r600/sb: do not convert if-blocks that contain indirect array access
authorGert Wollny <gw.fossdev@gmail.com>
Wed, 6 Dec 2017 16:42:02 +0000 (17:42 +0100)
committerDave Airlie <airlied@redhat.com>
Wed, 6 Dec 2017 23:48:41 +0000 (09:48 +1000)
commit6c268ea79af80a65a89a23854bdbe8bc1e99ab23
treed47712bf68d78d62ff515fc77394c0d6285f8188
parent81683c3d42b3383e894b204d024abfa2fa547764
r600/sb: do not convert if-blocks that contain indirect array access

If an array is accessed within an if block, then currently it is not known
whether the value in the address register is involved in the evaluation of the
if condition, and converting the if condition may actually result in
out-of-bounds array access. Consequently, if blocks that contain indirect array
access should not be converted.

Fixes piglits on r600/BARTS:
spec/glsl-1.10/execution/variable-indexing/
  vs-output-array-float-index-wr
  vs-output-array-vec3-index-wr
  vs-output-array-vec4-index-wr

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104143

Signed-off-by: Gert Wollny <gw.fossdev@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/sb/sb_if_conversion.cpp
src/gallium/drivers/r600/sb/sb_ir.cpp
src/gallium/drivers/r600/sb/sb_ir.h