XGMemoryLayout::MapPagePriorityArray Method

Maps pages using a page priority array.

Syntax

public:
HRESULT MapPagePriorityArray(
         XGMemoryLayoutMapping *pMapping,
         const UINT32 *pPagePriorityValues,
         UINT32 PagePriorityCount,
         UINT32 PageCount,
         UINT32 MaxEsramPageCount
)  

Parameters

pMapping
Type: XGMemoryLayoutMapping *

[in, out] The updated mapping result, as a pointer to an XGMemoryLayoutMapping structure.

pPagePriorityValues
Type: UINT32 *

[in] The priority values in the page priority array.

PagePriorityCount
Type: UINT32 

The number of page priority entries.

PageCount
Type: UINT32 

The total number of pages in the page priority array, including system pages and ESRAM pages. This count will adjust the mapping in length and/or ESRAM usage. If the page priority value array is not large enough to span the entire mapping, system pages will be used to pad to the end of the mapping.

If PageCount is XG_ALL_REMAINING_PAGES, XGMemoryLayout::GetPageCountRemaining is substituted as the value of PageCount.

MaxEsramPageCount
Type: UINT32 

The maximum numer of ESRAM pages in the page priority array. This count will adjust the mapping in length and/or ESRAM usage. If the page priority value array is not large enough to span the entire mapping, system pages will be used to pad to the end of the mapping.

If MaxEsramPageCount is XG_ALL_REMAINING_PAGES, XGMemoryLayout::GetFreeEsramPageCount is substituted as the value of MaxEsramPageCount.

Return value

Type: HRESULT 

S_OK, E_INVALIDARG, or E_OUTOFMEMORY, described in Direct3D 11 return codes.

Remarks

This method maps pages using a page priority array. Each value in the page priority array corresponds to one page, arranged in virtual address order.

Values are user-defined, with larger values indicating higher priority.

Before the mapping is applied, the max ESRAM page count is translated into a minimum priority value, where any priority values in the array greater than or equal to the minimum priority value are mapped using ESRAM pages. Translating from max ESRAM page count to minimum priority value is an O(n log n) operation on the mapping page count.

The mapping is created with the specified page count and max ESRAM page count. These counts will adjust the mapping in length and/or ESRAM usage. If the page priority value array is not large enough to span the entire mapping, system pages will be used to pad to the end of the mapping.

Requirements

Header: Declared in xgmemory.h.

See also

XGMemoryLayout

XGMemoryLayout Members