Improved debug support for Buffer<T> types
このコミットが含まれているのは:
1 親
364b6fb21d
コミット
07b3fb14b5
4ファイル変更
+60
-2
検索条件に一致するファイルはありません
@@ -1,7 +1,9 @@
|
||||
using ComputeSharp.Exceptions;
|
||||
using System.Diagnostics;
|
||||
using ComputeSharp.Exceptions;
|
||||
using ComputeSharp.Graphics;
|
||||
using ComputeSharp.Graphics.Buffers.Abstract;
|
||||
using ComputeSharp.Graphics.Buffers.Enums;
|
||||
using ComputeSharp.Graphics.Buffers.Views;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
@@ -9,6 +11,8 @@ namespace ComputeSharp
|
||||
/// A <see langword="class"/> representing a typed read write buffer stored on GPU memory
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of items stored on the buffer</typeparam>
|
||||
[DebuggerTypeProxy(typeof(BufferDebugView<>))]
|
||||
[DebuggerDisplay("{ToString(),raw}")]
|
||||
public sealed class ReadWriteBuffer<T> : StructuredBuffer<T>
|
||||
where T : unmanaged
|
||||
{
|
||||
@@ -28,5 +32,11 @@ namespace ComputeSharp
|
||||
/// <param name="i">The index of the value to get or set</param>
|
||||
/// <remarks>This API can only be used from a compute shader, and will always throw if used anywhere else</remarks>
|
||||
public ref T this[int i] => throw new InvalidExecutionContextException($"{nameof(ReadWriteBuffer<T>)}<T>[int]");
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override string ToString()
|
||||
{
|
||||
return $"ComputeSharp.ReadWriteBuffer<{typeof(T)}>[{Size}]";
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする