Skip to content

Commit

Permalink
Merge pull request #231 from 13xforever/vnext
Browse files Browse the repository at this point in the history
Improve GPU driver checks when no game was booted
  • Loading branch information
13xforever committed Feb 24, 2019
2 parents 1813033 + 3ac6834 commit 211012d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ private static async Task BuildNotesSectionAsync(DiscordEmbedBuilder builder, Lo
}
}

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)
Expand Down
16 changes: 13 additions & 3 deletions CompatBot/Utils/ResultFormatters/LogParserResultFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,20 @@ private static void CleanupValues(NameValueCollection items)

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)
Expand Down

0 comments on commit 211012d

Please sign in to comment.