aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs')
-rw-r--r--src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs15
1 files changed, 15 insertions, 0 deletions
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
@@ -737,6 +737,19 @@ namespace Ryujinx.Graphics.Gpu.Shader
}
/// <summary>
+ /// Populates pipeline state that doesn't exist in older caches with default values
+ /// based on specialization state.
+ /// </summary>
+ /// <param name="pipelineState">Pipeline state to prepare</param>
+ private void PreparePipelineState(ref ProgramPipelineState pipelineState)
+ {
+ if (!_compute)
+ {
+ pipelineState.DepthMode = GraphicsState.DepthMode ? DepthMode.MinusOneToOne : DepthMode.ZeroToOne;
+ }
+ }
+
+ /// <summary>
/// Reads shader specialization state that has been serialized.
/// </summary>
/// <param name="dataReader">Data reader</param>
@@ -776,6 +789,8 @@ namespace Ryujinx.Graphics.Gpu.Shader
{
ProgramPipelineState pipelineState = default;
dataReader.ReadWithMagicAndSize(ref pipelineState, PgpsMagic);
+
+ specState.PreparePipelineState(ref pipelineState);
specState.PipelineState = pipelineState;
}