From: Chia-I Wu Date: Tue, 7 Mar 2023 22:07:35 +0000 (-0800) Subject: radv: add RADV_FMASK_COMPRESSION_PARTIAL X-Git-Tag: upstream/23.3.3~10446 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bd5fb29db6c1f338fdb8f1e3cc9bc2a1bf5e90a8;p=platform%2Fupstream%2Fmesa.git radv: add RADV_FMASK_COMPRESSION_PARTIAL 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: --- diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 4de96af..7a6bcbe 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -2465,6 +2465,12 @@ radv_layout_fmask_compression(const struct radv_device *device, const struct rad 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; diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index cc1fb63..d3d68a6 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -2549,6 +2549,7 @@ bool radv_layout_dcc_compressed(const struct radv_device *device, const struct r enum radv_fmask_compression { RADV_FMASK_COMPRESSION_NONE, + RADV_FMASK_COMPRESSION_PARTIAL, RADV_FMASK_COMPRESSION_FULL, };