llvmpipe/setup: force fs constant updating upon beginning queries
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 18 Mar 2021 17:31:01 +0000 (13:31 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 19 Mar 2021 03:15:53 +0000 (23:15 -0400)
this flushes any pending updates and avoids trying to access constant buffers
which have been unset (and are also potentially deleted)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9692>

src/gallium/drivers/llvmpipe/lp_setup.c

index 284d78a..97d85bd 100644 (file)
@@ -1514,6 +1514,11 @@ 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");