SHA256
Fix Throttling
This commit is contained in:
1 file changed
+4
-2
@@ -11,6 +11,7 @@ using ADOFAIRenderer.Util.FFmpeg;
|
||||
using MelonLoader;
|
||||
using MelonLoader.Utils;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering;
|
||||
using Random = UnityEngine.Random;
|
||||
using ThreadPriority = System.Threading.ThreadPriority;
|
||||
|
||||
@@ -273,7 +274,8 @@ namespace ADOFAIRenderer.Core
|
||||
isThrottling = true;
|
||||
throttleCount++;
|
||||
}
|
||||
Thread.Sleep(1);
|
||||
|
||||
AsyncGPUReadback.WaitAllRequests();
|
||||
}
|
||||
isThrottling = false;
|
||||
|
||||
@@ -581,7 +583,7 @@ namespace ADOFAIRenderer.Core
|
||||
{
|
||||
foreach (var kvp in ImageQueue.Values)
|
||||
{
|
||||
if (kvp.ManagedBuffer != null && kvp.ManagedBuffer.Length > 0)
|
||||
if (kvp.ManagedBuffer is { Length: > 0 })
|
||||
{
|
||||
ArrayPool<byte>.Shared.Return(kvp.ManagedBuffer);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user