SHA256
forked from ADOFAIEditorForum/ADOFAIRenderer
Fix Throttling
This commit is contained in:
1 file changed
+4
-2
@@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user