mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 19:30:11 +01:00
nir/validate: Require array indices to match the deref bit size
This doesn't currently change anything because array indices are required to be 32 bits and all derefs are also 32 bits. However, we will one day have 64-bit derefs for OpenCL. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
parent
abfe674c54
commit
cd93b0a670
1 changed files with 4 additions and 2 deletions
|
|
@ -464,8 +464,10 @@ validate_deref_instr(nir_deref_instr *instr, validate_state *state)
|
|||
validate_assert(state,
|
||||
instr->type == glsl_get_array_element(parent->type));
|
||||
|
||||
if (instr->deref_type == nir_deref_type_array)
|
||||
validate_src(&instr->arr.index, state, 32, 1);
|
||||
if (instr->deref_type == nir_deref_type_array) {
|
||||
validate_src(&instr->arr.index, state,
|
||||
nir_dest_bit_size(instr->dest), 1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue