}
}
-/* Temporary helper to remap back to TGSI style semantic name/index
- * values, for use in drivers that haven't been converted to using
- * VARYING_SLOT_
- */
-void
-varying_slot_to_tgsi_semantic(gl_varying_slot slot,
- unsigned *semantic_name, unsigned *semantic_index)
-{
- static const unsigned map[][2] = {
- [VARYING_SLOT_POS] = { TGSI_SEMANTIC_POSITION, 0 },
- [VARYING_SLOT_COL0] = { TGSI_SEMANTIC_COLOR, 0 },
- [VARYING_SLOT_COL1] = { TGSI_SEMANTIC_COLOR, 1 },
- [VARYING_SLOT_BFC0] = { TGSI_SEMANTIC_BCOLOR, 0 },
- [VARYING_SLOT_BFC1] = { TGSI_SEMANTIC_BCOLOR, 1 },
- [VARYING_SLOT_FOGC] = { TGSI_SEMANTIC_FOG, 0 },
- [VARYING_SLOT_PSIZ] = { TGSI_SEMANTIC_PSIZE, 0 },
- [VARYING_SLOT_FACE] = { TGSI_SEMANTIC_FACE, 0 },
- [VARYING_SLOT_EDGE] = { TGSI_SEMANTIC_EDGEFLAG, 0 },
- [VARYING_SLOT_PRIMITIVE_ID] = { TGSI_SEMANTIC_PRIMID, 0 },
- [VARYING_SLOT_CLIP_DIST0] = { TGSI_SEMANTIC_CLIPDIST, 0 },
- [VARYING_SLOT_CLIP_DIST1] = { TGSI_SEMANTIC_CLIPDIST, 1 },
- [VARYING_SLOT_CLIP_VERTEX] = { TGSI_SEMANTIC_CLIPVERTEX, 0 },
- [VARYING_SLOT_PNTC] = { TGSI_SEMANTIC_PCOORD, 0 },
- [VARYING_SLOT_VIEWPORT] = { TGSI_SEMANTIC_VIEWPORT_INDEX, 0 },
- [VARYING_SLOT_LAYER] = { TGSI_SEMANTIC_LAYER, 0 },
- };
-
- if (slot >= VARYING_SLOT_VAR0) {
- *semantic_name = TGSI_SEMANTIC_GENERIC;
- *semantic_index = slot - VARYING_SLOT_VAR0;
- return;
- }
-
- if (slot >= VARYING_SLOT_TEX0 && slot <= VARYING_SLOT_TEX7) {
- *semantic_name = TGSI_SEMANTIC_TEXCOORD;
- *semantic_index = slot - VARYING_SLOT_TEX0;
- return;
- }
-
- if (slot >= ARRAY_SIZE(map)) {
- fprintf(stderr, "Unknown varying slot %d\n", slot);
- abort();
- }
-
- *semantic_name = map[slot][0];
- *semantic_index = map[slot][1];
-}
-
-/* Temporary helper to remap back to TGSI style semantic name/index
- * values, for use in drivers that haven't been converted to using
- * FRAG_RESULT_
- */
-void
-frag_result_to_tgsi_semantic(gl_frag_result slot,
- unsigned *semantic_name, unsigned *semantic_index)
-{
- static const unsigned map[][2] = {
- [FRAG_RESULT_DEPTH] = { TGSI_SEMANTIC_POSITION, 0 },
- [FRAG_RESULT_COLOR] = { TGSI_SEMANTIC_COLOR, -1 },
- [FRAG_RESULT_DATA0 + 0] = { TGSI_SEMANTIC_COLOR, 0 },
- [FRAG_RESULT_DATA0 + 1] = { TGSI_SEMANTIC_COLOR, 1 },
- [FRAG_RESULT_DATA0 + 2] = { TGSI_SEMANTIC_COLOR, 2 },
- [FRAG_RESULT_DATA0 + 3] = { TGSI_SEMANTIC_COLOR, 3 },
- [FRAG_RESULT_DATA0 + 4] = { TGSI_SEMANTIC_COLOR, 4 },
- [FRAG_RESULT_DATA0 + 5] = { TGSI_SEMANTIC_COLOR, 5 },
- [FRAG_RESULT_DATA0 + 6] = { TGSI_SEMANTIC_COLOR, 6 },
- [FRAG_RESULT_DATA0 + 7] = { TGSI_SEMANTIC_COLOR, 7 },
- };
-
- *semantic_name = map[slot][0];
- *semantic_index = map[slot][1];
-}
-
static nir_ssa_def *
ttn_src_for_dest(nir_builder *b, nir_alu_dest *dest)
{