Skip to content
Snippets Groups Projects
Commit d9ec7df2 authored by Boris Brezillon's avatar Boris Brezillon Committed by Marge Bot
Browse files

nir: Fix flat new_var assignment in create_new_io_vars()


If the type is not an array, glsl_get_length() returns 0 and we don't
update the new_vars[]/flat_vars[] entries.

Fixes: bcd14756 ("nir/lower_io_to_vector: add flat mode")
Reviewed-by: default avatarJason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jesse Natalie's avatarJesse Natalie <jenatali@microsoft.com>
Part-of: <mesa/mesa!16960>
parent b12417a2
No related branches found
No related tags found
No related merge requests found
......@@ -304,7 +304,8 @@ create_new_io_vars(nir_shader *shader, nir_variable_mode mode,
var->type = flat_type;
nir_shader_add_variable(shader, var);
for (unsigned i = 0; i < glsl_get_length(flat_type); i++) {
unsigned num_slots = MAX2(glsl_get_length(flat_type), 1);
for (unsigned i = 0; i < num_slots; i++) {
for (unsigned j = 0; j < 4; j++)
new_vars[loc + i][j] = var;
flat_vars[loc + i] = true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment