glsl/nir: Fix copying vector constant values

For n_columns == 1, we have a vector which is handled by the else
case.  Fixes invalid memory access in upcoming ARB_gl_spirv tests.

Failure bisected by Arcady Goldmints-Orlov.

Fixes: 81e51b41 "nir: Make nir_constant a vector rather than a matrix"
Reviewed-by: Jason Ekstrand's avatarJason Ekstrand <jason@jlekstrand.net>
parent 0daeb1d1
......@@ -121,7 +121,7 @@ copy_constant_to_storage(union gl_constant_value *storage,
unsigned dmul = glsl_base_type_is_64bit(base_type) ? 2 : 1;
int i = 0;
if (n_columns > 0) {
if (n_columns > 1) {
const struct glsl_type *column_type = glsl_get_column_type(type);
for (unsigned int column = 0; column < n_columns; column++) {
copy_constant_to_storage(&storage[i], val->elements[column],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment