mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-18 23:59:59 -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:
@@ -463,6 +463,7 @@ static int selftest(void) {
|
||||
mem_kernel_free(k1, 0x200);
|
||||
CHECK(mem_kernel_alloc(0x200, 16) == k1, "a freed kernel-region block is not reused");
|
||||
check_memory();
|
||||
failures += vk_pipeline_spirv_selftest();
|
||||
|
||||
float used, total, proc;
|
||||
plat_mem_info(&used, &total, &proc);
|
||||
|
||||
Reference in New Issue
Block a user