Fix Windows newlines.
[mesa.git] / src / mesa / shader / program_instruction.h
index 7b92075b09acb139388f4552f49da0851441ada9..93bcfc240a9e8a163f1f63588f3c15bdd2b45555 100644 (file)
@@ -54,7 +54,7 @@
 /*@}*/
 
 
-/*
+/**
  * Instruction precision for GL_NV_fragment_program
  */
 /*@{*/
 /*@}*/
 
 
+/**
+ * Saturation modes when storing values.
+ */
+/*@{*/
+#define SATURATE_OFF            0
+#define SATURATE_ZERO_ONE       1
+#define SATURATE_PLUS_MINUS_ONE 2
+/*@}*/
+
+
+/**
+ * Per-component negation masks
+ */
+/*@{*/
+#define NEGATE_X    0x1
+#define NEGATE_Y    0x2
+#define NEGATE_Z    0x4
+#define NEGATE_W    0x8
+#define NEGATE_XYZW 0xf
+#define NEGATE_NONE 0x0
+/*@}*/
+
+
 /**
  * Program instruction opcodes, for both vertex and fragment programs.
  * \note changes to this opcode list must be reflected in t_vb_arbprogram.c
@@ -163,7 +186,8 @@ struct prog_src_register
     */
    /*@{*/
    /**
-    * Per-component negation for the SWZ instruction.
+    * Per-component negation for the SWZ instruction.  For non-SWZ
+    * instructions the only possible values are NEGATE_XYZW and NEGATE_NONE.
     *
     * \since
     * ARB_vertex_program, ARB_fragment_program
@@ -180,8 +204,7 @@ struct prog_src_register
    GLuint Abs:1;
 
    /**
-    * Take the component-wise negation.  The negation occurs \b after the
-    * (optional) absolute value operation.
+    * Post-absolute value negation (all components).
     */
    GLuint NegateAbs:1;
    /*@}*/
@@ -267,8 +290,8 @@ struct prog_instruction
     * condition code register that is to be updated.
     *
     * In GL_NV_fragment_program or GL_NV_vertex_program2 mode, only condition
-    * code register 0 is available.  In GL_NV_vertex_program3 mode, condition code registers
-    * 0 and 1 are available.
+    * code register 0 is available.  In GL_NV_vertex_program3 mode, condition
+    * code registers 0 and 1 are available.
     *
     * \since
     * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
@@ -280,11 +303,12 @@ struct prog_instruction
     * Saturate each value of the vectored result to the range [0,1] or the
     * range [-1,1].  \c SSAT mode (i.e., saturation to the range [-1,1]) is
     * only available in NV_fragment_program2 mode.
+    * Value is one of the SATURATE_* tokens.
     *
     * \since
     * NV_fragment_program, NV_fragment_program_option, NV_vertex_program3.
     */
-   GLuint Saturate:2;
+   GLuint SaturateMode:2;
    
    /**
     * Per-instruction selectable precision.