add BindSSBO functions at VKDescriptorSets
This commit is contained in:
parent
3fa5c3c032
commit
4b8ccbed17
@ -43,6 +43,8 @@ public:
|
|||||||
|
|
||||||
bool BindUBO(const int binding,const GPUBuffer *buf,bool dynamic=false);
|
bool BindUBO(const int binding,const GPUBuffer *buf,bool dynamic=false);
|
||||||
bool BindUBO(const int binding,const GPUBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic=false);
|
bool BindUBO(const int binding,const GPUBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic=false);
|
||||||
|
bool BindSSBO(const int binding,const GPUBuffer *buf,bool dynamic=false);
|
||||||
|
bool BindSSBO(const int binding,const GPUBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic=false);
|
||||||
|
|
||||||
bool BindSampler(const int binding,Texture *,Sampler *);
|
bool BindSampler(const int binding,Texture *,Sampler *);
|
||||||
bool BindInputAttachment(const int binding,Texture *);
|
bool BindInputAttachment(const int binding,Texture *);
|
||||||
|
@ -20,9 +20,7 @@ namespace
|
|||||||
descriptorType = desc_type;
|
descriptorType = desc_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
WriteDescriptorSet(VkDescriptorSet desc_set,const uint32_t binding,const VkDescriptorBufferInfo *buf_info,const bool dynamic):
|
WriteDescriptorSet(VkDescriptorSet desc_set,const uint32_t binding,const VkDescriptorBufferInfo *buf_info,const VkDescriptorType desc_type):WriteDescriptorSet(desc_set,binding,desc_type)
|
||||||
WriteDescriptorSet(desc_set,binding,dynamic?VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:
|
|
||||||
VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER)
|
|
||||||
{
|
{
|
||||||
pImageInfo = nullptr;
|
pImageInfo = nullptr;
|
||||||
pBufferInfo = buf_info;
|
pBufferInfo = buf_info;
|
||||||
@ -74,7 +72,9 @@ bool DescriptorSets::BindUBO(const int binding,const GPUBuffer *buf,bool dynamic
|
|||||||
if(binding<0||!buf)
|
if(binding<0||!buf)
|
||||||
return(false);
|
return(false);
|
||||||
|
|
||||||
wds_list.Add(WriteDescriptorSet(desc_set,binding,buf->GetBufferInfo(),dynamic));
|
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
||||||
|
|
||||||
|
wds_list.Add(WriteDescriptorSet(desc_set,binding,buf->GetBufferInfo(),desc_type));
|
||||||
|
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
@ -88,7 +88,36 @@ bool DescriptorSets::BindUBO(const int binding,const GPUBuffer *buf,const VkDevi
|
|||||||
|
|
||||||
buffer_list.Add(buf_info);
|
buffer_list.Add(buf_info);
|
||||||
|
|
||||||
wds_list.Add(WriteDescriptorSet(desc_set,binding,buf_info,dynamic));
|
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER;
|
||||||
|
|
||||||
|
wds_list.Add(WriteDescriptorSet(desc_set,binding,buf_info,desc_type));
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DescriptorSets::BindSSBO(const int binding,const GPUBuffer *buf,bool dynamic)
|
||||||
|
{
|
||||||
|
if(binding<0||!buf)
|
||||||
|
return(false);
|
||||||
|
|
||||||
|
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
|
||||||
|
|
||||||
|
wds_list.Add(WriteDescriptorSet(desc_set,binding,buf->GetBufferInfo(),desc_type));
|
||||||
|
|
||||||
|
return(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DescriptorSets::BindSSBO(const int binding,const GPUBuffer *buf,const VkDeviceSize offset,const VkDeviceSize range,bool dynamic)
|
||||||
|
{
|
||||||
|
if(binding<0||!buf)
|
||||||
|
return(false);
|
||||||
|
|
||||||
|
DescriptorBufferInfo *buf_info=new DescriptorBufferInfo(buf,offset,range);
|
||||||
|
|
||||||
|
buffer_list.Add(buf_info);
|
||||||
|
|
||||||
|
const VkDescriptorType desc_type=dynamic?VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC:VK_DESCRIPTOR_TYPE_STORAGE_BUFFER;
|
||||||
|
|
||||||
|
wds_list.Add(WriteDescriptorSet(desc_set,binding,buf_info,desc_type));
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user