a lot of loader cleanup
This commit is contained in:
@@ -5,8 +5,9 @@
|
|||||||
|
|
||||||
gryphnInstanceFunctionLayers metalLoadAPILayer() {
|
gryphnInstanceFunctionLayers metalLoadAPILayer() {
|
||||||
return (gryphnInstanceFunctionLayers) {
|
return (gryphnInstanceFunctionLayers) {
|
||||||
.createInstance = { metalCreateInstance, NULL },
|
.createInstance = metalCreateInstance,
|
||||||
.destroyInstance = { metalDestroyInstance, NULL }
|
.destroyInstance = metalDestroyInstance,
|
||||||
|
.next = NULL
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -7,5 +7,5 @@ typedef struct gnPlatformInstance_t {
|
|||||||
NSView* metalContentView;
|
NSView* metalContentView;
|
||||||
} gnPlatformInstance;
|
} gnPlatformInstance;
|
||||||
|
|
||||||
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next);
|
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnInstanceFunctionLayers* next);
|
||||||
void metalDestroyInstance(gnInstance instance, PFN_gnDestroyInstance_layer* next);
|
void metalDestroyInstance(gnInstance instance, gryphnInstanceFunctionLayers* next);
|
||||||
|
@@ -1,10 +1,10 @@
|
|||||||
#include "metal_instance.h"
|
#include "metal_instance.h"
|
||||||
|
|
||||||
// metal instances are kinda useless
|
// 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));
|
if (instance->instance == NULL) instance->instance = malloc(sizeof(gnPlatformInstance));
|
||||||
return GN_SUCCESS;
|
return GN_SUCCESS;
|
||||||
}
|
}
|
||||||
void metalDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next) {
|
void metalDestroyInstance(gnInstanceHandle instance, gryphnInstanceFunctionLayers* next) {
|
||||||
free(instance->instance);
|
free(instance->instance);
|
||||||
}
|
}
|
||||||
|
@@ -6,8 +6,9 @@
|
|||||||
|
|
||||||
gryphnInstanceFunctionLayers loadVulkanAPILayer() {
|
gryphnInstanceFunctionLayers loadVulkanAPILayer() {
|
||||||
return (gryphnInstanceFunctionLayers) {
|
return (gryphnInstanceFunctionLayers) {
|
||||||
.createInstance = { vulkanCreateInstance, NULL },
|
.createInstance = vulkanCreateInstance,
|
||||||
.destroyInstance = { vulkanDestroyInstance, NULL }
|
.destroyInstance = vulkanDestroyInstance,
|
||||||
|
.next = NULL
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -37,7 +37,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL vk_debuggerDebugCallback(
|
|||||||
return VK_TRUE;
|
return VK_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next) {
|
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnInstanceFunctionLayers* next) {
|
||||||
instance->instance = malloc(sizeof(gnPlatformInstance));
|
instance->instance = malloc(sizeof(gnPlatformInstance));
|
||||||
|
|
||||||
vkStringArrayList extensions = vkStringArrayListCreate();
|
vkStringArrayList extensions = vkStringArrayListCreate();
|
||||||
@@ -75,8 +75,7 @@ gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInf
|
|||||||
createInfo.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
|
createInfo.flags |= VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (int i = 0; i < instanceInfo->debuggerInfo.layerCount; i++) {
|
if (instance->enabledLayerCounts[GN_DEBUGGER_LAYER_PLATFORM] > 0) {
|
||||||
if (instanceInfo->debuggerInfo.layers[i] == GN_DEBUGGER_LAYER_PLATFORM) {
|
|
||||||
vkStringArrayListAdd(&extensions, VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
|
vkStringArrayListAdd(&extensions, VK_EXT_DEBUG_UTILS_EXTENSION_NAME);
|
||||||
|
|
||||||
const char* validation_layers[1] = { "VK_LAYER_KHRONOS_validation" };
|
const char* validation_layers[1] = { "VK_LAYER_KHRONOS_validation" };
|
||||||
@@ -95,7 +94,6 @@ gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInf
|
|||||||
debugCreateInfo.pUserData = &instance->instance->userData;
|
debugCreateInfo.pUserData = &instance->instance->userData;
|
||||||
createInfo.pNext = &debugCreateInfo;
|
createInfo.pNext = &debugCreateInfo;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
createInfo.enabledExtensionCount = extensions.count;
|
createInfo.enabledExtensionCount = extensions.count;
|
||||||
@@ -103,6 +101,7 @@ gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInf
|
|||||||
return VkResultToGnReturnCode(vkCreateInstance(&createInfo, NULL, &instance->instance->vk_instance));
|
return VkResultToGnReturnCode(vkCreateInstance(&createInfo, NULL, &instance->instance->vk_instance));
|
||||||
}
|
}
|
||||||
|
|
||||||
void vulkanDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next) {
|
void vulkanDestroyInstance(gnInstanceHandle instance, gryphnInstanceFunctionLayers* next) {
|
||||||
|
printf("destroying layer\n");
|
||||||
vkDestroyInstance(instance->instance->vk_instance, NULL);
|
vkDestroyInstance(instance->instance->vk_instance, NULL);
|
||||||
}
|
}
|
||||||
|
@@ -14,8 +14,8 @@ typedef struct gnPlatformInstance_t {
|
|||||||
vkUserData userData;
|
vkUserData userData;
|
||||||
} gnPlatformInstance;
|
} gnPlatformInstance;
|
||||||
|
|
||||||
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next);
|
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnInstanceFunctionLayers* next);
|
||||||
void vulkanDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next);
|
void vulkanDestroyInstance(gnInstanceHandle instance, gryphnInstanceFunctionLayers* next);
|
||||||
|
|
||||||
typedef const char* vkString;
|
typedef const char* vkString;
|
||||||
GN_ARRAY_LIST(vkString);
|
GN_ARRAY_LIST(vkString);
|
||||||
|
@@ -29,7 +29,9 @@ typedef gnBool (*gnDebuggerCallback)(
|
|||||||
|
|
||||||
typedef enum gnDebuggerLayer {
|
typedef enum gnDebuggerLayer {
|
||||||
GN_DEBUGGER_LAYER_PLATFORM, // enable platform (vulkan validation) layers
|
GN_DEBUGGER_LAYER_PLATFORM, // enable platform (vulkan validation) layers
|
||||||
GN_DEBUGGER_LAYER_FUNCTIONS // enable the checks on every function
|
GN_DEBUGGER_LAYER_FUNCTIONS, // enable the checks on every function
|
||||||
|
|
||||||
|
GN_LAYER_MAX
|
||||||
} gnDebuggerLayer;
|
} gnDebuggerLayer;
|
||||||
|
|
||||||
typedef struct gnDebuggerCreateInfo {
|
typedef struct gnDebuggerCreateInfo {
|
||||||
|
@@ -6,7 +6,8 @@
|
|||||||
#include "loader/src/gryphn_loader.h"
|
#include "loader/src/gryphn_loader.h"
|
||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
|
|
||||||
#include "apis/vulkan/loader/vulkan_loader.h"
|
#include "validation_layers/function_loader/loader/function_loader.h"
|
||||||
|
|
||||||
|
|
||||||
// this implementation of gnCreateInstance cannot return GN_UNLOADED_LAYER
|
// this implementation of gnCreateInstance cannot return GN_UNLOADED_LAYER
|
||||||
gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceCreateInfo* info) {
|
gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceCreateInfo* info) {
|
||||||
@@ -14,8 +15,6 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceCreateInfo*
|
|||||||
(*instance)->hasDebugger = GN_FALSE;
|
(*instance)->hasDebugger = GN_FALSE;
|
||||||
(*instance)->layers = loaderLayerArrayListCreate();
|
(*instance)->layers = loaderLayerArrayListCreate();
|
||||||
|
|
||||||
(*instance)->functions = gryphnLoadAPILayer(info->coreAPI);
|
|
||||||
|
|
||||||
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){
|
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){
|
||||||
.api = info->coreAPI,
|
.api = info->coreAPI,
|
||||||
.layerToLoad = api_layer
|
.layerToLoad = api_layer
|
||||||
@@ -23,6 +22,7 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceCreateInfo*
|
|||||||
|
|
||||||
gnBool unsupportedExtension = GN_FALSE;
|
gnBool unsupportedExtension = GN_FALSE;
|
||||||
for (int c = 0; c < GN_EXT_MAX; c++) (*instance)->enabledExtensions[c] = GN_FALSE;
|
for (int c = 0; c < GN_EXT_MAX; c++) (*instance)->enabledExtensions[c] = GN_FALSE;
|
||||||
|
for (int c = 0; c < GN_LAYER_MAX; c++) (*instance)->enabledLayerCounts[c] = 0;
|
||||||
for (int i = 0; i < info->extensionCount; i++) {
|
for (int i = 0; i < info->extensionCount; i++) {
|
||||||
(*instance)->enabledExtensions[info->extensions[i]] = GN_TRUE;
|
(*instance)->enabledExtensions[info->extensions[i]] = GN_TRUE;
|
||||||
if (!gnIsExtensionSuppoted(info->coreAPI, info->extensions[i])) unsupportedExtension = GN_TRUE;
|
if (!gnIsExtensionSuppoted(info->coreAPI, info->extensions[i])) unsupportedExtension = GN_TRUE;
|
||||||
@@ -33,6 +33,8 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceCreateInfo*
|
|||||||
|
|
||||||
if (info->debuggerInfo.layerCount > 0) {
|
if (info->debuggerInfo.layerCount > 0) {
|
||||||
for (int i = 0; i < info->debuggerInfo.layerCount; i++) {
|
for (int i = 0; i < info->debuggerInfo.layerCount; i++) {
|
||||||
|
(*instance)->enabledLayerCounts[info->debuggerInfo.layers[i]]++;
|
||||||
|
|
||||||
if (info->debuggerInfo.layers[i] == GN_DEBUGGER_LAYER_FUNCTIONS) {
|
if (info->debuggerInfo.layers[i] == GN_DEBUGGER_LAYER_FUNCTIONS) {
|
||||||
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){
|
loaderLayerArrayListAdd(&(*instance)->layers, loadLayer((loaderInfo){
|
||||||
.api = info->coreAPI,
|
.api = info->coreAPI,
|
||||||
@@ -44,15 +46,27 @@ gnReturnCode gnCreateInstance(gnInstanceHandle* instance, gnInstanceCreateInfo*
|
|||||||
(*instance)->hasDebugger = GN_TRUE;
|
(*instance)->hasDebugger = GN_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
(*instance)->allLayers = malloc(sizeof(gryphnInstanceFunctionLayers) * (
|
||||||
|
(*instance)->enabledLayerCounts[GN_DEBUGGER_LAYER_FUNCTIONS] +
|
||||||
|
1 // for the core layer
|
||||||
|
));
|
||||||
|
|
||||||
|
int layerIDX = 0;
|
||||||
|
for (int i = 0; i < info->debuggerInfo.layerCount; i++) {
|
||||||
|
if (info->debuggerInfo.layers[i] == GN_DEBUGGER_LAYER_FUNCTIONS) (*instance)->allLayers[layerIDX++] = checkerLoadInstanceFunctions();
|
||||||
|
(*instance)->allLayers[layerIDX - 1].next = &(*instance)->allLayers[layerIDX];
|
||||||
|
}
|
||||||
|
(*instance)->allLayers[layerIDX] = gryphnLoadAPILayer(info->coreAPI);
|
||||||
|
(*instance)->functions = &(*instance)->allLayers[0];
|
||||||
(*instance)->currentLayer = ((*instance)->layers.count - 1);
|
(*instance)->currentLayer = ((*instance)->layers.count - 1);
|
||||||
for (int i = 0; i < (*instance)->layers.count; i++) (*instance)->layers.data[i].layerIndex = i;
|
for (int i = 0; i < (*instance)->layers.count; i++) (*instance)->layers.data[i].layerIndex = i;
|
||||||
(*instance)->callingLayer = &(*instance)->layers.data[(*instance)->layers.count - 1];
|
(*instance)->callingLayer = &(*instance)->layers.data[(*instance)->layers.count - 1];
|
||||||
if (unsupportedExtension) return GN_UNLOADED_EXTENSION;
|
if (unsupportedExtension) return GN_UNLOADED_EXTENSION;
|
||||||
return (*instance)->functions.createInstance.func(*instance, info, NULL);
|
return (*instance)->functions->createInstance(*instance, info, (*instance)->functions->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
void gnDestroyInstance(gnInstanceHandle* instance) {
|
void gnDestroyInstance(gnInstanceHandle* instance) {
|
||||||
if (instance == GN_NULL_HANDLE) return;
|
if (instance == GN_NULL_HANDLE) return;
|
||||||
(*instance)->functions.destroyInstance.func(*instance, NULL);
|
(*instance)->functions->destroyInstance(*instance, (*instance)->functions->next);
|
||||||
*instance = GN_NULL_HANDLE;
|
*instance = GN_NULL_HANDLE;
|
||||||
}
|
}
|
||||||
|
@@ -29,8 +29,9 @@ struct gnInstance_t {
|
|||||||
struct gnPlatformInstance_t* instance;
|
struct gnPlatformInstance_t* instance;
|
||||||
gnDebuggerCreateInfo debugger;
|
gnDebuggerCreateInfo debugger;
|
||||||
gnBool enabledExtensions[GN_EXT_MAX];
|
gnBool enabledExtensions[GN_EXT_MAX];
|
||||||
|
int enabledLayerCounts[GN_LAYER_MAX];
|
||||||
gryphnInstanceFunctionLayers functions;
|
gryphnInstanceFunctionLayers* allLayers;
|
||||||
|
gryphnInstanceFunctionLayers* functions;
|
||||||
|
|
||||||
loaderLayerArrayList layers;
|
loaderLayerArrayList layers;
|
||||||
loaderLayer* callingLayer;
|
loaderLayer* callingLayer;
|
||||||
|
@@ -3,7 +3,6 @@
|
|||||||
#include "core/gryphn_return_code.h"
|
#include "core/gryphn_return_code.h"
|
||||||
#include "utils/gryphn_bool.h"
|
#include "utils/gryphn_bool.h"
|
||||||
#include "gryphn_handles.h"
|
#include "gryphn_handles.h"
|
||||||
#include "gryphn_loader_helpers.h"
|
|
||||||
|
|
||||||
typedef struct gnInstanceCreateInfo gnInstanceCreateInfo;
|
typedef struct gnInstanceCreateInfo gnInstanceCreateInfo;
|
||||||
typedef struct gnSurfaceDetails gnSurfaceDetails;
|
typedef struct gnSurfaceDetails gnSurfaceDetails;
|
||||||
@@ -19,13 +18,9 @@ typedef struct gnOutputDeviceInfo gnOutputDeviceInfo;
|
|||||||
typedef struct gnMacOSWindowSurfaceInfo gnMacOSWindowSurfaceInfo;
|
typedef struct gnMacOSWindowSurfaceInfo gnMacOSWindowSurfaceInfo;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct PFN_gnCreateInstance_layer PFN_gnCreateInstance_layer;
|
typedef struct gryphnInstanceFunctionLayers gryphnInstanceFunctionLayers;
|
||||||
typedef gnReturnCode (*PFN_gnCreateInstance)(gnInstanceHandle instance, gnInstanceCreateInfo* info, PFN_gnCreateInstance_layer* next);
|
typedef gnReturnCode (*PFN_gnCreateInstance)(gnInstanceHandle instance, gnInstanceCreateInfo* info, gryphnInstanceFunctionLayers* next);
|
||||||
gryphnFunctionLayer(PFN_gnCreateInstance);
|
typedef void (*PFN_gnDestroyInstance)(gnInstanceHandle instance, gryphnInstanceFunctionLayers* next);
|
||||||
|
|
||||||
typedef struct PFN_gnDestroyInstance_layer PFN_gnDestroyInstance_layer;
|
|
||||||
typedef void (*PFN_gnDestroyInstance)(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next);
|
|
||||||
gryphnFunctionLayer(PFN_gnDestroyInstance);
|
|
||||||
|
|
||||||
typedef struct gnInstanceFunctions {
|
typedef struct gnInstanceFunctions {
|
||||||
gnPhysicalDevice* (*_gnGetPhysicalDevices)(gnInstanceHandle instance, uint32_t* count);
|
gnPhysicalDevice* (*_gnGetPhysicalDevices)(gnInstanceHandle instance, uint32_t* count);
|
||||||
|
@@ -14,9 +14,11 @@ typedef struct gryphnFunctionLayer {
|
|||||||
} gryphnFunctionLayer;
|
} gryphnFunctionLayer;
|
||||||
|
|
||||||
typedef struct gryphnInstanceFunctionLayers {
|
typedef struct gryphnInstanceFunctionLayers {
|
||||||
PFN_gnCreateInstance_layer createInstance;
|
PFN_gnCreateInstance createInstance;
|
||||||
PFN_gnDestroyInstance_layer destroyInstance;
|
PFN_gnDestroyInstance destroyInstance;
|
||||||
|
struct gryphnInstanceFunctionLayers* next;
|
||||||
} gryphnInstanceFunctionLayers;
|
} gryphnInstanceFunctionLayers;
|
||||||
|
|
||||||
gryphnInstanceFunctionLayers gryphnLoadAPILayer(gnRenderingAPI api);
|
gryphnInstanceFunctionLayers gryphnLoadAPILayer(gnRenderingAPI api);
|
||||||
|
|
||||||
typedef struct loaderLayer {
|
typedef struct loaderLayer {
|
||||||
|
@@ -1,6 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#define gryphnFunctionLayer(function) typedef struct function##_layer { \
|
|
||||||
function func;\
|
|
||||||
struct function##_layer* next; \
|
|
||||||
} function##_layer;\
|
|
@@ -7,8 +7,8 @@
|
|||||||
|
|
||||||
gryphnInstanceFunctionLayers checkerLoadInstanceFunctions() {
|
gryphnInstanceFunctionLayers checkerLoadInstanceFunctions() {
|
||||||
return (gryphnInstanceFunctionLayers) {
|
return (gryphnInstanceFunctionLayers) {
|
||||||
.createInstance = { checkCreateInstance, NULL },
|
.createInstance = checkCreateInstance,
|
||||||
.destroyInstance = { checkDestroyInstance, NULL }
|
.destroyInstance = checkDestroyInstance
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -3,6 +3,9 @@
|
|||||||
#include "loader/src/gryphn_device_functions.h"
|
#include "loader/src/gryphn_device_functions.h"
|
||||||
#include "loader/src/gryphn_command_functions.h"
|
#include "loader/src/gryphn_command_functions.h"
|
||||||
|
|
||||||
|
typedef struct gryphnInstanceFunctionLayers gryphnInstanceFunctionLayers;
|
||||||
|
gryphnInstanceFunctionLayers checkerLoadInstanceFunctions();
|
||||||
|
|
||||||
gnInstanceFunctions loadFunctionLoaderInstanceFunctions();
|
gnInstanceFunctions loadFunctionLoaderInstanceFunctions();
|
||||||
gnDeviceFunctions loadFunctionLoaderDeviceFunctions();
|
gnDeviceFunctions loadFunctionLoaderDeviceFunctions();
|
||||||
gnCommandFunctions loadFunctionLoaderCommandFunctions();
|
gnCommandFunctions loadFunctionLoaderCommandFunctions();
|
||||||
|
@@ -4,23 +4,24 @@
|
|||||||
#include "core/src/output_device/gryphn_output_device.h"
|
#include "core/src/output_device/gryphn_output_device.h"
|
||||||
#include "core/src/window_surface/gryphn_surface.h"
|
#include "core/src/window_surface/gryphn_surface.h"
|
||||||
|
|
||||||
gnReturnCode checkCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* info, PFN_gnCreateInstance_layer* next) {
|
gnReturnCode checkCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* info, gryphnInstanceFunctionLayers* next) {
|
||||||
if (next->func == NULL) {
|
if (next == NULL || next->createInstance == NULL) {
|
||||||
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
||||||
.message = gnCreateString("Failed to load gnCreateInstance this indicates a bug within gryphn")
|
.message = gnCreateString("Failed to load gnCreateInstance this indicates a bug within gryphn")
|
||||||
});
|
});
|
||||||
return GN_FAILED_TO_LOAD_FUNCTION;
|
return GN_FAILED_TO_LOAD_FUNCTION;
|
||||||
}
|
}
|
||||||
return (*(PFN_gnCreateInstance*)next->func)(instance, info, next->next);
|
return next->createInstance(instance, info, next->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
void checkDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next) {
|
void checkDestroyInstance(gnInstanceHandle instance, gryphnInstanceFunctionLayers* next) {
|
||||||
if (next->func == NULL) {
|
if (next == NULL || next->destroyInstance == NULL) {
|
||||||
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
gnDebuggerSetErrorMessage(instance->debugger, (gnMessageData){
|
||||||
.message = gnCreateString("Failed to load gnDestroyInstance this indicates a bug within gryphn")
|
.message = gnCreateString("Failed to load gnDestroyInstance this indicates a bug within gryphn")
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
(*(PFN_gnDestroyInstance*)next->func)(instance, next->next);
|
next->destroyInstance(instance, next->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
gnPhysicalDevice* checkGetPhysicalDevices(gnInstanceHandle instance, uint32_t* count) {
|
gnPhysicalDevice* checkGetPhysicalDevices(gnInstanceHandle instance, uint32_t* count) {
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
#include "core/src/instance/gryphn_instance.h"
|
#include "core/src/instance/gryphn_instance.h"
|
||||||
#include <core/src/window_surface/gryphn_surface_create_functions.h>
|
#include <core/src/window_surface/gryphn_surface_create_functions.h>
|
||||||
|
|
||||||
gnReturnCode checkCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* info, PFN_gnCreateInstance_layer* next);
|
gnReturnCode checkCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* info, gryphnInstanceFunctionLayers* next);
|
||||||
void checkDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next);
|
void checkDestroyInstance(gnInstanceHandle instance, gryphnInstanceFunctionLayers* next);
|
||||||
|
|
||||||
gnPhysicalDevice* checkGetPhysicalDevices(gnInstanceHandle instance, uint32_t* count);
|
gnPhysicalDevice* checkGetPhysicalDevices(gnInstanceHandle instance, uint32_t* count);
|
||||||
gnBool checkCanDevicePresent(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);
|
gnBool checkCanDevicePresent(gnPhysicalDevice device, gnWindowSurfaceHandle windowSurface);
|
||||||
|
Reference in New Issue
Block a user