aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/gallium/auxiliary/draw/draw_context.c9
-rw-r--r--src/gallium/auxiliary/draw/draw_context.h2
-rw-r--r--src/mesa/state_tracker/st_program.c9
3 files changed, 18 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/draw/draw_context.c b/src/gallium/auxiliary/draw/draw_context.c
index 5e2e2580fb6..fb0b22eae43 100644
--- a/src/gallium/auxiliary/draw/draw_context.c
+++ b/src/gallium/auxiliary/draw/draw_context.c
@@ -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.
diff --git a/src/gallium/auxiliary/draw/draw_context.h b/src/gallium/auxiliary/draw/draw_context.h
index 0170f13e735..c58c12cc497 100644
--- a/src/gallium/auxiliary/draw/draw_context.h
+++ b/src/gallium/auxiliary/draw/draw_context.h
@@ -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
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 1beba6317b6..84fd8e320af 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -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;