Commit graph

48 commits

Author SHA1 Message Date
Unknown W. Brackets
f8d29fdc1a GPU: Simplify depth clamped clip planes.
There's no need to think about the scaled Z if we're using w anyway, just
use the existing Z clipping.
2022-09-20 16:23:19 -07:00
Unknown W. Brackets
2fc7f72d72 GPU: Clip clamped depth accounting for perspective. 2022-09-20 15:55:39 -07:00
Unknown W. Brackets
a2a7e8258b GPU: Clip depth properly when also clamping.
Helps situations like #11216, where only one side should be clamped.
Keeps depth clamp (i.e. #7932) working.  See #11399.
2022-09-18 13:18:02 -07:00
Henrik Rydgård
e56e5947d5 Vulkan: Declare gl_Position as invariant. See #11583
The code that computes shader outputs declared as invariant gets certain
optimizations disabled that could change the value - it makes it more
likely that different ways to do the same calculations end up with the same value.

This can help some types of Z fighting problems and similar.

Generally not a big deal for performance, plus, we're rarely vshader-bottlenecked...
2022-09-10 00:26:23 +02:00
Lubos
5b47d22afc OpenXR - Mismatch in stereo and normal uniform fixed 2022-09-04 21:27:48 +02:00
Lubos
81de46c978 OpenXR - Do not include lens projection in nonVR builds 2022-09-04 21:20:35 +02:00
Lubos
4ce0579f70 OpenXR - Split projection matrix for color and depth buffer 2022-09-04 21:12:18 +02:00
Lubos
4bd5a28604 OpenXR - Flag to easily disable multiview shaders added 2022-08-28 14:49:27 +02:00
Lubos
c2c0561be2 OpenXR - OPENXR ifdef removal 2022-08-27 17:33:37 +02:00
Lubos
4026d49104 OpenXR - Multiview uniforms working 2022-08-17 19:14:36 +02:00
Lubos
22e7f87e33 OpenXR - Disable multiview for now 2022-08-16 21:32:11 +02:00
Lubos
71df50a354 OpenXR - GL and OXR logging added 2022-08-16 17:39:54 +02:00
Lubos
ab6c91c203 OpenXR - Integrate multiview into system 2022-08-14 18:51:45 +02:00
Lubos
4814bed7df OpenXR - HUD support added 2022-08-02 20:58:16 +02:00
Henrik Rydgård
1fd80646cb Mali driver bug workaround for driver 32+.
See #15661

Hope this small bias won't break things.
2022-07-17 22:53:10 +02:00
Unknown W. Brackets
a181c9f7c4 unittest: Correct failing unit test.
Was just an invalid flag combination.
2022-01-29 12:22:11 -08:00
Unknown W. Brackets
142db5d61e GLES: Explicitly enable ARB_cull_distance. 2021-11-06 11:33:41 -07:00
Unknown W. Brackets
b3a8e013f6 GPU: Expand points into triangles for higher res. 2021-10-31 13:06:06 -07:00
Henrik Rydgård
3245f54dc1 Optimize the rotation a bit (limit to VK/D3D11, mat2 instead of mat4) 2021-10-31 13:44:54 +01:00
Unknown W. Brackets
b5a2afef76 D3D11: Fix fog in software transform. 2021-10-30 18:24:01 -07:00
Unknown W. Brackets
e688bb2cdf GPU: Correct software transform projection.
Now reading the new fog value.
2021-10-30 18:23:58 -07:00
Unknown W. Brackets
b87451de92 GPU: Restore rotation handling in sw transform. 2021-10-30 18:22:53 -07:00
Unknown W. Brackets
4e5ce403b5 GPU: Process proj matrix in sw transform.
Will need this to properly handle culling and clipping in software
transform.

Temporarily breaks display rotation handling (Vulkan/UWP.)
2021-10-30 18:22:53 -07:00
Unknown W. Brackets
030bfb1fb6
GPU: Fix missing newline in shader. 2021-10-26 06:54:03 -07:00
Henrik Rydgård
906a04f1fd Make sure to not leave cull distance uninitialized in other paths, if we do write to it in some path. 2021-10-26 09:56:38 +02:00
Unknown W. Brackets
275baccc5b GLES: Support GL_APPLE_clip_distance too.
Seems modern Apple mobile chips only support clip.
2021-10-12 20:34:44 -07:00
Unknown W. Brackets
33598f2e75 GPU: Support clip and cull distances separately.
Older GL devices, and it seems Apple devices, may not support cull.
2021-10-12 20:34:44 -07:00
Unknown W. Brackets
7b00c4a572 GPU: Move Z/W equal hack to bugs from supports.
It's really a bug (might even ideally cap the version?), and we already
have other bugs handled the same way.
2021-10-12 20:34:44 -07:00
Unknown W. Brackets
c6a52909f9 D3D11: Support vertex clip/cull planes. 2021-10-12 20:34:43 -07:00
Unknown W. Brackets
1a603fedf5 Vulkan: Cull verts fully outside depth.
Following PSP rules of -1 to 1 pre-viewport Z.  This also enables it for
GLES/OpenGL.
2021-10-12 20:34:43 -07:00
Unknown W. Brackets
7d00b6ca90 GLES: Enable/disable clip distance 0. 2021-10-12 20:34:42 -07:00
Unknown W. Brackets
2271b41d07 Vulkan: Use clip distance only if supported. 2021-10-12 20:34:42 -07:00
Unknown W. Brackets
273b9a3dc1 Vulkan: Add negative Z clipping. 2021-10-12 20:34:42 -07:00
Unknown W. Brackets
24011c3754 GPU: Correct depth handling for guardband.
This culls based on pre-viewport Z and avoids culling based on the clip
range at negative Z.
2021-10-12 20:34:41 -07:00
Henrik Rydgård
71707b5102 Fix bug in vertex shader generator. See #14260. 2021-03-05 12:32:06 +01:00
Unknown W. Brackets
64484a59e6 GPU: Normalize zero consistently in hw transform. 2021-02-28 00:05:10 -08:00
Henrik Rydgård
294f530cd0 Have the flat shading workaround obey the driver workarounds checkbox 2021-01-31 15:50:19 +01: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
Henrik Rydgård
7de7680416 Apple driver bug workaround. See issue #13451 2020-12-16 14:39:08 +01:00
Henrik Rydgård
7061993c8f VK: Restore the ARM Mali Z hack that got lost in the refactor somehow.
Warning fixes.
2020-12-14 19:54:39 +01:00
Henrik Rydgård
f3ebd6553d Turn off vertex range culling in bezier/spline calls.
When we do lower res tess than the real PSP, we cant trust the game to not cause range culling to kick in.

Fixes #11692
2020-12-13 16:04:16 +01:00
Henrik Rydgård
34efa1281b More consistent use of GLSL precision modifiers, now use them in Vulkan too.
Might help #13464 ?
2020-11-10 22:42:41 +01:00
Henrik Rydgård
733a152c54 Move ShaderWriter to Common/GPU, along with some stuff from ShaderCommon.h. 2020-11-04 09:18:35 +01:00
Henrik Rydgård
ce4ee010ac Apparently only MSVC can handle the ambiguity. 2020-11-02 11:45:47 +01:00
Henrik Rydgård
0292d1719d GEDebugger: Use utf-8 internally. 2020-11-02 10:02:52 +01:00
Henrik Rydgård
39b5eb5b3d ShaderWriter, a replacement for the sprintf WRITE macro. 2020-11-02 10:02:52 +01:00
Henrik Rydgård
085900adb5 Fix vertex shader generator bug. Got caught by the new test 2020-11-02 09:03:08 +01:00
Henrik Rydgård
f4ea3ccf22 Move the generic vertex shader generator into GPU/Common and rename it. 2020-11-01 19:58:54 +01:00
Renamed from GPU/GLES/VertexShaderGeneratorGLES.cpp (Browse further)