From 42c661156360dd7957e29283af7bdc7bb2902e53 Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 26 Jul 2024 13:58:25 +0100 Subject: [PATCH] Some debug improvements --- src/Ryujinx.Graphics.Metal/CommandBufferPool.cs | 7 ++++++- src/Ryujinx.Graphics.Metal/EnumConversion.cs | 1 - src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs | 3 +++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Graphics.Metal/CommandBufferPool.cs b/src/Ryujinx.Graphics.Metal/CommandBufferPool.cs index 050f93efc..5e7576b37 100644 --- a/src/Ryujinx.Graphics.Metal/CommandBufferPool.cs +++ b/src/Ryujinx.Graphics.Metal/CommandBufferPool.cs @@ -35,7 +35,12 @@ namespace Ryujinx.Graphics.Metal public void Use(MTLCommandQueue queue, IEncoderFactory stateManager) { - CommandBuffer = queue.CommandBuffer(); + MTLCommandBufferDescriptor descriptor = new(); +#if DEBUG + descriptor.ErrorOptions = MTLCommandBufferErrorOption.EncoderExecutionStatus; +#endif + + CommandBuffer = queue.CommandBuffer(descriptor); Fence = new FenceHolder(CommandBuffer); Encoders.Initialize(CommandBuffer, stateManager); diff --git a/src/Ryujinx.Graphics.Metal/EnumConversion.cs b/src/Ryujinx.Graphics.Metal/EnumConversion.cs index 18662e21a..091de7ef8 100644 --- a/src/Ryujinx.Graphics.Metal/EnumConversion.cs +++ b/src/Ryujinx.Graphics.Metal/EnumConversion.cs @@ -137,7 +137,6 @@ namespace Ryujinx.Graphics.Metal }; } - // TODO: Metal does not have native support for Triangle Fans but it is possible to emulate with TriangleStrip and moving around the indices public static MTLPrimitiveType Convert(this PrimitiveTopology topology) { return topology switch diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs index 3c9859a2f..346beb02e 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Declarations.cs @@ -59,6 +59,9 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl public static void Declare(CodeGenContext context, StructuredProgramInfo info) { + // TODO: Re-enable this warning + context.AppendLine("#pragma clang diagnostic ignored \"-Wunused-variable\""); + context.AppendLine(); context.AppendLine("#include "); context.AppendLine("#include "); context.AppendLine();