Added RenderCmdBuffer::Draw(const VertexInputData *)
This commit is contained in:
parent
9c6c37c07a
commit
a1bf9336a3
@ -225,12 +225,7 @@ public:
|
||||
cb->BindPipeline(ri->GetPipeline());
|
||||
cb->BindDescriptorSets(ri->GetMaterial());
|
||||
cb->BindVBO(ri);
|
||||
|
||||
if (vid->ib_access->buffer)
|
||||
cb->DrawIndexed(vid->ib_access->buffer->GetCount());
|
||||
else
|
||||
cb->Draw(vid->vertex_count);
|
||||
|
||||
cb->Draw(vid);
|
||||
cb->EndRenderPass();
|
||||
cb->End();
|
||||
|
||||
|
@ -54,6 +54,8 @@ class DeviceMemory;
|
||||
class DeviceBuffer;
|
||||
struct DeviceBufferData;
|
||||
|
||||
struct VertexInputData;
|
||||
|
||||
class 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 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
|
||||
};//class RenderCmdBuffer:public GPUCmdBuffer
|
||||
|
||||
|
@ -183,4 +183,12 @@ void RenderCmdBuffer::DrawIndexedIndirect( VkBuffer buffer,
|
||||
for(uint32_t i=0;i<drawCount;i++)
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user