Skip to content

Cleanup of layer storage and enabling logic - #2031

Merged
charles-lunarg merged 6 commits into
KhronosGroup:mainfrom
charles-lunarg:remove_app_activated_layer_list
Sep 11, 2026
Merged

charles-lunarg merged 6 commits into
KhronosGroup:mainfrom
charles-lunarg:remove_app_activated_layer_list

Conversation

@charles-lunarg

@charles-lunarg charles-lunarg commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Multiple commits that work together to clean up layer enabling and storage.

app_activated_layer_list is redundant as it stores almost the same list as expanded_activated_layer_list save for not holding meta layers. Combining them does require handling meta layers in certain places, but overall it removes the burden of remembering why they are two lists.

loader_validate_instance_extensions() created the list of enabled layers but then destroys it. This duplicates the logic loader_enable_instance_layers() does to create the actual list of enabled layers. By moving loader_validate_instance_extensions() below loader_enable_instance_layers(), the duplicate logic can be removed.

Also refactors the parameter passing of loader_layer_list and loader_pointer_layer_list to not pass them when a loader_instance is also being passed in.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 110868.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3751 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 110886.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3752 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3752 failed.

The loader_instance member variable app_activated_layer_list had one
difference with expanded_activated_layer_list, which was that it
contained enabled meta layers. It is simpler to have a single list of
'enabled' layers and skip over meta layers whenever necessary. It also
removes confusion because "app_activated" is not what the list
represented.
Move loader_getenv out of the loop so it is queried once at the start
and use a local variable to store the VkExtensionProperties pointer so
it is scoped only to where it is used.
loader_validate_instance_extensions() made all of the same calls to set
up a list of enabled layers that loader_enable_instance_layers() did.
By calling loader_validate_instance_extensions() after
loader_enable_instance_layers(), we can re-use the list of enabled
layers.
@charles-lunarg
charles-lunarg force-pushed the remove_app_activated_layer_list branch from 8370818 to 20375b2 Compare September 10, 2026 19:19
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 114085.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3755 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 114103.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3756 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3756 passed.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 114342.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3757 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 114360.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3758 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3758 passed.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 114621.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 114638.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3760 running.

Various functions take the loader_layer_list and
loader_pointer_layer_list parameters that live inside the
loader_instance, meaning the lists are already accessible through the
passed in loader_instance. Removing them also solves a clang-tidy false
positive that was difficult to determine the root cause of, but likely
originated because of passing the lists around as pointers.
@charles-lunarg
charles-lunarg force-pushed the remove_app_activated_layer_list branch from eb350b1 to 3f48a00 Compare September 11, 2026 03:58
@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 114657.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3761 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3761 passed.

@charles-lunarg charles-lunarg changed the title Remove unused variable app_activated_layer_list Cleanup of layer storage and enabling logic Sep 11, 2026
@charles-lunarg
charles-lunarg merged commit bde79ad into KhronosGroup:main Sep 11, 2026
52 checks passed
@charles-lunarg
charles-lunarg deleted the remove_app_activated_layer_list branch September 11, 2026 05:18
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.

2 participants