From: Michael Lentine Date: Tue, 2 Feb 2016 22:47:58 +0000 (-0600) Subject: layers: Make sure fb render pass and secondary render pass are compatible. X-Git-Tag: submit/tizen/20181227.054638~3908 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9efcf135273f232baf2fe3fcd592209eda59a048;p=platform%2Fupstream%2FVulkan-Tools.git layers: Make sure fb render pass and secondary render pass are compatible. --- diff --git a/layers/draw_state.cpp b/layers/draw_state.cpp index 072a34c6..39855d3b 100644 --- a/layers/draw_state.cpp +++ b/layers/draw_state.cpp @@ -6292,10 +6292,20 @@ bool validateFramebuffer(layer_data* dev_data, VkCommandBuffer primaryBuffer, co } 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(secondary_fb), reinterpret_cast(primary_fb)); + if (secondary_fb != VK_NULL_HANDLE) { + if (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(secondary_fb), reinterpret_cast(primary_fb)); + } + auto fb_data = dev_data->frameBufferMap.find(secondary_fb); + if (fb_data == dev_data->frameBufferMap.end() || !fb_data->second) { + 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 invalid framebuffer %" PRIx64 ".", + (void*)secondaryBuffer, reinterpret_cast(secondary_fb)); + return skip_call; + } + skip_call |= validateRenderPassCompatibility(dev_data, secondaryBuffer, fb_data->second->renderPass, secondaryBuffer, pSubCB->beginInfo.pInheritanceInfo->renderPass); } return skip_call; }