Commit Graph

142 Commits

Author SHA1 Message Date
Henrik Rydgård 30aa07b156 Two more renames to make things read better 2022-10-17 08:47:05 +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
Henrik Rydgård 4d1da5859c Add simple way to add debug annotation in the middle of the command stream. Vulkan-only. 2022-10-13 22:39:44 +02:00
Unknown W. Brackets 2f9392083a GPU: Respect stencil state in shader blend. 2022-10-11 22:26:31 -07:00
Henrik Rydgård e0e29a1556 Merge pull request #16197 from hrydgard/more-uniform-optimization
More uniform optimization, fixes
2022-10-12 01:00:27 +02:00
Henrik Rydgård d30d8bf35c Removes the option, autodetect instead - only enable if the GPU doesn't support bitwise ops. 2022-10-11 16:09:57 +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
Unknown W. Brackets 38818f9f6e GLES: Fix colortest/logicop uint/int conversion.
Shown well in #16119.
2022-09-27 19:24:54 -07:00
Henrik Rydgård 9b46adb985 Fix color test.
Fixes the new color test bug reported in #13324, though doesn't fix that
issue (didn't confirm it still is one).
2022-09-26 22:51:46 +02:00
Unknown W. Brackets 4329aaa31c GPU: Apply color test mask as a uint.
This is simpler and allows us to unify paths better.
2022-09-26 06:57:41 -07:00
Unknown W. Brackets a19a057e8c GPU: Consistently use uvec3 for colortest. 2022-09-26 06:57:41 -07:00
Henrik Rydgård d9f74d2fb7 ivec->uvec, comment fix 2022-09-26 13:05:25 +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 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 ce82fce8de Use subpass dependencies to implement shader framebuffer read in Vulkan. 2022-09-16 19:19:42 +02:00
Henrik Rydgård a52e62a187 Enable depth uploads on render-to-clut-buffer. Esoteric but needed for #11100. Compat flag for now. 2022-09-14 22:18:34 +02:00
Henrik Rydgård 8d00df12a4 Detect the CLUT8/8888 situation
Implement CLUT8 depal from 8888 textures. Hard to tell if working
2022-09-14 22:18:34 +02:00
Henrik Rydgård b4d0ac2e1c Unify CLUT texture size at 512 to reduce complexity. Worth the extra bytes. 2022-09-13 11:56:56 +02:00
Henrik Rydgård 3e7f6b57aa Shadergen issues found by the test 2022-09-11 16:52:33 +02:00
Henrik Rydgård 694dbe1271 Add ShaderDepalMode enum, use in shader ID. Replaces smoothed bit. 2022-09-11 14:40:01 +02:00
Henrik Rydgård 9bd8b11bf8 Implement shader depal for D3D11. 2022-09-11 13:41:17 +02:00
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