예제 #1
0
        public void Release(DescriptorTablePoolEntry entry)
        {
            // TODO: Do garbage collection
            // https://github.com/DiligentGraphics/DiligentCore/blob/109a75aac22463802f03dfc6588951ed0b04892a/Graphics/GraphicsTools/include/VariableSizeAllocationsManager.h

            _entries.Remove(entry.HeapIndex);
        }
예제 #2
0
        public DescriptorTablePoolEntry Reserve(int descriptorCount)
        {
            if (_nextDescriptorIndex + descriptorCount > _maxEntries)
            {
                throw new InvalidOperationException();
            }

            var result = new DescriptorTablePoolEntry(
                _nextDescriptorIndex,
                descriptorCount,
                _descriptorHeap.GPUDescriptorHandleForHeapStart + (_incrementSize * _nextDescriptorIndex),
                _descriptorHeap.CPUDescriptorHandleForHeapStart + (_incrementSize * _nextDescriptorIndex),
                _incrementSize);

            _entries[_nextDescriptorIndex] = result;

            _nextDescriptorIndex += descriptorCount;

            return(result);
        }