diff --git a/src/ComputeSharp.Graphics/Resources/ReadBackTexture3D{T}.cs b/src/ComputeSharp.Graphics/Resources/ReadBackTexture3D{T}.cs new file mode 100644 index 00000000..aeb4a130 --- /dev/null +++ b/src/ComputeSharp.Graphics/Resources/ReadBackTexture3D{T}.cs @@ -0,0 +1,36 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed 3D texture stored on CPU memory, that can be used to transfer back from the GPU. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class ReadBackTexture3D : TransferTexture3D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal ReadBackTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.ReadBack, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.ReadBackTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + } +} diff --git a/src/ComputeSharp.Graphics/Resources/UploadTexture3D{T}.cs b/src/ComputeSharp.Graphics/Resources/UploadTexture3D{T}.cs new file mode 100644 index 00000000..eacc0862 --- /dev/null +++ b/src/ComputeSharp.Graphics/Resources/UploadTexture3D{T}.cs @@ -0,0 +1,36 @@ +using System.Diagnostics; +using ComputeSharp.Graphics.Resources.Enums; +using ComputeSharp.Resources; +using ComputeSharp.Resources.Debug; + +namespace ComputeSharp +{ + /// + /// A representing a typed 3D texture stored on CPU memory, that can be used to transfer data to the GPU. + /// + /// The type of items stored on the texture. + [DebuggerTypeProxy(typeof(TransferTexture3DDebugView<>))] + [DebuggerDisplay("{ToString(),raw}")] + public sealed class UploadTexture3D : TransferTexture3D + where T : unmanaged + { + /// + /// Creates a new instance with the specified parameters. + /// + /// The associated with the current instance. + /// The width of the texture. + /// The height of the texture. + /// The depth of the texture. + /// The allocation mode to use for the new resource. + internal UploadTexture3D(GraphicsDevice device, int width, int height, int depth, AllocationMode allocationMode) + : base(device, width, height, depth, ResourceType.Upload, allocationMode) + { + } + + /// + public override string ToString() + { + return $"ComputeSharp.UploadTexture3D<{typeof(T)}>[{Width}, {Height}, {Depth}]"; + } + } +}