From: Karol Herbst Date: Fri, 18 Jan 2019 13:13:25 +0000 (+0100) Subject: glsl/lower_output_reads: set invariant and precise flags on temporaries X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=987744be9850bfe3a7c3c9556ae5d48ee5c34352;p=mesa.git glsl/lower_output_reads: set invariant and precise flags on temporaries 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: Signed-off-by: Karol Herbst Reviewed-by: Ilia Mirkin --- diff --git a/src/compiler/glsl/lower_output_reads.cpp b/src/compiler/glsl/lower_output_reads.cpp index bd3accb3dda..4f90c7385ad 100644 --- a/src/compiler/glsl/lower_output_reads.cpp +++ b/src/compiler/glsl/lower_output_reads.cpp @@ -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); }