Exemplo n.º 1
0
        public Auto(T value, MultiFenceHolder waitable, params IAutoPrivate[] referencedObjs) : this(value)
        {
            _waitable       = waitable;
            _referencedObjs = referencedObjs;

            for (int i = 0; i < referencedObjs.Length; i++)
            {
                referencedObjs[i].IncrementReferenceCount();
            }
        }
Exemplo n.º 2
0
 public BufferHolder(VulkanRenderer gd, Device device, VkBuffer buffer, MemoryAllocation allocation, int size)
 {
     _gd             = gd;
     _device         = device;
     _allocation     = allocation;
     _allocationAuto = new Auto <MemoryAllocation>(allocation);
     _waitable       = new MultiFenceHolder(size);
     _buffer         = new Auto <DisposableBuffer>(new DisposableBuffer(gd.Api, device, buffer), _waitable, _allocationAuto);
     _bufferHandle   = buffer.Handle;
     Size            = size;
     _map            = allocation.HostPointer;
 }
Exemplo n.º 3
0
        public void AddWaitable(MultiFenceHolder waitable)
        {
            lock (_commandBuffers)
            {
                for (int i = 0; i < _totalCommandBuffers; i++)
                {
                    ref var entry = ref _commandBuffers[i];

                    if (entry.InConsumption)
                    {
                        AddWaitable(i, waitable);
                    }
                }
            }
Exemplo n.º 4
0
        public void Create(ulong id)
        {
            MultiFenceHolder waitable = new MultiFenceHolder();

            _gd.FlushAllCommands();
            _gd.CommandBufferPool.AddWaitable(waitable);

            SyncHandle handle = new SyncHandle
            {
                ID       = id,
                Waitable = waitable
            };

            lock (_handles)
            {
                _handles.Add(handle);
            }
        }
Exemplo n.º 5
0
 public void AddWaitable(MultiFenceHolder waitable)
 {
     _pool.AddWaitable(CommandBufferIndex, waitable);
 }