fix bad pointer arithmetic in SetBufferData

pull/33/head
Caleb Cornett 2022-11-11 22:35:12 -05:00
parent 934f3fd623
commit 41ef762fe3
1 changed files with 2 additions and 4 deletions

View File

@ -784,16 +784,14 @@ namespace MoonWorks.Graphics
var elementSize = sizeof(T);
fixed (T* ptr = &data[0])
fixed (T* ptr = &data[startElement])
{
var dataPtr = ptr + (startElement * elementSize);
Refresh.Refresh_SetBufferData(
Device.Handle,
Handle,
buffer.Handle,
bufferOffsetInBytes,
(IntPtr) dataPtr,
(IntPtr) ptr,
(uint) (numElements * elementSize)
);
}