add element-wise SetBufferData overload

main
cosmonaut 2022-03-04 10:00:29 -08:00
parent c4d2e3b8ee
commit 40d9cdd33a
1 changed files with 16 additions and 0 deletions

View File

@ -765,6 +765,22 @@ namespace MoonWorks.Graphics
}
}
public void SetBufferData<T>(
Buffer buffer,
IntPtr dataPtr,
uint bufferOffsetInElements,
uint numElements
) {
Refresh.Refresh_SetBufferData(
Device.Handle,
Handle,
buffer.Handle,
(uint) Marshal.SizeOf<T>() * bufferOffsetInElements,
dataPtr,
(uint) Marshal.SizeOf<T>() * numElements
);
}
/// <summary>
/// Asynchronously copies data into a texture.
/// </summary>