-
Notifications
You must be signed in to change notification settings - Fork 422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Clean up for "ExtensionNotEnabled" with prerequisite framework fixes. #320
Conversation
Add interface for version aware (i.e. > 1.0) tests to specify the preferred api version. Acutally version used is the lesser of the specified version and the instance version. Test must handle getting a lower API version than requested gracefully. Change-Id: I7b700cfdf2c691453c66e41cf843ffe55f426ad4
Tests that are actually designed to by able to run at > 1.0 must declare that ability to avoid validation errors, as subsequent changes will enforce greater validation based on the appInfo.apiVersion supplied. I.e. validation will attempt to validate to the given apiVersion not the driver version. Change-Id: I86ad83eb20cd26d890c3a379f78e58b97c49dee0
Make the initialization of the extension enable tables consistent between instance and device creation. Validation will treat extension presence based on the lesser of the requested API level and the driver API level. Change-Id: I453cbf4b7da35db22c4ffdf03fdf6e361d940b2f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With notes...
@@ -2310,8 +2310,10 @@ VKAPI_ATTR VkResult VKAPI_CALL CreateDevice(VkPhysicalDevice gpu, const VkDevice | |||
// Get physical device limits for this device | |||
instance_data->dispatch_table.GetPhysicalDeviceProperties(gpu, &(device_data->phys_dev_properties.properties)); | |||
|
|||
device_data->api_version = device_data->extensions.InitFromDeviceCreateInfo( | |||
&instance_data->extensions, device_data->phys_dev_properties.properties.apiVersion, pCreateInfo); | |||
// Setup the validation tables based on the application API version from the instance and the capabilities of the device driver. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the driver version can be more or less than the instance version. For purposes of validation, if the application version is less than the driver version, we'll validate as if the driver was the lesser version.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the instance supplied version is the lesser of the instances enumerated version and the apiVersion supplied to CreateInstance. (if the apiVersion is higher than the enumerated version, CreateInstance fails)
@@ -434,6 +434,8 @@ class VkLayerTest : public VkRenderFramework { | |||
|
|||
protected: | |||
ErrorMonitor *m_errorMonitor; | |||
uint32_t m_instance_api_version = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The "instance" version is what enumerates... (or by failing to enumerate informs us of being 1.0). The "target version" is what the framework will try to create.
m_target_api_version = app_info.apiVersion; | ||
} | ||
|
||
uint32_t SetTargetApiVersion(uint32_t target_api_version) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not binding on the framework, the return is what CreateInstance will request.
@@ -22053,7 +22080,7 @@ TEST_F(VkLayerTest, CopyImageTypeExtentMismatchMaintenance1) { | |||
|
|||
TEST_F(VkLayerTest, CopyImageCompressedBlockAlignment) { | |||
// Image copy tests on compressed images with block alignment errors | |||
|
|||
SetTargetApiVersion(VK_API_VERSION_1_1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test really is 1.1 aware and thus should request 1.1. We don't care about what is request, as we test below.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the case for the other tests with this call added.
@@ -22124,7 +22151,7 @@ TEST_F(VkLayerTest, CopyImageCompressedBlockAlignment) { | |||
|
|||
std::string vuid; | |||
bool ycbcr = (DeviceExtensionEnabled(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME) || | |||
(m_device->props.apiVersion >= VK_API_VERSION_1_1)); | |||
(DeviceValidationVersion() >= VK_API_VERSION_1_1)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The call hides the logic matching the logic the validation uses for "how we will validate"
// Do NOT enable VK_KHR_maintenance1 | ||
if (DeviceExtensionSupported(gpu(), nullptr, VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME)) { | ||
m_device_extension_names.push_back(VK_KHR_SAMPLER_YCBCR_CONVERSION_EXTENSION_NAME); | ||
if (InstanceExtensionSupported(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests is changed is to ensure that we get the same single error we expect on 1.0 and 1.1 drivers.
2f61e6c
to
42f7372
Compare
Reduce number of missing extensions to one for consistent, clean results on 1.1 and 1.0. Change-Id: Ic7a3ef6de16e604e700ed46766723214106c0e3f
The promotion of extensions was being treated inconsistently by layers, framework, and tests, with the result being inconsistent errors between 1.0 and 1.1 drivers.
This set of changes unties this knot, cleaning up the tests that the fixes would otherwise break.