diff --git a/inc/hgl/graph/vulkan/VKDescriptorSets.h b/inc/hgl/graph/vulkan/VKDescriptorSets.h index 6912e2e1..d5c7a477 100644 --- a/inc/hgl/graph/vulkan/VKDescriptorSets.h +++ b/inc/hgl/graph/vulkan/VKDescriptorSets.h @@ -40,6 +40,7 @@ public: void Clear(); bool BindUBO(const uint32_t binding,const VkDescriptorBufferInfo *); + bool BindUBODynamic(const uint32_t binding,const VkDescriptorBufferInfo *); bool BindSampler(const uint32_t binding,Texture *,Sampler *); void Update(); };//class DescriptorSets diff --git a/src/RenderDevice/Vulkan/VKDescriptorSets.cpp b/src/RenderDevice/Vulkan/VKDescriptorSets.cpp index 2754f297..c1d688f3 100644 --- a/src/RenderDevice/Vulkan/VKDescriptorSets.cpp +++ b/src/RenderDevice/Vulkan/VKDescriptorSets.cpp @@ -25,6 +25,21 @@ bool DescriptorSets::BindUBO(const uint32_t binding,const VkDescriptorBufferInfo return(true); } +bool DescriptorSets::BindUBODynamic(const uint32_t binding,const VkDescriptorBufferInfo *buf_info) +{ + VkWriteDescriptorSet writeDescriptorSet = {}; + + writeDescriptorSet.sType = VK_STRUCTURE_TYPE_WRITE_DESCRIPTOR_SET; + writeDescriptorSet.dstSet = desc_set; + writeDescriptorSet.descriptorCount = 1; + writeDescriptorSet.descriptorType = VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC; + writeDescriptorSet.pBufferInfo = buf_info; + writeDescriptorSet.dstBinding = binding; + + write_desc_sets.Add(writeDescriptorSet); + return(true); +} + bool DescriptorSets::BindSampler(const uint32_t binding,Texture *tex,Sampler *sampler) { if(!tex||!sampler)