Represents a single block of device memory (heap) with all the data about its regions (aka suballocations, Allocation), assigned and free. Thread-safety: This class must be externally synchronized. */
| 5470 | Thread-safety: This class must be externally synchronized. |
| 5471 | */ |
| 5472 | class NormalBlock : public MemoryBlock |
| 5473 | { |
| 5474 | public: |
| 5475 | BlockMetadata* m_pMetadata; |
| 5476 | |
| 5477 | NormalBlock( |
| 5478 | AllocatorPimpl* allocator, |
| 5479 | BlockVector* blockVector, |
| 5480 | const D3D12_HEAP_PROPERTIES& heapProps, |
| 5481 | D3D12_HEAP_FLAGS heapFlags, |
| 5482 | UINT64 size, |
| 5483 | UINT id); |
| 5484 | virtual ~NormalBlock(); |
| 5485 | |
| 5486 | BlockVector* GetBlockVector() const { return m_BlockVector; } |
| 5487 | |
| 5488 | // 'algorithm' should be one of the *_ALGORITHM_* flags in enums POOL_FLAGS or VIRTUAL_BLOCK_FLAGS |
| 5489 | HRESULT Init(UINT32 algorithm, ID3D12ProtectedResourceSession* pProtectedSession, bool denyMsaaTextures); |
| 5490 | |
| 5491 | // Validates all data structures inside this object. If not valid, returns false. |
| 5492 | bool Validate() const; |
| 5493 | |
| 5494 | private: |
| 5495 | BlockVector* m_BlockVector; |
| 5496 | |
| 5497 | D3D12MA_CLASS_NO_COPY(NormalBlock) |
| 5498 | }; |
| 5499 | #endif // _D3D12MA_NORMAL_BLOCK |
| 5500 | |
| 5501 | #ifndef _D3D12MA_COMMITTED_ALLOCATION_LIST_ITEM_TRAITS |
| 5502 | struct CommittedAllocationListItemTraits |
| 5503 | { |
| 5504 | using ItemType = Allocation; |
| 5505 | |
| 5506 | static ItemType* GetPrev(const ItemType* item) |
| 5507 | { |
| 5508 | D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); |
| 5509 | return item->m_Committed.prev; |
| 5510 | } |
| 5511 | static ItemType* GetNext(const ItemType* item) |
| 5512 | { |
| 5513 | D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); |
| 5514 | return item->m_Committed.next; |
| 5515 | } |
| 5516 | static ItemType*& AccessPrev(ItemType* item) |
| 5517 | { |
| 5518 | D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); |
| 5519 | return item->m_Committed.prev; |
| 5520 | } |
| 5521 | static ItemType*& AccessNext(ItemType* item) |
| 5522 | { |
| 5523 | D3D12MA_ASSERT(item->m_PackedData.GetType() == Allocation::TYPE_COMMITTED || item->m_PackedData.GetType() == Allocation::TYPE_HEAP); |
| 5524 | return item->m_Committed.next; |
| 5525 | } |
| 5526 | }; |
| 5527 | #endif // _D3D12MA_COMMITTED_ALLOCATION_LIST_ITEM_TRAITS |
| 5528 | |
| 5529 | #ifndef _D3D12MA_COMMITTED_ALLOCATION_LIST |
nothing calls this directly
no test coverage detected