Results 1 to 3 of 3

Thread: VK_KHR_swapchain extension missing (unable to create a logical device)?

  1. #1
    Newbie
    Join Date
    Nov 2018
    Posts
    2

    VK_KHR_swapchain extension missing (unable to create a logical device)?

    Hello!

    I am unable to create a logical device when I add VK_KHR_SWAPCHAIN_EXTENSION_NAME to ppEnabledExtensionNames (in the VkDeviceCreateInfo struct). At first I was suspicious that I was missing a driver but the spinning cube demo that came with the installation works just fine.

    Here is the header code:
    Code :
    std::vector<const char*> deviceExtensions;

    The constructor code:
    Code :
    const char* deviceExtensionsString = "VK_KHR_swapchain"; //VK_KHR_SWAPCHAIN_EXTENSION_NAME; (I've tried both!)
    deviceExtensions.push_back(standardValidationString);

    And the logical device creation code:
    Code :
    ...
     
    createInfo.enabledExtensionCount = static_cast<uint32_t>(deviceExtensions.size());
    createInfo.ppEnabledExtensionNames = deviceExtensions.data();
     
    if (vkCreateDevice(physicalDevice, &createInfo, nullptr, &device) != VK_SUCCESS) 
    {
        throw std::runtime_error("[CRITICAL ERROR] Failed to create logical device!");
    }

    Thanks for any help!
    Alek

  2. #2
    Senior Member
    Join Date
    Mar 2016
    Posts
    331
    Code :
    const char* deviceExtensionsString = "VK_KHR_swapchain"; //VK_KHR_SWAPCHAIN_EXTENSION_NAME; (I've tried both!)
    deviceExtensions.push_back(standardValidationString);

    You are pushing to the vector a different variable. Furthemore standardValidationString probably contains something unsupported, which is causing the error.

  3. #3
    Newbie
    Join Date
    Nov 2018
    Posts
    2
    Hahahaha thank you, can't believe I missed that typo for two hours of debugging!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean