mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-16 09:39:58 -04:00
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>
33 KiB
33 KiB