From b5032b3c91e9af6a1afb87b4bd8346922084ae75 Mon Sep 17 00:00:00 2001 From: Mary Date: Mon, 27 Mar 2023 08:40:27 +0200 Subject: [PATCH] vulkan: Fix access level of extensions fields and make them readonly (#4608) --- Ryujinx.Graphics.Vulkan/VulkanInitialization.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs index 0bb8260a..c4e9a626 100644 --- a/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs +++ b/Ryujinx.Graphics.Vulkan/VulkanInitialization.cs @@ -20,7 +20,7 @@ namespace Ryujinx.Graphics.Vulkan private const string AppName = "Ryujinx.Graphics.Vulkan"; private const int QueuesCount = 2; - public static string[] DesirableExtensions { get; } = new string[] + private static readonly string[] _desirableExtensions = new string[] { ExtConditionalRendering.ExtensionName, ExtExtendedDynamicState.ExtensionName, @@ -42,7 +42,7 @@ namespace Ryujinx.Graphics.Vulkan "VK_KHR_portability_subset", // By spec, we should enable this if present. }; - public static string[] RequiredExtensions { get; } = new string[] + private static readonly string[] _requiredExtensions = new string[] { KhrSwapchain.ExtensionName }; @@ -337,14 +337,14 @@ namespace Ryujinx.Graphics.Vulkan { string extensionName = Marshal.PtrToStringAnsi((IntPtr)pExtensionProperties[i].ExtensionName); - if (RequiredExtensions.Contains(extensionName)) + if (_requiredExtensions.Contains(extensionName)) { extensionMatches++; } } } - return extensionMatches == RequiredExtensions.Length && FindSuitableQueueFamily(api, physicalDevice, surface, out _) != InvalidIndex; + return extensionMatches == _requiredExtensions.Length && FindSuitableQueueFamily(api, physicalDevice, surface, out _) != InvalidIndex; } internal static uint FindSuitableQueueFamily(Vk api, PhysicalDevice physicalDevice, SurfaceKHR surface, out uint queueCount) @@ -626,7 +626,7 @@ namespace Ryujinx.Graphics.Vulkan pExtendedFeatures = &featuresCustomBorderColor; } - var enabledExtensions = RequiredExtensions.Union(DesirableExtensions.Intersect(supportedExtensions)).ToArray(); + var enabledExtensions = _requiredExtensions.Union(_desirableExtensions.Intersect(supportedExtensions)).ToArray(); IntPtr* ppEnabledExtensions = stackalloc IntPtr[enabledExtensions.Length];