* 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,
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;
struct asm_vector {
unsigned count;
- float data[4];
+ gl_constant_value data[4];
};
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
*/
unsigned MaxClipPlanes;
unsigned MaxLights;
unsigned MaxProgramMatrices;
+ unsigned MaxDrawBuffers;
/*@}*/
/**
* multiple ATTRIB statements bind illegal combinations of vertex
* attributes.
*/
- unsigned InputsBound;
+ GLbitfield64 InputsBound;
enum {
invalid_mode = 0,
unsigned Shadow:1;
unsigned TexRect:1;
unsigned TexArray:1;
- unsigned NV_fragment:1;
unsigned OriginUpperLeft:1;
unsigned PixelCenterInteger:1;
} option;
#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);
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 */