From ba3ae2baedf3d744e54619d09e7dcbb44051867a Mon Sep 17 00:00:00 2001 From: Tobin Ehlis Date: Wed, 30 Mar 2016 09:32:19 -0600 Subject: [PATCH] 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. --- layers/core_validation.cpp | 47 ++++++++++++-------------------------- 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(set_node->set), i, - pCB->dynamicOffsets[dynOffsetIndex], pWDS->pBufferInfo[j].offset, + reinterpret_cast(set_node->set), i, dynOffset, + pWDS->pBufferInfo[j].offset, reinterpret_cast(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(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(set_node->set), i, pCB->dynamicOffsets[dynOffsetIndex], - pWDS->pBufferInfo[j].offset, pWDS->pBufferInfo[j].range, - reinterpret_cast(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(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(set_node->set), i, pCB->dynamicOffsets[dynOffsetIndex], - pWDS->pBufferInfo[j].offset, pWDS->pBufferInfo[j].range, - reinterpret_cast(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(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(set_node->set), i, dynOffset, + pWDS->pBufferInfo[j].offset, pWDS->pBufferInfo[j].range, + reinterpret_cast(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 dynamicOffsets; vector viewports; vector scissors; VkRenderPassBeginInfo activeRenderPassBeginInfo; -- 2.34.1