glsl: Fix copying function's out to temp if dereferenced by array
authorDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Thu, 10 Jan 2019 16:16:59 +0000 (18:16 +0200)
committerTimothy Arceri <tarceri@itsqueeze.com>
Mon, 14 Jan 2019 01:04:07 +0000 (12:04 +1100)
commit0862929bf64222e85e8242824aecf05e494c157c
tree1ed28d83ea188e6ede834797f34e341ccd6dca5b
parent04c2f12ab28d61d30f9cb008edb9039c610dfb5f
glsl: Fix copying function's out to temp if dereferenced by array

Function's out variable could be an array dereferenced by an array:
 func(v[w[i]]);
or something more complicated.

Copy index in any case.

Fixes: 76c27e47b906 ("glsl: Copy function out to temp if we don't directly ref a variable")
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/glsl/ast_function.cpp