Skip to content

Fix vulkan crash on NVIDIA drivers >= 595 in Arknights: Endfield by removing API hook overrides#344

Merged
Kaldaien merged 1 commit intoSpecialKO:mainfrom
kisenaa:fix/akef-remove-api-hook-overrides
Mar 16, 2026
Merged

Fix vulkan crash on NVIDIA drivers >= 595 in Arknights: Endfield by removing API hook overrides#344
Kaldaien merged 1 commit intoSpecialKO:mainfrom
kisenaa:fix/akef-remove-api-hook-overrides

Conversation

@kisenaa
Copy link
Contributor

@kisenaa kisenaa commented Mar 16, 2026

Sorry about this. In my previous PR, I think i added some API overrides in config.cpp for endfield and set them to false. Because of that, the [API.HOOK] d3d12 option becomes false by default on the first launch. This PR removes the API overrides I previously added for Endfield and lets Special K use its original default behavior instead.

It turns out this can cause a crash on NVIDIA drivers >= 595 (thanks to IIIelKot and Meatball_Beam for pointing this out on discord).

From what I understand, when we set prefer layered on DXGI Swapchain in nvcp or vulkan bridge on driver version >= 595, special K may detect a native D3D12 swapchain during first creation. If the D3D12 hook is disabled, the code dereferences a null pointer in dxgi.cpp around line 7652:
(*ppSwapChain)->SetPrivateData(SKID_D3D12_SwapChainCommandQueue, sizeof(void *), pCmdQueue)

Setting the D3D12 hook back to true in specialk.ini avoids the crash on my machine. It is set to false by default on first launch because of this mistake at previous PR. Maybe in the future, it also be safer to add a null-pointer check there.

@Kaldaien
Copy link
Member

I don't understand how ppSwapChain could be a nullptr in this scenario :-
But I added it nonetheless. Thank you.

@Kaldaien Kaldaien merged commit 82593a2 into SpecialKO:main Mar 16, 2026
1 check 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.

2 participants