diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-06-21 16:55:08 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-06-24 11:32:14 -0700 |
commit | 390ff8ac54693262e7d56d8d467dbb6be8c858ae (patch) | |
tree | d955d59b71442a83aee82b33685d248a057ec142 /src | |
parent | 0daeb1d127987c8e70afe22cb30f676fb4631813 (diff) |
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: 81e51b412e9 "nir: Make nir_constant a vector rather than a matrix"
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl/gl_nir_link_uniform_initializers.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/compiler/glsl/gl_nir_link_uniform_initializers.c b/src/compiler/glsl/gl_nir_link_uniform_initializers.c index 546da68927f..1d2938dca01 100644 --- a/src/compiler/glsl/gl_nir_link_uniform_initializers.c +++ b/src/compiler/glsl/gl_nir_link_uniform_initializers.c @@ -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], |