llvmpipe/setup: use bigger hammer to force fs constant updating correctly

this race condition between destroying ubo backing memory in lavapipe and
performing descriptor updates can be triggered from more than just queries,
so forcing the update just before the Problem Area seems like the best way to
permanently resolve the issue

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9711>
This commit is contained in:
Mike Blumenkrantz 2021-03-19 10:10:58 -04:00
parent 012bc2fc77
commit 62335d7bc5

View file

@ -1182,6 +1182,12 @@ try_update_scene_state( struct lp_setup_context *setup )
setup->dirty |= LP_SETUP_NEW_FS;
}
struct llvmpipe_context *llvmpipe = llvmpipe_context(setup->pipe);
if (llvmpipe->dirty & LP_NEW_FS_CONSTANTS)
lp_setup_set_fs_constants(llvmpipe->setup,
ARRAY_SIZE(llvmpipe->constants[PIPE_SHADER_FRAGMENT]),
llvmpipe->constants[PIPE_SHADER_FRAGMENT]);
if (setup->dirty & LP_SETUP_NEW_CONSTANTS) {
for (i = 0; i < ARRAY_SIZE(setup->constants); ++i) {
struct pipe_resource *buffer = setup->constants[i].current.buffer;
@ -1514,12 +1520,6 @@ void
lp_setup_begin_query(struct lp_setup_context *setup,
struct llvmpipe_query *pq)
{
struct llvmpipe_context *llvmpipe = llvmpipe_context(setup->pipe);
if (llvmpipe->dirty & LP_NEW_FS_CONSTANTS)
lp_setup_set_fs_constants(llvmpipe->setup,
ARRAY_SIZE(llvmpipe->constants[PIPE_SHADER_FRAGMENT]),
llvmpipe->constants[PIPE_SHADER_FRAGMENT]);
set_scene_state(setup, SETUP_ACTIVE, "begin_query");
if (!(pq->type == PIPE_QUERY_OCCLUSION_COUNTER ||