st/mesa: inform the driver of framebuffer changes before compute dispatches
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 22 Feb 2017 18:59:06 +0000 (19:59 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 1 Mar 2017 17:59:36 +0000 (18:59 +0100)
commit40c77bbf83a369f21c5a95f14417348aae2dbe42
tree75068aeea9718b5eed3192ecbf4a4a308aeab34f
parent911391bd70fe30ad970c5e56632b2d7ccc29d955
st/mesa: inform the driver of framebuffer changes before compute dispatches

Even though compute shaders cannot access the framebuffer, there is a
synchronization issue when a compute dispatch accesses a texture that
was previously bound and drawn to as a framebuffer.

Section 9.3 (Feedback Loops Between Textures and the Framebuffer) of
the OpenGL 4.5 spec rather implicitly clarifies that undefined behavior
results if the texture is still attached to the currently bound
framebuffer. However, the feedback loop is broken when the application
changes the framebuffer binding before a compute dispatch, and the
state tracker needs to let the driver known about this.

Fixes GL45-CTS.compute_shader.pipeline-post-fs on SI family Radeons.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_atom.c