diff options
| author | Chia-I Wu <olv@lunarg.com> | 2015-01-05 13:42:56 +0800 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-02-04 17:58:04 -0700 |
| commit | 1ce97950e5c3a8f451eb39835a95e75876d0e5d3 (patch) | |
| tree | a4a4827a5688a7eb85360affe53e92b3835092fa | |
| parent | af4c1e1f5504eb70f546ad1ee9bc265c42d7e4bc (diff) | |
| download | usermoji-1ce97950e5c3a8f451eb39835a95e75876d0e5d3.tar.xz | |
layers: intercept xglCmdBindVertexData() in DrawState and MemTracker
| -rw-r--r-- | layers/draw_state.c | 2 | ||||
| -rw-r--r-- | layers/mem_tracker.c | 15 |
2 files changed, 15 insertions, 2 deletions
diff --git a/layers/draw_state.c b/layers/draw_state.c index c821a1d4..e8f432cf 100644 --- a/layers/draw_state.c +++ b/layers/draw_state.c @@ -2039,6 +2039,8 @@ XGL_LAYER_EXPORT XGL_VOID* XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL return xglCmdBindDescriptorSet; else if (!strncmp("xglCmdBindDynamicMemoryView", funcName, sizeof("xglCmdBindDynamicMemoryView"))) return xglCmdBindDynamicMemoryView; + else if (!strncmp("xglCmdBindVertexData", funcName, sizeof("xglCmdBindVertexData"))) + return xglCmdBindVertexData; else if (!strncmp("xglCmdBindIndexData", funcName, sizeof("xglCmdBindIndexData"))) return xglCmdBindIndexData; else if (!strncmp("xglCmdBindAttachments", funcName, sizeof("xglCmdBindAttachments"))) diff --git a/layers/mem_tracker.c b/layers/mem_tracker.c index a49b5433..a846308f 100644 --- a/layers/mem_tracker.c +++ b/layers/mem_tracker.c @@ -862,8 +862,6 @@ static void initMemTracker() GetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr"); nextTable.GetProcAddr = fpGetProcAddr; - - nextTable.CmdBindVertexData = NULL; } @@ -1449,6 +1447,17 @@ XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindDynamicMemoryView(XGL_CMD_BUFFER cmdB nextTable.CmdBindDynamicMemoryView(cmdBuffer, pipelineBindPoint, pMemView); } +XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindVertexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT binding) +{ + // Track this memory. What exactly is this call doing? + if (XGL_FALSE == updateCBBinding(cmdBuffer, mem)) { + char str[1024]; + sprintf(str, "In xglCmdBindVertexData() call unable to update binding of mem %p to cmdBuffer %p", mem, cmdBuffer); + layerCbMsg(XGL_DBG_MSG_ERROR, XGL_VALIDATION_LEVEL_0, cmdBuffer, 0, MEMTRACK_MEMORY_BINDING_ERROR, "MEM", str); + } + nextTable.CmdBindVertexData(cmdBuffer, mem, offset, binding); +} + XGL_LAYER_EXPORT XGL_VOID XGLAPI xglCmdBindIndexData(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType) { // Track this memory. What exactly is this call doing? @@ -2036,6 +2045,8 @@ XGL_LAYER_EXPORT XGL_VOID* XGLAPI xglGetProcAddr(XGL_PHYSICAL_GPU gpu, const XGL return xglCmdBindDescriptorSet; else if (!strncmp("xglCmdBindDynamicMemoryView", funcName, sizeof("xglCmdBindDynamicMemoryView"))) return xglCmdBindDynamicMemoryView; + else if (!strncmp("xglCmdBindVertexData", funcName, sizeof("xglCmdBindVertexData"))) + return xglCmdBindVertexData; else if (!strncmp("xglCmdBindIndexData", funcName, sizeof("xglCmdBindIndexData"))) return xglCmdBindIndexData; else if (!strncmp("xglCmdBindAttachments", funcName, sizeof("xglCmdBindAttachments"))) |
