不能将 pNext 设置为 NULL

Can not set pNext to be NULL

我正在尝试在 C 中设置 Vulkan。但是后来我创建了我的 VkInstanceCreateInfo 并将 pNext 设置为 NULL 我收到一个错误。

Vulkan documentation 声明 'pNext is NULL or a pointer to a structure extending this structure.' 但是当我将 pNext 设置为 NULL 时,我得到这个错误告诉我 pNext 必须是 NULL .

Error

VUID-VkApplicationInfo-pNext-pNext(ERROR / SPEC): msgNum: 1223396377 - Validation Error: [ VUID-VkApplicationInfo-pNext-pNext ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x48eb8c19 | vkCreateInstance: value of pCreateInfo->pApplicationInfo->pNext must be NULL. This error is based on the Valid Usage documentation for version 154 of the Vulkan header. It is possible that you are using a struct from a private extension or an extension that was added to a later version of the Vulkan header, in which case the use of pCreateInfo->pApplicationInfo->pNext is undefined and may not work correctly with validation enabled The Vulkan spec states: pNext must be NULL Objects: 1 [0] 0, type: 3, name: NULL

Code

 ...

 VkInstanceCreateInfo vulkanInstanceCreateInfo;
 vulkanInstanceCreateInfo.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO;
 vulkanInstanceCreateInfo.pNext = NULL;
 vulkanInstanceCreateInfo.flags = 0;
 vulkanInstanceCreateInfo.pApplicationInfo = &vulkanApplicationInfo;
 vulkanInstanceCreateInfo.enabledExtensionCount = glfwExtensionCount;
 vulkanInstanceCreateInfo.ppEnabledExtensionNames = glfwExtensions;

 /* validation layers */
 if(VALIDATION_LAYERS_ENABLED){
   vulkanInstanceCreateInfo.enabledLayerCount = validationLayersCount;
   vulkanInstanceCreateInfo.ppEnabledLayerNames = validationLayers;
 }else
   vulkanInstanceCreateInfo.enabledLayerCount = 0;

 ...

错误不是关于 VkInstanceCreateInfo,而是关于 VkApplicationInfo。我没有在那里设置我的 pNext。