From 77e92957a62eb2731ac733cb0b32e1a19c96aa7a Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Thu, 29 May 2025 15:08:32 -0400 Subject: [PATCH] metal command pool --- .../core/commands/command_pool/metal_command_pool.h | 7 +++++++ .../core/commands/command_pool/metal_command_pool.m | 13 +++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 rendering_api/metal/src/core/commands/command_pool/metal_command_pool.h create mode 100644 rendering_api/metal/src/core/commands/command_pool/metal_command_pool.m diff --git a/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.h b/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.h new file mode 100644 index 0000000..626a7d8 --- /dev/null +++ b/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.h @@ -0,0 +1,7 @@ +#pragma once +#import +#include "core/command/command_pool/gryphn_command_pool.h" + +typedef struct gnPlatformCommandPool_t { + id commandQueue; +} gnPlatformCommandPool; diff --git a/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.m b/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.m new file mode 100644 index 0000000..f1e4ac6 --- /dev/null +++ b/rendering_api/metal/src/core/commands/command_pool/metal_command_pool.m @@ -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); +}