Apply Optimized GPU Readback

This commit is contained in:
copecone committed 2026-05-27 13:14:31 +09:00
1 parent 3797cb7077
commit 9454226306
8 files changed
+208 -18

No files matched your search

+9 -3
View File
@@ -3,6 +3,7 @@ using System.Reflection;
using ADOFAIRenderer;
using ADOFAIRenderer.Component;
using ADOFAIRenderer.Util;
using ADOFAIRenderer.Util.FFmpeg;
using MelonLoader;
using UnityEngine;
using UnityEngine.EventSystems;
@@ -38,6 +39,8 @@ namespace ADOFAIRenderer
public static double DspTimeBase;
public static int FrameCountBase;
public static FrameReader? FrameReader;
public static bool RenderCheck = true;
public static int SkipCount;
@@ -98,7 +101,7 @@ namespace ADOFAIRenderer
var targetFps = RenderManager.Configuration.TargetFPS;
var videoFps = RenderManager.Configuration.VideoFPS;
var quotient = targetFps / videoFps;
var num = Math.Abs(quotient - Math.Round(quotient)) < 1e-9 ? (int)Math.Round(quotient) : 1;
var num = Math.Abs(quotient - Math.Round(quotient)) < 1e-9 ? (long)Math.Round(quotient) : 1L;
if (FrameCountForVideo % num == 0)
{
@@ -126,7 +129,7 @@ namespace ADOFAIRenderer
}
}
public static int FrameCountForVideo;
public static long FrameCountForVideo;
public static int ReadbackFailureCount;
public static int ThrottleCount;
public static bool IsThrottling;
@@ -171,7 +174,10 @@ namespace ADOFAIRenderer
{
return;
}
FrameReader?.RequestFrameCapture(texture, currentFrame);
/*
AsyncGPUReadback.Request(texture, 0, delegate(AsyncGPUReadbackRequest req)
{
if (!IsCapturing) return;
@@ -202,7 +208,7 @@ namespace ADOFAIRenderer
{
RenderManager.ImageQueue[currentFrame] = rawBytes;
}
});
});*/
}
public static void StartRender()