ir_to_mesa: Give the expected size for _mesa_add_attribute().
authorEric Anholt <eric@anholt.net>
Thu, 5 Aug 2010 22:54:56 +0000 (15:54 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 6 Aug 2010 07:23:48 +0000 (00:23 -0700)
Fixes a failure in glean shaderAPI.

src/mesa/program/ir_to_mesa.cpp

index f5e5f7d7b877bd1e3a767d44f289419a47a6f05a..9979e6e3e079795d202ae4591bac43ce058a71dd 100644 (file)
@@ -43,6 +43,7 @@
 
 extern "C" {
 #include "main/mtypes.h"
+#include "main/shaderapi.h"
 #include "main/shaderobj.h"
 #include "main/uniforms.h"
 #include "program/hash_table.h"
@@ -1458,7 +1459,7 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
                ir->var->location >= VERT_ATTRIB_GENERIC0) {
               _mesa_add_attribute(prog->Attributes,
                                   ir->var->name,
-                                  type_size(ir->var->type) * 4,
+                                  _mesa_sizeof_glsl_type(ir->var->type->gl_type),
                                   ir->var->type->gl_type,
                                   ir->var->location - VERT_ATTRIB_GENERIC0);
            }