Skip to content

Commit

Permalink
WinGui: Cache GPU infomation as the probe can be quite slow on some s…
Browse files Browse the repository at this point in the history
…ystems.
  • Loading branch information
sr55 committed Jul 11, 2024
1 parent 22684ae commit 8a1ab72
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions win/CS/HandBrakeWPF/Utilities/SystemInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ namespace HandBrakeWPF.Utilities
/// </summary>
public class SystemInfo
{
private static List<GpuInfo> gpuInfoCache;

public static ulong TotalPhysicalMemory
{
get
Expand Down Expand Up @@ -73,6 +75,11 @@ public static List<GpuInfo> GetGPUInfo
{
get
{
if (gpuInfoCache != null)
{
return gpuInfoCache;
}

List<GpuInfo> gpuInfo = new List<GpuInfo>();

if (IsArmDevice)
Expand Down Expand Up @@ -110,6 +117,8 @@ public static List<GpuInfo> GetGPUInfo
// Do Nothing. We couldn't get GPU Information.
}

gpuInfoCache = gpuInfo;

return gpuInfo;
}
}
Expand Down

0 comments on commit 8a1ab72

Please sign in to comment.