get all the commands to work
This commit is contained in:
@@ -10,3 +10,8 @@ typedef struct gnPlatformCommandBuffer_t {
|
||||
struct gnGraphicsPipeline_t* boundGraphcisPipeline;
|
||||
gnBufferHandle indexBuffer;
|
||||
} gnPlatformCommandBuffer;
|
||||
|
||||
gnReturnCode allocateMetalCommandBuffers(gnCommandBufferHandle* commandBuffers, uint32_t count, gnCommandPool pool);
|
||||
void resetMetalCommandBuffer(gnCommandBuffer commandBuffer);
|
||||
gnReturnCode beginMetalCommandBuffer(gnCommandBuffer commandBuffer);
|
||||
gnReturnCode endMetalCommandBuffer(gnCommandBuffer commandBuffer);
|
||||
|
||||
@@ -2,23 +2,22 @@
|
||||
#include "commands/command_pool/metal_command_pool.h"
|
||||
#import <Metal/Metal.h>
|
||||
|
||||
gnReturnCode gnCommandPoolAllocateCommandBuffersFn(gnCommandBufferHandle* commandBuffers, uint32_t count, struct gnCommandPool_t* pool) {
|
||||
gnReturnCode allocateMetalCommandBuffers(gnCommandBufferHandle* commandBuffers, uint32_t count, gnCommandPool pool) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
commandBuffers[i]->commandBuffer = malloc(sizeof(gnPlatformCommandBuffer));
|
||||
}
|
||||
commandBuffers[i]->commandBuffer = malloc(sizeof(gnPlatformCommandBuffer)); }
|
||||
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
void gnResetCommandBufferFn(struct gnCommandBuffer_t *commandBuffer) {
|
||||
// do nothing
|
||||
}
|
||||
gnReturnCode gnBeginCommandBufferFn(struct gnCommandBuffer_t* commandBuffer) {
|
||||
commandBuffer->commandBuffer->boundGraphcisPipeline = NULL;
|
||||
void resetMetalCommandBuffer(gnCommandBuffer commandBuffer) {
|
||||
commandBuffer->commandBuffer->commandBuffer = [commandBuffer->commandPool->commandPool->commandQueue commandBuffer];
|
||||
}
|
||||
gnReturnCode beginMetalCommandBuffer(gnCommandBuffer commandBuffer) {
|
||||
commandBuffer->commandBuffer->boundGraphcisPipeline = NULL;
|
||||
commandBuffer->commandBuffer->encoder = nil;
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
||||
gnReturnCode gnEndCommandBufferFn(struct gnCommandBuffer_t* commandBuffer) {
|
||||
gnReturnCode endMetalCommandBuffer(gnCommandBuffer commandBuffer) {
|
||||
// [commandBuffer->commandBuffer->commandBuffer commit];
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user