isl: Set Depth to array len for 3D storage images

This is necessary for RESINFO to work properly.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21376>
This commit is contained in:
Faith Ekstrand 2023-02-28 11:16:06 -06:00 committed by Marge Bot
parent 74e6e207fe
commit 7e1b62ea5b

View file

@ -329,12 +329,32 @@ isl_genX(surf_fill_state_s)(const struct isl_device *dev, void *state,
s.RenderTargetViewExtent = s.Depth;
break;
case SURFTYPE_3D:
assert(info->view->base_array_layer + info->view->array_len <=
isl_minify(info->surf->logical_level0_px.depth,
info->view->base_level));
/* From the Broadwell PRM >> RENDER_SURFACE_STATE::Depth:
*
* If the volume texture is MIP-mapped, this field specifies the
* depth of the base MIP level.
*/
s.Depth = info->surf->logical_level0_px.depth - 1;
if (GFX_VER >= 9 && info->view->usage & ISL_SURF_USAGE_STORAGE_BIT) {
/* From the Kaby Lake docs for the RESINFO message:
*
* "Surface Type | ... | Blue
* --------------+-----+----------------
* SURFTYPE_3D | ... | (Depth+1)»LOD"
*
* which isn't actually what the Vulkan or D3D specs want for storage
* images. We want the requested array size. The good news is that,
* thanks to Skylake and later using the same image layout for 3D
* images as 2D array images, we should be able to adjust the depth
* without affecting the layout.
*/
s.Depth = (info->view->array_len << info->view->base_level) - 1;
} else {
s.Depth = info->surf->logical_level0_px.depth - 1;
}
/* From the Broadwell PRM >> RENDER_SURFACE_STATE::RenderTargetViewExtent:
*