Add GPUTexture::DownloadData to C#

#2973 #1446
This commit is contained in:
Wojtek Figat
2025-04-07 23:32:37 +02:00
parent 6fc5e1f423
commit 15da2d59e5
7 changed files with 109 additions and 42 deletions

View File

@@ -5,6 +5,20 @@ using System.Runtime.InteropServices;
namespace FlaxEngine
{
partial class GPUTexture
{
/// <summary>
/// Downloads the texture data to be accessible from CPU. For frequent access, use staging textures, otherwise current thread will be stalled to wait for the GPU frame to copy data into staging buffer.
/// </summary>
/// <returns>Downloaded texture data container, or nul if failed.</returns>
[Unmanaged]
public TextureData DownloadData()
{
var result = new TextureData();
return DownloadData(result) ? null : result;
}
}
partial class TextureBase
{
/// <summary>