ir_to_mesa: Fix the indexing of attributes in the program's Attributes.
authorEric Anholt <eric@anholt.net>
Wed, 30 Jun 2010 21:01:43 +0000 (14:01 -0700)
committerEric Anholt <eric@anholt.net>
Wed, 30 Jun 2010 21:44:14 +0000 (14:44 -0700)
This fixes GetAttribLocation returning VERT_ATTRIB_GENERIC1 instead of 1,
caught by glsl-dlist-getattriblocation.

src/mesa/shader/ir_to_mesa.cpp

index 4eac810679ffbda05ac3634c7e1954bfff1395c0..c39621bf7969e61b16c9eeb4a3c7e987bbfafa91 100644 (file)
@@ -1008,7 +1008,7 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
                                   ir->var->name,
                                   type_size(ir->var->type) * 4,
                                   ir->var->type->gl_type,
-                                  ir->var->location);
+                                  ir->var->location - VERT_ATTRIB_GENERIC0);
            }
         } else {
            entry = new(mem_ctx) temp_entry(ir->var,