panfrost/midgard: Pipe through varying arrays

Varying arrays sometimes are lowered to a series of directly accessed
varyings (which we handled okay), but when indirectly accessed, they
appear as a single array; we need to handle this as well.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
This commit is contained in:
Alyssa Rosenzweig 2019-04-20 23:39:29 +00:00
parent 042d0bb5c3
commit 1f7b3884c9
1 changed files with 5 additions and 1 deletions

View File

@ -3417,7 +3417,11 @@ midgard_compile_shader_nir(nir_shader *nir, midgard_program *program, bool is_bl
nir_foreach_variable(var, varyings) {
unsigned loc = var->data.driver_location;
program->varyings[loc] = var->data.location;
unsigned sz = glsl_type_size(var->type, FALSE);
for (int c = 0; c < sz; ++c) {
program->varyings[loc + c] = var->data.location;
}
}
/* Lower gl_Position pre-optimisation */