From 76fbca6000bb3884d821a59f55852885d92ee8fd Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Mon, 23 Mar 2026 14:01:57 -0400 Subject: [PATCH] tu: Fix LRZ+FDM offset+secondaries As the comment says, we need to have an image view in order to disable LRZ so that secondaries know it's disabled. Noticed by inspection. Cc: mesa-stable (cherry picked from commit f590e46b9d72c32231feaee36ca64ee6866413fe) Part-of: --- .pick_status.json | 2 +- src/freedreno/vulkan/tu_lrz.cc | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index aebd648ced7..901c2f0aebf 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1344,7 +1344,7 @@ "description": "tu: Fix LRZ+FDM offset+secondaries", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/freedreno/vulkan/tu_lrz.cc b/src/freedreno/vulkan/tu_lrz.cc index 681e71debb5..ec42f5a598c 100644 --- a/src/freedreno/vulkan/tu_lrz.cc +++ b/src/freedreno/vulkan/tu_lrz.cc @@ -229,14 +229,6 @@ tu_lrz_init_state(struct tu_cmd_buffer *cmd, if (!has_gpu_tracking && !clears_depth) return; - /* Reusing previous state doesn't work with FDM offset because the LRZ - * image is offsetted. - */ - if ((view->image->vk.create_flags & - VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_EXT) && - !clears_depth) - return; - /* We need to always have an LRZ view just to disable it if there is a * depth attachment, there are any secondaries, and GPU tracking is * enabled, in order not to rely on loadOp state which doesn't exist with @@ -246,6 +238,14 @@ tu_lrz_init_state(struct tu_cmd_buffer *cmd, cmd->state.lrz.image_view = view; cmd->state.lrz.store = att->store; + /* Reusing previous state doesn't work with FDM offset because the LRZ + * image is offsetted. + */ + if ((view->image->vk.create_flags & + VK_IMAGE_CREATE_FRAGMENT_DENSITY_MAP_OFFSET_BIT_EXT) && + !clears_depth) + return; + if (!clears_depth && !att->load) return;