Don't mark unused binds with 0 stageFlags

* It's a reasonable mistake for someone to have a bind they care about with 0
  stageFlags
This commit is contained in:
baldurk
2020-07-06 12:16:17 +01:00
parent 5891a950ca
commit 5aed791c13
6 changed files with 8 additions and 6 deletions
@@ -595,7 +595,7 @@ void VulkanReplay::FetchShaderFeedback(uint32_t eventId)
const DescSetLayout::Binding &bindData = layout.bindings[binding];
// skip empty bindings
if(bindData.descriptorCount == 0 || bindData.stageFlags == 0)
if(bindData.descriptorType == VK_DESCRIPTOR_TYPE_MAX_ENUM)
continue;
// only process array bindings
+1
View File
@@ -4038,6 +4038,7 @@ void WrappedVulkan::AddUsage(VulkanDrawcallTreeNode &drawNode, rdcarray<DebugMes
if(slot.bufferInfo.buffer != ResourceId())
id = slot.bufferInfo.buffer;
break;
case VK_DESCRIPTOR_TYPE_MAX_ENUM: break;
default: RDCERR("Unexpected type %d", layout.bindings[bind].descriptorType); break;
}
+2 -2
View File
@@ -1927,7 +1927,7 @@ void VulkanReplay::PatchReservedDescriptors(const VulkanStatePipeline &pipe,
const DescSetLayout::Binding &bind = origLayout.bindings[b];
// skip empty bindings
if(bind.descriptorCount == 0 || bind.stageFlags == 0)
if(bind.descriptorType == VK_DESCRIPTOR_TYPE_MAX_ENUM)
continue;
// make room in the pool
@@ -2123,7 +2123,7 @@ void VulkanReplay::PatchReservedDescriptors(const VulkanStatePipeline &pipe,
const DescSetLayout::Binding &bind = origLayout.bindings[b];
// skip empty bindings
if(bind.descriptorCount == 0 || bind.stageFlags == 0)
if(bind.descriptorType == VK_DESCRIPTOR_TYPE_MAX_ENUM)
continue;
DescriptorSetSlot *slot = setInfo.currentBindings[b];
+2 -2
View File
@@ -82,8 +82,8 @@ struct DescSetLayout
// some elements could be untouched. We set stageFlags to 0 so the UI ignores these
// elements
Binding()
: descriptorType(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER),
descriptorCount(1),
: descriptorType(VK_DESCRIPTOR_TYPE_MAX_ENUM),
descriptorCount(0),
stageFlags(0),
immutableSampler(NULL)
{
+1
View File
@@ -1663,6 +1663,7 @@ void VulkanReplay::SavePipelineState(uint32_t eventId)
dst.bindings[b].descriptorCount = 1;
dst.bindings[b].type = BindType::ConstantBuffer;
break;
case VK_DESCRIPTOR_TYPE_MAX_ENUM: dst.bindings[b].type = BindType::Unknown; break;
default: dst.bindings[b].type = BindType::Unknown; RDCERR("Unexpected descriptor type");
}
+1 -1
View File
@@ -455,7 +455,7 @@ void VulkanRenderState::BindDescriptorSet(WrappedVulkan *vk, const DescSetLayout
const DescSetLayout::Binding &bind = descLayout.bindings[b];
// skip if this binding isn't used
if(bind.descriptorCount == 0 || bind.stageFlags == 0)
if(bind.descriptorType == VK_DESCRIPTOR_TYPE_MAX_ENUM)
continue;
// push.dstSet; // unused for push descriptors