Handle variable sized descriptor sets in FetchShaderFeedback

For variable sized descriptor sets compute feedbackStorageSize using the active descriptor set layout instead of the creation time data.
This commit is contained in:
Jake Turner
2023-11-01 14:53:06 +00:00
parent 3fbf060894
commit bbd1fe6243
+20 -2
View File
@@ -1573,6 +1573,9 @@ bool VulkanReplay::FetchShaderFeedback(uint32_t eventId)
if(pipeLayouts[i] == ResourceId())
continue;
const rdcarray<VulkanStatePipeline::DescriptorAndOffsets> &descSets =
(result.compute ? state.compute.descSets : state.graphics.descSets);
rdcspv::Binding key;
for(size_t set = 0; set < pipeInfo.descSetLayouts.size(); set++)
@@ -1593,11 +1596,26 @@ bool VulkanReplay::FetchShaderFeedback(uint32_t eventId)
if(bindData.descriptorCount > 1 &&
bindData.layoutDescType != VK_DESCRIPTOR_TYPE_INLINE_UNIFORM_BLOCK)
{
uint32_t descriptorCount = bindData.descriptorCount;
if(bindData.variableSize)
{
if(set < descSets.size())
{
ResourceId descSet = descSets[set].descSet;
if(descSet != ResourceId())
{
auto it = m_pDriver->m_DescriptorSetState.find(descSet);
if(it != m_pDriver->m_DescriptorSetState.end())
descriptorCount = it->second.data.variableDescriptorCount;
}
}
}
key.binding = (uint32_t)binding;
offsetMap[key] = {feedbackStorageSize, bindData.descriptorCount};
offsetMap[key] = {feedbackStorageSize, descriptorCount};
feedbackStorageSize += bindData.descriptorCount * sizeof(uint32_t);
feedbackStorageSize += descriptorCount * sizeof(uint32_t);
}
}
}