From 4a30a28653b744cb29b08c052cac594f23d53132 Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 28 May 2024 14:20:00 +0200 Subject: [PATCH] panvk: Fix depth-stencil AFBC support When both the depth and stencil attachments are enabled, and the underlying image is AFBC, it must be an combined Z24S8 format. Make sure this is the case when initializing the fbinfo object. Signed-off-by: Boris Brezillon Reviewed-by: Mary Guillemard Part-of: --- src/panfrost/vulkan/jm/panvk_vX_cmd_draw.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/panfrost/vulkan/jm/panvk_vX_cmd_draw.c b/src/panfrost/vulkan/jm/panvk_vX_cmd_draw.c index 3722ec26fea..b5164b937bb 100644 --- a/src/panfrost/vulkan/jm/panvk_vX_cmd_draw.c +++ b/src/panfrost/vulkan/jm/panvk_vX_cmd_draw.c @@ -1579,6 +1579,15 @@ panvk_cmd_begin_rendering_init_state(struct panvk_cmd_buffer *cmdbuf, cmdbuf->state.gfx.render.fb .bos[cmdbuf->state.gfx.render.fb.bo_count++] = img->bo; + + if (drm_is_afbc(img->pimage.layout.modifier)) { + assert(fbinfo->zs.view.zs == &iview->pview || !fbinfo->zs.view.zs); + fbinfo->zs.view.zs = &iview->pview; + } else { + fbinfo->zs.view.s = + &iview->pview != fbinfo->zs.view.zs ? &iview->pview : NULL; + } + fbinfo->zs.view.s = &iview->pview != fbinfo->zs.view.zs ? &iview->pview : NULL; fbinfo->nr_samples = MAX2(