GPGMM
GPGMM, a General-Purpose GPU Memory Management Library
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Typedefs | Enumerations | Functions | Variables
gpgmm_d3d12.h File Reference
#include <d3d12.h>
#include <dxgi1_4.h>
#include <windows.h>

Classes

struct  gpgmm::d3d12::RESIDENCY_HEAP_INFO
 
struct  gpgmm::d3d12::RESIDENCY_HEAP_DESC
 
struct  gpgmm::d3d12::RECORD_OPTIONS
 
struct  gpgmm::d3d12::RESIDENCY_MANAGER_DESC
 
struct  gpgmm::d3d12::RESIDENCY_MANAGER_STATS
 
struct  gpgmm::d3d12::RESOURCE_ALLOCATION_INFO
 
struct  gpgmm::d3d12::RESOURCE_ALLOCATOR_DESC
 
struct  gpgmm::d3d12::RESOURCE_ALLOCATION_DESC
 
struct  gpgmm::d3d12::FEATURE_DATA_RESOURCE_ALLOCATION_SUPPORT
 
struct  gpgmm::d3d12::RESOURCE_ALLOCATOR_STATS
 

Namespaces

namespace  gpgmm
 
namespace  gpgmm::d3d12
 

Macros

#define GPGMM_EXPORT
 
#define GPGMM_INTERFACE   struct
 

Typedefs

using gpgmm::d3d12::CreateHeapFn = HRESULT (*)(void* pCreateHeapContext, ID3D12Pageable** ppPageableOut)
 Callback function used to create a ID3D12Pageable.
 

Enumerations

enum  gpgmm::d3d12::RESIDENCY_HEAP_STATUS { gpgmm::d3d12::RESIDENCY_HEAP_STATUS_UNKNOWN = 0 , gpgmm::d3d12::RESIDENCY_HEAP_STATUS_EVICTED = 1 , gpgmm::d3d12::RESIDENCY_HEAP_STATUS_RESIDENT = 2 }
 
enum  gpgmm::d3d12::RESIDENCY_HEAP_FLAGS { gpgmm::d3d12::RESIDENCY_HEAP_FLAG_NONE = 0x0 , gpgmm::d3d12::RESIDENCY_HEAP_FLAG_CREATE_IN_BUDGET = 0x1 , gpgmm::d3d12::RESIDENCY_HEAP_FLAG_CREATE_RESIDENT = 0x2 , gpgmm::d3d12::RESIDENCY_HEAP_FLAG_CREATE_LOCKED = 0x4 }
 
enum  gpgmm::d3d12::RECORD_FLAGS {
  gpgmm::d3d12::RECORD_FLAG_NONE = 0x0 , gpgmm::d3d12::RECORD_FLAG_API_OBJECTS = 0x1 , gpgmm::d3d12::RECORD_FLAG_API_CALLS = 0x2 , gpgmm::d3d12::RECORD_FLAG_API_TIMINGS = 0x4 ,
  gpgmm::d3d12::RECORD_FLAG_COUNTERS = 0x8 , gpgmm::d3d12::RECORD_FLAG_CAPTURE = 0x3 , gpgmm::d3d12::RECORD_FLAG_ALL = 0xFF
}
 
enum  gpgmm::d3d12::RECORD_SCOPE { gpgmm::d3d12::RECORD_SCOPE_PER_PROCESS = 0 , gpgmm::d3d12::RECORD_SCOPE_PER_INSTANCE = 1 }
 
enum  gpgmm::d3d12::RESIDENCY_MANAGER_FLAGS { gpgmm::d3d12::RESIDENCY_MANAGER_FLAG_NONE = 0x0 , gpgmm::d3d12::RESIDENCY_MANAGER_FLAG_ALLOW_BACKGROUND_BUDGET_UPDATES = 0x1 , gpgmm::d3d12::RESIDENCY_MANAGER_FLAG_NEVER_USE_UNIFIED_MEMORY = 0x2 , gpgmm::d3d12::RESIDENCY_MANAGER_FLAG_ALWAYS_IN_BUDGET = 0x4 }
 
enum  gpgmm::d3d12::RESOURCE_ALLOCATION_TYPE { gpgmm::d3d12::RESOURCE_ALLOCATION_TYPE_UNKNOWN = 0 , gpgmm::d3d12::RESOURCE_ALLOCATION_TYPE_STANDALONE = 1 , gpgmm::d3d12::RESOURCE_ALLOCATION_TYPE_SUBALLOCATED = 2 , gpgmm::d3d12::RESOURCE_ALLOCATION_TYPE_SUBALLOCATED_WITHIN = 3 }
 
enum  gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAGS {
  gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_NONE = 0x0 , gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_ALWAYS_COMMITTED = 0x1 , gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_ALWAYS_IN_BUDGET = 0x2 , gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_ALLOW_PREFETCH = 0x4 ,
  gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_ALWAYS_ON_DEMAND = 0x8 , gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_ALLOW_UNIFIED_MEMORY = 0x10 , gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_NEVER_LEAK = 0x20 , gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_CREATE_NOT_RESIDENT = 0x40 ,
  gpgmm::d3d12::RESOURCE_ALLOCATOR_FLAG_NEVER_OVER_ALLOCATE = 0x80
}
 
enum  gpgmm::d3d12::RESOURCE_ALLOCATION_ALGORITHM {
  gpgmm::d3d12::RESOURCE_ALLOCATION_ALGORITHM_DEFAULT = 0 , gpgmm::d3d12::RESOURCE_ALLOCATION_ALGORITHM_SLAB = 1 , gpgmm::d3d12::RESOURCE_ALLOCATION_ALGORITHM_BUDDY_SYSTEM = 2 , gpgmm::d3d12::RESOURCE_ALLOCATION_ALGORITHM_FIXED_POOL = 3 ,
  gpgmm::d3d12::RESOURCE_ALLOCATION_ALGORITHM_SEGMENTED_POOL = 4 , gpgmm::d3d12::RESOURCE_ALLOCATION_ALGORITHM_DEDICATED = 5
}
 
enum  gpgmm::d3d12::RESOURCE_ALLOCATION_FLAGS {
  gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_NONE = 0x0 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_NEVER_ALLOCATE_HEAP = 0x1 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_ALLOW_SUBALLOCATE_WITHIN_RESOURCE = 0x2 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_NEVER_SUBALLOCATE_HEAP = 0x4 ,
  gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_ALWAYS_PREFETCH_HEAP = 0x8 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_ALWAYS_CACHE_SIZE = 0x10 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_ALWAYS_ATTRIBUTE_HEAPS = 0x20 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_NEVER_FALLBACK = 0x40 ,
  gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_NEVER_RESIDENT = 0x80 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_ALWAYS_WARN_ON_ALIGNMENT_MISMATCH = 0x100 , gpgmm::d3d12::RESOURCE_ALLOCATION_FLAG_ALWAYS_COMMITTED = 0x200
}
 
enum  gpgmm::d3d12::RESOURCE_ALLOCATOR_FEATURE { gpgmm::d3d12::RESOURCE_ALLOCATOR_FEATURE_RESOURCE_ALLOCATION_SUPPORT }
 

Functions

virtual HRESULT gpgmm::d3d12::SetDebugName (LPCWSTR Name)=0
 Associate a debug name.
 
virtual HRESULT gpgmm::d3d12::Lock ()=0
 Locks the specified heap.
 
virtual HRESULT gpgmm::d3d12::Unlock ()=0
 Unlocks the specified heap.
 
virtual HRESULT gpgmm::d3d12::GetResidencyManager (IResidencyManager **ppResidencyManagerOut) const =0
 Get the residency manager that manages this heap.
 
