XGComputeTileShape

Returns the shape of a single tiled resource tile for the given format.

Syntax

HRESULT XGComputeTileShape(
         XG_RESOURCE_DIMENSION Dimension,
         XG_FORMAT Format,
         UINT32 BytesPerElement,
         UINT32 SampleCount,
         XG_TILE_SHAPE *pTileShapeInTexels,
         XG_TILE_SHAPE_ELEMENTS *pTileShapeInElements
)  

Parameters

Dimension
Type: XG_RESOURCE_DIMENSION 

[in] The dimension of the resource, as a XG_RESOURCE_DIMENSION enumeration constant, such as for unknown, buffer, 1D texture, 2D texture, or 3D texture.

Format
Type: XG_FORMAT 

[in] The format, as an XG_FORMAT enumeration constant, such as XG_FORMAT_R32G32B32_UINT.

BytesPerElement
Type: UINT32 

[in] The bytes per element, as a UINT32.

SampleCount
Type: UINT32 

[in] For all resource dimensions other than Texture2D, SampleCount must be 1. For Texture2D, SampleCount must be one of 1, 2, 4, or 8.

pTileShapeInTexels
Type: XG_TILE_SHAPE *

[out, optional] The tile shape, in textels, as a pointer to a XG_TILE_SHAPE structure. If Format is XG_FORMAT_UNKNOWN, then pTileShapeInTexels will be filled with zeros if present.

pTileShapeInElements
Type: XG_TILE_SHAPE_ELEMENTS *

[out, optional] The tile shape, in elements, as a pointer to a XG_TILE_SHAPE_ELEMENTS structure.

Return value

Type: HRESULT 

S_OK if successful; otherwise, an error code.

Remarks

This function returns the shape of a single tiled resource tile for the given format. The tile shape is returned both in units of texels and elements.

Requirements

Header: Declared in xg.h.

Library: Use xg_x.lib.