Added RenderCmdBuffer::Draw(const VertexInputData *)
This commit is contained in:
parent
9c6c37c07a
commit
a1bf9336a3
@ -225,12 +225,7 @@ public:
|
|||||||
cb->BindPipeline(ri->GetPipeline());
|
cb->BindPipeline(ri->GetPipeline());
|
||||||
cb->BindDescriptorSets(ri->GetMaterial());
|
cb->BindDescriptorSets(ri->GetMaterial());
|
||||||
cb->BindVBO(ri);
|
cb->BindVBO(ri);
|
||||||
|
cb->Draw(vid);
|
||||||
if (vid->ib_access->buffer)
|
|
||||||
cb->DrawIndexed(vid->ib_access->buffer->GetCount());
|
|
||||||
else
|
|
||||||
cb->Draw(vid->vertex_count);
|
|
||||||
|
|
||||||
cb->EndRenderPass();
|
cb->EndRenderPass();
|
||||||
cb->End();
|
cb->End();
|
||||||
|
|
||||||
|
@ -54,6 +54,8 @@ class DeviceMemory;
|
|||||||
class DeviceBuffer;
|
class DeviceBuffer;
|
||||||
struct DeviceBufferData;
|
struct DeviceBufferData;
|
||||||
|
|
||||||
|
struct VertexInputData;
|
||||||
|
|
||||||
class VertexAttribBuffer;
|
class VertexAttribBuffer;
|
||||||
using VAB=VertexAttribBuffer;
|
using VAB=VertexAttribBuffer;
|
||||||
|
|
||||||
|
@ -200,6 +200,8 @@ public: //draw
|
|||||||
void DrawIndirect (VkBuffer buf, uint32_t drawCount,uint32_t stride=sizeof(VkDrawIndirectCommand )){return DrawIndirect( buf,0,drawCount,stride);}
|
void DrawIndirect (VkBuffer buf, uint32_t drawCount,uint32_t stride=sizeof(VkDrawIndirectCommand )){return DrawIndirect( buf,0,drawCount,stride);}
|
||||||
void DrawIndexedIndirect(VkBuffer buf, uint32_t drawCount,uint32_t stride=sizeof(VkDrawIndexedIndirectCommand )){return DrawIndexedIndirect( buf,0,drawCount,stride);}
|
void DrawIndexedIndirect(VkBuffer buf, uint32_t drawCount,uint32_t stride=sizeof(VkDrawIndexedIndirectCommand )){return DrawIndexedIndirect( buf,0,drawCount,stride);}
|
||||||
|
|
||||||
|
void Draw (const VertexInputData *vid);
|
||||||
|
|
||||||
public: //dynamic state
|
public: //dynamic state
|
||||||
};//class RenderCmdBuffer:public GPUCmdBuffer
|
};//class RenderCmdBuffer:public GPUCmdBuffer
|
||||||
|
|
||||||
|
@ -183,4 +183,12 @@ void RenderCmdBuffer::DrawIndexedIndirect( VkBuffer buffer,
|
|||||||
for(uint32_t i=0;i<drawCount;i++)
|
for(uint32_t i=0;i<drawCount;i++)
|
||||||
vkCmdDrawIndexedIndirect(cmd_buf,buffer,offset+i*stride,1,stride);
|
vkCmdDrawIndexedIndirect(cmd_buf,buffer,offset+i*stride,1,stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void RenderCmdBuffer::Draw(const VertexInputData *vid)
|
||||||
|
{
|
||||||
|
if (vid->ib_access->buffer)
|
||||||
|
DrawIndexed(vid->ib_access->buffer->GetCount());
|
||||||
|
else
|
||||||
|
Draw(vid->vertex_count);
|
||||||
|
}
|
||||||
VK_NAMESPACE_END
|
VK_NAMESPACE_END
|
||||||
|
Loading…
x
Reference in New Issue
Block a user