From f2ba8ce16372bce4ffe6b32d5eaedca95d80ca15 Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Fri, 6 Jun 2025 17:09:59 -0400 Subject: [PATCH] binding buffer --- .../metal/src/core/commands/commands/metal_commands.m | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/rendering_api/metal/src/core/commands/commands/metal_commands.m b/rendering_api/metal/src/core/commands/commands/metal_commands.m index f7b8ddd..b402809 100644 --- a/rendering_api/metal/src/core/commands/commands/metal_commands.m +++ b/rendering_api/metal/src/core/commands/commands/metal_commands.m @@ -2,6 +2,7 @@ #include "core/framebuffers/metal_framebuffer.h" #include "core/commands/command_buffer/metal_command_buffer.h" #include "core/pipelines/graphics_pipeline/metal_graphics_pipeline.h" +#include "core/buffer/metal_buffer.h" #import void gnCommandBeginRenderPassFn(struct gnCommandBuffer_t* buffer, struct gnRenderPassInfo_t passInfo) { @@ -68,6 +69,12 @@ void gnCommandSetScissorFn(struct gnCommandBuffer_t* buffer, struct gnScissor_t id encoder = (id)buffer->commandBuffer->encoder; [encoder setScissorRect:scissorRect]; } +void gnCommandBindBufferFn(gnCommandBufferHandle buffer, gnBufferHandle bufferToBind, gnBufferType type) { + if (type == GN_VERTEX_BUFFER) { + id encoder = (id)buffer->commandBuffer->encoder; + [encoder setVertexBuffer:bufferToBind->buffer->buffer offset:0 atIndex:0]; + } +} void gnCommandDrawFn(struct gnCommandBuffer_t* buffer, int vertexCount, int firstVertex, int instanceCount, int firstInstance) { if (buffer->commandBuffer->boundGraphcisPipeline != NULL) { id encoder = (id)buffer->commandBuffer->encoder;