diff options
| author | Tobin Ehlis <tobine@google.com> | 2017-01-04 09:21:17 -0700 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2017-01-04 15:05:18 -0700 |
| commit | 889f831f563078786947b0a07ccef09e6b86f6de (patch) | |
| tree | 672ab35764a64eb96692931387488ae09f564975 | |
| parent | 675424270e816e322459fdef408e813fa7abd2a7 (diff) | |
| download | usermoji-889f831f563078786947b0a07ccef09e6b86f6de.tar.xz | |
layers:Remove redundant checks
Remove duplicate checks from core_validation that are already handled
in object_tracker.
| -rw-r--r-- | layers/core_validation.cpp | 61 |
1 files changed, 23 insertions, 38 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 04a5fdd6..307cfd7f 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -7305,45 +7305,30 @@ BeginCommandBuffer(VkCommandBuffer commandBuffer, const VkCommandBufferBeginInfo commandBuffer, validation_error_map[VALIDATION_ERROR_00106]); } else { if (pBeginInfo->flags & VK_COMMAND_BUFFER_USAGE_RENDER_PASS_CONTINUE_BIT) { - if (!pInfo->renderPass) { // renderpass should NOT be null for a Secondary CB - skip_call |= - log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(commandBuffer), - __LINE__, VALIDATION_ERROR_00110, "DS", "vkBeginCommandBuffer(): Secondary Command Buffers " - "(0x%p) must specify a valid renderpass parameter. %s", - commandBuffer, validation_error_map[VALIDATION_ERROR_00110]); - } - if (!pInfo->framebuffer) { // framebuffer may be null for a Secondary CB, but this affects perf - skip_call |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_WARNING_BIT_EXT, VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, - reinterpret_cast<uint64_t>(commandBuffer), __LINE__, DRAWSTATE_BEGIN_CB_INVALID_STATE, "DS", - "vkBeginCommandBuffer(): Secondary Command Buffers (0x%p) may perform better if a " - "valid framebuffer parameter is specified.", - commandBuffer); - } else { - string errorString = ""; - auto framebuffer = getFramebufferState(dev_data, pInfo->framebuffer); - if (framebuffer) { - if ((framebuffer->createInfo.renderPass != pInfo->renderPass) && - !verify_renderpass_compatibility(dev_data, framebuffer->renderPassCreateInfo.ptr(), - getRenderPassState(dev_data, pInfo->renderPass)->createInfo.ptr(), - errorString)) { - // renderPass that framebuffer was created with must be compatible with local renderPass - skip_call |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, reinterpret_cast<uint64_t>(commandBuffer), - __LINE__, VALIDATION_ERROR_00112, "DS", - "vkBeginCommandBuffer(): Secondary Command " - "Buffer (0x%p) renderPass (0x%" PRIxLEAST64 ") is incompatible w/ framebuffer " - "(0x%" PRIxLEAST64 ") w/ render pass (0x%" PRIxLEAST64 ") due to: %s. %s", - commandBuffer, reinterpret_cast<const uint64_t &>(pInfo->renderPass), - reinterpret_cast<const uint64_t &>(pInfo->framebuffer), - reinterpret_cast<uint64_t &>(framebuffer->createInfo.renderPass), errorString.c_str(), - validation_error_map[VALIDATION_ERROR_00112]); - } - // Connect this framebuffer and its children to this cmdBuffer - AddFramebufferBinding(dev_data, cb_node, framebuffer); + // Object_tracker makes sure these objects are valid + assert(pInfo->renderPass); + assert(pInfo->framebuffer); + string errorString = ""; + auto framebuffer = getFramebufferState(dev_data, pInfo->framebuffer); + if (framebuffer) { + if ((framebuffer->createInfo.renderPass != pInfo->renderPass) && + !verify_renderpass_compatibility(dev_data, framebuffer->renderPassCreateInfo.ptr(), + getRenderPassState(dev_data, pInfo->renderPass)->createInfo.ptr(), + errorString)) { + // renderPass that framebuffer was created with must be compatible with local renderPass + skip_call |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_COMMAND_BUFFER_EXT, + reinterpret_cast<uint64_t>(commandBuffer), __LINE__, VALIDATION_ERROR_00112, "DS", + "vkBeginCommandBuffer(): Secondary Command " + "Buffer (0x%p) renderPass (0x%" PRIxLEAST64 ") is incompatible w/ framebuffer " + "(0x%" PRIxLEAST64 ") w/ render pass (0x%" PRIxLEAST64 ") due to: %s. %s", + commandBuffer, reinterpret_cast<const uint64_t &>(pInfo->renderPass), + reinterpret_cast<const uint64_t &>(pInfo->framebuffer), + reinterpret_cast<uint64_t &>(framebuffer->createInfo.renderPass), + errorString.c_str(), validation_error_map[VALIDATION_ERROR_00112]); } + // Connect this framebuffer and its children to this cmdBuffer + AddFramebufferBinding(dev_data, cb_node, framebuffer); } } if ((pInfo->occlusionQueryEnable == VK_FALSE || dev_data->enabled_features.occlusionQueryPrecise == VK_FALSE) && |
