Mesa (master): radv: enable FMASK for color attachments only

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 28 15:58:16 UTC 2020


Module: Mesa
Branch: master
Commit: 523e9603d3fba507be9fe9a70a24edfd0a41792b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=523e9603d3fba507be9fe9a70a24edfd0a41792b

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Tue Apr 28 10:08:17 2020 +0200

radv: enable FMASK for color attachments only

The reason behind this is that FMASK requires CMASK and also that
FMASK for non color attachments looks unnecessary. It's currently
much easier to add this simple check because the driver tries to
always enable DCC first and if we enable FMASK only if CMASK, we
might loose some FMASK compressions.

This helps fixing some new robustness2 tests which fails because
only FMASK is enabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4783>

---

 src/amd/vulkan/radv_image.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index f6b0ba0e09a..7bfd34041cd 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -1331,7 +1331,8 @@ radv_image_can_enable_cmask(struct radv_image *image)
 static inline bool
 radv_image_can_enable_fmask(struct radv_image *image)
 {
-	return image->info.samples > 1 && vk_format_is_color(image->vk_format);
+	return image->info.samples > 1 &&
+	       image->usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT;
 }
 
 static inline bool



More information about the mesa-commit mailing list