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
@@ -52,15 +52,21 @@ namespace ADOFAIRenderer.Util.FFmpeg
_ffmpegProcess.WaitForExit();
}
public static byte[] RentRawBytes<T>(NativeArray<T> arr) where T : struct
public static byte[] RentRawBytes(int size)
{
var array = ArrayPool<byte>.Shared.Rent(size);
return array;
}
/*public static byte[] RentRawBytes<T>(NativeArray<T> arr) where T : struct
{
var val = new NativeSlice<T>(arr).SliceConvert<byte>();
var array = ArrayPool<byte>.Shared.Rent(val.Length);
val.CopyTo(array);
return array;
}
}*/
public static byte[] ToRawBytes<T>(NativeArray<T> arr) where T : struct
protected static byte[] ToRawBytes<T>(NativeArray<T> arr) where T : struct
{
var val = new NativeSlice<T>(arr).SliceConvert<byte>();
var array = new byte[val.Length];
-1
View File
@@ -1,7 +1,6 @@
using System.Diagnostics.CodeAnalysis;
using System.IO;
using Unity.Collections;
using UnityEngine;
namespace ADOFAIRenderer.Util.FFmpeg
{