From 4741a05df95dd8964543f9770d8bfe15d842beaf Mon Sep 17 00:00:00 2001 From: riperiperi Date: Thu, 1 Jun 2023 08:05:39 +0100 Subject: Vulkan: Include DepthMode in ProgramPipelineState (#5185) --- .../Shader/ShaderSpecializationState.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/Ryujinx.Graphics.Gpu/Shader') diff --git a/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs b/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs index b2c4fccd..9b0c8b9b 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs @@ -736,6 +736,19 @@ namespace Ryujinx.Graphics.Gpu.Shader return MatchesTexture(specializationState, descriptor); } + /// + /// Populates pipeline state that doesn't exist in older caches with default values + /// based on specialization state. + /// + /// Pipeline state to prepare + private void PreparePipelineState(ref ProgramPipelineState pipelineState) + { + if (!_compute) + { + pipelineState.DepthMode = GraphicsState.DepthMode ? DepthMode.MinusOneToOne : DepthMode.ZeroToOne; + } + } + /// /// Reads shader specialization state that has been serialized. /// @@ -776,6 +789,8 @@ namespace Ryujinx.Graphics.Gpu.Shader { ProgramPipelineState pipelineState = default; dataReader.ReadWithMagicAndSize(ref pipelineState, PgpsMagic); + + specState.PreparePipelineState(ref pipelineState); specState.PipelineState = pipelineState; } -- cgit v1.2.3