History log of /external/mesa3d/src/compiler/glsl/opt_minmax.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1edc53a66b33e4d17688a3d03b1bdffed2aec414 06-Jan-2017 Timothy Arceri <timothy.arceri@collabora.com> glsl: fix opt_minmax redundancy checks against baserange

Marking operations as redundant if they are equal to the base
range is fine when the tree structure is something like this:

max
/ \
max b
/ \
3 max
/ \
3 a

But the opt falls apart with a tree like this:

max
/ \
max max
/ \ / \
3 a b 3

The problem is that both branches are treated the same: descending in
the left branch will prune the constant, and then descending the right
branch will prune the constant there as well, because limits[0] wasn't
updated to take the change on the left branch into account, and so we
still get [3,\infty) as baserange.

In order to fix the bug we just disable the marking of redundant expressions
when they match the baserange.

NIR algebraic opt will clean up the first tree for anyway, hopefully
other backends are smart enough to do this also.

Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
/external/mesa3d/src/compiler/glsl/opt_minmax.cpp
eb63640c1d38a200a7b1540405051d3ff79d0d8a 17-Jan-2016 Emil Velikov <emil.velikov@collabora.com> glsl: move to compiler/

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
/external/mesa3d/src/compiler/glsl/opt_minmax.cpp