i965/gen7: Use predicated rendering for indirect compute
authorJordan Justen <jordan.l.justen@intel.com>
Mon, 15 Feb 2016 23:17:15 +0000 (15:17 -0800)
committerJordan Justen <jordan.l.justen@intel.com>
Wed, 17 Feb 2016 17:25:47 +0000 (09:25 -0800)
commit9a939ebb47a0d37a6b29e3dbb1b20bdc9538a721
tree3a26bd80e619a60100ad7a2b763cb2edf08f8a70
parent37d540ba709ae0128a6fb3e11a7124eb6e8c00a0
i965/gen7: Use predicated rendering for indirect compute

On gen7 (Ivy Bridge, Haswell), we will get a GPU hang if an indirect
dispatch is used, but one of the dimensions is 0.

Therefore we use predicated rendering on the GPGPU_WALKER command to
handle this case.

Fixes piglit test: spec/arb_compute_shader/zero-dispatch-size

From the ARB_compute_shader spec, under DispatchCompute:

"If the work group count in any dimension is zero, no work groups are
 dispatched."

And then for DispatchComputeIndirect:

... "is equivalent (assuming no errors are generated) to calling
DispatchCompute with <num_groups_x>, <num_groups_y> and
<num_groups_z>" ...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94100
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ben Widawsky <benjamin.widawsky@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu>
src/mesa/drivers/dri/i965/brw_compute.c
src/mesa/drivers/dri/i965/brw_defines.h