KhronosGroup / Vulkan-LoaderAndValidationLayers

**Deprecated repository** for Vulkan loader and validation layers
Apache License 2.0
414 stars 172 forks source link

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

Open Whenning42 opened 6 years ago

Whenning42 commented 6 years ago

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().