From ab72c8742100946ba149d9c7df88eef0abf5cb13 Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Wed, 16 Jul 2025 20:03:15 -0400 Subject: [PATCH] function loader supports GN_EXT_QUEUES --- projects/loader/src/gryphn_loader.c | 3 +- .../extensions/queue_functions.c | 32 +++++++++++++++++++ .../extensions/queue_functions.h | 10 ++++++ .../function_loader/loader/function_loader.c | 12 +++++++ .../function_loader/loader/function_loader.h | 2 ++ 5 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 projects/validation_layers/function_loader/extensions/queue_functions.c create mode 100644 projects/validation_layers/function_loader/extensions/queue_functions.h diff --git a/projects/loader/src/gryphn_loader.c b/projects/loader/src/gryphn_loader.c index 8739755..2100067 100644 --- a/projects/loader/src/gryphn_loader.c +++ b/projects/loader/src/gryphn_loader.c @@ -134,7 +134,8 @@ loaderLayer function_check_layer() { .deviceFunctions = loadFunctionLoaderDeviceFunctions(), .commandFunctions = loadFunctionLoaderCommandFunctions(), - .syncFunctions = loadFunctionLoaderSyncExtFunctions() + .syncFunctions = loadFunctionLoaderSyncExtFunctions(), + .queueFunctions = loadFunctionLoaderQueueExtFunctions(), }; } diff --git a/projects/validation_layers/function_loader/extensions/queue_functions.c b/projects/validation_layers/function_loader/extensions/queue_functions.c new file mode 100644 index 0000000..450bbbd --- /dev/null +++ b/projects/validation_layers/function_loader/extensions/queue_functions.c @@ -0,0 +1,32 @@ +#include "queue_functions.h" +#include "loader_utils.h" +#include "core/src/output_device/gryphn_physical_output_device.h" +#include "core/src/output_device/gryphn_output_device.h" +#include +#include +#include "core/src/submit/gryphn_submit.h" +#include "core/src/present/gryphn_present.h" +#include "extensions/synchronization/commands/gryphn_sync_submit.h" +#include "extensions/synchronization/commands/gryphn_sync_present.h" + +gnReturnCode checkGetPhysicalDeviceQueueProperties(gnPhysicalOutputDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues) { + CHECK_FUNCTION_WITH_RETURN_CODE(device->instance, _gnGetPhysicalDeviceQueueProperties, queueFunctions, device, queueCount, queues); +} +void checkGetDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue) { + CHECK_VOID_FUNCTION(device->instance, _gnGetDeviceQueue, queueFunctions, device, queueFamily, queueIndex, queue); +} + +gnReturnCode checkQueueSubmit(gnOutputDevice device, gnQueue queue, gnSubmitInfo info) { + CHECK_FUNCTION_WITH_RETURN_CODE(device->instance, _gnQueueSubmit, queueFunctions, device, queue, info); +} +gnReturnCode checkQueueSubmitSync(gnOutputDevice device, gnQueue queue, gnSubmitSyncInfo info) { + CHECK_FUNCTION_WITH_RETURN_CODE(device->instance, _gnQueueSubmitSync, queueFunctions, device, queue, info); +} + +gnReturnCode checkQueuePresent(gnDevice device, gnQueue queue, gnPresentInfo info) { + CHECK_FUNCTION_WITH_RETURN_CODE(device->instance, _gnQueuePresent, queueFunctions, device, queue, info); + +} +gnReturnCode checkQueuePresentSync(gnDevice device, gnQueue queue, gnPresentSyncInfo info) { + CHECK_FUNCTION_WITH_RETURN_CODE(device->instance, _gnQueuePresentSync, queueFunctions, device, queue, info); +} diff --git a/projects/validation_layers/function_loader/extensions/queue_functions.h b/projects/validation_layers/function_loader/extensions/queue_functions.h new file mode 100644 index 0000000..ba49179 --- /dev/null +++ b/projects/validation_layers/function_loader/extensions/queue_functions.h @@ -0,0 +1,10 @@ +#include + +gnReturnCode checkGetPhysicalDeviceQueueProperties(gnPhysicalOutputDeviceHandle device, uint32_t queueCount, gnQueueFamilyProperties* queues); +void checkGetDeviceQueue(gnOutputDevice device, uint32_t queueFamily, uint32_t queueIndex, gnQueue* queue); + +gnReturnCode checkQueueSubmit(gnOutputDevice device, gnQueue queue, gnSubmitInfo info); +gnReturnCode checkQueueSubmitSync(gnOutputDevice device, gnQueue queue, gnSubmitSyncInfo info); + +gnReturnCode checkQueuePresent(gnDevice device, gnQueue queue, gnPresentInfo info); +gnReturnCode checkQueuePresentSync(gnDevice device, gnQueue queue, gnPresentSyncInfo info); diff --git a/projects/validation_layers/function_loader/loader/function_loader.c b/projects/validation_layers/function_loader/loader/function_loader.c index e6edd51..ceef1ba 100644 --- a/projects/validation_layers/function_loader/loader/function_loader.c +++ b/projects/validation_layers/function_loader/loader/function_loader.c @@ -3,6 +3,7 @@ #include "src/device_functions.h" #include "src/command_functions.h" #include "extensions/sync_functions.h" +#include "extensions/queue_functions.h" gnInstanceFunctions loadFunctionLoaderInstanceFunctions() { return (gnInstanceFunctions){ @@ -121,3 +122,14 @@ gnSyncExtFunctions loadFunctionLoaderSyncExtFunctions() { ._gnPresentSync = checkPresentSync }; } + +gnQueueExtFunctions loadFunctionLoaderQueueExtFunctions() { + return (gnQueueExtFunctions){ + ._gnGetPhysicalDeviceQueueProperties = checkGetPhysicalDeviceQueueProperties, + ._gnGetDeviceQueue = checkGetDeviceQueue, + ._gnQueueSubmit = checkQueueSubmit, + ._gnQueueSubmitSync = checkQueueSubmitSync, + ._gnQueuePresent = checkQueuePresent, + ._gnQueuePresentSync = checkQueuePresentSync + }; +} diff --git a/projects/validation_layers/function_loader/loader/function_loader.h b/projects/validation_layers/function_loader/loader/function_loader.h index 882f8f9..1fb987c 100644 --- a/projects/validation_layers/function_loader/loader/function_loader.h +++ b/projects/validation_layers/function_loader/loader/function_loader.h @@ -8,4 +8,6 @@ gnDeviceFunctions loadFunctionLoaderDeviceFunctions(); gnCommandFunctions loadFunctionLoaderCommandFunctions(); #include "extensions/synchronization/loader/sync_functions.h" +#include "extensions/queues/queues_functions.h" gnSyncExtFunctions loadFunctionLoaderSyncExtFunctions(); +gnQueueExtFunctions loadFunctionLoaderQueueExtFunctions();