问题描述
我在成功创建实例、表面和设备后尝试创建交换链.但是,vkCreateSwapchainKHR 因 VK_ERROR_OUT_OF_DEVICE_MEMORY 而失败.
I am attempting to create a swapchain after successfully creating an instance, surface, and device. However, vkCreateSwapchainKHR is failing with VK_ERROR_OUT_OF_DEVICE_MEMORY.
这是什么意思,可能的原因是什么?
What does this mean and what are the possible causes?
设备信息:
- 设备名称:GeForce GTX 970
- 驱动程序版本:1602764800
- Vulkan API 版本:4194346
API 转储:https://pastebin.com/pXebGX5t
我认为这可能与 pNext 在此处具有值有关.它在我的代码中设置为 NULL,所以可能会发生更深层次的事情,比如我的绑定问题......
I think it may be related to pNext having a value here. It is set to NULL in my code so something deeper might be happening like a problem with my binding...
vkCreateDevice(physicalDevice, pCreateInfo, pAllocator, pDevice) returns VkResult VK_SUCCESS (0):
physicalDevice: VkPhysicalDevice = 0000000004D768D0
pCreateInfo: const VkDeviceCreateInfo* = 000000000022EAD0:
sType: VkStructureType = VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO (3)
pNext: const void* = 000000000022EB20
flags: VkDeviceCreateFlags = 0
推荐答案
基于转储,您的交换链请求的格式是深度格式 (VK_FORMAT_D24_UNORM_S8_UINT
).
Based on the dump your swapchain requested format is a depth format (VK_FORMAT_D24_UNORM_S8_UINT
).
这非常可疑.
还有一些验证层可能会检查的东西(应该支持与请求的格式检查).所以帮自己一个忙,启用它们.
这篇关于vkCreateSwapchainKHR 因 VK_ERROR_OUT_OF_DEVICE_MEMORY 而失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!