212 Commits

Author SHA1 Message Date
Henrik Rydgård 5265422c0e Remove the old "Fragment ubershader" setting. It's been on by default for years and is not really an ubershader. 2026-06-10 09:54:52 +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 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 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 0b47955c64 Delete geometry shader culling support. Is mostly replaced, and will be fully replaced with software transform. 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 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
Herman Semenoff 1e2e04b9d2 shadermanagervk: fix possible typo in Clear() function
After set_invalid(), shader pointers are not nulled as in DirtyLastShader()
2026-04-28 10:45:45 +02:00
刘皓 5716cbd41d Use the libretro VFS interface in libretro builds 2026-01-01 00:24:01 -05:00
Henrik Rydgård 4cc5b230ce The ritual bump of the shader cache version 2025-06-05 11:01:25 +02:00
Henrik Rydgård 8ed898c5e6 GPU: Constify VertexDecoder pointers, remove in some cases 2025-05-14 15:13:59 +02:00
Henrik Rydgård df6ed8cfc9 Do some cleanup of #includes in GPU 2024-12-18 13:57:26 +01:00
Henrik Rydgård 4016539c85 Pre-release shader cache version bump for safety 2024-10-29 13:19:58 +01:00
Henrik Rydgård f54d701a2e Decentralize the assert for AllocateAlignedMemory failures 2024-10-22 21:49:50 +02:00
Henrik Rydgård dfca3dd87a Work around annoying assert in debug memory allocator on 32-bit Windows 2024-09-25 23:24:25 +02:00
Herman Semenov 3c66f149d3 [Common/Core/Windows] Removed excess check pointer before delete or free() 2024-09-17 11:34:42 +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 d479b74ed9 v1.17.1 2024-02-04 14:08:02 +01:00
Henrik Rydgård 493122a2fc v1.17 2024-01-27 14:48:00 +01:00
Henrik Rydgård 126d88ecfc Back out clearly inconsequential/useless .reserve() calls 2023-12-29 08:27:56 +01:00
Herman Semenov 0748ce610f [GPU/Common/D3D11/Directx9/GLES/Vulkan] Using reserve if possible 2023-12-15 14:08:22 +03:00
Henrik Rydgård ced821169e Bump shader cache versions 2023-10-09 19:39:25 +02:00
Henrik Rydgård 48d3efc473 Bump shader cache versions again, just because. 2023-09-27 17:38:15 +02:00
Henrik Rydgård 01035f48a4 Fix for crash when changing backends in-game 2023-09-26 00:13:53 +02:00
Henrik Rydgård 6e303e8f1d Vulkan: Simplify GetShaders and DirtyLastShader, making them internally consistent. 2023-09-24 11:55:15 +02:00
Henrik Rydgård d31ba393af Don't load the shader cache on a separate thread - all it does is already async 2023-09-24 10:53:23 +02:00
Henrik Rydgård 964f606a9c Fix some issues around geometry shaders - like, loading them from shader cache while disabled 2023-09-24 01:29:38 +02:00
Henrik Rydgård dbd3045f87 Join the shader cache load thread on exit 2023-09-24 01:07:08 +02:00
Henrik Rydgård 9a515c851f Vulkan: Extend the cacheLock usage in GetShaders (was unsafe, though mildly) 2023-09-24 00:58:45 +02:00
Henrik Rydgård 6a8f65b566 Some assert paranoia, remove unused "failed_" variable 2023-09-23 10:09:32 +02:00
Henrik Rydgård 1aab1c4b09 Be a bit smarter when loading the shader cache, avoid duplicating work 2023-09-21 10:44:04 +02:00
Henrik Rydgård 052747aa30 Add reporting of GLSL shader gen errors 2023-09-11 15:37:35 +02:00
Henrik Rydgård 10f93875c6 Fix the semantics of DenseHashMap to be consistent even when inserting nulls 2023-09-11 12:07:18 +02:00
Henrik Rydgård 162b363063 Bump shader cache version, just because. 2023-09-09 15:13:52 +02:00
Henrik Rydgård 6d8069dfd1 Vulkan: Remove the remains of the input attachment experiment
Haven't been using these for a while.

I've come to the conclusion here that I think it's better to try to
deal with the issues using safe workarounds like copies, instead of
relying on features with somewhat iffy driver support that are not
universal across APIs anyway.
2023-06-13 20:46:27 +02:00
Henrik Rydgård 72cf531759 Bump shader cache version 2023-05-25 10:19:01 +02:00
Henrik Rydgård b42670cf59 Manually revert the rest of the lmode optimization 2023-05-09 18:44:24 +02:00
Henrik Rydgård f42c682d34 Revert "Merge pull request #16628 from hrydgard/remove-fog-fshader-flag"
This reverts commit 10dee90c83, reversing
changes made to 34c11c8acf.
2023-05-08 22:01:38 +02:00
Henrik Rydgård 14887d6b04 Bump shader cache version (should have done it in the release) 2023-05-06 16:15:32 +02:00
Henrik Rydgård d7605c6877 Use dedicated threads for the shader object creation. Bypasses the deadlock possibility. 2023-02-01 11:15:33 +01:00
Henrik Rydgård 6b0903f566 Add facility to run tasks on dedicated threads using the ThreadManager interface.
Useful for things that should be run ASAP even if the threadpool is full,
at a small extra cost. (Not recommended for very small tasks).

Considering using this to resolve the deadlocks in #16802.
2023-01-31 11:07:40 +01:00
Henrik Rydgård 784e8ab782 Fix a race condition during Vulkan shader cache load.
Could lead to unnecessary pipelines being created.
2023-01-13 10:35:04 +01:00
Henrik Rydgård beed3c06d2 Vulkan: Don't use non-indexed draws for pure tristrips and fans, creates extra pipelines.
Bump shader cache version
2023-01-11 22:57:23 +01:00
Henrik Rydgård 3d376b0ab7 Remove the rather redundant DoTexture flag from vshaders.
Slightly reduces the number of unique vertex shaders but doesn't do much
for the pipeline count, as the fragment shader has a tex flag. Still
worth doing for the simplification.
2023-01-11 14:16:46 +01:00
Henrik Rydgård 088d0c39dc Remove the FS_TEXTURE_AT_OFFSET fragment shader flag 2023-01-10 12:37:21 +01:00
Henrik Rydgård c7c48abb37 Switch the 2x flag to a uniform 2023-01-10 12:36:28 +01:00
Henrik Rydgård d4ce134292 Shader generator: Move FS_TEX_ALPHA to a uniform bool.
Part of #16567
2023-01-10 09:42:54 +01:00
Henrik Rydgård cf52324e9e Vulkan: Fix pipeline cache clearing.
Extracted from #16759 and bugfixed. Fixes a leak of Vulkan pipelines.

I guess another way would be to queue the variants for destruction at
the same time as we queue the callback, but I like this better.
2023-01-09 09:49:55 +01:00