Add sleep when translating shaders

This commit is contained in:
Otozinclus 2024-12-30 06:54:59 +01:00 committed by GitHub
parent 95b7d38ad7
commit d737b0a967
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -178,10 +178,13 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
int programIndex, int programIndex,
bool isCompute) bool isCompute)
{ {
Thread.Sleep(shaderTranslationDelay);
GuestShaders = guestShaders; GuestShaders = guestShaders;
SpecializationState = specState; SpecializationState = specState;
ProgramIndex = programIndex; ProgramIndex = programIndex;
IsCompute = isCompute; IsCompute = isCompute,
int = shaderTranslationDelay;
} }
} }
@ -366,7 +369,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
{ {
try try
{ {
AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute); AsyncProgramTranslation asyncTranslation = new(guestShaders, specState, programIndex, isCompute, _context.DirtyHacks[DirtyHacks.ShaderCompilationThreadSleep);
_asyncTranslationQueue.Add(asyncTranslation, _cancellationToken); _asyncTranslationQueue.Add(asyncTranslation, _cancellationToken);
} }
catch (OperationCanceledException) catch (OperationCanceledException)