aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/draw/draw_gs.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2019-09-05 15:47:19 +1000
committerDave Airlie <[email protected]>2019-11-28 14:48:56 +1000
commitbf12bc2dd7a28844103bb30a07be0440e60c5864 (patch)
tree3651f292b005c09b06889a6e52ac3b1b9e587f7e /src/gallium/auxiliary/draw/draw_gs.c
parent44a6b0107b37ad9644d3435cf6d2d29b6779654f (diff)
draw: add nir info gathering and building support
Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/draw/draw_gs.c')
-rw-r--r--src/gallium/auxiliary/draw/draw_gs.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index 94cfe860b6d..1e5d3a86ea0 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -35,7 +35,7 @@
#include "tgsi/tgsi_parse.h"
#include "tgsi/tgsi_exec.h"
-
+#include "nir/nir_to_tgsi_info.h"
#include "pipe/p_shader_tokens.h"
#include "util/u_math.h"
@@ -793,13 +793,17 @@ draw_create_geometry_shader(struct draw_context *draw,
gs->draw = draw;
gs->state = *state;
- gs->state.tokens = tgsi_dup_tokens(state->tokens);
- if (!gs->state.tokens) {
- FREE(gs);
- return NULL;
- }
- tgsi_scan_shader(state->tokens, &gs->info);
+ if (state->type == PIPE_SHADER_IR_TGSI) {
+ gs->state.tokens = tgsi_dup_tokens(state->tokens);
+ if (!gs->state.tokens) {
+ FREE(gs);
+ return NULL;
+ }
+
+ tgsi_scan_shader(state->tokens, &gs->info);
+ } else
+ nir_tgsi_scan_shader(state->ir.nir, &gs->info, false);
/* setup the defaults */
gs->max_out_prims = 0;