ID3D12Device::GetResourceTiling method

Gets info about how a tiled resource is broken into tiles.

Syntax

void GetResourceTiling(
  ID3D12Resource           *pTiledResource,
  UINT                     *pNumTilesForEntireResource,
  D3D12_PACKED_MIP_INFO    *pPackedMipDesc,
  D3D12_TILE_SHAPE         *pStandardTileShapeForNonPackedMips,
  UINT                     *pNumSubresourceTilings,
  UINT                     FirstSubresourceTilingToGet,
  D3D12_SUBRESOURCE_TILING *pSubresourceTilingsForNonPackedMips
);

Parameters

pTiledResource

Type: ID3D12Resource*

Specifies a tiled ID3D12Resource to get info about.

pNumTilesForEntireResource

Type: UINT*

A pointer to a variable that receives the number of tiles needed to store the entire tiled resource.

pPackedMipDesc

Type: D3D12_PACKED_MIP_INFO*

A pointer to a D3D12_PACKED_MIP_INFO structure that GetResourceTiling fills with info about how the tiled resource's mipmaps are packed.

pStandardTileShapeForNonPackedMips

Type: D3D12_TILE_SHAPE*

Specifies a D3D12_TILE_SHAPE structure that GetResourceTiling fills with info about the tile shape. This is info about how pixels fit in the tiles, independent of tiled resource's dimensions, not including packed mipmaps. If the entire tiled resource is packed, this parameter is meaningless because the tiled resource has no defined layout for packed mipmaps. In this situation, GetResourceTiling sets the members of D3D12_TILE_SHAPE to zeros.

pNumSubresourceTilings

Type: UINT*

A pointer to a variable that contains the number of tiles in the subresource. On input, this is the number of subresources to query tilings for; on output, this is the number that was actually retrieved at pSubresourceTilingsForNonPackedMips (clamped to what's available).

FirstSubresourceTilingToGet

Type: UINT

The number of the first subresource tile to get. GetResourceTiling ignores this parameter if the number that pNumSubresourceTilings points to is 0.

pSubresourceTilingsForNonPackedMips

Type: D3D12_SUBRESOURCE_TILING*

Specifies a D3D12_SUBRESOURCE_TILING structure that GetResourceTiling fills with info about subresource tiles. If subresource tiles are part of packed mipmaps, GetResourceTiling sets the members of D3D12_SUBRESOURCE_TILING to zeros, except the StartTileIndexInOverallResource member, which GetResourceTiling sets to D3D12_PACKED_TILE (0xffffffff). The D3D12_PACKED_TILE constant indicates that the whole D3D12_SUBRESOURCE_TILING structure is meaningless for this situation, and the info that the pPackedMipDesc parameter points to applies.

Return Value

This method does not return a value.

Remarks

To estimate the total resource size of textures needed when calculating heap sizes and calling CreatePlacedResource, use GetResourceAllocationInfo instead of GetResourceTiling. GetResourceTiling cannot be used for this.

For more information on tiled resources, refer to Volume Tiled Resources.

Requirements

   
Target Platform Windows
Header d3d12.h
Library D3d12.lib
DLL D3d12.dll

See Also

ID3D12Device

Subresources