essentially finish the loader rewrite
This commit is contained in:
@@ -7,5 +7,5 @@ typedef struct gnPlatformInstance_t {
|
||||
NSView* metalContentView;
|
||||
} gnPlatformInstance;
|
||||
|
||||
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnFunctionLayer* next);
|
||||
void metalDestroyInstance(gnInstance instance, gryphnFunctionLayer* next);
|
||||
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next);
|
||||
void metalDestroyInstance(gnInstance instance, PFN_gnDestroyInstance_layer* next);
|
||||
|
@@ -1,10 +1,10 @@
|
||||
#include "metal_instance.h"
|
||||
|
||||
// metal instances are kinda useless
|
||||
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnFunctionLayer* next) {
|
||||
gnReturnCode metalCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next) {
|
||||
if (instance->instance == NULL) instance->instance = malloc(sizeof(gnPlatformInstance));
|
||||
return GN_SUCCESS;
|
||||
}
|
||||
void metalDestroyInstance(gnInstanceHandle instance, gryphnFunctionLayer* next) {
|
||||
void metalDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next) {
|
||||
free(instance->instance);
|
||||
}
|
||||
|
@@ -6,8 +6,8 @@
|
||||
|
||||
gryphnInstanceFunctionLayers loadVulkanAPILayer() {
|
||||
return (gryphnInstanceFunctionLayers) {
|
||||
.createInstance = {vulkanCreateInstance, NULL},
|
||||
.destroyInstance = {vulkanDestroyInstance, NULL}
|
||||
.createInstance = { vulkanCreateInstance, NULL },
|
||||
.destroyInstance = { vulkanDestroyInstance, NULL }
|
||||
};
|
||||
}
|
||||
|
||||
|
@@ -1,6 +1,8 @@
|
||||
#include "vulkan_instance.h"
|
||||
#include "vulkan_result_converter.h"
|
||||
|
||||
#include "stdio.h"
|
||||
|
||||
static VKAPI_ATTR VkBool32 VKAPI_CALL vk_debuggerDebugCallback(
|
||||
VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
|
||||
VkDebugUtilsMessageTypeFlagsEXT messageType,
|
||||
@@ -35,7 +37,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL vk_debuggerDebugCallback(
|
||||
return VK_TRUE;
|
||||
}
|
||||
|
||||
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnFunctionLayer* next) {
|
||||
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next) {
|
||||
instance->instance = malloc(sizeof(gnPlatformInstance));
|
||||
|
||||
vkStringArrayList extensions = vkStringArrayListCreate();
|
||||
@@ -101,6 +103,6 @@ gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInf
|
||||
return VkResultToGnReturnCode(vkCreateInstance(&createInfo, NULL, &instance->instance->vk_instance));
|
||||
}
|
||||
|
||||
void vulkanDestroyInstance(gnInstanceHandle instance, gryphnFunctionLayer* next) {
|
||||
void vulkanDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next) {
|
||||
vkDestroyInstance(instance->instance->vk_instance, NULL);
|
||||
}
|
||||
|
@@ -14,8 +14,8 @@ typedef struct gnPlatformInstance_t {
|
||||
vkUserData userData;
|
||||
} gnPlatformInstance;
|
||||
|
||||
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, gryphnFunctionLayer* next);
|
||||
void vulkanDestroyInstance(gnInstanceHandle instance, gryphnFunctionLayer* next);
|
||||
gnReturnCode vulkanCreateInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance_layer* next);
|
||||
void vulkanDestroyInstance(gnInstanceHandle instance, PFN_gnDestroyInstance_layer* next);
|
||||
|
||||
typedef const char* vkString;
|
||||
GN_ARRAY_LIST(vkString);
|
||||
|
Reference in New Issue
Block a user