Commit Graph

136 Commits

Author SHA1 Message Date
Henrik Rydgård 195455a7f4 Break out VertexReader, prepare VertexReader for CrossSIMD use in software transform 2026-06-04 12:45:17 +02:00
Henrik Rydgård e6185ba6bb Clean out NaNs and INFs from vertex coordinates
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 .
2026-06-02 10:52:39 +02:00
Henrik Rydgård 12d280839c Microoptimizations in VertexDecoder interpreter 2026-02-17 11:59:30 +01:00
Henrik Rydgård 991d7bdfab VertexDecoder: Refactor away lowerbound/upperbound parameters 2026-02-05 13:26:17 +01:00
Henrik Rydgård 47f6b9975e Optimize the color alpha computation for color morph 2026-01-20 13:51:24 +01:00
Henrik Rydgård 064ad64a55 More minor optimizations 2026-01-20 13:51:24 +01:00
Henrik Rydgård 73e41750f7 More non-JIT morph optimizations 2026-01-20 13:51:24 +01:00
Henrik Rydgård 3378faca5e Optimize morph code (non-JIT vertex decoders) 2026-01-20 13:51:24 +01:00
Henrik Rydgård 5e16bf907b VertexDecoder: Improve logging for missing formats. Add missing convert function.
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.
2025-09-24 10:52:09 -06:00
Lin Runze 5b406f00fd loongarch: Initial VertexJIT support and bug fix 2025-07-17 00:33:56 +08:00
Henrik Rydgård 9ecc135601 Vertex decoder C++ fallbacks: Make sure to never read from the destination
This can have devastating effects on performance on some architectures.

Will help, but not fix, #20171 on some hardware (there's more
optimization work that needs doing).
2025-05-26 11:18:45 +02:00
Henrik Rydgård 4e0b6ac3ec More misc cleanup 2025-05-14 15:14:03 +02:00
Henrik Rydgård dd38e8d012 GPU constify 2025-05-14 09:39:14 +02:00
Henrik Rydgård c6691de64c Remove excessive error reporting 2025-03-02 02:28:42 +01:00
Henrik Rydgård 449e3e1360 Very minor soft transform optimization 2024-12-28 18:45:03 +01:00
Henrik Rydgård c91169e702 Restore removed <algorithm> includes.
Turns out these were needed after all. For some reason, on Windows and
Mac, <algorithm> gets auto-included by something else so I don't notice
when it's missing, and MSVC's include dependency tracker doesn't see it
either.
2024-12-19 09:53:07 +01:00
Henrik Rydgård df6ed8cfc9 Do some cleanup of #includes in GPU 2024-12-18 13:57:26 +01:00
Henrik Rydgård e74101a2fb applySkinInDecode belongs in the VertexTypeID, not in the options. 2024-12-17 18:24:18 +01:00
Henrik Rydgård 2c283fbb07 Minor cleanups, crashfixes 2024-10-14 23:57:19 +02:00
Henrik Rydgård 42c32c5afc VertexDecoder: Don't read loop counts from memory. Improves codegen 2024-09-10 17:53:19 +02:00
Henrik Rydgård 43c68c4277 VertexDecoder: Remove member function pointers from decoding 2024-07-22 14:06:15 +02:00
Henrik Rydgård fd9daf7594 Fix some minor issues found by --sanitize. Add --sanitizeub.
Unfortunately the ub (undefined behavior) sanitizer has some bugs, it doesn't
understand pointers to member functions, so can't use it in-game (due to the
vertex decoder).

Thanks Nemoumbra for the reminder.
2024-07-22 11:37:18 +02:00
Henrik Rydgård e01ca5b057 Logging API change (refactor) (#19324)
* Rename LogType to Log

* Explicitly use the Log:: enum when logging. Allows for autocomplete when editing.

* Mac/ARM64 buildfix

* Do the same with the hle result log macros

* Rename the log names to mixed case while at it.

* iOS buildfix

* Qt buildfix attempt, ARM32 buildfix
2024-07-14 14:42:59 +02:00
Henrik Rydgård 8d6e96d04e Use binary search to find IR block offsets 2024-06-07 09:28:27 +02:00
Henrik Rydgård c794f4bd41 Add an unrelated comment and some casts 2024-06-05 08:35:09 +02:00
Henrik Rydgård 6ce087430b JIT-less vertex decoder: SSE/NEON-optimize ComputeSkinMatrix 2024-06-04 12:29:16 +02:00
Henrik Rydgård 9ac7054b01 Vertex decoder (non-JIT): Optimize 16-bit color decoders. 2024-06-04 10:35:31 +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 fb599cd0a6 Only use the optimized decoders if SSE or NEON is available. 2024-05-11 14:18:42 +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
Henrik Rydgård 3e11e54405 Remove obsolete flag 2024-05-11 10:00:35 +02:00
Herman Semenov b57dab2812 [GPU] Make static and const methods if possible 2024-04-05 17:04:31 +03:00
Henrik Rydgård e3177ac870 Make some global string pointers const, not just the strings.
Minor cleanup.
2023-12-29 14:09:45 +01:00
Henrik Rydgård f86189c951 Show vertex decoders separately in profiles 2023-12-19 12:25:54 +01:00
Herman Semenov 315340fc62 Using const reference for C++17 range-based loop and freq used objects 2023-12-13 17:33:01 +01:00
Henrik Rydgård 71aaad23fb Fix issue with zero-vertex draw calls. Though, should maybe just filter them out earlier. 2023-12-10 12:21:07 +01:00
Henrik Rydgård d4703e9534 Decoded position format is always the same 2023-10-06 15:39:58 +02:00
Henrik Rydgård 92ffef2626 Remove some state from IndexGenerator, fix bugs. Mostly works except vertex cache. 2023-10-03 11:01:37 +02:00
Henrik Rydgård 45bc4d8750 Make GetIndexBounds friendlier to autovectorization. Works on x86 at least. 2023-09-24 12:15:04 +02:00
Unknown W. Brackets 622c69dbb9 x86jit: Expose option to select new IR based jit. 2023-08-20 22:28:54 -07:00
Henrik Rydgård bee2400230 Merge pull request #17769 from unknownbrackets/vertexjit-debug
Add compilation-enabled vertexjit compare tool
2023-07-24 09:39:52 +02:00
Unknown W. Brackets 311c78f26b GPU: Make the vertexjit diff smarter. 2023-07-23 14:28:45 -07:00
Unknown W. Brackets b6f11d6dae GPU: Add a little tool to debug vertexjit.
Although it's too exacting right now, it still helps.
2023-07-23 14:28:45 -07:00
Unknown W. Brackets 312dcfc1c5 GPU: Correct UV scale for non-jit. 2023-07-23 14:25:43 -07:00
Henrik Rydgård 01cea7f088 Pass uvScale in as an argument to the vertex decoder
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.
2023-06-12 20:25:18 +02:00
Henrik Rydgård 80e47b7bd3 Only dirty the uniform UVSCALEOFFSET when really needed
Broken out from #17479

With OpenGL, greatly reduces the amount of glUniform4fv calls in many games (and
similar in the other backends).
2023-05-25 15:00:57 +02:00
Unknown W. Brackets 9c21184352 vertexjit: Simplify CPU core check.
This also avoids allocating the memory we won't use if it's off.
2023-02-28 07:03:12 -08:00