diff --git a/src/Ryujinx.Graphics.Metal/EncoderState.cs b/src/Ryujinx.Graphics.Metal/EncoderState.cs index 2f732681b..95f0f21b5 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderState.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderState.cs @@ -22,13 +22,12 @@ namespace Ryujinx.Graphics.Metal StencilRef = 1 << 7, Viewports = 1 << 8, Scissors = 1 << 9, - VertexBuffers = 1 << 10, - Buffers = 1 << 11, - VertexTextures = 1 << 12, - FragmentTextures = 1 << 13, - ComputeTextures = 1 << 14, + Buffers = 1 << 10, + VertexTextures = 1 << 11, + FragmentTextures = 1 << 12, + ComputeTextures = 1 << 13, - RenderAll = RenderPipeline | DepthStencil | DepthClamp | DepthBias | CullMode | FrontFace | StencilRef | Viewports | Scissors | VertexBuffers | Buffers | VertexTextures | FragmentTextures, + RenderAll = RenderPipeline | DepthStencil | DepthClamp | DepthBias | CullMode | FrontFace | StencilRef | Viewports | Scissors | Buffers | VertexTextures | FragmentTextures, ComputeAll = ComputePipeline | Buffers | ComputeTextures, All = RenderAll | ComputeAll, } diff --git a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs index 7699ed8f6..b76170068 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs @@ -179,6 +179,7 @@ namespace Ryujinx.Graphics.Metal { if (_currentState.Dirty.HasFlag(DirtyFlags.RenderPipeline)) { + SetVertexBuffers(renderCommandEncoder, _currentState.VertexBuffers); SetRenderPipelineState(renderCommandEncoder); } @@ -222,11 +223,6 @@ namespace Ryujinx.Graphics.Metal SetScissors(renderCommandEncoder); } - if (_currentState.Dirty.HasFlag(DirtyFlags.VertexBuffers)) - { - SetVertexBuffers(renderCommandEncoder, _currentState.VertexBuffers); - } - if (_currentState.Dirty.HasFlag(DirtyFlags.Buffers)) { SetRenderBuffers(renderCommandEncoder, _currentState.UniformBuffers, _currentState.StorageBuffers); @@ -683,15 +679,8 @@ namespace Ryujinx.Graphics.Metal // Update the buffers on the pipeline UpdatePipelineVertexState(_currentState.VertexBuffers, _currentState.VertexAttribs); - // Inline update - if (_pipeline.Encoders.TryGetRenderEncoder(out MTLRenderCommandEncoder renderCommandEncoder)) - { - SetVertexBuffers(renderCommandEncoder, _currentState.VertexBuffers); - return; - } - // Mark dirty - _currentState.Dirty |= DirtyFlags.RenderPipeline | DirtyFlags.VertexBuffers; + _currentState.Dirty |= DirtyFlags.RenderPipeline; } public void UpdateUniformBuffers(ReadOnlySpan buffers)