fix bad pointer arithmetic in SetBufferData
parent
934f3fd623
commit
41ef762fe3
|
@ -784,16 +784,14 @@ namespace MoonWorks.Graphics
|
||||||
|
|
||||||
var elementSize = sizeof(T);
|
var elementSize = sizeof(T);
|
||||||
|
|
||||||
fixed (T* ptr = &data[0])
|
fixed (T* ptr = &data[startElement])
|
||||||
{
|
{
|
||||||
var dataPtr = ptr + (startElement * elementSize);
|
|
||||||
|
|
||||||
Refresh.Refresh_SetBufferData(
|
Refresh.Refresh_SetBufferData(
|
||||||
Device.Handle,
|
Device.Handle,
|
||||||
Handle,
|
Handle,
|
||||||
buffer.Handle,
|
buffer.Handle,
|
||||||
bufferOffsetInBytes,
|
bufferOffsetInBytes,
|
||||||
(IntPtr) dataPtr,
|
(IntPtr) ptr,
|
||||||
(uint) (numElements * elementSize)
|
(uint) (numElements * elementSize)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue