From ef3a8be58c3278851b063afd1d9041825ec903ae Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 15 Jun 2021 19:03:15 +0800 Subject: [PATCH] added Global DescriptorSetType --- src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp | 7 +++++++ src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp index 0c1a78c1..f7d9359b 100644 --- a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp +++ b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.cpp @@ -48,6 +48,10 @@ void DescriptorSetLayoutCreater::Bind(const ShaderDescriptorList *sd_list,VkDesc &&sd.name[1]=='i' &&sd.name[2]=='_') index_by_binding_ri.Add(sd.binding,fin_count+old_count); + else + if(sd.name[0]=='g' + &&sd.name[1]=='_') + index_by_binding_global.Add(sd.binding,fin_count+old_count); else index_by_binding.Add(sd.binding,fin_count+old_count); @@ -122,6 +126,9 @@ DescriptorSets *DescriptorSetLayoutCreater::Create(const DescriptorSetType &type else if(type==DescriptorSetType::Renderable) return(new DescriptorSets(device,count,pipeline_layout,desc_set,&index_by_binding_ri)); + else + if(type==DescriptorSetType::Global) + return(new DescriptorSets(device,count,pipeline_layout,desc_set,&index_by_binding_global)); else return(nullptr); } diff --git a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h index e0102a46..41cb1fdb 100644 --- a/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h +++ b/src/SceneGraph/Vulkan/VKDescriptorSetLayoutCreater.h @@ -10,6 +10,7 @@ enum class DescriptorSetType { Material=0, Renderable, + Global, };// /** @@ -24,6 +25,7 @@ class DescriptorSetLayoutCreater VkDescriptorSetLayout dsl=VK_NULL_HANDLE; BindingMapping index_by_binding; BindingMapping index_by_binding_ri; + BindingMapping index_by_binding_global; VkPipelineLayout pipeline_layout=VK_NULL_HANDLE;