Add mirrored StructuredBufferExtensions APIs

このコミットが含まれているのは:
Sergio Pedri committed 2021-11-12 01:56:08 +01:00
1 親 ffa4881d0a
コミット c657730249
1ファイル変更
+27
+27
ファイルの表示
@@ -33,4 +33,31 @@ public static class StructuredBufferExtensions
{
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
/// <summary>
/// Reads the contents of an <see cref="UploadBuffer{T}"/> instance and writes them into a target <see cref="UploadBuffer{T}"/> instance.
/// </summary>
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="destination">The target <see cref="StructuredBuffer{T}"/> instance to write data to.</param>
/// <param name="source">The input <see cref="UploadBuffer{T}"/> instance to read data from.</param>
public static void CopyFrom<T>(this StructuredBuffer<T> destination, UploadBuffer<T> source)
where T : unmanaged
{
source.CopyTo(destination, 0, 0, source.Length);
}
/// <summary>
/// Reads the contents of an <see cref="UploadBuffer{T}"/> instance and writes them into a target <see cref="UploadBuffer{T}"/> instance.
/// </summary>
/// <typeparam name="T">The type of items stored on the buffer.</typeparam>
/// <param name="destination">The target <see cref="StructuredBuffer{T}"/> instance to write data to.</param>
/// <param name="source">The input <see cref="UploadBuffer{T}"/> instance to read data from.</param>
/// <param name="sourceOffset">The offset to start reading data from.</param>
/// <param name="destinationOffset">The starting offset within <paramref name="destination"/> to write data to.</param>
/// <param name="count">The number of items to read.</param>
public static void CopyFrom<T>(this StructuredBuffer<T> destination, UploadBuffer<T> source, int sourceOffset, int destinationOffset, int count)
where T : unmanaged
{
source.CopyTo(destination, sourceOffset, destinationOffset, count);
}
}