finish new loader structure for vulkan

This commit is contained in:
Gregory Wells
2025-06-24 14:43:59 -04:00
parent 4ec3d62146
commit 8cc44c709e
40 changed files with 178 additions and 93 deletions

View File

@@ -1,7 +1,7 @@
#include "vulkan_fence.h"
#include "output_device/vulkan_output_devices.h"
gnReturnCode gnCreateFenceFn(struct gnFence_t* fence, struct gnOutputDevice_t* device) {
gnReturnCode createFence(gnFence fence, gnDevice device) {
fence->fence = malloc(sizeof(gnPlatformFence));
VkFenceCreateInfo fenceInfo = {
.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO
@@ -10,14 +10,13 @@ gnReturnCode gnCreateFenceFn(struct gnFence_t* fence, struct gnOutputDevice_t* d
return GN_FAILED_TO_CREATE_FENCE;
return GN_SUCCESS;
}
void gnSignalFenceFn(struct gnFence_t* fence) {}
void gnWaitForFenceFn(struct gnFence_t* fence, uint64_t timeout) {
void waitForFence(gnFence fence, uint64_t timeout) {
vkWaitForFences(fence->device->outputDevice->device, 1, &fence->fence->fence, VK_TRUE, timeout);
}
void gnResetFenceFn(struct gnFence_t* fence) {
void resetFence(gnFence fence) {
vkResetFences(fence->device->outputDevice->device, 1, &fence->fence->fence);
}
void gnDestroyFenceFn(struct gnFence_t* fence) {
void destroyFence(gnFence fence) {
vkDestroyFence(fence->device->outputDevice->device, fence->fence->fence, NULL);
free(fence->fence);
}

View File

@@ -5,3 +5,8 @@
typedef struct gnPlatformFence_t {
VkFence fence;
} gnPlatformFence;
gnReturnCode createFence(gnFence fence, gnDevice device);
void waitForFence(gnFence fence, uint64_t timeout);
void resetFence(gnFence fence);
void destroyFence(gnFence fence);

View File

@@ -1,7 +1,7 @@
#include "vulkan_semaphore.h"
#include "output_device/vulkan_output_devices.h"
gnReturnCode gnCreateSemaphoreFn(struct gnSemaphore_t* semaphore, struct gnOutputDevice_t* device) {
gnReturnCode createSemaphore(gnSemaphore semaphore, gnDevice device) {
semaphore->semaphore = malloc(sizeof(gnPlatformSemaphore));
VkSemaphoreCreateInfo semaphoreInfo = {
.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO
@@ -11,7 +11,7 @@ gnReturnCode gnCreateSemaphoreFn(struct gnSemaphore_t* semaphore, struct gnOutpu
return GN_FAILED_TO_CREATE_SEMAPHORE;
return GN_SUCCESS;
}
void gnDestroySemaphoreFn(struct gnSemaphore_t* semaphore) {
void destroySemaphore(gnSemaphore semaphore) {
vkDestroySemaphore(semaphore->device->outputDevice->device, semaphore->semaphore->semaphore, NULL);
free(semaphore->semaphore);
}

View File

@@ -5,3 +5,6 @@
typedef struct gnPlatformSemaphore_t {
VkSemaphore semaphore;
} gnPlatformSemaphore;
gnReturnCode createSemaphore(gnSemaphore semaphore, gnDevice device);
void destroySemaphore(gnSemaphore semaphore);