mesa: add comments and change Index2D to just Index2
[mesa.git] / src / mesa / program / prog_instruction.h
index 5cdc321a31625b65cb090e0cce53ff8456b8e293..dacbc33704bb974119be9d66308580f5525e331b 100644 (file)
 
 
 /**
- * Program instruction opcodes, for both vertex and fragment programs.
- * \note changes to this opcode list must be reflected in t_vb_arbprogram.c
+ * Program instruction opcodes for vertex, fragment and geometry programs.
  */
 typedef enum prog_opcode {
                      /* ARB_vp   ARB_fp   NV_vp   NV_fp     GLSL */
@@ -170,9 +169,9 @@ typedef enum prog_opcode {
    OPCODE_DPH,       /*   X        X       1.1                   */
    OPCODE_DST,       /*   X        X       X       X             */
    OPCODE_ELSE,      /*                                      X   */
-   OPCODE_EMIT_VERTEX,  /*                                      X   */
+   OPCODE_EMIT_VERTEX,/*                                     X   */
    OPCODE_END,       /*   X        X       X       X        opt  */
-   OPCODE_END_PRIMITIVE,/*                                      X   */
+   OPCODE_END_PRIMITIVE,/*                                   X   */
    OPCODE_ENDIF,     /*                                     opt  */
    OPCODE_ENDLOOP,   /*                                     opt  */
    OPCODE_ENDSUB,    /*                                     opt  */
@@ -272,6 +271,22 @@ struct prog_src_register
     * instruction which allows per-component negation.
     */
    GLuint Negate:4;
+
+   /**
+    * Is the register two-dimensional.
+    * Two dimensional registers are of the
+    * REGISTER[index][index2] format.
+    * They are used by the geometry shaders where
+    * the first index is the index within an array
+    * and the second index is the semantic of the
+    * array, e.g. gl_PositionIn[index] would become
+    * INPUT[index][gl_PositionIn]
+    */
+   GLuint HasIndex2:1;
+   GLuint RelAddr2:1;
+   GLint Index2:(INST_INDEX_BITS+1); /**< Extra bit here for sign bit.
+                                       * May be negative for relative
+                                       * addressing. */
 };