From a527f3ff236e07961b851dc5359f7218e11bcbb3 Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Fri, 8 Nov 2024 17:40:02 +0000 Subject: [PATCH] nir/opt_move_discards_to_top: use nir_tex_instr_has_implicit_derivative Signed-off-by: Rhys Perry Reviewed-by: Alyssa Rosenzweig Reviewed-by: Georg Lehmann Fixes: 48158636bf1b ("nir: add is_gather_implicit_lod") Part-of: (cherry picked from commit 8bbc8284d940324d8f71fe29bee3d23bd1f0ab6f) --- .pick_status.json | 2 +- src/compiler/nir/nir_opt_move_discards_to_top.c | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 0b03aab26aa..548434c1124 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -184,7 +184,7 @@ "description": "nir/opt_move_discards_to_top: use nir_tex_instr_has_implicit_derivative", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "48158636bf1b0e62ebab4835e1f474866a34c6fe", "notes": null diff --git a/src/compiler/nir/nir_opt_move_discards_to_top.c b/src/compiler/nir/nir_opt_move_discards_to_top.c index 80531d5dc58..b36febbb4ba 100644 --- a/src/compiler/nir/nir_opt_move_discards_to_top.c +++ b/src/compiler/nir/nir_opt_move_discards_to_top.c @@ -26,13 +26,6 @@ #include "nir_control_flow.h" #include "nir_worklist.h" -static bool -nir_texop_implies_derivative(nir_texop op) -{ - return op == nir_texop_tex || - op == nir_texop_txb || - op == nir_texop_lod; -} #define MOVE_INSTR_FLAG 1 #define STOP_PROCESSING_INSTR_FLAG 2 @@ -149,7 +142,7 @@ opt_move_discards_to_top_impl(nir_function_impl *impl) case nir_instr_type_tex: { nir_tex_instr *tex = nir_instr_as_tex(instr); - if (nir_texop_implies_derivative(tex->op)) + if (nir_tex_instr_has_implicit_derivative(tex)) consider_discards = false; continue; }