gallium: when using gl_PointCoord ensure we use the correct attribute.
authorAlan Hourihane <alanh@vmware.com>
Wed, 8 Apr 2009 15:39:17 +0000 (16:39 +0100)
committerAlan Hourihane <alanh@vmware.com>
Wed, 8 Apr 2009 15:39:17 +0000 (16:39 +0100)
src/mesa/state_tracker/st_program.c

index f825204915cbc6c5e82270d7049f8f744dd0c036..6348e83d8ae51f2cae8c6af452a63b3e1e9b7d7b 100644 (file)
@@ -427,11 +427,13 @@ st_translate_fragment_program(struct st_context *st,
             interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
             break;
          case FRAG_ATTRIB_FOGC:
-            if (stfp->Base.UsesPointCoord)
+            if (stfp->Base.UsesPointCoord) {
                stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
-            else
+               stfp->input_semantic_index[slot] = num_generic++;
+            } else {
                stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
-            stfp->input_semantic_index[slot] = 0;
+               stfp->input_semantic_index[slot] = 0;
+           }
             interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
             break;
          case FRAG_ATTRIB_TEX0: