st_glsl_to_tgsi: add support for prim id fragment shader input

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>
This commit is contained in:
Dave Airlie
2013-12-18 18:00:33 +10:00
parent 28b552bf6b
commit 149140e922

View File

@@ -567,6 +567,11 @@ st_translate_fragment_program(struct st_context *st,
input_semantic_index[slot] = 0; input_semantic_index[slot] = 0;
interpMode[slot] = TGSI_INTERPOLATE_CONSTANT; interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
break; 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: case VARYING_SLOT_CLIP_DIST0:
input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST; input_semantic_name[slot] = TGSI_SEMANTIC_CLIPDIST;
input_semantic_index[slot] = 0; input_semantic_index[slot] = 0;