private void ReturnPlacedAllocation(GpuResource gpuAllocation) { var block = new HeapBlock { Offset = gpuAllocation.GetOffsetFromUnderlyingResource(), Size = gpuAllocation.Size }; var heap = gpuAllocation.GetAllocatorHeap(); heap.FreeBlocks.Add(block); // TODO defrag }
internal void Return(GpuResource gpuAllocation) { var heap = gpuAllocation.GetAllocatorHeap(); if (!heap.Heap.Exists) { // resource is comitted (implicit heap) gpuAllocation.UnderlyingResource->Release(); } else { ReturnPlacedAllocation(gpuAllocation); } }
internal VertexBuffer(GpuResource buffer) { Resource = buffer; }
internal IndexBuffer(GpuResource buffer) { Resource = buffer; }