more loader redoing (for instance)
This commit is contained in:
@@ -3,10 +3,15 @@
|
||||
#include "surface/metal_surface.h"
|
||||
#include "devices/metal_output_devices.h"
|
||||
|
||||
gryphnInstanceFunctionLayers metalLoadAPILayer() {
|
||||
return (gryphnInstanceFunctionLayers) {
|
||||
.createInstance = { metalCreateInstance, NULL },
|
||||
.destroyInstance = { metalDestroyInstance, NULL }
|
||||
};
|
||||
}
|
||||
|
||||
gnInstanceFunctions loadMetalInstanceFunctions() {
|
||||
return (gnInstanceFunctions){
|
||||
._gnCreateInstance = createMetalInstance,
|
||||
._gnDestroyInstance = destroyMetalInstance,
|
||||
._gnGetPhysicalDevices = getMetalDevices,
|
||||
._gnPhysicalDeviceCanPresentToSurface = metalCanDevicePresent,
|
||||
._gnCreateOutputDevice = createMetalOutputDevice,
|
||||
|
@@ -5,6 +5,9 @@
|
||||
#include "extensions/synchronization/loader/sync_functions.h"
|
||||
#include "core/gryphn_extensions.h"
|
||||
|
||||
typedef struct gryphnInstanceFunctionLayers gryphnInstanceFunctionLayers;
|
||||
gryphnInstanceFunctionLayers metalLoadAPILayer();
|
||||
|
||||
gnInstanceFunctions loadMetalInstanceFunctions();
|
||||
gnDeviceFunctions loadMetalDeviceFunctions();
|
||||
gnCommandFunctions loadMetalCommandFunctions();
|
||||
|
@@ -7,5 +7,5 @@ typedef struct gnPlatformInstance_t {
|
||||
NSView* metalContentView;
|
||||
} gnPlatformInstance;
|
||||
|
||||
gnReturnCode createMetalInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo);
|
||||
void destroyMetalInstance(gnInstance instance);
|
||||
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnFunctionLayer* next);
|
||||
void metalDestroyInstance(gnInstance instance, gryphnFunctionLayer* next);
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#include "metal_instance.h"
|
||||
|
||||
// metal instances are kinda useless
|
||||
gnReturnCode createMetalInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo) {
|
||||
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnFunctionLayer* next) {
|
||||
if (instance->instance == NULL) instance->instance = malloc(sizeof(gnPlatformInstance));
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
void destroyMetalInstance(gnInstance instance) {
|
||||
void metalDestroyInstance(gnInstanceHandle instance, gryphnFunctionLayer* next) {
|
||||
free(instance->instance);
|
||||
}
|
||||
|
@@ -6,6 +6,9 @@
|
||||
#include "extensions/queues/queues_functions.h"
|
||||
#include "core/gryphn_extensions.h"
|
||||
|
||||
typedef struct gryphnInstanceFunctionLayers gryphnInstanceFunctionLayers;
|
||||
gryphnInstanceFunctionLayers loadVulkanAPILayer();
|
||||
|
||||
gnInstanceFunctions loadVulkanInstanceFunctions();
|
||||
gnDeviceFunctions loadVulkanDeviceFunctions();
|
||||
gnCommandFunctions loadVulkanCommandFunctions();
|
||||
|
Reference in New Issue
Block a user