GPGMM_EXPORT HRESULT gpgmm::d3d12::CreateResidencyHeap (const RESIDENCY_HEAP_DESC &descriptor, IResidencyManager *const pResidencyManager, CreateHeapFn createHeapFn, void *pCreateHeapContext, IResidencyHeap **ppResidencyHeapOut)
 Create a residency managed heap.
 
GPGMM_EXPORT HRESULT gpgmm::d3d12::CreateResidencyHeap (const RESIDENCY_HEAP_DESC &descriptor, IResidencyManager *const pResidencyManager, ID3D12Pageable *pPageable, IResidencyHeap **ppResidencyHeapOut)
 Create a residency managed heap.
 
virtual HRESULT gpgmm::d3d12::Reset ()=0
 Resets list to its initial state as if a new list was created.
 
GPGMM_EXPORT HRESULT gpgmm::d3d12::CreateResidencyList (IResidencyList **ppResidencyListOut)
 Create a residency list or collection of heaps to manage together for residency.
 
virtual HRESULT gpgmm::d3d12::SetVideoMemoryReservation (const DXGI_MEMORY_SEGMENT_GROUP &heapSegment, UINT64 availableForReservation, UINT64 *pCurrentReservationOut=nullptr)=0
 Sets video memory reservation.
 
virtual HRESULT gpgmm::d3d12::QueryVideoMemoryInfo (const DXGI_MEMORY_SEGMENT_GROUP &heapSegment, DXGI_QUERY_VIDEO_MEMORY_INFO *pVideoMemoryInfoOut)=0
 Get the current budget and memory usage.
 
virtual HRESULT gpgmm::d3d12::SetResidencyStatus (IResidencyHeap *pHeap, const RESIDENCY_HEAP_STATUS &newStatus)=0
 Update the residency status of a heap.
 
virtual HRESULT gpgmm::d3d12::QueryStats (RESIDENCY_MANAGER_STATS *pResidencyManagerStats)=0
 Query the current residency usage.
 
GPGMM_EXPORT HRESULT gpgmm::d3d12::CreateResidencyManager (const RESIDENCY_MANAGER_DESC &descriptor, ID3D12Device *pDevice, IDXGIAdapter3 *pAdapter, IResidencyManager **ppResidencyManagerOut)
 Create residency residency manager to manage video memory.
 
virtual void gpgmm::d3d12::Unmap (UINT subresource, const D3D12_RANGE *pWrittenRange)=0
 Unmaps the resource allocation.
 
virtual ID3D12Resource * gpgmm::d3d12::GetResource () const =0
 Returns the resource owned by this allocation.
 
virtual D3D12_GPU_VIRTUAL_ADDRESS gpgmm::d3d12::GetGPUVirtualAddress () const =0
 Returns the GPU virtual address of the resource allocation.
 
virtual UINT64 gpgmm::d3d12::GetOffsetFromResource () const =0
 Returns the start of the allocation in the resource.
 
virtual RESOURCE_ALLOCATION_INFO gpgmm::d3d12::GetInfo () const =0
 Returns information about this resource allocation.
 
virtual IResidencyHeapgpgmm::d3d12::GetMemory () const =0
 Returns the heap assigned to this resource allocation.
 
virtual HRESULT gpgmm::d3d12::GetResourceAllocator (IResourceAllocator **ppResourceAllocatorOut) const =0
 Get the resource allocator that created the resource for this allocation.
 
virtual HRESULT gpgmm::d3d12::CreateResource (const RESOURCE_ALLOCATION_DESC &allocationDescriptor, ID3D12Resource *pCommittedResource, IResourceAllocation **ppResourceAllocationOut)=0
 Use existing ID3D12Resource as a resource allocation.
 
virtual HRESULT gpgmm::d3d12::ReleaseResourceHeaps (UINT64 bytesToRelease, UINT64 *pBytesReleased)=0
 Return free memory back to the OS.
 
virtual HRESULT gpgmm::d3d12::QueryStats (RESOURCE_ALLOCATOR_STATS *pResourceAllocatorStats)=0
 Query the current allocator usage.
 
