got bored and kinda rewrote GN_DEBUGGER_LAYER_FUNCTIONS

This commit is contained in:
Gregory Wells
2025-07-09 19:37:04 -04:00
parent a393d7b5b7
commit 0fe87e1e84
14 changed files with 160 additions and 280 deletions

View File

@@ -8,21 +8,21 @@ gnReturnCode gnCreateFence(gnFenceHandle* fence, gnDevice device) {
*fence = malloc(sizeof(struct gnFence_t));
(*fence)->device = device;
(*fence)->signaled = gnFalse;
return device->instance->callingLayer->deviceFunctions._gnCreateFence(*fence, device);
return device->instance->callingLayer->syncFunctions._gnCreateFence(*fence, device);
}
void gnSignalFence(gnFenceHandle fence) {
fence->signaled = gnTrue;
}
void gnWaitForFence(gnFenceHandle fence, uint64_t timeout) {
if (fence->signaled == gnTrue) return;
fence->device->instance->callingLayer->deviceFunctions._gnWaitForFence(fence, timeout);
fence->device->instance->callingLayer->syncFunctions._gnWaitForFence(fence, timeout);
}
void gnResetFence(gnFenceHandle fence) {
fence->signaled = gnFalse;
fence->device->instance->callingLayer->deviceFunctions._gnResetFence(fence);
fence->device->instance->callingLayer->syncFunctions._gnResetFence(fence);
}
void gnDestroyFence(gnFenceHandle fence) {
fence->device->instance->callingLayer->deviceFunctions._gnDestroyFence(fence);
fence->device->instance->callingLayer->syncFunctions._gnDestroyFence(fence);
}
// #endif

View File

@@ -0,0 +1,17 @@
#pragma once
#include "stdint.h"
#include "utils/gryphn_error_code.h"
#include "core/src/gryphn_handles.h"
typedef struct gnSyncExtFunctions {
gnReturnCode (*_gnPresentationQueueGetImageAsync)(gnPresentationQueueHandle presentationQueue, uint64_t timeout, gnSemaphoreHandle semaphore, uint32_t* imageIndex);
gnReturnCode (*_gnCreateSemaphore)(gnSemaphoreHandle semaphore, gnOutputDeviceHandle device);
void (*_gnDestroySemaphore)(gnSemaphoreHandle semaphore);
gnReturnCode (*_gnCreateFence)(gnFenceHandle fence, gnOutputDeviceHandle device);
void (*_gnWaitForFence)(gnFenceHandle fence, uint64_t timeout);
void (*_gnResetFence)(gnFenceHandle fence);
void (*_gnDestroyFence)(gnFenceHandle fence);
} gnSyncExtFunctions;

View File

@@ -7,10 +7,10 @@
gnReturnCode gnCreateSemaphore(gnSemaphore* semaphore, struct gnOutputDevice_t* device) {
*semaphore = malloc(sizeof(struct gnSemaphore_t));
(*semaphore)->device = device;
return device->instance->callingLayer->deviceFunctions._gnCreateSemaphore((*semaphore), device);
return device->instance->callingLayer->syncFunctions._gnCreateSemaphore((*semaphore), device);
}
void gnDestroySemaphore(struct gnSemaphore_t* semaphore) {
semaphore->device->instance->callingLayer->deviceFunctions._gnDestroySemaphore(semaphore);
semaphore->device->instance->callingLayer->syncFunctions._gnDestroySemaphore(semaphore);
}
// #endif