st/nir: Rework fixup_varying_slots
[mesa.git] / src / mesa / program / program_parser.h
index be952d4b9c88b7b3e5973e15ee9b6e25081f3e73..dadce126247889fa340785c5e86d810d37d3ec5f 100644 (file)
  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
-#pragma once
+
+#ifndef PROGRAM_PARSER_H
+#define PROGRAM_PARSER_H
 
 #include "main/config.h"
+#include "program/prog_parameter.h"
 
-#ifndef MTYPES_H
-struct __GLcontextRec;
-typedef struct __GLcontextRec GLcontext;
-#endif
+struct gl_context;
 
 enum asm_type {
    at_none,
@@ -46,7 +46,7 @@ struct asm_symbol {
    unsigned output_binding;   /**< Output / result register number. */
 
    /**
-    * One of PROGRAM_STATE_VAR, PROGRAM_LOCAL_PARAM, or PROGRAM_ENV_PARAM.
+    * One of PROGRAM_STATE_VAR or PROGRAM_CONSTANT.
     */
    unsigned param_binding_type;
 
@@ -99,7 +99,7 @@ struct asm_symbol {
 
 struct asm_vector {
    unsigned count;
-   float    data[4];
+   gl_constant_value data[4];
 };
 
 
@@ -131,9 +131,12 @@ struct asm_instruction {
 
 
 struct asm_parser_state {
-   GLcontext *ctx;
+   struct gl_context *ctx;
    struct gl_program *prog;
 
+   /** Memory context to attach instructions to. */
+   void *mem_ctx;
+
    /**
     * Per-program target limits
     */
@@ -176,6 +179,7 @@ struct asm_parser_state {
    unsigned MaxClipPlanes;
    unsigned MaxLights;
    unsigned MaxProgramMatrices;
+   unsigned MaxDrawBuffers;
    /*@}*/
 
    /**
@@ -192,7 +196,7 @@ struct asm_parser_state {
     * multiple ATTRIB statements bind illegal combinations of vertex
     * attributes.
     */
-   unsigned InputsBound;
+   GLbitfield64 InputsBound;
 
    enum {
       invalid_mode = 0,
@@ -208,7 +212,6 @@ struct asm_parser_state {
       unsigned Shadow:1;
       unsigned TexRect:1;
       unsigned TexArray:1;
-      unsigned NV_fragment:1;
       unsigned OriginUpperLeft:1;
       unsigned PixelCenterInteger:1;
    } option;
@@ -237,7 +240,7 @@ typedef struct YYLTYPE {
 #define YYLTYPE_IS_TRIVIAL 1
 
 
-extern GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target,
+extern GLboolean _mesa_parse_arb_program(struct gl_context *ctx, GLenum target,
     const GLubyte *str, GLsizei len, struct asm_parser_state *state);
 
 
@@ -286,17 +289,6 @@ extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state,
 extern int _mesa_parse_instruction_suffix(const struct asm_parser_state *state,
     const char *suffix, struct prog_instruction *inst);
 
-/**
- * Parses a condition code name
- *
- * The condition code names (e.g., \c LT, \c GT, \c NE) were added to assembly
- * shaders with the \c GL_NV_fragment_program_option extension.  This function
- * converts a string representation into one of the \c COND_ macros.
- *
- * \return
- * One of the \c COND_ macros defined in prog_instruction.h on success or zero
- * on failure.
- */
-extern int _mesa_parse_cc(const char *s);
-
 /*@}*/
+
+#endif /* PROGRAM_PARSER_H */