aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobin Ehlis <tobine@google.com>2016-01-19 13:12:52 -0700
committerMark Lobodzinski <mark@lunarg.com>2016-01-19 13:56:13 -0700
commit5caf62b7be0b98a7509786bfa1d4d74df9245bc7 (patch)
treefc7aa956ed370fcd3503fe3d6c2588abb0e474f5
parent9a59eac57832b7f3dce9e2c11f150cebb50e368a (diff)
downloadusermoji-5caf62b7be0b98a7509786bfa1d4d74df9245bc7.tar.xz
layers: MR145/GL67, Correctly mirror command buffer inheritance info
Embedded InheritanceInfo struct within command buffer BeginInfo was not correctly mirrored in draw_state. Correctly copy this data as appropriate and correctly clear it when command buffer is reset. Conflicts: layers/draw_state.cpp
-rw-r--r--layers/draw_state.cpp6
-rwxr-xr-xlayers/draw_state.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp
index 62a34773..fd975ee3 100644
--- a/layers/draw_state.cpp
+++ b/layers/draw_state.cpp
@@ -2566,6 +2566,7 @@ static void resetCB(layer_data* my_data, const VkCommandBuffer cb)
// Reset CB state (note that createInfo is not cleared)
pCB->commandBuffer = cb;
memset(&pCB->beginInfo, 0, sizeof(VkCommandBufferBeginInfo));
+ memset(&pCB->inheritanceInfo, 0, sizeof(VkCommandBufferInheritanceInfo));
pCB->fence = 0;
pCB->numCmds = 0;
memset(pCB->drawCount, 0, NUM_DRAW_TYPES * sizeof(uint64_t));
@@ -4037,6 +4038,11 @@ VK_LAYER_EXPORT VKAPI_ATTR VkResult VKAPI_CALL vkBeginCommandBuffer(VkCommandBuf
// Set updated state here in case implicit reset occurs above
pCB->state = CB_RECORDING;
pCB->beginInfo = *pBeginInfo;
+
+ if (pCB->beginInfo.pInheritanceInfo) {
+ pCB->inheritanceInfo = *(pCB->beginInfo.pInheritanceInfo);
+ pCB->beginInfo.pInheritanceInfo = &pCB->inheritanceInfo;
+ }
} else {
skipCall |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, (uint64_t)commandBuffer, __LINE__, DRAWSTATE_INVALID_COMMAND_BUFFER, "DS",
"In vkBeginCommandBuffer() and unable to find CommandBuffer Node for CB %p!", (void*)commandBuffer);
diff --git a/layers/draw_state.h b/layers/draw_state.h
index 4f20d474..e2e8aebd 100755
--- a/layers/draw_state.h
+++ b/layers/draw_state.h
@@ -477,6 +477,7 @@ typedef struct _GLOBAL_CB_NODE {
VkCommandBuffer commandBuffer;
VkCommandBufferAllocateInfo createInfo;
VkCommandBufferBeginInfo beginInfo;
+ VkCommandBufferInheritanceInfo inheritanceInfo;
VkFence fence; // fence tracking this cmd buffer
VkDevice device; // device this DB belongs to
uint64_t numCmds; // number of cmds in this CB