add real vulkan check
This commit is contained in:
@@ -2,4 +2,4 @@ file(GLOB_RECURSE VULKAN_SOURCES CONFIGURE_DEPENDS "src/*.c")
|
|||||||
add_library(gryphn_vulkan SHARED ${VULKAN_SOURCES})
|
add_library(gryphn_vulkan SHARED ${VULKAN_SOURCES})
|
||||||
project(gryphn_vulkan LANGUAGES C)
|
project(gryphn_vulkan LANGUAGES C)
|
||||||
set_target_properties(gryphn_vulkan PROPERTIES PREFIX "")
|
set_target_properties(gryphn_vulkan PROPERTIES PREFIX "")
|
||||||
target_link_libraries(gryphn_vulkan PRIVATE GryphnLoader)
|
target_link_libraries(gryphn_vulkan PRIVATE GryphnLoader vulkan)
|
||||||
|
|||||||
@@ -1,10 +1,30 @@
|
|||||||
#include "stdio.h"
|
#include "stdio.h"
|
||||||
#include "instance/gryphn_instance.h"
|
#include "instance/gryphn_instance.h"
|
||||||
#include "gryphn_handle.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) {
|
VkApplicationInfo appInfo = {
|
||||||
if (version != gnCreateVersion(1, 0, 0)) return 0;
|
.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;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user