mesa: Allows querying GL_SAMPLER_BINDING on GLES3 profile
[mesa.git] / src / mesa / program / prog_instruction.h
index 1d850c4d5d5c74b0a4949d9b20e74fd02de628bc..0957bd9d77982a4756c59f2097271c65b57499f4 100644 (file)
@@ -1,6 +1,5 @@
 /*
  * Mesa 3-D graphics library
- * Version:  7.3
  *
  * Copyright (C) 1999-2008  Brian Paul   All Rights Reserved.
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
- * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
- * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
@@ -38,7 +38,7 @@
 #define PROG_INSTRUCTION_H
 
 
-#include "main/mfeatures.h"
+#include "main/glheader.h"
 
 
 /**
@@ -147,45 +147,37 @@ typedef enum prog_opcode {
    OPCODE_NOP = 0,   /*                                      X   */
    OPCODE_ABS,       /*   X        X       1.1               X   */
    OPCODE_ADD,       /*   X        X       X       X         X   */
-   OPCODE_AND,       /*                                          */
-   OPCODE_ARA,       /*                    2                     */
    OPCODE_ARL,       /*   X                X                 X   */
-   OPCODE_ARL_NV,    /*                    2                     */
-   OPCODE_ARR,       /*                    2                     */
    OPCODE_BGNLOOP,   /*                                     opt  */
    OPCODE_BGNSUB,    /*                                     opt  */
-   OPCODE_BRA,       /*                    2                 X   */
    OPCODE_BRK,       /*                    2                opt  */
-   OPCODE_CAL,       /*                    2       2         X   */
+   OPCODE_CAL,       /*                    2       2        opt  */
    OPCODE_CMP,       /*            X                         X   */
    OPCODE_CONT,      /*                                     opt  */
    OPCODE_COS,       /*            X       2       X         X   */
    OPCODE_DDX,       /*                            X         X   */
    OPCODE_DDY,       /*                            X         X   */
    OPCODE_DP2,       /*                            2         X   */
-   OPCODE_DP2A,      /*                            2             */
    OPCODE_DP3,       /*   X        X       X       X         X   */
    OPCODE_DP4,       /*   X        X       X       X         X   */
    OPCODE_DPH,       /*   X        X       1.1                   */
    OPCODE_DST,       /*   X        X       X       X             */
-   OPCODE_ELSE,      /*                                      X   */
-   OPCODE_EMIT_VERTEX,/*                                     X   */
+   OPCODE_ELSE,      /*                                     opt  */
    OPCODE_END,       /*   X        X       X       X        opt  */
-   OPCODE_END_PRIMITIVE,/*                                   X   */
    OPCODE_ENDIF,     /*                                     opt  */
    OPCODE_ENDLOOP,   /*                                     opt  */
    OPCODE_ENDSUB,    /*                                     opt  */
    OPCODE_EX2,       /*   X        X       2       X         X   */
-   OPCODE_EXP,       /*   X                X                 X   */
+   OPCODE_EXP,       /*   X                X                     */
    OPCODE_FLR,       /*   X        X       2       X         X   */
    OPCODE_FRC,       /*   X        X       2       X         X   */
    OPCODE_IF,        /*                                     opt  */
-   OPCODE_KIL,       /*            X                             */
+   OPCODE_KIL,       /*            X                         X   */
    OPCODE_KIL_NV,    /*                            X         X   */
    OPCODE_LG2,       /*   X        X       2       X         X   */
    OPCODE_LIT,       /*   X        X       X       X             */
-   OPCODE_LOG,       /*   X                X                 X   */
-   OPCODE_LRP,       /*            X               X         X   */
+   OPCODE_LOG,       /*   X                X                     */
+   OPCODE_LRP,       /*            X               X             */
    OPCODE_MAD,       /*   X        X       X       X         X   */
    OPCODE_MAX,       /*   X        X       X       X         X   */
    OPCODE_MIN,       /*   X        X       X       X         X   */
