radv: fix TC-compat HTILE images with DST_OPTIMAL on the compute queue

This is probably rare but can happen if someone performs a depth-stencil
copy on the compute queue. This might work (untested by CTS) but it
looks more conservative to decompress before perfoming the operation.

Found by inspection.

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/8039>
This commit is contained in:
Samuel Pitoiset 2020-12-10 14:06:58 +01:00 committed by Marge Bot
parent 1c539b6484
commit f4f096805b

View file

@ -1764,6 +1764,11 @@ bool radv_layout_is_htile_compressed(const struct radv_image *image,
return true; return true;
} }
if ((layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL ||
layout == VK_IMAGE_LAYOUT_GENERAL) &&
(queue_mask & (1u << RADV_QUEUE_COMPUTE)))
return false;
return layout != VK_IMAGE_LAYOUT_GENERAL; return layout != VK_IMAGE_LAYOUT_GENERAL;
} }