diff options
author | Roland Scheidegger <[email protected]> | 2014-05-07 19:06:39 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2014-05-08 16:26:49 +0200 |
commit | 9af68e9b1d116cdc8eb6a22bac091fe4716679e6 (patch) | |
tree | fbcbda42c4b4a5f4079375f1457a909eaf5a558f /src/gallium/auxiliary/draw/draw_gs.c | |
parent | e6967270c75a5b669152127bb7a746d55f4407a6 (diff) |
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" <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_gs.c')
-rw-r--r-- | src/gallium/auxiliary/draw/draw_gs.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c index 5e503fff76a..fc4f69792fa 100644 --- a/src/gallium/auxiliary/draw/draw_gs.c +++ b/src/gallium/auxiliary/draw/draw_gs.c @@ -597,7 +597,7 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader, #ifdef HAVE_LLVM - if (draw_get_option_use_llvm()) { + if (shader->draw->llvm) { shader->gs_output = output_verts->verts; if (max_out_prims > shader->max_out_prims) { unsigned i; @@ -674,7 +674,7 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader, void draw_geometry_shader_prepare(struct draw_geometry_shader *shader, struct draw_context *draw) { - boolean use_llvm = draw_get_option_use_llvm(); + boolean use_llvm = draw->llvm != NULL; if (!use_llvm && shader && shader->machine->Tokens != shader->state.tokens) { tgsi_exec_machine_bind_shader(shader->machine, shader->state.tokens, @@ -686,7 +686,7 @@ void draw_geometry_shader_prepare(struct draw_geometry_shader *shader, boolean draw_gs_init( struct draw_context *draw ) { - if (!draw_get_option_use_llvm()) { + if (!draw->llvm) { draw->gs.tgsi.machine = tgsi_exec_machine_create(); if (!draw->gs.tgsi.machine) return FALSE; @@ -715,7 +715,7 @@ draw_create_geometry_shader(struct draw_context *draw, const struct pipe_shader_state *state) { #ifdef HAVE_LLVM - boolean use_llvm = draw_get_option_use_llvm(); + boolean use_llvm = draw->llvm != NULL; struct llvm_geometry_shader *llvm_gs; #endif struct draw_geometry_shader *gs; @@ -870,7 +870,7 @@ void draw_delete_geometry_shader(struct draw_context *draw, return; } #ifdef HAVE_LLVM - if (draw_get_option_use_llvm()) { + if (draw->llvm) { struct llvm_geometry_shader *shader = llvm_geometry_shader(dgs); struct draw_gs_llvm_variant_list_item *li; |