VKRenderable and CommandBufferRender supported newly VertexInputLayout

This commit is contained in:
2023-05-04 19:11:18 +08:00
parent 6bdbf87446
commit 7031270476
9 changed files with 87 additions and 67 deletions

View File

@@ -138,13 +138,23 @@ bool RenderCmdBuffer::BindVBO(Renderable *ri)
if(!ri)
return(false);
const VertexInputData *vid=ri->GetVertexInputData();
uint count=0;
if(vid->count<=0)
ENUM_CLASS_FOR(VertexInputGroup,uint,i)
{
const VertexInputData *vid=ri->GetVertexInputData(VertexInputGroup(i));
if(vid->binding_count<=0)
continue;
vkCmdBindVertexBuffers(cmd_buf,vid->first_binding,vid->binding_count,vid->buffer_list,vid->buffer_offset);
count+=vid->binding_count;
}
if(count==0)
return(false);
vkCmdBindVertexBuffers(cmd_buf,0,vid->count,vid->buffer_list,vid->buffer_offset);
IndexBuffer *indices_buffer=ri->GetIndexBuffer();
if(indices_buffer)