258 Commits

Author SHA1 Message Date
Henrik Rydgård 28b2b1793b Pipeline checker: Add support for checking for identical pipelines with different vertex formats
This turned out not to be very fruitful.
2026-07-10 19:07:27 +02:00
Henrik Rydgård 6d2948a09b Remove the cached UVScale in gstate_c. Conversion is cheap enough to do directly from gstate, no point in caching. 2026-07-03 13:17:35 +02:00
Henrik Rydgård 8804042a9d NormalizeVertices: Take UV scale as a parameter 2026-07-03 12:55:34 +02:00
Henrik Rydgård 623545bd24 Delete the "Hardware tessellation" feature.
Very hard to maintain and debug, not worth it.
2026-06-16 16:17:14 +02:00
Henrik Rydgård ea8a648737 Refactor UI shader presets, prepare for some updates to the ImGe debugger 2026-06-14 11:08:56 +02:00
Henrik Rydgård d19f8b72f9 Warning fixes 2026-06-06 14:24:16 +02:00
Henrik Rydgård cf9c0c5c84 Restructure the sprite detection, no longer require Smart 2D texture filtering to apply 2026-06-06 11:21:46 +02:00
Henrik Rydgård 19d6850789 Apply the correct culling epsilons both in fastcull and in software transform. Fixes NBA again. 2026-06-05 00:18:06 +02:00
Henrik Rydgård 392a862be2 Merge pull request #21784 from hrydgard/smarter-2d-filter
Smart 2D texture filtering: Use the new vertex path to check for pixel mapping in transformed geometry
2026-06-04 17:24:40 +02:00
Henrik Rydgård 169f473b95 Smart 2D texture filtering: Use the new vertex path to check for pixel mapping in transformed geometry
Previously, "Smart 2D texture filtering" was limited to through-mode
draws, but many games use fully transformed draws to do 2D elements.

An example of this is Outrun in the menus, and it's always been plagued by
horrible filtering artifacts.

With the improved Smart 2D texture filtering, the artifacts are gone!
Of course, instead of glitchy bilinear you instead get point sampled
texturing so it looks more pixellated, but no more ugly borders between letters
in the game.
2026-06-04 17:04:04 +02:00
Henrik Rydgård 1867f0775e Avoid soft-transform-and-clip if the near plane matches the final clip plane, and a new compat flag isn't set
Fixes #21776

Since only two games are known to need the cull-after-clip behavior
(previously known as inversion), we flag those and avoid unnecessary
soft clipping.

I had hoped to find a dynamic check that would work, but haven't managed
to figure out a good one yet.

