Fix inconsistencies in progress reporting (#2129)

Signal and setup events correctly
Eliminate possible races
Use a single event
Mark volatiles and reduce scope of waithandles
Common handler
100ms -> 50ms
This commit is contained in:
mageven 2021-03-23 00:10:07 +05:30 committed by GitHub
parent 0b022cad1e
commit 69f8722e79
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 128 additions and 87 deletions

View file

@ -80,25 +80,14 @@ namespace Ryujinx.Graphics.Gpu
internal Capabilities Capabilities => _caps.Value;
/// <summary>
/// Signaled when shader cache begins and ends loading.
/// Signals true when loading has started, false when ended.
/// Event for signalling shader cache loading progress.
/// </summary>
public event Action<bool> ShaderCacheStateChanged
public event Action<Shader.ShaderCacheState, int, int> ShaderCacheStateChanged
{
add => Methods.ShaderCache.ShaderCacheStateChanged += value;
remove => Methods.ShaderCache.ShaderCacheStateChanged -= value;
}
/// <summary>
/// Signaled while shader cache is loading to indicate current progress.
/// Provides current and total number of shaders loaded.
/// </summary>
public event Action<int, int> ShaderCacheProgressChanged
{
add => Methods.ShaderCache.ShaderCacheProgressChanged += value;
remove => Methods.ShaderCache.ShaderCacheProgressChanged -= value;
}
/// <summary>
/// Creates a new instance of the GPU emulation context.
/// </summary>