From 5caf62b7be0b98a7509786bfa1d4d74df9245bc7 Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Tue, 19 Jan 2016 13:12:52 -0700 Subject: 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 --- layers/draw_state.cpp | 6 ++++++ layers/draw_state.h | 1 + 2 files changed, 7 insertions(+) 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 -- cgit v1.2.3