summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/compiler/nir/nir.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/compiler/nir/nir.c b/src/compiler/nir/nir.c
index ea28fbd1af..cfce6ab3dc 100644
--- a/src/compiler/nir/nir.c
+++ b/src/compiler/nir/nir.c
@@ -1374,6 +1374,20 @@ visit_tex_src(nir_tex_instr *instr, nir_foreach_src_cb cb, void *state)
}
static bool
+visit_call_src(nir_call_instr *instr, nir_foreach_src_cb cb, void *state)
+{
+ if (instr->return_deref && !visit_deref_src(instr->return_deref, cb, state))
+ return false;
+
+ for (unsigned i = 0; i < instr->num_params; i++) {
+ if (!visit_deref_src(instr->params[i], cb, state))
+ return false;
+ }
+
+ return true;
+}
+
+static bool
visit_intrinsic_src(nir_intrinsic_instr *instr, nir_foreach_src_cb cb,
void *state)
{
@@ -1449,7 +1463,8 @@ nir_foreach_src(nir_instr *instr, nir_foreach_src_cb cb, void *state)
return false;
break;
case nir_instr_type_call:
- /* Call instructions have no regular sources */
+ if (!visit_call_src(nir_instr_as_call(instr), cb, state))
+ return false;
break;
case nir_instr_type_load_const:
/* Constant load instructions have no regular sources */