i965: Disable auxiliary buffers when there are self-dependencies.
authorKenneth Graunke <kenneth@whitecape.org>
Fri, 6 Oct 2017 03:31:01 +0000 (20:31 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 10 Oct 2017 21:57:04 +0000 (14:57 -0700)
commitea0d2e98ecb369ab84e78c84709c0930ea8c293a
tree9c122a430fac002bd0ca7ba2e154ab28d5a14922
parent96e85709df632674b9976435d350ce5d21ad8aea
i965: Disable auxiliary buffers when there are self-dependencies.

Jason and I investigated several OpenGL CTS failures where the tests
bind the same texture for rendering and texturing, at the same time.
This has defined results as long as the reads happen before writes,
or the regions are non-overlapping.  Normally, this just works out.

However, CCS can cause problems.  If the shader is reading one set of
pixels, and writing to different pixels that are adjacent, they may end
up being covered by the same CCS block.  So rendering may be writing a
CCS block, while the sampler is trying to read it.  Corruption ensues.

Disabling CCS is unfortunate, but safe.

Fixes several KHR-GL45.texture_barrier.* subtests.

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/drivers/dri/i965/brw_draw.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_mipmap_tree.h