Skip to content

loader: use layer chain handle in get_device_driver_id - #2038

Merged
charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:driver-id-filter-chain-handle
Sep 21, 2026
Merged

charles-lunarg merged 1 commit into
KhronosGroup:mainfrom
aizu-m:driver-id-filter-chain-handle

Conversation

@aizu-m

@aizu-m aizu-m commented Sep 20, 2026

Copy link
Copy Markdown
Contributor
  1. Reading the VK_LOADER_DRIVER_ID_FILTER path: both filter functions walk handles returned by layer_inst_disp.EnumeratePhysicalDevices, so they are top of chain handles that a layer may have wrapped.
  2. get_device_driver_id casts that handle to loader_physical_device_term. With a wrapping layer this_icd_term aliases a field of the layer's own object, and the instance pointer and GetPhysicalDeviceProperties2 pointer are then read out of unrelated memory.
  3. The vendor and device id checks beside it already go through the layer chain dispatch with the handle as given, so the driver id query belongs there too.

Test enables wrap_objects with the filter set: before, Assertion failed: (inst != NULL), function get_device_driver_id; after, it passes. wrap_objects needed a vkGetPhysicalDeviceProperties2 intercept so the handle is unwrapped on the way down.

The driver id filter passes VkPhysicalDevice handles taken from the top
of the layer chain, which a layer may have wrapped. Query the driver id
through the layer chain instead of casting the handle to a
loader_physical_device_term.
@ci-tester-lunarg

Copy link
Copy Markdown

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

1 similar comment
@ci-tester-lunarg

Copy link
Copy Markdown

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

@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.

This is a VERY easy approval. Because a few months ago I made the exact same change when I was experimenting with removing wrapping of VkPhysicalDevices. That experiment failed, and I never thought of pulling out that cleanup into main. commit where I made that change if you were curious how similar the change is: charles-lunarg@8cdb1c9

Thank you for doing that!

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build queued with queue ID 126735.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3776 running.

@ci-tester-lunarg

Copy link
Copy Markdown

CI Vulkan-Loader build # 3776 passed.

@charles-lunarg
charles-lunarg merged commit 320c4e0 into KhronosGroup:main Sep 21, 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