virtual HRESULT gpgmm::d3d12::CheckFeatureSupport (RESOURCE_ALLOCATOR_FEATURE feature, void *pFeatureSupportData, UINT featureSupportDataSize) const =0
 Gets information about the features that are supported by the resource allocator.
 
GPGMM_EXPORT HRESULT gpgmm::d3d12::CreateResourceAllocator (const RESOURCE_ALLOCATOR_DESC &allocatorDescriptor, ID3D12Device *pDevice, IDXGIAdapter *pAdapter, IResourceAllocator **ppResourceAllocatorOut, IResidencyManager **ppResidencyManagerOut)
 Create a resource allocator with residency.
 
GPGMM_EXPORT HRESULT gpgmm::d3d12::CreateResourceAllocator (const RESOURCE_ALLOCATOR_DESC &allocatorDescriptor, ID3D12Device *pDevice, IDXGIAdapter *pAdapter, IResidencyManager *pResidencyManager, IResourceAllocator **ppResourceAllocatorOut)
 Create a resource allocator using a specified residency manager.
 
GPGMM_EXPORT HRESULT gpgmm::d3d12::CreateResourceAllocator (const RESOURCE_ALLOCATOR_DESC &allocatorDescriptor, IResourceAllocator *pResourceAllocator, IResourceAllocator **ppResourceAllocatorOut)
 Create a resource allocator from an existing resource allocator.
 

Variables

GPGMM_INTERFACE gpgmm::d3d12::IDebugObject
 Debug object associates additional information for D3D objects using SetPrivateData.
 
GPGMM_INTERFACE gpgmm::d3d12::IResidencyManager
 ResidencyManager tracks and maintains one or more heaps within a residency cache.
 
GPGMM_INTERFACE gpgmm::d3d12::IResidencyHeap
 IResidencyHeap represents a ID3D12Pageable object used for residency management.
 
GPGMM_INTERFACE gpgmm::d3d12::IResidencyList
 Represents a list of heaps which will be "made resident" upon executing a command-list.
 
GPGMM_INTERFACE ID3D12CommandList *const * gpgmm::d3d12::ppCommandLists
 
GPGMM_INTERFACE ID3D12CommandList *const IResidencyList *const * gpgmm::d3d12::ppResidencyLists
 
GPGMM_INTERFACE ID3D12CommandList *const IResidencyList *const UINT gpgmm::d3d12::count = 0
 
GPGMM_INTERFACE gpgmm::d3d12::IResourceAllocator
 ResourceAllocator is an allocator that creates ID3D12Resources in a ResourceAllocation.
 
GPGMM_INTERFACE gpgmm::d3d12::IResourceAllocation
 ResourceAllocation is an allocation that contains a ID3D12Resource.
 
GPGMM_INTERFACE const D3D12_RANGE * gpgmm::d3d12::pReadRange
 
GPGMM_INTERFACE const D3D12_RANGE void ** gpgmm::d3d12::ppDataOut = 0
 
GPGMM_INTERFACE const D3D12_RESOURCE_DESC & gpgmm::d3d12::resourceDescriptor
 
GPGMM_INTERFACE const D3D12_RESOURCE_DESC D3D12_RESOURCE_STATES gpgmm::d3d12::initialResourceState
 
GPGMM_INTERFACE const D3D12_RESOURCE_DESC D3D12_RESOURCE_STATES const D3D12_CLEAR_VALUE * gpgmm::d3d12::pClearValue
 
GPGMM_INTERFACE const D3D12_RESOURCE_DESC D3D12_RESOURCE_STATES const D3D12_CLEAR_VALUE IResourceAllocation ** gpgmm::d3d12::ppResourceAllocationOut = 0
 

Macro Definition Documentation

◆ GPGMM_EXPORT

#define GPGMM_EXPORT

◆ GPGMM_INTERFACE

#define GPGMM_INTERFACE   struct