Files
NX2navi/tools/xlate/patches/0032-shadow-gather-per-tap-offsets.patch
chrg6 37c06e6894 Sample terrain with the right mip levels, keep NaNs out of min, max and clamp, and give shadow gathers their own tap offsets.
The runtime's TXD gradient transpose (gfx_shader.c patch_txd_transpose) is off for Switch 2 titles: the SM86 lowering
already orders the interleaved derivatives for the translator, so transposing again swapped them back. The
translator's float min, max and clamp are the NaN-safe forms (patch 0031), as Maxwell FMNMX and saturate behave, so a
NaN no longer spreads through lighting and bloom on drivers that pass it on. Depth-compare gathers with per-tap offsets
are split into one gather per tap like the others (patch 0032), where all four taps took the first tap's offset.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-07 16:28:53 -05:00

15 lines
759 B
Diff

--- a/src/Ryujinx.Graphics.Shader/Translation/Transforms/TexturePass.cs
+++ b/src/Ryujinx.Graphics.Shader/Translation/Transforms/TexturePass.cs
@@ -431,7 +431,10 @@
LinkedListNode<INode> oldNode = node;
- if (isGather && !isShadow && hasOffsets)
+ // NX2NAVI: depth-compare gathers too. With per-tap offsets (TLD4.PTP) the else branch below adds only tap 0's
+ // offset, so a shadow map's four taps all came from one place (blocky shadow edges); one gather per tap with
+ // that tap's offset keeps its compared texel, the reference value staying in the copied sources.
+ if (isGather && hasOffsets)
{
Operand[] newSources = new Operand[sources.Length];