upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/src/vulkan_aftermath.cpp
diff options
context:
space:
mode:
authoraadheel <250292080+aadheel@users.noreply.github.com>2026-11-24 16:10:13 +0530
committeraadheel <250292080+aadheel@users.noreply.github.com>2026-11-24 16:10:13 +0530
commita9bed902d2121ac581f707b2827c30c42fd095c0 (patch)
treebb45c69590e0a65e8852fd9605c391c98f181915 /runtime/src/vulkan_aftermath.cpp
parent21625bca8c675c62f9dbffc318ce6a59d57faf31 (diff)
rdna2spirv: VOP3 clamp of a NaN gives +0 (DX10_CLAMP)
Gen.clamp_mods applied the VOP3 clamp bit as a bare GLSL.std.450 FClamp, which is undefined for a NaN operand. The game's MODE has DX10_CLAMP=1, under which the hardware turns a NaN result into +0 (measured on gfx1036: the v_rcp_iflag_f32 run and SHADER-186 for v_fmac_f16 / v_fma_mix*). Select +0 for a NaN before FClamp, as the div_fixup, cvt_pk_u8 and cvt_pknorm clamps already do. This covers every f32/f16 op that applies clamp through clamp_mods/clamp_f16. - tests/semantic/test_vop3_clamp_nan.py: NaN operands (quiet, negative, signalling) and invalid operations (inf-inf, -inf*0) under clamp give +0 for f32, f16 (low and high half), conversions, legacy and mix ops; controls without a NaN are unchanged. It fails 33 subtests on the old translator. - The two negative controls that expected the undefined FClamp (test_alu_f32_min_max, test_alu_min3_max3) now expect +0, and the f16 unary harness checks clamp of a NaN result instead of skipping. - test_rcp_iflag_mods / test_f64_conversion match the new SPIR-V. - docs/design.md and docs/shader_validation.md no longer list the f32/f16 clamp of a NaN as unmodelled. Still a bare FClamp: the f64 clamp (open PR #475) and the packed v_pk_* clamp. AI-assisted (Claude Code). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'runtime/src/vulkan_aftermath.cpp')
0 files changed, 0 insertions, 0 deletions