From 7ffae404bbebfa03885ad2dd83bdec9843d8068a Mon Sep 17 00:00:00 2001 From: Greg Wells Date: Fri, 30 May 2025 10:17:59 -0400 Subject: [PATCH] sync API, not impl --- include/gryphn/gryphn.h | 2 ++ src/core/sync/fence/gryphn_fence.h | 13 +++++++++++++ src/core/sync/semaphore/gryphn_semaphore.h | 9 +++++++++ 3 files changed, 24 insertions(+) create mode 100644 src/core/sync/fence/gryphn_fence.h create mode 100644 src/core/sync/semaphore/gryphn_semaphore.h diff --git a/include/gryphn/gryphn.h b/include/gryphn/gryphn.h index eb7f6b4..8d462d8 100644 --- a/include/gryphn/gryphn.h +++ b/include/gryphn/gryphn.h @@ -17,3 +17,5 @@ #include #include #include +#include +#include diff --git a/src/core/sync/fence/gryphn_fence.h b/src/core/sync/fence/gryphn_fence.h new file mode 100644 index 0000000..151fd83 --- /dev/null +++ b/src/core/sync/fence/gryphn_fence.h @@ -0,0 +1,13 @@ +#pragma once +#include "core/output_device/gryphn_output_device.h" + + +typedef struct gnFence_t { + struct gnPlatformFence_t* fence; +} gnFence; + +gnReturnCode gnCreateFence(struct gnFence_t* fence, struct gnOutputDevice_t* device); +void gnSignalFence(struct gnFence_t* fence); +void gnWaitForFence(struct gnFence_t* fence, uint64_t timeout); +void gnResetFence(struct gnFence_t* fence); +void gnDestroyFence(struct gnFence_t* fence); diff --git a/src/core/sync/semaphore/gryphn_semaphore.h b/src/core/sync/semaphore/gryphn_semaphore.h new file mode 100644 index 0000000..a4607dc --- /dev/null +++ b/src/core/sync/semaphore/gryphn_semaphore.h @@ -0,0 +1,9 @@ +#pragma once +#include "core/output_device/gryphn_output_device.h" + +typedef struct gnSemaphore_t { + struct gnPlatformSemaphore_t* semaphore; +} gnSemaphore; + +gnReturnCode gnCreateSemaphore(struct gnSemaphore_t* semaphore, struct gnOutputDevice_t* device); +void gnDestroySemaphore(struct gnSemaphore_t* semaphore);