Commit Graph

202 Commits

Author SHA1 Message Date
Henrik Rydgård 9ceffa284d Vulkan: Add robustness against bad shader module compiles 2022-12-31 12:21:53 +01:00
Henrik Rydgård d2feb444b7 Bunch of defensive programming around shaders 2022-12-31 12:21:51 +01:00
Henrik Rydgård f069de2dd2 Pass the vertex decoder into the vertex shader IDs generator
Instead of just the vertex type.

This will allow things like the vertex decoder supplying defaults, in
order to reduce the number of unique vertex shaders at the cost of
slightly larger vertex data.

This doesn't actually do that yet though, it's just a refactor that can
be done separately.

Part of #16567
2022-12-30 22:57:05 +01:00
Unknown W. Brackets 49f6c461ad Reporting: Fix some header includes.
Particularly in Common, avoid including Core/Reporting.h.
2022-12-27 14:58:20 -08:00
Henrik Rydgård 00ebf4957f Make shader cache loading a bit more lenient. 2022-12-13 23:06:57 +01:00
Henrik Rydgård 65c721dce6 Rename Save/LoadCache to Save/LoadPipelineCache 2022-12-13 19:18:20 +01:00
Henrik Rydgård ee19db091f Add accessor for UseFlags 2022-12-13 18:27:45 +01:00
Henrik Rydgård 313a2b1327 Improve shader cache logging 2022-12-13 16:35:02 +01:00
Henrik Rydgård ad1cd40ff7 Bump shader cache versions before release, just to be safe. 2022-12-13 08:45:20 +01:00
Unknown W. Brackets 78ed8d45a7 Vulkan: Defer deletion of shader module promises. 2022-12-03 14:53:10 -08:00
Henrik Rydgård d72ad3b3f4 Fragment shader generator: Move the framebuffer fetch bit to the shader ID.
Will resolve a future issue in the multisampling PR, where the
GPU_USE_FRAMEBUFFER_FETCH flag changes at runtime if you switch between no AA and MSAA.

Just figured I'd get it in separately for safety.
2022-11-30 00:26:15 +01:00
Henrik Rydgård 970c266b41 Restore parallel GLSL builds 2022-11-08 00:30:21 +01:00
Henrik Rydgård 24d5cd087c Experiment (Vulkan): Temporarily disable GLSL parallel compilation on Android. For #16341 investigation. 2022-11-07 14:30:24 +01:00
Unknown W. Brackets 6c36f03a0d GPU: Purify vertTypeIsSkinningEnabled(). 2022-11-06 08:40:54 -08:00
Henrik Rydgård d3804ec2e5 Misc multiview hackery 2022-10-27 11:05:58 +02:00
Henrik Rydgård 8cd602a9c6 Merge pull request #16257 from unknownbrackets/error-cleanup
Kernel: Fix reported StopThread error
2022-10-19 08:06:30 +02:00
Unknown W. Brackets a42064eb48 Vulkan: Correct some enum switch warnings.
Nice to log debug annotations anyway.
2022-10-18 21:52:38 -07:00
Henrik Rydgård 7c5fc3ccb5 Reorder the GPU USE flags a bit 2022-10-17 19:55:11 +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 aee2ad46a2 GPU: Verify generated shader buffer length.
Hardware tessellation + uberlighting + clamp was exceeding the buffer,
causing memory corruption.  Let's try to catch it, but also increase
buffers to be safe.
2022-10-05 21:41:09 -07:00
Henrik Rydgård cdee10fe86 Vulkan: Basic geoshader code generation. 2022-10-02 07:42:17 -07:00
Unknown W. Brackets fbdb278168 Vulkan: Update shader cache format for geo shaders. 2022-10-02 07:42:16 -07:00
Unknown W. Brackets d16caa71af Vulkan: Add geometry shader ID tracking.
We're still not generating them, yet.  But this tracks the objects and
IDs through the pipeline.
2022-10-02 07:42:16 -07:00
Unknown W. Brackets 38e16324f0 Vulkan: Clean up shader module tag. 2022-10-02 07:42:16 -07:00
Unknown W. Brackets 878a049f60 GPU: Add dirtying for geo shader state.
Not yet used, but dirtied at the right times.
2022-10-02 07:42:16 -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 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 08d2cb4486 Bump the shader cache version 2022-09-24 22:40:42 +02:00
Henrik Rydgård b86648b352 Address feedback 2022-09-12 16:30:08 +02:00
Henrik Rydgård 4ad345d78d Better shader compile logging 2022-09-12 15:39:29 +02:00
Henrik Rydgård a2eaad5445 Debug-name shader modules with their shader desc strings 2022-09-12 15:39:29 +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 14b5a1a7cd Fix pipeline lifetime issue, misc. 2022-09-08 00:38:32 +02:00
Henrik Rydgård befcfb470c Fix shader caching. 2022-09-08 00:38:32 +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 2474eb6a72 Shader bit setup and code generation for logic-ops-in-shader 2022-09-04 11:14:47 +02:00
Henrik Rydgård 6b1e4806cf Don't parallelize shader compiles in debug mode, sync in debug allocator kills performance. 2022-09-03 23:07:39 +02:00
Henrik Rydgård fb3f417e77 Fix lying comment, log level reduction 2022-09-03 16:15:46 +02:00
Henrik Rydgård 6e605fa2bc Fix silly logic, fixes the shader leak. 2022-09-03 15:21:07 +02:00
Henrik Rydgård 8775837c11 Work towards finding the leak 2022-09-03 15:21:07 +02:00
Henrik Rydgård fc418ee16f Create shader modules (and compile GLSL) on worker threads 2022-09-03 15:21:07 +02:00
Henrik Rydgård ec0586ba50 Use promises to hold shader modules, for later asyncification 2022-09-03 15:21:07 +02:00
Henrik Rydgård b84cda2876 Plumb the computed pipeline state into ComputeFragmentShaderID. 2022-09-02 22:16:57 +02:00
Henrik Rydgård b447092742 Some Vulkan renderpass load/store optimizations. 2022-08-28 23:16:48 +02:00
Henrik Rydgård 6781dd5fe8 Fix Katamari 2022-08-26 23:47:22 +02:00
Unknown W. Brackets 7ec62a32b4 GPU: More consistently clear ptrs on DeviceLost().
Rather get a null pointer crash than confusing buggy use-after-free
excitement.
2022-08-23 20:15:30 -07:00
Unknown W. Brackets 2479d52202 Global: Reduce includes of common headers.
In many places, string, map, or Common.h were included but not needed.
2022-01-30 16:35:33 -08:00
Henrik Rydgård 81fba1f4a4 Minor refactor 2021-11-21 22:08:53 +01:00
Unknown W. Brackets 8a5f07b860 Vulkan: Don't cache vulkan_ with draw context.
Since we can get the VulkanContext cheaply from the draw context, it's
easier to make sure things stay up to date.
2021-11-14 15:25:28 -08:00
Henrik Rydgård 5dab9994b6 Bezier/Spline: Fix logical error (must flush buffered data before we modify submitType).
Should fix #14774
2021-09-07 23:52:06 +02:00