ttn: remove {varying_slot, frag_result}_to_tgsi_semantic helpers
authorEmil Velikov <emil.velikov@collabora.com>
Wed, 28 Feb 2018 14:30:06 +0000 (14:30 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 8 Aug 2018 12:33:07 +0000 (13:33 +0100)
The respective drivers have been updated and the helpers are no longer
needed.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gallium/auxiliary/nir/tgsi_to_nir.c
src/gallium/auxiliary/nir/tgsi_to_nir.h

index 1b31b564246719881ea280d65b02505fe881ba27..12114dc2030ab8d841295b3283b7a57b358b33e2 100644 (file)
@@ -144,79 +144,6 @@ tgsi_varying_semantic_to_slot(unsigned semantic, unsigned index)
    }
 }
 
-/* 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)
 {
index f480009afa41546eb4f021676b3bf36a4c336505..a7060bca610b79af80f13c826cd7feb116c20965 100644 (file)
@@ -26,9 +26,3 @@
 struct nir_shader *
 tgsi_to_nir(const void *tgsi_tokens,
             const struct nir_shader_compiler_options *options);
-void
-varying_slot_to_tgsi_semantic(gl_varying_slot slot,
-                              unsigned *semantic_name, unsigned *semantic_index);
-void
-frag_result_to_tgsi_semantic(gl_frag_result slot,
-                             unsigned *semantic_name, unsigned *semantic_index);