[Mesa-dev] [PATCH 4/7] glsl: Request an Nx1 type instance in ir_quadop_vector lowering pass.

Kenneth Graunke kenneth at whitecape.org
Fri Jul 27 10:49:22 PDT 2012


From: Ian Romanick <ian.d.romanick at intel.com>

No types have 0 columns.  The glsl_type::get_instance method contains

   if ((rows < 1) || (rows > 4) || (columns < 1) || (columns > 4))
      return error_type;

To get a vector, use columns = 1.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
---
 src/glsl/lower_vector.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/glsl/lower_vector.cpp b/src/glsl/lower_vector.cpp
index 57963a1..0cd6909 100644
--- a/src/glsl/lower_vector.cpp
+++ b/src/glsl/lower_vector.cpp
@@ -183,7 +183,7 @@ lower_vector_visitor::handle_rvalue(ir_rvalue **rvalue)
    if (assigned > 0) {
       ir_constant *const c =
 	 new(mem_ctx) ir_constant(glsl_type::get_instance(expr->type->base_type,
-							  assigned, 0),
+							  assigned, 1),
 				  &d);
       ir_dereference *const lhs = new(mem_ctx) ir_dereference_variable(temp);
       ir_assignment *const assign =
-- 
1.7.11.3



More information about the mesa-dev mailing list