glsl: Request an Nx1 type instance in ir_quadop_vector lowering pass.
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 22 Mar 2012 22:09:40 +0000 (15:09 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 30 Jul 2012 22:14:34 +0000 (15:14 -0700)
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@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Olivier Galibert <galibert@pobox.com>
src/glsl/lower_vector.cpp

index 57963a121addf487224a7562453d2f65bda6e597..0cd6909db55d5dc8a06716bb68a8c0667ee33f53 100644 (file)
@@ -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 =