aboutsummaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_deref.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-11-19 08:26:54 +1000
committerDave Airlie <[email protected]>2019-11-22 04:37:41 +1000
commitcce07ea83523a8e6b0924fdc9a09050600a3e8bf (patch)
treefb41e8556bb2257ee74f238d61804ef97d6daae7 /src/compiler/nir/nir_deref.c
parent7325f6ac987d295b101372bffcb98799251fe678 (diff)
nir: fix deref offset builder
Use the correct bit size Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir_deref.c')
-rw-r--r--src/compiler/nir/nir_deref.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 74dd776aed6..f8b48946cff 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -292,7 +292,7 @@ nir_build_deref_offset(nir_builder *b, nir_deref_instr *deref,
assert(path.path[0]->deref_type == nir_deref_type_var);
- nir_ssa_def *offset = nir_imm_int(b, 0);
+ nir_ssa_def *offset = nir_imm_intN_t(b, 0, deref->dest.ssa.bit_size);
for (nir_deref_instr **p = &path.path[1]; *p; p++) {
if ((*p)->deref_type == nir_deref_type_array) {
nir_ssa_def *index = nir_ssa_for_src(b, (*p)->arr.index, 1);