diff options
| author | Michael Lentine <mlentine@google.com> | 2016-02-02 15:24:27 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-02-04 11:17:40 -0700 |
| commit | ee73d499441ed22413fe925a4f0629be869da52c (patch) | |
| tree | 8c90336471db59561b07b8c15be13eee3c092c3e /layers/draw_state.cpp | |
| parent | a1e93ee2503c44b71c43e0cfbcd83b934f2ae47e (diff) | |
| download | usermoji-ee73d499441ed22413fe925a4f0629be869da52c.tar.xz | |
layers: Validate that the framebuffer specified in the secondary command buffer is the same as the current one.
Diffstat (limited to 'layers/draw_state.cpp')
| -rw-r--r-- | layers/draw_state.cpp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 0b3cda46..072a34c6 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -6285,6 +6285,21 @@ bool validateRenderPassCompatibility(layer_data* dev_data, VkCommandBuffer prima return skip_call; } +bool validateFramebuffer(layer_data* dev_data, VkCommandBuffer primaryBuffer, const GLOBAL_CB_NODE* pCB, VkCommandBuffer secondaryBuffer, const GLOBAL_CB_NODE* pSubCB) { + bool skip_call = false; + if (!pSubCB->beginInfo.pInheritanceInfo) { + return skip_call; + } + VkFramebuffer primary_fb = pCB->framebuffer; + VkFramebuffer secondary_fb = pSubCB->beginInfo.pInheritanceInfo->framebuffer; + if (secondary_fb != VK_NULL_HANDLE && primary_fb != secondary_fb) { + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, (VkDebugReportObjectTypeEXT) 0, 0, __LINE__, DRAWSTATE_INVALID_SECONDARY_COMMAND_BUFFER, "DS", + "vkCmdExecuteCommands() called w/ invalid Cmd Buffer %p which has a framebuffer %" PRIx64 " that is not compatible with the current framebuffer %" PRIx64 ".", + (void*)secondaryBuffer, reinterpret_cast<uint64_t>(secondary_fb), reinterpret_cast<uint64_t>(primary_fb)); + } + return skip_call; +} + VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, const VkCommandBuffer* pCommandBuffers) { VkBool32 skipCall = VK_FALSE; @@ -6307,6 +6322,7 @@ VK_LAYER_EXPORT VKAPI_ATTR void VKAPI_CALL vkCmdExecuteCommands(VkCommandBuffer } else { // Make sure render pass is compatible with parent command buffer pass if has continue skipCall |= validateRenderPassCompatibility(dev_data, commandBuffer, pCB->activeRenderPass, pCommandBuffers[i], pSubCB->beginInfo.pInheritanceInfo->renderPass); + skipCall |= validateFramebuffer(dev_data, commandBuffer, pCB, pCommandBuffers[i], pSubCB); } string errorString = ""; if (!verify_renderpass_compatibility(dev_data, pCB->activeRenderPass, pSubCB->beginInfo.pInheritanceInfo->renderPass, errorString)) { |
