diff --git a/src/amd/vulkan/meta/radv_meta_fast_clear.c b/src/amd/vulkan/meta/radv_meta_fast_clear.c index 2db318b9a0d..47046970568 100644 --- a/src/amd/vulkan/meta/radv_meta_fast_clear.c +++ b/src/amd/vulkan/meta/radv_meta_fast_clear.c @@ -441,20 +441,25 @@ void radv_fast_clear_flush_image_inplace(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, const VkImageSubresourceRange *subresourceRange) { - if (radv_image_has_fmask(image) && !image->tc_compatible_cmask) { - if (radv_image_has_dcc(image) && radv_image_has_cmask(image) && !image->support_comp_to_single) { - /* MSAA images with DCC and CMASK might have been fast-cleared and might require a FCE but - * FMASK_DECOMPRESS can't eliminate DCC fast clears. - */ + /* FMASK_DECOMPRESS is only required for MSAA images that don't support TC-compat CMASK. */ + const bool needs_fmask_decompress = radv_image_has_fmask(image) && !image->tc_compatible_cmask; + + /* FCE is only required for color images that don't support comp-to-single fast clears. */ + const bool needs_fce = !image->support_comp_to_single; + + if (needs_fmask_decompress) { + /* MSAA images with DCC and CMASK might have been fast-cleared and might require a FCE but + * FMASK_DECOMPRESS can't eliminate DCC fast clears. Only GFX10 is affected because it has few + * restrictions related to comp-to-single. + */ + const bool needs_dcc_fce = + radv_image_has_dcc(image) && radv_image_has_cmask(image) && !image->support_comp_to_single; + + if (needs_dcc_fce) radv_fast_clear_eliminate(cmd_buffer, image, subresourceRange); - } radv_fmask_decompress(cmd_buffer, image, subresourceRange); - } else { - /* Skip fast clear eliminate for images that support comp-to-single fast clears. */ - if (image->support_comp_to_single) - return; - + } else if (needs_fce) { radv_fast_clear_eliminate(cmd_buffer, image, subresourceRange); } }