From 40d9cdd33a3d5bb0a9d2947c77c4d6c5b864b78b Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Fri, 4 Mar 2022 10:00:29 -0800 Subject: [PATCH] add element-wise SetBufferData overload --- src/Graphics/CommandBuffer.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/Graphics/CommandBuffer.cs b/src/Graphics/CommandBuffer.cs index 19f56b12..c93ca991 100644 --- a/src/Graphics/CommandBuffer.cs +++ b/src/Graphics/CommandBuffer.cs @@ -765,6 +765,22 @@ namespace MoonWorks.Graphics } } + public void SetBufferData( + Buffer buffer, + IntPtr dataPtr, + uint bufferOffsetInElements, + uint numElements + ) { + Refresh.Refresh_SetBufferData( + Device.Handle, + Handle, + buffer.Handle, + (uint) Marshal.SizeOf() * bufferOffsetInElements, + dataPtr, + (uint) Marshal.SizeOf() * numElements + ); + } + /// /// Asynchronously copies data into a texture. ///