glsl: fix the type of ir_constant_data::u16
[mesa.git] / src / compiler / glsl / lower_output_reads.cpp
index bd3accb3ddab6ce819615b35aca366fe352a265b..7a182130b2e2770a20eb996e85fabf017c7a5c63 100644 (file)
@@ -72,7 +72,7 @@ static unsigned
 hash_table_var_hash(const void *key)
 {
    const ir_variable * var = static_cast<const ir_variable *>(key);
-   return _mesa_key_hash_string(var->name);
+   return _mesa_hash_string(var->name);
 }
 
 output_read_remover::output_read_remover(unsigned stage)
@@ -101,6 +101,10 @@ output_read_remover::visit(ir_dereference_variable *ir)
       void *var_ctx = ralloc_parent(ir->var);
       temp = new(var_ctx) ir_variable(ir->var->type, ir->var->name,
                                       ir_var_temporary);
+      /* copy flags which affect arithematical precision */
+      temp->data.invariant = ir->var->data.invariant;
+      temp->data.precise = ir->var->data.precise;
+      temp->data.precision = ir->var->data.precision;
       _mesa_hash_table_insert(replacements, ir->var, temp);
       ir->var->insert_after(temp);
    }