RADV_FMASK_COMPRESSION_PARTIAL means the fmask is decompressed but not
expanded. It is desired for sampling when the cmask is not
TC-compatible.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21615>
if (layout == VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL && (queue_mask & (1u << RADV_QUEUE_COMPUTE)))
return RADV_FMASK_COMPRESSION_NONE;
+ if (layout == VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL ||
+ layout == VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL) {
+ return radv_image_is_tc_compat_cmask(image) ? RADV_FMASK_COMPRESSION_FULL :
+ RADV_FMASK_COMPRESSION_PARTIAL;
+ }
+
/* Only compress concurrent images if TC-compat CMASK is enabled (no FMASK decompression). */
return (queue_mask == (1u << RADV_QUEUE_GENERAL) || radv_image_is_tc_compat_cmask(image)) ?
RADV_FMASK_COMPRESSION_FULL : RADV_FMASK_COMPRESSION_NONE;
enum radv_fmask_compression {
RADV_FMASK_COMPRESSION_NONE,
+ RADV_FMASK_COMPRESSION_PARTIAL,
RADV_FMASK_COMPRESSION_FULL,
};