mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-07-29 02:41:08 +00:00
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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user