llvmpipe: fix race between draw and setting fragment shader.
authorDave Airlie <airlied@redhat.com>
Tue, 10 Mar 2020 02:55:31 +0000 (12:55 +1000)
committerMarge Bot <eric+marge@anholt.net>
Wed, 6 May 2020 06:20:37 +0000 (06:20 +0000)
commitf6383673c96de2102edae0e705f7960753fe848b
treef199f882554de3d4ff01e428588ce2bc1cfa654b
parent6befeb66070498427e139d3ff86bfd0bd15b5668
llvmpipe: fix race between draw and setting fragment shader.

There is a race with u_blitter shaders + pipeline shaders (aaline/aapoint)
where the draw bind can cause a pipeline flush which can use bind_fs_state to
 be reenters and llvmpipe->fs gets the wrong value. Fix this by only
setting the llvmpipe->fs value after the draw binding is complete.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4122>
src/gallium/drivers/llvmpipe/lp_state_fs.c