glsl: Use count_attribute_slots() in ir_set_program_inouts.
authorPaul Berry <stereotype441@gmail.com>
Wed, 31 Jul 2013 16:43:16 +0000 (09:43 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 2 Aug 2013 03:19:26 +0000 (20:19 -0700)
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/glsl/ir_set_program_inouts.cpp

index ef95cbeaeb7345f1d5bd09a724482594b423a16d..351f65bd59da6fbfb49530a1aabbe59abf16e7e5 100644 (file)
@@ -110,14 +110,8 @@ ir_set_program_inouts_visitor::visit(ir_dereference_variable *ir)
    if (!is_shader_inout(ir->var))
       return visit_continue;
 
-   if (ir->type->is_array()) {
-      mark(this->prog, ir->var, 0,
-          ir->type->length * ir->type->fields.array->matrix_columns,
-           this->shader_type == GL_FRAGMENT_SHADER);
-   } else {
-      mark(this->prog, ir->var, 0, ir->type->matrix_columns,
-           this->shader_type == GL_FRAGMENT_SHADER);
-   }
+   mark(this->prog, ir->var, 0, ir->type->count_attribute_slots(),
+        this->shader_type == GL_FRAGMENT_SHADER);
 
    return visit_continue;
 }