From efc82aef35a2aac5d2ed9774f6d28f2626796416 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 30 Nov 2010 16:07:52 -0700 Subject: gallivm/llvmpipe: squash merge of the llvm-context branch This branch defines a gallivm_state structure which contains the LLVMBuilderRef, LLVMContextRef, etc. All data structures built with this object can be periodically freed during a "garbage collection" operation. The gallivm_state object has to be passed to most of the builder functions where LLVMBuilderRef used to be used. Conflicts: src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c src/gallium/drivers/llvmpipe/lp_state_setup.c --- src/gallium/drivers/llvmpipe/lp_flush.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/gallium/drivers/llvmpipe/lp_flush.c') diff --git a/src/gallium/drivers/llvmpipe/lp_flush.c b/src/gallium/drivers/llvmpipe/lp_flush.c index e2c723b7a87..e8d00cf5169 100644 --- a/src/gallium/drivers/llvmpipe/lp_flush.c +++ b/src/gallium/drivers/llvmpipe/lp_flush.c @@ -56,6 +56,13 @@ llvmpipe_flush( struct pipe_context *pipe, /* ask the setup module to flush */ lp_setup_flush(llvmpipe->setup, flags, fence, reason); + + if (llvmpipe_variant_count > 1000) { + /* time to do a garbage collection */ + gallivm_garbage_collect(llvmpipe->gallivm); + llvmpipe_variant_count = 0; + } + /* Enable to dump BMPs of the color/depth buffers each frame */ if (0) { if (flags & PIPE_FLUSH_FRAME) { -- cgit v1.2.3