Commit Graph
22 Commits
Author SHA1 Message Date
Henrik RydgårdandClaude Opus 5.5 cd1f3b0929 Vertex decoder: Handwritten decoder for God of War's one-weight skinned format
For where there's no vertex JIT. It skins the same way as the steps:
the skin matrix is 0 + bone * weight, kept as the columns that
Vec3ByMatrix43() and Norm3ByMatrix43() multiply and add unfused in the
same order (by lane on ARM64, like those), and only rebuilt when the
weight changes. 2.2 ns a vertex in God of War against the JIT's 1.95
and the steps' 12-18.

Without the vertex JIT, God of War's instructions drop by 6.8% per 10
emulated seconds.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 14:40:31 +02:00
Henrik RydgårdandClaude Opus 5.5 5f410479ce Vertex decoder: Fix the full alpha flag in the older handwritten decoders
The decoders clear gstate_c.vertexFullAlpha when a vertex has less than
full alpha, and a batch decodes each of its draws in turn. The God of War
and GTA decoders assigned it instead, so a draw with full alpha set it
back after an earlier one had cleared it. God of War's also read the
alpha from the normal: its struct had color and normal swapped (the
output came out right, as each went to the matching slot), so the flag
never got set for its most used format.

The vertex decoder test now decodes a vertex with full alpha after a
draw that cleared the flag and after one that didn't.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 14:40:31 +02:00
Henrik RydgårdandClaude Opus 5.5 3bd660c251 Vertex decoder: Handwritten decoders for ATV's, Wipeout's and Killzone's top formats
For where there's no vertex JIT (iOS), as they're a few percent slower
than the JIT's but four to eleven times faster than the steps. The
formats carry most of the vertices of ATV Offroad Fury: Blazin' Trails,
Wipeout Pure and Killzone: Liberation, and a lot of Gods Eater Burst's.
They convert like the steps (PrescaleUV moves to the header for that),
and the vertex decoder test now also compares each format's decoder
without the JIT against the steps.

Without the vertex JIT, 10 emulated seconds on an M1, instructions:
ATV -9.9%, Wipeout -6.0%, Killzone -5.4%, Gods Eater -2.2%.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 14:40:31 +02:00
Henrik RydgårdandClaude Opus 5.5 253aba2a60 Vertex decoder: Use the handwritten decoders with every UV generation mode
They were only used for UV from texture coordinates. With the texture
matrix or environment map, UV isn't prescaled, which is the same as a
scale of 1 and no offset, so NoPrescale versions pass that. God of War
draws 5 million of its vertices per 10 seconds this way, which without
the vertex JIT took 9.6 ns each through the steps and now 2.4.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 14:40:31 +02:00
Henrik RydgårdandClaude Opus 5 a1ed24ae2d Vertex decoder: fix the handwritten decoders, and test them too
The two handwritten SIMD decoders are used with or without the JIT, and had
drifted from the step functions:
- The God of War one ignored g_DoubleTextureCoordinates, giving HD Remaster
  games the wrong UVs, and passed NaN and infinite positions through. Those
  now come out finite like everywhere else.
- The GTA one expanded 5551 colors wrongly on NEON (a left shift where the
  SSE version shifts right).
- On ARM64, both now fuse the UV scale and offset, like the JIT and the steps
  as the compiler builds them.

Both are back in the unit test, which now also feeds NaN and infinity to plain
float positions and checks they come out finite, and runs only on x86-64 and
arm64 for now.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 11:29:40 -06:00
Henrik Rydgård 1a38b91d31 Fix compilation error on x86-32 2026-06-13 17:44:39 +02:00
Henrik Rydgård e0634f3df9 Assorted cleanup and tweaks 2026-06-13 13:34:41 +02:00
Henrik Rydgård 88266eee50 Warning fixes, comments 2026-02-10 13:59:32 +01:00
Henrik Rydgård 1599ea7b1d SaveState: Separate screenshot operations from other ops 2026-02-08 16:11:44 +01:00
Henrik Rydgård dd28f75852 Buildfixes 2026-02-07 12:03:44 +01:00
Henrik Rydgård d4896fbecd VtxDec_Tu16_C8888_Pfloat: Avoid over-reading the input 2026-02-05 13:34:34 +01:00
Henrik Rydgård 5326d87f9c Rename CrossSIMD to SIMDHeader, but also keep CrossSIMD.h (will have a future use) 2024-12-19 15:15:43 +01:00
Henrik Rydgård df6ed8cfc9 Do some cleanup of #includes in GPU 2024-12-18 13:57:26 +01:00
Henrik Rydgård 92938f8283 Vertex decoder, SSE opt: Use the correct store operation to store 64 bits.
The other one duplicates the bits twice and requires alignment.

Fixes #19351
2024-07-22 10:30:57 +02:00
Henrik Rydgård ef91fa8b4f Fix code typo in NEON reinterpret cast.
Fixes #19258
2024-06-08 21:25:44 +02:00
Henrik Rydgård 7a32507ab7 Add a decode counter to vertex decoders in _DEBUG mode 2024-06-02 10:25:05 +02:00
Henrik Rydgård 6ed8f96e98 Indentation fix 2024-05-11 20:36:51 +02:00
Henrik Rydgård 6452ce8ac5 NEON-optimize the GTA vertex decoder too. 2024-05-11 14:13:29 +02:00
Henrik Rydgård 4a66f8978b Fix the GoW optimized vertex decoder, add NEON optimizations 2024-05-11 13:27:11 +02:00
Henrik Rydgård bafff7f5db Temporarily disable the custom GoW vertex decoder, it needs some work. 2024-05-11 11:11:48 +02:00
Henrik Rydgård 3526416173 Add another handwritten vertex decoder 2024-05-11 10:00:39 +02:00
Henrik Rydgård 81f1b3fd95 Make handwritten vertex decoders work with non-compiled vertex decoding 2024-05-11 10:00:35 +02:00