예제 #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);
     }
 }
예제 #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);
     }
 }
예제 #3
0
파일: Buffer.cs 프로젝트: x5f3759df/Citrus
 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);
 }