Skip to content

icd: Remove needless environment override in instance extension enume… - #50

Merged
aqnuep merged 1 commit into
mainfrom
aqnuep/enum-instance-extensions-no-env-override
Sep 8, 2026
Merged

icd: Remove needless environment override in instance extension enume…#50
aqnuep merged 1 commit into
mainfrom
aqnuep/enum-instance-extensions-no-env-override

Conversation

@aqnuep

@aqnuep aqnuep commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

…ration

The instance extensions are enumerated and cached up-front at ICD load time, therefore environment override is not necessary in this call.

Furthermore, as it turns out, the loader does not take a lock inside vkEnumerateInstanceExtensionProperties, therefore overriding the environment variables here could cause unexpected side effects in other threads calling into the Vulkan SC loader.

Unfortunately, these types of issues are not fixed entirely by this change, as the environment override trick requires "collaboration" from the loader in the sense that the loader itself also mutexes the points where this happens. Fortunately, that is the case for key APIs like vkCreateInstance, vkEnumeratePhysicalDevices, and vkEnumeratePhysicalDeviceGroups, but ICD loading itself is not always mutexed by the loader at the moment, in particularly, exactly in the vkEnumerateInstanceExtensionProperties entry point.

…ration

The instance extensions are enumerated and cached up-front
at ICD load time, therefore environment override is not necessary
in this call.

Furthermore, as it turns out, the loader does not take a lock
inside vkEnumerateInstanceExtensionProperties, therefore overriding
the environment variables here could cause unexpected side effects
in other threads calling into the Vulkan SC loader.

Unfortunately, these types of issues are not fixed entirely by this
change, as the environment override trick requires "collaboration"
from the loader in the sense that the loader itself also mutexes the
points where this happens. Fortunately, that is the case for key APIs
like vkCreateInstance, vkEnumeratePhysicalDevices, and
vkEnumeratePhysicalDeviceGroups, but ICD loading itself is not
always mutexed by the loader at the moment, in particularly,
exactly in the vkEnumerateInstanceExtensionProperties entry point.
@aqnuep
aqnuep merged commit 1b2e579 into main Sep 8, 2026
29 checks passed
@aqnuep
aqnuep deleted the aqnuep/enum-instance-extensions-no-env-override branch September 8, 2026 14:44
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.

1 participant