Refactor Vulkan extensions handling #1161

Open
Astyyyyy wants to merge 3 commits from Astyyyyy/vk-extensions-refactor into master
Astyyyyy commented 2026-09-13 11:41:04 +00:00 (Migrated from github.com)

bit of a refactor for vulkan extensions, and adding enabling of feature structs support, and ability to enable radv's impl of VK_NV_COOPERATIVE_MATRIX_2_EXTENSION_NAME since its locked behind a env var, or vkd3d 😐 and also update latest vulkan headers for missing extensions

bit of a refactor for vulkan extensions, and adding enabling of feature structs support, and ability to enable radv's impl of `VK_NV_COOPERATIVE_MATRIX_2_EXTENSION_NAME` since its locked behind a env var, or vkd3d :neutral_face: and also update latest vulkan headers for missing extensions
s-Sabreafn commented 2026-09-13 11:42:51 +00:00 (Migrated from github.com)

bit of a refactor for vulkan extensions, and adding enabling of feature structs support, and ability to enable radv's impl of VK_NV_COOPERATIVE_MATRIX_2_EXTENSION_NAME since its locked behind a env var, or vkd3d 😐 and also update latest vulkan headers for missing extensions

Is this a bug fix or improvement?
Im merely curious 🙂

> bit of a refactor for vulkan extensions, and adding enabling of feature structs support, and ability to enable radv's impl of `VK_NV_COOPERATIVE_MATRIX_2_EXTENSION_NAME` since its locked behind a env var, or vkd3d :neutral_face: and also update latest vulkan headers for missing extensions Is this a bug fix or improvement? Im merely curious 🙂
FakeMichau (Migrated from github.com) reviewed 2026-09-14 14:49:50 +00:00
@ -26,2 +26,3 @@
// It's applied even if ffx is already signed, could be improved
if ((pathString.contains("amd_fidelityfx_dx12.dll") || pathString.contains("amd_fidelityfx_vk.dll")) &&
if ((pathString.contains("amd_fidelityfx_dx12.dll") || pathString.contains("amd_fidelityfx_upscaler_vk.dll") ||
pathString.contains("amd_fidelityfx_vk.dll")) &&
FakeMichau (Migrated from github.com) commented 2026-09-14 14:18:00 +00:00

Is this needed? That code is basically a hack to allow the driver override to work with unsigned dlls. Don't think that's needed for vk.

Is this needed? That code is basically a hack to allow the driver override to work with unsigned dlls. Don't think that's needed for vk.
FakeMichau (Migrated from github.com) commented 2026-09-14 14:34:32 +00:00

I was under the impression that this extension is not required for vkd3d-proton to have fsr4 working. Is it required in this case?

I was under the impression that this extension is not *required* for vkd3d-proton to have fsr4 working. Is it required in this case?
@ -5,6 +5,7 @@
#include "CommandBuffer_StateTracker.h"
#include <vulkan/vulkan.hpp>
#include <vulkan/vulkan_beta.h>
FakeMichau (Migrated from github.com) commented 2026-09-14 14:49:16 +00:00

Due to VK_NV_cooperative_matrix2?

Due to VK_NV_cooperative_matrix2?
@ -27,2 +27,3 @@
if (path.contains("amd_fidelityfx_dx12.dll") || path.contains("amd_fidelityfx_vk.dll"))
if (path.contains("amd_fidelityfx_dx12.dll") || path.contains("amd_fidelityfx_upscaler_vk.dll") ||
path.contains("amd_fidelityfx_vk.dll"))
FakeMichau (Migrated from github.com) commented 2026-09-14 14:28:01 +00:00

Same as Crypt32_Hooks.h

Same as Crypt32_Hooks.h
@ -381,0 +724,4 @@
if (HasExtension(pCreateInfo, VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME) &&
!HasExtension(pCreateInfo, VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME))
EnableFeatureStruct(pCreateInfo, getFeatures2, physicalDevice, modifiedFeatures, bufferDeviceAddress,
&VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress);
FakeMichau (Migrated from github.com) commented 2026-09-14 14:38:56 +00:00

If addExtension checks if an extension is supported then we might not need this check. Pascal and older dont have the nvx extensions thats why this check if here

If addExtension checks if an extension is supported then we might not need this check. Pascal and older dont have the nvx extensions thats why this check if here
FakeMichau (Migrated from github.com) reviewed 2026-09-14 14:50:57 +00:00
@ -381,0 +724,4 @@
if (HasExtension(pCreateInfo, VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME) &&
!HasExtension(pCreateInfo, VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME))
EnableFeatureStruct(pCreateInfo, getFeatures2, physicalDevice, modifiedFeatures, bufferDeviceAddress,
&VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress);
FakeMichau (Migrated from github.com) commented 2026-09-14 14:50:54 +00:00

Could we maybe get a log when we/the game wants an extension but it's not supported? There is the issue of matrix2 which may not be required but will be logged here.

Maybe something similar to GetSupportedFeatureStruct, im not quite sure. Would save us from having those nvidia checks later on. The idea would be "add VK_NV_LOW_LATENCY_EXTENSION_NAME, if not supported then log and skip"

Could we maybe get a log when we/the game wants an extension but it's not supported? There is the issue of matrix2 which may not be required but will be logged here. Maybe something similar to GetSupportedFeatureStruct, im not quite sure. Would save us from having those nvidia checks later on. The idea would be "add VK_NV_LOW_LATENCY_EXTENSION_NAME, if not supported then log and skip"
Astyyyyy (Migrated from github.com) reviewed 2026-09-17 03:29:45 +00:00
Astyyyyy (Migrated from github.com) commented 2026-09-17 03:29:45 +00:00

its not required, but radv only enables it when vkd3d is detected as running, so for native vk we need some way to enable outside user just plopping a env var in launch

its not required, but radv only enables it when vkd3d is detected as running, so for native vk we need some way to enable outside user just plopping a env var in launch
Astyyyyy (Migrated from github.com) reviewed 2026-09-17 04:03:25 +00:00
@ -26,2 +26,3 @@
// It's applied even if ffx is already signed, could be improved
if ((pathString.contains("amd_fidelityfx_dx12.dll") || pathString.contains("amd_fidelityfx_vk.dll")) &&
if ((pathString.contains("amd_fidelityfx_dx12.dll") || pathString.contains("amd_fidelityfx_upscaler_vk.dll") ||
pathString.contains("amd_fidelityfx_vk.dll")) &&
Astyyyyy (Migrated from github.com) commented 2026-09-17 04:03:25 +00:00

tru, yea i can remove, ill just check games dont actually explode when their original vk dll is gone though first

tru, yea i can remove, ill just check games dont actually explode when their original vk dll is gone though first
Astyyyyy (Migrated from github.com) reviewed 2026-09-17 05:11:54 +00:00
@ -381,0 +724,4 @@
if (HasExtension(pCreateInfo, VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME) &&
!HasExtension(pCreateInfo, VK_EXT_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME))
EnableFeatureStruct(pCreateInfo, getFeatures2, physicalDevice, modifiedFeatures, bufferDeviceAddress,
&VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress);
Astyyyyy (Migrated from github.com) commented 2026-09-17 05:11:54 +00:00

alr ive removed the nvidia checks and added the extra logging, so just checks if its supported then skips if not

alr ive removed the nvidia checks and added the extra logging, so just checks if its supported then skips if not
FakeMichau (Migrated from github.com) reviewed 2026-09-17 19:28:01 +00:00
FakeMichau (Migrated from github.com) commented 2026-09-17 19:28:01 +00:00

hm k

hm k
This pull request has changes conflicting with the target branch.
  • OptiScaler/OptiScaler.vcxproj
  • OptiScaler/hooks/Vulkan_Hooks.cpp
  • OptiScaler/hooks/VulkanwDx12_Hooks.h
  • OptiScaler/spoofing/Vulkan_Spoofing.cpp
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin Astyyyyy/vk-extensions-refactor:Astyyyyy/vk-extensions-refactor
git switch Astyyyyy/vk-extensions-refactor

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch master
git merge --no-ff Astyyyyy/vk-extensions-refactor
git switch Astyyyyy/vk-extensions-refactor
git rebase master
git switch master
git merge --ff-only Astyyyyy/vk-extensions-refactor
git switch Astyyyyy/vk-extensions-refactor
git rebase master
git switch master
git merge --no-ff Astyyyyy/vk-extensions-refactor
git switch master
git merge --squash Astyyyyy/vk-extensions-refactor
git switch master
git merge --ff-only Astyyyyy/vk-extensions-refactor
git switch master
git merge Astyyyyy/vk-extensions-refactor
git push origin master
Sign in to join this conversation.
No description provided.