@@ -195,36 +187,21 @@ typedef enum prog_opcode {
    OPCODE_NOISE2,    /*                                      X   */
    OPCODE_NOISE3,    /*                                      X   */
    OPCODE_NOISE4,    /*                                      X   */
-   OPCODE_NOT,       /*                                          */
-   OPCODE_NRM3,      /*                                      X   */
-   OPCODE_NRM4,      /*                                      X   */
-   OPCODE_OR,        /*                                          */
-   OPCODE_PK2H,      /*                            X             */
-   OPCODE_PK2US,     /*                            X             */
-   OPCODE_PK4B,      /*                            X             */
-   OPCODE_PK4UB,     /*                            X             */
    OPCODE_POW,       /*   X        X               X         X   */
-   OPCODE_POPA,      /*                    3                     */
-   OPCODE_PRINT,     /*                    X       X             */
-   OPCODE_PUSHA,     /*                    3                     */
-   OPCODE_RCC,       /*                    1.1                   */
    OPCODE_RCP,       /*   X        X       X       X         X   */
-   OPCODE_RET,       /*                    2       2         X   */
-   OPCODE_RFL,       /*            X               X             */
+   OPCODE_RET,       /*                    2       2        opt  */
    OPCODE_RSQ,       /*   X        X       X       X         X   */
-   OPCODE_SCS,       /*            X                             */
+   OPCODE_SCS,       /*            X                         X   */
    OPCODE_SEQ,       /*                    2       X         X   */
-   OPCODE_SFL,       /*                    2       X             */
    OPCODE_SGE,       /*   X        X       X       X         X   */
    OPCODE_SGT,       /*                    2       X         X   */
    OPCODE_SIN,       /*            X       2       X         X   */
    OPCODE_SLE,       /*                    2       X         X   */
    OPCODE_SLT,       /*   X        X       X       X         X   */
    OPCODE_SNE,       /*                    2       X         X   */
-   OPCODE_SSG,       /*                    2                     */
-   OPCODE_STR,       /*                    2       X             */
+   OPCODE_SSG,       /*                    2                 X   */
    OPCODE_SUB,       /*   X        X       1.1     X         X   */
-   OPCODE_SWZ,       /*   X        X                             */
+   OPCODE_SWZ,       /*   X        X                         X   */
    OPCODE_TEX,       /*            X       3       X         X   */
    OPCODE_TXB,       /*            X       3                 X   */
    OPCODE_TXD,       /*                            X         X   */
@@ -232,13 +209,7 @@ typedef enum prog_opcode {
    OPCODE_TXP,       /*            X                         X   */
    OPCODE_TXP_NV,    /*                    3       X             */
    OPCODE_TRUNC,     /*                                      X   */
-   OPCODE_UP2H,      /*                            X             */
-   OPCODE_UP2US,     /*                            X             */
-   OPCODE_UP4B,      /*                            X             */
-   OPCODE_UP4UB,     /*                            X             */
-   OPCODE_X2D,       /*                            X             */
-   OPCODE_XOR,       /*                                          */
-   OPCODE_XPD,       /*   X        X                         X   */
+   OPCODE_XPD,       /*   X        X                             */
    MAX_OPCODE
 } gl_inst_opcode;
 
@@ -247,7 +218,7 @@ typedef enum prog_opcode {
  * Number of bits for the src/dst register Index field.
  * This limits the size of temp/uniform register files.
  */
-#define INST_INDEX_BITS 10
+#define INST_INDEX_BITS 12
 
 
 /**
@@ -304,8 +275,7 @@ struct prog_dst_register
     * \name Conditional destination update control.
     *
     * \since
-    * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
-    * NV_vertex_program2_option.
+    * NV_fragment_program_option, NV_vertex_program2, NV_vertex_program2_option.
     */
    /*@{*/
    /**
@@ -320,15 +290,6 @@ 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 registers 0 and 1 are available.
-    */
-   GLuint CondSrc:1;
-   /*@}*/
 };
 
 
@@ -346,8 +307,7 @@ struct prog_instruction
     * register.
     *
     * \since
-    * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
-    * NV_vertex_program2_option.
+    * NV_fragment_program_option, NV_vertex_program2, NV_vertex_program2_option.
     */
    GLuint CondUpdate:1;
 
@@ -360,8 +320,7 @@ struct prog_instruction
     * code registers 0 and 1 are available.
     *
     * \since
-    * NV_fragment_program, NV_fragment_program_option, NV_vertex_program2,
-    * NV_vertex_program2_option.
+    * NV_fragment_program_option, NV_vertex_program2, NV_vertex_program2_option.
     */
    GLuint CondDst:1;
 
@@ -372,7 +331,7 @@ struct prog_instruction
     * Value is one of the SATURATE_* tokens.
     *
     * \since
-    * NV_fragment_program, NV_fragment_program_option, NV_vertex_program3.
+    * NV_fragment_program_option, NV_vertex_program3.
     */
    GLuint SaturateMode:2;
 
@@ -380,7 +339,7 @@ struct prog_instruction
     * Per-instruction selectable precision: FLOAT32, FLOAT16, FIXED12.
     *
     * \since
-    * NV_fragment_program, NV_fragment_program_option.
+    * NV_fragment_program_option.
     */
    GLuint Precision:3;
 
@@ -392,7 +351,7 @@ struct prog_instruction
    GLuint TexSrcUnit:5;
 
    /** Source texture target, one of TEXTURE_{1D,2D,3D,CUBE,RECT}_INDEX */
-   GLuint TexSrcTarget:3;
+   GLuint TexSrcTarget:4;
 
    /** True if tex instruction should do shadow comparison */
    GLuint TexShadow:1;
@@ -410,24 +369,21 @@ struct prog_instruction
    /** for debugging purposes */
    const char *Comment;
 
-   /** Arbitrary data.  Used for OPCODE_PRINT and some drivers */
-   void *Data;
-
    /** for driver use (try to remove someday) */
    GLint Aux;
 };
 
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 extern void
 _mesa_init_instructions(struct prog_instruction *inst, GLuint count);
 
 extern struct prog_instruction *
 _mesa_alloc_instructions(GLuint numInst);
 
-extern struct prog_instruction *
-_mesa_realloc_instructions(struct prog_instruction *oldInst,
-                           GLuint numOldInst, GLuint numNewInst);
-
 extern struct prog_instruction *
 _mesa_copy_instructions(struct prog_instruction *dest,
                         const struct prog_instruction *src, GLuint n);
@@ -451,4 +407,8 @@ extern const char *
 _mesa_opcode_string(gl_inst_opcode opcode);
 
 
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
 #endif /* PROG_INSTRUCTION_H */