Example #1
0
        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
        }
Example #2
0
        internal void Return(GpuResource gpuAllocation)
        {
            var heap = gpuAllocation.GetAllocatorHeap();

            if (!heap.Heap.Exists)
            {
                // resource is comitted (implicit heap)
                gpuAllocation.UnderlyingResource->Release();
            }
            else
            {
                ReturnPlacedAllocation(gpuAllocation);
            }
        }
Example #3
0
 internal VertexBuffer(GpuResource buffer)
 {
     Resource = buffer;
 }
Example #4
0
 internal IndexBuffer(GpuResource buffer)
 {
     Resource = buffer;
 }