diff options
author | Danylo Piliaiev <[email protected]> | 2018-08-13 18:57:38 +0300 |
---|---|---|
committer | Tapani Pälli <[email protected]> | 2018-08-15 10:01:43 +0300 |
commit | 479a849ad606482c3cf67157b77af94ecd450ace (patch) | |
tree | 87ab1770f59814b205567a0f228d18cde1e9a59d /src | |
parent | bffa025adaa68c429f86f1736600de7710b21a08 (diff) |
glsl: Avoid calling get_array_element for scalar constants
Accessing scalar constant as an array in function call or
initializer list triggered assert in get_array_element.
Examples:
func(0[0]);
vec2 t = { 0[0], 0 };
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107550
Signed-off-by: Danylo Piliaiev <[email protected]>
Reviewed-by: Tapani Pälli <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/ir_constant_expression.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/ir_constant_expression.cpp b/src/compiler/glsl/ir_constant_expression.cpp index 4a0aff72c6f..c9788c70535 100644 --- a/src/compiler/glsl/ir_constant_expression.cpp +++ b/src/compiler/glsl/ir_constant_expression.cpp @@ -826,7 +826,7 @@ ir_dereference_array::constant_expression_value(void *mem_ctx, const unsigned component = idx->value.u[0]; return new(mem_ctx) ir_constant(array, component); - } else { + } else if (array->type->is_array()) { const unsigned index = idx->value.u[0]; return array->get_array_element(index)->clone(mem_ctx, NULL); } |