summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_opt_constant_folding.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/compiler/nir/nir_opt_constant_folding.c')
-rw-r--r--src/compiler/nir/nir_opt_constant_folding.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_opt_constant_folding.c b/src/compiler/nir/nir_opt_constant_folding.c
index 20b31a8110c..04876a42fd7 100644
--- a/src/compiler/nir/nir_opt_constant_folding.c
+++ b/src/compiler/nir/nir_opt_constant_folding.c
@@ -136,10 +136,15 @@ constant_fold_intrinsic_instr(nir_intrinsic_instr *instr)
static bool
constant_fold_tex_instr(nir_tex_instr *instr)
{
+ bool progress = false;
+
if (instr->texture)
- return constant_fold_deref(&instr->instr, instr->texture);
- else
- return false;
+ progress |= constant_fold_deref(&instr->instr, instr->texture);
+
+ if (instr->sampler)
+ progress |= constant_fold_deref(&instr->instr, instr->sampler);
+
+ return progress;
}
static bool