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

Intercept device functions via vkGetInstanceProcAddr() #22

Merged
merged 3 commits into from
Dec 10, 2024
Merged

Conversation

solidpixel
Copy link
Contributor

Vulkan allows device functions to be (less efficiently) intercepted via
vkGetInstanceProcAddr() instead of vkGetDeviceProcAddr(). This PR adds
support for intercepting these correctly.

This includes a custom vkGetDeviceImageMemoryRequirementsKHR() to skip
driver invocations if the driver dispatch pointer is nullptr. This is a
workaround for a bug in Unreal Engine which fetches this function using
vkGetInstanceProcAddr() with a Vulkan 1.1 instance (when it is available
and is therefore non-null) and then tries to use it later with a device
created from a Vulkan 1.0 instance (when it is not available because
VK_KHR_maintenance4 is a Vulkan 1.1 extension).

@solidpixel solidpixel merged commit 783e42e into main Dec 10, 2024
5 checks passed
@solidpixel solidpixel deleted the gipa_devfns branch December 10, 2024 21:52
solidpixel added a commit that referenced this pull request Dec 11, 2024
Vulkan allows device functions to be (less efficiently) intercepted via
vkGetInstanceProcAddr() instead of vkGetDeviceProcAddr(). This PR adds
support for intercepting these correctly.

This includes a custom vkGetDeviceImageMemoryRequirementsKHR() to skip
driver invocations if the driver dispatch pointer is nullptr. This is a
workaround for a bug in Unreal Engine which fetches this function using
vkGetInstanceProcAddr() with a Vulkan 1.1 instance (when it is available
and is therefore non-null) and then tries to use it later with a device
created from a Vulkan 1.0 instance (when it is not available because
VK_KHR_maintenance4 is a Vulkan 1.1 extension).
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