nir: Make nir_deref_instr::mode a bitfield

We rename it to "modes" to make it clear that it may contain more than
one mode and adjust all the uses of nir_deref_instr::modes to attempt to
handle multiple modes.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6332>
This commit is contained in:
Jason Ekstrand
2020-10-30 12:14:05 -05:00
committed by Marge Bot
parent 7d5f3b5c0e
commit 9d377c01d0
22 changed files with 106 additions and 103 deletions

View File

@@ -484,7 +484,7 @@ add_var_use_deref(nir_deref_instr *deref, struct hash_table *live,
util_dynarray_append(ainfo->deref_list, nir_deref_instr *, deref);
}
assert(deref->mode == deref->var->data.mode);
assert(deref->modes == deref->var->data.mode);
_mesa_hash_table_insert(live, deref->var->name, ainfo);
}

View File

@@ -209,7 +209,7 @@ lower_buffer_interface_derefs_impl(nir_function_impl *impl,
break;
}
nir_deref_instr *cast = nir_build_deref_cast(&b, ptr, deref->mode,
nir_deref_instr *cast = nir_build_deref_cast(&b, ptr, deref->modes,
deref->type, 0);
/* Set the alignment on the cast so that we get good alignment out
* of nir_lower_explicit_io. Our offset to the start of the UBO