llvmpipe: Use two LLVMContexts per OpenGL context instead of a global one.
authorMathias Fröhlich <Mathias.Froehlich@gmx.net>
Thu, 28 Aug 2014 17:49:35 +0000 (19:49 +0200)
committerMathias Fröhlich <Mathias.Froehlich@gmx.net>
Tue, 30 Sep 2014 18:45:19 +0000 (20:45 +0200)
commit83c62597fc8eb38bf274fa1a3ca03c6adafb4bf9
tree512da771be3fa564311d151785c62eb06ad40a64
parent98d00d664009c74ac0c827b3c41c15e3fe1993d4
llvmpipe: Use two LLVMContexts per OpenGL context instead of a global one.

This is one step to make llvmpipe thread safe as mandated by the OpenGL
standard. Using the global LLVMContext is obviously a problem for
that kind of use pattern. The patch introduces two LLVMContext
instances that are private to an OpenGL context and used for all
compiles. One is put into struct draw_llvm and the other
one into struct llvmpipe_context.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
13 files changed:
src/gallium/auxiliary/draw/draw_llvm.c
src/gallium/auxiliary/draw/draw_llvm.h
src/gallium/auxiliary/gallivm/lp_bld_init.c
src/gallium/auxiliary/gallivm/lp_bld_init.h
src/gallium/drivers/llvmpipe/lp_context.c
src/gallium/drivers/llvmpipe/lp_context.h
src/gallium/drivers/llvmpipe/lp_state_fs.c
src/gallium/drivers/llvmpipe/lp_state_setup.c
src/gallium/drivers/llvmpipe/lp_test_arit.c
src/gallium/drivers/llvmpipe/lp_test_blend.c
src/gallium/drivers/llvmpipe/lp_test_conv.c
src/gallium/drivers/llvmpipe/lp_test_format.c
src/gallium/drivers/llvmpipe/lp_test_printf.c