From 1c73e919a4b4dd79166d0633075990056f27fd28 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 23 Apr 2014 17:06:13 -0400 Subject: draw/llvm: reduce memory usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lets make draw_get_option_use_llvm function available unconditionally and use it to avoid useless allocations when LLVM paths are active. TGSI machine is never used when we're using LLVM. Signed-off-by: Zack Rusin Reviewed-by: Roland Scheidegger Reviewed-by: José Fonseca --- src/gallium/auxiliary/draw/draw_vs.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/gallium/auxiliary/draw/draw_vs.c') diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index 55cbeb9..eb7f4e0 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -149,9 +149,11 @@ draw_vs_init( struct draw_context *draw ) { draw->dump_vs = debug_get_option_gallium_dump_vs(); - draw->vs.tgsi.machine = tgsi_exec_machine_create(); - if (!draw->vs.tgsi.machine) - return FALSE; + if (!draw_get_option_use_llvm()) { + draw->vs.tgsi.machine = tgsi_exec_machine_create(); + if (!draw->vs.tgsi.machine) + return FALSE; + } draw->vs.emit_cache = translate_cache_create(); if (!draw->vs.emit_cache) @@ -173,7 +175,8 @@ draw_vs_destroy( struct draw_context *draw ) if (draw->vs.emit_cache) translate_cache_destroy(draw->vs.emit_cache); - tgsi_exec_machine_destroy(draw->vs.tgsi.machine); + if (!draw_get_option_use_llvm()) + tgsi_exec_machine_destroy(draw->vs.tgsi.machine); } -- cgit v1.1