Remove TGSI_INTERPOLATE_ATTRIB.
authorMichal Krol <michal@tungstengraphics.com>
Mon, 29 Oct 2007 11:40:09 +0000 (11:40 +0000)
committerMichal Krol <michal@tungstengraphics.com>
Mon, 29 Oct 2007 13:25:00 +0000 (13:25 +0000)
src/mesa/pipe/tgsi/exec/tgsi_build.c
src/mesa/pipe/tgsi/exec/tgsi_token.h
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 56827726f5ceafe31424d863ab70f5ad48b18570..78f648aae256ab492985e89d622d49bf9acfa667 100644 (file)
@@ -294,7 +294,7 @@ tgsi_build_declaration_interpolation(
 {
    struct tgsi_declaration_interpolation di;
 
-   assert( interpolate <= TGSI_INTERPOLATE_ATTRIB );
+   assert( interpolate <= TGSI_INTERPOLATE_PERSPECTIVE );
 
    di = tgsi_default_declaration_interpolation();
    di.Interpolate = interpolate;
index 80c3fcd43423372cfe2b7e2707b3d9e35544cdd7..8d5992facbfb7b6f026aa245da58b9ad2f083818 100644 (file)
@@ -96,7 +96,6 @@ struct tgsi_declaration_mask
 #define TGSI_INTERPOLATE_CONSTANT      0
 #define TGSI_INTERPOLATE_LINEAR        1
 #define TGSI_INTERPOLATE_PERSPECTIVE   2
-#define TGSI_INTERPOLATE_ATTRIB        3  /**< Vertex shader input attrib */
 
 struct tgsi_declaration_interpolation
 {
index 37ba6a90b58f9a833d9297a706c49b04f84e07de..75195968e5cf577dd11e08ae195a31e03ec16cc7 100644 (file)
@@ -519,6 +519,7 @@ compile_instruction(
 static struct tgsi_full_declaration
 make_input_decl(
    GLuint index,
+   GLboolean interpolate_info,
    GLuint interpolate,
    GLuint usage_mask,
    GLboolean semantic_info,
@@ -534,14 +535,16 @@ make_input_decl(
    decl.Declaration.Declare = TGSI_DECLARE_RANGE;
    decl.Declaration.UsageMask = usage_mask;
    decl.Declaration.Semantic = semantic_info;
-   decl.Declaration.Interpolate = 1;
    decl.u.DeclarationRange.First = index;
    decl.u.DeclarationRange.Last = index;
    if (semantic_info) {
       decl.Semantic.SemanticName = semantic_name;
       decl.Semantic.SemanticIndex = semantic_index;
    }
-   decl.Interpolation.Interpolate = interpolate;
+   if (interpolate_info) {
+      decl.Declaration.Interpolate = 1;
+      decl.Interpolation.Interpolate = interpolate;
+   }
 
    return decl;
 }
@@ -685,7 +688,7 @@ tgsi_translate_mesa_program(
          case TGSI_SEMANTIC_POSITION:
             /* Fragment XY pos */
             fulldecl = make_input_decl(i,
-                                       TGSI_INTERPOLATE_CONSTANT,
+                                       GL_TRUE, TGSI_INTERPOLATE_CONSTANT,
                                        TGSI_WRITEMASK_XY,
                                        GL_TRUE, TGSI_SEMANTIC_POSITION, 0 );
             ti += tgsi_build_full_declaration(
@@ -695,7 +698,7 @@ tgsi_translate_mesa_program(
                                               maxTokens - ti );
             /* Fragment ZW pos */
             fulldecl = make_input_decl(i,
-                                       TGSI_INTERPOLATE_LINEAR,
+                                       GL_TRUE, TGSI_INTERPOLATE_LINEAR,
                                        TGSI_WRITEMASK_ZW,
                                        GL_TRUE, TGSI_SEMANTIC_POSITION, 0 );
             ti += tgsi_build_full_declaration(&fulldecl,
@@ -705,7 +708,7 @@ tgsi_translate_mesa_program(
             break;
          default:
             fulldecl = make_input_decl(i,
-                                       interpMode[i],
+                                       GL_TRUE, interpMode[i],
                                        TGSI_WRITEMASK_XYZW,
                                        GL_TRUE, inputSemanticName[i],
                                        inputSemanticIndex[i]);
@@ -722,10 +725,9 @@ tgsi_translate_mesa_program(
       for (i = 0; i < numInputs; i++) {
          struct tgsi_full_declaration fulldecl;
          fulldecl = make_input_decl(i,
-                                    TGSI_INTERPOLATE_ATTRIB,
+                                    GL_FALSE, 0,
                                     TGSI_WRITEMASK_XYZW,
-                                    GL_FALSE, inputSemanticName[i],
-                                    inputSemanticIndex[i]);
+                                    GL_FALSE, 0, 0);
          ti += tgsi_build_full_declaration(&fulldecl,
                                            &tokens[ti],
                                            header,