binding buffer
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
#include "core/framebuffers/metal_framebuffer.h"
|
#include "core/framebuffers/metal_framebuffer.h"
|
||||||
#include "core/commands/command_buffer/metal_command_buffer.h"
|
#include "core/commands/command_buffer/metal_command_buffer.h"
|
||||||
#include "core/pipelines/graphics_pipeline/metal_graphics_pipeline.h"
|
#include "core/pipelines/graphics_pipeline/metal_graphics_pipeline.h"
|
||||||
|
#include "core/buffer/metal_buffer.h"
|
||||||
#import <Metal/MTLRenderCommandEncoder.h>
|
#import <Metal/MTLRenderCommandEncoder.h>
|
||||||
|
|
||||||
void gnCommandBeginRenderPassFn(struct gnCommandBuffer_t* buffer, struct gnRenderPassInfo_t passInfo) {
|
void gnCommandBeginRenderPassFn(struct gnCommandBuffer_t* buffer, struct gnRenderPassInfo_t passInfo) {
|
||||||
@@ -68,6 +69,12 @@ void gnCommandSetScissorFn(struct gnCommandBuffer_t* buffer, struct gnScissor_t
|
|||||||
id<MTLRenderCommandEncoder> encoder = (id<MTLRenderCommandEncoder>)buffer->commandBuffer->encoder;
|
id<MTLRenderCommandEncoder> encoder = (id<MTLRenderCommandEncoder>)buffer->commandBuffer->encoder;
|
||||||
[encoder setScissorRect:scissorRect];
|
[encoder setScissorRect:scissorRect];
|
||||||
}
|
}
|
||||||
|
void gnCommandBindBufferFn(gnCommandBufferHandle buffer, gnBufferHandle bufferToBind, gnBufferType type) {
|
||||||
|
if (type == GN_VERTEX_BUFFER) {
|
||||||
|
id<MTLRenderCommandEncoder> encoder = (id<MTLRenderCommandEncoder>)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) {
|
void gnCommandDrawFn(struct gnCommandBuffer_t* buffer, int vertexCount, int firstVertex, int instanceCount, int firstInstance) {
|
||||||
if (buffer->commandBuffer->boundGraphcisPipeline != NULL) {
|
if (buffer->commandBuffer->boundGraphcisPipeline != NULL) {
|
||||||
id<MTLRenderCommandEncoder> encoder = (id<MTLRenderCommandEncoder>)buffer->commandBuffer->encoder;
|
id<MTLRenderCommandEncoder> encoder = (id<MTLRenderCommandEncoder>)buffer->commandBuffer->encoder;
|
||||||
|
Reference in New Issue
Block a user