From 0c1acb51072f9626cd70b3f4bcb0cf67c83b1a8b Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Tue, 2 Jul 2024 17:52:53 +0100 Subject: [PATCH] Cleanup + Format --- src/Ryujinx.Graphics.Metal/CommandBufferEncoder.cs | 2 +- src/Ryujinx.Graphics.Metal/EncoderStateManager.cs | 4 +--- src/Ryujinx.Graphics.Metal/Pipeline.cs | 2 +- src/Ryujinx.Graphics.Metal/Texture.cs | 6 +++--- 4 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/Ryujinx.Graphics.Metal/CommandBufferEncoder.cs b/src/Ryujinx.Graphics.Metal/CommandBufferEncoder.cs index 9e7dc73ea..82584629d 100644 --- a/src/Ryujinx.Graphics.Metal/CommandBufferEncoder.cs +++ b/src/Ryujinx.Graphics.Metal/CommandBufferEncoder.cs @@ -167,4 +167,4 @@ class CommandBufferEncoder CurrentEncoderType = EncoderType.Compute; return computeCommandEncoder; } -} \ No newline at end of file +} diff --git a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs index 7b1499795..b198e5fd7 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs @@ -868,7 +868,6 @@ namespace Ryujinx.Graphics.Metal { ref PipelineState pipeline = ref _currentState.Pipeline; uint indexMask = 0; - int descriptorCount = 0; for (int i = 0; i < attribDescriptors.Length; i++) { @@ -1352,7 +1351,7 @@ namespace Ryujinx.Graphics.Metal } } - private uint SetIndexToBindingIndex(int setIndex) + private static uint SetIndexToBindingIndex(int setIndex) { return setIndex switch { @@ -1363,7 +1362,6 @@ namespace Ryujinx.Graphics.Metal }; } - private readonly void SetCullMode(MTLRenderCommandEncoder renderCommandEncoder) { renderCommandEncoder.SetCullMode(_currentState.CullMode); diff --git a/src/Ryujinx.Graphics.Metal/Pipeline.cs b/src/Ryujinx.Graphics.Metal/Pipeline.cs index 3e17dde41..32b520e0e 100644 --- a/src/Ryujinx.Graphics.Metal/Pipeline.cs +++ b/src/Ryujinx.Graphics.Metal/Pipeline.cs @@ -218,7 +218,7 @@ namespace Ryujinx.Graphics.Metal } case EncoderType.Compute: { - var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures | MTLBarrierScope.RenderTargets;; + var scope = MTLBarrierScope.Buffers | MTLBarrierScope.Textures | MTLBarrierScope.RenderTargets; Encoders.ComputeEncoder.MemoryBarrier(scope); break; } diff --git a/src/Ryujinx.Graphics.Metal/Texture.cs b/src/Ryujinx.Graphics.Metal/Texture.cs index e938a04b8..c26890d36 100644 --- a/src/Ryujinx.Graphics.Metal/Texture.cs +++ b/src/Ryujinx.Graphics.Metal/Texture.cs @@ -38,7 +38,7 @@ namespace Ryujinx.Graphics.Metal descriptor.Swizzle = GetSwizzle(info, descriptor.PixelFormat); _mtlTexture = _device.NewTexture(descriptor); - + MtlFormat = pixelFormat; descriptor.Dispose(); } @@ -113,7 +113,7 @@ namespace Ryujinx.Graphics.Metal 0, (ulong)firstLevel, new MTLOrigin { x = 0, y = 0, z = (ulong)firstLayer }, - new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1}, + new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1 }, destinationTexture._mtlTexture, 0, (ulong)firstLevel, @@ -147,7 +147,7 @@ namespace Ryujinx.Graphics.Metal 0, (ulong)srcLevel, new MTLOrigin { x = 0, y = 0, z = (ulong)srcLayer }, - new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1}, + new MTLSize { width = (ulong)Math.Min(Info.Width, destinationTexture.Info.Width), height = (ulong)Math.Min(Info.Height, destinationTexture.Info.Height), depth = 1 }, destinationTexture._mtlTexture, 0, (ulong)dstLevel,