st_glsl_to_tgsi: add support for prim id fragment shader input
authorDave Airlie <airlied@redhat.com>
Wed, 18 Dec 2013 08:00:33 +0000 (18:00 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 18 Dec 2013 22:46:29 +0000 (22:46 +0000)
For GLSL 1.50 we can get frag shaders with primitive id as an
input, add support to the translator for this.

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

index e7c357c9e428c7caf6271b5577f0fec2b62edb16..f72122b4f24f1bcbc61eb60785288db767c89d6e 100644 (file)
@@ -567,6 +567,11 @@ st_translate_fragment_program(struct st_context *st,
             input_semantic_index[slot] = 0;
             interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
             break;
+         case VARYING_SLOT_PRIMITIVE_ID:
+            input_semantic_name[slot] = TGSI_SEMANTIC_PRIMID;
+            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;