llvmpipe: add reference counting to fragment shaders.
authorDave Airlie <airlied@redhat.com>
Mon, 6 Jul 2020 05:32:19 +0000 (15:32 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 31 Aug 2020 00:02:22 +0000 (10:02 +1000)
commit99330e50c9e08532f5d9c3568be938c7e9d8fd93
treea4420d0e012643db07cf25219c53888aaa56e7e1
parentac6b8e42ce20e5003af0846602af3f5caec182fa
llvmpipe: add reference counting to fragment shaders.

Currently llvmpipe calls finish on the context when a shader
variant has to be destroyed just in case the variant is currently
in use by the setup engine.

Fix this by reference counting the shaders, and reference counting
the shader variants.

Whenever a shader is used in the rasteriser backend, it is added
to a reference list and removed when the rasterizer is finished with it.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6341>
src/gallium/drivers/llvmpipe/lp_scene.c
src/gallium/drivers/llvmpipe/lp_scene.h
src/gallium/drivers/llvmpipe/lp_setup.c
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_fs.h