XGComputeTexture2DLayout

Computes the hardware layout for a 2D texture.

Syntax

HRESULT XGComputeTexture2DLayout(
         const XG_TEXTURE2D_DESC *pDesc,
         XG_RESOURCE_LAYOUT *pLayout
)  

Parameters

pDesc
Type: XG_TEXTURE2D_DESC *

[in] A description of a 2D texture, as a pointer to an XG_TEXTURE2D_DESC structure.

pLayout
Type: XG_RESOURCE_LAYOUT *

[out] The hardware layout, as a pointer to an XG_RESOURCE_LAYOUT structure.

Return value

Type: HRESULT 

S_OK if successful; otherwise, an error code.

Returns E_INVALIDARG in the following cases:

Remarks

Use this convenience function instead of creating a texture computer when you only need to compute a layout and you don’t need to use ony of the other features of a texture computer. This function internally creates a texture computer, calls XGTextureAddressComputer::GetResourceLayout Method, and then releases the texture computer.

Requirements

Header: Declared in xg.h.

Library: Use xg_x.lib.