diff --git a/inc/hgl/graph/vulkan/VKCommandBuffer.h b/inc/hgl/graph/vulkan/VKCommandBuffer.h index 5908082a..156b212b 100644 --- a/inc/hgl/graph/vulkan/VKCommandBuffer.h +++ b/inc/hgl/graph/vulkan/VKCommandBuffer.h @@ -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(); diff --git a/src/RenderDevice/Vulkan/VKCommandBuffer.cpp b/src/RenderDevice/Vulkan/VKCommandBuffer.cpp index 78159838..99b26368 100644 --- a/src/RenderDevice/Vulkan/VKCommandBuffer.cpp +++ b/src/RenderDevice/Vulkan/VKCommandBuffer.cpp @@ -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); }