mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-29 02:16:24 +02:00
misc: chore: Move all GeneratedRegex methods into one static class with static instance accessors.
This commit is contained in:
parent
9f94aa1c79
commit
38ef65aae0
9 changed files with 139 additions and 76 deletions
|
@ -16,14 +16,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
Unknown,
|
||||
}
|
||||
|
||||
static partial class VendorUtils
|
||||
static class VendorUtils
|
||||
{
|
||||
[GeneratedRegex("Radeon (((HD|R(5|7|9|X)) )?((M?[2-6]\\d{2}(\\D|$))|([7-8]\\d{3}(\\D|$))|Fury|Nano))|(Pro Duo)")]
|
||||
public static partial Regex AmdGcnRegex();
|
||||
|
||||
[GeneratedRegex("NVIDIA GeForce (R|G)?TX? (\\d{3}\\d?)M?")]
|
||||
public static partial Regex NvidiaConsumerClassRegex();
|
||||
|
||||
public static Vendor FromId(uint id)
|
||||
{
|
||||
return id switch
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
using Gommon;
|
||||
using Ryujinx.Common.Configuration;
|
||||
using Ryujinx.Common.Helper;
|
||||
using Ryujinx.Common.Logging;
|
||||
using Ryujinx.Graphics.GAL;
|
||||
using Ryujinx.Graphics.Shader;
|
||||
|
@ -375,11 +376,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
GpuVersion = $"Vulkan v{ParseStandardVulkanVersion(properties.ApiVersion)}, Driver v{ParseDriverVersion(ref properties)}";
|
||||
|
||||
IsAmdGcn = !IsMoltenVk && Vendor == Vendor.Amd && VendorUtils.AmdGcnRegex().IsMatch(GpuRenderer);
|
||||
IsAmdGcn = !IsMoltenVk && Vendor == Vendor.Amd && Patterns.AmdGcn.IsMatch(GpuRenderer);
|
||||
|
||||
if (Vendor == Vendor.Nvidia)
|
||||
{
|
||||
Match match = VendorUtils.NvidiaConsumerClassRegex().Match(GpuRenderer);
|
||||
Match match = Patterns.NvidiaConsumerClass.Match(GpuRenderer);
|
||||
|
||||
if (match != null && int.TryParse(match.Groups[2].Value, out int gpuNumber))
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue