DXGKDDI_CREATEMEMORYBASIS callback function (d3dkmddi.h)
KMD's DxgkDdiCreateMemoryBasis function creates a handle for a collection of memory ranges that represent the allocation being operated on during dirty bit tracking.
Syntax
DXGKDDI_CREATEMEMORYBASIS DxgkddiCreatememorybasis;
HANDLE DxgkddiCreatememorybasis(
IN_CONST_HANDLE hAdapter,
IN_CONST_PDXGKARG_CREATEMEMORYBASIS pArgs
)
{...}
Parameters
hAdapter
[in] A handle to a context block associated with a display adapter. KMD previously provided this handle to Dxgkrnl in the MiniportDeviceContext output parameter of the DxgiDdiAddDevice function.
pArgs
[in] A pointer to a DXGKARG_CREATEMEMORYBASIS structure that contains information for the basis being created.
Return value
DxgkDdiCreateMemoryBasis returns a HANDLE to KMD's reference for tracking the collection of ranges. KMD should be able to transform this information into the information of the basis in subsequent commands like DxgkDdiDestroyMemoryBasis.
Remarks
The tracking of modify operations on VRAM is for allocations that might not be backed contiguously. So the physical addresses represented in the tracking of dirty bits consists of a collection of ranges representing the allocation being operated on. DxgkDdiCreateMemoryBasis returns a handle to KMD's reference for tracking these ranges.
The KMD can rely on the following invariants:
For each range in Ranges, both SegmentOffset and (SegmentOffset + SizeInBytes - 1) represent valid addresses on the segment referred to by SegmentId.
All Ranges are pairwise disjoint; that is, the intersection between any two ranges is always null.
It is also common that SegmentOffset and SizeInBytes will respect certain page alignments when the created memory basis is used in certain dirty tracking DDIs. These values are described on those DDI's reference page, and are always a multiple of DXGK_DIRTY_BIT_TRACKING_SEGMENT_CAPS::PageSize.
Dxgkrnl otherwise doesn't make guarantees about the ordering of the addresses in the collection of Ranges or related assurances.
For more information, see Dirty bit tracking.
Requirements
Requirement | Value |
---|---|
Minimum supported client | Windows 11, version 24H2 (WDDM 3.2) |
Header | d3dkmddi.h |
IRQL | PASSIVE_LEVEL |