summaryrefslogtreecommitdiffstats
path: root/Tests/FindVulkan/Test/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'Tests/FindVulkan/Test/main.c')
-rw-r--r--Tests/FindVulkan/Test/main.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/Tests/FindVulkan/Test/main.c b/Tests/FindVulkan/Test/main.c
new file mode 100644
index 0000000..b29c9ec
--- /dev/null
+++ b/Tests/FindVulkan/Test/main.c
@@ -0,0 +1,29 @@
+#include <vulkan/vulkan.h>
+
+int main()
+{
+ VkInstanceCreateInfo instanceCreateInfo = {};
+ instanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
+
+ VkApplicationInfo applicationInfo = {};
+ applicationInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
+ applicationInfo.apiVersion = VK_API_VERSION_1_0;
+ applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
+ applicationInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
+ applicationInfo.pApplicationName = "CMake Test application";
+ applicationInfo.pEngineName = "CMake Test Engine";
+
+ instanceCreateInfo.pApplicationInfo = &applicationInfo;
+
+ VkInstance instance = VK_NULL_HANDLE;
+ vkCreateInstance(&instanceCreateInfo, NULL, &instance);
+
+ // We can't assert here because in general vkCreateInstance will return an
+ // error if no driver is found - but if we get here, FindVulkan is working
+
+ if (instance != VK_NULL_HANDLE) {
+ vkDestroyInstance(instance, NULL);
+ }
+
+ return 0;
+}