Renamed some public APIs
このコミットが含まれているのは:
1 親
eef3214611
コミット
a93bcc807c
3ファイル変更
+7
-7
検索条件に一致するファイルはありません
@@ -83,9 +83,9 @@ namespace ComputeSharp
|
||||
/// <returns>A constant <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input array</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static ReadOnlyBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, T[] array) where T : unmanaged
|
||||
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, T[] array) where T : unmanaged
|
||||
{
|
||||
return device.AllocateConstantBuffer(array.AsSpan());
|
||||
return device.AllocateReadOnlyBuffer(array.AsSpan());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -97,12 +97,12 @@ namespace ComputeSharp
|
||||
/// <returns>A constant <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input 2D array</returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static unsafe ReadOnlyBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, T[,] array) where T : unmanaged
|
||||
public static unsafe ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, T[,] array) where T : unmanaged
|
||||
{
|
||||
fixed (T* p = array)
|
||||
{
|
||||
Span<T> span = new Span<T>(p, array.Length);
|
||||
return device.AllocateConstantBuffer(span);
|
||||
return device.AllocateReadOnlyBuffer(span);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace ComputeSharp
|
||||
/// <returns>A constant <see cref="ReadOnlyBuffer{T}"/> instance with the contents of the input <see cref="Span{T}"/></returns>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static ReadOnlyBuffer<T> AllocateConstantBuffer<T>(this GraphicsDevice device, Span<T> span) where T : unmanaged
|
||||
public static ReadOnlyBuffer<T> AllocateReadOnlyBuffer<T>(this GraphicsDevice device, Span<T> span) where T : unmanaged
|
||||
{
|
||||
ReadOnlyBuffer<T> buffer = new ReadOnlyBuffer<T>(device, span.Length);
|
||||
buffer.SetData(span);
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace ComputeSharp.NetCore.Tests
|
||||
float[] array = new float[4096];
|
||||
array.AsSpan().FillRandom();
|
||||
|
||||
using ReadOnlyBuffer<float> buffer = Gpu.Default.AllocateConstantBuffer(array);
|
||||
using ReadOnlyBuffer<float> buffer = Gpu.Default.AllocateReadOnlyBuffer(array);
|
||||
float[] result = buffer.GetData();
|
||||
|
||||
Assert.IsTrue(array.AsSpan().ContentEquals(result));
|
||||
|
||||
@@ -70,7 +70,7 @@ namespace ComputeSharp.NetCore.Tests
|
||||
{
|
||||
float[] source = Enumerable.Range(0, 100).Select(i => (float)i).ToArray();
|
||||
|
||||
using ReadOnlyBuffer<float> input = Gpu.Default.AllocateConstantBuffer(source);
|
||||
using ReadOnlyBuffer<float> input = Gpu.Default.AllocateReadOnlyBuffer(source);
|
||||
using ReadWriteBuffer<float> buffer = Gpu.Default.AllocateReadWriteBuffer<float>(source.Length);
|
||||
|
||||
Action<ThreadIds> action = id => buffer[id.X] = input[id.X];
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする