using System.Diagnostics; using ComputeSharp.Graphics.Resources.Enums; using ComputeSharp.Resources; using ComputeSharp.Resources.Debug; namespace ComputeSharp { /// /// A representing a typed 2D 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(TransferTexture2DDebugView<>))] [DebuggerDisplay("{ToString(),raw}")] public sealed class ReadBackTexture2D : TransferTexture2D 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 allocation mode to use for the new resource. internal ReadBackTexture2D(GraphicsDevice device, int width, int height, AllocationMode allocationMode) : base(device, width, height, ResourceType.ReadBack, allocationMode) { } /// public override string ToString() { return $"ComputeSharp.ReadBackTexture2D<{typeof(T)}>[{Width}, {Height}]"; } } }