From 81722c5d7e8e93d837510b9e6e5d014ec64cf4b3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 10 Sep 2009 15:04:24 -0700 Subject: NV fp parser: Add support for condition codes Conditional write masks and the condition-code based KIL instruction are all supported. The specific behavior of KIL in the following shader may or may not match the behavior of other implementations: !!ARBfp1.0 TEMP GT; MOVC GT, fragment.texcoord[0]; KIL GT.x; END Should be it interpreted as 'KIL srcReg' or as 'KIL ccTest'? The current parser will interpret it as 'KIL srcReg'. --- src/mesa/shader/program_parser.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/shader/program_parser.h') diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index 497891f53d..bce6041381 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -278,4 +278,17 @@ 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); + /*@}*/ -- cgit v1.2.3