Commit Graph

82 Commits

Author SHA1 Message Date
Henrik Rydgård 93b570f8c7 Reverse the bits so we actually get the desired shader sorting order in the debug shader viewer 2026-07-07 20:16:37 +02:00
Henrik Rydgård 6508ae0aae Reorganize the vertex ShaderId bits, better sorting order 2026-07-07 20:16:32 +02:00
Henrik Rydgård 90c48671d7 D3D11: Remove support for BGRA textures and preferred framebuffer formats 2026-07-03 16:20:22 +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 83d82dcf66 Shader depal: Don't generate a big switch in the shader, generate specialized shaders instead. 2026-06-10 12:22:11 +02:00
Henrik Rydgård cd0802b9c8 Remove redundant flag from vertex shader IDs 2026-06-10 10:46:05 +02:00
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 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 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 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 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 8ed898c5e6 GPU: Constify VertexDecoder pointers, remove in some cases 2025-05-14 15:13:59 +02:00
Henrik Rydgård b4eecf3d5c Mali: Turn off any depth writes if depth test is set to NEVER. 2024-02-02 11:11:31 +01:00
Henrik Rydgård 7178c0cd42 Restore fragmentshader ID flags double and texalpha. Add a ubershader mode that uses dynamic state. 2023-05-25 10:19:01 +02:00
Henrik Rydgård ebd36a4369 Reorganize the fragment shader bits 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 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 5022ddc4fc D3D9 bool constants have a separate register space, oops. 2023-01-10 09:42:54 +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 18d00b0718 Remove lmode flag bit from fragment and geometry shaders 2023-01-04 11:04:23 +01:00
Henrik Rydgård 10dee90c83 Merge pull request #16628 from hrydgard/remove-fog-fshader-flag
Make fog-enable driven by uniform instead of fragment shader flag bit
2023-01-04 11:01:19 +01:00
Henrik Rydgård 26c748f959 Make fog-enable driven by uniform instead of fragment shader flag bit 2023-01-04 10:14:11 +01:00
Henrik Rydgård f069de2dd2 Pass the vertex decoder into the vertex shader IDs generator
Instead of just the vertex type.

This will allow things like the vertex decoder supplying defaults, in
order to reduce the number of unique vertex shaders at the cost of
slightly larger vertex data.

This doesn't actually do that yet though, it's just a refactor that can
be done separately.

Part of #16567
2022-12-30 22:57:05 +01:00
Henrik Rydgård 61eaa4ea2d Just a very minor optimization 2022-12-27 17:15:31 +01:00
Henrik Rydgård d72ad3b3f4 Fragment shader generator: Move the framebuffer fetch bit to the shader ID.
Will resolve a future issue in the multisampling PR, where the
GPU_USE_FRAMEBUFFER_FETCH flag changes at runtime if you switch between no AA and MSAA.

Just figured I'd get it in separately for safety.
2022-11-30 00:26:15 +01:00
Unknown W. Brackets 6c36f03a0d GPU: Purify vertTypeIsSkinningEnabled(). 2022-11-06 08:40:54 -08:00
Henrik Rydgård 0de12f5ca9 Some refactoring of framebuffer views, layer issues, more work. 2022-10-27 11:05:58 +02:00
Henrik Rydgård 2e87f0bc0b More work. Things are starting to work now. 2022-10-27 11:05:58 +02:00
Henrik Rydgård fb250c4b29 More multiview work 2022-10-27 11:05:58 +02:00
Henrik Rydgård a605366254 Add ShaderId utility function to be used for some sanity checking. 2022-10-13 22:39:47 +02:00
Unknown W. Brackets 3e5c09d432 Vulkan: Clip clamped depth in geometry shader.
This corrects deformed geometry on Mali devices which don't support
user-space clipping but do support depth clamp.
2022-10-05 19:41:59 -07:00
Unknown W. Brackets d16caa71af Vulkan: Add geometry shader ID tracking.
We're still not generating them, yet.  But this tracks the objects and
IDs through the pipeline.
2022-10-02 07:42:16 -07:00
Unknown W. Brackets 87171cef98 GPU: Add geometry path for shader writer.
Not yet used.
2022-10-01 12:45:43 -07:00
Henrik Rydgård 9d1355e137 Always do the vertex shader part of the fog computation.
In #16104, we drastically reduced the number of shader variants for
games that use flexible lighting setups. I looked at a few games and it
seems that a lot of games have the same shaders with fog on/off, while
fog is super cheap to compute. So let's just always do it, reducing
vertex shader variants further (though the amount of pipelines will probably
remain the same, since we still specialize the fragment shader).

Might also be worth adding a dynamic bool for the fragment shader, but
if so, doing it separately.
2022-09-26 09:30:54 +02:00
Henrik Rydgård 7adba20fac Experiment: Generate "Ubershaders" that can handle all lighting configurations
This drastically reduces the shader compile stutter that happens when a lot of new
light setups are created, like on the first punch in Tekken 6.

There's more stuff that might benefit from being made dynamic like this.
These branches are very cheap on modern GPUs since they're branching on
a uniform variable, so no divergence.

Only tested on Vulkan. I think we'll need to keep the old path too for
gpus like Mali-450...
2022-09-25 23:35:01 +02:00
Henrik Rydgård 694dbe1271 Add ShaderDepalMode enum, use in shader ID. Replaces smoothed bit. 2022-09-11 14:40:01 +02:00
Henrik Rydgård 2474eb6a72 Shader bit setup and code generation for logic-ops-in-shader 2022-09-04 11:14:47 +02:00
Henrik Rydgård 87b14fe1c2 Some more renaming and refactoring, extracted from a future PR 2022-09-04 00:10:55 +02:00
Henrik Rydgård b84cda2876 Plumb the computed pipeline state into ComputeFragmentShaderID. 2022-09-02 22:16:57 +02:00
Henrik Rydgård 6558bde0f6 Remove SmoothedDepal compat setting, instead detect the ramp directly. 2022-08-22 15:24:41 +02:00
Henrik Rydgård 886679c7ec Remove the color-to-depth mode 2022-08-20 08:29:33 +02:00
Henrik Rydgård 90a44579bf Implement color-to-depth for Vulkan, start implementing for D3D11 2022-08-01 11:30:36 +02:00
Henrik Rydgård f061eadc04 Initial implementation of 3D texturing through equal-size mips (see #6357)
Vulkan-only currently, though all the other backends except ES 2.0
without GL_OES_texture_3d can support it with some work.
2022-07-31 10:43:47 +02:00
Unknown W. Brackets 2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00
Unknown W. Brackets a73c15babc GPU: Correct shader gen with weights as floats.
For now, this supports the option.  We should probably just move to
everything being floats, but we already prefer software skinning.

Fixes #13903.
2021-01-10 08:52:28 -08:00