i965: add arrays of arrays support for varyings

V2: get the correct vector elements value for outputs

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
This commit is contained in:
Timothy Arceri
2015-07-18 17:24:22 +10:00
parent be822b89ac
commit 176e6930e6
2 changed files with 3 additions and 5 deletions
+2 -2
View File
@@ -1048,11 +1048,11 @@ fs_visitor::emit_general_interpolation(fs_reg attr, const char *name,
unsigned int array_elements;
if (type->is_array()) {
array_elements = type->length;
array_elements = type->arrays_of_arrays_size();
if (array_elements == 0) {
fail("dereferenced array '%s' has length 0\n", name);
}
type = type->fields.array;
type = type->without_array();
} else {
array_elements = 1;
}
+1 -3
View File
@@ -89,9 +89,7 @@ fs_visitor::nir_setup_outputs()
nir_foreach_variable(var, &nir->outputs) {
fs_reg reg = offset(nir_outputs, bld, var->data.driver_location);
int vector_elements =
var->type->is_array() ? var->type->fields.array->vector_elements
: var->type->vector_elements;
int vector_elements = var->type->without_array()->vector_elements;
switch (stage) {
case MESA_SHADER_VERTEX: