internal NativeBuffer(IDevice device, BufferTypeEnum bufferType, ReadOnlySpan <T> data, BufferInternalFormat internalFormat) { this.device = device; this.internalFormat = internalFormat; this.BufferType = bufferType; GlBufferType = BufferTypeToBindFlags(bufferType); CreateBufferWithData(data); }
internal NativeBuffer(IDevice device, BufferTypeEnum bufferType, int length, BufferInternalFormat internalFormat) { this.device = device; this.internalFormat = internalFormat; this.BufferType = bufferType; GlBufferType = BufferTypeToBindFlags(bufferType); CreateBuffer(); }
// Safe multithread call public NativeBuffer <T> CreateBuffer <T>(BufferTypeEnum bufferType, int size, BufferInternalFormat format = BufferInternalFormat.None) where T : unmanaged { return(new NativeBuffer <T>(device, bufferType, size, format)); }
public NativeBuffer <T> CreateBuffer <T>(BufferTypeEnum bufferType, ReadOnlySpan <T> data, BufferInternalFormat format = BufferInternalFormat.None) where T : unmanaged { return(new NativeBuffer <T>(device, bufferType, data, format)); }
public NativeBuffer <T> CreateBuffer <T>(BufferTypeEnum bufferType, ReadOnlySpan <T> data, BufferInternalFormat format = BufferInternalFormat.None) where T : unmanaged => Device.CreateBuffer <T>(bufferType, data, format);