use type instead of set in ShaderDescriptorSet. example "texture rect" can run OK.

This commit is contained in:
2021-06-22 17:39:15 +08:00
parent 2b70ee07c8
commit 713e76215c
6 changed files with 31 additions and 15 deletions

View File

@@ -34,9 +34,9 @@ void DescriptorSetLayoutCreater::Bind(const ShaderDescriptorList *sd_list,VkDesc
for(const ShaderDescriptor &sd:*sd_list)
{
all_set.Add(sd.set);
all_set.Add(sd.type);
++binding_count[sd.set];
++binding_count[(size_t)sd.type];
}
ENUM_CLASS_FOR(DescriptorSetType,int,i)
@@ -53,17 +53,17 @@ void DescriptorSetLayoutCreater::Bind(const ShaderDescriptorList *sd_list,VkDesc
//重复的绑定点是有可能存在的比如CameraInfo在vs/fs中同时存在
if(!all_binding.IsMember(sd.binding))
{
p[sd.set]->binding = sd.binding;
p[sd.set]->descriptorType = desc_type;
p[sd.set]->descriptorCount = 1;
p[sd.set]->stageFlags = stageFlags;
p[sd.set]->pImmutableSamplers = nullptr;
{
p[(size_t)sd.type]->binding = sd.binding;
p[(size_t)sd.type]->descriptorType = desc_type;
p[(size_t)sd.type]->descriptorCount = 1;
p[(size_t)sd.type]->stageFlags = stageFlags;
p[(size_t)sd.type]->pImmutableSamplers = nullptr;
all_binding.Add(sd.binding);
++p[sd.set];
++fin_count[sd.set];
++p[(size_t)sd.type];
++fin_count[(size_t)sd.type];
}
}

View File

@@ -15,7 +15,7 @@ class DescriptorSetLayoutCreater
VkDevice device;
VkDescriptorPool pool;
Sets<uint32_t> all_set;
Sets<DescriptorSetType> all_set;
Sets<uint32_t> all_binding;
struct ShaderDescriptorSet