DescriptorSetLayoutCreater传入DescriptorSets的index_by_binding改为指针
This commit is contained in:
parent
9447ae7487
commit
bd59374f25
@ -11,7 +11,7 @@ class DescriptorSets
|
||||
Device *device;
|
||||
int count;
|
||||
VkDescriptorSet *desc_set_list;
|
||||
Map<uint32_t,int> index_by_binding;
|
||||
const Map<uint32_t,int> *index_by_binding;
|
||||
|
||||
VkPipelineLayout pipeline_layout;
|
||||
|
||||
@ -19,12 +19,11 @@ private:
|
||||
|
||||
friend class DescriptorSetLayoutCreater;
|
||||
|
||||
DescriptorSets(Device *dev,const int c,VkPipelineLayout pl,VkDescriptorSet *desc_set,Map<uint32_t,int> &bi)
|
||||
DescriptorSets(Device *dev,const int c,VkPipelineLayout pl,VkDescriptorSet *desc_set,const Map<uint32_t,int> *bi):index_by_binding(bi)
|
||||
{
|
||||
device=dev;
|
||||
count=c;
|
||||
desc_set_list=desc_set;
|
||||
index_by_binding=bi;
|
||||
pipeline_layout=pl;
|
||||
}
|
||||
|
||||
@ -34,7 +33,7 @@ public:
|
||||
|
||||
const uint32_t GetCount ()const{return count;}
|
||||
const VkDescriptorSet * GetDescriptorSets ()const{return desc_set_list;}
|
||||
VkDescriptorSet GetDescriptorSet (const uint32_t binding);
|
||||
VkDescriptorSet GetDescriptorSet (const uint32_t binding)const;
|
||||
const VkPipelineLayout GetPipelineLayout ()const{return pipeline_layout;}
|
||||
|
||||
bool UpdateUBO(const uint32_t binding,const VkDescriptorBufferInfo *buf_info);
|
||||
|
@ -126,6 +126,6 @@ DescriptorSets *DescriptorSetLayoutCreater::Create()
|
||||
return(nullptr);
|
||||
}
|
||||
|
||||
return(new DescriptorSets(device,count,pipeline_layout,desc_set,index_by_binding));
|
||||
return(new DescriptorSets(device,count,pipeline_layout,desc_set,&index_by_binding));
|
||||
}
|
||||
VK_NAMESPACE_END
|
@ -2,11 +2,11 @@
|
||||
#include<hgl/graph/vulkan/VKDevice.h>
|
||||
|
||||
VK_NAMESPACE_BEGIN
|
||||
VkDescriptorSet DescriptorSets::GetDescriptorSet(const uint32_t binding)
|
||||
VkDescriptorSet DescriptorSets::GetDescriptorSet(const uint32_t binding)const
|
||||
{
|
||||
int index;
|
||||
|
||||
if(!index_by_binding.Get(binding,index))
|
||||
if(!index_by_binding->Get(binding,index))
|
||||
return(nullptr);
|
||||
|
||||
return desc_set_list[index];
|
||||
|
Loading…
x
Reference in New Issue
Block a user