Add GPUResourceUsage.Staging for both CPU read/write access

This commit is contained in:
Wojtek Figat
2025-01-30 20:39:04 +01:00
parent f11306af24
commit 44fae3838e
12 changed files with 89 additions and 21 deletions

View File

@@ -300,7 +300,7 @@ namespace FlaxEngine
}
/// <summary>
/// Gets the staging description for this instance.
/// Gets the staging upload (CPU write) description for this instance.
/// </summary>
/// <returns>A staging texture description</returns>
public GPUTextureDescription ToStagingUpload()
@@ -312,7 +312,7 @@ namespace FlaxEngine
}
/// <summary>
/// Gets the staging description for this instance.
/// Gets the staging readback (CPU read) description for this instance.
/// </summary>
/// <returns>A staging texture description</returns>
public GPUTextureDescription ToStagingReadback()
@@ -323,6 +323,18 @@ namespace FlaxEngine
return desc;
}
/// <summary>
/// Gets the staging (CPU read/write) description for this instance.
/// </summary>
/// <returns>A staging texture description</returns>
public GPUTextureDescription ToStaging()
{
var desc = this;
desc.Flags = GPUTextureFlags.None;
desc.Usage = GPUResourceUsage.Staging;
return desc;
}
/// <inheritdoc />
public override string ToString()
{