RenderCmdBuffer中记录的DescriptorBinding改为按SetType分类为多个
This commit is contained in:
parent
5e541e2f46
commit
55204779ba
@ -50,6 +50,8 @@ public:
|
||||
};//class VulkanCmdBuffer
|
||||
|
||||
class DescriptorBinding;
|
||||
using DescriptorBindingPtr=DescriptorBinding *;
|
||||
using DescriptorBindingArray=DescriptorBindingPtr[size_t(DescriptorSetType::RANGE_SIZE)];
|
||||
|
||||
class RenderCmdBuffer:public VulkanCmdBuffer
|
||||
{
|
||||
@ -61,7 +63,7 @@ class RenderCmdBuffer:public VulkanCmdBuffer
|
||||
RenderPassBeginInfo rp_begin;
|
||||
VkPipelineLayout pipeline_layout;
|
||||
|
||||
DescriptorBinding *desc_binding=nullptr;
|
||||
DescriptorBindingArray desc_binding{};
|
||||
|
||||
private:
|
||||
|
||||
@ -72,11 +74,11 @@ public:
|
||||
RenderCmdBuffer(const VulkanDevAttr *attr,VkCommandBuffer cb);
|
||||
~RenderCmdBuffer();
|
||||
|
||||
void SetDescriptorBinding(DescriptorBinding *db) { desc_binding=db; }
|
||||
bool SetDescriptorBinding(DescriptorBinding *);
|
||||
|
||||
bool End() override
|
||||
{
|
||||
desc_binding=nullptr;
|
||||
hgl_zero(desc_binding);
|
||||
|
||||
return VulkanCmdBuffer::End();
|
||||
}
|
||||
|
@ -24,6 +24,10 @@ class DescriptorBinding
|
||||
Map<AnsiString,DeviceBuffer *> ssbo_map;
|
||||
Map<AnsiString,Texture *> texture_map;
|
||||
|
||||
public:
|
||||
|
||||
const DescriptorSetType GetType()const{return set_type;}
|
||||
|
||||
public:
|
||||
|
||||
DescriptorBinding(const DescriptorSetType &dst)
|
||||
|
@ -25,6 +25,18 @@ RenderCmdBuffer::~RenderCmdBuffer()
|
||||
hgl_free(clear_values);
|
||||
}
|
||||
|
||||
bool RenderCmdBuffer::SetDescriptorBinding(DescriptorBinding *db)
|
||||
{
|
||||
if(!db)
|
||||
return(false);
|
||||
|
||||
const int index=int(db->GetType())-int(DescriptorSetType::BEGIN_RANGE);
|
||||
|
||||
desc_binding[index]=db;
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
void RenderCmdBuffer::SetClear()
|
||||
{
|
||||
if(cv_count>0)
|
||||
@ -91,8 +103,11 @@ bool RenderCmdBuffer::BindDescriptorSets(Material *mtl)
|
||||
{
|
||||
if(!mtl)return(false);
|
||||
|
||||
if(desc_binding)
|
||||
desc_binding->Bind(mtl);
|
||||
ENUM_CLASS_FOR(DescriptorSetType,int,i)
|
||||
{
|
||||
if(desc_binding[i])
|
||||
desc_binding[i]->Bind(mtl);
|
||||
}
|
||||
|
||||
{
|
||||
uint32_t count=0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user