From: Brian Paul Date: Wed, 28 Oct 2009 17:33:51 +0000 (-0600) Subject: Merge branch 'mesa_7_6_branch' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d56caabe45e91a67096804c7e341d04d01db7aa;p=mesa.git Merge branch 'mesa_7_6_branch' Conflicts: src/mesa/shader/lex.yy.c src/mesa/shader/program_lexer.l --- 7d56caabe45e91a67096804c7e341d04d01db7aa diff --cc src/mesa/shader/lex.yy.c index 17843c2121b,728c2dc272d..5e605274aaa --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@@ -53,6 -53,6 +53,7 @@@ typedef int flex_int32_t typedef unsigned char flex_uint8_t; typedef unsigned short int flex_uint16_t; typedef unsigned int flex_uint32_t; ++#endif /* ! C99 */ /* Limits of integral types. */ #ifndef INT8_MIN @@@ -83,8 -83,8 +84,6 @@@ #define UINT32_MAX (4294967295U) #endif --#endif /* ! C99 */ -- #endif /* ! FLEXINT_H */ #ifdef __cplusplus @@@ -1073,16 -943,15 +1073,17 @@@ static yyconst flex_int16_t yy_chk[1368 } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - return handle_ident(yyextra, yytext, yylval); \ + yylval->string = return_string(yyextra, yytext); \ + return IDENTIFIER; \ } \ } while (0) @@@ -1153,7 -1052,7 +1193,7 @@@ handle_ident(struct asm_parser_state *s } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * - #line 1157 "lex.yy.c" -#line 1056 "lex.yy.c" ++#line 1197 "lex.yy.c" #define INITIAL 0 @@@ -1298,7 -1202,7 +1338,7 @@@ static int input (yyscan_t yyscanner ) /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). */ --#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0) ++#define ECHO fwrite( yytext, yyleng, 1, yyout ) #endif /* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, @@@ -1309,7 -1213,7 +1349,7 @@@ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ int c = '*'; \ -- size_t n; \ ++ unsigned n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@@ -1394,10 -1298,10 +1434,10 @@@ YY_DEC register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - #line 157 "program_lexer.l" -#line 176 "program_lexer.l" ++#line 198 "program_lexer.l" - #line 1401 "lex.yy.c" -#line 1305 "lex.yy.c" ++#line 1441 "lex.yy.c" yylval = yylval_param; @@@ -1486,17 -1390,17 +1526,17 @@@ do_action: /* This label is used only t case 1: YY_RULE_SETUP - #line 159 "program_lexer.l" -#line 178 "program_lexer.l" ++#line 200 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP - #line 160 "program_lexer.l" -#line 179 "program_lexer.l" ++#line 201 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP - #line 161 "program_lexer.l" -#line 180 "program_lexer.l" ++#line 202 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@@ -1504,700 -1408,768 +1544,700 @@@ YY_BREAK case 4: YY_RULE_SETUP - #line 165 "program_lexer.l" -#line 184 "program_lexer.l" ++#line 206 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP - #line 166 "program_lexer.l" -#line 185 "program_lexer.l" ++#line 207 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP - #line 167 "program_lexer.l" -#line 186 "program_lexer.l" ++#line 208 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP - #line 168 "program_lexer.l" -#line 187 "program_lexer.l" ++#line 209 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP - #line 169 "program_lexer.l" -#line 188 "program_lexer.l" ++#line 210 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP - #line 170 "program_lexer.l" -#line 189 "program_lexer.l" ++#line 211 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP - #line 171 "program_lexer.l" -#line 190 "program_lexer.l" ++#line 212 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP - #line 173 "program_lexer.l" -#line 192 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, ABS, OFF); } ++#line 214 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, ABS, 3); } YY_BREAK case 12: YY_RULE_SETUP - #line 174 "program_lexer.l" -#line 193 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } ++#line 215 "program_lexer.l" +{ return_opcode( 1, BIN_OP, ADD, 3); } YY_BREAK case 13: YY_RULE_SETUP - #line 175 "program_lexer.l" -#line 194 "program_lexer.l" -{ return_opcode( 1, BIN_OP, ADD, OFF); } ++#line 216 "program_lexer.l" +{ return_opcode(require_ARB_vp, ARL, ARL, 3); } YY_BREAK case 14: YY_RULE_SETUP - #line 177 "program_lexer.l" -#line 195 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } ++#line 218 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, CMP, 3); } YY_BREAK case 15: YY_RULE_SETUP - #line 178 "program_lexer.l" -#line 196 "program_lexer.l" -{ return_opcode(require_ARB_vp, ARL, ARL, OFF); } ++#line 219 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, COS, 3); } YY_BREAK case 16: YY_RULE_SETUP - #line 180 "program_lexer.l" -#line 198 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } ++#line 221 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDX, 3); } YY_BREAK case 17: YY_RULE_SETUP - #line 181 "program_lexer.l" -#line 199 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } ++#line 222 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, DDY, 3); } YY_BREAK case 18: YY_RULE_SETUP - #line 182 "program_lexer.l" -#line 200 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } ++#line 223 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP3, 3); } YY_BREAK case 19: YY_RULE_SETUP - #line 183 "program_lexer.l" -#line 201 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } ++#line 224 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP4, 3); } YY_BREAK case 20: YY_RULE_SETUP - #line 184 "program_lexer.l" -#line 203 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP3, OFF); } ++#line 225 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DPH, 3); } YY_BREAK case 21: YY_RULE_SETUP - #line 185 "program_lexer.l" -#line 204 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } ++#line 226 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DST, 3); } YY_BREAK case 22: YY_RULE_SETUP - #line 187 "program_lexer.l" -#line 205 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DP4, OFF); } ++#line 228 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, EX2, 3); } YY_BREAK case 23: YY_RULE_SETUP - #line 188 "program_lexer.l" -#line 206 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } ++#line 229 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, 3); } YY_BREAK case 24: YY_RULE_SETUP - #line 190 "program_lexer.l" -#line 207 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DPH, OFF); } ++#line 231 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FLR, 3); } YY_BREAK case 25: YY_RULE_SETUP - #line 191 "program_lexer.l" -#line 208 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } ++#line 232 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FRC, 3); } YY_BREAK case 26: YY_RULE_SETUP - #line 193 "program_lexer.l" -#line 209 "program_lexer.l" -{ return_opcode( 1, BIN_OP, DST, OFF); } ++#line 234 "program_lexer.l" +{ return_opcode(require_ARB_fp, KIL, KIL, 3); } YY_BREAK case 27: YY_RULE_SETUP - #line 195 "program_lexer.l" -#line 210 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } ++#line 236 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, LIT, 3); } YY_BREAK case 28: YY_RULE_SETUP - #line 196 "program_lexer.l" -#line 212 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, EX2, OFF); } ++#line 237 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, LG2, 3); } YY_BREAK case 29: YY_RULE_SETUP - #line 197 "program_lexer.l" -#line 213 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } ++#line 238 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, 3); } YY_BREAK case 30: YY_RULE_SETUP - #line 198 "program_lexer.l" -#line 214 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } ++#line 239 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, LRP, 3); } YY_BREAK case 31: YY_RULE_SETUP - #line 200 "program_lexer.l" -#line 216 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FLR, OFF); } ++#line 241 "program_lexer.l" +{ return_opcode( 1, TRI_OP, MAD, 3); } YY_BREAK case 32: YY_RULE_SETUP - #line 201 "program_lexer.l" -#line 217 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } ++#line 242 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MAX, 3); } YY_BREAK case 33: YY_RULE_SETUP - #line 202 "program_lexer.l" -#line 218 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, FRC, OFF); } ++#line 243 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MIN, 3); } YY_BREAK case 34: YY_RULE_SETUP - #line 203 "program_lexer.l" -#line 219 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } ++#line 244 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, MOV, 3); } YY_BREAK case 35: YY_RULE_SETUP - #line 204 "program_lexer.l" -#line 221 "program_lexer.l" -{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } ++#line 245 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MUL, 3); } YY_BREAK case 36: YY_RULE_SETUP - #line 206 "program_lexer.l" -#line 223 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, LIT, OFF); } ++#line 247 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2H, 4); } YY_BREAK case 37: YY_RULE_SETUP - #line 207 "program_lexer.l" -#line 224 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } ++#line 248 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK2US, 5); } YY_BREAK case 38: YY_RULE_SETUP - #line 208 "program_lexer.l" -#line 225 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, LG2, OFF); } ++#line 249 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4B, 4); } YY_BREAK case 39: YY_RULE_SETUP - #line 209 "program_lexer.l" -#line 226 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } ++#line 250 "program_lexer.l" +{ return_opcode(require_NV_fp, VECTOR_OP, PK4UB, 5); } YY_BREAK case 40: YY_RULE_SETUP - #line 210 "program_lexer.l" -#line 227 "program_lexer.l" -{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } ++#line 251 "program_lexer.l" +{ return_opcode( 1, BINSC_OP, POW, 3); } YY_BREAK case 41: YY_RULE_SETUP - #line 212 "program_lexer.l" -#line 228 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } ++#line 253 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RCP, 3); } YY_BREAK case 42: YY_RULE_SETUP - #line 213 "program_lexer.l" -#line 229 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } ++#line 254 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, RFL, 3); } YY_BREAK case 43: YY_RULE_SETUP - #line 214 "program_lexer.l" -#line 231 "program_lexer.l" -{ return_opcode( 1, TRI_OP, MAD, OFF); } ++#line 255 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RSQ, 3); } YY_BREAK case 44: YY_RULE_SETUP - #line 216 "program_lexer.l" -#line 232 "program_lexer.l" -{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } ++#line 257 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, 3); } YY_BREAK case 45: YY_RULE_SETUP - #line 217 "program_lexer.l" -#line 233 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MAX, OFF); } ++#line 258 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SEQ, 3); } YY_BREAK case 46: YY_RULE_SETUP - #line 218 "program_lexer.l" -#line 234 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } ++#line 259 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SFL, 3); } YY_BREAK case 47: YY_RULE_SETUP - #line 219 "program_lexer.l" -#line 235 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MIN, OFF); } ++#line 260 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SGE, 3); } YY_BREAK case 48: YY_RULE_SETUP - #line 220 "program_lexer.l" -#line 236 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } ++#line 261 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SGT, 3); } YY_BREAK case 49: YY_RULE_SETUP - #line 221 "program_lexer.l" -#line 237 "program_lexer.l" -{ return_opcode( 1, VECTOR_OP, MOV, OFF); } ++#line 262 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, 3); } YY_BREAK case 50: YY_RULE_SETUP - #line 222 "program_lexer.l" -#line 238 "program_lexer.l" -{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } ++#line 263 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SLE, 3); } YY_BREAK case 51: YY_RULE_SETUP - #line 223 "program_lexer.l" -#line 239 "program_lexer.l" -{ return_opcode( 1, BIN_OP, MUL, OFF); } ++#line 264 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SLT, 3); } YY_BREAK case 52: YY_RULE_SETUP - #line 224 "program_lexer.l" -#line 240 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } ++#line 265 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, SNE, 3); } YY_BREAK case 53: YY_RULE_SETUP - #line 225 "program_lexer.l" -#line 242 "program_lexer.l" -{ return_opcode( 1, BINSC_OP, POW, OFF); } ++#line 266 "program_lexer.l" +{ return_opcode(require_NV_fp, BIN_OP, STR, 3); } YY_BREAK case 54: YY_RULE_SETUP - #line 226 "program_lexer.l" -#line 243 "program_lexer.l" -{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } ++#line 267 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SUB, 3); } YY_BREAK case 55: YY_RULE_SETUP - #line 227 "program_lexer.l" -#line 245 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RCP, OFF); } ++#line 268 "program_lexer.l" +{ return_opcode( 1, SWZ, SWZ, 3); } YY_BREAK case 56: YY_RULE_SETUP - #line 229 "program_lexer.l" -#line 246 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } ++#line 270 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, 3); } YY_BREAK case 57: YY_RULE_SETUP - #line 230 "program_lexer.l" -#line 247 "program_lexer.l" -{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } ++#line 271 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, 3); } YY_BREAK case 58: YY_RULE_SETUP - #line 231 "program_lexer.l" -#line 248 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } ++#line 272 "program_lexer.l" +{ return_opcode(require_NV_fp, TXD_OP, TXD, 3); } YY_BREAK case 59: YY_RULE_SETUP - #line 232 "program_lexer.l" -#line 250 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } ++#line 273 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, 3); } YY_BREAK case 60: YY_RULE_SETUP - #line 234 "program_lexer.l" -#line 251 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } ++#line 275 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2H, 4); } YY_BREAK case 61: YY_RULE_SETUP - #line 235 "program_lexer.l" -#line 252 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SGE, OFF); } ++#line 276 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP2US, 5); } YY_BREAK case 62: YY_RULE_SETUP - #line 236 "program_lexer.l" -#line 253 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } ++#line 277 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4B, 4); } YY_BREAK case 63: YY_RULE_SETUP - #line 237 "program_lexer.l" -#line 254 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } ++#line 278 "program_lexer.l" +{ return_opcode(require_NV_fp, SCALAR_OP, UP4UB, 5); } YY_BREAK case 64: YY_RULE_SETUP - #line 239 "program_lexer.l" -#line 255 "program_lexer.l" -{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } ++#line 280 "program_lexer.l" +{ return_opcode(require_NV_fp, TRI_OP, X2D, 3); } YY_BREAK case 65: YY_RULE_SETUP - #line 240 "program_lexer.l" -#line 256 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SLT, OFF); } ++#line 281 "program_lexer.l" +{ return_opcode( 1, BIN_OP, XPD, 3); } YY_BREAK case 66: YY_RULE_SETUP - #line 242 "program_lexer.l" -#line 257 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } ++#line 283 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 67: YY_RULE_SETUP - #line 243 "program_lexer.l" -#line 258 "program_lexer.l" -{ return_opcode( 1, BIN_OP, SUB, OFF); } ++#line 284 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 68: YY_RULE_SETUP - #line 244 "program_lexer.l" -#line 259 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } ++#line 285 "program_lexer.l" +{ return PROGRAM; } YY_BREAK case 69: YY_RULE_SETUP - #line 245 "program_lexer.l" -#line 260 "program_lexer.l" -{ return_opcode( 1, SWZ, SWZ, OFF); } ++#line 286 "program_lexer.l" +{ return STATE; } YY_BREAK case 70: YY_RULE_SETUP - #line 246 "program_lexer.l" -#line 261 "program_lexer.l" -{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } ++#line 287 "program_lexer.l" +{ return RESULT; } YY_BREAK case 71: YY_RULE_SETUP - #line 248 "program_lexer.l" -#line 263 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } ++#line 289 "program_lexer.l" +{ return AMBIENT; } YY_BREAK case 72: YY_RULE_SETUP - #line 249 "program_lexer.l" -#line 264 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } ++#line 290 "program_lexer.l" +{ return ATTENUATION; } YY_BREAK case 73: YY_RULE_SETUP - #line 250 "program_lexer.l" -#line 265 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } ++#line 291 "program_lexer.l" +{ return BACK; } YY_BREAK case 74: YY_RULE_SETUP - #line 251 "program_lexer.l" -#line 266 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } ++#line 292 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 75: YY_RULE_SETUP - #line 252 "program_lexer.l" -#line 267 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } ++#line 293 "program_lexer.l" +{ return COLOR; } YY_BREAK case 76: YY_RULE_SETUP - #line 253 "program_lexer.l" -#line 268 "program_lexer.l" -{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } ++#line 294 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 77: YY_RULE_SETUP - #line 254 "program_lexer.l" -#line 270 "program_lexer.l" -{ return_opcode( 1, BIN_OP, XPD, OFF); } ++#line 295 "program_lexer.l" +{ return DIFFUSE; } YY_BREAK case 78: YY_RULE_SETUP - #line 255 "program_lexer.l" -#line 271 "program_lexer.l" -{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } ++#line 296 "program_lexer.l" +{ return DIRECTION; } YY_BREAK case 79: YY_RULE_SETUP - #line 256 "program_lexer.l" -#line 273 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } ++#line 297 "program_lexer.l" +{ return EMISSION; } YY_BREAK case 80: YY_RULE_SETUP - #line 257 "program_lexer.l" -#line 274 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } ++#line 298 "program_lexer.l" +{ return ENV; } YY_BREAK case 81: YY_RULE_SETUP - #line 258 "program_lexer.l" -#line 275 "program_lexer.l" -{ return PROGRAM; } ++#line 299 "program_lexer.l" +{ return EYE; } YY_BREAK case 82: YY_RULE_SETUP - #line 259 "program_lexer.l" -#line 276 "program_lexer.l" -{ return STATE; } ++#line 300 "program_lexer.l" +{ return FOGCOORD; } YY_BREAK case 83: YY_RULE_SETUP - #line 260 "program_lexer.l" -#line 277 "program_lexer.l" -{ return RESULT; } ++#line 301 "program_lexer.l" +{ return FOG; } YY_BREAK case 84: YY_RULE_SETUP - #line 261 "program_lexer.l" -#line 279 "program_lexer.l" -{ return AMBIENT; } ++#line 302 "program_lexer.l" +{ return FRONT; } YY_BREAK case 85: YY_RULE_SETUP - #line 262 "program_lexer.l" -#line 280 "program_lexer.l" -{ return ATTENUATION; } ++#line 303 "program_lexer.l" +{ return HALF; } YY_BREAK case 86: YY_RULE_SETUP - #line 263 "program_lexer.l" -#line 281 "program_lexer.l" -{ return BACK; } ++#line 304 "program_lexer.l" +{ return INVERSE; } YY_BREAK case 87: YY_RULE_SETUP - #line 264 "program_lexer.l" -#line 282 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, CLIP); } ++#line 305 "program_lexer.l" +{ return INVTRANS; } YY_BREAK case 88: YY_RULE_SETUP - #line 265 "program_lexer.l" -#line 283 "program_lexer.l" -{ return COLOR; } ++#line 306 "program_lexer.l" +{ return LIGHT; } YY_BREAK case 89: YY_RULE_SETUP - #line 266 "program_lexer.l" -#line 284 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, DEPTH); } ++#line 307 "program_lexer.l" +{ return LIGHTMODEL; } YY_BREAK case 90: YY_RULE_SETUP - #line 267 "program_lexer.l" -#line 285 "program_lexer.l" -{ return DIFFUSE; } ++#line 308 "program_lexer.l" +{ return LIGHTPROD; } YY_BREAK case 91: YY_RULE_SETUP - #line 268 "program_lexer.l" -#line 286 "program_lexer.l" -{ return DIRECTION; } ++#line 309 "program_lexer.l" +{ return LOCAL; } YY_BREAK case 92: YY_RULE_SETUP - #line 269 "program_lexer.l" -#line 287 "program_lexer.l" -{ return EMISSION; } ++#line 310 "program_lexer.l" +{ return MATERIAL; } YY_BREAK case 93: YY_RULE_SETUP - #line 270 "program_lexer.l" -#line 288 "program_lexer.l" -{ return ENV; } ++#line 311 "program_lexer.l" +{ return MAT_PROGRAM; } YY_BREAK case 94: YY_RULE_SETUP - #line 271 "program_lexer.l" -#line 289 "program_lexer.l" -{ return EYE; } ++#line 312 "program_lexer.l" +{ return MATRIX; } YY_BREAK case 95: YY_RULE_SETUP - #line 272 "program_lexer.l" -#line 290 "program_lexer.l" -{ return FOGCOORD; } ++#line 313 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 96: YY_RULE_SETUP - #line 273 "program_lexer.l" -#line 291 "program_lexer.l" -{ return FOG; } ++#line 314 "program_lexer.l" +{ return MODELVIEW; } YY_BREAK case 97: YY_RULE_SETUP - #line 274 "program_lexer.l" -#line 292 "program_lexer.l" -{ return FRONT; } ++#line 315 "program_lexer.l" +{ return MVP; } YY_BREAK case 98: YY_RULE_SETUP - #line 275 "program_lexer.l" -#line 293 "program_lexer.l" -{ return HALF; } ++#line 316 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 99: YY_RULE_SETUP - #line 276 "program_lexer.l" -#line 294 "program_lexer.l" -{ return INVERSE; } ++#line 317 "program_lexer.l" +{ return OBJECT; } YY_BREAK case 100: YY_RULE_SETUP - #line 277 "program_lexer.l" -#line 295 "program_lexer.l" -{ return INVTRANS; } ++#line 318 "program_lexer.l" +{ return PALETTE; } YY_BREAK case 101: YY_RULE_SETUP - #line 278 "program_lexer.l" -#line 296 "program_lexer.l" -{ return LIGHT; } ++#line 319 "program_lexer.l" +{ return PARAMS; } YY_BREAK case 102: YY_RULE_SETUP - #line 279 "program_lexer.l" -#line 297 "program_lexer.l" -{ return LIGHTMODEL; } ++#line 320 "program_lexer.l" +{ return PLANE; } YY_BREAK case 103: YY_RULE_SETUP - #line 280 "program_lexer.l" -#line 298 "program_lexer.l" -{ return LIGHTPROD; } ++#line 321 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } YY_BREAK case 104: YY_RULE_SETUP - #line 281 "program_lexer.l" -#line 299 "program_lexer.l" -{ return LOCAL; } ++#line 322 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 105: YY_RULE_SETUP - #line 282 "program_lexer.l" -#line 300 "program_lexer.l" -{ return MATERIAL; } ++#line 323 "program_lexer.l" +{ return POSITION; } YY_BREAK case 106: YY_RULE_SETUP - #line 283 "program_lexer.l" -#line 301 "program_lexer.l" -{ return MAT_PROGRAM; } ++#line 324 "program_lexer.l" +{ return PRIMARY; } YY_BREAK case 107: YY_RULE_SETUP - #line 284 "program_lexer.l" -#line 302 "program_lexer.l" -{ return MATRIX; } ++#line 325 "program_lexer.l" +{ return PROJECTION; } YY_BREAK case 108: YY_RULE_SETUP - #line 285 "program_lexer.l" -#line 303 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } ++#line 326 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 109: YY_RULE_SETUP - #line 286 "program_lexer.l" -#line 304 "program_lexer.l" -{ return MODELVIEW; } ++#line 327 "program_lexer.l" +{ return ROW; } YY_BREAK case 110: YY_RULE_SETUP - #line 287 "program_lexer.l" -#line 305 "program_lexer.l" -{ return MVP; } ++#line 328 "program_lexer.l" +{ return SCENECOLOR; } YY_BREAK case 111: YY_RULE_SETUP - #line 288 "program_lexer.l" -#line 306 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, NORMAL); } ++#line 329 "program_lexer.l" +{ return SECONDARY; } YY_BREAK case 112: YY_RULE_SETUP - #line 289 "program_lexer.l" -#line 307 "program_lexer.l" -{ return OBJECT; } ++#line 330 "program_lexer.l" +{ return SHININESS; } YY_BREAK case 113: YY_RULE_SETUP - #line 290 "program_lexer.l" -#line 308 "program_lexer.l" -{ return PALETTE; } ++#line 331 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } YY_BREAK case 114: YY_RULE_SETUP - #line 291 "program_lexer.l" -#line 309 "program_lexer.l" -{ return PARAMS; } ++#line 332 "program_lexer.l" +{ return SPECULAR; } YY_BREAK case 115: YY_RULE_SETUP - #line 292 "program_lexer.l" -#line 310 "program_lexer.l" -{ return PLANE; } ++#line 333 "program_lexer.l" +{ return SPOT; } YY_BREAK case 116: YY_RULE_SETUP - #line 293 "program_lexer.l" -#line 311 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINT_TOK); } ++#line 334 "program_lexer.l" +{ return TEXCOORD; } YY_BREAK case 117: YY_RULE_SETUP - #line 294 "program_lexer.l" -#line 312 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } ++#line 335 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 118: YY_RULE_SETUP - #line 295 "program_lexer.l" -#line 313 "program_lexer.l" -{ return POSITION; } ++#line 336 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 119: YY_RULE_SETUP - #line 296 "program_lexer.l" -#line 314 "program_lexer.l" -{ return PRIMARY; } ++#line 337 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 120: YY_RULE_SETUP - #line 297 "program_lexer.l" -#line 315 "program_lexer.l" -{ return PROJECTION; } ++#line 338 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 121: YY_RULE_SETUP - #line 298 "program_lexer.l" -#line 316 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, RANGE); } ++#line 339 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 122: YY_RULE_SETUP - #line 299 "program_lexer.l" -#line 317 "program_lexer.l" -{ return ROW; } ++#line 340 "program_lexer.l" +{ return TEXTURE; } YY_BREAK case 123: YY_RULE_SETUP - #line 300 "program_lexer.l" -#line 318 "program_lexer.l" -{ return SCENECOLOR; } ++#line 341 "program_lexer.l" +{ return TRANSPOSE; } YY_BREAK case 124: YY_RULE_SETUP - #line 301 "program_lexer.l" -#line 319 "program_lexer.l" -{ return SECONDARY; } ++#line 342 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 125: YY_RULE_SETUP - #line 302 "program_lexer.l" -#line 320 "program_lexer.l" -{ return SHININESS; } ++#line 343 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 126: YY_RULE_SETUP - #line 304 "program_lexer.l" -#line 321 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, SIZE_TOK); } ++#line 345 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 127: YY_RULE_SETUP - #line 305 "program_lexer.l" -#line 322 "program_lexer.l" -{ return SPECULAR; } ++#line 346 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 128: YY_RULE_SETUP - #line 306 "program_lexer.l" -#line 323 "program_lexer.l" -{ return SPOT; } ++#line 347 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 129: YY_RULE_SETUP - #line 307 "program_lexer.l" -#line 324 "program_lexer.l" -{ return TEXCOORD; } ++#line 348 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 130: YY_RULE_SETUP - #line 308 "program_lexer.l" -#line 325 "program_lexer.l" -{ return_token_or_DOT(require_ARB_fp, TEXENV); } ++#line 349 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 131: YY_RULE_SETUP - #line 309 "program_lexer.l" -#line 326 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN); } ++#line 350 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 132: YY_RULE_SETUP - #line 310 "program_lexer.l" -#line 327 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } ++#line 351 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 133: YY_RULE_SETUP - #line 311 "program_lexer.l" -#line 328 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } ++#line 352 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 134: YY_RULE_SETUP - #line 312 "program_lexer.l" -#line 329 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } ++#line 353 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 135: YY_RULE_SETUP - #line 313 "program_lexer.l" -#line 330 "program_lexer.l" -{ return TEXTURE; } ++#line 354 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } YY_BREAK case 136: YY_RULE_SETUP - #line 314 "program_lexer.l" -#line 331 "program_lexer.l" -{ return TRANSPOSE; } ++#line 355 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } YY_BREAK case 137: YY_RULE_SETUP - #line 315 "program_lexer.l" -#line 332 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } ++#line 356 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } YY_BREAK case 138: YY_RULE_SETUP - #line 316 "program_lexer.l" -#line 333 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, WEIGHT); } ++#line 357 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } YY_BREAK case 139: YY_RULE_SETUP - #line 318 "program_lexer.l" -#line 335 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } ++#line 359 "program_lexer.l" +{ return handle_ident(yyextra, yytext, yylval); } YY_BREAK case 140: YY_RULE_SETUP - #line 320 "program_lexer.l" -#line 336 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } - YY_BREAK -case 141: -YY_RULE_SETUP -#line 337 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } - YY_BREAK -case 142: -YY_RULE_SETUP -#line 338 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } - YY_BREAK -case 143: -YY_RULE_SETUP -#line 339 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } - YY_BREAK -case 144: -YY_RULE_SETUP -#line 340 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } - YY_BREAK -case 145: -YY_RULE_SETUP -#line 341 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } - YY_BREAK -case 146: -YY_RULE_SETUP -#line 342 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } - YY_BREAK -case 147: -YY_RULE_SETUP -#line 343 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } - YY_BREAK -case 148: -YY_RULE_SETUP -#line 344 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } - YY_BREAK -case 149: -YY_RULE_SETUP -#line 345 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } - YY_BREAK -case 150: -YY_RULE_SETUP -#line 346 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } - YY_BREAK -case 151: -YY_RULE_SETUP -#line 347 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } - YY_BREAK -case 152: -YY_RULE_SETUP -#line 349 "program_lexer.l" -{ - yylval->string = return_string(yyextra, yytext); - return IDENTIFIER; -} - YY_BREAK -case 153: -YY_RULE_SETUP -#line 354 "program_lexer.l" ++#line 361 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 154: +case 141: YY_RULE_SETUP - #line 322 "program_lexer.l" -#line 356 "program_lexer.l" ++#line 363 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 155: +case 142: YY_RULE_SETUP - #line 326 "program_lexer.l" -#line 360 "program_lexer.l" ++#line 367 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; @@@ -2209,40 -2181,40 +2249,40 @@@ case 143 yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP - #line 330 "program_lexer.l" -#line 364 "program_lexer.l" ++#line 371 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 157: +case 144: YY_RULE_SETUP - #line 334 "program_lexer.l" -#line 368 "program_lexer.l" ++#line 375 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 158: +case 145: YY_RULE_SETUP - #line 338 "program_lexer.l" -#line 372 "program_lexer.l" ++#line 379 "program_lexer.l" { yylval->real = _mesa_strtod(yytext, NULL); return REAL; } YY_BREAK -case 159: +case 146: YY_RULE_SETUP - #line 343 "program_lexer.l" -#line 377 "program_lexer.l" ++#line 384 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 160: +case 147: YY_RULE_SETUP - #line 349 "program_lexer.l" -#line 383 "program_lexer.l" ++#line 390 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@@ -2250,27 -2222,27 +2290,27 @@@ return MASK3; } YY_BREAK -case 161: +case 148: YY_RULE_SETUP - #line 355 "program_lexer.l" -#line 389 "program_lexer.l" ++#line 396 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 162: +case 149: YY_RULE_SETUP - #line 360 "program_lexer.l" -#line 394 "program_lexer.l" ++#line 401 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 163: +case 150: YY_RULE_SETUP - #line 366 "program_lexer.l" -#line 400 "program_lexer.l" ++#line 407 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@@ -2278,9 -2250,9 +2318,9 @@@ return MASK2; } YY_BREAK -case 164: +case 151: YY_RULE_SETUP - #line 372 "program_lexer.l" -#line 406 "program_lexer.l" ++#line 413 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@@ -2288,18 -2260,18 +2328,18 @@@ return MASK2; } YY_BREAK -case 165: +case 152: YY_RULE_SETUP - #line 378 "program_lexer.l" -#line 412 "program_lexer.l" ++#line 419 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 166: +case 153: YY_RULE_SETUP - #line 384 "program_lexer.l" -#line 418 "program_lexer.l" ++#line 425 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@@ -2307,9 -2279,9 +2347,9 @@@ return MASK1; } YY_BREAK -case 167: +case 154: YY_RULE_SETUP - #line 391 "program_lexer.l" -#line 425 "program_lexer.l" ++#line 432 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@@ -2319,18 -2291,18 +2359,18 @@@ return SWIZZLE; } YY_BREAK -case 168: +case 155: YY_RULE_SETUP - #line 400 "program_lexer.l" -#line 434 "program_lexer.l" ++#line 441 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 169: +case 156: YY_RULE_SETUP - #line 406 "program_lexer.l" -#line 440 "program_lexer.l" ++#line 447 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@@ -2338,27 -2310,27 +2378,27 @@@ return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 170: +case 157: YY_RULE_SETUP - #line 412 "program_lexer.l" -#line 446 "program_lexer.l" ++#line 453 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 171: +case 158: YY_RULE_SETUP - #line 417 "program_lexer.l" -#line 451 "program_lexer.l" ++#line 458 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 172: +case 159: YY_RULE_SETUP - #line 423 "program_lexer.l" -#line 457 "program_lexer.l" ++#line 464 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@@ -2366,9 -2338,9 +2406,9 @@@ return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 173: +case 160: YY_RULE_SETUP - #line 429 "program_lexer.l" -#line 463 "program_lexer.l" ++#line 470 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@@ -2376,18 -2348,18 +2416,18 @@@ return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 174: +case 161: YY_RULE_SETUP - #line 435 "program_lexer.l" -#line 469 "program_lexer.l" ++#line 476 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 175: +case 162: YY_RULE_SETUP - #line 441 "program_lexer.l" -#line 475 "program_lexer.l" ++#line 482 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@@ -2395,9 -2367,9 +2435,9 @@@ return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 176: +case 163: YY_RULE_SETUP - #line 449 "program_lexer.l" -#line 483 "program_lexer.l" ++#line 490 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@@ -2409,9 -2381,9 +2449,9 @@@ } } YY_BREAK -case 177: +case 164: YY_RULE_SETUP - #line 460 "program_lexer.l" -#line 494 "program_lexer.l" ++#line 501 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@@ -2421,15 -2393,15 +2461,15 @@@ return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 178: +case 165: YY_RULE_SETUP - #line 469 "program_lexer.l" -#line 503 "program_lexer.l" ++#line 510 "program_lexer.l" { return DOT; } YY_BREAK -case 179: -/* rule 179 can match eol */ +case 166: +/* rule 166 can match eol */ YY_RULE_SETUP - #line 471 "program_lexer.l" -#line 505 "program_lexer.l" ++#line 512 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@@ -2438,30 -2410,30 +2478,30 @@@ yylloc->position++; } YY_BREAK -case 180: +case 167: YY_RULE_SETUP - #line 478 "program_lexer.l" -#line 512 "program_lexer.l" ++#line 519 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 181: +case 168: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP - #line 479 "program_lexer.l" -#line 513 "program_lexer.l" ++#line 520 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 182: +case 169: YY_RULE_SETUP - #line 480 "program_lexer.l" -#line 514 "program_lexer.l" ++#line 521 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 183: +case 170: YY_RULE_SETUP - #line 481 "program_lexer.l" -#line 515 "program_lexer.l" ++#line 522 "program_lexer.l" ECHO; YY_BREAK - #line 2465 "lex.yy.c" -#line 2437 "lex.yy.c" ++#line 2505 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@@ -3636,7 -3608,7 +3676,7 @@@ void yyfree (void * ptr , yyscan_t yysc #define YYTABLES_NAME "yytables" - #line 481 "program_lexer.l" -#line 515 "program_lexer.l" ++#line 522 "program_lexer.l" diff --cc src/mesa/shader/program_lexer.l index e2acb3c0c96,6c4fad30372..b50fb3c7dc2 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@@ -61,16 -56,15 +62,17 @@@ } while (0) -#define return_opcode(condition, token, opcode, sat) \ +#define return_opcode(condition, token, opcode, len) \ do { \ - if (condition) { \ + if (condition && \ + _mesa_parse_instruction_suffix(yyextra, \ + yytext + len, \ + & yylval->temp_inst)) { \ yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ - yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ return token; \ } else { \ - return handle_ident(yyextra, yytext, yylval); \ + yylval->string = return_string(yyextra, yytext); \ + return IDENTIFIER; \ } \ } while (0) diff --cc src/mesa/shader/program_parse.tab.c index 90867938a47,261b605a2d2..6e4095eca63 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@@ -1,23 -1,23 +1,24 @@@ -- --/* A Bison parser, made by GNU Bison 2.4.1. */ ++/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton implementation for Bison's Yacc-like parsers in C -- -- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 ++ ++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -- -- This program is free software: you can redistribute it and/or modify ++ ++ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -- ++ You should have received a copy of the GNU General Public License -- along with this program. If not, see . */ ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@@ -28,7 -28,7 +29,7 @@@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. -- ++ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ @@@ -46,7 -46,7 +47,7 @@@ #define YYBISON 1 /* Bison version. */ --#define YYBISON_VERSION "2.4.1" ++#define YYBISON_VERSION "2.3" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@@ -54,20 -54,20 +55,235 @@@ /* Pure parsers. */ #define YYPURE 1 --/* Push parsers. */ --#define YYPUSH 0 -- --/* Pull parsers. */ --#define YYPULL 1 -- /* Using locations. */ #define YYLSP_NEEDED 1 --/* Copy the first part of user declarations. */ ++/* Tokens. */ ++#ifndef YYTOKENTYPE ++# define YYTOKENTYPE ++ /* Put the tokens into the symbol table, so that GDB and other debuggers ++ know about them. */ ++ enum yytokentype { ++ ARBvp_10 = 258, ++ ARBfp_10 = 259, ++ ADDRESS = 260, ++ ALIAS = 261, ++ ATTRIB = 262, ++ OPTION = 263, ++ OUTPUT = 264, ++ PARAM = 265, ++ TEMP = 266, ++ END = 267, ++ BIN_OP = 268, ++ BINSC_OP = 269, ++ SAMPLE_OP = 270, ++ SCALAR_OP = 271, ++ TRI_OP = 272, ++ VECTOR_OP = 273, ++ ARL = 274, ++ KIL = 275, ++ SWZ = 276, ++ TXD_OP = 277, ++ INTEGER = 278, ++ REAL = 279, ++ AMBIENT = 280, ++ ATTENUATION = 281, ++ BACK = 282, ++ CLIP = 283, ++ COLOR = 284, ++ DEPTH = 285, ++ DIFFUSE = 286, ++ DIRECTION = 287, ++ EMISSION = 288, ++ ENV = 289, ++ EYE = 290, ++ FOG = 291, ++ FOGCOORD = 292, ++ FRAGMENT = 293, ++ FRONT = 294, ++ HALF = 295, ++ INVERSE = 296, ++ INVTRANS = 297, ++ LIGHT = 298, ++ LIGHTMODEL = 299, ++ LIGHTPROD = 300, ++ LOCAL = 301, ++ MATERIAL = 302, ++ MAT_PROGRAM = 303, ++ MATRIX = 304, ++ MATRIXINDEX = 305, ++ MODELVIEW = 306, ++ MVP = 307, ++ NORMAL = 308, ++ OBJECT = 309, ++ PALETTE = 310, ++ PARAMS = 311, ++ PLANE = 312, ++ POINT_TOK = 313, ++ POINTSIZE = 314, ++ POSITION = 315, ++ PRIMARY = 316, ++ PROGRAM = 317, ++ PROJECTION = 318, ++ RANGE = 319, ++ RESULT = 320, ++ ROW = 321, ++ SCENECOLOR = 322, ++ SECONDARY = 323, ++ SHININESS = 324, ++ SIZE_TOK = 325, ++ SPECULAR = 326, ++ SPOT = 327, ++ STATE = 328, ++ TEXCOORD = 329, ++ TEXENV = 330, ++ TEXGEN = 331, ++ TEXGEN_Q = 332, ++ TEXGEN_R = 333, ++ TEXGEN_S = 334, ++ TEXGEN_T = 335, ++ TEXTURE = 336, ++ TRANSPOSE = 337, ++ TEXTURE_UNIT = 338, ++ TEX_1D = 339, ++ TEX_2D = 340, ++ TEX_3D = 341, ++ TEX_CUBE = 342, ++ TEX_RECT = 343, ++ TEX_SHADOW1D = 344, ++ TEX_SHADOW2D = 345, ++ TEX_SHADOWRECT = 346, ++ TEX_ARRAY1D = 347, ++ TEX_ARRAY2D = 348, ++ TEX_ARRAYSHADOW1D = 349, ++ TEX_ARRAYSHADOW2D = 350, ++ VERTEX = 351, ++ VTXATTRIB = 352, ++ WEIGHT = 353, ++ IDENTIFIER = 354, ++ USED_IDENTIFIER = 355, ++ MASK4 = 356, ++ MASK3 = 357, ++ MASK2 = 358, ++ MASK1 = 359, ++ SWIZZLE = 360, ++ DOT_DOT = 361, ++ DOT = 362 ++ }; ++#endif ++/* Tokens. */ ++#define ARBvp_10 258 ++#define ARBfp_10 259 ++#define ADDRESS 260 ++#define ALIAS 261 ++#define ATTRIB 262 ++#define OPTION 263 ++#define OUTPUT 264 ++#define PARAM 265 ++#define TEMP 266 ++#define END 267 ++#define BIN_OP 268 ++#define BINSC_OP 269 ++#define SAMPLE_OP 270 ++#define SCALAR_OP 271 ++#define TRI_OP 272 ++#define VECTOR_OP 273 ++#define ARL 274 ++#define KIL 275 ++#define SWZ 276 ++#define TXD_OP 277 ++#define INTEGER 278 ++#define REAL 279 ++#define AMBIENT 280 ++#define ATTENUATION 281 ++#define BACK 282 ++#define CLIP 283 ++#define COLOR 284 ++#define DEPTH 285 ++#define DIFFUSE 286 ++#define DIRECTION 287 ++#define EMISSION 288 ++#define ENV 289 ++#define EYE 290 ++#define FOG 291 ++#define FOGCOORD 292 ++#define FRAGMENT 293 ++#define FRONT 294 ++#define HALF 295 ++#define INVERSE 296 ++#define INVTRANS 297 ++#define LIGHT 298 ++#define LIGHTMODEL 299 ++#define LIGHTPROD 300 ++#define LOCAL 301 ++#define MATERIAL 302 ++#define MAT_PROGRAM 303 ++#define MATRIX 304 ++#define MATRIXINDEX 305 ++#define MODELVIEW 306 ++#define MVP 307 ++#define NORMAL 308 ++#define OBJECT 309 ++#define PALETTE 310 ++#define PARAMS 311 ++#define PLANE 312 ++#define POINT_TOK 313 ++#define POINTSIZE 314 ++#define POSITION 315 ++#define PRIMARY 316 ++#define PROGRAM 317 ++#define PROJECTION 318 ++#define RANGE 319 ++#define RESULT 320 ++#define ROW 321 ++#define SCENECOLOR 322 ++#define SECONDARY 323 ++#define SHININESS 324 ++#define SIZE_TOK 325 ++#define SPECULAR 326 ++#define SPOT 327 ++#define STATE 328 ++#define TEXCOORD 329 ++#define TEXENV 330 ++#define TEXGEN 331 ++#define TEXGEN_Q 332 ++#define TEXGEN_R 333 ++#define TEXGEN_S 334 ++#define TEXGEN_T 335 ++#define TEXTURE 336 ++#define TRANSPOSE 337 ++#define TEXTURE_UNIT 338 ++#define TEX_1D 339 ++#define TEX_2D 340 ++#define TEX_3D 341 ++#define TEX_CUBE 342 ++#define TEX_RECT 343 ++#define TEX_SHADOW1D 344 ++#define TEX_SHADOW2D 345 ++#define TEX_SHADOWRECT 346 ++#define TEX_ARRAY1D 347 ++#define TEX_ARRAY2D 348 ++#define TEX_ARRAYSHADOW1D 349 ++#define TEX_ARRAYSHADOW2D 350 ++#define VERTEX 351 ++#define VTXATTRIB 352 ++#define WEIGHT 353 ++#define IDENTIFIER 354 ++#define USED_IDENTIFIER 355 ++#define MASK4 356 ++#define MASK3 357 ++#define MASK2 358 ++#define MASK1 359 ++#define SWIZZLE 360 ++#define DOT_DOT 361 ++#define DOT 362 ++ ++ ++ --/* Line 189 of yacc.c */ ++/* Copy the first part of user declarations. */ #line 1 "program_parse.y" /* @@@ -178,9 -169,9 +394,6 @@@ static struct asm_instruction *asm_inst #define YYLEX_PARAM state->scanner --/* Line 189 of yacc.c */ - #line 183 "program_parse.tab.c" -#line 174 "program_parse.tab.c" -- /* Enabling traces. */ #ifndef YYDEBUG # define YYDEBUG 0 @@@ -199,130 -190,128 +412,10 @@@ # define YYTOKEN_TABLE 0 #endif -- --/* Tokens. */ --#ifndef YYTOKENTYPE --# define YYTOKENTYPE -- /* Put the tokens into the symbol table, so that GDB and other debuggers -- know about them. */ -- enum yytokentype { -- ARBvp_10 = 258, -- ARBfp_10 = 259, -- ADDRESS = 260, -- ALIAS = 261, -- ATTRIB = 262, -- OPTION = 263, -- OUTPUT = 264, -- PARAM = 265, -- TEMP = 266, -- END = 267, -- BIN_OP = 268, -- BINSC_OP = 269, -- SAMPLE_OP = 270, -- SCALAR_OP = 271, -- TRI_OP = 272, -- VECTOR_OP = 273, -- ARL = 274, -- KIL = 275, -- SWZ = 276, - TXD_OP = 277, - INTEGER = 278, - REAL = 279, - AMBIENT = 280, - ATTENUATION = 281, - BACK = 282, - CLIP = 283, - COLOR = 284, - DEPTH = 285, - DIFFUSE = 286, - DIRECTION = 287, - EMISSION = 288, - ENV = 289, - EYE = 290, - FOG = 291, - FOGCOORD = 292, - FRAGMENT = 293, - FRONT = 294, - HALF = 295, - INVERSE = 296, - INVTRANS = 297, - LIGHT = 298, - LIGHTMODEL = 299, - LIGHTPROD = 300, - LOCAL = 301, - MATERIAL = 302, - MAT_PROGRAM = 303, - MATRIX = 304, - MATRIXINDEX = 305, - MODELVIEW = 306, - MVP = 307, - NORMAL = 308, - OBJECT = 309, - PALETTE = 310, - PARAMS = 311, - PLANE = 312, - POINT_TOK = 313, - POINTSIZE = 314, - POSITION = 315, - PRIMARY = 316, - PROGRAM = 317, - PROJECTION = 318, - RANGE = 319, - RESULT = 320, - ROW = 321, - SCENECOLOR = 322, - SECONDARY = 323, - SHININESS = 324, - SIZE_TOK = 325, - SPECULAR = 326, - SPOT = 327, - STATE = 328, - TEXCOORD = 329, - TEXENV = 330, - TEXGEN = 331, - TEXGEN_Q = 332, - TEXGEN_R = 333, - TEXGEN_S = 334, - TEXGEN_T = 335, - TEXTURE = 336, - TRANSPOSE = 337, - TEXTURE_UNIT = 338, - TEX_1D = 339, - TEX_2D = 340, - TEX_3D = 341, - TEX_CUBE = 342, - TEX_RECT = 343, - TEX_SHADOW1D = 344, - TEX_SHADOW2D = 345, - TEX_SHADOWRECT = 346, - TEX_ARRAY1D = 347, - TEX_ARRAY2D = 348, - TEX_ARRAYSHADOW1D = 349, - TEX_ARRAYSHADOW2D = 350, - VERTEX = 351, - VTXATTRIB = 352, - WEIGHT = 353, - IDENTIFIER = 354, - USED_IDENTIFIER = 355, - MASK4 = 356, - MASK3 = 357, - MASK2 = 358, - MASK1 = 359, - SWIZZLE = 360, - DOT_DOT = 361, - DOT = 362 - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 -- }; --#endif -- -- -- #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE - { - - /* Line 214 of yacc.c */ +#line 116 "program_parse.y" - + { - -/* Line 214 of yacc.c */ -#line 107 "program_parse.y" - struct asm_instruction *inst; struct asm_symbol *sym; struct asm_symbol temp_sym; @@@ -346,15 -335,15 +439,13 @@@ unsigned xyzw_valid:1; unsigned negate:1; } ext_swizzle; -- -- -- --/* Line 214 of yacc.c */ - #line 354 "program_parse.tab.c" -#line 343 "program_parse.tab.c" --} YYSTYPE; --# define YYSTYPE_IS_TRIVIAL 1 ++} ++/* Line 187 of yacc.c. */ ++#line 445 "program_parse.tab.c" ++ YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 ++# define YYSTYPE_IS_TRIVIAL 1 #endif #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED @@@ -372,16 -361,16 +463,14 @@@ typedef struct YYLTYP /* Copy the second part of user declarations. */ -- --/* Line 264 of yacc.c */ -#line 249 "program_parse.y" +#line 261 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); --/* Line 264 of yacc.c */ - #line 385 "program_parse.tab.c" -#line 374 "program_parse.tab.c" ++/* Line 216 of yacc.c. */ ++#line 474 "program_parse.tab.c" #ifdef short # undef short @@@ -456,14 -445,14 +545,14 @@@ typedef short int yytype_int16 #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static int --YYID (int yyi) ++YYID (int i) #else static int --YYID (yyi) -- int yyi; ++YYID (i) ++ int i; #endif { -- return yyi; ++ return i; } #endif @@@ -545,9 -534,9 +634,9 @@@ void free (void *); /* INFRINGES ON USE /* A type that is properly aligned for any stack member. */ union yyalloc { -- yytype_int16 yyss_alloc; -- YYSTYPE yyvs_alloc; -- YYLTYPE yyls_alloc; ++ yytype_int16 yyss; ++ YYSTYPE yyvs; ++ YYLTYPE yyls; }; /* The size of the maximum gap between one aligned stack and the next. */ @@@ -582,12 -571,12 +671,12 @@@ elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ --# define YYSTACK_RELOCATE(Stack_alloc, Stack) \ ++# define YYSTACK_RELOCATE(Stack) \ do \ { \ YYSIZE_T yynewbytes; \ -- YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ -- Stack = &yyptr->Stack_alloc; \ ++ YYCOPY (&yyptr->Stack, Stack, yysize); \ ++ Stack = &yyptr->Stack; \ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ @@@ -1458,20 -1407,20 +1547,17 @@@ yy_symbol_print (yyoutput, yytype, yyva #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) static void --yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) ++yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void --yy_stack_print (yybottom, yytop) -- yytype_int16 *yybottom; -- yytype_int16 *yytop; ++yy_stack_print (bottom, top) ++ yytype_int16 *bottom; ++ yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); -- for (; yybottom <= yytop; yybottom++) -- { -- int yybot = *yybottom; -- YYFPRINTF (stderr, " %d", yybot); -- } ++ for (; bottom <= top; ++bottom) ++ YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@@ -1507,11 -1456,11 +1593,11 @@@ yy_reduce_print (yyvsp, yylsp, yyrule, /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { -- YYFPRINTF (stderr, " $%d = ", yyi + 1); ++ fprintf (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], &(yyvsp[(yyi + 1) - (yynrhs)]) , &(yylsp[(yyi + 1) - (yynrhs)]) , state); -- YYFPRINTF (stderr, "\n"); ++ fprintf (stderr, "\n"); } } @@@ -1795,8 -1744,8 +1881,10 @@@ yydestruct (yymsg, yytype, yyvaluep, yy break; } } ++ /* Prevent warnings from -Wmissing-prototypes. */ ++ #ifdef YYPARSE_PARAM #if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); @@@ -1815,9 -1764,9 +1903,10 @@@ int yyparse () --/*-------------------------. --| yyparse or yypush_parse. | --`-------------------------*/ ++ ++/*----------. ++| yyparse. | ++`----------*/ #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ @@@ -1841,97 -1790,97 +1930,88 @@@ yyparse (state #endif #endif { --/* The lookahead symbol. */ ++ /* The look-ahead symbol. */ int yychar; --/* The semantic value of the lookahead symbol. */ ++/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; --/* Location data for the lookahead symbol. */ ++/* Number of syntax errors so far. */ ++int yynerrs; ++/* Location data for the look-ahead symbol. */ YYLTYPE yylloc; -- /* Number of syntax errors so far. */ -- int yynerrs; -- -- int yystate; -- /* Number of tokens to shift before error messages enabled. */ -- int yyerrstatus; - - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. - - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ - - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; - - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; - - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; - - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; - - YYSIZE_T yystacksize; - ++ int yystate; + int yyn; + int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; - /* The variables used to return semantic value and location from the - action routines. */ - YYSTYPE yyval; - YYLTYPE yyloc; - ++ /* Number of tokens to shift before error messages enabled. */ ++ int yyerrstatus; ++ /* Look-ahead token as an internal (translated) token number. */ ++ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif - /* The stacks and their tools: - `yyss': related to states. - `yyvs': related to semantic values. - `yyls': related to locations. ++ /* Three stacks and their tools: ++ `yyss': related to states, ++ `yyvs': related to semantic values, ++ `yyls': related to locations. + - Refer to the stacks thru separate pointers, to allow yyoverflow - to reallocate them elsewhere. */ ++ Refer to the stacks thru separate pointers, to allow yyoverflow ++ to reallocate them elsewhere. */ + - /* The state stack. */ - yytype_int16 yyssa[YYINITDEPTH]; - yytype_int16 *yyss; - yytype_int16 *yyssp; ++ /* The state stack. */ ++ yytype_int16 yyssa[YYINITDEPTH]; ++ yytype_int16 *yyss = yyssa; ++ yytype_int16 *yyssp; + - /* The semantic value stack. */ - YYSTYPE yyvsa[YYINITDEPTH]; - YYSTYPE *yyvs; - YYSTYPE *yyvsp; ++ /* The semantic value stack. */ ++ YYSTYPE yyvsa[YYINITDEPTH]; ++ YYSTYPE *yyvs = yyvsa; ++ YYSTYPE *yyvsp; + - /* The location stack. */ - YYLTYPE yylsa[YYINITDEPTH]; - YYLTYPE *yyls; - YYLTYPE *yylsp; ++ /* The location stack. */ ++ YYLTYPE yylsa[YYINITDEPTH]; ++ YYLTYPE *yyls = yylsa; ++ YYLTYPE *yylsp; ++ /* The locations where the error started and ended. */ ++ YYLTYPE yyerror_range[2]; + - /* The locations where the error started and ended. */ - YYLTYPE yyerror_range[2]; +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - YYSIZE_T yystacksize; ++ YYSIZE_T yystacksize = YYINITDEPTH; + - int yyn; - int yyresult; - /* Lookahead token as an internal (translated) token number. */ - int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + -#if YYERROR_VERBOSE - /* Buffer for error messages, and its allocated size. */ - char yymsgbuf[128]; - char *yymsg = yymsgbuf; - YYSIZE_T yymsg_alloc = sizeof yymsgbuf; -#endif - -#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) - /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; -- yytoken = 0; -- yyss = yyssa; -- yyvs = yyvsa; -- yyls = yylsa; -- yystacksize = YYINITDEPTH; -- YYDPRINTF ((stderr, "Starting parse\n")); yystate = 0; yyerrstatus = 0; yynerrs = 0; -- yychar = YYEMPTY; /* Cause a token to be read. */ ++ yychar = YYEMPTY; /* Cause a token to be read. */ /* Initialize stack pointers. Waste one element of value and location stack so that they stay on the same level as the state stack. The wasted elements are never initialized. */ ++ yyssp = yyss; yyvsp = yyvs; yylsp = yyls; -- #if YYLTYPE_IS_TRIVIAL /* Initialize the default location before parsing starts. */ yylloc.first_line = yylloc.last_line = 1; -- yylloc.first_column = yylloc.last_column = 1; ++ yylloc.first_column = yylloc.last_column = 0; #endif goto yysetstate; @@@ -1970,7 -1919,7 +2050,6 @@@ &yyvs1, yysize * sizeof (*yyvsp), &yyls1, yysize * sizeof (*yylsp), &yystacksize); -- yyls = yyls1; yyss = yyss1; yyvs = yyvs1; @@@ -1992,9 -1941,9 +2071,9 @@@ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) goto yyexhaustedlab; -- YYSTACK_RELOCATE (yyss_alloc, yyss); -- YYSTACK_RELOCATE (yyvs_alloc, yyvs); -- YYSTACK_RELOCATE (yyls_alloc, yyls); ++ YYSTACK_RELOCATE (yyss); ++ YYSTACK_RELOCATE (yyvs); ++ YYSTACK_RELOCATE (yyls); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); @@@ -2015,9 -1964,9 +2094,6 @@@ YYDPRINTF ((stderr, "Entering state %d\n", yystate)); -- if (yystate == YYFINAL) -- YYACCEPT; -- goto yybackup; /*-----------. @@@ -2026,16 -1975,16 +2102,16 @@@ yybackup: /* Do appropriate processing given the current state. Read a -- lookahead token if we need one and don't already have one. */ ++ look-ahead token if we need one and don't already have one. */ -- /* First try to decide what to do without reference to lookahead token. */ ++ /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; -- /* Not known => get a lookahead token if don't already have one. */ ++ /* Not known => get a look-ahead token if don't already have one. */ -- /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ ++ /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@@ -2067,16 -2016,16 +2143,20 @@@ goto yyreduce; } ++ if (yyn == YYFINAL) ++ YYACCEPT; ++ /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; -- /* Shift the lookahead token. */ ++ /* Shift the look-ahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); -- /* Discard the shifted token. */ -- yychar = YYEMPTY; ++ /* Discard the shifted token unless it is eof. */ ++ if (yychar != YYEOF) ++ yychar = YYEMPTY; yystate = yyn; *++yyvsp = yylval; @@@ -2117,9 -2066,9 +2197,7 @@@ yyreduce switch (yyn) { case 3: -- --/* Line 1455 of yacc.c */ -#line 260 "program_parse.y" +#line 272 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@@ -2130,9 -2079,9 +2208,7 @@@ break; case 4: -- --/* Line 1455 of yacc.c */ -#line 268 "program_parse.y" +#line 280 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@@ -2145,9 -2094,9 +2221,7 @@@ break; case 7: -- --/* Line 1455 of yacc.c */ -#line 284 "program_parse.y" +#line 296 "program_parse.y" { int valid = 0; @@@ -2170,9 -2119,9 +2244,7 @@@ break; case 10: -- --/* Line 1455 of yacc.c */ -#line 310 "program_parse.y" +#line 322 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@@ -2190,9 -2139,9 +2262,7 @@@ break; case 12: -- --/* Line 1455 of yacc.c */ -#line 328 "program_parse.y" +#line 340 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@@ -2200,75 -2149,80 +2270,59 @@@ break; case 13: -- --/* Line 1455 of yacc.c */ -#line 333 "program_parse.y" +#line 345 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; ;} break; - case 23: - -/* Line 1455 of yacc.c */ -#line 353 "program_parse.y" - { - (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - ;} - break; - case 24: -- --/* Line 1455 of yacc.c */ -#line 359 "program_parse.y" +#line 366 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 25: -- --/* Line 1455 of yacc.c */ -#line 366 "program_parse.y" +#line 372 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 26: -- --/* Line 1455 of yacc.c */ -#line 373 "program_parse.y" +#line 378 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (4)].temp_inst), & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} break; case 27: -- --/* Line 1455 of yacc.c */ -#line 381 "program_parse.y" +#line 384 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; case 28: -- --/* Line 1455 of yacc.c */ -#line 389 "program_parse.y" +#line 391 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); - (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (6)].temp_inst), & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); ;} break; case 29: - - /* Line 1455 of yacc.c */ +#line 398 "program_parse.y" + { + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); + ;} + break; -/* Line 1455 of yacc.c */ -#line 396 "program_parse.y" + case 30: - - /* Line 1455 of yacc.c */ +#line 404 "program_parse.y" { - (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (8)].temp_inst), & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { const GLbitfield tex_mask = (1U << (yyvsp[(6) - (8)].integer)); GLbitfield shadow_tex = 0; @@@ -2310,173 -2265,113 +2364,139 @@@ ;} break; - case 30: - -/* Line 1455 of yacc.c */ -#line 441 "program_parse.y" + case 31: - - /* Line 1455 of yacc.c */ +#line 448 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; ;} break; - case 31: + case 32: - - /* Line 1455 of yacc.c */ +#line 453 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor(OPCODE_KIL_NV, NULL, NULL, NULL, NULL); + (yyval.inst)->Base.DstReg.CondMask = (yyvsp[(2) - (2)].dst_reg).CondMask; + (yyval.inst)->Base.DstReg.CondSwizzle = (yyvsp[(2) - (2)].dst_reg).CondSwizzle; + (yyval.inst)->Base.DstReg.CondSrc = (yyvsp[(2) - (2)].dst_reg).CondSrc; + state->fragment.UsesKill = 1; + ;} + break; -/* Line 1455 of yacc.c */ -#line 448 "program_parse.y" + case 33: - - /* Line 1455 of yacc.c */ +#line 463 "program_parse.y" { - (yyval.integer) = (yyvsp[(2) - (2)].integer); + (yyval.inst) = asm_instruction_copy_ctor(& (yyvsp[(1) - (12)].temp_inst), & (yyvsp[(2) - (12)].dst_reg), & (yyvsp[(4) - (12)].src_reg), & (yyvsp[(6) - (12)].src_reg), & (yyvsp[(8) - (12)].src_reg)); + if ((yyval.inst) != NULL) { + const GLbitfield tex_mask = (1U << (yyvsp[(10) - (12)].integer)); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + + (yyval.inst)->Base.TexSrcUnit = (yyvsp[(10) - (12)].integer); + + if ((yyvsp[(12) - (12)].integer) < 0) { + shadow_tex = tex_mask; + + (yyval.inst)->Base.TexSrcTarget = -(yyvsp[(12) - (12)].integer); + (yyval.inst)->Base.TexShadow = 1; + } else { + (yyval.inst)->Base.TexSrcTarget = (yyvsp[(12) - (12)].integer); + } + + target_mask = (1U << (yyval.inst)->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != 0) + && ((state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& (yylsp[(12) - (12)]), state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[(yyvsp[(10) - (12)].integer)] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; + } ;} break; - case 32: + case 34: - - /* Line 1455 of yacc.c */ +#line 507 "program_parse.y" + { + (yyval.integer) = (yyvsp[(2) - (2)].integer); + ;} + break; -/* Line 1455 of yacc.c */ -#line 453 "program_parse.y" + case 35: - - /* Line 1455 of yacc.c */ +#line 512 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; - case 33: - -/* Line 1455 of yacc.c */ -#line 454 "program_parse.y" + case 36: - - /* Line 1455 of yacc.c */ +#line 513 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; - case 34: - -/* Line 1455 of yacc.c */ -#line 455 "program_parse.y" + case 37: - - /* Line 1455 of yacc.c */ +#line 514 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; - case 35: - -/* Line 1455 of yacc.c */ -#line 456 "program_parse.y" + case 38: - - /* Line 1455 of yacc.c */ +#line 515 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; - case 36: - -/* Line 1455 of yacc.c */ -#line 457 "program_parse.y" + case 39: - - /* Line 1455 of yacc.c */ +#line 516 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; - case 37: - -/* Line 1455 of yacc.c */ -#line 458 "program_parse.y" + case 40: - - /* Line 1455 of yacc.c */ +#line 517 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; - case 38: - -/* Line 1455 of yacc.c */ -#line 459 "program_parse.y" + case 41: - - /* Line 1455 of yacc.c */ +#line 518 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; - case 39: - -/* Line 1455 of yacc.c */ -#line 460 "program_parse.y" + case 42: - - /* Line 1455 of yacc.c */ +#line 519 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; - case 40: - -/* Line 1455 of yacc.c */ -#line 461 "program_parse.y" + case 43: - - /* Line 1455 of yacc.c */ +#line 520 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; - case 41: - -/* Line 1455 of yacc.c */ -#line 462 "program_parse.y" + case 44: - - /* Line 1455 of yacc.c */ +#line 521 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; - case 42: - -/* Line 1455 of yacc.c */ -#line 463 "program_parse.y" + case 45: - - /* Line 1455 of yacc.c */ +#line 522 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; - case 43: - -/* Line 1455 of yacc.c */ -#line 464 "program_parse.y" + case 46: - - /* Line 1455 of yacc.c */ +#line 523 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; - case 44: - -/* Line 1455 of yacc.c */ -#line 468 "program_parse.y" + case 47: - - /* Line 1455 of yacc.c */ +#line 527 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@@ -2488,32 -2384,30 +2508,28 @@@ ;} break; - case 45: - -/* Line 1455 of yacc.c */ -#line 481 "program_parse.y" + case 48: - - /* Line 1455 of yacc.c */ +#line 539 "program_parse.y" { - (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + (yyval.src_reg) = (yyvsp[(2) - (2)].src_reg); - if ((yyvsp[(1) - (3)].negate)) { + if ((yyvsp[(1) - (2)].negate)) { (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; } - - (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, - (yyvsp[(3) - (3)].swiz_mask).swizzle); ;} break; - case 46: - -/* Line 1455 of yacc.c */ -#line 494 "program_parse.y" + case 49: - - /* Line 1455 of yacc.c */ +#line 547 "program_parse.y" { - (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + (yyval.src_reg) = (yyvsp[(3) - (4)].src_reg); - if ((yyvsp[(1) - (3)].negate)) { + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (4)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (4)].negate)) { (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; } @@@ -2521,88 -2416,13 +2537,78 @@@ ;} break; - case 47: + case 50: - - /* Line 1455 of yacc.c */ +#line 564 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(1) - (2)].src_reg); -/* Line 1455 of yacc.c */ -#line 507 "program_parse.y" + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(2) - (2)].swiz_mask).swizzle); + ;} + break; + + case 51: - - /* Line 1455 of yacc.c */ +#line 571 "program_parse.y" { - (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); - (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; + struct asm_symbol temp_sym; + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (1)]), state, "expected scalar suffix"); + YYERROR; + } + + memset(& temp_sym, 0, sizeof(temp_sym)); + temp_sym.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & temp_sym, & (yyvsp[(1) - (1)].vector)); + + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.File = PROGRAM_CONSTANT; + (yyval.src_reg).Base.Index = temp_sym.param_binding_begin; + ;} + break; + + case 52: - - /* Line 1455 of yacc.c */ +#line 590 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + + if ((yyvsp[(1) - (3)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(3) - (3)].swiz_mask).swizzle); + ;} + break; + + case 53: - - /* Line 1455 of yacc.c */ +#line 601 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(3) - (5)].src_reg); + + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(2) - (5)]), state, "unexpected character '|'"); + YYERROR; + } + + if ((yyvsp[(1) - (5)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Abs = 1; + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(4) - (5)].swiz_mask).swizzle); + ;} + break; + + case 54: - - /* Line 1455 of yacc.c */ +#line 621 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (3)].dst_reg); + (yyval.dst_reg).WriteMask = (yyvsp[(2) - (3)].swiz_mask).mask; + (yyval.dst_reg).CondMask = (yyvsp[(3) - (3)].dst_reg).CondMask; + (yyval.dst_reg).CondSwizzle = (yyvsp[(3) - (3)].dst_reg).CondSwizzle; + (yyval.dst_reg).CondSrc = (yyvsp[(3) - (3)].dst_reg).CondSrc; if ((yyval.dst_reg).File == PROGRAM_OUTPUT) { /* Technically speaking, this should check that it is in @@@ -2621,10 -2441,10 +2627,8 @@@ ;} break; - case 48: - -/* Line 1455 of yacc.c */ -#line 529 "program_parse.y" + case 55: - - /* Line 1455 of yacc.c */ +#line 646 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@@ -2633,10 -2453,10 +2637,8 @@@ ;} break; - case 49: - -/* Line 1455 of yacc.c */ -#line 538 "program_parse.y" + case 56: - - /* Line 1455 of yacc.c */ +#line 655 "program_parse.y" { const unsigned xyzw_valid = ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) @@@ -2669,20 -2489,20 +2671,16 @@@ ;} break; - case 50: - -/* Line 1455 of yacc.c */ -#line 571 "program_parse.y" + case 57: - - /* Line 1455 of yacc.c */ +#line 688 "program_parse.y" { (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 51: - -/* Line 1455 of yacc.c */ -#line 578 "program_parse.y" + case 58: - - /* Line 1455 of yacc.c */ +#line 695 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@@ -2699,10 -2519,10 +2697,8 @@@ ;} break; - case 52: - -/* Line 1455 of yacc.c */ -#line 593 "program_parse.y" + case 59: - - /* Line 1455 of yacc.c */ +#line 710 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@@ -2752,10 -2572,10 +2748,8 @@@ ;} break; - case 53: - -/* Line 1455 of yacc.c */ -#line 643 "program_parse.y" + case 60: - - /* Line 1455 of yacc.c */ +#line 760 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@@ -2799,10 -2619,10 +2793,8 @@@ ;} break; - case 54: - -/* Line 1455 of yacc.c */ -#line 685 "program_parse.y" + case 61: - - /* Line 1455 of yacc.c */ +#line 802 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@@ -2815,10 -2635,10 +2807,8 @@@ ;} break; - case 55: - -/* Line 1455 of yacc.c */ -#line 696 "program_parse.y" + case 62: - - /* Line 1455 of yacc.c */ +#line 813 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@@ -2841,10 -2661,10 +2831,8 @@@ ;} break; - case 56: - -/* Line 1455 of yacc.c */ -#line 717 "program_parse.y" + case 63: - - /* Line 1455 of yacc.c */ +#line 834 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@@ -2854,10 -2674,10 +2842,8 @@@ ;} break; - case 57: - -/* Line 1455 of yacc.c */ -#line 727 "program_parse.y" + case 64: - - /* Line 1455 of yacc.c */ +#line 844 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@@ -2865,10 -2685,10 +2851,8 @@@ ;} break; - case 58: - -/* Line 1455 of yacc.c */ -#line 733 "program_parse.y" + case 65: - - /* Line 1455 of yacc.c */ +#line 850 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@@ -2899,10 -2719,10 +2883,8 @@@ ;} break; - case 59: - -/* Line 1455 of yacc.c */ -#line 764 "program_parse.y" + case 66: - - /* Line 1455 of yacc.c */ +#line 881 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@@ -2919,20 -2739,20 +2901,16 @@@ ;} break; - case 62: - -/* Line 1455 of yacc.c */ -#line 783 "program_parse.y" + case 69: - - /* Line 1455 of yacc.c */ +#line 900 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 63: - -/* Line 1455 of yacc.c */ -#line 790 "program_parse.y" + case 70: - - /* Line 1455 of yacc.c */ +#line 907 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@@ -2944,37 -2764,35 +2922,29 @@@ ;} break; - case 64: - -/* Line 1455 of yacc.c */ -#line 801 "program_parse.y" + case 71: - - /* Line 1455 of yacc.c */ +#line 918 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 65: - -/* Line 1455 of yacc.c */ -#line 802 "program_parse.y" + case 72: - - /* Line 1455 of yacc.c */ +#line 919 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 66: - -/* Line 1455 of yacc.c */ -#line 803 "program_parse.y" + case 73: - - /* Line 1455 of yacc.c */ +#line 920 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 67: - -/* Line 1455 of yacc.c */ -#line 807 "program_parse.y" + case 74: - - /* Line 1455 of yacc.c */ +#line 924 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (positive)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@@ -2982,16 -2800,14 +2952,14 @@@ ;} break; - case 68: - -/* Line 1455 of yacc.c */ -#line 819 "program_parse.y" + case 75: - - /* Line 1455 of yacc.c */ +#line 938 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { - yyerror(& (yylsp[(1) - (1)]), state, - "relative address offset too large (negative)"); + char s[100]; + _mesa_snprintf(s, sizeof(s), + "relative address offset too large (%d)", (yyvsp[(1) - (1)].integer)); + yyerror(& (yylsp[(1) - (1)]), state, s); YYERROR; } else { (yyval.integer) = (yyvsp[(1) - (1)].integer); @@@ -2999,10 -2815,10 +2967,8 @@@ ;} break; - case 69: - -/* Line 1455 of yacc.c */ -#line 831 "program_parse.y" + case 76: - - /* Line 1455 of yacc.c */ +#line 952 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@@ -3020,10 -2836,10 +2986,8 @@@ ;} break; - case 70: - -/* Line 1455 of yacc.c */ -#line 849 "program_parse.y" + case 77: - - /* Line 1455 of yacc.c */ +#line 970 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@@ -3034,10 -2850,10 +2998,8 @@@ ;} break; - case 71: - -/* Line 1455 of yacc.c */ -#line 860 "program_parse.y" + case 78: - - /* Line 1455 of yacc.c */ +#line 981 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@@ -3049,125 -2865,24 +3011,105 @@@ ;} break; - case 76: + case 83: - - /* Line 1455 of yacc.c */ +#line 997 "program_parse.y" + { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} + break; -/* Line 1455 of yacc.c */ -#line 876 "program_parse.y" + case 88: - - /* Line 1455 of yacc.c */ +#line 1001 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 81: + case 89: - - /* Line 1455 of yacc.c */ +#line 1005 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); + ;} + break; -/* Line 1455 of yacc.c */ -#line 880 "program_parse.y" - { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} + case 90: - - /* Line 1455 of yacc.c */ +#line 1009 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(2) - (3)].dst_reg); + ;} break; - case 88: + case 91: - - /* Line 1455 of yacc.c */ +#line 1013 "program_parse.y" + { + (yyval.dst_reg).CondMask = COND_TR; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 92: - - /* Line 1455 of yacc.c */ +#line 1021 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; + ;} + break; + + case 93: - - /* Line 1455 of yacc.c */ +#line 1028 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).CondSwizzle = (yyvsp[(2) - (2)].swiz_mask).swizzle; + ;} + break; + + case 94: - - /* Line 1455 of yacc.c */ +#line 1035 "program_parse.y" + { + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 95: - - /* Line 1455 of yacc.c */ +#line 1058 "program_parse.y" + { + const int cond = _mesa_parse_cc((yyvsp[(1) - (1)].string)); + if ((cond == 0) || ((yyvsp[(1) - (1)].string)[2] != '\0')) { + char *const err_str = + make_error_string("invalid condition code \"%s\"", (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid condition code"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } -/* Line 1455 of yacc.c */ -#line 892 "program_parse.y" + (yyval.dst_reg).CondMask = cond; + (yyval.dst_reg).CondSwizzle = SWIZZLE_NOOP; + (yyval.dst_reg).CondSrc = 0; + ;} + break; + + case 102: - - /* Line 1455 of yacc.c */ +#line 1089 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@@ -3185,55 -2900,55 +3127,43 @@@ ;} break; - case 89: - -/* Line 1455 of yacc.c */ -#line 910 "program_parse.y" + case 103: - - /* Line 1455 of yacc.c */ +#line 1107 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 90: - -/* Line 1455 of yacc.c */ -#line 914 "program_parse.y" + case 104: - - /* Line 1455 of yacc.c */ +#line 1111 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 91: - -/* Line 1455 of yacc.c */ -#line 920 "program_parse.y" + case 105: - - /* Line 1455 of yacc.c */ +#line 1117 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 92: - -/* Line 1455 of yacc.c */ -#line 924 "program_parse.y" + case 106: - - /* Line 1455 of yacc.c */ +#line 1121 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 93: - -/* Line 1455 of yacc.c */ -#line 928 "program_parse.y" + case 107: - - /* Line 1455 of yacc.c */ +#line 1125 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 94: - -/* Line 1455 of yacc.c */ -#line 932 "program_parse.y" + case 108: - - /* Line 1455 of yacc.c */ +#line 1129 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@@ -3244,10 -2959,10 +3174,8 @@@ ;} break; - case 95: - -/* Line 1455 of yacc.c */ -#line 941 "program_parse.y" + case 109: - - /* Line 1455 of yacc.c */ +#line 1138 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@@ -3258,38 -2973,38 +3186,30 @@@ ;} break; - case 96: - -/* Line 1455 of yacc.c */ -#line 950 "program_parse.y" + case 110: - - /* Line 1455 of yacc.c */ +#line 1147 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 97: - -/* Line 1455 of yacc.c */ -#line 954 "program_parse.y" + case 111: - - /* Line 1455 of yacc.c */ +#line 1151 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 98: - -/* Line 1455 of yacc.c */ -#line 959 "program_parse.y" + case 112: - - /* Line 1455 of yacc.c */ +#line 1156 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 99: - -/* Line 1455 of yacc.c */ -#line 965 "program_parse.y" + case 113: - - /* Line 1455 of yacc.c */ +#line 1162 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@@ -3300,46 -3015,46 +3220,36 @@@ ;} break; - case 103: - -/* Line 1455 of yacc.c */ -#line 979 "program_parse.y" + case 117: - - /* Line 1455 of yacc.c */ +#line 1176 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 104: - -/* Line 1455 of yacc.c */ -#line 983 "program_parse.y" + case 118: - - /* Line 1455 of yacc.c */ +#line 1180 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 105: - -/* Line 1455 of yacc.c */ -#line 987 "program_parse.y" + case 119: - - /* Line 1455 of yacc.c */ +#line 1184 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 106: - -/* Line 1455 of yacc.c */ -#line 991 "program_parse.y" + case 120: - - /* Line 1455 of yacc.c */ +#line 1188 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 109: - -/* Line 1455 of yacc.c */ -#line 999 "program_parse.y" + case 123: - - /* Line 1455 of yacc.c */ +#line 1196 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@@ -3355,10 -3070,10 +3265,8 @@@ ;} break; - case 110: - -/* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" + case 124: - - /* Line 1455 of yacc.c */ +#line 1212 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@@ -3380,19 -3095,19 +3288,15 @@@ ;} break; - case 111: - -/* Line 1455 of yacc.c */ -#line 1037 "program_parse.y" + case 125: - - /* Line 1455 of yacc.c */ +#line 1234 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 112: - -/* Line 1455 of yacc.c */ -#line 1041 "program_parse.y" + case 126: - - /* Line 1455 of yacc.c */ +#line 1238 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) > state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@@ -3403,38 -3118,38 +3307,30 @@@ ;} break; - case 113: - -/* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" + case 127: - - /* Line 1455 of yacc.c */ +#line 1249 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 114: - -/* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" + case 128: - - /* Line 1455 of yacc.c */ +#line 1255 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 116: - -/* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" + case 130: - - /* Line 1455 of yacc.c */ +#line 1262 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 117: - -/* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" + case 131: - - /* Line 1455 of yacc.c */ +#line 1269 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3442,10 -3157,10 +3338,8 @@@ ;} break; - case 118: - -/* Line 1455 of yacc.c */ -#line 1078 "program_parse.y" + case 132: - - /* Line 1455 of yacc.c */ +#line 1275 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3453,10 -3168,10 +3347,8 @@@ ;} break; - case 119: - -/* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" + case 133: - - /* Line 1455 of yacc.c */ +#line 1281 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3464,10 -3179,10 +3356,8 @@@ ;} break; - case 120: - -/* Line 1455 of yacc.c */ -#line 1092 "program_parse.y" + case 134: - - /* Line 1455 of yacc.c */ +#line 1289 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3475,10 -3190,10 +3365,8 @@@ ;} break; - case 121: - -/* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" + case 135: - - /* Line 1455 of yacc.c */ +#line 1295 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3486,10 -3201,10 +3374,8 @@@ ;} break; - case 122: - -/* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" + case 136: - - /* Line 1455 of yacc.c */ +#line 1301 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3497,10 -3212,10 +3383,8 @@@ ;} break; - case 123: - -/* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" + case 137: - - /* Line 1455 of yacc.c */ +#line 1309 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3508,10 -3223,10 +3392,8 @@@ ;} break; - case 124: - -/* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" + case 138: - - /* Line 1455 of yacc.c */ +#line 1315 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3519,10 -3234,10 +3401,8 @@@ ;} break; - case 125: - -/* Line 1455 of yacc.c */ -#line 1124 "program_parse.y" + case 139: - - /* Line 1455 of yacc.c */ +#line 1321 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@@ -3530,101 -3245,101 +3410,73 @@@ ;} break; - case 126: - -/* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" + case 140: - - /* Line 1455 of yacc.c */ +#line 1328 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 127: - -/* Line 1455 of yacc.c */ -#line 1132 "program_parse.y" + case 141: - - /* Line 1455 of yacc.c */ +#line 1329 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 128: - -/* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" + case 142: - - /* Line 1455 of yacc.c */ +#line 1332 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 129: - -/* Line 1455 of yacc.c */ -#line 1136 "program_parse.y" + case 143: - - /* Line 1455 of yacc.c */ +#line 1333 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 130: - -/* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" + case 144: - - /* Line 1455 of yacc.c */ +#line 1334 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 131: - -/* Line 1455 of yacc.c */ -#line 1138 "program_parse.y" + case 145: - - /* Line 1455 of yacc.c */ +#line 1335 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 132: - -/* Line 1455 of yacc.c */ -#line 1139 "program_parse.y" + case 146: - - /* Line 1455 of yacc.c */ +#line 1336 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 133: - -/* Line 1455 of yacc.c */ -#line 1140 "program_parse.y" + case 147: - - /* Line 1455 of yacc.c */ +#line 1337 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 134: - -/* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" + case 148: - - /* Line 1455 of yacc.c */ +#line 1338 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 135: - -/* Line 1455 of yacc.c */ -#line 1142 "program_parse.y" + case 149: - - /* Line 1455 of yacc.c */ +#line 1339 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 136: - -/* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" + case 150: - - /* Line 1455 of yacc.c */ +#line 1340 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 137: - -/* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" + case 151: - - /* Line 1455 of yacc.c */ +#line 1341 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 138: - -/* Line 1455 of yacc.c */ -#line 1145 "program_parse.y" + case 152: - - /* Line 1455 of yacc.c */ +#line 1342 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 139: - -/* Line 1455 of yacc.c */ -#line 1149 "program_parse.y" + case 153: - - /* Line 1455 of yacc.c */ +#line 1346 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@@ -3633,37 -3348,37 +3485,29 @@@ ;} break; - case 140: - -/* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" + case 154: - - /* Line 1455 of yacc.c */ +#line 1355 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 141: - -/* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" + case 155: - - /* Line 1455 of yacc.c */ +#line 1359 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 142: - -/* Line 1455 of yacc.c */ -#line 1166 "program_parse.y" + case 156: - - /* Line 1455 of yacc.c */ +#line 1363 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 143: - -/* Line 1455 of yacc.c */ -#line 1172 "program_parse.y" + case 157: - - /* Line 1455 of yacc.c */ +#line 1369 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@@ -3672,28 -3387,28 +3516,22 @@@ ;} break; - case 144: - -/* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" + case 158: - - /* Line 1455 of yacc.c */ +#line 1378 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 145: - -/* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" + case 159: - - /* Line 1455 of yacc.c */ +#line 1382 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 146: - -/* Line 1455 of yacc.c */ -#line 1189 "program_parse.y" + case 160: - - /* Line 1455 of yacc.c */ +#line 1386 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@@ -3704,57 -3419,57 +3542,45 @@@ ;} break; - case 147: - -/* Line 1455 of yacc.c */ -#line 1198 "program_parse.y" + case 161: - - /* Line 1455 of yacc.c */ +#line 1395 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 148: - -/* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" + case 162: - - /* Line 1455 of yacc.c */ +#line 1399 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 149: - -/* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" + case 163: - - /* Line 1455 of yacc.c */ +#line 1405 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 150: - -/* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" + case 164: - - /* Line 1455 of yacc.c */ +#line 1411 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 151: - -/* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" + case 165: - - /* Line 1455 of yacc.c */ +#line 1418 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 152: - -/* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" + case 166: - - /* Line 1455 of yacc.c */ +#line 1423 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@@ -3762,10 -3477,10 +3588,8 @@@ ;} break; - case 153: - -/* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" + case 167: - - /* Line 1455 of yacc.c */ +#line 1431 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@@ -3775,10 -3490,10 +3599,8 @@@ ;} break; - case 155: - -/* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" + case 169: - - /* Line 1455 of yacc.c */ +#line 1443 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@@ -3786,46 -3501,46 +3608,36 @@@ ;} break; - case 156: - -/* Line 1455 of yacc.c */ -#line 1254 "program_parse.y" + case 170: - - /* Line 1455 of yacc.c */ +#line 1451 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 157: - -/* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" + case 171: - - /* Line 1455 of yacc.c */ +#line 1457 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 158: - -/* Line 1455 of yacc.c */ -#line 1264 "program_parse.y" + case 172: - - /* Line 1455 of yacc.c */ +#line 1461 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 159: - -/* Line 1455 of yacc.c */ -#line 1268 "program_parse.y" + case 173: - - /* Line 1455 of yacc.c */ +#line 1465 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 160: - -/* Line 1455 of yacc.c */ -#line 1274 "program_parse.y" + case 174: - - /* Line 1455 of yacc.c */ +#line 1471 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@@ -3836,10 -3551,10 +3648,8 @@@ ;} break; - case 161: - -/* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" + case 175: - - /* Line 1455 of yacc.c */ +#line 1482 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@@ -3848,92 -3563,92 +3658,72 @@@ ;} break; - case 162: - -/* Line 1455 of yacc.c */ -#line 1294 "program_parse.y" + case 176: - - /* Line 1455 of yacc.c */ +#line 1491 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 163: - -/* Line 1455 of yacc.c */ -#line 1298 "program_parse.y" + case 177: - - /* Line 1455 of yacc.c */ +#line 1495 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 164: - -/* Line 1455 of yacc.c */ -#line 1303 "program_parse.y" + case 178: - - /* Line 1455 of yacc.c */ +#line 1500 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 165: - -/* Line 1455 of yacc.c */ -#line 1307 "program_parse.y" + case 179: - - /* Line 1455 of yacc.c */ +#line 1504 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 166: - -/* Line 1455 of yacc.c */ -#line 1311 "program_parse.y" + case 180: - - /* Line 1455 of yacc.c */ +#line 1508 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 167: - -/* Line 1455 of yacc.c */ -#line 1315 "program_parse.y" + case 181: - - /* Line 1455 of yacc.c */ +#line 1512 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 168: - -/* Line 1455 of yacc.c */ -#line 1321 "program_parse.y" + case 182: - - /* Line 1455 of yacc.c */ +#line 1518 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 169: - -/* Line 1455 of yacc.c */ -#line 1328 "program_parse.y" + case 183: - - /* Line 1455 of yacc.c */ +#line 1525 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 170: - -/* Line 1455 of yacc.c */ -#line 1332 "program_parse.y" + case 184: - - /* Line 1455 of yacc.c */ +#line 1529 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 171: - -/* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" + case 185: - - /* Line 1455 of yacc.c */ +#line 1535 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@@ -3941,10 -3656,10 +3731,8 @@@ ;} break; - case 172: - -/* Line 1455 of yacc.c */ -#line 1346 "program_parse.y" + case 186: - - /* Line 1455 of yacc.c */ +#line 1543 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@@ -3955,38 -3670,38 +3743,30 @@@ ;} break; - case 173: - -/* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" + case 187: - - /* Line 1455 of yacc.c */ +#line 1554 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 174: - -/* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" + case 188: - - /* Line 1455 of yacc.c */ +#line 1561 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 175: - -/* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" + case 189: - - /* Line 1455 of yacc.c */ +#line 1565 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 176: - -/* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" + case 190: - - /* Line 1455 of yacc.c */ +#line 1571 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@@ -3996,10 -3711,10 +3776,8 @@@ ;} break; - case 177: - -/* Line 1455 of yacc.c */ -#line 1384 "program_parse.y" + case 191: - - /* Line 1455 of yacc.c */ +#line 1581 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@@ -4009,20 -3724,20 +3787,16 @@@ ;} break; - case 178: - -/* Line 1455 of yacc.c */ -#line 1394 "program_parse.y" + case 192: - - /* Line 1455 of yacc.c */ +#line 1591 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 179: - -/* Line 1455 of yacc.c */ -#line 1399 "program_parse.y" + case 193: - - /* Line 1455 of yacc.c */ +#line 1596 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@@ -4040,10 -3755,10 +3814,8 @@@ ;} break; - case 180: - -/* Line 1455 of yacc.c */ -#line 1417 "program_parse.y" + case 194: - - /* Line 1455 of yacc.c */ +#line 1614 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@@ -4051,55 -3766,55 +3823,43 @@@ ;} break; - case 181: - -/* Line 1455 of yacc.c */ -#line 1425 "program_parse.y" + case 195: - - /* Line 1455 of yacc.c */ +#line 1622 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 182: - -/* Line 1455 of yacc.c */ -#line 1429 "program_parse.y" + case 196: - - /* Line 1455 of yacc.c */ +#line 1626 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 183: - -/* Line 1455 of yacc.c */ -#line 1435 "program_parse.y" + case 197: - - /* Line 1455 of yacc.c */ +#line 1632 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 184: - -/* Line 1455 of yacc.c */ -#line 1439 "program_parse.y" + case 198: - - /* Line 1455 of yacc.c */ +#line 1636 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 185: - -/* Line 1455 of yacc.c */ -#line 1443 "program_parse.y" + case 199: - - /* Line 1455 of yacc.c */ +#line 1640 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 186: - -/* Line 1455 of yacc.c */ -#line 1449 "program_parse.y" + case 200: - - /* Line 1455 of yacc.c */ +#line 1646 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@@ -4110,88 -3825,88 +3870,70 @@@ ;} break; - case 187: - -/* Line 1455 of yacc.c */ -#line 1460 "program_parse.y" + case 201: - - /* Line 1455 of yacc.c */ +#line 1657 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 188: - -/* Line 1455 of yacc.c */ -#line 1465 "program_parse.y" + case 202: - - /* Line 1455 of yacc.c */ +#line 1662 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 189: - -/* Line 1455 of yacc.c */ -#line 1470 "program_parse.y" + case 203: - - /* Line 1455 of yacc.c */ +#line 1667 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 190: - -/* Line 1455 of yacc.c */ -#line 1475 "program_parse.y" + case 204: - - /* Line 1455 of yacc.c */ +#line 1672 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 191: - -/* Line 1455 of yacc.c */ -#line 1480 "program_parse.y" + case 205: - - /* Line 1455 of yacc.c */ +#line 1677 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 192: - -/* Line 1455 of yacc.c */ -#line 1485 "program_parse.y" + case 206: - - /* Line 1455 of yacc.c */ +#line 1682 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 193: - -/* Line 1455 of yacc.c */ -#line 1492 "program_parse.y" + case 207: - - /* Line 1455 of yacc.c */ +#line 1689 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 194: - -/* Line 1455 of yacc.c */ -#line 1496 "program_parse.y" + case 208: - - /* Line 1455 of yacc.c */ +#line 1693 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 195: - -/* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" + case 209: - - /* Line 1455 of yacc.c */ +#line 1698 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@@ -4205,10 -3920,10 +3947,8 @@@ ;} break; - case 196: - -/* Line 1455 of yacc.c */ -#line 1514 "program_parse.y" + case 210: - - /* Line 1455 of yacc.c */ +#line 1711 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@@ -4217,10 -3932,10 +3957,8 @@@ ;} break; - case 197: - -/* Line 1455 of yacc.c */ -#line 1522 "program_parse.y" + case 211: - - /* Line 1455 of yacc.c */ +#line 1719 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@@ -4231,20 -3946,20 +3969,16 @@@ ;} break; - case 198: - -/* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" + case 212: - - /* Line 1455 of yacc.c */ +#line 1730 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; ;} break; - case 203: - -/* Line 1455 of yacc.c */ -#line 1545 "program_parse.y" + case 217: - - /* Line 1455 of yacc.c */ +#line 1742 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@@ -4254,30 -3969,30 +3988,24 @@@ ;} break; - case 204: - -/* Line 1455 of yacc.c */ -#line 1555 "program_parse.y" + case 218: - - /* Line 1455 of yacc.c */ +#line 1752 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 205: - -/* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" + case 219: - - /* Line 1455 of yacc.c */ +#line 1757 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 206: - -/* Line 1455 of yacc.c */ -#line 1567 "program_parse.y" + case 220: - - /* Line 1455 of yacc.c */ +#line 1764 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@@ -4287,10 -4002,10 +4015,8 @@@ ;} break; - case 207: - -/* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" + case 221: - - /* Line 1455 of yacc.c */ +#line 1774 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@@ -4300,30 -4015,30 +4026,24 @@@ ;} break; - case 208: - -/* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" + case 222: - - /* Line 1455 of yacc.c */ +#line 1783 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 209: - -/* Line 1455 of yacc.c */ -#line 1591 "program_parse.y" + case 223: - - /* Line 1455 of yacc.c */ +#line 1788 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 210: - -/* Line 1455 of yacc.c */ -#line 1598 "program_parse.y" + case 224: - - /* Line 1455 of yacc.c */ +#line 1795 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@@ -4333,10 -4048,10 +4053,8 @@@ ;} break; - case 211: - -/* Line 1455 of yacc.c */ -#line 1608 "program_parse.y" + case 225: - - /* Line 1455 of yacc.c */ +#line 1805 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@@ -4346,10 -4061,10 +4064,8 @@@ ;} break; - case 212: - -/* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" + case 226: - - /* Line 1455 of yacc.c */ +#line 1815 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@@ -4359,10 -4074,10 +4075,8 @@@ ;} break; - case 217: - -/* Line 1455 of yacc.c */ -#line 1633 "program_parse.y" + case 231: - - /* Line 1455 of yacc.c */ +#line 1830 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@@ -4372,10 -4087,10 +4086,8 @@@ ;} break; - case 218: - -/* Line 1455 of yacc.c */ -#line 1643 "program_parse.y" + case 232: - - /* Line 1455 of yacc.c */ +#line 1840 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@@ -4385,10 -4100,10 +4097,8 @@@ ;} break; - case 219: - -/* Line 1455 of yacc.c */ -#line 1651 "program_parse.y" + case 233: - - /* Line 1455 of yacc.c */ +#line 1848 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@@ -4398,10 -4113,10 +4108,8 @@@ ;} break; - case 220: - -/* Line 1455 of yacc.c */ -#line 1661 "program_parse.y" + case 234: - - /* Line 1455 of yacc.c */ +#line 1858 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@@ -4411,10 -4126,10 +4119,8 @@@ ;} break; - case 221: - -/* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" + case 235: - - /* Line 1455 of yacc.c */ +#line 1866 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@@ -4424,10 -4139,10 +4130,8 @@@ ;} break; - case 222: - -/* Line 1455 of yacc.c */ -#line 1678 "program_parse.y" + case 236: - - /* Line 1455 of yacc.c */ +#line 1875 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@@ -4437,10 -4152,10 +4141,8 @@@ ;} break; - case 223: - -/* Line 1455 of yacc.c */ -#line 1687 "program_parse.y" + case 237: - - /* Line 1455 of yacc.c */ +#line 1884 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@@ -4450,110 -4165,63 +4152,90 @@@ ;} break; - case 224: - -/* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" + case 238: - - /* Line 1455 of yacc.c */ +#line 1894 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 225: - -/* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" + case 239: - - /* Line 1455 of yacc.c */ +#line 1898 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 226: - -/* Line 1455 of yacc.c */ -#line 1706 "program_parse.y" + case 240: - - /* Line 1455 of yacc.c */ +#line 1903 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 227: - -/* Line 1455 of yacc.c */ -#line 1707 "program_parse.y" + case 241: - - /* Line 1455 of yacc.c */ +#line 1904 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 228: - -/* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" + case 242: - - /* Line 1455 of yacc.c */ +#line 1905 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 229: + case 243: - - /* Line 1455 of yacc.c */ +#line 1908 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} + break; -/* Line 1455 of yacc.c */ -#line 1711 "program_parse.y" - { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} + case 245: - - /* Line 1455 of yacc.c */ +#line 1912 "program_parse.y" + { + /* NV_fragment_program_option defines the size qualifiers in a + * fairly broken way. "SHORT" or "LONG" can optionally be used + * before TEMP or OUTPUT. However, neither is a reserved word! + * This means that we have to parse it as an identifier, then check + * to make sure it's one of the valid values. *sigh* + * + * In addition, the grammar in the extension spec does *not* allow + * the size specifier to be optional, but all known implementations + * do. + */ + if (!state->option.NV_fragment) { + yyerror(& (yylsp[(1) - (1)]), state, "unexpected IDENTIFIER"); + YYERROR; + } + + if (strcmp("SHORT", (yyvsp[(1) - (1)].string)) == 0) { + } else if (strcmp("LONG", (yyvsp[(1) - (1)].string)) == 0) { + } else { + char *const err_str = + make_error_string("invalid storage size specifier \"%s\"", + (yyvsp[(1) - (1)].string)); + + yyerror(& (yylsp[(1) - (1)]), state, (err_str != NULL) + ? err_str : "invalid storage size specifier"); + + if (err_str != NULL) { + _mesa_free(err_str); + } + + YYERROR; + } + ;} break; - case 231: + case 246: - - /* Line 1455 of yacc.c */ +#line 1946 "program_parse.y" + { + ;} + break; -/* Line 1455 of yacc.c */ -#line 1714 "program_parse.y" + case 247: - - /* Line 1455 of yacc.c */ +#line 1950 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 233: - -/* Line 1455 of yacc.c */ -#line 1718 "program_parse.y" + case 249: - - /* Line 1455 of yacc.c */ +#line 1954 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@@ -4561,10 -4229,10 +4243,8 @@@ ;} break; - case 234: - -/* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" + case 250: - - /* Line 1455 of yacc.c */ +#line 1960 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@@ -4572,13 -4240,13 +4252,11 @@@ ;} break; - case 235: - -/* Line 1455 of yacc.c */ -#line 1732 "program_parse.y" + case 251: - - /* Line 1455 of yacc.c */ +#line 1968 "program_parse.y" { struct asm_symbol *const s = - declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); + declare_variable(state, (yyvsp[(3) - (5)].string), at_output, & (yylsp[(3) - (5)])); if (s == NULL) { YYERROR; @@@ -4588,10 -4256,10 +4266,8 @@@ ;} break; - case 236: - -/* Line 1455 of yacc.c */ -#line 1745 "program_parse.y" + case 252: - - /* Line 1455 of yacc.c */ +#line 1981 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@@ -4602,10 -4270,10 +4278,8 @@@ ;} break; - case 237: - -/* Line 1455 of yacc.c */ -#line 1754 "program_parse.y" + case 253: - - /* Line 1455 of yacc.c */ +#line 1990 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@@ -4616,19 -4284,19 +4290,15 @@@ ;} break; - case 238: - -/* Line 1455 of yacc.c */ -#line 1763 "program_parse.y" + case 254: - - /* Line 1455 of yacc.c */ +#line 1999 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 239: - -/* Line 1455 of yacc.c */ -#line 1767 "program_parse.y" + case 255: - - /* Line 1455 of yacc.c */ +#line 2003 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@@ -4639,10 -4307,10 +4309,8 @@@ ;} break; - case 240: - -/* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" + case 256: - - /* Line 1455 of yacc.c */ +#line 2012 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@@ -4653,10 -4321,10 +4321,8 @@@ ;} break; - case 241: - -/* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" + case 257: - - /* Line 1455 of yacc.c */ +#line 2021 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@@ -4667,19 -4335,19 +4333,15 @@@ ;} break; - case 242: - -/* Line 1455 of yacc.c */ -#line 1796 "program_parse.y" + case 258: - - /* Line 1455 of yacc.c */ +#line 2032 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 243: - -/* Line 1455 of yacc.c */ -#line 1802 "program_parse.y" + case 259: - - /* Line 1455 of yacc.c */ +#line 2038 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@@ -4687,10 -4355,10 +4349,8 @@@ ;} break; - case 244: - -/* Line 1455 of yacc.c */ -#line 1808 "program_parse.y" + case 260: - - /* Line 1455 of yacc.c */ +#line 2044 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@@ -4701,10 -4369,10 +4361,8 @@@ ;} break; - case 245: - -/* Line 1455 of yacc.c */ -#line 1817 "program_parse.y" + case 261: - - /* Line 1455 of yacc.c */ +#line 2053 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@@ -4715,19 -4383,19 +4373,15 @@@ ;} break; - case 246: - -/* Line 1455 of yacc.c */ -#line 1828 "program_parse.y" + case 262: - - /* Line 1455 of yacc.c */ +#line 2064 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 247: - -/* Line 1455 of yacc.c */ -#line 1832 "program_parse.y" + case 263: - - /* Line 1455 of yacc.c */ +#line 2068 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@@ -4738,10 -4406,10 +4392,8 @@@ ;} break; - case 248: - -/* Line 1455 of yacc.c */ -#line 1841 "program_parse.y" + case 264: - - /* Line 1455 of yacc.c */ +#line 2077 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@@ -4752,94 -4420,94 +4404,68 @@@ ;} break; - case 249: - -/* Line 1455 of yacc.c */ -#line 1851 "program_parse.y" + case 265: - - /* Line 1455 of yacc.c */ +#line 2087 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 250: - -/* Line 1455 of yacc.c */ -#line 1852 "program_parse.y" + case 266: - - /* Line 1455 of yacc.c */ +#line 2088 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 251: - -/* Line 1455 of yacc.c */ -#line 1853 "program_parse.y" + case 267: - - /* Line 1455 of yacc.c */ +#line 2089 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 252: - -/* Line 1455 of yacc.c */ -#line 1856 "program_parse.y" + case 268: - - /* Line 1455 of yacc.c */ +#line 2092 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 253: - -/* Line 1455 of yacc.c */ -#line 1857 "program_parse.y" + case 269: - - /* Line 1455 of yacc.c */ +#line 2093 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: - -/* Line 1455 of yacc.c */ -#line 1858 "program_parse.y" + case 270: - - /* Line 1455 of yacc.c */ +#line 2094 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 255: - -/* Line 1455 of yacc.c */ -#line 1861 "program_parse.y" + case 271: - - /* Line 1455 of yacc.c */ +#line 2097 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: - -/* Line 1455 of yacc.c */ -#line 1862 "program_parse.y" + case 272: - - /* Line 1455 of yacc.c */ +#line 2098 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 257: - -/* Line 1455 of yacc.c */ -#line 1865 "program_parse.y" + case 273: - - /* Line 1455 of yacc.c */ +#line 2101 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: - -/* Line 1455 of yacc.c */ -#line 1866 "program_parse.y" + case 274: - - /* Line 1455 of yacc.c */ +#line 2102 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 259: - -/* Line 1455 of yacc.c */ -#line 1869 "program_parse.y" + case 275: - - /* Line 1455 of yacc.c */ +#line 2105 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 260: - -/* Line 1455 of yacc.c */ -#line 1870 "program_parse.y" + case 276: - - /* Line 1455 of yacc.c */ +#line 2106 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 261: - -/* Line 1455 of yacc.c */ -#line 1874 "program_parse.y" + case 277: - - /* Line 1455 of yacc.c */ +#line 2110 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@@ -4850,10 -4518,10 +4476,8 @@@ ;} break; - case 262: - -/* Line 1455 of yacc.c */ -#line 1885 "program_parse.y" + case 278: - - /* Line 1455 of yacc.c */ +#line 2121 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@@ -4864,10 -4532,10 +4488,8 @@@ ;} break; - case 263: - -/* Line 1455 of yacc.c */ -#line 1896 "program_parse.y" + case 279: - - /* Line 1455 of yacc.c */ +#line 2132 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@@ -4878,10 -4546,10 +4500,8 @@@ ;} break; - case 264: - -/* Line 1455 of yacc.c */ -#line 1907 "program_parse.y" + case 280: - - /* Line 1455 of yacc.c */ +#line 2143 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@@ -4903,9 -4571,9 +4523,8 @@@ break; -- --/* Line 1455 of yacc.c */ - #line 4909 "program_parse.tab.c" -#line 4577 "program_parse.tab.c" ++/* Line 1267 of yacc.c. */ ++#line 4528 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@@ -4981,7 -4649,7 +4600,7 @@@ yyerrlab if (yyerrstatus == 3) { -- /* If just tried and failed to reuse lookahead token after an ++ /* If just tried and failed to reuse look-ahead token after an error, discard it. */ if (yychar <= YYEOF) @@@ -4998,7 -4666,7 +4617,7 @@@ } } -- /* Else will try to reuse lookahead token after shifting the error ++ /* Else will try to reuse look-ahead token after shifting the error token. */ goto yyerrlab1; @@@ -5056,11 -4724,11 +4675,14 @@@ yyerrlab1 YY_STACK_PRINT (yyss, yyssp); } ++ if (yyn == YYFINAL) ++ YYACCEPT; ++ *++yyvsp = yylval; yyerror_range[1] = yylloc; /* Using YYLLOC is tempting, but would change the location of -- the lookahead. YYLOC is available though. */ ++ the look-ahead. YYLOC is available though. */ YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); *++yylsp = yyloc; @@@ -5085,7 -4753,7 +4707,7 @@@ yyabortlab yyresult = 1; goto yyreturn; --#if !defined(yyoverflow) || YYERROR_VERBOSE ++#ifndef yyoverflow /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@@ -5096,7 -4764,7 +4718,7 @@@ yyexhaustedlab #endif yyreturn: -- if (yychar != YYEMPTY) ++ if (yychar != YYEOF && yychar != YYEMPTY) yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval, &yylloc, state); /* Do not reclaim the symbols of the rule which action triggered @@@ -5122,51 -4790,9 +4744,49 @@@ } - - /* Line 1675 of yacc.c */ +#line 2167 "program_parse.y" + + +void +asm_instruction_set_operands(struct asm_instruction *inst, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + /* In the core ARB extensions only the KIL instruction doesn't have a + * destination register. + */ + if (dst == NULL) { + init_dst_reg(& inst->Base.DstReg); + } else { + inst->Base.DstReg = *dst; + } + + /* The only instruction that doesn't have any source registers is the + * condition-code based KIL instruction added by NV_fragment_program_option. + */ + if (src0 != NULL) { + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + } else { + init_src_reg(& inst->SrcReg[0]); + } + + if (src1 != NULL) { + inst->Base.SrcReg[1] = src1->Base; + inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); + } -/* Line 1675 of yacc.c */ -#line 1927 "program_parse.y" + if (src2 != NULL) { + inst->Base.SrcReg[2] = src2->Base; + inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); + } +} struct asm_instruction * diff --cc src/mesa/shader/program_parse.tab.h index 860b6f886e9,dabb3bf1a36..ae6dd8c34e2 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@@ -1,23 -1,23 +1,24 @@@ -- --/* A Bison parser, made by GNU Bison 2.4.1. */ ++/* A Bison parser, made by GNU Bison 2.3. */ /* Skeleton interface for Bison's Yacc-like parsers in C -- -- Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 ++ ++ Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -- -- This program is free software: you can redistribute it and/or modify ++ ++ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -- the Free Software Foundation, either version 3 of the License, or -- (at your option) any later version. -- ++ the Free Software Foundation; either version 2, or (at your option) ++ any later version. ++ This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. -- ++ You should have received a copy of the GNU General Public License -- along with this program. If not, see . */ ++ along with this program; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin Street, Fifth Floor, ++ Boston, MA 02110-1301, USA. */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work @@@ -28,11 -28,11 +29,10 @@@ special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. -- ++ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ -- /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@@ -58,104 -58,102 +58,208 @@@ ARL = 274, KIL = 275, SWZ = 276, - INTEGER = 277, - REAL = 278, - AMBIENT = 279, - ATTENUATION = 280, - BACK = 281, - CLIP = 282, - COLOR = 283, - DEPTH = 284, - DIFFUSE = 285, - DIRECTION = 286, - EMISSION = 287, - ENV = 288, - EYE = 289, - FOG = 290, - FOGCOORD = 291, - FRAGMENT = 292, - FRONT = 293, - HALF = 294, - INVERSE = 295, - INVTRANS = 296, - LIGHT = 297, - LIGHTMODEL = 298, - LIGHTPROD = 299, - LOCAL = 300, - MATERIAL = 301, - MAT_PROGRAM = 302, - MATRIX = 303, - MATRIXINDEX = 304, - MODELVIEW = 305, - MVP = 306, - NORMAL = 307, - OBJECT = 308, - PALETTE = 309, - PARAMS = 310, - PLANE = 311, - POINT_TOK = 312, - POINTSIZE = 313, - POSITION = 314, - PRIMARY = 315, - PROGRAM = 316, - PROJECTION = 317, - RANGE = 318, - RESULT = 319, - ROW = 320, - SCENECOLOR = 321, - SECONDARY = 322, - SHININESS = 323, - SIZE_TOK = 324, - SPECULAR = 325, - SPOT = 326, - STATE = 327, - TEXCOORD = 328, - TEXENV = 329, - TEXGEN = 330, - TEXGEN_Q = 331, - TEXGEN_R = 332, - TEXGEN_S = 333, - TEXGEN_T = 334, - TEXTURE = 335, - TRANSPOSE = 336, - TEXTURE_UNIT = 337, - TEX_1D = 338, - TEX_2D = 339, - TEX_3D = 340, - TEX_CUBE = 341, - TEX_RECT = 342, - TEX_SHADOW1D = 343, - TEX_SHADOW2D = 344, - TEX_SHADOWRECT = 345, - TEX_ARRAY1D = 346, - TEX_ARRAY2D = 347, - TEX_ARRAYSHADOW1D = 348, - TEX_ARRAYSHADOW2D = 349, - VERTEX = 350, - VTXATTRIB = 351, - WEIGHT = 352, - IDENTIFIER = 353, - MASK4 = 354, - MASK3 = 355, - MASK2 = 356, - MASK1 = 357, - SWIZZLE = 358, - DOT_DOT = 359, - DOT = 360 + TXD_OP = 277, + INTEGER = 278, + REAL = 279, + AMBIENT = 280, + ATTENUATION = 281, + BACK = 282, + CLIP = 283, + COLOR = 284, + DEPTH = 285, + DIFFUSE = 286, + DIRECTION = 287, + EMISSION = 288, + ENV = 289, + EYE = 290, + FOG = 291, + FOGCOORD = 292, + FRAGMENT = 293, + FRONT = 294, + HALF = 295, + INVERSE = 296, + INVTRANS = 297, + LIGHT = 298, + LIGHTMODEL = 299, + LIGHTPROD = 300, + LOCAL = 301, + MATERIAL = 302, + MAT_PROGRAM = 303, + MATRIX = 304, + MATRIXINDEX = 305, + MODELVIEW = 306, + MVP = 307, + NORMAL = 308, + OBJECT = 309, + PALETTE = 310, + PARAMS = 311, + PLANE = 312, + POINT_TOK = 313, + POINTSIZE = 314, + POSITION = 315, + PRIMARY = 316, + PROGRAM = 317, + PROJECTION = 318, + RANGE = 319, + RESULT = 320, + ROW = 321, + SCENECOLOR = 322, + SECONDARY = 323, + SHININESS = 324, + SIZE_TOK = 325, + SPECULAR = 326, + SPOT = 327, + STATE = 328, + TEXCOORD = 329, + TEXENV = 330, + TEXGEN = 331, + TEXGEN_Q = 332, + TEXGEN_R = 333, + TEXGEN_S = 334, + TEXGEN_T = 335, + TEXTURE = 336, + TRANSPOSE = 337, + TEXTURE_UNIT = 338, + TEX_1D = 339, + TEX_2D = 340, + TEX_3D = 341, + TEX_CUBE = 342, + TEX_RECT = 343, + TEX_SHADOW1D = 344, + TEX_SHADOW2D = 345, + TEX_SHADOWRECT = 346, + TEX_ARRAY1D = 347, + TEX_ARRAY2D = 348, + TEX_ARRAYSHADOW1D = 349, + TEX_ARRAYSHADOW2D = 350, + VERTEX = 351, + VTXATTRIB = 352, + WEIGHT = 353, + IDENTIFIER = 354, + USED_IDENTIFIER = 355, + MASK4 = 356, + MASK3 = 357, + MASK2 = 358, + MASK1 = 359, + SWIZZLE = 360, + DOT_DOT = 361, + DOT = 362 }; #endif ++/* Tokens. */ ++#define ARBvp_10 258 ++#define ARBfp_10 259 ++#define ADDRESS 260 ++#define ALIAS 261 ++#define ATTRIB 262 ++#define OPTION 263 ++#define OUTPUT 264 ++#define PARAM 265 ++#define TEMP 266 ++#define END 267 ++#define BIN_OP 268 ++#define BINSC_OP 269 ++#define SAMPLE_OP 270 ++#define SCALAR_OP 271 ++#define TRI_OP 272 ++#define VECTOR_OP 273 ++#define ARL 274 ++#define KIL 275 ++#define SWZ 276 ++#define TXD_OP 277 ++#define INTEGER 278 ++#define REAL 279 ++#define AMBIENT 280 ++#define ATTENUATION 281 ++#define BACK 282 ++#define CLIP 283 ++#define COLOR 284 ++#define DEPTH 285 ++#define DIFFUSE 286 ++#define DIRECTION 287 ++#define EMISSION 288 ++#define ENV 289 ++#define EYE 290 ++#define FOG 291 ++#define FOGCOORD 292 ++#define FRAGMENT 293 ++#define FRONT 294 ++#define HALF 295 ++#define INVERSE 296 ++#define INVTRANS 297 ++#define LIGHT 298 ++#define LIGHTMODEL 299 ++#define LIGHTPROD 300 ++#define LOCAL 301 ++#define MATERIAL 302 ++#define MAT_PROGRAM 303 ++#define MATRIX 304 ++#define MATRIXINDEX 305 ++#define MODELVIEW 306 ++#define MVP 307 ++#define NORMAL 308 ++#define OBJECT 309 ++#define PALETTE 310 ++#define PARAMS 311 ++#define PLANE 312 ++#define POINT_TOK 313 ++#define POINTSIZE 314 ++#define POSITION 315 ++#define PRIMARY 316 ++#define PROGRAM 317 ++#define PROJECTION 318 ++#define RANGE 319 ++#define RESULT 320 ++#define ROW 321 ++#define SCENECOLOR 322 ++#define SECONDARY 323 ++#define SHININESS 324 ++#define SIZE_TOK 325 ++#define SPECULAR 326 ++#define SPOT 327 ++#define STATE 328 ++#define TEXCOORD 329 ++#define TEXENV 330 ++#define TEXGEN 331 ++#define TEXGEN_Q 332 ++#define TEXGEN_R 333 ++#define TEXGEN_S 334 ++#define TEXGEN_T 335 ++#define TEXTURE 336 ++#define TRANSPOSE 337 ++#define TEXTURE_UNIT 338 ++#define TEX_1D 339 ++#define TEX_2D 340 ++#define TEX_3D 341 ++#define TEX_CUBE 342 ++#define TEX_RECT 343 ++#define TEX_SHADOW1D 344 ++#define TEX_SHADOW2D 345 ++#define TEX_SHADOWRECT 346 ++#define TEX_ARRAY1D 347 ++#define TEX_ARRAY2D 348 ++#define TEX_ARRAYSHADOW1D 349 ++#define TEX_ARRAYSHADOW2D 350 ++#define VERTEX 351 ++#define VTXATTRIB 352 ++#define WEIGHT 353 ++#define IDENTIFIER 354 ++#define USED_IDENTIFIER 355 ++#define MASK4 356 ++#define MASK3 357 ++#define MASK2 358 ++#define MASK1 359 ++#define SWIZZLE 360 ++#define DOT_DOT 361 ++#define DOT 362 ++ #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE - { - - /* Line 1676 of yacc.c */ +#line 116 "program_parse.y" - + { - -/* Line 1676 of yacc.c */ -#line 107 "program_parse.y" - struct asm_instruction *inst; struct asm_symbol *sym; struct asm_symbol temp_sym; @@@ -179,15 -177,15 +283,13 @@@ unsigned xyzw_valid:1; unsigned negate:1; } ext_swizzle; -- -- -- --/* Line 1676 of yacc.c */ - #line 187 "program_parse.tab.h" -#line 185 "program_parse.tab.h" --} YYSTYPE; --# define YYSTYPE_IS_TRIVIAL 1 ++} ++/* Line 1489 of yacc.c. */ ++#line 289 "program_parse.tab.h" ++ YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 ++# define YYSTYPE_IS_TRIVIAL 1 #endif @@@ -206,4 -204,4 +308,3 @@@ typedef struct YYLTYP #endif --