nir: Hoist nir_op_is_derivative
Redefine in terms of the algebraic property. This correctly handles the Mali-specific derivatives. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Reviewed-by: Daniel Schürmann <daniel@schuermann.dev> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24833>
This commit is contained in:
@@ -1432,6 +1432,12 @@ nir_op_is_selection(nir_op op)
|
||||
return (nir_op_infos[op].algebraic_properties & NIR_OP_IS_SELECTION) != 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
nir_op_is_derivative(nir_op op)
|
||||
{
|
||||
return (nir_op_infos[op].algebraic_properties & NIR_OP_IS_DERIVATIVE) != 0;
|
||||
}
|
||||
|
||||
typedef struct nir_alu_instr {
|
||||
/** Base instruction */
|
||||
nir_instr instr;
|
||||
|
@@ -26,17 +26,6 @@
|
||||
#include "nir_control_flow.h"
|
||||
#include "nir_worklist.h"
|
||||
|
||||
static bool
|
||||
nir_op_is_derivative(nir_op op)
|
||||
{
|
||||
return op == nir_op_fddx ||
|
||||
op == nir_op_fddy ||
|
||||
op == nir_op_fddx_fine ||
|
||||
op == nir_op_fddy_fine ||
|
||||
op == nir_op_fddx_coarse ||
|
||||
op == nir_op_fddy_coarse;
|
||||
}
|
||||
|
||||
static bool
|
||||
nir_texop_implies_derivative(nir_texop op)
|
||||
{
|
||||
|
Reference in New Issue
Block a user