+static gl_vert_attrib
+semantic_to_vert_attrib(unsigned semantic)
+{
+ switch (semantic) {
+ case TGSI_SEMANTIC_POSITION:
+ return VERT_ATTRIB_POS;
+ case TGSI_SEMANTIC_COLOR:
+ return VERT_ATTRIB_COLOR0;
+ case TGSI_SEMANTIC_GENERIC:
+ case TGSI_SEMANTIC_TEXCOORD:
+ return VERT_ATTRIB_GENERIC0;
+ default:
+ unreachable("unhandled semantic");
+ }
+}
+
+static gl_varying_slot
+semantic_to_varying_slot(unsigned semantic)
+{
+ switch (semantic) {
+ case TGSI_SEMANTIC_POSITION:
+ return VARYING_SLOT_POS;
+ case TGSI_SEMANTIC_COLOR:
+ return VARYING_SLOT_COL0;
+ case TGSI_SEMANTIC_GENERIC:
+ case TGSI_SEMANTIC_TEXCOORD:
+ return VARYING_SLOT_TEX0;
+ default:
+ unreachable("unhandled semantic");
+ }
+}