From 61303032f12ca7966339130386d1f5427683d3b6 Mon Sep 17 00:00:00 2001 From: Evan Husted Date: Tue, 24 Dec 2024 00:31:49 -0600 Subject: [PATCH] Silence compile warnings --- src/Ryujinx/AppHost.cs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Ryujinx/AppHost.cs b/src/Ryujinx/AppHost.cs index 768e70f3c..abcc357a6 100644 --- a/src/Ryujinx/AppHost.cs +++ b/src/Ryujinx/AppHost.cs @@ -915,17 +915,20 @@ namespace Ryujinx.Ava IRenderer renderer; GraphicsBackend backend = ConfigurationState.Instance.Graphics.GraphicsBackend; - if (backend == GraphicsBackend.Vulkan || (backend == GraphicsBackend.Auto && !ShouldInitMetal)) + if (ShouldInitMetal) + { +#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 + } + else if (backend == GraphicsBackend.Vulkan || (backend == GraphicsBackend.Auto && !ShouldInitMetal)) { renderer = VulkanRenderer.Create( ConfigurationState.Instance.Graphics.PreferredGpu, (RendererHost.EmbeddedWindow as EmbeddedWindowVulkan)!.CreateSurface, VulkanHelper.GetRequiredInstanceExtensions); } - else if (ShouldInitMetal) - { - renderer = new MetalRenderer((RendererHost.EmbeddedWindow as EmbeddedWindowMetal).CreateSurface); - } else { renderer = new OpenGLRenderer();