vulkan+gryphn sync impl

This commit is contained in:
Greg Wells
2025-05-30 11:00:20 -04:00
parent 7ffae404bb
commit 014b315faa
11 changed files with 114 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
#include "gryphn_fence.h"
#include "core/gryphn_platform_functions.h"
#include "stdio.h"
gnReturnCode gnCreateFence(struct gnFence_t* fence, struct gnOutputDevice_t* device) {
fence->device = device;
fence->signaled = gnFalse;
return device->deviceFunctions->_gnCreateFence(fence, device);
}
void gnSignalFence(struct gnFence_t* fence) {
fence->signaled = gnTrue;
// fence->device->deviceFunctions->_gnSignalFence(fence);
}
void gnWaitForFence(struct gnFence_t* fence, uint64_t timeout) {
if (fence->signaled == gnTrue) return;
fence->device->deviceFunctions->_gnWaitForFence(fence, timeout);
}
void gnResetFence(struct gnFence_t* fence) {
fence->signaled = gnFalse;
fence->device->deviceFunctions->_gnResetFence(fence);
}
void gnDestroyFence(struct gnFence_t* fence) {
fence->device->deviceFunctions->_gnDestroyFence(fence);
}

View File

@@ -4,6 +4,8 @@
typedef struct gnFence_t {
struct gnPlatformFence_t* fence;
struct gnOutputDevice_t* device;
gnBool signaled;
} gnFence;
gnReturnCode gnCreateFence(struct gnFence_t* fence, struct gnOutputDevice_t* device);

View File

@@ -0,0 +1,10 @@
#include "gryphn_semaphore.h"
#include "core/gryphn_platform_functions.h"
gnReturnCode gnCreateSemaphore(struct gnSemaphore_t* semaphore, struct gnOutputDevice_t* device) {
semaphore->device = device;
return device->deviceFunctions->_gnCreateSemaphore(semaphore, device);
}
void gnDestroySemaphore(struct gnSemaphore_t* semaphore) {
semaphore->device->deviceFunctions->_gnDestroySemaphore(semaphore);
}

View File

@@ -3,6 +3,7 @@
typedef struct gnSemaphore_t {
struct gnPlatformSemaphore_t* semaphore;
struct gnOutputDevice_t* device;
} gnSemaphore;
gnReturnCode gnCreateSemaphore(struct gnSemaphore_t* semaphore, struct gnOutputDevice_t* device);