glsl: fix incorrect optimisation in opt_constant_variable()
authorTimothy Arceri <tarceri@itsqueeze.com>
Wed, 10 Jun 2020 05:19:22 +0000 (15:19 +1000)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Jun 2020 08:51:54 +0000 (08:51 +0000)
commitb33f811068596c2764f6396a885f7aab7d7d411c
tree4e2004abaf0bf14b2f0b577e4e374da1951bad57
parent07aefe8065ddcc6c4c5815c761ede265bd760d78
glsl: fix incorrect optimisation in opt_constant_variable()

When handling function inputs the optimisation pass incorrectly
assumes the inputs are undefined. Here we simply change things to
assume inputs have always been assigned a value. Any further
optimisations will be taken care of once function inlining takes
place.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2984
Fixes: 65122e9e8038 ("ir_constant_variable: New pass to mark constant-assigned variables constant.")
Reviewed-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5413>
src/compiler/glsl/opt_constant_variable.cpp