summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2018-06-25 09:13:05 -0700
committerDylan Baker <dylan@pnwbakers.com>2018-06-26 08:40:30 -0700
commitbc67499bebc96c181cd983994a72f467c262d7eb (patch)
tree4e5892af56b12298cf3e98be35670bed3959e05a
parentd96eecbdd7f0f67a45c8a839a6757c4c6f2f507b (diff)
nir/validate: Use the type from the tail of call parameter derefs
Otherwise, if what gets passed into the function call is a deref chain longer than just a variable deref, we would use the type of the entire variable rather than the type of the thing being dereferenced. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106980 Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (Unique to 18.1)
-rw-r--r--src/compiler/nir/nir_validate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/compiler/nir/nir_validate.c b/src/compiler/nir/nir_validate.c
index eee737e806..4a60b7d70e 100644
--- a/src/compiler/nir/nir_validate.c
+++ b/src/compiler/nir/nir_validate.c
@@ -567,14 +567,16 @@ validate_call_instr(nir_call_instr *instr, validate_state *state)
if (instr->return_deref == NULL) {
validate_assert(state, glsl_type_is_void(instr->callee->return_type));
} else {
- validate_assert(state, instr->return_deref->deref.type == instr->callee->return_type);
+ validate_assert(state, instr->callee->return_type ==
+ nir_deref_tail(&instr->return_deref->deref)->type);
validate_deref_var(instr, instr->return_deref, state);
}
validate_assert(state, instr->num_params == instr->callee->num_params);
for (unsigned i = 0; i < instr->num_params; i++) {
- validate_assert(state, instr->callee->params[i].type == instr->params[i]->deref.type);
+ validate_assert(state, instr->callee->params[i].type ==
+ nir_deref_tail(&instr->params[i]->deref)->type);
validate_deref_var(instr, instr->params[i], state);
}
}