2 unmerged PRs from original Ryujinx:

Implement shader compile counter (currently not translated, will change, need to pull changes.)
Remove event logic in favor of a single init function.
Thanks @MutantAura
This commit is contained in:
Evan Husted 2024-10-24 14:14:12 -05:00
parent 7618ef134d
commit a01a06cd3f
10 changed files with 101 additions and 36 deletions

View file

@ -8,6 +8,7 @@ using Avalonia.Threading;
using DynamicData;
using DynamicData.Binding;
using FluentAvalonia.UI.Controls;
using Gommon;
using LibHac.Common;
using Ryujinx.Ava.Common;
using Ryujinx.Ava.Common.Locale;
@ -64,7 +65,9 @@ namespace Ryujinx.Ava.UI.ViewModels
private string _gameStatusText;
private string _volumeStatusText;
private string _gpuStatusText;
private string _shaderCountText;
private bool _isAmiiboRequested;
private bool _showRightmostSeparator;
private bool _isGameRunning;
private bool _isFullScreen;
private int _progressMaximum;
@ -256,6 +259,17 @@ namespace Ryujinx.Ava.UI.ViewModels
public bool ShowFirmwareStatus => !ShowLoadProgress;
public bool ShowRightmostSeparator
{
get => _showRightmostSeparator;
set
{
_showRightmostSeparator = value;
OnPropertyChanged();
}
}
public bool IsGameRunning
{
get => _isGameRunning;
@ -506,6 +520,16 @@ namespace Ryujinx.Ava.UI.ViewModels
OnPropertyChanged();
}
}
public string ShaderCountText
{
get => _shaderCountText;
set
{
_shaderCountText = value;
OnPropertyChanged();
}
}
public string BackendText
{
@ -1187,8 +1211,7 @@ namespace Ryujinx.Ava.UI.ViewModels
private void InitializeGame()
{
RendererHostControl.WindowCreated += RendererHost_Created;
AppHost.StatusInitEvent += Init_StatusBar;
AppHost.StatusUpdatedEvent += Update_StatusBar;
AppHost.AppExit += AppHost_AppExit;
@ -1215,18 +1238,6 @@ namespace Ryujinx.Ava.UI.ViewModels
}
}
private void Init_StatusBar(object sender, StatusInitEventArgs args)
{
if (ShowMenuAndStatusBar && !ShowLoadProgress)
{
Dispatcher.UIThread.InvokeAsync(() =>
{
GpuNameText = args.GpuName;
BackendText = args.GpuBackend;
});
}
}
private void Update_StatusBar(object sender, StatusUpdatedEventArgs args)
{
if (ShowMenuAndStatusBar && !ShowLoadProgress)
@ -1249,6 +1260,8 @@ namespace Ryujinx.Ava.UI.ViewModels
GameStatusText = args.GameStatus;
VolumeStatusText = args.VolumeStatus;
FifoStatusText = args.FifoStatus;
ShaderCountText = args.ShaderCount > 0 ? $"Compiling shaders: {args.ShaderCount}" : string.Empty;
ShowRightmostSeparator = !ShaderCountText.IsNullOrEmpty();
ShowStatusSeparator = true;
});