> ## 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

> 取得並排資源如何分割成圖格的相關資訊。(ID3D12Device.GetResourceTiling)

取得並排資源如何分割成圖格的相關資訊。

## 語法

```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
)
```

### 參數

*pTiledResource \[in]*\
類型：ID3D12Resource \*

指定要取得其資訊的並排 [ID3D12Resource](/zh-TW/reference/graphics/d3d12_xs/interfaces/ID3D12Resource/id3d12resource_xs)。

*pNumTilesForEntireResource \[out, optional]*\
類型：UINT \*

指向變數的指標，該變數會接收儲存整個並排資源所需的圖格數目。

*pPackedMipDesc \[out, optional]*\
類型：D3D12\_PACKED\_MIP\_INFO \*

指向 [D3D12\_PACKED\_MIP\_INFO](/zh-TW/reference/graphics/d3d12/structs/d3d12_packed_mip_info_public) 結構的指標，**GetResourceTiling** 會在其中填入並排資源的 MIP 對應如何封裝的相關資訊。

*pStandardTileShapeForNonPackedMips \[out, optional]*\
類型：D3D12\_TILE\_SHAPE \*

指定 [D3D12\_TILE\_SHAPE](/zh-TW/reference/graphics/d3d12/structs/d3d12_tile_shape_public) 結構，**GetResourceTiling** 會在其中填入圖格形狀的相關資訊。這是關於像素如何容納於圖格中的資訊，與並排資源的維度無關，不包括封裝的 MIP 對應。如果整個並排資源都已封裝，此參數就沒有意義，因為並排資源沒有為封裝的 MIP 對應定義配置。在此情況下，**GetResourceTiling** 會將 D3D12\_TILE\_SHAPE 的成員設為零。

*pNumSubresourceTilings \[in, out, optional]*\
類型：UINT \*

指向變數的指標，該變數包含子資源中的圖格數目。在輸入時，這是要查詢其並排的子資源數目；在輸出時，這是實際在 <i>pSubresourceTilingsForNonPackedMips</i> 擷取到的數目 (限制在可用的範圍內)。

*FirstSubresourceTilingToGet \[in]*\
類型：UINT

要取得的第一個子資源圖格的編號。如果 <i>pNumSubresourceTilings</i> 所指向的數目為 0，**GetResourceTiling** 會忽略此參數。

*pSubresourceTilingsForNonPackedMips \[out]*\
類型：D3D12\_SUBRESOURCE\_TILING \*

指定 [D3D12\_SUBRESOURCE\_TILING](/zh-TW/reference/graphics/d3d12/structs/d3d12_subresource_tiling_public) 結構，**GetResourceTiling** 會在其中填入子資源圖格的相關資訊。如果子資源圖格是封裝 MIP 對應的一部分，**GetResourceTiling** 會將 D3D12\_SUBRESOURCE\_TILING 的成員設為零，但 <i>StartTileIndexInOverallResource</i> 成員除外，**GetResourceTiling** 會將其設為 D3D12\_PACKED\_TILE (0xffffffff)。D3D12\_PACKED\_TILE 常數表示整個 **D3D12\_SUBRESOURCE\_TILING** 結構在此情況下沒有意義，而應套用 <i>pPackedMipDesc</i> 參數所指向的資訊。

### 傳回值

類型：void

無。

## 備註

若要在計算堆積大小及呼叫 [CreatePlacedResource](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_createplacedresource_public) 時估計所需紋理的總資源大小，請使用 [GetResourceAllocationInfo](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getresourceallocationinfo_public)，而不是 **GetResourceTiling**。
**GetResourceTiling** 無法用於此用途。

如需並排資源的詳細資訊，請參閱[體積並排資源](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/volume-tiled-resources)。

## 需求

**標頭：** d3d12\_xs.h 或 d3d12\_x.h\
**程式庫：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支援的平台：** XBOX Series 主機和 XBOX One 系列主機

## 另請參閱

[ID3D12Device](/zh-TW/reference/graphics/d3d12_x/interfaces/id3d12device/id3d12device)

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


## Related topics

- [D3D12_SUBRESOURCE_TILING](/zh-TW/reference/graphics/d3d12/structs/d3d12_subresource_tiling_public.md)
- [D3D12_TILE_SHAPE](/zh-TW/reference/graphics/d3d12/structs/d3d12_tile_shape_public.md)
- [GetResourceAllocationInfo](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device/methods/id3d12device_getresourceallocationinfo_public.md)
- [GetResourceAllocationInfo1 (XBOX Series 主機)](/zh-TW/reference/graphics/d3d12/interfaces/id3d12device4/methods/id3d12device4_getresourceallocationinfo1_public.md)
- [NDA 主題目錄 - Microsoft Learn 線上連結](/zh-TW/nda/nda-topic-directory.md)
