i965/fs: Fix hang on IVB and VLV with image format mismatch.
authorFrancisco Jerez <currojerez@riseup.net>
Wed, 26 Aug 2015 18:59:46 +0000 (21:59 +0300)
committerFrancisco Jerez <currojerez@riseup.net>
Mon, 28 Sep 2015 15:10:39 +0000 (18:10 +0300)
commitb61292296bd7e1876fdb64725a783a7e96f6c4c1
tree3fd2fc0123e40a178226ef81d0c6f2f8cf90aef8
parent2518645f63e2f66d3638180f44a007541928319c
i965/fs: Fix hang on IVB and VLV with image format mismatch.

IVB and VLV hang sporadically when an untyped surface read or write
message is used to access a surface of format other than RAW, as may
happen when there is a mismatch between the format qualifier of the
image uniform and the format of the actual image bound to the
pipeline.  According to the spec this condition gives undefined
results but may not lead to program termination (which is one of the
possible outcomes of the hang).  Fix it by checking at runtime whether
the surface is of the right type.

Fixes the "arb_shader_image_load_store.invalid/format mismatch" piglit
subtest.

Reported-by: Mark Janes <mark.a.janes@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91718
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/i965/brw_fs_surface_builder.cpp