Commit Graph
99 Commits
Author SHA1 Message Date
Unknown W. Brackets f09c09caa8 GLES: Avoid GLSL redefinition error. 2023-01-08 22:30:15 -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
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 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å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
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. Brackets 2b4a182b46 GLES: Use hex for uint constants.
Apparently some Adreno drivers have issues (fixed in 2014):
https://developer.qualcomm.com/forum/qdn-forums/maximize-hardware/mobile-gaming-graphics-adreno/27945
2023-01-02 13:13:48 -08: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 7950a00c14 Headless buildfix. Crashfix in shader generator test. 2022-12-01 22:49:00 +01:00
Lubos d466ae161a OpenXR - HUD max scale fixed 2022-11-28 19:46:46 +01:00
Henrik Rydgård 7eee7f2573 Fix shader debug description issue. 2022-11-23 15:41:20 +01:00
Henrik Rydgård 8f103f3f47 Extract the Vulkan descriptor binding cleanup from #16345 2022-11-21 20:30:20 +01:00
Unknown W. Brackets eae85836c9 GPU: Add a small error-compensation to depth clip.
This was causing a depth that should've calculated as zero to be clipped,
because the multiply and division resulted in a value that was off by
about 2 / pow(2, 24) in the negative direction.
2022-11-12 20:01:46 -08:00
Lubos 72d197fc47 Revert "OpenXR - Disable range culling properly"
This reverts commit d1dabd40ee.
2022-11-10 18:44:11 +01:00
Henrik Rydgård c6084c16c3 Fix GLSL compilation issues on really old Adreno drivers.
They don't seem to accept unsigned integers as switch cases.

Fixes some stuff in #16295 , not sure if all of it.
2022-11-08 22:59:43 +01:00
Henrik RydgårdandGitHub 87bd7aaccc Merge pull request #16356 from lvonasek/cleanup_camera_control
OpenXR - Camera adjust using any controller
2022-11-08 12:28:44 +01:00
Henrik Rydgård 4e8f97d64d Output shader descriptions directly in the source code 2022-11-08 00:21:08 +01:00
Lubos d1dabd40ee OpenXR - Disable range culling properly 2022-11-07 22:10:12 +01:00
Henrik Rydgård 0f37854ef9 Drop some D3D11 screen rotation support (was only used on Windows Phone) 2022-11-05 22:17:06 +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 96a5c52037 Vulkan: Reserve descriptor set 0 for frame-global data, move everything else to set 1 2022-10-28 09:39:56 +02:00
Henrik Rydgård 6d9008dab5 Fix validation issue with clears, remove redundant code 2022-10-27 11:05:59 +02:00
Henrik Rydgård 15d4495f76 Pass shadergen tests 2022-10-27 11:05:59 +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 d3804ec2e5 Misc multiview hackery 2022-10-27 11:05:58 +02:00
Henrik Rydgård 3af86ec6f7 Make it possible to specify extensions for Vulkan in the ShaderWriter 2022-10-22 17:46:57 +02:00
Henrik RydgårdandGitHub a830f18054 Merge pull request #16265 from unknownbrackets/lighting-nonormal
GPU: Respect world matrix and reverse flag w/o normals
2022-10-21 09:16:53 +02:00
Unknown W. Brackets d23293ee72 GPU: Respect matrix and reverse flag w/o normals.
See frame dump in #14223, which requires world matrix be applied.
2022-10-20 23:15:25 -07:00
Henrik Rydgård aa51bfd1ef Use GPU "use" flags to replace IsVRBuild in the renderer. It remains elsewhere. 2022-10-17 19:57:11 +02:00
Henrik Rydgård 9b8a5d1db3 Rename GPU_SUPPORTS_ to GPU_USE_ 2022-10-17 08:47:03 +02:00
Henrik Rydgård daca0b2109 Rename gstate_c.Supports to gstate_c.Use 2022-10-17 08:46:37 +02:00
Unknown W. Brackets 3aa863ec41 GPU: Clip against neg Z even w/o cull support.
This should fix rendering issues on Apple devices.
2022-10-06 00:34:02 -07:00
Unknown W. Brackets bc3d3cf9fb GPU: Optimize clip distances needed.
We only need to write one clip distance to clip clamped depth, since we
don't clamp when it needs clipping on both sides.
2022-10-05 21:17:17 -07:00
Unknown W. Brackets 8025def8d2 Vulkan: Clip to neg z in the geometry shader.
This is only used when clip distance is unsupported, such as on Mali.
2022-10-04 22:10:24 -07:00
Henrik RydgårdandUnknown W. Brackets ac248338be Vulkan: Cull in geoshader, hack to on for now. 2022-10-02 07:42:17 -07:00
Unknown W. Brackets 59a489f883 Draw: Add COLOR1 semantic. 2022-10-01 12:14:46 -07:00
Unknown W. Brackets 34a8056017 GPU: Correct normalized zero normal proj map.
Unlike lighting, this does not use 0, 0, 1.
2022-09-26 15:11:11 -07:00
Henrik Rydgård 07ca9e4656 Fold the "materialUpdate" flag into the light ubershader part.
This reduces the number of vertex shaders and thus pipelines by quite a
bit more in a few games, like Tekken and GoW, continuing the fight
against shader compile stutter.

The perf impact should be minimal if not positive due to less pipeline
changes.

GLES fixes

Make the vertex input declarations match (always declare fog input).  Fixes D3D11 validation

Tess fix
2022-09-26 12:06:16 +02:00
Henrik Rydgård 196f8e3461 Prepare for dynamic mat update 2022-09-26 11:21:40 +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 f30252f8d5 Oops! Also, testfix 2022-09-25 23:35:08 +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
Unknown W. Brackets 1e78f3aa57 GPU: Correct neg normal for hwtess texgen. 2022-09-21 22:06:32 -07:00