Vulkan: Implement Draw* commands
This commit is contained in:
parent
88d85fbaac
commit
49450b5644
|
@ -114,6 +114,21 @@ namespace backend { namespace vulkan {
|
|||
dstBuffer, 1, ®ion);
|
||||
} break;
|
||||
|
||||
case Command::DrawArrays: {
|
||||
DrawArraysCmd* draw = mCommands.NextCommand<DrawArraysCmd>();
|
||||
|
||||
device->fn.CmdDraw(commands, draw->vertexCount, draw->instanceCount,
|
||||
draw->firstVertex, draw->firstInstance);
|
||||
} break;
|
||||
|
||||
case Command::DrawElements: {
|
||||
DrawElementsCmd* draw = mCommands.NextCommand<DrawElementsCmd>();
|
||||
|
||||
uint32_t vertexOffset = 0;
|
||||
device->fn.CmdDrawIndexed(commands, draw->indexCount, draw->instanceCount,
|
||||
draw->firstIndex, vertexOffset, draw->firstInstance);
|
||||
} break;
|
||||
|
||||
case Command::SetIndexBuffer: {
|
||||
SetIndexBufferCmd* cmd = mCommands.NextCommand<SetIndexBufferCmd>();
|
||||
VkBuffer indexBuffer = ToBackend(cmd->buffer)->GetHandle();
|
||||
|
|
Loading…
Reference in New Issue