public void Dispose() { if (UseBufferOffsets) { allocator.ReleaseReference(constantBuffer); } else { Marshal.FreeHGlobal(Data); } Data = IntPtr.Zero; }
private void PrepareBuffers(int count) { List <Buffer> toRelease = new List <Buffer>(); for (int i = 0; i < count; i++) { toRelease.Add(allocator.GetTemporaryBuffer(defaultDescription)); } for (int i = 0; i < count; i++) { allocator.ReleaseReference(toRelease[i]); } }