Commit Graph

260 Commits

Author SHA1 Message Date
Henrik Rydgård 2534eb4480 Disable anisotropic filtering for all flat draws.
May improve performance slightly, and should fix the last instances of #19555
2026-06-08 15:28:58 +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 5151df7366 Remove fbman, texcache parameters from SoftwareTransformParams 2026-06-02 11:39:33 +02:00
Henrik Rydgård 77d5ca3116 Remove the SoftwareTransform class, there's no state anymore 2026-06-02 11:39:33 +02:00
Henrik Rydgård 8113cb9147 Misc cleanup and renaming 2026-06-02 11:39:33 +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 f8b153ba2b Fix some issues with depth rounding, and depth clamp in D3D11 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 0e8ba0d6fe Bugfixes, cleanup 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 66fd3e65d8 Remove some redundant function parameters 2026-05-30 19:07:59 +02:00
Henrik Rydgård 058b1af285 Revert to software on out-of-bounds projected depth 2026-05-30 19:07:59 +02:00
Henrik Rydgård 280ddbf86c Remove state from SoftwareTransform class 2026-05-30 19:07:59 +02:00
Henrik Rydgård d60d190236 Implement depth clamp (for safe cases) in the software transform pipeline, and make sure triangle culling is always done. 2026-05-30 19:07:59 +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 62d8cf22de Move the viewport transform to software in SW transform mode
transform fix
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 db99de8575 Rename BuildDrawParams to ProjectClipAndExpand, call it directly from Transform 2026-05-26 16:05:53 +02:00
Henrik Rydgård 9ad9a6c0bb DrawEngines: Move the clear-detection to a more sensible place, reorder things to make more sense. 2026-05-26 16:05:53 +02:00
Henrik Rydgård f40e487a61 Simplify the TransformedVertex struct 2026-05-24 12:48:26 +02:00
Henrik Rydgård 65c99beea7 Remove some old debris 2026-05-19 15:43:25 +02:00
Henrik Rydgård afb764e6ae Rendering: Unify the Y-flipping state across backends (now only applied in-shader, not through matrices). 2026-05-14 23:30:06 +02:00
Henrik Rydgård 28166cb35d Add "allocation slack" to our pushbuffers. Fixes a memory overwrite bug
Reported by Joseph on Discord.

Sometimes, things could align perfectly so allocations happend exactly
at the end of a pushbuffer. At the same time, we allow our vertex decoder to write an extra few
bytes if it needs to for speed. Unfortunately I missed this interaction,
resulting in some uncommon crashes that were especially common with
heavy-geometry things like modified GTA LCS with PS2 assets, for
example.

The problem was reported with Vulkan, but our OpenGL backend had the
same issue too.
2026-05-13 15:55:34 +02:00
Henrik Rydgård c3897fef4c Finish up #21151
See #21151
2026-01-24 10:42:43 +01:00
Henrik Rydgård 67010ff2af Split the display layout config between landscape and portrait orientations 2025-11-05 12:49:51 +01:00
Henrik Rydgård 8ed898c5e6 GPU: Constify VertexDecoder pointers, remove in some cases 2025-05-14 15:13:59 +02:00
Henrik Rydgård 5d85d5ed22 Depth raster: Rename some variables, fix incorrect draw limit 2025-04-10 17:49:06 +02:00
Henrik Rydgård 4aaea67766 Enable depth raster in all backends, not just Vulkan 2024-12-24 23:26:32 +01:00
Henrik Rydgård df6ed8cfc9 Do some cleanup of #includes in GPU 2024-12-18 13:57:26 +01:00
Henrik Rydgård 61b14df329 Delete obsolete empty function ClearTrackedVertexArrays 2024-12-17 19:15:25 +01:00
Henrik Rydgård abb2558535 When overriding skinning in sw transform mode, don't write/restore member variables 2024-12-17 18:52:49 +01:00
Henrik Rydgård 20ecbfdf57 Pass the VertexDecoder pointer around 2024-12-17 18:24: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 54d18bb343 Lift some more debugging functionality into GPUCommon 2024-12-15 14:03:05 +01:00
Henrik Rydgård b47c9b6dd2 Remove redundant call to SetColorUpdated 2024-12-15 13:44:35 +01:00
Henrik Rydgård 11dbae3457 Remove the "DispatchFlush" mechanism, not convinced it's a win 2024-12-15 13:42:05 +01:00
Henrik Rydgård 9e019ae246 Remove the notion of the GPU debugger being "Active". Now it's automatic. 2024-12-15 11:12:53 +01:00
Henrik Rydgård 1221a6e928 Minor code cleanups 2024-10-28 17:50:34 +01:00
Henrik Rydgård 2ba4eaf3dd First part of the const changes etc 2024-09-17 15:13:13 +02:00
Henrik Rydgård 096985f51f Provoking vertex (software transform): Simpler solution
Simply rotate each primitive in the index buffer to simulate a different provoking vertex.

Since at this point we have already generated a plain primitive index
buffer, it's easy to manipulate like this.

An even better solution would be to generate rotated index buffers
directly during decode, although that code is super critical and does
not need more complexity..

We could now also enable this for hardware transform but I'm leaving
that for later.
2024-07-17 14:40:52 +02:00
Henrik Rydgård 6b1e57a840 We never draw non-indexed in software transform mode, so get rid of the path. 2024-07-17 14:40:52 +02:00
Henrik Rydgård 665f03ff62 Add provoking vertex to caps, flip the flag around 2024-07-17 14:40:52 +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
Herman Semenov b57dab2812 [GPU] Make static and const methods if possible 2024-04-05 17:04:31 +03:00
Henrik Rydgård cb79783539 Expand primitives: Check the vertex count too.
Still getting a few crashes, let's get rid of the last of them from this,
hopefully.
2024-01-28 22:48:40 +01:00
Henrik Rydgård db94b0b696 Pass the limit on the number of indices to generate to BuildDrawingParams. 2024-01-15 10:09:04 +01:00
Henrik Rydgård 341fe04f4b Apply nearest filter for pixel-mapped draws 2024-01-11 12:56:03 +01:00
Henrik Rydgård 0b6ea4b2e5 Use the Tokimeki / old Juiced 2 method for Breath of Fire III
Allows us to delete a bunch of complex code.
2024-01-11 10:44:13 +01:00
Henrik Rydgård 126d88ecfc Back out clearly inconsequential/useless .reserve() calls 2023-12-29 08:27:56 +01:00