gallivm: rework coroutine malloc/free callouts.
authorDave Airlie <airlied@redhat.com>
Fri, 15 May 2020 00:03:32 +0000 (10:03 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 10 Jun 2020 20:05:40 +0000 (06:05 +1000)
commitf511d2a553377a58b5eea6c6d1170fcc4972237a
treeccd5a2d9b57d62d7d1389af0e6c5be2dfada5ef8
parentd815d74f75aa3a70e4c2d3859cf0cd76d0f2f9d8
gallivm: rework coroutine malloc/free callouts.

When using cached shaders we have to relink the shader with
external symbols when it's loaded. However the way gallivm does
function calls now hardcodes the function pointer into the shader.

LLVM had a mechanism for doing this properly using global mappings,
this switches the coroutine alloc/free code to use a global mapping.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5049>
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/gallivm/lp_bld_coro.c
src/gallium/auxiliary/gallivm/lp_bld_coro.h
src/gallium/auxiliary/gallivm/lp_bld_init.h
src/gallium/drivers/llvmpipe/lp_state_cs.c