Merge remote-tracking branch 'mesa-public/master' into vulkan
[mesa.git] / src / glsl / lower_vector.cpp
index 93c37638bbd4eb7397cbcc61a49b65ac45169ce0..a658410ae6fd20e0a894b35ad3658fb3db59faf3 100644 (file)
 #include "ir.h"
 #include "ir_rvalue_visitor.h"
 
+namespace {
+
 class lower_vector_visitor : public ir_rvalue_visitor {
 public:
-   lower_vector_visitor() : progress(false)
+   lower_vector_visitor() : dont_lower_swz(false), progress(false)
    {
       /* empty */
    }
@@ -48,6 +50,8 @@ public:
    bool progress;
 };
 
+} /* anonymous namespace */
+
 /**
  * Determine if an IR expression tree looks like an extended swizzle
  *
@@ -125,7 +129,7 @@ lower_vector_visitor::handle_rvalue(ir_rvalue **rvalue)
    if (this->dont_lower_swz && is_extended_swizzle(expr))
       return;
 
-   /* FINISHME: Is this the right thing to use for the talloc context?
+   /* FINISHME: Is this the right thing to use for the ralloc context?
     */
    void *const mem_ctx = expr;
 
@@ -183,7 +187,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 =