Skip to content
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

Warn when ICD Manifest version differs from VkPhysicalDevice #1251

Conversation

charles-lunarg
Copy link
Collaborator

@charles-lunarg charles-lunarg commented Jul 21, 2023

The apiVersion of a VkPhysicalDevice is not guaranteed to be identical to the
api_version specified by the ICD Manifest JSON file. While there is nothing
inherently wrong with a different version, it is unusual for these versions
to not match, and so this commit adds logic to check & emit a warning whenever
these versions are different.

This warning is in response to a real issue due to behavioral differences in
the loader between 1.0 and 1.1 drivers, as the manifest file reported 1.1
while the VkPhysicalDeviceProperties::apiVersion reported 1.0.

This PR also cleans up tests a fair bit - including setting the API version in a lot of places where they may be relevant.

Fixes #1242

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 10361.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2076 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2076 passed.

The apiVersion inside of the ICD Manifest is the first version the loader uses
to determine what the driver is capable of. If it is 1.1+, it will query for
vkEnumerateInstanceVersion & call it. This commit adds warnings for when the
returned version is 1.0 as well as when the function failed to be queried,
which a 1.1+ driver should not fail.

This warning is in response to a real issue due to behavioral differences in
the loader between 1.0 and 1.1 drivers, as the manifest file reported 1.1
while the vkEnumerateInstanceVersion reported 1.0.
Layer names should begin with VK_LAYER, which wasn't being done in certain
tests which this commit fixes.
Makes use of the vectors initialization constructor to remove iterating over
the elements of the vector to set the sType manually.

Also zero's out the VkPhysicalDevice array in the TestICD so that non-filled
in elements have a value of zero instead of being uninitialized.
The default value is 1.0, so it isn't necessary to set it.
The manifest file version and physical device properties versions should match
in many of the tests, to insure that there isn't unintended behavior occuring.

This commit also cleans up the LayerPhysDeviceMod tests so they aren't adding
an ICD at the very top, which appears to have been accidental. Making that fix
did require modifying the test logic to put physical devices in a slightly
different order in the physical device groups.
@charles-lunarg charles-lunarg force-pushed the warn_mismatch_between_manifest_and_physical_device branch from 55569b7 to 3ec0837 Compare July 24, 2023 20:58
@ci-tester-lunarg
Copy link

CI Vulkan-Loader build queued with queue ID 11820.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2085 running.

@ci-tester-lunarg
Copy link

CI Vulkan-Loader build # 2085 passed.

@charles-lunarg charles-lunarg merged commit 220a00b into KhronosGroup:main Jul 24, 2023
37 checks passed
@charles-lunarg charles-lunarg deleted the warn_mismatch_between_manifest_and_physical_device branch July 24, 2023 22:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorrect behavior for version mismatch on Vulkan 1.0
2 participants