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

# D3D12_TILE_REGION_SIZE

> 描述平铺区域的大小。(D3D12_TILE_REGION_SIZE)

描述平铺区域的大小。

## 语法

```cpp theme={null}
typedef struct D3D12_TILE_REGION_SIZE
{
    UINT NumTiles;
    BOOL UseBox;
    UINT Width;
    UINT16 Height;
    UINT16 Depth;
} D3D12_TILE_REGION_SIZE
```

### 成员

*NumTiles*\
类型：UINT

平铺区域中的图块数量。

*UseBox*\
类型：BOOL

指定运行时是否使用 **Width**、**Height** 和 **Depth** 成员来定义该区域。

如果为 **TRUE**，运行时将使用 **Width**、**Height** 和 **Depth** 成员来定义区域。在这种情况下，**NumTiles** 应等于 **Width** \* **Height** \* **Depth**。

如果为 **FALSE**，运行时将忽略 **Width**、**Height** 和 **Depth** 成员，并使用 **NumTiles** 成员按 x、y、z（如适用）的顺序线性遍历资源中的图块，然后按子资源顺序溢出到 mipmap/数组。例如，可使用此技术一次映射整个资源。

无论 **UseBox** 指定为 **TRUE** 还是 **FALSE**，都需使用 [D3D12\_TILED\_RESOURCE\_COORDINATE](/reference/graphics/d3d12/structs/d3d12_tiled_resource_coordinate_public) 结构，通过 x、y 和 z 坐标作为该结构之外的独立参数来指定区域在资源中的起始位置。

当区域包含使用非标准平铺打包的 mipmap 时，**UseBox** 必须为 **FALSE**，因为图块的尺寸不是标准的，应用程序只能知道每个数组切片的打包区域所占用的图块数量。在这种情况下，相应的（独立的）起始位置参数使用 x 来偏移到该情况下的扁平图块范围内，且 y 和 z 坐标必须均为 0。

*Width*\
类型：UINT

平铺区域的宽度（以图块为单位）。用于缓冲区以及 1D、2D 和 3D 纹理。

*Height*\
类型：UINT16

平铺区域的高度（以图块为单位）。用于 2D 和 3D 纹理。

*Depth*\
类型：UINT16

平铺区域的深度（以图块为单位）。用于 3D 纹理或数组。对于数组，用于按深度跳跃前进到相同 mipmap 大小的下一个切片，当存在多个 mipmap 时，这在子资源计数空间中并不连续。

## 备注

此结构由 [CopyTiles](/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_copytiles_public)、[CopyTileMappings](/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_copytilemappings_public) 和 [UpdateTileMappings](/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_updatetilemappings_public) 方法使用。

## 要求

**头文件：** d3d12\_xs.h 或 d3d12\_x.h\
**库：** d3d12\_xs.lib 或 d3d12\_x.lib\
**支持的平台**：XBOX Series 主机及 XBOX One 系列

## 另请参阅

[CD3DX12\_TILE\_REGION\_SIZE](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/cd3dx12-tile-region-size)

[核心结构](https://learn.microsoft.com/en-us/windows/desktop/direct3d12/direct3d-12-structures)


## Related topics

- [CopyTiles](/zh-CN/reference/graphics/d3d12/interfaces/id3d12graphicscommandlist/methods/id3d12graphicscommandlist_copytiles_public.md)
- [CopyTileMappings](/zh-CN/reference/graphics/d3d12/interfaces/id3d12commandqueue/methods/id3d12commandqueue_copytilemappings_public.md)
- [D3D12_TILE_SHAPE](/zh-CN/reference/graphics/d3d12/structs/d3d12_tile_shape_public.md)
- [D3D12_TILE_RANGE_FLAGS](/zh-CN/reference/graphics/d3d12/enums/d3d12_tile_range_flags_public.md)
- [D3D12_TILE_COPY_FLAGS](/zh-CN/reference/graphics/d3d12/enums/d3d12_tile_copy_flags_public.md)
