mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-21 13:18:09 +02:00
nir/spirv: Array lengths are constants not literals
This commit is contained in:
parent
1473a8dc6f
commit
d7f66f9f6f
1 changed files with 8 additions and 2 deletions
|
|
@ -515,8 +515,14 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode,
|
|||
struct vtn_type *array_element =
|
||||
vtn_value(b, w[2], vtn_value_type_type)->type;
|
||||
|
||||
/* A length of 0 is used to denote unsized arrays */
|
||||
unsigned length = (opcode == SpvOpTypeArray) ? w[3] : 0;
|
||||
unsigned length;
|
||||
if (opcode == SpvOpTypeRuntimeArray) {
|
||||
/* A length of 0 is used to denote unsized arrays */
|
||||
length = 0;
|
||||
} else {
|
||||
length =
|
||||
vtn_value(b, w[3], vtn_value_type_constant)->constant->value.u[0];
|
||||
}
|
||||
|
||||
val->type->type = glsl_array_type(array_element->type, length);
|
||||
val->type->array_element = array_element;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue