diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-07-19 10:45:24 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-08-08 06:47:51 -0600 |
| commit | d9afb8ebecf2a62c4f2dbb828d2113abf613a2b2 (patch) | |
| tree | 6d379748f47730fc9c0655a74ce9c0c4f3dcba99 /layers/core_validation.cpp | |
| parent | 9b26b5a7f8ccab7dc640c0cef7804dc28352e6e8 (diff) | |
| download | usermoji-d9afb8ebecf2a62c4f2dbb828d2113abf613a2b2.tar.xz | |
layers: Remove duplicate framebuffer incompatible check
The existing DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE check was a duplicate
of a check performed a few lines earlier in the validateFramebuffer()
function.
Update the check in that function to use the DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE
enum and remove the duplicate check.
Diffstat (limited to 'layers/core_validation.cpp')
| -rw-r--r-- | layers/core_validation.cpp | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 0e82d05f..f3f2e0a9 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -9851,10 +9851,12 @@ static bool validateFramebuffer(layer_data *dev_data, VkCommandBuffer primaryBuf 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 0x%p which has a framebuffer 0x%" PRIx64 - " that is not compatible with the current framebuffer 0x%" PRIx64 ".", - (void *)secondaryBuffer, (uint64_t)(secondary_fb), (uint64_t)(primary_fb)); + DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE, "DS", + "vkCmdExecuteCommands() called w/ invalid secondary Cmd Buffer 0x%" PRIx64 + " which has a framebuffer 0x%" PRIx64 + " that is not the same as the primaryCB's current active framebuffer 0x%" PRIx64 ".", + reinterpret_cast<uint64_t &>(secondaryBuffer), reinterpret_cast<uint64_t &>(secondary_fb), + reinterpret_cast<uint64_t &>(primary_fb)); } auto fb = getFramebuffer(dev_data, secondary_fb); if (!fb) { @@ -9949,9 +9951,11 @@ CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, skip_call |= validateRenderPassCompatibility(dev_data, commandBuffer, pCB->activeRenderPass->pCreateInfo, pCommandBuffers[i], secondary_rp_node->pCreateInfo); } + // If framebuffer for secondary CB is not NULL, then it must match active FB from primaryCB skip_call |= validateFramebuffer(dev_data, commandBuffer, pCB, pCommandBuffers[i], pSubCB); } string errorString = ""; + // secondaryCB must have been created w/ RP compatible w/ primaryCB active renderpass if ((pCB->activeRenderPass->renderPass != secondary_rp_node->renderPass) && !verify_renderpass_compatibility(dev_data, pCB->activeRenderPass->pCreateInfo, secondary_rp_node->pCreateInfo, errorString)) { @@ -9963,19 +9967,6 @@ CmdExecuteCommands(VkCommandBuffer commandBuffer, uint32_t commandBuffersCount, (void *)pCommandBuffers[i], (uint64_t)pSubCB->beginInfo.pInheritanceInfo->renderPass, (void *)commandBuffer, (uint64_t)pCB->activeRenderPass->renderPass, errorString.c_str()); } - // If framebuffer for secondary CB is not NULL, then it must match FB from vkCmdBeginRenderPass() - // that this CB will be executed in AND framebuffer must have been created w/ RP compatible w/ renderpass - if (pSubCB->beginInfo.pInheritanceInfo->framebuffer) { - if (pSubCB->beginInfo.pInheritanceInfo->framebuffer != pCB->activeRenderPassBeginInfo.framebuffer) { - skip_call |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - (uint64_t)pCommandBuffers[i], __LINE__, DRAWSTATE_FRAMEBUFFER_INCOMPATIBLE, "DS", - "vkCmdExecuteCommands(): Secondary Command Buffer (0x%p) references framebuffer (0x%" PRIxLEAST64 - ") that does not match framebuffer (0x%" PRIxLEAST64 ") in active renderpass (0x%" PRIxLEAST64 ").", - (void *)pCommandBuffers[i], (uint64_t)pSubCB->beginInfo.pInheritanceInfo->framebuffer, - (uint64_t)pCB->activeRenderPassBeginInfo.framebuffer, (uint64_t)pCB->activeRenderPass->renderPass); - } - } } // TODO(mlentine): Move more logic into this method skip_call |= validateSecondaryCommandBufferState(dev_data, pCB, pSubCB); |
