Exemple #1
0
 public static void SetData <T>(
     this IPlatformBuffer buffer, int offset, T[] data, int startIndex, int count, BufferSetDataMode mode) where T : unmanaged
 {
     fixed(T *p = &data[startIndex])
     {
         buffer.SetData(offset, new IntPtr(p), count * sizeof(T), mode);
     }
 }
Exemple #2
0
 public static void SetData <T>(
     this IPlatformBuffer buffer, int offset, ref T data, BufferSetDataMode mode) where T : unmanaged
 {
     fixed(T *p = &data)
     {
         buffer.SetData(offset, new IntPtr(p), sizeof(T), mode);
     }
 }
Exemple #3
0
 public void SetData <T>(T[] data, int elementCount) where T : unmanaged
 {
     EnsurePlatformBuffer(sizeof(T) * elementCount);
     platformBuffer.SetData(0, data, 0, elementCount, Dynamic ? BufferSetDataMode.Discard : BufferSetDataMode.Default);
 }