draw, st/mesa: generate TGSI for ffvp/ARB_vp if draw lacks LLVM

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
This commit is contained in:
Marek Olšák 2019-12-04 17:27:13 -05:00
parent a3de63fbb3
commit 41118246c6
3 changed files with 18 additions and 2 deletions

View file

@ -63,6 +63,15 @@ draw_get_option_use_llvm(void)
}
#endif
bool
draw_has_llvm(void)
{
#ifdef LLVM_AVAILABLE
return draw_get_option_use_llvm();
#else
return false;
#endif
}
/**
* Create new draw module context with gallivm state for LLVM JIT.

View file

@ -63,6 +63,8 @@ struct draw_so_target {
int internal_offset;
};
bool draw_has_llvm(void);
struct draw_context *draw_create( struct pipe_context *pipe );
#ifdef LLVM_AVAILABLE

View file

@ -462,7 +462,11 @@ st_translate_vertex_program(struct st_context *st,
stp->state.type = PIPE_SHADER_IR_NIR;
stp->Base.nir = st_translate_prog_to_nir(st, &stp->Base,
MESA_SHADER_VERTEX);
return true;
/* For st_draw_feedback, we need to generate TGSI too if draw doesn't
* use LLVM.
*/
if (draw_has_llvm())
return true;
}
}
@ -578,7 +582,8 @@ st_create_vp_variant(struct st_context *st,
state.stream_output = stvp->state.stream_output;
if (stvp->state.type == PIPE_SHADER_IR_NIR) {
if (stvp->state.type == PIPE_SHADER_IR_NIR &&
(!key->is_draw_shader || draw_has_llvm())) {
bool finalize = false;
state.type = PIPE_SHADER_IR_NIR;