tgsi: fix detection of front-facing attribute
authorBrian Paul <brianp@vmware.com>
Fri, 15 Jan 2010 21:57:55 +0000 (14:57 -0700)
committerBrian Paul <brianp@vmware.com>
Fri, 15 Jan 2010 21:57:58 +0000 (14:57 -0700)
This code was not updated when we added TGSI_SEMANTIC_FACE a while ago.

src/gallium/auxiliary/tgsi/tgsi_scan.c

index f9c16f1b6cb78968ed029ad4862bfe9af6775057..a4414d118a86dbe873be1a950f686ed97ed6a54e 100644 (file)
@@ -101,12 +101,10 @@ tgsi_scan_shader(const struct tgsi_token *tokens,
                   if (src->SrcRegister.File == TGSI_FILE_INPUT) {
                      const int ind = src->SrcRegister.Index;
                      if (info->input_semantic_name[ind] == TGSI_SEMANTIC_FOG) {
-                        if (src->SrcRegister.SwizzleX == TGSI_SWIZZLE_X) {
-                           info->uses_fogcoord = TRUE;
-                        }
-                        else if (src->SrcRegister.SwizzleX == TGSI_SWIZZLE_Y) {
-                           info->uses_frontfacing = TRUE;
-                        }
+                        info->uses_fogcoord = TRUE;
+                     }
+                     else if (info->input_semantic_name[ind] == TGSI_SEMANTIC_FACE) {
+                        info->uses_frontfacing = TRUE;
                      }
                   }
                }