XGMemoryLayout::MapFromPattern Method

Maps pages using a predefined pattern passed as a byte array.

Syntax

public:
HRESULT MapFromPattern(
         XGMemoryLayoutMapping *pMapping,
         UINT32 PageCount,
         const BYTE *pPattern,
         SIZE_T PatternSizeBytes,
         UINT32 MaxEsramPageCount
)  

Parameters

pMapping
Type: XGMemoryLayoutMapping *

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

PageCount
Type: UINT32 

The number of pages to create this mapping with, including ESRAM pages and system pages. This count will adjust the pattern in length and/or ESRAM usage. If the pattern 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 PageCount.

pPattern
Type: BYTE *

[in] The predefined pattern, as a byte array.

PatternSizeBytes
Type: SIZE_T 

The size of the predefined pattern.

MaxEsramPageCount
Type: UINT32 

The maximum numer of ESRAM pages to create the mapping with. This count will adjust the pattern in length and/or ESRAM usage. If the pattern 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 MaxEsramPageCount.

Return value

Type: HRESULT 

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

Remarks

The mapping is created with a specific page count and max ESRAM page count. These counts will adjust the pattern in length and/or ESRAM usage. If the pattern 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