More code refactoring

このコミットが含まれているのは:
Sergio Pedri committed 2019-08-13 21:44:35 +02:00
1 親 9edbdcfdc3
コミット 8abf928b45
3ファイル変更
+15 -16

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

+9 -4
ファイルの表示
@@ -111,12 +111,17 @@ namespace ComputeSharp.Graphics.Buffers
}
/// <inheritdoc/>
public override void SetData(ReadOnlyBuffer<T> buffer)
public override void SetData(HlslBuffer<T> buffer)
{
using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy);
if (buffer is ReadOnlyBuffer<T> readOnlyBuffer)
{
// Directly copy the input buffer, if possible
using CommandList copyCommandList = new CommandList(GraphicsDevice, CommandListType.Copy);
copyCommandList.CopyBufferRegion(buffer, 0, this, 0, SizeInBytes);
copyCommandList.Flush(true);
copyCommandList.CopyBufferRegion(buffer, 0, this, 0, SizeInBytes);
copyCommandList.Flush(true);
}
else SetDataWithCpuBuffer(buffer);
}
}
}