Added Buffer2<T>.GetData() overload

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-12 12:04:16 +02:00
1 親 bde2f35fe6
コミット 79c4df4a09
1ファイル変更
+13
+13
ファイルの表示
@@ -119,6 +119,19 @@ namespace ComputeSharp.Graphics.Buffers
set => throw new InvalidOperationException("The indexer APIs can only be used from a compute shader");
}
/// <summary>
/// Reads the contents of the current <see cref="Buffer2{T}"/> instance and returns an array
/// </summary>
/// <returns>A <typeparamref name="T"/> array with the contents of the current buffer</returns>
[Pure]
public T[] GetData()
{
T[] data = new T[Size];
GetData(data);
return data;
}
/// <summary>
/// Reads the contents of the current <see cref="Buffer2{T}"/> instance and writes them into a target <see cref="Span{T}"/>
/// </summary>