summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_gcm.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-06-07 17:58:15 -0500
committerJason Ekstrand <[email protected]>2019-07-23 13:40:41 -0500
commit0e6cb481fa203573bd1e27cea1f314b842b72e9c (patch)
treee1417757688c5e5a29496568a45908c31e271d0f /src/compiler/nir/nir_opt_gcm.c
parent7a98c7804c012b17e86a10d425b9dfa0dfd319b1 (diff)
nir: Add a nir_tex_instr_has_implicit_derivatives helper
Reviewed-by: Alyssa Rosenzweig <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_opt_gcm.c')
-rw-r--r--src/compiler/nir/nir_opt_gcm.c12
1 files changed, 1 insertions, 11 deletions
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: