i965: Fix variable indexing of UBO arrays under non-uniform control flow.
authorFrancisco Jerez <currojerez@riseup.net>
Thu, 19 Feb 2015 12:48:29 +0000 (14:48 +0200)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 4 May 2015 14:44:17 +0000 (17:44 +0300)
commitb234537cc3e513ded9b5385d876e4c531f72af94
tree9c65b436af131ceadd0e8f4ecb040764d3dfecfd
parent046abc998c6951ea8a4aee0a2c1b832f6c877b73
i965: Fix variable indexing of UBO arrays under non-uniform control flow.

ARB_gpu_shader5 requires UBO array indexing expressions to be
dynamically uniform, this however doesn't have any implications on the
control flow that leads to the evaluation of that expression being
uniform.  Use emit_uniformize() to obtain an arbitrary live value from
the binding table index calculation instead of assuming that the first
channel is always live.

Fixes the following Piglit tests:
  arb_gpu_shader5/execution/ubo_array_indexing/fs-nonuniform-control-flow.shader_test
  arb_gpu_shader5/execution/ubo_array_indexing/vs-nonuniform-control-flow.shader_test

part of the series:
  http://lists.freedesktop.org/archives/piglit/2015-February/014616.html

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp