Commit graph

70 commits

Author SHA1 Message Date
Henrik Rydgård
e828df9f25 Split each renderpass/framebuffer into multiple "compatibility classes" (RenderPassType). 2022-09-08 00:32:03 +02:00
Henrik Rydgård
b15c65540e Fix the new logic-op-in-shader on OpenGL and D3D11
Also disable BlueToAlpha for now for Outrun and DiRT 2, it breaks the
water effect somehow. Will come back to it later.
2022-09-04 22:53:05 +02:00
Henrik Rydgård
7882c4cd6d Shader unit test fix 2022-09-04 20:06:59 +02:00
Henrik Rydgård
8800f2046b Preserve alpha in shader logic op emulation. Include logic op in check for packUnorm4x8. 2022-09-04 19:27:26 +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
de712b7804 More renaming 2022-09-02 22:20:11 +02:00
Henrik Rydgård
4da2ca0935 Implement shader blending for D3D9
This was easy, dunno why I never got around to it before..
I guess I didn't know about VPOS.

This does raise our minimum shader model requirement to ps_3_0.
2022-08-30 12:19:56 +02:00
Henrik Rydgård
67c911d13f Fix smoothed CLUT lookups. Shouldn't go beyond the mask's reach.
Should help #15896
2022-08-24 17:13:36 +02:00
Henrik Rydgård
d459eac891 Fix checks for depth texture support, GLES syntax errors 2022-08-24 11:26:07 +02:00
Henrik Rydgård
2a6015c1e3 Better checks for smoothed depal 2022-08-22 15:25:28 +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
f5e6754ac0 Special case depal lookups for Test Drive's strange usage.
This implements the hack I suggested in #13355, where instead of first
reducing the color to RGB565 as the real game does, we just take each
channel at full precision and do the lookup according to the mask,
linearly filtering the palette.

This makes the game look a lot nicer and is also a small optimization,
but the hack is very specific so kinda ugly in a way.
2022-08-22 15:19:38 +02:00
Henrik Rydgård
886679c7ec Remove the color-to-depth mode 2022-08-20 08:29:33 +02:00
Henrik Rydgård
ade8b88766 Try to fix shader compilation error on Adreno reported by Lubos 2022-08-12 21:32:32 +02:00
Henrik Rydgård
92a3d45340 Lock out shaderDepal from D3D for now, will implement later. 2022-08-06 18:27:03 +02:00
Henrik Rydgård
5da7dd42b5 Fix Vulkan as well 2022-08-01 15:48:52 +02:00
Henrik Rydgård
b940c8a8b7 Fix for D3D11 and GL, but not Vulkan for some weird reason 2022-08-01 15:45:05 +02:00
Henrik Rydgård
7b7d16d2fb D3D9 fix 2022-08-01 12:11:42 +02:00
Henrik Rydgård
73fc9fb520 OpenGL fix 2022-08-01 11:57:22 +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
c158414858 Give the mip bias its own uniform flag. 2022-07-31 10:43:48 +02:00
Henrik Rydgård
cc857e8217 Revert mistaken change in D3D9 fragment shader gen 2022-07-31 10:43:48 +02:00
Henrik Rydgård
46d6b43618 Support 3D textures in OpenGL ES, add feature check 2022-07-31 10:43:48 +02:00
Henrik Rydgård
129f3fe997 Testfix, cleanup 2022-07-31 10:43:48 +02:00
Henrik Rydgård
fecf9127a0 Implement 3D texturing in the OpenGL backend too. Assorted fixes. 2022-07-31 10:43:48 +02:00
Henrik Rydgård
566385f762 Remove some dead code 2022-07-31 10:43:48 +02:00
Henrik Rydgård
f87b4cf232 Implement 3D textures for D3D9 as well 2022-07-31 10:43:48 +02:00
Henrik Rydgård
0262fbc70a Implement 3D textures for D3D11 2022-07-31 10:43:48 +02:00
Henrik Rydgård
e455d6bcfe Some safety checks to avoid bad combinations, probably not really needed in practice. 2022-07-31 10:43:48 +02:00
Henrik Rydgård
d7aa3ee486 Fix the mip bias to take the texture depth and sampling offset into account. 2022-07-31 10:43:48 +02:00
Henrik Rydgård
2cb9e09ad3 Implement new discovery of a larger CLUT than we thought, plus non-shared CLUTs for 8-bit indices.
Not sure yet what limitations apply, regarding using it for even more
16-bit colors, etc...
2022-07-31 10:43:48 +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
Henrik Rydgård
0ff8c721e4 Improve comment, variable name 2022-07-12 00:17:26 +02:00
Henrik Rydgård
e52e9094ca Vulkan fragment shaders: Don't opportunistically emit "layout (early_fragment_tests)"
The purpose of this is not really for optimization, it's to get a
specific behavior that we really don't care about. Drivers are pretty
good at getting this potential performance improvement automatically
if it's possible without changing the output.

git blame says I added it, heh.

Don't think it'll make much difference one way or another, though, but
trying to reduce complexity.
2022-07-12 00:14:22 +02:00
Henrik Rydgård
6b2dec91b5 Finish BlueToAlpha functionality 2022-04-30 18:17:17 +02:00
Henrik Rydgård
462972f7ea Add option to redirect blue to alpha if 565 mode is rendered and mask is 0x0FFFFF.
This is used by several games to render to the alpha channel of RGBA4444
images, which cannot normally be done directly on the PSP.

Can be used as a far more efficient replacement for
ReinterpretFramebuffers/ShaderColorBitmask
2022-04-30 18:17:16 +02:00
Unknown W. Brackets
c18236b5fa GPU: Avoid switch on uint.
Vivante seems to get confused.
2021-04-10 14:01:33 -07:00
Henrik Rydgård
98f593fd5d Only do the workaround in #14273 in Vulkan. May help #14280 2021-03-11 09:14:36 +01:00
Henrik Rydgård
3ac405ab5d GLSL vulkan: Specify the precision of function arguments. Works around #14269 2021-03-09 00:09:00 +01:00
Henrik Rydgård
294f530cd0 Have the flat shading workaround obey the driver workarounds checkbox 2021-01-31 15:50:19 +01:00
Henrik Rydgård
960e2dac36 OpenGL fragment shader gen: Fix precision inconsistency for v_color0/1.
Probably won't fix anything, just want this in for, well, consistency.

Noticed it debugging the iOS flat shading issues, but doesn't fix that.
2021-01-24 18:29:55 +01:00
Henrik Rydgård
c8bbf40bb0 GL FB readback: Only use "inout" if we actually want to read from the fb. 2021-01-17 19:13:56 +01:00
Henrik Rydgård
71f9196d61 VK: Re-apply the old Adreno driver bug workaround. Fixes #13910.
Should likely fix issue #13923 too.
2021-01-16 12:57:14 +01:00
Unknown W. Brackets
1834a524c8 GPU: Be careful with color write mask precision. 2021-01-03 08:50:34 -08:00
Unknown W. Brackets
4006a4b143 GPU: Ignore color write mask if unusable.
We unconditionally attempt to use a shader with color write mask, so we
can't just refuse to generate a shader - it'll mean non-supporting devices
get no shader at all.

It's better to continue ignoring the mask in that case.
2021-01-03 08:15:37 -08:00
Henrik Rydgård
7de7680416 Apple driver bug workaround. See issue #13451 2020-12-16 14:39:08 +01:00
Henrik Rydgård
29b2f2c4ef Better GLSL version handling. Now specify the latest version supported by the device.
Correct the version check for our own implementations of packUnorm4x8 etc.
2020-11-16 23:30:07 +01:00
Henrik Rydgård
e14437cb3f OpenGL: Assorted shader-depal bugfixes and regression fixes.
Fixes #13517
2020-11-11 23:09:48 +01:00
Henrik Rydgård
653a4bddde Fix check for when to generate packUnorm4x8 replacements 2020-11-11 22:46:25 +01:00