mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 13:09:57 -04:00
Ask every driver but NVIDIA's to keep NaN and infinity in the game's shaders, which should bring Navi's orb back on AMD GPUs.
The game's shaders rely on IEEE NaN and infinity results: unordered comparisons compile to x > c || isnan(x), a zero-length normalisation gives an infinity that a later test catches, integer masks travel through float selects, and the translator's own NaN guards are isnan tests. Our SPIR-V never declared SignedZeroInfNanPreserve, which lets a driver assume floats are never NaN or infinite. NVIDIA's driver keeps the IEEE results anyway; AMD's compilers do not (issue #156: a NaN-bit select read as a signed integer gave 2^32; #41 and #110: black and white blocks on Navi and on Link next to her). The player report: AMD GPUs draw Navi's sparkles but not her orb, whose light sits at her own centre. vk_pipeline.c spirv_nan_preserve now adds the capability, SPV_KHR_float_controls and the mode for 32-bit floats (16 and 64 where the module declares them and the driver can) to every game shader module. NX2NAVI_VK_NAN_PRESERVE: unset on every driver except NVIDIA's own, 1 everywhere, 0 off. --selftest checks the rewrite; the rewritten modules of 600 translated game shaders pass spirv-val for Vulkan 1.3. Not yet seen on an AMD GPU. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -198,6 +198,11 @@
|
||||
# Keep a shader's threads together after divergent code where the game's shaders expect it (maximal reconvergence,
|
||||
# when the driver supports it). 0 turns it off; leaves then go missing from the foliage's colour pass.
|
||||
# vk_reconverge = 1
|
||||
# Ask the GPU driver to keep NaN, infinity and signed zero in the game's shader maths as the Switch does, 0 or 1.
|
||||
# Without it a driver may assume they never occur. The AMD symptoms it is for: Navi drawn without her orb (only her
|
||||
# sparkles), black and white blocks on her and on Link, shadows blown up. Default: on, except on NVIDIA's driver,
|
||||
# which keeps them anyway; 1 also asks NVIDIA's driver. The first start after a change compiles the pipelines again.
|
||||
# vk_nan_preserve = 1
|
||||
|
||||
[display]
|
||||
# Device profile: auto (the Steam Deck when this is one), desktop or deck. On a Steam Deck the keys this file does not
|
||||
|
||||
Reference in New Issue
Block a user