a lot of loader cleanup

This commit is contained in:
Gregory Wells
2025-08-03 11:43:20 -04:00
parent 988333c0ac
commit 17b1cff781
16 changed files with 77 additions and 64 deletions

View File

@@ -5,8 +5,9 @@
gryphnInstanceFunctionLayers metalLoadAPILayer() {
return (gryphnInstanceFunctionLayers) {
.createInstance = { metalCreateInstance, NULL },
.destroyInstance = { metalDestroyInstance, NULL }
.createInstance = metalCreateInstance,
.destroyInstance = metalDestroyInstance,
.next = NULL
};
}

View File

@@ -7,5 +7,5 @@ typedef struct gnPlatformInstance_t {
NSView* metalContentView;
} gnPlatformInstance;
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next);
void metalDestroyInstance(gnInstance instance, PFN_gnDestroyInstance_layer* next);
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnInstanceFunctionLayers* next);
void metalDestroyInstance(gnInstance instance, gryphnInstanceFunctionLayers* next);

View File

@@ -1,10 +1,10 @@
#include "metal_instance.h"
// metal instances are kinda useless
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next) {
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnInstanceFunctionLayers* next) {
if (instance->instance == NULL) instance->instance = malloc(sizeof(gnPlatformInstance));
return GN_SUCCESS;
}
void metalDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next) {
void metalDestroyInstance(gnInstanceHandle instance, gryphnInstanceFunctionLayers* next) {
free(instance->instance);
}