From f53063a201e28a0dcf8b3a6127654470e95bb3cf Mon Sep 17 00:00:00 2001 From: Vladimir Vukicevic Date: Sat, 9 Oct 2010 12:44:25 -0700 Subject: [PATCH] b=602396; upgrade ANGLE to r445 --- gfx/angle/generated/glslang.cpp | 5766 ++++++------ gfx/angle/generated/glslang_tab.cpp | 8242 +++++++---------- gfx/angle/generated/glslang_tab.h | 306 +- gfx/angle/include/GLES2/gl2ext.h | 58 + gfx/angle/include/GLSLANG/ResourceLimits.h | 21 - gfx/angle/include/GLSLANG/ShaderLang.h | 254 +- gfx/angle/src/build_angle.gyp | 10 + gfx/angle/src/common/debug.cpp | 6 +- gfx/angle/src/compiler/BaseTypes.h | 15 + gfx/angle/src/compiler/CodeGenGLSL.cpp | 4 +- gfx/angle/src/compiler/CodeGenHLSL.cpp | 4 +- gfx/angle/src/compiler/Common.h | 2 - gfx/angle/src/compiler/Compiler.cpp | 168 + gfx/angle/src/compiler/ExtensionBehavior.h | 21 + gfx/angle/src/compiler/InfoSink.h | 1 + gfx/angle/src/compiler/Initialize.cpp | 136 +- gfx/angle/src/compiler/Initialize.h | 12 +- gfx/angle/src/compiler/Intermediate.cpp | 87 +- gfx/angle/src/compiler/OutputGLSL.cpp | 4 + gfx/angle/src/compiler/OutputHLSL.cpp | 40 +- gfx/angle/src/compiler/ParseHelper.cpp | 71 +- gfx/angle/src/compiler/ParseHelper.h | 25 +- gfx/angle/src/compiler/ShHandle.h | 50 +- gfx/angle/src/compiler/ShaderLang.cpp | 330 +- gfx/angle/src/compiler/SymbolTable.cpp | 18 +- gfx/angle/src/compiler/SymbolTable.h | 26 +- gfx/angle/src/compiler/TranslatorGLSL.cpp | 10 +- gfx/angle/src/compiler/TranslatorGLSL.h | 6 +- gfx/angle/src/compiler/TranslatorHLSL.cpp | 8 +- gfx/angle/src/compiler/TranslatorHLSL.h | 6 +- gfx/angle/src/compiler/Types.h | 165 +- gfx/angle/src/compiler/VariableInfo.cpp | 210 + gfx/angle/src/compiler/VariableInfo.h | 38 + gfx/angle/src/compiler/glslang.l | 2 +- gfx/angle/src/compiler/glslang.y | 248 +- gfx/angle/src/compiler/intermOut.cpp | 350 +- gfx/angle/src/compiler/intermediate.h | 127 +- gfx/angle/src/compiler/localintermediate.h | 2 +- gfx/angle/src/compiler/preprocessor/compile.h | 8 +- .../src/compiler/preprocessor/preprocess.h | 2 +- gfx/angle/src/compiler/preprocessor/scanner.c | 2 +- gfx/angle/src/compiler/preprocessor/scanner.h | 2 +- gfx/angle/src/compiler/tools/COPYING.bison | 339 + gfx/angle/src/compiler/tools/COPYING.flex | 38 + gfx/angle/src/compiler/tools/README | 14 + gfx/angle/src/compiler/tools/bison.exe | Bin 0 -> 196096 bytes gfx/angle/src/compiler/tools/bison.hairy | 334 + gfx/angle/src/compiler/tools/bison.simple | 699 ++ gfx/angle/src/compiler/tools/flex.exe | Bin 0 -> 181248 bytes .../src/compiler/translator_common.vcproj | 12 + gfx/angle/src/libEGL/Display.cpp | 280 +- gfx/angle/src/libEGL/Display.h | 18 +- gfx/angle/src/libEGL/Surface.cpp | 76 +- gfx/angle/src/libEGL/Surface.h | 13 +- gfx/angle/src/libEGL/libEGL.cpp | 11 +- gfx/angle/src/libGLESv2/Blit.cpp | 5 + gfx/angle/src/libGLESv2/Context.cpp | 844 +- gfx/angle/src/libGLESv2/Context.h | 58 +- gfx/angle/src/libGLESv2/Fence.cpp | 134 + gfx/angle/src/libGLESv2/Fence.h | 43 + gfx/angle/src/libGLESv2/Framebuffer.cpp | 123 + gfx/angle/src/libGLESv2/Framebuffer.h | 5 + gfx/angle/src/libGLESv2/Program.cpp | 15 +- gfx/angle/src/libGLESv2/RefCountObject.cpp | 1 + gfx/angle/src/libGLESv2/Renderbuffer.cpp | 89 +- gfx/angle/src/libGLESv2/Renderbuffer.h | 18 +- gfx/angle/src/libGLESv2/ResourceManager.cpp | 2 +- gfx/angle/src/libGLESv2/Shader.cpp | 40 +- gfx/angle/src/libGLESv2/Texture.cpp | 884 +- gfx/angle/src/libGLESv2/Texture.h | 70 +- gfx/angle/src/libGLESv2/libGLESv2.cpp | 754 +- gfx/angle/src/libGLESv2/libGLESv2.def | 21 +- gfx/angle/src/libGLESv2/libGLESv2.vcproj | 8 + gfx/angle/src/libGLESv2/utilities.cpp | 123 +- gfx/angle/src/libGLESv2/utilities.h | 5 + 75 files changed, 12612 insertions(+), 9327 deletions(-) create mode 100644 gfx/angle/src/compiler/Compiler.cpp create mode 100644 gfx/angle/src/compiler/ExtensionBehavior.h create mode 100644 gfx/angle/src/compiler/VariableInfo.cpp create mode 100644 gfx/angle/src/compiler/VariableInfo.h create mode 100644 gfx/angle/src/compiler/tools/COPYING.bison create mode 100644 gfx/angle/src/compiler/tools/COPYING.flex create mode 100644 gfx/angle/src/compiler/tools/README create mode 100644 gfx/angle/src/compiler/tools/bison.exe create mode 100644 gfx/angle/src/compiler/tools/bison.hairy create mode 100644 gfx/angle/src/compiler/tools/bison.simple create mode 100644 gfx/angle/src/compiler/tools/flex.exe create mode 100644 gfx/angle/src/libGLESv2/Fence.cpp create mode 100644 gfx/angle/src/libGLESv2/Fence.h diff --git a/gfx/angle/generated/glslang.cpp b/gfx/angle/generated/glslang.cpp index 42379295acf..e735c73aeab 100644 --- a/gfx/angle/generated/glslang.cpp +++ b/gfx/angle/generated/glslang.cpp @@ -1,2973 +1,2793 @@ - -#line 3 "generated/glslang.cpp" - -#define YY_INT_ALIGNED short int - -/* A lexical scanner generated by flex */ - -#define FLEX_SCANNER -#define YY_FLEX_MAJOR_VERSION 2 -#define YY_FLEX_MINOR_VERSION 5 -#define YY_FLEX_SUBMINOR_VERSION 35 -#if YY_FLEX_SUBMINOR_VERSION > 0 -#define FLEX_BETA -#endif - -/* First, we deal with platform-specific or compiler-specific issues. */ - -/* begin standard C headers. */ -#include -#include -#include -#include - -/* end standard C headers. */ - -/* flex integer type definitions */ - -#ifndef FLEXINT_H -#define FLEXINT_H - -/* C99 systems have . Non-C99 systems may or may not. */ - -#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L - -/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, - * if you want the limit (max/min) macros for int types. - */ -#ifndef __STDC_LIMIT_MACROS -#define __STDC_LIMIT_MACROS 1 -#endif - -#include -typedef int8_t flex_int8_t; -typedef uint8_t flex_uint8_t; -typedef int16_t flex_int16_t; -typedef uint16_t flex_uint16_t; -typedef int32_t flex_int32_t; -typedef uint32_t flex_uint32_t; -#else -typedef signed char flex_int8_t; -typedef short int flex_int16_t; -typedef int flex_int32_t; -typedef unsigned char flex_uint8_t; -typedef unsigned short int flex_uint16_t; -typedef unsigned int flex_uint32_t; - -/* Limits of integral types. */ -#ifndef INT8_MIN -#define INT8_MIN (-128) -#endif -#ifndef INT16_MIN -#define INT16_MIN (-32767-1) -#endif -#ifndef INT32_MIN -#define INT32_MIN (-2147483647-1) -#endif -#ifndef INT8_MAX -#define INT8_MAX (127) -#endif -#ifndef INT16_MAX -#define INT16_MAX (32767) -#endif -#ifndef INT32_MAX -#define INT32_MAX (2147483647) -#endif -#ifndef UINT8_MAX -#define UINT8_MAX (255U) -#endif -#ifndef UINT16_MAX -#define UINT16_MAX (65535U) -#endif -#ifndef UINT32_MAX -#define UINT32_MAX (4294967295U) -#endif - -#endif /* ! C99 */ - -#endif /* ! FLEXINT_H */ - -#ifdef __cplusplus - -/* The "const" storage-class-modifier is valid. */ -#define YY_USE_CONST - -#else /* ! __cplusplus */ - -/* C99 requires __STDC__ to be defined as 1. */ -#if defined (__STDC__) - -#define YY_USE_CONST - -#endif /* defined (__STDC__) */ -#endif /* ! __cplusplus */ - -#ifdef YY_USE_CONST -#define yyconst const -#else -#define yyconst -#endif - -/* Returned upon end-of-file. */ -#define YY_NULL 0 - -/* Promotes a possibly negative, possibly signed char to an unsigned - * integer for use as an array index. If the signed char is negative, - * we want to instead treat it as an 8-bit unsigned char, hence the - * double cast. - */ -#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) - -/* Enter a start condition. This macro really ought to take a parameter, - * but we do it the disgusting crufty way forced on us by the ()-less - * definition of BEGIN. - */ -#define BEGIN (yy_start) = 1 + 2 * - -/* Translate the current start state into a value that can be later handed - * to BEGIN to return to the state. The YYSTATE alias is for lex - * compatibility. - */ -#define YY_START (((yy_start) - 1) / 2) -#define YYSTATE YY_START - -/* Action number for EOF rule of a given start state. */ -#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) - -/* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart(yyin ) - -#define YY_END_OF_BUFFER_CHAR 0 - -/* Size of default input buffer. */ -#ifndef YY_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k. - * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case. - * Ditto for the __ia64__ case accordingly. - */ -#define YY_BUF_SIZE 32768 -#else -#define YY_BUF_SIZE 16384 -#endif /* __ia64__ */ -#endif - -/* The state buf must be large enough to hold one state per character in the main buffer. - */ -#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) - -#ifndef YY_TYPEDEF_YY_BUFFER_STATE -#define YY_TYPEDEF_YY_BUFFER_STATE -typedef struct yy_buffer_state *YY_BUFFER_STATE; -#endif - -extern int yyleng; - -extern FILE *yyin, *yyout; - -#define EOB_ACT_CONTINUE_SCAN 0 -#define EOB_ACT_END_OF_FILE 1 -#define EOB_ACT_LAST_MATCH 2 - - /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires - * access to the local variable yy_act. Since yyless() is a macro, it would break - * existing scanners that call yyless() from OUTSIDE yylex. - * One obvious solution it to make yy_act a global. I tried that, and saw - * a 5% performance hit in a non-yylineno scanner, because yy_act is - * normally declared as a register variable-- so it is not worth it. - */ - #define YY_LESS_LINENO(n) \ - do { \ - int yyl;\ - for ( yyl = n; yyl < yyleng; ++yyl )\ - if ( yytext[yyl] == '\n' )\ - --yylineno;\ - }while(0) - -/* Return all but the first "n" matched characters back to the input stream. */ -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - *yy_cp = (yy_hold_char); \ - YY_RESTORE_YY_MORE_OFFSET \ - (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ - YY_DO_BEFORE_ACTION; /* set up yytext again */ \ - } \ - while ( 0 ) - -#define unput(c) yyunput( c, (yytext_ptr) ) - -#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 - { - FILE *yy_input_file; - - char *yy_ch_buf; /* input buffer */ - char *yy_buf_pos; /* current position in input buffer */ - - /* Size of input buffer in bytes, not including room for EOB - * characters. - */ - yy_size_t yy_buf_size; - - /* Number of characters read into yy_ch_buf, not including EOB - * characters. - */ - int yy_n_chars; - - /* Whether we "own" the buffer - i.e., we know we created it, - * and can realloc() it to grow it, and should free() it to - * delete it. - */ - int yy_is_our_buffer; - - /* Whether this is an "interactive" input source; if so, and - * if we're using stdio for input, then we want to use getc() - * instead of fread(), to make sure we stop fetching input after - * each newline. - */ - int yy_is_interactive; - - /* Whether we're considered to be at the beginning of a line. - * If so, '^' rules will be active on the next match, otherwise - * not. - */ - int yy_at_bol; - - int yy_bs_lineno; /**< The line count. */ - int yy_bs_column; /**< The column count. */ - - /* Whether to try to fill the input buffer when we reach the - * end of it. - */ - int yy_fill_buffer; - - int yy_buffer_status; - -#define YY_BUFFER_NEW 0 -#define YY_BUFFER_NORMAL 1 - /* When an EOF's been seen but there's still some text to process - * then we mark the buffer as YY_EOF_PENDING, to indicate that we - * shouldn't try reading from the input source any more. We might - * still have a bunch of tokens to match, though, because of - * possible backing-up. - * - * When we actually see the EOF, we change the status to "new" - * (via yyrestart()), so that the user can continue scanning by - * just pointing yyin at a new input file. - */ -#define YY_BUFFER_EOF_PENDING 2 - - }; -#endif /* !YY_STRUCT_YY_BUFFER_STATE */ - -/* Stack of input buffers. */ -static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ -static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ -static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ - -/* We provide macros for accessing buffer states in case in the - * future we want to put the buffer states in a more general - * "scanner state". - * - * Returns the top of the stack, or NULL. - */ -#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ - ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ - : NULL) - -/* Same as previous macro, but useful when we know that the buffer stack is not - * NULL or when we need an lvalue. For internal use only. - */ -#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] - -/* yy_hold_char holds the character lost when yytext is formed. */ -static char yy_hold_char; -static int yy_n_chars; /* number of characters read into yy_ch_buf */ -int yyleng; - -/* Points to current character in buffer. */ -static char *yy_c_buf_p = (char *) 0; -static int yy_init = 0; /* whether we need to initialize */ -static int yy_start = 0; /* start state number */ - -/* Flag which is used to allow yywrap()'s to do buffer switches - * instead of setting up a fresh yyin. A bit of a hack ... - */ -static int yy_did_buffer_switch_on_eof; - -void yyrestart (FILE *input_file ); -void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); -YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); -void yy_delete_buffer (YY_BUFFER_STATE b ); -void yy_flush_buffer (YY_BUFFER_STATE b ); -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); -void yypop_buffer_state (void ); - -static void yyensure_buffer_stack (void ); -static void yy_load_buffer_state (void ); -static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); - -#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) - -YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); -YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); -YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); - -void *yyalloc (yy_size_t ); -void *yyrealloc (void *,yy_size_t ); -void yyfree (void * ); - -#define yy_new_buffer yy_create_buffer - -#define yy_set_interactive(is_interactive) \ - { \ - if ( ! YY_CURRENT_BUFFER ){ \ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ - } - -#define yy_set_bol(at_bol) \ - { \ - if ( ! YY_CURRENT_BUFFER ){\ - yyensure_buffer_stack (); \ - YY_CURRENT_BUFFER_LVALUE = \ - yy_create_buffer(yyin,YY_BUF_SIZE ); \ - } \ - YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ - } - -#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) - -/* Begin user sect3 */ - -#define yywrap(n) 1 -#define YY_SKIP_YYWRAP - -typedef unsigned char YY_CHAR; - -FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; - -typedef int yy_state_type; - -extern int yylineno; - -int yylineno = 1; - -extern char *yytext; -#define yytext_ptr yytext - -static yy_state_type yy_get_previous_state (void ); -static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); -static int yy_get_next_buffer (void ); -static void yy_fatal_error (yyconst char msg[] ); - -/* Done after the current pattern has been matched and before the - * corresponding action - sets up yytext. - */ -#define YY_DO_BEFORE_ACTION \ - (yytext_ptr) = yy_bp; \ - yyleng = (size_t) (yy_cp - yy_bp); \ - (yy_hold_char) = *yy_cp; \ - *yy_cp = '\0'; \ - (yy_c_buf_p) = yy_cp; - -#define YY_NUM_RULES 142 -#define YY_END_OF_BUFFER 143 -/* This struct is not used in this scanner, - but its presence is necessary. */ -struct yy_trans_info - { - flex_int32_t yy_verify; - flex_int32_t yy_nxt; - }; -static yyconst flex_int16_t yy_accept[407] = - { 0, - 0, 0, 0, 0, 143, 141, 140, 140, 125, 131, - 136, 120, 121, 129, 128, 117, 126, 124, 130, 88, - 88, 118, 114, 132, 119, 133, 137, 84, 122, 123, - 135, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 115, 134, 116, 127, 139, 142, 141, 138, 111, - 97, 116, 105, 100, 95, 103, 93, 104, 94, 91, - 92, 0, 96, 90, 86, 87, 0, 0, 88, 123, - 115, 122, 112, 108, 110, 109, 113, 84, 101, 107, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - - 13, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 16, 18, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 102, 106, 138, 0, 0, 1, 90, 0, - 0, 89, 85, 98, 99, 44, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 14, 84, 84, 84, 84, 84, 84, - 84, 84, 22, 84, 84, 84, 84, 84, 84, 84, - 84, 19, 84, 84, 84, 84, 84, 84, 84, 84, - - 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 0, 91, 0, 90, 84, 24, - 84, 84, 81, 84, 84, 84, 84, 84, 84, 84, - 17, 47, 84, 84, 84, 84, 84, 52, 66, 84, - 84, 84, 84, 84, 84, 84, 84, 63, 5, 29, - 30, 31, 84, 84, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 84, 84, 84, 84, 50, 25, 84, - 84, 84, 84, 84, 84, 32, 33, 34, 23, 84, - 84, 84, 11, 38, 39, 40, 45, 8, 84, 84, - 84, 84, 77, 78, 79, 84, 26, 67, 21, 74, - - 75, 76, 3, 71, 72, 73, 84, 20, 69, 84, - 84, 35, 36, 37, 84, 84, 84, 84, 84, 84, - 84, 84, 84, 64, 84, 84, 84, 84, 84, 84, - 84, 46, 84, 83, 84, 84, 15, 84, 84, 84, - 84, 65, 60, 55, 84, 84, 84, 84, 84, 70, - 51, 84, 58, 28, 84, 80, 59, 43, 53, 84, - 84, 84, 84, 84, 84, 84, 84, 54, 27, 84, - 84, 84, 4, 84, 84, 84, 84, 84, 48, 9, - 84, 10, 84, 84, 12, 61, 84, 84, 84, 56, - 84, 84, 84, 49, 68, 57, 7, 62, 2, 82, - - 6, 41, 84, 84, 42, 0 - } ; - -static yyconst flex_int32_t yy_ec[256] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, - 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 2, 4, 1, 1, 1, 5, 6, 1, 7, - 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 16, 16, 16, 20, 20, 21, 22, 23, - 24, 25, 26, 1, 27, 27, 28, 29, 30, 27, - 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, - 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, - 33, 1, 34, 35, 31, 1, 36, 37, 38, 39, - - 40, 41, 42, 43, 44, 31, 45, 46, 47, 48, - 49, 50, 31, 51, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1 - } ; - -static yyconst flex_int32_t yy_meta[64] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, - 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, - 3, 3, 1, 1, 1, 2, 2, 2, 2, 2, - 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, - 1, 1, 1 - } ; - -static yyconst flex_int16_t yy_base[411] = - { 0, - 0, 0, 63, 0, 600, 601, 601, 601, 575, 103, - 123, 601, 601, 574, 120, 601, 119, 117, 131, 143, - 151, 572, 601, 169, 572, 114, 601, 0, 601, 601, - 117, 96, 102, 136, 140, 130, 150, 546, 110, 156, - 545, 162, 152, 539, 167, 552, 170, 169, 167, 188, - 548, 601, 118, 601, 601, 601, 601, 576, 0, 601, - 601, 601, 601, 601, 601, 601, 601, 601, 601, 214, - 601, 586, 601, 223, 232, 251, 267, 0, 277, 601, - 601, 601, 564, 601, 601, 601, 563, 0, 601, 601, - 539, 532, 535, 543, 542, 529, 544, 531, 537, 525, - - 522, 535, 522, 519, 519, 525, 513, 520, 517, 527, - 513, 519, 522, 523, 0, 253, 522, 160, 508, 521, - 512, 514, 504, 518, 515, 517, 500, 505, 502, 491, - 171, 505, 501, 503, 492, 495, 173, 500, 492, 504, - 211, 497, 601, 601, 0, 303, 537, 601, 309, 325, - 335, 341, 0, 601, 601, 0, 488, 492, 501, 498, - 482, 482, 183, 497, 494, 494, 492, 489, 481, 487, - 474, 485, 488, 0, 485, 473, 480, 477, 481, 474, - 463, 462, 475, 478, 475, 470, 461, 241, 466, 469, - 460, 457, 461, 467, 458, 449, 452, 450, 460, 446, - - 444, 444, 446, 443, 454, 453, 224, 448, 443, 432, - 257, 450, 452, 441, 347, 353, 359, 365, 442, 0, - 440, 292, 0, 432, 430, 438, 427, 444, 433, 313, - 0, 0, 427, 437, 437, 422, 329, 0, 0, 424, - 369, 425, 419, 418, 419, 418, 372, 0, 0, 0, - 0, 0, 414, 415, 420, 411, 424, 419, 418, 410, - 414, 406, 409, 413, 418, 417, 408, 0, 0, 414, - 403, 403, 408, 407, 404, 0, 0, 0, 0, 394, - 406, 408, 0, 0, 0, 0, 0, 0, 396, 397, - 391, 401, 0, 0, 0, 392, 0, 0, 0, 0, - - 0, 0, 0, 0, 0, 0, 399, 0, 0, 397, - 393, 0, 0, 0, 389, 385, 390, 380, 393, 379, - 392, 381, 388, 0, 386, 388, 372, 381, 387, 382, - 370, 0, 372, 0, 371, 374, 0, 363, 362, 362, - 375, 0, 377, 0, 376, 375, 360, 373, 360, 0, - 0, 363, 0, 0, 355, 0, 0, 0, 0, 352, - 363, 356, 362, 359, 354, 346, 298, 0, 0, 290, - 296, 285, 0, 278, 274, 263, 261, 265, 0, 0, - 265, 0, 261, 260, 0, 0, 258, 235, 240, 0, - 213, 227, 192, 0, 0, 0, 0, 0, 0, 0, - - 0, 0, 173, 137, 0, 601, 390, 392, 395, 148 - } ; - -static yyconst flex_int16_t yy_def[411] = - { 0, - 406, 1, 406, 3, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 407, 406, 406, - 406, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 406, 406, 406, 406, 406, 406, 406, 408, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 409, 406, 406, 406, 406, 406, 410, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 407, 406, 406, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 406, 406, 408, 406, 409, 406, 406, 406, - 406, 406, 410, 406, 406, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 406, 406, 406, 406, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, - - 407, 407, 407, 407, 407, 0, 406, 406, 406, 406 - } ; - -static yyconst flex_int16_t yy_nxt[665] = - { 0, - 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 21, 21, 21, 21, - 22, 23, 24, 25, 26, 27, 28, 28, 28, 28, - 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, - 37, 38, 39, 40, 28, 41, 42, 43, 44, 45, - 46, 47, 48, 49, 50, 51, 28, 28, 28, 52, - 53, 54, 55, 6, 56, 57, 6, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 58, 6, 6, 6, - 6, 6, 6, 6, 6, 6, 6, 6, 6, 59, - 59, 59, 59, 59, 59, 6, 6, 6, 59, 59, - - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 59, 59, 6, 6, 6, 6, 61, 62, 63, 66, - 68, 70, 70, 70, 70, 70, 70, 86, 87, 71, - 89, 143, 69, 67, 72, 112, 64, 91, 92, 153, - 93, 90, 94, 113, 73, 74, 95, 75, 75, 75, - 75, 75, 76, 74, 114, 79, 79, 79, 79, 79, - 79, 96, 77, 81, 78, 103, 405, 104, 144, 99, - 77, 97, 77, 100, 98, 106, 105, 121, 101, 82, - 77, 83, 84, 107, 102, 108, 115, 119, 109, 78, - - 122, 120, 124, 116, 110, 128, 200, 186, 133, 404, - 117, 134, 129, 130, 137, 187, 207, 125, 138, 135, - 126, 201, 131, 139, 208, 132, 136, 140, 70, 70, - 70, 70, 70, 70, 225, 226, 141, 149, 149, 149, - 149, 149, 149, 146, 74, 403, 75, 75, 75, 75, - 75, 76, 150, 146, 212, 402, 213, 250, 251, 252, - 401, 77, 150, 74, 271, 76, 76, 76, 76, 76, - 76, 77, 272, 276, 277, 278, 151, 392, 151, 400, - 77, 152, 152, 152, 152, 152, 152, 399, 393, 74, - 77, 79, 79, 79, 79, 79, 79, 398, 180, 397, - - 396, 181, 182, 395, 394, 183, 77, 184, 284, 285, - 286, 391, 215, 390, 215, 389, 77, 216, 216, 216, - 216, 216, 216, 149, 149, 149, 149, 149, 149, 293, - 294, 295, 388, 387, 217, 386, 217, 385, 150, 218, - 218, 218, 218, 218, 218, 300, 301, 302, 150, 152, - 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, - 152, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 216, 218, 218, 218, 218, 218, 218, 218, - 218, 218, 218, 218, 218, 304, 305, 306, 312, 313, - 314, 88, 88, 145, 145, 147, 147, 147, 384, 383, - - 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, - 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, - 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, - 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, - 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, - 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, - 322, 321, 320, 319, 318, 317, 316, 315, 311, 310, - 309, 308, 307, 303, 299, 298, 297, 296, 292, 291, - 290, 289, 288, 287, 283, 282, 281, 280, 279, 275, - 274, 273, 270, 269, 268, 267, 266, 265, 264, 263, - - 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, - 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, - 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, - 229, 228, 227, 224, 223, 222, 221, 220, 219, 148, - 214, 211, 210, 209, 206, 205, 204, 203, 202, 199, - 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, - 188, 185, 179, 178, 177, 176, 175, 174, 173, 172, - 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, - 161, 160, 159, 158, 157, 156, 155, 154, 148, 72, - 142, 127, 123, 118, 111, 85, 80, 65, 60, 406, - - 5, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406 - } ; - -static yyconst flex_int16_t yy_chk[665] = - { 0, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 3, 3, 3, 3, 3, 3, 10, 10, 11, 15, - 17, 18, 18, 18, 18, 18, 18, 26, 26, 19, - 31, 53, 17, 15, 19, 39, 11, 32, 32, 410, - 33, 31, 33, 39, 19, 20, 33, 20, 20, 20, - 20, 20, 20, 21, 39, 21, 21, 21, 21, 21, - 21, 34, 20, 24, 20, 36, 404, 36, 53, 35, - 21, 34, 20, 35, 34, 37, 36, 43, 35, 24, - 21, 24, 24, 37, 35, 37, 40, 42, 37, 20, - - 43, 42, 45, 40, 37, 47, 131, 118, 48, 403, - 40, 48, 47, 47, 49, 118, 137, 45, 49, 48, - 45, 131, 47, 50, 137, 47, 48, 50, 70, 70, - 70, 70, 70, 70, 163, 163, 50, 74, 74, 74, - 74, 74, 74, 70, 75, 393, 75, 75, 75, 75, - 75, 75, 74, 70, 141, 392, 141, 188, 188, 188, - 391, 75, 74, 76, 207, 76, 76, 76, 76, 76, - 76, 75, 207, 211, 211, 211, 77, 377, 77, 389, - 76, 77, 77, 77, 77, 77, 77, 388, 377, 79, - 76, 79, 79, 79, 79, 79, 79, 387, 116, 384, - - 383, 116, 116, 381, 378, 116, 79, 116, 222, 222, - 222, 376, 146, 375, 146, 374, 79, 146, 146, 146, - 146, 146, 146, 149, 149, 149, 149, 149, 149, 230, - 230, 230, 372, 371, 150, 370, 150, 367, 149, 150, - 150, 150, 150, 150, 150, 237, 237, 237, 149, 151, - 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, - 152, 215, 215, 215, 215, 215, 215, 216, 216, 216, - 216, 216, 216, 217, 217, 217, 217, 217, 217, 218, - 218, 218, 218, 218, 218, 241, 241, 241, 247, 247, - 247, 407, 407, 408, 408, 409, 409, 409, 366, 365, - - 364, 363, 362, 361, 360, 355, 352, 349, 348, 347, - 346, 345, 343, 341, 340, 339, 338, 336, 335, 333, - 331, 330, 329, 328, 327, 326, 325, 323, 322, 321, - 320, 319, 318, 317, 316, 315, 311, 310, 307, 296, - 292, 291, 290, 289, 282, 281, 280, 275, 274, 273, - 272, 271, 270, 267, 266, 265, 264, 263, 262, 261, - 260, 259, 258, 257, 256, 255, 254, 253, 246, 245, - 244, 243, 242, 240, 236, 235, 234, 233, 229, 228, - 227, 226, 225, 224, 221, 219, 214, 213, 212, 210, - 209, 208, 206, 205, 204, 203, 202, 201, 200, 199, - - 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, - 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, - 177, 176, 175, 173, 172, 171, 170, 169, 168, 167, - 166, 165, 164, 162, 161, 160, 159, 158, 157, 147, - 142, 140, 139, 138, 136, 135, 134, 133, 132, 130, - 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, - 119, 117, 114, 113, 112, 111, 110, 109, 108, 107, - 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, - 96, 95, 94, 93, 92, 91, 87, 83, 72, 58, - 51, 46, 44, 41, 38, 25, 22, 14, 9, 5, - - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, - 406, 406, 406, 406 - } ; - -/* Table of booleans, true if rule could match eol. */ -static yyconst flex_int32_t yy_rule_can_match_eol[143] = - { 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, }; - -static yy_state_type yy_last_accepting_state; -static char *yy_last_accepting_cpos; - -extern int yy_flex_debug; -int yy_flex_debug = 0; - -/* The intent behind this definition is that it'll catch - * any uses of REJECT which flex missed. - */ -#define REJECT reject_used_but_not_detected -#define yymore() yymore_used_but_not_detected -#define YY_MORE_ADJ 0 -#define YY_RESTORE_YY_MORE_OFFSET -char *yytext; -/* -// -// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// -*/ -/* Based on -ANSI C grammar, Lex specification - -In 1985, Jeff Lee published this Lex specification together with a Yacc -grammar for the April 30, 1985 ANSI C draft. Tom Stockfisch reposted -both to net.sources in 1987; that original, as mentioned in the answer -to question 17.25 of the comp.lang.c FAQ, can be ftp'ed from ftp.uu.net, -file usenet/net.sources/ansi.c.grammar.Z. - -I intend to keep this version as close to the current C Standard grammar -as possible; please let me know if you discover discrepancies. - -Jutta Degener, 1995 -*/ -#include -#include - -#include "compiler/ParseHelper.h" -#include "glslang_tab.h" - -/* windows only pragma */ -#ifdef _MSC_VER -#pragma warning(disable : 4102) -#endif - -int yy_input(char* buf, int max_size); - -extern int yyparse(void*); -#define YY_DECL int yylex(YYSTYPE* pyylval,void* parseContextLocal) -#define parseContext (*((TParseContext*)(parseContextLocal))) - -#define YY_INPUT(buf,result,max_size) (result = yy_input(buf, max_size)) - -/* -TODO(alokp): yylineno is only here to support old flex.exe in compiler/tools. -Remove it when we can exclusively use the newer version. -*/ - -#define INITIAL 0 -#define FIELDS 1 - -#ifndef YY_EXTRA_TYPE -#define YY_EXTRA_TYPE void * -#endif - -static int yy_init_globals (void ); - -/* Accessor methods to globals. - These are made visible to non-reentrant scanners for convenience. */ - -int yylex_destroy (void ); - -int yyget_debug (void ); - -void yyset_debug (int debug_flag ); - -YY_EXTRA_TYPE yyget_extra (void ); - -void yyset_extra (YY_EXTRA_TYPE user_defined ); - -FILE *yyget_in (void ); - -void yyset_in (FILE * in_str ); - -FILE *yyget_out (void ); - -void yyset_out (FILE * out_str ); - -int yyget_leng (void ); - -char *yyget_text (void ); - -int yyget_lineno (void ); - -void yyset_lineno (int line_number ); - -/* Macros after this point can all be overridden by user definitions in - * section 1. - */ - -#ifndef YY_SKIP_YYWRAP -#ifdef __cplusplus -extern "C" int yywrap (void ); -#else -extern int yywrap (void ); -#endif -#endif - -#ifndef yytext_ptr -static void yy_flex_strncpy (char *,yyconst char *,int ); -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * ); -#endif - -#ifndef YY_NO_INPUT - -#ifdef __cplusplus -static int yyinput (void ); -#else -static int input (void ); -#endif - -#endif - -/* Amount of stuff to slurp up with each read. */ -#ifndef YY_READ_BUF_SIZE -#ifdef __ia64__ -/* On IA-64, the buffer size is 16k, not 8k */ -#define YY_READ_BUF_SIZE 16384 -#else -#define YY_READ_BUF_SIZE 8192 -#endif /* __ia64__ */ -#endif - -/* Copy whatever the last rule matched to the standard output. */ -#ifndef ECHO -/* 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) -#endif - -/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, - * is returned in "result". - */ -#ifndef YY_INPUT -#define YY_INPUT(buf,result,max_size) \ - if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ - { \ - int c = '*'; \ - size_t n; \ - for ( n = 0; n < max_size && \ - (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ - buf[n] = (char) c; \ - if ( c == '\n' ) \ - buf[n++] = (char) c; \ - if ( c == EOF && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - result = n; \ - } \ - else \ - { \ - errno=0; \ - while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ - { \ - if( errno != EINTR) \ - { \ - YY_FATAL_ERROR( "input in flex scanner failed" ); \ - break; \ - } \ - errno=0; \ - clearerr(yyin); \ - } \ - }\ -\ - -#endif - -/* No semi-colon after return; correct usage is to write "yyterminate();" - - * we don't want an extra ';' after the "return" because that will cause - * some compilers to complain about unreachable statements. - */ -#ifndef yyterminate -#define yyterminate() return YY_NULL -#endif - -/* Number of entries by which start-condition stack grows. */ -#ifndef YY_START_STACK_INCR -#define YY_START_STACK_INCR 25 -#endif - -/* Report a fatal error. */ -#ifndef YY_FATAL_ERROR -#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) -#endif - -/* end tables serialization structures and prototypes */ - -/* Default declaration of generated scanner - a define so the user can - * easily add parameters. - */ -#ifndef YY_DECL -#define YY_DECL_IS_OURS 1 - -extern int yylex (void); - -#define YY_DECL int yylex (void) -#endif /* !YY_DECL */ - -/* Code executed at the beginning of each rule, after yytext and yyleng - * have been set up. - */ -#ifndef YY_USER_ACTION -#define YY_USER_ACTION -#endif - -/* Code executed at the end of each rule. */ -#ifndef YY_BREAK -#define YY_BREAK break; -#endif - -#define YY_RULE_SETUP \ - YY_USER_ACTION - -/** The main scanner function which does all the work. - */ -YY_DECL -{ - register yy_state_type yy_current_state; - register char *yy_cp, *yy_bp; - register int yy_act; - - if ( !(yy_init) ) - { - (yy_init) = 1; - -#ifdef YY_USER_INIT - YY_USER_INIT; -#endif - - if ( ! (yy_start) ) - (yy_start) = 1; /* first start state */ - - if ( ! yyin ) - yyin = stdin; - - if ( ! yyout ) - yyout = stdout; - - if ( ! YY_CURRENT_BUFFER ) { - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_load_buffer_state( ); - } - - while ( 1 ) /* loops until end-of-file is reached */ - { - yy_cp = (yy_c_buf_p); - - /* Support of yytext. */ - *yy_cp = (yy_hold_char); - - /* yy_bp points to the position in yy_ch_buf of the start of - * the current run. - */ - yy_bp = yy_cp; - - yy_current_state = (yy_start); -yy_match: - do - { - register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 407 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - ++yy_cp; - } - while ( yy_current_state != 406 ); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - -yy_find_action: - yy_act = yy_accept[yy_current_state]; - - YY_DO_BEFORE_ACTION; - - if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] ) - { - int yyl; - for ( yyl = 0; yyl < yyleng; ++yyl ) - if ( yytext[yyl] == '\n' ) - - yylineno++; -; - } - -do_action: /* This label is used only to access EOF actions. */ - - switch ( yy_act ) - { /* beginning of action switch */ - case 0: /* must back up */ - /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = (yy_hold_char); - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - -case 1: -/* rule 1 can match eol */ -YY_RULE_SETUP -{ /* ?? carriage and/or line-feed? */ }; - YY_BREAK -case 2: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(INVARIANT); } - YY_BREAK -case 3: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(HIGH_PRECISION); } - YY_BREAK -case 4: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(MEDIUM_PRECISION); } - YY_BREAK -case 5: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(LOW_PRECISION); } - YY_BREAK -case 6: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(PRECISION); } - YY_BREAK -case 7: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(ATTRIBUTE); } - YY_BREAK -case 8: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(CONST_QUAL); } - YY_BREAK -case 9: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(UNIFORM); } - YY_BREAK -case 10: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(VARYING); } - YY_BREAK -case 11: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(BREAK); } - YY_BREAK -case 12: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(CONTINUE); } - YY_BREAK -case 13: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(DO); } - YY_BREAK -case 14: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(FOR); } - YY_BREAK -case 15: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(WHILE); } - YY_BREAK -case 16: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(IF); } - YY_BREAK -case 17: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(ELSE); } - YY_BREAK -case 18: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(IN_QUAL); } - YY_BREAK -case 19: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(OUT_QUAL); } - YY_BREAK -case 20: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(INOUT_QUAL); } - YY_BREAK -case 21: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(FLOAT_TYPE); } - YY_BREAK -case 22: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(INT_TYPE); } - YY_BREAK -case 23: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(VOID_TYPE); } - YY_BREAK -case 24: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(BOOL_TYPE); } - YY_BREAK -case 25: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.b = true; return(BOOLCONSTANT); } - YY_BREAK -case 26: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.b = false; return(BOOLCONSTANT); } - YY_BREAK -case 27: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(DISCARD); } - YY_BREAK -case 28: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(RETURN); } - YY_BREAK -case 29: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX2); } - YY_BREAK -case 30: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX3); } - YY_BREAK -case 31: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX4); } - YY_BREAK -case 32: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC2); } - YY_BREAK -case 33: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC3); } - YY_BREAK -case 34: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC4); } - YY_BREAK -case 35: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC2); } - YY_BREAK -case 36: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC3); } - YY_BREAK -case 37: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC4); } - YY_BREAK -case 38: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC2); } - YY_BREAK -case 39: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC3); } - YY_BREAK -case 40: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC4); } - YY_BREAK -case 41: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2D; } - YY_BREAK -case 42: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBE; } - YY_BREAK -case 43: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(STRUCT); } - YY_BREAK -case 44: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 45: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 46: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 47: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 48: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 49: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 50: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 51: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 52: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 53: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 54: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 55: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 56: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 57: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 58: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 59: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 60: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 61: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 62: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 63: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 64: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 65: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 66: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 67: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 68: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 69: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 70: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 71: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 72: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 73: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 74: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 75: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 76: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 77: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 78: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 79: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 80: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 81: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 82: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 83: -YY_RULE_SETUP -{ PaReservedWord(); return 0; } - YY_BREAK -case 84: -YY_RULE_SETUP -{ - pyylval->lex.line = yylineno; - pyylval->lex.string = NewPoolTString(yytext); - return PaIdentOrType(*pyylval->lex.string, parseContext, pyylval->lex.symbol); -} - YY_BREAK -case 85: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); } - YY_BREAK -case 86: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); } - YY_BREAK -case 87: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;} - YY_BREAK -case 88: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); } - YY_BREAK -case 89: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast(atof(yytext)); return(FLOATCONSTANT); } - YY_BREAK -case 90: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast(atof(yytext)); return(FLOATCONSTANT); } - YY_BREAK -case 91: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast(atof(yytext)); return(FLOATCONSTANT); } - YY_BREAK -case 92: -YY_RULE_SETUP -{ int ret = PaParseComment(pyylval->lex.line, parseContext); if (!ret) return ret; } - YY_BREAK -case 93: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(ADD_ASSIGN); } - YY_BREAK -case 94: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(SUB_ASSIGN); } - YY_BREAK -case 95: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(MUL_ASSIGN); } - YY_BREAK -case 96: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(DIV_ASSIGN); } - YY_BREAK -case 97: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(MOD_ASSIGN); } - YY_BREAK -case 98: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(LEFT_ASSIGN); } - YY_BREAK -case 99: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(RIGHT_ASSIGN); } - YY_BREAK -case 100: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(AND_ASSIGN); } - YY_BREAK -case 101: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(XOR_ASSIGN); } - YY_BREAK -case 102: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(OR_ASSIGN); } - YY_BREAK -case 103: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(INC_OP); } - YY_BREAK -case 104: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(DEC_OP); } - YY_BREAK -case 105: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(AND_OP); } - YY_BREAK -case 106: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(OR_OP); } - YY_BREAK -case 107: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(XOR_OP); } - YY_BREAK -case 108: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(LE_OP); } - YY_BREAK -case 109: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(GE_OP); } - YY_BREAK -case 110: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(EQ_OP); } - YY_BREAK -case 111: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(NE_OP); } - YY_BREAK -case 112: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(LEFT_OP); } - YY_BREAK -case 113: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(RIGHT_OP); } - YY_BREAK -case 114: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(SEMICOLON); } - YY_BREAK -case 115: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(LEFT_BRACE); } - YY_BREAK -case 116: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(RIGHT_BRACE); } - YY_BREAK -case 117: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; if (parseContext.inTypeParen) parseContext.lexAfterType = false; return(COMMA); } - YY_BREAK -case 118: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(COLON); } - YY_BREAK -case 119: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(EQUAL); } - YY_BREAK -case 120: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; parseContext.inTypeParen = true; return(LEFT_PAREN); } - YY_BREAK -case 121: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; parseContext.inTypeParen = false; return(RIGHT_PAREN); } - YY_BREAK -case 122: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(LEFT_BRACKET); } - YY_BREAK -case 123: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(RIGHT_BRACKET); } - YY_BREAK -case 124: -YY_RULE_SETUP -{ BEGIN(FIELDS); return(DOT); } - YY_BREAK -case 125: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(BANG); } - YY_BREAK -case 126: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(DASH); } - YY_BREAK -case 127: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(TILDE); } - YY_BREAK -case 128: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(PLUS); } - YY_BREAK -case 129: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(STAR); } - YY_BREAK -case 130: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(SLASH); } - YY_BREAK -case 131: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(PERCENT); } - YY_BREAK -case 132: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(LEFT_ANGLE); } - YY_BREAK -case 133: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(RIGHT_ANGLE); } - YY_BREAK -case 134: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(VERTICAL_BAR); } - YY_BREAK -case 135: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(CARET); } - YY_BREAK -case 136: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(AMPERSAND); } - YY_BREAK -case 137: -YY_RULE_SETUP -{ pyylval->lex.line = yylineno; return(QUESTION); } - YY_BREAK -case 138: -YY_RULE_SETUP -{ -BEGIN(INITIAL); - pyylval->lex.line = yylineno; - pyylval->lex.string = NewPoolTString(yytext); - return FIELD_SELECTION; } - YY_BREAK -case 139: -YY_RULE_SETUP -{} - YY_BREAK -case 140: -/* rule 140 can match eol */ -YY_RULE_SETUP -{ } - YY_BREAK -case YY_STATE_EOF(INITIAL): -case YY_STATE_EOF(FIELDS): -{ (&parseContext)->AfterEOF = true; yy_delete_buffer(YY_CURRENT_BUFFER); yyterminate();} - YY_BREAK -case 141: -YY_RULE_SETUP -{ parseContext.infoSink.info << "FLEX: Unknown char " << yytext << "\n"; - return 0; } - YY_BREAK -case 142: -YY_RULE_SETUP -ECHO; - YY_BREAK - - case YY_END_OF_BUFFER: - { - /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; - - /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = (yy_hold_char); - YY_RESTORE_YY_MORE_OFFSET - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) - { - /* We're scanning a new file or input source. It's - * possible that this happened because the user - * just pointed yyin at a new source and called - * yylex(). If so, then we have to assure - * consistency between YY_CURRENT_BUFFER and our - * globals. Here is the right place to do so, because - * this is the first action (other than possibly a - * back-up) that will match for the new input source. - */ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; - } - - /* Note that here we test for yy_c_buf_p "<=" to the position - * of the first EOB in the buffer, since yy_c_buf_p will - * already have been incremented past the NUL character - * (since all states make transitions on EOB to the - * end-of-buffer state). Contrast this with the test - * in input(). - */ - if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - { /* This was really a NUL. */ - yy_state_type yy_next_state; - - (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - /* Okay, we're now positioned to make the NUL - * transition. We couldn't have - * yy_get_previous_state() go ahead and do it - * for us because it doesn't know how to deal - * with the possibility of jamming (and we don't - * want to build jamming into it because then it - * will run more slowly). - */ - - yy_next_state = yy_try_NUL_trans( yy_current_state ); - - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - - if ( yy_next_state ) - { - /* Consume the NUL. */ - yy_cp = ++(yy_c_buf_p); - yy_current_state = yy_next_state; - goto yy_match; - } - - else - { - yy_cp = (yy_last_accepting_cpos); - yy_current_state = (yy_last_accepting_state); - goto yy_find_action; - } - } - - else switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_END_OF_FILE: - { - (yy_did_buffer_switch_on_eof) = 0; - - if ( yywrap( ) ) - { - /* Note: because we've taken care in - * yy_get_next_buffer() to have set up - * yytext, we can now set up - * yy_c_buf_p so that if some total - * hoser (like flex itself) wants to - * call the scanner after we return the - * YY_NULL, it'll still work - another - * YY_NULL will get returned. - */ - (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; - - yy_act = YY_STATE_EOF(YY_START); - goto do_action; - } - - else - { - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; - } - break; - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = - (yytext_ptr) + yy_amount_of_matched_text; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_match; - - case EOB_ACT_LAST_MATCH: - (yy_c_buf_p) = - &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - - yy_current_state = yy_get_previous_state( ); - - yy_cp = (yy_c_buf_p); - yy_bp = (yytext_ptr) + YY_MORE_ADJ; - goto yy_find_action; - } - break; - } - - default: - YY_FATAL_ERROR( - "fatal flex scanner internal error--no action found" ); - } /* end of action switch */ - } /* end of scanning one token */ -} /* end of yylex */ - -/* yy_get_next_buffer - try to read in a new buffer - * - * Returns a code representing an action: - * EOB_ACT_LAST_MATCH - - * EOB_ACT_CONTINUE_SCAN - continue scanning from current position - * EOB_ACT_END_OF_FILE - end of file - */ -static int yy_get_next_buffer (void) -{ - register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; - register char *source = (yytext_ptr); - register int number_to_move, i; - int ret_val; - - if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) - YY_FATAL_ERROR( - "fatal flex scanner internal error--end of buffer missed" ); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) - { /* Don't try to fill the buffer, so this is an EOF. */ - if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) - { - /* We matched a single character, the EOB, so - * treat this as a final EOF. - */ - return EOB_ACT_END_OF_FILE; - } - - else - { - /* We matched some text prior to the EOB, first - * process it. - */ - return EOB_ACT_LAST_MATCH; - } - } - - /* Try to read more data. */ - - /* First move last chars to start of buffer. */ - number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; - - for ( i = 0; i < number_to_move; ++i ) - *(dest++) = *(source++); - - if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) - /* don't do the read, it's not guaranteed to return an EOF, - * just force an EOF - */ - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; - - else - { - int 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; - - int yy_c_buf_p_offset = - (int) ((yy_c_buf_p) - b->yy_ch_buf); - - if ( b->yy_is_our_buffer ) - { - int new_size = b->yy_buf_size * 2; - - if ( new_size <= 0 ) - b->yy_buf_size += b->yy_buf_size / 8; - else - b->yy_buf_size *= 2; - - b->yy_ch_buf = (char *) - /* Include room in for 2 EOB chars. */ - yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); - } - else - /* Can't grow it, we don't own it. */ - b->yy_ch_buf = 0; - - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( - "fatal error - scanner input buffer overflow" ); - - (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - - num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - - number_to_move - 1; - - } - - if ( num_to_read > YY_READ_BUF_SIZE ) - num_to_read = YY_READ_BUF_SIZE; - - /* Read in more data. */ - YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), - (yy_n_chars), (size_t) num_to_read ); - - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - if ( (yy_n_chars) == 0 ) - { - if ( number_to_move == YY_MORE_ADJ ) - { - ret_val = EOB_ACT_END_OF_FILE; - yyrestart(yyin ); - } - - else - { - ret_val = EOB_ACT_LAST_MATCH; - YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = - YY_BUFFER_EOF_PENDING; - } - } - - else - ret_val = EOB_ACT_CONTINUE_SCAN; - - if ((yy_size_t) ((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 = (yy_n_chars) + number_to_move + ((yy_n_chars) >> 1); - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ); - if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); - } - - (yy_n_chars) += number_to_move; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; - YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - - (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; - - return ret_val; -} - -/* yy_get_previous_state - get the state just before the EOB char was reached */ - - static yy_state_type yy_get_previous_state (void) -{ - register yy_state_type yy_current_state; - register char *yy_cp; - - yy_current_state = (yy_start); - - for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) - { - register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 407 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - } - - return yy_current_state; -} - -/* yy_try_NUL_trans - try to make a transition on the NUL character - * - * synopsis - * next_state = yy_try_NUL_trans( current_state ); - */ - static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) -{ - register int yy_is_jam; - register char *yy_cp = (yy_c_buf_p); - - register YY_CHAR yy_c = 1; - if ( yy_accept[yy_current_state] ) - { - (yy_last_accepting_state) = yy_current_state; - (yy_last_accepting_cpos) = yy_cp; - } - while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) - { - yy_current_state = (int) yy_def[yy_current_state]; - if ( yy_current_state >= 407 ) - yy_c = yy_meta[(unsigned int) yy_c]; - } - yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; - yy_is_jam = (yy_current_state == 406); - - return yy_is_jam ? 0 : yy_current_state; -} - -#ifndef YY_NO_INPUT -#ifdef __cplusplus - static int yyinput (void) -#else - static int input (void) -#endif - -{ - int c; - - *(yy_c_buf_p) = (yy_hold_char); - - if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) - { - /* yy_c_buf_p now points to the character we want to return. - * If this occurs *before* the EOB characters, then it's a - * valid NUL; if not, then we've hit the end of the buffer. - */ - if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) - /* This was really a NUL. */ - *(yy_c_buf_p) = '\0'; - - else - { /* need more input */ - int offset = (yy_c_buf_p) - (yytext_ptr); - ++(yy_c_buf_p); - - switch ( yy_get_next_buffer( ) ) - { - case EOB_ACT_LAST_MATCH: - /* This happens because yy_g_n_b() - * sees that we've accumulated a - * token and flags that we need to - * try matching the token before - * proceeding. But for input(), - * there's no matching to consider. - * So convert the EOB_ACT_LAST_MATCH - * to EOB_ACT_END_OF_FILE. - */ - - /* Reset buffer status. */ - yyrestart(yyin ); - - /*FALLTHROUGH*/ - - case EOB_ACT_END_OF_FILE: - { - if ( yywrap( ) ) - return EOF; - - if ( ! (yy_did_buffer_switch_on_eof) ) - YY_NEW_FILE; -#ifdef __cplusplus - return yyinput(); -#else - return input(); -#endif - } - - case EOB_ACT_CONTINUE_SCAN: - (yy_c_buf_p) = (yytext_ptr) + offset; - break; - } - } - } - - c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ - *(yy_c_buf_p) = '\0'; /* preserve yytext */ - (yy_hold_char) = *++(yy_c_buf_p); - - if ( c == '\n' ) - - yylineno++; -; - - return c; -} -#endif /* ifndef YY_NO_INPUT */ - -/** Immediately switch to a different input stream. - * @param input_file A readable stream. - * - * @note This function does not reset the start condition to @c INITIAL . - */ - void yyrestart (FILE * input_file ) -{ - - if ( ! YY_CURRENT_BUFFER ){ - yyensure_buffer_stack (); - YY_CURRENT_BUFFER_LVALUE = - yy_create_buffer(yyin,YY_BUF_SIZE ); - } - - yy_init_buffer(YY_CURRENT_BUFFER,input_file ); - yy_load_buffer_state( ); -} - -/** Switch to a different input buffer. - * @param new_buffer The new input buffer. - * - */ - void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) -{ - - /* TODO. We should be able to replace this entire function body - * with - * yypop_buffer_state(); - * yypush_buffer_state(new_buffer); - */ - yyensure_buffer_stack (); - if ( YY_CURRENT_BUFFER == new_buffer ) - return; - - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - YY_CURRENT_BUFFER_LVALUE = new_buffer; - yy_load_buffer_state( ); - - /* We don't actually know whether we did this switch during - * EOF (yywrap()) processing, but the only time this flag - * is looked at is after yywrap() is called, so it's safe - * to go ahead and always set it. - */ - (yy_did_buffer_switch_on_eof) = 1; -} - -static void yy_load_buffer_state (void) -{ - (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; - (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; - yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; - (yy_hold_char) = *(yy_c_buf_p); -} - -/** Allocate and initialize an input buffer state. - * @param file A readable stream. - * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. - * - * @return the allocated buffer state. - */ - YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) -{ - YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_buf_size = 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. - */ - b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); - if ( ! b->yy_ch_buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); - - b->yy_is_our_buffer = 1; - - yy_init_buffer(b,file ); - - return b; -} - -/** Destroy the buffer. - * @param b a buffer created with yy_create_buffer() - * - */ - void yy_delete_buffer (YY_BUFFER_STATE b ) -{ - - if ( ! b ) - return; - - if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ - YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; - - if ( b->yy_is_our_buffer ) - yyfree((void *) b->yy_ch_buf ); - - yyfree((void *) b ); -} - -/* Initializes or reinitializes a buffer. - * This function is sometimes called more than once on the same buffer, - * such as during a yyrestart() or at EOF. - */ - static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - -{ - int oerrno = errno; - - yy_flush_buffer(b ); - - b->yy_input_file = file; - b->yy_fill_buffer = 1; - - /* If b is the current buffer, then yy_init_buffer was _probably_ - * called from yyrestart() or through yy_get_next_buffer. - * In that case, we don't want to reset the lineno or column. - */ - if (b != YY_CURRENT_BUFFER){ - b->yy_bs_lineno = 1; - b->yy_bs_column = 0; - } - - b->yy_is_interactive = 0; - - errno = oerrno; -} - -/** Discard all buffered characters. On the next scan, YY_INPUT will be called. - * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. - * - */ - void yy_flush_buffer (YY_BUFFER_STATE b ) -{ - if ( ! b ) - return; - - b->yy_n_chars = 0; - - /* We always need two end-of-buffer characters. The first causes - * a transition to the end-of-buffer state. The second causes - * a jam in that state. - */ - b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; - b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; - - b->yy_buf_pos = &b->yy_ch_buf[0]; - - b->yy_at_bol = 1; - b->yy_buffer_status = YY_BUFFER_NEW; - - if ( b == YY_CURRENT_BUFFER ) - yy_load_buffer_state( ); -} - -/** Pushes the new state onto the stack. The new state becomes - * the current state. This function will allocate the stack - * if necessary. - * @param new_buffer The new state. - * - */ -void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) -{ - if (new_buffer == NULL) - return; - - yyensure_buffer_stack(); - - /* This block is copied from yy_switch_to_buffer. */ - if ( YY_CURRENT_BUFFER ) - { - /* Flush out information for old buffer. */ - *(yy_c_buf_p) = (yy_hold_char); - YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); - YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); - } - - /* Only push if top exists. Otherwise, replace top. */ - if (YY_CURRENT_BUFFER) - (yy_buffer_stack_top)++; - YY_CURRENT_BUFFER_LVALUE = new_buffer; - - /* copied from yy_switch_to_buffer. */ - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; -} - -/** Removes and deletes the top of the stack, if present. - * The next element becomes the new top. - * - */ -void yypop_buffer_state (void) -{ - if (!YY_CURRENT_BUFFER) - return; - - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - if ((yy_buffer_stack_top) > 0) - --(yy_buffer_stack_top); - - if (YY_CURRENT_BUFFER) { - yy_load_buffer_state( ); - (yy_did_buffer_switch_on_eof) = 1; - } -} - -/* Allocates the stack if it does not exist. - * Guarantees space for at least one push. - */ -static void yyensure_buffer_stack (void) -{ - int num_to_alloc; - - if (!(yy_buffer_stack)) { - - /* First allocation is just for 2 elements, since we don't know if this - * 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; - (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc - (num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); - - (yy_buffer_stack_max) = num_to_alloc; - (yy_buffer_stack_top) = 0; - return; - } - - if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ - - /* Increase the buffer to prepare for a possible push. */ - int grow_size = 8 /* arbitrary grow size */; - - num_to_alloc = (yy_buffer_stack_max) + grow_size; - (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc - ((yy_buffer_stack), - num_to_alloc * sizeof(struct yy_buffer_state*) - ); - if ( ! (yy_buffer_stack) ) - YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); - - /* zero only the new slots.*/ - memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); - (yy_buffer_stack_max) = num_to_alloc; - } -} - -/** Setup the input buffer state to scan directly from a user-specified character buffer. - * @param base the character buffer - * @param size the size in bytes of the character buffer - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) -{ - YY_BUFFER_STATE b; - - if ( size < 2 || - base[size-2] != YY_END_OF_BUFFER_CHAR || - base[size-1] != YY_END_OF_BUFFER_CHAR ) - /* They forgot to leave room for the EOB's. */ - return 0; - - b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); - if ( ! b ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); - - b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ - b->yy_buf_pos = b->yy_ch_buf = base; - b->yy_is_our_buffer = 0; - b->yy_input_file = 0; - b->yy_n_chars = b->yy_buf_size; - b->yy_is_interactive = 0; - b->yy_at_bol = 1; - b->yy_fill_buffer = 0; - b->yy_buffer_status = YY_BUFFER_NEW; - - yy_switch_to_buffer(b ); - - return b; -} - -/** Setup the input buffer state to scan a string. The next call to yylex() will - * scan from a @e copy of @a str. - * @param yystr a NUL-terminated string to scan - * - * @return the newly allocated buffer state object. - * @note If you want to scan bytes that may contain NUL values, then use - * yy_scan_bytes() instead. - */ -YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) -{ - - return yy_scan_bytes(yystr,strlen(yystr) ); -} - -/** Setup the input buffer state to scan the given bytes. The next call to yylex() will - * scan from a @e copy of @a bytes. - * @param yybytes the byte buffer to scan - * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes. - * - * @return the newly allocated buffer state object. - */ -YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) -{ - YY_BUFFER_STATE b; - char *buf; - yy_size_t n; - int i; - - /* Get memory for full buffer, including space for trailing EOB's. */ - n = _yybytes_len + 2; - buf = (char *) yyalloc(n ); - if ( ! buf ) - YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - - for ( i = 0; i < _yybytes_len; ++i ) - buf[i] = yybytes[i]; - - buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - - b = yy_scan_buffer(buf,n ); - if ( ! b ) - YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); - - /* It's okay to grow etc. this buffer, and we should throw it - * away when we're done. - */ - b->yy_is_our_buffer = 1; - - return b; -} - -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif - -static void yy_fatal_error (yyconst char* msg ) -{ - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); -} - -/* Redefine yyless() so it works in section 3 code. */ - -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - int yyless_macro_arg = (n); \ - YY_LESS_LINENO(yyless_macro_arg);\ - yytext[yyleng] = (yy_hold_char); \ - (yy_c_buf_p) = yytext + yyless_macro_arg; \ - (yy_hold_char) = *(yy_c_buf_p); \ - *(yy_c_buf_p) = '\0'; \ - yyleng = yyless_macro_arg; \ - } \ - while ( 0 ) - -/* Accessor methods (get/set functions) to struct members. */ - -/** Get the current line number. - * - */ -int yyget_lineno (void) -{ - - return yylineno; -} - -/** Get the input stream. - * - */ -FILE *yyget_in (void) -{ - return yyin; -} - -/** Get the output stream. - * - */ -FILE *yyget_out (void) -{ - return yyout; -} - -/** Get the length of the current token. - * - */ -int yyget_leng (void) -{ - return yyleng; -} - -/** Get the current token. - * - */ - -char *yyget_text (void) -{ - return yytext; -} - -/** Set the current line number. - * @param line_number - * - */ -void yyset_lineno (int line_number ) -{ - - yylineno = line_number; -} - -/** Set the input stream. This does not discard the current - * input buffer. - * @param in_str A readable stream. - * - * @see yy_switch_to_buffer - */ -void yyset_in (FILE * in_str ) -{ - yyin = in_str ; -} - -void yyset_out (FILE * out_str ) -{ - yyout = out_str ; -} - -int yyget_debug (void) -{ - return yy_flex_debug; -} - -void yyset_debug (int bdebug ) -{ - yy_flex_debug = bdebug ; -} - -static int yy_init_globals (void) -{ - /* Initialization is the same as for the non-reentrant scanner. - * This function is called from yylex_destroy(), so don't allocate here. - */ - - /* We do not touch yylineno unless the option is enabled. */ - yylineno = 1; - - (yy_buffer_stack) = 0; - (yy_buffer_stack_top) = 0; - (yy_buffer_stack_max) = 0; - (yy_c_buf_p) = (char *) 0; - (yy_init) = 0; - (yy_start) = 0; - -/* Defined in main.c */ -#ifdef YY_STDINIT - yyin = stdin; - yyout = stdout; -#else - yyin = (FILE *) 0; - yyout = (FILE *) 0; -#endif - - /* For future reference: Set errno on error, since we are called by - * yylex_init() - */ - return 0; -} - -/* yylex_destroy is for both reentrant and non-reentrant scanners. */ -int yylex_destroy (void) -{ - - /* Pop the buffer stack, destroying each element. */ - while(YY_CURRENT_BUFFER){ - yy_delete_buffer(YY_CURRENT_BUFFER ); - YY_CURRENT_BUFFER_LVALUE = NULL; - yypop_buffer_state(); - } - - /* Destroy the stack itself. */ - yyfree((yy_buffer_stack) ); - (yy_buffer_stack) = NULL; - - /* Reset the globals. This is important in a non-reentrant scanner so the next time - * yylex() is called, initialization will occur. */ - yy_init_globals( ); - - return 0; -} - -/* - * Internal utility routines. - */ - -#ifndef yytext_ptr -static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) -{ - register int i; - for ( i = 0; i < n; ++i ) - s1[i] = s2[i]; -} -#endif - -#ifdef YY_NEED_STRLEN -static int yy_flex_strlen (yyconst char * s ) -{ - register int n; - for ( n = 0; s[n]; ++n ) - ; - - return n; -} -#endif - -void *yyalloc (yy_size_t size ) -{ - return (void *) malloc( size ); -} - -void *yyrealloc (void * ptr, yy_size_t size ) -{ - /* 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 - * because both ANSI C and C++ allow castless assignment from - * any pointer type to void*, and deal with argument conversions - * as though doing an assignment. - */ - return (void *) realloc( (char *) ptr, size ); -} - -void yyfree (void * ptr ) -{ - free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ -} - -#define YYTABLES_NAME "yytables" - -//Including Pre-processor. -extern "C" { - #include "compiler/preprocessor/preprocess.h" -} - -// -// The YY_INPUT macro just calls this. Maybe this could be just put into -// the macro directly. -// - -int yy_input(char* buf, int max_size) -{ - int len; - - if ((len = yylex_CPP(buf, max_size)) == 0) - return 0; - if (len >= max_size) - YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); - - buf[len] = ' '; - return len+1; -} - -// -// Parse an array of strings using yyparse. We set up globals used by -// yywrap. -// -// Returns 0 for success, as per yyparse(). -// -int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseContextLocal) -{ - int argv0len; - - ScanFromString(argv[0]); - - //Storing the Current Compiler Parse context into the cpp structure. - cpp->pC = (void*)&parseContextLocal; - - if (!argv || argc == 0) - return 1; - - for (int i = 0; i < argc; ++i) { - if (!argv[i]) { - parseContextLocal.error(0, "Null shader source string", "", ""); - parseContextLocal.recover(); - return 1; - } - } - - if (!strLen) { - argv0len = (int) strlen(argv[0]); - strLen = &argv0len; - } - yyrestart(0); - (&parseContextLocal)->AfterEOF = false; - cpp->PaWhichStr = 0; - cpp->PaArgv = argv; - cpp->PaArgc = argc; - cpp->PaStrLen = strLen; - cpp->pastFirstStatement = 0; - yylineno = 1; - - if (*cpp->PaStrLen >= 0) { - int ret = yyparse((void*)(&parseContextLocal)); - if (ret || cpp->CompileError == 1 || parseContextLocal.recoveredFromError || parseContextLocal.numErrors > 0) - return 1; - else - return 0; - } - else - return 0; -} - -void yyerror(const char *s) -{ - if (((TParseContext *)cpp->pC)->AfterEOF) { - if (cpp->tokensBeforeEOF == 1) { - GlobalParseContext->error(yylineno, "syntax error", "pre-mature EOF", s, ""); - GlobalParseContext->recover(); - } - } else { - GlobalParseContext->error(yylineno, "syntax error", yytext, s, ""); - GlobalParseContext->recover(); - } -} - -void PaReservedWord() -{ - GlobalParseContext->error(yylineno, "Reserved word.", yytext, "", ""); - GlobalParseContext->recover(); -} - -int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbol) -{ - symbol = parseContextLocal.symbolTable.find(id); - if (parseContextLocal.lexAfterType == false && symbol && symbol->isVariable()) { - TVariable* variable = static_cast(symbol); - if (variable->isUserType()) { - parseContextLocal.lexAfterType = true; - return TYPE_NAME; - } - } - - return IDENTIFIER; -} - -int PaParseComment(int &lineno, TParseContext& parseContextLocal) -{ - int transitionFlag = 0; - int nextChar; - - while (transitionFlag != 2) { - nextChar = yyinput(); - if (nextChar == '\n') - lineno++; - switch (nextChar) { - case '*' : - transitionFlag = 1; - break; - case '/' : /* if star is the previous character, then it is the end of comment */ - if (transitionFlag == 1) { - return 1 ; - } - break; - case EOF : - /* Raise error message here */ - parseContextLocal.error(yylineno, "End of shader found before end of comment.", "", "", ""); - GlobalParseContext->recover(); - return YY_NULL; - default : /* Any other character will be a part of the comment */ - transitionFlag = 0; - } - } - return 1; -} - -extern "C" { - -void CPPDebugLogMsg(const char *msg) -{ - ((TParseContext *)cpp->pC)->infoSink.debug.message(EPrefixNone, msg); -} - -void CPPWarningToInfoLog(const char *msg) -{ - ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg, yylineno); -} - -void CPPShInfoLogMsg(const char *msg) -{ - ((TParseContext *)cpp->pC)->error(yylineno,"", "",msg,""); - GlobalParseContext->recover(); -} - -void CPPErrorToInfoLog(char *msg) -{ - ((TParseContext *)cpp->pC)->error(yylineno,"syntax error", "",msg,""); - GlobalParseContext->recover(); -} - -void SetLineNumber(int line) -{ - yylineno &= ~SourceLocLineMask; - yylineno |= line; -} - -void SetStringNumber(int string) -{ - yylineno = (string << SourceLocStringShift) | (yylineno & SourceLocLineMask); -} - -int GetStringNumber(void) -{ - return yylineno >> 16; -} - -int GetLineNumber(void) -{ - return yylineno & SourceLocLineMask; -} - -void IncLineNumber(void) -{ - if ((yylineno & SourceLocLineMask) <= SourceLocLineMask) - ++yylineno; -} - -void DecLineNumber(void) -{ - if ((yylineno & SourceLocLineMask) > 0) - --yylineno; -} - -void HandlePragma(const char **tokens, int numTokens) -{ - if (!strcmp(tokens[0], "optimize")) { - if (numTokens != 4) { - CPPShInfoLogMsg("optimize pragma syntax is incorrect"); - return; - } - - if (strcmp(tokens[1], "(")) { - CPPShInfoLogMsg("\"(\" expected after 'optimize' keyword"); - return; - } - - if (!strcmp(tokens[2], "on")) - ((TParseContext *)cpp->pC)->contextPragma.optimize = true; - else if (!strcmp(tokens[2], "off")) - ((TParseContext *)cpp->pC)->contextPragma.optimize = false; - else { - CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'optimize' pragma"); - return; - } - - if (strcmp(tokens[3], ")")) { - CPPShInfoLogMsg("\")\" expected to end 'optimize' pragma"); - return; - } - } else if (!strcmp(tokens[0], "debug")) { - if (numTokens != 4) { - CPPShInfoLogMsg("debug pragma syntax is incorrect"); - return; - } - - if (strcmp(tokens[1], "(")) { - CPPShInfoLogMsg("\"(\" expected after 'debug' keyword"); - return; - } - - if (!strcmp(tokens[2], "on")) - ((TParseContext *)cpp->pC)->contextPragma.debug = true; - else if (!strcmp(tokens[2], "off")) - ((TParseContext *)cpp->pC)->contextPragma.debug = false; - else { - CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'debug' pragma"); - return; - } - - if (strcmp(tokens[3], ")")) { - CPPShInfoLogMsg("\")\" expected to end 'debug' pragma"); - return; - } - } else { - -#ifdef PRAGMA_TABLE - // - // implementation specific pragma - // use ((TParseContext *)cpp->pC)->contextPragma.pragmaTable to store the information about pragma - // For now, just ignore the pragma that the implementation cannot recognize - // An Example of one such implementation for a pragma that has a syntax like - // #pragma pragmaname(pragmavalue) - // This implementation stores the current pragmavalue against the pragma name in pragmaTable. - // - if (numTokens == 4 && !strcmp(tokens[1], "(") && !strcmp(tokens[3], ")")) { - TPragmaTable& pragmaTable = ((TParseContext *)cpp->pC)->contextPragma.pragmaTable; - TPragmaTable::iterator iter; - iter = pragmaTable.find(TString(tokens[0])); - if (iter != pragmaTable.end()) { - iter->second = tokens[2]; - } else { - pragmaTable[ tokens[0] ] = tokens[2]; - } - } else if (numTokens >= 2) { - TPragmaTable& pragmaTable = ((TParseContext *)cpp->pC)->contextPragma.pragmaTable; - TPragmaTable::iterator iter; - iter = pragmaTable.find(TString(tokens[0])); - if (iter != pragmaTable.end()) { - iter->second = tokens[1]; - } else { - pragmaTable[ tokens[0] ] = tokens[1]; - } - } -#endif // PRAGMA_TABLE - } -} - -void StoreStr(char *string) -{ - TString strSrc; - strSrc = TString(string); - - ((TParseContext *)cpp->pC)->HashErrMsg = ((TParseContext *)cpp->pC)->HashErrMsg + " " + strSrc; -} - -const char* GetStrfromTStr(void) -{ - cpp->ErrMsg = (((TParseContext *)cpp->pC)->HashErrMsg).c_str(); - return cpp->ErrMsg; -} - -void ResetTString(void) -{ - ((TParseContext *)cpp->pC)->HashErrMsg = ""; -} - -TBehavior GetBehavior(const char* behavior) -{ - if (!strcmp("require", behavior)) - return EBhRequire; - else if (!strcmp("enable", behavior)) - return EBhEnable; - else if (!strcmp("disable", behavior)) - return EBhDisable; - else if (!strcmp("warn", behavior)) - return EBhWarn; - else { - CPPShInfoLogMsg((TString("behavior '") + behavior + "' is not supported").c_str()); - return EBhDisable; - } -} - -void updateExtensionBehavior(const char* extName, const char* behavior) -{ - TBehavior behaviorVal = GetBehavior(behavior); - TMap:: iterator iter; - TString msg; - - // special cased for all extension - if (!strcmp(extName, "all")) { - if (behaviorVal == EBhRequire || behaviorVal == EBhEnable) { - CPPShInfoLogMsg("extension 'all' cannot have 'require' or 'enable' behavior"); - return; - } else { - for (iter = ((TParseContext *)cpp->pC)->extensionBehavior.begin(); iter != ((TParseContext *)cpp->pC)->extensionBehavior.end(); ++iter) - iter->second = behaviorVal; - } - } else { - iter = ((TParseContext *)cpp->pC)->extensionBehavior.find(TString(extName)); - if (iter == ((TParseContext *)cpp->pC)->extensionBehavior.end()) { - switch (behaviorVal) { - case EBhRequire: - CPPShInfoLogMsg((TString("extension '") + extName + "' is not supported").c_str()); - break; - case EBhEnable: - case EBhWarn: - case EBhDisable: - msg = TString("extension '") + extName + "' is not supported"; - ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno); - break; - } - return; - } else - iter->second = behaviorVal; - } -} - -} // extern "C" - -void setInitialState() -{ - yy_start = 1; -} - +/* A lexical scanner generated by flex */ + +/* Scanner skeleton version: + * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.85 95/04/24 10:48:47 vern Exp $ + */ + +#define FLEX_SCANNER +#define YY_FLEX_MAJOR_VERSION 2 +#define YY_FLEX_MINOR_VERSION 5 + +#include + + +/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ +#ifdef c_plusplus +#ifndef __cplusplus +#define __cplusplus +#endif +#endif + + +#ifdef __cplusplus + +#include + +/* Use prototypes in function declarations. */ +#define YY_USE_PROTOS + +/* The "const" storage-class-modifier is valid. */ +#define YY_USE_CONST + +#else /* ! __cplusplus */ + +#if __STDC__ + +#define YY_USE_PROTOS +#define YY_USE_CONST + +#endif /* __STDC__ */ +#endif /* ! __cplusplus */ + +#ifdef __TURBOC__ + #pragma warn -rch + #pragma warn -use +#include +#include +#define YY_USE_CONST +#define YY_USE_PROTOS +#endif + +#ifdef YY_USE_CONST +#define yyconst const +#else +#define yyconst +#endif + + +#ifdef YY_USE_PROTOS +#define YY_PROTO(proto) proto +#else +#define YY_PROTO(proto) () +#endif + +/* Returned upon end-of-file. */ +#define YY_NULL 0 + +/* Promotes a possibly negative, possibly signed char to an unsigned + * integer for use as an array index. If the signed char is negative, + * we want to instead treat it as an 8-bit unsigned char, hence the + * double cast. + */ +#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c) + +/* Enter a start condition. This macro really ought to take a parameter, + * but we do it the disgusting crufty way forced on us by the ()-less + * definition of BEGIN. + */ +#define BEGIN yy_start = 1 + 2 * + +/* Translate the current start state into a value that can be later handed + * to BEGIN to return to the state. The YYSTATE alias is for lex + * compatibility. + */ +#define YY_START ((yy_start - 1) / 2) +#define YYSTATE YY_START + +/* Action number for EOF rule of a given start state. */ +#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) + +/* Special action meaning "start processing a new file". */ +#define YY_NEW_FILE yyrestart( yyin ) + +#define YY_END_OF_BUFFER_CHAR 0 + +/* Size of default input buffer. */ +#define YY_BUF_SIZE 16384 + +typedef struct yy_buffer_state *YY_BUFFER_STATE; + +extern int yyleng; +extern FILE *yyin, *yyout; + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + +/* The funky do-while in the following #define is used to turn the definition + * int a single C statement (which needs a semi-colon terminator). This + * avoids problems with code like: + * + * if ( condition_holds ) + * yyless( 5 ); + * else + * do_something_else(); + * + * Prior to using the do-while the compiler would get upset at the + * "else" because it interpreted the "if" statement as being all + * done when it reached the ';' after the yyless() call. + */ + +/* Return all but the first 'n' matched characters back to the input stream. */ + +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + *yy_cp = yy_hold_char; \ + yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + YY_DO_BEFORE_ACTION; /* set up yytext again */ \ + } \ + while ( 0 ) + +#define unput(c) yyunput( c, yytext_ptr ) + +/* The following is because we cannot portably get our hands on size_t + * (without autoconf's help, which isn't available because we want + * flex-generated scanners to compile on their own). + */ +typedef unsigned int yy_size_t; + + +struct yy_buffer_state + { + FILE *yy_input_file; + + char *yy_ch_buf; /* input buffer */ + char *yy_buf_pos; /* current position in input buffer */ + + /* Size of input buffer in bytes, not including room for EOB + * characters. + */ + yy_size_t yy_buf_size; + + /* Number of characters read into yy_ch_buf, not including EOB + * characters. + */ + int yy_n_chars; + + /* Whether we "own" the buffer - i.e., we know we created it, + * and can realloc() it to grow it, and should free() it to + * delete it. + */ + int yy_is_our_buffer; + + /* Whether this is an "interactive" input source; if so, and + * if we're using stdio for input, then we want to use getc() + * instead of fread(), to make sure we stop fetching input after + * each newline. + */ + int yy_is_interactive; + + /* Whether we're considered to be at the beginning of a line. + * If so, '^' rules will be active on the next match, otherwise + * not. + */ + int yy_at_bol; + + /* Whether to try to fill the input buffer when we reach the + * end of it. + */ + int yy_fill_buffer; + + int yy_buffer_status; +#define YY_BUFFER_NEW 0 +#define YY_BUFFER_NORMAL 1 + /* When an EOF's been seen but there's still some text to process + * then we mark the buffer as YY_EOF_PENDING, to indicate that we + * shouldn't try reading from the input source any more. We might + * still have a bunch of tokens to match, though, because of + * possible backing-up. + * + * When we actually see the EOF, we change the status to "new" + * (via yyrestart()), so that the user can continue scanning by + * just pointing yyin at a new input file. + */ +#define YY_BUFFER_EOF_PENDING 2 + }; + +static YY_BUFFER_STATE yy_current_buffer = 0; + +/* We provide macros for accessing buffer states in case in the + * future we want to put the buffer states in a more general + * "scanner state". + */ +#define YY_CURRENT_BUFFER yy_current_buffer + + +/* yy_hold_char holds the character lost when yytext is formed. */ +static char yy_hold_char; + +static int yy_n_chars; /* number of characters read into yy_ch_buf */ + + +int yyleng; + +/* Points to current character in buffer. */ +static char *yy_c_buf_p = (char *) 0; +static int yy_init = 1; /* whether we need to initialize */ +static int yy_start = 0; /* start state number */ + +/* Flag which is used to allow yywrap()'s to do buffer switches + * instead of setting up a fresh yyin. A bit of a hack ... + */ +static int yy_did_buffer_switch_on_eof; + +void yyrestart YY_PROTO(( FILE *input_file )); + +void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); +void yy_load_buffer_state YY_PROTO(( void )); +YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); +void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); +void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); +void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); +#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) + +YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); +YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *str )); +YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); + +static void *yy_flex_alloc YY_PROTO(( yy_size_t )); +static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); +static void yy_flex_free YY_PROTO(( void * )); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! yy_current_buffer ) \ + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ + yy_current_buffer->yy_at_bol = at_bol; \ + } + +#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) + + +#define YY_USES_REJECT + +#define yywrap() 1 +#define YY_SKIP_YYWRAP +typedef unsigned char YY_CHAR; +FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; +typedef int yy_state_type; +extern int yylineno; +int yylineno = 1; +extern char *yytext; +#define yytext_ptr yytext + +static yy_state_type yy_get_previous_state YY_PROTO(( void )); +static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); +static int yy_get_next_buffer YY_PROTO(( void )); +static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yytext_ptr = yy_bp; \ + yyleng = (int) (yy_cp - yy_bp); \ + yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 142 +#define YY_END_OF_BUFFER 143 +static yyconst short int yy_acclist[581] = + { 0, + 143, 141, 142, 140, 141, 142, 140, 142, 125, 141, + 142, 131, 141, 142, 136, 141, 142, 120, 141, 142, + 121, 141, 142, 129, 141, 142, 128, 141, 142, 117, + 141, 142, 126, 141, 142, 124, 141, 142, 130, 141, + 142, 88, 141, 142, 88, 141, 142, 118, 141, 142, + 114, 141, 142, 132, 141, 142, 119, 141, 142, 133, + 141, 142, 137, 141, 142, 84, 141, 142, 122, 141, + 142, 123, 141, 142, 135, 141, 142, 84, 141, 142, + 84, 141, 142, 84, 141, 142, 84, 141, 142, 84, + 141, 142, 84, 141, 142, 84, 141, 142, 84, 141, + + 142, 84, 141, 142, 84, 141, 142, 84, 141, 142, + 84, 141, 142, 84, 141, 142, 84, 141, 142, 84, + 141, 142, 84, 141, 142, 84, 141, 142, 84, 141, + 142, 84, 141, 142, 84, 141, 142, 115, 141, 142, + 134, 141, 142, 116, 141, 142, 127, 141, 142, 139, + 141, 142, 142, 141, 142, 138, 141, 142, 111, 97, + 116, 105, 100, 95, 103, 93, 104, 94, 91, 92, + 96, 90, 86, 87, 88, 87, 88, 88, 123, 115, + 122, 112, 108, 110, 109, 113, 84, 101, 107, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 13, + + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 16, 84, 18, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 102, 106, 138, 1, 90, 89, + 85, 98, 99, 44, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 14, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 22, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 19, 84, 84, 84, 84, 84, 84, 84, + + 84, 84, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 91, 90, 84, 24, + 84, 84, 84, 81, 84, 84, 84, 84, 84, 84, + 84, 84, 17, 84, 47, 84, 84, 84, 84, 84, + 84, 52, 84, 66, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 63, 84, 5, 84, 29, 84, 30, + 84, 31, 84, 84, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 84, 84, 84, 84, 50, 84, + 25, 84, 84, 84, 84, 84, 84, 84, 32, 84, + 33, 84, 34, 84, 23, 84, 84, 84, 84, 11, + + 84, 38, 84, 39, 84, 40, 84, 45, 84, 8, + 84, 84, 84, 84, 84, 77, 84, 78, 84, 79, + 84, 84, 26, 84, 67, 84, 21, 84, 74, 84, + 75, 84, 76, 84, 3, 84, 71, 84, 72, 84, + 73, 84, 84, 20, 84, 69, 84, 84, 84, 35, + 84, 36, 84, 37, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 84, 64, 84, 84, 84, 84, 84, + 84, 84, 84, 46, 84, 84, 83, 84, 84, 84, + 15, 84, 84, 84, 84, 84, 65, 84, 60, 84, + 55, 84, 84, 84, 84, 84, 84, 70, 84, 51, + + 84, 84, 58, 84, 28, 84, 84, 80, 84, 59, + 84, 43, 84, 53, 84, 84, 84, 84, 84, 84, + 84, 84, 84, 54, 84, 27, 84, 84, 84, 84, + 4, 84, 84, 84, 84, 84, 84, 48, 84, 9, + 84, 84, 10, 84, 84, 84, 12, 84, 61, 84, + 84, 84, 84, 56, 84, 84, 84, 84, 49, 84, + 68, 84, 57, 84, 7, 84, 62, 84, 2, 84, + 82, 84, 6, 84, 41, 84, 84, 84, 42, 84 + } ; + +static yyconst short int yy_accept[408] = + { 0, + 1, 1, 1, 1, 1, 2, 4, 7, 9, 12, + 15, 18, 21, 24, 27, 30, 33, 36, 39, 42, + 45, 48, 51, 54, 57, 60, 63, 66, 69, 72, + 75, 78, 81, 84, 87, 90, 93, 96, 99, 102, + 105, 108, 111, 114, 117, 120, 123, 126, 129, 132, + 135, 138, 141, 144, 147, 150, 153, 154, 156, 159, + 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, + 170, 171, 171, 172, 173, 176, 178, 178, 178, 179, + 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, + 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, + + 200, 202, 203, 204, 205, 206, 207, 208, 209, 210, + 211, 212, 213, 214, 215, 217, 219, 220, 221, 222, + 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, + 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, + 243, 244, 245, 246, 247, 248, 248, 248, 249, 250, + 250, 250, 251, 252, 253, 254, 256, 257, 258, 259, + 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, + 270, 271, 272, 273, 275, 276, 277, 278, 279, 280, + 281, 282, 283, 285, 286, 287, 288, 289, 290, 291, + 292, 293, 295, 296, 297, 298, 299, 300, 301, 302, + + 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, + 313, 314, 315, 316, 317, 317, 318, 318, 319, 320, + 322, 323, 324, 326, 327, 328, 329, 330, 331, 332, + 333, 335, 337, 338, 339, 340, 341, 342, 344, 346, + 347, 348, 349, 350, 351, 352, 353, 354, 356, 358, + 360, 362, 364, 365, 366, 367, 368, 369, 370, 371, + 372, 373, 374, 375, 376, 377, 378, 379, 381, 383, + 384, 385, 386, 387, 388, 389, 391, 393, 395, 397, + 398, 399, 400, 402, 404, 406, 408, 410, 412, 413, + 414, 415, 416, 418, 420, 422, 423, 425, 427, 429, + + 431, 433, 435, 437, 439, 441, 443, 444, 446, 448, + 449, 450, 452, 454, 456, 457, 458, 459, 460, 461, + 462, 463, 464, 465, 467, 468, 469, 470, 471, 472, + 473, 474, 476, 477, 479, 480, 481, 483, 484, 485, + 486, 487, 489, 491, 493, 494, 495, 496, 497, 498, + 500, 502, 503, 505, 507, 508, 510, 512, 514, 516, + 517, 518, 519, 520, 521, 522, 523, 524, 526, 528, + 529, 530, 531, 533, 534, 535, 536, 537, 538, 540, + 542, 543, 545, 546, 547, 549, 551, 552, 553, 554, + 556, 557, 558, 559, 561, 563, 565, 567, 569, 571, + + 573, 575, 577, 578, 579, 581, 581 + } ; + +static yyconst int yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 2, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 1, 1, 1, 5, 6, 1, 7, + 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 16, 16, 16, 20, 20, 21, 22, 23, + 24, 25, 26, 1, 27, 27, 28, 29, 30, 27, + 31, 31, 31, 31, 31, 31, 31, 31, 31, 31, + 31, 31, 31, 31, 31, 31, 31, 32, 31, 31, + 33, 1, 34, 35, 31, 1, 36, 37, 38, 39, + + 40, 41, 42, 43, 44, 31, 45, 46, 47, 48, + 49, 50, 31, 51, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 61, 62, 63, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1 + } ; + +static yyconst int yy_meta[64] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, + 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 1, 1, 1, 2, 2, 2, 2, 2, + 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, + 1, 1, 1 + } ; + +static yyconst short int yy_base[411] = + { 0, + 0, 0, 63, 0, 600, 601, 601, 601, 575, 103, + 123, 601, 601, 574, 120, 601, 119, 117, 131, 143, + 151, 572, 601, 169, 572, 114, 601, 0, 601, 601, + 117, 96, 102, 136, 140, 130, 150, 546, 110, 156, + 545, 162, 152, 539, 167, 552, 170, 169, 167, 188, + 548, 601, 118, 601, 601, 601, 601, 576, 0, 601, + 601, 601, 601, 601, 601, 601, 601, 601, 601, 214, + 601, 586, 601, 223, 232, 251, 267, 0, 277, 601, + 601, 601, 564, 601, 601, 601, 563, 0, 601, 601, + 539, 532, 535, 543, 542, 529, 544, 531, 537, 525, + + 522, 535, 522, 519, 519, 525, 513, 520, 517, 527, + 513, 519, 522, 523, 0, 253, 522, 160, 508, 521, + 512, 514, 504, 518, 515, 517, 500, 505, 502, 491, + 171, 505, 501, 503, 492, 495, 173, 500, 492, 504, + 211, 497, 601, 601, 0, 303, 537, 601, 309, 325, + 335, 341, 0, 601, 601, 0, 488, 492, 501, 498, + 482, 482, 183, 497, 494, 494, 492, 489, 481, 487, + 474, 485, 488, 0, 485, 473, 480, 477, 481, 474, + 463, 462, 475, 478, 475, 470, 461, 241, 466, 469, + 460, 457, 461, 467, 458, 449, 452, 450, 460, 446, + + 444, 444, 446, 443, 454, 453, 224, 448, 443, 432, + 257, 450, 452, 441, 347, 353, 359, 365, 442, 0, + 440, 292, 0, 432, 430, 438, 427, 444, 433, 313, + 0, 0, 427, 437, 437, 422, 329, 0, 0, 424, + 369, 425, 419, 418, 419, 418, 372, 0, 0, 0, + 0, 0, 414, 415, 420, 411, 424, 419, 418, 410, + 414, 406, 409, 413, 418, 417, 408, 0, 0, 414, + 403, 403, 408, 407, 404, 0, 0, 0, 0, 394, + 406, 408, 0, 0, 0, 0, 0, 0, 396, 397, + 391, 401, 0, 0, 0, 392, 0, 0, 0, 0, + + 0, 0, 0, 0, 0, 0, 399, 0, 0, 397, + 393, 0, 0, 0, 389, 385, 390, 380, 393, 379, + 392, 381, 388, 0, 386, 388, 372, 381, 387, 382, + 370, 0, 372, 0, 371, 374, 0, 363, 362, 362, + 375, 0, 377, 0, 376, 375, 360, 373, 360, 0, + 0, 363, 0, 0, 355, 0, 0, 0, 0, 352, + 363, 356, 362, 359, 354, 346, 298, 0, 0, 290, + 296, 285, 0, 278, 274, 263, 261, 265, 0, 0, + 265, 0, 261, 260, 0, 0, 258, 235, 240, 0, + 213, 227, 192, 0, 0, 0, 0, 0, 0, 0, + + 0, 0, 173, 137, 0, 601, 390, 392, 395, 148 + } ; + +static yyconst short int yy_def[411] = + { 0, + 406, 1, 406, 3, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 407, 406, 406, + 406, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 406, 406, 406, 406, 406, 406, 406, 408, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 409, 406, 406, 406, 406, 406, 410, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 407, 406, 406, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 406, 406, 408, 406, 409, 406, 406, 406, + 406, 406, 410, 406, 406, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 406, 406, 406, 406, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, + + 407, 407, 407, 407, 407, 0, 406, 406, 406, 406 + } ; + +static yyconst short int yy_nxt[665] = + { 0, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 21, 21, 21, 21, + 22, 23, 24, 25, 26, 27, 28, 28, 28, 28, + 28, 28, 29, 30, 31, 32, 33, 34, 35, 36, + 37, 38, 39, 40, 28, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 28, 28, 28, 52, + 53, 54, 55, 6, 56, 57, 6, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 58, 6, 6, 6, + 6, 6, 6, 6, 6, 6, 6, 6, 6, 59, + 59, 59, 59, 59, 59, 6, 6, 6, 59, 59, + + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, + 59, 59, 6, 6, 6, 6, 61, 62, 63, 66, + 68, 70, 70, 70, 70, 70, 70, 86, 87, 71, + 89, 143, 69, 67, 72, 112, 64, 91, 92, 153, + 93, 90, 94, 113, 73, 74, 95, 75, 75, 75, + 75, 75, 76, 74, 114, 79, 79, 79, 79, 79, + 79, 96, 77, 81, 78, 103, 405, 104, 144, 99, + 77, 97, 77, 100, 98, 106, 105, 121, 101, 82, + 77, 83, 84, 107, 102, 108, 115, 119, 109, 78, + + 122, 120, 124, 116, 110, 128, 200, 186, 133, 404, + 117, 134, 129, 130, 137, 187, 207, 125, 138, 135, + 126, 201, 131, 139, 208, 132, 136, 140, 70, 70, + 70, 70, 70, 70, 225, 226, 141, 149, 149, 149, + 149, 149, 149, 146, 74, 403, 75, 75, 75, 75, + 75, 76, 150, 146, 212, 402, 213, 250, 251, 252, + 401, 77, 150, 74, 271, 76, 76, 76, 76, 76, + 76, 77, 272, 276, 277, 278, 151, 392, 151, 400, + 77, 152, 152, 152, 152, 152, 152, 399, 393, 74, + 77, 79, 79, 79, 79, 79, 79, 398, 180, 397, + + 396, 181, 182, 395, 394, 183, 77, 184, 284, 285, + 286, 391, 215, 390, 215, 389, 77, 216, 216, 216, + 216, 216, 216, 149, 149, 149, 149, 149, 149, 293, + 294, 295, 388, 387, 217, 386, 217, 385, 150, 218, + 218, 218, 218, 218, 218, 300, 301, 302, 150, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 216, 216, 216, 216, 216, 216, 216, 216, 216, + 216, 216, 216, 218, 218, 218, 218, 218, 218, 218, + 218, 218, 218, 218, 218, 304, 305, 306, 312, 313, + 314, 88, 88, 145, 145, 147, 147, 147, 384, 383, + + 382, 381, 380, 379, 378, 377, 376, 375, 374, 373, + 372, 371, 370, 369, 368, 367, 366, 365, 364, 363, + 362, 361, 360, 359, 358, 357, 356, 355, 354, 353, + 352, 351, 350, 349, 348, 347, 346, 345, 344, 343, + 342, 341, 340, 339, 338, 337, 336, 335, 334, 333, + 332, 331, 330, 329, 328, 327, 326, 325, 324, 323, + 322, 321, 320, 319, 318, 317, 316, 315, 311, 310, + 309, 308, 307, 303, 299, 298, 297, 296, 292, 291, + 290, 289, 288, 287, 283, 282, 281, 280, 279, 275, + 274, 273, 270, 269, 268, 267, 266, 265, 264, 263, + + 262, 261, 260, 259, 258, 257, 256, 255, 254, 253, + 249, 248, 247, 246, 245, 244, 243, 242, 241, 240, + 239, 238, 237, 236, 235, 234, 233, 232, 231, 230, + 229, 228, 227, 224, 223, 222, 221, 220, 219, 148, + 214, 211, 210, 209, 206, 205, 204, 203, 202, 199, + 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, + 188, 185, 179, 178, 177, 176, 175, 174, 173, 172, + 171, 170, 169, 168, 167, 166, 165, 164, 163, 162, + 161, 160, 159, 158, 157, 156, 155, 154, 148, 72, + 142, 127, 123, 118, 111, 85, 80, 65, 60, 406, + + 5, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406 + } ; + +static yyconst short int yy_chk[665] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 3, 3, 3, 3, 3, 3, 10, 10, 11, 15, + 17, 18, 18, 18, 18, 18, 18, 26, 26, 19, + 31, 53, 17, 15, 19, 39, 11, 32, 32, 410, + 33, 31, 33, 39, 19, 20, 33, 20, 20, 20, + 20, 20, 20, 21, 39, 21, 21, 21, 21, 21, + 21, 34, 20, 24, 20, 36, 404, 36, 53, 35, + 21, 34, 20, 35, 34, 37, 36, 43, 35, 24, + 21, 24, 24, 37, 35, 37, 40, 42, 37, 20, + + 43, 42, 45, 40, 37, 47, 131, 118, 48, 403, + 40, 48, 47, 47, 49, 118, 137, 45, 49, 48, + 45, 131, 47, 50, 137, 47, 48, 50, 70, 70, + 70, 70, 70, 70, 163, 163, 50, 74, 74, 74, + 74, 74, 74, 70, 75, 393, 75, 75, 75, 75, + 75, 75, 74, 70, 141, 392, 141, 188, 188, 188, + 391, 75, 74, 76, 207, 76, 76, 76, 76, 76, + 76, 75, 207, 211, 211, 211, 77, 377, 77, 389, + 76, 77, 77, 77, 77, 77, 77, 388, 377, 79, + 76, 79, 79, 79, 79, 79, 79, 387, 116, 384, + + 383, 116, 116, 381, 378, 116, 79, 116, 222, 222, + 222, 376, 146, 375, 146, 374, 79, 146, 146, 146, + 146, 146, 146, 149, 149, 149, 149, 149, 149, 230, + 230, 230, 372, 371, 150, 370, 150, 367, 149, 150, + 150, 150, 150, 150, 150, 237, 237, 237, 149, 151, + 151, 151, 151, 151, 151, 152, 152, 152, 152, 152, + 152, 215, 215, 215, 215, 215, 215, 216, 216, 216, + 216, 216, 216, 217, 217, 217, 217, 217, 217, 218, + 218, 218, 218, 218, 218, 241, 241, 241, 247, 247, + 247, 407, 407, 408, 408, 409, 409, 409, 366, 365, + + 364, 363, 362, 361, 360, 355, 352, 349, 348, 347, + 346, 345, 343, 341, 340, 339, 338, 336, 335, 333, + 331, 330, 329, 328, 327, 326, 325, 323, 322, 321, + 320, 319, 318, 317, 316, 315, 311, 310, 307, 296, + 292, 291, 290, 289, 282, 281, 280, 275, 274, 273, + 272, 271, 270, 267, 266, 265, 264, 263, 262, 261, + 260, 259, 258, 257, 256, 255, 254, 253, 246, 245, + 244, 243, 242, 240, 236, 235, 234, 233, 229, 228, + 227, 226, 225, 224, 221, 219, 214, 213, 212, 210, + 209, 208, 206, 205, 204, 203, 202, 201, 200, 199, + + 198, 197, 196, 195, 194, 193, 192, 191, 190, 189, + 187, 186, 185, 184, 183, 182, 181, 180, 179, 178, + 177, 176, 175, 173, 172, 171, 170, 169, 168, 167, + 166, 165, 164, 162, 161, 160, 159, 158, 157, 147, + 142, 140, 139, 138, 136, 135, 134, 133, 132, 130, + 129, 128, 127, 126, 125, 124, 123, 122, 121, 120, + 119, 117, 114, 113, 112, 111, 110, 109, 108, 107, + 106, 105, 104, 103, 102, 101, 100, 99, 98, 97, + 96, 95, 94, 93, 92, 91, 87, 83, 72, 58, + 51, 46, 44, 41, 38, 25, 22, 14, 9, 5, + + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406, 406, 406, 406, 406, 406, 406, + 406, 406, 406, 406 + } ; + +static yy_state_type yy_state_buf[YY_BUF_SIZE + 2], *yy_state_ptr; +static char *yy_full_match; +static int yy_lp; +#define REJECT \ +{ \ +*yy_cp = yy_hold_char; /* undo effects of setting up yytext */ \ +yy_cp = yy_full_match; /* restore poss. backed-over text */ \ +++yy_lp; \ +goto find_rule; \ +} +#define yymore() yymore_used_but_not_detected +#define YY_MORE_ADJ 0 +char *yytext; +#define INITIAL 0 +/* +// +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +*/ +/* Based on +ANSI C grammar, Lex specification + +In 1985, Jeff Lee published this Lex specification together with a Yacc +grammar for the April 30, 1985 ANSI C draft. Tom Stockfisch reposted +both to net.sources in 1987; that original, as mentioned in the answer +to question 17.25 of the comp.lang.c FAQ, can be ftp'ed from ftp.uu.net, +file usenet/net.sources/ansi.c.grammar.Z. + +I intend to keep this version as close to the current C Standard grammar +as possible; please let me know if you discover discrepancies. + +Jutta Degener, 1995 +*/ +#define YY_NO_UNPUT 1 +#include +#include + +#include "compiler/ParseHelper.h" +#include "glslang_tab.h" + +/* windows only pragma */ +#ifdef _MSC_VER +#pragma warning(disable : 4102) +#endif + +int yy_input(char* buf, int max_size); + +extern int yyparse(void*); +#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal) +#define parseContext (*((TParseContext*)(parseContextLocal))) + +#define YY_INPUT(buf,result,max_size) (result = yy_input(buf, max_size)) + +/* +TODO(alokp): yylineno is only here to support old flex.exe in compiler/tools. +Remove it when we can exclusively use the newer version. +*/ +#define YY_NEVER_INTERACTIVE 1 +#define FIELDS 1 + + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap YY_PROTO(( void )); +#else +extern int yywrap YY_PROTO(( void )); +#endif +#endif + +#ifndef YY_NO_UNPUT +static void yyunput YY_PROTO(( int c, char *buf_ptr )); +#endif + +#ifndef yytext_ptr +static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +#endif + +#ifndef YY_NO_INPUT +#ifdef __cplusplus +static int yyinput YY_PROTO(( void )); +#else +static int input YY_PROTO(( void )); +#endif +#endif + +#if YY_STACK_USED +static int yy_start_stack_ptr = 0; +static int yy_start_stack_depth = 0; +static int *yy_start_stack = 0; +#ifndef YY_NO_PUSH_STATE +static void yy_push_state YY_PROTO(( int new_state )); +#endif +#ifndef YY_NO_POP_STATE +static void yy_pop_state YY_PROTO(( void )); +#endif +#ifndef YY_NO_TOP_STATE +static int yy_top_state YY_PROTO(( void )); +#endif + +#else +#define YY_NO_PUSH_STATE 1 +#define YY_NO_POP_STATE 1 +#define YY_NO_TOP_STATE 1 +#endif + +#ifdef YY_MALLOC_DECL +YY_MALLOC_DECL +#else +#if __STDC__ +#ifndef __cplusplus +#include +#endif +#else +/* Just try to get by without declaring the routines. This will fail + * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) + * or sizeof(void*) != sizeof(int). + */ +#endif +#endif + +/* Amount of stuff to slurp up with each read. */ +#ifndef YY_READ_BUF_SIZE +#define YY_READ_BUF_SIZE 8192 +#endif + +/* Copy whatever the last rule matched to the standard output. */ + +#ifndef ECHO +/* This used to be an fputs(), but since the string might contain NUL's, + * we now use fwrite(). + */ +#define ECHO (void) fwrite( yytext, yyleng, 1, yyout ) +#endif + +/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL, + * is returned in "result". + */ +#ifndef YY_INPUT +#define YY_INPUT(buf,result,max_size) \ + if ( yy_current_buffer->yy_is_interactive ) \ + { \ + int c = '*', n; \ + for ( n = 0; n < max_size && \ + (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ + buf[n] = (char) c; \ + if ( c == '\n' ) \ + buf[n++] = (char) c; \ + if ( c == EOF && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + result = n; \ + } \ + else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ + && ferror( yyin ) ) \ + YY_FATAL_ERROR( "input in flex scanner failed" ); +#endif + +/* No semi-colon after return; correct usage is to write "yyterminate();" - + * we don't want an extra ';' after the "return" because that will cause + * some compilers to complain about unreachable statements. + */ +#ifndef yyterminate +#define yyterminate() return YY_NULL +#endif + +/* Number of entries by which start-condition stack grows. */ +#ifndef YY_START_STACK_INCR +#define YY_START_STACK_INCR 25 +#endif + +/* Report a fatal error. */ +#ifndef YY_FATAL_ERROR +#define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) +#endif + +/* Default declaration of generated scanner - a define so the user can + * easily add parameters. + */ +#ifndef YY_DECL +#define YY_DECL int yylex YY_PROTO(( void )) +#endif + +/* Code executed at the beginning of each rule, after yytext and yyleng + * have been set up. + */ +#ifndef YY_USER_ACTION +#define YY_USER_ACTION +#endif + +/* Code executed at the end of each rule. */ +#ifndef YY_BREAK +#define YY_BREAK break; +#endif + +#define YY_RULE_SETUP \ + YY_USER_ACTION + +YY_DECL + { + register yy_state_type yy_current_state; + register char *yy_cp, *yy_bp; + register int yy_act; + + + + if ( yy_init ) + { + yy_init = 0; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yy_start ) + yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! yy_current_buffer ) + yy_current_buffer = + yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_load_buffer_state(); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yy_hold_char; + + /* yy_bp points to the position in yy_ch_buf of the start of + * the current run. + */ + yy_bp = yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 407 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + ++yy_cp; + } + while ( yy_base[yy_current_state] != 601 ); + +yy_find_action: + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; +find_rule: /* we branch to this label when backing up */ + for ( ; ; ) /* until we find what rule we matched */ + { + if ( yy_lp && yy_lp < yy_accept[yy_current_state + 1] ) + { + yy_act = yy_acclist[yy_lp]; + { + yy_full_match = yy_cp; + break; + } + } + --yy_cp; + yy_current_state = *--yy_state_ptr; + yy_lp = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + + if ( yy_act != YY_END_OF_BUFFER ) + { + int yyl; + for ( yyl = 0; yyl < yyleng; ++yyl ) + if ( yytext[yyl] == '\n' ) + ++yylineno; + } + +do_action: /* This label is used only to access EOF actions. */ + + + switch ( yy_act ) + { /* beginning of action switch */ +case 1: +YY_RULE_SETUP +{ /* ?? carriage and/or line-feed? */ }; + YY_BREAK +case 2: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(INVARIANT); } + YY_BREAK +case 3: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(HIGH_PRECISION); } + YY_BREAK +case 4: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(MEDIUM_PRECISION); } + YY_BREAK +case 5: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(LOW_PRECISION); } + YY_BREAK +case 6: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(PRECISION); } + YY_BREAK +case 7: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(ATTRIBUTE); } + YY_BREAK +case 8: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(CONST_QUAL); } + YY_BREAK +case 9: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(UNIFORM); } + YY_BREAK +case 10: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(VARYING); } + YY_BREAK +case 11: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(BREAK); } + YY_BREAK +case 12: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(CONTINUE); } + YY_BREAK +case 13: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(DO); } + YY_BREAK +case 14: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(FOR); } + YY_BREAK +case 15: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(WHILE); } + YY_BREAK +case 16: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(IF); } + YY_BREAK +case 17: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(ELSE); } + YY_BREAK +case 18: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(IN_QUAL); } + YY_BREAK +case 19: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(OUT_QUAL); } + YY_BREAK +case 20: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(INOUT_QUAL); } + YY_BREAK +case 21: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(FLOAT_TYPE); } + YY_BREAK +case 22: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(INT_TYPE); } + YY_BREAK +case 23: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(VOID_TYPE); } + YY_BREAK +case 24: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(BOOL_TYPE); } + YY_BREAK +case 25: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.b = true; return(BOOLCONSTANT); } + YY_BREAK +case 26: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.b = false; return(BOOLCONSTANT); } + YY_BREAK +case 27: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(DISCARD); } + YY_BREAK +case 28: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(RETURN); } + YY_BREAK +case 29: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX2); } + YY_BREAK +case 30: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX3); } + YY_BREAK +case 31: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(MATRIX4); } + YY_BREAK +case 32: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC2); } + YY_BREAK +case 33: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC3); } + YY_BREAK +case 34: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (VEC4); } + YY_BREAK +case 35: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC2); } + YY_BREAK +case 36: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC3); } + YY_BREAK +case 37: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (IVEC4); } + YY_BREAK +case 38: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC2); } + YY_BREAK +case 39: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC3); } + YY_BREAK +case 40: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return (BVEC4); } + YY_BREAK +case 41: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLER2D; } + YY_BREAK +case 42: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return SAMPLERCUBE; } + YY_BREAK +case 43: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = true; return(STRUCT); } + YY_BREAK +case 44: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 45: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 46: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 47: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 48: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 49: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 50: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 51: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 52: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 53: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 54: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 55: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 56: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 57: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 58: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 59: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 60: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 61: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 62: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 63: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 64: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 65: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 66: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 67: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 68: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 69: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 70: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 71: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 72: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 73: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 74: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 75: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 76: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 77: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 78: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 79: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 80: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 81: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 82: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 83: +YY_RULE_SETUP +{ PaReservedWord(); return 0; } + YY_BREAK +case 84: +YY_RULE_SETUP +{ + pyylval->lex.line = yylineno; + pyylval->lex.string = NewPoolTString(yytext); + return PaIdentOrType(*pyylval->lex.string, parseContext, pyylval->lex.symbol); +} + YY_BREAK +case 85: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); } + YY_BREAK +case 86: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); } + YY_BREAK +case 87: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.error(yylineno, "Invalid Octal number.", yytext, "", ""); parseContext.recover(); return 0;} + YY_BREAK +case 88: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); } + YY_BREAK +case 89: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast(atof(yytext)); return(FLOATCONSTANT); } + YY_BREAK +case 90: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast(atof(yytext)); return(FLOATCONSTANT); } + YY_BREAK +case 91: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; pyylval->lex.f = static_cast(atof(yytext)); return(FLOATCONSTANT); } + YY_BREAK +case 92: +YY_RULE_SETUP +{ int ret = PaParseComment(pyylval->lex.line, parseContext); if (!ret) return ret; } + YY_BREAK +case 93: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(ADD_ASSIGN); } + YY_BREAK +case 94: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(SUB_ASSIGN); } + YY_BREAK +case 95: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(MUL_ASSIGN); } + YY_BREAK +case 96: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(DIV_ASSIGN); } + YY_BREAK +case 97: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(MOD_ASSIGN); } + YY_BREAK +case 98: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(LEFT_ASSIGN); } + YY_BREAK +case 99: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(RIGHT_ASSIGN); } + YY_BREAK +case 100: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(AND_ASSIGN); } + YY_BREAK +case 101: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(XOR_ASSIGN); } + YY_BREAK +case 102: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(OR_ASSIGN); } + YY_BREAK +case 103: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(INC_OP); } + YY_BREAK +case 104: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(DEC_OP); } + YY_BREAK +case 105: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(AND_OP); } + YY_BREAK +case 106: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(OR_OP); } + YY_BREAK +case 107: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(XOR_OP); } + YY_BREAK +case 108: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(LE_OP); } + YY_BREAK +case 109: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(GE_OP); } + YY_BREAK +case 110: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(EQ_OP); } + YY_BREAK +case 111: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(NE_OP); } + YY_BREAK +case 112: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(LEFT_OP); } + YY_BREAK +case 113: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(RIGHT_OP); } + YY_BREAK +case 114: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(SEMICOLON); } + YY_BREAK +case 115: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(LEFT_BRACE); } + YY_BREAK +case 116: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(RIGHT_BRACE); } + YY_BREAK +case 117: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; if (parseContext.inTypeParen) parseContext.lexAfterType = false; return(COMMA); } + YY_BREAK +case 118: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(COLON); } + YY_BREAK +case 119: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; return(EQUAL); } + YY_BREAK +case 120: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.lexAfterType = false; parseContext.inTypeParen = true; return(LEFT_PAREN); } + YY_BREAK +case 121: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; parseContext.inTypeParen = false; return(RIGHT_PAREN); } + YY_BREAK +case 122: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(LEFT_BRACKET); } + YY_BREAK +case 123: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(RIGHT_BRACKET); } + YY_BREAK +case 124: +YY_RULE_SETUP +{ BEGIN(FIELDS); return(DOT); } + YY_BREAK +case 125: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(BANG); } + YY_BREAK +case 126: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(DASH); } + YY_BREAK +case 127: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(TILDE); } + YY_BREAK +case 128: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(PLUS); } + YY_BREAK +case 129: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(STAR); } + YY_BREAK +case 130: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(SLASH); } + YY_BREAK +case 131: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(PERCENT); } + YY_BREAK +case 132: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(LEFT_ANGLE); } + YY_BREAK +case 133: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(RIGHT_ANGLE); } + YY_BREAK +case 134: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(VERTICAL_BAR); } + YY_BREAK +case 135: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(CARET); } + YY_BREAK +case 136: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(AMPERSAND); } + YY_BREAK +case 137: +YY_RULE_SETUP +{ pyylval->lex.line = yylineno; return(QUESTION); } + YY_BREAK +case 138: +YY_RULE_SETUP +{ +BEGIN(INITIAL); + pyylval->lex.line = yylineno; + pyylval->lex.string = NewPoolTString(yytext); + return FIELD_SELECTION; } + YY_BREAK +case 139: +YY_RULE_SETUP +{} + YY_BREAK +case 140: +YY_RULE_SETUP +{ } + YY_BREAK +case YY_STATE_EOF(INITIAL): +case YY_STATE_EOF(FIELDS): +{ (&parseContext)->AfterEOF = true; yy_delete_buffer(YY_CURRENT_BUFFER); yyterminate();} + YY_BREAK +case 141: +YY_RULE_SETUP +{ parseContext.infoSink.info << "FLEX: Unknown char " << yytext << "\n"; + return 0; } + YY_BREAK +case 142: +YY_RULE_SETUP +ECHO; + YY_BREAK + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yy_hold_char; + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + { + /* We're scanning a new file or input source. It's + * possible that this happened because the user + * just pointed yyin at a new source and called + * yylex(). If so, then we have to assure + * consistency between yy_current_buffer and our + * globals. Here is the right place to do so, because + * this is the first action (other than possibly a + * back-up) that will match for the new input source. + */ + yy_n_chars = yy_current_buffer->yy_n_chars; + yy_current_buffer->yy_input_file = yyin; + yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + } + + /* Note that here we test for yy_c_buf_p "<=" to the position + * of the first EOB in the buffer, since yy_c_buf_p will + * already have been incremented past the NUL character + * (since all states make transitions on EOB to the + * end-of-buffer state). Contrast this with the test + * in input(). + */ + if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + /* Okay, we're now positioned to make the NUL + * transition. We couldn't have + * yy_get_previous_state() go ahead and do it + * for us because it doesn't know how to deal + * with the possibility of jamming (and we don't + * want to build jamming into it because then it + * will run more slowly). + */ + + yy_next_state = yy_try_NUL_trans( yy_current_state ); + + yy_bp = yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + yy_did_buffer_switch_on_eof = 0; + + if ( yywrap() ) + { + /* Note: because we've taken care in + * yy_get_next_buffer() to have set up + * yytext, we can now set up + * yy_c_buf_p so that if some total + * hoser (like flex itself) wants to + * call the scanner after we return the + * YY_NULL, it'll still work - another + * YY_NULL will get returned. + */ + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = + yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yy_c_buf_p = + &yy_current_buffer->yy_ch_buf[yy_n_chars]; + + yy_current_state = yy_get_previous_state(); + + yy_cp = yy_c_buf_p; + yy_bp = yytext_ptr + YY_MORE_ADJ; + goto yy_find_action; + } + break; + } + + default: + YY_FATAL_ERROR( + "fatal flex scanner internal error--no action found" ); + } /* end of action switch */ + } /* end of scanning one token */ + } /* end of yylex */ + + +/* yy_get_next_buffer - try to read in a new buffer + * + * Returns a code representing an action: + * EOB_ACT_LAST_MATCH - + * EOB_ACT_CONTINUE_SCAN - continue scanning from current position + * EOB_ACT_END_OF_FILE - end of file + */ + +static int yy_get_next_buffer() + { + register char *dest = yy_current_buffer->yy_ch_buf; + register char *source = yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + YY_FATAL_ERROR( + "fatal flex scanner internal error--end of buffer missed" ); + + if ( yy_current_buffer->yy_fill_buffer == 0 ) + { /* Don't try to fill the buffer, so this is an EOF. */ + if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + { + /* We matched a singled characater, the EOB, so + * treat this as a final EOF. + */ + return EOB_ACT_END_OF_FILE; + } + + else + { + /* We matched some text prior to the EOB, first + * process it. + */ + return EOB_ACT_LAST_MATCH; + } + } + + /* Try to read more data. */ + + /* First move last chars to start of buffer. */ + number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + + for ( i = 0; i < number_to_move; ++i ) + *(dest++) = *(source++); + + if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + /* don't do the read, it's not guaranteed to return an EOF, + * just force an EOF + */ + yy_n_chars = 0; + + else + { + int num_to_read = + yy_current_buffer->yy_buf_size - number_to_move - 1; + + while ( num_to_read <= 0 ) + { /* Not enough room in the buffer - grow it. */ +#ifdef YY_USES_REJECT + YY_FATAL_ERROR( +"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); +#else + + /* just a shorter name for the current buffer */ + YY_BUFFER_STATE b = yy_current_buffer; + + int yy_c_buf_p_offset = + (int) (yy_c_buf_p - b->yy_ch_buf); + + if ( b->yy_is_our_buffer ) + { + int new_size = b->yy_buf_size * 2; + + if ( new_size <= 0 ) + b->yy_buf_size += b->yy_buf_size / 8; + else + b->yy_buf_size *= 2; + + b->yy_ch_buf = (char *) + /* Include room in for 2 EOB chars. */ + yy_flex_realloc( (void *) b->yy_ch_buf, + b->yy_buf_size + 2 ); + } + else + /* Can't grow it, we don't own it. */ + b->yy_ch_buf = 0; + + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( + "fatal error - scanner input buffer overflow" ); + + yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + + num_to_read = yy_current_buffer->yy_buf_size - + number_to_move - 1; +#endif + } + + if ( num_to_read > YY_READ_BUF_SIZE ) + num_to_read = YY_READ_BUF_SIZE; + + /* Read in more data. */ + YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), + yy_n_chars, num_to_read ); + } + + if ( yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart( yyin ); + } + + else + { + ret_val = EOB_ACT_LAST_MATCH; + yy_current_buffer->yy_buffer_status = + YY_BUFFER_EOF_PENDING; + } + } + + else + ret_val = EOB_ACT_CONTINUE_SCAN; + + yy_n_chars += number_to_move; + yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; + yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + + return ret_val; + } + + +/* yy_get_previous_state - get the state just before the EOB char was reached */ + +static yy_state_type yy_get_previous_state() + { + register yy_state_type yy_current_state; + register char *yy_cp; + + yy_current_state = yy_start; + yy_state_ptr = yy_state_buf; + *yy_state_ptr++ = yy_current_state; + + for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 407 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + } + + return yy_current_state; + } + + +/* yy_try_NUL_trans - try to make a transition on the NUL character + * + * synopsis + * next_state = yy_try_NUL_trans( current_state ); + */ + +#ifdef YY_USE_PROTOS +static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) +#else +static yy_state_type yy_try_NUL_trans( yy_current_state ) +yy_state_type yy_current_state; +#endif + { + register int yy_is_jam; + + register YY_CHAR yy_c = 1; + while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) + { + yy_current_state = (int) yy_def[yy_current_state]; + if ( yy_current_state >= 407 ) + yy_c = yy_meta[(unsigned int) yy_c]; + } + yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; + *yy_state_ptr++ = yy_current_state; + yy_is_jam = (yy_current_state == 406); + + return yy_is_jam ? 0 : yy_current_state; + } + + +#ifndef YY_NO_UNPUT +#ifdef YY_USE_PROTOS +static void yyunput( int c, register char *yy_bp ) +#else +static void yyunput( c, yy_bp ) +int c; +register char *yy_bp; +#endif + { + register char *yy_cp = yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yy_hold_char; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yy_n_chars + 2; + register char *dest = &yy_current_buffer->yy_ch_buf[ + yy_current_buffer->yy_buf_size + 2]; + register char *source = + &yy_current_buffer->yy_ch_buf[number_to_move]; + + while ( source > yy_current_buffer->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + yy_n_chars = yy_current_buffer->yy_buf_size; + + if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + if ( c == '\n' ) + --yylineno; + + yytext_ptr = yy_bp; + yy_hold_char = *yy_cp; + yy_c_buf_p = yy_cp; + } +#endif /* ifndef YY_NO_UNPUT */ + + +#ifdef __cplusplus +static int yyinput() +#else +static int input() +#endif + { + int c; + + *yy_c_buf_p = yy_hold_char; + + if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + { + /* yy_c_buf_p now points to the character we want to return. + * If this occurs *before* the EOB characters, then it's a + * valid NUL; if not, then we've hit the end of the buffer. + */ + if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + /* This was really a NUL. */ + *yy_c_buf_p = '\0'; + + else + { /* need more input */ + yytext_ptr = yy_c_buf_p; + ++yy_c_buf_p; + + switch ( yy_get_next_buffer() ) + { + case EOB_ACT_END_OF_FILE: + { + if ( yywrap() ) + { + yy_c_buf_p = + yytext_ptr + YY_MORE_ADJ; + return EOF; + } + + if ( ! yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(); +#else + return input(); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + break; + + case EOB_ACT_LAST_MATCH: +#ifdef __cplusplus + YY_FATAL_ERROR( + "unexpected last match in yyinput()" ); +#else + YY_FATAL_ERROR( + "unexpected last match in input()" ); +#endif + } + } + } + + c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ + *yy_c_buf_p = '\0'; /* preserve yytext */ + yy_hold_char = *++yy_c_buf_p; + + if ( c == '\n' ) + ++yylineno; + + return c; + } + + +#ifdef YY_USE_PROTOS +void yyrestart( FILE *input_file ) +#else +void yyrestart( input_file ) +FILE *input_file; +#endif + { + if ( ! yy_current_buffer ) + yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); + + yy_init_buffer( yy_current_buffer, input_file ); + yy_load_buffer_state(); + } + + +#ifdef YY_USE_PROTOS +void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) +#else +void yy_switch_to_buffer( new_buffer ) +YY_BUFFER_STATE new_buffer; +#endif + { + if ( yy_current_buffer == new_buffer ) + return; + + if ( yy_current_buffer ) + { + /* Flush out information for old buffer. */ + *yy_c_buf_p = yy_hold_char; + yy_current_buffer->yy_buf_pos = yy_c_buf_p; + yy_current_buffer->yy_n_chars = yy_n_chars; + } + + yy_current_buffer = new_buffer; + yy_load_buffer_state(); + + /* We don't actually know whether we did this switch during + * EOF (yywrap()) processing, but the only time this flag + * is looked at is after yywrap() is called, so it's safe + * to go ahead and always set it. + */ + yy_did_buffer_switch_on_eof = 1; + } + + +#ifdef YY_USE_PROTOS +void yy_load_buffer_state( void ) +#else +void yy_load_buffer_state() +#endif + { + yy_n_chars = yy_current_buffer->yy_n_chars; + yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; + yyin = yy_current_buffer->yy_input_file; + yy_hold_char = *yy_c_buf_p; + } + + +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) +#else +YY_BUFFER_STATE yy_create_buffer( file, size ) +FILE *file; +int size; +#endif + { + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_buf_size = 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. + */ + b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + if ( ! b->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); + + b->yy_is_our_buffer = 1; + + yy_init_buffer( b, file ); + + return b; + } + + +#ifdef YY_USE_PROTOS +void yy_delete_buffer( YY_BUFFER_STATE b ) +#else +void yy_delete_buffer( b ) +YY_BUFFER_STATE b; +#endif + { + if ( ! b ) + return; + + if ( b == yy_current_buffer ) + yy_current_buffer = (YY_BUFFER_STATE) 0; + + if ( b->yy_is_our_buffer ) + yy_flex_free( (void *) b->yy_ch_buf ); + + yy_flex_free( (void *) b ); + } + + +#ifndef YY_ALWAYS_INTERACTIVE +#ifndef YY_NEVER_INTERACTIVE +extern int isatty YY_PROTO(( int )); +#endif +#endif + +#ifdef YY_USE_PROTOS +void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) +#else +void yy_init_buffer( b, file ) +YY_BUFFER_STATE b; +FILE *file; +#endif + + + { + yy_flush_buffer( b ); + + b->yy_input_file = file; + b->yy_fill_buffer = 1; + +#if YY_ALWAYS_INTERACTIVE + b->yy_is_interactive = 1; +#else +#if YY_NEVER_INTERACTIVE + b->yy_is_interactive = 0; +#else + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif +#endif + } + + +#ifdef YY_USE_PROTOS +void yy_flush_buffer( YY_BUFFER_STATE b ) +#else +void yy_flush_buffer( b ) +YY_BUFFER_STATE b; +#endif + + { + b->yy_n_chars = 0; + + /* We always need two end-of-buffer characters. The first causes + * a transition to the end-of-buffer state. The second causes + * a jam in that state. + */ + b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR; + b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR; + + b->yy_buf_pos = &b->yy_ch_buf[0]; + + b->yy_at_bol = 1; + b->yy_buffer_status = YY_BUFFER_NEW; + + if ( b == yy_current_buffer ) + yy_load_buffer_state(); + } + + +#ifndef YY_NO_SCAN_BUFFER +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) +#else +YY_BUFFER_STATE yy_scan_buffer( base, size ) +char *base; +yy_size_t size; +#endif + { + YY_BUFFER_STATE b; + + if ( size < 2 || + base[size-2] != YY_END_OF_BUFFER_CHAR || + base[size-1] != YY_END_OF_BUFFER_CHAR ) + /* They forgot to leave room for the EOB's. */ + return 0; + + b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + if ( ! b ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); + + b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */ + b->yy_buf_pos = b->yy_ch_buf = base; + b->yy_is_our_buffer = 0; + b->yy_input_file = 0; + b->yy_n_chars = b->yy_buf_size; + b->yy_is_interactive = 0; + b->yy_at_bol = 1; + b->yy_fill_buffer = 0; + b->yy_buffer_status = YY_BUFFER_NEW; + + yy_switch_to_buffer( b ); + + return b; + } +#endif + + +#ifndef YY_NO_SCAN_STRING +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_string( yyconst char *str ) +#else +YY_BUFFER_STATE yy_scan_string( str ) +yyconst char *str; +#endif + { + int len; + for ( len = 0; str[len]; ++len ) + ; + + return yy_scan_bytes( str, len ); + } +#endif + + +#ifndef YY_NO_SCAN_BYTES +#ifdef YY_USE_PROTOS +YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) +#else +YY_BUFFER_STATE yy_scan_bytes( bytes, len ) +yyconst char *bytes; +int len; +#endif + { + YY_BUFFER_STATE b; + char *buf; + yy_size_t n; + int i; + + /* Get memory for full buffer, including space for trailing EOB's. */ + n = len + 2; + buf = (char *) yy_flex_alloc( n ); + if ( ! buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); + + for ( i = 0; i < len; ++i ) + buf[i] = bytes[i]; + + buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + + b = yy_scan_buffer( buf, n ); + if ( ! b ) + YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); + + /* It's okay to grow etc. this buffer, and we should throw it + * away when we're done. + */ + b->yy_is_our_buffer = 1; + + return b; + } +#endif + + +#ifndef YY_NO_PUSH_STATE +#ifdef YY_USE_PROTOS +static void yy_push_state( int new_state ) +#else +static void yy_push_state( new_state ) +int new_state; +#endif + { + if ( yy_start_stack_ptr >= yy_start_stack_depth ) + { + yy_size_t new_size; + + yy_start_stack_depth += YY_START_STACK_INCR; + new_size = yy_start_stack_depth * sizeof( int ); + + if ( ! yy_start_stack ) + yy_start_stack = (int *) yy_flex_alloc( new_size ); + + else + yy_start_stack = (int *) yy_flex_realloc( + (void *) yy_start_stack, new_size ); + + if ( ! yy_start_stack ) + YY_FATAL_ERROR( + "out of memory expanding start-condition stack" ); + } + + yy_start_stack[yy_start_stack_ptr++] = YY_START; + + BEGIN(new_state); + } +#endif + + +#ifndef YY_NO_POP_STATE +static void yy_pop_state() + { + if ( --yy_start_stack_ptr < 0 ) + YY_FATAL_ERROR( "start-condition stack underflow" ); + + BEGIN(yy_start_stack[yy_start_stack_ptr]); + } +#endif + + +#ifndef YY_NO_TOP_STATE +static int yy_top_state() + { + return yy_start_stack[yy_start_stack_ptr - 1]; + } +#endif + +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 +#endif + +#ifdef YY_USE_PROTOS +static void yy_fatal_error( yyconst char msg[] ) +#else +static void yy_fatal_error( msg ) +char msg[]; +#endif + { + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); + } + + + +/* Redefine yyless() so it works in section 3 code. */ + +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + yytext[yyleng] = yy_hold_char; \ + yy_c_buf_p = yytext + n - YY_MORE_ADJ; \ + yy_hold_char = *yy_c_buf_p; \ + *yy_c_buf_p = '\0'; \ + yyleng = n; \ + } \ + while ( 0 ) + + +/* Internal utility routines. */ + +#ifndef yytext_ptr +#ifdef YY_USE_PROTOS +static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) +#else +static void yy_flex_strncpy( s1, s2, n ) +char *s1; +yyconst char *s2; +int n; +#endif + { + register int i; + for ( i = 0; i < n; ++i ) + s1[i] = s2[i]; + } +#endif + + +#ifdef YY_USE_PROTOS +static void *yy_flex_alloc( yy_size_t size ) +#else +static void *yy_flex_alloc( size ) +yy_size_t size; +#endif + { + return (void *) malloc( size ); + } + +#ifdef YY_USE_PROTOS +static void *yy_flex_realloc( void *ptr, yy_size_t size ) +#else +static void *yy_flex_realloc( ptr, size ) +void *ptr; +yy_size_t size; +#endif + { + /* 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 + * because both ANSI C and C++ allow castless assignment from + * any pointer type to void*, and deal with argument conversions + * as though doing an assignment. + */ + return (void *) realloc( (char *) ptr, size ); + } + +#ifdef YY_USE_PROTOS +static void yy_flex_free( void *ptr ) +#else +static void yy_flex_free( ptr ) +void *ptr; +#endif + { + free( ptr ); + } + +#if YY_MAIN +int main() + { + yylex(); + return 0; + } +#endif + + + +//Including Pre-processor. +extern "C" { + #include "compiler/preprocessor/preprocess.h" +} + +// +// The YY_INPUT macro just calls this. Maybe this could be just put into +// the macro directly. +// + +int yy_input(char* buf, int max_size) +{ + int len; + + if ((len = yylex_CPP(buf, max_size)) == 0) + return 0; + if (len >= max_size) + YY_FATAL_ERROR( "input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); + + buf[len] = ' '; + return len+1; +} + + +// +// Parse an array of strings using yyparse. We set up globals used by +// yywrap. +// +// Returns 0 for success, as per yyparse(). +// +int PaParseStrings(const char* const argv[], const int strLen[], int argc, TParseContext& parseContextLocal) +{ + int argv0len; + + ScanFromString(argv[0]); + + //Storing the Current Compiler Parse context into the cpp structure. + cpp->pC = (void*)&parseContextLocal; + + if (!argv || argc == 0) + return 1; + + for (int i = 0; i < argc; ++i) { + if (!argv[i]) { + parseContextLocal.error(0, "Null shader source string", "", ""); + parseContextLocal.recover(); + return 1; + } + } + + if (!strLen) { + argv0len = (int) strlen(argv[0]); + strLen = &argv0len; + } + yyrestart(0); + (&parseContextLocal)->AfterEOF = false; + cpp->PaWhichStr = 0; + cpp->PaArgv = argv; + cpp->PaArgc = argc; + cpp->PaStrLen = strLen; + cpp->pastFirstStatement = 0; + yylineno = 1; + + if (*cpp->PaStrLen >= 0) { + int ret = yyparse((void*)(&parseContextLocal)); + if (ret || cpp->CompileError == 1 || parseContextLocal.recoveredFromError || parseContextLocal.numErrors > 0) + return 1; + else + return 0; + } + else + return 0; +} + +void yyerror(const char *s) +{ + if (((TParseContext *)cpp->pC)->AfterEOF) { + if (cpp->tokensBeforeEOF == 1) { + GlobalParseContext->error(yylineno, "syntax error", "pre-mature EOF", s, ""); + GlobalParseContext->recover(); + } + } else { + GlobalParseContext->error(yylineno, "syntax error", yytext, s, ""); + GlobalParseContext->recover(); + } +} + +void PaReservedWord() +{ + GlobalParseContext->error(yylineno, "Reserved word.", yytext, "", ""); + GlobalParseContext->recover(); +} + +int PaIdentOrType(TString& id, TParseContext& parseContextLocal, TSymbol*& symbol) +{ + symbol = parseContextLocal.symbolTable.find(id); + if (parseContextLocal.lexAfterType == false && symbol && symbol->isVariable()) { + TVariable* variable = static_cast(symbol); + if (variable->isUserType()) { + parseContextLocal.lexAfterType = true; + return TYPE_NAME; + } + } + + return IDENTIFIER; +} + +int PaParseComment(int &lineno, TParseContext& parseContextLocal) +{ + int transitionFlag = 0; + int nextChar; + + while (transitionFlag != 2) { + nextChar = yyinput(); + if (nextChar == '\n') + lineno++; + switch (nextChar) { + case '*' : + transitionFlag = 1; + break; + case '/' : /* if star is the previous character, then it is the end of comment */ + if (transitionFlag == 1) { + return 1 ; + } + break; + case EOF : + /* Raise error message here */ + parseContextLocal.error(yylineno, "End of shader found before end of comment.", "", "", ""); + GlobalParseContext->recover(); + return YY_NULL; + default : /* Any other character will be a part of the comment */ + transitionFlag = 0; + } + } + return 1; +} + +extern "C" { + +void CPPDebugLogMsg(const char *msg) +{ + ((TParseContext *)cpp->pC)->infoSink.debug.message(EPrefixNone, msg); +} + +void CPPWarningToInfoLog(const char *msg) +{ + ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg, yylineno); +} + +void CPPShInfoLogMsg(const char *msg) +{ + ((TParseContext *)cpp->pC)->error(yylineno,"", "",msg,""); + GlobalParseContext->recover(); +} + +void CPPErrorToInfoLog(char *msg) +{ + ((TParseContext *)cpp->pC)->error(yylineno,"syntax error", "",msg,""); + GlobalParseContext->recover(); +} + +void SetLineNumber(int line) +{ + yylineno &= ~SourceLocLineMask; + yylineno |= line; +} + +void SetStringNumber(int string) +{ + yylineno = (string << SourceLocStringShift) | (yylineno & SourceLocLineMask); +} + +int GetStringNumber(void) +{ + return yylineno >> 16; +} + +int GetLineNumber(void) +{ + return yylineno & SourceLocLineMask; +} + +void IncLineNumber(void) +{ + if ((yylineno & SourceLocLineMask) <= SourceLocLineMask) + ++yylineno; +} + +void DecLineNumber(void) +{ + if ((yylineno & SourceLocLineMask) > 0) + --yylineno; +} + +void HandlePragma(const char **tokens, int numTokens) +{ + if (!strcmp(tokens[0], "optimize")) { + if (numTokens != 4) { + CPPShInfoLogMsg("optimize pragma syntax is incorrect"); + return; + } + + if (strcmp(tokens[1], "(")) { + CPPShInfoLogMsg("\"(\" expected after 'optimize' keyword"); + return; + } + + if (!strcmp(tokens[2], "on")) + ((TParseContext *)cpp->pC)->contextPragma.optimize = true; + else if (!strcmp(tokens[2], "off")) + ((TParseContext *)cpp->pC)->contextPragma.optimize = false; + else { + CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'optimize' pragma"); + return; + } + + if (strcmp(tokens[3], ")")) { + CPPShInfoLogMsg("\")\" expected to end 'optimize' pragma"); + return; + } + } else if (!strcmp(tokens[0], "debug")) { + if (numTokens != 4) { + CPPShInfoLogMsg("debug pragma syntax is incorrect"); + return; + } + + if (strcmp(tokens[1], "(")) { + CPPShInfoLogMsg("\"(\" expected after 'debug' keyword"); + return; + } + + if (!strcmp(tokens[2], "on")) + ((TParseContext *)cpp->pC)->contextPragma.debug = true; + else if (!strcmp(tokens[2], "off")) + ((TParseContext *)cpp->pC)->contextPragma.debug = false; + else { + CPPShInfoLogMsg("\"on\" or \"off\" expected after '(' for 'debug' pragma"); + return; + } + + if (strcmp(tokens[3], ")")) { + CPPShInfoLogMsg("\")\" expected to end 'debug' pragma"); + return; + } + } else { + +#ifdef PRAGMA_TABLE + // + // implementation specific pragma + // use ((TParseContext *)cpp->pC)->contextPragma.pragmaTable to store the information about pragma + // For now, just ignore the pragma that the implementation cannot recognize + // An Example of one such implementation for a pragma that has a syntax like + // #pragma pragmaname(pragmavalue) + // This implementation stores the current pragmavalue against the pragma name in pragmaTable. + // + if (numTokens == 4 && !strcmp(tokens[1], "(") && !strcmp(tokens[3], ")")) { + TPragmaTable& pragmaTable = ((TParseContext *)cpp->pC)->contextPragma.pragmaTable; + TPragmaTable::iterator iter; + iter = pragmaTable.find(TString(tokens[0])); + if (iter != pragmaTable.end()) { + iter->second = tokens[2]; + } else { + pragmaTable[ tokens[0] ] = tokens[2]; + } + } else if (numTokens >= 2) { + TPragmaTable& pragmaTable = ((TParseContext *)cpp->pC)->contextPragma.pragmaTable; + TPragmaTable::iterator iter; + iter = pragmaTable.find(TString(tokens[0])); + if (iter != pragmaTable.end()) { + iter->second = tokens[1]; + } else { + pragmaTable[ tokens[0] ] = tokens[1]; + } + } +#endif // PRAGMA_TABLE + } +} + +void StoreStr(char *string) +{ + TString strSrc; + strSrc = TString(string); + + ((TParseContext *)cpp->pC)->HashErrMsg = ((TParseContext *)cpp->pC)->HashErrMsg + " " + strSrc; +} + +const char* GetStrfromTStr(void) +{ + cpp->ErrMsg = (((TParseContext *)cpp->pC)->HashErrMsg).c_str(); + return cpp->ErrMsg; +} + +void ResetTString(void) +{ + ((TParseContext *)cpp->pC)->HashErrMsg = ""; +} + +TBehavior GetBehavior(const char* behavior) +{ + if (!strcmp("require", behavior)) + return EBhRequire; + else if (!strcmp("enable", behavior)) + return EBhEnable; + else if (!strcmp("disable", behavior)) + return EBhDisable; + else if (!strcmp("warn", behavior)) + return EBhWarn; + else { + CPPShInfoLogMsg((TString("behavior '") + behavior + "' is not supported").c_str()); + return EBhDisable; + } +} + +void updateExtensionBehavior(const char* extName, const char* behavior) +{ + TBehavior behaviorVal = GetBehavior(behavior); + TMap:: iterator iter; + TString msg; + + // special cased for all extension + if (!strcmp(extName, "all")) { + if (behaviorVal == EBhRequire || behaviorVal == EBhEnable) { + CPPShInfoLogMsg("extension 'all' cannot have 'require' or 'enable' behavior"); + return; + } else { + for (iter = ((TParseContext *)cpp->pC)->extensionBehavior.begin(); iter != ((TParseContext *)cpp->pC)->extensionBehavior.end(); ++iter) + iter->second = behaviorVal; + } + } else { + iter = ((TParseContext *)cpp->pC)->extensionBehavior.find(TString(extName)); + if (iter == ((TParseContext *)cpp->pC)->extensionBehavior.end()) { + switch (behaviorVal) { + case EBhRequire: + CPPShInfoLogMsg((TString("extension '") + extName + "' is not supported").c_str()); + break; + case EBhEnable: + case EBhWarn: + case EBhDisable: + msg = TString("extension '") + extName + "' is not supported"; + ((TParseContext *)cpp->pC)->infoSink.info.message(EPrefixWarning, msg.c_str(), yylineno); + break; + } + return; + } else + iter->second = behaviorVal; + } +} + +} // extern "C" + +void setInitialState() +{ + yy_start = 1; +} diff --git a/gfx/angle/generated/glslang_tab.cpp b/gfx/angle/generated/glslang_tab.cpp index ec98ac5a124..d00fdfde923 100644 --- a/gfx/angle/generated/glslang_tab.cpp +++ b/gfx/angle/generated/glslang_tab.cpp @@ -1,4733 +1,3509 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton implementation for Bison's Yacc-like parsers in C - - 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 - 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. - - 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 . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - 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. */ - -/* C LALR(1) parser skeleton written by Richard Stallman, by - simplifying the original so-called "semantic" parser. */ - -/* All symbols defined below should begin with yy or YY, to avoid - infringing on user name space. This should be done even for local - variables, as they might otherwise be expanded by user macros. - There are some unavoidable exceptions within include files to - define necessary library symbols; they are noted "INFRINGES ON - USER NAME SPACE" below. */ - -/* Identify Bison output. */ -#define YYBISON 1 - -/* Bison version. */ -#define YYBISON_VERSION "2.4.1" - -/* Skeleton name. */ -#define YYSKELETON_NAME "yacc.c" - -/* Pure parsers. */ -#define YYPURE 1 - -/* Push parsers. */ -#define YYPUSH 0 - -/* Pull parsers. */ -#define YYPULL 1 - -/* Using locations. */ -#define YYLSP_NEEDED 0 - - - -/* Copy the first part of user declarations. */ - - - -/* Based on: -ANSI C Yacc grammar - -In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a -matching Lex specification) for the April 30, 1985 draft version of the -ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that -original, as mentioned in the answer to question 17.25 of the comp.lang.c -FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z. - -I intend to keep this version as close to the current C Standard grammar as -possible; please let me know if you discover discrepancies. - -Jutta Degener, 1995 -*/ - -#include "compiler/SymbolTable.h" -#include "compiler/ParseHelper.h" -#include "GLSLANG/ShaderLang.h" - -#define YYPARSE_PARAM parseContextLocal -/* -TODO(alokp): YYPARSE_PARAM_DECL is only here to support old bison.exe in -compiler/tools. Remove it when we can exclusively use the newer version. -*/ -#define YYPARSE_PARAM_DECL void* -#define parseContext ((TParseContext*)(parseContextLocal)) -#define YYLEX_PARAM parseContextLocal -#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal) -extern void yyerror(const char*); - -#define FRAG_VERT_ONLY(S, L) { \ - if (parseContext->language != EShLangFragment && \ - parseContext->language != EShLangVertex) { \ - parseContext->error(L, " supported in vertex/fragment shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define VERTEX_ONLY(S, L) { \ - if (parseContext->language != EShLangVertex) { \ - parseContext->error(L, " supported in vertex shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define FRAG_ONLY(S, L) { \ - if (parseContext->language != EShLangFragment) { \ - parseContext->error(L, " supported in fragment shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define PACK_ONLY(S, L) { \ - if (parseContext->language != EShLangPack) { \ - parseContext->error(L, " supported in pack shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define UNPACK_ONLY(S, L) { \ - if (parseContext->language != EShLangUnpack) { \ - parseContext->error(L, " supported in unpack shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define PACK_UNPACK_ONLY(S, L) { \ - if (parseContext->language != EShLangUnpack && \ - parseContext->language != EShLangPack) { \ - parseContext->error(L, " supported in pack/unpack shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - - - -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - -/* Enabling verbose error messages. */ -#ifdef YYERROR_VERBOSE -# undef YYERROR_VERBOSE -# define YYERROR_VERBOSE 1 -#else -# define YYERROR_VERBOSE 0 -#endif - -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# 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 { - INVARIANT = 258, - HIGH_PRECISION = 259, - MEDIUM_PRECISION = 260, - LOW_PRECISION = 261, - PRECISION = 262, - ATTRIBUTE = 263, - CONST_QUAL = 264, - BOOL_TYPE = 265, - FLOAT_TYPE = 266, - INT_TYPE = 267, - BREAK = 268, - CONTINUE = 269, - DO = 270, - ELSE = 271, - FOR = 272, - IF = 273, - DISCARD = 274, - RETURN = 275, - BVEC2 = 276, - BVEC3 = 277, - BVEC4 = 278, - IVEC2 = 279, - IVEC3 = 280, - IVEC4 = 281, - VEC2 = 282, - VEC3 = 283, - VEC4 = 284, - MATRIX2 = 285, - MATRIX3 = 286, - MATRIX4 = 287, - IN_QUAL = 288, - OUT_QUAL = 289, - INOUT_QUAL = 290, - UNIFORM = 291, - VARYING = 292, - STRUCT = 293, - VOID_TYPE = 294, - WHILE = 295, - SAMPLER2D = 296, - SAMPLERCUBE = 297, - IDENTIFIER = 298, - TYPE_NAME = 299, - FLOATCONSTANT = 300, - INTCONSTANT = 301, - BOOLCONSTANT = 302, - FIELD_SELECTION = 303, - LEFT_OP = 304, - RIGHT_OP = 305, - INC_OP = 306, - DEC_OP = 307, - LE_OP = 308, - GE_OP = 309, - EQ_OP = 310, - NE_OP = 311, - AND_OP = 312, - OR_OP = 313, - XOR_OP = 314, - MUL_ASSIGN = 315, - DIV_ASSIGN = 316, - ADD_ASSIGN = 317, - MOD_ASSIGN = 318, - LEFT_ASSIGN = 319, - RIGHT_ASSIGN = 320, - AND_ASSIGN = 321, - XOR_ASSIGN = 322, - OR_ASSIGN = 323, - SUB_ASSIGN = 324, - LEFT_PAREN = 325, - RIGHT_PAREN = 326, - LEFT_BRACKET = 327, - RIGHT_BRACKET = 328, - LEFT_BRACE = 329, - RIGHT_BRACE = 330, - DOT = 331, - COMMA = 332, - COLON = 333, - EQUAL = 334, - SEMICOLON = 335, - BANG = 336, - DASH = 337, - TILDE = 338, - PLUS = 339, - STAR = 340, - SLASH = 341, - PERCENT = 342, - LEFT_ANGLE = 343, - RIGHT_ANGLE = 344, - VERTICAL_BAR = 345, - CARET = 346, - AMPERSAND = 347, - QUESTION = 348 - }; -#endif - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - - - struct { - TSourceLoc line; - union { - TString *string; - float f; - int i; - bool b; - }; - TSymbol* symbol; - } lex; - struct { - TSourceLoc line; - TOperator op; - union { - TIntermNode* intermNode; - TIntermNodePair nodePair; - TIntermTyped* intermTypedNode; - TIntermAggregate* intermAggregate; - }; - union { - TPublicType type; - TPrecision precision; - TQualifier qualifier; - TFunction* function; - TParameter param; - TTypeLine typeLine; - TTypeList* typeList; - }; - } interm; - - - -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - -/* Copy the second part of user declarations. */ - - - extern int yylex(YYSTYPE*, void*); - - - -#ifdef short -# undef short -#endif - -#ifdef YYTYPE_UINT8 -typedef YYTYPE_UINT8 yytype_uint8; -#else -typedef unsigned char yytype_uint8; -#endif - -#ifdef YYTYPE_INT8 -typedef YYTYPE_INT8 yytype_int8; -#elif (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -typedef signed char yytype_int8; -#else -typedef short int yytype_int8; -#endif - -#ifdef YYTYPE_UINT16 -typedef YYTYPE_UINT16 yytype_uint16; -#else -typedef unsigned short int yytype_uint16; -#endif - -#ifdef YYTYPE_INT16 -typedef YYTYPE_INT16 yytype_int16; -#else -typedef short int yytype_int16; -#endif - -#ifndef YYSIZE_T -# ifdef __SIZE_TYPE__ -# define YYSIZE_T __SIZE_TYPE__ -# elif defined size_t -# define YYSIZE_T size_t -# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# else -# define YYSIZE_T unsigned int -# endif -#endif - -#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) - -#ifndef YY_ -# if YYENABLE_NLS -# if ENABLE_NLS -# include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) -# endif -# endif -# ifndef YY_ -# define YY_(msgid) msgid -# endif -#endif - -/* Suppress unused-variable warnings by "using" E. */ -#if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) -#else -# define YYUSE(e) /* empty */ -#endif - -/* Identity function, used to suppress warnings about constant conditions. */ -#ifndef lint -# define YYID(n) (n) -#else -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static int -YYID (int yyi) -#else -static int -YYID (yyi) - int yyi; -#endif -{ - return yyi; -} -#endif - -#if ! defined yyoverflow || YYERROR_VERBOSE - -/* The parser invokes alloca or malloc; define the necessary symbols. */ - -# ifdef YYSTACK_USE_ALLOCA -# if YYSTACK_USE_ALLOCA -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca -# elif defined __BUILTIN_VA_ARG_INCR -# include /* INFRINGES ON USER NAME SPACE */ -# elif defined _AIX -# define YYSTACK_ALLOC __alloca -# elif defined _MSC_VER -# include /* INFRINGES ON USER NAME SPACE */ -# define alloca _alloca -# else -# define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# endif -# endif -# endif - -# ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) -# ifndef YYSTACK_ALLOC_MAXIMUM - /* The OS might guarantee only one guard page at the bottom of the stack, - and a page size can be as small as 4096 bytes. So we cannot safely - invoke alloca (N) if N exceeds 4096. Use a slightly smaller number - to allow for a few compiler-allocated temporary stack slots. */ -# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ -# endif -# else -# define YYSTACK_ALLOC YYMALLOC -# define YYSTACK_FREE YYFREE -# ifndef YYSTACK_ALLOC_MAXIMUM -# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM -# endif -# if (defined __cplusplus && ! defined _STDLIB_H \ - && ! ((defined YYMALLOC || defined malloc) \ - && (defined YYFREE || defined free))) -# include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 -# endif -# endif -# ifndef YYMALLOC -# define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# ifndef YYFREE -# define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -void free (void *); /* INFRINGES ON USER NAME SPACE */ -# endif -# endif -# endif -#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ - - -#if (! defined yyoverflow \ - && (! defined __cplusplus \ - || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) - -/* A type that is properly aligned for any stack member. */ -union yyalloc -{ - yytype_int16 yyss_alloc; - YYSTYPE yyvs_alloc; -}; - -/* The size of the maximum gap between one aligned stack and the next. */ -# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1) - -/* The size of an array large to enough to hold all stacks, each with - N elements. */ -# define YYSTACK_BYTES(N) \ - ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ - + YYSTACK_GAP_MAXIMUM) - -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif - -/* Relocate STACK from its old location to the new one. The - local variables YYSIZE and YYSTACKSIZE give the old and new number of - 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) \ - do \ - { \ - YYSIZE_T yynewbytes; \ - YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ - Stack = &yyptr->Stack_alloc; \ - yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ - yyptr += yynewbytes / sizeof (*yyptr); \ - } \ - while (YYID (0)) - -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 69 -/* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 1378 - -/* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 94 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 78 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 195 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 300 - -/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ -#define YYUNDEFTOK 2 -#define YYMAXUTOK 348 - -#define YYTRANSLATE(YYX) \ - ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) - -/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const yytype_uint8 yytranslate[] = -{ - 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, - 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, - 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, - 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, - 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93 -}; - -#if YYDEBUG -/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in - YYRHS. */ -static const yytype_uint16 yyprhs[] = -{ - 0, 0, 3, 5, 7, 9, 11, 13, 17, 19, - 24, 26, 30, 33, 36, 38, 40, 42, 46, 49, - 52, 55, 57, 60, 64, 67, 69, 71, 73, 75, - 78, 81, 84, 86, 88, 90, 92, 96, 100, 102, - 106, 110, 112, 114, 118, 122, 126, 130, 132, 136, - 140, 142, 144, 146, 148, 152, 154, 158, 160, 164, - 166, 172, 174, 178, 180, 182, 184, 186, 188, 190, - 194, 196, 199, 202, 207, 210, 212, 214, 217, 221, - 225, 228, 234, 238, 241, 245, 248, 249, 251, 253, - 255, 257, 259, 263, 269, 276, 284, 293, 299, 301, - 304, 309, 315, 320, 323, 325, 328, 330, 332, 334, - 337, 339, 341, 344, 346, 348, 350, 352, 357, 359, - 361, 363, 365, 367, 369, 371, 373, 375, 377, 379, - 381, 383, 385, 387, 389, 391, 393, 395, 397, 403, - 408, 410, 413, 417, 419, 423, 425, 430, 432, 434, - 436, 438, 440, 442, 444, 446, 448, 451, 452, 453, - 459, 461, 463, 466, 470, 472, 475, 477, 480, 486, - 490, 492, 494, 499, 500, 507, 508, 517, 518, 526, - 528, 530, 532, 533, 536, 540, 543, 546, 549, 553, - 556, 558, 561, 563, 565, 566 -}; - -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yytype_int16 yyrhs[] = -{ - 168, 0, -1, 43, -1, 95, -1, 46, -1, 45, - -1, 47, -1, 70, 122, 71, -1, 96, -1, 97, - 72, 98, 73, -1, 99, -1, 97, 76, 48, -1, - 97, 51, -1, 97, 52, -1, 122, -1, 100, -1, - 101, -1, 97, 76, 101, -1, 103, 71, -1, 102, - 71, -1, 104, 39, -1, 104, -1, 104, 120, -1, - 103, 77, 120, -1, 105, 70, -1, 137, -1, 43, - -1, 48, -1, 97, -1, 51, 106, -1, 52, 106, - -1, 107, 106, -1, 84, -1, 82, -1, 81, -1, - 106, -1, 108, 85, 106, -1, 108, 86, 106, -1, - 108, -1, 109, 84, 108, -1, 109, 82, 108, -1, - 109, -1, 110, -1, 111, 88, 110, -1, 111, 89, - 110, -1, 111, 53, 110, -1, 111, 54, 110, -1, - 111, -1, 112, 55, 111, -1, 112, 56, 111, -1, - 112, -1, 113, -1, 114, -1, 115, -1, 116, 57, - 115, -1, 116, -1, 117, 59, 116, -1, 117, -1, - 118, 58, 117, -1, 118, -1, 118, 93, 122, 78, - 120, -1, 119, -1, 106, 121, 120, -1, 79, -1, - 60, -1, 61, -1, 62, -1, 69, -1, 120, -1, - 122, 77, 120, -1, 119, -1, 125, 80, -1, 133, - 80, -1, 7, 138, 139, 80, -1, 126, 71, -1, - 128, -1, 127, -1, 128, 130, -1, 127, 77, 130, - -1, 135, 43, 70, -1, 137, 43, -1, 137, 43, - 72, 123, 73, -1, 136, 131, 129, -1, 131, 129, - -1, 136, 131, 132, -1, 131, 132, -1, -1, 33, - -1, 34, -1, 35, -1, 137, -1, 134, -1, 133, - 77, 43, -1, 133, 77, 43, 72, 73, -1, 133, - 77, 43, 72, 123, 73, -1, 133, 77, 43, 72, - 73, 79, 146, -1, 133, 77, 43, 72, 123, 73, - 79, 146, -1, 133, 77, 43, 79, 146, -1, 135, - -1, 135, 43, -1, 135, 43, 72, 73, -1, 135, - 43, 72, 123, 73, -1, 135, 43, 79, 146, -1, - 3, 43, -1, 137, -1, 136, 137, -1, 9, -1, - 8, -1, 37, -1, 3, 37, -1, 36, -1, 139, - -1, 138, 139, -1, 4, -1, 5, -1, 6, -1, - 140, -1, 140, 72, 123, 73, -1, 39, -1, 11, - -1, 12, -1, 10, -1, 27, -1, 28, -1, 29, - -1, 21, -1, 22, -1, 23, -1, 24, -1, 25, - -1, 26, -1, 30, -1, 31, -1, 32, -1, 41, - -1, 42, -1, 141, -1, 44, -1, 38, 43, 74, - 142, 75, -1, 38, 74, 142, 75, -1, 143, -1, - 142, 143, -1, 137, 144, 80, -1, 145, -1, 144, - 77, 145, -1, 43, -1, 43, 72, 123, 73, -1, - 120, -1, 124, -1, 150, -1, 149, -1, 147, -1, - 156, -1, 157, -1, 160, -1, 167, -1, 74, 75, - -1, -1, -1, 74, 151, 155, 152, 75, -1, 154, - -1, 149, -1, 74, 75, -1, 74, 155, 75, -1, - 148, -1, 155, 148, -1, 80, -1, 122, 80, -1, - 18, 70, 122, 71, 158, -1, 148, 16, 148, -1, - 148, -1, 122, -1, 135, 43, 79, 146, -1, -1, - 40, 70, 161, 159, 71, 153, -1, -1, 15, 162, - 148, 40, 70, 122, 71, 80, -1, -1, 17, 70, - 163, 164, 166, 71, 153, -1, 156, -1, 147, -1, - 159, -1, -1, 165, 80, -1, 165, 80, 122, -1, - 14, 80, -1, 13, 80, -1, 20, 80, -1, 20, - 122, 80, -1, 19, 80, -1, 169, -1, 168, 169, - -1, 170, -1, 124, -1, -1, 125, 171, 154, -1 -}; - -/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const yytype_uint16 yyrline[] = -{ - 0, 183, 183, 218, 221, 234, 239, 244, 250, 253, - 326, 329, 438, 448, 461, 469, 567, 570, 578, 582, - 589, 593, 600, 606, 615, 623, 687, 694, 704, 707, - 717, 727, 748, 749, 750, 755, 756, 765, 777, 778, - 786, 797, 801, 802, 812, 822, 832, 845, 846, 857, - 871, 875, 879, 883, 884, 897, 898, 911, 912, 925, - 926, 943, 944, 958, 959, 960, 961, 962, 966, 969, - 980, 988, 1013, 1018, 1025, 1061, 1064, 1071, 1079, 1100, - 1119, 1130, 1159, 1164, 1174, 1179, 1189, 1192, 1195, 1198, - 1204, 1211, 1221, 1233, 1251, 1275, 1308, 1344, 1367, 1371, - 1385, 1405, 1434, 1454, 1530, 1540, 1566, 1569, 1575, 1583, - 1591, 1599, 1602, 1609, 1612, 1615, 1621, 1624, 1639, 1643, - 1647, 1651, 1660, 1665, 1670, 1675, 1680, 1685, 1690, 1695, - 1700, 1705, 1711, 1717, 1723, 1728, 1733, 1738, 1751, 1764, - 1772, 1775, 1790, 1816, 1820, 1826, 1834, 1850, 1854, 1858, - 1859, 1865, 1866, 1867, 1868, 1869, 1873, 1874, 1874, 1874, - 1882, 1883, 1888, 1891, 1899, 1902, 1908, 1909, 1913, 1921, - 1925, 1935, 1940, 1957, 1957, 1962, 1962, 1969, 1969, 1977, - 1980, 1986, 1989, 1995, 1999, 2006, 2013, 2020, 2027, 2038, - 2047, 2051, 2058, 2061, 2067, 2067 -}; -#endif - -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE -/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ -static const char *const yytname[] = -{ - "$end", "error", "$undefined", "INVARIANT", "HIGH_PRECISION", - "MEDIUM_PRECISION", "LOW_PRECISION", "PRECISION", "ATTRIBUTE", - "CONST_QUAL", "BOOL_TYPE", "FLOAT_TYPE", "INT_TYPE", "BREAK", "CONTINUE", - "DO", "ELSE", "FOR", "IF", "DISCARD", "RETURN", "BVEC2", "BVEC3", - "BVEC4", "IVEC2", "IVEC3", "IVEC4", "VEC2", "VEC3", "VEC4", "MATRIX2", - "MATRIX3", "MATRIX4", "IN_QUAL", "OUT_QUAL", "INOUT_QUAL", "UNIFORM", - "VARYING", "STRUCT", "VOID_TYPE", "WHILE", "SAMPLER2D", "SAMPLERCUBE", - "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT", "INTCONSTANT", - "BOOLCONSTANT", "FIELD_SELECTION", "LEFT_OP", "RIGHT_OP", "INC_OP", - "DEC_OP", "LE_OP", "GE_OP", "EQ_OP", "NE_OP", "AND_OP", "OR_OP", - "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN", "ADD_ASSIGN", "MOD_ASSIGN", - "LEFT_ASSIGN", "RIGHT_ASSIGN", "AND_ASSIGN", "XOR_ASSIGN", "OR_ASSIGN", - "SUB_ASSIGN", "LEFT_PAREN", "RIGHT_PAREN", "LEFT_BRACKET", - "RIGHT_BRACKET", "LEFT_BRACE", "RIGHT_BRACE", "DOT", "COMMA", "COLON", - "EQUAL", "SEMICOLON", "BANG", "DASH", "TILDE", "PLUS", "STAR", "SLASH", - "PERCENT", "LEFT_ANGLE", "RIGHT_ANGLE", "VERTICAL_BAR", "CARET", - "AMPERSAND", "QUESTION", "$accept", "variable_identifier", - "primary_expression", "postfix_expression", "integer_expression", - "function_call", "function_call_or_method", "function_call_generic", - "function_call_header_no_parameters", - "function_call_header_with_parameters", "function_call_header", - "function_identifier", "unary_expression", "unary_operator", - "multiplicative_expression", "additive_expression", "shift_expression", - "relational_expression", "equality_expression", "and_expression", - "exclusive_or_expression", "inclusive_or_expression", - "logical_and_expression", "logical_xor_expression", - "logical_or_expression", "conditional_expression", - "assignment_expression", "assignment_operator", "expression", - "constant_expression", "declaration", "function_prototype", - "function_declarator", "function_header_with_parameters", - "function_header", "parameter_declarator", "parameter_declaration", - "parameter_qualifier", "parameter_type_specifier", - "init_declarator_list", "single_declaration", "fully_specified_type", - "type_qualifier", "type_specifier", "precision_qualifier", - "type_specifier_no_prec", "type_specifier_nonarray", "struct_specifier", - "struct_declaration_list", "struct_declaration", - "struct_declarator_list", "struct_declarator", "initializer", - "declaration_statement", "statement", "simple_statement", - "compound_statement", "$@1", "$@2", "statement_no_new_scope", - "compound_statement_no_new_scope", "statement_list", - "expression_statement", "selection_statement", - "selection_rest_statement", "condition", "iteration_statement", "$@3", - "$@4", "$@5", "for_init_statement", "conditionopt", "for_rest_statement", - "jump_statement", "translation_unit", "external_declaration", - "function_definition", "$@6", 0 -}; -#endif - -# ifdef YYPRINT -/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to - token YYLEX-NUM. */ -static const yytype_uint16 yytoknum[] = -{ - 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, - 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, - 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, - 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, - 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, - 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, - 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, - 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, - 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, - 345, 346, 347, 348 -}; -# endif - -/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const yytype_uint8 yyr1[] = -{ - 0, 94, 95, 96, 96, 96, 96, 96, 97, 97, - 97, 97, 97, 97, 98, 99, 100, 100, 101, 101, - 102, 102, 103, 103, 104, 105, 105, 105, 106, 106, - 106, 106, 107, 107, 107, 108, 108, 108, 109, 109, - 109, 110, 111, 111, 111, 111, 111, 112, 112, 112, - 113, 114, 115, 116, 116, 117, 117, 118, 118, 119, - 119, 120, 120, 121, 121, 121, 121, 121, 122, 122, - 123, 124, 124, 124, 125, 126, 126, 127, 127, 128, - 129, 129, 130, 130, 130, 130, 131, 131, 131, 131, - 132, 133, 133, 133, 133, 133, 133, 133, 134, 134, - 134, 134, 134, 134, 135, 135, 136, 136, 136, 136, - 136, 137, 137, 138, 138, 138, 139, 139, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 140, 140, 140, - 140, 140, 140, 140, 140, 140, 140, 140, 141, 141, - 142, 142, 143, 144, 144, 145, 145, 146, 147, 148, - 148, 149, 149, 149, 149, 149, 150, 151, 152, 150, - 153, 153, 154, 154, 155, 155, 156, 156, 157, 158, - 158, 159, 159, 161, 160, 162, 160, 163, 160, 164, - 164, 165, 165, 166, 166, 167, 167, 167, 167, 167, - 168, 168, 169, 169, 171, 170 -}; - -/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const yytype_uint8 yyr2[] = -{ - 0, 2, 1, 1, 1, 1, 1, 3, 1, 4, - 1, 3, 2, 2, 1, 1, 1, 3, 2, 2, - 2, 1, 2, 3, 2, 1, 1, 1, 1, 2, - 2, 2, 1, 1, 1, 1, 3, 3, 1, 3, - 3, 1, 1, 3, 3, 3, 3, 1, 3, 3, - 1, 1, 1, 1, 3, 1, 3, 1, 3, 1, - 5, 1, 3, 1, 1, 1, 1, 1, 1, 3, - 1, 2, 2, 4, 2, 1, 1, 2, 3, 3, - 2, 5, 3, 2, 3, 2, 0, 1, 1, 1, - 1, 1, 3, 5, 6, 7, 8, 5, 1, 2, - 4, 5, 4, 2, 1, 2, 1, 1, 1, 2, - 1, 1, 2, 1, 1, 1, 1, 4, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 5, 4, - 1, 2, 3, 1, 3, 1, 4, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 2, 0, 0, 5, - 1, 1, 2, 3, 1, 2, 1, 2, 5, 3, - 1, 1, 4, 0, 6, 0, 8, 0, 7, 1, - 1, 1, 0, 2, 3, 2, 2, 2, 3, 2, - 1, 2, 1, 1, 0, 3 -}; - -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero - means the default is an error. */ -static const yytype_uint8 yydefact[] = -{ - 0, 0, 113, 114, 115, 0, 107, 106, 121, 119, - 120, 125, 126, 127, 128, 129, 130, 122, 123, 124, - 131, 132, 133, 110, 108, 0, 118, 134, 135, 137, - 193, 194, 0, 76, 86, 0, 91, 98, 0, 104, - 0, 111, 116, 136, 0, 190, 192, 109, 103, 0, - 0, 0, 71, 0, 74, 86, 0, 87, 88, 89, - 77, 0, 86, 0, 72, 99, 105, 112, 0, 1, - 191, 0, 0, 0, 0, 140, 0, 195, 78, 83, - 85, 90, 0, 92, 79, 0, 0, 2, 5, 4, - 6, 27, 0, 0, 0, 34, 33, 32, 3, 8, - 28, 10, 15, 16, 0, 0, 21, 0, 35, 0, - 38, 41, 42, 47, 50, 51, 52, 53, 55, 57, - 59, 70, 0, 25, 73, 0, 145, 0, 143, 139, - 141, 0, 0, 175, 0, 0, 0, 0, 0, 157, - 162, 166, 35, 61, 68, 0, 148, 0, 104, 151, - 164, 150, 149, 0, 152, 153, 154, 155, 80, 82, - 84, 0, 0, 100, 0, 147, 102, 29, 30, 0, - 12, 13, 0, 0, 19, 18, 0, 118, 22, 24, - 31, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 117, 138, 0, 0, 142, - 186, 185, 0, 177, 0, 189, 187, 0, 173, 156, - 0, 64, 65, 66, 67, 63, 0, 0, 167, 163, - 165, 0, 93, 0, 97, 101, 7, 0, 14, 26, - 11, 17, 23, 36, 37, 40, 39, 45, 46, 43, - 44, 48, 49, 54, 56, 58, 0, 0, 144, 0, - 0, 0, 188, 0, 158, 62, 69, 0, 0, 94, - 9, 0, 146, 0, 180, 179, 182, 0, 171, 0, - 0, 0, 81, 95, 0, 60, 0, 181, 0, 0, - 170, 168, 0, 0, 159, 96, 0, 183, 0, 0, - 0, 161, 174, 160, 0, 184, 178, 169, 172, 176 -}; - -/* YYDEFGOTO[NTERM-NUM]. */ -static const yytype_int16 yydefgoto[] = -{ - -1, 98, 99, 100, 227, 101, 102, 103, 104, 105, - 106, 107, 142, 109, 110, 111, 112, 113, 114, 115, - 116, 117, 118, 119, 120, 143, 144, 216, 145, 122, - 146, 147, 32, 33, 34, 79, 60, 61, 80, 35, - 36, 37, 38, 123, 40, 41, 42, 43, 74, 75, - 127, 128, 166, 149, 150, 151, 152, 210, 271, 292, - 293, 153, 154, 155, 281, 270, 156, 253, 202, 250, - 266, 278, 279, 157, 44, 45, 46, 53 -}; - -/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing - STATE-NUM. */ -#define YYPACT_NINF -253 -static const yytype_int16 yypact[] = -{ - 1269, -11, -253, -253, -253, 124, -253, -253, -253, -253, - -253, -253, -253, -253, -253, -253, -253, -253, -253, -253, - -253, -253, -253, -253, -253, -40, -253, -253, -253, -253, - -253, -65, -52, -50, 21, 16, -253, -10, 1310, -253, - 1334, -253, -12, -253, 1182, -253, -253, -253, -253, 1334, - -3, 1310, -253, 10, -253, 32, 68, -253, -253, -253, - -253, 1310, 122, 78, -253, 11, -253, -253, 993, -253, - -253, 31, 1310, 83, 202, -253, 287, -253, -253, -253, - -253, 91, 1310, -63, -253, 764, 993, 80, -253, -253, - -253, -253, 993, 993, 993, -253, -253, -253, -253, -253, - 27, -253, -253, -253, 81, -34, 1060, 90, -253, 993, - 12, -9, -253, -36, 103, -253, -253, -253, 111, 110, - -44, -253, 97, -253, -253, 1127, 99, 36, -253, -253, - -253, 92, 100, -253, 107, 109, 101, 845, 112, 108, - -253, -253, 25, -253, -253, 42, -253, -65, 115, -253, - -253, -253, -253, 369, -253, -253, -253, -253, 114, -253, - -253, 912, 993, -253, 117, -253, -253, -253, -253, -7, - -253, -253, 993, 1223, -253, -253, 993, 116, -253, -253, - -253, 993, 993, 993, 993, 993, 993, 993, 993, 993, - 993, 993, 993, 993, 993, -253, -253, 993, 83, -253, - -253, -253, 451, -253, 993, -253, -253, 43, -253, -253, - 451, -253, -253, -253, -253, -253, 993, 993, -253, -253, - -253, 993, 113, 118, -253, -253, -253, 120, 119, -253, - 127, -253, -253, -253, -253, 12, 12, -253, -253, -253, - -253, -36, -36, -253, 111, 110, 85, 121, -253, 148, - 615, 18, -253, 697, 451, -253, -253, 125, 993, 130, - -253, 993, -253, 129, -253, -253, 697, 451, 119, 157, - 132, 126, -253, -253, 993, -253, 993, -253, 131, 133, - 199, -253, 137, 533, -253, -253, 29, 993, 533, 451, - 993, -253, -253, -253, 138, 119, -253, -253, -253, -253 -}; - -/* YYPGOTO[NTERM-NUM]. */ -static const yytype_int16 yypgoto[] = -{ - -253, -253, -253, -253, -253, -253, -253, 44, -253, -253, - -253, -253, -46, -253, -19, -253, -78, -23, -253, -253, - -253, 28, 30, 45, -253, -43, -85, -253, -92, -73, - 4, 6, -253, -253, -253, 139, 165, 173, 154, -253, - -253, -243, -27, 0, 232, -29, -253, -253, 167, -66, - -253, 47, -157, -8, -140, -252, -253, -253, -253, -41, - 195, 39, 1, -253, -253, -14, -253, -253, -253, -253, - -253, -253, -253, -253, -253, 211, -253, -253 -}; - -/* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If - positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ -#define YYTABLE_NINF -76 -static const yytype_int16 yytable[] = -{ - 39, 165, 169, 50, 30, 224, 31, 62, 130, 161, - 269, 67, 164, 220, 193, 52, 162, 185, 186, 54, - 71, 178, 108, 269, 56, 121, 47, 55, 62, 6, - 7, 291, 48, 65, 51, 56, 291, 175, 66, 108, - 6, 7, 121, 176, 39, 207, 167, 168, 30, 194, - 31, 73, 187, 188, 57, 58, 59, 23, 24, 130, - 68, 81, 249, 180, 226, 57, 58, 59, 23, 24, - 217, 72, 73, 183, 73, 184, 148, 165, 170, 171, - 228, 84, 81, 85, 76, 211, 212, 213, 223, 267, - 86, 232, -75, 63, 214, 217, 64, 181, 182, 172, - 294, 273, 246, 173, 215, 47, 217, 237, 238, 239, - 240, 124, 251, 198, 220, 108, 199, 285, 121, 217, - 217, 83, 218, 252, 247, 73, 126, 280, 2, 3, - 4, 255, 256, 298, 158, 233, 234, 108, 108, 108, - 108, 108, 108, 108, 108, 108, 108, 108, 257, 297, - -26, 108, 174, 148, 121, 57, 58, 59, 189, 190, - 179, 268, 217, 261, 235, 236, 241, 242, 191, 192, - 195, 197, 200, 165, 268, 108, 275, 203, 121, 204, - 201, 205, 208, 209, 286, -25, 221, -20, 263, 165, - 225, 259, 258, 260, 262, 295, 217, -27, 272, 276, - 282, 284, 148, 283, 288, 165, 2, 3, 4, 274, - 148, 287, 8, 9, 10, 289, 290, 231, 299, 243, - 78, 159, 244, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 82, 160, 49, 245, 125, - 25, 26, 264, 27, 28, 248, 29, 296, 77, 254, - 148, 265, 277, 148, 148, 70, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 148, 148, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 129, 0, 0, - 0, 0, 0, 148, 0, 0, 0, 0, 148, 148, - 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, - 131, 132, 133, 0, 134, 135, 136, 137, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 0, 0, 0, 23, 24, 25, 26, 138, 27, 28, - 87, 29, 88, 89, 90, 91, 0, 0, 92, 93, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 94, 0, 0, - 0, 139, 140, 0, 0, 0, 0, 141, 95, 96, - 0, 97, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 131, 132, 133, 0, 134, 135, 136, 137, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 0, 0, 0, 23, 24, 25, 26, 138, - 27, 28, 87, 29, 88, 89, 90, 91, 0, 0, - 92, 93, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 94, - 0, 0, 0, 139, 219, 0, 0, 0, 0, 141, - 95, 96, 0, 97, 1, 2, 3, 4, 5, 6, - 7, 8, 9, 10, 131, 132, 133, 0, 134, 135, - 136, 137, 11, 12, 13, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 0, 0, 0, 23, 24, 25, - 26, 138, 27, 28, 87, 29, 88, 89, 90, 91, - 0, 0, 92, 93, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 94, 0, 0, 0, 139, 0, 0, 0, 0, - 0, 141, 95, 96, 0, 97, 1, 2, 3, 4, - 5, 6, 7, 8, 9, 10, 131, 132, 133, 0, - 134, 135, 136, 137, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, - 24, 25, 26, 138, 27, 28, 87, 29, 88, 89, - 90, 91, 0, 0, 92, 93, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 94, 0, 0, 0, 76, 0, 0, - 0, 0, 0, 141, 95, 96, 0, 97, 1, 2, - 3, 4, 5, 6, 7, 8, 9, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, - 0, 23, 24, 25, 26, 0, 27, 28, 87, 29, - 88, 89, 90, 91, 0, 0, 92, 93, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 94, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 141, 95, 96, 0, 97, - 56, 2, 3, 4, 0, 6, 7, 8, 9, 10, - 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 0, 0, 0, 23, 24, 25, 26, 0, 27, 28, - 87, 29, 88, 89, 90, 91, 0, 0, 92, 93, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 94, 2, 3, - 4, 0, 0, 0, 8, 9, 10, 0, 95, 96, - 0, 97, 0, 0, 0, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, - 0, 0, 25, 26, 0, 27, 28, 87, 29, 88, - 89, 90, 91, 0, 0, 92, 93, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 94, 0, 0, 163, 0, 0, - 0, 0, 0, 0, 0, 95, 96, 0, 97, 2, - 3, 4, 0, 0, 0, 8, 9, 10, 0, 0, - 0, 0, 0, 0, 0, 0, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, - 0, 0, 0, 25, 26, 0, 27, 28, 87, 29, - 88, 89, 90, 91, 0, 0, 92, 93, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 94, 2, 3, 4, 0, - 0, 0, 8, 9, 10, 206, 95, 96, 0, 97, - 0, 0, 0, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 0, 0, 0, 0, 0, - 25, 26, 0, 27, 28, 87, 29, 88, 89, 90, - 91, 0, 0, 92, 93, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 94, 0, 0, 222, 0, 0, 0, 0, - 0, 0, 0, 95, 96, 0, 97, 2, 3, 4, - 0, 0, 0, 8, 9, 10, 0, 0, 0, 0, - 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 0, 0, 0, 0, - 0, 25, 26, 0, 27, 28, 87, 29, 88, 89, - 90, 91, 0, 0, 92, 93, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 94, 2, 3, 4, 0, 0, 0, - 8, 9, 10, 0, 95, 96, 0, 97, 0, 0, - 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 0, 0, 0, 0, 0, 25, 177, - 0, 27, 28, 87, 29, 88, 89, 90, 91, 0, - 0, 92, 93, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 94, 2, 3, 4, 0, 0, 0, 8, 9, 10, - 0, 95, 96, 0, 97, 0, 0, 0, 11, 12, - 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, - 0, 0, 0, 0, 0, 25, 26, 0, 27, 28, - 0, 29, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 69, 0, 0, 1, 2, 3, 4, 5, - 6, 7, 8, 9, 10, 0, 0, 0, 0, 0, - 0, 0, 196, 11, 12, 13, 14, 15, 16, 17, - 18, 19, 20, 21, 22, 0, 0, 0, 23, 24, - 25, 26, 0, 27, 28, 0, 29, 2, 3, 4, - 0, 0, 0, 8, 9, 10, 0, 0, 0, 0, - 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, - 17, 18, 19, 20, 21, 22, 0, 0, 0, 0, - 0, 25, 26, 0, 27, 28, 229, 29, 0, 0, - 0, 230, 1, 2, 3, 4, 5, 6, 7, 8, - 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, - 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, - 21, 22, 0, 0, 0, 23, 24, 25, 26, 0, - 27, 28, 0, 29, 2, 3, 4, 0, 0, 0, - 8, 9, 10, 0, 0, 0, 0, 0, 0, 0, - 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 22, 0, 8, 9, 10, 0, 25, 26, - 0, 27, 28, 0, 29, 11, 12, 13, 14, 15, - 16, 17, 18, 19, 20, 21, 22, 0, 0, 0, - 0, 0, 25, 26, 0, 27, 28, 0, 29 -}; - -static const yytype_int16 yycheck[] = -{ - 0, 86, 94, 43, 0, 162, 0, 34, 74, 72, - 253, 40, 85, 153, 58, 80, 79, 53, 54, 71, - 49, 106, 68, 266, 3, 68, 37, 77, 55, 8, - 9, 283, 43, 43, 74, 3, 288, 71, 38, 85, - 8, 9, 85, 77, 44, 137, 92, 93, 44, 93, - 44, 51, 88, 89, 33, 34, 35, 36, 37, 125, - 72, 61, 202, 109, 71, 33, 34, 35, 36, 37, - 77, 74, 72, 82, 74, 84, 76, 162, 51, 52, - 172, 70, 82, 72, 74, 60, 61, 62, 161, 71, - 79, 176, 71, 77, 69, 77, 80, 85, 86, 72, - 71, 258, 194, 76, 79, 37, 77, 185, 186, 187, - 188, 80, 204, 77, 254, 161, 80, 274, 161, 77, - 77, 43, 80, 80, 197, 125, 43, 267, 4, 5, - 6, 216, 217, 290, 43, 181, 182, 183, 184, 185, - 186, 187, 188, 189, 190, 191, 192, 193, 221, 289, - 70, 197, 71, 153, 197, 33, 34, 35, 55, 56, - 70, 253, 77, 78, 183, 184, 189, 190, 57, 59, - 73, 72, 80, 258, 266, 221, 261, 70, 221, 70, - 80, 80, 70, 75, 276, 70, 72, 71, 40, 274, - 73, 73, 79, 73, 73, 287, 77, 70, 73, 70, - 43, 75, 202, 71, 71, 290, 4, 5, 6, 79, - 210, 80, 10, 11, 12, 16, 79, 173, 80, 191, - 55, 82, 192, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, 62, 82, 5, 193, 72, - 38, 39, 250, 41, 42, 198, 44, 288, 53, 210, - 250, 250, 266, 253, 254, 44, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, 266, 267, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 75, -1, -1, - -1, -1, -1, 283, -1, -1, -1, -1, 288, 289, - 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, - 13, 14, 15, -1, 17, 18, 19, 20, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - -1, -1, -1, 36, 37, 38, 39, 40, 41, 42, - 43, 44, 45, 46, 47, 48, -1, -1, 51, 52, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, - -1, 74, 75, -1, -1, -1, -1, 80, 81, 82, - -1, 84, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, 13, 14, 15, -1, 17, 18, 19, 20, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, -1, -1, -1, 36, 37, 38, 39, 40, - 41, 42, 43, 44, 45, 46, 47, 48, -1, -1, - 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, - -1, -1, -1, 74, 75, -1, -1, -1, -1, 80, - 81, 82, -1, 84, 3, 4, 5, 6, 7, 8, - 9, 10, 11, 12, 13, 14, 15, -1, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, - 29, 30, 31, 32, -1, -1, -1, 36, 37, 38, - 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - -1, -1, 51, 52, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, 70, -1, -1, -1, 74, -1, -1, -1, -1, - -1, 80, 81, 82, -1, 84, 3, 4, 5, 6, - 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, - 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, - 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, - 47, 48, -1, -1, 51, 52, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 70, -1, -1, -1, 74, -1, -1, - -1, -1, -1, 80, 81, 82, -1, 84, 3, 4, - 5, 6, 7, 8, 9, 10, 11, 12, -1, -1, - -1, -1, -1, -1, -1, -1, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, - -1, 36, 37, 38, 39, -1, 41, 42, 43, 44, - 45, 46, 47, 48, -1, -1, 51, 52, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 70, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 80, 81, 82, -1, 84, - 3, 4, 5, 6, -1, 8, 9, 10, 11, 12, - -1, -1, -1, -1, -1, -1, -1, -1, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - -1, -1, -1, 36, 37, 38, 39, -1, 41, 42, - 43, 44, 45, 46, 47, 48, -1, -1, 51, 52, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, 70, 4, 5, - 6, -1, -1, -1, 10, 11, 12, -1, 81, 82, - -1, 84, -1, -1, -1, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, - -1, -1, 38, 39, -1, 41, 42, 43, 44, 45, - 46, 47, 48, -1, -1, 51, 52, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, 70, -1, -1, 73, -1, -1, - -1, -1, -1, -1, -1, 81, 82, -1, 84, 4, - 5, 6, -1, -1, -1, 10, 11, 12, -1, -1, - -1, -1, -1, -1, -1, -1, 21, 22, 23, 24, - 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, - -1, -1, -1, 38, 39, -1, 41, 42, 43, 44, - 45, 46, 47, 48, -1, -1, 51, 52, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, 70, 4, 5, 6, -1, - -1, -1, 10, 11, 12, 80, 81, 82, -1, 84, - -1, -1, -1, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, -1, -1, -1, -1, -1, - 38, 39, -1, 41, 42, 43, 44, 45, 46, 47, - 48, -1, -1, 51, 52, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 70, -1, -1, 73, -1, -1, -1, -1, - -1, -1, -1, 81, 82, -1, 84, 4, 5, 6, - -1, -1, -1, 10, 11, 12, -1, -1, -1, -1, - -1, -1, -1, -1, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, - -1, 38, 39, -1, 41, 42, 43, 44, 45, 46, - 47, 48, -1, -1, 51, 52, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, 70, 4, 5, 6, -1, -1, -1, - 10, 11, 12, -1, 81, 82, -1, 84, -1, -1, - -1, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, -1, -1, -1, -1, -1, 38, 39, - -1, 41, 42, 43, 44, 45, 46, 47, 48, -1, - -1, 51, 52, -1, -1, -1, -1, -1, -1, -1, - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, - 70, 4, 5, 6, -1, -1, -1, 10, 11, 12, - -1, 81, 82, -1, 84, -1, -1, -1, 21, 22, - 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, - -1, -1, -1, -1, -1, 38, 39, -1, 41, 42, - -1, 44, -1, -1, -1, -1, -1, -1, -1, -1, - -1, -1, 0, -1, -1, 3, 4, 5, 6, 7, - 8, 9, 10, 11, 12, -1, -1, -1, -1, -1, - -1, -1, 75, 21, 22, 23, 24, 25, 26, 27, - 28, 29, 30, 31, 32, -1, -1, -1, 36, 37, - 38, 39, -1, 41, 42, -1, 44, 4, 5, 6, - -1, -1, -1, 10, 11, 12, -1, -1, -1, -1, - -1, -1, -1, -1, 21, 22, 23, 24, 25, 26, - 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, - -1, 38, 39, -1, 41, 42, 43, 44, -1, -1, - -1, 48, 3, 4, 5, 6, 7, 8, 9, 10, - 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, - 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, - 31, 32, -1, -1, -1, 36, 37, 38, 39, -1, - 41, 42, -1, 44, 4, 5, 6, -1, -1, -1, - 10, 11, 12, -1, -1, -1, -1, -1, -1, -1, - -1, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, -1, 10, 11, 12, -1, 38, 39, - -1, 41, 42, -1, 44, 21, 22, 23, 24, 25, - 26, 27, 28, 29, 30, 31, 32, -1, -1, -1, - -1, -1, 38, 39, -1, 41, 42, -1, 44 -}; - -/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing - symbol of state STATE-NUM. */ -static const yytype_uint8 yystos[] = -{ - 0, 3, 4, 5, 6, 7, 8, 9, 10, 11, - 12, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 36, 37, 38, 39, 41, 42, 44, - 124, 125, 126, 127, 128, 133, 134, 135, 136, 137, - 138, 139, 140, 141, 168, 169, 170, 37, 43, 138, - 43, 74, 80, 171, 71, 77, 3, 33, 34, 35, - 130, 131, 136, 77, 80, 43, 137, 139, 72, 0, - 169, 139, 74, 137, 142, 143, 74, 154, 130, 129, - 132, 137, 131, 43, 70, 72, 79, 43, 45, 46, - 47, 48, 51, 52, 70, 81, 82, 84, 95, 96, - 97, 99, 100, 101, 102, 103, 104, 105, 106, 107, - 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, - 118, 119, 123, 137, 80, 142, 43, 144, 145, 75, - 143, 13, 14, 15, 17, 18, 19, 20, 40, 74, - 75, 80, 106, 119, 120, 122, 124, 125, 137, 147, - 148, 149, 150, 155, 156, 157, 160, 167, 43, 129, - 132, 72, 79, 73, 123, 120, 146, 106, 106, 122, - 51, 52, 72, 76, 71, 71, 77, 39, 120, 70, - 106, 85, 86, 82, 84, 53, 54, 88, 89, 55, - 56, 57, 59, 58, 93, 73, 75, 72, 77, 80, - 80, 80, 162, 70, 70, 80, 80, 122, 70, 75, - 151, 60, 61, 62, 69, 79, 121, 77, 80, 75, - 148, 72, 73, 123, 146, 73, 71, 98, 122, 43, - 48, 101, 120, 106, 106, 108, 108, 110, 110, 110, - 110, 111, 111, 115, 116, 117, 122, 123, 145, 148, - 163, 122, 80, 161, 155, 120, 120, 123, 79, 73, - 73, 78, 73, 40, 147, 156, 164, 71, 122, 135, - 159, 152, 73, 146, 79, 120, 70, 159, 165, 166, - 148, 158, 43, 71, 75, 146, 122, 80, 71, 16, - 79, 149, 153, 154, 71, 122, 153, 148, 146, 80 -}; - -#define yyerrok (yyerrstatus = 0) -#define yyclearin (yychar = YYEMPTY) -#define YYEMPTY (-2) -#define YYEOF 0 - -#define YYACCEPT goto yyacceptlab -#define YYABORT goto yyabortlab -#define YYERROR goto yyerrorlab - - -/* Like YYERROR except do call yyerror. This remains here temporarily - to ease the transition to the new meaning of YYERROR, for GCC. - Once GCC version 2 has supplanted version 1, this can go. */ - -#define YYFAIL goto yyerrlab - -#define YYRECOVERING() (!!yyerrstatus) - -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ - yyerror (YY_("syntax error: cannot back up")); \ - YYERROR; \ - } \ -while (YYID (0)) - - -#define YYTERROR 1 -#define YYERRCODE 256 - - -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - -#ifndef YY_LOCATION_PRINT -# if YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif -#endif - - -/* YYLEX -- calling `yylex' with the right arguments. */ - -#ifdef YYLEX_PARAM -# define YYLEX yylex (&yylval, YYLEX_PARAM) -#else -# define YYLEX yylex (&yylval) -#endif - -/* Enable debugging if requested. */ -#if YYDEBUG - -# ifndef YYFPRINTF -# include /* INFRINGES ON USER NAME SPACE */ -# define YYFPRINTF fprintf -# endif - -# define YYDPRINTF(Args) \ -do { \ - if (yydebug) \ - YYFPRINTF Args; \ -} while (YYID (0)) - -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yy_symbol_print (stderr, \ - Type, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (YYID (0)) - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_value_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (!yyvaluep) - return; -# ifdef YYPRINT - if (yytype < YYNTOKENS) - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# else - YYUSE (yyoutput); -# endif - switch (yytype) - { - default: - break; - } -} - - -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) -#else -static void -yy_symbol_print (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE const * const yyvaluep; -#endif -{ - if (yytype < YYNTOKENS) - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); - else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - yy_symbol_value_print (yyoutput, yytype, yyvaluep); - YYFPRINTF (yyoutput, ")"); -} - -/*------------------------------------------------------------------. -| yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (included). | -`------------------------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop) -#else -static void -yy_stack_print (yybottom, yytop) - yytype_int16 *yybottom; - yytype_int16 *yytop; -#endif -{ - YYFPRINTF (stderr, "Stack now"); - for (; yybottom <= yytop; yybottom++) - { - int yybot = *yybottom; - YYFPRINTF (stderr, " %d", yybot); - } - YYFPRINTF (stderr, "\n"); -} - -# define YY_STACK_PRINT(Bottom, Top) \ -do { \ - if (yydebug) \ - yy_stack_print ((Bottom), (Top)); \ -} while (YYID (0)) - - -/*------------------------------------------------. -| Report that the YYRULE is going to be reduced. | -`------------------------------------------------*/ - -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yy_reduce_print (YYSTYPE *yyvsp, int yyrule) -#else -static void -yy_reduce_print (yyvsp, yyrule) - YYSTYPE *yyvsp; - int yyrule; -#endif -{ - int yynrhs = yyr2[yyrule]; - int yyi; - unsigned long int yylno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", - yyrule - 1, yylno); - /* The symbols being reduced. */ - for (yyi = 0; yyi < yynrhs; yyi++) - { - YYFPRINTF (stderr, " $%d = ", yyi + 1); - yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], - &(yyvsp[(yyi + 1) - (yynrhs)]) - ); - YYFPRINTF (stderr, "\n"); - } -} - -# define YY_REDUCE_PRINT(Rule) \ -do { \ - if (yydebug) \ - yy_reduce_print (yyvsp, Rule); \ -} while (YYID (0)) - -/* Nonzero means print parse trace. It is left uninitialized so that - multiple parsers can coexist. */ -int yydebug; -#else /* !YYDEBUG */ -# define YYDPRINTF(Args) -# define YY_SYMBOL_PRINT(Title, Type, Value, Location) -# define YY_STACK_PRINT(Bottom, Top) -# define YY_REDUCE_PRINT(Rule) -#endif /* !YYDEBUG */ - - -/* YYINITDEPTH -- initial size of the parser's stacks. */ -#ifndef YYINITDEPTH -# define YYINITDEPTH 200 -#endif - -/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only - if the built-in stack extension method is used). - - Do not make this value too large; the results are undefined if - YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) - evaluated with infinite-precision integer arithmetic. */ - -#ifndef YYMAXDEPTH -# define YYMAXDEPTH 10000 -#endif - - - -#if YYERROR_VERBOSE - -# ifndef yystrlen -# if defined __GLIBC__ && defined _STRING_H -# define yystrlen strlen -# else -/* Return the length of YYSTR. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static YYSIZE_T -yystrlen (const char *yystr) -#else -static YYSIZE_T -yystrlen (yystr) - const char *yystr; -#endif -{ - YYSIZE_T yylen; - for (yylen = 0; yystr[yylen]; yylen++) - continue; - return yylen; -} -# endif -# endif - -# ifndef yystpcpy -# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE -# define yystpcpy stpcpy -# else -/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in - YYDEST. */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static char * -yystpcpy (char *yydest, const char *yysrc) -#else -static char * -yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -#endif -{ - char *yyd = yydest; - const char *yys = yysrc; - - while ((*yyd++ = *yys++) != '\0') - continue; - - return yyd - 1; -} -# endif -# endif - -# ifndef yytnamerr -/* Copy to YYRES the contents of YYSTR after stripping away unnecessary - quotes and backslashes, so that it's suitable for yyerror. The - heuristic is that double-quoting is unnecessary unless the string - contains an apostrophe, a comma, or backslash (other than - backslash-backslash). YYSTR is taken from yytname. If YYRES is - null, do not copy; instead, return the length of what the result - would have been. */ -static YYSIZE_T -yytnamerr (char *yyres, const char *yystr) -{ - if (*yystr == '"') - { - YYSIZE_T yyn = 0; - char const *yyp = yystr; - - for (;;) - switch (*++yyp) - { - case '\'': - case ',': - goto do_not_strip_quotes; - - case '\\': - if (*++yyp != '\\') - goto do_not_strip_quotes; - /* Fall through. */ - default: - if (yyres) - yyres[yyn] = *yyp; - yyn++; - break; - - case '"': - if (yyres) - yyres[yyn] = '\0'; - return yyn; - } - do_not_strip_quotes: ; - } - - if (! yyres) - return yystrlen (yystr); - - return yystpcpy (yyres, yystr) - yyres; -} -# endif - -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) -{ - int yyn = yypact[yystate]; - - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else - { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; - -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; - - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; - - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; - - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); - - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } -} -#endif /* YYERROR_VERBOSE */ - - -/*-----------------------------------------------. -| Release the memory associated to this symbol. | -`-----------------------------------------------*/ - -/*ARGSUSED*/ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -static void -yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) -#else -static void -yydestruct (yymsg, yytype, yyvaluep) - const char *yymsg; - int yytype; - YYSTYPE *yyvaluep; -#endif -{ - YYUSE (yyvaluep); - - if (!yymsg) - yymsg = "Deleting"; - YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - - switch (yytype) - { - - default: - break; - } -} - -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ - - - - - -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - -#ifdef YYPARSE_PARAM -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void *YYPARSE_PARAM) -#else -int -yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -#endif -#else /* ! YYPARSE_PARAM */ -#if (defined __STDC__ || defined __C99__FUNC__ \ - || defined __cplusplus || defined _MSC_VER) -int -yyparse (void) -#else -int -yyparse () - -#endif -#endif -{ -/* The lookahead symbol. */ -int yychar; - -/* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; - - /* 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. - - 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; - - YYSIZE_T yystacksize; - - 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; - -#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)) - - /* 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; - yystacksize = YYINITDEPTH; - - YYDPRINTF ((stderr, "Starting parse\n")); - - yystate = 0; - yyerrstatus = 0; - yynerrs = 0; - 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; - - goto yysetstate; - -/*------------------------------------------------------------. -| yynewstate -- Push a new state, which is found in yystate. | -`------------------------------------------------------------*/ - yynewstate: - /* In all cases, when you get here, the value and location stacks - have just been pushed. So pushing a state here evens the stacks. */ - yyssp++; - - yysetstate: - *yyssp = yystate; - - if (yyss + yystacksize - 1 <= yyssp) - { - /* Get the current used size of the three stacks, in elements. */ - YYSIZE_T yysize = yyssp - yyss + 1; - -#ifdef yyoverflow - { - /* Give user a chance to reallocate the stack. Use copies of - these so that the &'s don't force the real ones into - memory. */ - YYSTYPE *yyvs1 = yyvs; - yytype_int16 *yyss1 = yyss; - - /* Each stack pointer address is followed by the size of the - data in use in that stack, in bytes. This used to be a - conditional around just the two extra args, but that might - be undefined if yyoverflow is a macro. */ - yyoverflow (YY_("memory exhausted"), - &yyss1, yysize * sizeof (*yyssp), - &yyvs1, yysize * sizeof (*yyvsp), - &yystacksize); - - yyss = yyss1; - yyvs = yyvs1; - } -#else /* no yyoverflow */ -# ifndef YYSTACK_RELOCATE - goto yyexhaustedlab; -# else - /* Extend the stack our own way. */ - if (YYMAXDEPTH <= yystacksize) - goto yyexhaustedlab; - yystacksize *= 2; - if (YYMAXDEPTH < yystacksize) - yystacksize = YYMAXDEPTH; - - { - yytype_int16 *yyss1 = yyss; - union yyalloc *yyptr = - (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); - if (! yyptr) - goto yyexhaustedlab; - YYSTACK_RELOCATE (yyss_alloc, yyss); - YYSTACK_RELOCATE (yyvs_alloc, yyvs); -# undef YYSTACK_RELOCATE - if (yyss1 != yyssa) - YYSTACK_FREE (yyss1); - } -# endif -#endif /* no yyoverflow */ - - yyssp = yyss + yysize - 1; - yyvsp = yyvs + yysize - 1; - - YYDPRINTF ((stderr, "Stack size increased to %lu\n", - (unsigned long int) yystacksize)); - - if (yyss + yystacksize - 1 <= yyssp) - YYABORT; - } - - YYDPRINTF ((stderr, "Entering state %d\n", yystate)); - - if (yystate == YYFINAL) - YYACCEPT; - - goto yybackup; - -/*-----------. -| yybackup. | -`-----------*/ -yybackup: - - /* Do appropriate processing given the current state. Read a - lookahead token if we need one and don't already have one. */ - - /* First try to decide what to do without reference to lookahead token. */ - yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) - goto yydefault; - - /* Not known => get a lookahead token if don't already have one. */ - - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ - if (yychar == YYEMPTY) - { - YYDPRINTF ((stderr, "Reading a token: ")); - yychar = YYLEX; - } - - if (yychar <= YYEOF) - { - yychar = yytoken = YYEOF; - YYDPRINTF ((stderr, "Now at end of input.\n")); - } - else - { - yytoken = YYTRANSLATE (yychar); - YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); - } - - /* If the proper action on seeing token YYTOKEN is to reduce or to - detect an error, take that action. */ - yyn += yytoken; - if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) - goto yydefault; - yyn = yytable[yyn]; - if (yyn <= 0) - { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; - yyn = -yyn; - goto yyreduce; - } - - /* Count tokens shifted since error; after three, turn off error - status. */ - if (yyerrstatus) - yyerrstatus--; - - /* Shift the lookahead token. */ - YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); - - /* Discard the shifted token. */ - yychar = YYEMPTY; - - yystate = yyn; - *++yyvsp = yylval; - - goto yynewstate; - - -/*-----------------------------------------------------------. -| yydefault -- do the default action for the current state. | -`-----------------------------------------------------------*/ -yydefault: - yyn = yydefact[yystate]; - if (yyn == 0) - goto yyerrlab; - goto yyreduce; - - -/*-----------------------------. -| yyreduce -- Do a reduction. | -`-----------------------------*/ -yyreduce: - /* yyn is the number of a rule to reduce with. */ - yylen = yyr2[yyn]; - - /* If YYLEN is nonzero, implement the default value of the action: - `$$ = $1'. - - Otherwise, the following line sets YYVAL to garbage. - This behavior is undocumented and Bison - users should not rely upon it. Assigning to YYVAL - unconditionally makes the parser a bit smaller, and it avoids a - GCC warning that YYVAL may be used uninitialized. */ - yyval = yyvsp[1-yylen]; - - - YY_REDUCE_PRINT (yyn); - switch (yyn) - { - case 2: - - { - // The symbol table search was done in the lexical phase - const TSymbol* symbol = (yyvsp[(1) - (1)].lex).symbol; - const TVariable* variable; - if (symbol == 0) { - parseContext->error((yyvsp[(1) - (1)].lex).line, "undeclared identifier", (yyvsp[(1) - (1)].lex).string->c_str(), ""); - parseContext->recover(); - TType type(EbtFloat, EbpUndefined); - TVariable* fakeVariable = new TVariable((yyvsp[(1) - (1)].lex).string, type); - parseContext->symbolTable.insert(*fakeVariable); - variable = fakeVariable; - } else { - // This identifier can only be a variable type symbol - if (! symbol->isVariable()) { - parseContext->error((yyvsp[(1) - (1)].lex).line, "variable expected", (yyvsp[(1) - (1)].lex).string->c_str(), ""); - parseContext->recover(); - } - variable = static_cast(symbol); - } - - // don't delete $1.string, it's used by error recovery, and the pool - // pop will reclaim the memory - - if (variable->getType().getQualifier() == EvqConst ) { - ConstantUnion* constArray = variable->getConstPointer(); - TType t(variable->getType()); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(constArray, t, (yyvsp[(1) - (1)].lex).line); - } else - (yyval.interm.intermTypedNode) = parseContext->intermediate.addSymbol(variable->getUniqueId(), - variable->getName(), - variable->getType(), (yyvsp[(1) - (1)].lex).line); - } - break; - - case 3: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 4: - - { - // - // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders, - // check for overflow for constants - // - if (abs((yyvsp[(1) - (1)].lex).i) >= (1 << 16)) { - parseContext->error((yyvsp[(1) - (1)].lex).line, " integer constant overflow", "", ""); - parseContext->recover(); - } - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setIConst((yyvsp[(1) - (1)].lex).i); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line); - } - break; - - case 5: - - { - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setFConst((yyvsp[(1) - (1)].lex).f); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line); - } - break; - - case 6: - - { - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst((yyvsp[(1) - (1)].lex).b); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].lex).line); - } - break; - - case 7: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (3)].interm.intermTypedNode); - } - break; - - case 8: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 9: - - { - if (!(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()) - parseContext->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", (yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()->getSymbol().c_str(), ""); - else - parseContext->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", "expression", ""); - parseContext->recover(); - } - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) { - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays - (yyval.interm.intermTypedNode) = parseContext->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); - } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) { // constant folding for vectors - TVectorFields fields; - fields.num = 1; - fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(); // need to do it this way because v.xy sends fields integer array - (yyval.interm.intermTypedNode) = parseContext->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); - } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices - (yyval.interm.intermTypedNode) = parseContext->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); - } - } else { - if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) { - if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() ) { - parseContext->error((yyvsp[(2) - (4)].lex).line, "", "[", "field selection out of range '%d'", (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst()); - parseContext->recover(); - } else { - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) { - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst()) { - if (parseContext->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), true, (yyvsp[(2) - (4)].lex).line)) - parseContext->recover(); - } else { - if (parseContext->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line)) - parseContext->recover(); - } - } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) { - parseContext->error((yyvsp[(2) - (4)].lex).line, "", "[", "array index out of range '%d'", (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst()); - parseContext->recover(); - } - } - (yyval.interm.intermTypedNode) = parseContext->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); - } - } else { - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) { - parseContext->error((yyvsp[(2) - (4)].lex).line, "", "[", "array must be redeclared with a size before being indexed with a variable"); - parseContext->recover(); - } - - (yyval.interm.intermTypedNode) = parseContext->intermediate.addIndex(EOpIndexIndirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line); - } - } - if ((yyval.interm.intermTypedNode) == 0) { - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setFConst(0.0f); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), (yyvsp[(2) - (4)].lex).line); - } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct()) - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getStruct(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getTypeName())); - else - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize(), (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix())); - - if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) - (yyval.interm.intermTypedNode)->getTypePointer()->changeQualifier(EvqConst); - } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize())); - else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (yyvsp[(1) - (4)].interm.intermTypedNode)->getNominalSize())); - else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqConst)); - else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (4)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getPrecision(), EvqTemporary)); - else - (yyval.interm.intermTypedNode)->setType((yyvsp[(1) - (4)].interm.intermTypedNode)->getType()); - } - break; - - case 10: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 11: - - { - if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray()) { - parseContext->error((yyvsp[(3) - (3)].lex).line, "cannot apply dot operator to an array", ".", ""); - parseContext->recover(); - } - - if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isVector()) { - TVectorFields fields; - if (! parseContext->parseVectorFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) { - fields.num = 1; - fields.offsets[0] = 0; - parseContext->recover(); - } - - if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { // constant folding for vector fields - (yyval.interm.intermTypedNode) = parseContext->addConstVectorNode(fields, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].lex).line); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - else - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqConst, (int) (*(yyvsp[(3) - (3)].lex).string).size())); - } else { - if (fields.num == 1) { - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setIConst(fields.offsets[0]); - TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision())); - } else { - TString vectorString = *(yyvsp[(3) - (3)].lex).string; - TIntermTyped* index = parseContext->intermediate.addSwizzle(fields, (yyvsp[(3) - (3)].lex).line); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addIndex(EOpVectorSwizzle, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(), EvqTemporary, (int) vectorString.size())); - } - } - } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->isMatrix()) { - TMatrixFields fields; - if (! parseContext->parseMatrixFields(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize(), fields, (yyvsp[(3) - (3)].lex).line)) { - fields.wholeRow = false; - fields.wholeCol = false; - fields.row = 0; - fields.col = 0; - parseContext->recover(); - } - - if (fields.wholeRow || fields.wholeCol) { - parseContext->error((yyvsp[(2) - (3)].lex).line, " non-scalar fields not implemented yet", ".", ""); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setIConst(0); - TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision(),EvqTemporary, (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize())); - } else { - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setIConst(fields.col * (yyvsp[(1) - (3)].interm.intermTypedNode)->getNominalSize() + fields.row); - TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), (yyvsp[(3) - (3)].lex).line); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); - (yyval.interm.intermTypedNode)->setType(TType((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType(), (yyvsp[(1) - (3)].interm.intermTypedNode)->getPrecision())); - } - } else if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getBasicType() == EbtStruct) { - bool fieldFound = false; - TTypeList* fields = (yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getStruct(); - if (fields == 0) { - parseContext->error((yyvsp[(2) - (3)].lex).line, "structure has no fields", "Internal Error", ""); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } else { - unsigned int i; - for (i = 0; i < fields->size(); ++i) { - if ((*fields)[i].type->getFieldName() == *(yyvsp[(3) - (3)].lex).string) { - fieldFound = true; - break; - } - } - if (fieldFound) { - if ((yyvsp[(1) - (3)].interm.intermTypedNode)->getType().getQualifier() == EvqConst) { - (yyval.interm.intermTypedNode) = parseContext->addConstStruct(*(yyvsp[(3) - (3)].lex).string, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - else { - (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type); - // change the qualifier of the return type, not of the structure field - // as the structure definition is shared between various structures. - (yyval.interm.intermTypedNode)->getTypePointer()->changeQualifier(EvqConst); - } - } else { - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setIConst(i); - TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, (yyvsp[(3) - (3)].lex).line); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addIndex(EOpIndexDirectStruct, (yyvsp[(1) - (3)].interm.intermTypedNode), index, (yyvsp[(2) - (3)].lex).line); - (yyval.interm.intermTypedNode)->setType(*(*fields)[i].type); - } - } else { - parseContext->error((yyvsp[(2) - (3)].lex).line, " no such field in structure", (yyvsp[(3) - (3)].lex).string->c_str(), ""); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - } - } else { - parseContext->error((yyvsp[(2) - (3)].lex).line, " field selection requires structure, vector, or matrix on left hand side", (yyvsp[(3) - (3)].lex).string->c_str(), ""); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - // don't delete $3.string, it's from the pool - } - break; - - case 12: - - { - if (parseContext->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode))) - parseContext->recover(); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addUnaryMath(EOpPostIncrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->unaryOpError((yyvsp[(2) - (2)].lex).line, "++", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode); - } - } - break; - - case 13: - - { - if (parseContext->lValueErrorCheck((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode))) - parseContext->recover(); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addUnaryMath(EOpPostDecrement, (yyvsp[(1) - (2)].interm.intermTypedNode), (yyvsp[(2) - (2)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->unaryOpError((yyvsp[(2) - (2)].lex).line, "--", (yyvsp[(1) - (2)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (2)].interm.intermTypedNode); - } - } - break; - - case 14: - - { - if (parseContext->integerErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode), "[]")) - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 15: - - { - TFunction* fnCall = (yyvsp[(1) - (1)].interm).function; - TOperator op = fnCall->getBuiltInOp(); - - if (op != EOpNull) - { - // - // Then this should be a constructor. - // Don't go through the symbol table for constructors. - // Their parameters will be verified algorithmically. - // - TType type(EbtVoid, EbpUndefined); // use this to get the type back - if (parseContext->constructorErrorCheck((yyvsp[(1) - (1)].interm).line, (yyvsp[(1) - (1)].interm).intermNode, *fnCall, op, &type)) { - (yyval.interm.intermTypedNode) = 0; - } else { - // - // It's a constructor, of type 'type'. - // - (yyval.interm.intermTypedNode) = parseContext->addConstructor((yyvsp[(1) - (1)].interm).intermNode, &type, op, fnCall, (yyvsp[(1) - (1)].interm).line); - } - - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->recover(); - (yyval.interm.intermTypedNode) = parseContext->intermediate.setAggregateOperator(0, op, (yyvsp[(1) - (1)].interm).line); - } - (yyval.interm.intermTypedNode)->setType(type); - } else { - // - // Not a constructor. Find it in the symbol table. - // - const TFunction* fnCandidate; - bool builtIn; - fnCandidate = parseContext->findFunction((yyvsp[(1) - (1)].interm).line, fnCall, &builtIn); - if (fnCandidate) { - // - // A declared function. But, it might still map to a built-in - // operation. - // - op = fnCandidate->getBuiltInOp(); - if (builtIn && op != EOpNull) { - // - // A function call mapped to a built-in operation. - // - if (fnCandidate->getParamCount() == 1) { - // - // Treat it like a built-in unary operator. - // - (yyval.interm.intermTypedNode) = parseContext->intermediate.addUnaryMath(op, (yyvsp[(1) - (1)].interm).intermNode, 0, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), " wrong operand type", "Internal Error", - "built in unary operator function. Type: %s", - static_cast((yyvsp[(1) - (1)].interm).intermNode)->getCompleteString().c_str()); - YYERROR; - } - } else { - (yyval.interm.intermTypedNode) = parseContext->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, op, (yyvsp[(1) - (1)].interm).line); - } - } else { - // This is a real function call - - (yyval.interm.intermTypedNode) = parseContext->intermediate.setAggregateOperator((yyvsp[(1) - (1)].interm).intermAggregate, EOpFunctionCall, (yyvsp[(1) - (1)].interm).line); - (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType()); - - // this is how we know whether the given function is a builtIn function or a user defined function - // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also - // if builtIn == true, it's definitely a builtIn function with EOpNull - if (!builtIn) - (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined(); - (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName()); - - TQualifier qual; - TQualifierList& qualifierList = (yyval.interm.intermTypedNode)->getAsAggregate()->getQualifier(); - for (int i = 0; i < fnCandidate->getParamCount(); ++i) { - qual = (*fnCandidate)[i].type->getQualifier(); - if (qual == EvqOut || qual == EvqInOut) { - if (parseContext->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) { - parseContext->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error", ""); - parseContext->recover(); - } - } - qualifierList.push_back(qual); - } - } - (yyval.interm.intermTypedNode)->setType(fnCandidate->getReturnType()); - } else { - // error message was put out by PaFindFunction() - // Put on a dummy node for error recovery - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setFConst(0.0f); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), (yyvsp[(1) - (1)].interm).line); - parseContext->recover(); - } - } - delete fnCall; - } - break; - - case 16: - - { - (yyval.interm) = (yyvsp[(1) - (1)].interm); - } - break; - - case 17: - - { - parseContext->error((yyvsp[(3) - (3)].interm).line, "methods are not supported", "", ""); - parseContext->recover(); - (yyval.interm) = (yyvsp[(3) - (3)].interm); - } - break; - - case 18: - - { - (yyval.interm) = (yyvsp[(1) - (2)].interm); - (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; - } - break; - - case 19: - - { - (yyval.interm) = (yyvsp[(1) - (2)].interm); - (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; - } - break; - - case 20: - - { - (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); - (yyval.interm).intermNode = 0; - } - break; - - case 21: - - { - (yyval.interm).function = (yyvsp[(1) - (1)].interm.function); - (yyval.interm).intermNode = 0; - } - break; - - case 22: - - { - TParameter param = { 0, new TType((yyvsp[(2) - (2)].interm.intermTypedNode)->getType()) }; - (yyvsp[(1) - (2)].interm.function)->addParameter(param); - (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); - (yyval.interm).intermNode = (yyvsp[(2) - (2)].interm.intermTypedNode); - } - break; - - case 23: - - { - TParameter param = { 0, new TType((yyvsp[(3) - (3)].interm.intermTypedNode)->getType()) }; - (yyvsp[(1) - (3)].interm).function->addParameter(param); - (yyval.interm).function = (yyvsp[(1) - (3)].interm).function; - (yyval.interm).intermNode = parseContext->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); - } - break; - - case 24: - - { - (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function); - } - break; - - case 25: - - { - // - // Constructor - // - if ((yyvsp[(1) - (1)].interm.type).array) { - if (parseContext->extensionErrorCheck((yyvsp[(1) - (1)].interm.type).line, "GL_3DL_array_objects")) { - parseContext->recover(); - (yyvsp[(1) - (1)].interm.type).setArray(false); - } - } - - if ((yyvsp[(1) - (1)].interm.type).userDef) { - TString tempString = ""; - TType type((yyvsp[(1) - (1)].interm.type)); - TFunction *function = new TFunction(&tempString, type, EOpConstructStruct); - (yyval.interm.function) = function; - } else { - TOperator op = EOpNull; - switch ((yyvsp[(1) - (1)].interm.type).type) { - case EbtFloat: - if ((yyvsp[(1) - (1)].interm.type).matrix) { - switch((yyvsp[(1) - (1)].interm.type).size) { - case 2: op = EOpConstructMat2; break; - case 3: op = EOpConstructMat3; break; - case 4: op = EOpConstructMat4; break; - } - } else { - switch((yyvsp[(1) - (1)].interm.type).size) { - case 1: op = EOpConstructFloat; break; - case 2: op = EOpConstructVec2; break; - case 3: op = EOpConstructVec3; break; - case 4: op = EOpConstructVec4; break; - } - } - break; - case EbtInt: - switch((yyvsp[(1) - (1)].interm.type).size) { - case 1: op = EOpConstructInt; break; - case 2: FRAG_VERT_ONLY("ivec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec2; break; - case 3: FRAG_VERT_ONLY("ivec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec3; break; - case 4: FRAG_VERT_ONLY("ivec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructIVec4; break; - } - break; - case EbtBool: - switch((yyvsp[(1) - (1)].interm.type).size) { - case 1: op = EOpConstructBool; break; - case 2: FRAG_VERT_ONLY("bvec2", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec2; break; - case 3: FRAG_VERT_ONLY("bvec3", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec3; break; - case 4: FRAG_VERT_ONLY("bvec4", (yyvsp[(1) - (1)].interm.type).line); op = EOpConstructBVec4; break; - } - break; - } - if (op == EOpNull) { - parseContext->error((yyvsp[(1) - (1)].interm.type).line, "cannot construct this type", TType::getBasicString((yyvsp[(1) - (1)].interm.type).type), ""); - parseContext->recover(); - (yyvsp[(1) - (1)].interm.type).type = EbtFloat; - op = EOpConstructFloat; - } - TString tempString = ""; - TType type((yyvsp[(1) - (1)].interm.type)); - TFunction *function = new TFunction(&tempString, type, op); - (yyval.interm.function) = function; - } - } - break; - - case 26: - - { - if (parseContext->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) - parseContext->recover(); - TType type(EbtVoid, EbpUndefined); - TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type); - (yyval.interm.function) = function; - } - break; - - case 27: - - { - if (parseContext->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) - parseContext->recover(); - TType type(EbtVoid, EbpUndefined); - TFunction *function = new TFunction((yyvsp[(1) - (1)].lex).string, type); - (yyval.interm.function) = function; - } - break; - - case 28: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 29: - - { - if (parseContext->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode))) - parseContext->recover(); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addUnaryMath(EOpPreIncrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->unaryOpError((yyvsp[(1) - (2)].lex).line, "++", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); - } - } - break; - - case 30: - - { - if (parseContext->lValueErrorCheck((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode))) - parseContext->recover(); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addUnaryMath(EOpPreDecrement, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->unaryOpError((yyvsp[(1) - (2)].lex).line, "--", (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); - } - } - break; - - case 31: - - { - if ((yyvsp[(1) - (2)].interm).op != EOpNull) { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addUnaryMath((yyvsp[(1) - (2)].interm).op, (yyvsp[(2) - (2)].interm.intermTypedNode), (yyvsp[(1) - (2)].interm).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - const char* errorOp = ""; - switch((yyvsp[(1) - (2)].interm).op) { - case EOpNegative: errorOp = "-"; break; - case EOpLogicalNot: errorOp = "!"; break; - default: break; - } - parseContext->unaryOpError((yyvsp[(1) - (2)].interm).line, errorOp, (yyvsp[(2) - (2)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); - } - } else - (yyval.interm.intermTypedNode) = (yyvsp[(2) - (2)].interm.intermTypedNode); - } - break; - - case 32: - - { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNull; } - break; - - case 33: - - { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpNegative; } - break; - - case 34: - - { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpLogicalNot; } - break; - - case 35: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 36: - - { - FRAG_VERT_ONLY("*", (yyvsp[(2) - (3)].lex).line); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpMul, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "*", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - } - break; - - case 37: - - { - FRAG_VERT_ONLY("/", (yyvsp[(2) - (3)].lex).line); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpDiv, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "/", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - } - break; - - case 38: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 39: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpAdd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "+", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - } - break; - - case 40: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpSub, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "-", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } - } - break; - - case 41: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 42: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 43: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpLessThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "<", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } - } - break; - - case 44: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpGreaterThan, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, ">", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } - } - break; - - case 45: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpLessThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "<=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } - } - break; - - case 46: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpGreaterThanEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, ">=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } - } - break; - - case 47: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 48: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "==", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } else if (((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray() || (yyvsp[(3) - (3)].interm.intermTypedNode)->isArray()) && parseContext->extensionErrorCheck((yyvsp[(2) - (3)].lex).line, "GL_3DL_array_objects")) - parseContext->recover(); - } - break; - - case 49: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpNotEqual, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "!=", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } else if (((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray() || (yyvsp[(3) - (3)].interm.intermTypedNode)->isArray()) && parseContext->extensionErrorCheck((yyvsp[(2) - (3)].lex).line, "GL_3DL_array_objects")) - parseContext->recover(); - } - break; - - case 50: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 51: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 52: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 53: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 54: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpLogicalAnd, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "&&", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } - } - break; - - case 55: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 56: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpLogicalXor, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "^^", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } - } - break; - - case 57: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 58: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addBinaryMath(EOpLogicalOr, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line, parseContext->symbolTable); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, "||", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - ConstantUnion *unionArray = new ConstantUnion[1]; - unionArray->setBConst(false); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), (yyvsp[(2) - (3)].lex).line); - } - } - break; - - case 59: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 60: - - { - if (parseContext->boolErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.intermTypedNode))) - parseContext->recover(); - - (yyval.interm.intermTypedNode) = parseContext->intermediate.addSelection((yyvsp[(1) - (5)].interm.intermTypedNode), (yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.intermTypedNode), (yyvsp[(2) - (5)].lex).line); - if ((yyvsp[(3) - (5)].interm.intermTypedNode)->getType() != (yyvsp[(5) - (5)].interm.intermTypedNode)->getType()) - (yyval.interm.intermTypedNode) = 0; - - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (5)].lex).line, ":", (yyvsp[(3) - (5)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(5) - (5)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(5) - (5)].interm.intermTypedNode); - } - } - break; - - case 61: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 62: - - { - if (parseContext->lValueErrorCheck((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode))) - parseContext->recover(); - (yyval.interm.intermTypedNode) = parseContext->intermediate.addAssign((yyvsp[(2) - (3)].interm).op, (yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].interm).line); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->assignError((yyvsp[(2) - (3)].interm).line, "assign", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (3)].interm.intermTypedNode); - } else if (((yyvsp[(1) - (3)].interm.intermTypedNode)->isArray() || (yyvsp[(3) - (3)].interm.intermTypedNode)->isArray()) && parseContext->extensionErrorCheck((yyvsp[(2) - (3)].interm).line, "GL_3DL_array_objects")) - parseContext->recover(); - } - break; - - case 63: - - { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAssign; } - break; - - case 64: - - { FRAG_VERT_ONLY("*=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpMulAssign; } - break; - - case 65: - - { FRAG_VERT_ONLY("/=", (yyvsp[(1) - (1)].lex).line); (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpDivAssign; } - break; - - case 66: - - { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpAddAssign; } - break; - - case 67: - - { (yyval.interm).line = (yyvsp[(1) - (1)].lex).line; (yyval.interm).op = EOpSubAssign; } - break; - - case 68: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 69: - - { - (yyval.interm.intermTypedNode) = parseContext->intermediate.addComma((yyvsp[(1) - (3)].interm.intermTypedNode), (yyvsp[(3) - (3)].interm.intermTypedNode), (yyvsp[(2) - (3)].lex).line); - if ((yyval.interm.intermTypedNode) == 0) { - parseContext->binaryOpError((yyvsp[(2) - (3)].lex).line, ",", (yyvsp[(1) - (3)].interm.intermTypedNode)->getCompleteString(), (yyvsp[(3) - (3)].interm.intermTypedNode)->getCompleteString()); - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(3) - (3)].interm.intermTypedNode); - } - } - break; - - case 70: - - { - if (parseContext->constErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode))) - parseContext->recover(); - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 71: - - { - TFunction &function = *((yyvsp[(1) - (2)].interm).function); - - TIntermAggregate *prototype = new TIntermAggregate; - prototype->setType(function.getReturnType()); - prototype->setName(function.getName()); - - for (int i = 0; i < function.getParamCount(); i++) - { - TParameter ¶m = function[i]; - if (param.name != 0) - { - TVariable *variable = new TVariable(param.name, *param.type); - - prototype = parseContext->intermediate.growAggregate(prototype, parseContext->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line); - } - else - { - prototype = parseContext->intermediate.growAggregate(prototype, parseContext->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line); - } - } - - prototype->setOperator(EOpPrototype); - (yyval.interm.intermNode) = prototype; - } - break; - - case 72: - - { - if ((yyvsp[(1) - (2)].interm).intermAggregate) - (yyvsp[(1) - (2)].interm).intermAggregate->setOperator(EOpDeclaration); - (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate; - } - break; - - case 73: - - { - parseContext->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type).type, (yyvsp[(2) - (4)].interm.precision) ); - (yyval.interm.intermNode) = 0; - } - break; - - case 74: - - { - // - // Multiple declarations of the same function are allowed. - // - // If this is a definition, the definition production code will check for redefinitions - // (we don't know at this point if it's a definition or not). - // - // Redeclarations are allowed. But, return types and parameter qualifiers must match. - // - TFunction* prevDec = static_cast(parseContext->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName())); - if (prevDec) { - if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) { - parseContext->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString(), ""); - parseContext->recover(); - } - for (int i = 0; i < prevDec->getParamCount(); ++i) { - if ((*prevDec)[i].type->getQualifier() != (*(yyvsp[(1) - (2)].interm.function))[i].type->getQualifier()) { - parseContext->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (*(yyvsp[(1) - (2)].interm.function))[i].type->getQualifierString(), ""); - parseContext->recover(); - } - } - } - - // - // If this is a redeclaration, it could also be a definition, - // in which case, we want to use the variable names from this one, and not the one that's - // being redeclared. So, pass back up this declaration, not the one in the symbol table. - // - (yyval.interm).function = (yyvsp[(1) - (2)].interm.function); - (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; - - parseContext->symbolTable.insert(*(yyval.interm).function); - } - break; - - case 75: - - { - (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); - } - break; - - case 76: - - { - (yyval.interm.function) = (yyvsp[(1) - (1)].interm.function); - } - break; - - case 77: - - { - // Add the parameter - (yyval.interm.function) = (yyvsp[(1) - (2)].interm.function); - if ((yyvsp[(2) - (2)].interm).param.type->getBasicType() != EbtVoid) - (yyvsp[(1) - (2)].interm.function)->addParameter((yyvsp[(2) - (2)].interm).param); - else - delete (yyvsp[(2) - (2)].interm).param.type; - } - break; - - case 78: - - { - // - // Only first parameter of one-parameter functions can be void - // The check for named parameters not being void is done in parameter_declarator - // - if ((yyvsp[(3) - (3)].interm).param.type->getBasicType() == EbtVoid) { - // - // This parameter > first is void - // - parseContext->error((yyvsp[(2) - (3)].lex).line, "cannot be an argument type except for '(void)'", "void", ""); - parseContext->recover(); - delete (yyvsp[(3) - (3)].interm).param.type; - } else { - // Add the parameter - (yyval.interm.function) = (yyvsp[(1) - (3)].interm.function); - (yyvsp[(1) - (3)].interm.function)->addParameter((yyvsp[(3) - (3)].interm).param); - } - } - break; - - case 79: - - { - if ((yyvsp[(1) - (3)].interm.type).qualifier != EvqGlobal && (yyvsp[(1) - (3)].interm.type).qualifier != EvqTemporary) { - parseContext->error((yyvsp[(2) - (3)].lex).line, "no qualifiers allowed for function return", getQualifierString((yyvsp[(1) - (3)].interm.type).qualifier), ""); - parseContext->recover(); - } - // make sure a sampler is not involved as well... - if (parseContext->structQualifierErrorCheck((yyvsp[(2) - (3)].lex).line, (yyvsp[(1) - (3)].interm.type))) - parseContext->recover(); - - // Add the function as a prototype after parsing it (we do not support recursion) - TFunction *function; - TType type((yyvsp[(1) - (3)].interm.type)); - function = new TFunction((yyvsp[(2) - (3)].lex).string, type); - (yyval.interm.function) = function; - } - break; - - case 80: - - { - if ((yyvsp[(1) - (2)].interm.type).type == EbtVoid) { - parseContext->error((yyvsp[(2) - (2)].lex).line, "illegal use of type 'void'", (yyvsp[(2) - (2)].lex).string->c_str(), ""); - parseContext->recover(); - } - if (parseContext->reservedErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string)) - parseContext->recover(); - TParameter param = {(yyvsp[(2) - (2)].lex).string, new TType((yyvsp[(1) - (2)].interm.type))}; - (yyval.interm).line = (yyvsp[(2) - (2)].lex).line; - (yyval.interm).param = param; - } - break; - - case 81: - - { - // Check that we can make an array out of this type - if (parseContext->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type))) - parseContext->recover(); - - if (parseContext->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string)) - parseContext->recover(); - - int size; - if (parseContext->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size)) - parseContext->recover(); - (yyvsp[(1) - (5)].interm.type).setArray(true, size); - - TType* type = new TType((yyvsp[(1) - (5)].interm.type)); - TParameter param = { (yyvsp[(2) - (5)].lex).string, type }; - (yyval.interm).line = (yyvsp[(2) - (5)].lex).line; - (yyval.interm).param = param; - } - break; - - case 82: - - { - (yyval.interm) = (yyvsp[(3) - (3)].interm); - if (parseContext->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type)) - parseContext->recover(); - } - break; - - case 83: - - { - (yyval.interm) = (yyvsp[(2) - (2)].interm); - if (parseContext->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) - parseContext->recover(); - if (parseContext->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) - parseContext->recover(); - } - break; - - case 84: - - { - (yyval.interm) = (yyvsp[(3) - (3)].interm); - if (parseContext->paramErrorCheck((yyvsp[(3) - (3)].interm).line, (yyvsp[(1) - (3)].interm.type).qualifier, (yyvsp[(2) - (3)].interm.qualifier), (yyval.interm).param.type)) - parseContext->recover(); - } - break; - - case 85: - - { - (yyval.interm) = (yyvsp[(2) - (2)].interm); - if (parseContext->parameterSamplerErrorCheck((yyvsp[(2) - (2)].interm).line, (yyvsp[(1) - (2)].interm.qualifier), *(yyvsp[(2) - (2)].interm).param.type)) - parseContext->recover(); - if (parseContext->paramErrorCheck((yyvsp[(2) - (2)].interm).line, EvqTemporary, (yyvsp[(1) - (2)].interm.qualifier), (yyval.interm).param.type)) - parseContext->recover(); - } - break; - - case 86: - - { - (yyval.interm.qualifier) = EvqIn; - } - break; - - case 87: - - { - (yyval.interm.qualifier) = EvqIn; - } - break; - - case 88: - - { - (yyval.interm.qualifier) = EvqOut; - } - break; - - case 89: - - { - (yyval.interm.qualifier) = EvqInOut; - } - break; - - case 90: - - { - TParameter param = { 0, new TType((yyvsp[(1) - (1)].interm.type)) }; - (yyval.interm).param = param; - } - break; - - case 91: - - { - (yyval.interm) = (yyvsp[(1) - (1)].interm); - - if ((yyval.interm).type.precision == EbpUndefined) { - (yyval.interm).type.precision = parseContext->symbolTable.getDefaultPrecision((yyvsp[(1) - (1)].interm).type.type); - if (parseContext->precisionErrorCheck((yyvsp[(1) - (1)].interm).line, (yyval.interm).type.precision, (yyvsp[(1) - (1)].interm).type.type)) { - parseContext->recover(); - } - } - } - break; - - case 92: - - { - (yyval.interm).intermAggregate = parseContext->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermNode, parseContext->intermediate.addSymbol(0, *(yyvsp[(3) - (3)].lex).string, TType((yyvsp[(1) - (3)].interm).type), (yyvsp[(3) - (3)].lex).line), (yyvsp[(3) - (3)].lex).line); - - if (parseContext->structQualifierErrorCheck((yyvsp[(3) - (3)].lex).line, (yyval.interm).type)) - parseContext->recover(); - - if (parseContext->nonInitConstErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type)) - parseContext->recover(); - - if (parseContext->nonInitErrorCheck((yyvsp[(3) - (3)].lex).line, *(yyvsp[(3) - (3)].lex).string, (yyval.interm).type)) - parseContext->recover(); - } - break; - - case 93: - - { - if (parseContext->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type)) - parseContext->recover(); - - if (parseContext->nonInitConstErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type)) - parseContext->recover(); - - (yyval.interm) = (yyvsp[(1) - (5)].interm); - - if (parseContext->arrayTypeErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type) || parseContext->arrayQualifierErrorCheck((yyvsp[(4) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type)) - parseContext->recover(); - else { - (yyvsp[(1) - (5)].interm).type.setArray(true); - TVariable* variable; - if (parseContext->arrayErrorCheck((yyvsp[(4) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, variable)) - parseContext->recover(); - } - } - break; - - case 94: - - { - if (parseContext->structQualifierErrorCheck((yyvsp[(3) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type)) - parseContext->recover(); - - if (parseContext->nonInitConstErrorCheck((yyvsp[(3) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type)) - parseContext->recover(); - - (yyval.interm) = (yyvsp[(1) - (6)].interm); - - if (parseContext->arrayTypeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type) || parseContext->arrayQualifierErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(1) - (6)].interm).type)) - parseContext->recover(); - else { - int size; - if (parseContext->arraySizeErrorCheck((yyvsp[(4) - (6)].lex).line, (yyvsp[(5) - (6)].interm.intermTypedNode), size)) - parseContext->recover(); - (yyvsp[(1) - (6)].interm).type.setArray(true, size); - TVariable* variable; - if (parseContext->arrayErrorCheck((yyvsp[(4) - (6)].lex).line, *(yyvsp[(3) - (6)].lex).string, (yyvsp[(1) - (6)].interm).type, variable)) - parseContext->recover(); - TType type = TType((yyvsp[(1) - (6)].interm).type); - type.setArraySize(size); - (yyval.interm).intermAggregate = parseContext->intermediate.growAggregate((yyvsp[(1) - (6)].interm).intermNode, parseContext->intermediate.addSymbol(0, *(yyvsp[(3) - (6)].lex).string, type, (yyvsp[(3) - (6)].lex).line), (yyvsp[(3) - (6)].lex).line); - } - } - break; - - case 95: - - { - if (parseContext->structQualifierErrorCheck((yyvsp[(3) - (7)].lex).line, (yyvsp[(1) - (7)].interm).type)) - parseContext->recover(); - - (yyval.interm) = (yyvsp[(1) - (7)].interm); - - TVariable* variable = 0; - if (parseContext->arrayTypeErrorCheck((yyvsp[(4) - (7)].lex).line, (yyvsp[(1) - (7)].interm).type) || parseContext->arrayQualifierErrorCheck((yyvsp[(4) - (7)].lex).line, (yyvsp[(1) - (7)].interm).type)) - parseContext->recover(); - else { - (yyvsp[(1) - (7)].interm).type.setArray(true, (yyvsp[(7) - (7)].interm.intermTypedNode)->getType().getArraySize()); - if (parseContext->arrayErrorCheck((yyvsp[(4) - (7)].lex).line, *(yyvsp[(3) - (7)].lex).string, (yyvsp[(1) - (7)].interm).type, variable)) - parseContext->recover(); - } - - if (parseContext->extensionErrorCheck((yyval.interm).line, "GL_3DL_array_objects")) - parseContext->recover(); - else { - TIntermNode* intermNode; - if (!parseContext->executeInitializer((yyvsp[(3) - (7)].lex).line, *(yyvsp[(3) - (7)].lex).string, (yyvsp[(1) - (7)].interm).type, (yyvsp[(7) - (7)].interm.intermTypedNode), intermNode, variable)) { - // - // build the intermediate representation - // - if (intermNode) - (yyval.interm).intermAggregate = parseContext->intermediate.growAggregate((yyvsp[(1) - (7)].interm).intermNode, intermNode, (yyvsp[(6) - (7)].lex).line); - else - (yyval.interm).intermAggregate = (yyvsp[(1) - (7)].interm).intermAggregate; - } else { - parseContext->recover(); - (yyval.interm).intermAggregate = 0; - } - } - } - break; - - case 96: - - { - if (parseContext->structQualifierErrorCheck((yyvsp[(3) - (8)].lex).line, (yyvsp[(1) - (8)].interm).type)) - parseContext->recover(); - - (yyval.interm) = (yyvsp[(1) - (8)].interm); - - TVariable* variable = 0; - if (parseContext->arrayTypeErrorCheck((yyvsp[(4) - (8)].lex).line, (yyvsp[(1) - (8)].interm).type) || parseContext->arrayQualifierErrorCheck((yyvsp[(4) - (8)].lex).line, (yyvsp[(1) - (8)].interm).type)) - parseContext->recover(); - else { - int size; - if (parseContext->arraySizeErrorCheck((yyvsp[(4) - (8)].lex).line, (yyvsp[(5) - (8)].interm.intermTypedNode), size)) - parseContext->recover(); - (yyvsp[(1) - (8)].interm).type.setArray(true, size); - if (parseContext->arrayErrorCheck((yyvsp[(4) - (8)].lex).line, *(yyvsp[(3) - (8)].lex).string, (yyvsp[(1) - (8)].interm).type, variable)) - parseContext->recover(); - } - - if (parseContext->extensionErrorCheck((yyval.interm).line, "GL_3DL_array_objects")) - parseContext->recover(); - else { - TIntermNode* intermNode; - if (!parseContext->executeInitializer((yyvsp[(3) - (8)].lex).line, *(yyvsp[(3) - (8)].lex).string, (yyvsp[(1) - (8)].interm).type, (yyvsp[(8) - (8)].interm.intermTypedNode), intermNode, variable)) { - // - // build the intermediate representation - // - if (intermNode) - (yyval.interm).intermAggregate = parseContext->intermediate.growAggregate((yyvsp[(1) - (8)].interm).intermNode, intermNode, (yyvsp[(7) - (8)].lex).line); - else - (yyval.interm).intermAggregate = (yyvsp[(1) - (8)].interm).intermAggregate; - } else { - parseContext->recover(); - (yyval.interm).intermAggregate = 0; - } - } - } - break; - - case 97: - - { - if (parseContext->structQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm).type)) - parseContext->recover(); - - (yyval.interm) = (yyvsp[(1) - (5)].interm); - - TIntermNode* intermNode; - if (!parseContext->executeInitializer((yyvsp[(3) - (5)].lex).line, *(yyvsp[(3) - (5)].lex).string, (yyvsp[(1) - (5)].interm).type, (yyvsp[(5) - (5)].interm.intermTypedNode), intermNode)) { - // - // build the intermediate representation - // - if (intermNode) - (yyval.interm).intermAggregate = parseContext->intermediate.growAggregate((yyvsp[(1) - (5)].interm).intermNode, intermNode, (yyvsp[(4) - (5)].lex).line); - else - (yyval.interm).intermAggregate = (yyvsp[(1) - (5)].interm).intermAggregate; - } else { - parseContext->recover(); - (yyval.interm).intermAggregate = 0; - } - } - break; - - case 98: - - { - (yyval.interm).type = (yyvsp[(1) - (1)].interm.type); - (yyval.interm).intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, "", TType((yyvsp[(1) - (1)].interm.type)), (yyvsp[(1) - (1)].interm.type).line), (yyvsp[(1) - (1)].interm.type).line); - } - break; - - case 99: - - { - (yyval.interm).intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, *(yyvsp[(2) - (2)].lex).string, TType((yyvsp[(1) - (2)].interm.type)), (yyvsp[(2) - (2)].lex).line), (yyvsp[(2) - (2)].lex).line); - - if (parseContext->structQualifierErrorCheck((yyvsp[(2) - (2)].lex).line, (yyval.interm).type)) - parseContext->recover(); - - if (parseContext->nonInitConstErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type)) - parseContext->recover(); - - (yyval.interm).type = (yyvsp[(1) - (2)].interm.type); - - if (parseContext->nonInitErrorCheck((yyvsp[(2) - (2)].lex).line, *(yyvsp[(2) - (2)].lex).string, (yyval.interm).type)) - parseContext->recover(); - } - break; - - case 100: - - { - (yyval.interm).intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, *(yyvsp[(2) - (4)].lex).string, TType((yyvsp[(1) - (4)].interm.type)), (yyvsp[(2) - (4)].lex).line), (yyvsp[(2) - (4)].lex).line); - - if (parseContext->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) - parseContext->recover(); - - if (parseContext->nonInitConstErrorCheck((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type))) - parseContext->recover(); - - (yyval.interm).type = (yyvsp[(1) - (4)].interm.type); - - if (parseContext->arrayTypeErrorCheck((yyvsp[(3) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type)) || parseContext->arrayQualifierErrorCheck((yyvsp[(3) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) - parseContext->recover(); - else { - (yyvsp[(1) - (4)].interm.type).setArray(true); - TVariable* variable; - if (parseContext->arrayErrorCheck((yyvsp[(3) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), variable)) - parseContext->recover(); - } - } - break; - - case 101: - - { - TType type = TType((yyvsp[(1) - (5)].interm.type)); - int size; - if (parseContext->arraySizeErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size)) - parseContext->recover(); - type.setArraySize(size); - (yyval.interm).intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, *(yyvsp[(2) - (5)].lex).string, type, (yyvsp[(2) - (5)].lex).line), (yyvsp[(2) - (5)].lex).line); - - if (parseContext->structQualifierErrorCheck((yyvsp[(2) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type))) - parseContext->recover(); - - if (parseContext->nonInitConstErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type))) - parseContext->recover(); - - (yyval.interm).type = (yyvsp[(1) - (5)].interm.type); - - if (parseContext->arrayTypeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type)) || parseContext->arrayQualifierErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(1) - (5)].interm.type))) - parseContext->recover(); - else { - int size; - if (parseContext->arraySizeErrorCheck((yyvsp[(3) - (5)].lex).line, (yyvsp[(4) - (5)].interm.intermTypedNode), size)) - parseContext->recover(); - - (yyvsp[(1) - (5)].interm.type).setArray(true, size); - TVariable* variable; - if (parseContext->arrayErrorCheck((yyvsp[(3) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string, (yyvsp[(1) - (5)].interm.type), variable)) - parseContext->recover(); - } - } - break; - - case 102: - - { - if (parseContext->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) - parseContext->recover(); - - (yyval.interm).type = (yyvsp[(1) - (4)].interm.type); - - TIntermNode* intermNode; - if (!parseContext->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) { - // - // Build intermediate representation - // - if(intermNode) - (yyval.interm).intermAggregate = parseContext->intermediate.makeAggregate(intermNode, (yyvsp[(3) - (4)].lex).line); - else - (yyval.interm).intermAggregate = 0; - } else { - parseContext->recover(); - (yyval.interm).intermAggregate = 0; - } - } - break; - - case 103: - - { - VERTEX_ONLY("invariant declaration", (yyvsp[(1) - (2)].lex).line); - (yyval.interm).qualifier = EvqInvariantVaryingOut; - (yyval.interm).intermAggregate = 0; - } - break; - - case 104: - - { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); - - if ((yyvsp[(1) - (1)].interm.type).array) { - if (parseContext->extensionErrorCheck((yyvsp[(1) - (1)].interm.type).line, "GL_3DL_array_objects")) { - parseContext->recover(); - (yyvsp[(1) - (1)].interm.type).setArray(false); - } - } - } - break; - - case 105: - - { - if ((yyvsp[(2) - (2)].interm.type).array && parseContext->extensionErrorCheck((yyvsp[(2) - (2)].interm.type).line, "GL_3DL_array_objects")) { - parseContext->recover(); - (yyvsp[(2) - (2)].interm.type).setArray(false); - } - if ((yyvsp[(2) - (2)].interm.type).array && parseContext->arrayQualifierErrorCheck((yyvsp[(2) - (2)].interm.type).line, (yyvsp[(1) - (2)].interm.type))) { - parseContext->recover(); - (yyvsp[(2) - (2)].interm.type).setArray(false); - } - - if ((yyvsp[(1) - (2)].interm.type).qualifier == EvqAttribute && - ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) { - parseContext->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier), ""); - parseContext->recover(); - } - if (((yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingIn || (yyvsp[(1) - (2)].interm.type).qualifier == EvqVaryingOut) && - ((yyvsp[(2) - (2)].interm.type).type == EbtBool || (yyvsp[(2) - (2)].interm.type).type == EbtInt)) { - parseContext->error((yyvsp[(2) - (2)].interm.type).line, "cannot be bool or int", getQualifierString((yyvsp[(1) - (2)].interm.type).qualifier), ""); - parseContext->recover(); - } - (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type); - (yyval.interm.type).qualifier = (yyvsp[(1) - (2)].interm.type).qualifier; - } - break; - - case 106: - - { - (yyval.interm.type).setBasic(EbtVoid, EvqConst, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 107: - - { - VERTEX_ONLY("attribute", (yyvsp[(1) - (1)].lex).line); - if (parseContext->globalErrorCheck((yyvsp[(1) - (1)].lex).line, parseContext->symbolTable.atGlobalLevel(), "attribute")) - parseContext->recover(); - (yyval.interm.type).setBasic(EbtVoid, EvqAttribute, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 108: - - { - if (parseContext->globalErrorCheck((yyvsp[(1) - (1)].lex).line, parseContext->symbolTable.atGlobalLevel(), "varying")) - parseContext->recover(); - if (parseContext->language == EShLangVertex) - (yyval.interm.type).setBasic(EbtVoid, EvqVaryingOut, (yyvsp[(1) - (1)].lex).line); - else - (yyval.interm.type).setBasic(EbtVoid, EvqVaryingIn, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 109: - - { - if (parseContext->globalErrorCheck((yyvsp[(1) - (2)].lex).line, parseContext->symbolTable.atGlobalLevel(), "invariant varying")) - parseContext->recover(); - if (parseContext->language == EShLangVertex) - (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingOut, (yyvsp[(1) - (2)].lex).line); - else - (yyval.interm.type).setBasic(EbtVoid, EvqInvariantVaryingIn, (yyvsp[(1) - (2)].lex).line); - } - break; - - case 110: - - { - if (parseContext->globalErrorCheck((yyvsp[(1) - (1)].lex).line, parseContext->symbolTable.atGlobalLevel(), "uniform")) - parseContext->recover(); - (yyval.interm.type).setBasic(EbtVoid, EvqUniform, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 111: - - { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); - } - break; - - case 112: - - { - (yyval.interm.type) = (yyvsp[(2) - (2)].interm.type); - (yyval.interm.type).precision = (yyvsp[(1) - (2)].interm.precision); - } - break; - - case 113: - - { - (yyval.interm.precision) = EbpHigh; - } - break; - - case 114: - - { - (yyval.interm.precision) = EbpMedium; - } - break; - - case 115: - - { - (yyval.interm.precision) = EbpLow; - } - break; - - case 116: - - { - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); - } - break; - - case 117: - - { - (yyval.interm.type) = (yyvsp[(1) - (4)].interm.type); - - if (parseContext->arrayTypeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) - parseContext->recover(); - else { - int size; - if (parseContext->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size)) - parseContext->recover(); - (yyval.interm.type).setArray(true, size); - } - } - break; - - case 118: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtVoid, qual, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 119: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 120: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 121: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 122: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(2); - } - break; - - case 123: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(3); - } - break; - - case 124: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(4); - } - break; - - case 125: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(2); - } - break; - - case 126: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(3); - } - break; - - case 127: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtBool, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(4); - } - break; - - case 128: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(2); - } - break; - - case 129: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(3); - } - break; - - case 130: - - { - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtInt, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(4); - } - break; - - case 131: - - { - FRAG_VERT_ONLY("mat2", (yyvsp[(1) - (1)].lex).line); - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(2, true); - } - break; - - case 132: - - { - FRAG_VERT_ONLY("mat3", (yyvsp[(1) - (1)].lex).line); - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(3, true); - } - break; - - case 133: - - { - FRAG_VERT_ONLY("mat4", (yyvsp[(1) - (1)].lex).line); - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtFloat, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).setAggregate(4, true); - } - break; - - case 134: - - { - FRAG_VERT_ONLY("sampler2D", (yyvsp[(1) - (1)].lex).line); - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtSampler2D, qual, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 135: - - { - FRAG_VERT_ONLY("samplerCube", (yyvsp[(1) - (1)].lex).line); - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtSamplerCube, qual, (yyvsp[(1) - (1)].lex).line); - } - break; - - case 136: - - { - FRAG_VERT_ONLY("struct", (yyvsp[(1) - (1)].interm.type).line); - (yyval.interm.type) = (yyvsp[(1) - (1)].interm.type); - (yyval.interm.type).qualifier = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - } - break; - - case 137: - - { - // - // This is for user defined type names. The lexical phase looked up the - // type. - // - TType& structure = static_cast((yyvsp[(1) - (1)].lex).symbol)->getType(); - TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; - (yyval.interm.type).setBasic(EbtStruct, qual, (yyvsp[(1) - (1)].lex).line); - (yyval.interm.type).userDef = &structure; - } - break; - - case 138: - - { - if (parseContext->reservedErrorCheck((yyvsp[(2) - (5)].lex).line, *(yyvsp[(2) - (5)].lex).string)) - parseContext->recover(); - - TType* structure = new TType((yyvsp[(4) - (5)].interm.typeList), *(yyvsp[(2) - (5)].lex).string); - TVariable* userTypeDef = new TVariable((yyvsp[(2) - (5)].lex).string, *structure, true); - if (! parseContext->symbolTable.insert(*userTypeDef)) { - parseContext->error((yyvsp[(2) - (5)].lex).line, "redefinition", (yyvsp[(2) - (5)].lex).string->c_str(), "struct"); - parseContext->recover(); - } - (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (5)].lex).line); - (yyval.interm.type).userDef = structure; - } - break; - - case 139: - - { - TType* structure = new TType((yyvsp[(3) - (4)].interm.typeList), TString("")); - (yyval.interm.type).setBasic(EbtStruct, EvqTemporary, (yyvsp[(1) - (4)].lex).line); - (yyval.interm.type).userDef = structure; - } - break; - - case 140: - - { - (yyval.interm.typeList) = (yyvsp[(1) - (1)].interm.typeList); - } - break; - - case 141: - - { - (yyval.interm.typeList) = (yyvsp[(1) - (2)].interm.typeList); - for (unsigned int i = 0; i < (yyvsp[(2) - (2)].interm.typeList)->size(); ++i) { - for (unsigned int j = 0; j < (yyval.interm.typeList)->size(); ++j) { - if ((*(yyval.interm.typeList))[j].type->getFieldName() == (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName()) { - parseContext->error((*(yyvsp[(2) - (2)].interm.typeList))[i].line, "duplicate field name in structure:", "struct", (*(yyvsp[(2) - (2)].interm.typeList))[i].type->getFieldName().c_str()); - parseContext->recover(); - } - } - (yyval.interm.typeList)->push_back((*(yyvsp[(2) - (2)].interm.typeList))[i]); - } - } - break; - - case 142: - - { - (yyval.interm.typeList) = (yyvsp[(2) - (3)].interm.typeList); - - if (parseContext->voidErrorCheck((yyvsp[(1) - (3)].interm.type).line, (*(yyvsp[(2) - (3)].interm.typeList))[0].type->getFieldName(), (yyvsp[(1) - (3)].interm.type))) { - parseContext->recover(); - } - for (unsigned int i = 0; i < (yyval.interm.typeList)->size(); ++i) { - // - // Careful not to replace already know aspects of type, like array-ness - // - (*(yyval.interm.typeList))[i].type->setType((yyvsp[(1) - (3)].interm.type).type, (yyvsp[(1) - (3)].interm.type).size, (yyvsp[(1) - (3)].interm.type).matrix, (yyvsp[(1) - (3)].interm.type).userDef); - - // don't allow arrays of arrays - if ((*(yyval.interm.typeList))[i].type->isArray()) { - if (parseContext->arrayTypeErrorCheck((yyvsp[(1) - (3)].interm.type).line, (yyvsp[(1) - (3)].interm.type))) - parseContext->recover(); - } - if ((yyvsp[(1) - (3)].interm.type).array) - (*(yyval.interm.typeList))[i].type->setArraySize((yyvsp[(1) - (3)].interm.type).arraySize); - if ((yyvsp[(1) - (3)].interm.type).userDef) - (*(yyval.interm.typeList))[i].type->setTypeName((yyvsp[(1) - (3)].interm.type).userDef->getTypeName()); - } - } - break; - - case 143: - - { - (yyval.interm.typeList) = NewPoolTTypeList(); - (yyval.interm.typeList)->push_back((yyvsp[(1) - (1)].interm.typeLine)); - } - break; - - case 144: - - { - (yyval.interm.typeList)->push_back((yyvsp[(3) - (3)].interm.typeLine)); - } - break; - - case 145: - - { - if (parseContext->reservedErrorCheck((yyvsp[(1) - (1)].lex).line, *(yyvsp[(1) - (1)].lex).string)) - parseContext->recover(); - - (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined); - (yyval.interm.typeLine).line = (yyvsp[(1) - (1)].lex).line; - (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (1)].lex).string); - } - break; - - case 146: - - { - if (parseContext->reservedErrorCheck((yyvsp[(1) - (4)].lex).line, *(yyvsp[(1) - (4)].lex).string)) - parseContext->recover(); - - (yyval.interm.typeLine).type = new TType(EbtVoid, EbpUndefined); - (yyval.interm.typeLine).line = (yyvsp[(1) - (4)].lex).line; - (yyval.interm.typeLine).type->setFieldName(*(yyvsp[(1) - (4)].lex).string); - - int size; - if (parseContext->arraySizeErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(3) - (4)].interm.intermTypedNode), size)) - parseContext->recover(); - (yyval.interm.typeLine).type->setArraySize(size); - } - break; - - case 147: - - { (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); } - break; - - case 148: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 149: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermAggregate); } - break; - - case 150: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 151: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 152: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 153: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 154: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 155: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 156: - - { (yyval.interm.intermAggregate) = 0; } - break; - - case 157: - - { parseContext->symbolTable.push(); } - break; - - case 158: - - { parseContext->symbolTable.pop(); } - break; - - case 159: - - { - if ((yyvsp[(3) - (5)].interm.intermAggregate) != 0) - (yyvsp[(3) - (5)].interm.intermAggregate)->setOperator(EOpSequence); - (yyval.interm.intermAggregate) = (yyvsp[(3) - (5)].interm.intermAggregate); - } - break; - - case 160: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 161: - - { (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); } - break; - - case 162: - - { - (yyval.interm.intermNode) = 0; - } - break; - - case 163: - - { - if ((yyvsp[(2) - (3)].interm.intermAggregate)) - (yyvsp[(2) - (3)].interm.intermAggregate)->setOperator(EOpSequence); - (yyval.interm.intermNode) = (yyvsp[(2) - (3)].interm.intermAggregate); - } - break; - - case 164: - - { - (yyval.interm.intermAggregate) = parseContext->intermediate.makeAggregate((yyvsp[(1) - (1)].interm.intermNode), 0); - } - break; - - case 165: - - { - (yyval.interm.intermAggregate) = parseContext->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermAggregate), (yyvsp[(2) - (2)].interm.intermNode), 0); - } - break; - - case 166: - - { (yyval.interm.intermNode) = 0; } - break; - - case 167: - - { (yyval.interm.intermNode) = static_cast((yyvsp[(1) - (2)].interm.intermTypedNode)); } - break; - - case 168: - - { - if (parseContext->boolErrorCheck((yyvsp[(1) - (5)].lex).line, (yyvsp[(3) - (5)].interm.intermTypedNode))) - parseContext->recover(); - (yyval.interm.intermNode) = parseContext->intermediate.addSelection((yyvsp[(3) - (5)].interm.intermTypedNode), (yyvsp[(5) - (5)].interm.nodePair), (yyvsp[(1) - (5)].lex).line); - } - break; - - case 169: - - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermNode); - (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermNode); - } - break; - - case 170: - - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (1)].interm.intermNode); - (yyval.interm.nodePair).node2 = 0; - } - break; - - case 171: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - if (parseContext->boolErrorCheck((yyvsp[(1) - (1)].interm.intermTypedNode)->getLine(), (yyvsp[(1) - (1)].interm.intermTypedNode))) - parseContext->recover(); - } - break; - - case 172: - - { - TIntermNode* intermNode; - if (parseContext->structQualifierErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) - parseContext->recover(); - if (parseContext->boolErrorCheck((yyvsp[(2) - (4)].lex).line, (yyvsp[(1) - (4)].interm.type))) - parseContext->recover(); - - if (!parseContext->executeInitializer((yyvsp[(2) - (4)].lex).line, *(yyvsp[(2) - (4)].lex).string, (yyvsp[(1) - (4)].interm.type), (yyvsp[(4) - (4)].interm.intermTypedNode), intermNode)) - (yyval.interm.intermTypedNode) = (yyvsp[(4) - (4)].interm.intermTypedNode); - else { - parseContext->recover(); - (yyval.interm.intermTypedNode) = 0; - } - } - break; - - case 173: - - { parseContext->symbolTable.push(); ++parseContext->loopNestingLevel; } - break; - - case 174: - - { - parseContext->symbolTable.pop(); - (yyval.interm.intermNode) = parseContext->intermediate.addLoop(0, (yyvsp[(6) - (6)].interm.intermNode), (yyvsp[(4) - (6)].interm.intermTypedNode), 0, true, (yyvsp[(1) - (6)].lex).line); - --parseContext->loopNestingLevel; - } - break; - - case 175: - - { ++parseContext->loopNestingLevel; } - break; - - case 176: - - { - if (parseContext->boolErrorCheck((yyvsp[(8) - (8)].lex).line, (yyvsp[(6) - (8)].interm.intermTypedNode))) - parseContext->recover(); - - (yyval.interm.intermNode) = parseContext->intermediate.addLoop(0, (yyvsp[(3) - (8)].interm.intermNode), (yyvsp[(6) - (8)].interm.intermTypedNode), 0, false, (yyvsp[(4) - (8)].lex).line); - --parseContext->loopNestingLevel; - } - break; - - case 177: - - { parseContext->symbolTable.push(); ++parseContext->loopNestingLevel; } - break; - - case 178: - - { - parseContext->symbolTable.pop(); - (yyval.interm.intermNode) = parseContext->intermediate.addLoop((yyvsp[(4) - (7)].interm.intermNode), (yyvsp[(7) - (7)].interm.intermNode), reinterpret_cast((yyvsp[(5) - (7)].interm.nodePair).node1), reinterpret_cast((yyvsp[(5) - (7)].interm.nodePair).node2), true, (yyvsp[(1) - (7)].lex).line); - --parseContext->loopNestingLevel; - } - break; - - case 179: - - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 180: - - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 181: - - { - (yyval.interm.intermTypedNode) = (yyvsp[(1) - (1)].interm.intermTypedNode); - } - break; - - case 182: - - { - (yyval.interm.intermTypedNode) = 0; - } - break; - - case 183: - - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (2)].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = 0; - } - break; - - case 184: - - { - (yyval.interm.nodePair).node1 = (yyvsp[(1) - (3)].interm.intermTypedNode); - (yyval.interm.nodePair).node2 = (yyvsp[(3) - (3)].interm.intermTypedNode); - } - break; - - case 185: - - { - if (parseContext->loopNestingLevel <= 0) { - parseContext->error((yyvsp[(1) - (2)].lex).line, "continue statement only allowed in loops", "", ""); - parseContext->recover(); - } - (yyval.interm.intermNode) = parseContext->intermediate.addBranch(EOpContinue, (yyvsp[(1) - (2)].lex).line); - } - break; - - case 186: - - { - if (parseContext->loopNestingLevel <= 0) { - parseContext->error((yyvsp[(1) - (2)].lex).line, "break statement only allowed in loops", "", ""); - parseContext->recover(); - } - (yyval.interm.intermNode) = parseContext->intermediate.addBranch(EOpBreak, (yyvsp[(1) - (2)].lex).line); - } - break; - - case 187: - - { - (yyval.interm.intermNode) = parseContext->intermediate.addBranch(EOpReturn, (yyvsp[(1) - (2)].lex).line); - if (parseContext->currentFunctionType->getBasicType() != EbtVoid) { - parseContext->error((yyvsp[(1) - (2)].lex).line, "non-void function must return a value", "return", ""); - parseContext->recover(); - } - } - break; - - case 188: - - { - (yyval.interm.intermNode) = parseContext->intermediate.addBranch(EOpReturn, (yyvsp[(2) - (3)].interm.intermTypedNode), (yyvsp[(1) - (3)].lex).line); - parseContext->functionReturnsValue = true; - if (parseContext->currentFunctionType->getBasicType() == EbtVoid) { - parseContext->error((yyvsp[(1) - (3)].lex).line, "void function cannot return a value", "return", ""); - parseContext->recover(); - } else if (*(parseContext->currentFunctionType) != (yyvsp[(2) - (3)].interm.intermTypedNode)->getType()) { - parseContext->error((yyvsp[(1) - (3)].lex).line, "function return is not matching type:", "return", ""); - parseContext->recover(); - } - } - break; - - case 189: - - { - FRAG_ONLY("discard", (yyvsp[(1) - (2)].lex).line); - (yyval.interm.intermNode) = parseContext->intermediate.addBranch(EOpKill, (yyvsp[(1) - (2)].lex).line); - } - break; - - case 190: - - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - parseContext->treeRoot = (yyval.interm.intermNode); - } - break; - - case 191: - - { - (yyval.interm.intermNode) = parseContext->intermediate.growAggregate((yyvsp[(1) - (2)].interm.intermNode), (yyvsp[(2) - (2)].interm.intermNode), 0); - parseContext->treeRoot = (yyval.interm.intermNode); - } - break; - - case 192: - - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 193: - - { - (yyval.interm.intermNode) = (yyvsp[(1) - (1)].interm.intermNode); - } - break; - - case 194: - - { - TFunction& function = *((yyvsp[(1) - (1)].interm).function); - TFunction* prevDec = static_cast(parseContext->symbolTable.find(function.getMangledName())); - // - // Note: 'prevDec' could be 'function' if this is the first time we've seen function - // as it would have just been put in the symbol table. Otherwise, we're looking up - // an earlier occurance. - // - if (prevDec->isDefined()) { - // - // Then this function already has a body. - // - parseContext->error((yyvsp[(1) - (1)].interm).line, "function already has a body", function.getName().c_str(), ""); - parseContext->recover(); - } - prevDec->setDefined(); - - // - // Raise error message if main function takes any parameters or return anything other than void - // - if (function.getName() == "main") { - if (function.getParamCount() > 0) { - parseContext->error((yyvsp[(1) - (1)].interm).line, "function cannot take any parameter(s)", function.getName().c_str(), ""); - parseContext->recover(); - } - if (function.getReturnType().getBasicType() != EbtVoid) { - parseContext->error((yyvsp[(1) - (1)].interm).line, "", function.getReturnType().getBasicString(), "main function cannot return a value"); - parseContext->recover(); - } - } - - // - // New symbol table scope for body of function plus its arguments - // - parseContext->symbolTable.push(); - - // - // Remember the return type for later checking for RETURN statements. - // - parseContext->currentFunctionType = &(prevDec->getReturnType()); - parseContext->functionReturnsValue = false; - - // - // Insert parameters into the symbol table. - // If the parameter has no name, it's not an error, just don't insert it - // (could be used for unused args). - // - // Also, accumulate the list of parameters into the HIL, so lower level code - // knows where to find parameters. - // - TIntermAggregate* paramNodes = new TIntermAggregate; - for (int i = 0; i < function.getParamCount(); i++) { - TParameter& param = function[i]; - if (param.name != 0) { - TVariable *variable = new TVariable(param.name, *param.type); - // - // Insert the parameters with name in the symbol table. - // - if (! parseContext->symbolTable.insert(*variable)) { - parseContext->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str(), ""); - parseContext->recover(); - delete variable; - } - // - // Transfer ownership of name pointer to symbol table. - // - param.name = 0; - - // - // Add the parameter to the HIL - // - paramNodes = parseContext->intermediate.growAggregate( - paramNodes, - parseContext->intermediate.addSymbol(variable->getUniqueId(), - variable->getName(), - variable->getType(), (yyvsp[(1) - (1)].interm).line), - (yyvsp[(1) - (1)].interm).line); - } else { - paramNodes = parseContext->intermediate.growAggregate(paramNodes, parseContext->intermediate.addSymbol(0, "", *param.type, (yyvsp[(1) - (1)].interm).line), (yyvsp[(1) - (1)].interm).line); - } - } - parseContext->intermediate.setAggregateOperator(paramNodes, EOpParameters, (yyvsp[(1) - (1)].interm).line); - (yyvsp[(1) - (1)].interm).intermAggregate = paramNodes; - parseContext->loopNestingLevel = 0; - } - break; - - case 195: - - { - //?? Check that all paths return a value if return type != void ? - // May be best done as post process phase on intermediate code - if (parseContext->currentFunctionType->getBasicType() != EbtVoid && ! parseContext->functionReturnsValue) { - parseContext->error((yyvsp[(1) - (3)].interm).line, "function does not return a value:", "", (yyvsp[(1) - (3)].interm).function->getName().c_str()); - parseContext->recover(); - } - parseContext->symbolTable.pop(); - (yyval.interm.intermNode) = parseContext->intermediate.growAggregate((yyvsp[(1) - (3)].interm).intermAggregate, (yyvsp[(3) - (3)].interm.intermNode), 0); - parseContext->intermediate.setAggregateOperator((yyval.interm.intermNode), EOpFunction, (yyvsp[(1) - (3)].interm).line); - (yyval.interm.intermNode)->getAsAggregate()->setName((yyvsp[(1) - (3)].interm).function->getMangledName().c_str()); - (yyval.interm.intermNode)->getAsAggregate()->setType((yyvsp[(1) - (3)].interm).function->getReturnType()); - - // store the pragma information for debug and optimize and other vendor specific - // information. This information can be queried from the parse tree - (yyval.interm.intermNode)->getAsAggregate()->setOptimize(parseContext->contextPragma.optimize); - (yyval.interm.intermNode)->getAsAggregate()->setDebug(parseContext->contextPragma.debug); - (yyval.interm.intermNode)->getAsAggregate()->addToPragmaTable(parseContext->contextPragma.pragmaTable); - } - break; - - - - default: break; - } - YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); - - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - - *++yyvsp = yyval; - - /* Now `shift' the result of the reduction. Determine what state - that goes to, based on the state we popped back to and the rule - number reduced by. */ - - yyn = yyr1[yyn]; - - yystate = yypgoto[yyn - YYNTOKENS] + *yyssp; - if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp) - yystate = yytable[yystate]; - else - yystate = yydefgoto[yyn - YYNTOKENS]; - - goto yynewstate; - - -/*------------------------------------. -| yyerrlab -- here on detecting error | -`------------------------------------*/ -yyerrlab: - /* If not already recovering from an error, report this error. */ - if (!yyerrstatus) - { - ++yynerrs; -#if ! YYERROR_VERBOSE - yyerror (YY_("syntax error")); -#else - { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } - } -#endif - } - - - - if (yyerrstatus == 3) - { - /* If just tried and failed to reuse lookahead token after an - error, discard it. */ - - if (yychar <= YYEOF) - { - /* Return failure if at end of input. */ - if (yychar == YYEOF) - YYABORT; - } - else - { - yydestruct ("Error: discarding", - yytoken, &yylval); - yychar = YYEMPTY; - } - } - - /* Else will try to reuse lookahead token after shifting the error - token. */ - goto yyerrlab1; - - -/*---------------------------------------------------. -| yyerrorlab -- error raised explicitly by YYERROR. | -`---------------------------------------------------*/ -yyerrorlab: - - /* Pacify compilers like GCC when the user code never invokes - YYERROR and the label yyerrorlab therefore never appears in user - code. */ - if (/*CONSTCOND*/ 0) - goto yyerrorlab; - - /* Do not reclaim the symbols of the rule which action triggered - this YYERROR. */ - YYPOPSTACK (yylen); - yylen = 0; - YY_STACK_PRINT (yyss, yyssp); - yystate = *yyssp; - goto yyerrlab1; - - -/*-------------------------------------------------------------. -| yyerrlab1 -- common code for both syntax error and YYERROR. | -`-------------------------------------------------------------*/ -yyerrlab1: - yyerrstatus = 3; /* Each real token shifted decrements this. */ - - for (;;) - { - yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) - { - yyn += YYTERROR; - if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) - { - yyn = yytable[yyn]; - if (0 < yyn) - break; - } - } - - /* Pop the current state because it cannot handle the error token. */ - if (yyssp == yyss) - YYABORT; - - - yydestruct ("Error: popping", - yystos[yystate], yyvsp); - YYPOPSTACK (1); - yystate = *yyssp; - YY_STACK_PRINT (yyss, yyssp); - } - - *++yyvsp = yylval; - - - /* Shift the error token. */ - YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); - - yystate = yyn; - goto yynewstate; - - -/*-------------------------------------. -| yyacceptlab -- YYACCEPT comes here. | -`-------------------------------------*/ -yyacceptlab: - yyresult = 0; - goto yyreturn; - -/*-----------------------------------. -| yyabortlab -- YYABORT comes here. | -`-----------------------------------*/ -yyabortlab: - yyresult = 1; - goto yyreturn; - -#if !defined(yyoverflow) || YYERROR_VERBOSE -/*-------------------------------------------------. -| yyexhaustedlab -- memory exhaustion comes here. | -`-------------------------------------------------*/ -yyexhaustedlab: - yyerror (YY_("memory exhausted")); - yyresult = 2; - /* Fall through. */ -#endif - -yyreturn: - if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); - /* Do not reclaim the symbols of the rule which action triggered - this YYABORT or YYACCEPT. */ - YYPOPSTACK (yylen); - YY_STACK_PRINT (yyss, yyssp); - while (yyssp != yyss) - { - yydestruct ("Cleanup: popping", - yystos[*yyssp], yyvsp); - YYPOPSTACK (1); - } -#ifndef yyoverflow - if (yyss != yyssa) - YYSTACK_FREE (yyss); -#endif -#if YYERROR_VERBOSE - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); -#endif - /* Make sure YYID is used. */ - return YYID (yyresult); -} - - - - - + +/* A Bison parser, made from src/compiler/glslang.y with Bison version GNU Bison version 1.24 + */ + +#define YYBISON 1 /* Identify Bison output. */ + +#define INVARIANT 258 +#define HIGH_PRECISION 259 +#define MEDIUM_PRECISION 260 +#define LOW_PRECISION 261 +#define PRECISION 262 +#define ATTRIBUTE 263 +#define CONST_QUAL 264 +#define BOOL_TYPE 265 +#define FLOAT_TYPE 266 +#define INT_TYPE 267 +#define BREAK 268 +#define CONTINUE 269 +#define DO 270 +#define ELSE 271 +#define FOR 272 +#define IF 273 +#define DISCARD 274 +#define RETURN 275 +#define BVEC2 276 +#define BVEC3 277 +#define BVEC4 278 +#define IVEC2 279 +#define IVEC3 280 +#define IVEC4 281 +#define VEC2 282 +#define VEC3 283 +#define VEC4 284 +#define MATRIX2 285 +#define MATRIX3 286 +#define MATRIX4 287 +#define IN_QUAL 288 +#define OUT_QUAL 289 +#define INOUT_QUAL 290 +#define UNIFORM 291 +#define VARYING 292 +#define STRUCT 293 +#define VOID_TYPE 294 +#define WHILE 295 +#define SAMPLER2D 296 +#define SAMPLERCUBE 297 +#define IDENTIFIER 298 +#define TYPE_NAME 299 +#define FLOATCONSTANT 300 +#define INTCONSTANT 301 +#define BOOLCONSTANT 302 +#define FIELD_SELECTION 303 +#define LEFT_OP 304 +#define RIGHT_OP 305 +#define INC_OP 306 +#define DEC_OP 307 +#define LE_OP 308 +#define GE_OP 309 +#define EQ_OP 310 +#define NE_OP 311 +#define AND_OP 312 +#define OR_OP 313 +#define XOR_OP 314 +#define MUL_ASSIGN 315 +#define DIV_ASSIGN 316 +#define ADD_ASSIGN 317 +#define MOD_ASSIGN 318 +#define LEFT_ASSIGN 319 +#define RIGHT_ASSIGN 320 +#define AND_ASSIGN 321 +#define XOR_ASSIGN 322 +#define OR_ASSIGN 323 +#define SUB_ASSIGN 324 +#define LEFT_PAREN 325 +#define RIGHT_PAREN 326 +#define LEFT_BRACKET 327 +#define RIGHT_BRACKET 328 +#define LEFT_BRACE 329 +#define RIGHT_BRACE 330 +#define DOT 331 +#define COMMA 332 +#define COLON 333 +#define EQUAL 334 +#define SEMICOLON 335 +#define BANG 336 +#define DASH 337 +#define TILDE 338 +#define PLUS 339 +#define STAR 340 +#define SLASH 341 +#define PERCENT 342 +#define LEFT_ANGLE 343 +#define RIGHT_ANGLE 344 +#define VERTICAL_BAR 345 +#define CARET 346 +#define AMPERSAND 347 +#define QUESTION 348 + + + +/* Based on: +ANSI C Yacc grammar + +In 1985, Jeff Lee published his Yacc grammar (which is accompanied by a +matching Lex specification) for the April 30, 1985 draft version of the +ANSI C standard. Tom Stockfisch reposted it to net.sources in 1987; that +original, as mentioned in the answer to question 17.25 of the comp.lang.c +FAQ, can be ftp'ed from ftp.uu.net, file usenet/net.sources/ansi.c.grammar.Z. + +I intend to keep this version as close to the current C Standard grammar as +possible; please let me know if you discover discrepancies. + +Jutta Degener, 1995 +*/ + +#include "compiler/SymbolTable.h" +#include "compiler/ParseHelper.h" +#include "GLSLANG/ShaderLang.h" + +#define YYPARSE_PARAM parseContextLocal +/* +TODO(alokp): YYPARSE_PARAM_DECL is only here to support old bison.exe in +compiler/tools. Remove it when we can exclusively use the newer version. +*/ +#define YYPARSE_PARAM_DECL void* +#define parseContext ((TParseContext*)(parseContextLocal)) +#define YYLEX_PARAM parseContextLocal +#define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal) +extern void yyerror(const char*); + +#define FRAG_VERT_ONLY(S, L) { \ + if (parseContext->shaderType != SH_FRAGMENT_SHADER && \ + parseContext->shaderType != SH_VERTEX_SHADER) { \ + parseContext->error(L, " supported in vertex/fragment shaders only ", S, "", ""); \ + parseContext->recover(); \ + } \ +} + +#define VERTEX_ONLY(S, L) { \ + if (parseContext->shaderType != SH_VERTEX_SHADER) { \ + parseContext->error(L, " supported in vertex shaders only ", S, "", ""); \ + parseContext->recover(); \ + } \ +} + +#define FRAG_ONLY(S, L) { \ + if (parseContext->shaderType != SH_FRAGMENT_SHADER) { \ + parseContext->error(L, " supported in fragment shaders only ", S, "", ""); \ + parseContext->recover(); \ + } \ +} + +typedef union { + struct { + TSourceLoc line; + union { + TString *string; + float f; + int i; + bool b; + }; + TSymbol* symbol; + } lex; + struct { + TSourceLoc line; + TOperator op; + union { + TIntermNode* intermNode; + TIntermNodePair nodePair; + TIntermTyped* intermTypedNode; + TIntermAggregate* intermAggregate; + }; + union { + TPublicType type; + TPrecision precision; + TQualifier qualifier; + TFunction* function; + TParameter param; + TTypeLine typeLine; + TTypeList* typeList; + }; + } interm; +} YYSTYPE; + + extern int yylex(YYSTYPE*, void*); + +#ifndef YYLTYPE +typedef + struct yyltype + { + int timestamp; + int first_line; + int first_column; + int last_line; + int last_column; + char *text; + } + yyltype; + +#define YYLTYPE yyltype +#endif + +#include + +#ifndef __cplusplus +#ifndef __STDC__ +#define const +#endif +#endif + + + +#define YYFINAL 296 +#define YYFLAG -32768 +#define YYNTBASE 94 + +#define YYTRANSLATE(x) ((unsigned)(x) <= 348 ? yytranslate[x] : 171) + +static const char yytranslate[] = { 0, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, + 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, + 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, + 86, 87, 88, 89, 90, 91, 92, 93 +}; + +#if YYDEBUG != 0 +static const short yyprhs[] = { 0, + 0, 2, 4, 6, 8, 10, 14, 16, 21, 23, + 27, 30, 33, 35, 37, 39, 43, 46, 49, 52, + 54, 57, 61, 64, 66, 68, 70, 72, 75, 78, + 81, 83, 85, 87, 89, 93, 97, 99, 103, 107, + 109, 111, 115, 119, 123, 127, 129, 133, 137, 139, + 141, 143, 145, 149, 151, 155, 157, 161, 163, 169, + 171, 175, 177, 179, 181, 183, 185, 187, 191, 193, + 196, 199, 204, 207, 209, 211, 214, 218, 222, 225, + 231, 235, 238, 242, 245, 246, 248, 250, 252, 254, + 256, 260, 266, 273, 279, 281, 284, 289, 295, 300, + 303, 305, 308, 310, 312, 314, 317, 319, 321, 324, + 326, 328, 330, 332, 337, 339, 341, 343, 345, 347, + 349, 351, 353, 355, 357, 359, 361, 363, 365, 367, + 369, 371, 373, 375, 377, 383, 388, 390, 393, 397, + 399, 403, 405, 410, 412, 414, 416, 418, 420, 422, + 424, 426, 428, 431, 432, 433, 439, 441, 443, 446, + 450, 452, 455, 457, 460, 466, 470, 472, 474, 479, + 480, 487, 488, 497, 498, 506, 508, 510, 512, 513, + 516, 520, 523, 526, 529, 533, 536, 538, 541, 543, + 545, 546 +}; + +static const short yyrhs[] = { 43, + 0, 94, 0, 46, 0, 45, 0, 47, 0, 70, + 121, 71, 0, 95, 0, 96, 72, 97, 73, 0, + 98, 0, 96, 76, 48, 0, 96, 51, 0, 96, + 52, 0, 121, 0, 99, 0, 100, 0, 96, 76, + 100, 0, 102, 71, 0, 101, 71, 0, 103, 39, + 0, 103, 0, 103, 119, 0, 102, 77, 119, 0, + 104, 70, 0, 136, 0, 43, 0, 48, 0, 96, + 0, 51, 105, 0, 52, 105, 0, 106, 105, 0, + 84, 0, 82, 0, 81, 0, 105, 0, 107, 85, + 105, 0, 107, 86, 105, 0, 107, 0, 108, 84, + 107, 0, 108, 82, 107, 0, 108, 0, 109, 0, + 110, 88, 109, 0, 110, 89, 109, 0, 110, 53, + 109, 0, 110, 54, 109, 0, 110, 0, 111, 55, + 110, 0, 111, 56, 110, 0, 111, 0, 112, 0, + 113, 0, 114, 0, 115, 57, 114, 0, 115, 0, + 116, 59, 115, 0, 116, 0, 117, 58, 116, 0, + 117, 0, 117, 93, 121, 78, 119, 0, 118, 0, + 105, 120, 119, 0, 79, 0, 60, 0, 61, 0, + 62, 0, 69, 0, 119, 0, 121, 77, 119, 0, + 118, 0, 124, 80, 0, 132, 80, 0, 7, 137, + 138, 80, 0, 125, 71, 0, 127, 0, 126, 0, + 127, 129, 0, 126, 77, 129, 0, 134, 43, 70, + 0, 136, 43, 0, 136, 43, 72, 122, 73, 0, + 135, 130, 128, 0, 130, 128, 0, 135, 130, 131, + 0, 130, 131, 0, 0, 33, 0, 34, 0, 35, + 0, 136, 0, 133, 0, 132, 77, 43, 0, 132, + 77, 43, 72, 73, 0, 132, 77, 43, 72, 122, + 73, 0, 132, 77, 43, 79, 145, 0, 134, 0, + 134, 43, 0, 134, 43, 72, 73, 0, 134, 43, + 72, 122, 73, 0, 134, 43, 79, 145, 0, 3, + 43, 0, 136, 0, 135, 136, 0, 9, 0, 8, + 0, 37, 0, 3, 37, 0, 36, 0, 138, 0, + 137, 138, 0, 4, 0, 5, 0, 6, 0, 139, + 0, 139, 72, 122, 73, 0, 39, 0, 11, 0, + 12, 0, 10, 0, 27, 0, 28, 0, 29, 0, + 21, 0, 22, 0, 23, 0, 24, 0, 25, 0, + 26, 0, 30, 0, 31, 0, 32, 0, 41, 0, + 42, 0, 140, 0, 44, 0, 38, 43, 74, 141, + 75, 0, 38, 74, 141, 75, 0, 142, 0, 141, + 142, 0, 136, 143, 80, 0, 144, 0, 143, 77, + 144, 0, 43, 0, 43, 72, 122, 73, 0, 119, + 0, 123, 0, 149, 0, 148, 0, 146, 0, 155, + 0, 156, 0, 159, 0, 166, 0, 74, 75, 0, + 0, 0, 74, 150, 154, 151, 75, 0, 153, 0, + 148, 0, 74, 75, 0, 74, 154, 75, 0, 147, + 0, 154, 147, 0, 80, 0, 121, 80, 0, 18, + 70, 121, 71, 157, 0, 147, 16, 147, 0, 147, + 0, 121, 0, 134, 43, 79, 145, 0, 0, 40, + 70, 160, 158, 71, 152, 0, 0, 15, 161, 147, + 40, 70, 121, 71, 80, 0, 0, 17, 70, 162, + 163, 165, 71, 152, 0, 155, 0, 146, 0, 158, + 0, 0, 164, 80, 0, 164, 80, 121, 0, 14, + 80, 0, 13, 80, 0, 20, 80, 0, 20, 121, + 80, 0, 19, 80, 0, 168, 0, 167, 168, 0, + 169, 0, 123, 0, 0, 124, 170, 153, 0 +}; + +#endif + +#if YYDEBUG != 0 +static const short yyrline[] = { 0, + 161, 196, 199, 212, 217, 222, 228, 231, 304, 307, + 416, 426, 439, 447, 546, 549, 557, 561, 568, 572, + 579, 585, 594, 602, 664, 671, 681, 684, 694, 704, + 725, 726, 727, 732, 733, 742, 754, 755, 763, 774, + 778, 779, 789, 799, 809, 822, 823, 833, 846, 850, + 854, 858, 859, 872, 873, 886, 887, 900, 901, 918, + 919, 932, 933, 934, 935, 936, 940, 943, 954, 962, + 987, 992, 999, 1035, 1038, 1045, 1053, 1074, 1093, 1104, + 1133, 1138, 1148, 1153, 1163, 1166, 1169, 1172, 1178, 1185, + 1195, 1207, 1225, 1249, 1272, 1276, 1290, 1310, 1339, 1359, + 1435, 1444, 1467, 1470, 1476, 1484, 1492, 1500, 1503, 1510, + 1513, 1516, 1522, 1525, 1540, 1544, 1548, 1552, 1561, 1566, + 1571, 1576, 1581, 1586, 1591, 1596, 1601, 1606, 1612, 1618, + 1624, 1629, 1634, 1639, 1652, 1665, 1673, 1676, 1691, 1722, + 1726, 1732, 1740, 1756, 1760, 1764, 1765, 1771, 1772, 1773, + 1774, 1775, 1779, 1780, 1780, 1780, 1788, 1789, 1794, 1797, + 1805, 1808, 1814, 1815, 1819, 1827, 1831, 1841, 1846, 1863, + 1863, 1868, 1868, 1875, 1875, 1883, 1886, 1892, 1895, 1901, + 1905, 1912, 1919, 1926, 1933, 1944, 1953, 1957, 1964, 1967, + 1973, 2054 +}; + +static const char * const yytname[] = { "$","error","$undefined.","INVARIANT", +"HIGH_PRECISION","MEDIUM_PRECISION","LOW_PRECISION","PRECISION","ATTRIBUTE", +"CONST_QUAL","BOOL_TYPE","FLOAT_TYPE","INT_TYPE","BREAK","CONTINUE","DO","ELSE", +"FOR","IF","DISCARD","RETURN","BVEC2","BVEC3","BVEC4","IVEC2","IVEC3","IVEC4", +"VEC2","VEC3","VEC4","MATRIX2","MATRIX3","MATRIX4","IN_QUAL","OUT_QUAL","INOUT_QUAL", +"UNIFORM","VARYING","STRUCT","VOID_TYPE","WHILE","SAMPLER2D","SAMPLERCUBE","IDENTIFIER", +"TYPE_NAME","FLOATCONSTANT","INTCONSTANT","BOOLCONSTANT","FIELD_SELECTION","LEFT_OP", +"RIGHT_OP","INC_OP","DEC_OP","LE_OP","GE_OP","EQ_OP","NE_OP","AND_OP","OR_OP", +"XOR_OP","MUL_ASSIGN","DIV_ASSIGN","ADD_ASSIGN","MOD_ASSIGN","LEFT_ASSIGN","RIGHT_ASSIGN", +"AND_ASSIGN","XOR_ASSIGN","OR_ASSIGN","SUB_ASSIGN","LEFT_PAREN","RIGHT_PAREN", +"LEFT_BRACKET","RIGHT_BRACKET","LEFT_BRACE","RIGHT_BRACE","DOT","COMMA","COLON", +"EQUAL","SEMICOLON","BANG","DASH","TILDE","PLUS","STAR","SLASH","PERCENT","LEFT_ANGLE", +"RIGHT_ANGLE","VERTICAL_BAR","CARET","AMPERSAND","QUESTION","variable_identifier", +"primary_expression","postfix_expression","integer_expression","function_call", +"function_call_or_method","function_call_generic","function_call_header_no_parameters", +"function_call_header_with_parameters","function_call_header","function_identifier", +"unary_expression","unary_operator","multiplicative_expression","additive_expression", +"shift_expression","relational_expression","equality_expression","and_expression", +"exclusive_or_expression","inclusive_or_expression","logical_and_expression", +"logical_xor_expression","logical_or_expression","conditional_expression","assignment_expression", +"assignment_operator","expression","constant_expression","declaration","function_prototype", +"function_declarator","function_header_with_parameters","function_header","parameter_declarator", +"parameter_declaration","parameter_qualifier","parameter_type_specifier","init_declarator_list", +"single_declaration","fully_specified_type","type_qualifier","type_specifier", +"precision_qualifier","type_specifier_no_prec","type_specifier_nonarray","struct_specifier", +"struct_declaration_list","struct_declaration","struct_declarator_list","struct_declarator", +"initializer","declaration_statement","statement","simple_statement","compound_statement", +"@1","@2","statement_no_new_scope","compound_statement_no_new_scope","statement_list", +"expression_statement","selection_statement","selection_rest_statement","condition", +"iteration_statement","@3","@4","@5","for_init_statement","conditionopt","for_rest_statement", +"jump_statement","translation_unit","external_declaration","function_definition", +"@6","" +}; +#endif + +static const short yyr1[] = { 0, + 94, 95, 95, 95, 95, 95, 96, 96, 96, 96, + 96, 96, 97, 98, 99, 99, 100, 100, 101, 101, + 102, 102, 103, 104, 104, 104, 105, 105, 105, 105, + 106, 106, 106, 107, 107, 107, 108, 108, 108, 109, + 110, 110, 110, 110, 110, 111, 111, 111, 112, 113, + 114, 115, 115, 116, 116, 117, 117, 118, 118, 119, + 119, 120, 120, 120, 120, 120, 121, 121, 122, 123, + 123, 123, 124, 125, 125, 126, 126, 127, 128, 128, + 129, 129, 129, 129, 130, 130, 130, 130, 131, 132, + 132, 132, 132, 132, 133, 133, 133, 133, 133, 133, + 134, 134, 135, 135, 135, 135, 135, 136, 136, 137, + 137, 137, 138, 138, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 139, 139, 139, 139, 139, 139, + 139, 139, 139, 139, 140, 140, 141, 141, 142, 143, + 143, 144, 144, 145, 146, 147, 147, 148, 148, 148, + 148, 148, 149, 150, 151, 149, 152, 152, 153, 153, + 154, 154, 155, 155, 156, 157, 157, 158, 158, 160, + 159, 161, 159, 162, 159, 163, 163, 164, 164, 165, + 165, 166, 166, 166, 166, 166, 167, 167, 168, 168, + 170, 169 +}; + +static const short yyr2[] = { 0, + 1, 1, 1, 1, 1, 3, 1, 4, 1, 3, + 2, 2, 1, 1, 1, 3, 2, 2, 2, 1, + 2, 3, 2, 1, 1, 1, 1, 2, 2, 2, + 1, 1, 1, 1, 3, 3, 1, 3, 3, 1, + 1, 3, 3, 3, 3, 1, 3, 3, 1, 1, + 1, 1, 3, 1, 3, 1, 3, 1, 5, 1, + 3, 1, 1, 1, 1, 1, 1, 3, 1, 2, + 2, 4, 2, 1, 1, 2, 3, 3, 2, 5, + 3, 2, 3, 2, 0, 1, 1, 1, 1, 1, + 3, 5, 6, 5, 1, 2, 4, 5, 4, 2, + 1, 2, 1, 1, 1, 2, 1, 1, 2, 1, + 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 5, 4, 1, 2, 3, 1, + 3, 1, 4, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 2, 0, 0, 5, 1, 1, 2, 3, + 1, 2, 1, 2, 5, 3, 1, 1, 4, 0, + 6, 0, 8, 0, 7, 1, 1, 1, 0, 2, + 3, 2, 2, 2, 3, 2, 1, 2, 1, 1, + 0, 3 +}; + +static const short yydefact[] = { 0, + 0, 110, 111, 112, 0, 104, 103, 118, 116, 117, + 122, 123, 124, 125, 126, 127, 119, 120, 121, 128, + 129, 130, 107, 105, 0, 115, 131, 132, 134, 190, + 191, 0, 75, 85, 0, 90, 95, 0, 101, 0, + 108, 113, 133, 0, 187, 189, 106, 100, 0, 0, + 0, 70, 0, 73, 85, 0, 86, 87, 88, 76, + 0, 85, 0, 71, 96, 102, 109, 0, 188, 0, + 0, 0, 0, 137, 0, 192, 77, 82, 84, 89, + 0, 91, 78, 0, 0, 1, 4, 3, 5, 26, + 0, 0, 0, 33, 32, 31, 2, 7, 27, 9, + 14, 15, 0, 0, 20, 0, 34, 0, 37, 40, + 41, 46, 49, 50, 51, 52, 54, 56, 58, 69, + 0, 24, 72, 0, 142, 0, 140, 136, 138, 0, + 0, 172, 0, 0, 0, 0, 0, 154, 159, 163, + 34, 60, 67, 0, 145, 0, 101, 148, 161, 147, + 146, 0, 149, 150, 151, 152, 79, 81, 83, 0, + 0, 97, 0, 144, 99, 28, 29, 0, 11, 12, + 0, 0, 18, 17, 0, 115, 21, 23, 30, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 114, 135, 0, 0, 139, 183, 182, + 0, 174, 0, 186, 184, 0, 170, 153, 0, 63, + 64, 65, 66, 62, 0, 0, 164, 160, 162, 0, + 92, 0, 94, 98, 6, 0, 13, 25, 10, 16, + 22, 35, 36, 39, 38, 44, 45, 42, 43, 47, + 48, 53, 55, 57, 0, 0, 141, 0, 0, 0, + 185, 0, 155, 61, 68, 0, 93, 8, 0, 143, + 0, 177, 176, 179, 0, 168, 0, 0, 0, 80, + 59, 0, 178, 0, 0, 167, 165, 0, 0, 156, + 0, 180, 0, 0, 0, 158, 171, 157, 0, 181, + 175, 166, 169, 173, 0, 0 +}; + +static const short yydefgoto[] = { 97, + 98, 99, 226, 100, 101, 102, 103, 104, 105, 106, + 141, 108, 109, 110, 111, 112, 113, 114, 115, 116, + 117, 118, 119, 142, 143, 215, 144, 121, 145, 146, + 32, 33, 34, 78, 60, 61, 79, 35, 36, 37, + 38, 122, 40, 41, 42, 43, 73, 74, 126, 127, + 165, 148, 149, 150, 151, 209, 269, 287, 288, 152, + 153, 154, 277, 268, 155, 252, 201, 249, 264, 274, + 275, 156, 44, 45, 46, 53 +}; + +static const short yypact[] = { 1224, + 2,-32768,-32768,-32768, 115,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768,-32768, -31,-32768,-32768,-32768,-32768,-32768, + -67, 36, -54, 23, 11,-32768, 27, 1265,-32768, 1289, +-32768, 5,-32768, 1137,-32768,-32768,-32768,-32768, 1289, 42, + 1265,-32768, 56,-32768, 76, 99,-32768,-32768,-32768,-32768, + 1265, 94, 108,-32768, -52,-32768,-32768, 907,-32768, 78, + 1265, 116, 1041,-32768, 282,-32768,-32768,-32768,-32768, 117, + 1265, -55,-32768, 193, 907, 91,-32768,-32768,-32768,-32768, + 907, 907, 907,-32768,-32768,-32768,-32768,-32768, -42,-32768, +-32768,-32768, 93, -5, 974, 92,-32768, 907, 15, -47, +-32768, -25, -1,-32768,-32768,-32768, 110, 106, -53,-32768, + 95,-32768,-32768, 1082, 97, 26,-32768,-32768,-32768, 90, + 98,-32768, 101, 102, 100, 759, 103, 104,-32768,-32768, + 7,-32768,-32768, 28,-32768, -67, 111,-32768,-32768,-32768, +-32768, 364,-32768,-32768,-32768,-32768, 112,-32768,-32768, 826, + 907,-32768, 109,-32768,-32768,-32768,-32768, 3,-32768,-32768, + 907, 1178,-32768,-32768, 907, 118,-32768,-32768,-32768, 907, + 907, 907, 907, 907, 907, 907, 907, 907, 907, 907, + 907, 907, 907,-32768,-32768, 907, 116,-32768,-32768,-32768, + 446,-32768, 907,-32768,-32768, 38,-32768,-32768, 446,-32768, +-32768,-32768,-32768,-32768, 907, 907,-32768,-32768,-32768, 907, +-32768, 113,-32768,-32768,-32768, 114, 119,-32768, 120,-32768, +-32768,-32768,-32768, 15, 15,-32768,-32768,-32768,-32768, -25, + -25,-32768, 110, 106, 45, 121,-32768, 134, 610, 12, +-32768, 692, 446,-32768,-32768, 122,-32768,-32768, 907,-32768, + 130,-32768,-32768, 692, 446, 119, 145, 135, 132,-32768, +-32768, 907,-32768, 128, 139, 175,-32768, 133, 528,-32768, + 16, 907, 528, 446, 907,-32768,-32768,-32768, 131, 119, +-32768,-32768,-32768,-32768, 192,-32768 +}; + +static const short yypgoto[] = {-32768, +-32768,-32768,-32768,-32768,-32768, 41,-32768,-32768,-32768,-32768, + -43,-32768, -48,-32768, -88, -32,-32768,-32768,-32768, 37, + 35, 50,-32768, -65, -83,-32768, -89, -70, 6, 8, +-32768,-32768,-32768, 147, 174, 168, 152,-32768,-32768, -231, + -19, 0, 238, -33,-32768,-32768, 176, -62,-32768, 49, + -160, 1, -99, -237,-32768,-32768,-32768, -35, 198, 46, + 9,-32768,-32768, -10,-32768,-32768,-32768,-32768,-32768,-32768, +-32768,-32768,-32768, 212,-32768,-32768 +}; + + +#define YYLAST 1333 + + +static const short yytable[] = { 39, + 223, 164, 120, 168, 192, 30, 67, 31, 169, 170, + 129, 50, 52, 163, 62, 70, 160, 83, 120, 84, + 267, 177, 55, 161, 107, 56, 85, 184, 185, 171, + 6, 7, 267, 172, 182, 62, 183, 66, 47, 193, + 107, 286, 51, 39, 48, 286, 206, 166, 167, 30, + 72, 31, 219, 188, 189, 57, 58, 59, 23, 24, + 80, 129, 186, 187, 179, 174, 210, 211, 212, 65, + 72, 175, 72, 225, 147, 213, 68, 164, 56, 216, + 80, 227, 265, 6, 7, 214, 289, 63, 216, 222, + 64, 231, 216, -74, 120, 236, 237, 238, 239, 180, + 181, 248, 197, 245, 216, 198, 54, 217, 57, 58, + 59, 23, 24, 250, 216, 71, 107, 251, 2, 3, + 4, 216, 259, 72, 293, 246, 57, 58, 59, 75, + 120, 254, 255, 234, 235, 47, 232, 233, 107, 107, + 107, 107, 107, 107, 107, 107, 107, 107, 107, 256, + 82, 147, 107, 219, 120, 240, 241, 123, 125, 157, + -25, 178, 266, 173, 191, 276, 190, 194, 196, 199, + 202, 203, 207, 261, 266, 271, 107, 200, 208, 204, + -24, 224, 281, 220, 292, 257, 258, 278, -19, -26, + 284, 296, 290, 260, 270, 216, 2, 3, 4, 272, + 147, 164, 8, 9, 10, 279, 280, 282, 147, 283, + 294, 285, 230, 11, 12, 13, 14, 15, 16, 17, + 18, 19, 20, 21, 22, 243, 242, 158, 77, 81, + 25, 26, 159, 27, 28, 86, 29, 87, 88, 89, + 90, 244, 49, 91, 92, 247, 124, 291, 147, 262, + 76, 147, 147, 273, 253, 69, 0, 263, 0, 0, + 0, 0, 93, 147, 147, 162, 0, 0, 0, 0, + 0, 0, 0, 94, 95, 0, 96, 0, 147, 0, + 0, 0, 147, 147, 1, 2, 3, 4, 5, 6, + 7, 8, 9, 10, 130, 131, 132, 0, 133, 134, + 135, 136, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 0, 0, 0, 23, 24, 25, + 26, 137, 27, 28, 86, 29, 87, 88, 89, 90, + 0, 0, 91, 92, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 93, 0, 0, 0, 138, 139, 0, 0, 0, + 0, 140, 94, 95, 0, 96, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 130, 131, 132, 0, + 133, 134, 135, 136, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 137, 27, 28, 86, 29, 87, 88, + 89, 90, 0, 0, 91, 92, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 93, 0, 0, 0, 138, 218, 0, + 0, 0, 0, 140, 94, 95, 0, 96, 1, 2, + 3, 4, 5, 6, 7, 8, 9, 10, 130, 131, + 132, 0, 133, 134, 135, 136, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, + 0, 23, 24, 25, 26, 137, 27, 28, 86, 29, + 87, 88, 89, 90, 0, 0, 91, 92, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 0, 138, + 0, 0, 0, 0, 0, 140, 94, 95, 0, 96, + 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, + 130, 131, 132, 0, 133, 134, 135, 136, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 0, 0, 0, 23, 24, 25, 26, 137, 27, 28, + 86, 29, 87, 88, 89, 90, 0, 0, 91, 92, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 93, 0, 0, + 0, 75, 0, 0, 0, 0, 0, 140, 94, 95, + 0, 96, 1, 2, 3, 4, 5, 6, 7, 8, + 9, 10, 0, 0, 0, 0, 0, 0, 0, 0, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 0, 0, 0, 23, 24, 25, 26, 0, + 27, 28, 86, 29, 87, 88, 89, 90, 0, 0, + 91, 92, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 140, + 94, 95, 0, 96, 56, 2, 3, 4, 0, 6, + 7, 8, 9, 10, 0, 0, 0, 0, 0, 0, + 0, 0, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 0, 0, 0, 23, 24, 25, + 26, 0, 27, 28, 86, 29, 87, 88, 89, 90, + 0, 0, 91, 92, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 93, 2, 3, 4, 0, 0, 0, 8, 9, + 10, 0, 94, 95, 0, 96, 0, 0, 0, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 0, 0, 0, 0, 0, 25, 26, 0, 27, + 28, 86, 29, 87, 88, 89, 90, 0, 0, 91, + 92, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 93, 2, + 3, 4, 0, 0, 0, 8, 9, 10, 205, 94, + 95, 0, 96, 0, 0, 0, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 0, 0, + 0, 0, 0, 25, 26, 0, 27, 28, 86, 29, + 87, 88, 89, 90, 0, 0, 91, 92, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 93, 0, 0, 221, 0, + 0, 0, 0, 0, 0, 0, 94, 95, 0, 96, + 2, 3, 4, 0, 0, 0, 8, 9, 10, 0, + 0, 0, 0, 0, 0, 0, 0, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, + 0, 0, 0, 0, 25, 26, 0, 27, 28, 86, + 29, 87, 88, 89, 90, 0, 0, 91, 92, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 93, 2, 3, 4, + 0, 0, 0, 8, 9, 10, 0, 94, 95, 0, + 96, 0, 0, 0, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 0, 0, 0, 0, + 0, 25, 176, 0, 27, 28, 86, 29, 87, 88, + 89, 90, 0, 0, 91, 92, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 93, 2, 3, 4, 0, 0, 0, + 8, 9, 10, 0, 94, 95, 0, 96, 0, 0, + 0, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 22, 0, 0, 0, 0, 0, 25, 26, + 0, 27, 28, 0, 29, 2, 3, 4, 0, 0, + 0, 8, 9, 10, 0, 0, 0, 0, 0, 0, + 0, 0, 11, 12, 13, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 0, 128, 0, 0, 0, 25, + 26, 0, 27, 28, 0, 29, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 295, 0, 0, 1, + 2, 3, 4, 5, 6, 7, 8, 9, 10, 0, + 0, 0, 0, 0, 0, 0, 195, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 0, + 0, 0, 23, 24, 25, 26, 0, 27, 28, 0, + 29, 2, 3, 4, 0, 0, 0, 8, 9, 10, + 0, 0, 0, 0, 0, 0, 0, 0, 11, 12, + 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, + 0, 0, 0, 0, 0, 25, 26, 0, 27, 28, + 228, 29, 0, 0, 0, 229, 1, 2, 3, 4, + 5, 6, 7, 8, 9, 10, 0, 0, 0, 0, + 0, 0, 0, 0, 11, 12, 13, 14, 15, 16, + 17, 18, 19, 20, 21, 22, 0, 0, 0, 23, + 24, 25, 26, 0, 27, 28, 0, 29, 2, 3, + 4, 0, 0, 0, 8, 9, 10, 0, 0, 0, + 0, 0, 0, 0, 0, 11, 12, 13, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 0, 8, 9, + 10, 0, 25, 26, 0, 27, 28, 0, 29, 11, + 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, + 22, 0, 0, 0, 0, 0, 25, 26, 0, 27, + 28, 0, 29 +}; + +static const short yycheck[] = { 0, + 161, 85, 68, 93, 58, 0, 40, 0, 51, 52, + 73, 43, 80, 84, 34, 49, 72, 70, 84, 72, + 252, 105, 77, 79, 68, 3, 79, 53, 54, 72, + 8, 9, 264, 76, 82, 55, 84, 38, 37, 93, + 84, 279, 74, 44, 43, 283, 136, 91, 92, 44, + 51, 44, 152, 55, 56, 33, 34, 35, 36, 37, + 61, 124, 88, 89, 108, 71, 60, 61, 62, 43, + 71, 77, 73, 71, 75, 69, 72, 161, 3, 77, + 81, 171, 71, 8, 9, 79, 71, 77, 77, 160, + 80, 175, 77, 71, 160, 184, 185, 186, 187, 85, + 86, 201, 77, 193, 77, 80, 71, 80, 33, 34, + 35, 36, 37, 203, 77, 74, 160, 80, 4, 5, + 6, 77, 78, 124, 285, 196, 33, 34, 35, 74, + 196, 215, 216, 182, 183, 37, 180, 181, 182, 183, + 184, 185, 186, 187, 188, 189, 190, 191, 192, 220, + 43, 152, 196, 253, 220, 188, 189, 80, 43, 43, + 70, 70, 252, 71, 59, 265, 57, 73, 72, 80, + 70, 70, 70, 40, 264, 259, 220, 80, 75, 80, + 70, 73, 272, 72, 284, 73, 73, 43, 71, 70, + 16, 0, 282, 73, 73, 77, 4, 5, 6, 70, + 201, 285, 10, 11, 12, 71, 75, 80, 209, 71, + 80, 79, 172, 21, 22, 23, 24, 25, 26, 27, + 28, 29, 30, 31, 32, 191, 190, 81, 55, 62, + 38, 39, 81, 41, 42, 43, 44, 45, 46, 47, + 48, 192, 5, 51, 52, 197, 71, 283, 249, 249, + 53, 252, 253, 264, 209, 44, -1, 249, -1, -1, + -1, -1, 70, 264, 265, 73, -1, -1, -1, -1, + -1, -1, -1, 81, 82, -1, 84, -1, 279, -1, + -1, -1, 283, 284, 3, 4, 5, 6, 7, 8, + 9, 10, 11, 12, 13, 14, 15, -1, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, -1, -1, -1, 36, 37, 38, + 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, + -1, -1, 51, 52, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 70, -1, -1, -1, 74, 75, -1, -1, -1, + -1, 80, 81, 82, -1, 84, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, 13, 14, 15, -1, + 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, + 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, + 47, 48, -1, -1, 51, 52, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 70, -1, -1, -1, 74, 75, -1, + -1, -1, -1, 80, 81, 82, -1, 84, 3, 4, + 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, + 15, -1, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, + -1, 36, 37, 38, 39, 40, 41, 42, 43, 44, + 45, 46, 47, 48, -1, -1, 51, 52, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 70, -1, -1, -1, 74, + -1, -1, -1, -1, -1, 80, 81, 82, -1, 84, + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, -1, 17, 18, 19, 20, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + -1, -1, -1, 36, 37, 38, 39, 40, 41, 42, + 43, 44, 45, 46, 47, 48, -1, -1, 51, 52, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, 70, -1, -1, + -1, 74, -1, -1, -1, -1, -1, 80, 81, 82, + -1, 84, 3, 4, 5, 6, 7, 8, 9, 10, + 11, 12, -1, -1, -1, -1, -1, -1, -1, -1, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, -1, -1, -1, 36, 37, 38, 39, -1, + 41, 42, 43, 44, 45, 46, 47, 48, -1, -1, + 51, 52, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 70, + -1, -1, -1, -1, -1, -1, -1, -1, -1, 80, + 81, 82, -1, 84, 3, 4, 5, 6, -1, 8, + 9, 10, 11, 12, -1, -1, -1, -1, -1, -1, + -1, -1, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, -1, -1, -1, 36, 37, 38, + 39, -1, 41, 42, 43, 44, 45, 46, 47, 48, + -1, -1, 51, 52, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, 70, 4, 5, 6, -1, -1, -1, 10, 11, + 12, -1, 81, 82, -1, 84, -1, -1, -1, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, -1, -1, -1, -1, -1, 38, 39, -1, 41, + 42, 43, 44, 45, 46, 47, 48, -1, -1, 51, + 52, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, 70, 4, + 5, 6, -1, -1, -1, 10, 11, 12, 80, 81, + 82, -1, 84, -1, -1, -1, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, -1, -1, + -1, -1, -1, 38, 39, -1, 41, 42, 43, 44, + 45, 46, 47, 48, -1, -1, 51, 52, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, 70, -1, -1, 73, -1, + -1, -1, -1, -1, -1, -1, 81, 82, -1, 84, + 4, 5, 6, -1, -1, -1, 10, 11, 12, -1, + -1, -1, -1, -1, -1, -1, -1, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, + -1, -1, -1, -1, 38, 39, -1, 41, 42, 43, + 44, 45, 46, 47, 48, -1, -1, 51, 52, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 70, 4, 5, 6, + -1, -1, -1, 10, 11, 12, -1, 81, 82, -1, + 84, -1, -1, -1, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, -1, -1, -1, -1, + -1, 38, 39, -1, 41, 42, 43, 44, 45, 46, + 47, 48, -1, -1, 51, 52, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, 70, 4, 5, 6, -1, -1, -1, + 10, 11, 12, -1, 81, 82, -1, 84, -1, -1, + -1, 21, 22, 23, 24, 25, 26, 27, 28, 29, + 30, 31, 32, -1, -1, -1, -1, -1, 38, 39, + -1, 41, 42, -1, 44, 4, 5, 6, -1, -1, + -1, 10, 11, 12, -1, -1, -1, -1, -1, -1, + -1, -1, 21, 22, 23, 24, 25, 26, 27, 28, + 29, 30, 31, 32, -1, 75, -1, -1, -1, 38, + 39, -1, 41, 42, -1, 44, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, 0, -1, -1, 3, + 4, 5, 6, 7, 8, 9, 10, 11, 12, -1, + -1, -1, -1, -1, -1, -1, 75, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 32, -1, + -1, -1, 36, 37, 38, 39, -1, 41, 42, -1, + 44, 4, 5, 6, -1, -1, -1, 10, 11, 12, + -1, -1, -1, -1, -1, -1, -1, -1, 21, 22, + 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, + -1, -1, -1, -1, -1, 38, 39, -1, 41, 42, + 43, 44, -1, -1, -1, 48, 3, 4, 5, 6, + 7, 8, 9, 10, 11, 12, -1, -1, -1, -1, + -1, -1, -1, -1, 21, 22, 23, 24, 25, 26, + 27, 28, 29, 30, 31, 32, -1, -1, -1, 36, + 37, 38, 39, -1, 41, 42, -1, 44, 4, 5, + 6, -1, -1, -1, 10, 11, 12, -1, -1, -1, + -1, -1, -1, -1, -1, 21, 22, 23, 24, 25, + 26, 27, 28, 29, 30, 31, 32, -1, 10, 11, + 12, -1, 38, 39, -1, 41, 42, -1, 44, 21, + 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, + 32, -1, -1, -1, -1, -1, 38, 39, -1, 41, + 42, -1, 44 +}; +#define YYPURE 1 + +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + 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 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not __GNUC__ */ +#if HAVE_ALLOCA_H +#include +#else /* not HAVE_ALLOCA_H */ +#ifdef _AIX + #pragma alloca +#else /* not _AIX */ +char *alloca (); +#endif /* not _AIX */ +#endif /* not HAVE_ALLOCA_H */ +#endif /* not __GNUC__ */ + +extern void yyerror(char* s); + +#ifndef alloca +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) +#include +#else /* not sparc */ +#if (defined (MSDOS) && !defined (__TURBOC__)) || defined (WIN32) +#include +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +#include + #pragma alloca +#else /* not MSDOS, __TURBOC__, or _AIX */ +#ifdef __hpux +#ifdef __cplusplus +extern "C" { +void *alloca (unsigned int); +}; +#else /* not __cplusplus */ +void *alloca (); +#endif /* not __cplusplus */ +#endif /* __hpux */ +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc. */ +#endif /* not GNU C. */ +#endif /* alloca not defined. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT return(0) +#define YYABORT return(1) +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +int yyparse (void); +#endif + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (from, to, count) + char *from; + char *to; + size_t count; +{ + register char *f = from; + register char *t = to; + register size_t i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *from, char *to, size_t count) +{ + register char *f = from; + register char *t = to; + register size_t i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifndef YYPARSE_PARAM_DECL +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif +#else +#define YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#endif + +extern YY_DECL; + +int +yyparse(YYPARSE_PARAM_DECL YYPARSE_PARAM) { + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + size_t yystacksize = YYINITDEPTH; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + 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 - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + size_t size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; + yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); + yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + + + switch (yyn) { + +case 1: +{ + // The symbol table search was done in the lexical phase + const TSymbol* symbol = yyvsp[0].lex.symbol; + const TVariable* variable; + if (symbol == 0) { + parseContext->error(yyvsp[0].lex.line, "undeclared identifier", yyvsp[0].lex.string->c_str(), ""); + parseContext->recover(); + TType type(EbtFloat, EbpUndefined); + TVariable* fakeVariable = new TVariable(yyvsp[0].lex.string, type); + parseContext->symbolTable.insert(*fakeVariable); + variable = fakeVariable; + } else { + // This identifier can only be a variable type symbol + if (! symbol->isVariable()) { + parseContext->error(yyvsp[0].lex.line, "variable expected", yyvsp[0].lex.string->c_str(), ""); + parseContext->recover(); + } + variable = static_cast(symbol); + } + + // don't delete $1.string, it's used by error recovery, and the pool + // pop will reclaim the memory + + if (variable->getType().getQualifier() == EvqConst ) { + ConstantUnion* constArray = variable->getConstPointer(); + TType t(variable->getType()); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(constArray, t, yyvsp[0].lex.line); + } else + yyval.interm.intermTypedNode = parseContext->intermediate.addSymbol(variable->getUniqueId(), + variable->getName(), + variable->getType(), yyvsp[0].lex.line); + ; + break;} +case 2: +{ + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 3: +{ + // + // INT_TYPE is only 16-bit plus sign bit for vertex/fragment shaders, + // check for overflow for constants + // + if (abs(yyvsp[0].lex.i) >= (1 << 16)) { + parseContext->error(yyvsp[0].lex.line, " integer constant overflow", "", ""); + parseContext->recover(); + } + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setIConst(yyvsp[0].lex.i); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), yyvsp[0].lex.line); + ; + break;} +case 4: +{ + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setFConst(yyvsp[0].lex.f); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), yyvsp[0].lex.line); + ; + break;} +case 5: +{ + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(yyvsp[0].lex.b); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[0].lex.line); + ; + break;} +case 6: +{ + yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode; + ; + break;} +case 7: +{ + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 8: +{ + if (!yyvsp[-3].interm.intermTypedNode->isArray() && !yyvsp[-3].interm.intermTypedNode->isMatrix() && !yyvsp[-3].interm.intermTypedNode->isVector()) { + if (yyvsp[-3].interm.intermTypedNode->getAsSymbolNode()) + parseContext->error(yyvsp[-2].lex.line, " left of '[' is not of type array, matrix, or vector ", yyvsp[-3].interm.intermTypedNode->getAsSymbolNode()->getSymbol().c_str(), ""); + else + parseContext->error(yyvsp[-2].lex.line, " left of '[' is not of type array, matrix, or vector ", "expression", ""); + parseContext->recover(); + } + if (yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst && yyvsp[-1].interm.intermTypedNode->getQualifier() == EvqConst) { + if (yyvsp[-3].interm.intermTypedNode->isArray()) { // constant folding for arrays + yyval.interm.intermTypedNode = parseContext->addConstArrayNode(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), yyvsp[-3].interm.intermTypedNode, yyvsp[-2].lex.line); + } else if (yyvsp[-3].interm.intermTypedNode->isVector()) { // constant folding for vectors + TVectorFields fields; + fields.num = 1; + fields.offsets[0] = yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst(); // need to do it this way because v.xy sends fields integer array + yyval.interm.intermTypedNode = parseContext->addConstVectorNode(fields, yyvsp[-3].interm.intermTypedNode, yyvsp[-2].lex.line); + } else if (yyvsp[-3].interm.intermTypedNode->isMatrix()) { // constant folding for matrices + yyval.interm.intermTypedNode = parseContext->addConstMatrixNode(yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), yyvsp[-3].interm.intermTypedNode, yyvsp[-2].lex.line); + } + } else { + if (yyvsp[-1].interm.intermTypedNode->getQualifier() == EvqConst) { + if ((yyvsp[-3].interm.intermTypedNode->isVector() || yyvsp[-3].interm.intermTypedNode->isMatrix()) && yyvsp[-3].interm.intermTypedNode->getType().getNominalSize() <= yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst() && !yyvsp[-3].interm.intermTypedNode->isArray() ) { + parseContext->error(yyvsp[-2].lex.line, "", "[", "field selection out of range '%d'", yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst()); + parseContext->recover(); + } else { + if (yyvsp[-3].interm.intermTypedNode->isArray()) { + if (yyvsp[-3].interm.intermTypedNode->getType().getArraySize() == 0) { + if (yyvsp[-3].interm.intermTypedNode->getType().getMaxArraySize() <= yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst()) { + if (parseContext->arraySetMaxSize(yyvsp[-3].interm.intermTypedNode->getAsSymbolNode(), yyvsp[-3].interm.intermTypedNode->getTypePointer(), yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), true, yyvsp[-2].lex.line)) + parseContext->recover(); + } else { + if (parseContext->arraySetMaxSize(yyvsp[-3].interm.intermTypedNode->getAsSymbolNode(), yyvsp[-3].interm.intermTypedNode->getTypePointer(), 0, false, yyvsp[-2].lex.line)) + parseContext->recover(); + } + } else if ( yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst() >= yyvsp[-3].interm.intermTypedNode->getType().getArraySize()) { + parseContext->error(yyvsp[-2].lex.line, "", "[", "array index out of range '%d'", yyvsp[-1].interm.intermTypedNode->getAsConstantUnion()->getUnionArrayPointer()->getIConst()); + parseContext->recover(); + } + } + yyval.interm.intermTypedNode = parseContext->intermediate.addIndex(EOpIndexDirect, yyvsp[-3].interm.intermTypedNode, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line); + } + } else { + if (yyvsp[-3].interm.intermTypedNode->isArray() && yyvsp[-3].interm.intermTypedNode->getType().getArraySize() == 0) { + parseContext->error(yyvsp[-2].lex.line, "", "[", "array must be redeclared with a size before being indexed with a variable"); + parseContext->recover(); + } + + yyval.interm.intermTypedNode = parseContext->intermediate.addIndex(EOpIndexIndirect, yyvsp[-3].interm.intermTypedNode, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line); + } + } + if (yyval.interm.intermTypedNode == 0) { + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setFConst(0.0f); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpHigh, EvqConst), yyvsp[-2].lex.line); + } else if (yyvsp[-3].interm.intermTypedNode->isArray()) { + if (yyvsp[-3].interm.intermTypedNode->getType().getStruct()) + yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getType().getStruct(), yyvsp[-3].interm.intermTypedNode->getType().getTypeName())); + else + yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), yyvsp[-3].interm.intermTypedNode->getPrecision(), EvqTemporary, yyvsp[-3].interm.intermTypedNode->getNominalSize(), yyvsp[-3].interm.intermTypedNode->isMatrix())); + + if (yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst) + yyval.interm.intermTypedNode->getTypePointer()->setQualifier(EvqConst); + } else if (yyvsp[-3].interm.intermTypedNode->isMatrix() && yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst) + yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), yyvsp[-3].interm.intermTypedNode->getPrecision(), EvqConst, yyvsp[-3].interm.intermTypedNode->getNominalSize())); + else if (yyvsp[-3].interm.intermTypedNode->isMatrix()) + yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), yyvsp[-3].interm.intermTypedNode->getPrecision(), EvqTemporary, yyvsp[-3].interm.intermTypedNode->getNominalSize())); + else if (yyvsp[-3].interm.intermTypedNode->isVector() && yyvsp[-3].interm.intermTypedNode->getType().getQualifier() == EvqConst) + yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), yyvsp[-3].interm.intermTypedNode->getPrecision(), EvqConst)); + else if (yyvsp[-3].interm.intermTypedNode->isVector()) + yyval.interm.intermTypedNode->setType(TType(yyvsp[-3].interm.intermTypedNode->getBasicType(), yyvsp[-3].interm.intermTypedNode->getPrecision(), EvqTemporary)); + else + yyval.interm.intermTypedNode->setType(yyvsp[-3].interm.intermTypedNode->getType()); + ; + break;} +case 9: +{ + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 10: +{ + if (yyvsp[-2].interm.intermTypedNode->isArray()) { + parseContext->error(yyvsp[0].lex.line, "cannot apply dot operator to an array", ".", ""); + parseContext->recover(); + } + + if (yyvsp[-2].interm.intermTypedNode->isVector()) { + TVectorFields fields; + if (! parseContext->parseVectorFields(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode->getNominalSize(), fields, yyvsp[0].lex.line)) { + fields.num = 1; + fields.offsets[0] = 0; + parseContext->recover(); + } + + if (yyvsp[-2].interm.intermTypedNode->getType().getQualifier() == EvqConst) { // constant folding for vector fields + yyval.interm.intermTypedNode = parseContext->addConstVectorNode(fields, yyvsp[-2].interm.intermTypedNode, yyvsp[0].lex.line); + if (yyval.interm.intermTypedNode == 0) { + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + else + yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), yyvsp[-2].interm.intermTypedNode->getPrecision(), EvqConst, (int) (*yyvsp[0].lex.string).size())); + } else { + if (fields.num == 1) { + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setIConst(fields.offsets[0]); + TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), yyvsp[0].lex.line); + yyval.interm.intermTypedNode = parseContext->intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line); + yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), yyvsp[-2].interm.intermTypedNode->getPrecision())); + } else { + TString vectorString = *yyvsp[0].lex.string; + TIntermTyped* index = parseContext->intermediate.addSwizzle(fields, yyvsp[0].lex.line); + yyval.interm.intermTypedNode = parseContext->intermediate.addIndex(EOpVectorSwizzle, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line); + yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), yyvsp[-2].interm.intermTypedNode->getPrecision(), EvqTemporary, (int) vectorString.size())); + } + } + } else if (yyvsp[-2].interm.intermTypedNode->isMatrix()) { + TMatrixFields fields; + if (! parseContext->parseMatrixFields(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode->getNominalSize(), fields, yyvsp[0].lex.line)) { + fields.wholeRow = false; + fields.wholeCol = false; + fields.row = 0; + fields.col = 0; + parseContext->recover(); + } + + if (fields.wholeRow || fields.wholeCol) { + parseContext->error(yyvsp[-1].lex.line, " non-scalar fields not implemented yet", ".", ""); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setIConst(0); + TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), yyvsp[0].lex.line); + yyval.interm.intermTypedNode = parseContext->intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line); + yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), yyvsp[-2].interm.intermTypedNode->getPrecision(),EvqTemporary, yyvsp[-2].interm.intermTypedNode->getNominalSize())); + } else { + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setIConst(fields.col * yyvsp[-2].interm.intermTypedNode->getNominalSize() + fields.row); + TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtInt, EbpUndefined, EvqConst), yyvsp[0].lex.line); + yyval.interm.intermTypedNode = parseContext->intermediate.addIndex(EOpIndexDirect, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line); + yyval.interm.intermTypedNode->setType(TType(yyvsp[-2].interm.intermTypedNode->getBasicType(), yyvsp[-2].interm.intermTypedNode->getPrecision())); + } + } else if (yyvsp[-2].interm.intermTypedNode->getBasicType() == EbtStruct) { + bool fieldFound = false; + const TTypeList* fields = yyvsp[-2].interm.intermTypedNode->getType().getStruct(); + if (fields == 0) { + parseContext->error(yyvsp[-1].lex.line, "structure has no fields", "Internal Error", ""); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } else { + unsigned int i; + for (i = 0; i < fields->size(); ++i) { + if ((*fields)[i].type->getFieldName() == *yyvsp[0].lex.string) { + fieldFound = true; + break; + } + } + if (fieldFound) { + if (yyvsp[-2].interm.intermTypedNode->getType().getQualifier() == EvqConst) { + yyval.interm.intermTypedNode = parseContext->addConstStruct(*yyvsp[0].lex.string, yyvsp[-2].interm.intermTypedNode, yyvsp[-1].lex.line); + if (yyval.interm.intermTypedNode == 0) { + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + else { + yyval.interm.intermTypedNode->setType(*(*fields)[i].type); + // change the qualifier of the return type, not of the structure field + // as the structure definition is shared between various structures. + yyval.interm.intermTypedNode->getTypePointer()->setQualifier(EvqConst); + } + } else { + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setIConst(i); + TIntermTyped* index = parseContext->intermediate.addConstantUnion(unionArray, *(*fields)[i].type, yyvsp[0].lex.line); + yyval.interm.intermTypedNode = parseContext->intermediate.addIndex(EOpIndexDirectStruct, yyvsp[-2].interm.intermTypedNode, index, yyvsp[-1].lex.line); + yyval.interm.intermTypedNode->setType(*(*fields)[i].type); + } + } else { + parseContext->error(yyvsp[-1].lex.line, " no such field in structure", yyvsp[0].lex.string->c_str(), ""); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + } + } else { + parseContext->error(yyvsp[-1].lex.line, " field selection requires structure, vector, or matrix on left hand side", yyvsp[0].lex.string->c_str(), ""); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + // don't delete $3.string, it's from the pool + ; + break;} +case 11: +{ + if (parseContext->lValueErrorCheck(yyvsp[0].lex.line, "++", yyvsp[-1].interm.intermTypedNode)) + parseContext->recover(); + yyval.interm.intermTypedNode = parseContext->intermediate.addUnaryMath(EOpPostIncrement, yyvsp[-1].interm.intermTypedNode, yyvsp[0].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->unaryOpError(yyvsp[0].lex.line, "++", yyvsp[-1].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode; + } + ; + break;} +case 12: +{ + if (parseContext->lValueErrorCheck(yyvsp[0].lex.line, "--", yyvsp[-1].interm.intermTypedNode)) + parseContext->recover(); + yyval.interm.intermTypedNode = parseContext->intermediate.addUnaryMath(EOpPostDecrement, yyvsp[-1].interm.intermTypedNode, yyvsp[0].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->unaryOpError(yyvsp[0].lex.line, "--", yyvsp[-1].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-1].interm.intermTypedNode; + } + ; + break;} +case 13: +{ + if (parseContext->integerErrorCheck(yyvsp[0].interm.intermTypedNode, "[]")) + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 14: +{ + TFunction* fnCall = yyvsp[0].interm.function; + TOperator op = fnCall->getBuiltInOp(); + + if (op != EOpNull) + { + // + // Then this should be a constructor. + // Don't go through the symbol table for constructors. + // Their parameters will be verified algorithmically. + // + TType type(EbtVoid, EbpUndefined); // use this to get the type back + if (parseContext->constructorErrorCheck(yyvsp[0].interm.line, yyvsp[0].interm.intermNode, *fnCall, op, &type)) { + yyval.interm.intermTypedNode = 0; + } else { + // + // It's a constructor, of type 'type'. + // + yyval.interm.intermTypedNode = parseContext->addConstructor(yyvsp[0].interm.intermNode, &type, op, fnCall, yyvsp[0].interm.line); + } + + if (yyval.interm.intermTypedNode == 0) { + parseContext->recover(); + yyval.interm.intermTypedNode = parseContext->intermediate.setAggregateOperator(0, op, yyvsp[0].interm.line); + } + yyval.interm.intermTypedNode->setType(type); + } else { + // + // Not a constructor. Find it in the symbol table. + // + const TFunction* fnCandidate; + bool builtIn; + fnCandidate = parseContext->findFunction(yyvsp[0].interm.line, fnCall, &builtIn); + if (fnCandidate) { + // + // A declared function. + // + if (builtIn && !fnCandidate->getExtension().empty() && + parseContext->extensionErrorCheck(yyvsp[0].interm.line, fnCandidate->getExtension())) { + parseContext->recover(); + } + op = fnCandidate->getBuiltInOp(); + if (builtIn && op != EOpNull) { + // + // A function call mapped to a built-in operation. + // + if (fnCandidate->getParamCount() == 1) { + // + // Treat it like a built-in unary operator. + // + yyval.interm.intermTypedNode = parseContext->intermediate.addUnaryMath(op, yyvsp[0].interm.intermNode, 0, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->error(yyvsp[0].interm.intermNode->getLine(), " wrong operand type", "Internal Error", + "built in unary operator function. Type: %s", + static_cast(yyvsp[0].interm.intermNode)->getCompleteString().c_str()); + YYERROR; + } + } else { + yyval.interm.intermTypedNode = parseContext->intermediate.setAggregateOperator(yyvsp[0].interm.intermAggregate, op, yyvsp[0].interm.line); + } + } else { + // This is a real function call + + yyval.interm.intermTypedNode = parseContext->intermediate.setAggregateOperator(yyvsp[0].interm.intermAggregate, EOpFunctionCall, yyvsp[0].interm.line); + yyval.interm.intermTypedNode->setType(fnCandidate->getReturnType()); + + // this is how we know whether the given function is a builtIn function or a user defined function + // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also + // if builtIn == true, it's definitely a builtIn function with EOpNull + if (!builtIn) + yyval.interm.intermTypedNode->getAsAggregate()->setUserDefined(); + yyval.interm.intermTypedNode->getAsAggregate()->setName(fnCandidate->getMangledName()); + + TQualifier qual; + for (int i = 0; i < fnCandidate->getParamCount(); ++i) { + qual = fnCandidate->getParam(i).type->getQualifier(); + if (qual == EvqOut || qual == EvqInOut) { + if (parseContext->lValueErrorCheck(yyval.interm.intermTypedNode->getLine(), "assign", yyval.interm.intermTypedNode->getAsAggregate()->getSequence()[i]->getAsTyped())) { + parseContext->error(yyvsp[0].interm.intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error", ""); + parseContext->recover(); + } + } + } + } + yyval.interm.intermTypedNode->setType(fnCandidate->getReturnType()); + } else { + // error message was put out by PaFindFunction() + // Put on a dummy node for error recovery + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setFConst(0.0f); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtFloat, EbpUndefined, EvqConst), yyvsp[0].interm.line); + parseContext->recover(); + } + } + delete fnCall; + ; + break;} +case 15: +{ + yyval.interm = yyvsp[0].interm; + ; + break;} +case 16: +{ + parseContext->error(yyvsp[0].interm.line, "methods are not supported", "", ""); + parseContext->recover(); + yyval.interm = yyvsp[0].interm; + ; + break;} +case 17: +{ + yyval.interm = yyvsp[-1].interm; + yyval.interm.line = yyvsp[0].lex.line; + ; + break;} +case 18: +{ + yyval.interm = yyvsp[-1].interm; + yyval.interm.line = yyvsp[0].lex.line; + ; + break;} +case 19: +{ + yyval.interm.function = yyvsp[-1].interm.function; + yyval.interm.intermNode = 0; + ; + break;} +case 20: +{ + yyval.interm.function = yyvsp[0].interm.function; + yyval.interm.intermNode = 0; + ; + break;} +case 21: +{ + TParameter param = { 0, new TType(yyvsp[0].interm.intermTypedNode->getType()) }; + yyvsp[-1].interm.function->addParameter(param); + yyval.interm.function = yyvsp[-1].interm.function; + yyval.interm.intermNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 22: +{ + TParameter param = { 0, new TType(yyvsp[0].interm.intermTypedNode->getType()) }; + yyvsp[-2].interm.function->addParameter(param); + yyval.interm.function = yyvsp[-2].interm.function; + yyval.interm.intermNode = parseContext->intermediate.growAggregate(yyvsp[-2].interm.intermNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line); + ; + break;} +case 23: +{ + yyval.interm.function = yyvsp[-1].interm.function; + ; + break;} +case 24: +{ + // + // Constructor + // + if (yyvsp[0].interm.type.array) { + // Constructors for arrays are not allowed. + parseContext->error(yyvsp[0].interm.type.line, "cannot construct this type", "array", ""); + parseContext->recover(); + yyvsp[0].interm.type.setArray(false); + } + + TOperator op = EOpNull; + if (yyvsp[0].interm.type.userDef) { + op = EOpConstructStruct; + } else { + switch (yyvsp[0].interm.type.type) { + case EbtFloat: + if (yyvsp[0].interm.type.matrix) { + switch(yyvsp[0].interm.type.size) { + case 2: op = EOpConstructMat2; break; + case 3: op = EOpConstructMat3; break; + case 4: op = EOpConstructMat4; break; + } + } else { + switch(yyvsp[0].interm.type.size) { + case 1: op = EOpConstructFloat; break; + case 2: op = EOpConstructVec2; break; + case 3: op = EOpConstructVec3; break; + case 4: op = EOpConstructVec4; break; + } + } + break; + case EbtInt: + switch(yyvsp[0].interm.type.size) { + case 1: op = EOpConstructInt; break; + case 2: FRAG_VERT_ONLY("ivec2", yyvsp[0].interm.type.line); op = EOpConstructIVec2; break; + case 3: FRAG_VERT_ONLY("ivec3", yyvsp[0].interm.type.line); op = EOpConstructIVec3; break; + case 4: FRAG_VERT_ONLY("ivec4", yyvsp[0].interm.type.line); op = EOpConstructIVec4; break; + } + break; + case EbtBool: + switch(yyvsp[0].interm.type.size) { + case 1: op = EOpConstructBool; break; + case 2: FRAG_VERT_ONLY("bvec2", yyvsp[0].interm.type.line); op = EOpConstructBVec2; break; + case 3: FRAG_VERT_ONLY("bvec3", yyvsp[0].interm.type.line); op = EOpConstructBVec3; break; + case 4: FRAG_VERT_ONLY("bvec4", yyvsp[0].interm.type.line); op = EOpConstructBVec4; break; + } + break; + default: break; + } + if (op == EOpNull) { + parseContext->error(yyvsp[0].interm.type.line, "cannot construct this type", getBasicString(yyvsp[0].interm.type.type), ""); + parseContext->recover(); + yyvsp[0].interm.type.type = EbtFloat; + op = EOpConstructFloat; + } + } + TString tempString; + TType type(yyvsp[0].interm.type); + TFunction *function = new TFunction(&tempString, type, op); + yyval.interm.function = function; + ; + break;} +case 25: +{ + if (parseContext->reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string)) + parseContext->recover(); + TType type(EbtVoid, EbpUndefined); + TFunction *function = new TFunction(yyvsp[0].lex.string, type); + yyval.interm.function = function; + ; + break;} +case 26: +{ + if (parseContext->reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string)) + parseContext->recover(); + TType type(EbtVoid, EbpUndefined); + TFunction *function = new TFunction(yyvsp[0].lex.string, type); + yyval.interm.function = function; + ; + break;} +case 27: +{ + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 28: +{ + if (parseContext->lValueErrorCheck(yyvsp[-1].lex.line, "++", yyvsp[0].interm.intermTypedNode)) + parseContext->recover(); + yyval.interm.intermTypedNode = parseContext->intermediate.addUnaryMath(EOpPreIncrement, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->unaryOpError(yyvsp[-1].lex.line, "++", yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + } + ; + break;} +case 29: +{ + if (parseContext->lValueErrorCheck(yyvsp[-1].lex.line, "--", yyvsp[0].interm.intermTypedNode)) + parseContext->recover(); + yyval.interm.intermTypedNode = parseContext->intermediate.addUnaryMath(EOpPreDecrement, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->unaryOpError(yyvsp[-1].lex.line, "--", yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + } + ; + break;} +case 30: +{ + if (yyvsp[-1].interm.op != EOpNull) { + yyval.interm.intermTypedNode = parseContext->intermediate.addUnaryMath(yyvsp[-1].interm.op, yyvsp[0].interm.intermTypedNode, yyvsp[-1].interm.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + const char* errorOp = ""; + switch(yyvsp[-1].interm.op) { + case EOpNegative: errorOp = "-"; break; + case EOpLogicalNot: errorOp = "!"; break; + default: break; + } + parseContext->unaryOpError(yyvsp[-1].interm.line, errorOp, yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + } + } else + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 31: +{ yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpNull; ; + break;} +case 32: +{ yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpNegative; ; + break;} +case 33: +{ yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpLogicalNot; ; + break;} +case 34: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 35: +{ + FRAG_VERT_ONLY("*", yyvsp[-1].lex.line); + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpMul, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "*", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + ; + break;} +case 36: +{ + FRAG_VERT_ONLY("/", yyvsp[-1].lex.line); + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpDiv, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "/", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + ; + break;} +case 37: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 38: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpAdd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "+", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + ; + break;} +case 39: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpSub, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "-", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + ; + break;} +case 40: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 41: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 42: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpLessThan, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "<", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 43: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpGreaterThan, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, ">", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 44: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpLessThanEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "<=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 45: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpGreaterThanEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, ">=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 46: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 47: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "==", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 48: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpNotEqual, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "!=", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 49: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 50: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 51: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 52: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 53: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpLogicalAnd, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "&&", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 54: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 55: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpLogicalXor, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "^^", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 56: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 57: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addBinaryMath(EOpLogicalOr, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line, parseContext->symbolTable); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, "||", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + ConstantUnion *unionArray = new ConstantUnion[1]; + unionArray->setBConst(false); + yyval.interm.intermTypedNode = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), yyvsp[-1].lex.line); + } + ; + break;} +case 58: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 59: +{ + if (parseContext->boolErrorCheck(yyvsp[-3].lex.line, yyvsp[-4].interm.intermTypedNode)) + parseContext->recover(); + + yyval.interm.intermTypedNode = parseContext->intermediate.addSelection(yyvsp[-4].interm.intermTypedNode, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-3].lex.line); + if (yyvsp[-2].interm.intermTypedNode->getType() != yyvsp[0].interm.intermTypedNode->getType()) + yyval.interm.intermTypedNode = 0; + + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-3].lex.line, ":", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + } + ; + break;} +case 60: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 61: +{ + if (parseContext->lValueErrorCheck(yyvsp[-1].interm.line, "assign", yyvsp[-2].interm.intermTypedNode)) + parseContext->recover(); + yyval.interm.intermTypedNode = parseContext->intermediate.addAssign(yyvsp[-1].interm.op, yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].interm.line); + if (yyval.interm.intermTypedNode == 0) { + parseContext->assignError(yyvsp[-1].interm.line, "assign", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[-2].interm.intermTypedNode; + } + ; + break;} +case 62: +{ yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAssign; ; + break;} +case 63: +{ FRAG_VERT_ONLY("*=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpMulAssign; ; + break;} +case 64: +{ FRAG_VERT_ONLY("/=", yyvsp[0].lex.line); yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpDivAssign; ; + break;} +case 65: +{ yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpAddAssign; ; + break;} +case 66: +{ yyval.interm.line = yyvsp[0].lex.line; yyval.interm.op = EOpSubAssign; ; + break;} +case 67: +{ + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 68: +{ + yyval.interm.intermTypedNode = parseContext->intermediate.addComma(yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.intermTypedNode, yyvsp[-1].lex.line); + if (yyval.interm.intermTypedNode == 0) { + parseContext->binaryOpError(yyvsp[-1].lex.line, ",", yyvsp[-2].interm.intermTypedNode->getCompleteString(), yyvsp[0].interm.intermTypedNode->getCompleteString()); + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + } + ; + break;} +case 69: +{ + if (parseContext->constErrorCheck(yyvsp[0].interm.intermTypedNode)) + parseContext->recover(); + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 70: +{ + TFunction &function = *(yyvsp[-1].interm.function); + + TIntermAggregate *prototype = new TIntermAggregate; + prototype->setType(function.getReturnType()); + prototype->setName(function.getName()); + + for (int i = 0; i < function.getParamCount(); i++) + { + const TParameter ¶m = function.getParam(i); + if (param.name != 0) + { + TVariable *variable = new TVariable(param.name, *param.type); + + prototype = parseContext->intermediate.growAggregate(prototype, parseContext->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), yyvsp[-1].interm.line), yyvsp[-1].interm.line); + } + else + { + prototype = parseContext->intermediate.growAggregate(prototype, parseContext->intermediate.addSymbol(0, "", *param.type, yyvsp[-1].interm.line), yyvsp[-1].interm.line); + } + } + + prototype->setOp(EOpPrototype); + yyval.interm.intermNode = prototype; + ; + break;} +case 71: +{ + if (yyvsp[-1].interm.intermAggregate) + yyvsp[-1].interm.intermAggregate->setOp(EOpDeclaration); + yyval.interm.intermNode = yyvsp[-1].interm.intermAggregate; + ; + break;} +case 72: +{ + parseContext->symbolTable.setDefaultPrecision( yyvsp[-1].interm.type.type, yyvsp[-2].interm.precision ); + yyval.interm.intermNode = 0; + ; + break;} +case 73: +{ + // + // Multiple declarations of the same function are allowed. + // + // If this is a definition, the definition production code will check for redefinitions + // (we don't know at this point if it's a definition or not). + // + // Redeclarations are allowed. But, return types and parameter qualifiers must match. + // + TFunction* prevDec = static_cast(parseContext->symbolTable.find(yyvsp[-1].interm.function->getMangledName())); + if (prevDec) { + if (prevDec->getReturnType() != yyvsp[-1].interm.function->getReturnType()) { + parseContext->error(yyvsp[0].lex.line, "overloaded functions must have the same return type", yyvsp[-1].interm.function->getReturnType().getBasicString(), ""); + parseContext->recover(); + } + for (int i = 0; i < prevDec->getParamCount(); ++i) { + if (prevDec->getParam(i).type->getQualifier() != yyvsp[-1].interm.function->getParam(i).type->getQualifier()) { + parseContext->error(yyvsp[0].lex.line, "overloaded functions must have the same parameter qualifiers", yyvsp[-1].interm.function->getParam(i).type->getQualifierString(), ""); + parseContext->recover(); + } + } + } + + // + // If this is a redeclaration, it could also be a definition, + // in which case, we want to use the variable names from this one, and not the one that's + // being redeclared. So, pass back up this declaration, not the one in the symbol table. + // + yyval.interm.function = yyvsp[-1].interm.function; + yyval.interm.line = yyvsp[0].lex.line; + + parseContext->symbolTable.insert(*yyval.interm.function); + ; + break;} +case 74: +{ + yyval.interm.function = yyvsp[0].interm.function; + ; + break;} +case 75: +{ + yyval.interm.function = yyvsp[0].interm.function; + ; + break;} +case 76: +{ + // Add the parameter + yyval.interm.function = yyvsp[-1].interm.function; + if (yyvsp[0].interm.param.type->getBasicType() != EbtVoid) + yyvsp[-1].interm.function->addParameter(yyvsp[0].interm.param); + else + delete yyvsp[0].interm.param.type; + ; + break;} +case 77: +{ + // + // Only first parameter of one-parameter functions can be void + // The check for named parameters not being void is done in parameter_declarator + // + if (yyvsp[0].interm.param.type->getBasicType() == EbtVoid) { + // + // This parameter > first is void + // + parseContext->error(yyvsp[-1].lex.line, "cannot be an argument type except for '(void)'", "void", ""); + parseContext->recover(); + delete yyvsp[0].interm.param.type; + } else { + // Add the parameter + yyval.interm.function = yyvsp[-2].interm.function; + yyvsp[-2].interm.function->addParameter(yyvsp[0].interm.param); + } + ; + break;} +case 78: +{ + if (yyvsp[-2].interm.type.qualifier != EvqGlobal && yyvsp[-2].interm.type.qualifier != EvqTemporary) { + parseContext->error(yyvsp[-1].lex.line, "no qualifiers allowed for function return", getQualifierString(yyvsp[-2].interm.type.qualifier), ""); + parseContext->recover(); + } + // make sure a sampler is not involved as well... + if (parseContext->structQualifierErrorCheck(yyvsp[-1].lex.line, yyvsp[-2].interm.type)) + parseContext->recover(); + + // Add the function as a prototype after parsing it (we do not support recursion) + TFunction *function; + TType type(yyvsp[-2].interm.type); + function = new TFunction(yyvsp[-1].lex.string, type); + yyval.interm.function = function; + ; + break;} +case 79: +{ + if (yyvsp[-1].interm.type.type == EbtVoid) { + parseContext->error(yyvsp[0].lex.line, "illegal use of type 'void'", yyvsp[0].lex.string->c_str(), ""); + parseContext->recover(); + } + if (parseContext->reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string)) + parseContext->recover(); + TParameter param = {yyvsp[0].lex.string, new TType(yyvsp[-1].interm.type)}; + yyval.interm.line = yyvsp[0].lex.line; + yyval.interm.param = param; + ; + break;} +case 80: +{ + // Check that we can make an array out of this type + if (parseContext->arrayTypeErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type)) + parseContext->recover(); + + if (parseContext->reservedErrorCheck(yyvsp[-3].lex.line, *yyvsp[-3].lex.string)) + parseContext->recover(); + + int size; + if (parseContext->arraySizeErrorCheck(yyvsp[-2].lex.line, yyvsp[-1].interm.intermTypedNode, size)) + parseContext->recover(); + yyvsp[-4].interm.type.setArray(true, size); + + TType* type = new TType(yyvsp[-4].interm.type); + TParameter param = { yyvsp[-3].lex.string, type }; + yyval.interm.line = yyvsp[-3].lex.line; + yyval.interm.param = param; + ; + break;} +case 81: +{ + yyval.interm = yyvsp[0].interm; + if (parseContext->paramErrorCheck(yyvsp[0].interm.line, yyvsp[-2].interm.type.qualifier, yyvsp[-1].interm.qualifier, yyval.interm.param.type)) + parseContext->recover(); + ; + break;} +case 82: +{ + yyval.interm = yyvsp[0].interm; + if (parseContext->parameterSamplerErrorCheck(yyvsp[0].interm.line, yyvsp[-1].interm.qualifier, *yyvsp[0].interm.param.type)) + parseContext->recover(); + if (parseContext->paramErrorCheck(yyvsp[0].interm.line, EvqTemporary, yyvsp[-1].interm.qualifier, yyval.interm.param.type)) + parseContext->recover(); + ; + break;} +case 83: +{ + yyval.interm = yyvsp[0].interm; + if (parseContext->paramErrorCheck(yyvsp[0].interm.line, yyvsp[-2].interm.type.qualifier, yyvsp[-1].interm.qualifier, yyval.interm.param.type)) + parseContext->recover(); + ; + break;} +case 84: +{ + yyval.interm = yyvsp[0].interm; + if (parseContext->parameterSamplerErrorCheck(yyvsp[0].interm.line, yyvsp[-1].interm.qualifier, *yyvsp[0].interm.param.type)) + parseContext->recover(); + if (parseContext->paramErrorCheck(yyvsp[0].interm.line, EvqTemporary, yyvsp[-1].interm.qualifier, yyval.interm.param.type)) + parseContext->recover(); + ; + break;} +case 85: +{ + yyval.interm.qualifier = EvqIn; + ; + break;} +case 86: +{ + yyval.interm.qualifier = EvqIn; + ; + break;} +case 87: +{ + yyval.interm.qualifier = EvqOut; + ; + break;} +case 88: +{ + yyval.interm.qualifier = EvqInOut; + ; + break;} +case 89: +{ + TParameter param = { 0, new TType(yyvsp[0].interm.type) }; + yyval.interm.param = param; + ; + break;} +case 90: +{ + yyval.interm = yyvsp[0].interm; + + if (yyval.interm.type.precision == EbpUndefined) { + yyval.interm.type.precision = parseContext->symbolTable.getDefaultPrecision(yyvsp[0].interm.type.type); + if (parseContext->precisionErrorCheck(yyvsp[0].interm.line, yyval.interm.type.precision, yyvsp[0].interm.type.type)) { + parseContext->recover(); + } + } + ; + break;} +case 91: +{ + yyval.interm.intermAggregate = parseContext->intermediate.growAggregate(yyvsp[-2].interm.intermNode, parseContext->intermediate.addSymbol(0, *yyvsp[0].lex.string, TType(yyvsp[-2].interm.type), yyvsp[0].lex.line), yyvsp[0].lex.line); + + if (parseContext->structQualifierErrorCheck(yyvsp[0].lex.line, yyval.interm.type)) + parseContext->recover(); + + if (parseContext->nonInitConstErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type)) + parseContext->recover(); + + if (parseContext->nonInitErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type)) + parseContext->recover(); + ; + break;} +case 92: +{ + if (parseContext->structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type)) + parseContext->recover(); + + if (parseContext->nonInitConstErrorCheck(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-4].interm.type)) + parseContext->recover(); + + yyval.interm = yyvsp[-4].interm; + + if (parseContext->arrayTypeErrorCheck(yyvsp[-1].lex.line, yyvsp[-4].interm.type) || parseContext->arrayQualifierErrorCheck(yyvsp[-1].lex.line, yyvsp[-4].interm.type)) + parseContext->recover(); + else { + yyvsp[-4].interm.type.setArray(true); + TVariable* variable; + if (parseContext->arrayErrorCheck(yyvsp[-1].lex.line, *yyvsp[-2].lex.string, yyvsp[-4].interm.type, variable)) + parseContext->recover(); + } + ; + break;} +case 93: +{ + if (parseContext->structQualifierErrorCheck(yyvsp[-3].lex.line, yyvsp[-5].interm.type)) + parseContext->recover(); + + if (parseContext->nonInitConstErrorCheck(yyvsp[-3].lex.line, *yyvsp[-3].lex.string, yyvsp[-5].interm.type)) + parseContext->recover(); + + yyval.interm = yyvsp[-5].interm; + + if (parseContext->arrayTypeErrorCheck(yyvsp[-2].lex.line, yyvsp[-5].interm.type) || parseContext->arrayQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-5].interm.type)) + parseContext->recover(); + else { + int size; + if (parseContext->arraySizeErrorCheck(yyvsp[-2].lex.line, yyvsp[-1].interm.intermTypedNode, size)) + parseContext->recover(); + yyvsp[-5].interm.type.setArray(true, size); + TVariable* variable; + if (parseContext->arrayErrorCheck(yyvsp[-2].lex.line, *yyvsp[-3].lex.string, yyvsp[-5].interm.type, variable)) + parseContext->recover(); + TType type = TType(yyvsp[-5].interm.type); + type.setArraySize(size); + yyval.interm.intermAggregate = parseContext->intermediate.growAggregate(yyvsp[-5].interm.intermNode, parseContext->intermediate.addSymbol(0, *yyvsp[-3].lex.string, type, yyvsp[-3].lex.line), yyvsp[-3].lex.line); + } + ; + break;} +case 94: +{ + if (parseContext->structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type)) + parseContext->recover(); + + yyval.interm = yyvsp[-4].interm; + + TIntermNode* intermNode; + if (!parseContext->executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-4].interm.type, yyvsp[0].interm.intermTypedNode, intermNode)) { + // + // build the intermediate representation + // + if (intermNode) + yyval.interm.intermAggregate = parseContext->intermediate.growAggregate(yyvsp[-4].interm.intermNode, intermNode, yyvsp[-1].lex.line); + else + yyval.interm.intermAggregate = yyvsp[-4].interm.intermAggregate; + } else { + parseContext->recover(); + yyval.interm.intermAggregate = 0; + } + ; + break;} +case 95: +{ + yyval.interm.type = yyvsp[0].interm.type; + yyval.interm.intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, "", TType(yyvsp[0].interm.type), yyvsp[0].interm.type.line), yyvsp[0].interm.type.line); + ; + break;} +case 96: +{ + yyval.interm.intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, *yyvsp[0].lex.string, TType(yyvsp[-1].interm.type), yyvsp[0].lex.line), yyvsp[0].lex.line); + + if (parseContext->structQualifierErrorCheck(yyvsp[0].lex.line, yyval.interm.type)) + parseContext->recover(); + + if (parseContext->nonInitConstErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type)) + parseContext->recover(); + + yyval.interm.type = yyvsp[-1].interm.type; + + if (parseContext->nonInitErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string, yyval.interm.type)) + parseContext->recover(); + ; + break;} +case 97: +{ + yyval.interm.intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, *yyvsp[-2].lex.string, TType(yyvsp[-3].interm.type), yyvsp[-2].lex.line), yyvsp[-2].lex.line); + + if (parseContext->structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type)) + parseContext->recover(); + + if (parseContext->nonInitConstErrorCheck(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type)) + parseContext->recover(); + + yyval.interm.type = yyvsp[-3].interm.type; + + if (parseContext->arrayTypeErrorCheck(yyvsp[-1].lex.line, yyvsp[-3].interm.type) || parseContext->arrayQualifierErrorCheck(yyvsp[-1].lex.line, yyvsp[-3].interm.type)) + parseContext->recover(); + else { + yyvsp[-3].interm.type.setArray(true); + TVariable* variable; + if (parseContext->arrayErrorCheck(yyvsp[-1].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type, variable)) + parseContext->recover(); + } + ; + break;} +case 98: +{ + TType type = TType(yyvsp[-4].interm.type); + int size; + if (parseContext->arraySizeErrorCheck(yyvsp[-3].lex.line, yyvsp[-1].interm.intermTypedNode, size)) + parseContext->recover(); + type.setArraySize(size); + yyval.interm.intermAggregate = parseContext->intermediate.makeAggregate(parseContext->intermediate.addSymbol(0, *yyvsp[-3].lex.string, type, yyvsp[-3].lex.line), yyvsp[-3].lex.line); + + if (parseContext->structQualifierErrorCheck(yyvsp[-3].lex.line, yyvsp[-4].interm.type)) + parseContext->recover(); + + if (parseContext->nonInitConstErrorCheck(yyvsp[-3].lex.line, *yyvsp[-3].lex.string, yyvsp[-4].interm.type)) + parseContext->recover(); + + yyval.interm.type = yyvsp[-4].interm.type; + + if (parseContext->arrayTypeErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type) || parseContext->arrayQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-4].interm.type)) + parseContext->recover(); + else { + int size; + if (parseContext->arraySizeErrorCheck(yyvsp[-2].lex.line, yyvsp[-1].interm.intermTypedNode, size)) + parseContext->recover(); + + yyvsp[-4].interm.type.setArray(true, size); + TVariable* variable; + if (parseContext->arrayErrorCheck(yyvsp[-2].lex.line, *yyvsp[-3].lex.string, yyvsp[-4].interm.type, variable)) + parseContext->recover(); + } + ; + break;} +case 99: +{ + if (parseContext->structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type)) + parseContext->recover(); + + yyval.interm.type = yyvsp[-3].interm.type; + + TIntermNode* intermNode; + if (!parseContext->executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type, yyvsp[0].interm.intermTypedNode, intermNode)) { + // + // Build intermediate representation + // + if(intermNode) + yyval.interm.intermAggregate = parseContext->intermediate.makeAggregate(intermNode, yyvsp[-1].lex.line); + else + yyval.interm.intermAggregate = 0; + } else { + parseContext->recover(); + yyval.interm.intermAggregate = 0; + } + ; + break;} +case 100: +{ + VERTEX_ONLY("invariant declaration", yyvsp[-1].lex.line); + yyval.interm.qualifier = EvqInvariantVaryingOut; + yyval.interm.intermAggregate = 0; + ; + break;} +case 101: +{ + yyval.interm.type = yyvsp[0].interm.type; + + if (yyvsp[0].interm.type.array) { + parseContext->error(yyvsp[0].interm.type.line, "not supported", "first-class array", ""); + parseContext->recover(); + yyvsp[0].interm.type.setArray(false); + } + ; + break;} +case 102: +{ + if (yyvsp[0].interm.type.array) { + parseContext->error(yyvsp[0].interm.type.line, "not supported", "first-class array", ""); + parseContext->recover(); + yyvsp[0].interm.type.setArray(false); + } + + if (yyvsp[-1].interm.type.qualifier == EvqAttribute && + (yyvsp[0].interm.type.type == EbtBool || yyvsp[0].interm.type.type == EbtInt)) { + parseContext->error(yyvsp[0].interm.type.line, "cannot be bool or int", getQualifierString(yyvsp[-1].interm.type.qualifier), ""); + parseContext->recover(); + } + if ((yyvsp[-1].interm.type.qualifier == EvqVaryingIn || yyvsp[-1].interm.type.qualifier == EvqVaryingOut) && + (yyvsp[0].interm.type.type == EbtBool || yyvsp[0].interm.type.type == EbtInt)) { + parseContext->error(yyvsp[0].interm.type.line, "cannot be bool or int", getQualifierString(yyvsp[-1].interm.type.qualifier), ""); + parseContext->recover(); + } + yyval.interm.type = yyvsp[0].interm.type; + yyval.interm.type.qualifier = yyvsp[-1].interm.type.qualifier; + ; + break;} +case 103: +{ + yyval.interm.type.setBasic(EbtVoid, EvqConst, yyvsp[0].lex.line); + ; + break;} +case 104: +{ + VERTEX_ONLY("attribute", yyvsp[0].lex.line); + if (parseContext->globalErrorCheck(yyvsp[0].lex.line, parseContext->symbolTable.atGlobalLevel(), "attribute")) + parseContext->recover(); + yyval.interm.type.setBasic(EbtVoid, EvqAttribute, yyvsp[0].lex.line); + ; + break;} +case 105: +{ + if (parseContext->globalErrorCheck(yyvsp[0].lex.line, parseContext->symbolTable.atGlobalLevel(), "varying")) + parseContext->recover(); + if (parseContext->shaderType == SH_VERTEX_SHADER) + yyval.interm.type.setBasic(EbtVoid, EvqVaryingOut, yyvsp[0].lex.line); + else + yyval.interm.type.setBasic(EbtVoid, EvqVaryingIn, yyvsp[0].lex.line); + ; + break;} +case 106: +{ + if (parseContext->globalErrorCheck(yyvsp[-1].lex.line, parseContext->symbolTable.atGlobalLevel(), "invariant varying")) + parseContext->recover(); + if (parseContext->shaderType == SH_VERTEX_SHADER) + yyval.interm.type.setBasic(EbtVoid, EvqInvariantVaryingOut, yyvsp[-1].lex.line); + else + yyval.interm.type.setBasic(EbtVoid, EvqInvariantVaryingIn, yyvsp[-1].lex.line); + ; + break;} +case 107: +{ + if (parseContext->globalErrorCheck(yyvsp[0].lex.line, parseContext->symbolTable.atGlobalLevel(), "uniform")) + parseContext->recover(); + yyval.interm.type.setBasic(EbtVoid, EvqUniform, yyvsp[0].lex.line); + ; + break;} +case 108: +{ + yyval.interm.type = yyvsp[0].interm.type; + ; + break;} +case 109: +{ + yyval.interm.type = yyvsp[0].interm.type; + yyval.interm.type.precision = yyvsp[-1].interm.precision; + ; + break;} +case 110: +{ + yyval.interm.precision = EbpHigh; + ; + break;} +case 111: +{ + yyval.interm.precision = EbpMedium; + ; + break;} +case 112: +{ + yyval.interm.precision = EbpLow; + ; + break;} +case 113: +{ + yyval.interm.type = yyvsp[0].interm.type; + ; + break;} +case 114: +{ + yyval.interm.type = yyvsp[-3].interm.type; + + if (parseContext->arrayTypeErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type)) + parseContext->recover(); + else { + int size; + if (parseContext->arraySizeErrorCheck(yyvsp[-2].lex.line, yyvsp[-1].interm.intermTypedNode, size)) + parseContext->recover(); + yyval.interm.type.setArray(true, size); + } + ; + break;} +case 115: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtVoid, qual, yyvsp[0].lex.line); + ; + break;} +case 116: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtFloat, qual, yyvsp[0].lex.line); + ; + break;} +case 117: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtInt, qual, yyvsp[0].lex.line); + ; + break;} +case 118: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtBool, qual, yyvsp[0].lex.line); + ; + break;} +case 119: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtFloat, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(2); + ; + break;} +case 120: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtFloat, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(3); + ; + break;} +case 121: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtFloat, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(4); + ; + break;} +case 122: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtBool, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(2); + ; + break;} +case 123: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtBool, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(3); + ; + break;} +case 124: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtBool, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(4); + ; + break;} +case 125: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtInt, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(2); + ; + break;} +case 126: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtInt, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(3); + ; + break;} +case 127: +{ + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtInt, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(4); + ; + break;} +case 128: +{ + FRAG_VERT_ONLY("mat2", yyvsp[0].lex.line); + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtFloat, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(2, true); + ; + break;} +case 129: +{ + FRAG_VERT_ONLY("mat3", yyvsp[0].lex.line); + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtFloat, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(3, true); + ; + break;} +case 130: +{ + FRAG_VERT_ONLY("mat4", yyvsp[0].lex.line); + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtFloat, qual, yyvsp[0].lex.line); + yyval.interm.type.setAggregate(4, true); + ; + break;} +case 131: +{ + FRAG_VERT_ONLY("sampler2D", yyvsp[0].lex.line); + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtSampler2D, qual, yyvsp[0].lex.line); + ; + break;} +case 132: +{ + FRAG_VERT_ONLY("samplerCube", yyvsp[0].lex.line); + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtSamplerCube, qual, yyvsp[0].lex.line); + ; + break;} +case 133: +{ + FRAG_VERT_ONLY("struct", yyvsp[0].interm.type.line); + yyval.interm.type = yyvsp[0].interm.type; + yyval.interm.type.qualifier = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + ; + break;} +case 134: +{ + // + // This is for user defined type names. The lexical phase looked up the + // type. + // + TType& structure = static_cast(yyvsp[0].lex.symbol)->getType(); + TQualifier qual = parseContext->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; + yyval.interm.type.setBasic(EbtStruct, qual, yyvsp[0].lex.line); + yyval.interm.type.userDef = &structure; + ; + break;} +case 135: +{ + if (parseContext->reservedErrorCheck(yyvsp[-3].lex.line, *yyvsp[-3].lex.string)) + parseContext->recover(); + + TType* structure = new TType(yyvsp[-1].interm.typeList, *yyvsp[-3].lex.string); + TVariable* userTypeDef = new TVariable(yyvsp[-3].lex.string, *structure, true); + if (! parseContext->symbolTable.insert(*userTypeDef)) { + parseContext->error(yyvsp[-3].lex.line, "redefinition", yyvsp[-3].lex.string->c_str(), "struct"); + parseContext->recover(); + } + yyval.interm.type.setBasic(EbtStruct, EvqTemporary, yyvsp[-4].lex.line); + yyval.interm.type.userDef = structure; + ; + break;} +case 136: +{ + TType* structure = new TType(yyvsp[-1].interm.typeList, TString("")); + yyval.interm.type.setBasic(EbtStruct, EvqTemporary, yyvsp[-3].lex.line); + yyval.interm.type.userDef = structure; + ; + break;} +case 137: +{ + yyval.interm.typeList = yyvsp[0].interm.typeList; + ; + break;} +case 138: +{ + yyval.interm.typeList = yyvsp[-1].interm.typeList; + for (unsigned int i = 0; i < yyvsp[0].interm.typeList->size(); ++i) { + for (unsigned int j = 0; j < yyval.interm.typeList->size(); ++j) { + if ((*yyval.interm.typeList)[j].type->getFieldName() == (*yyvsp[0].interm.typeList)[i].type->getFieldName()) { + parseContext->error((*yyvsp[0].interm.typeList)[i].line, "duplicate field name in structure:", "struct", (*yyvsp[0].interm.typeList)[i].type->getFieldName().c_str()); + parseContext->recover(); + } + } + yyval.interm.typeList->push_back((*yyvsp[0].interm.typeList)[i]); + } + ; + break;} +case 139: +{ + yyval.interm.typeList = yyvsp[-1].interm.typeList; + + if (parseContext->voidErrorCheck(yyvsp[-2].interm.type.line, (*yyvsp[-1].interm.typeList)[0].type->getFieldName(), yyvsp[-2].interm.type)) { + parseContext->recover(); + } + for (unsigned int i = 0; i < yyval.interm.typeList->size(); ++i) { + // + // Careful not to replace already known aspects of type, like array-ness + // + TType* type = (*yyval.interm.typeList)[i].type; + type->setBasicType(yyvsp[-2].interm.type.type); + type->setNominalSize(yyvsp[-2].interm.type.size); + type->setMatrix(yyvsp[-2].interm.type.matrix); + + // don't allow arrays of arrays + if (type->isArray()) { + if (parseContext->arrayTypeErrorCheck(yyvsp[-2].interm.type.line, yyvsp[-2].interm.type)) + parseContext->recover(); + } + if (yyvsp[-2].interm.type.array) + type->setArraySize(yyvsp[-2].interm.type.arraySize); + if (yyvsp[-2].interm.type.userDef) { + type->setStruct(yyvsp[-2].interm.type.userDef->getStruct()); + type->setTypeName(yyvsp[-2].interm.type.userDef->getTypeName()); + } + } + ; + break;} +case 140: +{ + yyval.interm.typeList = NewPoolTTypeList(); + yyval.interm.typeList->push_back(yyvsp[0].interm.typeLine); + ; + break;} +case 141: +{ + yyval.interm.typeList->push_back(yyvsp[0].interm.typeLine); + ; + break;} +case 142: +{ + if (parseContext->reservedErrorCheck(yyvsp[0].lex.line, *yyvsp[0].lex.string)) + parseContext->recover(); + + yyval.interm.typeLine.type = new TType(EbtVoid, EbpUndefined); + yyval.interm.typeLine.line = yyvsp[0].lex.line; + yyval.interm.typeLine.type->setFieldName(*yyvsp[0].lex.string); + ; + break;} +case 143: +{ + if (parseContext->reservedErrorCheck(yyvsp[-3].lex.line, *yyvsp[-3].lex.string)) + parseContext->recover(); + + yyval.interm.typeLine.type = new TType(EbtVoid, EbpUndefined); + yyval.interm.typeLine.line = yyvsp[-3].lex.line; + yyval.interm.typeLine.type->setFieldName(*yyvsp[-3].lex.string); + + int size; + if (parseContext->arraySizeErrorCheck(yyvsp[-2].lex.line, yyvsp[-1].interm.intermTypedNode, size)) + parseContext->recover(); + yyval.interm.typeLine.type->setArraySize(size); + ; + break;} +case 144: +{ yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; ; + break;} +case 145: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 146: +{ yyval.interm.intermNode = yyvsp[0].interm.intermAggregate; ; + break;} +case 147: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 148: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 149: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 150: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 151: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 152: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 153: +{ yyval.interm.intermAggregate = 0; ; + break;} +case 154: +{ parseContext->symbolTable.push(); ; + break;} +case 155: +{ parseContext->symbolTable.pop(); ; + break;} +case 156: +{ + if (yyvsp[-2].interm.intermAggregate != 0) + yyvsp[-2].interm.intermAggregate->setOp(EOpSequence); + yyval.interm.intermAggregate = yyvsp[-2].interm.intermAggregate; + ; + break;} +case 157: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 158: +{ yyval.interm.intermNode = yyvsp[0].interm.intermNode; ; + break;} +case 159: +{ + yyval.interm.intermNode = 0; + ; + break;} +case 160: +{ + if (yyvsp[-1].interm.intermAggregate) + yyvsp[-1].interm.intermAggregate->setOp(EOpSequence); + yyval.interm.intermNode = yyvsp[-1].interm.intermAggregate; + ; + break;} +case 161: +{ + yyval.interm.intermAggregate = parseContext->intermediate.makeAggregate(yyvsp[0].interm.intermNode, 0); + ; + break;} +case 162: +{ + yyval.interm.intermAggregate = parseContext->intermediate.growAggregate(yyvsp[-1].interm.intermAggregate, yyvsp[0].interm.intermNode, 0); + ; + break;} +case 163: +{ yyval.interm.intermNode = 0; ; + break;} +case 164: +{ yyval.interm.intermNode = static_cast(yyvsp[-1].interm.intermTypedNode); ; + break;} +case 165: +{ + if (parseContext->boolErrorCheck(yyvsp[-4].lex.line, yyvsp[-2].interm.intermTypedNode)) + parseContext->recover(); + yyval.interm.intermNode = parseContext->intermediate.addSelection(yyvsp[-2].interm.intermTypedNode, yyvsp[0].interm.nodePair, yyvsp[-4].lex.line); + ; + break;} +case 166: +{ + yyval.interm.nodePair.node1 = yyvsp[-2].interm.intermNode; + yyval.interm.nodePair.node2 = yyvsp[0].interm.intermNode; + ; + break;} +case 167: +{ + yyval.interm.nodePair.node1 = yyvsp[0].interm.intermNode; + yyval.interm.nodePair.node2 = 0; + ; + break;} +case 168: +{ + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + if (parseContext->boolErrorCheck(yyvsp[0].interm.intermTypedNode->getLine(), yyvsp[0].interm.intermTypedNode)) + parseContext->recover(); + ; + break;} +case 169: +{ + TIntermNode* intermNode; + if (parseContext->structQualifierErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type)) + parseContext->recover(); + if (parseContext->boolErrorCheck(yyvsp[-2].lex.line, yyvsp[-3].interm.type)) + parseContext->recover(); + + if (!parseContext->executeInitializer(yyvsp[-2].lex.line, *yyvsp[-2].lex.string, yyvsp[-3].interm.type, yyvsp[0].interm.intermTypedNode, intermNode)) + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + else { + parseContext->recover(); + yyval.interm.intermTypedNode = 0; + } + ; + break;} +case 170: +{ parseContext->symbolTable.push(); ++parseContext->loopNestingLevel; ; + break;} +case 171: +{ + parseContext->symbolTable.pop(); + yyval.interm.intermNode = parseContext->intermediate.addLoop(0, yyvsp[0].interm.intermNode, yyvsp[-2].interm.intermTypedNode, 0, true, yyvsp[-5].lex.line); + --parseContext->loopNestingLevel; + ; + break;} +case 172: +{ ++parseContext->loopNestingLevel; ; + break;} +case 173: +{ + if (parseContext->boolErrorCheck(yyvsp[0].lex.line, yyvsp[-2].interm.intermTypedNode)) + parseContext->recover(); + + yyval.interm.intermNode = parseContext->intermediate.addLoop(0, yyvsp[-5].interm.intermNode, yyvsp[-2].interm.intermTypedNode, 0, false, yyvsp[-4].lex.line); + --parseContext->loopNestingLevel; + ; + break;} +case 174: +{ parseContext->symbolTable.push(); ++parseContext->loopNestingLevel; ; + break;} +case 175: +{ + parseContext->symbolTable.pop(); + yyval.interm.intermNode = parseContext->intermediate.addLoop(yyvsp[-3].interm.intermNode, yyvsp[0].interm.intermNode, reinterpret_cast(yyvsp[-2].interm.nodePair.node1), reinterpret_cast(yyvsp[-2].interm.nodePair.node2), true, yyvsp[-6].lex.line); + --parseContext->loopNestingLevel; + ; + break;} +case 176: +{ + yyval.interm.intermNode = yyvsp[0].interm.intermNode; + ; + break;} +case 177: +{ + yyval.interm.intermNode = yyvsp[0].interm.intermNode; + ; + break;} +case 178: +{ + yyval.interm.intermTypedNode = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 179: +{ + yyval.interm.intermTypedNode = 0; + ; + break;} +case 180: +{ + yyval.interm.nodePair.node1 = yyvsp[-1].interm.intermTypedNode; + yyval.interm.nodePair.node2 = 0; + ; + break;} +case 181: +{ + yyval.interm.nodePair.node1 = yyvsp[-2].interm.intermTypedNode; + yyval.interm.nodePair.node2 = yyvsp[0].interm.intermTypedNode; + ; + break;} +case 182: +{ + if (parseContext->loopNestingLevel <= 0) { + parseContext->error(yyvsp[-1].lex.line, "continue statement only allowed in loops", "", ""); + parseContext->recover(); + } + yyval.interm.intermNode = parseContext->intermediate.addBranch(EOpContinue, yyvsp[-1].lex.line); + ; + break;} +case 183: +{ + if (parseContext->loopNestingLevel <= 0) { + parseContext->error(yyvsp[-1].lex.line, "break statement only allowed in loops", "", ""); + parseContext->recover(); + } + yyval.interm.intermNode = parseContext->intermediate.addBranch(EOpBreak, yyvsp[-1].lex.line); + ; + break;} +case 184: +{ + yyval.interm.intermNode = parseContext->intermediate.addBranch(EOpReturn, yyvsp[-1].lex.line); + if (parseContext->currentFunctionType->getBasicType() != EbtVoid) { + parseContext->error(yyvsp[-1].lex.line, "non-void function must return a value", "return", ""); + parseContext->recover(); + } + ; + break;} +case 185: +{ + yyval.interm.intermNode = parseContext->intermediate.addBranch(EOpReturn, yyvsp[-1].interm.intermTypedNode, yyvsp[-2].lex.line); + parseContext->functionReturnsValue = true; + if (parseContext->currentFunctionType->getBasicType() == EbtVoid) { + parseContext->error(yyvsp[-2].lex.line, "void function cannot return a value", "return", ""); + parseContext->recover(); + } else if (*(parseContext->currentFunctionType) != yyvsp[-1].interm.intermTypedNode->getType()) { + parseContext->error(yyvsp[-2].lex.line, "function return is not matching type:", "return", ""); + parseContext->recover(); + } + ; + break;} +case 186: +{ + FRAG_ONLY("discard", yyvsp[-1].lex.line); + yyval.interm.intermNode = parseContext->intermediate.addBranch(EOpKill, yyvsp[-1].lex.line); + ; + break;} +case 187: +{ + yyval.interm.intermNode = yyvsp[0].interm.intermNode; + parseContext->treeRoot = yyval.interm.intermNode; + ; + break;} +case 188: +{ + yyval.interm.intermNode = parseContext->intermediate.growAggregate(yyvsp[-1].interm.intermNode, yyvsp[0].interm.intermNode, 0); + parseContext->treeRoot = yyval.interm.intermNode; + ; + break;} +case 189: +{ + yyval.interm.intermNode = yyvsp[0].interm.intermNode; + ; + break;} +case 190: +{ + yyval.interm.intermNode = yyvsp[0].interm.intermNode; + ; + break;} +case 191: +{ + TFunction* function = yyvsp[0].interm.function; + TFunction* prevDec = static_cast(parseContext->symbolTable.find(function->getMangledName())); + // + // Note: 'prevDec' could be 'function' if this is the first time we've seen function + // as it would have just been put in the symbol table. Otherwise, we're looking up + // an earlier occurance. + // + if (prevDec->isDefined()) { + // + // Then this function already has a body. + // + parseContext->error(yyvsp[0].interm.line, "function already has a body", function->getName().c_str(), ""); + parseContext->recover(); + } + prevDec->setDefined(); + + // + // Raise error message if main function takes any parameters or return anything other than void + // + if (function->getName() == "main") { + if (function->getParamCount() > 0) { + parseContext->error(yyvsp[0].interm.line, "function cannot take any parameter(s)", function->getName().c_str(), ""); + parseContext->recover(); + } + if (function->getReturnType().getBasicType() != EbtVoid) { + parseContext->error(yyvsp[0].interm.line, "", function->getReturnType().getBasicString(), "main function cannot return a value"); + parseContext->recover(); + } + } + + // + // New symbol table scope for body of function plus its arguments + // + parseContext->symbolTable.push(); + + // + // Remember the return type for later checking for RETURN statements. + // + parseContext->currentFunctionType = &(prevDec->getReturnType()); + parseContext->functionReturnsValue = false; + + // + // Insert parameters into the symbol table. + // If the parameter has no name, it's not an error, just don't insert it + // (could be used for unused args). + // + // Also, accumulate the list of parameters into the HIL, so lower level code + // knows where to find parameters. + // + TIntermAggregate* paramNodes = new TIntermAggregate; + for (int i = 0; i < function->getParamCount(); i++) { + const TParameter& param = function->getParam(i); + if (param.name != 0) { + TVariable *variable = new TVariable(param.name, *param.type); + // + // Insert the parameters with name in the symbol table. + // + if (! parseContext->symbolTable.insert(*variable)) { + parseContext->error(yyvsp[0].interm.line, "redefinition", variable->getName().c_str(), ""); + parseContext->recover(); + delete variable; + } + + // + // Add the parameter to the HIL + // + paramNodes = parseContext->intermediate.growAggregate( + paramNodes, + parseContext->intermediate.addSymbol(variable->getUniqueId(), + variable->getName(), + variable->getType(), yyvsp[0].interm.line), + yyvsp[0].interm.line); + } else { + paramNodes = parseContext->intermediate.growAggregate(paramNodes, parseContext->intermediate.addSymbol(0, "", *param.type, yyvsp[0].interm.line), yyvsp[0].interm.line); + } + } + parseContext->intermediate.setAggregateOperator(paramNodes, EOpParameters, yyvsp[0].interm.line); + yyvsp[0].interm.intermAggregate = paramNodes; + parseContext->loopNestingLevel = 0; + ; + break;} +case 192: +{ + //?? Check that all paths return a value if return type != void ? + // May be best done as post process phase on intermediate code + if (parseContext->currentFunctionType->getBasicType() != EbtVoid && ! parseContext->functionReturnsValue) { + parseContext->error(yyvsp[-2].interm.line, "function does not return a value:", "", yyvsp[-2].interm.function->getName().c_str()); + parseContext->recover(); + } + parseContext->symbolTable.pop(); + yyval.interm.intermNode = parseContext->intermediate.growAggregate(yyvsp[-2].interm.intermAggregate, yyvsp[0].interm.intermNode, 0); + parseContext->intermediate.setAggregateOperator(yyval.interm.intermNode, EOpFunction, yyvsp[-2].interm.line); + yyval.interm.intermNode->getAsAggregate()->setName(yyvsp[-2].interm.function->getMangledName().c_str()); + yyval.interm.intermNode->getAsAggregate()->setType(yyvsp[-2].interm.function->getReturnType()); + + // store the pragma information for debug and optimize and other vendor specific + // information. This information can be queried from the parse tree + yyval.interm.intermNode->getAsAggregate()->setOptimize(parseContext->contextPragma.optimize); + yyval.interm.intermNode->getAsAggregate()->setDebug(parseContext->contextPragma.debug); + yyval.interm.intermNode->getAsAggregate()->addToPragmaTable(parseContext->contextPragma.pragmaTable); + ; + break;} +} + /* the action file gets copied in in place of this dollarsign */ + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; +} + diff --git a/gfx/angle/generated/glslang_tab.h b/gfx/angle/generated/glslang_tab.h index 84d7f4e0cb0..63c2e54fa7b 100644 --- a/gfx/angle/generated/glslang_tab.h +++ b/gfx/angle/generated/glslang_tab.h @@ -1,183 +1,123 @@ - -/* A Bison parser, made by GNU Bison 2.4.1. */ - -/* Skeleton interface for Bison's Yacc-like parsers in C - - 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 - 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. - - 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 . */ - -/* As a special exception, you may create a larger work that contains - part or all of the Bison parser skeleton and distribute that work - under terms of your choice, so long as that work isn't itself a - parser generator using the skeleton or a modified version thereof - as a parser skeleton. Alternatively, if you modify or redistribute - the parser skeleton itself, you may (at your option) remove this - 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 - /* Put the tokens into the symbol table, so that GDB and other debuggers - know about them. */ - enum yytokentype { - INVARIANT = 258, - HIGH_PRECISION = 259, - MEDIUM_PRECISION = 260, - LOW_PRECISION = 261, - PRECISION = 262, - ATTRIBUTE = 263, - CONST_QUAL = 264, - BOOL_TYPE = 265, - FLOAT_TYPE = 266, - INT_TYPE = 267, - BREAK = 268, - CONTINUE = 269, - DO = 270, - ELSE = 271, - FOR = 272, - IF = 273, - DISCARD = 274, - RETURN = 275, - BVEC2 = 276, - BVEC3 = 277, - BVEC4 = 278, - IVEC2 = 279, - IVEC3 = 280, - IVEC4 = 281, - VEC2 = 282, - VEC3 = 283, - VEC4 = 284, - MATRIX2 = 285, - MATRIX3 = 286, - MATRIX4 = 287, - IN_QUAL = 288, - OUT_QUAL = 289, - INOUT_QUAL = 290, - UNIFORM = 291, - VARYING = 292, - STRUCT = 293, - VOID_TYPE = 294, - WHILE = 295, - SAMPLER2D = 296, - SAMPLERCUBE = 297, - IDENTIFIER = 298, - TYPE_NAME = 299, - FLOATCONSTANT = 300, - INTCONSTANT = 301, - BOOLCONSTANT = 302, - FIELD_SELECTION = 303, - LEFT_OP = 304, - RIGHT_OP = 305, - INC_OP = 306, - DEC_OP = 307, - LE_OP = 308, - GE_OP = 309, - EQ_OP = 310, - NE_OP = 311, - AND_OP = 312, - OR_OP = 313, - XOR_OP = 314, - MUL_ASSIGN = 315, - DIV_ASSIGN = 316, - ADD_ASSIGN = 317, - MOD_ASSIGN = 318, - LEFT_ASSIGN = 319, - RIGHT_ASSIGN = 320, - AND_ASSIGN = 321, - XOR_ASSIGN = 322, - OR_ASSIGN = 323, - SUB_ASSIGN = 324, - LEFT_PAREN = 325, - RIGHT_PAREN = 326, - LEFT_BRACKET = 327, - RIGHT_BRACKET = 328, - LEFT_BRACE = 329, - RIGHT_BRACE = 330, - DOT = 331, - COMMA = 332, - COLON = 333, - EQUAL = 334, - SEMICOLON = 335, - BANG = 336, - DASH = 337, - TILDE = 338, - PLUS = 339, - STAR = 340, - SLASH = 341, - PERCENT = 342, - LEFT_ANGLE = 343, - RIGHT_ANGLE = 344, - VERTICAL_BAR = 345, - CARET = 346, - AMPERSAND = 347, - QUESTION = 348 - }; -#endif - - - -#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED -typedef union YYSTYPE -{ - - - struct { - TSourceLoc line; - union { - TString *string; - float f; - int i; - bool b; - }; - TSymbol* symbol; - } lex; - struct { - TSourceLoc line; - TOperator op; - union { - TIntermNode* intermNode; - TIntermNodePair nodePair; - TIntermTyped* intermTypedNode; - TIntermAggregate* intermAggregate; - }; - union { - TPublicType type; - TPrecision precision; - TQualifier qualifier; - TFunction* function; - TParameter param; - TTypeLine typeLine; - TTypeList* typeList; - }; - } interm; - - - -} YYSTYPE; -# define YYSTYPE_IS_TRIVIAL 1 -# define yystype YYSTYPE /* obsolescent; will be withdrawn */ -# define YYSTYPE_IS_DECLARED 1 -#endif - - - - +typedef union { + struct { + TSourceLoc line; + union { + TString *string; + float f; + int i; + bool b; + }; + TSymbol* symbol; + } lex; + struct { + TSourceLoc line; + TOperator op; + union { + TIntermNode* intermNode; + TIntermNodePair nodePair; + TIntermTyped* intermTypedNode; + TIntermAggregate* intermAggregate; + }; + union { + TPublicType type; + TPrecision precision; + TQualifier qualifier; + TFunction* function; + TParameter param; + TTypeLine typeLine; + TTypeList* typeList; + }; + } interm; +} YYSTYPE; +#define INVARIANT 258 +#define HIGH_PRECISION 259 +#define MEDIUM_PRECISION 260 +#define LOW_PRECISION 261 +#define PRECISION 262 +#define ATTRIBUTE 263 +#define CONST_QUAL 264 +#define BOOL_TYPE 265 +#define FLOAT_TYPE 266 +#define INT_TYPE 267 +#define BREAK 268 +#define CONTINUE 269 +#define DO 270 +#define ELSE 271 +#define FOR 272 +#define IF 273 +#define DISCARD 274 +#define RETURN 275 +#define BVEC2 276 +#define BVEC3 277 +#define BVEC4 278 +#define IVEC2 279 +#define IVEC3 280 +#define IVEC4 281 +#define VEC2 282 +#define VEC3 283 +#define VEC4 284 +#define MATRIX2 285 +#define MATRIX3 286 +#define MATRIX4 287 +#define IN_QUAL 288 +#define OUT_QUAL 289 +#define INOUT_QUAL 290 +#define UNIFORM 291 +#define VARYING 292 +#define STRUCT 293 +#define VOID_TYPE 294 +#define WHILE 295 +#define SAMPLER2D 296 +#define SAMPLERCUBE 297 +#define IDENTIFIER 298 +#define TYPE_NAME 299 +#define FLOATCONSTANT 300 +#define INTCONSTANT 301 +#define BOOLCONSTANT 302 +#define FIELD_SELECTION 303 +#define LEFT_OP 304 +#define RIGHT_OP 305 +#define INC_OP 306 +#define DEC_OP 307 +#define LE_OP 308 +#define GE_OP 309 +#define EQ_OP 310 +#define NE_OP 311 +#define AND_OP 312 +#define OR_OP 313 +#define XOR_OP 314 +#define MUL_ASSIGN 315 +#define DIV_ASSIGN 316 +#define ADD_ASSIGN 317 +#define MOD_ASSIGN 318 +#define LEFT_ASSIGN 319 +#define RIGHT_ASSIGN 320 +#define AND_ASSIGN 321 +#define XOR_ASSIGN 322 +#define OR_ASSIGN 323 +#define SUB_ASSIGN 324 +#define LEFT_PAREN 325 +#define RIGHT_PAREN 326 +#define LEFT_BRACKET 327 +#define RIGHT_BRACKET 328 +#define LEFT_BRACE 329 +#define RIGHT_BRACE 330 +#define DOT 331 +#define COMMA 332 +#define COLON 333 +#define EQUAL 334 +#define SEMICOLON 335 +#define BANG 336 +#define DASH 337 +#define TILDE 338 +#define PLUS 339 +#define STAR 340 +#define SLASH 341 +#define PERCENT 342 +#define LEFT_ANGLE 343 +#define RIGHT_ANGLE 344 +#define VERTICAL_BAR 345 +#define CARET 346 +#define AMPERSAND 347 +#define QUESTION 348 + diff --git a/gfx/angle/include/GLES2/gl2ext.h b/gfx/angle/include/GLES2/gl2ext.h index 80a682032ed..01844de4b62 100644 --- a/gfx/angle/include/GLES2/gl2ext.h +++ b/gfx/angle/include/GLES2/gl2ext.h @@ -222,6 +222,12 @@ typedef void* GLeglImageOES; #define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368 #endif +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#endif + /*------------------------------------------------------------------------* * IMG extension tokens *------------------------------------------------------------------------*/ @@ -350,6 +356,25 @@ typedef void* GLeglImageOES; #define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000 #endif +/*------------------------------------------------------------------------* + * ANGLE extension tokens + *------------------------------------------------------------------------*/ + +/* GL_ANGLE_framebuffer_blit */ +#ifndef GL_ANGLE_framebuffer_blit +#define GL_READ_FRAMEBUFFER_ANGLE 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_ANGLE 0x8CA9 +#define GL_DRAW_FRAMEBUFFER_BINDING_ANGLE 0x8CA6 // alias GL_FRAMEBUFFER_BINDING +#define GL_READ_FRAMEBUFFER_BINDING_ANGLE 0x8CAA +#endif + +/* GL_ANGLE_framebuffer_multisample */ +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_RENDERBUFFER_SAMPLES_ANGLE 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE 0x8D56 +#define GL_MAX_SAMPLES_ANGLE 0x8D57 +#endif + /*------------------------------------------------------------------------* * End of extension tokens, start of corresponding extension functions *------------------------------------------------------------------------*/ @@ -623,6 +648,11 @@ typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GL #define GL_EXT_texture_type_2_10_10_10_REV 1 #endif +/* GL_EXT_texture_compression_dxt1 */ +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 +#endif + /*------------------------------------------------------------------------* * IMG extension functions *------------------------------------------------------------------------*/ @@ -766,6 +796,34 @@ typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask); #endif +/*------------------------------------------------------------------------* + * ANGLE extension functions + *------------------------------------------------------------------------*/ + +/* GL_ANGLE_framebuffer_blit */ +#ifndef GL_ANGLE_framebuffer_blit +#define GL_ANGLE_framebuffer_blit 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glBlitFramebufferANGLE (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); +#endif +typedef void (GL_APIENTRYP PFNGLBLITFRAMEBUFFERANGLEPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter); +#endif + +/* GL_ANGLE_framebuffer_multisample */ +#ifndef GL_ANGLE_framebuffer_multisample +#define GL_ANGLE_framebuffer_multisample 1 +#ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glRenderbufferStorageMultisampleANGLE (GLenum target, GLsizei samples, GLenum internalformat, + GLsizei width, GLsizei height); +#endif +typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEANGLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, + GLsizei width, GLsizei height); +#endif + #ifdef __cplusplus } #endif diff --git a/gfx/angle/include/GLSLANG/ResourceLimits.h b/gfx/angle/include/GLSLANG/ResourceLimits.h index 7b7a4b75b1e..e69de29bb2d 100644 --- a/gfx/angle/include/GLSLANG/ResourceLimits.h +++ b/gfx/angle/include/GLSLANG/ResourceLimits.h @@ -1,21 +0,0 @@ -// -// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. -// - -#ifndef _RESOURCE_LIMITS_INCLUDED_ -#define _RESOURCE_LIMITS_INCLUDED_ - -struct TBuiltInResource -{ - int maxVertexAttribs; - int maxVertexUniformVectors; - int maxVaryingVectors; - int maxVertexTextureImageUnits; - int maxCombinedTextureImageUnits; - int maxTextureImageUnits; - int maxFragmentUniformVectors; - int maxDrawBuffers; -}; -#endif // _RESOURCE_LIMITS_INCLUDED_ diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h index 9dc88ade78e..83ab5ac8397 100644 --- a/gfx/angle/include/GLSLANG/ShaderLang.h +++ b/gfx/angle/include/GLSLANG/ShaderLang.h @@ -6,24 +6,6 @@ #ifndef _COMPILER_INTERFACE_INCLUDED_ #define _COMPILER_INTERFACE_INCLUDED_ -#include "nscore.h" - -#include "ResourceLimits.h" - -#ifdef WIN32 -# if !defined(MOZ_ENABLE_LIBXUL) && !defined(MOZ_STATIC_BUILD) -# ifdef ANGLE_BUILD -# define ANGLE_API NS_EXPORT -# else -# define ANGLE_API NS_IMPORT -# endif -# else -# define ANGLE_API /*nothing*/ -# endif -#else -# define ANGLE_API NS_EXTERNAL_VIS -#endif - // // This is the platform independent interface between an OGL driver // and the shading language compiler. @@ -32,47 +14,100 @@ #ifdef __cplusplus extern "C" { #endif + +// Version number for shader translation API. +// It is incremented everytime the API changes. +#define SH_VERSION 101 + +// +// The names of the following enums have been derived by replacing GL prefix +// with SH. For example, SH_INFO_LOG_LENGTH is equivalent to GL_INFO_LOG_LENGTH. +// The enum values are also equal to the values of their GL counterpart. This +// is done to make it easier for applications to use the shader library. +// +typedef enum { + SH_FRAGMENT_SHADER = 0x8B30, + SH_VERTEX_SHADER = 0x8B31 +} ShShaderType; + +typedef enum { + SH_GLES2_SPEC = 0x8B40, + SH_WEBGL_SPEC = 0x8B41 +} ShShaderSpec; + +typedef enum { + SH_NONE = 0, + SH_INT = 0x1404, + SH_FLOAT = 0x1406, + SH_FLOAT_VEC2 = 0x8B50, + SH_FLOAT_VEC3 = 0x8B51, + SH_FLOAT_VEC4 = 0x8B52, + SH_INT_VEC2 = 0x8B53, + SH_INT_VEC3 = 0x8B54, + SH_INT_VEC4 = 0x8B55, + SH_BOOL = 0x8B56, + SH_BOOL_VEC2 = 0x8B57, + SH_BOOL_VEC3 = 0x8B58, + SH_BOOL_VEC4 = 0x8B59, + SH_FLOAT_MAT2 = 0x8B5A, + SH_FLOAT_MAT3 = 0x8B5B, + SH_FLOAT_MAT4 = 0x8B5C, + SH_SAMPLER_2D = 0x8B5E, + SH_SAMPLER_CUBE = 0x8B60 +} ShDataType; + +typedef enum { + SH_INFO_LOG_LENGTH = 0x8B84, + SH_OBJECT_CODE_LENGTH = 0x8B88, // GL_SHADER_SOURCE_LENGTH + SH_ACTIVE_UNIFORMS = 0x8B86, + SH_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, + SH_ACTIVE_ATTRIBUTES = 0x8B89, + SH_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A +} ShShaderInfo; + +// Compile options. +typedef enum { + SH_VALIDATE = 0, + SH_INTERMEDIATE_TREE = 0x001, + SH_OBJECT_CODE = 0x002, + SH_ATTRIBUTES_UNIFORMS = 0x004 +} ShCompileOptions; + // // Driver must call this first, once, before doing any other // compiler operations. // -ANGLE_API int ShInitialize(); +int ShInitialize(); // // Driver should call this at shutdown. // -ANGLE_API int ShFinalize(); -// -// Types of languages the compiler can consume. -// -typedef enum { - EShLangVertex, - EShLangFragment, - EShLangCount -} EShLanguage; +int ShFinalize(); // -// The language specification compiler conforms to. -// It currently supports OpenGL ES and WebGL specifications. +// Implementation dependent built-in resources (constants and extensions). +// The names for these resources has been obtained by stripping gl_/GL_. // -typedef enum { - EShSpecGLES2, - EShSpecWebGL -} EShSpec; +typedef struct +{ + // Constants. + int MaxVertexAttribs; + int MaxVertexUniformVectors; + int MaxVaryingVectors; + int MaxVertexTextureImageUnits; + int MaxCombinedTextureImageUnits; + int MaxTextureImageUnits; + int MaxFragmentUniformVectors; + int MaxDrawBuffers; + + // Extensions. + // Set to 1 to enable the extension, else 0. + int OES_standard_derivatives; +} ShBuiltInResources; // -// Optimization level for the compiler. +// Initialize built-in resources with minimum expected values. // -typedef enum { - EShOptNoGeneration, - EShOptNone, - EShOptSimple, // Optimizations that can be done quickly - EShOptFull // Optimizations that will take more time -} EShOptimizationLevel; - -enum TDebugOptions { - EDebugOpNone = 0x000, - EDebugOpIntermediate = 0x001 // Writes intermediate tree into info-log. -}; +void ShInitBuiltInResources(ShBuiltInResources* resources); // // ShHandle held by but opaque to the driver. It is allocated, @@ -86,30 +121,123 @@ typedef void* ShHandle; // // Driver calls these to create and destroy compiler objects. // -ANGLE_API ShHandle ShConstructCompiler(EShLanguage, EShSpec, const TBuiltInResource*); -ANGLE_API void ShDestruct(ShHandle); +// Returns the handle of constructed compiler. +// Parameters: +// type: Specifies the type of shader - SH_FRAGMENT_SHADER or SH_VERTEX_SHADER. +// spec: Specifies the language spec the compiler must conform to - +// SH_GLES2_SPEC or SH_WEBGL_SPEC. +// resources: Specifies the built-in resources. +ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec, + const ShBuiltInResources* resources); +void ShDestruct(ShHandle handle); // -// The return value of ShCompile is boolean, indicating -// success or failure. +// Compiles the given shader source. +// If the function succeeds, the return value is nonzero, else zero. +// Parameters: +// handle: Specifies the handle of compiler to be used. +// shaderStrings: Specifies an array of pointers to null-terminated strings +// containing the shader source code. +// numStrings: Specifies the number of elements in shaderStrings array. +// compileOptions: A mask containing the following parameters: +// SH_VALIDATE: Performs validations only. +// SH_INTERMEDIATE_TREE: Writes intermediate tree to info log. +// Can be queried by calling ShGetInfoLog(). +// SH_OBJECT_CODE: Translates intermediate tree to glsl or hlsl shader. +// Can be queried by calling ShGetObjectCode(). +// SH_ATTRIBUTES_UNIFORMS: Extracts attributes and uniforms. +// Can be queried by calling ShGetActiveAttrib() and +// ShGetActiveUniform(). // -// The info-log should be written by ShCompile into -// ShHandle, so it can answer future queries. -// -ANGLE_API int ShCompile( - const ShHandle, +int ShCompile( + const ShHandle handle, const char* const shaderStrings[], const int numStrings, - const EShOptimizationLevel, - int debugOptions + int compileOptions ); -// -// All the following return 0 if the information is not -// available in the object passed down, or the object is bad. -// -ANGLE_API const char* ShGetInfoLog(const ShHandle); -ANGLE_API const char* ShGetObjectCode(const ShHandle); +// Returns a parameter from a compiled shader. +// Parameters: +// handle: Specifies the compiler +// pname: Specifies the parameter to query. +// The following parameters are defined: +// SH_INFO_LOG_LENGTH: the number of characters in the information log +// including the null termination character. +// SH_OBJECT_CODE_LENGTH: the number of characters in the object code +// including the null termination character. +// SH_ACTIVE_ATTRIBUTES: the number of active attribute variables. +// SH_ACTIVE_ATTRIBUTE_MAX_LENGTH: the length of the longest active attribute +// variable name including the null +// termination character. +// SH_ACTIVE_UNIFORMS: the number of active uniform variables. +// SH_ACTIVE_UNIFORM_MAX_LENGTH: the length of the longest active uniform +// variable name including the null +// termination character. +// +// params: Requested parameter +void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params); + +// Returns nul-terminated information log for a compiled shader. +// Parameters: +// handle: Specifies the compiler +// infoLog: Specifies an array of characters that is used to return +// the information log. It is assumed that infoLog has enough memory +// to accomodate the information log. The size of the buffer required +// to store the returned information log can be obtained by calling +// ShGetInfo with SH_INFO_LOG_LENGTH. +void ShGetInfoLog(const ShHandle handle, char* infoLog); + +// Returns null-terminated object code for a compiled shader. +// Parameters: +// handle: Specifies the compiler +// infoLog: Specifies an array of characters that is used to return +// the object code. It is assumed that infoLog has enough memory to +// accomodate the object code. The size of the buffer required to +// store the returned object code can be obtained by calling +// ShGetInfo with SH_OBJECT_CODE_LENGTH. +void ShGetObjectCode(const ShHandle handle, char* objCode); + +// Returns information about an active attribute variable. +// Parameters: +// handle: Specifies the compiler +// index: Specifies the index of the attribute variable to be queried. +// length: Returns the number of characters actually written in the string +// indicated by name (excluding the null terminator) if a value other +// than NULL is passed. +// size: Returns the size of the attribute variable. +// type: Returns the data type of the attribute variable. +// name: Returns a null terminated string containing the name of the +// attribute variable. It is assumed that name has enough memory to +// accomodate the attribute variable name. The size of the buffer +// required to store the attribute variable name can be obtained by +// calling ShGetInfo with SH_ACTIVE_ATTRIBUTE_MAX_LENGTH. +void ShGetActiveAttrib(const ShHandle handle, + int index, + int* length, + int* size, + ShDataType* type, + char* name); + +// Returns information about an active uniform variable. +// Parameters: +// handle: Specifies the compiler +// index: Specifies the index of the uniform variable to be queried. +// length: Returns the number of characters actually written in the string +// indicated by name (excluding the null terminator) if a value +// other than NULL is passed. +// size: Returns the size of the uniform variable. +// type: Returns the data type of the uniform variable. +// name: Returns a null terminated string containing the name of the +// uniform variable. It is assumed that name has enough memory to +// accomodate the uniform variable name. The size of the buffer required +// to store the uniform variable name can be obtained by calling +// ShGetInfo with SH_ACTIVE_UNIFORMS_MAX_LENGTH. +void ShGetActiveUniform(const ShHandle handle, + int index, + int* length, + int* size, + ShDataType* type, + char* name); #ifdef __cplusplus } diff --git a/gfx/angle/src/build_angle.gyp b/gfx/angle/src/build_angle.gyp index d17fe529920..927f415ca38 100644 --- a/gfx/angle/src/build_angle.gyp +++ b/gfx/angle/src/build_angle.gyp @@ -3,6 +3,11 @@ # found in the LICENSE file. { + 'target_defaults': { + 'defines': [ + 'TRACE_OUTPUT_FILE="angle-debug.txt"', + ], + }, 'targets': [ { 'target_name': 'translator_common', @@ -19,6 +24,7 @@ 'sources': [ 'compiler/BaseTypes.h', 'compiler/Common.h', + 'compiler/Compiler.cpp', 'compiler/ConstantUnion.h', 'compiler/debug.cpp', 'compiler/debug.h', @@ -52,6 +58,8 @@ 'compiler/SymbolTable.h', 'compiler/Types.h', 'compiler/unistd.h', + 'compiler/VariableInfo.cpp', + 'compiler/VariableInfo.h', 'compiler/preprocessor/atom.c', 'compiler/preprocessor/atom.h', 'compiler/preprocessor/compile.h', @@ -177,6 +185,8 @@ 'libGLESv2/Buffer.h', 'libGLESv2/Context.cpp', 'libGLESv2/Context.h', + 'libGLESv2/Fence.cpp', + 'libGLESv2/Fence.h', 'libGLESv2/Framebuffer.cpp', 'libGLESv2/Framebuffer.h', 'libGLESv2/libGLESv2.cpp', diff --git a/gfx/angle/src/common/debug.cpp b/gfx/angle/src/common/debug.cpp index d8d6ab89a4d..b07cf2ad44c 100644 --- a/gfx/angle/src/common/debug.cpp +++ b/gfx/angle/src/common/debug.cpp @@ -11,6 +11,10 @@ #include #include +#ifndef TRACE_OUTPUT_FILE +#define TRACE_OUTPUT_FILE "debug.txt" +#endif + static bool trace_on = true; namespace gl @@ -21,7 +25,7 @@ void trace(const char *format, ...) { if (format) { - FILE *file = fopen("debug.txt", "a"); + FILE *file = fopen(TRACE_OUTPUT_FILE, "a"); if (file) { diff --git a/gfx/angle/src/compiler/BaseTypes.h b/gfx/angle/src/compiler/BaseTypes.h index c0e07187859..5ae09433c4c 100644 --- a/gfx/angle/src/compiler/BaseTypes.h +++ b/gfx/angle/src/compiler/BaseTypes.h @@ -51,6 +51,21 @@ enum TBasicType EbtAddress, // should be deprecated?? }; +inline const char* getBasicString(TBasicType t) +{ + switch (t) + { + case EbtVoid: return "void"; break; + case EbtFloat: return "float"; break; + case EbtInt: return "int"; break; + case EbtBool: return "bool"; break; + case EbtSampler2D: return "sampler2D"; break; + case EbtSamplerCube: return "samplerCube"; break; + case EbtStruct: return "structure"; break; + default: return "unknown type"; + } +} + inline bool IsSampler(TBasicType type) { return type > EbtGuardSamplerBegin && type < EbtGuardSamplerEnd; diff --git a/gfx/angle/src/compiler/CodeGenGLSL.cpp b/gfx/angle/src/compiler/CodeGenGLSL.cpp index 855b09206f1..d140b375f71 100644 --- a/gfx/angle/src/compiler/CodeGenGLSL.cpp +++ b/gfx/angle/src/compiler/CodeGenGLSL.cpp @@ -11,9 +11,9 @@ // compile object used by higher level code. It returns // a subclass of TCompiler. // -TCompiler* ConstructCompiler(EShLanguage language, EShSpec spec) +TCompiler* ConstructCompiler(ShShaderType type, ShShaderSpec spec) { - return new TranslatorGLSL(language, spec); + return new TranslatorGLSL(type, spec); } // diff --git a/gfx/angle/src/compiler/CodeGenHLSL.cpp b/gfx/angle/src/compiler/CodeGenHLSL.cpp index 4db771d8874..e04e7894415 100644 --- a/gfx/angle/src/compiler/CodeGenHLSL.cpp +++ b/gfx/angle/src/compiler/CodeGenHLSL.cpp @@ -11,9 +11,9 @@ // compile object used by higher level code. It returns // a subclass of TCompiler. // -TCompiler* ConstructCompiler(EShLanguage language, EShSpec spec) +TCompiler* ConstructCompiler(ShShaderType type, ShShaderSpec spec) { - return new TranslatorHLSL(language, spec); + return new TranslatorHLSL(type, spec); } // diff --git a/gfx/angle/src/compiler/Common.h b/gfx/angle/src/compiler/Common.h index 65d0a518345..1545c53fc1f 100644 --- a/gfx/angle/src/compiler/Common.h +++ b/gfx/angle/src/compiler/Common.h @@ -71,6 +71,4 @@ public: TMap(const tAllocator& a) : std::map(std::map::key_compare(), a) {} }; -typedef TMap TPragmaTable; - #endif // _COMMON_INCLUDED_ diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp new file mode 100644 index 00000000000..7e8a835ff2a --- /dev/null +++ b/gfx/angle/src/compiler/Compiler.cpp @@ -0,0 +1,168 @@ +// +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +#include "compiler/Initialize.h" +#include "compiler/ParseHelper.h" +#include "compiler/ShHandle.h" + +static bool InitializeSymbolTable( + const TBuiltInStrings& builtInStrings, + ShShaderType type, ShShaderSpec spec, const ShBuiltInResources& resources, + TInfoSink& infoSink, TSymbolTable& symbolTable) +{ + TIntermediate intermediate(infoSink); + TExtensionBehavior extBehavior; + TParseContext parseContext(symbolTable, extBehavior, intermediate, type, spec, infoSink); + + GlobalParseContext = &parseContext; + + setInitialState(); + + assert(symbolTable.isEmpty()); + // + // Parse the built-ins. This should only happen once per + // language symbol table. + // + // Push the symbol table to give it an initial scope. This + // push should not have a corresponding pop, so that built-ins + // are preserved, and the test for an empty table fails. + // + symbolTable.push(); + + //Initialize the Preprocessor + if (InitPreprocessor()) + { + infoSink.info.message(EPrefixInternalError, "Unable to intialize the Preprocessor"); + return false; + } + + for (TBuiltInStrings::const_iterator i = builtInStrings.begin(); i != builtInStrings.end(); ++i) + { + const char* builtInShaders = i->c_str(); + int builtInLengths = static_cast(i->size()); + if (builtInLengths <= 0) + continue; + + if (PaParseStrings(&builtInShaders, &builtInLengths, 1, parseContext) != 0) + { + infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); + return false; + } + } + + IdentifyBuiltIns(type, spec, resources, symbolTable); + + FinalizePreprocessor(); + + return true; +} + +static void DefineExtensionMacros(const TExtensionBehavior& extBehavior) +{ + for (TExtensionBehavior::const_iterator iter = extBehavior.begin(); + iter != extBehavior.end(); ++iter) { + PredefineIntMacro(iter->first.c_str(), 1); + } +} + +TCompiler::TCompiler(ShShaderType type, ShShaderSpec spec) + : shaderType(type), + shaderSpec(spec) +{ +} + +TCompiler::~TCompiler() +{ +} + +bool TCompiler::Init(const ShBuiltInResources& resources) +{ + // Generate built-in symbol table. + if (!InitBuiltInSymbolTable(resources)) + return false; + + InitExtensionBehavior(resources, extensionBehavior); + return true; +} + +bool TCompiler::compile(const char* const shaderStrings[], + const int numStrings, + int compileOptions) +{ + clearResults(); + + if (numStrings == 0) + return true; + + TIntermediate intermediate(infoSink); + TParseContext parseContext(symbolTable, extensionBehavior, intermediate, + shaderType, shaderSpec, infoSink); + GlobalParseContext = &parseContext; + setInitialState(); + + // Initialize preprocessor. + InitPreprocessor(); + DefineExtensionMacros(extensionBehavior); + + // We preserve symbols at the built-in level from compile-to-compile. + // Start pushing the user-defined symbols at global level. + symbolTable.push(); + if (!symbolTable.atGlobalLevel()) + infoSink.info.message(EPrefixInternalError, "Wrong symbol table level"); + + // Parse shader. + bool success = + (PaParseStrings(shaderStrings, 0, numStrings, parseContext) == 0) && + (parseContext.treeRoot != NULL); + if (success) { + success = intermediate.postProcess(parseContext.treeRoot); + + if (success && (compileOptions & SH_INTERMEDIATE_TREE)) + intermediate.outputTree(parseContext.treeRoot); + + if (success && (compileOptions & SH_OBJECT_CODE)) + translate(parseContext.treeRoot); + + if (success && (compileOptions & SH_ATTRIBUTES_UNIFORMS)) + collectAttribsUniforms(parseContext.treeRoot); + } + + // Cleanup memory. + intermediate.remove(parseContext.treeRoot); + // Ensure symbol table is returned to the built-in level, + // throwing away all but the built-ins. + while (!symbolTable.atBuiltInLevel()) + symbolTable.pop(); + FinalizePreprocessor(); + + return success; +} + +bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources& resources) +{ + TBuiltIns builtIns; + + builtIns.initialize(shaderType, shaderSpec, resources); + return InitializeSymbolTable(builtIns.getBuiltInStrings(), + shaderType, shaderSpec, resources, infoSink, symbolTable); +} + +void TCompiler::clearResults() +{ + infoSink.info.erase(); + infoSink.obj.erase(); + infoSink.debug.erase(); + + attribs.clear(); + uniforms.clear(); +} + +void TCompiler::collectAttribsUniforms(TIntermNode* root) +{ + CollectAttribsUniforms collect(attribs, uniforms); + root->traverse(&collect); +} + diff --git a/gfx/angle/src/compiler/ExtensionBehavior.h b/gfx/angle/src/compiler/ExtensionBehavior.h new file mode 100644 index 00000000000..da96c2435ff --- /dev/null +++ b/gfx/angle/src/compiler/ExtensionBehavior.h @@ -0,0 +1,21 @@ +// +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +#ifndef _EXTENSION_BEHAVIOR_INCLUDED_ +#define _EXTENSION_BEHAVIOR_INCLUDED_ + +#include "compiler/Common.h" + +typedef enum { + EBhRequire, + EBhEnable, + EBhWarn, + EBhDisable +} TBehavior; + +typedef TMap TExtensionBehavior; + +#endif // _EXTENSION_TABLE_INCLUDED_ diff --git a/gfx/angle/src/compiler/InfoSink.h b/gfx/angle/src/compiler/InfoSink.h index 476277866ee..e2224e918d0 100644 --- a/gfx/angle/src/compiler/InfoSink.h +++ b/gfx/angle/src/compiler/InfoSink.h @@ -91,6 +91,7 @@ public: } void erase() { sink.clear(); } + int size() { return static_cast(sink.size()); } const TPersistString& str() const { return sink; } const char* c_str() const { return sink.c_str(); } diff --git a/gfx/angle/src/compiler/Initialize.cpp b/gfx/angle/src/compiler/Initialize.cpp index 1a9220b015e..12b53fe64f5 100644 --- a/gfx/angle/src/compiler/Initialize.cpp +++ b/gfx/angle/src/compiler/Initialize.cpp @@ -310,15 +310,6 @@ static TString BuiltInFunctionsCommon() s.append(TString("bvec3 not(bvec3 x);")); s.append(TString("bvec4 not(bvec4 x);")); - // - // Texture Functions. - // - s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);")); - s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);")); - s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);")); - - s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);")); - // // Noise functions. // @@ -342,7 +333,6 @@ static TString BuiltInFunctionsCommon() //s.append(TString("vec4 noise4(vec3 x);")); //s.append(TString("vec4 noise4(vec4 x);")); - s.append(TString("\n")); return s; } @@ -351,7 +341,7 @@ static TString BuiltInFunctionsCommon() // Prototypes for built-in functions seen by vertex shaders only. // //============================================================================ -static TString BuiltInFunctionsVertex() +static TString BuiltInFunctionsVertex(const ShBuiltInResources& resources) { TString s; @@ -363,12 +353,18 @@ static TString BuiltInFunctionsVertex() // // Texture Functions. // - s.append(TString("vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);")); - s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);")); - s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);")); - s.append(TString("vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);")); + if (resources.MaxVertexTextureImageUnits > 0) { + s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);")); + s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);")); + s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);")); + s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);")); + + s.append(TString("vec4 texture2DLod(sampler2D sampler, vec2 coord, float lod);")); + s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec3 coord, float lod);")); + s.append(TString("vec4 texture2DProjLod(sampler2D sampler, vec4 coord, float lod);")); + s.append(TString("vec4 textureCubeLod(samplerCube sampler, vec3 coord, float lod);")); + } - s.append(TString("\n")); return s; } @@ -377,34 +373,40 @@ static TString BuiltInFunctionsVertex() // Prototypes for built-in functions seen by fragment shaders only. // //============================================================================ -static TString BuiltInFunctionsFragment() +static TString BuiltInFunctionsFragment(const ShBuiltInResources& resources) { TString s; // // Texture Functions. // + s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord);")); + s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord);")); + s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord);")); + s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord);")); + s.append(TString("vec4 texture2D(sampler2D sampler, vec2 coord, float bias);")); s.append(TString("vec4 texture2DProj(sampler2D sampler, vec3 coord, float bias);")); s.append(TString("vec4 texture2DProj(sampler2D sampler, vec4 coord, float bias);")); s.append(TString("vec4 textureCube(samplerCube sampler, vec3 coord, float bias);")); - //s.append(TString("float dFdx(float p);")); - //s.append(TString("vec2 dFdx(vec2 p);")); - //s.append(TString("vec3 dFdx(vec3 p);")); - //s.append(TString("vec4 dFdx(vec4 p);")); + if (resources.OES_standard_derivatives) { + s.append(TString("float dFdx(float p);")); + s.append(TString("vec2 dFdx(vec2 p);")); + s.append(TString("vec3 dFdx(vec3 p);")); + s.append(TString("vec4 dFdx(vec4 p);")); - //s.append(TString("float dFdy(float p);")); - //s.append(TString("vec2 dFdy(vec2 p);")); - //s.append(TString("vec3 dFdy(vec3 p);")); - //s.append(TString("vec4 dFdy(vec4 p);")); + s.append(TString("float dFdy(float p);")); + s.append(TString("vec2 dFdy(vec2 p);")); + s.append(TString("vec3 dFdy(vec3 p);")); + s.append(TString("vec4 dFdy(vec4 p);")); - s.append(TString("float fwidth(float p);")); - s.append(TString("vec2 fwidth(vec2 p);")); - s.append(TString("vec3 fwidth(vec3 p);")); - s.append(TString("vec4 fwidth(vec4 p);")); + s.append(TString("float fwidth(float p);")); + s.append(TString("vec2 fwidth(vec2 p);")); + s.append(TString("vec3 fwidth(vec3 p);")); + s.append(TString("vec4 fwidth(vec4 p);")); + } - s.append(TString("\n")); return s; } @@ -427,7 +429,6 @@ static TString StandardUniforms() s.append(TString("};")); s.append(TString("uniform gl_DepthRangeParameters gl_DepthRange;")); - s.append(TString("\n")); return s; } @@ -443,7 +444,6 @@ static TString DefaultPrecisionVertex() s.append(TString("precision highp int;")); s.append(TString("precision highp float;")); - s.append(TString("\n")); return s; } @@ -459,7 +459,6 @@ static TString DefaultPrecisionFragment() s.append(TString("precision mediump int;")); // No default precision for float in fragment shaders - s.append(TString("\n")); return s; } @@ -468,37 +467,38 @@ static TString DefaultPrecisionFragment() // Implementation dependent built-in constants. // //============================================================================ -static TString BuiltInConstants(const TBuiltInResource &resources) +static TString BuiltInConstants(const ShBuiltInResources &resources) { TStringStream s; - s << "const int gl_MaxVertexAttribs = " << resources.maxVertexAttribs << ";"; - s << "const int gl_MaxVertexUniformVectors = " << resources.maxVertexUniformVectors << ";"; + s << "const int gl_MaxVertexAttribs = " << resources.MaxVertexAttribs << ";"; + s << "const int gl_MaxVertexUniformVectors = " << resources.MaxVertexUniformVectors << ";"; - s << "const int gl_MaxVaryingVectors = " << resources.maxVaryingVectors << ";"; - s << "const int gl_MaxVertexTextureImageUnits = " << resources.maxVertexTextureImageUnits << ";"; - s << "const int gl_MaxCombinedTextureImageUnits = " << resources.maxCombinedTextureImageUnits << ";"; - s << "const int gl_MaxTextureImageUnits = " << resources.maxTextureImageUnits << ";"; - s << "const int gl_MaxFragmentUniformVectors = " << resources.maxFragmentUniformVectors << ";"; - s << "const int gl_MaxDrawBuffers = " << resources.maxDrawBuffers << ";"; + s << "const int gl_MaxVaryingVectors = " << resources.MaxVaryingVectors << ";"; + s << "const int gl_MaxVertexTextureImageUnits = " << resources.MaxVertexTextureImageUnits << ";"; + s << "const int gl_MaxCombinedTextureImageUnits = " << resources.MaxCombinedTextureImageUnits << ";"; + s << "const int gl_MaxTextureImageUnits = " << resources.MaxTextureImageUnits << ";"; + s << "const int gl_MaxFragmentUniformVectors = " << resources.MaxFragmentUniformVectors << ";"; + s << "const int gl_MaxDrawBuffers = " << resources.MaxDrawBuffers << ";"; return s.str(); } -void TBuiltIns::initialize(EShLanguage language, EShSpec spec, const TBuiltInResource& resources) +void TBuiltIns::initialize(ShShaderType type, ShShaderSpec spec, + const ShBuiltInResources& resources) { - switch (language) { - case EShLangFragment: + switch (type) { + case SH_FRAGMENT_SHADER: builtInStrings.push_back(DefaultPrecisionFragment()); builtInStrings.push_back(BuiltInFunctionsCommon()); - builtInStrings.push_back(BuiltInFunctionsFragment()); + builtInStrings.push_back(BuiltInFunctionsFragment(resources)); builtInStrings.push_back(StandardUniforms()); break; - case EShLangVertex: + case SH_VERTEX_SHADER: builtInStrings.push_back(DefaultPrecisionVertex()); builtInStrings.push_back(BuiltInFunctionsCommon()); - builtInStrings.push_back(BuiltInFunctionsVertex()); + builtInStrings.push_back(BuiltInFunctionsVertex(resources)); builtInStrings.push_back(StandardUniforms()); break; @@ -508,14 +508,16 @@ void TBuiltIns::initialize(EShLanguage language, EShSpec spec, const TBuiltInRes builtInStrings.push_back(BuiltInConstants(resources)); } -void IdentifyBuiltIns(EShLanguage language, EShSpec spec, const TBuiltInResource& resources, TSymbolTable& symbolTable) +void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec, + const ShBuiltInResources& resources, + TSymbolTable& symbolTable) { // // First, insert some special built-in variables that are not in // the built-in header files. // - switch(language) { - case EShLangFragment: + switch(type) { + case SH_FRAGMENT_SHADER: symbolTable.insert(*new TVariable(NewPoolTString("gl_FragCoord"), TType(EbtFloat, EbpMedium, EvqFragCoord, 4))); symbolTable.insert(*new TVariable(NewPoolTString("gl_FrontFacing"), TType(EbtBool, EbpUndefined, EvqFrontFacing, 1))); symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"), TType(EbtFloat, EbpMedium, EvqFragColor, 4))); @@ -523,7 +525,7 @@ void IdentifyBuiltIns(EShLanguage language, EShSpec spec, const TBuiltInResource symbolTable.insert(*new TVariable(NewPoolTString("gl_PointCoord"), TType(EbtFloat, EbpMedium, EvqPointCoord, 2))); break; - case EShLangVertex: + case SH_VERTEX_SHADER: symbolTable.insert(*new TVariable(NewPoolTString("gl_Position"), TType(EbtFloat, EbpHigh, EvqPosition, 4))); symbolTable.insert(*new TVariable(NewPoolTString("gl_PointSize"), TType(EbtFloat, EbpMedium, EvqPointSize, 1))); break; @@ -591,23 +593,29 @@ void IdentifyBuiltIns(EShLanguage language, EShSpec spec, const TBuiltInResource symbolTable.relateToOperator("all", EOpAll); // Map language-specific operators. - switch(language) { - case EShLangVertex: + switch(type) { + case SH_VERTEX_SHADER: break; - case EShLangFragment: - //symbolTable.relateToOperator("dFdx", EOpDPdx); // OES_standard_derivatives extension - //symbolTable.relateToOperator("dFdy", EOpDPdy); // OES_standard_derivatives extension - //symbolTable.relateToOperator("fwidth", EOpFwidth); // OES_standard_derivatives extension + case SH_FRAGMENT_SHADER: + if (resources.OES_standard_derivatives) { + symbolTable.relateToOperator("dFdx", EOpDFdx); + symbolTable.relateToOperator("dFdy", EOpDFdy); + symbolTable.relateToOperator("fwidth", EOpFwidth); + + symbolTable.relateToExtension("dFdx", "GL_OES_standard_derivatives"); + symbolTable.relateToExtension("dFdy", "GL_OES_standard_derivatives"); + symbolTable.relateToExtension("fwidth", "GL_OES_standard_derivatives"); + } break; default: break; } // Finally add resource-specific variables. - switch(language) { - case EShLangFragment: { + switch(type) { + case SH_FRAGMENT_SHADER: { // Set up gl_FragData. The array size. TType fragData(EbtFloat, EbpMedium, EvqFragColor, 4, false, true); - fragData.setArraySize(resources.maxDrawBuffers); + fragData.setArraySize(resources.MaxDrawBuffers); symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"), fragData)); } break; @@ -615,3 +623,9 @@ void IdentifyBuiltIns(EShLanguage language, EShSpec spec, const TBuiltInResource } } +void InitExtensionBehavior(const ShBuiltInResources& resources, + TExtensionBehavior& extBehavior) +{ + if (resources.OES_standard_derivatives) + extBehavior["GL_OES_standard_derivatives"] = EBhDisable; +} diff --git a/gfx/angle/src/compiler/Initialize.h b/gfx/angle/src/compiler/Initialize.h index 03c9937958e..483ff48466c 100644 --- a/gfx/angle/src/compiler/Initialize.h +++ b/gfx/angle/src/compiler/Initialize.h @@ -7,8 +7,6 @@ #ifndef _INITIALIZE_INCLUDED_ #define _INITIALIZE_INCLUDED_ -#include "GLSLANG/ResourceLimits.h" - #include "compiler/Common.h" #include "compiler/ShHandle.h" #include "compiler/SymbolTable.h" @@ -19,17 +17,23 @@ class TBuiltIns { public: POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator) - void initialize(EShLanguage language, EShSpec spec, const TBuiltInResource& resources); + void initialize(ShShaderType type, ShShaderSpec spec, + const ShBuiltInResources& resources); const TBuiltInStrings& getBuiltInStrings() { return builtInStrings; } protected: TBuiltInStrings builtInStrings; }; -void IdentifyBuiltIns(EShLanguage language, EShSpec spec, const TBuiltInResource& resources, +void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec, + const ShBuiltInResources& resources, TSymbolTable& symbolTable); +void InitExtensionBehavior(const ShBuiltInResources& resources, + TExtensionBehavior& extensionBehavior); + extern "C" int InitPreprocessor(void); extern "C" int FinalizePreprocessor(void); +extern "C" void PredefineIntMacro(const char *name, int value); #endif // _INITIALIZE_INCLUDED_ diff --git a/gfx/angle/src/compiler/Intermediate.cpp b/gfx/angle/src/compiler/Intermediate.cpp index 4a1e02fbf8b..edb34603591 100644 --- a/gfx/angle/src/compiler/Intermediate.cpp +++ b/gfx/angle/src/compiler/Intermediate.cpp @@ -51,18 +51,23 @@ TIntermSymbol* TIntermediate::addSymbol(int id, const TString& name, const TType TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIntermTyped* right, TSourceLoc line, TSymbolTable& symbolTable) { switch (op) { + case EOpEqual: + case EOpNotEqual: + if (left->isArray()) + return 0; + break; case EOpLessThan: case EOpGreaterThan: case EOpLessThanEqual: case EOpGreaterThanEqual: - if (left->getType().isMatrix() || left->getType().isArray() || left->getType().isVector() || left->getType().getBasicType() == EbtStruct) { + if (left->isMatrix() || left->isArray() || left->isVector() || left->getBasicType() == EbtStruct) { return 0; } break; case EOpLogicalOr: case EOpLogicalXor: case EOpLogicalAnd: - if (left->getType().getBasicType() != EbtBool || left->getType().isMatrix() || left->getType().isArray() || left->getType().isVector()) { + if (left->getBasicType() != EbtBool || left->isMatrix() || left->isArray() || left->isVector()) { return 0; } break; @@ -70,7 +75,7 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn case EOpSub: case EOpDiv: case EOpMul: - if (left->getType().getBasicType() == EbtStruct || left->getType().getBasicType() == EbtBool) + if (left->getBasicType() == EbtStruct || left->getBasicType() == EbtBool) return 0; default: break; } @@ -78,8 +83,10 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn // // First try converting the children to compatible types. // - - if (!(left->getType().getStruct() && right->getType().getStruct())) { + if (left->getType().getStruct() && right->getType().getStruct()) { + if (left->getType() != right->getType()) + return 0; + } else { TIntermTyped* child = addConversion(op, left->getType(), right); if (child) right = child; @@ -90,12 +97,8 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn else return 0; } - } else { - if (left->getType() != right->getType()) - return 0; } - // // Need a new node holding things together then. Make // one and promote it to the right type. @@ -107,18 +110,16 @@ TIntermTyped* TIntermediate::addBinaryMath(TOperator op, TIntermTyped* left, TIn node->setLeft(left); node->setRight(right); - if (! node->promote(infoSink)) + if (!node->promote(infoSink)) return 0; - TIntermConstantUnion *leftTempConstant = left->getAsConstantUnion(); - TIntermConstantUnion *rightTempConstant = right->getAsConstantUnion(); - // // See if we can fold constants. // - TIntermTyped* typedReturnNode = 0; - if ( leftTempConstant && rightTempConstant) { + TIntermConstantUnion *leftTempConstant = left->getAsConstantUnion(); + TIntermConstantUnion *rightTempConstant = right->getAsConstantUnion(); + if (leftTempConstant && rightTempConstant) { typedReturnNode = leftTempConstant->fold(node->getOp(), rightTempConstant, infoSink); if (typedReturnNode) @@ -303,7 +304,7 @@ TIntermAggregate* TIntermediate::setAggregateOperator(TIntermNode* node, TOperat // // Set the operator. // - aggNode->setOperator(op); + aggNode->setOp(op); if (line != 0) aggNode->setLine(line); @@ -515,9 +516,9 @@ TIntermTyped* TIntermediate::addComma(TIntermTyped* left, TIntermTyped* right, T return right; } else { TIntermTyped *commaAggregate = growAggregate(left, right, line); - commaAggregate->getAsAggregate()->setOperator(EOpComma); + commaAggregate->getAsAggregate()->setOp(EOpComma); commaAggregate->setType(right->getType()); - commaAggregate->getTypePointer()->changeQualifier(EvqTemporary); + commaAggregate->getTypePointer()->setQualifier(EvqTemporary); return commaAggregate; } } @@ -630,7 +631,7 @@ TIntermBranch* TIntermediate::addBranch(TOperator branchOp, TIntermTyped* expres // This is to be executed once the final root is put on top by the parsing // process. // -bool TIntermediate::postProcess(TIntermNode* root, EShLanguage language) +bool TIntermediate::postProcess(TIntermNode* root) { if (root == 0) return true; @@ -640,7 +641,7 @@ bool TIntermediate::postProcess(TIntermNode* root, EShLanguage language) // TIntermAggregate* aggRoot = root->getAsAggregate(); if (aggRoot && aggRoot->getOp() == EOpNull) - aggRoot->setOperator(EOpSequence); + aggRoot->setOp(EOpSequence); return true; } @@ -760,6 +761,12 @@ bool TIntermUnary::promote(TInfoSink&) // bool TIntermBinary::promote(TInfoSink& infoSink) { + // This function only handles scalars, vectors, and matrices. + if (left->isArray() || right->isArray()) { + infoSink.info.message(EPrefixInternalError, "Invalid operation for arrays", getLine()); + return false; + } + // GLSL ES 2.0 does not support implicit type casting. // So the basic type should always match. if (left->getBasicType() != right->getBasicType()) @@ -773,46 +780,12 @@ bool TIntermBinary::promote(TInfoSink& infoSink) // The result gets promoted to the highest precision. TPrecision higherPrecision = GetHigherPrecision(left->getPrecision(), right->getPrecision()); - getTypePointer()->changePrecision(higherPrecision); + getTypePointer()->setPrecision(higherPrecision); // Binary operations results in temporary variables unless both // operands are const. if (left->getQualifier() != EvqConst || right->getQualifier() != EvqConst) { - getTypePointer()->changeQualifier(EvqTemporary); - } - - // - // Array operations. - // - if (left->isArray() || right->isArray()) { - // - // Arrays types have to be exact matches. - // - if (left->getType() != right->getType()) - return false; - - switch (op) { - // - // Promote to conditional - // - case EOpEqual: - case EOpNotEqual: - setType(TType(EbtBool, EbpUndefined)); - break; - - // - // Set array information. - // - case EOpAssign: - case EOpInitialize: - getTypePointer()->setArraySize(left->getType().getArraySize()); - getTypePointer()->setArrayInformationType(left->getType().getArrayInformationType()); - break; - - default: - return false; - } - return true; + getTypePointer()->setQualifier(EvqTemporary); } int size = std::max(left->getNominalSize(), right->getNominalSize()); @@ -964,7 +937,7 @@ bool TIntermBinary::promote(TInfoSink& infoSink) bool CompareStruct(const TType& leftNodeType, ConstantUnion* rightUnionArray, ConstantUnion* leftUnionArray) { - TTypeList* fields = leftNodeType.getStruct(); + const TTypeList* fields = leftNodeType.getStruct(); size_t structSize = fields->size(); int index = 0; diff --git a/gfx/angle/src/compiler/OutputGLSL.cpp b/gfx/angle/src/compiler/OutputGLSL.cpp index fd263b6f31c..b0ab7a76c77 100644 --- a/gfx/angle/src/compiler/OutputGLSL.cpp +++ b/gfx/angle/src/compiler/OutputGLSL.cpp @@ -374,6 +374,10 @@ bool TOutputGLSL::visitUnary(Visit visit, TIntermUnary* node) case EOpLength: writeTriplet(visit, "length(", NULL, ")"); break; case EOpNormalize: writeTriplet(visit, "normalize(", NULL, ")"); break; + case EOpDFdx: writeTriplet(visit, "dFdx(", NULL, ")"); break; + case EOpDFdy: writeTriplet(visit, "dFdy(", NULL, ")"); break; + case EOpFwidth: writeTriplet(visit, "fwidth(", NULL, ")"); break; + case EOpAny: writeTriplet(visit, "any(", NULL, ")"); break; case EOpAll: writeTriplet(visit, "all(", NULL, ")"); break; diff --git a/gfx/angle/src/compiler/OutputHLSL.cpp b/gfx/angle/src/compiler/OutputHLSL.cpp index d1e9017ce33..0e61d855a2c 100644 --- a/gfx/angle/src/compiler/OutputHLSL.cpp +++ b/gfx/angle/src/compiler/OutputHLSL.cpp @@ -96,7 +96,7 @@ int OutputHLSL::vectorSize(const TType &type) const void OutputHLSL::header() { - EShLanguage language = mContext.language; + ShShaderType shaderType = mContext.shaderType; TInfoSinkBase &out = mHeader; for (StructDeclarations::iterator structDeclaration = mStructDeclarations.begin(); structDeclaration != mStructDeclarations.end(); structDeclaration++) @@ -109,7 +109,7 @@ void OutputHLSL::header() out << *constructor; } - if (language == EShLangFragment) + if (shaderType == SH_FRAGMENT_SHADER) { TString uniforms; TString varyings; @@ -791,11 +791,11 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node) { if (node->getLeft()->isMatrix()) { - switch (node->getLeft()->getSize()) + switch (node->getLeft()->getNominalSize()) { - case 2 * 2: mUsesEqualMat2 = true; break; - case 3 * 3: mUsesEqualMat3 = true; break; - case 4 * 4: mUsesEqualMat4 = true; break; + case 2: mUsesEqualMat2 = true; break; + case 3: mUsesEqualMat3 = true; break; + case 4: mUsesEqualMat4 = true; break; default: UNREACHABLE(); } } @@ -804,7 +804,7 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node) switch (node->getLeft()->getBasicType()) { case EbtFloat: - switch (node->getLeft()->getSize()) + switch (node->getLeft()->getNominalSize()) { case 2: mUsesEqualVec2 = true; break; case 3: mUsesEqualVec3 = true; break; @@ -813,7 +813,7 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node) } break; case EbtInt: - switch (node->getLeft()->getSize()) + switch (node->getLeft()->getNominalSize()) { case 2: mUsesEqualIVec2 = true; break; case 3: mUsesEqualIVec3 = true; break; @@ -822,7 +822,7 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node) } break; case EbtBool: - switch (node->getLeft()->getSize()) + switch (node->getLeft()->getNominalSize()) { case 2: mUsesEqualBVec2 = true; break; case 3: mUsesEqualBVec3 = true; break; @@ -933,9 +933,9 @@ bool OutputHLSL::visitUnary(Visit visit, TIntermUnary *node) case EOpFract: outputTriplet(visit, "frac(", "", ")"); break; case EOpLength: outputTriplet(visit, "length(", "", ")"); break; case EOpNormalize: outputTriplet(visit, "normalize(", "", ")"); break; -// case EOpDPdx: outputTriplet(visit, "ddx(", "", ")"); break; -// case EOpDPdy: outputTriplet(visit, "ddy(", "", ")"); break; -// case EOpFwidth: outputTriplet(visit, "fwidth(", "", ")"); break; + case EOpDFdx: outputTriplet(visit, "ddx(", "", ")"); break; + case EOpDFdy: outputTriplet(visit, "ddy(", "", ")"); break; + case EOpFwidth: outputTriplet(visit, "fwidth(", "", ")"); break; case EOpAny: outputTriplet(visit, "any(", "", ")"); break; case EOpAll: outputTriplet(visit, "all(", "", ")"); break; default: UNREACHABLE(); @@ -946,7 +946,7 @@ bool OutputHLSL::visitUnary(Visit visit, TIntermUnary *node) bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) { - EShLanguage language = mContext.language; + ShShaderType shaderType = mContext.shaderType; TInfoSinkBase &out = mBody; switch (node->getOp()) @@ -1288,7 +1288,7 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) case EOpVectorNotEqual: outputTriplet(visit, "(", " != ", ")"); break; case EOpMod: { - switch (node->getSequence()[0]->getAsTyped()->getSize()) // Number of components in the first argument + switch (node->getSequence()[0]->getAsTyped()->getNominalSize()) // Number of components in the first argument { case 1: mUsesMod1 = true; break; case 2: mUsesMod2 = true; break; @@ -1317,7 +1317,7 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node) case EOpCross: outputTriplet(visit, "cross(", ", ", ")"); break; case EOpFaceForward: { - switch (node->getSequence()[0]->getAsTyped()->getSize()) // Number of components in the first argument + switch (node->getSequence()[0]->getAsTyped()->getNominalSize()) // Number of components in the first argument { case 1: mUsesFaceforward1 = true; break; case 2: mUsesFaceforward2 = true; break; @@ -1553,7 +1553,7 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node) if (symbol && constant) { - if (constant->getBasicType() == EbtInt && constant->getSize() == 1) + if (constant->getBasicType() == EbtInt && constant->getNominalSize() == 1) { index = symbol; initial = constant->getUnionArrayPointer()[0].getIConst(); @@ -1575,7 +1575,7 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node) if (constant) { - if (constant->getBasicType() == EbtInt && constant->getSize() == 1) + if (constant->getBasicType() == EbtInt && constant->getNominalSize() == 1) { comparator = test->getOp(); limit = constant->getUnionArrayPointer()[0].getIConst(); @@ -1597,7 +1597,7 @@ bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node) if (constant) { - if (constant->getBasicType() == EbtInt && constant->getSize() == 1) + if (constant->getBasicType() == EbtInt && constant->getNominalSize() == 1) { int value = constant->getUnionArrayPointer()[0].getIConst(); @@ -1848,8 +1848,8 @@ void OutputHLSL::addConstructor(const TType &type, const TString &name, const TI TType ctorType = type; ctorType.clearArrayness(); - ctorType.changePrecision(EbpHigh); - ctorType.changeQualifier(EvqTemporary); + ctorType.setPrecision(EbpHigh); + ctorType.setQualifier(EvqTemporary); TString ctorName = type.getStruct() ? decorate(name) : name; diff --git a/gfx/angle/src/compiler/ParseHelper.cpp b/gfx/angle/src/compiler/ParseHelper.cpp index c52bcbbb7d0..574726a88ab 100644 --- a/gfx/angle/src/compiler/ParseHelper.cpp +++ b/gfx/angle/src/compiler/ParseHelper.cpp @@ -415,7 +415,7 @@ bool TParseContext::reservedErrorCheck(int line, const TString& identifier) error(line, reservedErrMsg, "gl_", ""); return true; } - if (spec == EShSpecWebGL) { + if (shaderSpec == SH_WEBGL_SPEC) { if (identifier.substr(0, 6) == TString("webgl_")) { error(line, reservedErrMsg, "webgl_", ""); return true; @@ -471,22 +471,23 @@ bool TParseContext::constructorErrorCheck(int line, TIntermNode* node, TFunction bool matrixInMatrix = false; bool arrayArg = false; for (int i = 0; i < function.getParamCount(); ++i) { - size += function[i].type->getObjectSize(); + const TParameter& param = function.getParam(i); + size += param.type->getObjectSize(); - if (constructingMatrix && function[i].type->isMatrix()) + if (constructingMatrix && param.type->isMatrix()) matrixInMatrix = true; if (full) overFull = true; if (op != EOpConstructStruct && !type->isArray() && size >= type->getObjectSize()) full = true; - if (function[i].type->getQualifier() != EvqConst) + if (param.type->getQualifier() != EvqConst) constType = false; - if (function[i].type->isArray()) + if (param.type->isArray()) arrayArg = true; } if (constType) - type->changeQualifier(EvqConst); + type->setQualifier(EvqConst); if (type->isArray() && type->getArraySize() != function.getParamCount()) { error(line, "array constructor needs one argument per array element", "constructor", ""); @@ -586,14 +587,14 @@ bool TParseContext::samplerErrorCheck(int line, const TPublicType& pType, const { if (pType.type == EbtStruct) { if (containsSampler(*pType.userDef)) { - error(line, reason, TType::getBasicString(pType.type), "(structure contains a sampler)"); + error(line, reason, getBasicString(pType.type), "(structure contains a sampler)"); return true; } return false; } else if (IsSampler(pType.type)) { - error(line, reason, TType::getBasicString(pType.type), ""); + error(line, reason, getBasicString(pType.type), ""); return true; } @@ -674,14 +675,11 @@ bool TParseContext::arraySizeErrorCheck(int line, TIntermTyped* expr, int& size) // bool TParseContext::arrayQualifierErrorCheck(int line, TPublicType type) { - if (type.qualifier == EvqAttribute) { + if ((type.qualifier == EvqAttribute) || (type.qualifier == EvqConst)) { error(line, "cannot declare arrays of this qualifier", TType(type).getCompleteString().c_str(), ""); return true; } - if (type.qualifier == EvqConst && extensionErrorCheck(line, "GL_3DL_array_objects")) - return true; - return false; } @@ -879,23 +877,29 @@ bool TParseContext::paramErrorCheck(int line, TQualifier qualifier, TQualifier p } if (qualifier == EvqConst) - type->changeQualifier(EvqConstReadOnly); + type->setQualifier(EvqConstReadOnly); else - type->changeQualifier(paramQualifier); + type->setQualifier(paramQualifier); return false; } -bool TParseContext::extensionErrorCheck(int line, const char* extension) -{ - if (extensionBehavior[extension] == EBhWarn) { - infoSink.info.message(EPrefixWarning, ("extension " + TString(extension) + " is being used").c_str(), line); - return false; - } - if (extensionBehavior[extension] == EBhDisable) { - error(line, "extension", extension, "is disabled"); +bool TParseContext::extensionErrorCheck(int line, const TString& extension) +{ + TExtensionBehavior::const_iterator iter = extensionBehavior.find(extension); + if (iter == extensionBehavior.end()) { + error(line, "extension", extension.c_str(), "is not supported"); return true; } + if (iter->second == EBhDisable) { + error(line, "extension", extension.c_str(), "is disabled"); + return true; + } + if (iter->second == EBhWarn) { + TString msg = "extension " + extension + " is being used"; + infoSink.info.message(EPrefixWarning, msg.c_str(), line); + return false; + } return false; } @@ -976,13 +980,13 @@ bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPu if (qualifier == EvqConst) { if (qualifier != initializer->getType().getQualifier()) { error(line, " assigning non-constant to", "=", "'%s'", variable->getType().getCompleteString().c_str()); - variable->getType().changeQualifier(EvqTemporary); + variable->getType().setQualifier(EvqTemporary); return true; } if (type != initializer->getType()) { error(line, " non-matching types for const initializer ", variable->getType().getQualifierString(), ""); - variable->getType().changeQualifier(EvqTemporary); + variable->getType().setQualifier(EvqTemporary); return true; } if (initializer->getAsConstantUnion()) { @@ -1001,7 +1005,7 @@ bool TParseContext::executeInitializer(TSourceLoc line, TString& identifier, TPu variable->shareConstPointer(constArray); } else { error(line, " cannot assign to", "=", "'%s'", variable->getType().getCompleteString().c_str()); - variable->getType().changeQualifier(EvqTemporary); + variable->getType().setQualifier(EvqTemporary); return true; } } @@ -1052,7 +1056,7 @@ TIntermTyped* TParseContext::addConstructor(TIntermNode* node, const TType* type TIntermAggregate* aggrNode = node->getAsAggregate(); - TTypeList::iterator memberTypes; + TTypeList::const_iterator memberTypes; if (op == EOpConstructStruct) memberTypes = type->getStruct()->begin(); @@ -1350,7 +1354,7 @@ TIntermTyped* TParseContext::addConstArrayNode(int index, TIntermTyped* node, TS // TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* node, TSourceLoc line) { - TTypeList* fields = node->getType().getStruct(); + const TTypeList* fields = node->getType().getStruct(); TIntermTyped *typedNode; int instanceSize = 0; unsigned int index = 0; @@ -1378,19 +1382,6 @@ TIntermTyped* TParseContext::addConstStruct(TString& identifier, TIntermTyped* n return typedNode; } -// -// Initialize all supported extensions to disable -// -void TParseContext::initializeExtensionBehavior() -{ - // - // example code: extensionBehavior["test"] = EBhDisable; // where "test" is the name of - // supported extension - // - extensionBehavior["GL_ARB_texture_rectangle"] = EBhRequire; - extensionBehavior["GL_3DL_array_objects"] = EBhDisable; -} - OS_TLSIndex GlobalParseContextIndex = OS_INVALID_TLS_INDEX; bool InitializeParseContextIndex() diff --git a/gfx/angle/src/compiler/ParseHelper.h b/gfx/angle/src/compiler/ParseHelper.h index 792333fdf07..cdc86761cb2 100644 --- a/gfx/angle/src/compiler/ParseHelper.h +++ b/gfx/angle/src/compiler/ParseHelper.h @@ -6,9 +6,10 @@ #ifndef _PARSER_HELPER_INCLUDED_ #define _PARSER_HELPER_INCLUDED_ +#include "compiler/ExtensionBehavior.h" +#include "compiler/localintermediate.h" #include "compiler/ShHandle.h" #include "compiler/SymbolTable.h" -#include "compiler/localintermediate.h" struct TMatrixFields { bool wholeRow; @@ -17,13 +18,6 @@ struct TMatrixFields { int col; }; -typedef enum { - EBhRequire, - EBhEnable, - EBhWarn, - EBhDisable -} TBehavior; - struct TPragma { TPragma(bool o, bool d) : optimize(o), debug(d) { } bool optimize; @@ -36,15 +30,16 @@ struct TPragma { // they can be passed to the parser without needing a global. // struct TParseContext { - TParseContext(TSymbolTable& symt, TIntermediate& interm, EShLanguage l, EShSpec s, TInfoSink& is) : - intermediate(interm), symbolTable(symt), infoSink(is), language(l), spec(s), treeRoot(0), + TParseContext(TSymbolTable& symt, const TExtensionBehavior& ext, TIntermediate& interm, ShShaderType type, ShShaderSpec spec, TInfoSink& is) : + intermediate(interm), symbolTable(symt), extensionBehavior(ext), infoSink(is), shaderType(type), shaderSpec(spec), treeRoot(0), recoveredFromError(false), numErrors(0), lexAfterType(false), loopNestingLevel(0), inTypeParen(false), contextPragma(true, false) { } TIntermediate& intermediate; // to hold and build a parse tree TSymbolTable& symbolTable; // symbol table that goes with the language currently being parsed + TExtensionBehavior extensionBehavior; // mapping between supported extensions and current behavior. TInfoSink& infoSink; - EShLanguage language; // vertex or fragment language (future: pack or unpack) - EShSpec spec; // The language specification compiler conforms to - GLES2 or WebGL. + ShShaderType shaderType; // vertex or fragment language (future: pack or unpack) + ShShaderSpec shaderSpec; // The language specification compiler conforms to - GLES2 or WebGL. TIntermNode* treeRoot; // root of parse tree being created bool recoveredFromError; // true if a parse error has occurred, but we continue to parse int numErrors; @@ -53,8 +48,6 @@ struct TParseContext { bool inTypeParen; // true if in parentheses, looking only for an identifier const TType* currentFunctionType; // the return type of the function that's currently being parsed bool functionReturnsValue; // true if a non-void function has a return - TMap extensionBehavior; - void initializeExtensionBehavior(); void error(TSourceLoc, const char *szReason, const char *szToken, const char *szExtraInfoFormat, ...); @@ -86,7 +79,7 @@ struct TParseContext { bool nonInitConstErrorCheck(int line, TString& identifier, TPublicType& type); bool nonInitErrorCheck(int line, TString& identifier, TPublicType& type); bool paramErrorCheck(int line, TQualifier qualifier, TQualifier paramQualifier, TType* type); - bool extensionErrorCheck(int line, const char*); + bool extensionErrorCheck(int line, const TString&); const TFunction* findFunction(int line, TFunction* pfnCall, bool *builtIn = 0); bool executeInitializer(TSourceLoc line, TString& identifier, TPublicType& pType, TIntermTyped* initializer, TIntermNode*& intermNode, TVariable* variable = 0); @@ -105,7 +98,7 @@ struct TParseContext { bool AfterEOF; }; -int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext&); +int PaParseStrings(const char* const argv[], const int strLen[], int argc, TParseContext&); void PaReservedWord(); int PaIdentOrType(TString& id, TParseContext&, TSymbol*&); int PaParseComment(int &lineno, TParseContext&); diff --git a/gfx/angle/src/compiler/ShHandle.h b/gfx/angle/src/compiler/ShHandle.h index 5ef5d30cf8b..e23f1a37544 100644 --- a/gfx/angle/src/compiler/ShHandle.h +++ b/gfx/angle/src/compiler/ShHandle.h @@ -16,11 +16,12 @@ #include "GLSLANG/ShaderLang.h" +#include "compiler/ExtensionBehavior.h" #include "compiler/InfoSink.h" #include "compiler/SymbolTable.h" +#include "compiler/VariableInfo.h" class TCompiler; -class TIntermNode; // // The base class used to back handles returned to the driver. @@ -38,27 +39,44 @@ public: // class TCompiler : public TShHandleBase { public: - TCompiler(EShLanguage l, EShSpec s) : language(l), spec(s) { } - virtual ~TCompiler() { } - - EShLanguage getLanguage() const { return language; } - EShSpec getSpec() const { return spec; } - TSymbolTable& getSymbolTable() { return symbolTable; } - TInfoSink& getInfoSink() { return infoSink; } - - virtual bool compile(TIntermNode* root) = 0; - + TCompiler(ShShaderType type, ShShaderSpec spec); + virtual ~TCompiler(); virtual TCompiler* getAsCompiler() { return this; } + bool Init(const ShBuiltInResources& resources); + bool compile(const char* const shaderStrings[], + const int numStrings, + int compileOptions); + + // Get results of the last compilation. + TInfoSink& getInfoSink() { return infoSink; } + const TVariableInfoList& getAttribs() const { return attribs; } + const TVariableInfoList& getUniforms() const { return uniforms; } + protected: - EShLanguage language; - EShSpec spec; + // Initialize symbol-table with built-in symbols. + bool InitBuiltInSymbolTable(const ShBuiltInResources& resources); + // Clears the results from the previous compilation. + void clearResults(); + // Collect info for all attribs and uniforms. + void collectAttribsUniforms(TIntermNode* root); + // Translate to object code. + virtual void translate(TIntermNode* root) = 0; + +private: + ShShaderType shaderType; + ShShaderSpec shaderSpec; // Built-in symbol table for the given language, spec, and resources. // It is preserved from compile-to-compile. TSymbolTable symbolTable; - // Output sink. - TInfoSink infoSink; + // Built-in extensions with default behavior. + TExtensionBehavior extensionBehavior; + + // Results of compilation. + TInfoSink infoSink; // Output sink. + TVariableInfoList attribs; // Active attributes in the compiled shader. + TVariableInfoList uniforms; // Active uniforms in the compiled shader. }; // @@ -70,7 +88,7 @@ protected: // destroy the machine dependent objects, which contain the // above machine independent information. // -TCompiler* ConstructCompiler(EShLanguage, EShSpec); +TCompiler* ConstructCompiler(ShShaderType type, ShShaderSpec spec); void DeleteCompiler(TCompiler*); #endif // _SHHANDLE_INCLUDED_ diff --git a/gfx/angle/src/compiler/ShaderLang.cpp b/gfx/angle/src/compiler/ShaderLang.cpp index 865be18ffbe..c5eaf30071f 100644 --- a/gfx/angle/src/compiler/ShaderLang.cpp +++ b/gfx/angle/src/compiler/ShaderLang.cpp @@ -11,79 +11,56 @@ #include "GLSLANG/ShaderLang.h" -#include "compiler/Initialize.h" #include "compiler/InitializeDll.h" -#include "compiler/ParseHelper.h" #include "compiler/ShHandle.h" -#include "compiler/SymbolTable.h" - -static bool InitializeSymbolTable( - const TBuiltInStrings& builtInStrings, - EShLanguage language, EShSpec spec, const TBuiltInResource& resources, - TInfoSink& infoSink, TSymbolTable& symbolTable) -{ - TIntermediate intermediate(infoSink); - TParseContext parseContext(symbolTable, intermediate, language, spec, infoSink); - - GlobalParseContext = &parseContext; - - setInitialState(); - - assert(symbolTable.isEmpty()); - // - // Parse the built-ins. This should only happen once per - // language symbol table. - // - // Push the symbol table to give it an initial scope. This - // push should not have a corresponding pop, so that built-ins - // are preserved, and the test for an empty table fails. - // - symbolTable.push(); - - //Initialize the Preprocessor - if (InitPreprocessor()) - { - infoSink.info.message(EPrefixInternalError, "Unable to intialize the Preprocessor"); - return false; - } - - for (TBuiltInStrings::const_iterator i = builtInStrings.begin(); i != builtInStrings.end(); ++i) - { - const char* builtInShaders[1]; - int builtInLengths[1]; - - builtInShaders[0] = (*i).c_str(); - builtInLengths[0] = (int) (*i).size(); - - if (PaParseStrings(const_cast(builtInShaders), builtInLengths, 1, parseContext) != 0) - { - infoSink.info.message(EPrefixInternalError, "Unable to parse built-ins"); - return false; - } - } - - IdentifyBuiltIns(language, spec, resources, symbolTable); - - FinalizePreprocessor(); - - return true; -} - -static bool GenerateBuiltInSymbolTable( - EShLanguage language, EShSpec spec, const TBuiltInResource& resources, - TInfoSink& infoSink, TSymbolTable& symbolTable) -{ - TBuiltIns builtIns; - - builtIns.initialize(language, spec, resources); - return InitializeSymbolTable(builtIns.getBuiltInStrings(), language, spec, resources, infoSink, symbolTable); -} // // This is the platform independent interface between an OGL driver // and the shading language compiler. // +static int getVariableMaxLength(const TVariableInfoList& varList) +{ + TString::size_type maxLen = 0; + for (TVariableInfoList::const_iterator i = varList.begin(); + i != varList.end(); ++i) + { + maxLen = std::max(maxLen, i->name.size()); + } + // Add 1 to include null-termination character. + return static_cast(maxLen) + 1; +} + +static void getVariableInfo(ShShaderInfo varType, + const ShHandle handle, + int index, + int* length, + int* size, + ShDataType* type, + char* name) +{ + if (!handle || !size || !type || !name) + return; + ASSERT((varType == SH_ACTIVE_ATTRIBUTES) || + (varType == SH_ACTIVE_UNIFORMS)); + + TShHandleBase* base = reinterpret_cast(handle); + TCompiler* compiler = base->getAsCompiler(); + if (compiler == 0) + return; + + const TVariableInfoList& varList = varType == SH_ACTIVE_ATTRIBUTES ? + compiler->getAttribs() : compiler->getUniforms(); + if (index < 0 || index >= static_cast(varList.size())) + return; + + const TVariableInfo& varInfo = varList[index]; + if (length) *length = varInfo.name.size(); + *size = varInfo.size; + *type = varInfo.type; + strcpy(name, varInfo.name.c_str()); +} + // // Driver must call this first, once, before doing any other // compiler operations. @@ -96,22 +73,52 @@ int ShInitialize() return 1; } +// +// Cleanup symbol tables +// +int ShFinalize() +{ + if (!DetachProcess()) + return 0; + + return 1; +} + +// +// Initialize built-in resources with minimum expected values. +// +void ShInitBuiltInResources(ShBuiltInResources* resources) +{ + // Constants. + resources->MaxVertexAttribs = 8; + resources->MaxVertexUniformVectors = 128; + resources->MaxVaryingVectors = 8; + resources->MaxVertexTextureImageUnits = 0; + resources->MaxCombinedTextureImageUnits = 8; + resources->MaxTextureImageUnits = 8; + resources->MaxFragmentUniformVectors = 16; + resources->MaxDrawBuffers = 1; + + // Extensions. + resources->OES_standard_derivatives = 0; +} + // // Driver calls these to create and destroy compiler objects. // - -ShHandle ShConstructCompiler(EShLanguage language, EShSpec spec, const TBuiltInResource* resources) +ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec, + const ShBuiltInResources* resources) { if (!InitThread()) return 0; - TShHandleBase* base = static_cast(ConstructCompiler(language, spec)); + TShHandleBase* base = static_cast(ConstructCompiler(type, spec)); TCompiler* compiler = base->getAsCompiler(); if (compiler == 0) return 0; // Generate built-in symbol table. - if (!GenerateBuiltInSymbolTable(language, spec, *resources, compiler->getInfoSink(), compiler->getSymbolTable())) { + if (!compiler->Init(*resources)) { ShDestruct(base); return 0; } @@ -130,17 +137,6 @@ void ShDestruct(ShHandle handle) DeleteCompiler(base->getAsCompiler()); } -// -// Cleanup symbol tables -// -int ShFinalize() -{ - if (!DetachProcess()) - return 0; - - return 1; -} - // // Do an actual compile on the given strings. The result is left // in the given compile object. @@ -152,9 +148,7 @@ int ShCompile( const ShHandle handle, const char* const shaderStrings[], const int numStrings, - const EShOptimizationLevel optLevel, - int debugOptions - ) + int compileOptions) { if (!InitThread()) return 0; @@ -166,83 +160,11 @@ int ShCompile( TCompiler* compiler = base->getAsCompiler(); if (compiler == 0) return 0; - + GlobalPoolAllocator.push(); - TInfoSink& infoSink = compiler->getInfoSink(); - infoSink.info.erase(); - infoSink.debug.erase(); - infoSink.obj.erase(); - if (numStrings == 0) - return 1; + bool success = compiler->compile(shaderStrings, numStrings, compileOptions); - TIntermediate intermediate(infoSink); - TSymbolTable& symbolTable = compiler->getSymbolTable(); - - TParseContext parseContext(symbolTable, intermediate, compiler->getLanguage(), compiler->getSpec(), infoSink); - parseContext.initializeExtensionBehavior(); - GlobalParseContext = &parseContext; - - setInitialState(); - - InitPreprocessor(); - // - // Parse the application's shaders. All the following symbol table - // work will be throw-away, so push a new allocation scope that can - // be thrown away, then push a scope for the current shader's globals. - // - bool success = true; - - symbolTable.push(); - if (!symbolTable.atGlobalLevel()) - parseContext.infoSink.info.message(EPrefixInternalError, "Wrong symbol table level"); - - int ret = PaParseStrings(const_cast(shaderStrings), 0, numStrings, parseContext); - if (ret) - success = false; - - if (success && parseContext.treeRoot) { - if (optLevel == EShOptNoGeneration) - parseContext.infoSink.info.message(EPrefixNone, "No errors. No code generation was requested."); - else { - success = intermediate.postProcess(parseContext.treeRoot, parseContext.language); - - if (success) { - - if (debugOptions & EDebugOpIntermediate) - intermediate.outputTree(parseContext.treeRoot); - - // - // Call the machine dependent compiler - // - if (!compiler->compile(parseContext.treeRoot)) - success = false; - } - } - } else if (!success) { - parseContext.infoSink.info.prefix(EPrefixError); - parseContext.infoSink.info << parseContext.numErrors << " compilation errors. No code generated.\n\n"; - success = false; - if (debugOptions & EDebugOpIntermediate) - intermediate.outputTree(parseContext.treeRoot); - } else if (!parseContext.treeRoot) { - parseContext.error(1, "Unexpected end of file.", "", ""); - parseContext.infoSink.info << parseContext.numErrors << " compilation errors. No code generated.\n\n"; - success = false; - if (debugOptions & EDebugOpIntermediate) - intermediate.outputTree(parseContext.treeRoot); - } - - intermediate.remove(parseContext.treeRoot); - - // - // Ensure symbol table is returned to the built-in level, - // throwing away all but the built-ins. - // - while (!symbolTable.atBuiltInLevel()) - symbolTable.pop(); - - FinalizePreprocessor(); // // Throw away all the temporary memory used by the compilation process. // @@ -251,43 +173,91 @@ int ShCompile( return success ? 1 : 0; } +void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params) +{ + if (!handle || !params) + return; + + TShHandleBase* base = static_cast(handle); + TCompiler* compiler = base->getAsCompiler(); + if (!compiler) return; + + switch(pname) + { + case SH_INFO_LOG_LENGTH: + *params = compiler->getInfoSink().info.size() + 1; + break; + case SH_OBJECT_CODE_LENGTH: + *params = compiler->getInfoSink().obj.size() + 1; + break; + case SH_ACTIVE_UNIFORMS: + *params = compiler->getUniforms().size(); + break; + case SH_ACTIVE_UNIFORM_MAX_LENGTH: + *params = getVariableMaxLength(compiler->getUniforms()); + break; + case SH_ACTIVE_ATTRIBUTES: + *params = compiler->getAttribs().size(); + break; + case SH_ACTIVE_ATTRIBUTE_MAX_LENGTH: + *params = getVariableMaxLength(compiler->getAttribs()); + break; + + default: UNREACHABLE(); + } +} + // // Return any compiler log of messages for the application. // -const char* ShGetInfoLog(const ShHandle handle) +void ShGetInfoLog(const ShHandle handle, char* infoLog) { - if (!InitThread()) - return 0; - - if (handle == 0) - return 0; + if (!handle || !infoLog) + return; TShHandleBase* base = static_cast(handle); - TInfoSink* infoSink = 0; + TCompiler* compiler = base->getAsCompiler(); + if (!compiler) return; - if (base->getAsCompiler()) - infoSink = &(base->getAsCompiler()->getInfoSink()); - - infoSink->info << infoSink->debug.c_str(); - return infoSink->info.c_str(); + TInfoSink& infoSink = compiler->getInfoSink(); + strcpy(infoLog, infoSink.info.c_str()); } // // Return any object code. // -const char* ShGetObjectCode(const ShHandle handle) +void ShGetObjectCode(const ShHandle handle, char* objCode) { - if (!InitThread()) - return 0; - - if (handle == 0) - return 0; + if (!handle || !objCode) + return; TShHandleBase* base = static_cast(handle); - TInfoSink* infoSink; + TCompiler* compiler = base->getAsCompiler(); + if (!compiler) return; - if (base->getAsCompiler()) - infoSink = &(base->getAsCompiler()->getInfoSink()); - - return infoSink->obj.c_str(); + TInfoSink& infoSink = compiler->getInfoSink(); + strcpy(objCode, infoSink.obj.c_str()); } + +void ShGetActiveAttrib(const ShHandle handle, + int index, + int* length, + int* size, + ShDataType* type, + char* name) +{ + getVariableInfo(SH_ACTIVE_ATTRIBUTES, + handle, index, length, size, type, name); +} + +void ShGetActiveUniform(const ShHandle handle, + int index, + int* length, + int* size, + ShDataType* type, + char* name) +{ + getVariableInfo(SH_ACTIVE_UNIFORMS, + handle, index, length, size, type, name); +} + diff --git a/gfx/angle/src/compiler/SymbolTable.cpp b/gfx/angle/src/compiler/SymbolTable.cpp index d97f0eccbb5..02817d44716 100644 --- a/gfx/angle/src/compiler/SymbolTable.cpp +++ b/gfx/angle/src/compiler/SymbolTable.cpp @@ -65,7 +65,7 @@ int TType::getStructSize() const } if (structureSize == 0) - for (TTypeList::iterator tl = getStruct()->begin(); tl != getStruct()->end(); tl++) + for (TTypeList::const_iterator tl = getStruct()->begin(); tl != getStruct()->end(); tl++) structureSize += ((*tl).type)->getObjectSize(); return structureSize; @@ -140,6 +140,22 @@ void TSymbolTableLevel::relateToOperator(const char* name, TOperator op) } } +// +// Change all function entries in the table with the non-mangled name +// to be related to the provided built-in extension. This is a low +// performance operation, and only intended for symbol tables that +// live across a large number of compiles. +// +void TSymbolTableLevel::relateToExtension(const char* name, const TString& ext) +{ + for (tLevel::iterator it = level.begin(); it != level.end(); ++it) { + if (it->second->isFunction()) { + TFunction* function = static_cast(it->second); + if (function->getName() == name) + function->relateToExtension(ext); + } + } +} TSymbol::TSymbol(const TSymbol& copyOf) { diff --git a/gfx/angle/src/compiler/SymbolTable.h b/gfx/angle/src/compiler/SymbolTable.h index 07c81d15c2b..42cf736ba33 100644 --- a/gfx/angle/src/compiler/SymbolTable.h +++ b/gfx/angle/src/compiler/SymbolTable.h @@ -76,7 +76,7 @@ public: TType& getType() { return type; } const TType& getType() const { return type; } bool isUserType() const { return userType; } - void changeQualifier(TQualifier qualifier) { type.changeQualifier(qualifier); } + void setQualifier(TQualifier qualifier) { type.setQualifier(qualifier); } void updateArrayInformationType(TType *t) { arrayInformationType = t; } TType* getArrayInformationType() { return arrayInformationType; } @@ -156,14 +156,18 @@ public: const TString& getMangledName() const { return mangledName; } const TType& getReturnType() const { return returnType; } + void relateToOperator(TOperator o) { op = o; } TOperator getBuiltInOp() const { return op; } + + void relateToExtension(const TString& ext) { extension = ext; } + const TString& getExtension() const { return extension; } + void setDefined() { defined = true; } bool isDefined() { return defined; } - int getParamCount() const { return static_cast(parameters.size()); } - TParameter& operator [](int i) { return parameters[i]; } - const TParameter& operator [](int i) const { return parameters[i]; } + int getParamCount() const { return static_cast(parameters.size()); } + const TParameter& getParam(int i) const { return parameters[i]; } virtual void dump(TInfoSink &infoSink) const; TFunction(const TFunction&, TStructureMap& remapper); @@ -175,6 +179,7 @@ protected: TType returnType; TString mangledName; TOperator op; + TString extension; bool defined; }; @@ -221,6 +226,7 @@ public: } void relateToOperator(const char* name, TOperator op); + void relateToExtension(const char* name, const TString& ext); void dump(TInfoSink &infoSink) const; TSymbolTableLevel* clone(TStructureMap& remapper); @@ -289,8 +295,16 @@ public: return symbol; } - TSymbolTableLevel* getGlobalLevel() { assert(table.size() >= 2); return table[1]; } - void relateToOperator(const char* name, TOperator op) { table[0]->relateToOperator(name, op); } + TSymbolTableLevel* getGlobalLevel() { + assert(table.size() >= 2); + return table[1]; + } + void relateToOperator(const char* name, TOperator op) { + table[0]->relateToOperator(name, op); + } + void relateToExtension(const char* name, const TString& ext) { + table[0]->relateToExtension(name, ext); + } int getMaxSymbolId() { return uniqueId; } void dump(TInfoSink &infoSink) const; void copyTable(const TSymbolTable& copyOf); diff --git a/gfx/angle/src/compiler/TranslatorGLSL.cpp b/gfx/angle/src/compiler/TranslatorGLSL.cpp index 7b8d9036d89..2453334f0b3 100644 --- a/gfx/angle/src/compiler/TranslatorGLSL.cpp +++ b/gfx/angle/src/compiler/TranslatorGLSL.cpp @@ -8,13 +8,11 @@ #include "compiler/OutputGLSL.h" -TranslatorGLSL::TranslatorGLSL(EShLanguage lang, EShSpec spec) - : TCompiler(lang, spec) { +TranslatorGLSL::TranslatorGLSL(ShShaderType type, ShShaderSpec spec) + : TCompiler(type, spec) { } -bool TranslatorGLSL::compile(TIntermNode* root) { - TOutputGLSL outputGLSL(infoSink.obj); +void TranslatorGLSL::translate(TIntermNode* root) { + TOutputGLSL outputGLSL(getInfoSink().obj); root->traverse(&outputGLSL); - - return true; } diff --git a/gfx/angle/src/compiler/TranslatorGLSL.h b/gfx/angle/src/compiler/TranslatorGLSL.h index 973e39a459f..c2ce06d192f 100644 --- a/gfx/angle/src/compiler/TranslatorGLSL.h +++ b/gfx/angle/src/compiler/TranslatorGLSL.h @@ -11,8 +11,10 @@ class TranslatorGLSL : public TCompiler { public: - TranslatorGLSL(EShLanguage lang, EShSpec spec); - virtual bool compile(TIntermNode* root); + TranslatorGLSL(ShShaderType type, ShShaderSpec spec); + +protected: + virtual void translate(TIntermNode* root); }; #endif // COMPILER_TRANSLATORGLSL_H_ diff --git a/gfx/angle/src/compiler/TranslatorHLSL.cpp b/gfx/angle/src/compiler/TranslatorHLSL.cpp index 3a1e52d4b01..96d7f1077f7 100644 --- a/gfx/angle/src/compiler/TranslatorHLSL.cpp +++ b/gfx/angle/src/compiler/TranslatorHLSL.cpp @@ -8,17 +8,15 @@ #include "compiler/OutputHLSL.h" -TranslatorHLSL::TranslatorHLSL(EShLanguage lang, EShSpec spec) - : TCompiler(lang, spec) +TranslatorHLSL::TranslatorHLSL(ShShaderType type, ShShaderSpec spec) + : TCompiler(type, spec) { } -bool TranslatorHLSL::compile(TIntermNode *root) +void TranslatorHLSL::translate(TIntermNode *root) { TParseContext& parseContext = *GetGlobalParseContext(); sh::OutputHLSL outputHLSL(parseContext); outputHLSL.output(); - - return true; } diff --git a/gfx/angle/src/compiler/TranslatorHLSL.h b/gfx/angle/src/compiler/TranslatorHLSL.h index 38a5f0cedab..c3f672ba919 100644 --- a/gfx/angle/src/compiler/TranslatorHLSL.h +++ b/gfx/angle/src/compiler/TranslatorHLSL.h @@ -11,8 +11,10 @@ class TranslatorHLSL : public TCompiler { public: - TranslatorHLSL(EShLanguage lang, EShSpec spec); - virtual bool compile(TIntermNode* root); + TranslatorHLSL(ShShaderType type, ShShaderSpec spec); + +protected: + virtual void translate(TIntermNode* root); }; #endif // COMPILER_TRANSLATORHLSL_H_ diff --git a/gfx/angle/src/compiler/Types.h b/gfx/angle/src/compiler/Types.h index 44511b49df6..897b28ffe8c 100644 --- a/gfx/angle/src/compiler/Types.h +++ b/gfx/angle/src/compiler/Types.h @@ -82,28 +82,27 @@ typedef TMap::iterator TStructureMapIterator; class TType { public: POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator) - explicit TType(TBasicType t, TPrecision p, TQualifier q = EvqTemporary, int s = 1, bool m = false, bool a = false) : - type(t), precision(p), qualifier(q), size(s), matrix(m), array(a), arraySize(0), - structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0), typeName(0) - { } + TType() {} + TType(TBasicType t, TPrecision p, TQualifier q = EvqTemporary, int s = 1, bool m = false, bool a = false) : + type(t), precision(p), qualifier(q), size(s), matrix(m), array(a), arraySize(0), + structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0), typeName(0) + { + } explicit TType(const TPublicType &p) : - type(p.type), precision(p.precision), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(p.arraySize), - structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0), typeName(0) - { - if (p.userDef) { - structure = p.userDef->getStruct(); - typeName = NewPoolTString(p.userDef->getTypeName().c_str()); - } - } - explicit TType(TTypeList* userDef, const TString& n, TPrecision p = EbpUndefined) : - type(EbtStruct), precision(p), qualifier(EvqTemporary), size(1), matrix(false), array(false), arraySize(0), - structure(userDef), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0) { - typeName = NewPoolTString(n.c_str()); - } - explicit TType() {} - virtual ~TType() {} - - TType(const TType& type) { *this = type; } + type(p.type), precision(p.precision), qualifier(p.qualifier), size(p.size), matrix(p.matrix), array(p.array), arraySize(p.arraySize), + structure(0), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0), typeName(0) + { + if (p.userDef) { + structure = p.userDef->getStruct(); + typeName = NewPoolTString(p.userDef->getTypeName().c_str()); + } + } + TType(TTypeList* userDef, const TString& n, TPrecision p = EbpUndefined) : + type(EbtStruct), precision(p), qualifier(EvqTemporary), size(1), matrix(false), array(false), arraySize(0), + structure(userDef), structureSize(0), maxArraySize(0), arrayInformationType(0), fieldName(0), mangled(0) + { + typeName = NewPoolTString(n.c_str()); + } void copyType(const TType& copyOf, TStructureMap& remapper) { @@ -157,77 +156,19 @@ public: return newType; } - virtual void setType(TBasicType t, int s, bool m, bool a, int aS = 0) - { type = t; size = s; matrix = m; array = a; arraySize = aS; } - virtual void setType(TBasicType t, int s, bool m, TType* userDef = 0) - { type = t; - size = s; - matrix = m; - if (userDef) - structure = userDef->getStruct(); - // leave array information intact. - } - virtual void setTypeName(const TString& n) { typeName = NewPoolTString(n.c_str()); } - virtual void setFieldName(const TString& n) { fieldName = NewPoolTString(n.c_str()); } - virtual const TString& getTypeName() const - { - assert(typeName); - return *typeName; - } + TBasicType getBasicType() const { return type; } + void setBasicType(TBasicType t) { type = t; } - virtual const TString& getFieldName() const - { - assert(fieldName); - return *fieldName; - } + TPrecision getPrecision() const { return precision; } + void setPrecision(TPrecision p) { precision = p; } - virtual TBasicType getBasicType() const { return type; } - virtual TPrecision getPrecision() const { return precision; } - virtual TQualifier getQualifier() const { return qualifier; } - virtual void changePrecision(TPrecision p) { precision = p; } - virtual void changeQualifier(TQualifier q) { qualifier = q; } + TQualifier getQualifier() const { return qualifier; } + void setQualifier(TQualifier q) { qualifier = q; } // One-dimensional size of single instance type - virtual int getNominalSize() const { return size; } - - // Full-dimensional size of single instance of type - virtual int getInstanceSize() const - { - if (matrix) - return size * size; - else - return size; - } - - virtual bool isMatrix() const { return matrix ? true : false; } - virtual bool isArray() const { return array ? true : false; } - bool isField() const { return fieldName != 0; } - int getArraySize() const { return arraySize; } - void setArraySize(int s) { array = true; arraySize = s; } - void setMaxArraySize (int s) { maxArraySize = s; } - int getMaxArraySize () const { return maxArraySize; } - void clearArrayness() { array = false; arraySize = 0; maxArraySize = 0; } - void setArrayInformationType(TType* t) { arrayInformationType = t; } - TType* getArrayInformationType() const { return arrayInformationType; } - virtual bool isVector() const { return size > 1 && !matrix; } - virtual bool isScalar() const { return size == 1 && !matrix && !structure; } - static const char* getBasicString(TBasicType t) { - switch (t) { - case EbtVoid: return "void"; break; - case EbtFloat: return "float"; break; - case EbtInt: return "int"; break; - case EbtBool: return "bool"; break; - case EbtSampler2D: return "sampler2D"; break; - case EbtSamplerCube: return "samplerCube"; break; - case EbtStruct: return "structure"; break; - default: return "unknown type"; - } - } - const char* getBasicString() const { return TType::getBasicString(type); } - const char* getPrecisionString() const { return ::getPrecisionString(precision); } - const char* getQualifierString() const { return ::getQualifierString(qualifier); } - TTypeList* getStruct() { return structure; } - + int getNominalSize() const { return size; } + void setNominalSize(int s) { size = s; } + // Full size of single instance of type int getObjectSize() const { int totalSize; @@ -245,7 +186,45 @@ public: return totalSize; } + bool isMatrix() const { return matrix ? true : false; } + void setMatrix(bool m) { matrix = m; } + + bool isArray() const { return array ? true : false; } + int getArraySize() const { return arraySize; } + void setArraySize(int s) { array = true; arraySize = s; } + int getMaxArraySize () const { return maxArraySize; } + void setMaxArraySize (int s) { maxArraySize = s; } + void clearArrayness() { array = false; arraySize = 0; maxArraySize = 0; } + void setArrayInformationType(TType* t) { arrayInformationType = t; } + TType* getArrayInformationType() const { return arrayInformationType; } + + bool isVector() const { return size > 1 && !matrix; } + bool isScalar() const { return size == 1 && !matrix && !structure; } + TTypeList* getStruct() const { return structure; } + void setStruct(TTypeList* s) { structure = s; } + + const TString& getTypeName() const + { + assert(typeName); + return *typeName; + } + void setTypeName(const TString& n) + { + typeName = NewPoolTString(n.c_str()); + } + + bool isField() const { return fieldName != 0; } + const TString& getFieldName() const + { + assert(fieldName); + return *fieldName; + } + void setFieldName(const TString& n) + { + fieldName = NewPoolTString(n.c_str()); + } + TString& getMangledName() { if (!mangled) { mangled = NewPoolTString(""); @@ -255,6 +234,7 @@ public: return *mangled; } + bool sameElementType(const TType& right) const { return type == right.type && size == right.size && @@ -282,6 +262,10 @@ public: return false; } + + const char* getBasicString() const { return ::getBasicString(type); } + const char* getPrecisionString() const { return ::getPrecisionString(precision); } + const char* getQualifierString() const { return ::getQualifierString(qualifier); } TString getCompleteString() const; protected: @@ -295,11 +279,12 @@ protected: unsigned int matrix : 1; unsigned int array : 1; int arraySize; + int maxArraySize; + TType* arrayInformationType; TTypeList* structure; // 0 unless this is a struct mutable int structureSize; - int maxArraySize; - TType* arrayInformationType; + TString *fieldName; // for structure field names TString *mangled; TString *typeName; // for structure field type name diff --git a/gfx/angle/src/compiler/VariableInfo.cpp b/gfx/angle/src/compiler/VariableInfo.cpp new file mode 100644 index 00000000000..ad2e08f303d --- /dev/null +++ b/gfx/angle/src/compiler/VariableInfo.cpp @@ -0,0 +1,210 @@ +// +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +#include "compiler/VariableInfo.h" + +static TString arrayBrackets(int index) +{ + TStringStream stream; + stream << "[" << index << "]"; + return stream.str(); +} + +// Returns the data type for an attribute or uniform. +static ShDataType getVariableDataType(const TType& type) +{ + switch (type.getBasicType()) { + case EbtFloat: + if (type.isMatrix()) { + switch (type.getNominalSize()) { + case 2: return SH_FLOAT_MAT2; + case 3: return SH_FLOAT_MAT3; + case 4: return SH_FLOAT_MAT4; + default: UNREACHABLE(); + } + } else if (type.isVector()) { + switch (type.getNominalSize()) { + case 2: return SH_FLOAT_VEC2; + case 3: return SH_FLOAT_VEC3; + case 4: return SH_FLOAT_VEC4; + default: UNREACHABLE(); + } + } else { + return SH_FLOAT; + } + case EbtInt: + if (type.isMatrix()) { + UNREACHABLE(); + } else if (type.isVector()) { + switch (type.getNominalSize()) { + case 2: return SH_INT_VEC2; + case 3: return SH_INT_VEC3; + case 4: return SH_INT_VEC4; + default: UNREACHABLE(); + } + } else { + return SH_INT; + } + case EbtBool: + if (type.isMatrix()) { + UNREACHABLE(); + } else if (type.isVector()) { + switch (type.getNominalSize()) { + case 2: return SH_BOOL_VEC2; + case 3: return SH_BOOL_VEC3; + case 4: return SH_BOOL_VEC4; + default: UNREACHABLE(); + } + } else { + return SH_BOOL; + } + case EbtSampler2D: return SH_SAMPLER_2D; + case EbtSamplerCube: return SH_SAMPLER_CUBE; + default: UNREACHABLE(); + } + return SH_NONE; +} + +static void getBuiltInVariableInfo(const TType& type, + const TString& name, + TVariableInfoList& infoList); +static void getUserDefinedVariableInfo(const TType& type, + const TString& name, + TVariableInfoList& infoList); + +// Returns info for an attribute or uniform. +static void getVariableInfo(const TType& type, + const TString& name, + TVariableInfoList& infoList) +{ + if (type.getBasicType() == EbtStruct) { + if (type.isArray()) { + for (int i = 0; i < type.getArraySize(); ++i) { + TString lname = name + arrayBrackets(i); + getUserDefinedVariableInfo(type, lname, infoList); + } + } else { + getUserDefinedVariableInfo(type, name, infoList); + } + } else { + getBuiltInVariableInfo(type, name, infoList); + } +} + +void getBuiltInVariableInfo(const TType& type, + const TString& name, + TVariableInfoList& infoList) +{ + ASSERT(type.getBasicType() != EbtStruct); + + TVariableInfo varInfo; + if (type.isArray()) { + varInfo.name = (name + "[0]").c_str(); + varInfo.size = type.getArraySize(); + } else { + varInfo.name = name.c_str(); + varInfo.size = 1; + } + varInfo.type = getVariableDataType(type); + infoList.push_back(varInfo); +} + +void getUserDefinedVariableInfo(const TType& type, + const TString& name, + TVariableInfoList& infoList) +{ + ASSERT(type.getBasicType() == EbtStruct); + + TString lname = name + "."; + const TTypeList* structure = type.getStruct(); + for (size_t i = 0; i < structure->size(); ++i) { + const TType* fieldType = (*structure)[i].type; + getVariableInfo(*fieldType, + lname + fieldType->getFieldName(), + infoList); + } +} + +CollectAttribsUniforms::CollectAttribsUniforms(TVariableInfoList& attribs, + TVariableInfoList& uniforms) + : mAttribs(attribs), + mUniforms(uniforms) +{ +} + +// We are only interested in attribute and uniform variable declaration. +void CollectAttribsUniforms::visitSymbol(TIntermSymbol*) +{ +} + +void CollectAttribsUniforms::visitConstantUnion(TIntermConstantUnion*) +{ +} + +bool CollectAttribsUniforms::visitBinary(Visit, TIntermBinary*) +{ + return false; +} + +bool CollectAttribsUniforms::visitUnary(Visit, TIntermUnary*) +{ + return false; +} + +bool CollectAttribsUniforms::visitSelection(Visit, TIntermSelection*) +{ + return false; +} + +bool CollectAttribsUniforms::visitAggregate(Visit, TIntermAggregate* node) +{ + bool visitChildren = false; + + switch (node->getOp()) + { + case EOpSequence: + // We need to visit sequence children to get to variable declarations. + visitChildren = true; + break; + case EOpDeclaration: { + const TIntermSequence& sequence = node->getSequence(); + TQualifier qualifier = sequence.front()->getAsTyped()->getQualifier(); + if (qualifier == EvqAttribute || qualifier == EvqUniform) + { + TVariableInfoList& infoList = qualifier == EvqAttribute ? + mAttribs : mUniforms; + for (TIntermSequence::const_iterator i = sequence.begin(); + i != sequence.end(); ++i) + { + const TIntermSymbol* variable = (*i)->getAsSymbolNode(); + // The only case in which the sequence will not contain a + // TIntermSymbol node is initialization. It will contain a + // TInterBinary node in that case. Since attributes and unifroms + // cannot be initialized in a shader, we must have only + // TIntermSymbol nodes in the sequence. + ASSERT(variable != NULL); + getVariableInfo(variable->getType(), variable->getSymbol(), + infoList); + } + } + break; + } + default: break; + } + + return visitChildren; +} + +bool CollectAttribsUniforms::visitLoop(Visit, TIntermLoop*) +{ + return false; +} + +bool CollectAttribsUniforms::visitBranch(Visit, TIntermBranch*) +{ + return false; +} + diff --git a/gfx/angle/src/compiler/VariableInfo.h b/gfx/angle/src/compiler/VariableInfo.h new file mode 100644 index 00000000000..15a5c572eaf --- /dev/null +++ b/gfx/angle/src/compiler/VariableInfo.h @@ -0,0 +1,38 @@ +// +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +#include "GLSLANG/ShaderLang.h" +#include "compiler/intermediate.h" + +// Provides information about a variable. +// It is currently being used to store info about active attribs and uniforms. +struct TVariableInfo { + TPersistString name; + ShDataType type; + int size; +}; +typedef std::vector TVariableInfoList; + +// Traverses intermediate tree to collect all attributes and uniforms. +class CollectAttribsUniforms : public TIntermTraverser { +public: + CollectAttribsUniforms(TVariableInfoList& attribs, + TVariableInfoList& uniforms); + + virtual void visitSymbol(TIntermSymbol*); + virtual void visitConstantUnion(TIntermConstantUnion*); + virtual bool visitBinary(Visit, TIntermBinary*); + virtual bool visitUnary(Visit, TIntermUnary*); + virtual bool visitSelection(Visit, TIntermSelection*); + virtual bool visitAggregate(Visit, TIntermAggregate*); + virtual bool visitLoop(Visit, TIntermLoop*); + virtual bool visitBranch(Visit, TIntermBranch*); + +private: + TVariableInfoList& mAttribs; + TVariableInfoList& mUniforms; +}; + diff --git a/gfx/angle/src/compiler/glslang.l b/gfx/angle/src/compiler/glslang.l index 02c226f8f51..6f98688872d 100644 --- a/gfx/angle/src/compiler/glslang.l +++ b/gfx/angle/src/compiler/glslang.l @@ -274,7 +274,7 @@ int yy_input(char* buf, int max_size) // // Returns 0 for success, as per yyparse(). // -int PaParseStrings(char* argv[], int strLen[], int argc, TParseContext& parseContextLocal) +int PaParseStrings(const char* const argv[], const int strLen[], int argc, TParseContext& parseContextLocal) { int argv0len; diff --git a/gfx/angle/src/compiler/glslang.y b/gfx/angle/src/compiler/glslang.y index f0ae4c99725..d0370d74806 100644 --- a/gfx/angle/src/compiler/glslang.y +++ b/gfx/angle/src/compiler/glslang.y @@ -40,48 +40,26 @@ compiler/tools. Remove it when we can exclusively use the newer version. #define YY_DECL int yylex(YYSTYPE* pyylval, void* parseContextLocal) extern void yyerror(const char*); -#define FRAG_VERT_ONLY(S, L) { \ - if (parseContext->language != EShLangFragment && \ - parseContext->language != EShLangVertex) { \ - parseContext->error(L, " supported in vertex/fragment shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ +#define FRAG_VERT_ONLY(S, L) { \ + if (parseContext->shaderType != SH_FRAGMENT_SHADER && \ + parseContext->shaderType != SH_VERTEX_SHADER) { \ + parseContext->error(L, " supported in vertex/fragment shaders only ", S, "", ""); \ + parseContext->recover(); \ + } \ } -#define VERTEX_ONLY(S, L) { \ - if (parseContext->language != EShLangVertex) { \ - parseContext->error(L, " supported in vertex shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ +#define VERTEX_ONLY(S, L) { \ + if (parseContext->shaderType != SH_VERTEX_SHADER) { \ + parseContext->error(L, " supported in vertex shaders only ", S, "", ""); \ + parseContext->recover(); \ + } \ } -#define FRAG_ONLY(S, L) { \ - if (parseContext->language != EShLangFragment) { \ - parseContext->error(L, " supported in fragment shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define PACK_ONLY(S, L) { \ - if (parseContext->language != EShLangPack) { \ - parseContext->error(L, " supported in pack shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define UNPACK_ONLY(S, L) { \ - if (parseContext->language != EShLangUnpack) { \ - parseContext->error(L, " supported in unpack shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ -} - -#define PACK_UNPACK_ONLY(S, L) { \ - if (parseContext->language != EShLangUnpack && \ - parseContext->language != EShLangPack) { \ - parseContext->error(L, " supported in pack/unpack shaders only ", S, "", ""); \ - parseContext->recover(); \ - } \ +#define FRAG_ONLY(S, L) { \ + if (parseContext->shaderType != SH_FRAGMENT_SHADER) { \ + parseContext->error(L, " supported in fragment shaders only ", S, "", ""); \ + parseContext->recover(); \ + } \ } %} %union { @@ -311,7 +289,7 @@ postfix_expression $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqTemporary, $1->getNominalSize(), $1->isMatrix())); if ($1->getType().getQualifier() == EvqConst) - $$->getTypePointer()->changeQualifier(EvqConst); + $$->getTypePointer()->setQualifier(EvqConst); } else if ($1->isMatrix() && $1->getType().getQualifier() == EvqConst) $$->setType(TType($1->getBasicType(), $1->getPrecision(), EvqConst, $1->getNominalSize())); else if ($1->isMatrix()) @@ -389,7 +367,7 @@ postfix_expression } } else if ($1->getBasicType() == EbtStruct) { bool fieldFound = false; - TTypeList* fields = $1->getType().getStruct(); + const TTypeList* fields = $1->getType().getStruct(); if (fields == 0) { parseContext->error($2.line, "structure has no fields", "Internal Error", ""); parseContext->recover(); @@ -413,7 +391,7 @@ postfix_expression $$->setType(*(*fields)[i].type); // change the qualifier of the return type, not of the structure field // as the structure definition is shared between various structures. - $$->getTypePointer()->changeQualifier(EvqConst); + $$->getTypePointer()->setQualifier(EvqConst); } } else { ConstantUnion *unionArray = new ConstantUnion[1]; @@ -501,9 +479,12 @@ function_call fnCandidate = parseContext->findFunction($1.line, fnCall, &builtIn); if (fnCandidate) { // - // A declared function. But, it might still map to a built-in - // operation. + // A declared function. // + if (builtIn && !fnCandidate->getExtension().empty() && + parseContext->extensionErrorCheck($1.line, fnCandidate->getExtension())) { + parseContext->recover(); + } op = fnCandidate->getBuiltInOp(); if (builtIn && op != EOpNull) { // @@ -537,16 +518,14 @@ function_call $$->getAsAggregate()->setName(fnCandidate->getMangledName()); TQualifier qual; - TQualifierList& qualifierList = $$->getAsAggregate()->getQualifier(); for (int i = 0; i < fnCandidate->getParamCount(); ++i) { - qual = (*fnCandidate)[i].type->getQualifier(); + qual = fnCandidate->getParam(i).type->getQualifier(); if (qual == EvqOut || qual == EvqInOut) { if (parseContext->lValueErrorCheck($$->getLine(), "assign", $$->getAsAggregate()->getSequence()[i]->getAsTyped())) { parseContext->error($1.intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error", ""); parseContext->recover(); } } - qualifierList.push_back(qual); } } $$->setType(fnCandidate->getReturnType()); @@ -625,19 +604,16 @@ function_identifier // Constructor // if ($1.array) { - if (parseContext->extensionErrorCheck($1.line, "GL_3DL_array_objects")) { - parseContext->recover(); - $1.setArray(false); - } + // Constructors for arrays are not allowed. + parseContext->error($1.line, "cannot construct this type", "array", ""); + parseContext->recover(); + $1.setArray(false); } + TOperator op = EOpNull; if ($1.userDef) { - TString tempString = ""; - TType type($1); - TFunction *function = new TFunction(&tempString, type, EOpConstructStruct); - $$ = function; + op = EOpConstructStruct; } else { - TOperator op = EOpNull; switch ($1.type) { case EbtFloat: if ($1.matrix) { @@ -671,18 +647,19 @@ function_identifier case 4: FRAG_VERT_ONLY("bvec4", $1.line); op = EOpConstructBVec4; break; } break; + default: break; } if (op == EOpNull) { - parseContext->error($1.line, "cannot construct this type", TType::getBasicString($1.type), ""); + parseContext->error($1.line, "cannot construct this type", getBasicString($1.type), ""); parseContext->recover(); $1.type = EbtFloat; op = EOpConstructFloat; } - TString tempString = ""; - TType type($1); - TFunction *function = new TFunction(&tempString, type, op); - $$ = function; } + TString tempString; + TType type($1); + TFunction *function = new TFunction(&tempString, type, op); + $$ = function; } | IDENTIFIER { if (parseContext->reservedErrorCheck($1.line, *$1.string)) @@ -851,8 +828,7 @@ equality_expression ConstantUnion *unionArray = new ConstantUnion[1]; unionArray->setBConst(false); $$ = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); - } else if (($1->isArray() || $3->isArray()) && parseContext->extensionErrorCheck($2.line, "GL_3DL_array_objects")) - parseContext->recover(); + } } | equality_expression NE_OP relational_expression { $$ = parseContext->intermediate.addBinaryMath(EOpNotEqual, $1, $3, $2.line, parseContext->symbolTable); @@ -862,8 +838,7 @@ equality_expression ConstantUnion *unionArray = new ConstantUnion[1]; unionArray->setBConst(false); $$ = parseContext->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), $2.line); - } else if (($1->isArray() || $3->isArray()) && parseContext->extensionErrorCheck($2.line, "GL_3DL_array_objects")) - parseContext->recover(); + } } ; @@ -949,8 +924,7 @@ assignment_expression parseContext->assignError($2.line, "assign", $1->getCompleteString(), $3->getCompleteString()); parseContext->recover(); $$ = $1; - } else if (($1->isArray() || $3->isArray()) && parseContext->extensionErrorCheck($2.line, "GL_3DL_array_objects")) - parseContext->recover(); + } } ; @@ -994,7 +968,7 @@ declaration for (int i = 0; i < function.getParamCount(); i++) { - TParameter ¶m = function[i]; + const TParameter ¶m = function.getParam(i); if (param.name != 0) { TVariable *variable = new TVariable(param.name, *param.type); @@ -1007,12 +981,12 @@ declaration } } - prototype->setOperator(EOpPrototype); + prototype->setOp(EOpPrototype); $$ = prototype; } | init_declarator_list SEMICOLON { if ($1.intermAggregate) - $1.intermAggregate->setOperator(EOpDeclaration); + $1.intermAggregate->setOp(EOpDeclaration); $$ = $1.intermAggregate; } | PRECISION precision_qualifier type_specifier_no_prec SEMICOLON { @@ -1038,8 +1012,8 @@ function_prototype parseContext->recover(); } for (int i = 0; i < prevDec->getParamCount(); ++i) { - if ((*prevDec)[i].type->getQualifier() != (*$1)[i].type->getQualifier()) { - parseContext->error($2.line, "overloaded functions must have the same parameter qualifiers", (*$1)[i].type->getQualifierString(), ""); + if (prevDec->getParam(i).type->getQualifier() != $1->getParam(i).type->getQualifier()) { + parseContext->error($2.line, "overloaded functions must have the same parameter qualifiers", $1->getParam(i).type->getQualifierString(), ""); parseContext->recover(); } } @@ -1272,75 +1246,6 @@ init_declarator_list $$.intermAggregate = parseContext->intermediate.growAggregate($1.intermNode, parseContext->intermediate.addSymbol(0, *$3.string, type, $3.line), $3.line); } } - | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET RIGHT_BRACKET EQUAL initializer { - if (parseContext->structQualifierErrorCheck($3.line, $1.type)) - parseContext->recover(); - - $$ = $1; - - TVariable* variable = 0; - if (parseContext->arrayTypeErrorCheck($4.line, $1.type) || parseContext->arrayQualifierErrorCheck($4.line, $1.type)) - parseContext->recover(); - else { - $1.type.setArray(true, $7->getType().getArraySize()); - if (parseContext->arrayErrorCheck($4.line, *$3.string, $1.type, variable)) - parseContext->recover(); - } - - if (parseContext->extensionErrorCheck($$.line, "GL_3DL_array_objects")) - parseContext->recover(); - else { - TIntermNode* intermNode; - if (!parseContext->executeInitializer($3.line, *$3.string, $1.type, $7, intermNode, variable)) { - // - // build the intermediate representation - // - if (intermNode) - $$.intermAggregate = parseContext->intermediate.growAggregate($1.intermNode, intermNode, $6.line); - else - $$.intermAggregate = $1.intermAggregate; - } else { - parseContext->recover(); - $$.intermAggregate = 0; - } - } - } - | init_declarator_list COMMA IDENTIFIER LEFT_BRACKET constant_expression RIGHT_BRACKET EQUAL initializer { - if (parseContext->structQualifierErrorCheck($3.line, $1.type)) - parseContext->recover(); - - $$ = $1; - - TVariable* variable = 0; - if (parseContext->arrayTypeErrorCheck($4.line, $1.type) || parseContext->arrayQualifierErrorCheck($4.line, $1.type)) - parseContext->recover(); - else { - int size; - if (parseContext->arraySizeErrorCheck($4.line, $5, size)) - parseContext->recover(); - $1.type.setArray(true, size); - if (parseContext->arrayErrorCheck($4.line, *$3.string, $1.type, variable)) - parseContext->recover(); - } - - if (parseContext->extensionErrorCheck($$.line, "GL_3DL_array_objects")) - parseContext->recover(); - else { - TIntermNode* intermNode; - if (!parseContext->executeInitializer($3.line, *$3.string, $1.type, $8, intermNode, variable)) { - // - // build the intermediate representation - // - if (intermNode) - $$.intermAggregate = parseContext->intermediate.growAggregate($1.intermNode, intermNode, $7.line); - else - $$.intermAggregate = $1.intermAggregate; - } else { - parseContext->recover(); - $$.intermAggregate = 0; - } - } - } | init_declarator_list COMMA IDENTIFIER EQUAL initializer { if (parseContext->structQualifierErrorCheck($3.line, $1.type)) parseContext->recover(); @@ -1531,18 +1436,14 @@ fully_specified_type $$ = $1; if ($1.array) { - if (parseContext->extensionErrorCheck($1.line, "GL_3DL_array_objects")) { - parseContext->recover(); - $1.setArray(false); - } + parseContext->error($1.line, "not supported", "first-class array", ""); + parseContext->recover(); + $1.setArray(false); } } | type_qualifier type_specifier { - if ($2.array && parseContext->extensionErrorCheck($2.line, "GL_3DL_array_objects")) { - parseContext->recover(); - $2.setArray(false); - } - if ($2.array && parseContext->arrayQualifierErrorCheck($2.line, $1)) { + if ($2.array) { + parseContext->error($2.line, "not supported", "first-class array", ""); parseContext->recover(); $2.setArray(false); } @@ -1575,7 +1476,7 @@ type_qualifier | VARYING { if (parseContext->globalErrorCheck($1.line, parseContext->symbolTable.atGlobalLevel(), "varying")) parseContext->recover(); - if (parseContext->language == EShLangVertex) + if (parseContext->shaderType == SH_VERTEX_SHADER) $$.setBasic(EbtVoid, EvqVaryingOut, $1.line); else $$.setBasic(EbtVoid, EvqVaryingIn, $1.line); @@ -1583,7 +1484,7 @@ type_qualifier | INVARIANT VARYING { if (parseContext->globalErrorCheck($1.line, parseContext->symbolTable.atGlobalLevel(), "invariant varying")) parseContext->recover(); - if (parseContext->language == EShLangVertex) + if (parseContext->shaderType == SH_VERTEX_SHADER) $$.setBasic(EbtVoid, EvqInvariantVaryingOut, $1.line); else $$.setBasic(EbtVoid, EvqInvariantVaryingIn, $1.line); @@ -1795,19 +1696,24 @@ struct_declaration } for (unsigned int i = 0; i < $$->size(); ++i) { // - // Careful not to replace already know aspects of type, like array-ness + // Careful not to replace already known aspects of type, like array-ness // - (*$$)[i].type->setType($1.type, $1.size, $1.matrix, $1.userDef); + TType* type = (*$$)[i].type; + type->setBasicType($1.type); + type->setNominalSize($1.size); + type->setMatrix($1.matrix); // don't allow arrays of arrays - if ((*$$)[i].type->isArray()) { + if (type->isArray()) { if (parseContext->arrayTypeErrorCheck($1.line, $1)) parseContext->recover(); } if ($1.array) - (*$$)[i].type->setArraySize($1.arraySize); - if ($1.userDef) - (*$$)[i].type->setTypeName($1.userDef->getTypeName()); + type->setArraySize($1.arraySize); + if ($1.userDef) { + type->setStruct($1.userDef->getStruct()); + type->setTypeName($1.userDef->getTypeName()); + } } } ; @@ -1873,7 +1779,7 @@ compound_statement : LEFT_BRACE RIGHT_BRACE { $$ = 0; } | LEFT_BRACE { parseContext->symbolTable.push(); } statement_list { parseContext->symbolTable.pop(); } RIGHT_BRACE { if ($3 != 0) - $3->setOperator(EOpSequence); + $3->setOp(EOpSequence); $$ = $3; } ; @@ -1890,7 +1796,7 @@ compound_statement_no_new_scope } | LEFT_BRACE statement_list RIGHT_BRACE { if ($2) - $2->setOperator(EOpSequence); + $2->setOp(EOpSequence); $$ = $2; } ; @@ -2065,8 +1971,8 @@ external_declaration function_definition : function_prototype { - TFunction& function = *($1.function); - TFunction* prevDec = static_cast(parseContext->symbolTable.find(function.getMangledName())); + TFunction* function = $1.function; + TFunction* prevDec = static_cast(parseContext->symbolTable.find(function->getMangledName())); // // Note: 'prevDec' could be 'function' if this is the first time we've seen function // as it would have just been put in the symbol table. Otherwise, we're looking up @@ -2076,7 +1982,7 @@ function_definition // // Then this function already has a body. // - parseContext->error($1.line, "function already has a body", function.getName().c_str(), ""); + parseContext->error($1.line, "function already has a body", function->getName().c_str(), ""); parseContext->recover(); } prevDec->setDefined(); @@ -2084,13 +1990,13 @@ function_definition // // Raise error message if main function takes any parameters or return anything other than void // - if (function.getName() == "main") { - if (function.getParamCount() > 0) { - parseContext->error($1.line, "function cannot take any parameter(s)", function.getName().c_str(), ""); + if (function->getName() == "main") { + if (function->getParamCount() > 0) { + parseContext->error($1.line, "function cannot take any parameter(s)", function->getName().c_str(), ""); parseContext->recover(); } - if (function.getReturnType().getBasicType() != EbtVoid) { - parseContext->error($1.line, "", function.getReturnType().getBasicString(), "main function cannot return a value"); + if (function->getReturnType().getBasicType() != EbtVoid) { + parseContext->error($1.line, "", function->getReturnType().getBasicString(), "main function cannot return a value"); parseContext->recover(); } } @@ -2115,8 +2021,8 @@ function_definition // knows where to find parameters. // TIntermAggregate* paramNodes = new TIntermAggregate; - for (int i = 0; i < function.getParamCount(); i++) { - TParameter& param = function[i]; + for (int i = 0; i < function->getParamCount(); i++) { + const TParameter& param = function->getParam(i); if (param.name != 0) { TVariable *variable = new TVariable(param.name, *param.type); // @@ -2127,10 +2033,6 @@ function_definition parseContext->recover(); delete variable; } - // - // Transfer ownership of name pointer to symbol table. - // - param.name = 0; // // Add the parameter to the HIL diff --git a/gfx/angle/src/compiler/intermOut.cpp b/gfx/angle/src/compiler/intermOut.cpp index db042dd8a8e..7d4982868ae 100644 --- a/gfx/angle/src/compiler/intermOut.cpp +++ b/gfx/angle/src/compiler/intermOut.cpp @@ -21,8 +21,8 @@ // class TOutputTraverser : public TIntermTraverser { public: - TOutputTraverser(TInfoSink& i) : infoSink(i) { } - TInfoSink& infoSink; + TOutputTraverser(TInfoSinkBase& i) : sink(i) { } + TInfoSinkBase& sink; protected: void visitSymbol(TIntermSymbol*); @@ -56,14 +56,14 @@ TString TType::getCompleteString() const // Helper functions for printing, not part of traversing. // -void OutputTreeText(TInfoSink& infoSink, TIntermNode* node, const int depth) +void OutputTreeText(TInfoSinkBase& sink, TIntermNode* node, const int depth) { int i; - infoSink.debug.location(node->getLine()); + sink.location(node->getLine()); for (i = 0; i < depth; ++i) - infoSink.debug << " "; + sink << " "; } // @@ -77,226 +77,226 @@ void OutputTreeText(TInfoSink& infoSink, TIntermNode* node, const int depth) void TOutputTraverser::visitSymbol(TIntermSymbol* node) { - OutputTreeText(infoSink, node, depth); + OutputTreeText(sink, node, depth); - infoSink.debug << "'" << node->getSymbol() << "' "; - infoSink.debug << "(" << node->getCompleteString() << ")\n"; + sink << "'" << node->getSymbol() << "' "; + sink << "(" << node->getCompleteString() << ")\n"; } bool TOutputTraverser::visitBinary(Visit visit, TIntermBinary* node) { - TInfoSink& out = infoSink; + TInfoSinkBase& out = sink; OutputTreeText(out, node, depth); switch (node->getOp()) { - case EOpAssign: out.debug << "move second child to first child"; break; - case EOpInitialize: out.debug << "initialize first child with second child"; break; - case EOpAddAssign: out.debug << "add second child into first child"; break; - case EOpSubAssign: out.debug << "subtract second child into first child"; break; - case EOpMulAssign: out.debug << "multiply second child into first child"; break; - case EOpVectorTimesMatrixAssign: out.debug << "matrix mult second child into first child"; break; - case EOpVectorTimesScalarAssign: out.debug << "vector scale second child into first child"; break; - case EOpMatrixTimesScalarAssign: out.debug << "matrix scale second child into first child"; break; - case EOpMatrixTimesMatrixAssign: out.debug << "matrix mult second child into first child"; break; - case EOpDivAssign: out.debug << "divide second child into first child"; break; - case EOpIndexDirect: out.debug << "direct index"; break; - case EOpIndexIndirect: out.debug << "indirect index"; break; - case EOpIndexDirectStruct: out.debug << "direct index for structure"; break; - case EOpVectorSwizzle: out.debug << "vector swizzle"; break; + case EOpAssign: out << "move second child to first child"; break; + case EOpInitialize: out << "initialize first child with second child"; break; + case EOpAddAssign: out << "add second child into first child"; break; + case EOpSubAssign: out << "subtract second child into first child"; break; + case EOpMulAssign: out << "multiply second child into first child"; break; + case EOpVectorTimesMatrixAssign: out << "matrix mult second child into first child"; break; + case EOpVectorTimesScalarAssign: out << "vector scale second child into first child"; break; + case EOpMatrixTimesScalarAssign: out << "matrix scale second child into first child"; break; + case EOpMatrixTimesMatrixAssign: out << "matrix mult second child into first child"; break; + case EOpDivAssign: out << "divide second child into first child"; break; + case EOpIndexDirect: out << "direct index"; break; + case EOpIndexIndirect: out << "indirect index"; break; + case EOpIndexDirectStruct: out << "direct index for structure"; break; + case EOpVectorSwizzle: out << "vector swizzle"; break; - case EOpAdd: out.debug << "add"; break; - case EOpSub: out.debug << "subtract"; break; - case EOpMul: out.debug << "component-wise multiply"; break; - case EOpDiv: out.debug << "divide"; break; - case EOpEqual: out.debug << "Compare Equal"; break; - case EOpNotEqual: out.debug << "Compare Not Equal"; break; - case EOpLessThan: out.debug << "Compare Less Than"; break; - case EOpGreaterThan: out.debug << "Compare Greater Than"; break; - case EOpLessThanEqual: out.debug << "Compare Less Than or Equal"; break; - case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break; + case EOpAdd: out << "add"; break; + case EOpSub: out << "subtract"; break; + case EOpMul: out << "component-wise multiply"; break; + case EOpDiv: out << "divide"; break; + case EOpEqual: out << "Compare Equal"; break; + case EOpNotEqual: out << "Compare Not Equal"; break; + case EOpLessThan: out << "Compare Less Than"; break; + case EOpGreaterThan: out << "Compare Greater Than"; break; + case EOpLessThanEqual: out << "Compare Less Than or Equal"; break; + case EOpGreaterThanEqual: out << "Compare Greater Than or Equal"; break; - case EOpVectorTimesScalar: out.debug << "vector-scale"; break; - case EOpVectorTimesMatrix: out.debug << "vector-times-matrix"; break; - case EOpMatrixTimesVector: out.debug << "matrix-times-vector"; break; - case EOpMatrixTimesScalar: out.debug << "matrix-scale"; break; - case EOpMatrixTimesMatrix: out.debug << "matrix-multiply"; break; + case EOpVectorTimesScalar: out << "vector-scale"; break; + case EOpVectorTimesMatrix: out << "vector-times-matrix"; break; + case EOpMatrixTimesVector: out << "matrix-times-vector"; break; + case EOpMatrixTimesScalar: out << "matrix-scale"; break; + case EOpMatrixTimesMatrix: out << "matrix-multiply"; break; - case EOpLogicalOr: out.debug << "logical-or"; break; - case EOpLogicalXor: out.debug << "logical-xor"; break; - case EOpLogicalAnd: out.debug << "logical-and"; break; - default: out.debug << ""; + case EOpLogicalOr: out << "logical-or"; break; + case EOpLogicalXor: out << "logical-xor"; break; + case EOpLogicalAnd: out << "logical-and"; break; + default: out << ""; } - out.debug << " (" << node->getCompleteString() << ")"; + out << " (" << node->getCompleteString() << ")"; - out.debug << "\n"; + out << "\n"; return true; } bool TOutputTraverser::visitUnary(Visit visit, TIntermUnary* node) { - TInfoSink& out = infoSink; + TInfoSinkBase& out = sink; OutputTreeText(out, node, depth); switch (node->getOp()) { - case EOpNegative: out.debug << "Negate value"; break; + case EOpNegative: out << "Negate value"; break; case EOpVectorLogicalNot: - case EOpLogicalNot: out.debug << "Negate conditional"; break; + case EOpLogicalNot: out << "Negate conditional"; break; - case EOpPostIncrement: out.debug << "Post-Increment"; break; - case EOpPostDecrement: out.debug << "Post-Decrement"; break; - case EOpPreIncrement: out.debug << "Pre-Increment"; break; - case EOpPreDecrement: out.debug << "Pre-Decrement"; break; + case EOpPostIncrement: out << "Post-Increment"; break; + case EOpPostDecrement: out << "Post-Decrement"; break; + case EOpPreIncrement: out << "Pre-Increment"; break; + case EOpPreDecrement: out << "Pre-Decrement"; break; - case EOpConvIntToBool: out.debug << "Convert int to bool"; break; - case EOpConvFloatToBool:out.debug << "Convert float to bool";break; - case EOpConvBoolToFloat:out.debug << "Convert bool to float";break; - case EOpConvIntToFloat: out.debug << "Convert int to float"; break; - case EOpConvFloatToInt: out.debug << "Convert float to int"; break; - case EOpConvBoolToInt: out.debug << "Convert bool to int"; break; + case EOpConvIntToBool: out << "Convert int to bool"; break; + case EOpConvFloatToBool:out << "Convert float to bool";break; + case EOpConvBoolToFloat:out << "Convert bool to float";break; + case EOpConvIntToFloat: out << "Convert int to float"; break; + case EOpConvFloatToInt: out << "Convert float to int"; break; + case EOpConvBoolToInt: out << "Convert bool to int"; break; - case EOpRadians: out.debug << "radians"; break; - case EOpDegrees: out.debug << "degrees"; break; - case EOpSin: out.debug << "sine"; break; - case EOpCos: out.debug << "cosine"; break; - case EOpTan: out.debug << "tangent"; break; - case EOpAsin: out.debug << "arc sine"; break; - case EOpAcos: out.debug << "arc cosine"; break; - case EOpAtan: out.debug << "arc tangent"; break; + case EOpRadians: out << "radians"; break; + case EOpDegrees: out << "degrees"; break; + case EOpSin: out << "sine"; break; + case EOpCos: out << "cosine"; break; + case EOpTan: out << "tangent"; break; + case EOpAsin: out << "arc sine"; break; + case EOpAcos: out << "arc cosine"; break; + case EOpAtan: out << "arc tangent"; break; - case EOpExp: out.debug << "exp"; break; - case EOpLog: out.debug << "log"; break; - case EOpExp2: out.debug << "exp2"; break; - case EOpLog2: out.debug << "log2"; break; - case EOpSqrt: out.debug << "sqrt"; break; - case EOpInverseSqrt: out.debug << "inverse sqrt"; break; + case EOpExp: out << "exp"; break; + case EOpLog: out << "log"; break; + case EOpExp2: out << "exp2"; break; + case EOpLog2: out << "log2"; break; + case EOpSqrt: out << "sqrt"; break; + case EOpInverseSqrt: out << "inverse sqrt"; break; - case EOpAbs: out.debug << "Absolute value"; break; - case EOpSign: out.debug << "Sign"; break; - case EOpFloor: out.debug << "Floor"; break; - case EOpCeil: out.debug << "Ceiling"; break; - case EOpFract: out.debug << "Fraction"; break; + case EOpAbs: out << "Absolute value"; break; + case EOpSign: out << "Sign"; break; + case EOpFloor: out << "Floor"; break; + case EOpCeil: out << "Ceiling"; break; + case EOpFract: out << "Fraction"; break; - case EOpLength: out.debug << "length"; break; - case EOpNormalize: out.debug << "normalize"; break; - // case EOpDPdx: out.debug << "dPdx"; break; - // case EOpDPdy: out.debug << "dPdy"; break; - // case EOpFwidth: out.debug << "fwidth"; break; + case EOpLength: out << "length"; break; + case EOpNormalize: out << "normalize"; break; + // case EOpDPdx: out << "dPdx"; break; + // case EOpDPdy: out << "dPdy"; break; + // case EOpFwidth: out << "fwidth"; break; - case EOpAny: out.debug << "any"; break; - case EOpAll: out.debug << "all"; break; + case EOpAny: out << "any"; break; + case EOpAll: out << "all"; break; - default: out.debug.message(EPrefixError, "Bad unary op"); + default: out.message(EPrefixError, "Bad unary op"); } - out.debug << " (" << node->getCompleteString() << ")"; + out << " (" << node->getCompleteString() << ")"; - out.debug << "\n"; + out << "\n"; return true; } bool TOutputTraverser::visitAggregate(Visit visit, TIntermAggregate* node) { - TInfoSink& out = infoSink; + TInfoSinkBase& out = sink; if (node->getOp() == EOpNull) { - out.debug.message(EPrefixError, "node is still EOpNull!"); + out.message(EPrefixError, "node is still EOpNull!"); return true; } OutputTreeText(out, node, depth); switch (node->getOp()) { - case EOpSequence: out.debug << "Sequence\n"; return true; - case EOpComma: out.debug << "Comma\n"; return true; - case EOpFunction: out.debug << "Function Definition: " << node->getName(); break; - case EOpFunctionCall: out.debug << "Function Call: " << node->getName(); break; - case EOpParameters: out.debug << "Function Parameters: "; break; + case EOpSequence: out << "Sequence\n"; return true; + case EOpComma: out << "Comma\n"; return true; + case EOpFunction: out << "Function Definition: " << node->getName(); break; + case EOpFunctionCall: out << "Function Call: " << node->getName(); break; + case EOpParameters: out << "Function Parameters: "; break; - case EOpConstructFloat: out.debug << "Construct float"; break; - case EOpConstructVec2: out.debug << "Construct vec2"; break; - case EOpConstructVec3: out.debug << "Construct vec3"; break; - case EOpConstructVec4: out.debug << "Construct vec4"; break; - case EOpConstructBool: out.debug << "Construct bool"; break; - case EOpConstructBVec2: out.debug << "Construct bvec2"; break; - case EOpConstructBVec3: out.debug << "Construct bvec3"; break; - case EOpConstructBVec4: out.debug << "Construct bvec4"; break; - case EOpConstructInt: out.debug << "Construct int"; break; - case EOpConstructIVec2: out.debug << "Construct ivec2"; break; - case EOpConstructIVec3: out.debug << "Construct ivec3"; break; - case EOpConstructIVec4: out.debug << "Construct ivec4"; break; - case EOpConstructMat2: out.debug << "Construct mat2"; break; - case EOpConstructMat3: out.debug << "Construct mat3"; break; - case EOpConstructMat4: out.debug << "Construct mat4"; break; - case EOpConstructStruct: out.debug << "Construct structure"; break; + case EOpConstructFloat: out << "Construct float"; break; + case EOpConstructVec2: out << "Construct vec2"; break; + case EOpConstructVec3: out << "Construct vec3"; break; + case EOpConstructVec4: out << "Construct vec4"; break; + case EOpConstructBool: out << "Construct bool"; break; + case EOpConstructBVec2: out << "Construct bvec2"; break; + case EOpConstructBVec3: out << "Construct bvec3"; break; + case EOpConstructBVec4: out << "Construct bvec4"; break; + case EOpConstructInt: out << "Construct int"; break; + case EOpConstructIVec2: out << "Construct ivec2"; break; + case EOpConstructIVec3: out << "Construct ivec3"; break; + case EOpConstructIVec4: out << "Construct ivec4"; break; + case EOpConstructMat2: out << "Construct mat2"; break; + case EOpConstructMat3: out << "Construct mat3"; break; + case EOpConstructMat4: out << "Construct mat4"; break; + case EOpConstructStruct: out << "Construct structure"; break; - case EOpLessThan: out.debug << "Compare Less Than"; break; - case EOpGreaterThan: out.debug << "Compare Greater Than"; break; - case EOpLessThanEqual: out.debug << "Compare Less Than or Equal"; break; - case EOpGreaterThanEqual: out.debug << "Compare Greater Than or Equal"; break; - case EOpVectorEqual: out.debug << "Equal"; break; - case EOpVectorNotEqual: out.debug << "NotEqual"; break; + case EOpLessThan: out << "Compare Less Than"; break; + case EOpGreaterThan: out << "Compare Greater Than"; break; + case EOpLessThanEqual: out << "Compare Less Than or Equal"; break; + case EOpGreaterThanEqual: out << "Compare Greater Than or Equal"; break; + case EOpVectorEqual: out << "Equal"; break; + case EOpVectorNotEqual: out << "NotEqual"; break; - case EOpMod: out.debug << "mod"; break; - case EOpPow: out.debug << "pow"; break; + case EOpMod: out << "mod"; break; + case EOpPow: out << "pow"; break; - case EOpAtan: out.debug << "arc tangent"; break; + case EOpAtan: out << "arc tangent"; break; - case EOpMin: out.debug << "min"; break; - case EOpMax: out.debug << "max"; break; - case EOpClamp: out.debug << "clamp"; break; - case EOpMix: out.debug << "mix"; break; - case EOpStep: out.debug << "step"; break; - case EOpSmoothStep: out.debug << "smoothstep"; break; + case EOpMin: out << "min"; break; + case EOpMax: out << "max"; break; + case EOpClamp: out << "clamp"; break; + case EOpMix: out << "mix"; break; + case EOpStep: out << "step"; break; + case EOpSmoothStep: out << "smoothstep"; break; - case EOpDistance: out.debug << "distance"; break; - case EOpDot: out.debug << "dot-product"; break; - case EOpCross: out.debug << "cross-product"; break; - case EOpFaceForward: out.debug << "face-forward"; break; - case EOpReflect: out.debug << "reflect"; break; - case EOpRefract: out.debug << "refract"; break; - case EOpMul: out.debug << "component-wise multiply"; break; + case EOpDistance: out << "distance"; break; + case EOpDot: out << "dot-product"; break; + case EOpCross: out << "cross-product"; break; + case EOpFaceForward: out << "face-forward"; break; + case EOpReflect: out << "reflect"; break; + case EOpRefract: out << "refract"; break; + case EOpMul: out << "component-wise multiply"; break; - default: out.debug.message(EPrefixError, "Bad aggregation op"); + default: out.message(EPrefixError, "Bad aggregation op"); } if (node->getOp() != EOpSequence && node->getOp() != EOpParameters) - out.debug << " (" << node->getCompleteString() << ")"; + out << " (" << node->getCompleteString() << ")"; - out.debug << "\n"; + out << "\n"; return true; } bool TOutputTraverser::visitSelection(Visit visit, TIntermSelection* node) { - TInfoSink& out = infoSink; + TInfoSinkBase& out = sink; OutputTreeText(out, node, depth); - out.debug << "Test condition and select"; - out.debug << " (" << node->getCompleteString() << ")\n"; + out << "Test condition and select"; + out << " (" << node->getCompleteString() << ")\n"; ++depth; - OutputTreeText(infoSink, node, depth); - out.debug << "Condition\n"; + OutputTreeText(sink, node, depth); + out << "Condition\n"; node->getCondition()->traverse(this); - OutputTreeText(infoSink, node, depth); + OutputTreeText(sink, node, depth); if (node->getTrueBlock()) { - out.debug << "true case\n"; + out << "true case\n"; node->getTrueBlock()->traverse(this); } else - out.debug << "true case is null\n"; + out << "true case is null\n"; if (node->getFalseBlock()) { - OutputTreeText(infoSink, node, depth); - out.debug << "false case\n"; + OutputTreeText(sink, node, depth); + out << "false case\n"; node->getFalseBlock()->traverse(this); } @@ -307,7 +307,7 @@ bool TOutputTraverser::visitSelection(Visit visit, TIntermSelection* node) void TOutputTraverser::visitConstantUnion(TIntermConstantUnion* node) { - TInfoSink& out = infoSink; + TInfoSinkBase& out = sink; int size = node->getType().getObjectSize(); @@ -316,23 +316,23 @@ void TOutputTraverser::visitConstantUnion(TIntermConstantUnion* node) switch (node->getUnionArrayPointer()[i].getType()) { case EbtBool: if (node->getUnionArrayPointer()[i].getBConst()) - out.debug << "true"; + out << "true"; else - out.debug << "false"; + out << "false"; - out.debug << " (" << "const bool" << ")"; - out.debug << "\n"; + out << " (" << "const bool" << ")"; + out << "\n"; break; case EbtFloat: - out.debug << node->getUnionArrayPointer()[i].getFConst(); - out.debug << " (const float)\n"; + out << node->getUnionArrayPointer()[i].getFConst(); + out << " (const float)\n"; break; case EbtInt: - out.debug << node->getUnionArrayPointer()[i].getIConst(); - out.debug << " (const int)\n"; + out << node->getUnionArrayPointer()[i].getIConst(); + out << " (const int)\n"; break; default: - out.info.message(EPrefixInternalError, "Unknown constant", node->getLine()); + out.message(EPrefixInternalError, "Unknown constant", node->getLine()); break; } } @@ -340,34 +340,34 @@ void TOutputTraverser::visitConstantUnion(TIntermConstantUnion* node) bool TOutputTraverser::visitLoop(Visit visit, TIntermLoop* node) { - TInfoSink& out = infoSink; + TInfoSinkBase& out = sink; OutputTreeText(out, node, depth); - out.debug << "Loop with condition "; + out << "Loop with condition "; if (! node->testFirst()) - out.debug << "not "; - out.debug << "tested first\n"; + out << "not "; + out << "tested first\n"; ++depth; - OutputTreeText(infoSink, node, depth); + OutputTreeText(sink, node, depth); if (node->getTest()) { - out.debug << "Loop Condition\n"; + out << "Loop Condition\n"; node->getTest()->traverse(this); } else - out.debug << "No loop condition\n"; + out << "No loop condition\n"; - OutputTreeText(infoSink, node, depth); + OutputTreeText(sink, node, depth); if (node->getBody()) { - out.debug << "Loop Body\n"; + out << "Loop Body\n"; node->getBody()->traverse(this); } else - out.debug << "No loop body\n"; + out << "No loop body\n"; if (node->getTerminal()) { - OutputTreeText(infoSink, node, depth); - out.debug << "Loop Terminal Expression\n"; + OutputTreeText(sink, node, depth); + out << "Loop Terminal Expression\n"; node->getTerminal()->traverse(this); } @@ -378,25 +378,25 @@ bool TOutputTraverser::visitLoop(Visit visit, TIntermLoop* node) bool TOutputTraverser::visitBranch(Visit visit, TIntermBranch* node) { - TInfoSink& out = infoSink; + TInfoSinkBase& out = sink; OutputTreeText(out, node, depth); switch (node->getFlowOp()) { - case EOpKill: out.debug << "Branch: Kill"; break; - case EOpBreak: out.debug << "Branch: Break"; break; - case EOpContinue: out.debug << "Branch: Continue"; break; - case EOpReturn: out.debug << "Branch: Return"; break; - default: out.debug << "Branch: Unknown Branch"; break; + case EOpKill: out << "Branch: Kill"; break; + case EOpBreak: out << "Branch: Break"; break; + case EOpContinue: out << "Branch: Continue"; break; + case EOpReturn: out << "Branch: Return"; break; + default: out << "Branch: Unknown Branch"; break; } if (node->getExpression()) { - out.debug << " with expression\n"; + out << " with expression\n"; ++depth; node->getExpression()->traverse(this); --depth; } else - out.debug << "\n"; + out << "\n"; return false; } @@ -411,7 +411,7 @@ void TIntermediate::outputTree(TIntermNode* root) if (root == 0) return; - TOutputTraverser it(infoSink); + TOutputTraverser it(infoSink.info); root->traverse(&it); } diff --git a/gfx/angle/src/compiler/intermediate.h b/gfx/angle/src/compiler/intermediate.h index c83fc48a1fe..dd269e1ed01 100644 --- a/gfx/angle/src/compiler/intermediate.h +++ b/gfx/angle/src/compiler/intermediate.h @@ -129,9 +129,9 @@ enum TOperator { EOpReflect, EOpRefract, - //EOpDPdx, // Fragment only, OES_standard_derivatives extension - //EOpDPdy, // Fragment only, OES_standard_derivatives extension - //EOpFwidth, // Fragment only, OES_standard_derivatives extension + EOpDFdx, // Fragment only, OES_standard_derivatives extension + EOpDFdy, // Fragment only, OES_standard_derivatives extension + EOpFwidth, // Fragment only, OES_standard_derivatives extension EOpMatrixTimesMatrix, @@ -203,8 +203,10 @@ public: POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator) TIntermNode() : line(0) {} - virtual TSourceLoc getLine() const { return line; } - virtual void setLine(TSourceLoc l) { line = l; } + + TSourceLoc getLine() const { return line; } + void setLine(TSourceLoc l) { line = l; } + virtual void traverse(TIntermTraverser*) = 0; virtual TIntermTyped* getAsTyped() { return 0; } virtual TIntermConstantUnion* getAsConstantUnion() { return 0; } @@ -215,6 +217,7 @@ public: virtual TIntermSymbol* getAsSymbolNode() { return 0; } virtual TIntermLoop* getAsLoopNode() { return 0; } virtual ~TIntermNode() { } + protected: TSourceLoc line; }; @@ -233,22 +236,23 @@ struct TIntermNodePair { class TIntermTyped : public TIntermNode { public: TIntermTyped(const TType& t) : type(t) { } - virtual TIntermTyped* getAsTyped() { return this; } - virtual void setType(const TType& t) { type = t; } - virtual const TType& getType() const { return type; } - virtual TType* getTypePointer() { return &type; } + virtual TIntermTyped* getAsTyped() { return this; } - virtual TBasicType getBasicType() const { return type.getBasicType(); } - virtual TQualifier getQualifier() const { return type.getQualifier(); } - virtual TPrecision getPrecision() const { return type.getPrecision(); } - virtual int getNominalSize() const { return type.getNominalSize(); } - virtual int getSize() const { return type.getInstanceSize(); } - virtual bool isMatrix() const { return type.isMatrix(); } - virtual bool isArray() const { return type.isArray(); } - virtual bool isVector() const { return type.isVector(); } - virtual bool isScalar() const { return type.isScalar(); } - const char* getBasicString() const { return type.getBasicString(); } - const char* getQualifierString() const { return type.getQualifierString(); } + void setType(const TType& t) { type = t; } + const TType& getType() const { return type; } + TType* getTypePointer() { return &type; } + + TBasicType getBasicType() const { return type.getBasicType(); } + TQualifier getQualifier() const { return type.getQualifier(); } + TPrecision getPrecision() const { return type.getPrecision(); } + int getNominalSize() const { return type.getNominalSize(); } + + bool isMatrix() const { return type.isMatrix(); } + bool isArray() const { return type.isArray(); } + bool isVector() const { return type.isVector(); } + bool isScalar() const { return type.isScalar(); } + const char* getBasicString() const { return type.getBasicString(); } + const char* getQualifierString() const { return type.getQualifierString(); } TString getCompleteString() const { return type.getCompleteString(); } protected: @@ -266,13 +270,16 @@ public: test(aTest), terminal(aTerminal), first(testFirst) { } + virtual TIntermLoop* getAsLoopNode() { return this; } virtual void traverse(TIntermTraverser*); + TIntermNode *getInit() { return init; } TIntermNode *getBody() { return body; } TIntermTyped *getTest() { return test; } TIntermTyped *getTerminal() { return terminal; } bool testFirst() { return first; } + protected: TIntermNode *init; TIntermNode *body; // code to loop over @@ -289,9 +296,12 @@ public: TIntermBranch(TOperator op, TIntermTyped* e) : flowOp(op), expression(e) { } + virtual void traverse(TIntermTraverser*); + TOperator getFlowOp() { return flowOp; } TIntermTyped* getExpression() { return expression; } + protected: TOperator flowOp; TIntermTyped* expression; // non-zero except for "return exp;" statements @@ -307,10 +317,13 @@ public: // it is essential to use "symbol = sym" to assign to symbol TIntermSymbol(int i, const TString& sym, const TType& t) : TIntermTyped(t), id(i) { symbol = sym;} - virtual int getId() const { return id; } - virtual const TString& getSymbol() const { return symbol; } + + int getId() const { return id; } + const TString& getSymbol() const { return symbol; } + virtual void traverse(TIntermTraverser*); virtual TIntermSymbol* getAsSymbolNode() { return this; } + protected: int id; TString symbol; @@ -319,11 +332,15 @@ protected: class TIntermConstantUnion : public TIntermTyped { public: TIntermConstantUnion(ConstantUnion *unionPointer, const TType& t) : TIntermTyped(t), unionArrayPointer(unionPointer) { } + ConstantUnion* getUnionArrayPointer() const { return unionArrayPointer; } void setUnionArrayPointer(ConstantUnion *c) { unionArrayPointer = c; } + virtual TIntermConstantUnion* getAsConstantUnion() { return this; } - virtual void traverse(TIntermTraverser* ); - virtual TIntermTyped* fold(TOperator, TIntermTyped*, TInfoSink&); + virtual void traverse(TIntermTraverser*); + + TIntermTyped* fold(TOperator, TIntermTyped*, TInfoSink&); + protected: ConstantUnion *unionArrayPointer; }; @@ -334,9 +351,11 @@ protected: class TIntermOperator : public TIntermTyped { public: TOperator getOp() const { return op; } + void setOp(TOperator o) { op = o; } + bool modifiesState() const; bool isConstructor() const; - virtual bool promote(TInfoSink&) { return true; } + protected: TIntermOperator(TOperator o) : TIntermTyped(TType(EbtFloat, EbpUndefined)), op(o) {} TIntermOperator(TOperator o, TType& t) : TIntermTyped(t), op(o) {} @@ -349,13 +368,16 @@ protected: class TIntermBinary : public TIntermOperator { public: TIntermBinary(TOperator o) : TIntermOperator(o) {} - virtual void traverse(TIntermTraverser*); - virtual void setLeft(TIntermTyped* n) { left = n; } - virtual void setRight(TIntermTyped* n) { right = n; } - virtual TIntermTyped* getLeft() const { return left; } - virtual TIntermTyped* getRight() const { return right; } + virtual TIntermBinary* getAsBinaryNode() { return this; } - virtual bool promote(TInfoSink&); + virtual void traverse(TIntermTraverser*); + + void setLeft(TIntermTyped* n) { left = n; } + void setRight(TIntermTyped* n) { right = n; } + TIntermTyped* getLeft() const { return left; } + TIntermTyped* getRight() const { return right; } + bool promote(TInfoSink&); + protected: TIntermTyped* left; TIntermTyped* right; @@ -368,17 +390,21 @@ class TIntermUnary : public TIntermOperator { public: TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0) {} TIntermUnary(TOperator o) : TIntermOperator(o), operand(0) {} + virtual void traverse(TIntermTraverser*); - virtual void setOperand(TIntermTyped* o) { operand = o; } - virtual TIntermTyped* getOperand() { return operand; } virtual TIntermUnary* getAsUnaryNode() { return this; } - virtual bool promote(TInfoSink&); + + void setOperand(TIntermTyped* o) { operand = o; } + TIntermTyped* getOperand() { return operand; } + bool promote(TInfoSink&); + protected: TIntermTyped* operand; }; typedef TVector TIntermSequence; typedef TVector TQualifierList; +typedef TMap TPragmaTable; // // Nodes that operate on an arbitrary sized set of children. // @@ -387,28 +413,32 @@ public: TIntermAggregate() : TIntermOperator(EOpNull), userDefined(false), pragmaTable(0) { } TIntermAggregate(TOperator o) : TIntermOperator(o), pragmaTable(0) { } ~TIntermAggregate() { delete pragmaTable; } + virtual TIntermAggregate* getAsAggregate() { return this; } - virtual void setOperator(TOperator o) { op = o; } - virtual TIntermSequence& getSequence() { return sequence; } - virtual void setName(const TString& n) { name = n; } - virtual const TString& getName() const { return name; } virtual void traverse(TIntermTraverser*); - virtual void setUserDefined() { userDefined = true; } - virtual bool isUserDefined() { return userDefined; } - virtual TQualifierList& getQualifier() { return qualifier; } + + TIntermSequence& getSequence() { return sequence; } + + void setName(const TString& n) { name = n; } + const TString& getName() const { return name; } + + void setUserDefined() { userDefined = true; } + bool isUserDefined() { return userDefined; } + void setOptimize(bool o) { optimize = o; } - void setDebug(bool d) { debug = d; } bool getOptimize() { return optimize; } + void setDebug(bool d) { debug = d; } bool getDebug() { return debug; } void addToPragmaTable(const TPragmaTable& pTable); const TPragmaTable& getPragmaTable() const { return *pragmaTable; } + protected: TIntermAggregate(const TIntermAggregate&); // disallow copy constructor TIntermAggregate& operator=(const TIntermAggregate&); // disallow assignment operator TIntermSequence sequence; - TQualifierList qualifier; TString name; bool userDefined; // used for user defined function names + bool optimize; bool debug; TPragmaTable *pragmaTable; @@ -423,12 +453,15 @@ public: TIntermTyped(TType(EbtVoid, EbpUndefined)), condition(cond), trueBlock(trueB), falseBlock(falseB) {} TIntermSelection(TIntermTyped* cond, TIntermNode* trueB, TIntermNode* falseB, const TType& type) : TIntermTyped(type), condition(cond), trueBlock(trueB), falseBlock(falseB) {} + virtual void traverse(TIntermTraverser*); + bool usesTernaryOperator() const { return getBasicType() != EbtVoid; } - virtual TIntermNode* getCondition() const { return condition; } - virtual TIntermNode* getTrueBlock() const { return trueBlock; } - virtual TIntermNode* getFalseBlock() const { return falseBlock; } - virtual TIntermSelection* getAsSelectionNode() { return this; } + TIntermNode* getCondition() const { return condition; } + TIntermNode* getTrueBlock() const { return trueBlock; } + TIntermNode* getFalseBlock() const { return falseBlock; } + TIntermSelection* getAsSelectionNode() { return this; } + protected: TIntermTyped* condition; TIntermNode* trueBlock; diff --git a/gfx/angle/src/compiler/localintermediate.h b/gfx/angle/src/compiler/localintermediate.h index 5fd4c696e33..4ea6ff57670 100644 --- a/gfx/angle/src/compiler/localintermediate.h +++ b/gfx/angle/src/compiler/localintermediate.h @@ -44,7 +44,7 @@ public: TIntermBranch* addBranch(TOperator, TSourceLoc); TIntermBranch* addBranch(TOperator, TIntermTyped*, TSourceLoc); TIntermTyped* addSwizzle(TVectorFields&, TSourceLoc); - bool postProcess(TIntermNode*, EShLanguage); + bool postProcess(TIntermNode*); void remove(TIntermNode*); void outputTree(TIntermNode*); diff --git a/gfx/angle/src/compiler/preprocessor/compile.h b/gfx/angle/src/compiler/preprocessor/compile.h index 5bfa9021a1e..69e34258c56 100644 --- a/gfx/angle/src/compiler/preprocessor/compile.h +++ b/gfx/angle/src/compiler/preprocessor/compile.h @@ -89,10 +89,10 @@ struct CPPStruct_Rec { // Globals used to communicate between PaParseStrings() and yy_input()and // also across the files.(gen_glslang.cpp and scanner.c) // - int PaWhichStr; // which string we're parsing - int* PaStrLen; // array of lengths of the PaArgv strings - int PaArgc; // count of strings in the array - char** PaArgv; // our array of strings to parse + int PaWhichStr; // which string we're parsing + const int* PaStrLen; // array of lengths of the PaArgv strings + int PaArgc; // count of strings in the array + const char* const* PaArgv; // our array of strings to parse unsigned int tokensBeforeEOF : 1; }; diff --git a/gfx/angle/src/compiler/preprocessor/preprocess.h b/gfx/angle/src/compiler/preprocessor/preprocess.h index 0602c91e8e6..3fcaa0d668c 100644 --- a/gfx/angle/src/compiler/preprocessor/preprocess.h +++ b/gfx/angle/src/compiler/preprocessor/preprocess.h @@ -47,5 +47,5 @@ extern CPPStruct *cpp; int InitCPPStruct(void); int InitScanner(CPPStruct *cpp); int InitAtomTable(AtomTable *atable, int htsize); -int ScanFromString(char *s); +int ScanFromString(const char *s); char* GetStringOfAtom(AtomTable *atable, int atom); diff --git a/gfx/angle/src/compiler/preprocessor/scanner.c b/gfx/angle/src/compiler/preprocessor/scanner.c index c77d2716a69..c9fc2fa2577 100644 --- a/gfx/angle/src/compiler/preprocessor/scanner.c +++ b/gfx/angle/src/compiler/preprocessor/scanner.c @@ -170,7 +170,7 @@ static void str_ungetch(StringInputSrc *in, int ch, yystypepp *type) { } } // str_ungetch -int ScanFromString(char *s) +int ScanFromString(const char *s) { StringInputSrc *in = malloc(sizeof(StringInputSrc)); diff --git a/gfx/angle/src/compiler/preprocessor/scanner.h b/gfx/angle/src/compiler/preprocessor/scanner.h index 571fe576245..c12c97b30d4 100644 --- a/gfx/angle/src/compiler/preprocessor/scanner.h +++ b/gfx/angle/src/compiler/preprocessor/scanner.h @@ -73,7 +73,7 @@ typedef struct InputSrc { } InputSrc; int InitScanner(CPPStruct *cpp); // Intialise the cpp scanner. -int ScanFromString(char *); // Start scanning the input from the string mentioned. +int ScanFromString(const char *); // Start scanning the input from the string mentioned. int check_EOF(int); // check if we hit a EOF abruptly void CPPErrorToInfoLog(char *); // sticking the msg,line into the Shader's.Info.log void SetLineNumber(int); diff --git a/gfx/angle/src/compiler/tools/COPYING.bison b/gfx/angle/src/compiler/tools/COPYING.bison new file mode 100644 index 00000000000..92851102051 --- /dev/null +++ b/gfx/angle/src/compiler/tools/COPYING.bison @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 675 Mass Ave, Cambridge, MA 02139, USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + Appendix: How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) 19yy + + 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 2 of the License, 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) 19yy name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. diff --git a/gfx/angle/src/compiler/tools/COPYING.flex b/gfx/angle/src/compiler/tools/COPYING.flex new file mode 100644 index 00000000000..9a419abd329 --- /dev/null +++ b/gfx/angle/src/compiler/tools/COPYING.flex @@ -0,0 +1,38 @@ +Flex carries the copyright used for BSD software, slightly modified +because it originated at the Lawrence Berkeley (not Livermore!) Laboratory, +which operates under a contract with the Department of Energy: + + Copyright (c) 1990 The Regents of the University of California. + All rights reserved. + + This code is derived from software contributed to Berkeley by + Vern Paxson. + + The United States Government has rights in this work pursuant + to contract no. DE-AC03-76SF00098 between the United States + Department of Energy and the University of California. + + Redistribution and use in source and binary forms are permitted + provided that: (1) source distributions retain this entire + copyright notice and comment, and (2) distributions including + binaries display the following acknowledgement: ``This product + includes software developed by the University of California, + Berkeley and its contributors'' in the documentation or other + materials provided with the distribution and in all advertising + materials mentioning features or use of this software. Neither the + name of the University nor the names of its contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE. + +This basically says "do whatever you please with this software except +remove this notice or take advantage of the University's (or the flex +authors') name". + +Note that the "flex.skl" scanner skeleton carries no copyright notice. +You are free to do whatever you please with scanners generated using flex; +for them, you are not even bound by the above copyright. diff --git a/gfx/angle/src/compiler/tools/README b/gfx/angle/src/compiler/tools/README new file mode 100644 index 00000000000..1db4ce7867a --- /dev/null +++ b/gfx/angle/src/compiler/tools/README @@ -0,0 +1,14 @@ +The standalone Bison and Flex win32 executables +were created by Wilbur Streett and can be obtained from: +http://userpages.monmouth.com/~wstreett/lex-yacc/lex-yacc.html + +Bison version 1.24: +See COPYING.bison for license information. +The original source distribution for bison can be obtained from the following location: +http://angleproject.googlecode.com/files/bison.zip + +Flex version 2.5.2 +See COPYING.flex for license information. +The original source distribution for flex can be obtained from the following location: +http://angleproject.googlecode.com/files/flex.zip + diff --git a/gfx/angle/src/compiler/tools/bison.exe b/gfx/angle/src/compiler/tools/bison.exe new file mode 100644 index 0000000000000000000000000000000000000000..4881bf604916b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E21F!*_CCSrtQnyCYnsVe@xlm?7aE@>Ws7t{D2R zc;x(S?33U8i0tp~QHQ=CPxeWBmp=csB#@TK5y-==zx*d4EUW|6htvPL+;BQadXOJ! YcfY#-V)nRSdX^UC{nvVu+I#bV0CDn^H~;_u literal 0 HcmV?d00001 diff --git a/gfx/angle/src/compiler/tools/bison.hairy b/gfx/angle/src/compiler/tools/bison.hairy new file mode 100644 index 00000000000..999b55591d0 --- /dev/null +++ b/gfx/angle/src/compiler/tools/bison.hairy @@ -0,0 +1,334 @@ + +extern int timeclock; + + +int yyerror; /* Yyerror and yycost are set by guards. */ +int yycost; /* If yyerror is set to a nonzero value by a */ + /* guard, the reduction with which the guard */ + /* is associated is not performed, and the */ + /* error recovery mechanism is invoked. */ + /* Yycost indicates the cost of performing */ + /* the reduction given the attributes of the */ + /* symbols. */ + + +/* YYMAXDEPTH indicates the size of the parser's state and value */ +/* stacks. */ + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 500 +#endif + +/* YYMAXRULES must be at least as large as the number of rules that */ +/* could be placed in the rule queue. That number could be determined */ +/* from the grammar and the size of the stack, but, as yet, it is not. */ + +#ifndef YYMAXRULES +#define YYMAXRULES 100 +#endif + +#ifndef YYMAXBACKUP +#define YYMAXBACKUP 100 +#endif + + +short yyss[YYMAXDEPTH]; /* the state stack */ +YYSTYPE yyvs[YYMAXDEPTH]; /* the semantic value stack */ +YYLTYPE yyls[YYMAXDEPTH]; /* the location stack */ +short yyrq[YYMAXRULES]; /* the rule queue */ +int yychar; /* the lookahead symbol */ + +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +YYSTYPE yytval; /* the semantic value for the state */ + /* at the top of the state stack. */ + +YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ + +YYLTYPE yytloc; /* location data for the state at the */ + /* top of the state stack */ + + +int yynunlexed; +short yyunchar[YYMAXBACKUP]; +YYSTYPE yyunval[YYMAXBACKUP]; +YYLTYPE yyunloc[YYMAXBACKUP]; + +short *yygssp; /* a pointer to the top of the state */ + /* stack; only set during error */ + /* recovery. */ + +YYSTYPE *yygvsp; /* a pointer to the top of the value */ + /* stack; only set during error */ + /* recovery. */ + +YYLTYPE *yyglsp; /* a pointer to the top of the */ + /* location stack; only set during */ + /* error recovery. */ + + +/* Yyget is an interface between the parser and the lexical analyzer. */ +/* It is costly to provide such an interface, but it avoids requiring */ +/* the lexical analyzer to be able to back up the scan. */ + +yyget() +{ + if (yynunlexed > 0) + { + yynunlexed--; + yychar = yyunchar[yynunlexed]; + yylval = yyunval[yynunlexed]; + yylloc = yyunloc[yynunlexed]; + } + else if (yychar <= 0) + yychar = 0; + else + { + yychar = yylex(); + if (yychar < 0) + yychar = 0; + else yychar = YYTRANSLATE(yychar); + } +} + + + +yyunlex(chr, val, loc) +int chr; +YYSTYPE val; +YYLTYPE loc; +{ + yyunchar[yynunlexed] = chr; + yyunval[yynunlexed] = val; + yyunloc[yynunlexed] = loc; + yynunlexed++; +} + + + +yyrestore(first, last) +register short *first; +register short *last; +{ + register short *ssp; + register short *rp; + register int symbol; + register int state; + register int tvalsaved; + + ssp = yygssp; + yyunlex(yychar, yylval, yylloc); + + tvalsaved = 0; + while (first != last) + { + symbol = yystos[*ssp]; + if (symbol < YYNTBASE) + { + yyunlex(symbol, yytval, yytloc); + tvalsaved = 1; + ssp--; + } + + ssp--; + + if (first == yyrq) + first = yyrq + YYMAXRULES; + + first--; + + for (rp = yyrhs + yyprhs[*first]; symbol = *rp; rp++) + { + if (symbol < YYNTBASE) + state = yytable[yypact[*ssp] + symbol]; + else + { + state = yypgoto[symbol - YYNTBASE] + *ssp; + + if (state >= 0 && state <= YYLAST && yycheck[state] == *ssp) + state = yytable[state]; + else + state = yydefgoto[symbol - YYNTBASE]; + } + + *++ssp = state; + } + } + + if ( ! tvalsaved && ssp > yyss) + { + yyunlex(yystos[*ssp], yytval, yytloc); + ssp--; + } + + yygssp = ssp; +} + + + +int +yyparse() +{ + register int yystate; + register int yyn; + register short *yyssp; + register short *yyrq0; + register short *yyptr; + register YYSTYPE *yyvsp; + + int yylen; + YYLTYPE *yylsp; + short *yyrq1; + short *yyrq2; + + yystate = 0; + yyssp = yyss - 1; + yyvsp = yyvs - 1; + yylsp = yyls - 1; + yyrq0 = yyrq; + yyrq1 = yyrq0; + yyrq2 = yyrq0; + + yychar = yylex(); + if (yychar < 0) + yychar = 0; + else yychar = YYTRANSLATE(yychar); + +yynewstate: + + if (yyssp >= yyss + YYMAXDEPTH - 1) + { + yyabort("Parser Stack Overflow"); + YYABORT; + } + + *++yyssp = yystate; + +yyresume: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + yyn += yychar; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar) + goto yydefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + yystate = yyn; + + yyptr = yyrq2; + while (yyptr != yyrq1) + { + yyn = *yyptr++; + yylen = yyr2[yyn]; + yyvsp -= yylen; + yylsp -= yylen; + + yyguard(yyn, yyvsp, yylsp); + if (yyerror) + goto yysemerr; + + yyaction(yyn, yyvsp, yylsp); + *++yyvsp = yyval; + + yylsp++; + if (yylen == 0) + { + yylsp->timestamp = timeclock; + yylsp->first_line = yytloc.first_line; + yylsp->first_column = yytloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } + + if (yyptr == yyrq + YYMAXRULES) + yyptr = yyrq; + } + + if (yystate == YYFINAL) + YYACCEPT; + + yyrq2 = yyptr; + yyrq1 = yyrq0; + + *++yyvsp = yytval; + *++yylsp = yytloc; + yytval = yylval; + yytloc = yylloc; + yyget(); + + goto yynewstate; + +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +yyreduce: + + *yyrq0++ = yyn; + + if (yyrq0 == yyrq + YYMAXRULES) + yyrq0 = yyrq; + + if (yyrq0 == yyrq2) + { + yyabort("Parser Rule Queue Overflow"); + YYABORT; + } + + yyssp -= yyr2[yyn]; + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yysemerr: + *--yyptr = yyn; + yyrq2 = yyptr; + yyvsp += yyr2[yyn]; + +yyerrlab: + + yygssp = yyssp; + yygvsp = yyvsp; + yyglsp = yylsp; + yyrestore(yyrq0, yyrq2); + yyrecover(); + yystate = *yygssp; + yyssp = yygssp; + yyvsp = yygvsp; + yyrq0 = yyrq; + yyrq1 = yyrq0; + yyrq2 = yyrq0; + goto yyresume; +} + +$ diff --git a/gfx/angle/src/compiler/tools/bison.simple b/gfx/angle/src/compiler/tools/bison.simple new file mode 100644 index 00000000000..08acea80a3f --- /dev/null +++ b/gfx/angle/src/compiler/tools/bison.simple @@ -0,0 +1,699 @@ +/* -*-C-*- Note some compilers choke on comments on `#line' lines. */ + +/* Skeleton output parser for bison, + Copyright (C) 1984, 1989, 1990 Free Software Foundation, Inc. + + 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 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, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* As a special exception, when this file is copied by Bison into a + Bison output file, you may use that output file without restriction. + This special exception was added by the Free Software Foundation + in version 1.24 of Bison. */ + +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not __GNUC__ */ +#if HAVE_ALLOCA_H +#include +#else /* not HAVE_ALLOCA_H */ +#ifdef _AIX + #pragma alloca +#else /* not _AIX */ +char *alloca (); +#endif /* not _AIX */ +#endif /* not HAVE_ALLOCA_H */ +#endif /* not __GNUC__ */ + +extern void yyerror(char* s); + +#ifndef alloca +#ifdef __GNUC__ +#define alloca __builtin_alloca +#else /* not GNU C. */ +#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi) +#include +#else /* not sparc */ +#if (defined (MSDOS) && !defined (__TURBOC__)) || defined (WIN32) +#include +#else /* not MSDOS, or __TURBOC__ */ +#if defined(_AIX) +#include + #pragma alloca +#else /* not MSDOS, __TURBOC__, or _AIX */ +#ifdef __hpux +#ifdef __cplusplus +extern "C" { +void *alloca (unsigned int); +}; +#else /* not __cplusplus */ +void *alloca (); +#endif /* not __cplusplus */ +#endif /* __hpux */ +#endif /* not _AIX */ +#endif /* not MSDOS, or __TURBOC__ */ +#endif /* not sparc. */ +#endif /* not GNU C. */ +#endif /* alloca not defined. */ + +/* This is the parser code that is written into each bison parser + when the %semantic_parser declaration is not specified in the grammar. + It was written by Richard Stallman by simplifying the hairy parser + used when %semantic_parser is specified. */ + +/* Note: there must be only one dollar sign in this file. + It is replaced by the list of actions, each action + as one case of the switch. */ + +#define yyerrok (yyerrstatus = 0) +#define yyclearin (yychar = YYEMPTY) +#define YYEMPTY -2 +#define YYEOF 0 +#define YYACCEPT return(0) +#define YYABORT return(1) +#define YYERROR goto yyerrlab1 +/* Like YYERROR except do call yyerror. + This remains here temporarily to ease the + transition to the new meaning of YYERROR, for GCC. + Once GCC version 2 has supplanted version 1, this can go. */ +#define YYFAIL goto yyerrlab +#define YYRECOVERING() (!!yyerrstatus) +#define YYBACKUP(token, value) \ +do \ + if (yychar == YYEMPTY && yylen == 1) \ + { yychar = (token), yylval = (value); \ + yychar1 = YYTRANSLATE (yychar); \ + YYPOPSTACK; \ + goto yybackup; \ + } \ + else \ + { yyerror ("syntax error: cannot back up"); YYERROR; } \ +while (0) + +#define YYTERROR 1 +#define YYERRCODE 256 + +#ifndef YYPURE +#define YYLEX yylex() +#endif + +#ifdef YYPURE +#ifdef YYLSP_NEEDED +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, &yylloc, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval, &yylloc) +#endif +#else /* not YYLSP_NEEDED */ +#ifdef YYLEX_PARAM +#define YYLEX yylex(&yylval, YYLEX_PARAM) +#else +#define YYLEX yylex(&yylval) +#endif +#endif /* not YYLSP_NEEDED */ +#endif + +/* If nonreentrant, generate the variables here */ + +#ifndef YYPURE + +int yychar; /* the lookahead symbol */ +YYSTYPE yylval; /* the semantic value of the */ + /* lookahead symbol */ + +#ifdef YYLSP_NEEDED +YYLTYPE yylloc; /* location data for the lookahead */ + /* symbol */ +#endif + +int yynerrs; /* number of parse errors so far */ +#endif /* not YYPURE */ + +#if YYDEBUG != 0 +int yydebug; /* nonzero means print parse trace */ +/* Since this is uninitialized, it does not stop multiple parsers + from coexisting. */ +#endif + +/* YYINITDEPTH indicates the initial size of the parser's stacks */ + +#ifndef YYINITDEPTH +#define YYINITDEPTH 200 +#endif + +/* YYMAXDEPTH is the maximum size the stacks can grow to + (effective only if the built-in stack extension method is used). */ + +#if YYMAXDEPTH == 0 +#undef YYMAXDEPTH +#endif + +#ifndef YYMAXDEPTH +#define YYMAXDEPTH 10000 +#endif + +/* Prevent warning if -Wstrict-prototypes. */ +#ifdef __GNUC__ +int yyparse (void); +#endif + +#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */ +#define __yy_memcpy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT) +#else /* not GNU C or C++ */ +#ifndef __cplusplus + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (from, to, count) + char *from; + char *to; + size_t count; +{ + register char *f = from; + register char *t = to; + register size_t i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#else /* __cplusplus */ + +/* This is the most reliable way to avoid incompatibilities + in available built-in functions on various systems. */ +static void +__yy_memcpy (char *from, char *to, size_t count) +{ + register char *f = from; + register char *t = to; + register size_t i = count; + + while (i-- > 0) + *t++ = *f++; +} + +#endif +#endif + +/* The user can define YYPARSE_PARAM as the name of an argument to be passed + into yyparse. The argument should have type void *. + It should actually point to an object. + Grammar actions can access the variable by casting it + to the proper pointer type. */ + +#ifdef YYPARSE_PARAM +#ifndef YYPARSE_PARAM_DECL +#define YYPARSE_PARAM_DECL void *YYPARSE_PARAM; +#endif +#else +#define YYPARSE_PARAM +#define YYPARSE_PARAM_DECL +#endif + +extern YY_DECL; + +int +yyparse(YYPARSE_PARAM_DECL YYPARSE_PARAM) { + register int yystate; + register int yyn; + register short *yyssp; + register YYSTYPE *yyvsp; + int yyerrstatus; /* number of tokens to shift before error messages enabled */ + int yychar1 = 0; /* lookahead token as an internal (translated) token number */ + + short yyssa[YYINITDEPTH]; /* the state stack */ + YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */ + + short *yyss = yyssa; /* refer to the stacks thru separate pointers */ + YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */ + +#ifdef YYLSP_NEEDED + YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */ + YYLTYPE *yyls = yylsa; + YYLTYPE *yylsp; + +#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--) +#else +#define YYPOPSTACK (yyvsp--, yyssp--) +#endif + + size_t yystacksize = YYINITDEPTH; + +#ifdef YYPURE + int yychar; + YYSTYPE yylval; + int yynerrs; +#ifdef YYLSP_NEEDED + YYLTYPE yylloc; +#endif +#endif + + YYSTYPE yyval; /* the variable used to return */ + /* semantic values from the action */ + /* routines */ + + int yylen; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Starting parse\n"); +#endif + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + 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 - 1; + yyvsp = yyvs; +#ifdef YYLSP_NEEDED + yylsp = yyls; +#endif + +/* Push a new state, which is found in yystate . */ +/* In all cases, when you get here, the value and location stacks + have just been pushed. so pushing a state here evens the stacks. */ +yynewstate: + + *++yyssp = yystate; + + if (yyssp >= yyss + yystacksize - 1) + { + /* Give user a chance to reallocate the stack */ + /* Use copies of these so that the &'s don't force the real ones into memory. */ + YYSTYPE *yyvs1 = yyvs; + short *yyss1 = yyss; +#ifdef YYLSP_NEEDED + YYLTYPE *yyls1 = yyls; +#endif + + /* Get the current used size of the three stacks, in elements. */ + size_t size = yyssp - yyss + 1; + +#ifdef yyoverflow + /* Each stack pointer address is followed by the size of + the data in use in that stack, in bytes. */ +#ifdef YYLSP_NEEDED + /* This used to be a conditional around just the two extra args, + but that might be undefined if yyoverflow is a macro. */ + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yyls1, size * sizeof (*yylsp), + &yystacksize); +#else + yyoverflow("parser stack overflow", + &yyss1, size * sizeof (*yyssp), + &yyvs1, size * sizeof (*yyvsp), + &yystacksize); +#endif + + yyss = yyss1; yyvs = yyvs1; +#ifdef YYLSP_NEEDED + yyls = yyls1; +#endif +#else /* no yyoverflow */ + /* Extend the stack our own way. */ + if (yystacksize >= YYMAXDEPTH) + { + yyerror("parser stack overflow"); + return 2; + } + yystacksize *= 2; + if (yystacksize > YYMAXDEPTH) + yystacksize = YYMAXDEPTH; + yyss = (short *) alloca (yystacksize * sizeof (*yyssp)); + __yy_memcpy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp)); + yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp)); + __yy_memcpy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp)); +#ifdef YYLSP_NEEDED + yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp)); + __yy_memcpy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp)); +#endif +#endif /* no yyoverflow */ + + yyssp = yyss + size - 1; + yyvsp = yyvs + size - 1; +#ifdef YYLSP_NEEDED + yylsp = yyls + size - 1; +#endif + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Stack size increased to %d\n", yystacksize); +#endif + + if (yyssp >= yyss + yystacksize - 1) + YYABORT; + } + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Entering state %d\n", yystate); +#endif + + goto yybackup; + yybackup: + +/* Do appropriate processing given the current state. */ +/* Read a lookahead token if we need one and don't already have one. */ +/* yyresume: */ + + /* First try to decide what to do without reference to lookahead token. */ + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yydefault; + + /* Not known => get a lookahead token if don't already have one. */ + + /* yychar is either YYEMPTY or YYEOF + or a valid token in external form. */ + + if (yychar == YYEMPTY) + { +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Reading a token: "); +#endif + yychar = YYLEX; + } + + /* Convert token to internal form (in yychar1) for indexing tables with */ + + if (yychar <= 0) /* This means end of input. */ + { + yychar1 = 0; + yychar = YYEOF; /* Don't call YYLEX any more */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Now at end of input.\n"); +#endif + } + else + { + yychar1 = YYTRANSLATE(yychar); + +#if YYDEBUG != 0 + if (yydebug) + { + fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]); + /* Give the individual parser a way to print the precise meaning + of a token, for further debugging info. */ +#ifdef YYPRINT + YYPRINT (stderr, yychar, yylval); +#endif + fprintf (stderr, ")\n"); + } +#endif + } + + yyn += yychar1; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1) + goto yydefault; + + yyn = yytable[yyn]; + + /* yyn is what to do for this token type in this state. + Negative => reduce, -yyn is rule number. + Positive => shift, yyn is new state. + New state is final state => don't bother to shift, + just return success. + 0, or most negative number => error. */ + + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrlab; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrlab; + + if (yyn == YYFINAL) + YYACCEPT; + + /* Shift the lookahead token. */ + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]); +#endif + + /* Discard the token being shifted unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + /* count tokens shifted since error; after three, turn off error status. */ + if (yyerrstatus) yyerrstatus--; + + yystate = yyn; + goto yynewstate; + +/* Do the default action for the current state. */ +yydefault: + + yyn = yydefact[yystate]; + if (yyn == 0) + goto yyerrlab; + +/* Do a reduction. yyn is the number of a rule to reduce with. */ +yyreduce: + yylen = yyr2[yyn]; + if (yylen > 0) + yyval = yyvsp[1-yylen]; /* implement default value of the action */ + +#if YYDEBUG != 0 + if (yydebug) + { + int i; + + fprintf (stderr, "Reducing via rule %d (line %d), ", + yyn, yyrline[yyn]); + + /* Print the symbols being reduced, and their result. */ + for (i = yyprhs[yyn]; yyrhs[i] > 0; i++) + fprintf (stderr, "%s ", yytname[yyrhs[i]]); + fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]); + } +#endif + +$ /* the action file gets copied in in place of this dollarsign */ + yyvsp -= yylen; + yyssp -= yylen; +#ifdef YYLSP_NEEDED + yylsp -= yylen; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + + *++yyvsp = yyval; + +#ifdef YYLSP_NEEDED + yylsp++; + if (yylen == 0) + { + yylsp->first_line = yylloc.first_line; + yylsp->first_column = yylloc.first_column; + yylsp->last_line = (yylsp-1)->last_line; + yylsp->last_column = (yylsp-1)->last_column; + yylsp->text = 0; + } + else + { + yylsp->last_line = (yylsp+yylen-1)->last_line; + yylsp->last_column = (yylsp+yylen-1)->last_column; + } +#endif + + /* Now "shift" the result of the reduction. + Determine what state that goes to, + based on the state we popped back to + and the rule number reduced by. */ + + yyn = yyr1[yyn]; + + yystate = yypgoto[yyn - YYNTBASE] + *yyssp; + if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp) + yystate = yytable[yystate]; + else + yystate = yydefgoto[yyn - YYNTBASE]; + + goto yynewstate; + +yyerrlab: /* here on detecting error */ + + if (! yyerrstatus) + /* If not already recovering from an error, report this error. */ + { + ++yynerrs; + +#ifdef YYERROR_VERBOSE + yyn = yypact[yystate]; + + if (yyn > YYFLAG && yyn < YYLAST) + { + int size = 0; + char *msg; + int x, count; + + count = 0; + /* Start X at -yyn if nec to avoid negative indexes in yycheck. */ + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + size += strlen(yytname[x]) + 15, count++; + msg = (char *) malloc(size + 15); + if (msg != 0) + { + strcpy(msg, "parse error"); + + if (count < 5) + { + count = 0; + for (x = (yyn < 0 ? -yyn : 0); + x < (sizeof(yytname) / sizeof(char *)); x++) + if (yycheck[x + yyn] == x) + { + strcat(msg, count == 0 ? ", expecting `" : " or `"); + strcat(msg, yytname[x]); + strcat(msg, "'"); + count++; + } + } + yyerror(msg); + free(msg); + } + else + yyerror ("parse error; also virtual memory exceeded"); + } + else +#endif /* YYERROR_VERBOSE */ + yyerror("parse error"); + } + + goto yyerrlab1; +yyerrlab1: /* here on error raised explicitly by an action */ + + if (yyerrstatus == 3) + { + /* if just tried and failed to reuse lookahead token after an error, discard it. */ + + /* return failure if at end of input */ + if (yychar == YYEOF) + YYABORT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]); +#endif + + yychar = YYEMPTY; + } + + /* Else will try to reuse lookahead token + after shifting the error token. */ + + yyerrstatus = 3; /* Each real token shifted decrements this */ + + goto yyerrhandle; + +yyerrdefault: /* current state does not do anything special for the error token. */ + +#if 0 + /* This is wrong; only states that explicitly want error tokens + should shift them. */ + yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/ + if (yyn) goto yydefault; +#endif + +yyerrpop: /* pop the current state because it cannot handle the error token */ + + if (yyssp == yyss) YYABORT; + yyvsp--; + yystate = *--yyssp; +#ifdef YYLSP_NEEDED + yylsp--; +#endif + +#if YYDEBUG != 0 + if (yydebug) + { + short *ssp1 = yyss - 1; + fprintf (stderr, "Error: state stack now"); + while (ssp1 != yyssp) + fprintf (stderr, " %d", *++ssp1); + fprintf (stderr, "\n"); + } +#endif + +yyerrhandle: + + yyn = yypact[yystate]; + if (yyn == YYFLAG) + goto yyerrdefault; + + yyn += YYTERROR; + if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR) + goto yyerrdefault; + + yyn = yytable[yyn]; + if (yyn < 0) + { + if (yyn == YYFLAG) + goto yyerrpop; + yyn = -yyn; + goto yyreduce; + } + else if (yyn == 0) + goto yyerrpop; + + if (yyn == YYFINAL) + YYACCEPT; + +#if YYDEBUG != 0 + if (yydebug) + fprintf(stderr, "Shifting error token, "); +#endif + + *++yyvsp = yylval; +#ifdef YYLSP_NEEDED + *++yylsp = yylloc; +#endif + + yystate = yyn; + goto yynewstate; +} diff --git a/gfx/angle/src/compiler/tools/flex.exe b/gfx/angle/src/compiler/tools/flex.exe new file mode 100644 index 0000000000000000000000000000000000000000..58f10ce3561e8b693e3e4d3ef247bc6507c38608 GIT binary patch literal 181248 zcmeFa4Rlo1)i-{V%)kgUOu$5=BpPc}6tJm*N}5Cih7T*&34vghFD=?DrHVSESVKrU ziOu9D6f3pZTI)EprIlK$v`$Q#v+8% z0Mk`{CjJU)!gZv<@~t{Pkuj^OLQ@FvALh;czj zV*u{=Xd7#pkk@_TZ8t2uyJAqkQbzo(aa%Q46vxA94}kffva|!y)l#60HHB*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QV?#a{R`)#2k1I@NFF|*ztXNU3f|62knOuCPTJ)(B@tTtH@7steVyf7cIdf_7 zz5aaHU@(2qk#w-eF^^}mI8~g%OrH7w@_>ImFm;)_N?m)?1N)Z;{BPs|;KMj@f<-(| zM93ZTM^$k%$P&(xI0d3yjL<}wkwvJ&da+ + + @@ -261,6 +265,10 @@ RelativePath=".\SymbolTable.cpp" > + + @@ -403,6 +411,10 @@ RelativePath=".\unistd.h" > + + diff --git a/gfx/angle/src/libEGL/Display.cpp b/gfx/angle/src/libEGL/Display.cpp index 24d80a5bf31..c95e1f66b80 100644 --- a/gfx/angle/src/libEGL/Display.cpp +++ b/gfx/angle/src/libEGL/Display.cpp @@ -17,7 +17,8 @@ #include "libEGL/main.h" -#define REF_RAST 0 // Can also be enabled by defining FORCE_REF_RAST in the project's predefined macros +#define REF_RAST 0 // Can also be enabled by defining FORCE_REF_RAST in the project's predefined macros +#define ENABLE_D3D9EX 1 // Enables use of the IDirect3D9Ex interface, when available namespace egl { @@ -40,7 +41,6 @@ Display::Display(HDC deviceContext) : mDc(deviceContext) mMinSwapInterval = 1; mMaxSwapInterval = 1; - setSwapInterval(1); } Display::~Display() @@ -77,7 +77,7 @@ bool Display::initialize() // Use Direct3D9Ex if available. Among other things, this version is less // inclined to report a lost context, for example when the user switches // desktop. Direct3D9Ex is available in Windows Vista and later if suitable drivers are available. - if (Direct3DCreate9ExPtr && SUCCEEDED(Direct3DCreate9ExPtr(D3D_SDK_VERSION, &mD3d9ex))) + if (ENABLE_D3D9EX && Direct3DCreate9ExPtr && SUCCEEDED(Direct3DCreate9ExPtr(D3D_SDK_VERSION, &mD3d9ex))) { ASSERT(mD3d9ex); mD3d9ex->QueryInterface(IID_IDirect3D9, reinterpret_cast(&mD3d9)); @@ -95,12 +95,24 @@ bool Display::initialize() // UNIMPLEMENTED(); // FIXME: Determine which adapter index the device context corresponds to } - HRESULT result = mD3d9->GetDeviceCaps(mAdapter, mDeviceType, &mDeviceCaps); - - if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) + HRESULT result; + + do { - return error(EGL_BAD_ALLOC, false); + result = mD3d9->GetDeviceCaps(mAdapter, mDeviceType, &mDeviceCaps); + + if (result == D3DERR_NOTAVAILABLE) + { + Sleep(0); // Give the driver some time to initialize/recover + } + else if (FAILED(result)) // D3DERR_OUTOFVIDEOMEMORY, E_OUTOFMEMORY, D3DERR_INVALIDDEVICE, or another error we can't recover from + { + return error(EGL_BAD_ALLOC, false); + } } + while(result == D3DERR_NOTAVAILABLE); + + ASSERT(SUCCEEDED(result)); if (mDeviceCaps.PixelShaderVersion < D3DPS_VERSION(2, 0)) { @@ -164,7 +176,7 @@ bool Display::initialize() if (SUCCEEDED(result)) { - // FIXME: Enumerate multi-sampling + // FIXME: enumerate multi-sampling configSet.add(currentDisplayMode, mMinSwapInterval, mMaxSwapInterval, renderTargetFormat, depthStencilFormat, 0); } @@ -183,13 +195,6 @@ bool Display::initialize() mConfigSet.mSet.insert(configuration); } - - if (!createDevice()) - { - terminate(); - - return false; - } } if (!isInitialized()) @@ -199,23 +204,34 @@ bool Display::initialize() return false; } + static const TCHAR windowName[] = TEXT("AngleHiddenWindow"); + static const TCHAR className[] = TEXT("STATIC"); + + mDeviceWindow = CreateWindowEx(WS_EX_NOACTIVATE, className, windowName, WS_DISABLED | WS_POPUP, 0, 0, 1, 1, HWND_MESSAGE, NULL, GetModuleHandle(NULL), NULL); + return true; } void Display::terminate() { - for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++) + while (!mSurfaceSet.empty()) { - delete *surface; + destroySurface(*mSurfaceSet.begin()); } - for (ContextSet::iterator context = mContextSet.begin(); context != mContextSet.end(); context++) + while (!mContextSet.empty()) { - glDestroyContext(*context); + destroyContext(*mContextSet.begin()); } if (mDevice) { + // If the device is lost, reset it first to prevent leaving the driver in an unstable state + if (FAILED(mDevice->TestCooperativeLevel())) + { + resetDevice(); + } + mDevice->Release(); mDevice = NULL; } @@ -314,33 +330,12 @@ bool Display::getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value) bool Display::createDevice() { - static const TCHAR windowName[] = TEXT("AngleHiddenWindow"); - static const TCHAR className[] = TEXT("STATIC"); - - mDeviceWindow = CreateWindowEx(WS_EX_NOACTIVATE, className, windowName, WS_DISABLED | WS_POPUP, 0, 0, 1, 1, HWND_MESSAGE, NULL, GetModuleHandle(NULL), NULL); - - D3DPRESENT_PARAMETERS presentParameters = {0}; - - // The default swap chain is never actually used. Surface will create a new swap chain with the proper parameters. - presentParameters.AutoDepthStencilFormat = D3DFMT_UNKNOWN; - presentParameters.BackBufferCount = 1; - presentParameters.BackBufferFormat = D3DFMT_UNKNOWN; - presentParameters.BackBufferWidth = 1; - presentParameters.BackBufferHeight = 1; - presentParameters.EnableAutoDepthStencil = FALSE; - presentParameters.Flags = 0; - presentParameters.hDeviceWindow = mDeviceWindow; - presentParameters.MultiSampleQuality = 0; - presentParameters.MultiSampleType = D3DMULTISAMPLE_NONE; - presentParameters.PresentationInterval = convertInterval(mMinSwapInterval); - presentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD; - presentParameters.Windowed = TRUE; - + D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters(); DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE | D3DCREATE_NOWINDOWCHANGES; HRESULT result = mD3d9->CreateDevice(mAdapter, mDeviceType, mDeviceWindow, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &presentParameters, &mDevice); - if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) + if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DEVICELOST) { return error(EGL_BAD_ALLOC, false); } @@ -349,14 +344,13 @@ bool Display::createDevice() { result = mD3d9->CreateDevice(mAdapter, mDeviceType, mDeviceWindow, behaviorFlags | D3DCREATE_SOFTWARE_VERTEXPROCESSING, &presentParameters, &mDevice); - if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) + if (FAILED(result)) { + ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_NOTAVAILABLE || result == D3DERR_DEVICELOST); return error(EGL_BAD_ALLOC, false); } } - ASSERT(SUCCEEDED(result)); - // Permanent non-default states mDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE); @@ -365,6 +359,29 @@ bool Display::createDevice() return true; } +bool Display::resetDevice() +{ + D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters(); + HRESULT result; + + do + { + Sleep(0); // Give the graphics driver some CPU time + + result = mDevice->Reset(&presentParameters); + } + while (result == D3DERR_DEVICELOST); + + if (FAILED(result)) + { + return error(EGL_BAD_ALLOC, false); + } + + ASSERT(SUCCEEDED(result)); + + return true; +} + Surface *Display::createWindowSurface(HWND window, EGLConfig config) { const Config *configuration = mConfigSet.get(config); @@ -377,6 +394,27 @@ Surface *Display::createWindowSurface(HWND window, EGLConfig config) EGLContext Display::createContext(EGLConfig configHandle, const gl::Context *shareContext) { + if (!mDevice) + { + if (!createDevice()) + { + return NULL; + } + } + else if (FAILED(mDevice->TestCooperativeLevel())) // Lost device + { + if (!resetDevice()) + { + return NULL; + } + + // Restore any surfaces that may have been lost + for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++) + { + (*surface)->resetSwapChain(); + } + } + const egl::Config *config = mConfigSet.get(configHandle); gl::Context *context = glCreateContext(config, shareContext); @@ -395,6 +433,14 @@ void Display::destroyContext(gl::Context *context) { glDestroyContext(context); mContextSet.erase(context); + + if (mContextSet.empty() && mDevice && FAILED(mDevice->TestCooperativeLevel())) // Last context of a lost device + { + for (SurfaceSet::iterator surface = mSurfaceSet.begin(); surface != mSurfaceSet.end(); surface++) + { + (*surface)->release(); + } + } } bool Display::isInitialized() @@ -430,37 +476,26 @@ bool Display::hasExistingWindowSurface(HWND window) return false; } -void Display::setSwapInterval(GLint interval) +EGLint Display::getMinSwapInterval() { - mSwapInterval = interval; - mSwapInterval = std::max(mSwapInterval, mMinSwapInterval); - mSwapInterval = std::min(mSwapInterval, mMaxSwapInterval); - - mPresentInterval = convertInterval(mSwapInterval); + return mMinSwapInterval; } -DWORD Display::getPresentInterval() +EGLint Display::getMaxSwapInterval() { - return mPresentInterval; -} - -DWORD Display::convertInterval(GLint interval) -{ - switch(interval) - { - case 0: return D3DPRESENT_INTERVAL_IMMEDIATE; - case 1: return D3DPRESENT_INTERVAL_ONE; - case 2: return D3DPRESENT_INTERVAL_TWO; - case 3: return D3DPRESENT_INTERVAL_THREE; - case 4: return D3DPRESENT_INTERVAL_FOUR; - default: UNREACHABLE(); - } - - return D3DPRESENT_INTERVAL_DEFAULT; + return mMaxSwapInterval; } IDirect3DDevice9 *Display::getDevice() { + if (!mDevice) + { + if (!createDevice()) + { + return NULL; + } + } + return mDevice; } @@ -468,4 +503,113 @@ D3DCAPS9 Display::getDeviceCaps() { return mDeviceCaps; } + +void Display::getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray) +{ + for (int multiSampleIndex = 0; multiSampleIndex <= D3DMULTISAMPLE_16_SAMPLES; multiSampleIndex++) + { + HRESULT result = mD3d9->CheckDeviceMultiSampleType(mAdapter, mDeviceType, format, + TRUE, (D3DMULTISAMPLE_TYPE)multiSampleIndex, NULL); + + multiSampleArray[multiSampleIndex] = SUCCEEDED(result); + } } + +bool Display::getCompressedTextureSupport() +{ + D3DDISPLAYMODE currentDisplayMode; + mD3d9->GetAdapterDisplayMode(mAdapter, ¤tDisplayMode); + + return SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_DXT1)); +} + +bool Display::getFloatTextureSupport(bool *filtering, bool *renderable) +{ + D3DDISPLAYMODE currentDisplayMode; + mD3d9->GetAdapterDisplayMode(mAdapter, ¤tDisplayMode); + + *filtering = SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_QUERY_FILTER, + D3DRTYPE_TEXTURE, D3DFMT_A32B32G32R32F)) && + SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_QUERY_FILTER, + D3DRTYPE_CUBETEXTURE, D3DFMT_A32B32G32R32F)); + + *renderable = SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_RENDERTARGET, + D3DRTYPE_TEXTURE, D3DFMT_A32B32G32R32F))&& + SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_RENDERTARGET, + D3DRTYPE_CUBETEXTURE, D3DFMT_A32B32G32R32F)); + + if (!filtering && !renderable) + { + return SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, + D3DRTYPE_TEXTURE, D3DFMT_A32B32G32R32F)) && + SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, + D3DRTYPE_CUBETEXTURE, D3DFMT_A32B32G32R32F)); + } + else + { + return true; + } +} + +bool Display::getHalfFloatTextureSupport(bool *filtering, bool *renderable) +{ + D3DDISPLAYMODE currentDisplayMode; + mD3d9->GetAdapterDisplayMode(mAdapter, ¤tDisplayMode); + + *filtering = SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_QUERY_FILTER, + D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16F)) && + SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_QUERY_FILTER, + D3DRTYPE_CUBETEXTURE, D3DFMT_A16B16G16R16F)); + + *renderable = SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_RENDERTARGET, + D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16F)) && + SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, D3DUSAGE_RENDERTARGET, + D3DRTYPE_CUBETEXTURE, D3DFMT_A16B16G16R16F)); + + if (!filtering && !renderable) + { + return SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, + D3DRTYPE_TEXTURE, D3DFMT_A16B16G16R16F)) && + SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, + D3DRTYPE_CUBETEXTURE, D3DFMT_A16B16G16R16F)); + } + else + { + return true; + } +} + +bool Display::getEventQuerySupport() +{ + IDirect3DQuery9 *query; + HRESULT result = mDevice->CreateQuery(D3DQUERYTYPE_EVENT, &query); + if (SUCCEEDED(result)) + { + query->Release(); + } + + return result != D3DERR_NOTAVAILABLE; +} + +D3DPRESENT_PARAMETERS Display::getDefaultPresentParameters() +{ + D3DPRESENT_PARAMETERS presentParameters = {0}; + + // The default swap chain is never actually used. Surface will create a new swap chain with the proper parameters. + presentParameters.AutoDepthStencilFormat = D3DFMT_UNKNOWN; + presentParameters.BackBufferCount = 1; + presentParameters.BackBufferFormat = D3DFMT_UNKNOWN; + presentParameters.BackBufferWidth = 1; + presentParameters.BackBufferHeight = 1; + presentParameters.EnableAutoDepthStencil = FALSE; + presentParameters.Flags = 0; + presentParameters.hDeviceWindow = mDeviceWindow; + presentParameters.MultiSampleQuality = 0; + presentParameters.MultiSampleType = D3DMULTISAMPLE_NONE; + presentParameters.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT; + presentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD; + presentParameters.Windowed = TRUE; + + return presentParameters; +} +} \ No newline at end of file diff --git a/gfx/angle/src/libEGL/Display.h b/gfx/angle/src/libEGL/Display.h index b4fac3f75a1..44989f1ced9 100644 --- a/gfx/angle/src/libEGL/Display.h +++ b/gfx/angle/src/libEGL/Display.h @@ -54,15 +54,22 @@ class Display bool isValidSurface(egl::Surface *surface); bool hasExistingWindowSurface(HWND window); - void setSwapInterval(GLint interval); - DWORD getPresentInterval(); - static DWORD convertInterval(GLint interval); + EGLint getMinSwapInterval(); + EGLint getMaxSwapInterval(); virtual IDirect3DDevice9 *getDevice(); virtual D3DCAPS9 getDeviceCaps(); + virtual void getMultiSampleSupport(D3DFORMAT format, bool *multiSampleArray); + virtual bool getCompressedTextureSupport(); + virtual bool getEventQuerySupport(); + virtual bool getFloatTextureSupport(bool *filtering, bool *renderable); + virtual bool getHalfFloatTextureSupport(bool *filtering, bool *renderable); private: DISALLOW_COPY_AND_ASSIGN(Display); + + D3DPRESENT_PARAMETERS getDefaultPresentParameters(); + const HDC mDc; HMODULE mD3d9Module; @@ -76,11 +83,9 @@ class Display HWND mDeviceWindow; bool mSceneStarted; - GLint mSwapInterval; EGLint mMaxSwapInterval; EGLint mMinSwapInterval; - DWORD mPresentInterval; - + typedef std::set SurfaceSet; SurfaceSet mSurfaceSet; @@ -90,6 +95,7 @@ class Display ContextSet mContextSet; bool createDevice(); + bool resetDevice(); }; } diff --git a/gfx/angle/src/libEGL/Surface.cpp b/gfx/angle/src/libEGL/Surface.cpp index 1acc46e06e0..b1a2ddb0353 100644 --- a/gfx/angle/src/libEGL/Surface.cpp +++ b/gfx/angle/src/libEGL/Surface.cpp @@ -31,45 +31,59 @@ Surface::Surface(Display *display, const Config *config, HWND window) mPixelAspectRatio = (EGLint)(1.0 * EGL_DISPLAY_SCALING); // FIXME: Determine actual pixel aspect ratio mRenderBuffer = EGL_BACK_BUFFER; mSwapBehavior = EGL_BUFFER_PRESERVED; + mSwapInterval = -1; + setSwapInterval(1); resetSwapChain(); } Surface::~Surface() +{ + release(); +} + +void Surface::release() { if (mSwapChain) { mSwapChain->Release(); + mSwapChain = NULL; } if (mBackBuffer) { mBackBuffer->Release(); + mBackBuffer = NULL; } if (mRenderTarget) { mRenderTarget->Release(); + mRenderTarget = NULL; } if (mDepthStencil) { mDepthStencil->Release(); + mDepthStencil = NULL; } if (mFlipTexture) { mFlipTexture->Release(); + mFlipTexture = NULL; } if (mFlipState) { mFlipState->Release(); + mFlipState = NULL; } if (mPreFlipState) { mPreFlipState->Release(); + mPreFlipState = NULL; } } @@ -77,6 +91,11 @@ void Surface::resetSwapChain() { IDirect3DDevice9 *device = mDisplay->getDevice(); + if (device == NULL) + { + return; + } + D3DPRESENT_PARAMETERS presentParameters = {0}; presentParameters.AutoDepthStencilFormat = mConfig->mDepthStencilFormat; @@ -87,12 +106,17 @@ void Surface::resetSwapChain() presentParameters.hDeviceWindow = getWindowHandle(); presentParameters.MultiSampleQuality = 0; // FIXME: Unimplemented presentParameters.MultiSampleType = D3DMULTISAMPLE_NONE; // FIXME: Unimplemented - presentParameters.PresentationInterval = Display::convertInterval(mConfig->mMinSwapInterval); + presentParameters.PresentationInterval = mPresentInterval; presentParameters.SwapEffect = D3DSWAPEFFECT_DISCARD; presentParameters.Windowed = TRUE; RECT windowRect; - GetClientRect(getWindowHandle(), &windowRect); + if (!GetClientRect(getWindowHandle(), &windowRect)) + { + ASSERT(false); + return; + } + presentParameters.BackBufferWidth = windowRect.right - windowRect.left; presentParameters.BackBufferHeight = windowRect.bottom - windowRect.top; @@ -173,6 +197,8 @@ void Surface::resetSwapChain() mRenderTarget = renderTarget; mFlipTexture = flipTexture; + mPresentIntervalDirty = false; + // The flip state block recorded mFlipTexture so it is now invalid. releaseRecordedState(device); } @@ -305,11 +331,16 @@ void Surface::releaseRecordedState(IDirect3DDevice9 *device) } } -bool Surface::checkForWindowResize() +bool Surface::checkForOutOfDateSwapChain() { RECT client; - GetClientRect(getWindowHandle(), &client); - if (getWidth() != client.right - client.left || getHeight() != client.bottom - client.top) + if (!GetClientRect(getWindowHandle(), &client)) + { + ASSERT(false); + return false; + } + + if (getWidth() != client.right - client.left || getHeight() != client.bottom - client.top || mPresentIntervalDirty) { resetSwapChain(); @@ -324,6 +355,22 @@ bool Surface::checkForWindowResize() return false; } +DWORD Surface::convertInterval(EGLint interval) +{ + switch(interval) + { + case 0: return D3DPRESENT_INTERVAL_IMMEDIATE; + case 1: return D3DPRESENT_INTERVAL_ONE; + case 2: return D3DPRESENT_INTERVAL_TWO; + case 3: return D3DPRESENT_INTERVAL_THREE; + case 4: return D3DPRESENT_INTERVAL_FOUR; + default: UNREACHABLE(); + } + + return D3DPRESENT_INTERVAL_DEFAULT; +} + + bool Surface::swap() { if (mSwapChain) @@ -337,7 +384,7 @@ bool Surface::swap() EGLint oldWidth = mWidth; EGLint oldHeight = mHeight; - checkForWindowResize(); + checkForOutOfDateSwapChain(); IDirect3DDevice9 *device = mDisplay->getDevice(); @@ -370,7 +417,7 @@ bool Surface::swap() restoreState(device); mDisplay->endScene(); - HRESULT result = mSwapChain->Present(NULL, NULL, NULL, NULL, mDisplay->getPresentInterval()); + HRESULT result = mSwapChain->Present(NULL, NULL, NULL, NULL, 0); if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DRIVERINTERNALERROR) { @@ -418,4 +465,19 @@ IDirect3DSurface9 *Surface::getDepthStencil() return mDepthStencil; } + +void Surface::setSwapInterval(EGLint interval) +{ + if (mSwapInterval == interval) + { + return; + } + + mSwapInterval = interval; + mSwapInterval = std::max(mSwapInterval, mDisplay->getMinSwapInterval()); + mSwapInterval = std::min(mSwapInterval, mDisplay->getMaxSwapInterval()); + + mPresentInterval = convertInterval(mSwapInterval); + mPresentIntervalDirty = true; +} } diff --git a/gfx/angle/src/libEGL/Surface.h b/gfx/angle/src/libEGL/Surface.h index 5bc912c7477..06bbca160d1 100644 --- a/gfx/angle/src/libEGL/Surface.h +++ b/gfx/angle/src/libEGL/Surface.h @@ -29,6 +29,9 @@ class Surface ~Surface(); + void release(); + void resetSwapChain(); + HWND getWindowHandle(); bool swap(); @@ -38,6 +41,8 @@ class Surface virtual IDirect3DSurface9 *getRenderTarget(); virtual IDirect3DSurface9 *getDepthStencil(); + void setSwapInterval(EGLint interval); + private: DISALLOW_COPY_AND_ASSIGN(Surface); @@ -48,8 +53,9 @@ class Surface IDirect3DSurface9 *mDepthStencil; IDirect3DTexture9 *mFlipTexture; - void resetSwapChain(); - bool checkForWindowResize(); + bool checkForOutOfDateSwapChain(); + + static DWORD convertInterval(EGLint interval); void applyFlipState(IDirect3DDevice9 *device); void restoreState(IDirect3DDevice9 *device); @@ -77,6 +83,9 @@ class Surface // EGLenum textureTarget; // Type of texture: 2D or no texture // EGLenum vgAlphaFormat; // Alpha format for OpenVG // EGLenum vgColorSpace; // Color space for OpenVG + EGLint mSwapInterval; + DWORD mPresentInterval; + bool mPresentIntervalDirty; }; } diff --git a/gfx/angle/src/libEGL/libEGL.cpp b/gfx/angle/src/libEGL/libEGL.cpp index 5ceb6ef4f9c..f7d2c4406f3 100644 --- a/gfx/angle/src/libEGL/libEGL.cpp +++ b/gfx/angle/src/libEGL/libEGL.cpp @@ -746,7 +746,14 @@ EGLBoolean __stdcall eglSwapInterval(EGLDisplay dpy, EGLint interval) return EGL_FALSE; } - display->setSwapInterval(interval); + egl::Surface *draw_surface = static_cast(egl::getCurrentDrawSurface()); + + if (draw_surface == NULL) + { + return error(EGL_BAD_SURFACE, EGL_FALSE); + } + + draw_surface->setSwapInterval(interval); return success(EGL_TRUE); } @@ -825,7 +832,7 @@ EGLBoolean __stdcall eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface gl::Context *context = static_cast(ctx); IDirect3DDevice9 *device = display->getDevice(); - if (!device || device->TestCooperativeLevel() != D3D_OK) + if (!device || FAILED(device->TestCooperativeLevel())) { return error(EGL_CONTEXT_LOST, EGL_FALSE); } diff --git a/gfx/angle/src/libGLESv2/Blit.cpp b/gfx/angle/src/libGLESv2/Blit.cpp index 00c878f62ea..e96486520a9 100644 --- a/gfx/angle/src/libGLESv2/Blit.cpp +++ b/gfx/angle/src/libGLESv2/Blit.cpp @@ -382,6 +382,11 @@ bool Blit::setFormatConvertShaders(GLenum destFormat) IDirect3DTexture9 *Blit::copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect) { + if (!surface) + { + return NULL; + } + egl::Display *display = getDisplay(); IDirect3DDevice9 *device = getDevice(); diff --git a/gfx/angle/src/libGLESv2/Context.cpp b/gfx/angle/src/libGLESv2/Context.cpp index f711be0a1f8..55cdae32b0f 100644 --- a/gfx/angle/src/libGLESv2/Context.cpp +++ b/gfx/angle/src/libGLESv2/Context.cpp @@ -19,6 +19,7 @@ #include "libGLESv2/Blit.h" #include "libGLESv2/ResourceManager.h" #include "libGLESv2/Buffer.h" +#include "libGLESv2/Fence.h" #include "libGLESv2/FrameBuffer.h" #include "libGLESv2/Program.h" #include "libGLESv2/RenderBuffer.h" @@ -83,6 +84,7 @@ Context::Context(const egl::Config *config, const gl::Context *shareContext) mState.scissorTest = false; mState.dither = true; mState.generateMipmapHint = GL_DONT_CARE; + mState.fragmentShaderDerivativeHint = GL_DONT_CARE; mState.lineWidth = 1.0f; @@ -120,25 +122,18 @@ Context::Context(const egl::Config *config, const gl::Context *shareContext) // In order that access to these initial textures not be lost, they are treated as texture // objects all of whose names are 0. - mTexture2DZero = new Texture2D(0); - mTextureCubeMapZero = new TextureCubeMap(0); - - mColorbufferZero = NULL; - mDepthStencilbufferZero = NULL; + mTexture2DZero.set(new Texture2D(0)); + mTextureCubeMapZero.set(new TextureCubeMap(0)); mState.activeSampler = 0; bindArrayBuffer(0); bindElementArrayBuffer(0); bindTextureCubeMap(0); bindTexture2D(0); - bindFramebuffer(0); + bindReadFramebuffer(0); + bindDrawFramebuffer(0); bindRenderbuffer(0); - for (int type = 0; type < SAMPLER_TYPE_COUNT; type++) - { - mIncompleteTextures[type] = NULL; - } - mState.currentProgram = 0; mState.packAlignment = 4; @@ -157,6 +152,9 @@ Context::Context(const egl::Config *config, const gl::Context *shareContext) mHasBeenCurrent = false; + mSupportsCompressedTextures = false; + mSupportsEventQueries = false; + mMaxSupportedSamples = 0; mMaskedClearSavedState = NULL; markAllStateDirty(); } @@ -178,6 +176,17 @@ Context::~Context() deleteFramebuffer(mFramebufferMap.begin()->first); } + while (!mFenceMap.empty()) + { + deleteFence(mFenceMap.begin()->first); + } + + while (!mMultiSampleSupport.empty()) + { + delete [] mMultiSampleSupport.begin()->second; + mMultiSampleSupport.erase(mMultiSampleSupport.begin()); + } + for (int type = 0; type < SAMPLER_TYPE_COUNT; type++) { for (int sampler = 0; sampler < MAX_TEXTURE_IMAGE_UNITS; sampler++) @@ -188,7 +197,7 @@ Context::~Context() for (int type = 0; type < SAMPLER_TYPE_COUNT; type++) { - delete mIncompleteTextures[type]; + mIncompleteTextures[type].set(NULL); } for (int i = 0; i < MAX_VERTEX_ATTRIBS; i++) @@ -202,8 +211,8 @@ Context::~Context() mState.textureCubeMap.set(NULL); mState.renderbuffer.set(NULL); - delete mTexture2DZero; - delete mTextureCubeMapZero; + mTexture2DZero.set(NULL); + mTextureCubeMapZero.set(NULL); delete mBufferBackEnd; delete mVertexDataManager; @@ -231,6 +240,37 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface) mIndexDataManager = new IndexDataManager(this, mBufferBackEnd); mBlit = new Blit(this); + const D3DFORMAT renderBufferFormats[] = + { + D3DFMT_A8R8G8B8, + D3DFMT_X8R8G8B8, + D3DFMT_R5G6B5, + D3DFMT_D24S8 + }; + + int max = 0; + for (int i = 0; i < sizeof(renderBufferFormats) / sizeof(D3DFORMAT); ++i) + { + bool *multisampleArray = new bool[D3DMULTISAMPLE_16_SAMPLES + 1]; + display->getMultiSampleSupport(renderBufferFormats[i], multisampleArray); + mMultiSampleSupport[renderBufferFormats[i]] = multisampleArray; + + for (int j = D3DMULTISAMPLE_16_SAMPLES; j >= 0; --j) + { + if (multisampleArray[j] && j != D3DMULTISAMPLE_NONMASKABLE && j > max) + { + max = j; + } + } + } + + mMaxSupportedSamples = max; + + mSupportsEventQueries = display->getEventQuerySupport(); + mSupportsCompressedTextures = display->getCompressedTextureSupport(); + mSupportsFloatTextures = display->getFloatTextureSupport(&mSupportsFloatLinearFilter, &mSupportsFloatRenderableTextures); + mSupportsHalfFloatTextures = display->getHalfFloatTextureSupport(&mSupportsHalfFloatLinearFilter, &mSupportsHalfFloatRenderableTextures); + initExtensionString(); mState.viewportX = 0; @@ -256,7 +296,10 @@ void Context::makeCurrent(egl::Display *display, egl::Surface *surface) setFramebufferZero(framebufferZero); - defaultRenderTarget->Release(); + if (defaultRenderTarget) + { + defaultRenderTarget->Release(); + } if (depthStencil) { @@ -273,6 +316,8 @@ void Context::markAllStateDirty() { mAppliedRenderTargetSerial = 0; mAppliedDepthbufferSerial = 0; + mAppliedStencilbufferSerial = 0; + mDepthStencilInitialized = false; mAppliedProgram = 0; mClearStateDirty = true; @@ -614,6 +659,14 @@ void Context::setGenerateMipmapHint(GLenum hint) mState.generateMipmapHint = hint; } +void Context::setFragmentShaderDerivativeHint(GLenum hint) +{ + mState.fragmentShaderDerivativeHint = hint; + // TODO: Propagate the hint to shader translator so we can write + // ddx, ddx_coarse, or ddx_fine depending on the hint. + // Ignore for now. It is valid for implementations to ignore hint. +} + void Context::setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height) { mState.viewportX = x; @@ -662,9 +715,14 @@ void Context::setActiveSampler(int active) mState.activeSampler = active; } -GLuint Context::getFramebufferHandle() const +GLuint Context::getReadFramebufferHandle() const { - return mState.framebuffer; + return mState.readFramebuffer; +} + +GLuint Context::getDrawFramebufferHandle() const +{ + return mState.drawFramebuffer; } GLuint Context::getRenderbufferHandle() const @@ -769,6 +827,20 @@ GLuint Context::createFramebuffer() return handle; } +GLuint Context::createFence() +{ + unsigned int handle = 0; + + while (mFenceMap.find(handle) != mFenceMap.end()) + { + handle++; + } + + mFenceMap[handle] = new Fence; + + return handle; +} + void Context::deleteBuffer(GLuint buffer) { if (mResourceManager->getBuffer(buffer)) @@ -822,6 +894,17 @@ void Context::deleteFramebuffer(GLuint framebuffer) } } +void Context::deleteFence(GLuint fence) +{ + FenceMap::iterator fenceObject = mFenceMap.find(fence); + + if (fenceObject != mFenceMap.end()) + { + delete fenceObject->second; + mFenceMap.erase(fenceObject); + } +} + Buffer *Context::getBuffer(GLuint handle) { return mResourceManager->getBuffer(handle); @@ -847,9 +930,14 @@ Renderbuffer *Context::getRenderbuffer(GLuint handle) return mResourceManager->getRenderbuffer(handle); } -Framebuffer *Context::getFramebuffer() +Framebuffer *Context::getReadFramebuffer() { - return getFramebuffer(mState.framebuffer); + return getFramebuffer(mState.readFramebuffer); +} + +Framebuffer *Context::getDrawFramebuffer() +{ + return getFramebuffer(mState.drawFramebuffer); } void Context::bindArrayBuffer(unsigned int buffer) @@ -884,14 +972,24 @@ void Context::bindTextureCubeMap(GLuint texture) mState.samplerTexture[SAMPLER_CUBE][mState.activeSampler].set(mState.textureCubeMap.get()); } -void Context::bindFramebuffer(GLuint framebuffer) +void Context::bindReadFramebuffer(GLuint framebuffer) { if (!getFramebuffer(framebuffer)) { mFramebufferMap[framebuffer] = new Framebuffer(); } - mState.framebuffer = framebuffer; + mState.readFramebuffer = framebuffer; +} + +void Context::bindDrawFramebuffer(GLuint framebuffer) +{ + if (!getFramebuffer(framebuffer)) + { + mFramebufferMap[framebuffer] = new Framebuffer(); + } + + mState.drawFramebuffer = framebuffer; } void Context::bindRenderbuffer(GLuint renderbuffer) @@ -949,6 +1047,20 @@ Framebuffer *Context::getFramebuffer(unsigned int handle) } } +Fence *Context::getFence(unsigned int handle) +{ + FenceMap::iterator fence = mFenceMap.find(handle); + + if (fence == mFenceMap.end()) + { + return NULL; + } + else + { + return fence->second; + } +} + Buffer *Context::getArrayBuffer() { return mState.arrayBuffer.get(); @@ -968,7 +1080,7 @@ Texture2D *Context::getTexture2D() { if (mState.texture2D.id() == 0) // Special case: 0 refers to different initial textures based on the target { - return mTexture2DZero; + return mTexture2DZero.get(); } return static_cast(mState.texture2D.get()); @@ -978,7 +1090,7 @@ TextureCubeMap *Context::getTextureCubeMap() { if (mState.textureCubeMap.id() == 0) // Special case: 0 refers to different initial textures based on the target { - return mTextureCubeMapZero; + return mTextureCubeMapZero.get(); } return static_cast(mState.textureCubeMap.get()); @@ -993,8 +1105,8 @@ Texture *Context::getSamplerTexture(unsigned int sampler, SamplerType type) switch (type) { default: UNREACHABLE(); - case SAMPLER_2D: return mTexture2DZero; - case SAMPLER_CUBE: return mTextureCubeMapZero; + case SAMPLER_2D: return mTexture2DZero.get(); + case SAMPLER_CUBE: return mTextureCubeMapZero.get(); } } @@ -1092,17 +1204,18 @@ bool Context::getIntegerv(GLenum pname, GLint *params) case GL_MAX_FRAGMENT_UNIFORM_VECTORS: *params = gl::MAX_FRAGMENT_UNIFORM_VECTORS; break; case GL_MAX_RENDERBUFFER_SIZE: *params = gl::MAX_RENDERBUFFER_SIZE; break; case GL_NUM_SHADER_BINARY_FORMATS: *params = 0; break; - case GL_NUM_COMPRESSED_TEXTURE_FORMATS: *params = 0; break; - case GL_COMPRESSED_TEXTURE_FORMATS: /* no compressed texture formats are supported */ break; case GL_SHADER_BINARY_FORMATS: /* no shader binary formats are supported */ break; case GL_ARRAY_BUFFER_BINDING: *params = mState.arrayBuffer.id(); break; case GL_ELEMENT_ARRAY_BUFFER_BINDING: *params = mState.elementArrayBuffer.id(); break; - case GL_FRAMEBUFFER_BINDING: *params = mState.framebuffer; break; + //case GL_FRAMEBUFFER_BINDING: // now equivalent to GL_DRAW_FRAMEBUFFER_BINDING_ANGLE + case GL_DRAW_FRAMEBUFFER_BINDING_ANGLE: *params = mState.drawFramebuffer; break; + case GL_READ_FRAMEBUFFER_BINDING_ANGLE: *params = mState.readFramebuffer; break; case GL_RENDERBUFFER_BINDING: *params = mState.renderbuffer.id(); break; case GL_CURRENT_PROGRAM: *params = mState.currentProgram; break; case GL_PACK_ALIGNMENT: *params = mState.packAlignment; break; case GL_UNPACK_ALIGNMENT: *params = mState.unpackAlignment; break; case GL_GENERATE_MIPMAP_HINT: *params = mState.generateMipmapHint; break; + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: *params = mState.fragmentShaderDerivativeHint; break; case GL_ACTIVE_TEXTURE: *params = (mState.activeSampler + GL_TEXTURE0); break; case GL_STENCIL_FUNC: *params = mState.stencilFunc; break; case GL_STENCIL_REF: *params = mState.stencilRef; break; @@ -1129,8 +1242,63 @@ bool Context::getIntegerv(GLenum pname, GLint *params) case GL_SUBPIXEL_BITS: *params = 4; break; case GL_MAX_TEXTURE_SIZE: *params = gl::MAX_TEXTURE_SIZE; break; case GL_MAX_CUBE_MAP_TEXTURE_SIZE: *params = gl::MAX_CUBE_MAP_TEXTURE_SIZE; break; - case GL_SAMPLE_BUFFERS: *params = 0; break; - case GL_SAMPLES: *params = 0; break; + case GL_NUM_COMPRESSED_TEXTURE_FORMATS: + { + if (supportsCompressedTextures()) + { + // at current, only GL_COMPRESSED_RGB_S3TC_DXT1_EXT and + // GL_COMPRESSED_RGBA_S3TC_DXT1_EXT are supported + *params = 2; + } + else + { + *params = 0; + } + } + break; + case GL_MAX_SAMPLES_ANGLE: + { + GLsizei maxSamples = getMaxSupportedSamples(); + if (maxSamples != 0) + { + *params = maxSamples; + } + else + { + return false; + } + + break; + } + case GL_SAMPLE_BUFFERS: + case GL_SAMPLES: + { + gl::Framebuffer *framebuffer = getDrawFramebuffer(); + if (framebuffer->completeness() == GL_FRAMEBUFFER_COMPLETE) + { + switch (pname) + { + case GL_SAMPLE_BUFFERS: + if (framebuffer->getSamples() != 0) + { + *params = 1; + } + else + { + *params = 0; + } + break; + case GL_SAMPLES: + *params = framebuffer->getSamples(); + break; + } + } + else + { + *params = 0; + } + } + break; case GL_IMPLEMENTATION_COLOR_READ_TYPE: *params = gl::IMPLEMENTATION_COLOR_READ_TYPE; break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT: *params = gl::IMPLEMENTATION_COLOR_READ_FORMAT; break; case GL_MAX_VIEWPORT_DIMS: @@ -1140,6 +1308,15 @@ bool Context::getIntegerv(GLenum pname, GLint *params) params[1] = maxDimension; } break; + case GL_COMPRESSED_TEXTURE_FORMATS: + { + if (supportsCompressedTextures()) + { + params[0] = GL_COMPRESSED_RGB_S3TC_DXT1_EXT; + params[1] = GL_COMPRESSED_RGBA_S3TC_DXT1_EXT; + } + } + break; case GL_VIEWPORT: params[0] = mState.viewportX; params[1] = mState.viewportY; @@ -1159,7 +1336,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params) case GL_BLUE_BITS: case GL_ALPHA_BITS: { - gl::Framebuffer *framebuffer = getFramebuffer(); + gl::Framebuffer *framebuffer = getDrawFramebuffer(); gl::Colorbuffer *colorbuffer = framebuffer->getColorbuffer(); if (colorbuffer) @@ -1180,7 +1357,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params) break; case GL_DEPTH_BITS: { - gl::Framebuffer *framebuffer = getFramebuffer(); + gl::Framebuffer *framebuffer = getDrawFramebuffer(); gl::DepthStencilbuffer *depthbuffer = framebuffer->getDepthbuffer(); if (depthbuffer) @@ -1195,7 +1372,7 @@ bool Context::getIntegerv(GLenum pname, GLint *params) break; case GL_STENCIL_BITS: { - gl::Framebuffer *framebuffer = getFramebuffer(); + gl::Framebuffer *framebuffer = getDrawFramebuffer(); gl::DepthStencilbuffer *stencilbuffer = framebuffer->getStencilbuffer(); if (stencilbuffer) @@ -1272,6 +1449,7 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu case GL_PACK_ALIGNMENT: case GL_UNPACK_ALIGNMENT: case GL_GENERATE_MIPMAP_HINT: + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: case GL_RED_BITS: case GL_GREEN_BITS: case GL_BLUE_BITS: @@ -1318,6 +1496,19 @@ bool Context::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *nu *numParams = 1; } break; + case GL_MAX_SAMPLES_ANGLE: + { + if (getMaxSupportedSamples() != 0) + { + *type = GL_INT; + *numParams = 1; + } + else + { + return false; + } + } + break; case GL_MAX_VIEWPORT_DIMS: { *type = GL_INT; @@ -1392,7 +1583,7 @@ bool Context::applyRenderTarget(bool ignoreViewport) { IDirect3DDevice9 *device = getDevice(); - Framebuffer *framebufferObject = getFramebuffer(); + Framebuffer *framebufferObject = getDrawFramebuffer(); if (!framebufferObject || framebufferObject->completeness() != GL_FRAMEBUFFER_COMPLETE) { @@ -1402,6 +1593,12 @@ bool Context::applyRenderTarget(bool ignoreViewport) } IDirect3DSurface9 *renderTarget = framebufferObject->getRenderTarget(); + + if (!renderTarget) + { + return false; // Context must be lost + } + IDirect3DSurface9 *depthStencil = NULL; unsigned int renderTargetSerial = framebufferObject->getRenderTargetSerial(); @@ -1417,20 +1614,34 @@ bool Context::applyRenderTarget(bool ignoreViewport) if (framebufferObject->getDepthbufferType() != GL_NONE) { depthStencil = framebufferObject->getDepthbuffer()->getDepthStencil(); + if (!depthStencil) + { + ERR("Depth stencil pointer unexpectedly null."); + return false; + } + depthbufferSerial = framebufferObject->getDepthbuffer()->getSerial(); } else if (framebufferObject->getStencilbufferType() != GL_NONE) { depthStencil = framebufferObject->getStencilbuffer()->getDepthStencil(); + if (!depthStencil) + { + ERR("Depth stencil pointer unexpectedly null."); + return false; + } + stencilbufferSerial = framebufferObject->getStencilbuffer()->getSerial(); } if (depthbufferSerial != mAppliedDepthbufferSerial || - stencilbufferSerial != mAppliedStencilbufferSerial) + stencilbufferSerial != mAppliedStencilbufferSerial || + !mDepthStencilInitialized) { device->SetDepthStencilSurface(depthStencil); mAppliedDepthbufferSerial = depthbufferSerial; mAppliedStencilbufferSerial = stencilbufferSerial; + mDepthStencilInitialized = true; } D3DVIEWPORT9 viewport; @@ -1530,7 +1741,7 @@ void Context::applyState(GLenum drawMode) GLint alwaysFront = !isTriangleMode(drawMode); programObject->setUniform1iv(pointsOrLines, 1, &alwaysFront); - Framebuffer *framebufferObject = getFramebuffer(); + Framebuffer *framebufferObject = getDrawFramebuffer(); if (mCullStateDirty || mFrontFaceDirty) { @@ -1610,7 +1821,7 @@ void Context::applyState(GLenum drawMode) if (mStencilStateDirty || mFrontFaceDirty) { - if (mState.stencilTest && hasStencil()) + if (mState.stencilTest && framebufferObject->hasStencil()) { device->SetRenderState(D3DRS_STENCILENABLE, TRUE); device->SetRenderState(D3DRS_TWOSIDEDSTENCILMODE, TRUE); @@ -1628,8 +1839,7 @@ void Context::applyState(GLenum drawMode) } // get the maximum size of the stencil ref - gl::Framebuffer *framebuffer = getFramebuffer(); - gl::DepthStencilbuffer *stencilbuffer = framebuffer->getStencilbuffer(); + gl::DepthStencilbuffer *stencilbuffer = framebufferObject->getStencilbuffer(); GLuint maxStencil = (1 << stencilbuffer->getStencilSize()) - 1; device->SetRenderState(mState.frontFace == GL_CCW ? D3DRS_STENCILWRITEMASK : D3DRS_CCW_STENCILWRITEMASK, mState.stencilWritemask); @@ -1681,7 +1891,7 @@ void Context::applyState(GLenum drawMode) { if (mState.polygonOffsetFill) { - gl::DepthStencilbuffer *depthbuffer = getFramebuffer()->getDepthbuffer(); + gl::DepthStencilbuffer *depthbuffer = framebufferObject->getDepthbuffer(); if (depthbuffer) { device->SetRenderState(D3DRS_SLOPESCALEDEPTHBIAS, *((DWORD*)&mState.polygonOffsetFactor)); @@ -1698,16 +1908,50 @@ void Context::applyState(GLenum drawMode) mPolygonOffsetStateDirty = false; } - if (mConfig->mMultiSample != 0 && mSampleStateDirty) + if (mSampleStateDirty) { - if (mState.sampleAlphaToCoverage) + if (framebufferObject->isMultisample()) { - FIXME("Sample alpha to coverage is unimplemented."); - } + if (mState.sampleAlphaToCoverage) + { + FIXME("Sample alpha to coverage is unimplemented."); + } - if (mState.sampleCoverage) + device->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, TRUE); + if (mState.sampleCoverage) + { + unsigned int mask = 0; + if (mState.sampleCoverageValue != 0) + { + float threshold = 0.5f; + + for (int i = 0; i < framebufferObject->getSamples(); ++i) + { + mask <<= 1; + + if ((i + 1) * mState.sampleCoverageValue >= threshold) + { + threshold += 1.0f; + mask |= 1; + } + } + } + + if (mState.sampleCoverageInvert) + { + mask = ~mask; + } + + device->SetRenderState(D3DRS_MULTISAMPLEMASK, mask); + } + else + { + device->SetRenderState(D3DRS_MULTISAMPLEMASK, 0xFFFFFFFF); + } + } + else { - FIXME("Sample coverage is unimplemented."); + device->SetRenderState(D3DRS_MULTISAMPLEANTIALIAS, FALSE); } mSampleStateDirty = false; @@ -1876,14 +2120,25 @@ void Context::applyTextures() void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) { - Framebuffer *framebuffer = getFramebuffer(); + Framebuffer *framebuffer = getReadFramebuffer(); if (framebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE) { return error(GL_INVALID_FRAMEBUFFER_OPERATION); } + if (getReadFramebufferHandle() != 0 && framebuffer->getSamples() != 0) + { + return error(GL_INVALID_OPERATION); + } + IDirect3DSurface9 *renderTarget = framebuffer->getRenderTarget(); + + if (!renderTarget) + { + return; // Context must be lost, return silently + } + IDirect3DDevice9 *device = getDevice(); D3DSURFACE_DESC desc; @@ -2027,6 +2282,28 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum r = (argb & 0x3FF00000) * (1.0f / 0x3FF00000); } break; + case D3DFMT_A32B32G32R32F: + { + // float formats in D3D are stored rgba, rather than the other way round + r = *((float*)(source + 16 * i + j * lock.Pitch) + 0); + g = *((float*)(source + 16 * i + j * lock.Pitch) + 1); + b = *((float*)(source + 16 * i + j * lock.Pitch) + 2); + a = *((float*)(source + 16 * i + j * lock.Pitch) + 3); + } + break; + case D3DFMT_A16B16G16R16F: + { + // float formats in D3D are stored rgba, rather than the other way round + float abgr[4]; + + D3DXFloat16To32Array(abgr, (D3DXFLOAT16*)(source + 8 * i + j * lock.Pitch), 4); + + a = abgr[3]; + b = abgr[2]; + g = abgr[1]; + r = abgr[0]; + } + break; default: UNIMPLEMENTED(); // FIXME UNREACHABLE(); @@ -2110,7 +2387,7 @@ void Context::readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum void Context::clear(GLbitfield mask) { - Framebuffer *framebufferObject = getFramebuffer(); + Framebuffer *framebufferObject = getDrawFramebuffer(); if (!framebufferObject || framebufferObject->completeness() != GL_FRAMEBUFFER_COMPLETE) { @@ -2150,6 +2427,12 @@ void Context::clear(GLbitfield mask) if (framebufferObject->getStencilbufferType() != GL_NONE) { IDirect3DSurface9 *depthStencil = framebufferObject->getStencilbuffer()->getDepthStencil(); + if (!depthStencil) + { + ERR("Depth stencil pointer unexpectedly null."); + return; + } + D3DSURFACE_DESC desc; depthStencil->GetDesc(&desc); @@ -2182,6 +2465,11 @@ void Context::clear(GLbitfield mask) IDirect3DSurface9 *renderTarget = framebufferObject->getRenderTarget(); + if (!renderTarget) + { + return; // Context must be lost, return silently + } + D3DSURFACE_DESC desc; renderTarget->GetDesc(&desc); @@ -2218,6 +2506,7 @@ void Context::clear(GLbitfield mask) device->SetVertexShader(NULL); device->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE); device->SetStreamSourceFreq(0, 1); + device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE); hr = device->EndStateBlock(&mMaskedClearSavedState); ASSERT(SUCCEEDED(hr) || hr == D3DERR_OUTOFVIDEOMEMORY || hr == E_OUTOFMEMORY); @@ -2273,6 +2562,7 @@ void Context::clear(GLbitfield mask) device->SetVertexShader(NULL); device->SetFVF(D3DFVF_XYZRHW | D3DFVF_DIFFUSE); device->SetStreamSourceFreq(0, 1); + device->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_DISABLE); struct Vertex { @@ -2463,7 +2753,8 @@ void Context::finish() IDirect3DStateBlock9 *savedState = NULL; device->CreateStateBlock(D3DSBT_ALL, &savedState); - occlusionQuery->Issue(D3DISSUE_BEGIN); + HRESULT result = occlusionQuery->Issue(D3DISSUE_BEGIN); + ASSERT(SUCCEEDED(result)); // Render something outside the render target device->SetStreamSourceFreq(0, 1); @@ -2474,7 +2765,8 @@ void Context::finish() display->startScene(); device->DrawPrimitiveUP(D3DPT_POINTLIST, 1, data, sizeof(data)); - occlusionQuery->Issue(D3DISSUE_END); + result = occlusionQuery->Issue(D3DISSUE_END); + ASSERT(SUCCEEDED(result)); while (occlusionQuery->GetData(NULL, 0, D3DGETDATA_FLUSH) == S_FALSE) { @@ -2508,15 +2800,16 @@ void Context::flush() if (eventQuery) { - eventQuery->Issue(D3DISSUE_END); - - while (eventQuery->GetData(NULL, 0, D3DGETDATA_FLUSH) == S_FALSE) - { - // Keep polling, but allow other threads to do something useful first - Sleep(0); - } + HRESULT result = eventQuery->Issue(D3DISSUE_END); + ASSERT(SUCCEEDED(result)); + result = eventQuery->GetData(NULL, 0, D3DGETDATA_FLUSH); eventQuery->Release(); + + if (result == D3DERR_DEVICELOST) + { + error(GL_OUT_OF_MEMORY); + } } } @@ -2592,6 +2885,75 @@ bool Context::supportsShaderModel3() const return mSupportsShaderModel3; } +int Context::getMaxSupportedSamples() const +{ + return mMaxSupportedSamples; +} + +int Context::getNearestSupportedSamples(D3DFORMAT format, int requested) const +{ + if (requested == 0) + { + return requested; + } + + std::map::const_iterator itr = mMultiSampleSupport.find(format); + if (itr == mMultiSampleSupport.end()) + { + return -1; + } + + for (int i = requested; i <= D3DMULTISAMPLE_16_SAMPLES; ++i) + { + if (itr->second[i] && i != D3DMULTISAMPLE_NONMASKABLE) + { + return i; + } + } + + return -1; +} + +bool Context::supportsEventQueries() const +{ + return mSupportsEventQueries; +} + +bool Context::supportsCompressedTextures() const +{ + return mSupportsCompressedTextures; +} + +bool Context::supportsFloatTextures() const +{ + return mSupportsFloatTextures; +} + +bool Context::supportsFloatLinearFilter() const +{ + return mSupportsFloatLinearFilter; +} + +bool Context::supportsFloatRenderableTextures() const +{ + return mSupportsFloatRenderableTextures; +} + +bool Context::supportsHalfFloatTextures() const +{ + return mSupportsHalfFloatTextures; +} + +bool Context::supportsHalfFloatLinearFilter() const +{ + return mSupportsHalfFloatLinearFilter; +} + +bool Context::supportsHalfFloatRenderableTextures() const +{ + return mSupportsHalfFloatRenderableTextures; +} + void Context::detachBuffer(GLuint buffer) { // [OpenGL ES 2.0.24] section 2.9 page 22: @@ -2639,11 +3001,17 @@ void Context::detachTexture(GLuint texture) // as if FramebufferTexture2D had been called, with a texture of 0, for each attachment point to which this // image was attached in the currently bound framebuffer. - Framebuffer *framebuffer = getFramebuffer(); + Framebuffer *readFramebuffer = getReadFramebuffer(); + Framebuffer *drawFramebuffer = getDrawFramebuffer(); - if (framebuffer) + if (readFramebuffer) { - framebuffer->detachTexture(texture); + readFramebuffer->detachTexture(texture); + } + + if (drawFramebuffer && drawFramebuffer != readFramebuffer) + { + drawFramebuffer->detachTexture(texture); } } @@ -2653,9 +3021,14 @@ void Context::detachFramebuffer(GLuint framebuffer) // If a framebuffer that is currently bound to the target FRAMEBUFFER is deleted, it is as though // BindFramebuffer had been executed with the target of FRAMEBUFFER and framebuffer of zero. - if (mState.framebuffer == framebuffer) + if (mState.readFramebuffer == framebuffer) { - bindFramebuffer(0); + bindReadFramebuffer(0); + } + + if (mState.drawFramebuffer == framebuffer) + { + bindDrawFramebuffer(0); } } @@ -2675,17 +3048,23 @@ void Context::detachRenderbuffer(GLuint renderbuffer) // then it is as if FramebufferRenderbuffer had been called, with a renderbuffer of 0, for each attachment // point to which this image was attached in the currently bound framebuffer. - Framebuffer *framebuffer = getFramebuffer(); + Framebuffer *readFramebuffer = getReadFramebuffer(); + Framebuffer *drawFramebuffer = getDrawFramebuffer(); - if (framebuffer) + if (readFramebuffer) { - framebuffer->detachRenderbuffer(renderbuffer); + readFramebuffer->detachRenderbuffer(renderbuffer); + } + + if (drawFramebuffer && drawFramebuffer != readFramebuffer) + { + drawFramebuffer->detachRenderbuffer(renderbuffer); } } Texture *Context::getIncompleteTexture(SamplerType type) { - Texture *t = mIncompleteTextures[type]; + Texture *t = mIncompleteTextures[type].get(); if (t == NULL) { @@ -2721,7 +3100,7 @@ Texture *Context::getIncompleteTexture(SamplerType type) break; } - mIncompleteTextures[type] = t; + mIncompleteTextures[type].set(t); } return t; @@ -2751,23 +3130,6 @@ bool Context::isTriangleMode(GLenum drawMode) return false; } -bool Context::hasStencil() -{ - Framebuffer *framebufferObject = getFramebuffer(); - - if (framebufferObject && framebufferObject->getStencilbufferType() != GL_NONE) - { - DepthStencilbuffer *stencilbufferObject = framebufferObject->getStencilbuffer(); - - if (stencilbufferObject) - { - return stencilbufferObject->getStencilSize() > 0; - } - } - - return false; -} - void Context::setVertexAttrib(GLuint index, const GLfloat *values) { ASSERT(index < gl::MAX_VERTEX_ATTRIBS); @@ -2785,6 +3147,44 @@ void Context::initExtensionString() mExtensionString += "GL_OES_packed_depth_stencil "; mExtensionString += "GL_EXT_texture_format_BGRA8888 "; mExtensionString += "GL_EXT_read_format_bgra "; + mExtensionString += "GL_ANGLE_framebuffer_blit "; + mExtensionString += "GL_OES_rgb8_rgba8 "; + mExtensionString += "GL_OES_standard_derivatives "; + + if (supportsEventQueries()) + { + mExtensionString += "GL_NV_fence "; + } + + if (supportsCompressedTextures()) + { + mExtensionString += "GL_EXT_texture_compression_dxt1 "; + } + + if (supportsFloatTextures()) + { + mExtensionString += "GL_OES_texture_float "; + } + + if (supportsHalfFloatTextures()) + { + mExtensionString += "GL_OES_texture_half_float "; + } + + if (supportsFloatLinearFilter()) + { + mExtensionString += "GL_OES_texture_float_linear "; + } + + if (supportsHalfFloatLinearFilter()) + { + mExtensionString += "GL_OES_texture_half_float_linear "; + } + + if (getMaxSupportedSamples() != 0) + { + mExtensionString += "GL_ANGLE_framebuffer_multisample "; + } if (mBufferBackEnd->supportIntIndices()) { @@ -2803,6 +3203,282 @@ const char *Context::getExtensionString() const return mExtensionString.c_str(); } +void Context::blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask) +{ + IDirect3DDevice9 *device = getDevice(); + + Framebuffer *readFramebuffer = getReadFramebuffer(); + Framebuffer *drawFramebuffer = getDrawFramebuffer(); + + if (!readFramebuffer || readFramebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE || + !drawFramebuffer || drawFramebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE) + { + return error(GL_INVALID_FRAMEBUFFER_OPERATION); + } + + if (drawFramebuffer->getSamples() != 0) + { + return error(GL_INVALID_OPERATION); + } + + RECT sourceRect; + RECT destRect; + + if (srcX0 < srcX1) + { + sourceRect.left = srcX0; + sourceRect.right = srcX1; + destRect.left = dstX0; + destRect.right = dstX1; + } + else + { + sourceRect.left = srcX1; + destRect.left = dstX1; + sourceRect.right = srcX0; + destRect.right = dstX0; + } + + // Arguments to StretchRect must be in D3D-style (0-top) coordinates, so we must + // flip our Y-values here + if (srcY0 < srcY1) + { + sourceRect.bottom = srcY1; + destRect.bottom = dstY1; + sourceRect.top = srcY0; + destRect.top = dstY0; + } + else + { + sourceRect.bottom = srcY0; + destRect.bottom = dstY0; + sourceRect.top = srcY1; + destRect.top = dstY1; + } + + RECT sourceScissoredRect = sourceRect; + RECT destScissoredRect = destRect; + + if (mState.scissorTest) + { + // Only write to parts of the destination framebuffer which pass the scissor test + // Please note: the destRect is now in D3D-style coordinates, so the *top* of the + // rect will be checked against scissorY, rather than the bottom. + if (destRect.left < mState.scissorX) + { + int xDiff = mState.scissorX - destRect.left; + destScissoredRect.left = mState.scissorX; + sourceScissoredRect.left += xDiff; + } + + if (destRect.right > mState.scissorX + mState.scissorWidth) + { + int xDiff = destRect.right - (mState.scissorX + mState.scissorWidth); + destScissoredRect.right = mState.scissorX + mState.scissorWidth; + sourceScissoredRect.right -= xDiff; + } + + if (destRect.top < mState.scissorY) + { + int yDiff = mState.scissorY - destRect.top; + destScissoredRect.top = mState.scissorY; + sourceScissoredRect.top += yDiff; + } + + if (destRect.bottom > mState.scissorY + mState.scissorHeight) + { + int yDiff = destRect.bottom - (mState.scissorY + mState.scissorHeight); + destScissoredRect.bottom = mState.scissorY + mState.scissorHeight; + sourceScissoredRect.bottom -= yDiff; + } + } + + bool blitRenderTarget = false; + bool blitDepthStencil = false; + + RECT sourceTrimmedRect = sourceScissoredRect; + RECT destTrimmedRect = destScissoredRect; + + // The source & destination rectangles also may need to be trimmed if they fall out of the bounds of + // the actual draw and read surfaces. + if (sourceTrimmedRect.left < 0) + { + int xDiff = 0 - sourceTrimmedRect.left; + sourceTrimmedRect.left = 0; + destTrimmedRect.left += xDiff; + } + + int readBufferWidth = readFramebuffer->getColorbuffer()->getWidth(); + int readBufferHeight = readFramebuffer->getColorbuffer()->getHeight(); + int drawBufferWidth = drawFramebuffer->getColorbuffer()->getWidth(); + int drawBufferHeight = drawFramebuffer->getColorbuffer()->getHeight(); + + if (sourceTrimmedRect.right > readBufferWidth) + { + int xDiff = sourceTrimmedRect.right - readBufferWidth; + sourceTrimmedRect.right = readBufferWidth; + destTrimmedRect.right -= xDiff; + } + + if (sourceTrimmedRect.top < 0) + { + int yDiff = 0 - sourceTrimmedRect.top; + sourceTrimmedRect.top = 0; + destTrimmedRect.top += yDiff; + } + + if (sourceTrimmedRect.bottom > readBufferHeight) + { + int yDiff = sourceTrimmedRect.bottom - readBufferHeight; + sourceTrimmedRect.bottom = readBufferHeight; + destTrimmedRect.bottom -= yDiff; + } + + if (destTrimmedRect.left < 0) + { + int xDiff = 0 - destTrimmedRect.left; + destTrimmedRect.left = 0; + sourceTrimmedRect.left += xDiff; + } + + if (destTrimmedRect.right > drawBufferWidth) + { + int xDiff = destTrimmedRect.right - drawBufferWidth; + destTrimmedRect.right = drawBufferWidth; + sourceTrimmedRect.right -= xDiff; + } + + if (destTrimmedRect.top < 0) + { + int yDiff = 0 - destTrimmedRect.top; + destTrimmedRect.top = 0; + sourceTrimmedRect.top += yDiff; + } + + if (destTrimmedRect.bottom > drawBufferHeight) + { + int yDiff = destTrimmedRect.bottom - drawBufferHeight; + destTrimmedRect.bottom = drawBufferHeight; + sourceTrimmedRect.bottom -= yDiff; + } + + bool partialBufferCopy = false; + if (sourceTrimmedRect.bottom - sourceTrimmedRect.top < readFramebuffer->getColorbuffer()->getHeight() || + sourceTrimmedRect.right - sourceTrimmedRect.left < readFramebuffer->getColorbuffer()->getWidth() || + destTrimmedRect.bottom - destTrimmedRect.top < drawFramebuffer->getColorbuffer()->getHeight() || + destTrimmedRect.right - destTrimmedRect.left < drawFramebuffer->getColorbuffer()->getWidth() || + sourceTrimmedRect.top != 0 || destTrimmedRect.top != 0 || sourceTrimmedRect.left != 0 || destTrimmedRect.left != 0) + { + partialBufferCopy = true; + } + + if (mask & GL_COLOR_BUFFER_BIT) + { + const bool validReadType = readFramebuffer->getColorbufferType() == GL_TEXTURE_2D || + readFramebuffer->getColorbufferType() == GL_RENDERBUFFER; + const bool validDrawType = drawFramebuffer->getColorbufferType() == GL_TEXTURE_2D || + drawFramebuffer->getColorbufferType() == GL_RENDERBUFFER; + if (!validReadType || !validDrawType || + readFramebuffer->getColorbuffer()->getD3DFormat() != drawFramebuffer->getColorbuffer()->getD3DFormat()) + { + ERR("Color buffer format conversion in BlitFramebufferANGLE not supported by this implementation"); + return error(GL_INVALID_OPERATION); + } + + if (partialBufferCopy && readFramebuffer->getSamples() != 0) + { + return error(GL_INVALID_OPERATION); + } + + blitRenderTarget = true; + + } + + if (mask & (GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)) + { + DepthStencilbuffer *readDSBuffer = NULL; + DepthStencilbuffer *drawDSBuffer = NULL; + + // We support OES_packed_depth_stencil, and do not support a separately attached depth and stencil buffer, so if we have + // both a depth and stencil buffer, it will be the same buffer. + + if (mask & GL_DEPTH_BUFFER_BIT) + { + if (readFramebuffer->getDepthbuffer() && drawFramebuffer->getDepthbuffer()) + { + if (readFramebuffer->getDepthbufferType() != drawFramebuffer->getDepthbufferType() || + readFramebuffer->getDepthbuffer()->getD3DFormat() != drawFramebuffer->getDepthbuffer()->getD3DFormat()) + { + return error(GL_INVALID_OPERATION); + } + + blitDepthStencil = true; + readDSBuffer = readFramebuffer->getDepthbuffer(); + drawDSBuffer = drawFramebuffer->getDepthbuffer(); + } + } + + if (mask & GL_STENCIL_BUFFER_BIT) + { + if (readFramebuffer->getStencilbuffer() && drawFramebuffer->getStencilbuffer()) + { + if (readFramebuffer->getStencilbufferType() != drawFramebuffer->getStencilbufferType() || + readFramebuffer->getStencilbuffer()->getD3DFormat() != drawFramebuffer->getStencilbuffer()->getD3DFormat()) + { + return error(GL_INVALID_OPERATION); + } + + blitDepthStencil = true; + readDSBuffer = readFramebuffer->getStencilbuffer(); + drawDSBuffer = drawFramebuffer->getStencilbuffer(); + } + } + + if (partialBufferCopy) + { + ERR("Only whole-buffer depth and stencil blits are supported by this implementation."); + return error(GL_INVALID_OPERATION); // only whole-buffer copies are permitted + } + + if ((drawDSBuffer && drawDSBuffer->getSamples() != 0) || + (readDSBuffer && readDSBuffer->getSamples() != 0)) + { + return error(GL_INVALID_OPERATION); + } + } + + if (blitRenderTarget || blitDepthStencil) + { + egl::Display *display = getDisplay(); + display->endScene(); + + if (blitRenderTarget) + { + HRESULT result = device->StretchRect(readFramebuffer->getRenderTarget(), &sourceTrimmedRect, + drawFramebuffer->getRenderTarget(), &destTrimmedRect, D3DTEXF_NONE); + + if (FAILED(result)) + { + ERR("BlitFramebufferANGLE failed: StretchRect returned %x.", result); + return; + } + } + + if (blitDepthStencil) + { + HRESULT result = device->StretchRect(readFramebuffer->getDepthStencil(), NULL, drawFramebuffer->getDepthStencil(), NULL, D3DTEXF_NONE); + + if (FAILED(result)) + { + ERR("BlitFramebufferANGLE failed: StretchRect returned %x.", result); + return; + } + } + } +} + } extern "C" diff --git a/gfx/angle/src/libGLESv2/Context.h b/gfx/angle/src/libGLESv2/Context.h index adfd5bdfddf..8ecebcb9684 100644 --- a/gfx/angle/src/libGLESv2/Context.h +++ b/gfx/angle/src/libGLESv2/Context.h @@ -12,6 +12,7 @@ #define GL_APICALL #include +#include #define EGLAPI #include #include @@ -51,6 +52,7 @@ class VertexDataManager; class IndexDataManager; class BufferBackEnd; class Blit; +class Fence; enum { @@ -157,6 +159,7 @@ struct State GLfloat lineWidth; GLenum generateMipmapHint; + GLenum fragmentShaderDerivativeHint; GLint viewportX; GLint viewportY; @@ -181,7 +184,8 @@ struct State BindingPointer elementArrayBuffer; BindingPointer texture2D; BindingPointer textureCubeMap; - GLuint framebuffer; + GLuint readFramebuffer; + GLuint drawFramebuffer; BindingPointer renderbuffer; GLuint currentProgram; @@ -263,6 +267,7 @@ class Context void setLineWidth(GLfloat width); void setGenerateMipmapHint(GLenum hint); + void setFragmentShaderDerivativeHint(GLenum hint); void setViewportParams(GLint x, GLint y, GLsizei width, GLsizei height); @@ -273,7 +278,8 @@ class Context void setActiveSampler(int active); - GLuint getFramebufferHandle() const; + GLuint getReadFramebufferHandle() const; + GLuint getDrawFramebufferHandle() const; GLuint getRenderbufferHandle() const; GLuint getArrayBufferHandle() const; @@ -310,11 +316,16 @@ class Context GLuint createFramebuffer(); void deleteFramebuffer(GLuint framebuffer); + // Fences are owned by the Context. + GLuint createFence(); + void deleteFence(GLuint fence); + void bindArrayBuffer(GLuint buffer); void bindElementArrayBuffer(GLuint buffer); void bindTexture2D(GLuint texture); void bindTextureCubeMap(GLuint texture); - void bindFramebuffer(GLuint framebuffer); + void bindReadFramebuffer(GLuint framebuffer); + void bindDrawFramebuffer(GLuint framebuffer); void bindRenderbuffer(GLuint renderbuffer); void useProgram(GLuint program); @@ -325,6 +336,7 @@ class Context void setVertexAttrib(GLuint index, const GLfloat *values); Buffer *getBuffer(GLuint handle); + Fence *getFence(GLuint handle); Shader *getShader(GLuint handle); Program *getProgram(GLuint handle); Texture *getTexture(GLuint handle); @@ -337,7 +349,8 @@ class Context Texture2D *getTexture2D(); TextureCubeMap *getTextureCubeMap(); Texture *getSamplerTexture(unsigned int sampler, SamplerType type); - Framebuffer *getFramebuffer(); + Framebuffer *getReadFramebuffer(); + Framebuffer *getDrawFramebuffer(); bool getFloatv(GLenum pname, GLfloat *params); bool getIntegerv(GLenum pname, GLint *params); @@ -370,7 +383,21 @@ class Context GLenum getError(); bool supportsShaderModel3() const; + GLsizei getMaxSupportedSamples() const; + int getNearestSupportedSamples(D3DFORMAT format, int requested) const; const char *getExtensionString() const; + bool supportsEventQueries() const; + bool supportsCompressedTextures() const; + bool supportsFloatTextures() const; + bool supportsFloatLinearFilter() const; + bool supportsFloatRenderableTextures() const; + bool supportsHalfFloatTextures() const; + bool supportsHalfFloatLinearFilter() const; + bool supportsHalfFloatRenderableTextures() const; + + void blitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, + GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask); Blit *getBlitter() { return mBlit; } @@ -390,21 +417,21 @@ class Context bool cullSkipsDraw(GLenum drawMode); bool isTriangleMode(GLenum drawMode); - bool hasStencil(); const egl::Config *const mConfig; State mState; - Texture2D *mTexture2DZero; - TextureCubeMap *mTextureCubeMapZero; + BindingPointer mTexture2DZero; + BindingPointer mTextureCubeMapZero; - Colorbuffer *mColorbufferZero; - DepthStencilbuffer *mDepthStencilbufferZero; typedef std::map FramebufferMap; FramebufferMap mFramebufferMap; + typedef std::map FenceMap; + FenceMap mFenceMap; + void initExtensionString(); std::string mExtensionString; @@ -414,7 +441,7 @@ class Context Blit *mBlit; - Texture *mIncompleteTextures[SAMPLER_TYPE_COUNT]; + BindingPointer mIncompleteTextures[SAMPLER_TYPE_COUNT]; // Recorded errors bool mInvalidEnum; @@ -429,8 +456,19 @@ class Context unsigned int mAppliedRenderTargetSerial; unsigned int mAppliedDepthbufferSerial; unsigned int mAppliedStencilbufferSerial; + bool mDepthStencilInitialized; bool mSupportsShaderModel3; + std::map mMultiSampleSupport; + GLsizei mMaxSupportedSamples; + bool mSupportsEventQueries; + bool mSupportsCompressedTextures; + bool mSupportsFloatTextures; + bool mSupportsFloatLinearFilter; + bool mSupportsFloatRenderableTextures; + bool mSupportsHalfFloatTextures; + bool mSupportsHalfFloatLinearFilter; + bool mSupportsHalfFloatRenderableTextures; // state caching flags bool mClearStateDirty; diff --git a/gfx/angle/src/libGLESv2/Fence.cpp b/gfx/angle/src/libGLESv2/Fence.cpp new file mode 100644 index 00000000000..7fbcb6ad34d --- /dev/null +++ b/gfx/angle/src/libGLESv2/Fence.cpp @@ -0,0 +1,134 @@ +// +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +// Fence.cpp: Implements the gl::Fence class, which supports the GL_NV_fence extension. + +#include "libGLESv2/Fence.h" + +#include "libGLESv2/main.h" + +namespace gl +{ + +Fence::Fence() +{ + mQuery = NULL; + mCondition = GL_NONE; + mStatus = GL_FALSE; +} + +Fence::~Fence() +{ + if (mQuery != NULL) + { + mQuery->Release(); + mQuery = NULL; + } +} + +GLboolean Fence::isFence() +{ + // GL_NV_fence spec: + // A name returned by GenFencesNV, but not yet set via SetFenceNV, is not the name of an existing fence. + return mQuery != NULL; +} + +void Fence::setFence(GLenum condition) +{ + if (mQuery != NULL) + { + mQuery->Release(); + mQuery = NULL; + } + + if (FAILED(getDevice()->CreateQuery(D3DQUERYTYPE_EVENT, &mQuery))) + { + return error(GL_OUT_OF_MEMORY); + } + + HRESULT result = mQuery->Issue(D3DISSUE_END); + ASSERT(SUCCEEDED(result)); + + mCondition = condition; + mStatus = GL_FALSE; +} + +GLboolean Fence::testFence() +{ + if (mQuery == NULL) + { + return error(GL_INVALID_OPERATION, GL_TRUE); + } + + HRESULT result = mQuery->GetData(NULL, 0, D3DGETDATA_FLUSH); + + if (result == D3DERR_DEVICELOST) + { + return error(GL_OUT_OF_MEMORY, GL_TRUE); + } + + ASSERT(result == S_OK || result == S_FALSE); + mStatus = result == S_OK; + return mStatus; +} + +void Fence::finishFence() +{ + if (mQuery == NULL) + { + return error(GL_INVALID_OPERATION); + } + + while (!testFence()) + { + Sleep(0); + } +} + +void Fence::getFenceiv(GLenum pname, GLint *params) +{ + if (mQuery == NULL) + { + return error(GL_INVALID_OPERATION); + } + + switch (pname) + { + case GL_FENCE_STATUS_NV: + { + // GL_NV_fence spec: + // Once the status of a fence has been finished (via FinishFenceNV) or tested and the returned status is TRUE (via either TestFenceNV + // or GetFenceivNV querying the FENCE_STATUS_NV), the status remains TRUE until the next SetFenceNV of the fence. + if (mStatus) + { + params[0] = GL_TRUE; + return; + } + + HRESULT result = mQuery->GetData(NULL, 0, 0); + + if (result == D3DERR_DEVICELOST) + { + params[0] = GL_TRUE; + return error(GL_OUT_OF_MEMORY); + } + + ASSERT(result == S_OK || result == S_FALSE); + mStatus = result == S_OK; + params[0] = mStatus; + + break; + } + case GL_FENCE_CONDITION_NV: + params[0] = mCondition; + break; + default: + return error(GL_INVALID_ENUM); + break; + } +} + +} diff --git a/gfx/angle/src/libGLESv2/Fence.h b/gfx/angle/src/libGLESv2/Fence.h new file mode 100644 index 00000000000..17bad78ea5b --- /dev/null +++ b/gfx/angle/src/libGLESv2/Fence.h @@ -0,0 +1,43 @@ +// +// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// + +// Fence.h: Defines the gl::Fence class, which supports the GL_NV_fence extension. + +#ifndef LIBGLESV2_FENCE_H_ +#define LIBGLESV2_FENCE_H_ + +#define GL_APICALL +#include +#include + +#include "common/angleutils.h" + +namespace gl +{ + +class Fence +{ + public: + Fence(); + virtual ~Fence(); + + GLboolean isFence(); + void setFence(GLenum condition); + GLboolean testFence(); + void finishFence(); + void getFenceiv(GLenum pname, GLint *params); + + private: + DISALLOW_COPY_AND_ASSIGN(Fence); + + IDirect3DQuery9* mQuery; + GLenum mCondition; + GLboolean mStatus; +}; + +} + +#endif // LIBGLESV2_FENCE_H_ diff --git a/gfx/angle/src/libGLESv2/Framebuffer.cpp b/gfx/angle/src/libGLESv2/Framebuffer.cpp index 8a457d5a57e..6e453400413 100644 --- a/gfx/angle/src/libGLESv2/Framebuffer.cpp +++ b/gfx/angle/src/libGLESv2/Framebuffer.cpp @@ -140,6 +140,23 @@ IDirect3DSurface9 *Framebuffer::getRenderTarget() return NULL; } +IDirect3DSurface9 *Framebuffer::getDepthStencil() +{ + Renderbuffer *depthstencilbuffer = mDepthbufferPointer.get(); + + if (!depthstencilbuffer) + { + depthstencilbuffer = mStencilbufferPointer.get(); + } + + if (depthstencilbuffer) + { + return depthstencilbuffer->getDepthStencil(); + } + + return NULL; +} + unsigned int Framebuffer::getDepthbufferSerial() { Renderbuffer *depthbuffer = mDepthbufferPointer.get(); @@ -152,6 +169,18 @@ unsigned int Framebuffer::getDepthbufferSerial() return 0; } +unsigned int Framebuffer::getStencilbufferSerial() +{ + Renderbuffer *stencilbuffer = mStencilbufferPointer.get(); + + if (stencilbuffer) + { + return stencilbuffer->getSerial(); + } + + return 0; +} + Colorbuffer *Framebuffer::getColorbuffer() { Renderbuffer *rb = mColorbufferPointer.get(); @@ -224,10 +253,43 @@ GLuint Framebuffer::getStencilbufferHandle() return mStencilbufferPointer.id(); } +bool Framebuffer::hasStencil() +{ + if (mStencilbufferType != GL_NONE) + { + DepthStencilbuffer *stencilbufferObject = getStencilbuffer(); + + if (stencilbufferObject) + { + return stencilbufferObject->getStencilSize() > 0; + } + } + + return false; +} + +bool Framebuffer::isMultisample() +{ + // If the framebuffer is not complete, attachment samples may be mismatched, and it + // cannot be used as a multisample framebuffer. If it is complete, it is required to + // have a color attachment, and all its attachments must have the same number of samples, + // so the number of samples for the colorbuffer will indicate whether the framebuffer is + // multisampled. + if (completeness() == GL_FRAMEBUFFER_COMPLETE && getColorbuffer()->getSamples() > 0) + { + return true; + } + else + { + return false; + } +} + GLenum Framebuffer::completeness() { int width = 0; int height = 0; + int samples = -1; if (mColorbufferType != GL_NONE) { @@ -243,8 +305,23 @@ GLenum Framebuffer::completeness() return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT; } + if (IsTextureTarget(mColorbufferType)) + { + if (IsCompressed(colorbuffer->getFormat())) + { + return GL_FRAMEBUFFER_UNSUPPORTED; + } + + if (colorbuffer->isFloatingPoint() && (!getContext()->supportsFloatRenderableTextures() || + !getContext()->supportsHalfFloatRenderableTextures())) + { + return GL_FRAMEBUFFER_UNSUPPORTED; + } + } + width = colorbuffer->getWidth(); height = colorbuffer->getHeight(); + samples = colorbuffer->getSamples(); } else { @@ -277,6 +354,23 @@ GLenum Framebuffer::completeness() { return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; } + + if (samples == -1) + { + samples = depthbuffer->getSamples(); + } + else if (samples != depthbuffer->getSamples()) + { + return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE; + } + + if (IsTextureTarget(mDepthbufferType)) + { + if (IsCompressed(depthbuffer->getFormat())) + { + return GL_FRAMEBUFFER_UNSUPPORTED; + } + } } if (mStencilbufferType != GL_NONE) @@ -302,6 +396,23 @@ GLenum Framebuffer::completeness() { return GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS; } + + if (samples == -1) + { + samples = stencilbuffer->getSamples(); + } + else if (samples != stencilbuffer->getSamples()) + { + return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_ANGLE; + } + + if (IsTextureTarget(mStencilbufferType)) + { + if (IsCompressed(stencilbuffer->getFormat())) + { + return GL_FRAMEBUFFER_UNSUPPORTED; + } + } } if (mDepthbufferType == GL_RENDERBUFFER && mStencilbufferType == GL_RENDERBUFFER) @@ -330,6 +441,18 @@ DefaultFramebuffer::DefaultFramebuffer(Colorbuffer *color, DepthStencilbuffer *d mStencilbufferPointer.set(depthStencilRenderbuffer); } +int Framebuffer::getSamples() +{ + if (completeness() == GL_FRAMEBUFFER_COMPLETE) + { + return getColorbuffer()->getSamples(); + } + else + { + return 0; + } +} + GLenum DefaultFramebuffer::completeness() { return GL_FRAMEBUFFER_COMPLETE; diff --git a/gfx/angle/src/libGLESv2/Framebuffer.h b/gfx/angle/src/libGLESv2/Framebuffer.h index 5f4e481f056..09951457a61 100644 --- a/gfx/angle/src/libGLESv2/Framebuffer.h +++ b/gfx/angle/src/libGLESv2/Framebuffer.h @@ -44,6 +44,7 @@ class Framebuffer unsigned int getRenderTargetSerial(); unsigned int getDepthbufferSerial(); + unsigned int getStencilbufferSerial(); Colorbuffer *getColorbuffer(); DepthStencilbuffer *getDepthbuffer(); @@ -57,6 +58,10 @@ class Framebuffer GLuint getDepthbufferHandle(); GLuint getStencilbufferHandle(); + bool hasStencil(); + bool isMultisample(); + int getSamples(); + virtual GLenum completeness(); protected: diff --git a/gfx/angle/src/libGLESv2/Program.cpp b/gfx/angle/src/libGLESv2/Program.cpp index a32bc9faa37..ef966036e26 100644 --- a/gfx/angle/src/libGLESv2/Program.cpp +++ b/gfx/angle/src/libGLESv2/Program.cpp @@ -595,7 +595,9 @@ bool Program::setUniform1iv(GLint location, GLsizei count, const GLint *v) Uniform *targetUniform = mUniforms[mUniformIndex[location].index]; targetUniform->dirty = true; - if (targetUniform->type == GL_INT) + if (targetUniform->type == GL_INT || + targetUniform->type == GL_SAMPLER_2D || + targetUniform->type == GL_SAMPLER_CUBE) { int arraySize = targetUniform->arraySize; @@ -949,6 +951,8 @@ void Program::applyUniforms() case GL_FLOAT_MAT2: applyUniformMatrix2fv(location, arraySize, f); break; case GL_FLOAT_MAT3: applyUniformMatrix3fv(location, arraySize, f); break; case GL_FLOAT_MAT4: applyUniformMatrix4fv(location, arraySize, f); break; + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: case GL_INT: applyUniform1iv(location, arraySize, i); break; case GL_INT_VEC2: applyUniform2iv(location, arraySize, i); break; case GL_INT_VEC3: applyUniform3iv(location, arraySize, i); break; @@ -1737,10 +1741,16 @@ Uniform *Program::createUniform(const D3DXCONSTANT_DESC &constantDescription, st switch (constantDescription.Type) { case D3DXPT_SAMPLER2D: + switch (constantDescription.Columns) + { + case 1: return new Uniform(GL_SAMPLER_2D, name, constantDescription.Elements); + default: UNREACHABLE(); + } + break; case D3DXPT_SAMPLERCUBE: switch (constantDescription.Columns) { - case 1: return new Uniform(GL_INT, name, constantDescription.Elements); + case 1: return new Uniform(GL_SAMPLER_CUBE, name, constantDescription.Elements); default: UNREACHABLE(); } break; @@ -2371,6 +2381,7 @@ void Program::resetInfoLog() if (mInfoLog) { delete [] mInfoLog; + mInfoLog = NULL; } } diff --git a/gfx/angle/src/libGLESv2/RefCountObject.cpp b/gfx/angle/src/libGLESv2/RefCountObject.cpp index e3fd36e47cb..2de1e718db6 100644 --- a/gfx/angle/src/libGLESv2/RefCountObject.cpp +++ b/gfx/angle/src/libGLESv2/RefCountObject.cpp @@ -22,6 +22,7 @@ RefCountObject::RefCountObject(GLuint id) RefCountObject::~RefCountObject() { + ASSERT(mRefCount == 0); } void RefCountObject::addRef() const diff --git a/gfx/angle/src/libGLESv2/Renderbuffer.cpp b/gfx/angle/src/libGLESv2/Renderbuffer.cpp index 81cff87e8e0..de8ea074bc8 100644 --- a/gfx/angle/src/libGLESv2/Renderbuffer.cpp +++ b/gfx/angle/src/libGLESv2/Renderbuffer.cpp @@ -11,6 +11,7 @@ #include "libGLESv2/Renderbuffer.h" #include "libGLESv2/main.h" +#include "libGLESv2/Texture.h" #include "libGLESv2/utilities.h" namespace gl @@ -68,6 +69,11 @@ GLenum Renderbuffer::getFormat() const return mStorage->getFormat(); } +D3DFORMAT Renderbuffer::getD3DFormat() const +{ + return mStorage->getD3DFormat(); +} + unsigned int Renderbuffer::getSerial() const { return mStorage->getSerial(); @@ -136,6 +142,21 @@ GLenum RenderbufferStorage::getFormat() const return mFormat; } +bool RenderbufferStorage::isFloatingPoint() const +{ + return false; // no floating point renderbuffers +} + +D3DFORMAT RenderbufferStorage::getD3DFormat() const +{ + return mD3DFormat; +} + +GLsizei RenderbufferStorage::getSamples() const +{ + return mSamples; +} + unsigned int RenderbufferStorage::getSerial() const { return mSerial; @@ -156,20 +177,42 @@ Colorbuffer::Colorbuffer(IDirect3DSurface9 *renderTarget) : mRenderTarget(render renderTarget->GetDesc(&description); setSize(description.Width, description.Height); + mD3DFormat = description.Format; + mSamples = es2dx::GetSamplesFromMultisampleType(description.MultiSampleType); + } + else + { + mD3DFormat = D3DFMT_UNKNOWN; + mSamples = 0; } - } -Colorbuffer::Colorbuffer(int width, int height, GLenum format) +Colorbuffer::Colorbuffer(const Texture* texture) : mRenderTarget(NULL) +{ + setSize(texture->getWidth(), texture->getHeight()); + mD3DFormat = texture->getD3DFormat(); + mSamples = 0; +} + +Colorbuffer::Colorbuffer(int width, int height, GLenum format, GLsizei samples) { IDirect3DDevice9 *device = getDevice(); mRenderTarget = NULL; + D3DFORMAT requestedFormat = es2dx::ConvertRenderbufferFormat(format); + int supportedSamples = getContext()->getNearestSupportedSamples(requestedFormat, samples); + + if (supportedSamples == -1) + { + error(GL_OUT_OF_MEMORY); + + return; + } if (width > 0 && height > 0) { - HRESULT result = device->CreateRenderTarget(width, height, es2dx::ConvertRenderbufferFormat(format), - D3DMULTISAMPLE_NONE, 0, FALSE, &mRenderTarget, NULL); + HRESULT result = device->CreateRenderTarget(width, height, requestedFormat, + es2dx::GetMultisampleTypeFromSamples(supportedSamples), 0, FALSE, &mRenderTarget, NULL); if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) { @@ -185,11 +228,15 @@ Colorbuffer::Colorbuffer(int width, int height, GLenum format) { setSize(width, height); mFormat = format; + mD3DFormat = requestedFormat; + mSamples = supportedSamples; } else { setSize(0, 0); mFormat = GL_RGBA4; + mD3DFormat = D3DFMT_UNKNOWN; + mSamples = 0; } } @@ -273,16 +320,34 @@ DepthStencilbuffer::DepthStencilbuffer(IDirect3DSurface9 *depthStencil) : mDepth depthStencil->GetDesc(&description); setSize(description.Width, description.Height); - mFormat = GL_DEPTH24_STENCIL8_OES; + mFormat = (description.Format == D3DFMT_D16 ? GL_DEPTH_COMPONENT16 : GL_DEPTH24_STENCIL8_OES); + mSamples = es2dx::GetSamplesFromMultisampleType(description.MultiSampleType); + mD3DFormat = description.Format; + } + else + { + mD3DFormat = D3DFMT_UNKNOWN; + mSamples = 0; } } -DepthStencilbuffer::DepthStencilbuffer(int width, int height) +DepthStencilbuffer::DepthStencilbuffer(int width, int height, GLsizei samples) { IDirect3DDevice9 *device = getDevice(); mDepthStencil = NULL; - HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, D3DMULTISAMPLE_NONE, 0, FALSE, &mDepthStencil, 0); + + int supportedSamples = getContext()->getNearestSupportedSamples(D3DFMT_D24S8, samples); + + if (supportedSamples == -1) + { + error(GL_OUT_OF_MEMORY); + + return; + } + + HRESULT result = device->CreateDepthStencilSurface(width, height, D3DFMT_D24S8, es2dx::GetMultisampleTypeFromSamples(supportedSamples), + 0, FALSE, &mDepthStencil, 0); if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY) { @@ -296,12 +361,16 @@ DepthStencilbuffer::DepthStencilbuffer(int width, int height) if (mDepthStencil) { setSize(width, height); - mFormat = GL_DEPTH24_STENCIL8_OES; + mFormat = GL_DEPTH24_STENCIL8_OES; + mD3DFormat = D3DFMT_D24S8; + mSamples = supportedSamples; } else { setSize(0, 0); mFormat = GL_RGBA4; //default format + mD3DFormat = D3DFMT_UNKNOWN; + mSamples = 0; } } @@ -364,7 +433,7 @@ Depthbuffer::Depthbuffer(IDirect3DSurface9 *depthStencil) : DepthStencilbuffer(d } } -Depthbuffer::Depthbuffer(int width, int height) : DepthStencilbuffer(width, height) +Depthbuffer::Depthbuffer(int width, int height, GLsizei samples) : DepthStencilbuffer(width, height, samples) { if (getDepthStencil()) { @@ -402,7 +471,7 @@ Stencilbuffer::Stencilbuffer(IDirect3DSurface9 *depthStencil) : DepthStencilbuff } } -Stencilbuffer::Stencilbuffer(int width, int height) : DepthStencilbuffer(width, height) +Stencilbuffer::Stencilbuffer(int width, int height, GLsizei samples) : DepthStencilbuffer(width, height, samples) { if (getDepthStencil()) { diff --git a/gfx/angle/src/libGLESv2/Renderbuffer.h b/gfx/angle/src/libGLESv2/Renderbuffer.h index bbc01bcfc74..15e661b4196 100644 --- a/gfx/angle/src/libGLESv2/Renderbuffer.h +++ b/gfx/angle/src/libGLESv2/Renderbuffer.h @@ -21,6 +21,7 @@ namespace gl { + class Texture; // A class derived from RenderbufferStorage is created whenever glRenderbufferStorage // is called. The specific concrete type depends on whether the internal format is @@ -41,7 +42,10 @@ class RenderbufferStorage virtual int getWidth() const; virtual int getHeight() const; - GLenum getFormat() const; + virtual GLenum getFormat() const; + virtual bool isFloatingPoint() const; + D3DFORMAT getD3DFormat() const; + GLsizei getSamples() const; unsigned int getSerial() const; static unsigned int issueSerial(); @@ -49,6 +53,8 @@ class RenderbufferStorage protected: void setSize(int width, int height); GLenum mFormat; + D3DFORMAT mD3DFormat; + GLsizei mSamples; unsigned int mSerial; private: @@ -80,6 +86,7 @@ class Renderbuffer : public RefCountObject int getWidth() const; int getHeight() const; GLenum getFormat() const; + D3DFORMAT getD3DFormat() const; unsigned int getSerial() const; void setStorage(RenderbufferStorage *newStorage); @@ -95,7 +102,8 @@ class Colorbuffer : public RenderbufferStorage { public: explicit Colorbuffer(IDirect3DSurface9 *renderTarget); - Colorbuffer(int width, int height, GLenum format); + explicit Colorbuffer(const Texture* texture); + Colorbuffer(int width, int height, GLenum format, GLsizei samples); ~Colorbuffer(); @@ -119,7 +127,7 @@ class DepthStencilbuffer : public RenderbufferStorage { public: explicit DepthStencilbuffer(IDirect3DSurface9 *depthStencil); - DepthStencilbuffer(int width, int height); + DepthStencilbuffer(int width, int height, GLsizei samples); ~DepthStencilbuffer(); @@ -140,7 +148,7 @@ class Depthbuffer : public DepthStencilbuffer { public: explicit Depthbuffer(IDirect3DSurface9 *depthStencil); - Depthbuffer(int width, int height); + Depthbuffer(int width, int height, GLsizei samples); ~Depthbuffer(); @@ -155,7 +163,7 @@ class Stencilbuffer : public DepthStencilbuffer { public: explicit Stencilbuffer(IDirect3DSurface9 *depthStencil); - Stencilbuffer(int width, int height); + Stencilbuffer(int width, int height, GLsizei samples); ~Stencilbuffer(); diff --git a/gfx/angle/src/libGLESv2/ResourceManager.cpp b/gfx/angle/src/libGLESv2/ResourceManager.cpp index 0b8422ea5d9..12a86c1d91f 100644 --- a/gfx/angle/src/libGLESv2/ResourceManager.cpp +++ b/gfx/angle/src/libGLESv2/ResourceManager.cpp @@ -331,7 +331,7 @@ void ResourceManager::checkRenderbufferAllocation(GLuint renderbuffer) { if (renderbuffer != 0 && !getRenderbuffer(renderbuffer)) { - Renderbuffer *renderbufferObject = new Renderbuffer(renderbuffer, new Colorbuffer(0, 0, GL_RGBA4)); + Renderbuffer *renderbufferObject = new Renderbuffer(renderbuffer, new Colorbuffer(0, 0, GL_RGBA4, 0)); mRenderbufferMap[renderbuffer] = renderbufferObject; renderbufferObject->addRef(); } diff --git a/gfx/angle/src/libGLESv2/Shader.cpp b/gfx/angle/src/libGLESv2/Shader.cpp index bc94c659f6a..6bcb2c7b123 100644 --- a/gfx/angle/src/libGLESv2/Shader.cpp +++ b/gfx/angle/src/libGLESv2/Shader.cpp @@ -34,18 +34,20 @@ Shader::Shader(ResourceManager *manager, GLuint handle) : mHandle(handle), mReso if (result) { - TBuiltInResource resources; - resources.maxVertexAttribs = MAX_VERTEX_ATTRIBS; - resources.maxVertexUniformVectors = MAX_VERTEX_UNIFORM_VECTORS; - resources.maxVaryingVectors = MAX_VARYING_VECTORS; - resources.maxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; - resources.maxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS; - resources.maxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; - resources.maxFragmentUniformVectors = MAX_FRAGMENT_UNIFORM_VECTORS; - resources.maxDrawBuffers = MAX_DRAW_BUFFERS; + ShBuiltInResources resources; + ShInitBuiltInResources(&resources); + resources.MaxVertexAttribs = MAX_VERTEX_ATTRIBS; + resources.MaxVertexUniformVectors = MAX_VERTEX_UNIFORM_VECTORS; + resources.MaxVaryingVectors = MAX_VARYING_VECTORS; + resources.MaxVertexTextureImageUnits = MAX_VERTEX_TEXTURE_IMAGE_UNITS; + resources.MaxCombinedTextureImageUnits = MAX_COMBINED_TEXTURE_IMAGE_UNITS; + resources.MaxTextureImageUnits = MAX_TEXTURE_IMAGE_UNITS; + resources.MaxFragmentUniformVectors = MAX_FRAGMENT_UNIFORM_VECTORS; + resources.MaxDrawBuffers = MAX_DRAW_BUFFERS; + resources.OES_standard_derivatives = 1; - mFragmentCompiler = ShConstructCompiler(EShLangFragment, EShSpecGLES2, &resources); - mVertexCompiler = ShConstructCompiler(EShLangVertex, EShSpecGLES2, &resources); + mFragmentCompiler = ShConstructCompiler(SH_FRAGMENT_SHADER, SH_GLES2_SPEC, &resources); + mVertexCompiler = ShConstructCompiler(SH_VERTEX_SHADER, SH_GLES2_SPEC, &resources); } } @@ -279,21 +281,23 @@ void Shader::compileToHLSL(void *compiler) delete[] mInfoLog; mInfoLog = NULL; - int result = ShCompile(compiler, &mSource, 1, EShOptNone, EDebugOpNone); - const char *obj = ShGetObjectCode(compiler); - const char *info = ShGetInfoLog(compiler); + int result = ShCompile(compiler, &mSource, 1, SH_OBJECT_CODE); if (result) { - mHlsl = new char[strlen(obj) + 1]; - strcpy(mHlsl, obj); + int objCodeLen = 0; + ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &objCodeLen); + mHlsl = new char[objCodeLen]; + ShGetObjectCode(compiler, mHlsl); TRACE("\n%s", mHlsl); } else { - mInfoLog = new char[strlen(info) + 1]; - strcpy(mInfoLog, info); + int infoLogLen = 0; + ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &infoLogLen); + mInfoLog = new char[infoLogLen]; + ShGetInfoLog(compiler, mInfoLog); TRACE("\n%s", mInfoLog); } diff --git a/gfx/angle/src/libGLESv2/Texture.cpp b/gfx/angle/src/libGLESv2/Texture.cpp index b9abb96b09a..05632c46c60 100644 --- a/gfx/angle/src/libGLESv2/Texture.cpp +++ b/gfx/angle/src/libGLESv2/Texture.cpp @@ -23,7 +23,7 @@ namespace gl { Texture::Image::Image() - : width(0), height(0), dirty(false), surface(NULL) + : width(0), height(0), dirty(false), surface(NULL), format(GL_NONE) { } @@ -45,6 +45,7 @@ Texture::Texture(GLuint id) : RefCountObject(id) mDirtyMetaData = true; mDirty = true; mIsRenderable = false; + mType = GL_UNSIGNED_BYTE; mBaseTexture = NULL; } @@ -174,15 +175,31 @@ GLuint Texture::getHeight() const return mHeight; } -// Selects an internal Direct3D 9 format for storing an Image -D3DFORMAT Texture::selectFormat(GLenum format) +bool Texture::isFloatingPoint() const { - return D3DFMT_A8R8G8B8; + return (mType == GL_FLOAT || mType == GL_HALF_FLOAT_OES); } -int Texture::imagePitch(const Image &img) const +// Selects an internal Direct3D 9 format for storing an Image +D3DFORMAT Texture::selectFormat(GLenum format, GLenum type) { - return img.width * 4; + if (format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || + format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) + { + return D3DFMT_DXT1; + } + else if (type == GL_FLOAT) + { + return D3DFMT_A32B32G32R32F; + } + else if (type == GL_HALF_FLOAT_OES) + { + return D3DFMT_A16B16G16R16F; + } + else + { + return D3DFMT_A8R8G8B8; + } } // Store the pixel rectangle designated by xoffset,yoffset,width,height with pixels stored as format/type at input @@ -192,132 +209,510 @@ void Texture::loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei { GLsizei inputPitch = ComputePitch(width, format, type, unpackAlignment); + switch (type) + { + case GL_UNSIGNED_BYTE: + switch (format) + { + case GL_ALPHA: + loadAlphaImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_LUMINANCE: + loadLuminanceImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_LUMINANCE_ALPHA: + loadLuminanceAlphaImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_RGB: + loadRGBUByteImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_RGBA: + loadRGBAUByteImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_BGRA_EXT: + loadBGRAImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + default: UNREACHABLE(); + } + break; + case GL_UNSIGNED_SHORT_5_6_5: + switch (format) + { + case GL_RGB: + loadRGB565ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + default: UNREACHABLE(); + } + break; + case GL_UNSIGNED_SHORT_4_4_4_4: + switch (format) + { + case GL_RGBA: + loadRGBA4444ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + default: UNREACHABLE(); + } + break; + case GL_UNSIGNED_SHORT_5_5_5_1: + switch (format) + { + case GL_RGBA: + loadRGBA5551ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + default: UNREACHABLE(); + } + break; + case GL_FLOAT: + switch (format) + { + // float textures are converted to RGBA, not BGRA, as they're stored that way in D3D + case GL_ALPHA: + loadAlphaFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_LUMINANCE: + loadLuminanceFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_LUMINANCE_ALPHA: + loadLuminanceAlphaFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_RGB: + loadRGBFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_RGBA: + loadRGBAFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + default: UNREACHABLE(); + } + break; + case GL_HALF_FLOAT_OES: + switch (format) + { + // float textures are converted to RGBA, not BGRA, as they're stored that way in D3D + case GL_ALPHA: + loadAlphaHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_LUMINANCE: + loadLuminanceHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_LUMINANCE_ALPHA: + loadLuminanceAlphaHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_RGB: + loadRGBHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + case GL_RGBA: + loadRGBAHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output); + break; + default: UNREACHABLE(); + } + break; + default: UNREACHABLE(); + } +} + +void Texture::loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned char *source = NULL; + unsigned char *dest = NULL; + for (int y = 0; y < height; y++) { - const unsigned char *source = static_cast(input) + y * inputPitch; - const unsigned short *source16 = reinterpret_cast(source); - unsigned char *dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; - - // fast path for EXT_texture_format_BGRA8888 - if (format == GL_BGRA_EXT && type == GL_UNSIGNED_BYTE) { - memcpy(dest, source, width*4); - continue; - } - + source = static_cast(input) + y * inputPitch; + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; for (int x = 0; x < width; x++) { - unsigned char r; - unsigned char g; - unsigned char b; - unsigned char a; - - switch (format) - { - case GL_ALPHA: - a = source[x]; - r = 0; - g = 0; - b = 0; - break; - - case GL_LUMINANCE: - r = source[x]; - g = source[x]; - b = source[x]; - a = 0xFF; - break; - - case GL_LUMINANCE_ALPHA: - r = source[2*x+0]; - g = source[2*x+0]; - b = source[2*x+0]; - a = source[2*x+1]; - break; - - case GL_RGB: - switch (type) - { - case GL_UNSIGNED_BYTE: - r = source[x * 3 + 0]; - g = source[x * 3 + 1]; - b = source[x * 3 + 2]; - a = 0xFF; - break; - - case GL_UNSIGNED_SHORT_5_6_5: - { - unsigned short rgba = source16[x]; - - a = 0xFF; - b = ((rgba & 0x001F) << 3) | ((rgba & 0x001F) >> 2); - g = ((rgba & 0x07E0) >> 3) | ((rgba & 0x07E0) >> 9); - r = ((rgba & 0xF800) >> 8) | ((rgba & 0xF800) >> 13); - } - break; - - default: UNREACHABLE(); - } - break; - - case GL_RGBA: - switch (type) - { - case GL_UNSIGNED_BYTE: - r = source[x * 4 + 0]; - g = source[x * 4 + 1]; - b = source[x * 4 + 2]; - a = source[x * 4 + 3]; - break; - - case GL_UNSIGNED_SHORT_4_4_4_4: - { - unsigned short rgba = source16[x]; - - a = ((rgba & 0x000F) << 4) | ((rgba & 0x000F) >> 0); - b = ((rgba & 0x00F0) << 0) | ((rgba & 0x00F0) >> 4); - g = ((rgba & 0x0F00) >> 4) | ((rgba & 0x0F00) >> 8); - r = ((rgba & 0xF000) >> 8) | ((rgba & 0xF000) >> 12); - } - break; - - case GL_UNSIGNED_SHORT_5_5_5_1: - { - unsigned short rgba = source16[x]; - - a = (rgba & 0x0001) ? 0xFF : 0; - b = ((rgba & 0x003E) << 2) | ((rgba & 0x003E) >> 3); - g = ((rgba & 0x07C0) >> 3) | ((rgba & 0x07C0) >> 8); - r = ((rgba & 0xF800) >> 8) | ((rgba & 0xF800) >> 13); - } - break; - - default: UNREACHABLE(); - } - break; - default: UNREACHABLE(); - } - - dest[4 * x + 0] = b; - dest[4 * x + 1] = g; - dest[4 * x + 2] = r; - dest[4 * x + 3] = a; + dest[4 * x + 0] = 0; + dest[4 * x + 1] = 0; + dest[4 * x + 2] = 0; + dest[4 * x + 3] = source[x]; } } } -void Texture::setImage(GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img) +void Texture::loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const { + const float *source = NULL; + float *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 16); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = 0; + dest[4 * x + 1] = 0; + dest[4 * x + 2] = 0; + dest[4 * x + 3] = source[x]; + } + } +} + +void Texture::loadAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned short *source = NULL; + unsigned short *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 8); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = 0; + dest[4 * x + 1] = 0; + dest[4 * x + 2] = 0; + dest[4 * x + 3] = source[x]; + } + } +} + +void Texture::loadLuminanceImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned char *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = static_cast(input) + y * inputPitch; + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[x]; + dest[4 * x + 1] = source[x]; + dest[4 * x + 2] = source[x]; + dest[4 * x + 3] = 0xFF; + } + } +} + +void Texture::loadLuminanceFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const float *source = NULL; + float *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 16); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[x]; + dest[4 * x + 1] = source[x]; + dest[4 * x + 2] = source[x]; + dest[4 * x + 3] = 1.0f; + } + } +} + +void Texture::loadLuminanceHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned short *source = NULL; + unsigned short *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 8); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[x]; + dest[4 * x + 1] = source[x]; + dest[4 * x + 2] = source[x]; + dest[4 * x + 3] = 0x3C00; // SEEEEEMMMMMMMMMM, S = 0, E = 15, M = 0: 16bit flpt representation of 1 + } + } +} + +void Texture::loadLuminanceAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned char *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = static_cast(input) + y * inputPitch; + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[2*x+0]; + dest[4 * x + 1] = source[2*x+0]; + dest[4 * x + 2] = source[2*x+0]; + dest[4 * x + 3] = source[2*x+1]; + } + } +} + +void Texture::loadLuminanceAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const float *source = NULL; + float *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 16); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[2*x+0]; + dest[4 * x + 1] = source[2*x+0]; + dest[4 * x + 2] = source[2*x+0]; + dest[4 * x + 3] = source[2*x+1]; + } + } +} + +void Texture::loadLuminanceAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned short *source = NULL; + unsigned short *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 8); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[2*x+0]; + dest[4 * x + 1] = source[2*x+0]; + dest[4 * x + 2] = source[2*x+0]; + dest[4 * x + 3] = source[2*x+1]; + } + } +} + +void Texture::loadRGBUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned char *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = static_cast(input) + y * inputPitch; + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[x * 3 + 2]; + dest[4 * x + 1] = source[x * 3 + 1]; + dest[4 * x + 2] = source[x * 3 + 0]; + dest[4 * x + 3] = 0xFF; + } + } +} + +void Texture::loadRGB565ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned short *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + for (int x = 0; x < width; x++) + { + unsigned short rgba = source[x]; + dest[4 * x + 0] = ((rgba & 0x001F) << 3) | ((rgba & 0x001F) >> 2); + dest[4 * x + 1] = ((rgba & 0x07E0) >> 3) | ((rgba & 0x07E0) >> 9); + dest[4 * x + 2] = ((rgba & 0xF800) >> 8) | ((rgba & 0xF800) >> 13); + dest[4 * x + 3] = 0xFF; + } + } +} + +void Texture::loadRGBFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const float *source = NULL; + float *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 16); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[x * 3 + 0]; + dest[4 * x + 1] = source[x * 3 + 1]; + dest[4 * x + 2] = source[x * 3 + 2]; + dest[4 * x + 3] = 1.0f; + } + } +} + +void Texture::loadRGBHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned short *source = NULL; + unsigned short *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 8); + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[x * 3 + 0]; + dest[4 * x + 1] = source[x * 3 + 1]; + dest[4 * x + 2] = source[x * 3 + 2]; + dest[4 * x + 3] = 0x3C00; // SEEEEEMMMMMMMMMM, S = 0, E = 15, M = 0: 16bit flpt representation of 1 + } + } +} + +void Texture::loadRGBAUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned char *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = static_cast(input) + y * inputPitch; + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + for (int x = 0; x < width; x++) + { + dest[4 * x + 0] = source[x * 4 + 2]; + dest[4 * x + 1] = source[x * 4 + 1]; + dest[4 * x + 2] = source[x * 4 + 0]; + dest[4 * x + 3] = source[x * 4 + 3]; + } + } +} + +void Texture::loadRGBA4444ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned short *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + for (int x = 0; x < width; x++) + { + unsigned short rgba = source[x]; + dest[4 * x + 0] = ((rgba & 0x00F0) << 0) | ((rgba & 0x00F0) >> 4); + dest[4 * x + 1] = ((rgba & 0x0F00) >> 4) | ((rgba & 0x0F00) >> 8); + dest[4 * x + 2] = ((rgba & 0xF000) >> 8) | ((rgba & 0xF000) >> 12); + dest[4 * x + 3] = ((rgba & 0x000F) << 4) | ((rgba & 0x000F) >> 0); + } + } +} + +void Texture::loadRGBA5551ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned short *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + for (int x = 0; x < width; x++) + { + unsigned short rgba = source[x]; + dest[4 * x + 0] = ((rgba & 0x003E) << 2) | ((rgba & 0x003E) >> 3); + dest[4 * x + 1] = ((rgba & 0x07C0) >> 3) | ((rgba & 0x07C0) >> 8); + dest[4 * x + 2] = ((rgba & 0xF800) >> 8) | ((rgba & 0xF800) >> 13); + dest[4 * x + 3] = (rgba & 0x0001) ? 0xFF : 0; + } + } +} + +void Texture::loadRGBAFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const float *source = NULL; + float *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = reinterpret_cast(static_cast(input) + y * inputPitch); + dest = reinterpret_cast(static_cast(output) + (y + yoffset) * outputPitch + xoffset * 16); + memcpy(dest, source, width * 16); + } +} + +void Texture::loadRGBAHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned char *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = static_cast(input) + y * inputPitch; + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 8; + memcpy(dest, source, width * 8); + } +} + +void Texture::loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const +{ + const unsigned char *source = NULL; + unsigned char *dest = NULL; + + for (int y = 0; y < height; y++) + { + source = static_cast(input) + y * inputPitch; + dest = static_cast(output) + (y + yoffset) * outputPitch + xoffset * 4; + memcpy(dest, source, width*4); + } +} + +void Texture::createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img) +{ + IDirect3DTexture9 *newTexture = NULL; IDirect3DSurface9 *newSurface = NULL; if (width != 0 && height != 0) { - HRESULT result = getDevice()->CreateOffscreenPlainSurface(width, height, selectFormat(format), D3DPOOL_SYSTEMMEM, &newSurface, NULL); + int levelToFetch = 0; + GLsizei requestWidth = width; + GLsizei requestHeight = height; + if (IsCompressed(format) && (width % 4 != 0 || height % 4 != 0)) + { + bool isMult4 = false; + int upsampleCount = 0; + while (!isMult4) + { + requestWidth <<= 1; + requestHeight <<= 1; + upsampleCount++; + if (requestWidth % 4 == 0 && requestHeight % 4 == 0) + { + isMult4 = true; + } + } + levelToFetch = upsampleCount; + } + + HRESULT result = getDevice()->CreateTexture(requestWidth, requestHeight, levelToFetch + 1, NULL, selectFormat(format, type), + D3DPOOL_SYSTEMMEM, &newTexture, NULL); if (FAILED(result)) { ASSERT(result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY); return error(GL_OUT_OF_MEMORY); } + + newTexture->GetSurfaceLevel(levelToFetch, &newSurface); + newTexture->Release(); } if (img->surface) img->surface->Release(); @@ -326,18 +721,46 @@ void Texture::setImage(GLsizei width, GLsizei height, GLenum format, GLenum type img->width = width; img->height = height; img->format = format; +} - if (pixels != NULL && newSurface != NULL) +void Texture::setImage(GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img) +{ + createSurface(width, height, format, type, img); + + if (pixels != NULL && img->surface != NULL) { D3DLOCKED_RECT locked; - HRESULT result = newSurface->LockRect(&locked, NULL, 0); + HRESULT result = img->surface->LockRect(&locked, NULL, 0); ASSERT(SUCCEEDED(result)); if (SUCCEEDED(result)) { loadImageData(0, 0, width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits); - newSurface->UnlockRect(); + img->surface->UnlockRect(); + } + + img->dirty = true; + } + + mDirtyMetaData = true; +} + +void Texture::setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img) +{ + createSurface(width, height, format, GL_UNSIGNED_BYTE, img); + + if (pixels != NULL && img->surface != NULL) + { + D3DLOCKED_RECT locked; + HRESULT result = img->surface->LockRect(&locked, NULL, 0); + + ASSERT(SUCCEEDED(result)); + + if (SUCCEEDED(result)) + { + memcpy(locked.pBits, pixels, imageSize); + img->surface->UnlockRect(); } img->dirty = true; @@ -354,21 +777,84 @@ bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei heig return false; } - D3DLOCKED_RECT locked; - HRESULT result = img->surface->LockRect(&locked, NULL, 0); - - ASSERT(SUCCEEDED(result)); - - if (SUCCEEDED(result)) + if (!img->surface) { - loadImageData(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits); - img->surface->UnlockRect(); + createSurface(img->width, img->height, format, type, img); + } + + if (pixels != NULL && img->surface != NULL) + { + D3DLOCKED_RECT locked; + HRESULT result = img->surface->LockRect(&locked, NULL, 0); + + ASSERT(SUCCEEDED(result)); + + if (SUCCEEDED(result)) + { + loadImageData(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits); + img->surface->UnlockRect(); + } + + img->dirty = true; } - img->dirty = true; return true; } +bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img) +{ + if (width + xoffset > img->width || height + yoffset > img->height) + { + error(GL_INVALID_VALUE); + return false; + } + + if (format != getFormat()) + { + error(GL_INVALID_OPERATION); + return false; + } + + if (!img->surface) + { + createSurface(img->width, img->height, format, GL_UNSIGNED_BYTE, img); + } + + if (pixels != NULL && img->surface != NULL) + { + RECT updateRegion; + updateRegion.left = xoffset; + updateRegion.right = xoffset + width; + updateRegion.bottom = yoffset + height; + updateRegion.top = yoffset; + + D3DLOCKED_RECT locked; + HRESULT result = img->surface->LockRect(&locked, &updateRegion, 0); + + ASSERT(SUCCEEDED(result)); + + if (SUCCEEDED(result)) + { + GLsizei inputPitch = ComputeCompressedPitch(width, format); + int rows = imageSize / inputPitch; + for (int i = 0; i < rows; ++i) + { + memcpy((void*)((BYTE*)locked.pBits + i * locked.Pitch), (void*)((BYTE*)pixels + i * inputPitch), inputPitch); + } + img->surface->UnlockRect(); + } + + img->dirty = true; + } + + return true; +} + +D3DFORMAT Texture::getD3DFormat() const +{ + return selectFormat(getFormat(), mType); +} + IDirect3DBaseTexture9 *Texture::getTexture() { if (!isComplete()) @@ -460,12 +946,11 @@ int Texture::levelCount() const Texture2D::Texture2D(GLuint id) : Texture(id) { mTexture = NULL; - mColorbufferProxy = NULL; } Texture2D::~Texture2D() { - delete mColorbufferProxy; + mColorbufferProxy.set(NULL); if (mTexture) { @@ -479,13 +964,18 @@ GLenum Texture2D::getTarget() const return GL_TEXTURE_2D; } +GLenum Texture2D::getFormat() const +{ + return mImageArray[0].format; +} + // While OpenGL doesn't check texture consistency until draw-time, D3D9 requires a complete texture // for render-to-texture (such as CopyTexImage). We have no way of keeping individual inconsistent levels. // Call this when a particular level of the texture must be defined with a specific format, width and height. // // Returns true if the existing texture was unsuitable had to be destroyed. If so, it will also set // a new height and width for the texture by working backwards from the given width and height. -bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei width, GLsizei height) +bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum type) { bool widthOkay = (mWidth >> level == width); bool heightOkay = (mHeight >> level == height); @@ -494,7 +984,9 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt || (widthOkay && mHeight >> level == 0 && height == 1) || (heightOkay && mWidth >> level == 0 && width == 1)); - bool textureOkay = (sizeOkay && internalFormat == mImageArray[0].format); + bool typeOkay = (type == mType); + + bool textureOkay = (sizeOkay && typeOkay && internalFormat == mImageArray[0].format); if (!textureOkay) { @@ -525,6 +1017,7 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt mWidth = width << level; mHeight = height << level; mImageArray[0].format = internalFormat; + mType = type; } return !textureOkay; @@ -532,11 +1025,18 @@ bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei widt void Texture2D::setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) { - redefineTexture(level, internalFormat, width, height); + redefineTexture(level, internalFormat, width, height, type); Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[level]); } +void Texture2D::setCompressedImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels) +{ + redefineTexture(level, internalFormat, width, height, GL_UNSIGNED_BYTE); + + Texture::setCompressedImage(width, height, internalFormat, imageSize, pixels, &mImageArray[level]); +} + void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height) { ASSERT(mImageArray[level].surface != NULL); @@ -580,9 +1080,17 @@ void Texture2D::subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei widt } } +void Texture2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels) +{ + if (Texture::subImageCompressed(xoffset, yoffset, width, height, format, imageSize, pixels, &mImageArray[level])) + { + commitRect(level, xoffset, yoffset, width, height); + } +} + void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source) { - if (redefineTexture(level, internalFormat, width, height)) + if (redefineTexture(level, internalFormat, width, height, mType)) { convertToRenderTarget(); pushTexture(mTexture, true); @@ -619,7 +1127,7 @@ void Texture2D::copySubImage(GLint level, GLint xoffset, GLint yoffset, GLint x, return error(GL_INVALID_VALUE); } - if (redefineTexture(0, mImageArray[0].format, mImageArray[0].width, mImageArray[0].height)) + if (redefineTexture(0, mImageArray[0].format, mImageArray[0].width, mImageArray[0].height, mType)) { convertToRenderTarget(); pushTexture(mTexture, true); @@ -673,6 +1181,16 @@ bool Texture2D::isComplete() const default: UNREACHABLE(); } + if ((getFormat() == GL_FLOAT && !getContext()->supportsFloatLinearFilter()) || + (getFormat() == GL_HALF_FLOAT_OES && !getContext()->supportsHalfFloatLinearFilter())) + { + if (mMagFilter != GL_NEAREST || (mMinFilter != GL_NEAREST && mMinFilter != GL_NEAREST_MIPMAP_NEAREST)) + { + return false; + } + } + + if ((getWrapS() != GL_CLAMP_TO_EDGE && !isPow2(width)) || (getWrapT() != GL_CLAMP_TO_EDGE && !isPow2(height))) { @@ -710,13 +1228,18 @@ bool Texture2D::isComplete() const return true; } +bool Texture2D::isCompressed() const +{ + return IsCompressed(getFormat()); +} + // Constructs a Direct3D 9 texture resource from the texture images, or returns an existing one IDirect3DBaseTexture9 *Texture2D::createTexture() { IDirect3DTexture9 *texture; IDirect3DDevice9 *device = getDevice(); - D3DFORMAT format = selectFormat(mImageArray[0].format); + D3DFORMAT format = selectFormat(mImageArray[0].format, mType); HRESULT result = device->CreateTexture(mWidth, mHeight, creationLevels(mWidth, mHeight, 0), 0, format, D3DPOOL_DEFAULT, &texture, NULL); @@ -767,7 +1290,7 @@ IDirect3DBaseTexture9 *Texture2D::convertToRenderTarget() { egl::Display *display = getDisplay(); IDirect3DDevice9 *device = getDevice(); - D3DFORMAT format = selectFormat(mImageArray[0].format); + D3DFORMAT format = selectFormat(mImageArray[0].format, mType); HRESULT result = device->CreateTexture(mWidth, mHeight, creationLevels(mWidth, mHeight, 0), D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL); @@ -874,6 +1397,11 @@ void Texture2D::generateMipmaps() needRenderTarget(); + if (mTexture == NULL) + { + return; + } + for (unsigned int i = 1; i <= q; i++) { IDirect3DSurface9 *upper = NULL; @@ -899,13 +1427,12 @@ Renderbuffer *Texture2D::getColorbuffer(GLenum target) return error(GL_INVALID_OPERATION, (Renderbuffer *)NULL); } - if (mColorbufferProxy == NULL) + if (mColorbufferProxy.get() == NULL) { - mColorbufferProxy = new Renderbuffer(id(), new TextureColorbufferProxy(this, target)); - mColorbufferProxy->addRef(); + mColorbufferProxy.set(new Renderbuffer(id(), new TextureColorbufferProxy(this, target))); } - return mColorbufferProxy; + return mColorbufferProxy.get(); } IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target) @@ -914,6 +1441,11 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target) needRenderTarget(); + if (mTexture == NULL) + { + return NULL; + } + IDirect3DSurface9 *renderTarget = NULL; mTexture->GetSurfaceLevel(0, &renderTarget); @@ -923,18 +1455,13 @@ IDirect3DSurface9 *Texture2D::getRenderTarget(GLenum target) TextureCubeMap::TextureCubeMap(GLuint id) : Texture(id) { mTexture = NULL; - - for (int i = 0; i < 6; i++) - { - mFaceProxies[i] = NULL; - } } TextureCubeMap::~TextureCubeMap() { for (int i = 0; i < 6; i++) { - delete mFaceProxies[i]; + mFaceProxies[i].set(NULL); } if (mTexture) @@ -949,6 +1476,11 @@ GLenum TextureCubeMap::getTarget() const return GL_TEXTURE_CUBE_MAP; } +GLenum TextureCubeMap::getFormat() const +{ + return mImageArray[0][0].format; +} + void TextureCubeMap::setImagePosX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels) { setImage(0, level, internalFormat, width, height, format, type, unpackAlignment, pixels); @@ -979,6 +1511,13 @@ void TextureCubeMap::setImageNegZ(GLint level, GLenum internalFormat, GLsizei wi setImage(5, level, internalFormat, width, height, format, type, unpackAlignment, pixels); } +void TextureCubeMap::setCompressedImage(GLenum face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels) +{ + redefineTexture(level, internalFormat, width); + + Texture::setCompressedImage(width, height, internalFormat, imageSize, pixels, &mImageArray[faceIndex(face)][level]); +} + void TextureCubeMap::commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height) { int face = faceIndex(faceTarget); @@ -1022,6 +1561,14 @@ void TextureCubeMap::subImage(GLenum face, GLint level, GLint xoffset, GLint yof } } +void TextureCubeMap::subImageCompressed(GLenum face, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels) +{ + if (Texture::subImageCompressed(xoffset, yoffset, width, height, format, imageSize, pixels, &mImageArray[faceIndex(face)][level])) + { + commitRect(face, level, xoffset, yoffset, width, height); + } +} + // Tests for GL texture object completeness. [OpenGL ES 2.0.24] section 3.7.10 page 81. bool TextureCubeMap::isComplete() const { @@ -1057,6 +1604,15 @@ bool TextureCubeMap::isComplete() const } } + if ((getFormat() == GL_FLOAT && !getContext()->supportsFloatLinearFilter()) || + (getFormat() == GL_HALF_FLOAT_OES && !getContext()->supportsHalfFloatLinearFilter())) + { + if (mMagFilter != GL_NEAREST || (mMinFilter != GL_NEAREST && mMinFilter != GL_NEAREST_MIPMAP_NEAREST)) + { + return false; + } + } + if (mipmapping) { if (!isPow2(size) && (getWrapS() != GL_CLAMP_TO_EDGE || getWrapT() != GL_CLAMP_TO_EDGE)) @@ -1088,11 +1644,16 @@ bool TextureCubeMap::isComplete() const return true; } +bool TextureCubeMap::isCompressed() const +{ + return IsCompressed(getFormat()); +} + // Constructs a Direct3D 9 texture resource from the texture images, or returns an existing one IDirect3DBaseTexture9 *TextureCubeMap::createTexture() { IDirect3DDevice9 *device = getDevice(); - D3DFORMAT format = selectFormat(mImageArray[0][0].format); + D3DFORMAT format = selectFormat(mImageArray[0][0].format, mType); IDirect3DCubeTexture9 *texture; @@ -1148,7 +1709,7 @@ IDirect3DBaseTexture9 *TextureCubeMap::convertToRenderTarget() { egl::Display *display = getDisplay(); IDirect3DDevice9 *device = getDevice(); - D3DFORMAT format = selectFormat(mImageArray[0][0].format); + D3DFORMAT format = selectFormat(mImageArray[0][0].format, mType); HRESULT result = device->CreateCubeTexture(mWidth, creationLevels(mWidth, 0), D3DUSAGE_RENDERTARGET, format, D3DPOOL_DEFAULT, &texture, NULL); @@ -1450,6 +2011,11 @@ void TextureCubeMap::generateMipmaps() needRenderTarget(); + if (mTexture == NULL) + { + return; + } + for (unsigned int f = 0; f < 6; f++) { for (unsigned int i = 1; i <= q; i++) @@ -1477,13 +2043,12 @@ Renderbuffer *TextureCubeMap::getColorbuffer(GLenum target) unsigned int face = faceIndex(target); - if (mFaceProxies[face] == NULL) + if (mFaceProxies[face].get() == NULL) { - mFaceProxies[face] = new Renderbuffer(id(), new TextureColorbufferProxy(this, target)); - mFaceProxies[face]->addRef(); + mFaceProxies[face].set(new Renderbuffer(id(), new TextureColorbufferProxy(this, target))); } - return mFaceProxies[face]; + return mFaceProxies[face].get(); } IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target) @@ -1491,7 +2056,12 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target) ASSERT(IsCubemapTextureTarget(target)); needRenderTarget(); - + + if (mTexture == NULL) + { + return NULL; + } + IDirect3DSurface9 *renderTarget = NULL; mTexture->GetCubeMapSurface(static_cast(faceIndex(target)), 0, &renderTarget); @@ -1499,7 +2069,7 @@ IDirect3DSurface9 *TextureCubeMap::getRenderTarget(GLenum target) } Texture::TextureColorbufferProxy::TextureColorbufferProxy(Texture *texture, GLenum target) - : Colorbuffer(NULL), mTexture(texture), mTarget(target) + : Colorbuffer(texture), mTexture(texture), mTarget(target) { ASSERT(target == GL_TEXTURE_2D || IsCubemapTextureTarget(target)); } @@ -1533,4 +2103,14 @@ int Texture::TextureColorbufferProxy::getHeight() const return mTexture->getHeight(); } +GLenum Texture::TextureColorbufferProxy::getFormat() const +{ + return mTexture->getFormat(); +} + +bool Texture::TextureColorbufferProxy::isFloatingPoint() const +{ + return mTexture->isFloatingPoint(); +} + } diff --git a/gfx/angle/src/libGLESv2/Texture.h b/gfx/angle/src/libGLESv2/Texture.h index 64598a6c7f4..6285a7cb183 100644 --- a/gfx/angle/src/libGLESv2/Texture.h +++ b/gfx/angle/src/libGLESv2/Texture.h @@ -18,6 +18,7 @@ #include #include "libGLESv2/Renderbuffer.h" +#include "libGLESv2/RefCountObject.h" #include "libGLESv2/utilities.h" #include "common/debug.h" @@ -55,8 +56,12 @@ class Texture : public RefCountObject GLuint getWidth() const; GLuint getHeight() const; + virtual GLenum getFormat() const = 0; virtual bool isComplete() const = 0; + virtual bool isCompressed() const = 0; + bool isFloatingPoint() const; + D3DFORMAT getD3DFormat() const; IDirect3DBaseTexture9 *getTexture(); virtual Renderbuffer *getColorbuffer(GLenum target) = 0; @@ -82,6 +87,8 @@ class Texture : public RefCountObject virtual int getWidth() const; virtual int getHeight() const; + virtual GLenum getFormat() const; + virtual bool isFloatingPoint() const; private: Texture *mTexture; @@ -103,11 +110,12 @@ class Texture : public RefCountObject IDirect3DSurface9 *surface; }; - static D3DFORMAT selectFormat(GLenum format); - int imagePitch(const Image& img) const; + static D3DFORMAT selectFormat(GLenum format, GLenum type); void setImage(GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img); bool subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img); + void setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img); + bool subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img); void needRenderTarget(); @@ -135,6 +143,7 @@ class Texture : public RefCountObject GLenum mMagFilter; GLenum mWrapS; GLenum mWrapT; + GLenum mType; private: DISALLOW_COPY_AND_ASSIGN(Texture); @@ -142,11 +151,53 @@ class Texture : public RefCountObject void loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *input, std::size_t outputPitch, void *output) const; + void loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadLuminanceImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadLuminanceFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadLuminanceHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadLuminanceAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadLuminanceAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadLuminanceAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGB565ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBAUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBA4444ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBA5551ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBAFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadRGBAHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + void loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, + size_t inputPitch, const void *input, size_t outputPitch, void *output) const; + + void createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img); + IDirect3DBaseTexture9 *mBaseTexture; // This is a weak pointer. The derived class is assumed to own a strong pointer. bool mDirty; bool mDirtyMetaData; bool mIsRenderable; + }; class Texture2D : public Texture @@ -157,13 +208,17 @@ class Texture2D : public Texture ~Texture2D(); GLenum getTarget() const; + GLenum getFormat() const; void setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); + void setCompressedImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels); void subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); + void subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels); void copyImage(GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source); void copySubImage(GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source); bool isComplete() const; + bool isCompressed() const; virtual void generateMipmaps(); @@ -179,14 +234,14 @@ class Texture2D : public Texture virtual bool dirtyImageData() const; - bool redefineTexture(GLint level, GLenum internalFormat, GLsizei width, GLsizei height); + bool redefineTexture(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum type); void commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height); Image mImageArray[MAX_TEXTURE_LEVELS]; IDirect3DTexture9 *mTexture; - Renderbuffer *mColorbufferProxy; + BindingPointer mColorbufferProxy; }; class TextureCubeMap : public Texture @@ -197,6 +252,7 @@ class TextureCubeMap : public Texture ~TextureCubeMap(); GLenum getTarget() const; + GLenum getFormat() const; void setImagePosX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImageNegX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); @@ -205,11 +261,15 @@ class TextureCubeMap : public Texture void setImagePosZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); void setImageNegZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); + void setCompressedImage(GLenum face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels); + void subImage(GLenum face, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels); + void subImageCompressed(GLenum face, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels); void copyImage(GLenum face, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source); void copySubImage(GLenum face, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source); bool isComplete() const; + bool isCompressed() const; virtual void generateMipmaps(); @@ -241,7 +301,7 @@ class TextureCubeMap : public Texture IDirect3DCubeTexture9 *mTexture; - Renderbuffer *mFaceProxies[6]; + BindingPointer mFaceProxies[6]; }; } diff --git a/gfx/angle/src/libGLESv2/libGLESv2.cpp b/gfx/angle/src/libGLESv2/libGLESv2.cpp index 795f4b93abf..7ac312d0376 100644 --- a/gfx/angle/src/libGLESv2/libGLESv2.cpp +++ b/gfx/angle/src/libGLESv2/libGLESv2.cpp @@ -20,6 +20,7 @@ #include "libGLESv2/utilities.h" #include "libGLESv2/Buffer.h" #include "libGLESv2/Context.h" +#include "libGLESv2/Fence.h" #include "libGLESv2/Framebuffer.h" #include "libGLESv2/Program.h" #include "libGLESv2/Renderbuffer.h" @@ -180,7 +181,7 @@ void __stdcall glBindFramebuffer(GLenum target, GLuint framebuffer) try { - if (target != GL_FRAMEBUFFER) + if (target != GL_FRAMEBUFFER && target != GL_DRAW_FRAMEBUFFER_ANGLE && target != GL_READ_FRAMEBUFFER_ANGLE) { return error(GL_INVALID_ENUM); } @@ -189,7 +190,15 @@ void __stdcall glBindFramebuffer(GLenum target, GLuint framebuffer) if (context) { - context->bindFramebuffer(framebuffer); + if (target == GL_READ_FRAMEBUFFER_ANGLE || target == GL_FRAMEBUFFER) + { + context->bindReadFramebuffer(framebuffer); + } + + if (target == GL_DRAW_FRAMEBUFFER_ANGLE || target == GL_FRAMEBUFFER) + { + context->bindDrawFramebuffer(framebuffer); + } } } catch(std::bad_alloc&) @@ -559,7 +568,7 @@ GLenum __stdcall glCheckFramebufferStatus(GLenum target) try { - if (target != GL_FRAMEBUFFER) + if (target != GL_FRAMEBUFFER && target != GL_DRAW_FRAMEBUFFER_ANGLE && target != GL_READ_FRAMEBUFFER_ANGLE) { return error(GL_INVALID_ENUM, 0); } @@ -568,7 +577,15 @@ GLenum __stdcall glCheckFramebufferStatus(GLenum target) if (context) { - gl::Framebuffer *framebuffer = context->getFramebuffer(); + gl::Framebuffer *framebuffer = NULL; + if (target == GL_READ_FRAMEBUFFER_ANGLE) + { + framebuffer = context->getReadFramebuffer(); + } + else + { + framebuffer = context->getDrawFramebuffer(); + } return framebuffer->completeness(); } @@ -720,11 +737,6 @@ void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum interna try { - if (!gl::IsTextureTarget(target)) - { - return error(GL_INVALID_ENUM); - } - if (level < 0 || level > gl::MAX_TEXTURE_LEVELS) { return error(GL_INVALID_VALUE); @@ -735,7 +747,97 @@ void __stdcall glCompressedTexImage2D(GLenum target, GLint level, GLenum interna return error(GL_INVALID_VALUE); } - return error(GL_INVALID_ENUM); // ultimately we don't support compressed textures + switch (target) + { + case GL_TEXTURE_2D: + if (width > (gl::MAX_TEXTURE_SIZE >> level) || height > (gl::MAX_TEXTURE_SIZE >> level)) + { + return error(GL_INVALID_VALUE); + } + break; + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + if (width != height) + { + return error(GL_INVALID_VALUE); + } + + if (width > (gl::MAX_CUBE_MAP_TEXTURE_SIZE >> level) || height > (gl::MAX_CUBE_MAP_TEXTURE_SIZE >> level)) + { + return error(GL_INVALID_VALUE); + } + break; + default: + return error(GL_INVALID_ENUM); + } + + switch (internalformat) + { + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + break; + default: + return error(GL_INVALID_ENUM); + } + + if (border != 0) + { + return error(GL_INVALID_VALUE); + } + + gl::Context *context = gl::getContext(); + + if (context) + { + if (!context->supportsCompressedTextures()) + { + return error(GL_INVALID_ENUM); // in this case, it's as though the internal format switch failed + } + + if (imageSize != gl::ComputeCompressedSize(width, height, internalformat)) + { + return error(GL_INVALID_VALUE); + } + + if (target == GL_TEXTURE_2D) + { + gl::Texture2D *texture = context->getTexture2D(); + + if (!texture) + { + return error(GL_INVALID_OPERATION); + } + + texture->setCompressedImage(level, internalformat, width, height, imageSize, data); + } + else + { + gl::TextureCubeMap *texture = context->getTextureCubeMap(); + + if (!texture) + { + return error(GL_INVALID_OPERATION); + } + + switch (target) + { + case GL_TEXTURE_CUBE_MAP_POSITIVE_X: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y: + case GL_TEXTURE_CUBE_MAP_POSITIVE_Z: + case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z: + texture->setCompressedImage(target, level, internalformat, width, height, imageSize, data); + break; + default: UNREACHABLE(); + } + } + } + } catch(std::bad_alloc&) { @@ -763,17 +865,95 @@ void __stdcall glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffs return error(GL_INVALID_VALUE); } - if (xoffset < 0 || yoffset < 0 || width < 0 || height < 0 || (level > 0 && !gl::isPow2(width)) || (level > 0 && !gl::isPow2(height)) || imageSize < 0) + if (xoffset < 0 || yoffset < 0 || width < 0 || height < 0 || + (level > 0 && !gl::isPow2(width)) || (level > 0 && !gl::isPow2(height)) || imageSize < 0) { return error(GL_INVALID_VALUE); } - if (xoffset != 0 || yoffset != 0) + switch (format) { - return error(GL_INVALID_OPERATION); + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + break; + default: + return error(GL_INVALID_ENUM); } - return error(GL_INVALID_OPERATION); // The texture being operated on is not a compressed texture. + if (width == 0 || height == 0 || data == NULL) + { + return; + } + + gl::Context *context = gl::getContext(); + + if (context) + { + if (!context->supportsCompressedTextures()) + { + return error(GL_INVALID_ENUM); // in this case, it's as though the format switch has failed. + } + + if (imageSize != gl::ComputeCompressedSize(width, height, format)) + { + return error(GL_INVALID_VALUE); + } + + if (xoffset % 4 != 0 || yoffset % 4 != 0) + { + return error(GL_INVALID_OPERATION); // we wait to check the offsets until this point, because the multiple-of-four restriction + // does not exist unless DXT1 textures are supported. + } + + if (target == GL_TEXTURE_2D) + { + gl::Texture2D *texture = context->getTexture2D(); + + if (!texture) + { + return error(GL_INVALID_OPERATION); + } + + if (!texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if ((width % 4 != 0 && width != texture->getWidth()) || + (height % 4 != 0 && height != texture->getHeight())) + { + return error(GL_INVALID_OPERATION); + } + + texture->subImageCompressed(level, xoffset, yoffset, width, height, format, imageSize, data); + } + else if (gl::IsCubemapTextureTarget(target)) + { + gl::TextureCubeMap *texture = context->getTextureCubeMap(); + + if (!texture) + { + return error(GL_INVALID_OPERATION); + } + + if (!texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if ((width % 4 != 0 && width != texture->getWidth()) || + (height % 4 != 0 && height != texture->getHeight())) + { + return error(GL_INVALID_OPERATION); + } + + texture->subImageCompressed(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + else + { + UNREACHABLE(); + } + } } catch(std::bad_alloc&) { @@ -834,6 +1014,8 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma case GL_LUMINANCE_ALPHA: case GL_RGB: case GL_RGBA: + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: // Compressed textures are not supported here, but if they are unsupported altogether, + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: // a different error is generated than otherwise. That is handled below. break; default: return error(GL_INVALID_VALUE); @@ -848,12 +1030,30 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma if (context) { - gl::Framebuffer *framebuffer = context->getFramebuffer(); + if (internalformat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || + internalformat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) + { + if (context->supportsCompressedTextures()) + { + return error(GL_INVALID_OPERATION); + } + else + { + return error(GL_INVALID_ENUM); + } + } + + gl::Framebuffer *framebuffer = context->getReadFramebuffer(); if (framebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE) { return error(GL_INVALID_FRAMEBUFFER_OPERATION); } + if (context->getReadFramebufferHandle() != 0 && framebuffer->getColorbuffer()->getSamples() != 0) + { + return error(GL_INVALID_OPERATION); + } + gl::Colorbuffer *source = framebuffer->getColorbuffer(); if (target == GL_TEXTURE_2D) { @@ -863,6 +1063,16 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma { return error(GL_INVALID_OPERATION); } + + if (texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if (texture->isFloatingPoint()) + { + return error(GL_INVALID_OPERATION); + } texture->copyImage(level, internalformat, x, y, width, height, source); } @@ -875,6 +1085,16 @@ void __stdcall glCopyTexImage2D(GLenum target, GLint level, GLenum internalforma return error(GL_INVALID_OPERATION); } + if (texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if (texture->isFloatingPoint()) + { + return error(GL_INVALID_OPERATION); + } + texture->copyImage(target, level, internalformat, x, y, width, height, source); } else @@ -921,12 +1141,17 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL if (context) { - gl::Framebuffer *framebuffer = context->getFramebuffer(); + gl::Framebuffer *framebuffer = context->getReadFramebuffer(); if (framebuffer->completeness() != GL_FRAMEBUFFER_COMPLETE) { return error(GL_INVALID_FRAMEBUFFER_OPERATION); } + if (context->getReadFramebufferHandle() != 0 && framebuffer->getColorbuffer()->getSamples() != 0) + { + return error(GL_INVALID_OPERATION); + } + gl::Colorbuffer *source = framebuffer->getColorbuffer(); if (target == GL_TEXTURE_2D) { @@ -937,6 +1162,16 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL return error(GL_INVALID_OPERATION); } + if (texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if (texture->isFloatingPoint()) + { + return error(GL_INVALID_OPERATION); + } + texture->copySubImage(level, xoffset, yoffset, x, y, width, height, source); } else if (gl::IsCubemapTextureTarget(target)) @@ -948,6 +1183,16 @@ void __stdcall glCopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GL return error(GL_INVALID_OPERATION); } + if (texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if (texture->isFloatingPoint()) + { + return error(GL_INVALID_OPERATION); + } + texture->copySubImage(target, level, xoffset, yoffset, x, y, width, height, source); } else @@ -1069,6 +1314,33 @@ void __stdcall glDeleteBuffers(GLsizei n, const GLuint* buffers) } } +void __stdcall glDeleteFencesNV(GLsizei n, const GLuint* fences) +{ + TRACE("(GLsizei n = %d, const GLuint* fences = 0x%0.8p)", n, fences); + + try + { + if (n < 0) + { + return error(GL_INVALID_VALUE); + } + + gl::Context *context = gl::getContext(); + + if (context) + { + for (int i = 0; i < n; i++) + { + context->deleteFence(fences[i]); + } + } + } + catch(std::bad_alloc&) + { + return error(GL_OUT_OF_MEMORY); + } +} + void __stdcall glDeleteFramebuffers(GLsizei n, const GLuint* framebuffers) { TRACE("(GLsizei n = %d, const GLuint* framebuffers = 0x%0.8p)", n, framebuffers); @@ -1524,6 +1796,32 @@ void __stdcall glEnableVertexAttribArray(GLuint index) } } +void __stdcall glFinishFenceNV(GLuint fence) +{ + TRACE("(GLuint fence = %d)", fence); + + try + { + gl::Context *context = gl::getContext(); + + if (context) + { + gl::Fence* fenceObject = context->getFence(fence); + + if (fenceObject == NULL) + { + return error(GL_INVALID_OPERATION); + } + + fenceObject->finishFence(); + } + } + catch(std::bad_alloc&) + { + return error(GL_OUT_OF_MEMORY); + } +} + void __stdcall glFinish(void) { TRACE("()"); @@ -1569,7 +1867,8 @@ void __stdcall glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenu try { - if (target != GL_FRAMEBUFFER || renderbuffertarget != GL_RENDERBUFFER) + if ((target != GL_FRAMEBUFFER && target != GL_DRAW_FRAMEBUFFER_ANGLE && target != GL_READ_FRAMEBUFFER_ANGLE) + || renderbuffertarget != GL_RENDERBUFFER) { return error(GL_INVALID_ENUM); } @@ -1578,9 +1877,20 @@ void __stdcall glFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenu if (context) { - gl::Framebuffer *framebuffer = context->getFramebuffer(); + gl::Framebuffer *framebuffer = NULL; + GLuint framebufferHandle = 0; + if (target == GL_READ_FRAMEBUFFER_ANGLE) + { + framebuffer = context->getReadFramebuffer(); + framebufferHandle = context->getReadFramebufferHandle(); + } + else + { + framebuffer = context->getDrawFramebuffer(); + framebufferHandle = context->getDrawFramebufferHandle(); + } - if (context->getFramebufferHandle() == 0 || !framebuffer) + if (framebufferHandle == 0 || !framebuffer) { return error(GL_INVALID_OPERATION); } @@ -1614,7 +1924,7 @@ void __stdcall glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum t try { - if (target != GL_FRAMEBUFFER) + if (target != GL_FRAMEBUFFER && target != GL_DRAW_FRAMEBUFFER_ANGLE && target != GL_READ_FRAMEBUFFER_ANGLE) { return error(GL_INVALID_ENUM); } @@ -1646,6 +1956,11 @@ void __stdcall glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum t return error(GL_INVALID_OPERATION); } + if (tex->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + switch (textarget) { case GL_TEXTURE_2D: @@ -1677,9 +1992,20 @@ void __stdcall glFramebufferTexture2D(GLenum target, GLenum attachment, GLenum t } } - gl::Framebuffer *framebuffer = context->getFramebuffer(); + gl::Framebuffer *framebuffer = NULL; + GLuint framebufferHandle = 0; + if (target == GL_READ_FRAMEBUFFER_ANGLE) + { + framebuffer = context->getReadFramebuffer(); + framebufferHandle = context->getReadFramebufferHandle(); + } + else + { + framebuffer = context->getDrawFramebuffer(); + framebufferHandle = context->getDrawFramebufferHandle(); + } - if (context->getFramebufferHandle() == 0 || !framebuffer) + if (framebufferHandle == 0 || !framebuffer) { return error(GL_INVALID_OPERATION); } @@ -1780,6 +2106,11 @@ void __stdcall glGenerateMipmap(GLenum target) return error(GL_INVALID_ENUM); } + if (texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + texture->generateMipmaps(); } } @@ -1789,6 +2120,33 @@ void __stdcall glGenerateMipmap(GLenum target) } } +void __stdcall glGenFencesNV(GLsizei n, GLuint* fences) +{ + TRACE("(GLsizei n = %d, GLuint* fences = 0x%0.8p)", n, fences); + + try + { + if (n < 0) + { + return error(GL_INVALID_VALUE); + } + + gl::Context *context = gl::getContext(); + + if (context) + { + for (int i = 0; i < n; i++) + { + fences[i] = context->createFence(); + } + } + } + catch(std::bad_alloc&) + { + return error(GL_OUT_OF_MEMORY); + } +} + void __stdcall glGenFramebuffers(GLsizei n, GLuint* framebuffers) { TRACE("(GLsizei n = %d, GLuint* framebuffers = 0x%0.8p)", n, framebuffers); @@ -2164,6 +2522,33 @@ GLenum __stdcall glGetError(void) return GL_NO_ERROR; } +void __stdcall glGetFenceivNV(GLuint fence, GLenum pname, GLint *params) +{ + TRACE("(GLuint fence = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", fence, pname, params); + + try + { + + gl::Context *context = gl::getContext(); + + if (context) + { + gl::Fence *fenceObject = context->getFence(fence); + + if (fenceObject == NULL) + { + return error(GL_INVALID_OPERATION); + } + + fenceObject->getFenceiv(pname, params); + } + } + catch(std::bad_alloc&) + { + return error(GL_OUT_OF_MEMORY); + } +} + void __stdcall glGetFloatv(GLenum pname, GLfloat* params) { TRACE("(GLenum pname = 0x%X, GLfloat* params = 0x%0.8p)", pname, params); @@ -2235,31 +2620,46 @@ void __stdcall glGetFramebufferAttachmentParameteriv(GLenum target, GLenum attac if (context) { - if (context->getFramebufferHandle() == 0) - { - return error(GL_INVALID_OPERATION); - } - - if (target != GL_FRAMEBUFFER) + if (target != GL_FRAMEBUFFER && target != GL_DRAW_FRAMEBUFFER_ANGLE && target != GL_READ_FRAMEBUFFER_ANGLE) { return error(GL_INVALID_ENUM); } + gl::Framebuffer *framebuffer = NULL; + if (target == GL_READ_FRAMEBUFFER_ANGLE) + { + if(context->getReadFramebufferHandle() == 0) + { + return error(GL_INVALID_OPERATION); + } + + framebuffer = context->getReadFramebuffer(); + } + else + { + if (context->getDrawFramebufferHandle() == 0) + { + return error(GL_INVALID_OPERATION); + } + + framebuffer = context->getDrawFramebuffer(); + } + GLenum attachmentType; GLuint attachmentHandle; switch (attachment) { case GL_COLOR_ATTACHMENT0: - attachmentType = context->getFramebuffer()->getColorbufferType(); - attachmentHandle = context->getFramebuffer()->getColorbufferHandle(); + attachmentType = framebuffer->getColorbufferType(); + attachmentHandle = framebuffer->getColorbufferHandle(); break; case GL_DEPTH_ATTACHMENT: - attachmentType = context->getFramebuffer()->getDepthbufferType(); - attachmentHandle = context->getFramebuffer()->getDepthbufferHandle(); + attachmentType = framebuffer->getDepthbufferType(); + attachmentHandle = framebuffer->getDepthbufferHandle(); break; case GL_STENCIL_ATTACHMENT: - attachmentType = context->getFramebuffer()->getStencilbufferType(); - attachmentHandle = context->getFramebuffer()->getStencilbufferHandle(); + attachmentType = framebuffer->getStencilbufferType(); + attachmentHandle = framebuffer->getStencilbufferHandle(); break; default: return error(GL_INVALID_ENUM); } @@ -2575,6 +2975,18 @@ void __stdcall glGetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* *params = 0; } break; + case GL_RENDERBUFFER_SAMPLES_ANGLE: + { + if (context->getMaxSupportedSamples() != 0) + { + *params = renderbuffer->getStorage()->getSamples(); + } + else + { + return error(GL_INVALID_ENUM); + } + } + break; default: return error(GL_INVALID_ENUM); } @@ -3130,28 +3542,27 @@ void __stdcall glHint(GLenum target, GLenum mode) try { - switch (target) + switch (mode) { - case GL_GENERATE_MIPMAP_HINT: - switch (mode) - { - case GL_FASTEST: - case GL_NICEST: - case GL_DONT_CARE: - break; - default: - return error(GL_INVALID_ENUM); - } + case GL_FASTEST: + case GL_NICEST: + case GL_DONT_CARE: break; default: - return error(GL_INVALID_ENUM); + return error(GL_INVALID_ENUM); } gl::Context *context = gl::getContext(); - if (context) + switch (target) { - if (target == GL_GENERATE_MIPMAP_HINT) - context->setGenerateMipmapHint(mode); + case GL_GENERATE_MIPMAP_HINT: + if (context) context->setGenerateMipmapHint(mode); + break; + case GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES: + if (context) context->setFragmentShaderDerivativeHint(mode); + break; + default: + return error(GL_INVALID_ENUM); } } catch(std::bad_alloc&) @@ -3220,6 +3631,34 @@ GLboolean __stdcall glIsEnabled(GLenum cap) return false; } +GLboolean __stdcall glIsFenceNV(GLuint fence) +{ + TRACE("(GLuint fence = %d)", fence); + + try + { + gl::Context *context = gl::getContext(); + + if (context) + { + gl::Fence *fenceObject = context->getFence(fence); + + if (fenceObject == NULL) + { + return GL_FALSE; + } + + return fenceObject->isFence(); + } + } + catch(std::bad_alloc&) + { + return error(GL_OUT_OF_MEMORY, GL_FALSE); + } + + return GL_FALSE; +} + GLboolean __stdcall glIsFramebuffer(GLuint framebuffer) { TRACE("(GLuint framebuffer = %d)", framebuffer); @@ -3542,10 +3981,10 @@ void __stdcall glReleaseShaderCompiler(void) } } -void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +void __stdcall glRenderbufferStorageMultisampleANGLE(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) { - TRACE("(GLenum target = 0x%X, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = %d)", - target, internalformat, width, height); + TRACE("(GLenum target = 0x%X, GLsizei samples = %d, GLenum internalformat = 0x%X, GLsizei width = %d, GLsizei height = %d)", + target, samples, internalformat, width, height); try { @@ -3565,12 +4004,14 @@ void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsiz case GL_RGB565: case GL_STENCIL_INDEX8: case GL_DEPTH24_STENCIL8_OES: + case GL_RGB8_OES: + case GL_RGBA8_OES: break; default: return error(GL_INVALID_ENUM); } - if (width < 0 || height < 0 || width > gl::MAX_RENDERBUFFER_SIZE || height > gl::MAX_RENDERBUFFER_SIZE) + if (width < 0 || height < 0 || width > gl::MAX_RENDERBUFFER_SIZE || height > gl::MAX_RENDERBUFFER_SIZE || samples < 0) { return error(GL_INVALID_VALUE); } @@ -3579,6 +4020,11 @@ void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsiz if (context) { + if (samples > context->getMaxSupportedSamples()) + { + return error(GL_INVALID_VALUE); + } + GLuint handle = context->getRenderbufferHandle(); if (handle == 0) { @@ -3588,18 +4034,20 @@ void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsiz switch (internalformat) { case GL_DEPTH_COMPONENT16: - context->setRenderbufferStorage(new gl::Depthbuffer(width, height)); + context->setRenderbufferStorage(new gl::Depthbuffer(width, height, samples)); break; case GL_RGBA4: case GL_RGB5_A1: case GL_RGB565: - context->setRenderbufferStorage(new gl::Colorbuffer(width, height, internalformat)); + case GL_RGB8_OES: + case GL_RGBA8_OES: + context->setRenderbufferStorage(new gl::Colorbuffer(width, height, internalformat, samples)); break; case GL_STENCIL_INDEX8: - context->setRenderbufferStorage(new gl::Stencilbuffer(width, height)); + context->setRenderbufferStorage(new gl::Stencilbuffer(width, height, samples)); break; case GL_DEPTH24_STENCIL8_OES: - context->setRenderbufferStorage(new gl::DepthStencilbuffer(width, height)); + context->setRenderbufferStorage(new gl::DepthStencilbuffer(width, height, samples)); break; default: return error(GL_INVALID_ENUM); @@ -3612,6 +4060,11 @@ void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsiz } } +void __stdcall glRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +{ + glRenderbufferStorageMultisampleANGLE(target, 0, internalformat, width, height); +} + void __stdcall glSampleCoverage(GLclampf value, GLboolean invert) { TRACE("(GLclampf value = %f, GLboolean invert = %d)", value, invert); @@ -3631,6 +4084,37 @@ void __stdcall glSampleCoverage(GLclampf value, GLboolean invert) } } +void __stdcall glSetFenceNV(GLuint fence, GLenum condition) +{ + TRACE("(GLuint fence = %d, GLenum condition = 0x%X)", fence, condition); + + try + { + if (condition != GL_ALL_COMPLETED_NV) + { + return error(GL_INVALID_ENUM); + } + + gl::Context *context = gl::getContext(); + + if (context) + { + gl::Fence *fenceObject = context->getFence(fence); + + if (fenceObject == NULL) + { + return error(GL_INVALID_OPERATION); + } + + fenceObject->setFence(condition); + } + } + catch(std::bad_alloc&) + { + return error(GL_OUT_OF_MEMORY); + } +} + void __stdcall glScissor(GLint x, GLint y, GLsizei width, GLsizei height) { TRACE("(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d)", x, y, width, height); @@ -3898,6 +4382,34 @@ void __stdcall glStencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenu } } +GLboolean __stdcall glTestFenceNV(GLuint fence) +{ + TRACE("(GLuint fence = %d)", fence); + + try + { + gl::Context *context = gl::getContext(); + + if (context) + { + gl::Fence *fenceObject = context->getFence(fence); + + if (fenceObject == NULL) + { + return error(GL_INVALID_OPERATION, GL_TRUE); + } + + return fenceObject->testFence(); + } + } + catch(std::bad_alloc&) + { + error(GL_OUT_OF_MEMORY); + } + + return GL_TRUE; +} + void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid* pixels) { @@ -3958,6 +4470,8 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL switch (type) { case GL_UNSIGNED_BYTE: + case GL_FLOAT: + case GL_HALF_FLOAT_OES: break; default: return error(GL_INVALID_ENUM); @@ -3968,6 +4482,8 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL { case GL_UNSIGNED_BYTE: case GL_UNSIGNED_SHORT_5_6_5: + case GL_FLOAT: + case GL_HALF_FLOAT_OES: break; default: return error(GL_INVALID_ENUM); @@ -3979,6 +4495,8 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL case GL_UNSIGNED_BYTE: case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_FLOAT: + case GL_HALF_FLOAT_OES: break; default: return error(GL_INVALID_ENUM); @@ -3993,6 +4511,9 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL return error(GL_INVALID_ENUM); } break; + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: // error cases for compressed textures are handled below + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + break; default: return error(GL_INVALID_VALUE); } @@ -4006,6 +4527,34 @@ void __stdcall glTexImage2D(GLenum target, GLint level, GLint internalformat, GL if (context) { + if (internalformat == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || + internalformat == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) + { + if (context->supportsCompressedTextures()) + { + return error(GL_INVALID_OPERATION); + } + else + { + return error(GL_INVALID_ENUM); + } + } + + if (type == GL_FLOAT) + { + if (!context->supportsFloatTextures()) + { + return error(GL_INVALID_ENUM); + } + } + else if (type == GL_HALF_FLOAT_OES) + { + if (!context->supportsHalfFloatTextures()) + { + return error(GL_INVALID_ENUM); + } + } + if (target == GL_TEXTURE_2D) { gl::Texture2D *texture = context->getTexture2D(); @@ -4172,6 +4721,21 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint if (context) { + if (format == GL_FLOAT) + { + if (!context->supportsFloatTextures()) + { + return error(GL_INVALID_ENUM); + } + } + else if (format == GL_HALF_FLOAT_OES) + { + if (!context->supportsHalfFloatTextures()) + { + return error(GL_INVALID_ENUM); + } + } + if (target == GL_TEXTURE_2D) { gl::Texture2D *texture = context->getTexture2D(); @@ -4181,6 +4745,16 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint return error(GL_INVALID_OPERATION); } + if (texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if (format != texture->getFormat()) + { + return error(GL_INVALID_OPERATION); + } + texture->subImage(level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels); } else if (gl::IsCubemapTextureTarget(target)) @@ -4192,6 +4766,16 @@ void __stdcall glTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint return error(GL_INVALID_OPERATION); } + if (texture->isCompressed()) + { + return error(GL_INVALID_OPERATION); + } + + if (format != texture->getFormat()) + { + return error(GL_INVALID_OPERATION); + } + texture->subImage(target, level, xoffset, yoffset, width, height, format, type, context->getUnpackAlignment(), pixels); } else @@ -5033,6 +5617,54 @@ void __stdcall glViewport(GLint x, GLint y, GLsizei width, GLsizei height) } } +void __stdcall glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, + GLbitfield mask, GLenum filter) +{ + TRACE("(GLint srcX0 = %d, GLint srcY0 = %d, GLint srcX1 = %d, GLint srcY1 = %d, " + "GLint dstX0 = %d, GLint dstY0 = %d, GLint dstX1 = %d, GLint dstY1 = %d, " + "GLbitfield mask = 0x%X, GLenum filter = 0x%X)", + srcX0, srcY0, srcX1, srcX1, dstX0, dstY0, dstX1, dstY1, mask, filter); + + try + { + switch (filter) + { + case GL_NEAREST: + break; + default: + return error(GL_INVALID_ENUM); + } + + if ((mask & ~(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)) != 0) + { + return error(GL_INVALID_VALUE); + } + + if (srcX1 - srcX0 != dstX1 - dstX0 || srcY1 - srcY0 != dstY1 - dstY0) + { + ERR("Scaling and flipping in BlitFramebufferANGLE not supported by this implementation"); + return error(GL_INVALID_OPERATION); + } + + gl::Context *context = gl::getContext(); + + if (context) + { + if (context->getReadFramebufferHandle() == context->getDrawFramebufferHandle()) + { + ERR("Blits with the same source and destination framebuffer are not supported by this implementation."); + return error(GL_INVALID_OPERATION); + } + + context->blitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask); + } + } + catch(std::bad_alloc&) + { + return error(GL_OUT_OF_MEMORY); + } +} + void __stdcall glTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) { @@ -5062,6 +5694,14 @@ __eglMustCastToProperFunctionPointerType __stdcall glGetProcAddress(const char * static const Extension glExtensions[] = { {"glTexImage3DOES", (__eglMustCastToProperFunctionPointerType)glTexImage3DOES}, + {"glBlitFramebufferANGLE", (__eglMustCastToProperFunctionPointerType)glBlitFramebufferANGLE}, + {"glDeleteFencesNV", (__eglMustCastToProperFunctionPointerType)glDeleteFencesNV}, + {"glGenFencesNV", (__eglMustCastToProperFunctionPointerType)glGenFencesNV}, + {"glIsFenceNV", (__eglMustCastToProperFunctionPointerType)glIsFenceNV}, + {"glTestFenceNV", (__eglMustCastToProperFunctionPointerType)glTestFenceNV}, + {"glGetFenceivNV", (__eglMustCastToProperFunctionPointerType)glGetFenceivNV}, + {"glFinishFenceNV", (__eglMustCastToProperFunctionPointerType)glFinishFenceNV}, + {"glSetFenceNV", (__eglMustCastToProperFunctionPointerType)glSetFenceNV}, }; for (int ext = 0; ext < sizeof(glExtensions) / sizeof(Extension); ext++) diff --git a/gfx/angle/src/libGLESv2/libGLESv2.def b/gfx/angle/src/libGLESv2/libGLESv2.def index 0aaaa678b6d..b2dc23caec9 100644 --- a/gfx/angle/src/libGLESv2/libGLESv2.def +++ b/gfx/angle/src/libGLESv2/libGLESv2.def @@ -144,11 +144,20 @@ EXPORTS glViewport @142 ; Extensions - glTexImage3DOES @143 - + glTexImage3DOES @143 + glBlitFramebufferANGLE @149 + glRenderbufferStorageMultisampleANGLE @150 + glDeleteFencesNV @151 + glFinishFenceNV @152 + glGenFencesNV @153 + glGetFenceivNV @154 + glIsFenceNV @155 + glSetFenceNV @156 + glTestFenceNV @157 + ; EGL dependencies - glCreateContext @144 NONAME - glDestroyContext @145 NONAME - glMakeCurrent @146 NONAME - glGetCurrentContext @147 NONAME + glCreateContext @144 NONAME + glDestroyContext @145 NONAME + glMakeCurrent @146 NONAME + glGetCurrentContext @147 NONAME glGetProcAddress @148 NONAME \ No newline at end of file diff --git a/gfx/angle/src/libGLESv2/libGLESv2.vcproj b/gfx/angle/src/libGLESv2/libGLESv2.vcproj index f9e34d000dc..dc5a33d631e 100644 --- a/gfx/angle/src/libGLESv2/libGLESv2.vcproj +++ b/gfx/angle/src/libGLESv2/libGLESv2.vcproj @@ -200,6 +200,10 @@ RelativePath="..\common\debug.cpp" > + + @@ -278,6 +282,10 @@ RelativePath=".\Context.h" > + + diff --git a/gfx/angle/src/libGLESv2/utilities.cpp b/gfx/angle/src/libGLESv2/utilities.cpp index e5b7368e03e..d0fe3986212 100644 --- a/gfx/angle/src/libGLESv2/utilities.cpp +++ b/gfx/angle/src/libGLESv2/utilities.cpp @@ -25,6 +25,8 @@ int UniformComponentCount(GLenum type) case GL_BOOL: case GL_FLOAT: case GL_INT: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: return 1; case GL_BOOL_VEC2: case GL_FLOAT_VEC2: @@ -68,6 +70,8 @@ GLenum UniformComponentType(GLenum type) case GL_FLOAT_MAT4: return GL_FLOAT; case GL_INT: + case GL_SAMPLER_2D: + case GL_SAMPLER_CUBE: case GL_INT_VEC2: case GL_INT_VEC3: case GL_INT_VEC4: @@ -183,6 +187,49 @@ GLsizei ComputePitch(GLsizei width, GLenum format, GLenum type, GLint alignment) return (rawPitch + alignment - 1) & ~(alignment - 1); } +GLsizei ComputeCompressedPitch(GLsizei width, GLenum format) +{ + switch (format) + { + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + break; + default: + return 0; + } + + ASSERT(width % 4 == 0); + + return 8 * width / 4; +} + +GLsizei ComputeCompressedSize(GLsizei width, GLsizei height, GLenum format) +{ + switch (format) + { + case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: + case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: + break; + default: + return 0; + } + + return 8 * (GLsizei)ceil((float)width / 4.0f) * (GLsizei)ceil((float)height / 4.0f); +} + +bool IsCompressed(GLenum format) +{ + if(format == GL_COMPRESSED_RGB_S3TC_DXT1_EXT || + format == GL_COMPRESSED_RGBA_S3TC_DXT1_EXT) + { + return true; + } + else + { + return false; + } +} + // Returns the size, in bytes, of a single texel in an Image int ComputePixelSize(GLenum format, GLenum type) { @@ -204,6 +251,28 @@ int ComputePixelSize(GLenum format, GLenum type) case GL_UNSIGNED_SHORT_5_5_5_1: case GL_UNSIGNED_SHORT_5_6_5: return sizeof(unsigned short); + case GL_FLOAT: + switch (format) + { + case GL_ALPHA: return sizeof(float); + case GL_LUMINANCE: return sizeof(float); + case GL_LUMINANCE_ALPHA: return sizeof(float) * 2; + case GL_RGB: return sizeof(float) * 3; + case GL_RGBA: return sizeof(float) * 4; + default: UNREACHABLE(); + } + break; + case GL_HALF_FLOAT_OES: + switch (format) + { + case GL_ALPHA: return sizeof(unsigned short); + case GL_LUMINANCE: return sizeof(unsigned short); + case GL_LUMINANCE_ALPHA: return sizeof(unsigned short) * 2; + case GL_RGB: return sizeof(unsigned short) * 3; + case GL_RGBA: return sizeof(unsigned short) * 4; + default: UNREACHABLE(); + } + break; default: UNREACHABLE(); } @@ -240,6 +309,21 @@ bool CheckTextureFormatType(GLenum format, GLenum type) return false; } + case GL_FLOAT: + case GL_HALF_FLOAT_OES: + switch (format) + { + case GL_RGBA: + case GL_RGB: + case GL_ALPHA: + case GL_LUMINANCE: + case GL_LUMINANCE_ALPHA: + return true; + + default: + return false; + } + case GL_UNSIGNED_SHORT_4_4_4_4: case GL_UNSIGNED_SHORT_5_5_5_1: return (format == GL_RGBA); @@ -465,6 +549,10 @@ unsigned int GetAlphaSize(D3DFORMAT colorFormat) { switch (colorFormat) { + case D3DFMT_A16B16G16R16F: + return 16; + case D3DFMT_A32B32G32R32F: + return 32; case D3DFMT_A2R10G10B10: return 2; case D3DFMT_A8R8G8B8: @@ -484,6 +572,10 @@ unsigned int GetRedSize(D3DFORMAT colorFormat) { switch (colorFormat) { + case D3DFMT_A16B16G16R16F: + return 16; + case D3DFMT_A32B32G32R32F: + return 32; case D3DFMT_A2R10G10B10: return 10; case D3DFMT_A8R8G8B8: @@ -502,6 +594,10 @@ unsigned int GetGreenSize(D3DFORMAT colorFormat) { switch (colorFormat) { + case D3DFMT_A16B16G16R16F: + return 16; + case D3DFMT_A32B32G32R32F: + return 32; case D3DFMT_A2R10G10B10: return 10; case D3DFMT_A8R8G8B8: @@ -521,6 +617,10 @@ unsigned int GetBlueSize(D3DFORMAT colorFormat) { switch (colorFormat) { + case D3DFMT_A16B16G16R16F: + return 16; + case D3DFMT_A32B32G32R32F: + return 32; case D3DFMT_A2R10G10B10: return 10; case D3DFMT_A8R8G8B8: @@ -601,12 +701,31 @@ D3DFORMAT ConvertRenderbufferFormat(GLenum format) switch (format) { case GL_RGBA4: - case GL_RGB5_A1: return D3DFMT_A8R8G8B8; + case GL_RGB5_A1: + case GL_RGBA8_OES: return D3DFMT_A8R8G8B8; case GL_RGB565: return D3DFMT_R5G6B5; + case GL_RGB8_OES: return D3DFMT_X8R8G8B8; case GL_DEPTH_COMPONENT16: - case GL_STENCIL_INDEX8: return D3DFMT_D24S8; + case GL_STENCIL_INDEX8: + case GL_DEPTH24_STENCIL8_OES: return D3DFMT_D24S8; default: UNREACHABLE(); return D3DFMT_A8R8G8B8; } } +GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type) +{ + if (type == D3DMULTISAMPLE_NONMASKABLE) + return 0; + else + return type; +} + +D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples) +{ + if (samples <= 1) + return D3DMULTISAMPLE_NONE; + else + return (D3DMULTISAMPLE_TYPE)samples; +} + } diff --git a/gfx/angle/src/libGLESv2/utilities.h b/gfx/angle/src/libGLESv2/utilities.h index c143f1e7f46..b6c8ce505bc 100644 --- a/gfx/angle/src/libGLESv2/utilities.h +++ b/gfx/angle/src/libGLESv2/utilities.h @@ -29,6 +29,9 @@ int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsig int ComputePixelSize(GLenum format, GLenum type); GLsizei ComputePitch(GLsizei width, GLenum format, GLenum type, GLint alignment); +GLsizei ComputeCompressedPitch(GLsizei width, GLenum format); +GLsizei ComputeCompressedSize(GLsizei width, GLsizei height, GLenum format); +bool IsCompressed(GLenum format); bool IsCubemapTextureTarget(GLenum target); bool IsTextureTarget(GLenum target); bool CheckTextureFormatType(GLenum format, GLenum type); @@ -57,6 +60,8 @@ unsigned int GetStencilSize(D3DFORMAT stencilFormat); bool ConvertPrimitiveType(GLenum primitiveType, GLsizei primitiveCount, D3DPRIMITIVETYPE *d3dPrimitiveType, int *d3dPrimitiveCount); D3DFORMAT ConvertRenderbufferFormat(GLenum format); +D3DMULTISAMPLE_TYPE GetMultisampleTypeFromSamples(GLsizei samples); +GLsizei GetSamplesFromMultisampleType(D3DMULTISAMPLE_TYPE type); }