PosFloat loaded its clamp constants into XMM4/XMM5 but clamped with XMM2/XMM3,
and the S8/S16 morphs overwrote the morph weight pointer with the constant's
address. These only run when the JIT cache lands more than 2GB from the
constants, which CPUEquivalence's allocations made happen on Linux CI
(SplineTessellation). Checked by forcing every RipAccessible() false, which
SplineTessellation and VertexJit now pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add a unit test that decodes every vertex format through both the step
functions and the JIT and requires identical output, side effects included.
Only skinning may differ by rounding, since arm64 accumulates the bone
matrices with fused multiply-adds.
What it found, and fixed:
- x86 morph colors rounded to nearest where the steps truncate, and applied
the scale before the weight, which rounds differently.
- x86 through-mode u16 UV bounds compared signed, so texcoords above 32767
scrambled the bounds for everyone running the x86 JIT.
- x86 morph sums could produce -0 where the steps produce +0.
- Step_NormalS16Morph scaled by 1/32768 twice, giving near-zero normals.
- Step_PosFloatThrough lost the truncation of Z to an integer that the JITs
and the vertex reader did before it moved into the decoder.
- SetVertexType never reset skinInDecode.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This enables a behavior seen on the real PSP where 0 * NaN == 0 in the
GPU (NOTE: This means the vertex transform pipeline).
However, this
doesn't touch INFs unfortunately, and we need to modify those too...
This, together with #21715, finally fixes#20204 .
The missing function is mainly used in D3D11, which can be used on
Windows for ARM64. It's not necesssary for the other backends, which is
why it used to be missing in the ARM64 vertex decoder.
Also fix a minor memory leak in AtracCtx2.
Cleaner than overwriting/restoring gstate_c.uvScale in the decoder
loop. A small cleanup I've been wanting to do for ages.
Expecting a negligble perf boost if any.