redo some instance funcions stuff

This commit is contained in:
Gregory Wells
2025-08-03 09:28:49 -04:00
parent 797191c2b6
commit 77b52b5d2d
8 changed files with 20 additions and 18 deletions

View File

@@ -19,7 +19,6 @@ target_include_directories(GryphnMetalImpl PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../platform/
${CMAKE_CURRENT_SOURCE_DIR}/../../../depends/
${CMAKE_CURRENT_SOURCE_DIR}/src/
depends/SPIRV-Cross/
)
add_compile_definitions(GN_REVEAL_IMPL)
add_subdirectory(depends/SPIRV-Cross)

View File

@@ -6,14 +6,14 @@
gnInstanceFunctions loadVulkanInstanceFunctions() {
return (gnInstanceFunctions){
._gnCreateInstance = createInstance,
._gnDestroyInstance = destroyInstance,
.createInstance = (PFN_gnCreateInstance)createVulkanInstance,
.destroyInstance = (PFN_gnDestroyInstance)destroyVulkanInstance,
._gnGetPhysicalDevices = getPhysicalDevices,
._gnPhysicalDeviceCanPresentToSurface = deviceCanPresentToSurface,
._gnCreateOutputDevice = createOutputDevice,
._gnDestroyOutputDevice = destroyOutputDevice,
._gnCreateOutputDevice = createVulkanOutputDevice,
._gnDestroyOutputDevice = destroyVulkanOutputDevice,
#ifdef GN_PLATFORM_LINUX

View File

@@ -35,7 +35,7 @@ static VKAPI_ATTR VkBool32 VKAPI_CALL vk_debuggerDebugCallback(
return VK_TRUE;
}
gnReturnCode createInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo) {
gnReturnCode createVulkanInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance* next) {
instance->instance = malloc(sizeof(gnPlatformInstance));
vkStringArrayList extensions = vkStringArrayListCreate();
@@ -101,6 +101,6 @@ gnReturnCode createInstance(gnInstanceHandle instance, gnInstanceCreateInfo* ins
return VkResultToGnReturnCode(vkCreateInstance(&createInfo, NULL, &instance->instance->vk_instance));
}
void destroyInstance(gnInstanceHandle instance) {
void destroyVulkanInstance(gnInstanceHandle instance, PFN_gnDestroyInstance* next) {
vkDestroyInstance(instance->instance->vk_instance, NULL);
}

View File

@@ -2,6 +2,7 @@
#include <vulkan/vulkan.h>
#include "instance/gryphn_instance.h"
#include "utils/lists/gryphn_array_list.h"
#include "loader/src/gryphn_instance_functions.h"
typedef struct vkUserData {
gnDebuggerCallback debuggerCallback;
@@ -13,9 +14,8 @@ typedef struct gnPlatformInstance_t {
vkUserData userData;
} gnPlatformInstance;
gnReturnCode createInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo);
void destroyInstance(gnInstanceHandle instance);
gnReturnCode createVulkanInstance(gnInstanceHandle instance, gnInstanceCreateInfo* instanceInfo, PFN_gnCreateInstance* next);
void destroyVulkanInstance(gnInstanceHandle instance, PFN_gnDestroyInstance* next);
typedef const char* vkString;
GN_ARRAY_LIST(vkString);