diff options
author | Jakob Bornecrantz <[email protected]> | 2012-01-09 18:17:07 +0100 |
---|---|---|
committer | Jakob Bornecrantz <[email protected]> | 2012-01-09 21:39:03 +0100 |
commit | f4863f3923152448e27ea68d0cd04411bbe3f4c7 (patch) | |
tree | 9a959aa50b07436b1dc67722d21b8037bd1ddb3c /src/gallium/auxiliary/draw/draw_context.c | |
parent | 3e22c7a25321554a32fa6254485912fd53deff3a (diff) |
draw: Fail if we fail to enable llvm when asked for it
The r300 driver requires LLVM when building and other drivers that
depend on it for all TNL, like i915g will be a lot slower without it.
Signed-off-by: Jakob Bornecrantz <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_context.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_context.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c index f4b1f8c973c..f6db95d756e 100644 --- a/src/gallium/auxiliary/draw/draw_context.c +++ b/src/gallium/auxiliary/draw/draw_context.c @@ -74,7 +74,7 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm, { struct draw_context *draw = CALLOC_STRUCT( draw_context ); if (draw == NULL) - goto fail; + goto err_out; #if HAVE_LLVM if (try_llvm && draw_get_option_use_llvm()) { @@ -83,20 +83,26 @@ draw_create_context(struct pipe_context *pipe, boolean try_llvm, draw->own_gallivm = gallivm; } - if (gallivm) - draw->llvm = draw_llvm_create(draw, gallivm); + if (!gallivm) + goto err_destroy; + + draw->llvm = draw_llvm_create(draw, gallivm); + + if (!draw->llvm) + goto err_destroy; } #endif if (!draw_init(draw)) - goto fail; + goto err_destroy; draw->pipe = pipe; return draw; -fail: +err_destroy: draw_destroy( draw ); +err_out: return NULL; } |