From 316fea1fa9fc1842b4eeec48bc105ad5f32bd150 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Wed, 20 Mar 2024 14:35:19 -0400 Subject: [PATCH] Set scissors & viewports --- Directory.Packages.props | 2 +- src/Ryujinx.Graphics.Metal/Pipeline.cs | 14 ++++---------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 7f25b7b79..cfb884d01 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -38,7 +38,7 @@ - + diff --git a/src/Ryujinx.Graphics.Metal/Pipeline.cs b/src/Ryujinx.Graphics.Metal/Pipeline.cs index 3699b8f61..a3856a016 100644 --- a/src/Ryujinx.Graphics.Metal/Pipeline.cs +++ b/src/Ryujinx.Graphics.Metal/Pipeline.cs @@ -521,11 +521,8 @@ namespace Ryujinx.Graphics.Metal fixed (MTLScissorRect* pMtlScissorRects = mtlScissorRects) { - // TODO: Fix this function which currently wont accept pointer as intended - if (_currentEncoderType == EncoderType.Render) - { - // new MTLRenderCommandEncoder(_currentEncoder.Value).SetScissorRects(pMtlScissorRects, (ulong)regions.Length); - } + var renderCommandEncoder = GetOrCreateRenderEncoder(); + renderCommandEncoder.SetScissorRects((IntPtr)pMtlScissorRects, (ulong)regions.Length); } } @@ -670,11 +667,8 @@ namespace Ryujinx.Graphics.Metal fixed (MTLViewport* pMtlViewports = mtlViewports) { - // TODO: Fix this function which currently wont accept pointer as intended - if (_currentEncoderType == EncoderType.Render) - { - // new MTLRenderCommandEncoder(_currentEncoder.Value).SetViewports(pMtlViewports, (ulong)regions.Length); - } + var renderCommandEncoder = GetOrCreateRenderEncoder(); + renderCommandEncoder.SetViewports((IntPtr)pMtlViewports, (ulong)viewports.Length); } }