st/mesa: add support for viewport index semantic
authorDave Airlie <airlied@redhat.com>
Tue, 21 Jan 2014 04:55:59 +0000 (14:55 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 11 Feb 2014 04:06:40 +0000 (14:06 +1000)
This adds GS output and FS input support, even though FS input
support isn't supported until GLSL 4.30 from what I can see.

Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/state_tracker/st_program.c

index cadbe1705a315a7d8f43ba18b956608bb96a91dc..438d52c21126cb5db2c48a102532638a9fb8038c 100644 (file)
@@ -572,6 +572,11 @@ st_translate_fragment_program(struct st_context *st,
             input_semantic_index[slot] = 0;
             interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
             break;
+         case VARYING_SLOT_VIEWPORT:
+            input_semantic_name[slot] = TGSI_SEMANTIC_VIEWPORT_INDEX;
+            input_semantic_index[slot] = 0;
+            interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
+            break;
          case VARYING_SLOT_CLIP_DIST0:
             input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
             input_semantic_index[slot] = 0;
@@ -1027,6 +1032,10 @@ st_translate_geometry_program(struct st_context *st,
             gs_output_semantic_name[slot] = TGSI_SEMANTIC_PRIMID;
             gs_output_semantic_index[slot] = 0;
             break;
+         case VARYING_SLOT_VIEWPORT:
+            gs_output_semantic_name[slot] = TGSI_SEMANTIC_VIEWPORT_INDEX;
+            gs_output_semantic_index[slot] = 0;
+            break;
          case VARYING_SLOT_TEX0:
          case VARYING_SLOT_TEX1:
          case VARYING_SLOT_TEX2: