Files
AnyPS5/docs/dev
ntamas94andClaude Opus 5.5 807442da20 fix(shader): keep GCN v_sin_f32 linear up to 1.5 x 2^-12 of a turn as the PS4 does
A PS4 Pro (GCN, firmware 10.71) returns the input times 0x40c90fd5 for
every v_sin_f32 input below 0x39c00000 (1.5 x 2^-12 of a turn) and for
none at or above it, over 12,288 consecutive inputs of each sign across
that boundary and 65,536 random inputs from 2^-24 to 1 turn. The linear
band from 909281c994 ends at 2^-12, as measured on RDNA2, so PS4 guest
shaders took the driver sine or the series in [2^-12, 1.5 x 2^-12),
where the PS4 is 5 ULP away from the true sine.

PS4 guest shaders now keep the integer band of v_sin_f32 up to
0x39c00000. The half- and quarter-turn bands keep 2^-12: there the PS4
is within 6 ULP of the f32 2pi term and is not linear. PS5 shaders are
unchanged.

GcnSinNearZero runs a GCN compute kernel over PS4-measured inputs; it
fails without the change (0x39bf48b8 gives 0x3b163be8, the PS4 returns
0x3b163bed).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-30 09:23:09 +01:00
..