change array param to span in Buffer.GetData

remotes/1695061714407202320/main
cosmonaut 2023-04-05 11:32:12 -07:00
parent 1e3f04235e
commit 5a2f7eadb8
1 changed files with 3 additions and 3 deletions

View File

@ -61,14 +61,14 @@ namespace MoonWorks.Graphics
/// Reads data out of a buffer and into an array. /// Reads data out of a buffer and into an array.
/// This operation is only guaranteed to read up-to-date data if GraphicsDevice.Wait is called first. /// This operation is only guaranteed to read up-to-date data if GraphicsDevice.Wait is called first.
/// </summary> /// </summary>
/// <param name="data">The array that data will be copied to.</param> /// <param name="data">The span that data will be copied to.</param>
/// <param name="dataLengthInBytes">The length of the data to read.</param> /// <param name="dataLengthInBytes">The length of the data to read.</param>
public unsafe void GetData<T>( public unsafe void GetData<T>(
T[] data, Span<T> data,
uint dataLengthInBytes uint dataLengthInBytes
) where T : unmanaged ) where T : unmanaged
{ {
fixed (T* ptr = &data[0]) fixed (T* ptr = data)
{ {
Refresh.Refresh_GetBufferData( Refresh.Refresh_GetBufferData(
Device.Handle, Device.Handle,