3935 Commits

Author SHA1 Message Date
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
Henrik Rydgård
ed3cd1dc26
Merge pull request #16150 from unknownbrackets/vram-mirrors
GPU: Mask away unused bits in framebuf/zbuf ptr, cleanup
2022-10-03 11:56:24 +02:00
Unknown W. Brackets
b9b59f7806 GPU: Mask away unused bits in framebuf/zbuf ptr.
Lower 4 bits are ignored during rendering, and mirrors (even even the 8
bit at the top) are ignored.
2022-10-02 20:44:35 -07:00
lainon
3cdf72b68b Better readability and optimization insertion into container by replacing 'insert' -> 'emplace', 'push_back' -> 'emplace_back' 2022-09-30 12:35:28 +03:00
lainon
b304551747 Code readability, vec reserve() and remove excess c_str() 2022-09-30 12:31:32 +03: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
Lubos
adffbb2ea7 Merge branch 'master' into compat_openxr_gta 2022-09-23 14:16:58 +02:00
Unknown W. Brackets
a8eced4773 GLES: Avoid resizing tessellation data textures.
Just recreate when it needs to be larger.  Fixes Test Drive Unlimited
issues noted in #16069.
2022-09-21 23:30:00 -07:00
Lubos
c4dbd6d045 Merge branch 'master' into compat_openxr_gta 2022-09-20 21:46:33 +02:00
Henrik Rydgård
aa19712fc3 Unify depth texture and framebuffer fetch checks 2022-09-20 10:47:49 +02:00
Henrik Rydgård
09bcf3ec13 Unify range culling detection 2022-09-20 10:15:04 +02:00
Henrik Rydgård
1ae7c0132c Start unifying setting of the GPU feature flags, now that thin3d has feature detection. 2022-09-20 10:07:01 +02: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
Unknown W. Brackets
c08c873462 GLES: Support more clip distances.
Will be used later, for now just the enable/disable logic.
2022-09-18 13:16:59 -07:00
Henrik Rydgård
ce82fce8de Use subpass dependencies to implement shader framebuffer read in Vulkan. 2022-09-16 19:19:42 +02:00
Luboš Vonásek
861af63be9
Merge branch 'hrydgard:master' into compat_openxr_gta 2022-09-16 10:20:11 +02:00
Henrik Rydgård
a208afb7b8 OpenGL and D3D11 fixes 2022-09-14 23:35:15 +02:00
Henrik Rydgård
abd58199ce Add way to bind cached textures to a DrawContext 2022-09-14 22:18:35 +02:00
Henrik Rydgård
0ed1f3d461 Switch multiple bools as parameters to DecodeTextureLevel to a flags enum. 2022-09-14 18:40:08 +02:00
Lubos
e406dc4730 Merge branch 'master' into compat_openxr_gta 2022-09-13 21:01:55 +02:00
Lubos
b695c1ffb3 Merge branch 'master' into compat_openxr_gta 2022-09-12 23:04:31 +02:00
Lubos
e49ee5c93b Merge branch 'master' into feature_openxr_stereo 2022-09-12 18:49:22 +02:00
Lubos
bdde5f0f7f OpenXR - Use per game stereo separation file 2022-09-12 18:47:13 +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
Luboš Vonásek
5be9455bf5
Merge branch 'hrydgard:master' into compat_openxr_gta 2022-09-08 18:39:11 +02:00
Lubos
c9f08a85c6 OpenXR - Do not mashup Common/GPU 2022-09-08 18:25:10 +02:00
Henrik Rydgård
f3c097680e
Merge pull request #15982 from hrydgard/renderpass-refactor
Vulkan: Refactor renderpass handling
2022-09-08 09:35:55 +02:00
Unknown W. Brackets
e6b4495e22 GPU: Make NotifyConfigChanged() calls consistent.
They're generally centralized in Common.
2022-09-07 23:41:00 -07:00
Henrik Rydgård
e828df9f25 Split each renderpass/framebuffer into multiple "compatibility classes" (RenderPassType). 2022-09-08 00:32:03 +02:00
Lubos
08226d8396 OpenXR - Stereo matrices fixed 2022-09-05 20:49:25 +02:00
Lubos
3a0e6c7232 Merge branch 'master' into feature_openxr_stereo 2022-09-05 19:11:52 +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
Lubos
4ce0579f70 OpenXR - Split projection matrix for color and depth buffer 2022-09-04 21:12:18 +02:00
Lubos
5be6665df8 Merge branch 'master' into feature_openxr_stereo 2022-09-04 12:37:41 +02:00
Lubos
1df1d79b9e OpenXR - Stereo without multiview added 2022-09-04 12:36:52 +02:00
Henrik Rydgård
ec173559f8 Additional cleanup 2022-09-04 00:10:55 +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
8e39018b95 Channel mask refactor 2022-09-04 00:10:54 +02:00
Henrik Rydgård
c846c2dfa8 Remove confusing resetFramebufferRead flag from secondary framebuffer binding 2022-09-03 14:48:07 +02:00
Henrik Rydgård
8c56abd3dc Remove setting "Disable slower framebuffer effects" 2022-09-03 11:06:43 +02:00
Henrik Rydgård
b84cda2876 Plumb the computed pipeline state into ComputeFragmentShaderID. 2022-09-02 22:16:57 +02:00
Henrik Rydgård
c784c0e94b Some renaming. Store the BlendState/MaskState. 2022-09-02 21:07:29 +02:00
Lubos
00aaf9e1a6 Merge branch 'master' into feature_openxr_stereo 2022-09-01 18:09:21 +02:00
Henrik Rydgård
2bf0c86ac7 Fix image format when dumping textures.
Fixes #15831
2022-09-01 15:04:59 +02:00
Henrik Rydgård
67d6549afd Rename Slow Framebuf effects to Shader Blending (might remove). Reassign readbacks to BlockTransferGPU. 2022-08-31 14:23:33 +02:00
Henrik Rydgård
08eaf7665c Fix race condition in replacement texture loading
The texture could become valid during the load, causing an inconsistent
state within the texture loading. So can only check for valid-ness once.
2022-08-30 12:52:31 +02:00
Henrik Rydgård
6f2966f502 Clean up mip size calculations
Calculating the same thing in multiple places is a recipe for bugs, so
let's not.
2022-08-30 12:05:57 +02:00