diff options
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir.h | 13 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_gcm.c | 12 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index c6c9e2b5347..e224f03ea99 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -1783,6 +1783,19 @@ nir_tex_instr_is_query(const nir_tex_instr *instr) } } +static inline bool +nir_tex_instr_has_implicit_derivative(const nir_tex_instr *instr) +{ + switch (instr->op) { + case nir_texop_tex: + case nir_texop_txb: + case nir_texop_lod: + return true; + default: + return false; + } +} + static inline nir_alu_type nir_tex_instr_src_type(const nir_tex_instr *instr, unsigned src) { diff --git a/src/compiler/nir/nir_opt_gcm.c b/src/compiler/nir/nir_opt_gcm.c index aeae2ad6401..eb8b9ee6583 100644 --- a/src/compiler/nir/nir_opt_gcm.c +++ b/src/compiler/nir/nir_opt_gcm.c @@ -133,18 +133,8 @@ gcm_pin_instructions_block(nir_block *block, struct gcm_state *state) break; case nir_instr_type_tex: - switch (nir_instr_as_tex(instr)->op) { - case nir_texop_tex: - case nir_texop_txb: - case nir_texop_lod: - /* These two take implicit derivatives so they need to be pinned */ + if (nir_tex_instr_has_implicit_derivative(nir_instr_as_tex(instr))) instr->pass_flags = GCM_INSTR_PINNED; - break; - - default: - instr->pass_flags = 0; - break; - } break; case nir_instr_type_load_const: |