diff options
author | Timothy Arceri <[email protected]> | 2014-05-04 21:13:25 +1000 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2015-09-26 22:48:49 +1000 |
commit | abdab88b30ab2eb78cf20fd91361f820e1f3e06b (patch) | |
tree | 95143edbe16b905b8387a1f9dde9a4d814111579 /src/glsl/link_varyings.cpp | |
parent | 1d401f9ce48f85b4340fcd4a591222aa165910f1 (diff) |
glsl: calculate component size for arrays of arrays when varying packing disabled
Signed-off-by: Timothy Arceri <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/link_varyings.cpp')
-rw-r--r-- | src/glsl/link_varyings.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/glsl/link_varyings.cpp b/src/glsl/link_varyings.cpp index f7a7b8c4c5b..0d343d64a2e 100644 --- a/src/glsl/link_varyings.cpp +++ b/src/glsl/link_varyings.cpp @@ -956,9 +956,16 @@ varying_matches::record(ir_variable *producer_var, ir_variable *consumer_var) type = type->fields.array; } - slots = (type->is_array() - ? (type->length * type->fields.array->matrix_columns) - : type->matrix_columns); + if (type->is_array()) { + slots = 1; + while (type->is_array()) { + slots *= type->length; + type = type->fields.array; + } + slots *= type->matrix_columns; + } else { + slots = var->type->matrix_columns; + } this->matches[this->num_matches].num_components = 4 * slots; } else { this->matches[this->num_matches].num_components |