Added upload/readback texture 3D types

このコミットが含まれているのは:
Sergio Pedri committed 2021-02-04 13:54:23 +01:00
1 親 6badb589f2
コミット ce240ebce5
2ファイル変更
+72

検索条件に一致するファイルはありません

+36
ファイルの表示
@@ -0,0 +1,36 @@
using System.Diagnostics;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
namespace ComputeSharp
{
/// <summary>
/// A <see langword="class"/> representing a typed 3D texture stored on CPU memory, that can be used to transfer back from the GPU.
/// </summary>
/// <typeparam name="T">The type of items stored on the texture.</typeparam>
[DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed class ReadBackTexture3D<T> : TransferTexture3D<T>
where T : unmanaged
{
/// <summary>
/// Creates a new <see cref="ReadBackTexture3D{T}"/> instance with the specified parameters.
/// </summary>
/// <param name="device">The <see cref="GraphicsDevice"/> associated with the current instance.</param>
/// <param name="width">The width of the texture.</param>
/// <param name="height">The height of the texture.</param>
/// <param name="depth">The depth of the texture.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
internal ReadBackTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode)
: base(device, width, height, depth, ResourceType.ReadBack, allocationMode)
{
}
/// <inheritdoc/>
public override string ToString()
{
return $"ComputeSharp.ReadBackTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]";
}
}
}
+36
ファイルの表示
@@ -0,0 +1,36 @@
using System.Diagnostics;
using ComputeSharp.Graphics.Resources.Enums;
using ComputeSharp.Resources;
using ComputeSharp.Resources.Debug;
namespace ComputeSharp
{
/// <summary>
/// A <see langword="class"/> representing a typed 3D texture stored on CPU memory, that can be used to transfer data to the GPU.
/// </summary>
/// <typeparam name="T">The type of items stored on the texture.</typeparam>
[DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))]
[DebuggerDisplay("{ToString(),raw}")]
public sealed class UploadTexture3D<T> : TransferTexture3D<T>
where T : unmanaged
{
/// <summary>
/// Creates a new <see cref="UploadTexture3D{T}"/> instance with the specified parameters.
/// </summary>
/// <param name="device">The <see cref="GraphicsDevice"/> associated with the current instance.</param>
/// <param name="width">The width of the texture.</param>
/// <param name="height">The height of the texture.</param>
/// <param name="depth">The depth of the texture.</param>
/// <param name="allocationMode">The allocation mode to use for the new resource.</param>
internal UploadTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode)
: base(device, width, height, depth, ResourceType.Upload, allocationMode)
{
}
/// <inheritdoc/>
public override string ToString()
{
return $"ComputeSharp.UploadTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]";
}
}
}