From 61d6cbf7aae486bd48e4adee676e141cd6577bf5 Mon Sep 17 00:00:00 2001 From: Connor Abbott Date: Tue, 14 Nov 2023 16:20:03 +0100 Subject: [PATCH] tu: Fix passthrough D24S8 attachments We need to make sure that we don't trash a passthrough depth/stencil aspect if we need to store the whole attachment by loading it beforehand. Fixes: cb0f414b ("tu: Add support for suspending and resuming renderpasses") Part-of: (cherry picked from commit 5377219ca0ff3388cc8fda2bb1425131bf31019d) --- .pick_status.json | 2 +- src/freedreno/vulkan/tu_pass.cc | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 76cb3fdb10d..9e81e1a4cf2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -1184,7 +1184,7 @@ "description": "tu: Fix passthrough D24S8 attachments", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "cb0f414b2aed88f48b2593dad833844be2f5f42b", "notes": null diff --git a/src/freedreno/vulkan/tu_pass.cc b/src/freedreno/vulkan/tu_pass.cc index cb18611d88e..c813e9063e5 100644 --- a/src/freedreno/vulkan/tu_pass.cc +++ b/src/freedreno/vulkan/tu_pass.cc @@ -726,6 +726,15 @@ attachment_set_ops(struct tu_device *device, att->load = true; if (stencil_store) att->store = true; + /* If depth or stencil is passthrough (STORE_OP_NONE), then we need to + * preserve the contents when storing by loading even if neither + * component needs to be loaded. + */ + if ((store_op == VK_ATTACHMENT_STORE_OP_NONE_EXT || + stencil_store_op == VK_ATTACHMENT_STORE_OP_NONE_EXT) && + att->store) { + att->load = true; + } break; case VK_FORMAT_S8_UINT: /* replace load/store with stencil load/store */ att->clear_mask = stencil_clear ? VK_IMAGE_ASPECT_COLOR_BIT : 0;