summaryrefslogtreecommitdiff
path: root/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2022-02-24 01:57:18 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2022-02-24 01:57:18 +0000
commitb24b5b9049e889ee4eb39b565bcc8d48bd45ab48 (patch)
tree658ca4e6b41655f49463c85edbaeda48979c394c /lib/mesa/src/gallium/auxiliary/draw/draw_vs.c
parent57768bbb154c2879d34ec20e401b19472e77aaf7 (diff)
Import Mesa 21.3.7
Diffstat (limited to 'lib/mesa/src/gallium/auxiliary/draw/draw_vs.c')
-rw-r--r--lib/mesa/src/gallium/auxiliary/draw/draw_vs.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c b/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c
index e8dbc11bc..41e6c7a04 100644
--- a/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c
+++ b/lib/mesa/src/gallium/auxiliary/draw/draw_vs.c
@@ -35,6 +35,8 @@
#include "util/u_memory.h"
#include "pipe/p_shader_tokens.h"
+#include "pipe/p_context.h"
+#include "pipe/p_screen.h"
#include "draw_private.h"
#include "draw_context.h"
@@ -46,6 +48,8 @@
#include "tgsi/tgsi_dump.h"
#include "tgsi/tgsi_exec.h"
+#include "nir/nir_to_tgsi.h"
+
DEBUG_GET_ONCE_BOOL_OPTION(gallium_dump_vs, "GALLIUM_DUMP_VS", FALSE)
@@ -54,6 +58,7 @@ draw_create_vertex_shader(struct draw_context *draw,
const struct pipe_shader_state *shader)
{
struct draw_vertex_shader *vs = NULL;
+ struct pipe_shader_state state = *shader;
if (draw->dump_vs) {
tgsi_dump(shader->tokens, 0);
@@ -61,12 +66,22 @@ draw_create_vertex_shader(struct draw_context *draw,
#ifdef DRAW_LLVM_AVAILABLE
if (draw->pt.middle.llvm) {
- vs = draw_create_vs_llvm(draw, shader);
+ struct pipe_screen *screen = draw->pipe->screen;
+ if (shader->type == PIPE_SHADER_IR_NIR &&
+ ((!screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
+ PIPE_SHADER_CAP_INTEGERS)) ||
+ (screen->get_shader_param(screen, PIPE_SHADER_VERTEX,
+ PIPE_SHADER_CAP_PREFERRED_IR) ==
+ PIPE_SHADER_IR_TGSI))) {
+ state.type = PIPE_SHADER_IR_TGSI;
+ state.tokens = nir_to_tgsi(shader->ir.nir, screen);
+ }
+ vs = draw_create_vs_llvm(draw, &state);
}
#endif
if (!vs) {
- vs = draw_create_vs_exec( draw, shader );
+ vs = draw_create_vs_exec( draw, &state );
}
if (vs)