loader: apply settings device configurations to device groups - #2011
Open
Wint3rNight wants to merge 1 commit into
Open
loader: apply settings device configurations to device groups#2011Wint3rNight wants to merge 1 commit into
Wint3rNight wants to merge 1 commit into
Conversation
|
Author Wint3rNight not on autobuild list. Waiting for curator authorization before starting CI build. |
1 similar comment
|
Author Wint3rNight not on autobuild list. Waiting for curator authorization before starting CI build. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1915.
The settings file's
device_configurationslist decides whichVkPhysicalDevices an app gets to see, but onlyvkEnumeratePhysicalDeviceswas honouring it.vkEnumeratePhysicalDeviceGroupsdidn't look at the settings at all, so an app could still get at a hidden device through a group — which is what makes the validation layer fall over in the issue.So a group containing an excluded device now gets dropped. It calls
loader_apply_settings_device_configurationsrather than redoing the deviceUUID/driverUUID/driverVersion matching, so the two paths can't drift apart.Two calls I made that are worth a second opinion:
I drop the whole group instead of removing the hidden device from it. The devices in a group are physically linked, so a group with a member missing doesn't really describe the hardware anymore. Easy to switch if you'd rather strip.
I also changed
phys_dev_group_count_termto count the groups actually written. The copy loop already skips groups withphysicalDeviceCount == 0, but the count included them, andnew_phys_dev_groupsis calloc'd — so a skipped group left a NULL that the memcpy at the end would read. Nothing sets that count to zero today so it was unreachable, but this change makes it reachable.The count query is still an upper bound, same as the plain path does. Getting it exact would mean fetching every group's contents during a count-only call, which seemed like a bad trade.
One log message got reworded, since it named
vkEnumeratePhysicalDevicesand the group path calls it now too.Tests cover a hidden singleton group, a partially hidden group, settings that match nothing, and no settings file at all. Suite's green at 693/693.