From 4b6d6642d2c64ce67d65ead480fb99104a7e2d3a Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 18 Nov 2014 22:46:00 +0100 Subject: draw: fixes for vertex shaders outputting layer or viewport index Mostly add a couple cases so we don't just check gs for this. There's only one gotcha, the built-in vp transform in the llvm vs can't handle it (this would be fixable though non-trivial due to vp index being non-constant for the SoA outputs, but we don't use it if there's a gs neither - the whole clip/vp transform integration there is suboptimal). Reviewed-by: Jose Fonseca --- src/gallium/auxiliary/draw/draw_vs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/gallium/auxiliary/draw/draw_vs.c') diff --git a/src/gallium/auxiliary/draw/draw_vs.c b/src/gallium/auxiliary/draw/draw_vs.c index dc50870..f24354e 100644 --- a/src/gallium/auxiliary/draw/draw_vs.c +++ b/src/gallium/auxiliary/draw/draw_vs.c @@ -85,7 +85,9 @@ draw_create_vertex_shader(struct draw_context *draw, vs->info.output_semantic_index[i] == 0) { found_clipvertex = TRUE; vs->clipvertex_output = i; - } else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CLIPDIST) { + } else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_VIEWPORT_INDEX) + vs->viewport_index_output = i; + else if (vs->info.output_semantic_name[i] == TGSI_SEMANTIC_CLIPDIST) { debug_assert(vs->info.output_semantic_index[i] < PIPE_MAX_CLIP_OR_CULL_DISTANCE_ELEMENT_COUNT); vs->clipdistance_output[vs->info.output_semantic_index[i]] = i; -- cgit v1.1