Commit Graph

67 Commits

Author SHA1 Message Date
Henrik Rydgård 1b2f87bf1a Rename GPUgstate to GEState 2026-07-02 20:34:09 +02:00
Henrik Rydgård a4d21d23bb Remove some remains of HW tessellation 2026-06-26 18:53:35 +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 c5931ea690 Unify more shader uniform update code, fix bug in fallback for Uint8x3ToFloat4. 2026-06-13 10:14:39 +02:00
Henrik Rydgård 40a345bff8 Fix a filtering issue, enable this for Fushigi no Dungeon 4. 2026-06-12 23:52:50 +02:00
Henrik Rydgård 66fd3e65d8 Remove some redundant function parameters 2026-05-30 19:07:59 +02:00
Henrik Rydgård 5808afef10 Implement minZ/maxZ through user clip planes 2026-05-30 19:07:58 +02:00
Henrik Rydgård 490469c4e6 Re-implement range culling 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 69c7c75124 Replace u_proj_through with a simple scale/offset
First reasonable output appears.
2026-05-30 19:07:58 +02:00
Henrik Rydgård 736d054b8f Remove the u_proj_though matrix from the uniform buffer 2026-05-19 16:33:45 +02:00
Henrik Rydgård d243737c11 Revert "Convert the pre-rotation to just the matrix multiplication."
After the previous commit, the optimization is no longer needed, and
unnecessarily bloats the uniform buffer.

This reverts commit 62bcb1785e.
2026-05-17 11:02:35 +02:00
Henrik Rydgård 947217d1be Convert the pre-rotation to just the matrix multiplication. 2026-05-17 10:59:40 +02:00
Henrik Rydgård 065a68ef4f Split out screen rotation from the projection matrix 2026-05-17 10:58:54 +02: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 bb6d696a84 Merge the tex "ubershader" uniforms into one for convenience 2023-05-25 10:19:01 +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 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 c7c48abb37 Switch the 2x flag to a uniform 2023-01-10 12:36:28 +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 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 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 26c748f959 Make fog-enable driven by uniform instead of fragment shader flag bit 2023-01-04 10:14:11 +01:00
Henrik Rydgård 26884150d7 Remove the 0th descriptor set, move everything else back to 0 2022-12-16 13:05:40 +01:00
Henrik Rydgård ad6725b684 VK/D3D11: Move the rarely used "u_rotation" uniform to the frame uniform buffer.
This uniform is used in two cases:

* Non-buffered rendering in Vulkan, software transform
* Non-buffered rendering in D3D11 level 9 on Windows Phone, software transform
  - which I don't think anyone builds for anymore

Nice to not have it in the main uniform buffer, but mainly a
demonstrator/test of moving stuff to the new frame-global buffer, and
setting up the infrastructure.
2022-11-05 22:14:05 +01:00
Henrik Rydgård ab1cebec51 Actually bind a global uniform buffer, too. Not yet used. 2022-10-28 10:15:36 +02:00
Henrik Rydgård fb250c4b29 More multiview work 2022-10-27 11:05:58 +02:00
Henrik Rydgård 089ac9a50e Comment about VR uniforms 2022-10-10 18:02:19 +02:00
Henrik Rydgård aec22491fe Don't expand alphaColorRef to 128 bytes on backends where we don't need to. 2022-10-10 18:02:01 +02:00
Henrik Rydgård fc30b04430 ShaderUniforms: cleanup, put every "4-float" on a line for clarity 2022-09-26 13:05:25 +02:00
Henrik Rydgård cfa427c37a Shuffle constants around, squeezing them into gaps. Saves another 16 bytes. 2022-09-26 13:05:24 +02:00
Henrik Rydgård f4b71e2dc7 Fragment shader uniforms: Pack color mask in 32 bits instead of expand to 128 bits.
Allows us to save 16 bytes from the main uniform buffer, since there's
free 32-bit spaces here and there to use.
2022-09-26 13:04:56 +02: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 96f054f098 Fix light ubershader for D3D11 and OpenGL, GLES unsigned/signed stuff 2022-09-25 23:35:08 +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 650ce22359 Force low resolution for effects in Burnout Dominator. Fixes lens flare at high res 2022-09-14 22:18:34 +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 b87451de92 GPU: Restore rotation handling in sw transform. 2021-10-30 18:22:53 -07:00
Henrik Rydgård 06425dae8c Remove superfluous variable from uniform buffer 2020-12-03 09:13:46 +01:00
Henrik Rydgård 6310af25fa Get shader color write masking going on all backends. 2020-11-08 23:45:47 +01:00
Henrik Rydgård 17778131bd Share the uniform buffer declarations between D3D11 and VK. 2020-11-01 19:58:53 +01:00
Henrik Rydgård 8efb40180e Make the hardware skinning code match 2020-11-01 19:58:50 +01:00
Henrik Rydgård a8f4a4d749 Fix more vertex shader differences 2020-10-25 08:34:35 +01:00
Henrik Rydgård 057fd9f8a3 Bridge more vertex shader differences 2020-10-25 08:34:35 +01:00
Henrik Rydgård 712f56fb7d Vulkan: remove array indexing for light parameters to match the other backends 2020-10-21 23:20:11 +02:00
Henrik Rydgård 391d2ea73d Rename vk uniforms to match the other backends 2020-10-21 21:13:08 +02:00
Unknown W. Brackets c42fb72419 GPU: Update uniforms w/ consistent render mode too. 2020-04-04 11:03:07 -07:00
Unknown W. Brackets 52baec21a8 GPU: Refactor cull range calculation together. 2018-09-17 22:27:25 -07:00
Unknown W. Brackets 44ba31fbc6 Vulkan: Implement verex range culling.
Also D3D11, since they are very similar.
2018-09-17 07:27:26 -07:00