diff options
| author | Tobin Ehlis <tobine@google.com> | 2016-03-30 09:32:19 -0600 |
|---|---|---|
| committer | Tobin Ehlis <tobine@google.com> | 2016-04-04 09:07:17 -0600 |
| commit | ba3ae2baedf3d744e54619d09e7dcbb44051867a (patch) | |
| tree | d8a63c5d6d3948e97f163523d5302a6162646222 | |
| parent | a88c4b896a0fa25c9935071bfac96f5c5581ad41 (diff) | |
| download | usermoji-ba3ae2baedf3d744e54619d09e7dcbb44051867a.tar.xz | |
layers: Removed duplicate dynamicOffsets from core_validation
Missed this from a rebase conflict. Kill top-level cmd buffer node
dynamicOffsets vector and only use vector based off of lastBound data.
| -rw-r--r-- | layers/core_validation.cpp | 47 | ||||
| -rw-r--r-- | layers/core_validation.h | 1 |
2 files changed, 15 insertions, 33 deletions
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp index 52d04cb1..0bf63aa1 100644 --- a/layers/core_validation.cpp +++ b/layers/core_validation.cpp @@ -2821,36 +2821,23 @@ static VkBool32 validate_and_update_drawtime_descriptor_state( "VK_WHOLE_SIZE but dynamic offset %#" PRIxLEAST32 ". " "combined with offset %#" PRIxLEAST64 " oversteps its buffer (%#" PRIxLEAST64 ") which has a size of %#" PRIxLEAST64 ".", - reinterpret_cast<const uint64_t &>(set_node->set), i, - pCB->dynamicOffsets[dynOffsetIndex], pWDS->pBufferInfo[j].offset, + reinterpret_cast<const uint64_t &>(set_node->set), i, dynOffset, + pWDS->pBufferInfo[j].offset, reinterpret_cast<const uint64_t &>(pWDS->pBufferInfo[j].buffer), bufferSize); } } else if ((dynOffset + pWDS->pBufferInfo[j].offset + pWDS->pBufferInfo[j].range) > bufferSize) { - result |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - reinterpret_cast<const uint64_t &>(set_node->set), __LINE__, DRAWSTATE_DYNAMIC_OFFSET_OVERFLOW, - "DS", - "VkDescriptorSet (%#" PRIxLEAST64 ") bound as set #%u has dynamic offset %#" PRIxLEAST32 ". " - "Combined with offset %#" PRIxLEAST64 " and range %#" PRIxLEAST64 - " from its update, this oversteps its buffer " - "(%#" PRIxLEAST64 ") which has a size of %#" PRIxLEAST64 ".", - reinterpret_cast<const uint64_t &>(set_node->set), i, pCB->dynamicOffsets[dynOffsetIndex], - pWDS->pBufferInfo[j].offset, pWDS->pBufferInfo[j].range, - reinterpret_cast<const uint64_t &>(pWDS->pBufferInfo[j].buffer), bufferSize); - } else if ((dynOffset + pWDS->pBufferInfo[j].offset + pWDS->pBufferInfo[j].range) > bufferSize) { - result |= log_msg( - dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, - VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, - reinterpret_cast<const uint64_t &>(set_node->set), __LINE__, DRAWSTATE_DYNAMIC_OFFSET_OVERFLOW, - "DS", - "VkDescriptorSet (%#" PRIxLEAST64 ") bound as set #%u has dynamic offset %#" PRIxLEAST32 ". " - "Combined with offset %#" PRIxLEAST64 " and range %#" PRIxLEAST64 - " from its update, this oversteps its buffer " - "(%#" PRIxLEAST64 ") which has a size of %#" PRIxLEAST64 ".", - reinterpret_cast<const uint64_t &>(set_node->set), i, pCB->dynamicOffsets[dynOffsetIndex], - pWDS->pBufferInfo[j].offset, pWDS->pBufferInfo[j].range, - reinterpret_cast<const uint64_t &>(pWDS->pBufferInfo[j].buffer), bufferSize); + result |= log_msg(dev_data->report_data, VK_DEBUG_REPORT_ERROR_BIT_EXT, + VK_DEBUG_REPORT_OBJECT_TYPE_DESCRIPTOR_SET_EXT, + reinterpret_cast<const uint64_t &>(set_node->set), __LINE__, + DRAWSTATE_DYNAMIC_OFFSET_OVERFLOW, "DS", + "VkDescriptorSet (%#" PRIxLEAST64 + ") bound as set #%u has dynamic offset %#" PRIxLEAST32 ". " + "Combined with offset %#" PRIxLEAST64 " and range %#" PRIxLEAST64 + " from its update, this oversteps its buffer " + "(%#" PRIxLEAST64 ") which has a size of %#" PRIxLEAST64 ".", + reinterpret_cast<const uint64_t &>(set_node->set), i, dynOffset, + pWDS->pBufferInfo[j].offset, pWDS->pBufferInfo[j].range, + reinterpret_cast<const uint64_t &>(pWDS->pBufferInfo[j].buffer), bufferSize); } dynOffsetIndex++; } @@ -7500,10 +7487,6 @@ vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipel pCB->lastBound[pipelineBindPoint].boundDescriptorSets.resize(lastSetIndex + 1); } } - // Save dynamicOffsets bound to this CB - for (uint32_t i = 0; i < dynamicOffsetCount; i++) { - pCB->lastBound[pipelineBindPoint].dynamicOffsets.push_back(pDynamicOffsets[i]); - } } // dynamicOffsetCount must equal the total number of dynamic descriptors in the sets being bound if (totalDynamicDescriptors != dynamicOffsetCount) { @@ -7516,7 +7499,7 @@ vkCmdBindDescriptorSets(VkCommandBuffer commandBuffer, VkPipelineBindPoint pipel } // Save dynamicOffsets bound to this CB for (uint32_t i = 0; i < dynamicOffsetCount; i++) { - pCB->dynamicOffsets.emplace_back(pDynamicOffsets[i]); + pCB->lastBound[pipelineBindPoint].dynamicOffsets.emplace_back(pDynamicOffsets[i]); } } else { skipCall |= report_error_no_cb_begin(dev_data, commandBuffer, "vkCmdBindDescriptorSets()"); diff --git a/layers/core_validation.h b/layers/core_validation.h index 9fe162a4..3c3450d9 100644 --- a/layers/core_validation.h +++ b/layers/core_validation.h @@ -874,7 +874,6 @@ struct GLOBAL_CB_NODE { // Store last bound state for Gfx & Compute pipeline bind points LAST_BOUND_STATE lastBound[VK_PIPELINE_BIND_POINT_RANGE_SIZE]; - vector<uint32_t> dynamicOffsets; vector<VkViewport> viewports; vector<VkRect2D> scissors; VkRenderPassBeginInfo activeRenderPassBeginInfo; |
