KhronosGroup/Vulkan-LoaderAndValidationLayers

Validation layers print errors when creating a device using supported device features from extensions

Whenning42 opened this issue · 0 comments

Creating a device with supported physical device features added by extensions prints errors. It looks like the validation layers are currently only tracking physical device features returned from a call to vkGetPhysicalDeviceFeatures, and so the layers think any physical device features added by extensions are unsupported.

An example of this is that running the following code using the testing framework:

ASSERT_NO_FATAL_FAILURE(InitFramework(myDbgFunc, m_errorMonitor));
auto indexingFeatures = lvl_init_struct<VkPhysicalDeviceDescriptorIndexingFeaturesEXT>();
auto features2 = lvl_init_struct<VkPhysicalDeviceFeatures2KHR>(&indexingFeatures);
vkGetPhysicalDeviceFeatures2(gpu(), &features2);
ASSERT_NO_FATAL_FAILURE(InitState(nullptr, &features2));

prints the following errors:

Unexpected: Object: VK_NULL_HANDLE (Type = 2) | While calling vkCreateDevice(), requesting feature 'textureCompressionETC2' in VkPhysicalDeviceFeatures struct, which is not available on this device.
Unexpected: Object: VK_NULL_HANDLE (Type = 2) | While calling vkCreateDevice(), requesting feature 'textureCompressionASTC_LDR' in VkPhysicalDeviceFeatures struct, which is not available on this device.
Unexpected: Object: VK_NULL_HANDLE (Type = 2) | You requested features that are unavailable on this device. You should first query feature availability by calling vkGetPhysicalDeviceFeatures().