r600g/sb: fix issues cause by GLSL switching to loops for switch
authorDave Airlie <airlied@redhat.com>
Fri, 28 Nov 2014 00:49:48 +0000 (00:49 +0000)
committerDave Airlie <airlied@redhat.com>
Tue, 2 Dec 2014 03:57:27 +0000 (13:57 +1000)
commit7b0067d23a6f64cf83c42e7f11b2cd4100c569fe
treec1b19a88e374755ce463457f31daa94bcd9d1732
parent036f434ac2dfed6ff730a1bd8f74eafd95bcad4e
r600g/sb: fix issues cause by GLSL switching to loops for switch

Since 73dd50acf6d244979c2a657906aa56d3ac60d550
glsl: implement switch flow control using a loop

The SB backend was falling over in an assert or crashing.

Tracked this down to the loops having no repeats, but requiring
a working break, initial code just called the loop handler for
all non-if statements, but this caused a regression in
tests/shaders/dead-code-break-interaction.shader_test.
So I had to add further code to detect if all the departure
nodes are empty and avoid generating an empty loop for that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=86089
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-By: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/gallium/drivers/r600/sb/sb_bc_finalize.cpp