etnaviv: fix shader miscompilation with more than 16 labels
authorLucas Stach <l.stach@pengutronix.de>
Mon, 26 Jun 2017 16:24:31 +0000 (18:24 +0200)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 28 Jun 2017 20:04:30 +0000 (22:04 +0200)
commitec43605189907fa327a4a7f457aa3c822cfdea5d
treea83211cabc9cc981f62da6a8685ac7fb84f74ba3
parentff422500cc4f69877b7ba9f8c633309be6233f4c
etnaviv: fix shader miscompilation with more than 16 labels

The labels array may change its virtual address on a reallocation, so
it is invalid to cache pointers into the array. Rather than using the
pointer directly, remember the array index.

Fixes miscompilation of shaders in glmark2 ideas, leading to GPU hangs.

Fixes: c9e8b49b (etnaviv: gallium driver for Vivante GPUs)
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
src/gallium/drivers/etnaviv/etnaviv_compiler.c