blorp: Fix compute-blits for rectangles not aligned to the workgroup
authorKenneth Graunke <kenneth@whitecape.org>
Sat, 2 Oct 2021 08:31:35 +0000 (01:31 -0700)
committerMarge Bot <emma+marge@anholt.net>
Tue, 30 Nov 2021 12:30:50 +0000 (12:30 +0000)
commitd832209a781f7d3e04b23ddd7e5bfd0ee1a0533a
tree05891f58c6f6525b4f1e64900cb001b384aa72fb
parent80c2b274387ba6372c493cae036887a5cc13e15a
blorp: Fix compute-blits for rectangles not aligned to the workgroup

When dispatching compute shaders to do a blit, our destination rectangle
may not line up perfectly with the workgroup size.  For example, we may
round the left x0 coordinate down to a multiple of the workgroup width,
and the right x1 coordinate up to the next multiple of the workgroup
width.  Similarly for y0/y1 and workgroup height.  This means that we
may dispatch additional invocations which should not actually do any
blitting.  We need to set key->uses_kill to bounds check and drop those.

Caught by Piglit's arb_copy_image-simple when forcing iris to perform
resource_copy_region via BLOCS and running with INTEL_DEBUG=norbc on
Icelake.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13524>
src/intel/blorp/blorp_blit.c