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

Clarify the VK_LOADER_DRIVERS_SELECT example #1130

Merged
merged 1 commit into from
Jan 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/LoaderInterfaceArchitecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,10 @@ discovery.
</small></td>
<td><small>
export<br/>
&nbsp;&nbsp;VK_LOADER_DRIVERS_SELECT=nvidia<br/>
&nbsp;&nbsp;VK_LOADER_DRIVERS_SELECT=nvidia*<br/>
<br/>
set<br/>
&nbsp;&nbsp;VK_LOADER_DRIVERS_SELECT=nvidia<br/><br/>
&nbsp;&nbsp;VK_LOADER_DRIVERS_SELECT=nvidia*<br/><br/>
The above would select only the Nvidia driver if it was present on the
system and already visible to the loader.
</small></td>
Expand Down
18 changes: 18 additions & 0 deletions tests/loader_envvar_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,24 @@ TEST(EnvVarICDOverrideSetup, FilterSelectDriver) {
ASSERT_TRUE(env.debug_log.find_prefix_then_postfix("Found ICD manifest file", "CDE_ICD.json"));
ASSERT_FALSE(env.debug_log.find_prefix_then_postfix("CDE_ICD.json", "ignored because not selected by env var"));
ASSERT_FALSE(env.debug_log.find_prefix_then_postfix("CDE_ICD.json", "ignored because it was disabled by env var"));

// The full-name string is not a valid match if it doesn't also include the file extension
env.debug_log.clear();
filter_select_env_var.set_new_value("ABC_ICD");

InstWrapper inst8{env.vulkan_functions};
FillDebugUtilsCreateDetails(inst8.create_info, env.debug_log);
inst8.CheckCreate(VK_ERROR_INCOMPATIBLE_DRIVER);

ASSERT_TRUE(env.debug_log.find_prefix_then_postfix("Found ICD manifest file", "ABC_ICD.json"));
ASSERT_TRUE(env.debug_log.find_prefix_then_postfix("ABC_ICD.json", "ignored because not selected by env var"));
ASSERT_FALSE(env.debug_log.find_prefix_then_postfix("ABC_ICD.json", "ignored because it was disabled by env var"));
ASSERT_TRUE(env.debug_log.find_prefix_then_postfix("Found ICD manifest file", "BCD_ICD.json"));
ASSERT_TRUE(env.debug_log.find_prefix_then_postfix("BCD_ICD.json", "ignored because not selected by env var"));
ASSERT_FALSE(env.debug_log.find_prefix_then_postfix("BCD_ICD.json", "ignored because it was disabled by env var"));
ASSERT_TRUE(env.debug_log.find_prefix_then_postfix("Found ICD manifest file", "CDE_ICD.json"));
ASSERT_TRUE(env.debug_log.find_prefix_then_postfix("CDE_ICD.json", "ignored because not selected by env var"));
ASSERT_FALSE(env.debug_log.find_prefix_then_postfix("CDE_ICD.json", "ignored because it was disabled by env var"));
}

// Test that the driver filter disable disables driver manifest files that match the filter
Expand Down