lavapipe: rewrite cmdbufs to always do descriptor binds/pushes first
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 18 Mar 2021 17:34:32 +0000 (13:34 -0400)
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 19 Mar 2021 03:15:53 +0000 (23:15 -0400)
commit007bf1d1dcf79028948e0e4207e445763faa6894
tree1e8a31018a21432ca1f44fd2f7b084b29ec89d24
parent4feb26f64709309e6dab6be206504fc60d7acded
lavapipe: rewrite cmdbufs to always do descriptor binds/pushes first

llvmpipe has some crazy dependency ordering with constant buffers that
I don't want to mess with, so instead this ensures that descriptors are
always updated as early in the command stream as possible, avoiding any
use-after-free scenarios which might result from lavapipe freeing memory
in a still-bound descriptor that's pending an update

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9692>
src/gallium/frontends/lavapipe/lvp_cmd_buffer.c
src/gallium/frontends/lavapipe/lvp_private.h