nir/opt_move_discards_to_top: use nir_tex_instr_has_implicit_derivative

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 48158636bf ("nir: add is_gather_implicit_lod")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32145>
(cherry picked from commit 8bbc8284d9)
This commit is contained in:
Rhys Perry 2024-11-08 17:40:02 +00:00 committed by Dylan Baker
parent 5a60f9965d
commit a527f3ff23
2 changed files with 2 additions and 9 deletions

View file

@ -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

View file

@ -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;
}