metal command pool

This commit is contained in:
Greg Wells
2025-05-29 15:08:32 -04:00
parent e3ec7619ed
commit 77e92957a6
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
#pragma once
#import <Metal/Metal.h>
#include "core/command/command_pool/gryphn_command_pool.h"
typedef struct gnPlatformCommandPool_t {
id<MTLCommandQueue> commandQueue;
} gnPlatformCommandPool;

View File

@@ -0,0 +1,13 @@
#include "metal_command_pool.h"
#include "core/devices/metal_output_devices.h"
gnReturnCode gnCreateCommandPoolFn(struct gnCommandPool_t* commandPool, struct gnOutputDevice_t* device, struct gnCommandPoolInfo_t info) {
commandPool->commandPool = malloc(sizeof(struct gnPlatformCommandPool_t));
commandPool->commandPool->commandQueue = [device->outputDevice->device newCommandQueue];
return GN_SUCCESS;
}
void gnDestroyCommandPoolFn(struct gnCommandPool_t* commandPool) {
[commandPool->commandPool->commandQueue release];
free(commandPool->commandPool);
}