Skip to content

check disable_all_explicit in enable_correct_layers_from_settings - #2108

Merged
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:settings-disable-explicit-layers
Nov 13, 2026
Merged

charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:settings-disable-explicit-layers

Conversation

@aizu-m

@aizu-m aizu-m commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Unpatched loader, new test SettingsFile.VK_LOADER_LAYERS_DISABLE_ImplicitExplicitMatchLayerType, VK_LOADER_DEBUG=layer:

VK_LOADER_LAYERS_DISABLE=~implicit~
[Vulkan Loader] WARNING | LAYER: Layer "VK_LAYER_Regular_TestLayer1" forced disabled because name matches filter of env var 'VK_LOADER_LAYERS_DISABLE'.

VK_LOADER_LAYERS_DISABLE=~explicit~
[Vulkan Loader] INFO | LAYER:   Insert instance layer "VK_LAYER_Regular_TestLayer1" (.../libtest_layer_export_version_2_0.dylib)

VK_LAYER_Regular_TestLayer1 is an explicit layer, set to "auto" in the settings file and enabled by the app. ~implicit~ drops it. ~explicit~ loads it.

Found while comparing the two layer enable paths.

  • With layer configurations in the settings file, loader_enable_instance_layers hands every decision to enable_correct_layers_from_settings.
  • Its VK_LOADER_LAYERS_DISABLE check for "auto" layers tests disable_all_implicit for every layer. It never reads disable_all_explicit.
  • loader_layer_is_available and loader_add_environment_layers pick the flag from the layer type. TestLayers.EnvironLayerEnableDisableExplicitLayer covers that path and passes.
  • Settings takes priority over layers disable env var #1605 moved this check into its current branch unchanged, so this looks like an oversight, not a choice.

Conclusion: once a settings file is present, ~explicit~ is ignored and an explicit layer requested by the app or VK_INSTANCE_LAYERS still loads. ~implicit~ also strips explicit layers the app enabled. The fix picks the flag from the layer type, as loader_layer_is_available does. Implicit layers see no change.

The test puts one explicit and one implicit layer in the settings file as "auto". Unpatched it sees 0 active layers for ~implicit~ and 2 for ~explicit~, with 1 expected each time. It passes with the fix. Linux (GCC, Debug, BUILD_WERROR=ON): 694/694. macOS (Debug, ASAN): all pass except integration.find_package, which fails the same way on the untouched tree here because of the local SDK setup. clang-format 16 clean.

When the loader settings file has layer configurations, the
VK_LOADER_LAYERS_DISABLE check for "auto" layers tested
disable_all_implicit for every layer and never looked at
disable_all_explicit. ~explicit~ was ignored and ~implicit~ also
removed explicit layers the application enabled. Pick the flag from
the layer type, as loader_layer_is_available does.
@ci-tester-lunarg

Copy link
Copy Markdown

User aizu-m not on autobuild list. Waiting for curator authorization before starting CI build.

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown

User aizu-m not on autobuild list. Waiting for curator authorization before starting CI build.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 197237.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 4000 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 4000 passed.

@charles-lunarg charles-lunarg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definitely an oversight, appreciate the fix.

@charles-lunarg
charles-lunarg merged commit 0b13708 into KhronosGroup:main Nov 13, 2026
52 checks passed
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.

3 participants