radv: try to keep HTILE compressed for READ_ONLY_OPTIMAL layout

It should be handled like DEPTH_STENCIL_READ_ONLY_OPTIMAL.

This fixes an issue with VRS attachment because HTILE was considered
disabled for READ_ONLY_OPTIMAL but there is no reasons to disable it
as long as the image is only used as a depth/stencil attachment.

Otherwise, when HTILE is disabled, VRS rates are ignored.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8675
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22468>
(cherry picked from commit f11a4a09b0)
This commit is contained in:
Samuel Pitoiset 2023-04-13 16:07:16 +02:00 committed by Dylan Baker
parent 4b0973d19e
commit b00921a8ff
2 changed files with 2 additions and 1 deletions

View file

@ -2844,7 +2844,7 @@
"description": "radv: try to keep HTILE compressed for READ_ONLY_OPTIMAL layout",
"nominated": true,
"nomination_type": 0,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": null,
"notes": null

View file

@ -2323,6 +2323,7 @@ radv_layout_is_htile_compressed(const struct radv_device *device, const struct r
*/
return false;
case VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL:
case VK_IMAGE_LAYOUT_READ_ONLY_OPTIMAL:
if (radv_image_is_tc_compat_htile(image) ||
(radv_image_has_htile(image) &&
!(image->vk.usage & (VK_IMAGE_USAGE_SAMPLED_BIT |