MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / NormalBlock

Class NormalBlock

3rdparty/d3d12memalloc/src/D3D12MemAlloc.cpp:5472–10401  ·  view source on GitHub ↗

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. */

Source from the content-addressed store, hash-verified

5470Thread-safety: This class must be externally synchronized.
5471*/
5472class NormalBlock : public MemoryBlock
5473{
5474public:
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
5494private:
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
5502struct 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

Callers

nothing calls this directly

Calls 15

InitFunction · 0.85
IsHeapTypeStandardFunction · 0.85
ClearDetailedStatisticsFunction · 0.85
AddDetailedStatisticsFunction · 0.85
IndexToStandardHeapTypeFunction · 0.85
FreeFunction · 0.85
HeapFlagsToAlignmentFunction · 0.85
ValidateFunction · 0.85
GetHeapFunction · 0.85
AddStatisticsFunction · 0.85
RegisterClass · 0.85

Tested by

no test coverage detected