This will improve performance a little bit in some other games since we
can avoid clipping in software at all in many cases.
2026-06-04 14:49:22 +02:00
Henrik Rydgård 652e3e2c22 Use fastcull on indexed draws too. 2026-06-04 11:24:15 +02:00
Henrik Rydgård 9f5d28ca6e Fix toggling pause with the bound pause key 2026-06-03 18:49:13 +02:00
Henrik Rydgård 48084e9c3e Cleanup, fix some oversights 2026-06-03 15:23:17 +02:00
Henrik Rydgård ab108f7f0c BBOX: Avoid z clipping issues by culling in clip space. 2026-06-03 10:05:21 +02:00
Henrik Rydgård 847953fd31 Fix wrong logic causing excessive software transform fallback if cull planes are missing. Minor cleanup. 2026-05-31 13:31:16 +02:00
Henrik Rydgård 702088c2d0 Fix backwards check for minZ/maxZ in fragment shader 2026-05-31 10:40:14 +02:00
Henrik Rydgård bdd72c08f3 Fix dirtying caused by clip flag state. This could probably be a bit smarter. 2026-05-30 21:47:21 +02:00
Henrik Rydgård 0e880a16f0 Flush on changed clipInfoFlags. This fixes many Z fighting artifacts caused by strange joining of meshes and sw/hw tranform conflict. 2026-05-30 19:07:59 +02:00
Henrik Rydgård 44ece6dfa2 Determine the clip flags directly when culling, simplifying the code. 2026-05-30 19:07:59 +02:00
Henrik Rydgård 2a5c2fa477 Check if the viewport transform matches the clip space. If so we can skip the near clip plane. 2026-05-30 19:07:59 +02:00
Henrik Rydgård 189dde8115 Cache the cull matrix. Minor bbox optimization. 2026-05-30 19:07:59 +02:00
Henrik Rydgård e75d9f8a5f Unify the bounding depth checks, correct them if minmax clip is needed 2026-05-30 19:07:59 +02:00
Henrik Rydgård 0eede05f5f Implement fragment shader depth clamp and min/max discard. Slow on some hardware, but it's a fallback. 2026-05-30 19:07:59 +02:00
Henrik Rydgård 5ad24adc93 Cleanup, increase the max cull count. Flatout water works now. 2026-05-30 19:07:59 +02:00
Henrik Rydgård 86f9618cb9 Fallback to software transform if draw intersects -W<Z<W 2026-05-30 19:07:59 +02:00
Henrik Rydgård 5eb114d3d9 Put more useful data in BoundingDepths. Slightly more costly. 2026-05-30 19:07:59 +02:00
Henrik Rydgård b1723086be Plumb through depth information (although not yet always generated) 2026-05-30 19:07:58 +02:00
Henrik Rydgård 08f4c8fae8 Compute min/max Z and W from the culling loop, use to cull some more 2026-05-30 19:07:58 +02:00
Henrik Rydgård f0d715feaa During culling, evaluate minZ,maxZ,minW,maxW, and use them to cull some things. Also, assorted vshader work. 2026-05-30 19:07:58 +02:00
Henrik Rydgård 5808afef10 Implement minZ/maxZ through user clip planes 2026-05-30 19:07:58 +02:00
Henrik Rydgård ae98055cec Delete a lot of legacy depth and viewport code, fix OpenGL 2026-05-30 19:07:58 +02:00
Henrik Rydgård f60e27a9b7 Just some refactoring of the GPUStatistics struct, and more use of StringWriter 2026-05-29 14:40:31 +02:00
Henrik Rydgård b65bbaf92c Merge pull request #21678 from nintendo424/gpu-save-first-frame
gpu: Preserve first-frame font render targets
2026-05-27 12:22:47 +02:00
Henrik Rydgård 4be2a853b7 FastCull: Integrate the vertex position loading into the culling loop 2026-05-25 18:16:34 +02:00
Henrik Rydgård 82a888fd8e Reimplement the fast culling using CrossSIMD 2026-05-25 18:16:34 +02:00
Henrik Rydgård 250abe0d56 Loongarch64 build fixes 2026-05-25 15:41:24 +02:00
Henrik Rydgård 37f6fda9c9 Add a CrossSIMD loongarch64 LSX implementation. Note: This is untested! 2026-05-25 15:40:22 +02:00
Henrik Rydgård 4a55fc6724 Prepare TestBoundingBoxFast for optimization 2026-05-25 13:37:27 +02:00
Henrik Rydgård 2eca0123f1 Correct culling in case of some weird viewport setups 2026-05-23 14:49:17 +02:00
Henrik Rydgård fa856fbf68 Pass the culling unit tests. 2026-05-23 14:40:15 +02:00
Henrik Rydgård a854a2bed1 Correct some comparisons for bbox 2026-05-23 14:40:15 +02:00
Henrik Rydgård 0d33cd0a65 Convert the BBOX/BJUMP culling to use the worldviewproj matrix and a screen space check. 2026-05-23 14:40:15 +02:00
Henrik Rydgård 7a093623e8 Sonnet NEON 2026-05-23 14:40:15 +02:00
Henrik Rydgård 1fb9446d5a Optimize the SSE path 2026-05-23 14:40:15 +02:00
Henrik Rydgård e64a61017e Use the new method for NEON and fallback fast culling 2026-05-23 14:40:15 +02:00
Henrik Rydgård dbba46bfb5 Simplify away some trivial math 2026-05-23 14:40:15 +02:00
Henrik Rydgård 893bc732a1 Fast culling: Use the worldviewproj matrix to avoid the need for planes 2026-05-23 14:40:15 +02:00
Henrik Rydgård 5cfbf50111 Keep updated products of view*proj and world*view*proj matrices. Use to simplify bbox culling. 2026-05-21 19:18:32 +02:00
nintendo424 e5689d1adc gpu: Preserve first-frame font render targets
Some games render HLE sceFont glyphs into small VRAM-backed framebuffers and immediately sample them as textures. This needs both the source glyph buffer and the temporary render target to be preserved before later commands overwrite or rebind them.

Save first-frame data from the previous render target before creating a new framebuffer, since ResizeFramebufFBO() makes the new framebuffer current. Also flush pending draws before PGF writes over a glyph buffer that may still be referenced by queued texture draws.

Backend software transform normally reports safe framebuffer size during draw flush, but first-frame readback can happen before queued draws reach that path. Estimate through-mode rectangle/triangle bounds before SubmitPrim() and feed those bounds to SetSafeSize(), using actual vertices clamped to scissor instead of a tiny-target heuristic.

Fixes missing text in Evangelion JO.
2026-05-15 12:23:14 -04:00