public void Dispose() { if (Buffer != null) { GpuBackend.ReleaseBuffer(Buffer); Buffer = null; } }
void Dispose(bool disposing) { if (disposing && Buffer != null) { GpuBackend.ReleaseBuffer(Buffer); Buffer = null; } }
public void Reset(Shape shape) { Shape = shape; var total = shape.ElementCount; if (Buffer != null && total != Buffer.count) { GpuBackend.ReleaseBuffer(Buffer); Buffer = null; } if (Buffer == null && total > 0) { Buffer = GpuBackend.AllocateBuffer(total); } }