Added BufferDebugView3D<T> type, minor bug fixes
このコミットが含まれているのは:
1 親
9806d02279
コミット
d557d7264e
4ファイル変更
+41
-2
検索条件に一致するファイルはありません
@@ -20,7 +20,7 @@ namespace ComputeSharp.Graphics.Buffers.Views
|
||||
{
|
||||
var items = new T[texture.Height, texture.Width];
|
||||
|
||||
texture.GetData(ref items[0, 0], items.Length, 0, 0, texture.Height, texture.Width);
|
||||
texture.GetData(ref items[0, 0], items.Length, 0, 0, texture.Width, texture.Height);
|
||||
|
||||
Items = items;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Graphics.Buffers.Abstract;
|
||||
|
||||
namespace ComputeSharp.Graphics.Buffers.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// A debug proxy used to display items in a <see cref="Texture3D{T}"/> instance.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of items to display.</typeparam>
|
||||
internal sealed class BufferDebugView3D<T>
|
||||
where T : unmanaged
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="BufferDebugView3D{T}"/> class with the specified parameters.
|
||||
/// </summary>
|
||||
/// <param name="texture">The input <see cref="Texture3D{T}"/> instance with the items to display.</param>
|
||||
public BufferDebugView3D(Texture3D<T>? texture)
|
||||
{
|
||||
if (texture is not null)
|
||||
{
|
||||
var items = new T[texture.Depth, texture.Height, texture.Width];
|
||||
|
||||
texture.GetData(ref items[0, 0, 0], items.Length, 0, 0, 0, texture.Width, texture.Height, texture.Depth);
|
||||
|
||||
Items = items;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the items to display for the current instance.
|
||||
/// </summary>
|
||||
[DebuggerBrowsable(DebuggerBrowsableState.Collapsed)]
|
||||
public T[,,]? Items { get; }
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする