anv: limit to default fast clear color when image used for transfer

v2: use vk_image_layout_to_usage_flags for detecting
    transfer usage (Nanley)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7189
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18836>
This commit is contained in:
Tapani Pälli
2022-09-27 08:42:13 +03:00
committed by Marge Bot
parent 35c40c64c8
commit 60be71aeaa
+9
View File
@@ -2371,6 +2371,9 @@ anv_layout_to_fast_clear_type(const struct intel_device_info * const devinfo,
enum isl_aux_state aux_state =
anv_layout_to_aux_state(devinfo, image, aspect, layout);
const VkImageUsageFlags layout_usage =
vk_image_layout_to_usage_flags(layout, aspect);
switch (aux_state) {
case ISL_AUX_STATE_CLEAR:
unreachable("We never use this state");
@@ -2389,6 +2392,12 @@ anv_layout_to_fast_clear_type(const struct intel_device_info * const devinfo,
* must get partially resolved before we leave the render pass.
*/
return ANV_FAST_CLEAR_ANY;
} else if (layout_usage & (VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
/* Fast clear with non zero color is not supported during transfer
* operations since transfer may do format reinterpretation.
*/
return ANV_FAST_CLEAR_DEFAULT_VALUE;
} else if (image->planes[plane].aux_usage == ISL_AUX_USAGE_MCS ||
image->planes[plane].aux_usage == ISL_AUX_USAGE_CCS_E) {
if (devinfo->ver >= 11) {