layers: Removed duplicate dynamicOffsets from core_validation
authorTobin Ehlis <tobine@google.com>
Wed, 30 Mar 2016 15:32:19 +0000 (09:32 -0600)
committerTobin Ehlis <tobine@google.com>
Mon, 4 Apr 2016 15:07:17 +0000 (09:07 -0600)
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
layers/core_validation.h

index 52d04cb..0bf63aa 100644 (file)
@@ -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()");
index 9fe162a..3c3450d 100644 (file)
@@ -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;