From 2f540dc88cff3709f7e46ad6224dddf6ce9e0056 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 24 Dec 2024 01:23:01 -0600 Subject: [PATCH] infra: chore: fix/silence compile warnings --- src/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs | 1 + src/Ryujinx.Graphics.Metal/EncoderStateManager.cs | 1 + src/Ryujinx.Graphics.Metal/MetalRenderer.cs | 5 ++++- .../CodeGen/Msl/Instructions/InstGen.cs | 1 + src/Ryujinx/AppHost.cs | 2 +- 5 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs b/src/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs index 4473e8cb3..0924c60f8 100644 --- a/src/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs +++ b/src/Ryujinx.Graphics.Gpu/Shader/ShaderCache.cs @@ -838,6 +838,7 @@ namespace Ryujinx.Graphics.Gpu.Shader TargetApi.OpenGL => TargetLanguage.Glsl, TargetApi.Vulkan => GraphicsConfig.EnableSpirvCompilationOnVulkan ? TargetLanguage.Spirv : TargetLanguage.Glsl, TargetApi.Metal => TargetLanguage.Msl, + _ => throw new NotImplementedException() }; return new TranslationOptions(lang, api, flags); diff --git a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs index 0093ac148..169e0142d 100644 --- a/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs +++ b/src/Ryujinx.Graphics.Metal/EncoderStateManager.cs @@ -1767,6 +1767,7 @@ namespace Ryujinx.Graphics.Metal Constants.StorageBuffersSetIndex => Constants.StorageBuffersIndex, Constants.TexturesSetIndex => Constants.TexturesIndex, Constants.ImagesSetIndex => Constants.ImagesIndex, + _ => throw new NotImplementedException() }; } diff --git a/src/Ryujinx.Graphics.Metal/MetalRenderer.cs b/src/Ryujinx.Graphics.Metal/MetalRenderer.cs index 935a5b3b1..7afd30886 100644 --- a/src/Ryujinx.Graphics.Metal/MetalRenderer.cs +++ b/src/Ryujinx.Graphics.Metal/MetalRenderer.cs @@ -21,9 +21,12 @@ namespace Ryujinx.Graphics.Metal private Pipeline _pipeline; private Window _window; - public uint ProgramCount { get; set; } = 0; + public uint ProgramCount { get; set; } +#pragma warning disable CS0067 // The event is never used public event EventHandler ScreenCaptured; +#pragma warning restore CS0067 + public bool PreferThreading => true; public IPipeline Pipeline => _pipeline; public IWindow Window => _window; diff --git a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGen.cs b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGen.cs index 715688987..57177e402 100644 --- a/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGen.cs +++ b/src/Ryujinx.Graphics.Shader/CodeGen/Msl/Instructions/InstGen.cs @@ -125,6 +125,7 @@ namespace Ryujinx.Graphics.Shader.CodeGen.Msl.Instructions Instruction.Add => "PreciseFAdd", Instruction.Subtract => "PreciseFSub", Instruction.Multiply => "PreciseFMul", + _ => throw new NotImplementedException() }; return $"{func}({expr[0]}, {expr[1]})"; diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index abcc357a6..86b5eafa1 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -917,7 +917,7 @@ namespace Ryujinx.Ava if (ShouldInitMetal) { -#pragma warning disable CA1416 This call site is reachable on all platforms +#pragma warning disable CA1416 // This call site is reachable on all platforms // The condition does a check for Mac, on top of checking if it's an ARM Mac. This isn't a problem. renderer = new MetalRenderer((RendererHost.EmbeddedWindow as EmbeddedWindowMetal)!.CreateSurface); #pragma warning restore CA1416