From e734acad002fcd6744eae72d574a9babac800eae Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 15 Jun 2021 17:46:38 +0800 Subject: [PATCH] deleted DescriptSetList/DescriptorBindingList. --- inc/hgl/graph/shader/ShaderResource.h | 2 -- .../Vulkan/VKDescriptorSetLayoutCreater.cpp | 24 ++----------------- .../Vulkan/VKDescriptorSetLayoutCreater.h | 6 ----- 3 files changed, 2 insertions(+), 30 deletions(-) diff --git a/inc/hgl/graph/shader/ShaderResource.h b/inc/hgl/graph/shader/ShaderResource.h index 934599f9..c8f1c96a 100644 --- a/inc/hgl/graph/shader/ShaderResource.h +++ b/inc/hgl/graph/shader/ShaderResource.h @@ -41,8 +41,6 @@ struct ShaderStage };//struct ShaderStage using ShaderStageList =ObjectList; -using DescriptorSetList =List; -using DescriptorBindingList =List; struct ShaderDescriptor { diff --git a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp index 1fa4dd35..9e1b3341 100644 --- a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp +++ b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp @@ -17,28 +17,6 @@ DescriptorSetLayoutCreater::~DescriptorSetLayoutCreater() vkDestroyDescriptorSetLayout(device,dsl,nullptr); } -//单个版本,暂时用不到 -//void DescriptorSetLayoutCreater::Bind(const uint32_t binding,VkDescriptorType desc_type,VkShaderStageFlagBits stageFlags) -//{ -// if(index_by_binding.KeyExist(binding)) -// { -// //重复的绑定点,有可能存在的,比如CameraMatrix在vs/fs中同时存在 -// return; -// } -// -// VkDescriptorSetLayoutBinding layout_binding; -// -// layout_binding.binding = binding; -// layout_binding.descriptorType = desc_type; -// layout_binding.descriptorCount = 1; -// layout_binding.stageFlags = stageFlags; -// layout_binding.pImmutableSamplers = nullptr; -// -// const int index=layout_binding_list.Add(layout_binding); -// -// index_by_binding.Add(binding,index); -//} - void DescriptorSetLayoutCreater::Bind(const ShaderDescriptorList *sd_list,VkDescriptorType desc_type,VkShaderStageFlagBits stageFlags) { if(!sd_list||sd_list->GetCount()<=0)return; @@ -55,6 +33,8 @@ void DescriptorSetLayoutCreater::Bind(const ShaderDescriptorList *sd_list,VkDesc for(const ShaderDescriptor &sd:*sd_list) { + //重复的绑定点是有可能存在的,比如CameraInfo在vs/fs中同时存在 + if((!index_by_binding.KeyExist(sd.binding)) &&(!index_by_binding_ri.KeyExist(sd.binding))) { diff --git a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h index 0e0d5319..027e333b 100644 --- a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h +++ b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h @@ -26,13 +26,7 @@ public: DescriptorSetLayoutCreater(VkDevice dev,VkDescriptorPool dp){device=dev;pool=dp;} ~DescriptorSetLayoutCreater(); -// void Bind(const uint32_t binding,VkDescriptorType,VkShaderStageFlagBits); //单个版本,暂时用不到 void Bind(const ShaderDescriptorList *sd_list,VkDescriptorType type,VkShaderStageFlagBits stage); - //void Bind(const DescriptorBindingList &dbl,VkDescriptorType type,VkShaderStageFlagBits stage) - //{ - // if(dbl.GetCount()>0) - // Bind(dbl.GetData(),dbl.GetCount(),type,stage); - //} void Bind(const ShaderDescriptorList *sdl,VkShaderStageFlagBits stage) {