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>
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 */