Commit Graph
3315 Commits
Author SHA1 Message Date
Henrik Rydgård 86f34c52a4 Revert bad shader optimization 2023-01-12 00:30:41 +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 ca63bb1e5b Even more optimization/cleanup. Don't need to check ldot that we already know is >= 0.0. 2023-01-11 19:34:58 +01:00
Henrik Rydgård 965007d65b Tighten up the lighting shader code a bit, hopefully eliminating a branch or two. 2023-01-11 19:29:02 +01:00
Henrik Rydgård 1c8e456c97 Also apply this to OpenGL and D3D9 2023-01-11 19:29:02 +01:00
Henrik Rydgård 4c2a41cc83 Break out the attenuation term, too 2023-01-11 19:29:02 +01:00
Henrik Rydgård a508f7e345 Shave a few instructions from lighting shaders by prenormalizing the light dir used for spotlights 2023-01-11 19:29:02 +01:00
Henrik Rydgård 7b62b4626f Comment fixes 2023-01-11 15:29:52 +01:00
Henrik Rydgård 3b46409350 Vertex shaders: On platforms with uniform buffers, use indexing and loop for real over the lights.
Strangely, greatly speeds up pipeline creation on PowerVR.
2023-01-11 15:24:56 +01:00
Henrik Rydgård d894906a7e Fix formatting of lights uniform buffer (tabs->spaces) 2023-01-11 14:18:14 +01:00
Henrik Rydgård c4d8ebcad5 D3D11 fix 2023-01-11 14:16:46 +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 56261af697 Uniform dirty-bits: Make room for four more uniforms. Then we're out and need to merge. 2023-01-11 00:16:17 +01:00
Henrik RydgårdandGitHub edaa5246d1 Merge pull request #16771 from hrydgard/more-getpointer-cleanup
Core: A bit more GetPointer cleanup.
2023-01-10 14:36:08 +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 e1a48d74c4 A bit more GetPointer cleanup.
Probably not worth it for performance reasons, but some semantic cleanup
is good, especially the accidental GetPointer -> writable casts without
using GetPointerWrite.

Using Unchecked on already checked pointers, or when we'd crash anyway
if it returned nullptr, is good for clarity.
2023-01-10 12:13:47 +01:00
Henrik Rydgård 00c44ea799 Get rid of the bool, not worth it. 2023-01-10 10:23:29 +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
Unknown W. Brackets f09c09caa8 GLES: Avoid GLSL redefinition error. 2023-01-08 22:30:15 -08:00
Henrik RydgårdandGitHub 10d7b2d410 Merge pull request #16756 from unknownbrackets/replace-stride
Replacement: Always return w/h from GetMipSize()
2023-01-08 22:34:50 +01:00
Unknown W. Brackets 0f92afb0c1 Replacement: Check replaceValid before load. 2023-01-08 10:20:52 -08:00
Unknown W. Brackets 26aedbe2f5 Replacement: Always return w/h from GetMipSize(). 2023-01-08 10:12:04 -08:00
Unknown W. Brackets f49f7c6371 D3D9: Force branch usage for fog compute.
When using `[flatten]`/default, it picks the wrong value, seemingly always
taking the else case (even if the condition is changed or reversed.)
2023-01-06 17:25:04 -08:00
Unknown W. Brackets 81f4a76ac9 GPU: Don't bother with fog uniform in sw transform. 2023-01-06 17:24:44 -08:00
Henrik RydgårdandGitHub 3cd882f21b Merge pull request #16565 from unknownbrackets/bloom-hack
GPU: Avoid bloom hack on buffers used for depth
2023-01-06 14:32:23 +01:00
Henrik RydgårdandGitHub d1cc378242 Merge pull request #16577 from unknownbrackets/shader-cache
Fix GLES and Vulkan cache with equal depth check detect
2023-01-06 14:19:36 +01:00
Unknown W. Brackets 3f20562b9f Vulkan: Store saw equal depth flag in cache. 2023-01-05 18:24:29 -08:00
Unknown W. Brackets e5d67119a8 GPU: Avoid bloom hack on buffers used for depth.
If a buffer even has depth transferred to it, let's avoid lowering its
resolution.
2023-01-05 18:00:43 -08:00
Unknown W. Brackets f3acdb9da8 GLES: Avoid a shader constant error.
Some Adreno drivers interpret 0u as an integer.
2023-01-05 17:56:58 -08:00
Henrik Rydgård a58bf45540 Removes LM flag from vshader in the common case, if ubershader is enabled. 2023-01-05 13:09:49 +01:00
Henrik Rydgård 389c7bf44c FragmentShaderDesc improvement (debugging) 2023-01-05 11:49:03 +01:00
Henrik Rydgård a73ccd77e3 Add FOGCOEFENABLE to the list of base uniforms.
Spotted by Unknown in #16628 comments.
2023-01-05 08:34:54 +01:00
Henrik Rydgård 4e30c5c0c6 Unbreak fog, oops.
Fixes #16722
2023-01-04 13:01:00 +01:00
Henrik Rydgård b84e24cb89 Invert the nesting of specularIsZero and lmode conditions in VS. 2023-01-04 11:04:24 +01:00
Henrik Rydgård ae383147db Minor simplification in VS 2023-01-04 11:04:24 +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årdandGitHub 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årdandGitHub 34c11c8acf Merge pull request #16584 from hrydgard/vertex-format-vshader-id
Pass in the vertex decoder to the shader ID computation
2023-01-04 10:26:18 +01:00
Henrik Rydgård 5cae5615ea Use more unusual values as "fog-disabled". 2023-01-04 10:14:12 +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årdandGitHub 830f1064e6 Merge pull request #16676 from unknownbrackets/riscv-disasm
Add disassembler for RISC-V
2023-01-04 09:52:56 +01:00
Unknown W. Brackets d45142ebaa GPU: Avoid uint by int shifts in reinterpret. 2023-01-03 23:00:17 -08:00
Unknown W. Brackets 0b6635c2dc GLES: Avoid switch-case on older glsl. 2023-01-02 14:57:06 -08:00
Unknown W. Brackets 86d748fa0c GLES: Use uint for uint shift amounts.
This seems to cause trouble for some Adreno drivers as well.
2023-01-02 14:37:38 -08:00
Unknown W. BracketsandGitHub 26dc773b2a Merge pull request #16709 from unknownbrackets/shader-errors
Correct some shader errors in reporting
2023-01-02 13:51:23 -08:00
Henrik Rydgård ae99b797d7 Remove some bad float suffixes 2023-01-02 22:30:01 +01:00
Unknown W. Brackets c8728a12d0 GLES: Use mod() not fmod() in depal shaders. 2023-01-02 13:25:40 -08:00
Henrik Rydgård 6b95ed2e2e Prevent name clash from redefining packUnorm4x8 if the driver "lies" about having it 2023-01-02 22:24:00 +01:00