i965: Bind null render targets for shadow sampling + color.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 17 Jan 2018 22:16:04 +0000 (14:16 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 18 Jan 2018 17:32:28 +0000 (09:32 -0800)
commit3e18c53e59457f585de217208e1745f2683be0b9
tree2bb0e5bea583526fbd6cdc8d06877adb21592d9d
parent7ec6e4e68980c575b0818304920a8a8829ebd240
i965: Bind null render targets for shadow sampling + color.

Portal 2 appears to bind RGBA8888_UNORM textures to a sampler2DShadow,
and calls shadow2D() on it.  This causes undefined behavior in OpenGL.

Unfortunately, our sampler appears to hang in this scenario, which is
not acceptable.  Just give them a null surface instead, which returns
all zeroes.

Fixes GPU hangs in Portal 2 on Kabylake.

Huge thanks to Jason Ekstrand for noticing this crazy behavior while
sifting through crash dumps.

Cc: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104487
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_wm_surface_state.c