Fix bad pointer arithmetic in SetBufferData #33

Merged
cosmonaut merged 1 commits from TheSpydog/MoonWorks:pointerfix into main 2022-11-12 03:42:35 +00:00
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)
);
}