glsl: Handle conditional discards in lower_discard_flow().
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 24 Feb 2015 07:12:39 +0000 (23:12 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 24 Feb 2015 23:24:52 +0000 (15:24 -0800)
commitd77b186871389be10a68546da0e3ada8134ae539
tree84877adfb0fc85564cff1b1074472dad39582ed2
parent44b45da994c5d827eb123fb18b501d712822baae
glsl: Handle conditional discards in lower_discard_flow().

This pass wasn't prepared to handle conditional discards.

Instead of initializing the "discarded" temporary to "true", set it to
the condition.  Then, refer to the variable for the condition, to avoid
duplicating the expression tree.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/glsl/lower_discard_flow.cpp