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 <brian.paul@tungstengraphics.com>
Mon, 24 Nov 2008 20:11:05 +0000 (13:11 -0700)
src/gallium/auxiliary/tgsi/tgsi_build.c
src/gallium/auxiliary/tgsi/tgsi_dump.c
src/gallium/include/pipe/p_shader_tokens.h

index 38fcaf88293eeb751c77b8352b08372c5e7be283..eee2db7771a1f2dd02a74329bc72618cf381647d 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 3177f5495231a6e9749e77a871921fa25f731b6e..c2a0ac5aff848a7d38783787ba46dae1cfa33e04 100644 (file)
@@ -246,6 +246,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 78c20de3e27b908f7500130dc9a0be09de50304b..1292367c66525fe1f4c74e2f86e960b0109a9723 100644 (file)
@@ -112,7 +112,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 */
 };