Fix Throttling

This commit is contained in:
copecone committed 2026-06-14 16:06:10 +09:00
1 parent 826b2c0e7e
commit f0699ccbb7
1 file changed
+4 -2
+4 -2
View File
@@ -11,6 +11,7 @@ using ADOFAIRenderer.Util.FFmpeg;
using MelonLoader; using MelonLoader;
using MelonLoader.Utils; using MelonLoader.Utils;
using UnityEngine; using UnityEngine;
using UnityEngine.Rendering;
using Random = UnityEngine.Random; using Random = UnityEngine.Random;
using ThreadPriority = System.Threading.ThreadPriority; using ThreadPriority = System.Threading.ThreadPriority;
@@ -273,7 +274,8 @@ namespace ADOFAIRenderer.Core
isThrottling = true; isThrottling = true;
throttleCount++; throttleCount++;
} }
Thread.Sleep(1);
AsyncGPUReadback.WaitAllRequests();
} }
isThrottling = false; isThrottling = false;
@@ -581,7 +583,7 @@ namespace ADOFAIRenderer.Core
{ {
foreach (var kvp in ImageQueue.Values) 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); ArrayPool<byte>.Shared.Return(kvp.ManagedBuffer);
} }