Vulkan 创建实例 VK_OUT_OF_HOST_MEMORY [英] Vulkan create instance VK_OUT_OF_HOST_MEMORY
问题描述
我正在尝试创建一个 VkInstance 以开始使用 Vulkan,但我已经遇到了一个未记录的错误.这是我到目前为止的所有代码:
I'm trying to create a VkInstance to get started with Vulkan and I've already run into an undocumented error. This is all the code that I have so far:
VkApplicationInfo applicationInfo = {};
applicationInfo.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO;
applicationInfo.pNext = NULL;
applicationInfo.pApplicationName = "<game>";
applicationInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0);
applicationInfo.pEngineName = "<engine>";
applicationInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0);
applicationInfo.apiVersion = VK_API_VERSION_1_0;
// setup the instance info
VkInstanceCreateInfo instanceInfo = {};
instanceInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
instanceInfo.pNext = NULL;
instanceInfo.flags = 0;
instanceInfo.pApplicationInfo = &applicationInfo;
instanceInfo.enabledLayerCount = 0;
instanceInfo.ppEnabledExtensionNames = NULL;
instanceInfo.enabledExtensionCount = 0;
instanceInfo.ppEnabledLayerNames = NULL;
// create the vk instance which is used to do stuff in vulkan
VkInstance instance;
VkResult result = vkCreateInstance(&instanceInfo, NULL, &instance);
这之后的结果是 VK_OUT_OF_HOST_MEMORY.所有关于这个的文档都说 vkCreateInstance 可能会返回这个.超级有帮助-_-.我在这里错过了什么?
the result after this is VK_OUT_OF_HOST_MEMORY. All the documentation says about this is that vkCreateInstance might return this. Super helpful -_-. What am I missing here?
推荐答案
事实证明这是 Vulkan SDK 中的一个错误,它在问题 #629 https://vulkan.lunarg.com/issue/view/584553649ab0fa4b673614cb.
This turned out to be a bug in the Vulkan SDK, which was reproduced and patched in issue #629 https://vulkan.lunarg.com/issue/view/584553649ab0fa4b673614cb.
这篇关于Vulkan 创建实例 VK_OUT_OF_HOST_MEMORY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!