Merge branch 'master' into r300-compiler
[mesa.git] / src / mesa / shader / prog_instruction.h
index 3808644550276cda697880f4af4d56f79aa1d101..1c687bc16cfffce591f59979df31f0262b6242c2 100644 (file)
@@ -38,6 +38,9 @@
 #define PROG_INSTRUCTION_H
 
 
+#include "main/mfeatures.h"
+
+
 /**
  * Swizzle indexes.
  * Do not change!
 /*@{*/
 #define SATURATE_OFF            0
 #define SATURATE_ZERO_ONE       1
-#define SATURATE_PLUS_MINUS_ONE 2
 /*@}*/
 
 
 #define NEGATE_Y    0x2
 #define NEGATE_Z    0x4
 #define NEGATE_W    0x8
+#define NEGATE_XYZ  0x7
 #define NEGATE_XYZW 0xf
 #define NEGATE_NONE 0x0
 /*@}*/
@@ -258,37 +261,15 @@ struct prog_src_register
    GLuint Swizzle:12;
    GLuint RelAddr:1;
 
-   /**
-    * \name Source register "sign" control.
-    *
-    * The ARB and NV extensions allow varrying degrees of control over the
-    * sign of the source vector components.  These values allow enough control
-    * for all flavors of the extensions.
-    */
-   /*@{*/
-   /**
-    * 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
-    */
-   GLuint NegateBase:4;
-
-   /**
-    * Take the component-wise absolute value.
-    *
-    * \since
-    * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
-    * NV_vertex_program2_option.
-    */
+   /** Take the component-wise absolute value */
    GLuint Abs:1;
 
    /**
-    * Post-absolute value negation (all components).
+    * Post-Abs negation.
+    * This will either be NEGATE_NONE or NEGATE_XYZW, except for the SWZ
+    * instruction which allows per-component negation.
     */
-   GLuint NegateAbs:1;
-   /*@}*/
+   GLuint Negate:4;
 };
 
 
@@ -322,11 +303,11 @@ struct prog_dst_register
     * Condition code swizzle value.
     */
    GLuint CondSwizzle:12;
-   
+
    /**
     * Selects the condition code register to use for conditional destination
     * update masking.  In NV_fragmnet_program or NV_vertex_program2 mode, only
-    * condition code register 0 is available.  In NV_vertex_program3 mode, 
+    * condition code register 0 is available.  In NV_vertex_program3 mode,
     * condition code registers 0 and 1 are available.
     */
    GLuint CondSrc:1;
@@ -378,7 +359,7 @@ struct prog_instruction
     * NV_fragment_program, NV_fragment_program_option, NV_vertex_program3.
     */
    GLuint SaturateMode:2;
-   
+
    /**
     * Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12.
     *
@@ -393,7 +374,7 @@ struct prog_instruction
    /*@{*/
    /** Source texture unit. */
    GLuint TexSrcUnit:5;
-   
+
    /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */
    GLuint TexSrcTarget:3;
 
@@ -418,11 +399,6 @@ struct prog_instruction
 
    /** for driver use (try to remove someday) */
    GLint Aux;
-
-   /* XXX obsolete - remove someday */
-#if FEATURE_MESA_program_debug
-   GLshort StringPos;
-#endif
 };
 
 
@@ -452,6 +428,9 @@ _mesa_num_inst_dst_regs(gl_inst_opcode opcode);
 extern GLboolean
 _mesa_is_tex_instruction(gl_inst_opcode opcode);
 
+extern GLboolean
+_mesa_check_soa_dependencies(const struct prog_instruction *inst);
+
 extern const char *
 _mesa_opcode_string(gl_inst_opcode opcode);