From f2490347af8d11c6617f1633aea73f43deaafccd Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Sun, 19 May 2024 11:07:55 -0400 Subject: [PATCH] Use return value of BeginRenderPass --- src/Ryujinx.Graphics.Metal/Pipeline.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Ryujinx.Graphics.Metal/Pipeline.cs b/src/Ryujinx.Graphics.Metal/Pipeline.cs index f1dcd19c0..91afb33bf 100644 --- a/src/Ryujinx.Graphics.Metal/Pipeline.cs +++ b/src/Ryujinx.Graphics.Metal/Pipeline.cs @@ -48,12 +48,16 @@ namespace Ryujinx.Graphics.Metal public MTLRenderCommandEncoder GetOrCreateRenderEncoder() { + MTLRenderCommandEncoder renderCommandEncoder; + if (_currentEncoder == null || _currentEncoderType != EncoderType.Render) { - BeginRenderPass(); + renderCommandEncoder = BeginRenderPass(); + } + else + { + renderCommandEncoder = new MTLRenderCommandEncoder(_currentEncoder.Value); } - - var renderCommandEncoder = new MTLRenderCommandEncoder(_currentEncoder.Value); _encoderStateManager.RebindState(renderCommandEncoder);