Renamed GetData/SetData to CopyTo/CopyFrom

このコミットが含まれているのは:
Sergio Pedri committed 2021-01-31 23:46:00 +01:00
1 親 da19f87276
コミット f8d0ac5b87
23ファイル変更
+183 -183

検索条件に一致するファイルはありません

+6 -6
ファイルの表示
@@ -112,7 +112,7 @@ namespace ComputeSharp.Resources
/// <param name="destination">The input memory area to write data to.</param>
/// <param name="length">The length of the memory area to write data to.</param>
/// <param name="offset">The offset to start reading data from.</param>
internal abstract void GetData(ref T destination, int length, int offset);
internal abstract void CopyTo(ref T destination, int length, int offset);
/// <summary>
/// Writes the contents of a given memory area to a specified area of the current <see cref="Buffer{T}"/> instance.
@@ -120,19 +120,19 @@ namespace ComputeSharp.Resources
/// <param name="source">The input memory area to read data from.</param>
/// <param name="length">The length of the input memory area to read data from.</param>
/// <param name="offset">The offset to start writing data to.</param>
internal abstract void SetData(ref T source, int length, int offset);
internal abstract void CopyFrom(ref T source, int length, int offset);
/// <summary>
/// Writes the contents of a given <see cref="Buffer{T}"/> to the current <see cref="Buffer{T}"/> instance.
/// </summary>
/// <param name="source">The input <see cref="Buffer{T}"/> to read data from.</param>
public abstract void SetData(Buffer<T> source);
public abstract void CopyFrom(Buffer<T> source);
/// <summary>
/// Writes the contents of a given <see cref="Buffer{T}"/> to the current <see cref="Buffer{T}"/> instance, using a temporary CPU buffer.
/// </summary>
/// <param name="source">The input <see cref="Buffer{T}"/> to read data from.</param>
protected void SetDataWithCpuBuffer(Buffer<T> source)
protected void CopyFromWithCpuBuffer(Buffer<T> source)
{
T[] array = ArrayPool<T>.Shared.Rent(source.Length);
@@ -140,9 +140,9 @@ namespace ComputeSharp.Resources
{
ref T r0 = ref MemoryMarshal.GetArrayDataReference(array);
source.GetData(ref r0, source.Length, 0);
source.CopyTo(ref r0, source.Length, 0);
SetData(ref r0, source.Length, 0);
CopyFrom(ref r0, source.Length, 0);
}
finally
{
+6 -6
ファイルの表示
@@ -29,7 +29,7 @@ namespace ComputeSharp.Resources
}
/// <inheritdoc/>
internal override unsafe void GetData(ref T destination, int length, int offset)
internal override unsafe void CopyTo(ref T destination, int length, int offset)
{
GraphicsDevice.ThrowIfDisposed();
@@ -87,7 +87,7 @@ namespace ComputeSharp.Resources
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="length">The number of items to read.</param>
/// <param name="offset">The offset to start reading data from.</param>
internal unsafe void GetData(ReadBackBuffer<T> destination, int destinationOffset, int length, int offset)
internal unsafe void CopyTo(ReadBackBuffer<T> destination, int destinationOffset, int length, int offset)
{
GraphicsDevice.ThrowIfDisposed();
@@ -113,7 +113,7 @@ namespace ComputeSharp.Resources
}
/// <inheritdoc/>
internal override unsafe void SetData(ref T source, int length, int offset)
internal override unsafe void CopyFrom(ref T source, int length, int offset)
{
GraphicsDevice.ThrowIfDisposed();
@@ -169,7 +169,7 @@ namespace ComputeSharp.Resources
/// <param name="sourceOffset">The starting offset within <paramref name="source"/> to read data from.</param>
/// <param name="length">The number of items to read.</param>
/// <param name="offset">The offset to start reading writing data to.</param>
internal unsafe void SetData(UploadBuffer<T> source, int sourceOffset, int length, int offset)
internal unsafe void CopyFrom(UploadBuffer<T> source, int sourceOffset, int length, int offset)
{
GraphicsDevice.ThrowIfDisposed();
@@ -195,7 +195,7 @@ namespace ComputeSharp.Resources
}
/// <inheritdoc/>
public override unsafe void SetData(Buffer<T> source)
public override unsafe void CopyFrom(Buffer<T> source)
{
GraphicsDevice.ThrowIfDisposed();
@@ -212,7 +212,7 @@ namespace ComputeSharp.Resources
copyCommandList.CopyBufferRegion(D3D12Resource, 0, source.D3D12Resource, 0,(ulong)SizeInBytes);
copyCommandList.ExecuteAndWaitForCompletion();
}
else SetDataWithCpuBuffer(source);
else CopyFromWithCpuBuffer(source);
}
}
}
+2 -2
ファイルの表示
@@ -131,7 +131,7 @@ namespace ComputeSharp.Resources
/// <param name="y">The vertical offset in the source texture.</param>
/// <param name="width">The width of the memory area to copy.</param>
/// <param name="height">The height of the memory area to copy.</param>
internal void GetData(ref T destination, int size, int x, int y, int width, int height)
internal void CopyTo(ref T destination, int size, int x, int y, int width, int height)
{
GraphicsDevice.ThrowIfDisposed();
@@ -203,7 +203,7 @@ namespace ComputeSharp.Resources
/// <param name="y">The vertical offset in the destination texture.</param>
/// <param name="width">The width of the memory area to write to.</param>
/// <param name="height">The height of the memory area to write to.</param>
internal void SetData(ref T source, int size, int x, int y, int width, int height)
internal void CopyFrom(ref T source, int size, int x, int y, int width, int height)
{
GraphicsDevice.ThrowIfDisposed();
+2 -2
ファイルの表示
@@ -142,7 +142,7 @@ namespace ComputeSharp.Resources
/// <param name="width">The width of the memory area to copy.</param>
/// <param name="height">The height of the memory area to copy.</param>
/// <param name="depth">The depth of the memory area to copy.</param>
internal void GetData(ref T destination, int size, int x, int y, int z, int width, int height, int depth)
internal void CopyTo(ref T destination, int size, int x, int y, int z, int width, int height, int depth)
{
GraphicsDevice.ThrowIfDisposed();
@@ -221,7 +221,7 @@ namespace ComputeSharp.Resources
/// <param name="width">The width of the memory area to write to.</param>
/// <param name="height">The height of the memory area to write to.</param>
/// <param name="depth">The depth of the memory area to write to.</param>
internal void SetData(ref T source, int size, int x, int y, int z, int width, int height, int depth)
internal void CopyFrom(ref T source, int size, int x, int y, int z, int width, int height, int depth)
{
GraphicsDevice.ThrowIfDisposed();