Merge pull request #231 from 13xforever/vnext

Improve GPU driver checks when no game was booted
This commit is contained in:
Ilya
2019-02-24 21:28:52 +05:00
committed by GitHub
2 changed files with 15 additions and 5 deletions

View File

@@ -119,8 +119,8 @@ namespace CompatBot.Utils.ResultFormatters
}
}
if (supportedGpu
&& items["gpu_info"] is string gpuInfo)
var gpuInfo = items["gpu_info"] ?? items["discrete_gpu_info"];
if (supportedGpu && !string.IsNullOrEmpty(gpuInfo))
{
if (IntelGpuModel.Match(gpuInfo) is Match intelMatch
&& intelMatch.Success)

View File

@@ -153,10 +153,20 @@ namespace CompatBot.Utils.ResultFormatters
if (items["vulkan_compatible_device_name"] is string vulkanDevices)
{
var deviceNames = vulkanDevices.Split(Environment.NewLine)
var devices = vulkanDevices.Split(Environment.NewLine)
.Distinct()
.Select(n => $"{n} ({GetVulkanDriverVersion(n, items["vulkan_found_device"])})");
items["gpu_available_info"] = string.Join(Environment.NewLine, deviceNames);
.Select(n => new {name = n, driverVersion = GetVulkanDriverVersion(n, items["vulkan_found_device"])})
.Reverse()
.ToList();
if (string.IsNullOrEmpty(items["gpu_info"]) && devices.Count > 0)
{
var discreteGpu = devices.FirstOrDefault(d => IsNvidia(d.name))
?? devices.FirstOrDefault(d => IsAmd(d.name))
?? devices.First();
items["discrete_gpu_info"] = $"{discreteGpu.name} ({discreteGpu.driverVersion})";
items["driver_version_info"] = discreteGpu.driverVersion;
}
items["gpu_available_info"] = string.Join(Environment.NewLine, devices.Select(d => $"{d.name} ({d.driverVersion})"));
}
if (items["af_override"] is string af)