From b84786715dd7e7a687d7508f4a2e2d48d5fd6115 Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Wed, 16 Jul 2025 13:16:18 -0400 Subject: [PATCH] giving up on this extension for now --- .../command_pool/gryphn_command_pool.h | 10 ++++----- projects/core/src/gryphn_handles.h | 2 -- .../queues/gryphn_queued_command_pool.h | 22 +++++++++++++++++++ projects/extensions/queues/queues_functions.h | 4 ++++ .../commands/gryphn_sync_present.h | 1 + .../commands/gryphn_sync_submit.h | 2 ++ .../synchronization/fence/gryphn_fence.h | 2 ++ .../gryphn_synced_presentation_queue.h | 1 + .../synchronization/loader/sync_functions.h | 2 ++ .../semaphore/gryphn_semaphore.h | 2 ++ 10 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 projects/extensions/queues/gryphn_queued_command_pool.h diff --git a/projects/core/src/command/command_pool/gryphn_command_pool.h b/projects/core/src/command/command_pool/gryphn_command_pool.h index b49cb5f..015f4f0 100644 --- a/projects/core/src/command/command_pool/gryphn_command_pool.h +++ b/projects/core/src/command/command_pool/gryphn_command_pool.h @@ -3,13 +3,13 @@ #include #include "gryphn_handles.h" -typedef enum gnCommandPoolFlags { - GN_NO_FLAGS = 0, - GN_REUSE_COMMAND_BUFFERS = 1 -} gnCommandPoolFlags; +typedef enum gnCommandPoolFlagBits { + GN_NO_FLAGS = 0, + GN_REUSE_COMMAND_BUFFERS = 1 << 0 +} gnCommandPoolFlagBits; +typedef gnFlags gnCommandPoolFlags; typedef struct gnCommandPoolInfo { - // uint32_t queueIndex; gnCommandPoolFlags flags; } gnCommandPoolInfo; diff --git a/projects/core/src/gryphn_handles.h b/projects/core/src/gryphn_handles.h index 8dc141b..3d0e4c5 100644 --- a/projects/core/src/gryphn_handles.h +++ b/projects/core/src/gryphn_handles.h @@ -26,8 +26,6 @@ GN_HANDLE(gnShaderModule); GN_HANDLE(gnGraphicsPipeline); GN_HANDLE(gnCommandPool); GN_HANDLE(gnCommandBuffer); -GN_HANDLE(gnSemaphore); -GN_HANDLE(gnFence); GN_HANDLE(gnFramebuffer); GN_HANDLE(gnBuffer); GN_HANDLE(gnUniformPool); diff --git a/projects/extensions/queues/gryphn_queued_command_pool.h b/projects/extensions/queues/gryphn_queued_command_pool.h new file mode 100644 index 0000000..00009c2 --- /dev/null +++ b/projects/extensions/queues/gryphn_queued_command_pool.h @@ -0,0 +1,22 @@ +#pragma once +#include "command/command_pool/gryphn_command_pool.h" +#include + +GN_HANDLE(gnQueuedCommandPool); + +typedef struct gnQueuedCommandPoolInfo { + gnCommandPoolFlags flags; + uint32_t queueFamilyIndex; +} gnQueuedCommandPoolInfo; + +#ifdef GN_REVEAL_IMPL +struct gnQueuedCommandPool_t { + struct gnPlatformCommandPool_t* commandPool; + gnDevice device; + gnInstance instance; + gnCommandPoolInfo info; +}; +#endif + +gnReturnCode gnCreateQueuedCommandPool(gnQueuedCommandPool* commandPool, gnDeviceHandle device, gnQueuedCommandPoolInfo info); +void gnDestroyQueuedCommandPool(gnQueuedCommandPool commandPool); diff --git a/projects/extensions/queues/queues_functions.h b/projects/extensions/queues/queues_functions.h index 54fe653..8d312a1 100644 --- a/projects/extensions/queues/queues_functions.h +++ b/projects/extensions/queues/queues_functions.h @@ -2,9 +2,13 @@ #include "stdint.h" #include "utils/gryphn_error_code.h" #include "core/src/gryphn_handles.h" +#include "gryphn_queued_command_pool.h" typedef struct gnQueueFamilyProperties gnQueueFamilyProperties; typedef struct gnQueueExtFunctions { gnReturnCode (*_gnGetPhysicalDeviceQueueProperties)(gnPhysicalOutputDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues); + + gnReturnCode (*_gnCreateQueuedCommandPool)(gnQueuedCommandPool* commandPool, gnDeviceHandle device, gnQueuedCommandPoolInfo info); + void (*_gnDestroyQueuedCommandPool)(gnQueuedCommandPool commandPool); } gnQueueExtFunctions; diff --git a/projects/extensions/synchronization/commands/gryphn_sync_present.h b/projects/extensions/synchronization/commands/gryphn_sync_present.h index 874eee4..602195a 100644 --- a/projects/extensions/synchronization/commands/gryphn_sync_present.h +++ b/projects/extensions/synchronization/commands/gryphn_sync_present.h @@ -2,6 +2,7 @@ #include "stdint.h" #include "utils/gryphn_error_code.h" #include "gryphn_handles.h" +#include "extensions/synchronization/semaphore/gryphn_semaphore.h" typedef struct gnPresentSyncInfo { uint32_t waitCount; diff --git a/projects/extensions/synchronization/commands/gryphn_sync_submit.h b/projects/extensions/synchronization/commands/gryphn_sync_submit.h index 09ebff5..d87f8a4 100644 --- a/projects/extensions/synchronization/commands/gryphn_sync_submit.h +++ b/projects/extensions/synchronization/commands/gryphn_sync_submit.h @@ -2,6 +2,8 @@ #include "stdint.h" #include "core/src/renderpass/gryphn_render_pass_descriptor.h" #include "core/src/gryphn_handles.h" +#include "extensions/synchronization/semaphore/gryphn_semaphore.h" +#include "extensions/synchronization/fence/gryphn_fence.h" typedef struct gnSubmitSyncInfo { uint32_t waitCount; diff --git a/projects/extensions/synchronization/fence/gryphn_fence.h b/projects/extensions/synchronization/fence/gryphn_fence.h index fa276ac..d2d97d8 100644 --- a/projects/extensions/synchronization/fence/gryphn_fence.h +++ b/projects/extensions/synchronization/fence/gryphn_fence.h @@ -4,6 +4,8 @@ #include "utils/lists/gryphn_array_list.h" #include "gryphn_handles.h" +GN_HANDLE(gnFence); + #ifdef GN_REVEAL_IMPL struct gnFence_t { struct gnPlatformFence_t* fence; diff --git a/projects/extensions/synchronization/gryphn_synced_presentation_queue.h b/projects/extensions/synchronization/gryphn_synced_presentation_queue.h index eed5f27..22e72dd 100644 --- a/projects/extensions/synchronization/gryphn_synced_presentation_queue.h +++ b/projects/extensions/synchronization/gryphn_synced_presentation_queue.h @@ -2,5 +2,6 @@ #include "stdint.h" #include "utils/gryphn_error_code.h" #include "core/src/gryphn_handles.h" +#include "semaphore/gryphn_semaphore.h" gnReturnCode gnPresentationQueueGetImageAsync(gnPresentationQueueHandle presentationQueue, uint64_t timeout, gnSemaphoreHandle semaphore, uint32_t* imageIndex); diff --git a/projects/extensions/synchronization/loader/sync_functions.h b/projects/extensions/synchronization/loader/sync_functions.h index c4a17da..152f228 100644 --- a/projects/extensions/synchronization/loader/sync_functions.h +++ b/projects/extensions/synchronization/loader/sync_functions.h @@ -1,6 +1,8 @@ #pragma once #include "stdint.h" #include "utils/gryphn_error_code.h" +#include +#include #include "core/src/gryphn_handles.h" typedef struct gnSubmitSyncInfo gnSubmitSyncInfo; diff --git a/projects/extensions/synchronization/semaphore/gryphn_semaphore.h b/projects/extensions/synchronization/semaphore/gryphn_semaphore.h index 881eb12..8c98b29 100644 --- a/projects/extensions/synchronization/semaphore/gryphn_semaphore.h +++ b/projects/extensions/synchronization/semaphore/gryphn_semaphore.h @@ -3,6 +3,8 @@ #include "utils/lists/gryphn_array_list.h" #include "gryphn_handles.h" +GN_HANDLE(gnSemaphore); + #ifdef GN_REVEAL_IMPL struct gnSemaphore_t { struct gnPlatformSemaphore_t* semaphore;