Add GPU name in status bar (#984)

* Add GPU name in status bar

* Fixed like Ac_K suggest

* Nit.

* Minor fix

* Minor change.

* Nit.

* Fixed for ATI vendor

* Minor fix, again...
This commit is contained in:
HorrorTroll 2020-03-25 04:54:09 +07:00 committed by GitHub
parent 1de16f7653
commit 17200214df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 50 additions and 8 deletions

View file

@ -19,6 +19,12 @@ namespace Ryujinx.Graphics.OpenGL
internal TextureCopy TextureCopy { get; }
public string GpuVendor { get; private set; }
public string GpuRenderer { get; private set; }
public string GpuVersion { get; private set; }
public Renderer()
{
_pipeline = new Pipeline();
@ -78,11 +84,11 @@ namespace Ryujinx.Graphics.OpenGL
private void PrintGpuInformation()
{
string gpuVendor = GL.GetString(StringName.Vendor);
string gpuRenderer = GL.GetString(StringName.Renderer);
string gpuVersion = GL.GetString(StringName.Version);
GpuVendor = GL.GetString(StringName.Vendor);
GpuRenderer = GL.GetString(StringName.Renderer);
GpuVersion = GL.GetString(StringName.Version);
Logger.PrintInfo(LogClass.Gpu, $"{gpuVendor} {gpuRenderer} ({gpuVersion})");
Logger.PrintInfo(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
}
public void ResetCounter(CounterType type)

View file

@ -335,10 +335,17 @@ namespace Ryujinx.Ui
_device.Statistics.RecordSystemFrameTime();
string gpuVendor = "Unknown";
if (_renderer.GpuVendor.ToLower().Contains("nvidia")) gpuVendor = "NVIDIA";
if (_renderer.GpuVendor.ToLower().Contains("amd") || _renderer.GpuVendor.ToLower().Contains("ati")) gpuVendor = "AMD";
if (_renderer.GpuVendor.ToLower().Contains("intel")) gpuVendor = "Intel";
StatusUpdatedEvent?.Invoke(this, new StatusUpdatedEventArgs(
_device.EnableDeviceVsync,
$"Host: {_device.Statistics.GetSystemFrameRate():00.00} FPS",
$"Game: {_device.Statistics.GetGameFrameRate():00.00} FPS"));
$"Game: {_device.Statistics.GetGameFrameRate():00.00} FPS",
$"GPU: {gpuVendor}"));
_device.System.SignalVsync();

View file

@ -71,6 +71,7 @@ namespace Ryujinx.Ui
[GUI] TreeView _gameTable;
[GUI] ScrolledWindow _gameTableWindow;
[GUI] TreeSelection _gameTableSelection;
[GUI] Label _gpuName;
[GUI] Label _progressLabel;
[GUI] Label _firmwareVersionLabel;
[GUI] LevelBar _progressBar;
@ -605,6 +606,7 @@ namespace Ryujinx.Ui
{
_hostStatus.Text = args.HostStatus;
_gameStatus.Text = args.GameStatus;
_gpuName.Text = args.GpuName;
if (args.VSyncEnabled)
{

View file

@ -475,7 +475,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">10</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
<property name="label" translatable="yes">VSync</property>
</object>
@ -527,11 +527,36 @@
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">5</property>
<property name="margin_right">5</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
<property name="can_focus">False</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">5</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="_gpuName">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">start</property>
<property name="margin_left">5</property>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">4</property>
<property name="position">6</property>
</packing>
</child>
</object>

View file

@ -7,12 +7,14 @@ namespace Ryujinx.Ui
public bool VSyncEnabled;
public string HostStatus;
public string GameStatus;
public string GpuName;
public StatusUpdatedEventArgs(bool vSyncEnabled, string hostStatus, string gameStatus)
public StatusUpdatedEventArgs(bool vSyncEnabled, string hostStatus, string gameStatus, string gpuName)
{
VSyncEnabled = vSyncEnabled;
HostStatus = hostStatus;
GameStatus = gameStatus;
GpuName = gpuName;
}
}
}