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:


std::vector<const char*> deviceExtensions;

The constructor 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:


...

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


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.

Hahahaha thank you, can’t believe I missed that typo for two hours of debugging!