diff --git a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c index 80ac1669c..70eca4be9 100644 --- a/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c +++ b/3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.c @@ -1,6 +1,5 @@ -#line 2 "src/glsl/glcpp/glcpp-lex.c" -#line 4 "src/glsl/glcpp/glcpp-lex.c" +#line 3 "" #define YY_INT_ALIGNED short int @@ -8,8 +7,8 @@ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 +#define YY_FLEX_MINOR_VERSION 6 +#define YY_FLEX_SUBMINOR_VERSION 0 #if YY_FLEX_SUBMINOR_VERSION > 0 #define FLEX_BETA #endif @@ -179,11 +178,17 @@ typedef void* yyscan_t; typedef struct yy_buffer_state *YY_BUFFER_STATE; #endif +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 #define YY_LESS_LINENO(n) + #define YY_LINENO_REWIND_TO(ptr) /* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ @@ -201,11 +206,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE; #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner ) -#ifndef YY_TYPEDEF_YY_SIZE_T -#define YY_TYPEDEF_YY_SIZE_T -typedef size_t yy_size_t; -#endif - #ifndef YY_STRUCT_YY_BUFFER_STATE #define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state @@ -302,7 +302,7 @@ static void glcpp__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner YY_BUFFER_STATE glcpp__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); YY_BUFFER_STATE glcpp__scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); -YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); +YY_BUFFER_STATE glcpp__scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner ); void *glcpp_alloc (yy_size_t ,yyscan_t yyscanner ); void *glcpp_realloc (void *,yy_size_t ,yyscan_t yyscanner ); @@ -334,7 +334,7 @@ void glcpp_free (void * ,yyscan_t yyscanner ); /* Begin user sect3 */ -#define glcpp_wrap(n) 1 +#define glcpp_wrap(yyscanner) (/*CONSTCOND*/1) #define YY_SKIP_YYWRAP typedef unsigned char YY_CHAR; @@ -346,6 +346,9 @@ typedef int yy_state_type; static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); static int yy_get_next_buffer (yyscan_t yyscanner ); +#if defined(__GNUC__) && __GNUC__ >= 3 +__attribute__((__noreturn__)) +#endif static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); /* Done after the current pattern has been matched and before the @@ -390,7 +393,7 @@ static yyconst flex_int16_t yy_accept[174] = 9, 11, 0 } ; -static yyconst flex_int32_t yy_ec[256] = +static yyconst YY_CHAR yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 4, 4, 5, 1, 1, 1, 1, 1, 1, 1, @@ -422,7 +425,7 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[46] = +static yyconst YY_CHAR yy_meta[46] = { 0, 1, 2, 3, 2, 3, 1, 1, 1, 1, 4, 5, 1, 1, 6, 1, 7, 7, 7, 1, 1, @@ -431,7 +434,7 @@ static yyconst flex_int32_t yy_meta[46] = 7, 7, 7, 7, 1 } ; -static yyconst flex_int16_t yy_base[191] = +static yyconst flex_uint16_t yy_base[191] = { 0, 0, 0, 43, 44, 55, 0, 47, 48, 99, 141, 102, 103, 106, 107, 435, 433, 436, 428, 436, 429, @@ -479,7 +482,7 @@ static yyconst flex_int16_t yy_def[191] = 173, 173, 173, 173, 173, 173, 173, 173, 173, 173 } ; -static yyconst flex_int16_t yy_nxt[482] = +static yyconst flex_uint16_t yy_nxt[482] = { 0, 16, 17, 18, 19, 20, 21, 22, 23, 24, 23, 23, 25, 26, 27, 28, 29, 30, 30, 31, 32, @@ -600,8 +603,8 @@ static yyconst flex_int16_t yy_chk[482] = #define yymore() yymore_used_but_not_detected #define YY_MORE_ADJ 0 #define YY_RESTORE_YY_MORE_OFFSET -#line 1 "src/glsl/glcpp/glcpp-lex.l" -#line 2 "src/glsl/glcpp/glcpp-lex.l" +#line 1 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" +#line 2 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" /* * Copyright © 2010 Intel Corporation * @@ -767,7 +770,7 @@ match longer strings take priority over those matching shorter strings, we have to be careful to avoid OTHER matching and hiding something that CPP does care about. So we simply exclude all characters that appear in any other expressions. */ -#line 771 "src/glsl/glcpp/glcpp-lex.c" +#line 774 "" #define INITIAL 0 #define COMMENT 1 @@ -777,6 +780,14 @@ characters that appear in any other expressions. */ #define NEWLINE_CATCHUP 5 #define UNREACHABLE 6 +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + #define YY_EXTRA_TYPE glcpp_parser_t * /* Holds the entire state of the reentrant scanner. */ @@ -793,7 +804,7 @@ struct yyguts_t YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ char yy_hold_char; int yy_n_chars; - int yyleng_r; + yy_size_t yyleng_r; char *yy_c_buf_p; int yy_init; int yy_start; @@ -844,19 +855,23 @@ void glcpp_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); FILE *glcpp_get_in (yyscan_t yyscanner ); -void glcpp_set_in (FILE * in_str ,yyscan_t yyscanner ); +void glcpp_set_in (FILE * _in_str ,yyscan_t yyscanner ); FILE *glcpp_get_out (yyscan_t yyscanner ); -void glcpp_set_out (FILE * out_str ,yyscan_t yyscanner ); +void glcpp_set_out (FILE * _out_str ,yyscan_t yyscanner ); -int glcpp_get_leng (yyscan_t yyscanner ); +yy_size_t glcpp_get_leng (yyscan_t yyscanner ); char *glcpp_get_text (yyscan_t yyscanner ); int glcpp_get_lineno (yyscan_t yyscanner ); -void glcpp_set_lineno (int line_number ,yyscan_t yyscanner ); +void glcpp_set_lineno (int _line_number ,yyscan_t yyscanner ); + +int glcpp_get_column (yyscan_t yyscanner ); + +void glcpp_set_column (int _column_no ,yyscan_t yyscanner ); YYSTYPE * glcpp_get_lval (yyscan_t yyscanner ); @@ -878,8 +893,12 @@ extern int glcpp_wrap (yyscan_t yyscanner ); #endif #endif +#ifndef YY_NO_UNPUT + static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); +#endif + #ifndef yytext_ptr static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); #endif @@ -898,7 +917,7 @@ static int input (yyscan_t yyscanner ); #endif - static void yy_push_state (int new_state ,yyscan_t yyscanner); + static void yy_push_state (int _new_state ,yyscan_t yyscanner); static void yy_pop_state (yyscan_t yyscanner ); @@ -1000,7 +1019,7 @@ extern int glcpp_lex \ /* Code executed at the end of each rule. */ #ifndef YY_BREAK -#define YY_BREAK break; +#define YY_BREAK /*LINTED*/break; #endif #define YY_RULE_SETUP \ @@ -1010,12 +1029,43 @@ extern int glcpp_lex \ */ YY_DECL { - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; + yy_state_type yy_current_state; + char *yy_cp, *yy_bp; + int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 195 "src/glsl/glcpp/glcpp-lex.l" + yylval = yylval_param; + + yylloc = yylloc_param; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + glcpp_ensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + glcpp__load_buffer_state(yyscanner ); + } + + { +#line 195 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" glcpp_parser_t *parser = yyextra; @@ -1076,39 +1126,9 @@ YY_DECL } /* Single-line comments */ -#line 1080 "src/glsl/glcpp/glcpp-lex.c" +#line 1130 "" - yylval = yylval_param; - - yylloc = yylloc_param; - - if ( !yyg->yy_init ) - { - yyg->yy_init = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! yyg->yy_start ) - yyg->yy_start = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - glcpp_ensure_buffer_stack (yyscanner); - YY_CURRENT_BUFFER_LVALUE = - glcpp__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); - } - - glcpp__load_buffer_state(yyscanner ); - } - - while ( 1 ) /* loops until end-of-file is reached */ + while ( /*CONSTCOND*/1 ) /* loops until end-of-file is reached */ { yy_cp = yyg->yy_c_buf_p; @@ -1124,7 +1144,7 @@ YY_DECL yy_match: do { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)] ; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1161,41 +1181,41 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 255 "src/glsl/glcpp/glcpp-lex.l" +#line 255 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { } YY_BREAK /* Multi-line comments */ case 2: YY_RULE_SETUP -#line 259 "src/glsl/glcpp/glcpp-lex.l" +#line 259 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { yy_push_state(COMMENT, yyscanner); } YY_BREAK case 3: YY_RULE_SETUP -#line 260 "src/glsl/glcpp/glcpp-lex.l" +#line 260 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" YY_BREAK case 4: /* rule 4 can match eol */ YY_RULE_SETUP -#line 261 "src/glsl/glcpp/glcpp-lex.l" +#line 261 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { yylineno++; yycolumn = 0; parser->commented_newlines++; } YY_BREAK case 5: YY_RULE_SETUP -#line 262 "src/glsl/glcpp/glcpp-lex.l" +#line 262 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" YY_BREAK case 6: /* rule 6 can match eol */ YY_RULE_SETUP -#line 263 "src/glsl/glcpp/glcpp-lex.l" +#line 263 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { yylineno++; yycolumn = 0; parser->commented_newlines++; } YY_BREAK case 7: YY_RULE_SETUP -#line 264 "src/glsl/glcpp/glcpp-lex.l" +#line 264 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { yy_pop_state(yyscanner); /* In the start condition, we don't want any SPACE token. */ @@ -1205,7 +1225,7 @@ YY_RULE_SETUP YY_BREAK case 8: YY_RULE_SETUP -#line 271 "src/glsl/glcpp/glcpp-lex.l" +#line 271 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { /* If the '#' is the first non-whitespace, non-comment token on this @@ -1223,7 +1243,7 @@ YY_RULE_SETUP YY_BREAK case 9: YY_RULE_SETUP -#line 286 "src/glsl/glcpp/glcpp-lex.l" +#line 286 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->space_tokens = 0; @@ -1241,10 +1261,11 @@ YY_RULE_SETUP case 10: /* rule 10 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_cp - 1); yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 300 "src/glsl/glcpp/glcpp-lex.l" +#line 300 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; } @@ -1253,7 +1274,7 @@ YY_RULE_SETUP * Simply pass them through to the main compiler's lexer/parser. */ case 11: YY_RULE_SETUP -#line 306 "src/glsl/glcpp/glcpp-lex.l" +#line 306 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; RETURN_STRING_TOKEN (PRAGMA); @@ -1261,7 +1282,7 @@ YY_RULE_SETUP YY_BREAK case 12: YY_RULE_SETUP -#line 311 "src/glsl/glcpp/glcpp-lex.l" +#line 311 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; RETURN_TOKEN (LINE); @@ -1270,7 +1291,7 @@ YY_RULE_SETUP case 13: /* rule 13 can match eol */ YY_RULE_SETUP -#line 316 "src/glsl/glcpp/glcpp-lex.l" +#line 316 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; RETURN_TOKEN_NEVER_SKIP (NEWLINE); @@ -1280,7 +1301,7 @@ YY_RULE_SETUP * even when we are otherwise skipping. */ case 14: YY_RULE_SETUP -#line 323 "src/glsl/glcpp/glcpp-lex.l" +#line 323 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->lexing_directive = 1; @@ -1290,7 +1311,7 @@ YY_RULE_SETUP YY_BREAK case 15: YY_RULE_SETUP -#line 330 "src/glsl/glcpp/glcpp-lex.l" +#line 330 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->lexing_directive = 1; @@ -1301,10 +1322,11 @@ YY_RULE_SETUP case 16: /* rule 16 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 2); yyg->yy_c_buf_p = yy_cp = yy_bp + 2; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 337 "src/glsl/glcpp/glcpp-lex.l" +#line 337 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->lexing_directive = 1; @@ -1315,10 +1337,11 @@ YY_RULE_SETUP case 17: /* rule 17 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +YY_LINENO_REWIND_TO(yy_bp + 4); yyg->yy_c_buf_p = yy_cp = yy_bp + 4; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 344 "src/glsl/glcpp/glcpp-lex.l" +#line 344 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->lexing_directive = 1; @@ -1328,7 +1351,7 @@ YY_RULE_SETUP YY_BREAK case 18: YY_RULE_SETUP -#line 351 "src/glsl/glcpp/glcpp-lex.l" +#line 351 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->space_tokens = 0; @@ -1337,7 +1360,7 @@ YY_RULE_SETUP YY_BREAK case 19: YY_RULE_SETUP -#line 357 "src/glsl/glcpp/glcpp-lex.l" +#line 357 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->space_tokens = 0; @@ -1346,7 +1369,7 @@ YY_RULE_SETUP YY_BREAK case 20: YY_RULE_SETUP -#line 363 "src/glsl/glcpp/glcpp-lex.l" +#line 363 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; RETURN_STRING_TOKEN (ERROR_TOKEN); @@ -1372,7 +1395,7 @@ YY_RULE_SETUP */ case 21: YY_RULE_SETUP -#line 386 "src/glsl/glcpp/glcpp-lex.l" +#line 386 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { if (! parser->skipping) { BEGIN DEFINE; @@ -1383,7 +1406,7 @@ YY_RULE_SETUP YY_BREAK case 22: YY_RULE_SETUP -#line 394 "src/glsl/glcpp/glcpp-lex.l" +#line 394 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; yyextra->space_tokens = 0; @@ -1392,7 +1415,7 @@ YY_RULE_SETUP YY_BREAK case 23: YY_RULE_SETUP -#line 400 "src/glsl/glcpp/glcpp-lex.l" +#line 400 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { /* Nothing to do here. Importantly, don't leave the * start condition, since it's legal to have space between the @@ -1402,7 +1425,7 @@ YY_RULE_SETUP /* This will catch any non-directive garbage after a HASH */ case 24: YY_RULE_SETUP -#line 407 "src/glsl/glcpp/glcpp-lex.l" +#line 407 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; RETURN_TOKEN (GARBAGE); @@ -1414,7 +1437,7 @@ case 25: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 413 "src/glsl/glcpp/glcpp-lex.l" +#line 413 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; RETURN_STRING_TOKEN (FUNC_IDENTIFIER); @@ -1423,7 +1446,7 @@ YY_RULE_SETUP /* An identifier not immediately followed by '(' */ case 26: YY_RULE_SETUP -#line 419 "src/glsl/glcpp/glcpp-lex.l" +#line 419 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; RETURN_STRING_TOKEN (OBJ_IDENTIFIER); @@ -1432,7 +1455,7 @@ YY_RULE_SETUP /* Whitespace */ case 27: YY_RULE_SETUP -#line 425 "src/glsl/glcpp/glcpp-lex.l" +#line 425 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { /* Just ignore it. Nothing to do here. */ } @@ -1441,7 +1464,7 @@ YY_RULE_SETUP case 28: /* rule 28 can match eol */ YY_RULE_SETUP -#line 430 "src/glsl/glcpp/glcpp-lex.l" +#line 430 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext); @@ -1452,7 +1475,7 @@ YY_RULE_SETUP * space. This is an error. */ case 29: YY_RULE_SETUP -#line 438 "src/glsl/glcpp/glcpp-lex.l" +#line 438 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { BEGIN INITIAL; glcpp_error(yylloc, yyextra, "#define followed by a non-identifier: %s", yytext); @@ -1461,98 +1484,98 @@ YY_RULE_SETUP YY_BREAK case 30: YY_RULE_SETUP -#line 444 "src/glsl/glcpp/glcpp-lex.l" +#line 444 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK case 31: YY_RULE_SETUP -#line 448 "src/glsl/glcpp/glcpp-lex.l" +#line 448 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK case 32: YY_RULE_SETUP -#line 452 "src/glsl/glcpp/glcpp-lex.l" +#line 452 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_STRING_TOKEN (INTEGER_STRING); } YY_BREAK case 33: YY_RULE_SETUP -#line 456 "src/glsl/glcpp/glcpp-lex.l" +#line 456 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (LEFT_SHIFT); } YY_BREAK case 34: YY_RULE_SETUP -#line 460 "src/glsl/glcpp/glcpp-lex.l" +#line 460 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (RIGHT_SHIFT); } YY_BREAK case 35: YY_RULE_SETUP -#line 464 "src/glsl/glcpp/glcpp-lex.l" +#line 464 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (LESS_OR_EQUAL); } YY_BREAK case 36: YY_RULE_SETUP -#line 468 "src/glsl/glcpp/glcpp-lex.l" +#line 468 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (GREATER_OR_EQUAL); } YY_BREAK case 37: YY_RULE_SETUP -#line 472 "src/glsl/glcpp/glcpp-lex.l" +#line 472 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (EQUAL); } YY_BREAK case 38: YY_RULE_SETUP -#line 476 "src/glsl/glcpp/glcpp-lex.l" +#line 476 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (NOT_EQUAL); } YY_BREAK case 39: YY_RULE_SETUP -#line 480 "src/glsl/glcpp/glcpp-lex.l" +#line 480 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (AND); } YY_BREAK case 40: YY_RULE_SETUP -#line 484 "src/glsl/glcpp/glcpp-lex.l" +#line 484 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (OR); } YY_BREAK case 41: YY_RULE_SETUP -#line 488 "src/glsl/glcpp/glcpp-lex.l" +#line 488 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (PLUS_PLUS); } YY_BREAK case 42: YY_RULE_SETUP -#line 492 "src/glsl/glcpp/glcpp-lex.l" +#line 492 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (MINUS_MINUS); } YY_BREAK case 43: YY_RULE_SETUP -#line 496 "src/glsl/glcpp/glcpp-lex.l" +#line 496 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { if (! parser->skipping) { if (parser->is_gles) @@ -1563,42 +1586,42 @@ YY_RULE_SETUP YY_BREAK case 44: YY_RULE_SETUP -#line 504 "src/glsl/glcpp/glcpp-lex.l" +#line 504 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (DEFINED); } YY_BREAK case 45: YY_RULE_SETUP -#line 508 "src/glsl/glcpp/glcpp-lex.l" +#line 508 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_STRING_TOKEN (IDENTIFIER); } YY_BREAK case 46: YY_RULE_SETUP -#line 512 "src/glsl/glcpp/glcpp-lex.l" +#line 512 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_STRING_TOKEN (OTHER); } YY_BREAK case 47: YY_RULE_SETUP -#line 516 "src/glsl/glcpp/glcpp-lex.l" +#line 516 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_TOKEN (yytext[0]); } YY_BREAK case 48: YY_RULE_SETUP -#line 520 "src/glsl/glcpp/glcpp-lex.l" +#line 520 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { RETURN_STRING_TOKEN (OTHER); } YY_BREAK case 49: YY_RULE_SETUP -#line 524 "src/glsl/glcpp/glcpp-lex.l" +#line 524 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { if (yyextra->space_tokens) { RETURN_TOKEN (SPACE); @@ -1610,7 +1633,7 @@ YY_RULE_SETUP case 50: /* rule 50 can match eol */ YY_RULE_SETUP -#line 532 "src/glsl/glcpp/glcpp-lex.l" +#line 532 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { if (parser->commented_newlines) { BEGIN NEWLINE_CATCHUP; @@ -1628,7 +1651,7 @@ case YY_STATE_EOF(INITIAL): case YY_STATE_EOF(COMMENT): case YY_STATE_EOF(DEFINE): case YY_STATE_EOF(HASH): -#line 545 "src/glsl/glcpp/glcpp-lex.l" +#line 545 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { if (YY_START == COMMENT) glcpp_error(yylloc, yyextra, "Unterminated comment"); @@ -1644,7 +1667,7 @@ case YY_STATE_EOF(HASH): * of the preceding patterns to match that input. */ case 51: YY_RULE_SETUP -#line 559 "src/glsl/glcpp/glcpp-lex.l" +#line 559 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" { glcpp_error(yylloc, yyextra, "Internal compiler error: Unexpected character: %s", yytext); @@ -1660,10 +1683,10 @@ YY_RULE_SETUP YY_BREAK case 52: YY_RULE_SETUP -#line 572 "src/glsl/glcpp/glcpp-lex.l" +#line 572 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" YY_FATAL_ERROR( "flex scanner jammed" ); YY_BREAK -#line 1667 "src/glsl/glcpp/glcpp-lex.c" +#line 1690 "" case YY_STATE_EOF(DONE): case YY_STATE_EOF(NEWLINE_CATCHUP): case YY_STATE_EOF(UNREACHABLE): @@ -1797,6 +1820,7 @@ case YY_STATE_EOF(UNREACHABLE): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ + } /* end of user's declarations */ } /* end of glcpp_lex */ /* yy_get_next_buffer - try to read in a new buffer @@ -1809,9 +1833,9 @@ case YY_STATE_EOF(UNREACHABLE): static int yy_get_next_buffer (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = yyg->yytext_ptr; - register int number_to_move, i; + char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + char *source = yyg->yytext_ptr; + yy_size_t number_to_move, i; int ret_val; if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] ) @@ -1840,7 +1864,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; + number_to_move = (yy_size_t) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); @@ -1853,21 +1877,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { - int num_to_read = + yy_size_t num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = YY_CURRENT_BUFFER; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE; int yy_c_buf_p_offset = (int) (yyg->yy_c_buf_p - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { - int new_size = b->yy_buf_size * 2; + yy_size_t new_size = b->yy_buf_size * 2; if ( new_size <= 0 ) b->yy_buf_size += b->yy_buf_size / 8; @@ -1898,7 +1922,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) /* Read in more data. */ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - yyg->yy_n_chars, (size_t) num_to_read ); + yyg->yy_n_chars, num_to_read ); YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; } @@ -1922,9 +1946,9 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else ret_val = EOB_ACT_CONTINUE_SCAN; - if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + if ((int) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { /* Extend the array by 50%, plus the number we really need. */ - yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + int new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) glcpp_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); @@ -1943,15 +1967,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) static yy_state_type yy_get_previous_state (yyscan_t yyscanner) { - register yy_state_type yy_current_state; - register char *yy_cp; + yy_state_type yy_current_state; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_current_state = yyg->yy_start; for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1976,11 +2000,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) */ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner) { - register int yy_is_jam; + int yy_is_jam; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ - register char *yy_cp = yyg->yy_c_buf_p; + char *yy_cp = yyg->yy_c_buf_p; - register YY_CHAR yy_c = 1; + YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { yyg->yy_last_accepting_state = yy_current_state; @@ -1995,12 +2019,15 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; yy_is_jam = (yy_current_state == 173); + (void)yyg; return yy_is_jam ? 0 : yy_current_state; } - static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) +#ifndef YY_NO_UNPUT + + static void yyunput (int c, char * yy_bp , yyscan_t yyscanner) { - register char *yy_cp; + char *yy_cp; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; yy_cp = yyg->yy_c_buf_p; @@ -2011,10 +2038,10 @@ static int yy_get_next_buffer (yyscan_t yyscanner) if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yyg->yy_n_chars + 2; - register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + yy_size_t number_to_move = yyg->yy_n_chars + 2; + char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; - register char *source = + char *source = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) @@ -2036,6 +2063,8 @@ static int yy_get_next_buffer (yyscan_t yyscanner) yyg->yy_c_buf_p = yy_cp; } +#endif + #ifndef YY_NO_INPUT #ifdef __cplusplus static int yyinput (yyscan_t yyscanner) @@ -2061,7 +2090,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) else { /* need more input */ - int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr; ++yyg->yy_c_buf_p; switch ( yy_get_next_buffer( yyscanner ) ) @@ -2189,7 +2218,7 @@ static void glcpp__load_buffer_state (yyscan_t yyscanner) if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in glcpp__create_buffer()" ); - b->yy_buf_size = size; + b->yy_buf_size = (yy_size_t)size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. @@ -2341,7 +2370,7 @@ void glcpp_pop_buffer_state (yyscan_t yyscanner) */ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) { - int num_to_alloc; + yy_size_t num_to_alloc; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if (!yyg->yy_buffer_stack) { @@ -2350,7 +2379,7 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) * scanner will even need a stack. We use 2 instead of 1 to avoid an * immediate realloc on the next call. */ - num_to_alloc = 1; + num_to_alloc = 1; /* After all that talk, this was set to 1 anyways... */ yyg->yy_buffer_stack = (struct yy_buffer_state**)glcpp_alloc (num_to_alloc * sizeof(struct yy_buffer_state*) , yyscanner); @@ -2367,7 +2396,7 @@ static void glcpp_ensure_buffer_stack (yyscan_t yyscanner) if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; + yy_size_t grow_size = 8 /* arbitrary grow size */; num_to_alloc = yyg->yy_buffer_stack_max + grow_size; yyg->yy_buffer_stack = (struct yy_buffer_state**)glcpp_realloc @@ -2439,12 +2468,12 @@ YY_BUFFER_STATE glcpp__scan_string (yyconst char * yystr , yyscan_t yyscanner) * @param yyscanner The scanner object. * @return the newly allocated buffer state object. */ -YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner) { YY_BUFFER_STATE b; char *buf; yy_size_t n; - int i; + yy_size_t i; /* Get memory for full buffer, including space for trailing EOB's. */ n = _yybytes_len + 2; @@ -2469,7 +2498,7 @@ YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , return b; } - static void yy_push_state (int new_state , yyscan_t yyscanner) + static void yy_push_state (int _new_state , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; if ( yyg->yy_start_stack_ptr >= yyg->yy_start_stack_depth ) @@ -2491,7 +2520,7 @@ YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyg->yy_start_stack[yyg->yy_start_stack_ptr++] = YY_START; - BEGIN(new_state); + BEGIN(_new_state); } static void yy_pop_state (yyscan_t yyscanner) @@ -2515,7 +2544,9 @@ YY_BUFFER_STATE glcpp__scan_bytes (yyconst char * yybytes, int _yybytes_len , static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner) { - (void) fprintf( stderr, "%s\n", msg ); + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + (void) fprintf( stderr, "%s\n", msg ); exit( YY_EXIT_FAILURE ); } @@ -2594,7 +2625,7 @@ FILE *glcpp_get_out (yyscan_t yyscanner) /** Get the length of the current token. * @param yyscanner The scanner object. */ -int glcpp_get_leng (yyscan_t yyscanner) +yy_size_t glcpp_get_leng (yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; return yyleng; @@ -2621,51 +2652,51 @@ void glcpp_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) } /** Set the current line number. - * @param line_number + * @param _line_number line number * @param yyscanner The scanner object. */ -void glcpp_set_lineno (int line_number , yyscan_t yyscanner) +void glcpp_set_lineno (int _line_number , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* lineno is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_lineno called with no buffer" , yyscanner); + YY_FATAL_ERROR( "glcpp_set_lineno called with no buffer" ); - yylineno = line_number; + yylineno = _line_number; } /** Set the current column. - * @param line_number + * @param _column_no column number * @param yyscanner The scanner object. */ -void glcpp_set_column (int column_no , yyscan_t yyscanner) +void glcpp_set_column (int _column_no , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* column is only valid if an input buffer exists. */ if (! YY_CURRENT_BUFFER ) - yy_fatal_error( "glcpp_set_column called with no buffer" , yyscanner); + YY_FATAL_ERROR( "glcpp_set_column called with no buffer" ); - yycolumn = column_no; + yycolumn = _column_no; } /** Set the input stream. This does not discard the current * input buffer. - * @param in_str A readable stream. + * @param _in_str A readable stream. * @param yyscanner The scanner object. * @see glcpp__switch_to_buffer */ -void glcpp_set_in (FILE * in_str , yyscan_t yyscanner) +void glcpp_set_in (FILE * _in_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyin = in_str ; + yyin = _in_str ; } -void glcpp_set_out (FILE * out_str , yyscan_t yyscanner) +void glcpp_set_out (FILE * _out_str , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yyout = out_str ; + yyout = _out_str ; } int glcpp_get_debug (yyscan_t yyscanner) @@ -2674,10 +2705,10 @@ int glcpp_get_debug (yyscan_t yyscanner) return yy_flex_debug; } -void glcpp_set_debug (int bdebug , yyscan_t yyscanner) +void glcpp_set_debug (int _bdebug , yyscan_t yyscanner) { struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; - yy_flex_debug = bdebug ; + yy_flex_debug = _bdebug ; } /* Accessor methods for yylval and yylloc */ @@ -2840,7 +2871,10 @@ int glcpp_lex_destroy (yyscan_t yyscanner) #ifndef yytext_ptr static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) { - register int i; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + + int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; } @@ -2849,7 +2883,7 @@ static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yysca #ifdef YY_NEED_STRLEN static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) { - register int n; + int n; for ( n = 0; s[n]; ++n ) ; @@ -2859,11 +2893,16 @@ static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner) void *glcpp_alloc (yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; return (void *) malloc( size ); } void *glcpp_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; + /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -2876,12 +2915,14 @@ void *glcpp_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner) void glcpp_free (void * ptr , yyscan_t yyscanner) { + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + (void)yyg; free( (char *) ptr ); /* see glcpp_realloc() for (char *) cast */ } #define YYTABLES_NAME "yytables" -#line 572 "src/glsl/glcpp/glcpp-lex.l" +#line 572 "../../../3rdparty/glsl-optimizer/src/glsl/glcpp/glcpp-lex.l" diff --git a/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out b/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out index c79545216..2247ca418 100755 --- a/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out +++ b/3rdparty/glslang/Test/baseLegalResults/hlsl.partialFlattenLocal.vert.out @@ -2,7 +2,7 @@ hlsl.partialFlattenLocal.vert WARNING: AST will form illegal SPIR-V; need to transform to legalize // Module Version 10000 // Generated by (magic number): 80004 -// Id's are bound by 165 +// Id's are bound by 169 Capability Shader 1: ExtInstImport "GLSL.std.450" @@ -52,22 +52,22 @@ WARNING: AST will form illegal SPIR-V; need to transform to legalize Store 137 38 Branch 100 100: Label - 164: 21(int) Phi 25 5 119 106 - 105: 54(bool) SLessThan 164 31 + 168: 21(int) Phi 25 5 119 106 + 105: 54(bool) SLessThan 168 31 LoopMerge 101 106 None BranchConditional 105 106 101 106: Label - 138: 39(ptr) AccessChain 133 164 + 138: 39(ptr) AccessChain 133 168 110: 18(fvec2) Load 138 - 139: 34(ptr) AccessChain 131 164 + 139: 34(ptr) AccessChain 131 168 112: 14(fvec3) Load 139 113: 18(fvec2) VectorShuffle 112 112 0 1 114: 18(fvec2) FAdd 113 110 - 140: 34(ptr) AccessChain 131 164 + 140: 34(ptr) AccessChain 131 168 116: 14(fvec3) Load 140 117: 14(fvec3) VectorShuffle 116 114 3 4 2 Store 140 117 - 119: 21(int) IAdd 164 31 + 119: 21(int) IAdd 168 31 Branch 100 101: Label 142: 17 Load 131 diff --git a/3rdparty/glslang/Test/baseResults/matrix2.frag.out b/3rdparty/glslang/Test/baseResults/matrix2.frag.out index 880f75adc..3e3b3f06a 100644 --- a/3rdparty/glslang/Test/baseResults/matrix2.frag.out +++ b/3rdparty/glslang/Test/baseResults/matrix2.frag.out @@ -158,6 +158,9 @@ Shader version: 150 0:49 'FragColor' ( out 4-component vector of float) 0:49 Constant: 0:49 3 (const int) +0:50 matrix mult second child into first child ( temp 3X4 matrix of float) +0:50 'm34' ( temp 3X4 matrix of float) +0:50 'colorTransform' ( uniform 3X3 matrix of float) 0:? Linker Objects 0:? 'colorTransform' ( uniform 3X3 matrix of float) 0:? 'Color' ( smooth in 3-component vector of float) @@ -331,6 +334,9 @@ Shader version: 150 0:49 'FragColor' ( out 4-component vector of float) 0:49 Constant: 0:49 3 (const int) +0:50 matrix mult second child into first child ( temp 3X4 matrix of float) +0:50 'm34' ( temp 3X4 matrix of float) +0:50 'colorTransform' ( uniform 3X3 matrix of float) 0:? Linker Objects 0:? 'colorTransform' ( uniform 3X3 matrix of float) 0:? 'Color' ( smooth in 3-component vector of float) diff --git a/3rdparty/glslang/Test/baseResults/matrixError.vert.out b/3rdparty/glslang/Test/baseResults/matrixError.vert.out index f818892a9..0a0d1e402 100644 --- a/3rdparty/glslang/Test/baseResults/matrixError.vert.out +++ b/3rdparty/glslang/Test/baseResults/matrixError.vert.out @@ -6,7 +6,9 @@ ERROR: 0:18: 'assign' : cannot convert from ' temp 2-component vector of float' ERROR: 0:19: 'xy' : does not apply to this type: temp 2X3 matrix of float ERROR: 0:21: '[' : matrix index out of range '2' ERROR: 0:21: '[' : vector index out of range '4' -ERROR: 7 compilation errors. No code generated. +ERROR: 0:22: 'assign' : cannot convert from ' temp 2X3 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 0:23: 'assign' : cannot convert from ' uniform 3X2 matrix of float' to ' temp 2X3 matrix of float' +ERROR: 9 compilation errors. No code generated. Shader version: 120 @@ -32,6 +34,8 @@ ERROR: node is still EOpNull! 0:21 2 (const int) 0:21 Constant: 0:21 4 (const int) +0:22 'm23' ( temp 2X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) 0:? Linker Objects 0:? 'v3' ( in 3-component vector of float) 0:? 'm32' ( uniform 3X2 matrix of float) @@ -64,6 +68,8 @@ ERROR: node is still EOpNull! 0:21 2 (const int) 0:21 Constant: 0:21 4 (const int) +0:22 'm23' ( temp 2X3 matrix of float) +0:23 'm23' ( temp 2X3 matrix of float) 0:? Linker Objects 0:? 'v3' ( in 3-component vector of float) 0:? 'm32' ( uniform 3X2 matrix of float) diff --git a/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.err b/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.err index e69de29bb..da435dbd9 100644 --- a/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.err +++ b/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.err @@ -0,0 +1,2 @@ +WARNING: 0:10: '#pragma once' : not implemented + diff --git a/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.out b/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.out index 8c5281446..ebe1e4a74 100644 --- a/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.out +++ b/3rdparty/glslang/Test/baseResults/preprocessor.pragma.vert.out @@ -7,6 +7,8 @@ #pragma undefined_pragma(x,4) +#pragma once + int main(){ } diff --git a/3rdparty/glslang/Test/matrix2.frag b/3rdparty/glslang/Test/matrix2.frag index eb2c53c2e..df6580440 100644 --- a/3rdparty/glslang/Test/matrix2.frag +++ b/3rdparty/glslang/Test/matrix2.frag @@ -47,4 +47,5 @@ void main() FragColor *= inv4; FragColor = vec4(FragColor * matrixCompMult(un34, un34), FragColor.w); + m34 *= colorTransform; } diff --git a/3rdparty/glslang/Test/matrixError.vert b/3rdparty/glslang/Test/matrixError.vert index 3c8cc11fe..0ad145b25 100644 --- a/3rdparty/glslang/Test/matrixError.vert +++ b/3rdparty/glslang/Test/matrixError.vert @@ -19,4 +19,6 @@ void main() m23.xy; // ERROR, can't use . gl_Position = vec4(m23 * m32 * v3, m24[2][4]); // ERROR, 2 and 4 are out of range + m23 *= m23; // ERROR, right side needs to be square + m23 *= m32; // ERROR, left columns must match right rows } diff --git a/3rdparty/glslang/Test/preprocessor.pragma.vert b/3rdparty/glslang/Test/preprocessor.pragma.vert index 79f5600a8..0ae7ee212 100644 --- a/3rdparty/glslang/Test/preprocessor.pragma.vert +++ b/3rdparty/glslang/Test/preprocessor.pragma.vert @@ -7,5 +7,7 @@ #pragma undefined_pragma(x, 4) +#pragma once + int main() { } diff --git a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp index 287745b2d..d32f93635 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/Intermediate.cpp @@ -2706,7 +2706,7 @@ bool TIntermediate::promoteBinary(TIntermBinary& node) node.setOp(op = EOpMatrixTimesScalarAssign); } } else if (left->isMatrix() && right->isMatrix()) { - if (left->getMatrixCols() != left->getMatrixRows() || left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) + if (left->getMatrixCols() != right->getMatrixCols() || left->getMatrixCols() != right->getMatrixRows()) return false; node.setOp(op = EOpMatrixTimesMatrixAssign); } else if (!left->isMatrix() && !right->isMatrix()) { diff --git a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp index e768d46ec..8016e2ea4 100644 --- a/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp +++ b/3rdparty/glslang/glslang/MachineIndependent/ParseHelper.cpp @@ -266,6 +266,8 @@ void TParseContext::handlePragma(const TSourceLoc& loc, const TVector& if (tokens.size() != 1) error(loc, "extra tokens", "#pragma", ""); intermediate.setUseStorageBuffer(); + } else if (tokens[0].compare("once") == 0) { + warn(loc, "not implemented", "#pragma once", ""); } } @@ -1583,6 +1585,9 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan case EOpInterpolateAtCentroid: case EOpInterpolateAtSample: case EOpInterpolateAtOffset: +#ifdef AMD_EXTENSIONS + case EOpInterpolateAtVertex: +#endif // Make sure the first argument is an interpolant, or an array element of an interpolant if (arg0->getType().getQualifier().storage != EvqVaryingIn) { // It might still be an array element. diff --git a/3rdparty/glslang/hlsl/hlslParseHelper.cpp b/3rdparty/glslang/hlsl/hlslParseHelper.cpp index 6602ba28e..cba772d86 100755 --- a/3rdparty/glslang/hlsl/hlslParseHelper.cpp +++ b/3rdparty/glslang/hlsl/hlslParseHelper.cpp @@ -550,6 +550,13 @@ void HlslParseContext::handlePragma(const TSourceLoc& loc, const TVector