portability/native/test.c
2017-09-06 22:02:03 -04:00

32 lines
791 B
C

#include "vulkan/vulkan.h"
#include <stdio.h>
#include <stdlib.h>
int main() {
VkInstanceCreateInfo inst_info = {};
inst_info.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
inst_info.pNext = NULL;
inst_info.flags = 0;
inst_info.pApplicationInfo = NULL;
inst_info.enabledExtensionCount = 0;
inst_info.ppEnabledExtensionNames = NULL;
inst_info.enabledLayerCount = 0;
inst_info.ppEnabledLayerNames = NULL;
VkInstance inst;
VkResult res;
res = vkCreateInstance(&inst_info, NULL, &inst);
if (res == VK_ERROR_INCOMPATIBLE_DRIVER) {
printf("cannot find a compatible Vulkan ICD\n");
exit(-1);
} else if (res) {
printf("unknown error\n");
exit(-1);
}
vkDestroyInstance(inst, NULL);
return 0;
}