| 86 | } |
| 87 | |
| 88 | void DescriptorHeap::Free(DescriptorHandle& handle) |
| 89 | { |
| 90 | if(handle.IsValid() == false) |
| 91 | return; |
| 92 | |
| 93 | #if UseAsserts_ |
| 94 | Assert_(reinterpret_cast<const void*>(this) == handle.ParentHeap); |
| 95 | #endif |
| 96 | |
| 97 | Assert_(Heap != nullptr); |
| 98 | Assert_(Allocated > 0); |
| 99 | Assert_(handle.CPUHandle.ptr >= CPUStart.ptr); |
| 100 | uint64 heapIdx = (handle.CPUHandle.ptr - CPUStart.ptr) / DescriptorSize; |
| 101 | Assert_(heapIdx < NumDescriptors); |
| 102 | |
| 103 | DeadList[Allocated - 1] = uint32(heapIdx); |
| 104 | --Allocated; |
| 105 | |
| 106 | handle = DescriptorHandle(); |
| 107 | } |
| 108 | |
| 109 | // == LinearDescriptorHeap ======================================================================== |
| 110 |
no test coverage detected