tgsi: add tgsi_declaration fields for centroid sampling, invariant optimization
authorBrian Paul <brian.paul@tungstengraphics.com>
Mon, 24 Nov 2008 17:02:44 +0000 (10:02 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 6 Jan 2009 15:57:28 +0000 (08:57 -0700)
(cherry picked from commit 434e255eae90b0f3d836d452b7d3b0c5aadf78b8)

src/gallium/auxiliary/tgsi/tgsi_build.c
src/gallium/auxiliary/tgsi/tgsi_dump.c
src/gallium/include/pipe/p_shader_tokens.h

index 74614d368843f2195a5621898bb44daf26025810..1219c7da182a8e25c769ad4f631b1e9ef4db56f6 100644 (file)
@@ -119,6 +119,8 @@ tgsi_default_declaration( void )
    declaration.UsageMask = TGSI_WRITEMASK_XYZW;
    declaration.Interpolate = TGSI_INTERPOLATE_CONSTANT;
    declaration.Semantic = 0;
+   declaration.Centroid = 0;
+   declaration.Invariant = 0;
    declaration.Padding = 0;
    declaration.Extended = 0;
 
index 485e96379c09401b5facc6f1761418574cac5d37..2ed8c2bf07b3c8028fbf427a3337f5887964782b 100644 (file)
@@ -248,6 +248,14 @@ iter_declaration(
    TXT( ", " );
    ENM( decl->Declaration.Interpolate, interpolate_names );
 
+   if (decl->Declaration.Centroid) {
+      TXT( ", CENTROID" );
+   }
+
+   if (decl->Declaration.Invariant) {
+      TXT( ", INVARIANT" );
+   }
+
    EOL();
 
    return TRUE;
index a562e3a6b14db2ee94b068fa7cf8f85eaaf91172..d591f046fbcdaa2616f805e2f28221c4a8f57609 100644 (file)
@@ -85,7 +85,9 @@ struct tgsi_declaration
    unsigned UsageMask   : 4;  /* bitmask of TGSI_WRITEMASK_x flags */
    unsigned Interpolate : 4;  /* TGSI_INTERPOLATE_ */
    unsigned Semantic    : 1;  /* BOOL, any semantic info? */
-   unsigned Padding     : 6;
+   unsigned Centroid    : 1;  /* centroid sampling */
+   unsigned Invariant   : 1;  /* invariant optimization */
+   unsigned Padding     : 4;
    unsigned Extended    : 1;  /* BOOL */
 };