Created
February 17, 2021 19:01
-
-
Save rg3/4dc72ac436872af2be97cdcef5320196 to your computer and use it in GitHub Desktop.
Vulkan program using invalid sType value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vulkan/vulkan.h> | |
#include <iostream> | |
int main(void) | |
{ | |
VkInstance instance = VK_NULL_HANDLE; | |
const VkApplicationInfo appInfo = | |
{ | |
VK_STRUCTURE_TYPE_APPLICATION_INFO, // VkStructureType sType; | |
nullptr, // const void* pNext; | |
"app", // const char* pApplicationName; | |
VK_VERSION_1_0, // uint32_t applicationVersion; | |
"engine", // const char* pEngineName; | |
VK_VERSION_1_0, // uint32_t engineVersion; | |
VK_API_VERSION_1_0, // uint32_t apiVersion; | |
}; | |
const VkInstanceCreateInfo instanceInfo = | |
{ | |
VK_STRUCTURE_TYPE_MAX_ENUM, // VkStructureType sType; | |
nullptr, // const void* pNext; | |
0u, // VkInstanceCreateFlags flags; | |
&appInfo, // const VkApplicationInfo* pApplicationInfo; | |
0u, // uint32_t enabledLayerCount; | |
nullptr, // const char* const* ppEnabledLayerNames; | |
0u, // uint32_t enabledExtensionCount; | |
nullptr, // const char* const* ppEnabledExtensionNames; | |
}; | |
vkCreateInstance(&instanceInfo, nullptr, &instance); | |
if (instance != VK_NULL_HANDLE) | |
vkDestroyInstance(instance, nullptr); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment