[Solved] Enabling 1.1 features in a 1.1 instance

Going off the example here I am trying to enable a 1.1 feature in a version 1.1 instance:

But I get a validation error saying that the stype constant is declared in Vulkan 1.2 and can’t be used in 1.1??? If so, how the heck to I enable 1.1 features in Vulkan 1.1?

Validation Error: [ VUID-VkDeviceCreateInfo-pNext-pNext ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_INSTANCE; | MessageID = 0x901f59ec | vkCreateDevice: Includes a pNext pointer (pCreateInfo->pNext) to a VkStructureType (VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES) which was added in VK_API_VERSION_1_2 but the current effective API version is 1.1.0 (0x00401000). The Vulkan spec states: Each pNext member of any structure (including this one) in the pNext chain must be either NULL or a pointer to a valid instance of blah blah blah…
(https://vulkan.lunarg.com/doc/view/1.2.170.0/windows/1.2-extensions/vkspec.html#VUID-VkDeviceCreateInfo-pNext-pNext)

			//------------------------------------------------------
			// Vulkan 1.1 features
			//------------------------------------------------------
			VkPhysicalDeviceVulkan11Features features11 = {};
			features11.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_VULKAN_1_1_FEATURES;
			features11.multiview = VK_TRUE;
			VkPhysicalDeviceFeatures2 physical_features2 = {};
			physical_features2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2;
			physical_features2.pNext = &features11;
			vkGetPhysicalDeviceFeatures2(devices[n], &physical_features2);
			device_info.pNext = &physical_features2;
			//------------------------------------------------------
			// 
			//------------------------------------------------------

			res = vkCreateDevice(devices[n], &device_info, nullptr, &device);
			if (res == VK_SUCCESS)
			{
				physicaldevice = devices[n];
				VkPhysicalDeviceProperties deviceprops = VkPhysicalDeviceProperties{};
				vkGetPhysicalDeviceProperties(devices[n], &deviceprops);
				break;
			}

Here is the only mention I can find of this issue:
https://gitter.im/mosra/magnum?at=5fda0561c614d23c2e10

VkPhysicalDeviceVulkan11Features is a 1.2 struct added for convenience. You cannot use it in 1.1.

Spec nowadays shows this conveniently, so watch for those dependencies:

obrazek

You can use VkPhysicalDeviceMultiviewFeatures instead for your feature.

Thank you for the information.

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.