From 9af68e9b1d116cdc8eb6a22bac091fe4716679e6 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 7 May 2014 19:06:39 +0200 Subject: draw: do not use draw_get_option_use_llvm() inside draw execution paths 1c73e919a4b4dd79166d0633075990056f27fd28 made it possible to not allocate the tgsi machine if llvm was used. However, draw_get_option_use_llvm() is not reliable after draw context creation, since drivers can explicitly request a non-llvm draw context even if draw_get_option_use_llvm() would return true (and softpipe does just that) which leads to crashes. Thus use draw->llvm to determine if we're using llvm or not instead (and make draw->llvm available even if HAVE_LLVM is false so we don't have to put even more ifdefs). Cc: "10.2" Reviewed-by: Brian Paul --- src/gallium/auxiliary/draw/draw_vs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 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 eb7f4e0..dc50870 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -149,7 +149,7 @@ draw_vs_init( struct draw_context *draw ) { draw->dump_vs = debug_get_option_gallium_dump_vs(); - if (!draw_get_option_use_llvm()) { + if (!draw->llvm) { draw->vs.tgsi.machine = tgsi_exec_machine_create(); if (!draw->vs.tgsi.machine) return FALSE; @@ -175,7 +175,7 @@ draw_vs_destroy( struct draw_context *draw ) if (draw->vs.emit_cache) translate_cache_destroy(draw->vs.emit_cache); - if (!draw_get_option_use_llvm()) + if (!draw->llvm) tgsi_exec_machine_destroy(draw->vs.tgsi.machine); } -- cgit v1.1