tgsi/scan: fix scanning fragment shaders with PrimID and Position/Face
authorMarek Olšák <marek.olsak@amd.com>
Tue, 30 May 2017 00:04:29 +0000 (02:04 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 5 Jun 2017 16:29:42 +0000 (18:29 +0200)
Not relevant to radeonsi, because Position/Face are system values
with radeonsi, while this codepath is for drivers where Position and
Face are ordinary inputs.

Reviewed-by: Brian Paul <brianp@vmware.com>
src/gallium/auxiliary/tgsi/tgsi_scan.c

index 847f4fce28f5ecd94413cb626cf8d3fe6c117e33..018ca4b5bd40c10955bcc0d523bcffdc388f8dd1 100644 (file)
@@ -557,13 +557,16 @@ scan_declaration(struct tgsi_shader_info *info,
          /* Vertex shaders can have inputs with holes between them. */
          info->num_inputs = MAX2(info->num_inputs, reg + 1);
 
-         if (semName == TGSI_SEMANTIC_PRIMID)
-            info->uses_primid = TRUE;
-         else if (procType == PIPE_SHADER_FRAGMENT) {
-            if (semName == TGSI_SEMANTIC_POSITION)
-               info->reads_position = TRUE;
-            else if (semName == TGSI_SEMANTIC_FACE)
-               info->uses_frontface = TRUE;
+         switch (semName) {
+         case TGSI_SEMANTIC_PRIMID:
+            info->uses_primid = true;
+            break;
+         case TGSI_SEMANTIC_POSITION:
+            info->reads_position = true;
+            break;
+         case TGSI_SEMANTIC_FACE:
+            info->uses_frontface = true;
+            break;
          }
          break;