diff options
author | riperiperi <rhy3756547@hotmail.com> | 2023-06-01 08:05:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-01 09:05:39 +0200 |
commit | 4741a05df95dd8964543f9770d8bfe15d842beaf (patch) | |
tree | 74263d1eddd3fdf2fbbc691316618be9d42dbc3d /src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs | |
parent | c6676007bfdc65724afebac27990c47a5d6aa3dd (diff) |
Vulkan: Include DepthMode in ProgramPipelineState (#5185)1.1.849
Diffstat (limited to 'src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs | 15 |
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; } |