nir/opcodes: Use fpclassify() instead of isnormal() for ldexp
[mesa.git] / src / glsl / lower_variable_index_to_cond_assign.cpp
index 040b0bf83576197bc65602655739672b96a2a6fa..d878cb078115cbdb7b232f42c8f29810c059fd5c 100644 (file)
@@ -76,7 +76,7 @@ compare_index_block(exec_list *instructions, ir_variable *index,
    ir_rvalue *broadcast_index = new(mem_ctx) ir_dereference_variable(index);
 
    assert(index->type->is_scalar());
-   assert(index->type->base_type == GLSL_TYPE_INT);
+   assert(index->type->base_type == GLSL_TYPE_INT || index->type->base_type == GLSL_TYPE_UINT);
    assert(components >= 1 && components <= 4);
 
    if (components > 1) {
@@ -99,7 +99,7 @@ compare_index_block(exec_list *instructions, ir_variable *index,
 
    ir_rvalue *const condition_val =
       new(mem_ctx) ir_expression(ir_binop_equal,
-                                &glsl_type::bool_type[components - 1],
+                                glsl_type::bvec(components),
                                 broadcast_index,
                                 test_indices);
 
@@ -122,6 +122,7 @@ is_array_or_matrix(const ir_rvalue *ir)
    return (ir->type->is_array() || ir->type->is_matrix());
 }
 
+namespace {
 /**
  * Replace a dereference of a variable with a specified r-value
  *
@@ -191,6 +192,12 @@ struct assignment_generator
    ir_variable* var;
 
    assignment_generator()
+      : base_ir(NULL),
+        rvalue(NULL),
+        old_index(NULL),
+        is_write(false),
+        write_mask(0),
+        var(NULL)
    {
    }
 
@@ -358,7 +365,7 @@ public:
       if (var == NULL)
         return this->lower_temps;
 
-      switch (var->mode) {
+      switch (var->data.mode) {
       case ir_var_auto:
       case ir_var_temporary:
         return this->lower_temps;
@@ -512,6 +519,8 @@ public:
    }
 };
 
+} /* anonymous namespace */
+
 bool
 lower_variable_index_to_cond_assign(exec_list *instructions,
                                    bool lower_input,