d3d/archive/D3D11_3_FunctionalSpec.htm [5618:5736]: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
// -------------------------------------------------------------------------------------------------------------------------------- // GetResourceTiling // -------------------------------------------------------------------------------------------------------------------------------- // GetResourceTiling retrieves information about how a Tiled Resource is broken into tiles. // typedef struct D3D11_SUBRESOURCE_TILING { // Each packed mip is individually reported as 0 for WidthInTiles, HeightInTiles and DepthInTiles. UINT WidthInTiles; UINT HeightInTiles; UINT DepthInTiles; // Total number of tiles in subresources is WidthInTiles*HeightInTiles*DepthInTiles UINT StartTileIndexInOverallResource; }; // D3D11_PACKED_TILE is filled into D3D11_SUBRESOURCE_TILING.StartTileIndexInOverallResource // for packed mip levels, signifying that this entire struct is meaningless (WidthInTiles, HeightInTiles, // DepthInTiles are also al set to 0). // For packed tiles, the description of the packed mips comes from D3D11_PACKED_MIP_DESC instead. const UINT D3D11_PACKED_TILE = 0xffffffff; typedef struct D3D11_TILE_SHAPE { UINT WidthInTexels; UINT HeightInTexels; UINT DepthInTexels; // Texels are equivalent to pixels. For untyped Buffer resources, a texel is just a byte. // For MSAA surfaces the numbers are still in terms of pixels/texels. // The values here are independent of the surface dimensions. Even if the surface is // smaller than what would fit in a tile, the full tile dimensions are reported here. }; typedef struct D3D11_PACKED_MIP_DESC { UINT NumPackedMips; // How many mips starting from the least detailed mip are packed (either // sharing tiles or using non standard tile layout). 0 if there no // such packing in the resource. For array surfaces this value is how many // mips are packed for a given array slice - each array slice repeats the same // packing. // Mipmaps that fill at least one standard shaped tile in all dimensions // are not allowed to be included in the set of packed mips. Mips with at least one // dimension less than the standard tile shape may or may not be packed, // depending on the IHV. Once a given mip needs to be packed, all coarser // mips for a given array slice are considered packed as well. UINT NumTilesForPackedMips; // If there is no packing this value is meaningless and returns 0. // Otherwise it returns how many tiles // are needed to represent the set of packed mips. // The pixel layout within the packed mips is hardware specific. // If applications define only partial mappings for the set // of tiles in packed mip(s), read/write behavior will be // IHV specific and undefined. // For arrays this only returns the count of packed mips within // the subresources for each array slice. UINT StartTileIndexInOverallResource; // Offset of the first packed tile for the resource // in the overall range of tiles. If NumPackedMips is 0, this // value is meaningless and returns 0. Otherwise it returns the // offset of the first packed tile for the resource in the overall // range of tiles for the resource. A return of 0 for // StartTileIndexInOverallResourcein means the entire resource is packed. // For array surfaces this is the offset for the tiles containing the packed // mips for the first array slice. // Packed mips for each array slice in arrayed surfaces are at this offset // past the beginning of the tiles for each array slice. (Note the // number of overall tiles, packed or not, for a given array slice is // simply the total number of tiles for the resource divided by the // resource's array size, so it is easy to locate the range of tiles for // any given array slice, out of which StartTileIndexInOverallResource identifies // which of those are packed.) }; void ID3D11Device2:: GetResourceTiling( _In_ ID3D11Resource* pTiledResource, _Out_opt_ UINT* pNumTilesForEntireResource, // Total number of tiles needed to store the resource _Out_opt_ D3D11_PACKED_MIP_DESC* pPackedMipDesc, // Mip packing details _Out_opt_ D3D11_TILE_SHAPE* pTileShape, // How pixels fit in tiles, independent of surface dimensions, // not including packed mip(s). If the entire surface is packed, // this parameter is meaningless since there is no defined layout // for packed mips. In this case the returned fields are set to 0. _Inout_opt_ UINT* pNumSubresourceTilings, // IN: how many subresources to query tilings for, // OUT: returns how many retrieved (clamped to what's available) _In_ UINT FirstSubresourceTilingToGet, // ignored if *pNumSubresourceTilings is 0, _Out_writes_(*pNumSubresourceTilings) D3D11_SUBRESOURCE_TILING* pSubresourceTilings, // Subresources that // are part of packed mips return 0 for all of the fields in // the corresponding output, except StartTileIndexInOverallResource which is // set to D3D11_PACKED_TILE (0xffffffff) - basically indicating the whole // struct is meaningless for this case and pPackedMipDesc applies. ); // -------------------------------------------------------------------------------------------------------------------------------- // CheckMultisampleQualityLevels1 // -------------------------------------------------------------------------------------------------------------------------------- // CheckMultisampleQualityLevel1 is a variant of the existing CheckMultisampleQualityLevels API that adds a flags field that // allows the caller to indicate the query is for a tiled resource. This allows drivers to report multisample quality levels // for tiled resources differently than non-Tiled resources. // // As with non-tiled Resources, when Multisampling is supported/required for a given format, applications are guaranteed to // be able to use the standard or center multisample patterns instead of using one of the driver quality levels. // typedef enum D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAGS { D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_TILED_RESOURCE = 0x00000001, }; HRESULT ID3D11Device2:: CheckMultisampleQualityLevels1( _In_ DXGI_FORMAT Format, _In_ UINT SampleCount, _In_ UINT Flags, // D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAGS _Out_ UINT *pNumQualityLevels);
// -------------------------------------------------------------------------------------------------------------------------------- // GetResourceTiling // -------------------------------------------------------------------------------------------------------------------------------- // GetResourceTiling retrieves information about how a Tiled Resource is broken into tiles. // typedef struct D3D11_SUBRESOURCE_TILING { // Each packed mip is individually reported as 0 for WidthInTiles, HeightInTiles and DepthInTiles. UINT WidthInTiles; UINT HeightInTiles; UINT DepthInTiles; // Total number of tiles in subresources is WidthInTiles*HeightInTiles*DepthInTiles UINT StartTileIndexInOverallResource; }; // D3D11_PACKED_TILE is filled into D3D11_SUBRESOURCE_TILING.StartTileIndexInOverallResource // for packed mip levels, signifying that this entire struct is meaningless (WidthInTiles, HeightInTiles, // DepthInTiles are also al set to 0). // For packed tiles, the description of the packed mips comes from D3D11_PACKED_MIP_DESC instead. const UINT D3D11_PACKED_TILE = 0xffffffff; typedef struct D3D11_TILE_SHAPE { UINT WidthInTexels; UINT HeightInTexels; UINT DepthInTexels; // Texels are equivalent to pixels. For untyped Buffer resources, a texel is just a byte. // For MSAA surfaces the numbers are still in terms of pixels/texels. // The values here are independent of the surface dimensions. Even if the surface is // smaller than what would fit in a tile, the full tile dimensions are reported here. }; typedef struct D3D11_PACKED_MIP_DESC { UINT NumPackedMips; // How many mips starting from the least detailed mip are packed (either // sharing tiles or using non standard tile layout). 0 if there no // such packing in the resource. For array surfaces this value is how many // mips are packed for a given array slice - each array slice repeats the same // packing. // Mipmaps that fill at least one standard shaped tile in all dimensions // are not allowed to be included in the set of packed mips. Mips with at least one // dimension less than the standard tile shape may or may not be packed, // depending on the IHV. Once a given mip needs to be packed, all coarser // mips for a given array slice are considered packed as well. UINT NumTilesForPackedMips; // If there is no packing this value is meaningless and returns 0. // Otherwise it returns how many tiles // are needed to represent the set of packed mips. // The pixel layout within the packed mips is hardware specific. // If applications define only partial mappings for the set // of tiles in packed mip(s), read/write behavior will be // IHV specific and undefined. // For arrays this only returns the count of packed mips within // the subresources for each array slice. UINT StartTileIndexInOverallResource; // Offset of the first packed tile for the resource // in the overall range of tiles. If NumPackedMips is 0, this // value is meaningless and returns 0. Otherwise it returns the // offset of the first packed tile for the resource in the overall // range of tiles for the resource. A return of 0 for // StartTileIndexInOverallResourcein means the entire resource is packed. // For array surfaces this is the offset for the tiles containing the packed // mips for the first array slice. // Packed mips for each array slice in arrayed surfaces are at this offset // past the beginning of the tiles for each array slice. (Note the // number of overall tiles, packed or not, for a given array slice is // simply the total number of tiles for the resource divided by the // resource's array size, so it is easy to locate the range of tiles for // any given array slice, out of which StartTileIndexInOverallResource identifies // which of those are packed.) }; void ID3D11Device2:: GetResourceTiling( _In_ ID3D11Resource* pTiledResource, _Out_opt_ UINT* pNumTilesForEntireResource, // Total number of tiles needed to store the resource _Out_opt_ D3D11_PACKED_MIP_DESC* pPackedMipDesc, // Mip packing details _Out_opt_ D3D11_TILE_SHAPE* pTileShape, // How pixels fit in tiles, independent of surface dimensions, // not including packed mip(s). If the entire surface is packed, // this parameter is meaningless since there is no defined layout // for packed mips. In this case the returned fields are set to 0. _Inout_opt_ UINT* pNumSubresourceTilings, // IN: how many subresources to query tilings for, // OUT: returns how many retrieved (clamped to what's available) _In_ UINT FirstSubresourceTilingToGet, // ignored if *pNumSubresourceTilings is 0, _Out_writes_(*pNumSubresourceTilings) D3D11_SUBRESOURCE_TILING* pSubresourceTilings, // Subresources that // are part of packed mips return 0 for all of the fields in // the corresponding output, except StartTileIndexInOverallResource which is // set to D3D11_PACKED_TILE (0xffffffff) - basically indicating the whole // struct is meaningless for this case and pPackedMipDesc applies. ); // -------------------------------------------------------------------------------------------------------------------------------- // CheckMultisampleQualityLevels1 // -------------------------------------------------------------------------------------------------------------------------------- // CheckMultisampleQualityLevel1 is a variant of the existing CheckMultisampleQualityLevels API that adds a flags field that // allows the caller to indicate the query is for a tiled resource. This allows drivers to report multisample quality levels // for tiled resources differently than non-Tiled resources. // // As with non-tiled Resources, when Multisampling is supported/required for a given format, applications are guaranteed to // be able to use the standard or center multisample patterns instead of using one of the driver quality levels. // typedef enum D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAGS { D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_TILED_RESOURCE = 0x00000001, }; HRESULT ID3D11Device2:: CheckMultisampleQualityLevels1( _In_ DXGI_FORMAT Format, _In_ UINT SampleCount, _In_ UINT Flags, // D3D11_CHECK_MULTISAMPLE_QUALITY_LEVELS_FLAGS _Out_ UINT *pNumQualityLevels);