예제 #1
0
 public void Dispose()
 {
     if (UseBufferOffsets)
     {
         allocator.ReleaseReference(constantBuffer);
     }
     else
     {
         Marshal.FreeHGlobal(Data);
     }
     Data = IntPtr.Zero;
 }
예제 #2
0
        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]);
            }
        }