add real vulkan check

This commit is contained in:
Gregory Wells
2026-05-24 14:01:43 -04:00
parent 2379e3ae6b
commit 01148e2dad
2 changed files with 23 additions and 3 deletions
+1 -1
View File
@@ -2,4 +2,4 @@ file(GLOB_RECURSE VULKAN_SOURCES CONFIGURE_DEPENDS "src/*.c")
add_library(gryphn_vulkan SHARED ${VULKAN_SOURCES})
project(gryphn_vulkan LANGUAGES C)
set_target_properties(gryphn_vulkan PROPERTIES PREFIX "")
target_link_libraries(gryphn_vulkan PRIVATE GryphnLoader)
target_link_libraries(gryphn_vulkan PRIVATE GryphnLoader vulkan)
+22 -2
View File
@@ -1,10 +1,30 @@
#include "stdio.h"
#include "instance/gryphn_instance.h"
#include "gryphn_handle.h"
#include "vulkan/vulkan.h"
uint32_t gnInternalIsApiSupported(gnVersion gryphnVersion) {
if (gryphnVersion != gnCreateVersion(1, 0, 0)) return 0;
uint32_t gnInternalIsApiSupported(gnVersion version) {
if (version != gnCreateVersion(1, 0, 0)) return 0;
VkApplicationInfo appInfo = {
.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO,
.pApplicationName = "Gryphn Vulkan Test",
.applicationVersion = VK_MAKE_VERSION(1, 0, 0),
.pEngineName = "Gryphn Vulkan Test",
.engineVersion = VK_MAKE_VERSION(1, 0, 0),
.apiVersion = VK_API_VERSION_1_0
};
VkInstanceCreateInfo createInfo = {
.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO,
.pApplicationInfo = &appInfo
};
VkInstance instance;
VkResult result = vkCreateInstance(&createInfo, NULL, &instance);
if (result != VK_SUCCESS)
return 0;
vkDestroyInstance(instance, NULL);
return 1;
}