This commit is contained in:
Evan Husted 2024-12-30 01:00:42 -06:00 committed by GitHub
parent afd0b6ad9a
commit dfb9c7e691
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -177,11 +177,8 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
GuestCodeAndCbData?[] guestShaders, GuestCodeAndCbData?[] guestShaders,
ShaderSpecializationState specState, ShaderSpecializationState specState,
int programIndex, int programIndex,
bool isCompute, bool isCompute)
int shaderTranslationDelay)
{ {
Thread.Sleep(shaderTranslationDelay);
GuestShaders = guestShaders; GuestShaders = guestShaders;
SpecializationState = specState; SpecializationState = specState;
ProgramIndex = programIndex; ProgramIndex = programIndex;
@ -370,7 +367,10 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
{ {
try try
{ {
AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute, _context.DirtyHacks[DirtyHacks.ShaderCompilationThreadSleep]); if (_context.DirtyHacks.IsEnabled(DirtyHacks.ShaderCompilationThreadSleep))
Thread.Sleep(_context.DirtyHacks[DirtyHacks.ShaderCompilationThreadSleep]);
AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute);
_asyncTranslationQueue.Add(asyncTranslation, _cancellationToken); _asyncTranslationQueue.Add(asyncTranslation, _cancellationToken);
} }
catch (OperationCanceledException) catch (OperationCanceledException)