From be9f5dcf69a11870b7efe823cf730208756dbd3a Mon Sep 17 00:00:00 2001 From: Samuliak Date: Fri, 24 May 2024 16:40:01 +0200 Subject: [PATCH] set the inline state after restoring state --- src/Ryujinx.Graphics.Metal/EncoderStateManager.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs index da3fab54a..313d380f4 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs @@ -45,6 +45,17 @@ namespace Ryujinx.Graphics.Metal { _currentState = _backStates[_backStates.Count - 1]; _backStates.RemoveAt(_backStates.Count - 1); + + // Set all the inline state, since it might have changed + var renderCommandEncoder = _pipeline.GetOrCreateRenderEncoder(); + SetDepthClamp(renderCommandEncoder); + SetScissors(renderCommandEncoder); + SetViewports(renderCommandEncoder); + SetVertexBuffers(renderCommandEncoder, _currentState.VertexBuffers); + SetBuffers(renderCommandEncoder, _currentState.UniformBuffers, true); + SetBuffers(renderCommandEncoder, _currentState.StorageBuffers, true); + SetCullMode(renderCommandEncoder); + SetFrontFace(renderCommandEncoder); } else { Logger.Error?.Print(LogClass.Gpu, "No state to restore");