Example #1
0
 /// <summary>
 /// Removes a fence from the holder.
 /// </summary>
 /// <param name="cbIndex">Command buffer index of the command buffer that owns the fence</param>
 /// <param name="fence">Fence to be removed</param>
 public void RemoveFence(int cbIndex, FenceHolder fence)
 {
     lock (_fences)
     {
         _fences.Remove(fence);
     }
 }
Example #2
0
 /// <summary>
 /// Adds a fence to the holder.
 /// </summary>
 /// <param name="cbIndex">Command buffer index of the command buffer that owns the fence</param>
 /// <param name="fence">Fence to be added</param>
 public void AddFence(int cbIndex, FenceHolder fence)
 {
     lock (_fences)
     {
         _fences.TryAdd(fence, cbIndex);
     }
 }
Example #3
0
        private void FreeCompleted()
        {
            FenceHolder signalledFence = null;

            while (_pendingCopies.TryPeek(out var pc) && (pc.Fence == signalledFence || pc.Fence.IsSignaled()))
            {
                signalledFence = pc.Fence; // Already checked - don't need to do it again.
                var dequeued = _pendingCopies.Dequeue();
                Debug.Assert(dequeued.Fence == pc.Fence);
                _freeSize += pc.Size;
                pc.Fence.Put();
            }
        }
Example #4
0
 public PendingCopy(FenceHolder fence, int size)
 {
     Fence = fence;
     Size  = size;
     fence.Get();
 }