Module: Mesa
Branch: main
Commit: 1714f7aff4457d8c03bdcee2d77e175d7354c74c
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=1714f7aff4457d8c03bdcee2d77e175d7354c74c

Author: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Date:   Thu Dec 14 17:54:43 2023 +0100

radv: disable FMASK for MSAA images with layers on GFX9

It seems that FMASK can be interleaved and RADV doesn't support this
properly, so let's disable it.

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26634>

---

 src/amd/vulkan/radv_image.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index 92eceb8fa12..cb86bb192a0 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -348,6 +348,11 @@ radv_image_use_dcc_predication(const struct radv_device 
*device, const struct ra
 static inline bool
 radv_use_fmask_for_image(const struct radv_device *device, const struct 
radv_image *image)
 {
+   if (device->physical_device->rad_info.gfx_level == GFX9 && 
image->vk.array_layers > 1) {
+      /* On GFX9, FMASK can be interleaved with layers and this isn't properly 
supported. */
+      return false;
+   }
+
    return device->physical_device->use_fmask && image->vk.samples > 1 &&
           ((image->vk.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) ||
            (device->instance->debug_flags & RADV_DEBUG_FORCE_COMPRESS));

Reply via email to