mirror of
https://github.com/Ryujinx/Ryujinx.git
synced 2025-06-28 23:20:46 -07:00
Use source generated regular expressions (#4005)
This commit is contained in:
@ -11,9 +11,10 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
Unknown
|
||||
}
|
||||
|
||||
static class VendorUtils
|
||||
static partial class VendorUtils
|
||||
{
|
||||
public static Regex AmdGcnRegex = new Regex(@"Radeon (((HD|R(5|7|9|X)) )?((M?[2-6]\d{2}(\D|$))|([7-8]\d{3}(\D|$))|Fury|Nano))|(Pro Duo)");
|
||||
[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();
|
||||
|
||||
public static Vendor FromId(uint id)
|
||||
{
|
||||
|
@ -471,7 +471,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
GpuRenderer = Marshal.PtrToStringAnsi((IntPtr)properties.DeviceName);
|
||||
GpuVersion = $"Vulkan v{ParseStandardVulkanVersion(properties.ApiVersion)}, Driver v{ParseDriverVersion(ref properties)}";
|
||||
|
||||
IsAmdGcn = Vendor == Vendor.Amd && VendorUtils.AmdGcnRegex.IsMatch(GpuRenderer);
|
||||
IsAmdGcn = Vendor == Vendor.Amd && VendorUtils.AmdGcnRegex().IsMatch(GpuRenderer);
|
||||
|
||||
Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
|
||||
}
|
||||
|
Reference in New Issue
Block a user