> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetResourceTiling

> Gets info about how a tiled resource is broken into tiles. (ID3D12Device.GetResourceTiling)

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

## Syntax

```cpp theme={null}
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 \[in]*\
Type: ID3D12Resource \*

Specifies a tiled [ID3D12Resource](/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)  to get info about.

*pNumTilesForEntireResource \[out, optional]*\
Type: UINT \*

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

*pPackedMipDesc \[out, optional]*\
Type: D3D12\_PACKED\_MIP\_INFO \*

A pointer to a [D3D12\_PACKED\_MIP\_INFO](/reference/graphics/d3d12/structs/d3d12_packed_mip_info_public) structure that **GetResourceTiling** fills with info about how the tiled resource's mipmaps are packed.

*pStandardTileShapeForNonPackedMips \[out, optional]*\
Type: D3D12\_TILE\_SHAPE \*

Specifies a [D3D12\_TILE\_SHAPE](/reference/graphics/d3d12/structs/d3d12_tile_shape_public) 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 \[in, out, optional]*\
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 <i>pSubresourceTilingsForNonPackedMips</i> (clamped to what's available).

*FirstSubresourceTilingToGet \[in]*\
Type: UINT

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

*pSubresourceTilingsForNonPackedMips \[out]*\
Type: D3D12\_SUBRESOURCE\_TILING \*

Specifies a [D3D12\_SUBRESOURCE\_TILING](/reference/graphics/d3d12/structs/d3d12_subresource_tiling_public) 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 <i>StartTileIndexInOverallResource</i> 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 <i>pPackedMipDesc</i> parameter points to applies.

### Return value

Type: void

None.

## Remarks

To estimate the total resource size of textures needed when calculating heap sizes and calling [CreatePlacedResource](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createplacedresource_public), use [GetResourceAllocationInfo](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getresourceallocationinfo_public) instead of **GetResourceTiling**.
**GetResourceTiling** cannot be used for this.

For more information on tiled resources, refer to [Volume Tiled Resources](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/volume-tiled-resources).

## Requirements

**Header:** d3d12\_xs.h or d3d12\_x.h\
**Library:** d3d12\_xs.lib or d3d12\_x.lib\
**Supported Platforms**: XBOX Series consoles and XBOX One family

## See Also

[ID3D12Device](/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)

[Subresources](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/subresources)


## Related topics

- [D3D12_SUBRESOURCE_TILING](/reference/graphics/d3d12/structs/d3d12_subresource_tiling_public.md)
- [GetResourceAllocationInfo](/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getresourceallocationinfo_public.md)
- [GetResourceAllocationInfo1 (XBOX Series consoles)](/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_getresourceallocationinfo1_public.md)
- [D3D12_TILE_SHAPE](/reference/graphics/d3d12/structs/d3d12_tile_shape_public.md)
- [D3D12_TILED_RESOURCE_COORDINATE](/reference/graphics/d3d12/structs/d3d12_tiled_resource_coordinate_public.md)
