改进CommandBuffer::Bind(DescriptorSets *,使其支持绑定部分数据
This commit is contained in:
parent
c8131db208
commit
abe66192d6
@ -47,7 +47,7 @@ public:
|
||||
bool Begin();
|
||||
bool BeginRenderPass(RenderPass *rp,Framebuffer *fb);
|
||||
bool Bind(Pipeline *p);
|
||||
bool Bind(DescriptorSets *);
|
||||
bool Bind(DescriptorSets *,int first=0,int count=0);
|
||||
bool Bind(Renderable *);
|
||||
void EndRenderPass();
|
||||
bool End();
|
||||
|
@ -80,15 +80,19 @@ bool CommandBuffer::Bind(Pipeline *p)
|
||||
return(true);
|
||||
}
|
||||
|
||||
bool CommandBuffer::Bind(DescriptorSets *dsl)
|
||||
bool CommandBuffer::Bind(DescriptorSets *dsl,int first,int count)
|
||||
{
|
||||
if(!dsl)
|
||||
return(false);
|
||||
|
||||
const uint32_t count=dsl->GetCount();
|
||||
if(first<0)
|
||||
first=0;
|
||||
|
||||
if(count==0||first+count>dsl->GetCount())
|
||||
count=dsl->GetCount()-first;
|
||||
|
||||
if(count>0)
|
||||
vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,dsl->GetPipelineLayout(),0,count,dsl->GetDescriptorSets(),0,nullptr);
|
||||
vkCmdBindDescriptorSets(cmd_buf,VK_PIPELINE_BIND_POINT_GRAPHICS,dsl->GetPipelineLayout(),first,count,dsl->GetDescriptorSets(),0,nullptr);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user