SHA256
Add AMD GPU Support
This commit is contained in:
3 files changed
+64
-22
No files matched your search
+13
-4
@@ -15,10 +15,14 @@ namespace ADOFAIRenderer.Util
|
||||
public static class GPUUtil
|
||||
{
|
||||
private const string NvidiaPattern =
|
||||
@"^NVIDIA GeForce [RG]TX [0-9]+(?>(?> Ti)|(?> SUPER)|(?> [0-9]+GB))?(?> Laptop GPU)?/PCIe/SSE2$";
|
||||
@"^NVIDIA GeForce [RG]TX [0-9]+(?> SUPER| Ti(?> SUPER)?)?(?> [0-9]+GB)?(?> Laptop GPU)?/PCIe/SSE2$";
|
||||
|
||||
private const string IntelPattern =
|
||||
@"^Intel(?>\(R\))* (?>U*HD Graphics [0-9]+$|Arc\(TM\) [A-C][0-9]+ Graphics)";
|
||||
@"^Intel(?>\(R\))? (?>U?HD Graphics [0-9]+$|Arc\(TM\) [A-C][0-9]+ Graphics)$";
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
private const string AMDPattern =
|
||||
@"^AMD Radeon RX [0-9]+(?> XT)?$";
|
||||
|
||||
private static readonly Dictionary<Codec, List<(GPUVendor, string)>> CodecMap = new()
|
||||
{
|
||||
@@ -28,8 +32,8 @@ namespace ADOFAIRenderer.Util
|
||||
[Codec.AV1] = new List<(GPUVendor, string)> { (GPUVendor.NVIDIA, "av1_nvenc"), (GPUVendor.Intel, "av1_qsv"), (GPUVendor.AMD, "av1_amf"), (GPUVendor.Unknown, "libsvtav1"), (GPUVendor.Unknown, "libaom-av1") },
|
||||
[Codec.VVC] = new List<(GPUVendor, string)> { (GPUVendor.Unknown, "libvvenc") }
|
||||
};
|
||||
|
||||
public static GPUVendor GetActiveGPUVendor()
|
||||
|
||||
private static GPUVendor GetActiveGPUVendor()
|
||||
{
|
||||
var gpuName = UnityEngine.SystemInfo.graphicsDeviceName;
|
||||
Melon<RenderMod>.Logger.Msg($"Active GPU: {gpuName}");
|
||||
@@ -44,6 +48,11 @@ namespace ADOFAIRenderer.Util
|
||||
return GPUVendor.Intel;
|
||||
}
|
||||
|
||||
foreach (Match unused in Regex.Matches(gpuName, AMDPattern))
|
||||
{
|
||||
return GPUVendor.AMD;
|
||||
}
|
||||
|
||||
return GPUVendor.Unknown;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user