gallium: add TGSI_SEMANTIC_TEXCOORD,PCOORD v3
[mesa.git] / src / gallium / include / pipe / p_shader_tokens.h
index 81e4a6b52ce3e423dbc082e2c9160abca1dc34bd..478ce25f57cfc926a545d56abbd6a4584e64c037 100644 (file)
@@ -119,7 +119,8 @@ struct tgsi_declaration
    unsigned Interpolate : 1;  /**< any interpolation info? */
    unsigned Invariant   : 1;  /**< invariant optimization? */
    unsigned Local       : 1;  /**< optimize as subroutine local variable? */
-   unsigned Padding     : 7;
+   unsigned Array       : 1;  /**< extra array info? */
+   unsigned Padding     : 6;
 };
 
 struct tgsi_declaration_range
@@ -161,7 +162,9 @@ struct tgsi_declaration_interp
 #define TGSI_SEMANTIC_BLOCK_ID   16 /**< id of the current block */
 #define TGSI_SEMANTIC_BLOCK_SIZE 17 /**< block size in threads */
 #define TGSI_SEMANTIC_THREAD_ID  18 /**< block-relative id of the current thread */
-#define TGSI_SEMANTIC_COUNT      19 /**< number of semantic values */
+#define TGSI_SEMANTIC_TEXCOORD   19 /**< texture or sprite coordinates */
+#define TGSI_SEMANTIC_PCOORD     20 /**< point sprite coordinate */
+#define TGSI_SEMANTIC_COUNT      21 /**< number of semantic values */
 
 struct tgsi_declaration_semantic
 {
@@ -185,6 +188,11 @@ struct tgsi_declaration_sampler_view {
    unsigned ReturnTypeW : 6; /**< one of enum pipe_type */
 };
 
+struct tgsi_declaration_array {
+   unsigned ArrayID : 10;
+   unsigned Padding : 22;
+};
+
 /*
  * Special resources that don't need to be declared.  They map to the
  * GLOBAL/LOCAL/PRIVATE/INPUT compute memory spaces.
@@ -557,7 +565,7 @@ struct tgsi_instruction_predicate
  *
  * Index specifies the element number of a register in the register file.
  *
- * If Indirect is TRUE, Index should be offset by the X component of a source
+ * If Indirect is TRUE, Index should be offset by the X component of the indirect
  * register that follows. The register can be now fetched into local storage
  * for further processing.
  *
@@ -583,14 +591,26 @@ struct tgsi_src_register
 };
 
 /**
- * If tgsi_src_register::Modifier is TRUE, tgsi_src_register_modifier follows.
- * 
- * Then, if tgsi_src_register::Indirect is TRUE, another tgsi_src_register
- * follows.
+ * If tgsi_src_register::Indirect is TRUE, tgsi_ind_register follows.
+ *
+ * File, Index and Swizzle are handled the same as in tgsi_src_register.
+ *
+ * If ArrayID is zero the whole register file might be is indirectly addressed,
+ * if not only the Declaration with this ArrayID is accessed by this operand.
  *
- * Then, if tgsi_src_register::Dimension is TRUE, tgsi_dimension follows.
  */
 
+struct tgsi_ind_register
+{
+   unsigned File    : 4;  /* TGSI_FILE_ */
+   int      Index   : 16; /* SINT */
+   unsigned Swizzle : 2;  /* TGSI_SWIZZLE_ */
+   unsigned ArrayID : 10; /* UINT */
+};
+
+/**
+ * If tgsi_src_register::Dimension is TRUE, tgsi_dimension follows.
+ */
 
 struct tgsi_dimension
 {