radv: do not enable TC-compat CMASK if the image isn't readable by a shader

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9415>
This commit is contained in:
Samuel Pitoiset 2021-01-19 14:00:15 +01:00 committed by Marge Bot
parent fb648634b0
commit d173ed2e9c
1 changed files with 8 additions and 0 deletions

View File

@ -273,6 +273,14 @@ radv_use_tc_compat_cmask_for_image(struct radv_device *device,
if (image->usage & VK_IMAGE_USAGE_STORAGE_BIT)
return false;
/* Do not enable TC-compatible if the image isn't readable by a shader
* because no texture fetches will happen.
*/
if (!(image->usage & (VK_IMAGE_USAGE_SAMPLED_BIT |
VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT |
VK_IMAGE_USAGE_TRANSFER_SRC_BIT)))
return false;
if (radv_image_has_dcc(image))
return false;