On Wednesday 09 December 2009 10:18:42 Zack Rusin wrote:
> I could do that but only if we agree it's in the name of love.
> 
> So is everyone ok with a new register SV for system generated values and
>  new declaration token called PROPERTY for shader specific properties (btw,
>  d3d calls those attributes, but since attributes already have a meaning in
>  glsl I think it'd probably wise to not try to redefine it).

Something like what's attached.
One of the fs properties might be imply the other, so I'm not sure if we'll 
need both but I just went with d3d does here.
diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h
index 588ca5e..e7f6dfc 100644
--- a/src/gallium/include/pipe/p_shader_tokens.h
+++ b/src/gallium/include/pipe/p_shader_tokens.h
@@ -55,6 +55,7 @@ struct tgsi_processor
 #define TGSI_TOKEN_TYPE_DECLARATION    0
 #define TGSI_TOKEN_TYPE_IMMEDIATE      1
 #define TGSI_TOKEN_TYPE_INSTRUCTION    2
+#define TGSI_TOKEN_TYPE_PROPERTY       3
 
 struct tgsi_token
 {
@@ -64,16 +65,17 @@ struct tgsi_token
 };
 
 enum tgsi_file_type {
-   TGSI_FILE_NULL        =0,
-   TGSI_FILE_CONSTANT    =1,
-   TGSI_FILE_INPUT       =2,
-   TGSI_FILE_OUTPUT      =3,
-   TGSI_FILE_TEMPORARY   =4,
-   TGSI_FILE_SAMPLER     =5,
-   TGSI_FILE_ADDRESS     =6,
-   TGSI_FILE_IMMEDIATE   =7,
-   TGSI_FILE_LOOP        =8,
-   TGSI_FILE_PREDICATE   =9,
+   TGSI_FILE_NULL         =0,
+   TGSI_FILE_CONSTANT     =1,
+   TGSI_FILE_INPUT        =2,
+   TGSI_FILE_OUTPUT       =3,
+   TGSI_FILE_TEMPORARY    =4,
+   TGSI_FILE_SAMPLER      =5,
+   TGSI_FILE_ADDRESS      =6,
+   TGSI_FILE_IMMEDIATE    =7,
+   TGSI_FILE_LOOP         =8,
+   TGSI_FILE_PREDICATE    =9,
+   TGSI_FILE_SYSTEM_VALUE =10,
    TGSI_FILE_COUNT      /**< how many TGSI_FILE_ types */
 };
 
@@ -151,6 +153,24 @@ union tgsi_immediate_data
    float Float;
 };
 
+#define TGSI_PROPERTY_FS_OUTPUT_DEPTH        0
+#define TGSI_PROPERTY_FS_EARLY_DEPTH_STENCIL 1
+#define TGSI_PROPERTY_GS_INPUT_PRIM          2
+#define TGSI_PROPERTY_GS_OUTPUT_PRIM         3
+#define TGSI_PROPERTY_GS_MAX_VERTICES        4
+#define TGSI_PROPERTY_GS_INSTANCES           5
+
+struct tgsi_property {
+   unsigned Type         : 4;  /**< TGSI_TOKEN_TYPE_PROPERTY */
+   unsigned NrTokens     : 8;  /**< UINT */
+   unsigned SemanticName : 8;  /**< one of TGSI_PROPERTY */
+   unsigned Padding;     : 12;
+};
+
+struct tgsi_property_data {
+   unsigned Data;
+};
+
 /* TGSI opcodes.  
  * 
  * For more information on semantics of opcodes and
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to