From ee4b192b19429bd49f82ef08d3287357f5d48c44 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 19 Sep 2022 15:11:24 -0700 Subject: [PATCH] turnip: Fix the "written stencil is unmodified" check. We want to know if anything writes stencil, not if all of them do. Fixes: b2a60c157e4d ("turnip: add LRZ early-z support") Part-of: (cherry picked from commit b9f9bfa5560a0d5e8a8bf71a146ffd11f1196173) --- .pick_status.json | 2 +- src/freedreno/vulkan/tu_cmd_buffer.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index ffd53cb72c2..bf7bc39baf1 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -2551,7 +2551,7 @@ "description": "turnip: Fix the \"written stencil is unmodified\" check.", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b2a60c157e4d6cc62c55d8fe8777f7cbd548a722" }, diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index b6eea06aa07..32a57c4f6e5 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -4273,13 +4273,13 @@ tu6_writes_stencil(struct tu_cmd_buffer *cmd) (cmd->state.rb_stencil_cntl & A6XX_RB_STENCIL_CONTROL_ZFAIL_BF__MASK) >> A6XX_RB_STENCIL_CONTROL_ZFAIL_BF__SHIFT; bool stencil_front_op_writes = - front_pass_op != VK_STENCIL_OP_KEEP && - front_fail_op != VK_STENCIL_OP_KEEP && + front_pass_op != VK_STENCIL_OP_KEEP || + front_fail_op != VK_STENCIL_OP_KEEP || front_depth_fail_op != VK_STENCIL_OP_KEEP; bool stencil_back_op_writes = - back_pass_op != VK_STENCIL_OP_KEEP && - back_fail_op != VK_STENCIL_OP_KEEP && + back_pass_op != VK_STENCIL_OP_KEEP || + back_fail_op != VK_STENCIL_OP_KEEP || back_depth_fail_op != VK_STENCIL_OP_KEEP; return stencil_test_enable &&