mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-15 00:10:25 +01:00
glsl/ir_reader: Make sure constants have the right number of components.
The list of numbers in (constant type (<numbers>)) needs to contain exactly type->components() numbers (16 for a mat4, 3 for a vec3, etc.) Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
parent
6afce988a9
commit
8ceb235c9c
1 changed files with 5 additions and 0 deletions
|
|
@ -820,6 +820,11 @@ ir_reader::read_constant(s_expression *expr)
|
|||
}
|
||||
++k;
|
||||
}
|
||||
if (k != type->components()) {
|
||||
ir_read_error(values, "expected %d constant values, found %d",
|
||||
type->components(), k);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return new(mem_ctx) ir_constant(type, &data);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue