Mesa (glsl2): ir_to_mesa: Tell Mesa about our choices for vertex attribute locations.

Eric Anholt anholt at kemper.freedesktop.org
Wed Jun 30 12:14:45 PDT 2010


Module: Mesa
Branch: glsl2
Commit: edcb9c2b062693a5974aa74725f6259023fff794
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=edcb9c2b062693a5974aa74725f6259023fff794

Author: Eric Anholt <eric at anholt.net>
Date:   Tue Jun 29 18:23:05 2010 -0700

ir_to_mesa: Tell Mesa about our choices for vertex attribute locations.

---

 src/mesa/shader/ir_to_mesa.cpp |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/mesa/shader/ir_to_mesa.cpp b/src/mesa/shader/ir_to_mesa.cpp
index f0eb46a..75021a7 100644
--- a/src/mesa/shader/ir_to_mesa.cpp
+++ b/src/mesa/shader/ir_to_mesa.cpp
@@ -1001,6 +1001,15 @@ ir_to_mesa_visitor::visit(ir_dereference_variable *ir)
 	    entry = new(mem_ctx) temp_entry(ir->var,
 					    PROGRAM_INPUT,
 					    ir->var->location);
+
+	    if (this->prog->Target == GL_VERTEX_PROGRAM_ARB &&
+		ir->var->location >= VERT_ATTRIB_GENERIC0) {
+	       _mesa_add_attribute(prog->Attributes,
+				   ir->var->name,
+				   type_size(ir->var->type) * 4,
+				   ir->var->type->gl_type,
+				   ir->var->location);
+	    }
 	 } else {
 	    entry = new(mem_ctx) temp_entry(ir->var,
 					    PROGRAM_OUTPUT,



More information about the mesa-commit mailing list