From 859675dbab86e6eeda662ef9bdb0c688cce4cec3 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Tue, 5 Mar 2024 17:38:06 -0800 Subject: [PATCH] modify readback API --- src/Refresh.cs | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/src/Refresh.cs b/src/Refresh.cs index dd10e80..ce1f484 100644 --- a/src/Refresh.cs +++ b/src/Refresh.cs @@ -969,7 +969,7 @@ namespace RefreshCS IntPtr device, IntPtr commandBuffer, IntPtr transferBuffer, - in TextureRegion textureSlice, + in TextureRegion textureRegion, in BufferImageCopy copyParams, WriteOptions writeOption ); @@ -984,26 +984,6 @@ namespace RefreshCS WriteOptions writeOption ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void Refresh_DownloadFromTexture( - IntPtr device, - IntPtr commandBuffer, - in TextureRegion textureSlice, - IntPtr transferBuffer, - in BufferImageCopy copyParams, - TransferOptions transferOption - ); - - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] - public static extern void Refresh_DownloadFromBuffer( - IntPtr device, - IntPtr commandBuffer, - IntPtr gpuBuffer, - IntPtr transferBuffer, - in BufferCopy copyParams, - TransferOptions transferOption - ); - [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern void Refresh_CopyTextureToTexture( IntPtr device, @@ -1115,6 +1095,24 @@ namespace RefreshCS IntPtr fence ); + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void Refresh_DownloadFromTexture( + IntPtr device, + in TextureRegion textureRegion, + IntPtr transferBuffer, + in BufferImageCopy copyParams, + TransferOptions transferOption + ); + + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] + public static extern void Refresh_DownloadFromBuffer( + IntPtr device, + IntPtr gpuBuffer, + IntPtr transferBuffer, + in BufferCopy copyParams, + TransferOptions transferOption + ); + [DllImport(nativeLibName, CallingConvention = CallingConvention.Cdecl)] public static extern IntPtr Refresh_Image_Load( IntPtr bufferPtr,