Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Vulkan program using invalid sType value
#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