How a streaming resource's area is tiled
When you create a streaming resource, the dimensions, format element size, and number of mipmaps and/or array slices (if applicable) determine the number of tiles that are required to back the entire surface area. The pixel/byte layout within tiles is determined by the implementation. The number of pixels that fit in a tile, depending on the format element size, is fixed and identical whether you use a standard swizzle or not.
The number of tiles that will be used by a given surface size and format element width is well defined and predictable based on the tables in the following sections. For resources that contain mipmaps or cases where surface dimensions don't fill a tile, some constraints exist; see Mipmap packing.
Different streaming resources can point to identical memory with different formats as long as applications don't rely on the results of writing to the memory with one format and reading with another. But applications can rely on the results of writing to the memory with one format and reading with another if the formats are in the same format family (that is, they have the same typeless parent format). For example, DXGI_FORMAT_R8G8B8A8_UNORM and DXGI_FORMAT_R8G8B8A8_UINT are compatible with each other but not with DXGI_FORMAT_R16G16_UNORM.
An exception is where bleeding data from one format aliasing to another is well defined: if a tile completely contains 0 for all its bits, that tile can be used with any format that interprets those memory contents as 0 (regardless of memory layout). So, a tile could be cleared to 0x00 with the format DXGI_FORMAT_R8_UNORM and then used with a format like DXGI_FORMAT_R32G32_FLOAT and it would appear the contents are still (0.0f,0.0f).
The layout of data within a tile doesn't depend on where the tile is mapped in a resource overall. So, for example, a tile can be reused in different locations of a surface at once with consistent behavior in all locations.
In this section
Topic | Description |
---|---|
These tables show how Texture2D and Texture2DArray subresources are tiled. |
|
This table shows how Texture3D subresources are tiled. |
|
A Buffer resource is divided into 64KB tiles, with some empty space in the last tile if the size is not a multiple of 64KB. |
|
Some number of mips (per array slice) can be packed into some number of tiles, depending on a streaming resource's dimensions, format, number of mipmaps, and array slices. |
Related topics