glsl: Don't copy propagate or tree graft precise values.
authorKenneth Graunke <kenneth@whitecape.org>
Sun, 3 Apr 2016 09:02:12 +0000 (02:02 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 12 Apr 2016 22:57:48 +0000 (15:57 -0700)
commit95d622e16df0ddbf52e43a34bd6ed6dd15e3bdee
tree5e8821f5804efc214feb7073fa6e91e36eaae1d3
parent8ec971a9972e5343cfb28da6f48650caba0a7e50
glsl: Don't copy propagate or tree graft precise values.

This is kind of a hack.  We currently track precise requirements
by decorating ir_variables.  Propagating or grafting the RHS of an
assignment to a precise value into some other expression tree can
lose those decorations.

In the long run, it might be better to replace these ir_variable
decorations with an "exact" decoration on ir_expression nodes,
similar to what NIR does.

In the short run, this is probably good enough.  It preserves
enough information for glsl_to_nir to generate "exact" decorations,
and NIR will then handle optimizing these expressions reasonably.

Fixes ES31-CTS.gpu_shader5.precise_qualifier.

v2: Drop invariant handling, as it shouldn't be necessary (caught
    by Jason Ekstrand).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/glsl/opt_copy_propagation.cpp
src/compiler/glsl/opt_copy_propagation_elements.cpp
src/compiler/glsl/opt_tree_grafting.cpp