glsl/lower_output_reads: set invariant and precise flags on temporaries
authorKarol Herbst <kherbst@redhat.com>
Fri, 18 Jan 2019 13:13:25 +0000 (14:13 +0100)
committerKarol Herbst <kherbst@redhat.com>
Sun, 20 Jan 2019 23:16:50 +0000 (00:16 +0100)
fixes a couple of deqp tests (on nvc0 and potential other drivers):
dEQP-GLES3.functional.shaders.invariance.highp.common_subexpression_1
dEQP-GLES3.functional.shaders.invariance.highp.common_subexpression_2
dEQP-GLES3.functional.shaders.invariance.highp.common_subexpression_3
dEQP-GLES3.functional.shaders.invariance.mediump.common_subexpression_1
dEQP-GLES3.functional.shaders.invariance.mediump.common_subexpression_2
dEQP-GLES3.functional.shaders.invariance.mediump.common_subexpression_3
dEQP-GLES3.functional.shaders.invariance.lowp.common_subexpression_1
dEQP-GLES3.functional.shaders.invariance.lowp.common_subexpression_2
dEQP-GLES3.functional.shaders.invariance.lowp.common_subexpression_3

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/compiler/glsl/lower_output_reads.cpp

index bd3accb3ddab6ce819615b35aca366fe352a265b..4f90c7385add4de1af861f185f3c64d8e01776d7 100644 (file)
@@ -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);
    }