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.
diff --git a/layers/core_validation.cpp b/layers/core_validation.cpp
index 52d04cb..0bf63aa 100644
--- a/layers/core_validation.cpp
+++ b/layers/core_validation.cpp
@@ -2821,36 +2821,23 @@
"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 @@
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 @@
}
// 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 9fe162a..3c3450d 100644
--- a/layers/core_validation.h
+++ b/layers/core_validation.h
@@ -874,7 +874,6 @@
// 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;