From 480567d5c451511a72744b0c849960c2b712e093 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 8 Jul 2009 11:39:13 -0700 Subject: Add new _mesa_new_parameter_list_sized to pre-allocate a parameter list --- src/mesa/shader/prog_parameter.c | 28 ++++++++++++++++++++++++++++ src/mesa/shader/prog_parameter.h | 3 +++ 2 files changed, 31 insertions(+) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index bcd8c5d9dc..6b9e73b2cb 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -44,6 +44,34 @@ _mesa_new_parameter_list(void) } +struct gl_program_parameter_list * +_mesa_new_parameter_list_sized(unsigned size) +{ + struct gl_program_parameter_list *p = _mesa_new_parameter_list(); + + if ((p != NULL) && (size != 0)) { + p->Size = size; + + /* alloc arrays */ + p->Parameters = (struct gl_program_parameter *) + _mesa_calloc(size * sizeof(struct gl_program_parameter)); + + p->ParameterValues = (GLfloat (*)[4]) + _mesa_align_malloc(size * 4 *sizeof(GLfloat), 16); + + + if ((p->Parameters == NULL) || (p->ParameterValues == NULL)) { + _mesa_free(p->Parameters); + _mesa_align_free(p->ParameterValues); + _mesa_free(p); + p = NULL; + } + } + + return p; +} + + /** * Free a parameter list and all its parameters */ diff --git a/src/mesa/shader/prog_parameter.h b/src/mesa/shader/prog_parameter.h index 01f5a0e179..d1fcf47e61 100644 --- a/src/mesa/shader/prog_parameter.h +++ b/src/mesa/shader/prog_parameter.h @@ -84,6 +84,9 @@ struct gl_program_parameter_list extern struct gl_program_parameter_list * _mesa_new_parameter_list(void); +extern struct gl_program_parameter_list * +_mesa_new_parameter_list_sized(unsigned size); + extern void _mesa_free_parameter_list(struct gl_program_parameter_list *paramList); -- cgit v1.2.3 From 770cebbc29863ae944a31463ee4bdeb789105aba Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 20 Jul 2009 17:44:36 -0700 Subject: ARB_fp/vp: Initial import of new ARB vp/fp assembler This still needs quite a bit of work, but a bunch of the programs in progs/vp produce correct results. --- src/mesa/shader/Makefile | 7 + src/mesa/shader/arbprogparse.c | 121 +- src/mesa/shader/hash_table.c | 153 + src/mesa/shader/hash_table.h | 108 + src/mesa/shader/lex.yy.c | 3530 ++++++++++++++++++++++ src/mesa/shader/prog_parameter_layout.c | 205 ++ src/mesa/shader/prog_parameter_layout.h | 41 + src/mesa/shader/program_lexer.l | 482 +++ src/mesa/shader/program_parse.tab.c | 4915 +++++++++++++++++++++++++++++++ src/mesa/shader/program_parse.tab.h | 193 ++ src/mesa/shader/program_parse.y | 2130 ++++++++++++++ src/mesa/shader/program_parse_extra.c | 109 + src/mesa/shader/program_parser.h | 256 ++ src/mesa/shader/symbol_table.c | 334 +++ src/mesa/shader/symbol_table.h | 54 + src/mesa/sources.mak | 8 +- 16 files changed, 12596 insertions(+), 50 deletions(-) create mode 100644 src/mesa/shader/Makefile create mode 100644 src/mesa/shader/hash_table.c create mode 100644 src/mesa/shader/hash_table.h create mode 100644 src/mesa/shader/lex.yy.c create mode 100644 src/mesa/shader/prog_parameter_layout.c create mode 100644 src/mesa/shader/prog_parameter_layout.h create mode 100644 src/mesa/shader/program_lexer.l create mode 100644 src/mesa/shader/program_parse.tab.c create mode 100644 src/mesa/shader/program_parse.tab.h create mode 100644 src/mesa/shader/program_parse.y create mode 100644 src/mesa/shader/program_parse_extra.c create mode 100644 src/mesa/shader/program_parser.h create mode 100644 src/mesa/shader/symbol_table.c create mode 100644 src/mesa/shader/symbol_table.h diff --git a/src/mesa/shader/Makefile b/src/mesa/shader/Makefile new file mode 100644 index 0000000000..400a543bda --- /dev/null +++ b/src/mesa/shader/Makefile @@ -0,0 +1,7 @@ +all: program_parse.tab.c lex.yy.c + +program_parse.tab.c program_parse.tab.h: program_parse.y + bison -v -d $< + +lex.yy.c: program_lexer.l + flex --never-interactive $< diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index bc65aba39a..36470b669c 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -63,6 +63,7 @@ having three separate program parameter arrays. #include "prog_parameter.h" #include "prog_statevars.h" #include "prog_instruction.h" +#include "program_parser.h" /** * This is basically a union of the vertex_program and fragment_program @@ -96,7 +97,7 @@ struct arb_program }; - +#if 0 /* TODO: * Fragment Program Stuff: * ----------------------------------------------------- @@ -3923,7 +3924,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, return !err; } - +#endif void @@ -3931,11 +3932,18 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, const GLvoid *str, GLsizei len, struct gl_fragment_program *program) { - struct arb_program ap; + struct gl_program prog; + struct asm_parser_state state; GLuint i; ASSERT(target == GL_FRAGMENT_PROGRAM_ARB); - if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &ap)) { + + memset(&prog, 0, sizeof(prog)); + memset(&state, 0, sizeof(state)); + state.prog = &prog; + + if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, + &state)) { /* Error in the program. Just return. */ return; } @@ -3943,33 +3951,39 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, /* Copy the relevant contents of the arb_program struct into the * fragment_program struct. */ - program->Base.String = ap.Base.String; - program->Base.NumInstructions = ap.Base.NumInstructions; - program->Base.NumTemporaries = ap.Base.NumTemporaries; - program->Base.NumParameters = ap.Base.NumParameters; - program->Base.NumAttributes = ap.Base.NumAttributes; - program->Base.NumAddressRegs = ap.Base.NumAddressRegs; - program->Base.NumNativeInstructions = ap.Base.NumNativeInstructions; - program->Base.NumNativeTemporaries = ap.Base.NumNativeTemporaries; - program->Base.NumNativeParameters = ap.Base.NumNativeParameters; - program->Base.NumNativeAttributes = ap.Base.NumNativeAttributes; - program->Base.NumNativeAddressRegs = ap.Base.NumNativeAddressRegs; - program->Base.NumAluInstructions = ap.Base.NumAluInstructions; - program->Base.NumTexInstructions = ap.Base.NumTexInstructions; - program->Base.NumTexIndirections = ap.Base.NumTexIndirections; - program->Base.NumNativeAluInstructions = ap.Base.NumAluInstructions; - program->Base.NumNativeTexInstructions = ap.Base.NumTexInstructions; - program->Base.NumNativeTexIndirections = ap.Base.NumTexIndirections; - program->Base.InputsRead = ap.Base.InputsRead; - program->Base.OutputsWritten = ap.Base.OutputsWritten; + program->Base.String = prog.String; + program->Base.NumInstructions = prog.NumInstructions; + program->Base.NumTemporaries = prog.NumTemporaries; + program->Base.NumParameters = prog.NumParameters; + program->Base.NumAttributes = prog.NumAttributes; + program->Base.NumAddressRegs = prog.NumAddressRegs; + program->Base.NumNativeInstructions = prog.NumNativeInstructions; + program->Base.NumNativeTemporaries = prog.NumNativeTemporaries; + program->Base.NumNativeParameters = prog.NumNativeParameters; + program->Base.NumNativeAttributes = prog.NumNativeAttributes; + program->Base.NumNativeAddressRegs = prog.NumNativeAddressRegs; + program->Base.NumAluInstructions = prog.NumAluInstructions; + program->Base.NumTexInstructions = prog.NumTexInstructions; + program->Base.NumTexIndirections = prog.NumTexIndirections; + program->Base.NumNativeAluInstructions = prog.NumAluInstructions; + program->Base.NumNativeTexInstructions = prog.NumTexInstructions; + program->Base.NumNativeTexIndirections = prog.NumTexIndirections; + program->Base.InputsRead = prog.InputsRead; + program->Base.OutputsWritten = prog.OutputsWritten; for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) { - program->Base.TexturesUsed[i] = ap.TexturesUsed[i]; - if (ap.TexturesUsed[i]) + program->Base.TexturesUsed[i] = state.fragment.TexturesUsed[i]; + if (state.fragment.TexturesUsed[i]) program->Base.SamplersUsed |= (1 << i); } - program->Base.ShadowSamplers = ap.ShadowSamplers; - program->FogOption = ap.FogOption; - program->UsesKill = ap.UsesKill; + program->Base.ShadowSamplers = state.fragment.ShadowSamplers; + switch (state.option.Fog) { + case OPTION_FOG_EXP: program->FogOption = GL_EXP; break; + case OPTION_FOG_EXP2: program->FogOption = GL_EXP2; break; + case OPTION_FOG_LINEAR: program->FogOption = GL_LINEAR; break; + default: program->FogOption = GL_NONE; break; + } + + program->UsesKill = state.fragment.UsesKill; if (program->FogOption) program->Base.InputsRead |= FRAG_BIT_FOGC; @@ -3983,11 +3997,11 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, if (program->Base.Instructions) _mesa_free(program->Base.Instructions); - program->Base.Instructions = ap.Base.Instructions; + program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) _mesa_free_parameter_list(program->Base.Parameters); - program->Base.Parameters = ap.Base.Parameters; + program->Base.Parameters = prog.Parameters; /* Append fog instructions now if the program has "OPTION ARB_fog_exp" * or similar. We used to leave this up to drivers, but it appears @@ -4017,11 +4031,17 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, const GLvoid *str, GLsizei len, struct gl_vertex_program *program) { - struct arb_program ap; + struct gl_program prog; + struct asm_parser_state state; ASSERT(target == GL_VERTEX_PROGRAM_ARB); - if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, &ap)) { + memset(&prog, 0, sizeof(prog)); + memset(&state, 0, sizeof(state)); + state.prog = &prog; + + if (!_mesa_parse_arb_program(ctx, target, (const GLubyte*) str, len, + &state)) { _mesa_error(ctx, GL_INVALID_OPERATION, "glProgramString(bad program)"); return; } @@ -4029,31 +4049,34 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, /* Copy the relevant contents of the arb_program struct into the * vertex_program struct. */ - program->Base.String = ap.Base.String; - program->Base.NumInstructions = ap.Base.NumInstructions; - program->Base.NumTemporaries = ap.Base.NumTemporaries; - program->Base.NumParameters = ap.Base.NumParameters; - program->Base.NumAttributes = ap.Base.NumAttributes; - program->Base.NumAddressRegs = ap.Base.NumAddressRegs; - program->Base.NumNativeInstructions = ap.Base.NumNativeInstructions; - program->Base.NumNativeTemporaries = ap.Base.NumNativeTemporaries; - program->Base.NumNativeParameters = ap.Base.NumNativeParameters; - program->Base.NumNativeAttributes = ap.Base.NumNativeAttributes; - program->Base.NumNativeAddressRegs = ap.Base.NumNativeAddressRegs; - program->Base.InputsRead = ap.Base.InputsRead; - program->Base.OutputsWritten = ap.Base.OutputsWritten; - program->IsPositionInvariant = ap.HintPositionInvariant; + program->Base.String = prog.String; + program->Base.NumInstructions = prog.NumInstructions; + program->Base.NumTemporaries = prog.NumTemporaries; + program->Base.NumParameters = prog.NumParameters; + program->Base.NumAttributes = prog.NumAttributes; + program->Base.NumAddressRegs = prog.NumAddressRegs; + program->Base.NumNativeInstructions = prog.NumNativeInstructions; + program->Base.NumNativeTemporaries = prog.NumNativeTemporaries; + program->Base.NumNativeParameters = prog.NumNativeParameters; + program->Base.NumNativeAttributes = prog.NumNativeAttributes; + program->Base.NumNativeAddressRegs = prog.NumNativeAddressRegs; + program->Base.InputsRead = prog.InputsRead; + program->Base.OutputsWritten = prog.OutputsWritten; + program->IsPositionInvariant = (state.option.PositionInvariant) + ? GL_TRUE : GL_FALSE; if (program->Base.Instructions) _mesa_free(program->Base.Instructions); - program->Base.Instructions = ap.Base.Instructions; + program->Base.Instructions = prog.Instructions; if (program->Base.Parameters) _mesa_free_parameter_list(program->Base.Parameters); - program->Base.Parameters = ap.Base.Parameters; + program->Base.Parameters = prog.Parameters; -#if DEBUG_VP +#if 1 || DEBUG_VP _mesa_printf("____________Vertex program %u __________\n", program->Base.Id); _mesa_print_program(&program->Base); + _mesa_printf("inputs = 0x%04x, outputs = 0x%04x\n", program->Base.InputsRead, + program->Base.OutputsWritten); #endif } diff --git a/src/mesa/shader/hash_table.c b/src/mesa/shader/hash_table.c new file mode 100644 index 0000000000..9b8f251bcc --- /dev/null +++ b/src/mesa/shader/hash_table.c @@ -0,0 +1,153 @@ +/* + * Copyright © 2008 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file hash_table.c + * \brief Implementation of a generic, opaque hash table data type. + * + * \author Ian Romanick + */ +#include +#include + +#include + +#include "main/simple_list.h" +#include "hash_table.h" + +struct node { + struct node *next; + struct node *prev; +}; + +struct hash_table { + hash_func_t hash; + hash_compare_func_t compare; + + unsigned num_buckets; + struct node buckets[1]; +}; + + +struct hash_node { + struct node link; + const void *key; + void *data; +}; + + +struct hash_table * +hash_table_ctor(unsigned num_buckets, hash_func_t hash, + hash_compare_func_t compare) +{ + struct hash_table *ht; + unsigned i; + + + if (num_buckets < 16) { + num_buckets = 16; + } + + ht = malloc(sizeof(*ht) + ((num_buckets - 1) * sizeof(ht->buckets[0]))); + if (ht != NULL) { + ht->hash = hash; + ht->compare = compare; + ht->num_buckets = num_buckets; + + for (i = 0; i < num_buckets; i++) { + make_empty_list(& ht->buckets[i]); + } + } + + return ht; +} + + +void +hash_table_clear(struct hash_table *ht) +{ + struct node *node; + struct node *temp; + unsigned i; + + + for (i = 0; i < ht->num_buckets; i++) { + foreach_s(node, temp, & ht->buckets[i]) { + remove_from_list(node); + free(node); + } + + assert(is_empty_list(& ht->buckets[i])); + } +} + + +void * +hash_table_find(struct hash_table *ht, const void *key) +{ + const unsigned hash_value = (*ht->hash)(key); + const unsigned bucket = hash_value % ht->num_buckets; + struct node *node; + + foreach(node, & ht->buckets[bucket]) { + struct hash_node *hn = (struct hash_node *) node; + + if ((*ht->compare)(hn->key, key) == 0) { + return hn->data; + } + } + + return NULL; +} + + +void +hash_table_insert(struct hash_table *ht, void *data, const void *key) +{ + const unsigned hash_value = (*ht->hash)(key); + const unsigned bucket = hash_value % ht->num_buckets; + struct hash_node *node; + + node = calloc(1, sizeof(*node)); + + node->data = data; + node->key = key; + + insert_at_head(& ht->buckets[bucket], & node->link); +} + + +unsigned +hash_table_string_hash(const void *key) +{ + const char *str = (const char *) key; + unsigned hash = 5381; + + + while (*str != '\0') { + hash = (hash * 33) + *str; + str++; + } + + return hash; +} diff --git a/src/mesa/shader/hash_table.h b/src/mesa/shader/hash_table.h new file mode 100644 index 0000000000..83ae7f07c7 --- /dev/null +++ b/src/mesa/shader/hash_table.h @@ -0,0 +1,108 @@ +/* + * Copyright © 2008 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file hash_table.h + * \brief Implementation of a generic, opaque hash table data type. + * + * \author Ian Romanick + */ + +#ifndef HASH_TABLE_H +#define HASH_TABLE_H + +#include + +struct hash_table; + +typedef unsigned (*hash_func_t)(const void *key); +typedef int (*hash_compare_func_t)(const void *key1, const void *key2); + +/** + * Hash table constructor + * + * Creates a hash table with the specified number of buckets. The supplied + * \c hash and \c compare routines are used when adding elements to the table + * and when searching for elements in the table. + * + * \param num_buckets Number of buckets (bins) in the hash table. + * \param hash Function used to compute hash value of input keys. + * \param compare Function used to compare keys. + */ +extern struct hash_table *hash_table_ctor(unsigned num_buckets, + hash_func_t hash, hash_compare_func_t compare); + + +/** + * Flush all entries from a hash table + * + * \param ht Table to be cleared of its entries. + */ +extern void hash_table_clear(struct hash_table *ht); + + +/** + * Search a hash table for a specific element + * + * \param ht Table to be searched + * \param key Key of the desired element + * + * \return + * The \c data value supplied to \c hash_table_insert when the element with + * the matching key was added. If no matching key exists in the table, + * \c NULL is returned. + */ +extern void *hash_table_find(struct hash_table *ht, const void *key); + + +/** + * Add an element to a hash table + */ +extern void hash_table_insert(struct hash_table *ht, void *data, + const void *key); + + +/** + * Compute hash value of a string + * + * Computes the hash value of a string using the DJB2 algorithm developed by + * Professor Daniel J. Bernstein. It was published on comp.lang.c once upon + * a time. I was unable to find the original posting in the archives. + * + * \param key Pointer to a NUL terminated string to be hashed. + * + * \sa hash_table_string_compare + */ +extern unsigned hash_table_string_hash(const void *key); + + +/** + * Compare two strings used as keys + * + * This is just a macro wrapper around \c strcmp. + * + * \sa hash_table_string_hash + */ +#define hash_table_string_compare ((hash_compare_func_t) strcmp) + +#endif /* HASH_TABLE_H */ diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c new file mode 100644 index 0000000000..120e18eb19 --- /dev/null +++ b/src/mesa/shader/lex.yy.c @@ -0,0 +1,3530 @@ + +#line 3 "lex.yy.c" + +#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) + +/* An opaque pointer. */ +#ifndef YY_TYPEDEF_YY_SCANNER_T +#define YY_TYPEDEF_YY_SCANNER_T +typedef void* yyscan_t; +#endif + +/* For convenience, these vars (plus the bison vars far below) + are macros in the reentrant scanner. */ +#define yyin yyg->yyin_r +#define yyout yyg->yyout_r +#define yyextra yyg->yyextra_r +#define yyleng yyg->yyleng_r +#define yytext yyg->yytext_r +#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno) +#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column) +#define yy_flex_debug yyg->yy_flex_debug_r + +/* 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 yyg->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 ((yyg->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 ,yyscanner ) + +#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 + +#define EOB_ACT_CONTINUE_SCAN 0 +#define EOB_ACT_END_OF_FILE 1 +#define EOB_ACT_LAST_MATCH 2 + + #define YY_LESS_LINENO(n) + +/* 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 = yyg->yy_hold_char; \ + YY_RESTORE_YY_MORE_OFFSET \ + yyg->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, yyg->yytext_ptr , yyscanner ) + +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef size_t yy_size_t; +#endif + +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE +struct yy_buffer_state + { + 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 */ + +/* 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 ( yyg->yy_buffer_stack \ + ? yyg->yy_buffer_stack[yyg->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 yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] + +void yyrestart (FILE *input_file ,yyscan_t yyscanner ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner ); +void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner ); +void yypop_buffer_state (yyscan_t yyscanner ); + +static void yyensure_buffer_stack (yyscan_t yyscanner ); +static void yy_load_buffer_state (yyscan_t yyscanner ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner ); + +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner) + +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner ); + +void *yyalloc (yy_size_t ,yyscan_t yyscanner ); +void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner ); +void yyfree (void * ,yyscan_t yyscanner ); + +#define yy_new_buffer yy_create_buffer + +#define yy_set_interactive(is_interactive) \ + { \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ + } + +#define yy_set_bol(at_bol) \ + { \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (yyscanner); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \ + } \ + 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; + +typedef int yy_state_type; + +#define yytext_ptr yytext_r + +static yy_state_type yy_get_previous_state (yyscan_t yyscanner ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner); +static int yy_get_next_buffer (yyscan_t yyscanner ); +static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); + +/* Done after the current pattern has been matched and before the + * corresponding action - sets up yytext. + */ +#define YY_DO_BEFORE_ACTION \ + yyg->yytext_ptr = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + yyg->yy_hold_char = *yy_cp; \ + *yy_cp = '\0'; \ + yyg->yy_c_buf_p = yy_cp; + +#define YY_NUM_RULES 176 +#define YY_END_OF_BUFFER 177 +/* 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[645] = + { 0, + 0, 0, 177, 175, 173, 172, 175, 175, 145, 171, + 147, 147, 147, 147, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 173, 0, 0, 174, 145, 0, + 146, 148, 168, 168, 0, 0, 0, 0, 168, 0, + 0, 0, 0, 0, 0, 0, 132, 169, 133, 134, + 159, 159, 159, 159, 0, 147, 0, 140, 141, 142, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 166, 166, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, + 165, 165, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 156, 156, 156, 157, 157, 158, 149, 148, + 149, 0, 150, 11, 13, 145, 15, 145, 16, 18, + 145, 20, 22, 24, 26, 6, 28, 30, 31, 33, + 35, 38, 36, 40, 41, 43, 45, 47, 49, 51, + + 145, 145, 145, 53, 55, 145, 57, 59, 61, 63, + 65, 67, 69, 145, 71, 73, 75, 77, 145, 145, + 145, 145, 145, 145, 0, 0, 0, 0, 148, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, + 94, 96, 0, 164, 0, 0, 0, 0, 0, 0, + 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 163, 162, 162, 122, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 153, 153, 154, 155, 0, + 151, 145, 145, 145, 145, 145, 145, 145, 143, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 145, 145, 145, 145, 145, 145, 145, 145, 145, 144, + 145, 145, 145, 145, 145, 145, 145, 10, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 0, 170, + 0, 0, 0, 86, 87, 0, 0, 0, 0, 0, + 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 161, 0, 0, 0, 126, 0, 128, 0, 0, + 0, 0, 0, 0, 160, 152, 145, 145, 145, 4, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + + 9, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 82, 145, 145, + 0, 0, 0, 0, 0, 88, 89, 0, 0, 0, + 0, 97, 0, 0, 101, 104, 0, 0, 0, 0, + 0, 0, 0, 115, 116, 0, 0, 0, 0, 121, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 145, 145, 145, 5, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, + 145, 7, 8, 145, 145, 145, 145, 145, 145, 145, + 145, 145, 145, 145, 145, 145, 145, 145, 83, 145, + + 79, 0, 0, 0, 0, 137, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 107, 0, 111, 112, 0, + 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 130, 131, 0, 0, 138, 12, 3, 14, 17, + 19, 21, 23, 25, 27, 29, 32, 34, 39, 37, + 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, + 62, 64, 66, 68, 70, 72, 74, 76, 78, 145, + 81, 139, 0, 0, 84, 0, 90, 0, 0, 0, + 99, 0, 0, 0, 0, 0, 0, 113, 0, 0, + 119, 106, 0, 0, 0, 0, 0, 0, 135, 0, + + 80, 0, 0, 0, 0, 92, 95, 100, 0, 0, + 105, 0, 0, 0, 118, 0, 0, 0, 0, 127, + 129, 0, 2, 1, 0, 91, 0, 103, 0, 109, + 117, 0, 0, 124, 125, 136, 0, 102, 0, 120, + 123, 85, 108, 0 + } ; + +static yyconst flex_int32_t yy_ec[256] = + { 0, + 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 4, 1, 5, 6, 1, 1, 1, 1, + 1, 1, 7, 1, 7, 8, 1, 9, 10, 11, + 12, 13, 14, 14, 14, 14, 14, 1, 1, 1, + 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 6, 24, 25, 26, 27, 28, 29, + 30, 31, 32, 33, 34, 35, 36, 37, 6, 38, + 1, 1, 1, 1, 39, 1, 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, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 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[66] = + { 0, + 1, 1, 1, 1, 1, 2, 1, 3, 4, 4, + 4, 4, 4, 4, 2, 2, 2, 4, 4, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2 + } ; + +static yyconst flex_int16_t yy_base[649] = + { 0, + 0, 0, 904, 905, 901, 905, 898, 898, 0, 64, + 80, 95, 117, 882, 115, 53, 38, 58, 55, 876, + 121, 122, 67, 54, 115, 134, 65, 869, 840, 839, + 851, 835, 849, 848, 889, 875, 886, 905, 0, 169, + 905, 153, 133, 136, 17, 110, 131, 43, 148, 848, + 834, 121, 146, 832, 844, 147, 905, 189, 190, 86, + 189, 177, 185, 193, 250, 262, 273, 905, 905, 905, + 852, 865, 859, 856, 847, 850, 846, 861, 255, 843, + 857, 149, 843, 856, 847, 860, 837, 848, 839, 162, + 840, 831, 840, 831, 830, 831, 825, 831, 842, 828, + + 825, 837, 828, 821, 837, 814, 165, 190, 833, 810, + 795, 790, 807, 783, 788, 813, 144, 803, 225, 798, + 286, 261, 800, 781, 263, 791, 787, 782, 96, 788, + 774, 790, 787, 778, 270, 273, 780, 769, 783, 786, + 768, 783, 770, 767, 774, 264, 782, 160, 269, 285, + 288, 295, 759, 776, 777, 770, 752, 234, 753, 775, + 766, 227, 284, 291, 295, 299, 303, 307, 905, 364, + 375, 381, 387, 774, 205, 797, 0, 780, 771, 770, + 789, 768, 767, 766, 765, 0, 764, 0, 763, 762, + 0, 761, 760, 0, 759, 758, 757, 756, 755, 754, + + 769, 762, 775, 750, 749, 754, 747, 746, 745, 744, + 743, 742, 741, 750, 739, 738, 737, 736, 728, 727, + 712, 712, 711, 710, 752, 725, 713, 393, 400, 375, + 717, 280, 714, 708, 708, 702, 715, 715, 700, 905, + 905, 715, 703, 377, 710, 39, 707, 713, 376, 708, + 905, 699, 706, 705, 708, 694, 693, 697, 692, 294, + 697, 384, 396, 398, 905, 689, 687, 687, 695, 696, + 678, 401, 683, 689, 364, 386, 394, 399, 403, 460, + 466, 702, 714, 700, 699, 707, 697, 696, 0, 695, + 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, + + 684, 683, 682, 681, 684, 677, 684, 677, 676, 0, + 675, 674, 673, 672, 671, 670, 669, 0, 668, 667, + 666, 665, 644, 638, 643, 649, 632, 647, 374, 905, + 646, 636, 640, 905, 905, 630, 639, 625, 642, 625, + 628, 622, 905, 623, 622, 619, 626, 619, 627, 623, + 633, 630, 612, 618, 625, 609, 608, 626, 608, 620, + 619, 905, 618, 608, 612, 905, 599, 905, 604, 604, + 612, 595, 596, 606, 905, 905, 637, 619, 635, 0, + 633, 633, 632, 631, 630, 629, 628, 627, 626, 625, + 624, 623, 622, 621, 620, 619, 618, 617, 604, 597, + + 0, 614, 613, 612, 611, 610, 609, 608, 607, 606, + 605, 604, 603, 602, 572, 575, 555, 0, 556, 549, + 556, 555, 556, 548, 566, 905, 905, 548, 546, 556, + 549, 905, 544, 561, 429, 905, 552, 536, 537, 546, + 537, 536, 536, 905, 535, 544, 534, 550, 547, 905, + 546, 544, 533, 534, 530, 522, 529, 524, 525, 520, + 545, 545, 543, 0, 542, 541, 540, 539, 538, 537, + 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, + 526, 0, 0, 525, 524, 523, 522, 521, 520, 519, + 518, 517, 516, 515, 514, 513, 492, 492, 0, 499, + + 0, 532, 531, 481, 499, 905, 494, 489, 482, 478, + 490, 480, 478, 474, 490, 481, 480, 905, 905, 483, + 905, 478, 471, 460, 471, 463, 467, 480, 475, 478, + 460, 905, 905, 472, 461, 905, 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, 455, + 0, 0, 505, 504, 905, 452, 905, 456, 456, 465, + 905, 449, 463, 451, 453, 450, 458, 905, 436, 447, + 905, 905, 451, 447, 439, 432, 426, 439, 905, 396, + + 0, 443, 437, 392, 378, 905, 905, 905, 378, 338, + 905, 337, 317, 307, 905, 296, 290, 275, 275, 905, + 905, 288, 905, 905, 268, 905, 261, 905, 264, 905, + 905, 213, 158, 905, 905, 905, 128, 905, 75, 905, + 905, 905, 905, 905, 484, 487, 489, 493 + } ; + +static yyconst flex_int16_t yy_def[649] = + { 0, + 644, 1, 644, 644, 644, 644, 644, 645, 646, 644, + 644, 647, 647, 13, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 644, 644, 645, 644, 646, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 648, 644, 644, 644, 644, 644, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + + 646, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, + 646, 646, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + + 646, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 0, 644, 644, 644, 644 + } ; + +static yyconst flex_int16_t yy_nxt[971] = + { 0, + 4, 5, 6, 7, 8, 9, 4, 10, 11, 12, + 13, 14, 11, 11, 15, 9, 16, 17, 18, 19, + 9, 9, 9, 20, 21, 22, 9, 23, 24, 9, + 25, 26, 27, 9, 9, 9, 28, 9, 9, 9, + 9, 9, 9, 9, 29, 9, 9, 9, 9, 9, + 9, 9, 9, 9, 30, 9, 31, 32, 33, 9, + 34, 9, 9, 9, 9, 40, 79, 126, 96, 80, + 127, 41, 42, 42, 42, 42, 42, 42, 76, 83, + 77, 97, 344, 107, 81, 84, 78, 65, 66, 66, + 66, 66, 66, 66, 82, 94, 133, 345, 67, 134, + + 95, 108, 65, 43, 44, 45, 46, 47, 48, 49, + 50, 51, 68, 67, 52, 53, 54, 55, 56, 57, + 58, 59, 60, 67, 65, 61, 62, 63, 64, 159, + 71, 98, 72, 99, 69, 67, 90, 643, 67, 73, + 237, 86, 160, 87, 91, 74, 100, 75, 88, 92, + 101, 89, 238, 128, 102, 93, 103, 129, 104, 187, + 67, 42, 42, 42, 42, 42, 42, 105, 139, 106, + 40, 121, 122, 122, 140, 125, 122, 188, 122, 196, + 642, 122, 130, 131, 123, 141, 146, 135, 136, 122, + 214, 124, 122, 122, 132, 123, 121, 147, 197, 142, + + 148, 215, 124, 149, 122, 216, 143, 257, 117, 118, + 45, 46, 47, 48, 641, 50, 51, 258, 217, 52, + 53, 54, 55, 56, 57, 119, 59, 60, 150, 151, + 120, 154, 161, 155, 152, 283, 156, 157, 163, 162, + 164, 165, 153, 284, 158, 122, 166, 162, 162, 167, + 162, 162, 162, 162, 168, 162, 162, 162, 170, 170, + 170, 170, 170, 170, 227, 640, 182, 183, 171, 65, + 66, 66, 66, 66, 66, 66, 184, 270, 153, 172, + 67, 173, 173, 173, 173, 173, 173, 271, 275, 275, + 275, 275, 228, 171, 229, 229, 229, 229, 229, 229, + + 230, 230, 230, 230, 233, 67, 230, 639, 230, 230, + 230, 638, 244, 230, 254, 230, 259, 230, 230, 230, + 255, 637, 260, 332, 230, 230, 230, 262, 230, 230, + 230, 636, 635, 230, 263, 264, 333, 261, 634, 359, + 230, 230, 360, 633, 230, 275, 275, 275, 275, 632, + 631, 230, 276, 275, 275, 277, 278, 275, 275, 275, + 275, 275, 275, 275, 279, 275, 275, 275, 275, 275, + 275, 275, 42, 42, 42, 42, 42, 42, 630, 629, + 628, 280, 121, 281, 281, 281, 281, 281, 281, 173, + 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + + 173, 229, 229, 229, 229, 229, 229, 121, 229, 229, + 229, 229, 229, 229, 330, 330, 330, 330, 421, 348, + 330, 627, 330, 330, 330, 375, 375, 375, 375, 330, + 626, 330, 349, 330, 422, 330, 330, 362, 330, 625, + 330, 330, 369, 330, 370, 624, 371, 375, 375, 375, + 375, 623, 330, 622, 330, 376, 375, 375, 375, 372, + 375, 375, 375, 375, 375, 375, 375, 375, 281, 281, + 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, + 513, 621, 620, 514, 37, 37, 37, 37, 39, 619, + 39, 66, 66, 169, 169, 618, 169, 617, 616, 615, + + 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, + 604, 603, 602, 601, 600, 599, 598, 597, 596, 595, + 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, + 584, 583, 582, 581, 580, 579, 578, 577, 576, 575, + 574, 573, 572, 571, 570, 569, 568, 567, 566, 565, + 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, + 554, 553, 552, 551, 550, 549, 548, 547, 546, 545, + 544, 543, 542, 541, 540, 539, 538, 537, 536, 535, + 534, 533, 532, 531, 530, 529, 528, 527, 526, 525, + 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, + + 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, + 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, + 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, + 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, + 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, + 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, + 452, 451, 450, 449, 448, 447, 446, 445, 444, 443, + 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, + 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, + 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, + + 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, + 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, + 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, + 380, 379, 378, 377, 374, 373, 368, 367, 366, 365, + 364, 363, 361, 358, 357, 356, 355, 354, 353, 352, + 351, 350, 347, 346, 343, 342, 341, 340, 339, 338, + 337, 336, 335, 334, 331, 261, 233, 329, 328, 327, + 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, + 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, + 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, + + 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, + 286, 285, 282, 274, 273, 272, 269, 268, 267, 266, + 265, 256, 253, 252, 251, 250, 249, 248, 247, 246, + 245, 243, 242, 241, 240, 239, 236, 235, 234, 232, + 231, 161, 226, 225, 224, 223, 222, 221, 220, 219, + 218, 213, 212, 211, 210, 209, 208, 207, 206, 205, + 204, 203, 202, 201, 200, 199, 198, 195, 194, 193, + 192, 191, 190, 189, 186, 185, 181, 180, 179, 178, + 177, 176, 175, 174, 145, 144, 138, 137, 38, 116, + 35, 115, 114, 113, 112, 111, 110, 109, 85, 70, + + 38, 36, 35, 644, 3, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644 + } ; + +static yyconst flex_int16_t yy_chk[971] = + { 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, 1, 1, 10, 17, 45, 24, 17, + 45, 10, 10, 10, 10, 10, 10, 10, 16, 19, + 16, 24, 246, 27, 18, 19, 16, 11, 11, 11, + 11, 11, 11, 11, 18, 23, 48, 246, 11, 48, + + 23, 27, 12, 10, 10, 10, 10, 10, 10, 10, + 10, 10, 12, 12, 10, 10, 10, 10, 10, 10, + 10, 10, 10, 11, 13, 10, 10, 10, 10, 60, + 15, 25, 15, 25, 13, 13, 22, 639, 12, 15, + 129, 21, 60, 21, 22, 15, 25, 15, 21, 22, + 26, 21, 129, 46, 26, 22, 26, 46, 26, 82, + 13, 42, 42, 42, 42, 42, 42, 26, 52, 26, + 40, 42, 43, 43, 52, 44, 44, 82, 43, 90, + 637, 44, 47, 47, 43, 53, 56, 49, 49, 43, + 107, 43, 44, 49, 47, 117, 42, 56, 90, 53, + + 56, 107, 117, 56, 49, 108, 53, 148, 40, 40, + 40, 40, 40, 40, 633, 40, 40, 148, 108, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 58, 58, + 40, 59, 61, 59, 58, 175, 59, 59, 62, 62, + 62, 62, 58, 175, 59, 58, 63, 63, 63, 63, + 61, 61, 61, 61, 64, 64, 64, 64, 65, 65, + 65, 65, 65, 65, 119, 632, 79, 79, 65, 66, + 66, 66, 66, 66, 66, 66, 79, 158, 119, 67, + 66, 67, 67, 67, 67, 67, 67, 158, 162, 162, + 162, 162, 121, 65, 121, 121, 121, 121, 121, 121, + + 122, 122, 125, 125, 125, 66, 122, 629, 125, 135, + 135, 627, 136, 136, 146, 135, 149, 122, 136, 125, + 146, 625, 149, 232, 150, 150, 135, 151, 151, 136, + 150, 622, 619, 151, 152, 152, 232, 150, 618, 260, + 152, 150, 260, 617, 151, 163, 163, 163, 163, 616, + 614, 152, 164, 164, 164, 164, 165, 165, 165, 165, + 166, 166, 166, 166, 167, 167, 167, 167, 168, 168, + 168, 168, 170, 170, 170, 170, 170, 170, 613, 612, + 610, 171, 170, 171, 171, 171, 171, 171, 171, 172, + 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, + + 173, 228, 228, 228, 228, 228, 228, 170, 229, 229, + 229, 229, 229, 229, 230, 230, 244, 244, 329, 249, + 230, 609, 244, 262, 262, 275, 275, 275, 275, 262, + 605, 230, 249, 244, 329, 263, 263, 264, 264, 604, + 262, 263, 272, 264, 272, 603, 272, 276, 276, 276, + 276, 602, 263, 600, 264, 277, 277, 277, 277, 272, + 278, 278, 278, 278, 279, 279, 279, 279, 280, 280, + 280, 280, 280, 280, 281, 281, 281, 281, 281, 281, + 435, 598, 597, 435, 645, 645, 645, 645, 646, 596, + 646, 647, 647, 648, 648, 595, 648, 594, 593, 590, + + 589, 587, 586, 585, 584, 583, 582, 580, 579, 578, + 576, 574, 573, 570, 535, 534, 531, 530, 529, 528, + 527, 526, 525, 524, 523, 522, 520, 517, 516, 515, + 514, 513, 512, 511, 510, 509, 508, 507, 505, 504, + 503, 502, 500, 498, 497, 496, 495, 494, 493, 492, + 491, 490, 489, 488, 487, 486, 485, 484, 481, 480, + 479, 478, 477, 476, 475, 474, 473, 472, 471, 470, + 469, 468, 467, 466, 465, 463, 462, 461, 460, 459, + 458, 457, 456, 455, 454, 453, 452, 451, 449, 448, + 447, 446, 445, 443, 442, 441, 440, 439, 438, 437, + + 434, 433, 431, 430, 429, 428, 425, 424, 423, 422, + 421, 420, 419, 417, 416, 415, 414, 413, 412, 411, + 410, 409, 408, 407, 406, 405, 404, 403, 402, 400, + 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, + 389, 388, 387, 386, 385, 384, 383, 382, 381, 379, + 378, 377, 374, 373, 372, 371, 370, 369, 367, 365, + 364, 363, 361, 360, 359, 358, 357, 356, 355, 354, + 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, + 342, 341, 340, 339, 338, 337, 336, 333, 332, 331, + 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, + + 317, 316, 315, 314, 313, 312, 311, 309, 308, 307, + 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, + 296, 295, 294, 293, 292, 291, 290, 288, 287, 286, + 285, 284, 283, 282, 274, 273, 271, 270, 269, 268, + 267, 266, 261, 259, 258, 257, 256, 255, 254, 253, + 252, 250, 248, 247, 245, 243, 242, 239, 238, 237, + 236, 235, 234, 233, 231, 227, 226, 225, 224, 223, + 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, + 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, + 202, 201, 200, 199, 198, 197, 196, 195, 193, 192, + + 190, 189, 187, 185, 184, 183, 182, 181, 180, 179, + 178, 176, 174, 161, 160, 159, 157, 156, 155, 154, + 153, 147, 145, 144, 143, 142, 141, 140, 139, 138, + 137, 134, 133, 132, 131, 130, 128, 127, 126, 124, + 123, 120, 118, 116, 115, 114, 113, 112, 111, 110, + 109, 106, 105, 104, 103, 102, 101, 100, 99, 98, + 97, 96, 95, 94, 93, 92, 91, 89, 88, 87, + 86, 85, 84, 83, 81, 80, 78, 77, 76, 75, + 74, 73, 72, 71, 55, 54, 51, 50, 37, 36, + 35, 34, 33, 32, 31, 30, 29, 28, 20, 14, + + 8, 7, 5, 3, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, + 644, 644, 644, 644, 644, 644, 644, 644, 644, 644 + } ; + +/* 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 +#line 1 "program_lexer.l" +#line 2 "program_lexer.l" +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include "main/glheader.h" +#include "prog_instruction.h" + +#include "program_parser.h" +#include "program_parse.tab.h" + +#define require_ARB_vp (yyextra->mode == ARB_vertex) +#define require_ARB_fp (yyextra->mode == ARB_fragment) + +#define return_token_or_IDENTIFIER(condition, token) \ + do { \ + if (condition) { \ + return token; \ + } else { \ + yylval->string = strdup(yytext); \ + return IDENTIFIER; \ + } \ + } while (0) + +#define return_token_or_DOT(condition, token) \ + do { \ + if (condition) { \ + return token; \ + } else { \ + yyless(1); \ + return DOT; \ + } \ + } while (0) + + +#define return_opcode(condition, token, opcode, sat) \ + do { \ + if (condition) { \ + yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ + yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ + return token; \ + } else { \ + yylval->string = strdup(yytext); \ + return IDENTIFIER; \ + } \ + } while (0) + +#define SWIZZLE_INVAL MAKE_SWIZZLE4(SWIZZLE_NIL, SWIZZLE_NIL, \ + SWIZZLE_NIL, SWIZZLE_NIL) + +static unsigned +mask_from_char(char c) +{ + switch (c) { + case 'x': + case 'r': + return WRITEMASK_X; + case 'y': + case 'g': + return WRITEMASK_Y; + case 'z': + case 'b': + return WRITEMASK_Z; + case 'w': + case 'a': + return WRITEMASK_W; + } + + return 0; +} + +static unsigned +swiz_from_char(char c) +{ + switch (c) { + case 'x': + case 'r': + return SWIZZLE_X; + case 'y': + case 'g': + return SWIZZLE_Y; + case 'z': + case 'b': + return SWIZZLE_Z; + case 'w': + case 'a': + return SWIZZLE_W; + } + + return 0; +} + +#define YY_USER_ACTION \ + do { \ + yylloc->first_column = yylloc->last_column; \ + yylloc->last_column += yyleng; \ + if ((yylloc->first_line == 1) \ + && (yylloc->first_column == 1)) { \ + yylloc->position = 1; \ + } else { \ + yylloc->position += yylloc->last_column - yylloc->first_column; \ + } \ + } while(0); + +#define YY_EXTRA_TYPE struct asm_parser_state * +#line 989 "lex.yy.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +/* Holds the entire state of the reentrant scanner. */ +struct yyguts_t + { + + /* User-defined. Not touched by flex. */ + YY_EXTRA_TYPE yyextra_r; + + /* The rest are the same as the globals declared in the non-reentrant scanner. */ + FILE *yyin_r, *yyout_r; + size_t yy_buffer_stack_top; /**< index of top of stack. */ + size_t yy_buffer_stack_max; /**< capacity of stack. */ + YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */ + char yy_hold_char; + int yy_n_chars; + int yyleng_r; + char *yy_c_buf_p; + int yy_init; + int yy_start; + int yy_did_buffer_switch_on_eof; + int yy_start_stack_ptr; + int yy_start_stack_depth; + int *yy_start_stack; + yy_state_type yy_last_accepting_state; + char* yy_last_accepting_cpos; + + int yylineno_r; + int yy_flex_debug_r; + + char *yytext_r; + int yy_more_flag; + int yy_more_len; + + YYSTYPE * yylval_r; + + YYLTYPE * yylloc_r; + + }; /* end struct yyguts_t */ + +static int yy_init_globals (yyscan_t yyscanner ); + + /* This must go here because YYSTYPE and YYLTYPE are included + * from bison output in section 1.*/ + # define yylval yyg->yylval_r + + # define yylloc yyg->yylloc_r + +int yylex_init (yyscan_t* scanner); + +int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner); + +/* Accessor methods to globals. + These are made visible to non-reentrant scanners for convenience. */ + +int yylex_destroy (yyscan_t yyscanner ); + +int yyget_debug (yyscan_t yyscanner ); + +void yyset_debug (int debug_flag ,yyscan_t yyscanner ); + +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner ); + +void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner ); + +FILE *yyget_in (yyscan_t yyscanner ); + +void yyset_in (FILE * in_str ,yyscan_t yyscanner ); + +FILE *yyget_out (yyscan_t yyscanner ); + +void yyset_out (FILE * out_str ,yyscan_t yyscanner ); + +int yyget_leng (yyscan_t yyscanner ); + +char *yyget_text (yyscan_t yyscanner ); + +int yyget_lineno (yyscan_t yyscanner ); + +void yyset_lineno (int line_number ,yyscan_t yyscanner ); + +YYSTYPE * yyget_lval (yyscan_t yyscanner ); + +void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner ); + + YYLTYPE *yyget_lloc (yyscan_t yyscanner ); + + void yyset_lloc (YYLTYPE * yylloc_param ,yyscan_t yyscanner ); + +/* Macros after this point can all be overridden by user definitions in + * section 1. + */ + +#ifndef YY_SKIP_YYWRAP +#ifdef __cplusplus +extern "C" int yywrap (yyscan_t yyscanner ); +#else +extern int yywrap (yyscan_t yyscanner ); +#endif +#endif + + static void yyunput (int c,char *buf_ptr ,yyscan_t yyscanner); + +#ifndef yytext_ptr +static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner); +#endif + +#ifdef YY_NEED_STRLEN +static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner); +#endif + +#ifndef YY_NO_INPUT + +#ifdef __cplusplus +static int yyinput (yyscan_t yyscanner ); +#else +static int input (yyscan_t yyscanner ); +#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 , yyscanner) +#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 \ + (YYSTYPE * yylval_param,YYLTYPE * yylloc_param ,yyscan_t yyscanner); + +#define YY_DECL int yylex \ + (YYSTYPE * yylval_param, YYLTYPE * yylloc_param , yyscan_t yyscanner) +#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; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + +#line 132 "program_lexer.l" + + +#line 1238 "lex.yy.c" + + yylval = yylval_param; + + yylloc = yylloc_param; + + if ( !yyg->yy_init ) + { + yyg->yy_init = 1; + +#ifdef YY_USER_INIT + YY_USER_INIT; +#endif + + if ( ! yyg->yy_start ) + yyg->yy_start = 1; /* first start state */ + + if ( ! yyin ) + yyin = stdin; + + if ( ! yyout ) + yyout = stdout; + + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + yy_load_buffer_state(yyscanner ); + } + + while ( 1 ) /* loops until end-of-file is reached */ + { + yy_cp = yyg->yy_c_buf_p; + + /* Support of yytext. */ + *yy_cp = yyg->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 = yyg->yy_start; +yy_match: + do + { + register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->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 >= 645 ) + 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_base[yy_current_state] != 905 ); + +yy_find_action: + yy_act = yy_accept[yy_current_state]; + if ( yy_act == 0 ) + { /* have to back up */ + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + yy_act = yy_accept[yy_current_state]; + } + + YY_DO_BEFORE_ACTION; + +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 = yyg->yy_hold_char; + yy_cp = yyg->yy_last_accepting_cpos; + yy_current_state = yyg->yy_last_accepting_state; + goto yy_find_action; + +case 1: +YY_RULE_SETUP +#line 134 "program_lexer.l" +{ return ARBvp_10; } + YY_BREAK +case 2: +YY_RULE_SETUP +#line 135 "program_lexer.l" +{ return ARBfp_10; } + YY_BREAK +case 3: +YY_RULE_SETUP +#line 136 "program_lexer.l" +{ + yylval->integer = at_address; + return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); +} + YY_BREAK +case 4: +YY_RULE_SETUP +#line 140 "program_lexer.l" +{ return ALIAS; } + YY_BREAK +case 5: +YY_RULE_SETUP +#line 141 "program_lexer.l" +{ return ATTRIB; } + YY_BREAK +case 6: +YY_RULE_SETUP +#line 142 "program_lexer.l" +{ return END; } + YY_BREAK +case 7: +YY_RULE_SETUP +#line 143 "program_lexer.l" +{ return OPTION; } + YY_BREAK +case 8: +YY_RULE_SETUP +#line 144 "program_lexer.l" +{ return OUTPUT; } + YY_BREAK +case 9: +YY_RULE_SETUP +#line 145 "program_lexer.l" +{ return PARAM; } + YY_BREAK +case 10: +YY_RULE_SETUP +#line 146 "program_lexer.l" +{ yylval->integer = at_temp; return TEMP; } + YY_BREAK +case 11: +YY_RULE_SETUP +#line 148 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, ABS, OFF); } + YY_BREAK +case 12: +YY_RULE_SETUP +#line 149 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } + YY_BREAK +case 13: +YY_RULE_SETUP +#line 150 "program_lexer.l" +{ return_opcode( 1, BIN_OP, ADD, OFF); } + YY_BREAK +case 14: +YY_RULE_SETUP +#line 151 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } + YY_BREAK +case 15: +YY_RULE_SETUP +#line 152 "program_lexer.l" +{ return_opcode(require_ARB_vp, ARL, ARL, OFF); } + YY_BREAK +case 16: +YY_RULE_SETUP +#line 154 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } + YY_BREAK +case 17: +YY_RULE_SETUP +#line 155 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } + YY_BREAK +case 18: +YY_RULE_SETUP +#line 156 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } + YY_BREAK +case 19: +YY_RULE_SETUP +#line 157 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } + YY_BREAK +case 20: +YY_RULE_SETUP +#line 159 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP3, OFF); } + YY_BREAK +case 21: +YY_RULE_SETUP +#line 160 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } + YY_BREAK +case 22: +YY_RULE_SETUP +#line 161 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DP4, OFF); } + YY_BREAK +case 23: +YY_RULE_SETUP +#line 162 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } + YY_BREAK +case 24: +YY_RULE_SETUP +#line 163 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DPH, OFF); } + YY_BREAK +case 25: +YY_RULE_SETUP +#line 164 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } + YY_BREAK +case 26: +YY_RULE_SETUP +#line 165 "program_lexer.l" +{ return_opcode( 1, BIN_OP, DST, OFF); } + YY_BREAK +case 27: +YY_RULE_SETUP +#line 166 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } + YY_BREAK +case 28: +YY_RULE_SETUP +#line 168 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, EX2, OFF); } + YY_BREAK +case 29: +YY_RULE_SETUP +#line 169 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } + YY_BREAK +case 30: +YY_RULE_SETUP +#line 170 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } + YY_BREAK +case 31: +YY_RULE_SETUP +#line 172 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FLR, OFF); } + YY_BREAK +case 32: +YY_RULE_SETUP +#line 173 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } + YY_BREAK +case 33: +YY_RULE_SETUP +#line 174 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, FRC, OFF); } + YY_BREAK +case 34: +YY_RULE_SETUP +#line 175 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } + YY_BREAK +case 35: +YY_RULE_SETUP +#line 177 "program_lexer.l" +{ return_opcode(require_ARB_fp, KIL, KIL, OFF); } + YY_BREAK +case 36: +YY_RULE_SETUP +#line 179 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, LIT, OFF); } + YY_BREAK +case 37: +YY_RULE_SETUP +#line 180 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } + YY_BREAK +case 38: +YY_RULE_SETUP +#line 181 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, LG2, OFF); } + YY_BREAK +case 39: +YY_RULE_SETUP +#line 182 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } + YY_BREAK +case 40: +YY_RULE_SETUP +#line 183 "program_lexer.l" +{ return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } + YY_BREAK +case 41: +YY_RULE_SETUP +#line 184 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } + YY_BREAK +case 42: +YY_RULE_SETUP +#line 185 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } + YY_BREAK +case 43: +YY_RULE_SETUP +#line 187 "program_lexer.l" +{ return_opcode( 1, TRI_OP, MAD, OFF); } + YY_BREAK +case 44: +YY_RULE_SETUP +#line 188 "program_lexer.l" +{ return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } + YY_BREAK +case 45: +YY_RULE_SETUP +#line 189 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MAX, OFF); } + YY_BREAK +case 46: +YY_RULE_SETUP +#line 190 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } + YY_BREAK +case 47: +YY_RULE_SETUP +#line 191 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MIN, OFF); } + YY_BREAK +case 48: +YY_RULE_SETUP +#line 192 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } + YY_BREAK +case 49: +YY_RULE_SETUP +#line 193 "program_lexer.l" +{ return_opcode( 1, VECTOR_OP, MOV, OFF); } + YY_BREAK +case 50: +YY_RULE_SETUP +#line 194 "program_lexer.l" +{ return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } + YY_BREAK +case 51: +YY_RULE_SETUP +#line 195 "program_lexer.l" +{ return_opcode( 1, BIN_OP, MUL, OFF); } + YY_BREAK +case 52: +YY_RULE_SETUP +#line 196 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } + YY_BREAK +case 53: +YY_RULE_SETUP +#line 198 "program_lexer.l" +{ return_opcode( 1, BINSC_OP, POW, OFF); } + YY_BREAK +case 54: +YY_RULE_SETUP +#line 199 "program_lexer.l" +{ return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } + YY_BREAK +case 55: +YY_RULE_SETUP +#line 201 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RCP, OFF); } + YY_BREAK +case 56: +YY_RULE_SETUP +#line 202 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } + YY_BREAK +case 57: +YY_RULE_SETUP +#line 203 "program_lexer.l" +{ return_opcode( 1, SCALAR_OP, RSQ, OFF); } + YY_BREAK +case 58: +YY_RULE_SETUP +#line 204 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } + YY_BREAK +case 59: +YY_RULE_SETUP +#line 206 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } + YY_BREAK +case 60: +YY_RULE_SETUP +#line 207 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } + YY_BREAK +case 61: +YY_RULE_SETUP +#line 208 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SGE, OFF); } + YY_BREAK +case 62: +YY_RULE_SETUP +#line 209 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } + YY_BREAK +case 63: +YY_RULE_SETUP +#line 210 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } + YY_BREAK +case 64: +YY_RULE_SETUP +#line 211 "program_lexer.l" +{ return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } + YY_BREAK +case 65: +YY_RULE_SETUP +#line 212 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SLT, OFF); } + YY_BREAK +case 66: +YY_RULE_SETUP +#line 213 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } + YY_BREAK +case 67: +YY_RULE_SETUP +#line 214 "program_lexer.l" +{ return_opcode( 1, BIN_OP, SUB, OFF); } + YY_BREAK +case 68: +YY_RULE_SETUP +#line 215 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } + YY_BREAK +case 69: +YY_RULE_SETUP +#line 216 "program_lexer.l" +{ return_opcode( 1, SWZ, SWZ, OFF); } + YY_BREAK +case 70: +YY_RULE_SETUP +#line 217 "program_lexer.l" +{ return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } + YY_BREAK +case 71: +YY_RULE_SETUP +#line 219 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } + YY_BREAK +case 72: +YY_RULE_SETUP +#line 220 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } + YY_BREAK +case 73: +YY_RULE_SETUP +#line 221 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } + YY_BREAK +case 74: +YY_RULE_SETUP +#line 222 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } + YY_BREAK +case 75: +YY_RULE_SETUP +#line 223 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } + YY_BREAK +case 76: +YY_RULE_SETUP +#line 224 "program_lexer.l" +{ return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } + YY_BREAK +case 77: +YY_RULE_SETUP +#line 226 "program_lexer.l" +{ return_opcode( 1, BIN_OP, XPD, OFF); } + YY_BREAK +case 78: +YY_RULE_SETUP +#line 227 "program_lexer.l" +{ return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } + YY_BREAK +case 79: +YY_RULE_SETUP +#line 229 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } + YY_BREAK +case 80: +YY_RULE_SETUP +#line 230 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } + YY_BREAK +case 81: +YY_RULE_SETUP +#line 231 "program_lexer.l" +{ return PROGRAM; } + YY_BREAK +case 82: +YY_RULE_SETUP +#line 232 "program_lexer.l" +{ return STATE; } + YY_BREAK +case 83: +YY_RULE_SETUP +#line 233 "program_lexer.l" +{ return RESULT; } + YY_BREAK +case 84: +YY_RULE_SETUP +#line 235 "program_lexer.l" +{ return AMBIENT; } + YY_BREAK +case 85: +YY_RULE_SETUP +#line 236 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, ATTENUATION); } + YY_BREAK +case 86: +YY_RULE_SETUP +#line 237 "program_lexer.l" +{ return BACK; } + YY_BREAK +case 87: +YY_RULE_SETUP +#line 238 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, CLIP); } + YY_BREAK +case 88: +YY_RULE_SETUP +#line 239 "program_lexer.l" +{ return COLOR; } + YY_BREAK +case 89: +YY_RULE_SETUP +#line 240 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, DEPTH); } + YY_BREAK +case 90: +YY_RULE_SETUP +#line 241 "program_lexer.l" +{ return DIFFUSE; } + YY_BREAK +case 91: +YY_RULE_SETUP +#line 242 "program_lexer.l" +{ return DIRECTION; } + YY_BREAK +case 92: +YY_RULE_SETUP +#line 243 "program_lexer.l" +{ return EMISSION; } + YY_BREAK +case 93: +YY_RULE_SETUP +#line 244 "program_lexer.l" +{ return ENV; } + YY_BREAK +case 94: +YY_RULE_SETUP +#line 245 "program_lexer.l" +{ return EYE; } + YY_BREAK +case 95: +YY_RULE_SETUP +#line 246 "program_lexer.l" +{ return FOGCOORD; } + YY_BREAK +case 96: +YY_RULE_SETUP +#line 247 "program_lexer.l" +{ return FOG; } + YY_BREAK +case 97: +YY_RULE_SETUP +#line 248 "program_lexer.l" +{ return FRONT; } + YY_BREAK +case 98: +YY_RULE_SETUP +#line 249 "program_lexer.l" +{ return HALF; } + YY_BREAK +case 99: +YY_RULE_SETUP +#line 250 "program_lexer.l" +{ return INVERSE; } + YY_BREAK +case 100: +YY_RULE_SETUP +#line 251 "program_lexer.l" +{ return INVTRANS; } + YY_BREAK +case 101: +YY_RULE_SETUP +#line 252 "program_lexer.l" +{ return LIGHT; } + YY_BREAK +case 102: +YY_RULE_SETUP +#line 253 "program_lexer.l" +{ return LIGHTMODEL; } + YY_BREAK +case 103: +YY_RULE_SETUP +#line 254 "program_lexer.l" +{ return LIGHTPROD; } + YY_BREAK +case 104: +YY_RULE_SETUP +#line 255 "program_lexer.l" +{ return LOCAL; } + YY_BREAK +case 105: +YY_RULE_SETUP +#line 256 "program_lexer.l" +{ return MATERIAL; } + YY_BREAK +case 106: +YY_RULE_SETUP +#line 257 "program_lexer.l" +{ return MAT_PROGRAM; } + YY_BREAK +case 107: +YY_RULE_SETUP +#line 258 "program_lexer.l" +{ return MATRIX; } + YY_BREAK +case 108: +YY_RULE_SETUP +#line 259 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } + YY_BREAK +case 109: +YY_RULE_SETUP +#line 260 "program_lexer.l" +{ return MODELVIEW; } + YY_BREAK +case 110: +YY_RULE_SETUP +#line 261 "program_lexer.l" +{ return MVP; } + YY_BREAK +case 111: +YY_RULE_SETUP +#line 262 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, NORMAL); } + YY_BREAK +case 112: +YY_RULE_SETUP +#line 263 "program_lexer.l" +{ return OBJECT; } + YY_BREAK +case 113: +YY_RULE_SETUP +#line 264 "program_lexer.l" +{ return PALETTE; } + YY_BREAK +case 114: +YY_RULE_SETUP +#line 265 "program_lexer.l" +{ return PARAMS; } + YY_BREAK +case 115: +YY_RULE_SETUP +#line 266 "program_lexer.l" +{ return PLANE; } + YY_BREAK +case 116: +YY_RULE_SETUP +#line 267 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINT); } + YY_BREAK +case 117: +YY_RULE_SETUP +#line 268 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, POINTSIZE); } + YY_BREAK +case 118: +YY_RULE_SETUP +#line 269 "program_lexer.l" +{ return POSITION; } + YY_BREAK +case 119: +YY_RULE_SETUP +#line 270 "program_lexer.l" +{ return PRIMARY; } + YY_BREAK +case 120: +YY_RULE_SETUP +#line 271 "program_lexer.l" +{ return PROJECTION; } + YY_BREAK +case 121: +YY_RULE_SETUP +#line 272 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, RANGE); } + YY_BREAK +case 122: +YY_RULE_SETUP +#line 273 "program_lexer.l" +{ return ROW; } + YY_BREAK +case 123: +YY_RULE_SETUP +#line 274 "program_lexer.l" +{ return SCENECOLOR; } + YY_BREAK +case 124: +YY_RULE_SETUP +#line 275 "program_lexer.l" +{ return SECONDARY; } + YY_BREAK +case 125: +YY_RULE_SETUP +#line 276 "program_lexer.l" +{ return SHININESS; } + YY_BREAK +case 126: +YY_RULE_SETUP +#line 277 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, SIZE); } + YY_BREAK +case 127: +YY_RULE_SETUP +#line 278 "program_lexer.l" +{ return SPECULAR; } + YY_BREAK +case 128: +YY_RULE_SETUP +#line 279 "program_lexer.l" +{ return SPOT; } + YY_BREAK +case 129: +YY_RULE_SETUP +#line 280 "program_lexer.l" +{ return TEXCOORD; } + YY_BREAK +case 130: +YY_RULE_SETUP +#line 281 "program_lexer.l" +{ return_token_or_DOT(require_ARB_fp, TEXENV); } + YY_BREAK +case 131: +YY_RULE_SETUP +#line 282 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN); } + YY_BREAK +case 132: +YY_RULE_SETUP +#line 283 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } + YY_BREAK +case 133: +YY_RULE_SETUP +#line 284 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_S); } + YY_BREAK +case 134: +YY_RULE_SETUP +#line 285 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, TEXGEN_T); } + YY_BREAK +case 135: +YY_RULE_SETUP +#line 286 "program_lexer.l" +{ return TEXTURE; } + YY_BREAK +case 136: +YY_RULE_SETUP +#line 287 "program_lexer.l" +{ return TRANSPOSE; } + YY_BREAK +case 137: +YY_RULE_SETUP +#line 288 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, VTXATTRIB); } + YY_BREAK +case 138: +YY_RULE_SETUP +#line 289 "program_lexer.l" +{ return_token_or_DOT(require_ARB_vp, WEIGHT); } + YY_BREAK +case 139: +YY_RULE_SETUP +#line 291 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } + YY_BREAK +case 140: +YY_RULE_SETUP +#line 292 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } + YY_BREAK +case 141: +YY_RULE_SETUP +#line 293 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } + YY_BREAK +case 142: +YY_RULE_SETUP +#line 294 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } + YY_BREAK +case 143: +YY_RULE_SETUP +#line 295 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } + YY_BREAK +case 144: +YY_RULE_SETUP +#line 296 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_RECT); } + YY_BREAK +case 145: +YY_RULE_SETUP +#line 298 "program_lexer.l" +{ + yylval->string = strdup(yytext); + return IDENTIFIER; +} + YY_BREAK +case 146: +YY_RULE_SETUP +#line 303 "program_lexer.l" +{ return DOT_DOT; } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 305 "program_lexer.l" +{ + yylval->integer = strtol(yytext, NULL, 10); + return INTEGER; +} + YY_BREAK +case 148: +YY_RULE_SETUP +#line 309 "program_lexer.l" +{ + yylval->real = strtod(yytext, NULL); + return REAL; +} + YY_BREAK +case 149: +/* rule 149 can match eol */ +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 313 "program_lexer.l" +{ + yylval->real = strtod(yytext, NULL); + return REAL; +} + YY_BREAK +case 150: +YY_RULE_SETUP +#line 317 "program_lexer.l" +{ + yylval->real = strtod(yytext, NULL); + return REAL; +} + YY_BREAK +case 151: +YY_RULE_SETUP +#line 321 "program_lexer.l" +{ + yylval->real = strtod(yytext, NULL); + return REAL; +} + YY_BREAK +case 152: +YY_RULE_SETUP +#line 326 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_NOOP; + yylval->swiz_mask.mask = WRITEMASK_XYZW; + return MASK4; +} + YY_BREAK +case 153: +YY_RULE_SETUP +#line 332 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XY + | mask_from_char(yytext[3]); + return MASK3; +} + YY_BREAK +case 154: +YY_RULE_SETUP +#line 338 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XZW; + return MASK3; +} + YY_BREAK +case 155: +YY_RULE_SETUP +#line 343 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_YZW; + return MASK3; +} + YY_BREAK +case 156: +YY_RULE_SETUP +#line 349 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_X + | mask_from_char(yytext[2]); + return MASK2; +} + YY_BREAK +case 157: +YY_RULE_SETUP +#line 355 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_Y + | mask_from_char(yytext[2]); + return MASK2; +} + YY_BREAK +case 158: +YY_RULE_SETUP +#line 361 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_ZW; + return MASK2; +} + YY_BREAK +case 159: +YY_RULE_SETUP +#line 367 "program_lexer.l" +{ + const unsigned s = swiz_from_char(yytext[1]); + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); + yylval->swiz_mask.mask = mask_from_char(yytext[1]); + return MASK1; +} + YY_BREAK +case 160: +YY_RULE_SETUP +#line 374 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), + swiz_from_char(yytext[2]), + swiz_from_char(yytext[3]), + swiz_from_char(yytext[4])); + yylval->swiz_mask.mask = 0; + return SWIZZLE; +} + YY_BREAK +case 161: +YY_RULE_SETUP +#line 383 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_NOOP; + yylval->swiz_mask.mask = WRITEMASK_XYZW; + return_token_or_DOT(require_ARB_fp, MASK4); +} + YY_BREAK +case 162: +YY_RULE_SETUP +#line 389 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XY + | mask_from_char(yytext[3]); + return_token_or_DOT(require_ARB_fp, MASK3); +} + YY_BREAK +case 163: +YY_RULE_SETUP +#line 395 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XZW; + return_token_or_DOT(require_ARB_fp, MASK3); +} + YY_BREAK +case 164: +YY_RULE_SETUP +#line 400 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_YZW; + return_token_or_DOT(require_ARB_fp, MASK3); +} + YY_BREAK +case 165: +YY_RULE_SETUP +#line 406 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_X + | mask_from_char(yytext[2]); + return_token_or_DOT(require_ARB_fp, MASK2); +} + YY_BREAK +case 166: +YY_RULE_SETUP +#line 412 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_Y + | mask_from_char(yytext[2]); + return_token_or_DOT(require_ARB_fp, MASK2); +} + YY_BREAK +case 167: +YY_RULE_SETUP +#line 418 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_ZW; + return_token_or_DOT(require_ARB_fp, MASK2); +} + YY_BREAK +case 168: +YY_RULE_SETUP +#line 424 "program_lexer.l" +{ + const unsigned s = swiz_from_char(yytext[1]); + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); + yylval->swiz_mask.mask = mask_from_char(yytext[1]); + return_token_or_DOT(require_ARB_fp, MASK1); +} + YY_BREAK +case 169: +YY_RULE_SETUP +#line 432 "program_lexer.l" +{ + if (require_ARB_vp) { + return TEXGEN_R; + } else { + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, + SWIZZLE_X, SWIZZLE_X); + yylval->swiz_mask.mask = WRITEMASK_X; + return MASK1; + } +} + YY_BREAK +case 170: +YY_RULE_SETUP +#line 443 "program_lexer.l" +{ + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), + swiz_from_char(yytext[2]), + swiz_from_char(yytext[3]), + swiz_from_char(yytext[4])); + yylval->swiz_mask.mask = 0; + return_token_or_DOT(require_ARB_fp, SWIZZLE); +} + YY_BREAK +case 171: +YY_RULE_SETUP +#line 452 "program_lexer.l" +{ return DOT; } + YY_BREAK +case 172: +/* rule 172 can match eol */ +YY_RULE_SETUP +#line 454 "program_lexer.l" +{ + yylloc->first_line++; + yylloc->first_column = 1; + yylloc->last_line++; + yylloc->last_column = 1; + yylloc->position++; +} + YY_BREAK +case 173: +YY_RULE_SETUP +#line 461 "program_lexer.l" +/* eat whitespace */ ; + YY_BREAK +case 174: +*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ +yyg->yy_c_buf_p = yy_cp -= 1; +YY_DO_BEFORE_ACTION; /* set up yytext again */ +YY_RULE_SETUP +#line 462 "program_lexer.l" +/* eat comments */ ; + YY_BREAK +case 175: +YY_RULE_SETUP +#line 463 "program_lexer.l" +{ return yytext[0]; } + YY_BREAK +case 176: +YY_RULE_SETUP +#line 464 "program_lexer.l" +ECHO; + YY_BREAK +#line 2335 "lex.yy.c" +case YY_STATE_EOF(INITIAL): + yyterminate(); + + case YY_END_OF_BUFFER: + { + /* Amount of text matched not including the EOB char. */ + int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1; + + /* Undo the effects of YY_DO_BEFORE_ACTION. */ + *yy_cp = yyg->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. + */ + yyg->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 ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + { /* This was really a NUL. */ + yy_state_type yy_next_state; + + yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + /* 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 , yyscanner); + + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + + if ( yy_next_state ) + { + /* Consume the NUL. */ + yy_cp = ++yyg->yy_c_buf_p; + yy_current_state = yy_next_state; + goto yy_match; + } + + else + { + yy_cp = yyg->yy_c_buf_p; + goto yy_find_action; + } + } + + else switch ( yy_get_next_buffer( yyscanner ) ) + { + case EOB_ACT_END_OF_FILE: + { + yyg->yy_did_buffer_switch_on_eof = 0; + + if ( yywrap(yyscanner ) ) + { + /* 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. + */ + yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ; + + yy_act = YY_STATE_EOF(YY_START); + goto do_action; + } + + else + { + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; + } + break; + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = + yyg->yytext_ptr + yy_amount_of_matched_text; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->yytext_ptr + YY_MORE_ADJ; + goto yy_match; + + case EOB_ACT_LAST_MATCH: + yyg->yy_c_buf_p = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars]; + + yy_current_state = yy_get_previous_state( yyscanner ); + + yy_cp = yyg->yy_c_buf_p; + yy_bp = yyg->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 (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = yyg->yytext_ptr; + register int number_to_move, i; + int ret_val; + + if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->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 ( yyg->yy_c_buf_p - yyg->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) (yyg->yy_c_buf_p - yyg->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 = yyg->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) (yyg->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 ,yyscanner ); + } + 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" ); + + yyg->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]), + yyg->yy_n_chars, (size_t) num_to_read ); + + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + if ( yyg->yy_n_chars == 0 ) + { + if ( number_to_move == YY_MORE_ADJ ) + { + ret_val = EOB_ACT_END_OF_FILE; + yyrestart(yyin ,yyscanner); + } + + 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) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) { + /* Extend the array by 50%, plus the number we really need. */ + yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1); + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner ); + if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" ); + } + + yyg->yy_n_chars += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + + yyg->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 (yyscan_t yyscanner) +{ + register yy_state_type yy_current_state; + register char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_current_state = yyg->yy_start; + + for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp ) + { + register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->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 >= 645 ) + 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 , yyscan_t yyscanner) +{ + register int yy_is_jam; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */ + register char *yy_cp = yyg->yy_c_buf_p; + + register YY_CHAR yy_c = 1; + if ( yy_accept[yy_current_state] ) + { + yyg->yy_last_accepting_state = yy_current_state; + yyg->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 >= 645 ) + 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 == 644); + + return yy_is_jam ? 0 : yy_current_state; +} + + static void yyunput (int c, register char * yy_bp , yyscan_t yyscanner) +{ + register char *yy_cp; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_cp = yyg->yy_c_buf_p; + + /* undo effects of setting up yytext */ + *yy_cp = yyg->yy_hold_char; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + { /* need to shift things up to make room */ + /* +2 for EOB chars. */ + register int number_to_move = yyg->yy_n_chars + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; + register char *source = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; + + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) + *--dest = *--source; + + yy_cp += (int) (dest - source); + yy_bp += (int) (dest - source); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; + + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) + YY_FATAL_ERROR( "flex scanner push-back overflow" ); + } + + *--yy_cp = (char) c; + + yyg->yytext_ptr = yy_bp; + yyg->yy_hold_char = *yy_cp; + yyg->yy_c_buf_p = yy_cp; +} + +#ifndef YY_NO_INPUT +#ifdef __cplusplus + static int yyinput (yyscan_t yyscanner) +#else + static int input (yyscan_t yyscanner) +#endif + +{ + int c; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + *yyg->yy_c_buf_p = yyg->yy_hold_char; + + if ( *yyg->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 ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] ) + /* This was really a NUL. */ + *yyg->yy_c_buf_p = '\0'; + + else + { /* need more input */ + int offset = yyg->yy_c_buf_p - yyg->yytext_ptr; + ++yyg->yy_c_buf_p; + + switch ( yy_get_next_buffer( yyscanner ) ) + { + 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 ,yyscanner); + + /*FALLTHROUGH*/ + + case EOB_ACT_END_OF_FILE: + { + if ( yywrap(yyscanner ) ) + return EOF; + + if ( ! yyg->yy_did_buffer_switch_on_eof ) + YY_NEW_FILE; +#ifdef __cplusplus + return yyinput(yyscanner); +#else + return input(yyscanner); +#endif + } + + case EOB_ACT_CONTINUE_SCAN: + yyg->yy_c_buf_p = yyg->yytext_ptr + offset; + break; + } + } + } + + c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */ + *yyg->yy_c_buf_p = '\0'; /* preserve yytext */ + yyg->yy_hold_char = *++yyg->yy_c_buf_p; + + return c; +} +#endif /* ifndef YY_NO_INPUT */ + +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * @param yyscanner The scanner object. + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (yyscanner); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); + } + + yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner); + yy_load_buffer_state(yyscanner ); +} + +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * @param yyscanner The scanner object. + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (yyscanner); + if ( YY_CURRENT_BUFFER == new_buffer ) + return; + + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state(yyscanner ); + + /* 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. + */ + yyg->yy_did_buffer_switch_on_eof = 1; +} + +static void yy_load_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + yyg->yy_hold_char = *yyg->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. + * @param yyscanner The scanner object. + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size , yyscan_t yyscanner) +{ + YY_BUFFER_STATE b; + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner ); + 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 ,yyscanner ); + 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 ,yyscanner); + + return b; +} + +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * @param yyscanner The scanner object. + */ + void yy_delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + 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 ,yyscanner ); + + yyfree((void *) b ,yyscanner ); +} + +/* 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 , yyscan_t yyscanner) + +{ + int oerrno = errno; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + yy_flush_buffer(b ,yyscanner); + + 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. + * @param yyscanner The scanner object. + */ + void yy_flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + 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(yyscanner ); +} + +/** 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. + * @param yyscanner The scanner object. + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(yyscanner); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *yyg->yy_c_buf_p = yyg->yy_hold_char; + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars; + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + yyg->yy_buffer_stack_top++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state(yyscanner ); + yyg->yy_did_buffer_switch_on_eof = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * @param yyscanner The scanner object. + */ +void yypop_buffer_state (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner); + YY_CURRENT_BUFFER_LVALUE = NULL; + if (yyg->yy_buffer_stack_top > 0) + --yyg->yy_buffer_stack_top; + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state(yyscanner ); + yyg->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 (yyscan_t yyscanner) +{ + int num_to_alloc; + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (!yyg->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; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + yyg->yy_buffer_stack_max = num_to_alloc; + yyg->yy_buffer_stack_top = 0; + return; + } + + if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){ + + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = yyg->yy_buffer_stack_max + grow_size; + yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc + (yyg->yy_buffer_stack, + num_to_alloc * sizeof(struct yy_buffer_state*) + , yyscanner); + if ( ! yyg->yy_buffer_stack ) + YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" ); + + /* zero only the new slots.*/ + memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*)); + yyg->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 + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner) +{ + 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 ) ,yyscanner ); + 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 ,yyscanner ); + + 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 + * @param yyscanner The scanner object. + * @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 , yyscan_t yyscanner) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner); +} + +/** 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. + * @param yyscanner The scanner object. + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner) +{ + 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 ,yyscanner ); + 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 ,yyscanner); + 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 , yyscan_t yyscanner) +{ + (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] = yyg->yy_hold_char; \ + yyg->yy_c_buf_p = yytext + yyless_macro_arg; \ + yyg->yy_hold_char = *yyg->yy_c_buf_p; \ + *yyg->yy_c_buf_p = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) + +/* Accessor methods (get/set functions) to struct members. */ + +/** Get the user-defined data for this scanner. + * @param yyscanner The scanner object. + */ +YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyextra; +} + +/** Get the current line number. + * @param yyscanner The scanner object. + */ +int yyget_lineno (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yylineno; +} + +/** Get the current column number. + * @param yyscanner The scanner object. + */ +int yyget_column (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + if (! YY_CURRENT_BUFFER) + return 0; + + return yycolumn; +} + +/** Get the input stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_in (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyin; +} + +/** Get the output stream. + * @param yyscanner The scanner object. + */ +FILE *yyget_out (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyout; +} + +/** Get the length of the current token. + * @param yyscanner The scanner object. + */ +int yyget_leng (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yyleng; +} + +/** Get the current token. + * @param yyscanner The scanner object. + */ + +char *yyget_text (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yytext; +} + +/** Set the user-defined data. This data is never touched by the scanner. + * @param user_defined The data to be associated with this scanner. + * @param yyscanner The scanner object. + */ +void yyset_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyextra = user_defined ; +} + +/** Set the current line number. + * @param line_number + * @param yyscanner The scanner object. + */ +void yyset_lineno (int line_number , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* lineno is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); + + yylineno = line_number; +} + +/** Set the current column. + * @param line_number + * @param yyscanner The scanner object. + */ +void yyset_column (int column_no , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* column is only valid if an input buffer exists. */ + if (! YY_CURRENT_BUFFER ) + yy_fatal_error( "yyset_column called with no buffer" , yyscanner); + + yycolumn = column_no; +} + +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * @param yyscanner The scanner object. + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyin = in_str ; +} + +void yyset_out (FILE * out_str , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yyout = out_str ; +} + +int yyget_debug (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yy_flex_debug; +} + +void yyset_debug (int bdebug , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yy_flex_debug = bdebug ; +} + +/* Accessor methods for yylval and yylloc */ + +YYSTYPE * yyget_lval (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylval; +} + +void yyset_lval (YYSTYPE * yylval_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylval = yylval_param; +} + +YYLTYPE *yyget_lloc (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + return yylloc; +} + +void yyset_lloc (YYLTYPE * yylloc_param , yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + yylloc = yylloc_param; +} + +/* User-visible API */ + +/* yylex_init is special because it creates the scanner itself, so it is + * the ONLY reentrant function that doesn't take the scanner as the last argument. + * That's why we explicitly handle the declaration, instead of using our macros. + */ + +int yylex_init(yyscan_t* ptr_yy_globals) + +{ + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + return yy_init_globals ( *ptr_yy_globals ); +} + +/* yylex_init_extra has the same functionality as yylex_init, but follows the + * convention of taking the scanner as the last argument. Note however, that + * this is a *pointer* to a scanner, as it will be allocated by this call (and + * is the reason, too, why this function also must handle its own declaration). + * The user defined value in the first argument will be available to yyalloc in + * the yyextra field. + */ + +int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals ) + +{ + struct yyguts_t dummy_yyguts; + + yyset_extra (yy_user_defined, &dummy_yyguts); + + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts ); + + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + /* By setting to 0xAA, we expose bugs in + yy_init_globals. Leave at 0x00 for releases. */ + memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t)); + + yyset_extra (yy_user_defined, *ptr_yy_globals); + + return yy_init_globals ( *ptr_yy_globals ); +} + +static int yy_init_globals (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + yyg->yy_buffer_stack = 0; + yyg->yy_buffer_stack_top = 0; + yyg->yy_buffer_stack_max = 0; + yyg->yy_c_buf_p = (char *) 0; + yyg->yy_init = 0; + yyg->yy_start = 0; + + yyg->yy_start_stack_ptr = 0; + yyg->yy_start_stack_depth = 0; + yyg->yy_start_stack = NULL; + +/* 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 (yyscan_t yyscanner) +{ + struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(yyscanner); + } + + /* Destroy the stack itself. */ + yyfree(yyg->yy_buffer_stack ,yyscanner); + yyg->yy_buffer_stack = NULL; + + /* Destroy the start condition stack. */ + yyfree(yyg->yy_start_stack ,yyscanner ); + yyg->yy_start_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( yyscanner); + + /* Destroy the main struct (reentrant only). */ + yyfree ( yyscanner , yyscanner ); + yyscanner = NULL; + return 0; +} + +/* + * Internal utility routines. + */ + +#ifndef yytext_ptr +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner) +{ + 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 , yyscan_t yyscanner) +{ + register int n; + for ( n = 0; s[n]; ++n ) + ; + + return n; +} +#endif + +void *yyalloc (yy_size_t size , yyscan_t yyscanner) +{ + return (void *) malloc( size ); +} + +void *yyrealloc (void * ptr, yy_size_t size , yyscan_t yyscanner) +{ + /* 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 , yyscan_t yyscanner) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" + +#line 464 "program_lexer.l" + + + +void +_mesa_program_lexer_ctor(void **scanner, struct asm_parser_state *state, + const char *string, size_t len) +{ + yylex_init_extra(state,scanner); + yy_scan_bytes(string,len,*scanner); +} + +void +_mesa_program_lexer_dtor(void *scanner) +{ + /* FINISHME: It's not clear to me whether or not the buffer state returned + * FINISHME: by yy_scan_bytes in _mesa_program_lexer_ctor needs to be + * FINISHME: explicitly destroyed here or not. + */ + yylex_destroy(scanner); +} + diff --git a/src/mesa/shader/prog_parameter_layout.c b/src/mesa/shader/prog_parameter_layout.c new file mode 100644 index 0000000000..f374636f11 --- /dev/null +++ b/src/mesa/shader/prog_parameter_layout.c @@ -0,0 +1,205 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file prog_parameter_layout.c + * \brief Helper functions to layout storage for program parameters + * + * \author Ian Romanick + */ + +#include "main/mtypes.h" +#include "prog_parameter.h" +#include "prog_parameter_layout.h" +#include "prog_instruction.h" +#include "program_parser.h" + +unsigned +_mesa_combine_swizzles(unsigned base, unsigned applied) +{ + unsigned swiz = 0; + unsigned i; + + for (i = 0; i < 4; i++) { + const unsigned s = GET_SWZ(applied, i); + + swiz |= ((s <= SWIZZLE_W) ? GET_SWZ(base, s) : s) << (i * 3); + } + + return swiz; +} + + +/** + * Copy indirect access array from one parameter list to another + * + * \param src Parameter array copied from + * \param dst Parameter array copied to + * \param first Index of first element in \c src to copy + * \param count Number of elements to copy + * + * \return + * The location in \c dst of the first element copied from \c src on + * success. -1 on failure. + * + * \warning + * This function assumes that there is already enough space available in + * \c dst to hold all of the elements that will be copied over. + */ +static int +copy_indirect_accessed_array(struct gl_program_parameter_list *src, + struct gl_program_parameter_list *dst, + unsigned first, unsigned count) +{ + const int base = dst->NumParameters; + unsigned i; + unsigned j; + + + for (i = first; i < (first + count); i++) { + struct gl_program_parameter *curr = & src->Parameters[i]; + + + if (curr->Type == PROGRAM_CONSTANT) { + j = dst->NumParameters; + } else { + for (j = 0; j < dst->NumParameters; j++) { + if (memcmp(dst->Parameters[j].StateIndexes, curr->StateIndexes, + sizeof(curr->StateIndexes)) == 0) { + return -1; + } + } + } + + assert(j == dst->NumParameters); + + memcpy(& dst->Parameters[j], curr, + sizeof(dst->Parameters[j])); + memcpy(dst->ParameterValues[j], src->ParameterValues[i], + sizeof(GLfloat) * 4); + curr->Name = NULL; + + dst->NumParameters++; + } + + return base; +} + + +int +_mesa_layout_parameters(struct asm_parser_state *state) +{ + struct gl_program_parameter_list *layout; + struct asm_instruction *inst; + unsigned i; + + + layout = + _mesa_new_parameter_list_sized(state->prog->Parameters->NumParameters); + + + /* PASS 1: Move any parameters that are accessed indirectly from the + * original parameter list to the new parameter list. + */ + for (inst = state->inst_head; inst != NULL; inst = inst->next) { + for (i = 0; i < 3; i++) { + if (inst->SrcReg[i].Base.RelAddr) { + /* Only attempt to add the to the new parameter list once. + */ + if (!inst->SrcReg[i].Symbol->pass1_done) { + const int new_begin = + copy_indirect_accessed_array(state->prog->Parameters, layout, + inst->SrcReg[i].Symbol->param_binding_begin, + inst->SrcReg[i].Symbol->param_binding_length); + + if (new_begin < 0) { + return 0; + } + + inst->SrcReg[i].Symbol->param_binding_begin = new_begin; + inst->SrcReg[i].Symbol->pass1_done = 1; + } + + /* Previously the Index was just the offset from the parameter + * array. Now that the base of the parameter array is known, the + * index can be updated to its actual value. + */ + inst->Base.SrcReg[i] = inst->SrcReg[i].Base; + inst->Base.SrcReg[i].Index += + inst->SrcReg[i].Symbol->param_binding_begin; + } + } + } + + + /* PASS 2: Move any parameters that are not accessed indirectly from the + * original parameter list to the new parameter list. + */ + for (inst = state->inst_head; inst != NULL; inst = inst->next) { + for (i = 0; i < 3; i++) { + const struct gl_program_parameter *p; + const int idx = inst->SrcReg[i].Base.Index; + unsigned swizzle = SWIZZLE_NOOP; + + + /* All relative addressed operands were processed on the first + * pass. Just skip them here. + */ + if (inst->SrcReg[i].Base.RelAddr) { + continue; + } + + + inst->Base.SrcReg[i] = inst->SrcReg[i].Base; + p = & state->prog->Parameters->Parameters[idx]; + + switch (inst->SrcReg[i].Base.File) { + case PROGRAM_CONSTANT: { + const float *const v = + state->prog->Parameters->ParameterValues[idx]; + + inst->Base.SrcReg[i].Index = + _mesa_add_unnamed_constant(layout, v, p->Size, & swizzle); + + inst->Base.SrcReg[i].Swizzle = + _mesa_combine_swizzles(inst->Base.SrcReg[i].Swizzle, swizzle); + break; + } + + case PROGRAM_STATE_VAR: + inst->Base.SrcReg[i].Index = + _mesa_add_state_reference(layout, p->StateIndexes); + break; + + default: + break; + } + } + } + + + _mesa_free_parameter_list(state->prog->Parameters); + state->prog->Parameters = layout; + + return 1; +} diff --git a/src/mesa/shader/prog_parameter_layout.h b/src/mesa/shader/prog_parameter_layout.h new file mode 100644 index 0000000000..1686170bab --- /dev/null +++ b/src/mesa/shader/prog_parameter_layout.h @@ -0,0 +1,41 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +/** + * \file prog_parameter_layout.h + * \brief Helper functions to layout storage for program parameters + * + * \author Ian Romanick + */ + +#pragma once + +#ifndef PROG_PARAMETER_LAYOUT_H +#define PROG_PARAMETER_LAYOUT_H + +extern unsigned _mesa_combine_swizzles(unsigned base, unsigned applied); + +struct asm_parser_state; +extern int _mesa_layout_parameters(struct asm_parser_state *state); + +#endif /* PROG_PARAMETER_LAYOUT_H */ diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l new file mode 100644 index 0000000000..2d20772631 --- /dev/null +++ b/src/mesa/shader/program_lexer.l @@ -0,0 +1,482 @@ +%{ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include "main/glheader.h" +#include "prog_instruction.h" + +#include "program_parser.h" +#include "program_parse.tab.h" + +#define require_ARB_vp (yyextra->mode == ARB_vertex) +#define require_ARB_fp (yyextra->mode == ARB_fragment) + +#define return_token_or_IDENTIFIER(condition, token) \ + do { \ + if (condition) { \ + return token; \ + } else { \ + yylval->string = strdup(yytext); \ + return IDENTIFIER; \ + } \ + } while (0) + +#define return_token_or_DOT(condition, token) \ + do { \ + if (condition) { \ + return token; \ + } else { \ + yyless(1); \ + return DOT; \ + } \ + } while (0) + + +#define return_opcode(condition, token, opcode, sat) \ + do { \ + if (condition) { \ + yylval->temp_inst.Opcode = OPCODE_ ## opcode; \ + yylval->temp_inst.SaturateMode = SATURATE_ ## sat; \ + return token; \ + } else { \ + yylval->string = strdup(yytext); \ + return IDENTIFIER; \ + } \ + } while (0) + +#define SWIZZLE_INVAL MAKE_SWIZZLE4(SWIZZLE_NIL, SWIZZLE_NIL, \ + SWIZZLE_NIL, SWIZZLE_NIL) + +static unsigned +mask_from_char(char c) +{ + switch (c) { + case 'x': + case 'r': + return WRITEMASK_X; + case 'y': + case 'g': + return WRITEMASK_Y; + case 'z': + case 'b': + return WRITEMASK_Z; + case 'w': + case 'a': + return WRITEMASK_W; + } + + return 0; +} + +static unsigned +swiz_from_char(char c) +{ + switch (c) { + case 'x': + case 'r': + return SWIZZLE_X; + case 'y': + case 'g': + return SWIZZLE_Y; + case 'z': + case 'b': + return SWIZZLE_Z; + case 'w': + case 'a': + return SWIZZLE_W; + } + + return 0; +} + +#define YY_USER_ACTION \ + do { \ + yylloc->first_column = yylloc->last_column; \ + yylloc->last_column += yyleng; \ + if ((yylloc->first_line == 1) \ + && (yylloc->first_column == 1)) { \ + yylloc->position = 1; \ + } else { \ + yylloc->position += yylloc->last_column - yylloc->first_column; \ + } \ + } while(0); + +#define YY_EXTRA_TYPE struct asm_parser_state * +%} + +num [0-9]+ +exp [Ee][-+]?[0-9]+ +frac "."[0-9]+ +dot "."[ \t]* + +%option bison-bridge bison-locations reentrant noyywrap +%% + +"!!ARBvp1.0" { return ARBvp_10; } +"!!ARBfp1.0" { return ARBfp_10; } +ADDRESS { + yylval->integer = at_address; + return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); +} +ALIAS { return ALIAS; } +ATTRIB { return ATTRIB; } +END { return END; } +OPTION { return OPTION; } +OUTPUT { return OUTPUT; } +PARAM { return PARAM; } +TEMP { yylval->integer = at_temp; return TEMP; } + +ABS { return_opcode( 1, VECTOR_OP, ABS, OFF); } +ABS_SAT { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } +ADD { return_opcode( 1, BIN_OP, ADD, OFF); } +ADD_SAT { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } +ARL { return_opcode(require_ARB_vp, ARL, ARL, OFF); } + +CMP { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } +CMP_SAT { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } +COS { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } +COS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } + +DP3 { return_opcode( 1, BIN_OP, DP3, OFF); } +DP3_SAT { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } +DP4 { return_opcode( 1, BIN_OP, DP4, OFF); } +DP4_SAT { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } +DPH { return_opcode( 1, BIN_OP, DPH, OFF); } +DPH_SAT { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } +DST { return_opcode( 1, BIN_OP, DST, OFF); } +DST_SAT { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } + +EX2 { return_opcode( 1, SCALAR_OP, EX2, OFF); } +EX2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } +EXP { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } + +FLR { return_opcode( 1, VECTOR_OP, FLR, OFF); } +FLR_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } +FRC { return_opcode( 1, VECTOR_OP, FRC, OFF); } +FRC_SAT { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } + +KIL { return_opcode(require_ARB_fp, KIL, KIL, OFF); } + +LIT { return_opcode( 1, VECTOR_OP, LIT, OFF); } +LIT_SAT { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } +LG2 { return_opcode( 1, SCALAR_OP, LG2, OFF); } +LG2_SAT { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } +LOG { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } +LRP { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } +LRP_SAT { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } + +MAD { return_opcode( 1, TRI_OP, MAD, OFF); } +MAD_SAT { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } +MAX { return_opcode( 1, BIN_OP, MAX, OFF); } +MAX_SAT { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } +MIN { return_opcode( 1, BIN_OP, MIN, OFF); } +MIN_SAT { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } +MOV { return_opcode( 1, VECTOR_OP, MOV, OFF); } +MOV_SAT { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } +MUL { return_opcode( 1, BIN_OP, MUL, OFF); } +MUL_SAT { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } + +POW { return_opcode( 1, BINSC_OP, POW, OFF); } +POW_SAT { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } + +RCP { return_opcode( 1, SCALAR_OP, RCP, OFF); } +RCP_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } +RSQ { return_opcode( 1, SCALAR_OP, RSQ, OFF); } +RSQ_SAT { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } + +SCS { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } +SCS_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } +SGE { return_opcode( 1, BIN_OP, SGE, OFF); } +SGE_SAT { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } +SIN { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } +SIN_SAT { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } +SLT { return_opcode( 1, BIN_OP, SLT, OFF); } +SLT_SAT { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } +SUB { return_opcode( 1, BIN_OP, SUB, OFF); } +SUB_SAT { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } +SWZ { return_opcode( 1, SWZ, SWZ, OFF); } +SWZ_SAT { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } + +TEX { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } +TEX_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } +TXB { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } +TXB_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } +TXP { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } +TXP_SAT { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } + +XPD { return_opcode( 1, BIN_OP, XPD, OFF); } +XPD_SAT { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } + +vertex { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } +fragment { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } +program { return PROGRAM; } +state { return STATE; } +result { return RESULT; } + +{dot}ambient { return AMBIENT; } +{dot}attenuation { return_token_or_DOT(require_ARB_vp, ATTENUATION); } +{dot}back { return BACK; } +{dot}clip { return_token_or_DOT(require_ARB_vp, CLIP); } +{dot}color { return COLOR; } +{dot}depth { return_token_or_DOT(require_ARB_fp, DEPTH); } +{dot}diffuse { return DIFFUSE; } +{dot}direction { return DIRECTION; } +{dot}emission { return EMISSION; } +{dot}env { return ENV; } +{dot}eye { return EYE; } +{dot}fogcoord { return FOGCOORD; } +{dot}fog { return FOG; } +{dot}front { return FRONT; } +{dot}half { return HALF; } +{dot}inverse { return INVERSE; } +{dot}invtrans { return INVTRANS; } +{dot}light { return LIGHT; } +{dot}lightmodel { return LIGHTMODEL; } +{dot}lightprod { return LIGHTPROD; } +{dot}local { return LOCAL; } +{dot}material { return MATERIAL; } +{dot}program { return MAT_PROGRAM; } +{dot}matrix { return MATRIX; } +{dot}matrixindex { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } +{dot}modelview { return MODELVIEW; } +{dot}mvp { return MVP; } +{dot}normal { return_token_or_DOT(require_ARB_vp, NORMAL); } +{dot}object { return OBJECT; } +{dot}palette { return PALETTE; } +{dot}params { return PARAMS; } +{dot}plane { return PLANE; } +{dot}point { return_token_or_DOT(require_ARB_vp, POINT); } +{dot}pointsize { return_token_or_DOT(require_ARB_vp, POINTSIZE); } +{dot}position { return POSITION; } +{dot}primary { return PRIMARY; } +{dot}projection { return PROJECTION; } +{dot}range { return_token_or_DOT(require_ARB_fp, RANGE); } +{dot}row { return ROW; } +{dot}scenecolor { return SCENECOLOR; } +{dot}secondary { return SECONDARY; } +{dot}shininess { return SHININESS; } +{dot}size { return_token_or_DOT(require_ARB_vp, SIZE); } +{dot}specular { return SPECULAR; } +{dot}spot { return SPOT; } +{dot}texcoord { return TEXCOORD; } +{dot}texenv { return_token_or_DOT(require_ARB_fp, TEXENV); } +{dot}texgen { return_token_or_DOT(require_ARB_vp, TEXGEN); } +{dot}q { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } +{dot}s { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } +{dot}t { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } +{dot}texture { return TEXTURE; } +{dot}transpose { return TRANSPOSE; } +{dot}attrib { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } +{dot}weight { return_token_or_DOT(require_ARB_vp, WEIGHT); } + +texture { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } +1D { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } +2D { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } +3D { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } +CUBE { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } +RECT { return_token_or_IDENTIFIER(require_ARB_fp, TEX_RECT); } + +[_a-zA-Z$][_a-zA-Z0-9$]* { + yylval->string = strdup(yytext); + return IDENTIFIER; +} + +".." { return DOT_DOT; } + +{num} { + yylval->integer = strtol(yytext, NULL, 10); + return INTEGER; +} +{num}?{frac}{exp}? { + yylval->real = strtod(yytext, NULL); + return REAL; +} +{num}"."/[^.] { + yylval->real = strtod(yytext, NULL); + return REAL; +} +{num}{exp} { + yylval->real = strtod(yytext, NULL); + return REAL; +} +{num}"."{exp} { + yylval->real = strtod(yytext, NULL); + return REAL; +} + +".xyzw" { + yylval->swiz_mask.swizzle = SWIZZLE_NOOP; + yylval->swiz_mask.mask = WRITEMASK_XYZW; + return MASK4; +} + +".xy"[zw] { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XY + | mask_from_char(yytext[3]); + return MASK3; +} +".xzw" { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XZW; + return MASK3; +} +".yzw" { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_YZW; + return MASK3; +} + +".x"[yzw] { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_X + | mask_from_char(yytext[2]); + return MASK2; +} +".y"[zw] { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_Y + | mask_from_char(yytext[2]); + return MASK2; +} +".zw" { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_ZW; + return MASK2; +} + +"."[xyzw] { + const unsigned s = swiz_from_char(yytext[1]); + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); + yylval->swiz_mask.mask = mask_from_char(yytext[1]); + return MASK1; +} + +"."[xyzw]{4} { + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), + swiz_from_char(yytext[2]), + swiz_from_char(yytext[3]), + swiz_from_char(yytext[4])); + yylval->swiz_mask.mask = 0; + return SWIZZLE; +} + +".rgba" { + yylval->swiz_mask.swizzle = SWIZZLE_NOOP; + yylval->swiz_mask.mask = WRITEMASK_XYZW; + return_token_or_DOT(require_ARB_fp, MASK4); +} + +".rg"[ba] { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XY + | mask_from_char(yytext[3]); + return_token_or_DOT(require_ARB_fp, MASK3); +} +".rba" { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_XZW; + return_token_or_DOT(require_ARB_fp, MASK3); +} +".gba" { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_YZW; + return_token_or_DOT(require_ARB_fp, MASK3); +} + +".r"[gba] { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_X + | mask_from_char(yytext[2]); + return_token_or_DOT(require_ARB_fp, MASK2); +} +".g"[ba] { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_Y + | mask_from_char(yytext[2]); + return_token_or_DOT(require_ARB_fp, MASK2); +} +".ba" { + yylval->swiz_mask.swizzle = SWIZZLE_INVAL; + yylval->swiz_mask.mask = WRITEMASK_ZW; + return_token_or_DOT(require_ARB_fp, MASK2); +} + +"."[gba] { + const unsigned s = swiz_from_char(yytext[1]); + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); + yylval->swiz_mask.mask = mask_from_char(yytext[1]); + return_token_or_DOT(require_ARB_fp, MASK1); +} + + +".r" { + if (require_ARB_vp) { + return TEXGEN_R; + } else { + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(SWIZZLE_X, SWIZZLE_X, + SWIZZLE_X, SWIZZLE_X); + yylval->swiz_mask.mask = WRITEMASK_X; + return MASK1; + } +} + +"."[rgba]{4} { + yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), + swiz_from_char(yytext[2]), + swiz_from_char(yytext[3]), + swiz_from_char(yytext[4])); + yylval->swiz_mask.mask = 0; + return_token_or_DOT(require_ARB_fp, SWIZZLE); +} + +"." { return DOT; } + +\n { + yylloc->first_line++; + yylloc->first_column = 1; + yylloc->last_line++; + yylloc->last_column = 1; + yylloc->position++; +} +[ \t]+ /* eat whitespace */ ; +#.*$ /* eat comments */ ; +. { return yytext[0]; } +%% + +void +_mesa_program_lexer_ctor(void **scanner, struct asm_parser_state *state, + const char *string, size_t len) +{ + yylex_init_extra(state, scanner); + yy_scan_bytes(string, len, *scanner); +} + +void +_mesa_program_lexer_dtor(void *scanner) +{ + /* FINISHME: It's not clear to me whether or not the buffer state returned + * FINISHME: by yy_scan_bytes in _mesa_program_lexer_ctor needs to be + * FINISHME: explicitly destroyed here or not. + */ + yylex_destroy(scanner); +} diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c new file mode 100644 index 0000000000..090c399f44 --- /dev/null +++ b/src/mesa/shader/program_parse.tab.c @@ -0,0 +1,4915 @@ + +/* 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 1 + + + +/* Copy the first part of user declarations. */ + +/* Line 189 of yacc.c */ +#line 1 "program_parse.y" + +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include +#include +#include + +#include "main/mtypes.h" +#include "prog_parameter.h" +#include "prog_parameter_layout.h" +#include "prog_statevars.h" +#include "prog_instruction.h" + +#include "symbol_table.h" +#include "program_parser.h" + +extern void *yy_scan_string(char *); +extern void yy_delete_buffer(void *); + +static struct asm_symbol *declare_variable(struct asm_parser_state *state, + char *name, enum asm_type t, struct YYLTYPE *locp); + +static int initialize_symbol_from_state(struct gl_program *prog, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]); + +static int initialize_symbol_from_param(struct gl_program *prog, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]); + +static int initialize_symbol_from_const(struct gl_program *prog, + struct asm_symbol *param_var, const struct asm_vector *vec); + +static int yyparse(struct asm_parser_state *state); + +static void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state, + const char *s); + +static int validate_inputs(struct YYLTYPE *locp, + struct asm_parser_state *state); + +static void init_dst_reg(struct prog_dst_register *r); + +static void init_src_reg(struct asm_src_register *r); + +static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, + const struct prog_dst_register *dst, const struct asm_src_register *src0, + const struct asm_src_register *src1, const struct asm_src_register *src2); + +#ifndef FALSE +#define FALSE 0 +#define TRUE (!FALSE) +#endif + +#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).position = YYRHSLOC(Rhs, 1).position; \ + (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ + } else { \ + (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \ + (Current).last_line = (Current).first_line; \ + (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \ + (Current).last_column = (Current).first_column; \ + (Current).position = YYRHSLOC(Rhs, 0).position \ + + (Current).first_column; \ + } \ + } while(YYID(0)) + +#define YYLEX_PARAM state->scanner + + +/* Line 189 of yacc.c */ +#line 167 "program_parse.tab.c" + +/* 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 1 +#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 { + ARBvp_10 = 258, + ARBfp_10 = 259, + ADDRESS = 260, + ALIAS = 261, + ATTRIB = 262, + OPTION = 263, + OUTPUT = 264, + PARAM = 265, + TEMP = 266, + END = 267, + BIN_OP = 268, + BINSC_OP = 269, + SAMPLE_OP = 270, + SCALAR_OP = 271, + TRI_OP = 272, + VECTOR_OP = 273, + ARL = 274, + KIL = 275, + SWZ = 276, + INTEGER = 277, + REAL = 278, + AMBIENT = 279, + ATTENUATION = 280, + BACK = 281, + CLIP = 282, + COLOR = 283, + DEPTH = 284, + DIFFUSE = 285, + DIRECTION = 286, + EMISSION = 287, + ENV = 288, + EYE = 289, + FOG = 290, + FOGCOORD = 291, + FRAGMENT = 292, + FRONT = 293, + HALF = 294, + INVERSE = 295, + INVTRANS = 296, + LIGHT = 297, + LIGHTMODEL = 298, + LIGHTPROD = 299, + LOCAL = 300, + MATERIAL = 301, + MAT_PROGRAM = 302, + MATRIX = 303, + MATRIXINDEX = 304, + MODELVIEW = 305, + MVP = 306, + NORMAL = 307, + OBJECT = 308, + PALETTE = 309, + PARAMS = 310, + PLANE = 311, + POINT = 312, + POINTSIZE = 313, + POSITION = 314, + PRIMARY = 315, + PROGRAM = 316, + PROJECTION = 317, + RANGE = 318, + RESULT = 319, + ROW = 320, + SCENECOLOR = 321, + SECONDARY = 322, + SHININESS = 323, + SIZE = 324, + SPECULAR = 325, + SPOT = 326, + STATE = 327, + TEXCOORD = 328, + TEXENV = 329, + TEXGEN = 330, + TEXGEN_Q = 331, + TEXGEN_R = 332, + TEXGEN_S = 333, + TEXGEN_T = 334, + TEXTURE = 335, + TRANSPOSE = 336, + TEXTURE_UNIT = 337, + TEX_1D = 338, + TEX_2D = 339, + TEX_3D = 340, + TEX_CUBE = 341, + TEX_RECT = 342, + VERTEX = 343, + VTXATTRIB = 344, + WEIGHT = 345, + IDENTIFIER = 346, + MASK4 = 347, + MASK3 = 348, + MASK2 = 349, + MASK1 = 350, + SWIZZLE = 351, + DOT_DOT = 352, + DOT = 353 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 214 of yacc.c */ +#line 100 "program_parse.y" + + struct asm_instruction *inst; + struct asm_symbol *sym; + struct asm_symbol temp_sym; + struct asm_swizzle_mask swiz_mask; + struct asm_src_register src_reg; + struct prog_dst_register dst_reg; + struct prog_instruction temp_inst; + char *string; + unsigned result; + unsigned attrib; + int integer; + float real; + unsigned state[5]; + int negate; + struct asm_vector vector; + gl_inst_opcode opcode; + + + +/* Line 214 of yacc.c */ +#line 322 "program_parse.tab.c" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +} YYLTYPE; +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + +/* Copy the second part of user declarations. */ + +/* Line 264 of yacc.c */ +#line 233 "program_parse.y" + +extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, + void *yyscanner); + + +/* Line 264 of yacc.c */ +#line 353 "program_parse.tab.c" + +#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 YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL \ + && 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; + YYLTYPE yyls_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) + sizeof (YYLTYPE)) \ + + 2 * 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 5 +/* YYLAST -- Last index in YYTABLE. */ +#define YYLAST 335 + +/* YYNTOKENS -- Number of terminals. */ +#define YYNTOKENS 108 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 133 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 255 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 424 + +/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ +#define YYUNDEFTOK 2 +#define YYMAXUTOK 353 + +#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, 103, 100, 104, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 99, + 2, 105, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 101, 2, 102, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 106, 2, 107, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 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, 94, + 95, 96, 97, 98 +}; + +#if YYDEBUG +/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in + YYRHS. */ +static const yytype_uint16 yyprhs[] = +{ + 0, 0, 3, 8, 10, 12, 15, 16, 20, 23, + 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, + 46, 48, 50, 52, 57, 62, 67, 74, 81, 90, + 99, 102, 105, 107, 109, 111, 113, 115, 122, 126, + 130, 133, 136, 144, 147, 149, 151, 153, 155, 160, + 162, 164, 166, 168, 170, 172, 174, 178, 179, 182, + 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, + 204, 206, 208, 210, 212, 213, 215, 217, 219, 221, + 223, 225, 230, 233, 236, 238, 241, 243, 246, 248, + 251, 256, 261, 263, 264, 268, 270, 272, 275, 277, + 280, 282, 284, 288, 295, 296, 298, 301, 306, 308, + 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, + 332, 335, 338, 341, 344, 347, 350, 353, 356, 359, + 362, 365, 369, 371, 373, 375, 381, 383, 385, 387, + 390, 392, 394, 397, 399, 402, 409, 411, 415, 417, + 419, 421, 423, 425, 430, 432, 434, 436, 438, 440, + 442, 445, 447, 449, 455, 457, 460, 462, 464, 470, + 473, 474, 481, 485, 486, 488, 490, 492, 494, 496, + 499, 501, 503, 506, 511, 516, 517, 519, 521, 523, + 525, 527, 529, 531, 533, 539, 541, 545, 551, 557, + 559, 563, 569, 571, 573, 575, 577, 579, 581, 583, + 585, 587, 591, 597, 605, 615, 618, 621, 623, 625, + 626, 627, 631, 632, 636, 640, 642, 647, 650, 653, + 656, 659, 663, 666, 670, 671, 673, 675, 676, 678, + 680, 681, 683, 685, 686, 688, 690, 691, 695, 696, + 700, 701, 705, 707, 709, 711 +}; + +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int16 yyrhs[] = +{ + 109, 0, -1, 110, 111, 113, 12, -1, 3, -1, + 4, -1, 111, 112, -1, -1, 8, 91, 99, -1, + 113, 114, -1, -1, 115, 99, -1, 151, 99, -1, + 116, -1, 117, -1, 118, -1, 119, -1, 120, -1, + 121, -1, 122, -1, 123, -1, 128, -1, 124, -1, + 125, -1, 19, 132, 100, 129, -1, 18, 131, 100, + 130, -1, 16, 131, 100, 129, -1, 14, 131, 100, + 129, 100, 129, -1, 13, 131, 100, 130, 100, 130, + -1, 17, 131, 100, 130, 100, 130, 100, 130, -1, + 15, 131, 100, 130, 100, 126, 100, 127, -1, 20, + 130, -1, 82, 235, -1, 83, -1, 84, -1, 85, + -1, 86, -1, 87, -1, 21, 131, 100, 136, 100, + 133, -1, 221, 136, 148, -1, 221, 136, 149, -1, + 137, 150, -1, 145, 147, -1, 134, 100, 134, 100, + 134, 100, 134, -1, 221, 135, -1, 22, -1, 91, + -1, 91, -1, 153, -1, 138, 101, 139, 102, -1, + 167, -1, 228, -1, 91, -1, 91, -1, 140, -1, + 141, -1, 22, -1, 145, 146, 142, -1, -1, 103, + 143, -1, 104, 144, -1, 22, -1, 22, -1, 91, + -1, 95, -1, 95, -1, 95, -1, 95, -1, 92, + -1, 96, -1, -1, 92, -1, 93, -1, 94, -1, + 95, -1, -1, 152, -1, 159, -1, 222, -1, 224, + -1, 227, -1, 240, -1, 7, 91, 105, 153, -1, + 88, 154, -1, 37, 158, -1, 59, -1, 90, 156, + -1, 52, -1, 28, 233, -1, 36, -1, 73, 234, + -1, 49, 101, 157, 102, -1, 89, 101, 155, 102, + -1, 22, -1, -1, 101, 157, 102, -1, 22, -1, + 59, -1, 28, 233, -1, 36, -1, 73, 234, -1, + 160, -1, 161, -1, 10, 91, 163, -1, 10, 91, + 101, 162, 102, 164, -1, -1, 22, -1, 105, 166, + -1, 105, 106, 165, 107, -1, 168, -1, 165, 100, + 168, -1, 170, -1, 205, -1, 215, -1, 170, -1, + 205, -1, 216, -1, 169, -1, 206, -1, 215, -1, + 170, -1, 72, 194, -1, 72, 171, -1, 72, 173, + -1, 72, 176, -1, 72, 178, -1, 72, 184, -1, + 72, 180, -1, 72, 187, -1, 72, 189, -1, 72, + 191, -1, 72, 193, -1, 46, 232, 172, -1, 182, + -1, 32, -1, 68, -1, 42, 101, 183, 102, 174, + -1, 182, -1, 59, -1, 25, -1, 71, 175, -1, + 39, -1, 31, -1, 43, 177, -1, 24, -1, 232, + 66, -1, 44, 101, 183, 102, 232, 179, -1, 182, + -1, 74, 236, 181, -1, 28, -1, 24, -1, 30, + -1, 70, -1, 22, -1, 75, 234, 185, 186, -1, + 34, -1, 53, -1, 78, -1, 79, -1, 77, -1, + 76, -1, 35, 188, -1, 28, -1, 55, -1, 27, + 101, 190, 102, 56, -1, 22, -1, 57, 192, -1, + 69, -1, 25, -1, 196, 65, 101, 199, 102, -1, + 196, 195, -1, -1, 65, 101, 199, 97, 199, 102, + -1, 48, 200, 197, -1, -1, 198, -1, 40, -1, + 81, -1, 41, -1, 22, -1, 50, 201, -1, 62, + -1, 51, -1, 80, 234, -1, 54, 101, 203, 102, + -1, 47, 101, 204, 102, -1, -1, 202, -1, 22, + -1, 22, -1, 22, -1, 209, -1, 212, -1, 207, + -1, 210, -1, 61, 33, 101, 208, 102, -1, 213, + -1, 213, 97, 213, -1, 61, 33, 101, 213, 102, + -1, 61, 45, 101, 211, 102, -1, 214, -1, 214, + 97, 214, -1, 61, 45, 101, 214, 102, -1, 22, + -1, 22, -1, 217, -1, 219, -1, 218, -1, 219, + -1, 220, -1, 23, -1, 22, -1, 106, 220, 107, + -1, 106, 220, 100, 220, 107, -1, 106, 220, 100, + 220, 100, 220, 107, -1, 106, 220, 100, 220, 100, + 220, 100, 220, 107, -1, 221, 23, -1, 221, 22, + -1, 103, -1, 104, -1, -1, -1, 11, 223, 226, + -1, -1, 5, 225, 226, -1, 226, 100, 91, -1, + 91, -1, 9, 91, 105, 228, -1, 64, 59, -1, + 64, 36, -1, 64, 229, -1, 64, 58, -1, 64, + 73, 234, -1, 64, 29, -1, 28, 230, 231, -1, + -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, + -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, + -1, 101, 237, 102, -1, -1, 101, 238, 102, -1, + -1, 101, 239, 102, -1, 22, -1, 22, -1, 22, + -1, 6, 91, 105, 91, -1 +}; + +/* YYRLINE[YYN] -- source line where rule number YYN was defined. */ +static const yytype_uint16 yyrline[] = +{ + 0, 240, 240, 243, 251, 260, 261, 264, 282, 283, + 286, 301, 304, 305, 308, 309, 310, 311, 312, 313, + 314, 317, 318, 321, 327, 334, 341, 349, 356, 364, + 375, 381, 387, 388, 389, 390, 391, 394, 406, 419, + 432, 454, 463, 472, 479, 488, 516, 558, 569, 590, + 598, 604, 628, 645, 645, 647, 654, 666, 667, 668, + 671, 683, 695, 713, 724, 736, 738, 739, 740, 741, + 744, 744, 744, 744, 745, 748, 749, 750, 751, 752, + 753, 756, 774, 778, 784, 788, 792, 796, 800, 804, + 808, 812, 818, 829, 829, 830, 832, 836, 840, 844, + 850, 850, 852, 868, 891, 894, 905, 911, 917, 918, + 925, 931, 937, 945, 951, 957, 965, 971, 977, 985, + 986, 989, 990, 991, 992, 993, 994, 995, 996, 997, + 998, 1001, 1010, 1014, 1018, 1024, 1033, 1037, 1041, 1045, + 1049, 1055, 1061, 1068, 1073, 1081, 1091, 1093, 1101, 1107, + 1111, 1115, 1121, 1132, 1141, 1145, 1150, 1154, 1158, 1162, + 1168, 1175, 1179, 1185, 1193, 1204, 1211, 1215, 1221, 1231, + 1242, 1246, 1264, 1273, 1276, 1282, 1286, 1290, 1296, 1307, + 1312, 1317, 1322, 1327, 1331, 1339, 1342, 1347, 1360, 1368, + 1381, 1381, 1383, 1383, 1385, 1395, 1400, 1407, 1417, 1426, + 1431, 1438, 1448, 1458, 1470, 1470, 1471, 1471, 1473, 1480, + 1485, 1492, 1497, 1503, 1511, 1522, 1526, 1532, 1533, 1534, + 1537, 1537, 1540, 1540, 1543, 1549, 1557, 1570, 1579, 1588, + 1592, 1601, 1610, 1621, 1628, 1633, 1642, 1654, 1657, 1666, + 1677, 1678, 1679, 1682, 1683, 1684, 1687, 1688, 1691, 1692, + 1695, 1696, 1699, 1710, 1721, 1732 +}; +#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", "ARBvp_10", "ARBfp_10", "ADDRESS", + "ALIAS", "ATTRIB", "OPTION", "OUTPUT", "PARAM", "TEMP", "END", "BIN_OP", + "BINSC_OP", "SAMPLE_OP", "SCALAR_OP", "TRI_OP", "VECTOR_OP", "ARL", + "KIL", "SWZ", "INTEGER", "REAL", "AMBIENT", "ATTENUATION", "BACK", + "CLIP", "COLOR", "DEPTH", "DIFFUSE", "DIRECTION", "EMISSION", "ENV", + "EYE", "FOG", "FOGCOORD", "FRAGMENT", "FRONT", "HALF", "INVERSE", + "INVTRANS", "LIGHT", "LIGHTMODEL", "LIGHTPROD", "LOCAL", "MATERIAL", + "MAT_PROGRAM", "MATRIX", "MATRIXINDEX", "MODELVIEW", "MVP", "NORMAL", + "OBJECT", "PALETTE", "PARAMS", "PLANE", "POINT", "POINTSIZE", "POSITION", + "PRIMARY", "PROGRAM", "PROJECTION", "RANGE", "RESULT", "ROW", + "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE", "SPECULAR", "SPOT", + "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R", + "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D", + "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "VERTEX", "VTXATTRIB", + "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", + "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", + "'}'", "$accept", "program", "language", "optionSequence", "option", + "statementSequence", "statement", "instruction", "ALU_instruction", + "TexInstruction", "ARL_instruction", "VECTORop_instruction", + "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", + "TRIop_instruction", "SAMPLE_instruction", "KIL_instruction", + "texImageUnit", "texTarget", "SWZ_instruction", "scalarSrcReg", + "swizzleSrcReg", "maskedDstReg", "maskedAddrReg", "extendedSwizzle", + "extSwizComp", "extSwizSel", "srcReg", "dstReg", "progParamArray", + "progParamArrayMem", "progParamArrayAbs", "progParamArrayRel", + "addrRegRelOffset", "addrRegPosOffset", "addrRegNegOffset", "addrReg", + "addrComponent", "addrWriteMask", "scalarSuffix", "swizzleSuffix", + "optionalMask", "namingStatement", "ATTRIB_statement", "attribBinding", + "vtxAttribItem", "vtxAttribNum", "vtxOptWeightNum", "vtxWeightNum", + "fragAttribItem", "PARAM_statement", "PARAM_singleStmt", + "PARAM_multipleStmt", "optArraySize", "paramSingleInit", + "paramMultipleInit", "paramMultInitList", "paramSingleItemDecl", + "paramSingleItemUse", "paramMultipleItem", "stateMultipleItem", + "stateSingleItem", "stateMaterialItem", "stateMatProperty", + "stateLightItem", "stateLightProperty", "stateSpotProperty", + "stateLightModelItem", "stateLModProperty", "stateLightProdItem", + "stateLProdProperty", "stateTexEnvItem", "stateTexEnvProperty", + "ambDiffSpecProperty", "stateLightNumber", "stateTexGenItem", + "stateTexGenType", "stateTexGenCoord", "stateFogItem", + "stateFogProperty", "stateClipPlaneItem", "stateClipPlaneNum", + "statePointItem", "statePointProperty", "stateMatrixRow", + "stateMatrixRows", "optMatrixRows", "stateMatrixItem", + "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum", + "stateMatrixName", "stateOptModMatNum", "stateModMatNum", + "statePaletteMatNum", "stateProgramMatNum", "programSingleItem", + "programMultipleItem", "progEnvParams", "progEnvParamNums", + "progEnvParam", "progLocalParams", "progLocalParamNums", + "progLocalParam", "progEnvParamNum", "progLocalParamNum", + "paramConstDecl", "paramConstUse", "paramConstScalarDecl", + "paramConstScalarUse", "paramConstVector", "signedFloatConstant", + "optionalSign", "TEMP_statement", "@1", "ADDRESS_statement", "@2", + "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding", + "optResultFaceType", "optResultColorType", "optFaceType", "optColorType", + "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", + "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", + "ALIAS_statement", 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, 349, 350, 351, 352, 353, 59, + 44, 91, 93, 43, 45, 61, 123, 125 +}; +# endif + +/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ +static const yytype_uint8 yyr1[] = +{ + 0, 108, 109, 110, 110, 111, 111, 112, 113, 113, + 114, 114, 115, 115, 116, 116, 116, 116, 116, 116, + 116, 117, 117, 118, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 127, 127, 127, 127, 128, 129, 130, + 131, 132, 133, 134, 135, 135, 136, 136, 136, 136, + 137, 137, 138, 139, 139, 140, 141, 142, 142, 142, + 143, 144, 145, 146, 147, 148, 149, 149, 149, 149, + 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, + 151, 152, 153, 153, 154, 154, 154, 154, 154, 154, + 154, 154, 155, 156, 156, 157, 158, 158, 158, 158, + 159, 159, 160, 161, 162, 162, 163, 164, 165, 165, + 166, 166, 166, 167, 167, 167, 168, 168, 168, 169, + 169, 170, 170, 170, 170, 170, 170, 170, 170, 170, + 170, 171, 172, 172, 172, 173, 174, 174, 174, 174, + 174, 175, 176, 177, 177, 178, 179, 180, 181, 182, + 182, 182, 183, 184, 185, 185, 186, 186, 186, 186, + 187, 188, 188, 189, 190, 191, 192, 192, 193, 194, + 195, 195, 196, 197, 197, 198, 198, 198, 199, 200, + 200, 200, 200, 200, 200, 201, 201, 202, 203, 204, + 205, 205, 206, 206, 207, 208, 208, 209, 210, 211, + 211, 212, 213, 214, 215, 215, 216, 216, 217, 218, + 218, 219, 219, 219, 219, 220, 220, 221, 221, 221, + 223, 222, 225, 224, 226, 226, 227, 228, 228, 228, + 228, 228, 228, 229, 230, 230, 230, 231, 231, 231, + 232, 232, 232, 233, 233, 233, 234, 234, 235, 235, + 236, 236, 237, 238, 239, 240 +}; + +/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ +static const yytype_uint8 yyr2[] = +{ + 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, + 2, 2, 1, 1, 1, 1, 1, 6, 3, 3, + 2, 2, 7, 2, 1, 1, 1, 1, 4, 1, + 1, 1, 1, 1, 1, 1, 3, 0, 2, 2, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, + 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, + 1, 4, 2, 2, 1, 2, 1, 2, 1, 2, + 4, 4, 1, 0, 3, 1, 1, 2, 1, 2, + 1, 1, 3, 6, 0, 1, 2, 4, 1, 3, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 3, 1, 1, 1, 5, 1, 1, 1, 2, + 1, 1, 2, 1, 2, 6, 1, 3, 1, 1, + 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, + 2, 1, 1, 5, 1, 2, 1, 1, 5, 2, + 0, 6, 3, 0, 1, 1, 1, 1, 1, 2, + 1, 1, 2, 4, 4, 0, 1, 1, 1, 1, + 1, 1, 1, 1, 5, 1, 3, 5, 5, 1, + 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 3, 5, 7, 9, 2, 2, 1, 1, 0, + 0, 3, 0, 3, 3, 1, 4, 2, 2, 2, + 2, 3, 2, 3, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 3, 0, 3, + 0, 3, 1, 1, 1, 4 +}; + +/* 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, 3, 4, 0, 6, 1, 9, 0, 5, 0, + 0, 222, 0, 0, 0, 0, 220, 2, 0, 0, + 0, 0, 0, 0, 0, 219, 0, 8, 0, 12, + 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, + 0, 75, 76, 100, 101, 77, 78, 79, 80, 7, + 0, 0, 0, 0, 0, 0, 0, 51, 0, 74, + 50, 0, 0, 0, 0, 0, 62, 0, 0, 217, + 218, 30, 0, 0, 10, 11, 225, 223, 0, 0, + 0, 104, 219, 102, 221, 234, 232, 228, 230, 227, + 246, 229, 219, 70, 71, 72, 73, 40, 219, 219, + 219, 219, 219, 219, 64, 41, 210, 209, 0, 0, + 0, 0, 46, 219, 69, 0, 47, 49, 113, 114, + 190, 191, 115, 206, 207, 0, 0, 255, 81, 226, + 105, 0, 106, 110, 111, 112, 204, 205, 208, 0, + 236, 235, 237, 0, 231, 0, 0, 0, 0, 25, + 0, 24, 23, 243, 98, 96, 246, 83, 0, 0, + 0, 0, 0, 240, 0, 240, 0, 0, 250, 246, + 121, 122, 123, 124, 126, 125, 127, 128, 129, 130, + 0, 243, 88, 0, 86, 84, 246, 0, 93, 82, + 0, 67, 66, 68, 39, 0, 0, 224, 0, 216, + 215, 238, 239, 233, 252, 0, 219, 219, 0, 0, + 219, 244, 245, 97, 99, 0, 0, 0, 161, 162, + 160, 0, 143, 242, 241, 142, 0, 0, 0, 0, + 185, 181, 0, 180, 246, 173, 167, 166, 165, 0, + 0, 0, 0, 87, 0, 89, 0, 0, 85, 219, + 211, 55, 0, 53, 54, 0, 219, 0, 103, 247, + 27, 26, 65, 38, 248, 0, 0, 202, 0, 203, + 0, 164, 0, 152, 0, 144, 0, 149, 150, 133, + 134, 151, 131, 132, 0, 187, 179, 186, 0, 182, + 175, 177, 176, 172, 174, 254, 0, 148, 147, 154, + 155, 0, 0, 95, 0, 92, 0, 0, 0, 48, + 63, 57, 37, 0, 0, 219, 0, 31, 0, 219, + 197, 201, 0, 0, 240, 189, 0, 188, 0, 251, + 159, 158, 156, 157, 153, 178, 0, 90, 91, 94, + 219, 212, 0, 0, 56, 219, 44, 45, 43, 0, + 0, 0, 108, 116, 119, 117, 192, 193, 118, 253, + 0, 32, 33, 34, 35, 36, 29, 28, 163, 138, + 140, 137, 0, 135, 136, 0, 184, 183, 168, 0, + 60, 58, 61, 59, 0, 0, 0, 120, 170, 219, + 107, 249, 141, 139, 145, 146, 219, 213, 219, 0, + 0, 0, 169, 109, 0, 0, 0, 195, 0, 199, + 0, 214, 219, 194, 0, 198, 0, 0, 42, 196, + 200, 0, 0, 171 +}; + +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = +{ + -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 265, 366, + 39, 146, 71, 58, 67, 312, 313, 348, 114, 59, + 115, 252, 253, 254, 344, 381, 383, 68, 311, 105, + 263, 194, 97, 40, 41, 116, 189, 306, 248, 304, + 157, 42, 43, 44, 131, 83, 258, 351, 132, 117, + 352, 353, 118, 170, 282, 171, 373, 393, 172, 225, + 173, 394, 174, 298, 283, 274, 175, 301, 334, 176, + 220, 177, 272, 178, 238, 179, 387, 402, 180, 293, + 294, 336, 235, 286, 287, 328, 326, 119, 355, 356, + 406, 120, 357, 408, 121, 268, 270, 358, 122, 136, + 123, 124, 138, 72, 45, 55, 46, 50, 77, 47, + 60, 91, 142, 203, 226, 213, 144, 317, 240, 205, + 360, 296, 48 +}; + +/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing + STATE-NUM. */ +#define YYPACT_NINF -371 +static const yytype_int16 yypact[] = +{ + 159, -371, -371, 34, -371, -371, 66, 11, -371, 140, + -22, -371, 25, 37, 51, 53, -371, -371, -28, -28, + -28, -28, -28, -28, 74, 102, -28, -371, 80, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + 82, -371, -371, -371, -371, -371, -371, -371, -371, -371, + 120, -6, 107, 108, 91, 120, 61, -371, 93, 105, + -371, 114, 115, 116, 117, 118, -371, 119, 87, -371, + -371, -371, -15, 121, -371, -371, -371, 122, 129, -17, + 160, 201, -3, -371, 122, 21, -371, -371, -371, -371, + 124, -371, 102, -371, -371, -371, -371, -371, 102, 102, + 102, 102, 102, 102, -371, -371, -371, -371, 68, 72, + 8, -11, 126, 102, 99, 127, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -15, 135, -371, -371, -371, + -371, 130, -371, -371, -371, -371, -371, -371, -371, 185, + -371, -371, 48, 207, -371, 136, 137, -15, 138, -371, + 139, -371, -371, 64, -371, -371, 124, -371, 141, 142, + 143, 9, 144, 88, 145, 83, 86, 24, 146, 124, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + 175, 64, -371, 147, -371, -371, 124, 148, 150, -371, + 73, -371, -371, -371, -371, -10, 152, -371, 151, -371, + -371, -371, -371, -371, -371, 153, 102, 102, 155, 171, + 102, -371, -371, -371, -371, 219, 232, 235, -371, -371, + -371, 237, -371, -371, -371, -371, 194, 237, 0, 161, + 239, -371, 163, -371, 124, -14, -371, -371, -371, 243, + 238, 58, 166, -371, 246, -371, 247, 246, -371, 102, + -371, -371, 168, -371, -371, 176, 102, 167, -371, -371, + -371, -371, -371, -371, 173, 172, 177, -371, 174, -371, + 178, -371, 179, -371, 180, -371, 181, -371, -371, -371, + -371, -371, -371, -371, 253, -371, -371, -371, 256, -371, + -371, -371, -371, -371, -371, -371, 182, -371, -371, -371, + -371, 125, 257, -371, 183, -371, 186, 187, 76, -371, + -371, 106, -371, 190, -7, 26, 265, -371, 103, 102, + -371, -371, 236, 36, 83, -371, 189, -371, 191, -371, + -371, -371, -371, -371, -371, -371, 192, -371, -371, -371, + 102, -371, 273, 274, -371, 102, -371, -371, -371, 90, + 8, 77, -371, -371, -371, -371, -371, -371, -371, -371, + 195, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, 267, -371, -371, 15, -371, -371, -371, 78, + -371, -371, -371, -371, 199, 200, 202, -371, 240, 26, + -371, -371, -371, -371, -371, -371, 102, -371, 102, 219, + 232, 203, -371, -371, 193, 206, 208, 205, 209, 215, + 257, -371, 102, -371, 219, -371, 232, 41, -371, -371, + -371, 257, 211, -371 +}; + +/* YYPGOTO[NTERM-NUM]. */ +static const yytype_int16 yypgoto[] = +{ + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -371, -94, -88, 149, -371, -371, -326, -371, -92, -371, + -371, -371, -371, -371, -371, -371, -371, 123, -371, -371, + -371, -371, -371, -371, -371, 241, -371, -371, -371, 70, + -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, + -74, -371, -81, -371, -371, -371, -371, -371, -371, -371, + -371, -371, -371, -371, -295, 92, -371, -371, -371, -371, + -371, -371, -371, -371, -371, -371, -371, -371, -29, -371, + -371, -368, -371, -371, -371, -371, -371, 242, -371, -371, + -371, -371, -371, -371, -371, -370, -306, 244, -371, -371, + -371, -80, -110, -82, -371, -371, -371, -371, 268, -371, + 245, -371, -371, -371, -160, 154, -146, -371, -371, -371, + -371, -371, -371 +}; + +/* 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 -53 +static const yytype_int16 yytable[] = +{ + 139, 133, 137, 190, 145, 228, 149, 106, 107, 152, + 214, 148, 251, 150, 151, 346, 147, 181, 147, 384, + 108, 147, 108, 241, 277, 182, 290, 291, 374, 407, + 278, 139, 279, 196, 5, 160, 56, 218, 183, 277, + 245, 184, 417, 161, 419, 278, 109, 140, 185, 236, + 162, 163, 164, 422, 165, 208, 166, 110, 109, 141, + 277, 369, 186, 57, 219, 167, 278, 292, 280, 110, + 281, 111, 405, 111, 7, 370, 112, 49, 187, 188, + 395, 66, 168, 169, 347, 281, 418, 349, 289, 85, + 86, 113, 299, 237, 409, 371, 153, 87, 350, 78, + 69, 70, 10, 113, 154, 158, 281, 372, 201, 223, + 420, 300, 222, 261, 223, 202, 51, 159, 260, 88, + 89, 224, 266, 385, 211, 147, 224, 155, 52, 69, + 70, 212, 113, 229, 90, 386, 230, 231, 421, 308, + 232, 156, 53, 378, 54, 11, 12, 13, 233, 14, + 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 1, 2, 375, 66, 234, 139, 61, 62, + 63, 64, 65, 249, 314, 73, 340, 389, 396, 74, + 250, 75, 104, 341, 390, 397, 361, 362, 363, 364, + 365, 191, 81, 92, 192, 193, 82, 93, 94, 95, + 96, 330, 331, 332, 333, 69, 70, 199, 200, 342, + 343, 76, 79, 80, 98, 99, 100, 101, 102, 103, + 127, 125, 126, 130, 56, 143, 197, -52, 195, 204, + 379, 367, 198, 139, 354, 137, 206, 207, 209, 210, + 242, 267, 215, 216, 217, 221, 227, 239, 244, 246, + 262, 247, 256, 264, 269, 259, 257, 271, 139, 273, + 275, 285, 284, 314, 288, 295, 297, 302, 303, 305, + 309, 310, 318, 315, 316, 325, 320, 319, 327, 335, + 321, 322, 323, 324, 329, 337, 404, 359, 338, 339, + 345, 376, 368, 377, 378, 380, 382, 391, 392, 398, + 411, 399, 414, 400, 410, 401, 412, 139, 354, 137, + 413, 415, 416, 423, 139, 403, 314, 307, 255, 276, + 128, 388, 0, 84, 134, 129, 135, 0, 0, 0, + 314, 0, 0, 0, 0, 243 +}; + +static const yytype_int16 yycheck[] = +{ + 82, 82, 82, 113, 92, 165, 100, 22, 23, 103, + 156, 99, 22, 101, 102, 22, 98, 28, 100, 345, + 37, 103, 37, 169, 24, 36, 40, 41, 323, 399, + 30, 113, 32, 125, 0, 27, 64, 28, 49, 24, + 186, 52, 410, 35, 414, 30, 61, 26, 59, 25, + 42, 43, 44, 421, 46, 147, 48, 72, 61, 38, + 24, 25, 73, 91, 55, 57, 30, 81, 68, 72, + 70, 88, 398, 88, 8, 39, 91, 99, 89, 90, + 375, 91, 74, 75, 91, 70, 412, 61, 234, 28, + 29, 106, 34, 69, 400, 59, 28, 36, 72, 105, + 103, 104, 91, 106, 36, 33, 70, 71, 60, 26, + 416, 53, 24, 207, 26, 67, 91, 45, 206, 58, + 59, 38, 210, 33, 60, 207, 38, 59, 91, 103, + 104, 67, 106, 47, 73, 45, 50, 51, 97, 249, + 54, 73, 91, 102, 91, 5, 6, 7, 62, 9, + 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, + 20, 21, 3, 4, 324, 91, 80, 249, 19, 20, + 21, 22, 23, 100, 256, 26, 100, 100, 100, 99, + 107, 99, 95, 107, 107, 107, 83, 84, 85, 86, + 87, 92, 101, 100, 95, 96, 105, 92, 93, 94, + 95, 76, 77, 78, 79, 103, 104, 22, 23, 103, + 104, 91, 105, 105, 100, 100, 100, 100, 100, 100, + 91, 100, 100, 22, 64, 101, 91, 101, 101, 22, + 340, 319, 102, 315, 315, 315, 100, 100, 100, 100, + 65, 22, 101, 101, 101, 101, 101, 101, 101, 101, + 95, 101, 100, 82, 22, 102, 105, 22, 340, 22, + 66, 22, 101, 345, 101, 22, 28, 101, 22, 22, + 102, 95, 100, 106, 101, 22, 102, 100, 22, 22, + 102, 102, 102, 102, 102, 102, 396, 22, 102, 102, + 100, 102, 56, 102, 102, 22, 22, 102, 31, 100, + 107, 101, 97, 101, 101, 65, 100, 389, 389, 389, + 102, 102, 97, 102, 396, 389, 398, 247, 195, 227, + 79, 350, -1, 55, 82, 80, 82, -1, -1, -1, + 412, -1, -1, -1, -1, 181 +}; + +/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing + symbol of state STATE-NUM. */ +static const yytype_uint8 yystos[] = +{ + 0, 3, 4, 109, 110, 0, 111, 8, 112, 113, + 91, 5, 6, 7, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 114, 115, 116, + 117, 118, 119, 120, 121, 122, 123, 124, 125, 128, + 151, 152, 159, 160, 161, 222, 224, 227, 240, 99, + 225, 91, 91, 91, 91, 223, 64, 91, 131, 137, + 228, 131, 131, 131, 131, 131, 91, 132, 145, 103, + 104, 130, 221, 131, 99, 99, 91, 226, 105, 105, + 105, 101, 105, 163, 226, 28, 29, 36, 58, 59, + 73, 229, 100, 92, 93, 94, 95, 150, 100, 100, + 100, 100, 100, 100, 95, 147, 22, 23, 37, 61, + 72, 88, 91, 106, 136, 138, 153, 167, 170, 205, + 209, 212, 216, 218, 219, 100, 100, 91, 153, 228, + 22, 162, 166, 170, 205, 215, 217, 219, 220, 221, + 26, 38, 230, 101, 234, 130, 129, 221, 130, 129, + 130, 130, 129, 28, 36, 59, 73, 158, 33, 45, + 27, 35, 42, 43, 44, 46, 48, 57, 74, 75, + 171, 173, 176, 178, 180, 184, 187, 189, 191, 193, + 196, 28, 36, 49, 52, 59, 73, 89, 90, 154, + 220, 92, 95, 96, 149, 101, 136, 91, 102, 22, + 23, 60, 67, 231, 22, 237, 100, 100, 136, 100, + 100, 60, 67, 233, 234, 101, 101, 101, 28, 55, + 188, 101, 24, 26, 38, 177, 232, 101, 232, 47, + 50, 51, 54, 62, 80, 200, 25, 69, 192, 101, + 236, 234, 65, 233, 101, 234, 101, 101, 156, 100, + 107, 22, 139, 140, 141, 145, 100, 105, 164, 102, + 130, 129, 95, 148, 82, 126, 130, 22, 213, 22, + 214, 22, 190, 22, 183, 66, 183, 24, 30, 32, + 68, 70, 172, 182, 101, 22, 201, 202, 101, 234, + 40, 41, 81, 197, 198, 22, 239, 28, 181, 34, + 53, 185, 101, 22, 157, 22, 155, 157, 220, 102, + 95, 146, 133, 134, 221, 106, 101, 235, 100, 100, + 102, 102, 102, 102, 102, 22, 204, 22, 203, 102, + 76, 77, 78, 79, 186, 22, 199, 102, 102, 102, + 100, 107, 103, 104, 142, 100, 22, 91, 135, 61, + 72, 165, 168, 169, 170, 206, 207, 210, 215, 22, + 238, 83, 84, 85, 86, 87, 127, 130, 56, 25, + 39, 59, 71, 174, 182, 232, 102, 102, 102, 220, + 22, 143, 22, 144, 134, 33, 45, 194, 196, 100, + 107, 102, 31, 175, 179, 182, 100, 107, 100, 101, + 101, 65, 195, 168, 220, 134, 208, 213, 211, 214, + 101, 107, 100, 102, 97, 102, 97, 199, 134, 213, + 214, 97, 199, 102 +}; + +#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 (&yylloc, state, 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, &yylloc, YYLEX_PARAM) +#else +# define YYLEX yylex (&yylval, &yylloc, scanner) +#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, Location, state); \ + 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, YYLTYPE const * const yylocationp, struct asm_parser_state *state) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, state) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + YYLTYPE const * const yylocationp; + struct asm_parser_state *state; +#endif +{ + if (!yyvaluep) + return; + YYUSE (yylocationp); + YYUSE (state); +# 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, YYLTYPE const * const yylocationp, struct asm_parser_state *state) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep, yylocationp, state) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; + YYLTYPE const * const yylocationp; + struct asm_parser_state *state; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + YY_LOCATION_PRINT (yyoutput, *yylocationp); + YYFPRINTF (yyoutput, ": "); + yy_symbol_value_print (yyoutput, yytype, yyvaluep, yylocationp, state); + 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, YYLTYPE *yylsp, int yyrule, struct asm_parser_state *state) +#else +static void +yy_reduce_print (yyvsp, yylsp, yyrule, state) + YYSTYPE *yyvsp; + YYLTYPE *yylsp; + int yyrule; + struct asm_parser_state *state; +#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)]) + , &(yylsp[(yyi + 1) - (yynrhs)]) , state); + YYFPRINTF (stderr, "\n"); + } +} + +# define YY_REDUCE_PRINT(Rule) \ +do { \ + if (yydebug) \ + yy_reduce_print (yyvsp, yylsp, Rule, state); \ +} 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, YYLTYPE *yylocationp, struct asm_parser_state *state) +#else +static void +yydestruct (yymsg, yytype, yyvaluep, yylocationp, state) + const char *yymsg; + int yytype; + YYSTYPE *yyvaluep; + YYLTYPE *yylocationp; + struct asm_parser_state *state; +#endif +{ + YYUSE (yyvaluep); + YYUSE (yylocationp); + YYUSE (state); + + 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 (struct asm_parser_state *state); +#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 (struct asm_parser_state *state) +#else +int +yyparse (state) + struct asm_parser_state *state; +#endif +#endif +{ +/* The lookahead symbol. */ +int yychar; + +/* The semantic value of the lookahead symbol. */ +YYSTYPE yylval; + +/* Location data for the lookahead symbol. */ +YYLTYPE yylloc; + + /* Number of syntax errors so far. */ + int yynerrs; + + int yystate; + /* Number of tokens to shift before error messages enabled. */ + int yyerrstatus; + + /* The stacks and their tools: + `yyss': related to states. + `yyvs': related to semantic values. + `yyls': related to locations. + + Refer to the stacks thru separate pointers, to allow yyoverflow + to reallocate them elsewhere. */ + + /* The state stack. */ + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss; + yytype_int16 *yyssp; + + /* The semantic value stack. */ + YYSTYPE yyvsa[YYINITDEPTH]; + YYSTYPE *yyvs; + YYSTYPE *yyvsp; + + /* The location stack. */ + YYLTYPE yylsa[YYINITDEPTH]; + YYLTYPE *yyls; + YYLTYPE *yylsp; + + /* The locations where the error started and ended. */ + YYLTYPE yyerror_range[2]; + + YYSIZE_T yystacksize; + + int yyn; + int yyresult; + /* Lookahead token as an internal (translated) token number. */ + int yytoken; + /* The variables used to return semantic value and location from the + action routines. */ + YYSTYPE yyval; + YYLTYPE yyloc; + +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif + +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N), yylsp -= (N)) + + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; + + yytoken = 0; + yyss = yyssa; + yyvs = yyvsa; + yyls = yylsa; + yystacksize = YYINITDEPTH; + + YYDPRINTF ((stderr, "Starting parse\n")); + + yystate = 0; + yyerrstatus = 0; + yynerrs = 0; + yychar = YYEMPTY; /* Cause a token to be read. */ + + /* Initialize stack pointers. + Waste one element of value and location stack + so that they stay on the same level as the state stack. + The wasted elements are never initialized. */ + yyssp = yyss; + yyvsp = yyvs; + yylsp = yyls; + +#if YYLTYPE_IS_TRIVIAL + /* Initialize the default location before parsing starts. */ + yylloc.first_line = yylloc.last_line = 1; + yylloc.first_column = yylloc.last_column = 1; +#endif + + 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; + YYLTYPE *yyls1 = yyls; + + /* 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), + &yyls1, yysize * sizeof (*yylsp), + &yystacksize); + + yyls = yyls1; + 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); + YYSTACK_RELOCATE (yyls_alloc, yyls); +# undef YYSTACK_RELOCATE + if (yyss1 != yyssa) + YYSTACK_FREE (yyss1); + } +# endif +#endif /* no yyoverflow */ + + yyssp = yyss + yysize - 1; + yyvsp = yyvs + yysize - 1; + yylsp = yyls + 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; + *++yylsp = yylloc; + 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]; + + /* Default location. */ + YYLLOC_DEFAULT (yyloc, (yylsp - yylen), yylen); + YY_REDUCE_PRINT (yyn); + switch (yyn) + { + case 3: + +/* Line 1455 of yacc.c */ +#line 244 "program_parse.y" + { + if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); + + } + state->mode = ARB_vertex; + ;} + break; + + case 4: + +/* Line 1455 of yacc.c */ +#line 252 "program_parse.y" + { + if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); + } + state->mode = ARB_fragment; + ;} + break; + + case 7: + +/* Line 1455 of yacc.c */ +#line 265 "program_parse.y" + { + int valid = 0; + + if (state->mode == ARB_vertex) { + valid = _mesa_ARBvp_parse_option(state, (yyvsp[(2) - (3)].string)); + } else if (state->mode == ARB_fragment) { + valid = _mesa_ARBfp_parse_option(state, (yyvsp[(2) - (3)].string)); + } + + + if (!valid) { + yyerror(& (yylsp[(2) - (3)]), state, "invalid option string"); + YYERROR; + } + ;} + break; + + case 10: + +/* Line 1455 of yacc.c */ +#line 287 "program_parse.y" + { + if ((yyvsp[(1) - (2)].inst) != NULL) { + if (state->inst_tail == NULL) { + state->inst_head = (yyvsp[(1) - (2)].inst); + } else { + state->inst_tail->next = (yyvsp[(1) - (2)].inst); + } + + state->inst_tail = (yyvsp[(1) - (2)].inst); + (yyvsp[(1) - (2)].inst)->next = NULL; + + state->prog->NumInstructions++; + } + ;} + break; + + case 23: + +/* Line 1455 of yacc.c */ +#line 322 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); + ;} + break; + + case 24: + +/* Line 1455 of yacc.c */ +#line 328 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + ;} + break; + + case 25: + +/* Line 1455 of yacc.c */ +#line 335 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; + ;} + break; + + case 26: + +/* Line 1455 of yacc.c */ +#line 342 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + ;} + break; + + case 27: + +/* Line 1455 of yacc.c */ +#line 350 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + ;} + break; + + case 28: + +/* Line 1455 of yacc.c */ +#line 358 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; + ;} + break; + + case 29: + +/* Line 1455 of yacc.c */ +#line 365 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); + if ((yyval.inst) != NULL) { + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; + (yyval.inst)->Base.TexSrcUnit = (yyvsp[(6) - (8)].integer); + (yyval.inst)->Base.TexSrcTarget = (yyvsp[(8) - (8)].integer); + } + ;} + break; + + case 30: + +/* Line 1455 of yacc.c */ +#line 376 "program_parse.y" + { + (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); + ;} + break; + + case 31: + +/* Line 1455 of yacc.c */ +#line 382 "program_parse.y" + { + (yyval.integer) = (yyvsp[(2) - (2)].integer); + ;} + break; + + case 32: + +/* Line 1455 of yacc.c */ +#line 387 "program_parse.y" + { (yyval.integer) = TEXTURE_1D_INDEX; ;} + break; + + case 33: + +/* Line 1455 of yacc.c */ +#line 388 "program_parse.y" + { (yyval.integer) = TEXTURE_2D_INDEX; ;} + break; + + case 34: + +/* Line 1455 of yacc.c */ +#line 389 "program_parse.y" + { (yyval.integer) = TEXTURE_3D_INDEX; ;} + break; + + case 35: + +/* Line 1455 of yacc.c */ +#line 390 "program_parse.y" + { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} + break; + + case 36: + +/* Line 1455 of yacc.c */ +#line 391 "program_parse.y" + { (yyval.integer) = TEXTURE_RECT_INDEX; ;} + break; + + case 37: + +/* Line 1455 of yacc.c */ +#line 395 "program_parse.y" + { + /* FIXME: Is this correct? Should the extenedSwizzle be applied + * FIXME: to the existing swizzle? + */ + (yyvsp[(4) - (6)].src_reg).Base.Swizzle = (yyvsp[(6) - (6)].swiz_mask).swizzle; + + (yyval.inst) = asm_instruction_ctor(OPCODE_SWZ, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; + ;} + break; + + case 38: + +/* Line 1455 of yacc.c */ +#line 407 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + + if ((yyvsp[(1) - (3)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(3) - (3)].swiz_mask).swizzle); + ;} + break; + + case 39: + +/* Line 1455 of yacc.c */ +#line 420 "program_parse.y" + { + (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); + + if ((yyvsp[(1) - (3)].negate)) { + (yyval.src_reg).Base.Negate = ~(yyval.src_reg).Base.Negate; + } + + (yyval.src_reg).Base.Swizzle = _mesa_combine_swizzles((yyval.src_reg).Base.Swizzle, + (yyvsp[(3) - (3)].swiz_mask).swizzle); + ;} + break; + + case 40: + +/* Line 1455 of yacc.c */ +#line 433 "program_parse.y" + { + (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); + (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; + + if ((yyval.dst_reg).File == PROGRAM_OUTPUT) { + /* Technically speaking, this should check that it is in + * vertex program mode. However, PositionInvariant can never be + * set in fragment program mode, so it is somewhat irrelevant. + */ + if (state->option.PositionInvariant + && ((yyval.dst_reg).Index == VERT_RESULT_HPOS)) { + yyerror(& (yylsp[(1) - (2)]), state, "position-invariant programs cannot " + "write position"); + YYERROR; + } + + state->prog->OutputsWritten |= (1U << (yyval.dst_reg).Index); + } + ;} + break; + + case 41: + +/* Line 1455 of yacc.c */ +#line 455 "program_parse.y" + { + init_dst_reg(& (yyval.dst_reg)); + (yyval.dst_reg).File = PROGRAM_ADDRESS; + (yyval.dst_reg).Index = 0; + (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; + ;} + break; + + case 42: + +/* Line 1455 of yacc.c */ +#line 464 "program_parse.y" + { + (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, + (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); + (yyval.swiz_mask).mask = ((yyvsp[(1) - (7)].swiz_mask).mask) | ((yyvsp[(3) - (7)].swiz_mask).mask << 1) | ((yyvsp[(5) - (7)].swiz_mask).mask << 2) + | ((yyvsp[(7) - (7)].swiz_mask).mask << 3); + ;} + break; + + case 43: + +/* Line 1455 of yacc.c */ +#line 473 "program_parse.y" + { + (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); + (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; + ;} + break; + + case 44: + +/* Line 1455 of yacc.c */ +#line 480 "program_parse.y" + { + if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); + YYERROR; + } + + (yyval.integer) = ((yyvsp[(1) - (1)].integer) == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; + ;} + break; + + case 45: + +/* Line 1455 of yacc.c */ +#line 489 "program_parse.y" + { + if (strlen((yyvsp[(1) - (1)].string)) > 1) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); + YYERROR; + } + + switch ((yyvsp[(1) - (1)].string)[0]) { + case 'x': + (yyval.integer) = SWIZZLE_X; + break; + case 'y': + (yyval.integer) = SWIZZLE_Y; + break; + case 'z': + (yyval.integer) = SWIZZLE_Z; + break; + case 'w': + (yyval.integer) = SWIZZLE_W; + break; + default: + yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); + YYERROR; + break; + } + ;} + break; + + case 46: + +/* Line 1455 of yacc.c */ +#line 517 "program_parse.y" + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + + if (s == NULL) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); + YYERROR; + } else if ((s->type != at_param) && (s->type != at_temp) + && (s->type != at_attrib)) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); + YYERROR; + } else if ((s->type == at_param) && s->param_is_array) { + yyerror(& (yylsp[(1) - (1)]), state, "non-array access to array PARAM"); + YYERROR; + } + + init_src_reg(& (yyval.src_reg)); + switch (s->type) { + case at_temp: + (yyval.src_reg).Base.File = PROGRAM_TEMPORARY; + (yyval.src_reg).Base.Index = s->temp_binding; + break; + case at_param: + (yyval.src_reg).Base.File = s->param_binding_type; + (yyval.src_reg).Base.Index = s->param_binding_begin; + break; + case at_attrib: + (yyval.src_reg).Base.File = PROGRAM_INPUT; + (yyval.src_reg).Base.Index = s->attrib_binding; + state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); + + if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { + YYERROR; + } + break; + + default: + YYERROR; + break; + } + ;} + break; + + case 47: + +/* Line 1455 of yacc.c */ +#line 559 "program_parse.y" + { + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.File = PROGRAM_INPUT; + (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].attrib); + state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); + + if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { + YYERROR; + } + ;} + break; + + case 48: + +/* Line 1455 of yacc.c */ +#line 570 "program_parse.y" + { + if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr + && ((yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { + yyerror(& (yylsp[(3) - (4)]), state, "out of bounds array access"); + YYERROR; + } + + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.File = (yyvsp[(1) - (4)].sym)->param_binding_type; + + if ((yyvsp[(3) - (4)].src_reg).Base.RelAddr) { + (yyvsp[(1) - (4)].sym)->param_accessed_indirectly = 1; + + (yyval.src_reg).Base.RelAddr = 1; + (yyval.src_reg).Base.Index = (yyvsp[(3) - (4)].src_reg).Base.Index; + (yyval.src_reg).Symbol = (yyvsp[(1) - (4)].sym); + } else { + (yyval.src_reg).Base.Index = (yyvsp[(1) - (4)].sym)->param_binding_begin + (yyvsp[(3) - (4)].src_reg).Base.Index; + } + ;} + break; + + case 49: + +/* Line 1455 of yacc.c */ +#line 591 "program_parse.y" + { + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.File = (yyvsp[(1) - (1)].temp_sym).param_binding_type; + (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].temp_sym).param_binding_begin; + ;} + break; + + case 50: + +/* Line 1455 of yacc.c */ +#line 599 "program_parse.y" + { + init_dst_reg(& (yyval.dst_reg)); + (yyval.dst_reg).File = PROGRAM_OUTPUT; + (yyval.dst_reg).Index = (yyvsp[(1) - (1)].result); + ;} + break; + + case 51: + +/* Line 1455 of yacc.c */ +#line 605 "program_parse.y" + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + + if (s == NULL) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); + YYERROR; + } else if ((s->type != at_output) && (s->type != at_temp)) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); + YYERROR; + } + + init_dst_reg(& (yyval.dst_reg)); + if (s->type == at_temp) { + (yyval.dst_reg).File = PROGRAM_TEMPORARY; + (yyval.dst_reg).Index = s->temp_binding; + } else { + (yyval.dst_reg).File = s->param_binding_type; + (yyval.dst_reg).Index = s->param_binding_begin; + } + ;} + break; + + case 52: + +/* Line 1455 of yacc.c */ +#line 629 "program_parse.y" + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + + if (s == NULL) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid operand variable"); + YYERROR; + } else if ((s->type != at_param) || !s->param_is_array) { + yyerror(& (yylsp[(1) - (1)]), state, "array access to non-PARAM variable"); + YYERROR; + } else { + (yyval.sym) = s; + } + ;} + break; + + case 55: + +/* Line 1455 of yacc.c */ +#line 648 "program_parse.y" + { + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 56: + +/* Line 1455 of yacc.c */ +#line 655 "program_parse.y" + { + /* FINISHME: Add support for multiple address registers. + */ + /* FINISHME: Add support for 4-component address registers. + */ + init_src_reg(& (yyval.src_reg)); + (yyval.src_reg).Base.RelAddr = 1; + (yyval.src_reg).Base.Index = (yyvsp[(3) - (3)].integer); + ;} + break; + + case 57: + +/* Line 1455 of yacc.c */ +#line 666 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 58: + +/* Line 1455 of yacc.c */ +#line 667 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} + break; + + case 59: + +/* Line 1455 of yacc.c */ +#line 668 "program_parse.y" + { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} + break; + + case 60: + +/* Line 1455 of yacc.c */ +#line 672 "program_parse.y" + { + if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { + yyerror(& (yylsp[(1) - (1)]), state, + "relative address offset too large (positive)"); + YYERROR; + } else { + (yyval.integer) = (yyvsp[(1) - (1)].integer); + } + ;} + break; + + case 61: + +/* Line 1455 of yacc.c */ +#line 684 "program_parse.y" + { + if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { + yyerror(& (yylsp[(1) - (1)]), state, + "relative address offset too large (negative)"); + YYERROR; + } else { + (yyval.integer) = (yyvsp[(1) - (1)].integer); + } + ;} + break; + + case 62: + +/* Line 1455 of yacc.c */ +#line 696 "program_parse.y" + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); + + if (s == NULL) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid array member"); + YYERROR; + } else if (s->type != at_address) { + yyerror(& (yylsp[(1) - (1)]), state, + "invalid variable for indexed array access"); + YYERROR; + } else { + (yyval.sym) = s; + } + ;} + break; + + case 63: + +/* Line 1455 of yacc.c */ +#line 714 "program_parse.y" + { + if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); + YYERROR; + } else { + (yyval.swiz_mask) = (yyvsp[(1) - (1)].swiz_mask); + } + ;} + break; + + case 64: + +/* Line 1455 of yacc.c */ +#line 725 "program_parse.y" + { + if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { + yyerror(& (yylsp[(1) - (1)]), state, + "address register write mask must be \".x\""); + YYERROR; + } else { + (yyval.swiz_mask) = (yyvsp[(1) - (1)].swiz_mask); + } + ;} + break; + + case 69: + +/* Line 1455 of yacc.c */ +#line 741 "program_parse.y" + { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} + break; + + case 74: + +/* Line 1455 of yacc.c */ +#line 745 "program_parse.y" + { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} + break; + + case 81: + +/* Line 1455 of yacc.c */ +#line 757 "program_parse.y" + { + struct asm_symbol *const s = + declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); + + if (s == NULL) { + YYERROR; + } else { + s->attrib_binding = (yyvsp[(4) - (4)].attrib); + state->InputsBound |= (1U << s->attrib_binding); + + if (!validate_inputs(& (yylsp[(4) - (4)]), state)) { + YYERROR; + } + } + ;} + break; + + case 82: + +/* Line 1455 of yacc.c */ +#line 775 "program_parse.y" + { + (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + ;} + break; + + case 83: + +/* Line 1455 of yacc.c */ +#line 779 "program_parse.y" + { + (yyval.attrib) = (yyvsp[(2) - (2)].attrib); + ;} + break; + + case 84: + +/* Line 1455 of yacc.c */ +#line 785 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_POS; + ;} + break; + + case 85: + +/* Line 1455 of yacc.c */ +#line 789 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_WEIGHT; + ;} + break; + + case 86: + +/* Line 1455 of yacc.c */ +#line 793 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_NORMAL; + ;} + break; + + case 87: + +/* Line 1455 of yacc.c */ +#line 797 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 88: + +/* Line 1455 of yacc.c */ +#line 801 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_FOG; + ;} + break; + + case 89: + +/* Line 1455 of yacc.c */ +#line 805 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 90: + +/* Line 1455 of yacc.c */ +#line 809 "program_parse.y" + { + YYERROR; + ;} + break; + + case 91: + +/* Line 1455 of yacc.c */ +#line 813 "program_parse.y" + { + (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); + ;} + break; + + case 92: + +/* Line 1455 of yacc.c */ +#line 819 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 96: + +/* Line 1455 of yacc.c */ +#line 833 "program_parse.y" + { + (yyval.attrib) = FRAG_ATTRIB_WPOS; + ;} + break; + + case 97: + +/* Line 1455 of yacc.c */ +#line 837 "program_parse.y" + { + (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 98: + +/* Line 1455 of yacc.c */ +#line 841 "program_parse.y" + { + (yyval.attrib) = FRAG_ATTRIB_FOGC; + ;} + break; + + case 99: + +/* Line 1455 of yacc.c */ +#line 845 "program_parse.y" + { + (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); + ;} + break; + + case 102: + +/* Line 1455 of yacc.c */ +#line 853 "program_parse.y" + { + struct asm_symbol *const s = + declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); + + if (s == NULL) { + YYERROR; + } else { + s->param_binding_type = (yyvsp[(3) - (3)].temp_sym).param_binding_type; + s->param_binding_begin = (yyvsp[(3) - (3)].temp_sym).param_binding_begin; + s->param_binding_length = (yyvsp[(3) - (3)].temp_sym).param_binding_length; + s->param_is_array = 0; + } + ;} + break; + + case 103: + +/* Line 1455 of yacc.c */ +#line 869 "program_parse.y" + { + if (((yyvsp[(4) - (6)].integer) != 0) && ((yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { + yyerror(& (yylsp[(4) - (6)]), state, + "parameter array size and number of bindings must match"); + YYERROR; + } else { + struct asm_symbol *const s = + declare_variable(state, (yyvsp[(2) - (6)].string), (yyvsp[(6) - (6)].temp_sym).type, & (yylsp[(2) - (6)])); + + if (s == NULL) { + YYERROR; + } else { + s->param_binding_type = (yyvsp[(6) - (6)].temp_sym).param_binding_type; + s->param_binding_begin = (yyvsp[(6) - (6)].temp_sym).param_binding_begin; + s->param_binding_length = (yyvsp[(6) - (6)].temp_sym).param_binding_length; + s->param_is_array = 1; + } + } + ;} + break; + + case 104: + +/* Line 1455 of yacc.c */ +#line 891 "program_parse.y" + { + (yyval.integer) = 0; + ;} + break; + + case 105: + +/* Line 1455 of yacc.c */ +#line 895 "program_parse.y" + { + if (((yyvsp[(1) - (1)].integer) < 1) || ((yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); + YYERROR; + } else { + (yyval.integer) = (yyvsp[(1) - (1)].integer); + } + ;} + break; + + case 106: + +/* Line 1455 of yacc.c */ +#line 906 "program_parse.y" + { + (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); + ;} + break; + + case 107: + +/* Line 1455 of yacc.c */ +#line 912 "program_parse.y" + { + (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); + ;} + break; + + case 109: + +/* Line 1455 of yacc.c */ +#line 919 "program_parse.y" + { + (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; + (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); + ;} + break; + + case 110: + +/* Line 1455 of yacc.c */ +#line 926 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[(1) - (1)].state)); + ;} + break; + + case 111: + +/* Line 1455 of yacc.c */ +#line 932 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[(1) - (1)].state)); + ;} + break; + + case 112: + +/* Line 1455 of yacc.c */ +#line 938 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[(1) - (1)].vector)); + ;} + break; + + case 113: + +/* Line 1455 of yacc.c */ +#line 946 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[(1) - (1)].state)); + ;} + break; + + case 114: + +/* Line 1455 of yacc.c */ +#line 952 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[(1) - (1)].state)); + ;} + break; + + case 115: + +/* Line 1455 of yacc.c */ +#line 958 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[(1) - (1)].vector)); + ;} + break; + + case 116: + +/* Line 1455 of yacc.c */ +#line 966 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_state(state->prog, & (yyval.temp_sym), (yyvsp[(1) - (1)].state)); + ;} + break; + + case 117: + +/* Line 1455 of yacc.c */ +#line 972 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_param(state->prog, & (yyval.temp_sym), (yyvsp[(1) - (1)].state)); + ;} + break; + + case 118: + +/* Line 1455 of yacc.c */ +#line 978 "program_parse.y" + { + memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); + (yyval.temp_sym).param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & (yyval.temp_sym), & (yyvsp[(1) - (1)].vector)); + ;} + break; + + case 119: + +/* Line 1455 of yacc.c */ +#line 985 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} + break; + + case 120: + +/* Line 1455 of yacc.c */ +#line 986 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 121: + +/* Line 1455 of yacc.c */ +#line 989 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 122: + +/* Line 1455 of yacc.c */ +#line 990 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 123: + +/* Line 1455 of yacc.c */ +#line 991 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 124: + +/* Line 1455 of yacc.c */ +#line 992 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 125: + +/* Line 1455 of yacc.c */ +#line 993 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 126: + +/* Line 1455 of yacc.c */ +#line 994 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 127: + +/* Line 1455 of yacc.c */ +#line 995 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 128: + +/* Line 1455 of yacc.c */ +#line 996 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 129: + +/* Line 1455 of yacc.c */ +#line 997 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 130: + +/* Line 1455 of yacc.c */ +#line 998 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 131: + +/* Line 1455 of yacc.c */ +#line 1002 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_MATERIAL; + (yyval.state)[1] = (yyvsp[(2) - (3)].integer); + (yyval.state)[2] = (yyvsp[(3) - (3)].integer); + ;} + break; + + case 132: + +/* Line 1455 of yacc.c */ +#line 1011 "program_parse.y" + { + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 133: + +/* Line 1455 of yacc.c */ +#line 1015 "program_parse.y" + { + (yyval.integer) = STATE_EMISSION; + ;} + break; + + case 134: + +/* Line 1455 of yacc.c */ +#line 1019 "program_parse.y" + { + (yyval.integer) = STATE_SHININESS; + ;} + break; + + case 135: + +/* Line 1455 of yacc.c */ +#line 1025 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_LIGHT; + (yyval.state)[1] = (yyvsp[(3) - (5)].integer); + (yyval.state)[2] = (yyvsp[(5) - (5)].integer); + ;} + break; + + case 136: + +/* Line 1455 of yacc.c */ +#line 1034 "program_parse.y" + { + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 137: + +/* Line 1455 of yacc.c */ +#line 1038 "program_parse.y" + { + (yyval.integer) = STATE_POSITION; + ;} + break; + + case 138: + +/* Line 1455 of yacc.c */ +#line 1042 "program_parse.y" + { + (yyval.integer) = STATE_ATTENUATION; + ;} + break; + + case 139: + +/* Line 1455 of yacc.c */ +#line 1046 "program_parse.y" + { + (yyval.integer) = (yyvsp[(2) - (2)].integer); + ;} + break; + + case 140: + +/* Line 1455 of yacc.c */ +#line 1050 "program_parse.y" + { + (yyval.integer) = STATE_HALF_VECTOR; + ;} + break; + + case 141: + +/* Line 1455 of yacc.c */ +#line 1056 "program_parse.y" + { + (yyval.integer) = STATE_SPOT_DIRECTION; + ;} + break; + + case 142: + +/* Line 1455 of yacc.c */ +#line 1062 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; + (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; + ;} + break; + + case 143: + +/* Line 1455 of yacc.c */ +#line 1069 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; + ;} + break; + + case 144: + +/* Line 1455 of yacc.c */ +#line 1074 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; + (yyval.state)[1] = (yyvsp[(1) - (2)].integer); + ;} + break; + + case 145: + +/* Line 1455 of yacc.c */ +#line 1082 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_LIGHTPROD; + (yyval.state)[1] = (yyvsp[(3) - (6)].integer); + (yyval.state)[2] = (yyvsp[(5) - (6)].integer); + (yyval.state)[3] = (yyvsp[(6) - (6)].integer); + ;} + break; + + case 147: + +/* Line 1455 of yacc.c */ +#line 1094 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = (yyvsp[(3) - (3)].integer); + (yyval.state)[1] = (yyvsp[(2) - (3)].integer); + ;} + break; + + case 148: + +/* Line 1455 of yacc.c */ +#line 1102 "program_parse.y" + { + (yyval.integer) = STATE_TEXENV_COLOR; + ;} + break; + + case 149: + +/* Line 1455 of yacc.c */ +#line 1108 "program_parse.y" + { + (yyval.integer) = STATE_AMBIENT; + ;} + break; + + case 150: + +/* Line 1455 of yacc.c */ +#line 1112 "program_parse.y" + { + (yyval.integer) = STATE_DIFFUSE; + ;} + break; + + case 151: + +/* Line 1455 of yacc.c */ +#line 1116 "program_parse.y" + { + (yyval.integer) = STATE_SPECULAR; + ;} + break; + + case 152: + +/* Line 1455 of yacc.c */ +#line 1122 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->MaxLights) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 153: + +/* Line 1455 of yacc.c */ +#line 1133 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_TEXGEN; + (yyval.state)[1] = (yyvsp[(2) - (4)].integer); + (yyval.state)[2] = (yyvsp[(3) - (4)].integer) + (yyvsp[(4) - (4)].integer); + ;} + break; + + case 154: + +/* Line 1455 of yacc.c */ +#line 1142 "program_parse.y" + { + (yyval.integer) = STATE_TEXGEN_EYE_S; + ;} + break; + + case 155: + +/* Line 1455 of yacc.c */ +#line 1146 "program_parse.y" + { + (yyval.integer) = STATE_TEXGEN_OBJECT_S; + ;} + break; + + case 156: + +/* Line 1455 of yacc.c */ +#line 1151 "program_parse.y" + { + (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; + ;} + break; + + case 157: + +/* Line 1455 of yacc.c */ +#line 1155 "program_parse.y" + { + (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; + ;} + break; + + case 158: + +/* Line 1455 of yacc.c */ +#line 1159 "program_parse.y" + { + (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; + ;} + break; + + case 159: + +/* Line 1455 of yacc.c */ +#line 1163 "program_parse.y" + { + (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; + ;} + break; + + case 160: + +/* Line 1455 of yacc.c */ +#line 1169 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = (yyvsp[(2) - (2)].integer); + ;} + break; + + case 161: + +/* Line 1455 of yacc.c */ +#line 1176 "program_parse.y" + { + (yyval.integer) = STATE_FOG_COLOR; + ;} + break; + + case 162: + +/* Line 1455 of yacc.c */ +#line 1180 "program_parse.y" + { + (yyval.integer) = STATE_FOG_PARAMS; + ;} + break; + + case 163: + +/* Line 1455 of yacc.c */ +#line 1186 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_CLIPPLANE; + (yyval.state)[1] = (yyvsp[(3) - (5)].integer); + ;} + break; + + case 164: + +/* Line 1455 of yacc.c */ +#line 1194 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 165: + +/* Line 1455 of yacc.c */ +#line 1205 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = (yyvsp[(2) - (2)].integer); + ;} + break; + + case 166: + +/* Line 1455 of yacc.c */ +#line 1212 "program_parse.y" + { + (yyval.integer) = STATE_POINT_SIZE; + ;} + break; + + case 167: + +/* Line 1455 of yacc.c */ +#line 1216 "program_parse.y" + { + (yyval.integer) = STATE_POINT_ATTENUATION; + ;} + break; + + case 168: + +/* Line 1455 of yacc.c */ +#line 1222 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; + (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; + (yyval.state)[2] = (yyvsp[(4) - (5)].integer); + (yyval.state)[3] = (yyvsp[(4) - (5)].integer); + (yyval.state)[4] = (yyvsp[(1) - (5)].state)[2]; + ;} + break; + + case 169: + +/* Line 1455 of yacc.c */ +#line 1232 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; + (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; + (yyval.state)[2] = (yyvsp[(2) - (2)].state)[2]; + (yyval.state)[3] = (yyvsp[(2) - (2)].state)[3]; + (yyval.state)[4] = (yyvsp[(1) - (2)].state)[2]; + ;} + break; + + case 170: + +/* Line 1455 of yacc.c */ +#line 1242 "program_parse.y" + { + (yyval.state)[2] = 0; + (yyval.state)[3] = 3; + ;} + break; + + case 171: + +/* Line 1455 of yacc.c */ +#line 1247 "program_parse.y" + { + /* It seems logical that the matrix row range specifier would have + * to specify a range or more than one row (i.e., $5 > $3). + * However, the ARB_vertex_program spec says "a program will fail + * to load if is greater than ." This means that $3 == $5 + * is valid. + */ + if ((yyvsp[(3) - (6)].integer) > (yyvsp[(5) - (6)].integer)) { + yyerror(& (yylsp[(3) - (6)]), state, "invalid matrix row range"); + YYERROR; + } + + (yyval.state)[2] = (yyvsp[(3) - (6)].integer); + (yyval.state)[3] = (yyvsp[(5) - (6)].integer); + ;} + break; + + case 172: + +/* Line 1455 of yacc.c */ +#line 1265 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; + (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; + (yyval.state)[2] = (yyvsp[(3) - (3)].integer); + ;} + break; + + case 173: + +/* Line 1455 of yacc.c */ +#line 1273 "program_parse.y" + { + (yyval.integer) = 0; + ;} + break; + + case 174: + +/* Line 1455 of yacc.c */ +#line 1277 "program_parse.y" + { + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 175: + +/* Line 1455 of yacc.c */ +#line 1283 "program_parse.y" + { + (yyval.integer) = STATE_MATRIX_INVERSE; + ;} + break; + + case 176: + +/* Line 1455 of yacc.c */ +#line 1287 "program_parse.y" + { + (yyval.integer) = STATE_MATRIX_TRANSPOSE; + ;} + break; + + case 177: + +/* Line 1455 of yacc.c */ +#line 1291 "program_parse.y" + { + (yyval.integer) = STATE_MATRIX_INVTRANS; + ;} + break; + + case 178: + +/* Line 1455 of yacc.c */ +#line 1297 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) > 3) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 179: + +/* Line 1455 of yacc.c */ +#line 1308 "program_parse.y" + { + (yyval.state)[0] = STATE_MODELVIEW_MATRIX; + (yyval.state)[1] = (yyvsp[(2) - (2)].integer); + ;} + break; + + case 180: + +/* Line 1455 of yacc.c */ +#line 1313 "program_parse.y" + { + (yyval.state)[0] = STATE_PROJECTION_MATRIX; + (yyval.state)[1] = 0; + ;} + break; + + case 181: + +/* Line 1455 of yacc.c */ +#line 1318 "program_parse.y" + { + (yyval.state)[0] = STATE_MVP_MATRIX; + (yyval.state)[1] = 0; + ;} + break; + + case 182: + +/* Line 1455 of yacc.c */ +#line 1323 "program_parse.y" + { + (yyval.state)[0] = STATE_TEXTURE_MATRIX; + (yyval.state)[1] = (yyvsp[(2) - (2)].integer); + ;} + break; + + case 183: + +/* Line 1455 of yacc.c */ +#line 1328 "program_parse.y" + { + YYERROR; + ;} + break; + + case 184: + +/* Line 1455 of yacc.c */ +#line 1332 "program_parse.y" + { + (yyval.state)[0] = STATE_PROGRAM_MATRIX; + (yyval.state)[1] = (yyvsp[(3) - (4)].integer); + ;} + break; + + case 185: + +/* Line 1455 of yacc.c */ +#line 1339 "program_parse.y" + { + (yyval.integer) = 0; + ;} + break; + + case 186: + +/* Line 1455 of yacc.c */ +#line 1343 "program_parse.y" + { + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 187: + +/* Line 1455 of yacc.c */ +#line 1348 "program_parse.y" + { + /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix + * zero is valid. + */ + if ((yyvsp[(1) - (1)].integer) != 0) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid modelview matrix index"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 188: + +/* Line 1455 of yacc.c */ +#line 1361 "program_parse.y" + { + /* Since GL_ARB_matrix_palette isn't supported, just let any value + * through here. The error will be generated later. + */ + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 189: + +/* Line 1455 of yacc.c */ +#line 1369 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 194: + +/* Line 1455 of yacc.c */ +#line 1386 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = state->state_param_enum; + (yyval.state)[1] = STATE_ENV; + (yyval.state)[2] = (yyvsp[(4) - (5)].state)[0]; + (yyval.state)[3] = (yyvsp[(4) - (5)].state)[1]; + ;} + break; + + case 195: + +/* Line 1455 of yacc.c */ +#line 1396 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(1) - (1)].integer); + (yyval.state)[1] = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 196: + +/* Line 1455 of yacc.c */ +#line 1401 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(1) - (3)].integer); + (yyval.state)[1] = (yyvsp[(3) - (3)].integer); + ;} + break; + + case 197: + +/* Line 1455 of yacc.c */ +#line 1408 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = state->state_param_enum; + (yyval.state)[1] = STATE_ENV; + (yyval.state)[2] = (yyvsp[(4) - (5)].integer); + (yyval.state)[3] = (yyvsp[(4) - (5)].integer); + ;} + break; + + case 198: + +/* Line 1455 of yacc.c */ +#line 1418 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = state->state_param_enum; + (yyval.state)[1] = STATE_LOCAL; + (yyval.state)[2] = (yyvsp[(4) - (5)].state)[0]; + (yyval.state)[3] = (yyvsp[(4) - (5)].state)[1]; + ;} + break; + + case 199: + +/* Line 1455 of yacc.c */ +#line 1427 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(1) - (1)].integer); + (yyval.state)[1] = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 200: + +/* Line 1455 of yacc.c */ +#line 1432 "program_parse.y" + { + (yyval.state)[0] = (yyvsp[(1) - (3)].integer); + (yyval.state)[1] = (yyvsp[(3) - (3)].integer); + ;} + break; + + case 201: + +/* Line 1455 of yacc.c */ +#line 1439 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = state->state_param_enum; + (yyval.state)[1] = STATE_LOCAL; + (yyval.state)[2] = (yyvsp[(4) - (5)].integer); + (yyval.state)[3] = (yyvsp[(4) - (5)].integer); + ;} + break; + + case 202: + +/* Line 1455 of yacc.c */ +#line 1449 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); + YYERROR; + } + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 203: + +/* Line 1455 of yacc.c */ +#line 1459 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); + YYERROR; + } + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 208: + +/* Line 1455 of yacc.c */ +#line 1474 "program_parse.y" + { + (yyval.vector).count = 1; + (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); + ;} + break; + + case 209: + +/* Line 1455 of yacc.c */ +#line 1481 "program_parse.y" + { + (yyval.vector).count = 1; + (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); + ;} + break; + + case 210: + +/* Line 1455 of yacc.c */ +#line 1486 "program_parse.y" + { + (yyval.vector).count = 1; + (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); + ;} + break; + + case 211: + +/* Line 1455 of yacc.c */ +#line 1493 "program_parse.y" + { + (yyval.vector).count = 1; + (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); + ;} + break; + + case 212: + +/* Line 1455 of yacc.c */ +#line 1498 "program_parse.y" + { + (yyval.vector).count = 2; + (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); + (yyval.vector).data[1] = (yyvsp[(4) - (5)].real); + ;} + break; + + case 213: + +/* Line 1455 of yacc.c */ +#line 1505 "program_parse.y" + { + (yyval.vector).count = 3; + (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); + (yyval.vector).data[1] = (yyvsp[(4) - (7)].real); + (yyval.vector).data[1] = (yyvsp[(6) - (7)].real); + ;} + break; + + case 214: + +/* Line 1455 of yacc.c */ +#line 1513 "program_parse.y" + { + (yyval.vector).count = 4; + (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); + (yyval.vector).data[1] = (yyvsp[(4) - (9)].real); + (yyval.vector).data[1] = (yyvsp[(6) - (9)].real); + (yyval.vector).data[1] = (yyvsp[(8) - (9)].real); + ;} + break; + + case 215: + +/* Line 1455 of yacc.c */ +#line 1523 "program_parse.y" + { + (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); + ;} + break; + + case 216: + +/* Line 1455 of yacc.c */ +#line 1527 "program_parse.y" + { + (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); + ;} + break; + + case 217: + +/* Line 1455 of yacc.c */ +#line 1532 "program_parse.y" + { (yyval.negate) = FALSE; ;} + break; + + case 218: + +/* Line 1455 of yacc.c */ +#line 1533 "program_parse.y" + { (yyval.negate) = TRUE; ;} + break; + + case 219: + +/* Line 1455 of yacc.c */ +#line 1534 "program_parse.y" + { (yyval.negate) = FALSE; ;} + break; + + case 220: + +/* Line 1455 of yacc.c */ +#line 1537 "program_parse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} + break; + + case 222: + +/* Line 1455 of yacc.c */ +#line 1540 "program_parse.y" + { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} + break; + + case 224: + +/* Line 1455 of yacc.c */ +#line 1544 "program_parse.y" + { + if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { + YYERROR; + } + ;} + break; + + case 225: + +/* Line 1455 of yacc.c */ +#line 1550 "program_parse.y" + { + if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { + YYERROR; + } + ;} + break; + + case 226: + +/* Line 1455 of yacc.c */ +#line 1558 "program_parse.y" + { + struct asm_symbol *const s = + declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); + + if (s == NULL) { + YYERROR; + } else { + s->output_binding = (yyvsp[(4) - (4)].result); + } + ;} + break; + + case 227: + +/* Line 1455 of yacc.c */ +#line 1571 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.result) = VERT_RESULT_HPOS; + } else { + yyerror(& (yylsp[(2) - (2)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 228: + +/* Line 1455 of yacc.c */ +#line 1580 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.result) = VERT_RESULT_FOGC; + } else { + yyerror(& (yylsp[(2) - (2)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 229: + +/* Line 1455 of yacc.c */ +#line 1589 "program_parse.y" + { + (yyval.result) = (yyvsp[(2) - (2)].result); + ;} + break; + + case 230: + +/* Line 1455 of yacc.c */ +#line 1593 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.result) = VERT_RESULT_PSIZ; + } else { + yyerror(& (yylsp[(2) - (2)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 231: + +/* Line 1455 of yacc.c */ +#line 1602 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); + } else { + yyerror(& (yylsp[(2) - (3)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 232: + +/* Line 1455 of yacc.c */ +#line 1611 "program_parse.y" + { + if (state->mode == ARB_fragment) { + (yyval.result) = FRAG_RESULT_DEPTH; + } else { + yyerror(& (yylsp[(2) - (2)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 233: + +/* Line 1455 of yacc.c */ +#line 1622 "program_parse.y" + { + (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); + ;} + break; + + case 234: + +/* Line 1455 of yacc.c */ +#line 1628 "program_parse.y" + { + (yyval.integer) = (state->mode == ARB_vertex) + ? VERT_RESULT_COL0 + : FRAG_RESULT_COLOR; + ;} + break; + + case 235: + +/* Line 1455 of yacc.c */ +#line 1634 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.integer) = VERT_RESULT_COL0; + } else { + yyerror(& (yylsp[(1) - (1)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 236: + +/* Line 1455 of yacc.c */ +#line 1643 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.integer) = VERT_RESULT_BFC0; + } else { + yyerror(& (yylsp[(1) - (1)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 237: + +/* Line 1455 of yacc.c */ +#line 1654 "program_parse.y" + { + (yyval.integer) = 0; + ;} + break; + + case 238: + +/* Line 1455 of yacc.c */ +#line 1658 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.integer) = 0; + } else { + yyerror(& (yylsp[(1) - (1)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 239: + +/* Line 1455 of yacc.c */ +#line 1667 "program_parse.y" + { + if (state->mode == ARB_vertex) { + (yyval.integer) = 1; + } else { + yyerror(& (yylsp[(1) - (1)]), state, "invalid program result name"); + YYERROR; + } + ;} + break; + + case 240: + +/* Line 1455 of yacc.c */ +#line 1677 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 241: + +/* Line 1455 of yacc.c */ +#line 1678 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 242: + +/* Line 1455 of yacc.c */ +#line 1679 "program_parse.y" + { (yyval.integer) = 1; ;} + break; + + case 243: + +/* Line 1455 of yacc.c */ +#line 1682 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 244: + +/* Line 1455 of yacc.c */ +#line 1683 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 245: + +/* Line 1455 of yacc.c */ +#line 1684 "program_parse.y" + { (yyval.integer) = 1; ;} + break; + + case 246: + +/* Line 1455 of yacc.c */ +#line 1687 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 247: + +/* Line 1455 of yacc.c */ +#line 1688 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} + break; + + case 248: + +/* Line 1455 of yacc.c */ +#line 1691 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 249: + +/* Line 1455 of yacc.c */ +#line 1692 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} + break; + + case 250: + +/* Line 1455 of yacc.c */ +#line 1695 "program_parse.y" + { (yyval.integer) = 0; ;} + break; + + case 251: + +/* Line 1455 of yacc.c */ +#line 1696 "program_parse.y" + { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} + break; + + case 252: + +/* Line 1455 of yacc.c */ +#line 1700 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 253: + +/* Line 1455 of yacc.c */ +#line 1711 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 254: + +/* Line 1455 of yacc.c */ +#line 1722 "program_parse.y" + { + if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { + yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); + YYERROR; + } + + (yyval.integer) = (yyvsp[(1) - (1)].integer); + ;} + break; + + case 255: + +/* Line 1455 of yacc.c */ +#line 1733 "program_parse.y" + { + struct asm_symbol *exist = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); + struct asm_symbol *target = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(4) - (4)].string)); + + + if (exist != NULL) { + yyerror(& (yylsp[(2) - (4)]), state, "redeclared identifier"); + YYERROR; + } else if (target == NULL) { + yyerror(& (yylsp[(4) - (4)]), state, + "undefined variable binding in ALIAS statement"); + YYERROR; + } else { + _mesa_symbol_table_add_symbol(state->st, 0, (yyvsp[(2) - (4)].string), target); + } + ;} + break; + + + +/* Line 1455 of yacc.c */ +#line 4318 "program_parse.tab.c" + default: break; + } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); + + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + + *++yyvsp = yyval; + *++yylsp = yyloc; + + /* 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 (&yylloc, state, 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 (&yylloc, state, yymsg); + } + else + { + yyerror (&yylloc, state, YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif + } + + yyerror_range[0] = yylloc; + + 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, &yylloc, state); + 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; + + yyerror_range[0] = yylsp[1-yylen]; + /* 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; + + yyerror_range[0] = *yylsp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp, yylsp, state); + YYPOPSTACK (1); + yystate = *yyssp; + YY_STACK_PRINT (yyss, yyssp); + } + + *++yyvsp = yylval; + + yyerror_range[1] = yylloc; + /* Using YYLLOC is tempting, but would change the location of + the lookahead. YYLOC is available though. */ + YYLLOC_DEFAULT (yyloc, (yyerror_range - 1), 2); + *++yylsp = yyloc; + + /* 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 (&yylloc, state, YY_("memory exhausted")); + yyresult = 2; + /* Fall through. */ +#endif + +yyreturn: + if (yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval, &yylloc, state); + /* 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, yylsp, state); + 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); +} + + + +/* Line 1675 of yacc.c */ +#line 1753 "program_parse.y" + + +struct asm_instruction * +asm_instruction_ctor(gl_inst_opcode op, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + + if (inst) { + _mesa_init_instructions(inst, 1); + inst->Base.Opcode = op; + inst->Base.DstReg = *dst; + + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + + if (src1 != NULL) { + inst->Base.SrcReg[1] = src1->Base; + inst->SrcReg[1] = *src1; + } + + if (src2 != NULL) { + inst->Base.SrcReg[2] = src2->Base; + inst->SrcReg[2] = *src2; + } + } + + return inst; +} + + +void +init_dst_reg(struct prog_dst_register *r) +{ + memset(r, 0, sizeof(*r)); + r->File = PROGRAM_UNDEFINED; + r->WriteMask = WRITEMASK_XYZW; + r->CondMask = COND_TR; + r->CondSwizzle = SWIZZLE_NOOP; +} + + +void +init_src_reg(struct asm_src_register *r) +{ + memset(r, 0, sizeof(*r)); + r->Base.File = PROGRAM_UNDEFINED; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + +/** + * Validate the set of inputs used by a program + * + * Validates that legal sets of inputs are used by the program. In this case + * "used" included both reading the input or binding the input to a name using + * the \c ATTRIB command. + * + * \return + * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise. + */ +int +validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state) +{ + const int inputs = state->prog->InputsRead | state->InputsBound; + + if (((inputs & 0x0ffff) & (inputs >> 16)) != 0) { + yyerror(locp, state, "illegal use of generic attribute and name attribute"); + return 0; + } + + return 1; +} + + +struct asm_symbol * +declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, + struct YYLTYPE *locp) +{ + struct asm_symbol *s = NULL; + struct asm_symbol *exist = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, name); + + + if (exist != NULL) { + yyerror(locp, state, "redeclared identifier"); + } else { + s = calloc(1, sizeof(struct asm_symbol)); + s->name = name; + s->type = t; + + switch (t) { + case at_temp: + if (state->prog->NumTemporaries >= state->limits->MaxTemps) { + yyerror(locp, state, "too many temporaries declared"); + free(s); + return NULL; + } + + s->temp_binding = state->prog->NumTemporaries; + state->prog->NumTemporaries++; + break; + + case at_address: + if (state->prog->NumAddressRegs >= state->limits->MaxAddressRegs) { + yyerror(locp, state, "too many address registers declared"); + free(s); + return NULL; + } + + /* FINISHME: Add support for multiple address registers. + */ + state->prog->NumAddressRegs++; + break; + + default: + break; + } + + _mesa_symbol_table_add_symbol(state->st, 0, s->name, s); + } + + return s; +} + + +int add_state_reference(struct gl_program_parameter_list *param_list, + const gl_state_index tokens[STATE_LENGTH]) +{ + const GLuint size = 4; /* XXX fix */ + char *name; + GLint index; + + name = _mesa_program_state_string(tokens); + index = _mesa_add_parameter(param_list, PROGRAM_STATE_VAR, name, + size, GL_NONE, + NULL, (gl_state_index *) tokens, 0x0); + param_list->StateFlags |= _mesa_program_state_flags(tokens); + + /* free name string here since we duplicated it in add_parameter() */ + _mesa_free(name); + + return index; +} + + +int +initialize_symbol_from_state(struct gl_program *prog, + struct asm_symbol *param_var, + const gl_state_index tokens[STATE_LENGTH]) +{ + int idx = -1; + gl_state_index state_tokens[STATE_LENGTH]; + + + memcpy(state_tokens, tokens, sizeof(state_tokens)); + + param_var->type = at_param; + + /* If we are adding a STATE_MATRIX that has multiple rows, we need to + * unroll it and call add_state_reference() for each row + */ + if ((state_tokens[0] == STATE_MODELVIEW_MATRIX || + state_tokens[0] == STATE_PROJECTION_MATRIX || + state_tokens[0] == STATE_MVP_MATRIX || + state_tokens[0] == STATE_TEXTURE_MATRIX || + state_tokens[0] == STATE_PROGRAM_MATRIX) + && (state_tokens[2] != state_tokens[3])) { + int row; + const int first_row = state_tokens[2]; + const int last_row = state_tokens[3]; + + for (row = first_row; row <= last_row; row++) { + state_tokens[2] = state_tokens[3] = row; + + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + } + else { + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + + return idx; +} + + +int +initialize_symbol_from_param(struct gl_program *prog, + struct asm_symbol *param_var, + const gl_state_index tokens[STATE_LENGTH]) +{ + int idx = -1; + gl_state_index state_tokens[STATE_LENGTH]; + + + memcpy(state_tokens, tokens, sizeof(state_tokens)); + + assert((state_tokens[0] == STATE_VERTEX_PROGRAM) + || (state_tokens[0] == STATE_FRAGMENT_PROGRAM)); + assert((state_tokens[1] == STATE_ENV) + || (state_tokens[1] == STATE_LOCAL)); + + param_var->type = at_param; + + /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements, + * we need to unroll it and call add_state_reference() for each row + */ + if (state_tokens[2] != state_tokens[3]) { + int row; + const int first_row = state_tokens[2]; + const int last_row = state_tokens[3]; + + for (row = first_row; row <= last_row; row++) { + state_tokens[2] = state_tokens[3] = row; + + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + } + else { + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + + return idx; +} + + +int +initialize_symbol_from_const(struct gl_program *prog, + struct asm_symbol *param_var, + const struct asm_vector *vec) +{ + const int idx = _mesa_add_parameter(prog->Parameters, PROGRAM_CONSTANT, + NULL, vec->count, GL_NONE, vec->data, + NULL, 0x0); + + param_var->type = at_param; + + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + + return idx; +} + + +void +yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) +{ + (void) state; + + fprintf(stderr, "line %u, char %u: error: %s\n", locp->first_line, + locp->first_column, s); +} + +GLboolean +_mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, + GLsizei len, struct asm_parser_state *state) +{ + struct gl_program_constants limits; + struct asm_instruction *inst; + unsigned i; + GLubyte *strz; + + state->prog->Target = target; + state->prog->Parameters = _mesa_new_parameter_list(); + + /* Make a copy of the program string and force it to be NUL-terminated. + */ + strz = (GLubyte *) _mesa_malloc(len + 1); + if (strz == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); + return GL_FALSE; + } + _mesa_memcpy (strz, str, len); + strz[len] = '\0'; + + state->prog->String = strz; + + state->st = _mesa_symbol_table_ctor(); + + /* All of these limits should come from ctx. + */ + limits.MaxInstructions = 128; + limits.MaxAluInstructions = 128; + limits.MaxTexInstructions = 128; + limits.MaxTexIndirections = 128; + limits.MaxAttribs = 16; + limits.MaxTemps = 128; + limits.MaxAddressRegs = 1; + limits.MaxParameters = 128; + limits.MaxLocalParams = 256; + limits.MaxEnvParams = 128; + limits.MaxNativeInstructions = 128; + limits.MaxNativeAluInstructions = 128; + limits.MaxNativeTexInstructions = 128; + limits.MaxNativeTexIndirections = 128; + limits.MaxNativeAttribs = 16; + limits.MaxNativeTemps = 128; + limits.MaxNativeAddressRegs = 1; + limits.MaxNativeParameters = 128; + limits.MaxUniformComponents = 0; + + state->limits = & limits; + + state->MaxTextureImageUnits = 16; + state->MaxTextureCoordUnits = 8; + state->MaxTextureUnits = 8; + state->MaxClipPlanes = 6; + state->MaxLights = 8; + state->MaxProgramMatrices = 8; + + state->state_param_enum = (target == GL_VERTEX_PROGRAM_ARB) + ? STATE_VERTEX_PROGRAM : STATE_FRAGMENT_PROGRAM; + + _mesa_set_program_error(ctx, -1, NULL); + + _mesa_program_lexer_ctor(& state->scanner, state, (const char *) str, len); + yyparse(state); + _mesa_program_lexer_dtor(state->scanner); + + + if (! _mesa_layout_parameters(state)) { + fprintf(stderr, "error: layout\n"); + return GL_FALSE; + } + + + + /* Add one instruction to store the "END" instruction. + */ + state->prog->Instructions = + _mesa_alloc_instructions(state->prog->NumInstructions + 1); + inst = state->inst_head; + for (i = 0; i < state->prog->NumInstructions; i++) { + struct asm_instruction *const temp = inst->next; + + state->prog->Instructions[i] = inst->Base; + _mesa_free(inst); + + inst = temp; + } + + /* Finally, tag on an OPCODE_END instruction */ + { + const GLuint numInst = state->prog->NumInstructions; + _mesa_init_instructions(state->prog->Instructions + numInst, 1); + state->prog->Instructions[numInst].Opcode = OPCODE_END; + } + state->prog->NumInstructions++; + + /* + * Initialize native counts to logical counts. The device driver may + * change them if program is translated into a hardware program. + */ + state->prog->NumNativeInstructions = state->prog->NumInstructions; + state->prog->NumNativeTemporaries = state->prog->NumTemporaries; + state->prog->NumNativeParameters = state->prog->NumParameters; + state->prog->NumNativeAttributes = state->prog->NumAttributes; + state->prog->NumNativeAddressRegs = state->prog->NumAddressRegs; + + return GL_TRUE; +} + diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h new file mode 100644 index 0000000000..007b06fcc1 --- /dev/null +++ b/src/mesa/shader/program_parse.tab.h @@ -0,0 +1,193 @@ + +/* 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 { + ARBvp_10 = 258, + ARBfp_10 = 259, + ADDRESS = 260, + ALIAS = 261, + ATTRIB = 262, + OPTION = 263, + OUTPUT = 264, + PARAM = 265, + TEMP = 266, + END = 267, + BIN_OP = 268, + BINSC_OP = 269, + SAMPLE_OP = 270, + SCALAR_OP = 271, + TRI_OP = 272, + VECTOR_OP = 273, + ARL = 274, + KIL = 275, + SWZ = 276, + INTEGER = 277, + REAL = 278, + AMBIENT = 279, + ATTENUATION = 280, + BACK = 281, + CLIP = 282, + COLOR = 283, + DEPTH = 284, + DIFFUSE = 285, + DIRECTION = 286, + EMISSION = 287, + ENV = 288, + EYE = 289, + FOG = 290, + FOGCOORD = 291, + FRAGMENT = 292, + FRONT = 293, + HALF = 294, + INVERSE = 295, + INVTRANS = 296, + LIGHT = 297, + LIGHTMODEL = 298, + LIGHTPROD = 299, + LOCAL = 300, + MATERIAL = 301, + MAT_PROGRAM = 302, + MATRIX = 303, + MATRIXINDEX = 304, + MODELVIEW = 305, + MVP = 306, + NORMAL = 307, + OBJECT = 308, + PALETTE = 309, + PARAMS = 310, + PLANE = 311, + POINT = 312, + POINTSIZE = 313, + POSITION = 314, + PRIMARY = 315, + PROGRAM = 316, + PROJECTION = 317, + RANGE = 318, + RESULT = 319, + ROW = 320, + SCENECOLOR = 321, + SECONDARY = 322, + SHININESS = 323, + SIZE = 324, + SPECULAR = 325, + SPOT = 326, + STATE = 327, + TEXCOORD = 328, + TEXENV = 329, + TEXGEN = 330, + TEXGEN_Q = 331, + TEXGEN_R = 332, + TEXGEN_S = 333, + TEXGEN_T = 334, + TEXTURE = 335, + TRANSPOSE = 336, + TEXTURE_UNIT = 337, + TEX_1D = 338, + TEX_2D = 339, + TEX_3D = 340, + TEX_CUBE = 341, + TEX_RECT = 342, + VERTEX = 343, + VTXATTRIB = 344, + WEIGHT = 345, + IDENTIFIER = 346, + MASK4 = 347, + MASK3 = 348, + MASK2 = 349, + MASK1 = 350, + SWIZZLE = 351, + DOT_DOT = 352, + DOT = 353 + }; +#endif + + + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED +typedef union YYSTYPE +{ + +/* Line 1676 of yacc.c */ +#line 100 "program_parse.y" + + struct asm_instruction *inst; + struct asm_symbol *sym; + struct asm_symbol temp_sym; + struct asm_swizzle_mask swiz_mask; + struct asm_src_register src_reg; + struct prog_dst_register dst_reg; + struct prog_instruction temp_inst; + char *string; + unsigned result; + unsigned attrib; + int integer; + float real; + unsigned state[5]; + int negate; + struct asm_vector vector; + gl_inst_opcode opcode; + + + +/* Line 1676 of yacc.c */ +#line 171 "program_parse.tab.h" +} YYSTYPE; +# define YYSTYPE_IS_TRIVIAL 1 +# define yystype YYSTYPE /* obsolescent; will be withdrawn */ +# define YYSTYPE_IS_DECLARED 1 +#endif + + + +#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED +typedef struct YYLTYPE +{ + int first_line; + int first_column; + int last_line; + int last_column; +} YYLTYPE; +# define yyltype YYLTYPE /* obsolescent; will be withdrawn */ +# define YYLTYPE_IS_DECLARED 1 +# define YYLTYPE_IS_TRIVIAL 1 +#endif + + + diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y new file mode 100644 index 0000000000..39e3ee1f1e --- /dev/null +++ b/src/mesa/shader/program_parse.y @@ -0,0 +1,2130 @@ +%{ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include +#include +#include + +#include "main/mtypes.h" +#include "prog_parameter.h" +#include "prog_parameter_layout.h" +#include "prog_statevars.h" +#include "prog_instruction.h" + +#include "symbol_table.h" +#include "program_parser.h" + +extern void *yy_scan_string(char *); +extern void yy_delete_buffer(void *); + +static struct asm_symbol *declare_variable(struct asm_parser_state *state, + char *name, enum asm_type t, struct YYLTYPE *locp); + +static int initialize_symbol_from_state(struct gl_program *prog, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]); + +static int initialize_symbol_from_param(struct gl_program *prog, + struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]); + +static int initialize_symbol_from_const(struct gl_program *prog, + struct asm_symbol *param_var, const struct asm_vector *vec); + +static int yyparse(struct asm_parser_state *state); + +static void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state, + const char *s); + +static int validate_inputs(struct YYLTYPE *locp, + struct asm_parser_state *state); + +static void init_dst_reg(struct prog_dst_register *r); + +static void init_src_reg(struct asm_src_register *r); + +static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, + const struct prog_dst_register *dst, const struct asm_src_register *src0, + const struct asm_src_register *src1, const struct asm_src_register *src2); + +#ifndef FALSE +#define FALSE 0 +#define TRUE (!FALSE) +#endif + +#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).position = YYRHSLOC(Rhs, 1).position; \ + (Current).last_line = YYRHSLOC(Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC(Rhs, N).last_column; \ + } else { \ + (Current).first_line = YYRHSLOC(Rhs, 0).last_line; \ + (Current).last_line = (Current).first_line; \ + (Current).first_column = YYRHSLOC(Rhs, 0).last_column; \ + (Current).last_column = (Current).first_column; \ + (Current).position = YYRHSLOC(Rhs, 0).position \ + + (Current).first_column; \ + } \ + } while(YYID(0)) + +#define YYLEX_PARAM state->scanner +%} + +%pure-parser +%locations +%parse-param { struct asm_parser_state *state } +%error-verbose +%lex-param { void *scanner } + +%union { + struct asm_instruction *inst; + struct asm_symbol *sym; + struct asm_symbol temp_sym; + struct asm_swizzle_mask swiz_mask; + struct asm_src_register src_reg; + struct prog_dst_register dst_reg; + struct prog_instruction temp_inst; + char *string; + unsigned result; + unsigned attrib; + int integer; + float real; + unsigned state[5]; + int negate; + struct asm_vector vector; + gl_inst_opcode opcode; +} + +%token ARBvp_10 ARBfp_10 + +/* Tokens for assembler pseudo-ops */ +%token ADDRESS +%token ALIAS ATTRIB +%token OPTION OUTPUT +%token PARAM +%token TEMP +%token END + + /* Tokens for instructions */ +%token BIN_OP BINSC_OP SAMPLE_OP SCALAR_OP TRI_OP VECTOR_OP +%token ARL KIL SWZ + +%token INTEGER +%token REAL + +%token AMBIENT ATTENUATION +%token BACK +%token CLIP COLOR +%token DEPTH DIFFUSE DIRECTION +%token EMISSION ENV EYE +%token FOG FOGCOORD FRAGMENT FRONT +%token HALF +%token INVERSE INVTRANS +%token LIGHT LIGHTMODEL LIGHTPROD LOCAL +%token MATERIAL MAT_PROGRAM MATRIX MATRIXINDEX MODELVIEW MVP +%token NORMAL +%token OBJECT +%token PALETTE PARAMS PLANE POINT POINTSIZE POSITION PRIMARY PROGRAM PROJECTION +%token RANGE RESULT ROW +%token SCENECOLOR SECONDARY SHININESS SIZE SPECULAR SPOT STATE +%token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE +%token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT +%token VERTEX VTXATTRIB +%token WEIGHT + +%token IDENTIFIER +%token MASK4 MASK3 MASK2 MASK1 SWIZZLE +%token DOT_DOT +%token DOT + +%type instruction ALU_instruction TexInstruction +%type ARL_instruction VECTORop_instruction +%type SCALARop_instruction BINSCop_instruction BINop_instruction +%type TRIop_instruction SWZ_instruction SAMPLE_instruction +%type KIL_instruction + +%type dstReg maskedDstReg maskedAddrReg +%type srcReg scalarSrcReg swizzleSrcReg +%type scalarSuffix swizzleSuffix extendedSwizzle extSwizComp +%type optionalMask +%type extSwizSel + +%type progParamArray +%type addrRegRelOffset addrRegPosOffset addrRegNegOffset +%type progParamArrayMem progParamArrayAbs progParamArrayRel +%type addrReg +%type addrComponent addrWriteMask + +%type resultBinding resultColBinding +%type optFaceType optColorType +%type optResultFaceType optResultColorType + +%type optTexImageUnitNum texImageUnitNum +%type optTexCoordUnitNum texCoordUnitNum +%type optLegacyTexUnitNum legacyTexUnitNum +%type texImageUnit texTarget +%type vtxAttribNum + +%type attribBinding vtxAttribItem fragAttribItem + +%type paramSingleInit paramSingleItemDecl +%type optArraySize + +%type stateSingleItem stateMultipleItem +%type stateMaterialItem +%type stateLightItem stateLightModelItem stateLightProdItem +%type stateTexGenItem stateFogItem stateClipPlaneItem statePointItem +%type stateMatrixItem stateMatrixRow stateMatrixRows +%type stateTexEnvItem + +%type stateLModProperty +%type stateMatrixName optMatrixRows + +%type stateMatProperty +%type stateLightProperty stateSpotProperty +%type stateLightNumber stateLProdProperty +%type stateTexGenType stateTexGenCoord +%type stateTexEnvProperty +%type stateFogProperty +%type stateClipPlaneNum +%type statePointProperty + +%type stateOptMatModifier stateMatModifier stateMatrixRowNum +%type stateOptModMatNum stateModMatNum statePaletteMatNum +%type stateProgramMatNum + +%type ambDiffSpecProperty + +%type programSingleItem progEnvParam progLocalParam +%type programMultipleItem progEnvParams progLocalParams + +%type paramMultipleInit paramMultInitList paramMultipleItem +%type paramSingleItemUse + +%type progEnvParamNum progLocalParamNum +%type progEnvParamNums progLocalParamNums + +%type paramConstDecl paramConstUse +%type paramConstScalarDecl paramConstScalarUse paramConstVector +%type signedFloatConstant +%type optionalSign + +%{ +extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, + void *yyscanner); +%} + +%% + +program: language optionSequence statementSequence END + ; + +language: ARBvp_10 + { + if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { + yyerror(& @1, state, "invalid fragment program header"); + + } + state->mode = ARB_vertex; + } + | ARBfp_10 + { + if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { + yyerror(& @1, state, "invalid vertex program header"); + } + state->mode = ARB_fragment; + } + ; + +optionSequence: optionSequence option + | + ; + +option: OPTION IDENTIFIER ';' + { + int valid = 0; + + if (state->mode == ARB_vertex) { + valid = _mesa_ARBvp_parse_option(state, $2); + } else if (state->mode == ARB_fragment) { + valid = _mesa_ARBfp_parse_option(state, $2); + } + + + if (!valid) { + yyerror(& @2, state, "invalid option string"); + YYERROR; + } + } + ; + +statementSequence: statementSequence statement + | + ; + +statement: instruction ';' + { + if ($1 != NULL) { + if (state->inst_tail == NULL) { + state->inst_head = $1; + } else { + state->inst_tail->next = $1; + } + + state->inst_tail = $1; + $1->next = NULL; + + state->prog->NumInstructions++; + } + } + | namingStatement ';' + ; + +instruction: ALU_instruction + | TexInstruction + ; + +ALU_instruction: ARL_instruction + | VECTORop_instruction + | SCALARop_instruction + | BINSCop_instruction + | BINop_instruction + | TRIop_instruction + | SWZ_instruction + ; + +TexInstruction: SAMPLE_instruction + | KIL_instruction + ; + +ARL_instruction: ARL maskedAddrReg ',' scalarSrcReg + { + $$ = asm_instruction_ctor(OPCODE_ARL, & $2, & $4, NULL, NULL); + } + ; + +VECTORop_instruction: VECTOR_OP maskedDstReg ',' swizzleSrcReg + { + $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); + $$->Base.SaturateMode = $1.SaturateMode; + } + ; + +SCALARop_instruction: SCALAR_OP maskedDstReg ',' scalarSrcReg + { + $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); + $$->Base.SaturateMode = $1.SaturateMode; + } + ; + +BINSCop_instruction: BINSC_OP maskedDstReg ',' scalarSrcReg ',' scalarSrcReg + { + $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); + $$->Base.SaturateMode = $1.SaturateMode; + } + ; + + +BINop_instruction: BIN_OP maskedDstReg ',' swizzleSrcReg ',' swizzleSrcReg + { + $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, NULL); + $$->Base.SaturateMode = $1.SaturateMode; + } + ; + +TRIop_instruction: TRI_OP maskedDstReg ',' + swizzleSrcReg ',' swizzleSrcReg ',' swizzleSrcReg + { + $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, & $6, & $8); + $$->Base.SaturateMode = $1.SaturateMode; + } + ; + +SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ',' texTarget + { + $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); + if ($$ != NULL) { + $$->Base.SaturateMode = $1.SaturateMode; + $$->Base.TexSrcUnit = $6; + $$->Base.TexSrcTarget = $8; + } + } + ; + +KIL_instruction: KIL swizzleSrcReg + { + $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL); + } + ; + +texImageUnit: TEXTURE_UNIT optTexImageUnitNum + { + $$ = $2; + } + ; + +texTarget: TEX_1D { $$ = TEXTURE_1D_INDEX; } + | TEX_2D { $$ = TEXTURE_2D_INDEX; } + | TEX_3D { $$ = TEXTURE_3D_INDEX; } + | TEX_CUBE { $$ = TEXTURE_CUBE_INDEX; } + | TEX_RECT { $$ = TEXTURE_RECT_INDEX; } + ; + +SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle + { + /* FIXME: Is this correct? Should the extenedSwizzle be applied + * FIXME: to the existing swizzle? + */ + $4.Base.Swizzle = $6.swizzle; + + $$ = asm_instruction_ctor(OPCODE_SWZ, & $2, & $4, NULL, NULL); + $$->Base.SaturateMode = $1.SaturateMode; + } + ; + +scalarSrcReg: optionalSign srcReg scalarSuffix + { + $$ = $2; + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, + $3.swizzle); + } + ; + +swizzleSrcReg: optionalSign srcReg swizzleSuffix + { + $$ = $2; + + if ($1) { + $$.Base.Negate = ~$$.Base.Negate; + } + + $$.Base.Swizzle = _mesa_combine_swizzles($$.Base.Swizzle, + $3.swizzle); + } + ; + +maskedDstReg: dstReg optionalMask + { + $$ = $1; + $$.WriteMask = $2.mask; + + if ($$.File == PROGRAM_OUTPUT) { + /* Technically speaking, this should check that it is in + * vertex program mode. However, PositionInvariant can never be + * set in fragment program mode, so it is somewhat irrelevant. + */ + if (state->option.PositionInvariant + && ($$.Index == VERT_RESULT_HPOS)) { + yyerror(& @1, state, "position-invariant programs cannot " + "write position"); + YYERROR; + } + + state->prog->OutputsWritten |= (1U << $$.Index); + } + } + ; + +maskedAddrReg: addrReg addrWriteMask + { + init_dst_reg(& $$); + $$.File = PROGRAM_ADDRESS; + $$.Index = 0; + $$.WriteMask = $2.mask; + } + ; + +extendedSwizzle: extSwizComp ',' extSwizComp ',' extSwizComp ',' extSwizComp + { + $$.swizzle = MAKE_SWIZZLE4($1.swizzle, $3.swizzle, + $5.swizzle, $7.swizzle); + $$.mask = ($1.mask) | ($3.mask << 1) | ($5.mask << 2) + | ($7.mask << 3); + } + ; + +extSwizComp: optionalSign extSwizSel + { + $$.swizzle = $2; + $$.mask = ($1) ? 1 : 0; + } + ; + +extSwizSel: INTEGER + { + if (($1 != 0) && ($1 != 1)) { + yyerror(& @1, state, "invalid extended swizzle selector"); + YYERROR; + } + + $$ = ($1 == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; + } + | IDENTIFIER + { + if (strlen($1) > 1) { + yyerror(& @1, state, "invalid extended swizzle selector"); + YYERROR; + } + + switch ($1[0]) { + case 'x': + $$ = SWIZZLE_X; + break; + case 'y': + $$ = SWIZZLE_Y; + break; + case 'z': + $$ = SWIZZLE_Z; + break; + case 'w': + $$ = SWIZZLE_W; + break; + default: + yyerror(& @1, state, "invalid extended swizzle selector"); + YYERROR; + break; + } + } + ; + +srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, $1); + + if (s == NULL) { + yyerror(& @1, state, "invalid operand variable"); + YYERROR; + } else if ((s->type != at_param) && (s->type != at_temp) + && (s->type != at_attrib)) { + yyerror(& @1, state, "invalid operand variable"); + YYERROR; + } else if ((s->type == at_param) && s->param_is_array) { + yyerror(& @1, state, "non-array access to array PARAM"); + YYERROR; + } + + init_src_reg(& $$); + switch (s->type) { + case at_temp: + $$.Base.File = PROGRAM_TEMPORARY; + $$.Base.Index = s->temp_binding; + break; + case at_param: + $$.Base.File = s->param_binding_type; + $$.Base.Index = s->param_binding_begin; + break; + case at_attrib: + $$.Base.File = PROGRAM_INPUT; + $$.Base.Index = s->attrib_binding; + state->prog->InputsRead |= (1U << $$.Base.Index); + + if (!validate_inputs(& @1, state)) { + YYERROR; + } + break; + + default: + YYERROR; + break; + } + } + | attribBinding + { + init_src_reg(& $$); + $$.Base.File = PROGRAM_INPUT; + $$.Base.Index = $1; + state->prog->InputsRead |= (1U << $$.Base.Index); + + if (!validate_inputs(& @1, state)) { + YYERROR; + } + } + | progParamArray '[' progParamArrayMem ']' + { + if (! $3.Base.RelAddr + && ($3.Base.Index >= $1->param_binding_length)) { + yyerror(& @3, state, "out of bounds array access"); + YYERROR; + } + + init_src_reg(& $$); + $$.Base.File = $1->param_binding_type; + + if ($3.Base.RelAddr) { + $1->param_accessed_indirectly = 1; + + $$.Base.RelAddr = 1; + $$.Base.Index = $3.Base.Index; + $$.Symbol = $1; + } else { + $$.Base.Index = $1->param_binding_begin + $3.Base.Index; + } + } + | paramSingleItemUse + { + init_src_reg(& $$); + $$.Base.File = $1.param_binding_type; + $$.Base.Index = $1.param_binding_begin; + } + ; + +dstReg: resultBinding + { + init_dst_reg(& $$); + $$.File = PROGRAM_OUTPUT; + $$.Index = $1; + } + | IDENTIFIER /* temporaryReg | vertexResultReg */ + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, $1); + + if (s == NULL) { + yyerror(& @1, state, "invalid operand variable"); + YYERROR; + } else if ((s->type != at_output) && (s->type != at_temp)) { + yyerror(& @1, state, "invalid operand variable"); + YYERROR; + } + + init_dst_reg(& $$); + if (s->type == at_temp) { + $$.File = PROGRAM_TEMPORARY; + $$.Index = s->temp_binding; + } else { + $$.File = s->param_binding_type; + $$.Index = s->param_binding_begin; + } + } + ; + +progParamArray: IDENTIFIER + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, $1); + + if (s == NULL) { + yyerror(& @1, state, "invalid operand variable"); + YYERROR; + } else if ((s->type != at_param) || !s->param_is_array) { + yyerror(& @1, state, "array access to non-PARAM variable"); + YYERROR; + } else { + $$ = s; + } + } + ; + +progParamArrayMem: progParamArrayAbs | progParamArrayRel; + +progParamArrayAbs: INTEGER + { + init_src_reg(& $$); + $$.Base.Index = $1; + } + ; + +progParamArrayRel: addrReg addrComponent addrRegRelOffset + { + /* FINISHME: Add support for multiple address registers. + */ + /* FINISHME: Add support for 4-component address registers. + */ + init_src_reg(& $$); + $$.Base.RelAddr = 1; + $$.Base.Index = $3; + } + ; + +addrRegRelOffset: { $$ = 0; } + | '+' addrRegPosOffset { $$ = $2; } + | '-' addrRegNegOffset { $$ = -$2; } + ; + +addrRegPosOffset: INTEGER + { + if (($1 < 0) || ($1 > 63)) { + yyerror(& @1, state, + "relative address offset too large (positive)"); + YYERROR; + } else { + $$ = $1; + } + } + ; + +addrRegNegOffset: INTEGER + { + if (($1 < 0) || ($1 > 64)) { + yyerror(& @1, state, + "relative address offset too large (negative)"); + YYERROR; + } else { + $$ = $1; + } + } + ; + +addrReg: IDENTIFIER + { + struct asm_symbol *const s = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, $1); + + if (s == NULL) { + yyerror(& @1, state, "invalid array member"); + YYERROR; + } else if (s->type != at_address) { + yyerror(& @1, state, + "invalid variable for indexed array access"); + YYERROR; + } else { + $$ = s; + } + } + ; + +addrComponent: MASK1 + { + if ($1.mask != WRITEMASK_X) { + yyerror(& @1, state, "invalid address component selector"); + YYERROR; + } else { + $$ = $1; + } + } + ; + +addrWriteMask: MASK1 + { + if ($1.mask != WRITEMASK_X) { + yyerror(& @1, state, + "address register write mask must be \".x\""); + YYERROR; + } else { + $$ = $1; + } + } + ; + +scalarSuffix: MASK1; + +swizzleSuffix: MASK1 + | MASK4 + | SWIZZLE + | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; } + ; + +optionalMask: MASK4 | MASK3 | MASK2 | MASK1 + | { $$.swizzle = SWIZZLE_NOOP; $$.mask = WRITEMASK_XYZW; } + ; + +namingStatement: ATTRIB_statement + | PARAM_statement + | TEMP_statement + | ADDRESS_statement + | OUTPUT_statement + | ALIAS_statement + ; + +ATTRIB_statement: ATTRIB IDENTIFIER '=' attribBinding + { + struct asm_symbol *const s = + declare_variable(state, $2, at_attrib, & @2); + + if (s == NULL) { + YYERROR; + } else { + s->attrib_binding = $4; + state->InputsBound |= (1U << s->attrib_binding); + + if (!validate_inputs(& @4, state)) { + YYERROR; + } + } + } + ; + +attribBinding: VERTEX vtxAttribItem + { + $$ = $2; + } + | FRAGMENT fragAttribItem + { + $$ = $2; + } + ; + +vtxAttribItem: POSITION + { + $$ = VERT_ATTRIB_POS; + } + | WEIGHT vtxOptWeightNum + { + $$ = VERT_ATTRIB_WEIGHT; + } + | NORMAL + { + $$ = VERT_ATTRIB_NORMAL; + } + | COLOR optColorType + { + $$ = VERT_ATTRIB_COLOR0 + $2; + } + | FOGCOORD + { + $$ = VERT_ATTRIB_FOG; + } + | TEXCOORD optTexCoordUnitNum + { + $$ = VERT_ATTRIB_TEX0 + $2; + } + | MATRIXINDEX '[' vtxWeightNum ']' + { + YYERROR; + } + | VTXATTRIB '[' vtxAttribNum ']' + { + $$ = VERT_ATTRIB_GENERIC0 + $3; + } + ; + +vtxAttribNum: INTEGER + { + if ($1 >= state->limits->MaxAttribs) { + yyerror(& @1, state, "invalid vertex attribute reference"); + YYERROR; + } + + $$ = $1; + } + ; + +vtxOptWeightNum: | '[' vtxWeightNum ']'; +vtxWeightNum: INTEGER; + +fragAttribItem: POSITION + { + $$ = FRAG_ATTRIB_WPOS; + } + | COLOR optColorType + { + $$ = FRAG_ATTRIB_COL0 + $2; + } + | FOGCOORD + { + $$ = FRAG_ATTRIB_FOGC; + } + | TEXCOORD optTexCoordUnitNum + { + $$ = FRAG_ATTRIB_TEX0 + $2; + } + ; + +PARAM_statement: PARAM_singleStmt | PARAM_multipleStmt; + +PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit + { + struct asm_symbol *const s = + declare_variable(state, $2, at_param, & @2); + + if (s == NULL) { + YYERROR; + } else { + s->param_binding_type = $3.param_binding_type; + s->param_binding_begin = $3.param_binding_begin; + s->param_binding_length = $3.param_binding_length; + s->param_is_array = 0; + } + } + ; + +PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit + { + if (($4 != 0) && ($4 != $6.param_binding_length)) { + yyerror(& @4, state, + "parameter array size and number of bindings must match"); + YYERROR; + } else { + struct asm_symbol *const s = + declare_variable(state, $2, $6.type, & @2); + + if (s == NULL) { + YYERROR; + } else { + s->param_binding_type = $6.param_binding_type; + s->param_binding_begin = $6.param_binding_begin; + s->param_binding_length = $6.param_binding_length; + s->param_is_array = 1; + } + } + } + ; + +optArraySize: + { + $$ = 0; + } + | INTEGER + { + if (($1 < 1) || ($1 >= state->limits->MaxParameters)) { + yyerror(& @1, state, "invalid parameter array size"); + YYERROR; + } else { + $$ = $1; + } + } + ; + +paramSingleInit: '=' paramSingleItemDecl + { + $$ = $2; + } + ; + +paramMultipleInit: '=' '{' paramMultInitList '}' + { + $$ = $3; + } + ; + +paramMultInitList: paramMultipleItem + | paramMultInitList ',' paramMultipleItem + { + $1.param_binding_length += $3.param_binding_length; + $$ = $1; + } + ; + +paramSingleItemDecl: stateSingleItem + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_state(state->prog, & $$, $1); + } + | programSingleItem + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_param(state->prog, & $$, $1); + } + | paramConstDecl + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & $$, & $1); + } + ; + +paramSingleItemUse: stateSingleItem + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_state(state->prog, & $$, $1); + } + | programSingleItem + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_param(state->prog, & $$, $1); + } + | paramConstUse + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & $$, & $1); + } + ; + +paramMultipleItem: stateMultipleItem + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_state(state->prog, & $$, $1); + } + | programMultipleItem + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_param(state->prog, & $$, $1); + } + | paramConstDecl + { + memset(& $$, 0, sizeof($$)); + $$.param_binding_begin = ~0; + initialize_symbol_from_const(state->prog, & $$, & $1); + } + ; + +stateMultipleItem: stateSingleItem { memcpy($$, $1, sizeof($$)); } + | STATE stateMatrixRows { memcpy($$, $2, sizeof($$)); } + ; + +stateSingleItem: STATE stateMaterialItem { memcpy($$, $2, sizeof($$)); } + | STATE stateLightItem { memcpy($$, $2, sizeof($$)); } + | STATE stateLightModelItem { memcpy($$, $2, sizeof($$)); } + | STATE stateLightProdItem { memcpy($$, $2, sizeof($$)); } + | STATE stateTexGenItem { memcpy($$, $2, sizeof($$)); } + | STATE stateTexEnvItem { memcpy($$, $2, sizeof($$)); } + | STATE stateFogItem { memcpy($$, $2, sizeof($$)); } + | STATE stateClipPlaneItem { memcpy($$, $2, sizeof($$)); } + | STATE statePointItem { memcpy($$, $2, sizeof($$)); } + | STATE stateMatrixRow { memcpy($$, $2, sizeof($$)); } + ; + +stateMaterialItem: MATERIAL optFaceType stateMatProperty + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_MATERIAL; + $$[1] = $2; + $$[2] = $3; + } + ; + +stateMatProperty: ambDiffSpecProperty + { + $$ = $1; + } + | EMISSION + { + $$ = STATE_EMISSION; + } + | SHININESS + { + $$ = STATE_SHININESS; + } + ; + +stateLightItem: LIGHT '[' stateLightNumber ']' stateLightProperty + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_LIGHT; + $$[1] = $3; + $$[2] = $5; + } + ; + +stateLightProperty: ambDiffSpecProperty + { + $$ = $1; + } + | POSITION + { + $$ = STATE_POSITION; + } + | ATTENUATION + { + $$ = STATE_ATTENUATION; + } + | SPOT stateSpotProperty + { + $$ = $2; + } + | HALF + { + $$ = STATE_HALF_VECTOR; + } + ; + +stateSpotProperty: DIRECTION + { + $$ = STATE_SPOT_DIRECTION; + } + ; + +stateLightModelItem: LIGHTMODEL stateLModProperty + { + $$[0] = $2[0]; + $$[1] = $2[1]; + } + ; + +stateLModProperty: AMBIENT + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_LIGHTMODEL_AMBIENT; + } + | optFaceType SCENECOLOR + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_LIGHTMODEL_SCENECOLOR; + $$[1] = $1; + } + ; + +stateLightProdItem: LIGHTPROD '[' stateLightNumber ']' optFaceType stateLProdProperty + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_LIGHTPROD; + $$[1] = $3; + $$[2] = $5; + $$[3] = $6; + } + ; + +stateLProdProperty: ambDiffSpecProperty; + +stateTexEnvItem: TEXENV optLegacyTexUnitNum stateTexEnvProperty + { + memset($$, 0, sizeof($$)); + $$[0] = $3; + $$[1] = $2; + } + ; + +stateTexEnvProperty: COLOR + { + $$ = STATE_TEXENV_COLOR; + } + ; + +ambDiffSpecProperty: AMBIENT + { + $$ = STATE_AMBIENT; + } + | DIFFUSE + { + $$ = STATE_DIFFUSE; + } + | SPECULAR + { + $$ = STATE_SPECULAR; + } + ; + +stateLightNumber: INTEGER + { + if ($1 >= state->MaxLights) { + yyerror(& @1, state, "invalid light selector"); + YYERROR; + } + + $$ = $1; + } + ; + +stateTexGenItem: TEXGEN optTexCoordUnitNum stateTexGenType stateTexGenCoord + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_TEXGEN; + $$[1] = $2; + $$[2] = $3 + $4; + } + ; + +stateTexGenType: EYE + { + $$ = STATE_TEXGEN_EYE_S; + } + | OBJECT + { + $$ = STATE_TEXGEN_OBJECT_S; + } + ; +stateTexGenCoord: TEXGEN_S + { + $$ = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; + } + | TEXGEN_T + { + $$ = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; + } + | TEXGEN_R + { + $$ = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; + } + | TEXGEN_Q + { + $$ = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; + } + ; + +stateFogItem: FOG stateFogProperty + { + memset($$, 0, sizeof($$)); + $$[0] = $2; + } + ; + +stateFogProperty: COLOR + { + $$ = STATE_FOG_COLOR; + } + | PARAMS + { + $$ = STATE_FOG_PARAMS; + } + ; + +stateClipPlaneItem: CLIP '[' stateClipPlaneNum ']' PLANE + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_CLIPPLANE; + $$[1] = $3; + } + ; + +stateClipPlaneNum: INTEGER + { + if ($1 >= state->MaxClipPlanes) { + yyerror(& @1, state, "invalid clip plane selector"); + YYERROR; + } + + $$ = $1; + } + ; + +statePointItem: POINT statePointProperty + { + memset($$, 0, sizeof($$)); + $$[0] = $2; + } + ; + +statePointProperty: SIZE + { + $$ = STATE_POINT_SIZE; + } + | ATTENUATION + { + $$ = STATE_POINT_ATTENUATION; + } + ; + +stateMatrixRow: stateMatrixItem ROW '[' stateMatrixRowNum ']' + { + $$[0] = $1[0]; + $$[1] = $1[1]; + $$[2] = $4; + $$[3] = $4; + $$[4] = $1[2]; + } + ; + +stateMatrixRows: stateMatrixItem optMatrixRows + { + $$[0] = $1[0]; + $$[1] = $1[1]; + $$[2] = $2[2]; + $$[3] = $2[3]; + $$[4] = $1[2]; + } + ; + +optMatrixRows: + { + $$[2] = 0; + $$[3] = 3; + } + | ROW '[' stateMatrixRowNum DOT_DOT stateMatrixRowNum ']' + { + /* It seems logical that the matrix row range specifier would have + * to specify a range or more than one row (i.e., $5 > $3). + * However, the ARB_vertex_program spec says "a program will fail + * to load if is greater than ." This means that $3 == $5 + * is valid. + */ + if ($3 > $5) { + yyerror(& @3, state, "invalid matrix row range"); + YYERROR; + } + + $$[2] = $3; + $$[3] = $5; + } + ; + +stateMatrixItem: MATRIX stateMatrixName stateOptMatModifier + { + $$[0] = $2[0]; + $$[1] = $2[1]; + $$[2] = $3; + } + ; + +stateOptMatModifier: + { + $$ = 0; + } + | stateMatModifier + { + $$ = $1; + } + ; + +stateMatModifier: INVERSE + { + $$ = STATE_MATRIX_INVERSE; + } + | TRANSPOSE + { + $$ = STATE_MATRIX_TRANSPOSE; + } + | INVTRANS + { + $$ = STATE_MATRIX_INVTRANS; + } + ; + +stateMatrixRowNum: INTEGER + { + if ($1 > 3) { + yyerror(& @1, state, "invalid matrix row reference"); + YYERROR; + } + + $$ = $1; + } + ; + +stateMatrixName: MODELVIEW stateOptModMatNum + { + $$[0] = STATE_MODELVIEW_MATRIX; + $$[1] = $2; + } + | PROJECTION + { + $$[0] = STATE_PROJECTION_MATRIX; + $$[1] = 0; + } + | MVP + { + $$[0] = STATE_MVP_MATRIX; + $$[1] = 0; + } + | TEXTURE optTexCoordUnitNum + { + $$[0] = STATE_TEXTURE_MATRIX; + $$[1] = $2; + } + | PALETTE '[' statePaletteMatNum ']' + { + YYERROR; + } + | MAT_PROGRAM '[' stateProgramMatNum ']' + { + $$[0] = STATE_PROGRAM_MATRIX; + $$[1] = $3; + } + ; + +stateOptModMatNum: + { + $$ = 0; + } + | stateModMatNum + { + $$ = $1; + } + ; +stateModMatNum: INTEGER + { + /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix + * zero is valid. + */ + if ($1 != 0) { + yyerror(& @1, state, "invalid modelview matrix index"); + YYERROR; + } + + $$ = $1; + } + ; +statePaletteMatNum: INTEGER + { + /* Since GL_ARB_matrix_palette isn't supported, just let any value + * through here. The error will be generated later. + */ + $$ = $1; + } + ; +stateProgramMatNum: INTEGER + { + if ($1 >= state->MaxProgramMatrices) { + yyerror(& @1, state, "invalid program matrix selector"); + YYERROR; + } + + $$ = $1; + } + ; + + + +programSingleItem: progEnvParam | progLocalParam; + +programMultipleItem: progEnvParams | progLocalParams; + +progEnvParams: PROGRAM ENV '[' progEnvParamNums ']' + { + memset($$, 0, sizeof($$)); + $$[0] = state->state_param_enum; + $$[1] = STATE_ENV; + $$[2] = $4[0]; + $$[3] = $4[1]; + } + ; + +progEnvParamNums: progEnvParamNum + { + $$[0] = $1; + $$[1] = $1; + } + | progEnvParamNum DOT_DOT progEnvParamNum + { + $$[0] = $1; + $$[1] = $3; + } + ; + +progEnvParam: PROGRAM ENV '[' progEnvParamNum ']' + { + memset($$, 0, sizeof($$)); + $$[0] = state->state_param_enum; + $$[1] = STATE_ENV; + $$[2] = $4; + $$[3] = $4; + } + ; + +progLocalParams: PROGRAM LOCAL '[' progLocalParamNums ']' + { + memset($$, 0, sizeof($$)); + $$[0] = state->state_param_enum; + $$[1] = STATE_LOCAL; + $$[2] = $4[0]; + $$[3] = $4[1]; + } + +progLocalParamNums: progLocalParamNum + { + $$[0] = $1; + $$[1] = $1; + } + | progLocalParamNum DOT_DOT progLocalParamNum + { + $$[0] = $1; + $$[1] = $3; + } + ; + +progLocalParam: PROGRAM LOCAL '[' progLocalParamNum ']' + { + memset($$, 0, sizeof($$)); + $$[0] = state->state_param_enum; + $$[1] = STATE_LOCAL; + $$[2] = $4; + $$[3] = $4; + } + ; + +progEnvParamNum: INTEGER + { + if ($1 >= state->limits->MaxEnvParams) { + yyerror(& @1, state, "invalid environment parameter reference"); + YYERROR; + } + $$ = $1; + } + ; + +progLocalParamNum: INTEGER + { + if ($1 >= state->limits->MaxLocalParams) { + yyerror(& @1, state, "invalid local parameter reference"); + YYERROR; + } + $$ = $1; + } + ; + + + +paramConstDecl: paramConstScalarDecl | paramConstVector; +paramConstUse: paramConstScalarUse | paramConstVector; + +paramConstScalarDecl: signedFloatConstant + { + $$.count = 1; + $$.data[0] = $1; + } + ; + +paramConstScalarUse: REAL + { + $$.count = 1; + $$.data[0] = $1; + } + | INTEGER + { + $$.count = 1; + $$.data[0] = (float) $1; + } + ; + +paramConstVector: '{' signedFloatConstant '}' + { + $$.count = 1; + $$.data[0] = $2; + } + | '{' signedFloatConstant ',' signedFloatConstant '}' + { + $$.count = 2; + $$.data[0] = $2; + $$.data[1] = $4; + } + | '{' signedFloatConstant ',' signedFloatConstant ',' + signedFloatConstant '}' + { + $$.count = 3; + $$.data[0] = $2; + $$.data[1] = $4; + $$.data[1] = $6; + } + | '{' signedFloatConstant ',' signedFloatConstant ',' + signedFloatConstant ',' signedFloatConstant '}' + { + $$.count = 4; + $$.data[0] = $2; + $$.data[1] = $4; + $$.data[1] = $6; + $$.data[1] = $8; + } + ; + +signedFloatConstant: optionalSign REAL + { + $$ = ($1) ? -$2 : $2; + } + | optionalSign INTEGER + { + $$ = (float)(($1) ? -$2 : $2); + } + ; + +optionalSign: '+' { $$ = FALSE; } + | '-' { $$ = TRUE; } + | { $$ = FALSE; } + ; + +TEMP_statement: TEMP { $$ = $1; } varNameList + ; + +ADDRESS_statement: ADDRESS { $$ = $1; } varNameList + ; + +varNameList: varNameList ',' IDENTIFIER + { + if (!declare_variable(state, $3, $0, & @3)) { + YYERROR; + } + } + | IDENTIFIER + { + if (!declare_variable(state, $1, $0, & @1)) { + YYERROR; + } + } + ; + +OUTPUT_statement: OUTPUT IDENTIFIER '=' resultBinding + { + struct asm_symbol *const s = + declare_variable(state, $2, at_output, & @2); + + if (s == NULL) { + YYERROR; + } else { + s->output_binding = $4; + } + } + ; + +resultBinding: RESULT POSITION + { + if (state->mode == ARB_vertex) { + $$ = VERT_RESULT_HPOS; + } else { + yyerror(& @2, state, "invalid program result name"); + YYERROR; + } + } + | RESULT FOGCOORD + { + if (state->mode == ARB_vertex) { + $$ = VERT_RESULT_FOGC; + } else { + yyerror(& @2, state, "invalid program result name"); + YYERROR; + } + } + | RESULT resultColBinding + { + $$ = $2; + } + | RESULT POINTSIZE + { + if (state->mode == ARB_vertex) { + $$ = VERT_RESULT_PSIZ; + } else { + yyerror(& @2, state, "invalid program result name"); + YYERROR; + } + } + | RESULT TEXCOORD optTexCoordUnitNum + { + if (state->mode == ARB_vertex) { + $$ = VERT_RESULT_TEX0 + $3; + } else { + yyerror(& @2, state, "invalid program result name"); + YYERROR; + } + } + | RESULT DEPTH + { + if (state->mode == ARB_fragment) { + $$ = FRAG_RESULT_DEPTH; + } else { + yyerror(& @2, state, "invalid program result name"); + YYERROR; + } + } + ; + +resultColBinding: COLOR optResultFaceType optResultColorType + { + $$ = $2 + $3; + } + ; + +optResultFaceType: + { + $$ = (state->mode == ARB_vertex) + ? VERT_RESULT_COL0 + : FRAG_RESULT_COLOR; + } + | FRONT + { + if (state->mode == ARB_vertex) { + $$ = VERT_RESULT_COL0; + } else { + yyerror(& @1, state, "invalid program result name"); + YYERROR; + } + } + | BACK + { + if (state->mode == ARB_vertex) { + $$ = VERT_RESULT_BFC0; + } else { + yyerror(& @1, state, "invalid program result name"); + YYERROR; + } + } + ; + +optResultColorType: + { + $$ = 0; + } + | PRIMARY + { + if (state->mode == ARB_vertex) { + $$ = 0; + } else { + yyerror(& @1, state, "invalid program result name"); + YYERROR; + } + } + | SECONDARY + { + if (state->mode == ARB_vertex) { + $$ = 1; + } else { + yyerror(& @1, state, "invalid program result name"); + YYERROR; + } + } + ; + +optFaceType: { $$ = 0; } + | FRONT { $$ = 0; } + | BACK { $$ = 1; } + ; + +optColorType: { $$ = 0; } + | PRIMARY { $$ = 0; } + | SECONDARY { $$ = 1; } + ; + +optTexCoordUnitNum: { $$ = 0; } + | '[' texCoordUnitNum ']' { $$ = $2; } + ; + +optTexImageUnitNum: { $$ = 0; } + | '[' texImageUnitNum ']' { $$ = $2; } + ; + +optLegacyTexUnitNum: { $$ = 0; } + | '[' legacyTexUnitNum ']' { $$ = $2; } + ; + +texCoordUnitNum: INTEGER + { + if ($1 >= state->MaxTextureCoordUnits) { + yyerror(& @1, state, "invalid texture coordinate unit selector"); + YYERROR; + } + + $$ = $1; + } + ; + +texImageUnitNum: INTEGER + { + if ($1 >= state->MaxTextureImageUnits) { + yyerror(& @1, state, "invalid texture image unit selector"); + YYERROR; + } + + $$ = $1; + } + ; + +legacyTexUnitNum: INTEGER + { + if ($1 >= state->MaxTextureUnits) { + yyerror(& @1, state, "invalid texture unit selector"); + YYERROR; + } + + $$ = $1; + } + ; + +ALIAS_statement: ALIAS IDENTIFIER '=' IDENTIFIER + { + struct asm_symbol *exist = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, $2); + struct asm_symbol *target = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, $4); + + + if (exist != NULL) { + yyerror(& @2, state, "redeclared identifier"); + YYERROR; + } else if (target == NULL) { + yyerror(& @4, state, + "undefined variable binding in ALIAS statement"); + YYERROR; + } else { + _mesa_symbol_table_add_symbol(state->st, 0, $2, target); + } + } + ; + +%% + +struct asm_instruction * +asm_instruction_ctor(gl_inst_opcode op, + const struct prog_dst_register *dst, + const struct asm_src_register *src0, + const struct asm_src_register *src1, + const struct asm_src_register *src2) +{ + struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); + + if (inst) { + _mesa_init_instructions(inst, 1); + inst->Base.Opcode = op; + inst->Base.DstReg = *dst; + + inst->Base.SrcReg[0] = src0->Base; + inst->SrcReg[0] = *src0; + + if (src1 != NULL) { + inst->Base.SrcReg[1] = src1->Base; + inst->SrcReg[1] = *src1; + } + + if (src2 != NULL) { + inst->Base.SrcReg[2] = src2->Base; + inst->SrcReg[2] = *src2; + } + } + + return inst; +} + + +void +init_dst_reg(struct prog_dst_register *r) +{ + memset(r, 0, sizeof(*r)); + r->File = PROGRAM_UNDEFINED; + r->WriteMask = WRITEMASK_XYZW; + r->CondMask = COND_TR; + r->CondSwizzle = SWIZZLE_NOOP; +} + + +void +init_src_reg(struct asm_src_register *r) +{ + memset(r, 0, sizeof(*r)); + r->Base.File = PROGRAM_UNDEFINED; + r->Base.Swizzle = SWIZZLE_NOOP; + r->Symbol = NULL; +} + + +/** + * Validate the set of inputs used by a program + * + * Validates that legal sets of inputs are used by the program. In this case + * "used" included both reading the input or binding the input to a name using + * the \c ATTRIB command. + * + * \return + * \c TRUE if the combination of inputs used is valid, \c FALSE otherwise. + */ +int +validate_inputs(struct YYLTYPE *locp, struct asm_parser_state *state) +{ + const int inputs = state->prog->InputsRead | state->InputsBound; + + if (((inputs & 0x0ffff) & (inputs >> 16)) != 0) { + yyerror(locp, state, "illegal use of generic attribute and name attribute"); + return 0; + } + + return 1; +} + + +struct asm_symbol * +declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, + struct YYLTYPE *locp) +{ + struct asm_symbol *s = NULL; + struct asm_symbol *exist = (struct asm_symbol *) + _mesa_symbol_table_find_symbol(state->st, 0, name); + + + if (exist != NULL) { + yyerror(locp, state, "redeclared identifier"); + } else { + s = calloc(1, sizeof(struct asm_symbol)); + s->name = name; + s->type = t; + + switch (t) { + case at_temp: + if (state->prog->NumTemporaries >= state->limits->MaxTemps) { + yyerror(locp, state, "too many temporaries declared"); + free(s); + return NULL; + } + + s->temp_binding = state->prog->NumTemporaries; + state->prog->NumTemporaries++; + break; + + case at_address: + if (state->prog->NumAddressRegs >= state->limits->MaxAddressRegs) { + yyerror(locp, state, "too many address registers declared"); + free(s); + return NULL; + } + + /* FINISHME: Add support for multiple address registers. + */ + state->prog->NumAddressRegs++; + break; + + default: + break; + } + + _mesa_symbol_table_add_symbol(state->st, 0, s->name, s); + } + + return s; +} + + +int add_state_reference(struct gl_program_parameter_list *param_list, + const gl_state_index tokens[STATE_LENGTH]) +{ + const GLuint size = 4; /* XXX fix */ + char *name; + GLint index; + + name = _mesa_program_state_string(tokens); + index = _mesa_add_parameter(param_list, PROGRAM_STATE_VAR, name, + size, GL_NONE, + NULL, (gl_state_index *) tokens, 0x0); + param_list->StateFlags |= _mesa_program_state_flags(tokens); + + /* free name string here since we duplicated it in add_parameter() */ + _mesa_free(name); + + return index; +} + + +int +initialize_symbol_from_state(struct gl_program *prog, + struct asm_symbol *param_var, + const gl_state_index tokens[STATE_LENGTH]) +{ + int idx = -1; + gl_state_index state_tokens[STATE_LENGTH]; + + + memcpy(state_tokens, tokens, sizeof(state_tokens)); + + param_var->type = at_param; + + /* If we are adding a STATE_MATRIX that has multiple rows, we need to + * unroll it and call add_state_reference() for each row + */ + if ((state_tokens[0] == STATE_MODELVIEW_MATRIX || + state_tokens[0] == STATE_PROJECTION_MATRIX || + state_tokens[0] == STATE_MVP_MATRIX || + state_tokens[0] == STATE_TEXTURE_MATRIX || + state_tokens[0] == STATE_PROGRAM_MATRIX) + && (state_tokens[2] != state_tokens[3])) { + int row; + const int first_row = state_tokens[2]; + const int last_row = state_tokens[3]; + + for (row = first_row; row <= last_row; row++) { + state_tokens[2] = state_tokens[3] = row; + + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + } + else { + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + + return idx; +} + + +int +initialize_symbol_from_param(struct gl_program *prog, + struct asm_symbol *param_var, + const gl_state_index tokens[STATE_LENGTH]) +{ + int idx = -1; + gl_state_index state_tokens[STATE_LENGTH]; + + + memcpy(state_tokens, tokens, sizeof(state_tokens)); + + assert((state_tokens[0] == STATE_VERTEX_PROGRAM) + || (state_tokens[0] == STATE_FRAGMENT_PROGRAM)); + assert((state_tokens[1] == STATE_ENV) + || (state_tokens[1] == STATE_LOCAL)); + + param_var->type = at_param; + + /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements, + * we need to unroll it and call add_state_reference() for each row + */ + if (state_tokens[2] != state_tokens[3]) { + int row; + const int first_row = state_tokens[2]; + const int last_row = state_tokens[3]; + + for (row = first_row; row <= last_row; row++) { + state_tokens[2] = state_tokens[3] = row; + + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + } + else { + idx = add_state_reference(prog->Parameters, state_tokens); + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + } + + return idx; +} + + +int +initialize_symbol_from_const(struct gl_program *prog, + struct asm_symbol *param_var, + const struct asm_vector *vec) +{ + const int idx = _mesa_add_parameter(prog->Parameters, PROGRAM_CONSTANT, + NULL, vec->count, GL_NONE, vec->data, + NULL, 0x0); + + param_var->type = at_param; + + if (param_var->param_binding_begin == ~0U) + param_var->param_binding_begin = idx; + param_var->param_binding_length++; + + return idx; +} + + +void +yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) +{ + (void) state; + + fprintf(stderr, "line %u, char %u: error: %s\n", locp->first_line, + locp->first_column, s); +} + +GLboolean +_mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, + GLsizei len, struct asm_parser_state *state) +{ + struct gl_program_constants limits; + struct asm_instruction *inst; + unsigned i; + GLubyte *strz; + + state->prog->Target = target; + state->prog->Parameters = _mesa_new_parameter_list(); + + /* Make a copy of the program string and force it to be NUL-terminated. + */ + strz = (GLubyte *) _mesa_malloc(len + 1); + if (strz == NULL) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); + return GL_FALSE; + } + _mesa_memcpy (strz, str, len); + strz[len] = '\0'; + + state->prog->String = strz; + + state->st = _mesa_symbol_table_ctor(); + + /* All of these limits should come from ctx. + */ + limits.MaxInstructions = 128; + limits.MaxAluInstructions = 128; + limits.MaxTexInstructions = 128; + limits.MaxTexIndirections = 128; + limits.MaxAttribs = 16; + limits.MaxTemps = 128; + limits.MaxAddressRegs = 1; + limits.MaxParameters = 128; + limits.MaxLocalParams = 256; + limits.MaxEnvParams = 128; + limits.MaxNativeInstructions = 128; + limits.MaxNativeAluInstructions = 128; + limits.MaxNativeTexInstructions = 128; + limits.MaxNativeTexIndirections = 128; + limits.MaxNativeAttribs = 16; + limits.MaxNativeTemps = 128; + limits.MaxNativeAddressRegs = 1; + limits.MaxNativeParameters = 128; + limits.MaxUniformComponents = 0; + + state->limits = & limits; + + state->MaxTextureImageUnits = 16; + state->MaxTextureCoordUnits = 8; + state->MaxTextureUnits = 8; + state->MaxClipPlanes = 6; + state->MaxLights = 8; + state->MaxProgramMatrices = 8; + + state->state_param_enum = (target == GL_VERTEX_PROGRAM_ARB) + ? STATE_VERTEX_PROGRAM : STATE_FRAGMENT_PROGRAM; + + _mesa_set_program_error(ctx, -1, NULL); + + _mesa_program_lexer_ctor(& state->scanner, state, (const char *) str, len); + yyparse(state); + _mesa_program_lexer_dtor(state->scanner); + + + if (! _mesa_layout_parameters(state)) { + fprintf(stderr, "error: layout\n"); + return GL_FALSE; + } + + + + /* Add one instruction to store the "END" instruction. + */ + state->prog->Instructions = + _mesa_alloc_instructions(state->prog->NumInstructions + 1); + inst = state->inst_head; + for (i = 0; i < state->prog->NumInstructions; i++) { + struct asm_instruction *const temp = inst->next; + + state->prog->Instructions[i] = inst->Base; + _mesa_free(inst); + + inst = temp; + } + + /* Finally, tag on an OPCODE_END instruction */ + { + const GLuint numInst = state->prog->NumInstructions; + _mesa_init_instructions(state->prog->Instructions + numInst, 1); + state->prog->Instructions[numInst].Opcode = OPCODE_END; + } + state->prog->NumInstructions++; + + /* + * Initialize native counts to logical counts. The device driver may + * change them if program is translated into a hardware program. + */ + state->prog->NumNativeInstructions = state->prog->NumInstructions; + state->prog->NumNativeTemporaries = state->prog->NumTemporaries; + state->prog->NumNativeParameters = state->prog->NumParameters; + state->prog->NumNativeAttributes = state->prog->NumAttributes; + state->prog->NumNativeAddressRegs = state->prog->NumAddressRegs; + + return GL_TRUE; +} diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c new file mode 100644 index 0000000000..b365267d4d --- /dev/null +++ b/src/mesa/shader/program_parse_extra.c @@ -0,0 +1,109 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include +#include "main/mtypes.h" +#include "prog_instruction.h" +#include "program_parser.h" + + +/** + * Extra assembly-level parser routines + * + * \author Ian Romanick + */ + +int +_mesa_ARBvp_parse_option(struct asm_parser_state *state, const char *option) +{ + if (strcmp(option, "ARB_position_invariant") == 0) { + state->option.PositionInvariant = 1; + return 1; + } + + return 0; +} + + +int +_mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) +{ + /* All of the options currently supported start with "ARB_". The code is + * currently structured with nested if-statements because eventually options + * that start with "NV_" will be supported. This structure will result in + * less churn when those options are added. + */ + if (strncmp(option, "ARB_", 4) == 0) { + /* Advance the pointer past the "ARB_" prefix. + */ + option += 4; + + + if (strncmp(option, "fog_", 4) == 0) { + option += 4; + + if (state->option.Fog == OPTION_NONE) { + if (strcmp(option, "exp") == 0) { + state->option.Fog = OPTION_FOG_EXP; + return 1; + } else if (strcmp(option, "exp2") == 0) { + state->option.Fog = OPTION_FOG_EXP2; + return 1; + } else if (strcmp(option, "linear") == 0) { + state->option.Fog = OPTION_FOG_LINEAR; + return 1; + } + } + + return 0; + } else if (strncmp(option, "precision_hint_", 15) == 0) { + option += 15; + + if (state->option.PrecisionHint == OPTION_NONE) { + if (strcmp(option, "nicest") == 0) { + state->option.PrecisionHint = OPTION_NICEST; + return 1; + } else if (strcmp(option, "fastest") == 0) { + state->option.PrecisionHint = OPTION_FASTEST; + return 1; + } + } + + return 0; + } else if (strcmp(option, "draw_buffers") == 0) { + /* FINISHME: This should validate that the driver support the + * FINISHME: GL_ARB_draw_buffers extension. + */ + state->option.DrawBuffers = 1; + return 1; + } else if (strcmp(option, "fragment_program_shadow") == 0) { + /* FINISHME: This should validate that the driver support the + * FINISHME: GL_ARB_fragment_program_shadow extension. + */ + state->option.Shadow = 1; + return 1; + } + } + + return 0; +} diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h new file mode 100644 index 0000000000..20190470ea --- /dev/null +++ b/src/mesa/shader/program_parser.h @@ -0,0 +1,256 @@ +/* + * Copyright © 2009 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#pragma once + +#include "main/config.h" + +enum asm_type { + at_none, + at_address, + at_attrib, + at_param, + at_temp, + at_output, +}; + +struct asm_symbol { + const char *name; + enum asm_type type; + unsigned attrib_binding; + unsigned output_binding; /**< Output / result register number. */ + + /** + * One of PROGRAM_STATE_VAR, PROGRAM_LOCAL_PARAM, or PROGRAM_ENV_PARAM. + */ + unsigned param_binding_type; + + /** + * Offset into the program_parameter_list where the tokens representing our + * bound state (or constants) start. + */ + unsigned param_binding_begin; + + /* This is how many entries in the the program_parameter_list we take up + * with our state tokens or constants. Note that this is _not_ the same as + * the number of param registers we eventually use. + */ + unsigned param_binding_length; + + /** + * Index of the temp register assigned to this variable. + */ + unsigned temp_binding; + + /** + * Flag whether or not a PARAM is an array + */ + unsigned param_is_array:1; + + + /** + * Flag whether or not a PARAM array is accessed indirectly + */ + unsigned param_accessed_indirectly:1; + + + /** + * \brief Is first pass of parameter layout done with this variable? + * + * The parameter layout routine operates in two passes. This flag tracks + * whether or not the first pass has handled this variable. + * + * \sa _mesa_layout_parameters + */ + unsigned pass1_done:1; +}; + + +struct asm_vector { + unsigned count; + float data[4]; +}; + + +struct asm_swizzle_mask { + unsigned swizzle:12; + unsigned mask:4; +}; + + +struct asm_src_register { + struct prog_src_register Base; + + /** + * Symbol associated with indirect access to parameter arrays. + * + * If \c Base::RelAddr is 1, this will point to the symbol for the parameter + * that is being dereferenced. Further, \c Base::Index will be the offset + * from the address register being used. + */ + struct asm_symbol *Symbol; +}; + + +struct asm_instruction { + struct prog_instruction Base; + struct asm_instruction *next; + struct asm_src_register SrcReg[3]; +}; + + +struct asm_parser_state { + struct gl_program *prog; + + /** + * Per-program target limits + */ + struct gl_program_constants *limits; + + struct _mesa_symbol_table *st; + + /** + * State for the lexer. + */ + void *scanner; + + /** + * Linked list of instructions generated during parsing. + */ + /*@{*/ + struct asm_instruction *inst_head; + struct asm_instruction *inst_tail; + /*@}*/ + + + /** + * Selected limits copied from gl_constants + * + * These are limits from the GL context, but various bits in the program + * must be validated against these values. + */ + /*@{*/ + unsigned MaxTextureCoordUnits; + unsigned MaxTextureImageUnits; + unsigned MaxTextureUnits; + unsigned MaxClipPlanes; + unsigned MaxLights; + unsigned MaxProgramMatrices; + /*@}*/ + + /** + * Value to use in state vector accessors for environment and local + * parameters + */ + unsigned state_param_enum; + + + /** + * Input attributes bound to specific names + * + * This is only needed so that errors can be properly produced when + * multiple ATTRIB statements bind illegal combinations of vertex + * attributes. + */ + unsigned InputsBound; + + enum { + invalid_mode = 0, + ARB_vertex, + ARB_fragment + } mode; + + struct { + unsigned PositionInvariant:1; + unsigned Fog:2; + unsigned PrecisionHint:2; + unsigned DrawBuffers:1; + unsigned Shadow:1; + } option; + + struct { + unsigned TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; + unsigned ShadowSamplers; + unsigned UsesKill:1; + } fragment; +}; + +#define OPTION_NONE 0 +#define OPTION_FOG_EXP 1 +#define OPTION_FOG_EXP2 2 +#define OPTION_FOG_LINEAR 3 +#define OPTION_NICEST 1 +#define OPTION_FASTEST 2 + +typedef struct YYLTYPE { + int first_line; + int first_column; + int last_line; + int last_column; + int position; +} YYLTYPE; + +#define YYLTYPE_IS_DECLARED 1 +#define YYLTYPE_IS_TRIVIAL 1 + + +#ifndef MTYPES_H +struct __GLcontextRec; +typedef struct __GLcontextRec GLcontext; +#endif + +extern GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, + const GLubyte *str, GLsizei len, struct asm_parser_state *state); + + + +/* From program_lexer.l. */ +extern void _mesa_program_lexer_dtor(void *scanner); + +extern void _mesa_program_lexer_ctor(void **scanner, + struct asm_parser_state *state, const char *string, size_t len); + + +/** + *\name From program_parse_extra.c + */ +/*@{*/ + +/** + * Parses and processes an option string to an ARB vertex program + * + * \return + * Non-zero on success, zero on failure. + */ +extern int _mesa_ARBvp_parse_option(struct asm_parser_state *state, + const char *option); + +/** + * Parses and processes an option string to an ARB fragment program + * + * \return + * Non-zero on success, zero on failure. + */ +extern int _mesa_ARBfp_parse_option(struct asm_parser_state *state, + const char *option); + +/*@}*/ diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c new file mode 100644 index 0000000000..b90c495cdb --- /dev/null +++ b/src/mesa/shader/symbol_table.c @@ -0,0 +1,334 @@ +/* + * Copyright © 2008 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include +#include +#include +#include +#include + +#include "symbol_table.h" +#include "hash_table.h" + +struct symbol { + /** + * Link to the next symbol in the table with the same name + * + * The linked list of symbols with the same name is ordered by scope + * from inner-most to outer-most. + */ + struct symbol *next_with_same_name; + + + /** + * Link to the next symbol in the table with the same scope + * + * The linked list of symbols with the same scope is unordered. Symbols + * in this list my have unique names. + */ + struct symbol *next_with_same_scope; + + + /** + * Header information for the list of symbols with the same name. + */ + struct symbol_header *hdr; + + + /** + * Name space of the symbol + * + * Name space are arbitrary user assigned integers. No two symbols can + * exist in the same name space at the same scope level. + */ + int name_space; + + + /** + * Arbitrary user supplied data. + */ + void *data; +}; + + +/** + */ +struct symbol_header { + /** Symbol name. */ + const char *name; + + /** Linked list of symbols with the same name. */ + struct symbol *symbols; +}; + + +/** + * Element of the scope stack. + */ +struct scope_level { + /** Link to next (inner) scope level. */ + struct scope_level *next; + + /** Linked list of symbols with the same scope. */ + struct symbol *symbols; +}; + + +/** + * + */ +struct _mesa_symbol_table { + /** Hash table containing all symbols in the symbol table. */ + struct hash_table *ht; + + /** Top of scope stack. */ + struct scope_level *current_scope; +}; + + +struct _mesa_symbol_table_iterator { + /** + * Name space of symbols returned by this iterator. + */ + int name_space; + + + /** + * Currently iterated symbol + * + * The next call to \c _mesa_symbol_table_iterator_get will return this + * value. It will also update this value to the value that should be + * returned by the next call. + */ + struct symbol *curr; +}; + + +static void +check_symbol_table(struct _mesa_symbol_table *table) +{ +#if 1 + struct scope_level *scope; + + for (scope = table->current_scope; scope != NULL; scope = scope->next) { + struct symbol *sym; + + for (sym = scope->symbols + ; sym != NULL + ; sym = sym->next_with_same_name) { + const struct symbol_header *const hdr = sym->hdr; + struct symbol *sym2; + + for (sym2 = hdr->symbols + ; sym2 != NULL + ; sym2 = sym2->next_with_same_name) { + assert(sym2->hdr == hdr); + } + } + } +#endif +} + +void +_mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table) +{ + struct scope_level *const scope = table->current_scope; + struct symbol *sym = scope->symbols; + + table->current_scope = scope->next; + + free(scope); + + while (sym != NULL) { + struct symbol *const next = sym->next_with_same_scope; + struct symbol_header *const hdr = sym->hdr; + + assert(hdr->symbols == sym); + + hdr->symbols = sym->next_with_same_name; + + free(sym); + + sym = next; + } + + check_symbol_table(table); +} + + +void +_mesa_symbol_table_push_scope(struct _mesa_symbol_table *table) +{ + struct scope_level *const scope = calloc(1, sizeof(*scope)); + + scope->next = table->current_scope; + table->current_scope = scope; +} + + +static struct symbol_header * +find_symbol(struct _mesa_symbol_table *table, const char *name) +{ + return (struct symbol_header *) hash_table_find(table->ht, name); +} + + +struct _mesa_symbol_table_iterator * +_mesa_symbol_table_iterator_ctor(struct _mesa_symbol_table *table, + int name_space, const char *name) +{ + struct _mesa_symbol_table_iterator *iter = calloc(1, sizeof(*iter)); + struct symbol_header *const hdr = find_symbol(table, name); + + iter->name_space = name_space; + + if (hdr != NULL) { + struct symbol *sym; + + for (sym = hdr->symbols; sym != NULL; sym = sym->next_with_same_name) { + assert(sym->hdr == hdr); + + if ((name_space == -1) || (sym->name_space == name_space)) { + iter->curr = sym; + break; + } + } + } + + return iter; +} + + +void +_mesa_symbol_table_iterator_dtor(struct _mesa_symbol_table_iterator *iter) +{ + free(iter); +} + + +void * +_mesa_symbol_table_iterator_get(struct _mesa_symbol_table_iterator *iter) +{ + return (iter->curr == NULL) ? NULL : iter->curr->data; +} + + +int +_mesa_symbol_table_iterator_next(struct _mesa_symbol_table_iterator *iter) +{ + struct symbol_header *hdr; + + if (iter->curr == NULL) { + return 0; + } + + hdr = iter->curr->hdr; + iter->curr = iter->curr->next_with_same_name; + + while (iter->curr != NULL) { + assert(iter->curr->hdr == hdr); + + if ((iter->name_space == -1) + || (iter->curr->name_space == iter->name_space)) { + return 1; + } + + iter->curr = iter->curr->next_with_same_name; + } + + return 0; +} + + +void * +_mesa_symbol_table_find_symbol(struct _mesa_symbol_table *table, + int name_space, const char *name) +{ + struct symbol_header *const hdr = find_symbol(table, name); + + if (hdr != NULL) { + struct symbol *sym; + + + for (sym = hdr->symbols; sym != NULL; sym = sym->next_with_same_name) { + assert(sym->hdr == hdr); + + if ((name_space == -1) || (sym->name_space == name_space)) { + return sym->data; + } + } + } + + return NULL; +} + + +int +_mesa_symbol_table_add_symbol(struct _mesa_symbol_table *table, + int name_space, const char *name, + void *declaration) +{ + check_symbol_table(table); + + struct symbol_header *hdr = find_symbol(table, name); + struct symbol *sym; + + check_symbol_table(table); + + if (hdr == NULL) { + hdr = calloc(1, sizeof(*hdr)); + hdr->name = name; + + hash_table_insert(table->ht, hdr, name); + } + + check_symbol_table(table); + + sym = calloc(1, sizeof(*sym)); + sym->next_with_same_name = hdr->symbols; + sym->next_with_same_scope = table->current_scope->symbols; + sym->hdr = hdr; + sym->name_space = name_space; + sym->data = declaration; + + assert(sym->hdr == hdr); + + hdr->symbols = sym; + table->current_scope->symbols = sym; + + check_symbol_table(table); + return 0; +} + + +struct _mesa_symbol_table * +_mesa_symbol_table_ctor(void) +{ + struct _mesa_symbol_table *table = calloc(1, sizeof(*table)); + + table->ht = hash_table_ctor(32, hash_table_string_hash, + hash_table_string_compare); + + _mesa_symbol_table_push_scope(table); + + return table; +} diff --git a/src/mesa/shader/symbol_table.h b/src/mesa/shader/symbol_table.h new file mode 100644 index 0000000000..c543615761 --- /dev/null +++ b/src/mesa/shader/symbol_table.h @@ -0,0 +1,54 @@ +/* + * Copyright © 2008 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#ifndef MESA_SYMBOL_TABLE_H +#define MESA_SYMBOL_TABLE_H + +struct _mesa_symbol_table; +struct _mesa_symbol_table_iterator; + +extern void _mesa_symbol_table_push_scope(struct _mesa_symbol_table *table); + +extern void _mesa_symbol_table_pop_scope(struct _mesa_symbol_table *table); + +extern int _mesa_symbol_table_add_symbol(struct _mesa_symbol_table *symtab, + int name_space, const char *name, void *declaration); + +extern void *_mesa_symbol_table_find_symbol( + struct _mesa_symbol_table *symtab, int name_space, const char *name); + +extern struct _mesa_symbol_table *_mesa_symbol_table_ctor(void); + + +extern struct _mesa_symbol_table_iterator *_mesa_symbol_table_iterator_ctor( + struct _mesa_symbol_table *table, int name_space, const char *name); + +extern void _mesa_symbol_table_iterator_dtor( + struct _mesa_symbol_table_iterator *); + +extern void *_mesa_symbol_table_iterator_get( + struct _mesa_symbol_table_iterator *iter); + +extern int _mesa_symbol_table_iterator_next( + struct _mesa_symbol_table_iterator *iter); + +#endif /* MESA_SYMBOL_TABLE_H */ diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index b4b36368cf..f07f96d69e 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -218,21 +218,27 @@ SHADER_SOURCES = \ shader/arbprogram.c \ shader/atifragshader.c \ shader/grammar/grammar_mesa.c \ + shader/hash_table.c \ + shader/lex.yy.c \ shader/nvfragparse.c \ shader/nvprogram.c \ shader/nvvertparse.c \ shader/program.c \ + shader/program_parse.tab.c \ + shader/program_parse_extra.c \ shader/prog_cache.c \ shader/prog_execute.c \ shader/prog_instruction.c \ shader/prog_noise.c \ shader/prog_optimize.c \ shader/prog_parameter.c \ + shader/prog_parameter_layout.c \ shader/prog_print.c \ shader/prog_statevars.c \ shader/prog_uniform.c \ shader/programopt.c \ - shader/shader_api.c \ + shader/symbol_table.c \ + shader/shader_api.c SLANG_SOURCES = \ shader/slang/slang_builtin.c \ -- cgit v1.2.3 From 69d3d19b54c46cb7b0e05c04a5304830a1ee2691 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 10:51:18 -0700 Subject: parser: Anonymous constants come from the PROGRAM_CONSTANT file --- src/mesa/shader/program_parse.tab.c | 396 ++++++++++++++++++------------------ src/mesa/shader/program_parse.y | 4 +- 2 files changed, 202 insertions(+), 198 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 090c399f44..bf48b9752f 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -743,27 +743,27 @@ static const yytype_uint16 yyrline[] = 314, 317, 318, 321, 327, 334, 341, 349, 356, 364, 375, 381, 387, 388, 389, 390, 391, 394, 406, 419, 432, 454, 463, 472, 479, 488, 516, 558, 569, 590, - 598, 604, 628, 645, 645, 647, 654, 666, 667, 668, - 671, 683, 695, 713, 724, 736, 738, 739, 740, 741, - 744, 744, 744, 744, 745, 748, 749, 750, 751, 752, - 753, 756, 774, 778, 784, 788, 792, 796, 800, 804, - 808, 812, 818, 829, 829, 830, 832, 836, 840, 844, - 850, 850, 852, 868, 891, 894, 905, 911, 917, 918, - 925, 931, 937, 945, 951, 957, 965, 971, 977, 985, - 986, 989, 990, 991, 992, 993, 994, 995, 996, 997, - 998, 1001, 1010, 1014, 1018, 1024, 1033, 1037, 1041, 1045, - 1049, 1055, 1061, 1068, 1073, 1081, 1091, 1093, 1101, 1107, - 1111, 1115, 1121, 1132, 1141, 1145, 1150, 1154, 1158, 1162, - 1168, 1175, 1179, 1185, 1193, 1204, 1211, 1215, 1221, 1231, - 1242, 1246, 1264, 1273, 1276, 1282, 1286, 1290, 1296, 1307, - 1312, 1317, 1322, 1327, 1331, 1339, 1342, 1347, 1360, 1368, - 1381, 1381, 1383, 1383, 1385, 1395, 1400, 1407, 1417, 1426, - 1431, 1438, 1448, 1458, 1470, 1470, 1471, 1471, 1473, 1480, - 1485, 1492, 1497, 1503, 1511, 1522, 1526, 1532, 1533, 1534, - 1537, 1537, 1540, 1540, 1543, 1549, 1557, 1570, 1579, 1588, - 1592, 1601, 1610, 1621, 1628, 1633, 1642, 1654, 1657, 1666, - 1677, 1678, 1679, 1682, 1683, 1684, 1687, 1688, 1691, 1692, - 1695, 1696, 1699, 1710, 1721, 1732 + 600, 606, 630, 647, 647, 649, 656, 668, 669, 670, + 673, 685, 697, 715, 726, 738, 740, 741, 742, 743, + 746, 746, 746, 746, 747, 750, 751, 752, 753, 754, + 755, 758, 776, 780, 786, 790, 794, 798, 802, 806, + 810, 814, 820, 831, 831, 832, 834, 838, 842, 846, + 852, 852, 854, 870, 893, 896, 907, 913, 919, 920, + 927, 933, 939, 947, 953, 959, 967, 973, 979, 987, + 988, 991, 992, 993, 994, 995, 996, 997, 998, 999, + 1000, 1003, 1012, 1016, 1020, 1026, 1035, 1039, 1043, 1047, + 1051, 1057, 1063, 1070, 1075, 1083, 1093, 1095, 1103, 1109, + 1113, 1117, 1123, 1134, 1143, 1147, 1152, 1156, 1160, 1164, + 1170, 1177, 1181, 1187, 1195, 1206, 1213, 1217, 1223, 1233, + 1244, 1248, 1266, 1275, 1278, 1284, 1288, 1292, 1298, 1309, + 1314, 1319, 1324, 1329, 1333, 1341, 1344, 1349, 1362, 1370, + 1383, 1383, 1385, 1385, 1387, 1397, 1402, 1409, 1419, 1428, + 1433, 1440, 1450, 1460, 1472, 1472, 1473, 1473, 1475, 1482, + 1487, 1494, 1499, 1505, 1513, 1524, 1528, 1534, 1535, 1536, + 1539, 1539, 1542, 1542, 1545, 1551, 1559, 1572, 1581, 1590, + 1594, 1603, 1612, 1623, 1630, 1635, 1644, 1656, 1659, 1668, + 1679, 1680, 1681, 1684, 1685, 1686, 1689, 1690, 1693, 1694, + 1697, 1698, 1701, 1712, 1723, 1734 }; #endif @@ -2466,7 +2466,9 @@ yyreduce: #line 591 "program_parse.y" { init_src_reg(& (yyval.src_reg)); - (yyval.src_reg).Base.File = (yyvsp[(1) - (1)].temp_sym).param_binding_type; + (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) + ? (yyvsp[(1) - (1)].temp_sym).param_binding_type + : PROGRAM_CONSTANT; (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].temp_sym).param_binding_begin; ;} break; @@ -2474,7 +2476,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 599 "program_parse.y" +#line 601 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2485,7 +2487,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 605 "program_parse.y" +#line 607 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2512,7 +2514,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 629 "program_parse.y" +#line 631 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2532,7 +2534,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 648 "program_parse.y" +#line 650 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2542,7 +2544,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 655 "program_parse.y" +#line 657 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2557,28 +2559,28 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 666 "program_parse.y" +#line 668 "program_parse.y" { (yyval.integer) = 0; ;} break; case 58: /* Line 1455 of yacc.c */ -#line 667 "program_parse.y" +#line 669 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 59: /* Line 1455 of yacc.c */ -#line 668 "program_parse.y" +#line 670 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 60: /* Line 1455 of yacc.c */ -#line 672 "program_parse.y" +#line 674 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2593,7 +2595,7 @@ yyreduce: case 61: /* Line 1455 of yacc.c */ -#line 684 "program_parse.y" +#line 686 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2608,7 +2610,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 696 "program_parse.y" +#line 698 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2629,7 +2631,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 714 "program_parse.y" +#line 716 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2643,7 +2645,7 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 725 "program_parse.y" +#line 727 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2658,21 +2660,21 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 741 "program_parse.y" +#line 743 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 74: /* Line 1455 of yacc.c */ -#line 745 "program_parse.y" +#line 747 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 757 "program_parse.y" +#line 759 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2693,7 +2695,7 @@ yyreduce: case 82: /* Line 1455 of yacc.c */ -#line 775 "program_parse.y" +#line 777 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2702,7 +2704,7 @@ yyreduce: case 83: /* Line 1455 of yacc.c */ -#line 779 "program_parse.y" +#line 781 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2711,7 +2713,7 @@ yyreduce: case 84: /* Line 1455 of yacc.c */ -#line 785 "program_parse.y" +#line 787 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2720,7 +2722,7 @@ yyreduce: case 85: /* Line 1455 of yacc.c */ -#line 789 "program_parse.y" +#line 791 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2729,7 +2731,7 @@ yyreduce: case 86: /* Line 1455 of yacc.c */ -#line 793 "program_parse.y" +#line 795 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2738,7 +2740,7 @@ yyreduce: case 87: /* Line 1455 of yacc.c */ -#line 797 "program_parse.y" +#line 799 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); ;} @@ -2747,7 +2749,7 @@ yyreduce: case 88: /* Line 1455 of yacc.c */ -#line 801 "program_parse.y" +#line 803 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_FOG; ;} @@ -2756,7 +2758,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 805 "program_parse.y" +#line 807 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2765,7 +2767,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 809 "program_parse.y" +#line 811 "program_parse.y" { YYERROR; ;} @@ -2774,7 +2776,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 813 "program_parse.y" +#line 815 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2783,7 +2785,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 819 "program_parse.y" +#line 821 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2797,7 +2799,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 833 "program_parse.y" +#line 835 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2806,7 +2808,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 837 "program_parse.y" +#line 839 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2815,7 +2817,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 841 "program_parse.y" +#line 843 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2824,7 +2826,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 845 "program_parse.y" +#line 847 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2833,7 +2835,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 853 "program_parse.y" +#line 855 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2852,7 +2854,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 869 "program_parse.y" +#line 871 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -2877,7 +2879,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 891 "program_parse.y" +#line 893 "program_parse.y" { (yyval.integer) = 0; ;} @@ -2886,7 +2888,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 895 "program_parse.y" +#line 897 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -2900,7 +2902,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 906 "program_parse.y" +#line 908 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -2909,7 +2911,7 @@ yyreduce: case 107: /* Line 1455 of yacc.c */ -#line 912 "program_parse.y" +#line 914 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -2918,7 +2920,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 919 "program_parse.y" +#line 921 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -2928,7 +2930,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 926 "program_parse.y" +#line 928 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2939,7 +2941,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 934 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2950,7 +2952,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 938 "program_parse.y" +#line 940 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2961,7 +2963,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 946 "program_parse.y" +#line 948 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2972,7 +2974,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 952 "program_parse.y" +#line 954 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2983,7 +2985,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 958 "program_parse.y" +#line 960 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2994,7 +2996,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 966 "program_parse.y" +#line 968 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3005,7 +3007,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 972 "program_parse.y" +#line 974 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3016,7 +3018,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 978 "program_parse.y" +#line 980 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3027,91 +3029,91 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 985 "program_parse.y" +#line 987 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 120: /* Line 1455 of yacc.c */ -#line 986 "program_parse.y" +#line 988 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 121: /* Line 1455 of yacc.c */ -#line 989 "program_parse.y" +#line 991 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 122: /* Line 1455 of yacc.c */ -#line 990 "program_parse.y" +#line 992 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 123: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 993 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 124: /* Line 1455 of yacc.c */ -#line 992 "program_parse.y" +#line 994 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 125: /* Line 1455 of yacc.c */ -#line 993 "program_parse.y" +#line 995 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 126: /* Line 1455 of yacc.c */ -#line 994 "program_parse.y" +#line 996 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 995 "program_parse.y" +#line 997 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 996 "program_parse.y" +#line 998 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 997 "program_parse.y" +#line 999 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 998 "program_parse.y" +#line 1000 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1002 "program_parse.y" +#line 1004 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3123,7 +3125,7 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1011 "program_parse.y" +#line 1013 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3132,7 +3134,7 @@ yyreduce: case 133: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1017 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3141,7 +3143,7 @@ yyreduce: case 134: /* Line 1455 of yacc.c */ -#line 1019 "program_parse.y" +#line 1021 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3150,7 +3152,7 @@ yyreduce: case 135: /* Line 1455 of yacc.c */ -#line 1025 "program_parse.y" +#line 1027 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3162,7 +3164,7 @@ yyreduce: case 136: /* Line 1455 of yacc.c */ -#line 1034 "program_parse.y" +#line 1036 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3171,7 +3173,7 @@ yyreduce: case 137: /* Line 1455 of yacc.c */ -#line 1038 "program_parse.y" +#line 1040 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3180,7 +3182,7 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1042 "program_parse.y" +#line 1044 "program_parse.y" { (yyval.integer) = STATE_ATTENUATION; ;} @@ -3189,7 +3191,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1046 "program_parse.y" +#line 1048 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3198,7 +3200,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1050 "program_parse.y" +#line 1052 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3207,7 +3209,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1056 "program_parse.y" +#line 1058 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3216,7 +3218,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1062 "program_parse.y" +#line 1064 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3226,7 +3228,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1069 "program_parse.y" +#line 1071 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3236,7 +3238,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1074 "program_parse.y" +#line 1076 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3247,7 +3249,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1082 "program_parse.y" +#line 1084 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3260,7 +3262,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1094 "program_parse.y" +#line 1096 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3271,7 +3273,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1102 "program_parse.y" +#line 1104 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3280,7 +3282,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1108 "program_parse.y" +#line 1110 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3289,7 +3291,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" +#line 1114 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3298,7 +3300,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1116 "program_parse.y" +#line 1118 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3307,7 +3309,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1122 "program_parse.y" +#line 1124 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3321,7 +3323,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1133 "program_parse.y" +#line 1135 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3333,7 +3335,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1142 "program_parse.y" +#line 1144 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3342,7 +3344,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1146 "program_parse.y" +#line 1148 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3351,7 +3353,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1151 "program_parse.y" +#line 1153 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3360,7 +3362,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1157 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3369,7 +3371,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1159 "program_parse.y" +#line 1161 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3378,7 +3380,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1163 "program_parse.y" +#line 1165 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3387,7 +3389,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1169 "program_parse.y" +#line 1171 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3397,7 +3399,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1176 "program_parse.y" +#line 1178 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3406,7 +3408,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1180 "program_parse.y" +#line 1182 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3415,7 +3417,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1186 "program_parse.y" +#line 1188 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3426,7 +3428,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1194 "program_parse.y" +#line 1196 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3440,7 +3442,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1205 "program_parse.y" +#line 1207 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3450,7 +3452,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1212 "program_parse.y" +#line 1214 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3459,7 +3461,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1216 "program_parse.y" +#line 1218 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3468,7 +3470,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1222 "program_parse.y" +#line 1224 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3481,7 +3483,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1232 "program_parse.y" +#line 1234 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3494,7 +3496,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1242 "program_parse.y" +#line 1244 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3504,7 +3506,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1247 "program_parse.y" +#line 1249 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3525,7 +3527,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1265 "program_parse.y" +#line 1267 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3536,7 +3538,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1273 "program_parse.y" +#line 1275 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3545,7 +3547,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1277 "program_parse.y" +#line 1279 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3554,7 +3556,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1283 "program_parse.y" +#line 1285 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3563,7 +3565,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1287 "program_parse.y" +#line 1289 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3572,7 +3574,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1291 "program_parse.y" +#line 1293 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3581,7 +3583,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1297 "program_parse.y" +#line 1299 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3595,7 +3597,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1308 "program_parse.y" +#line 1310 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3605,7 +3607,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1313 "program_parse.y" +#line 1315 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3615,7 +3617,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1318 "program_parse.y" +#line 1320 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3625,7 +3627,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1323 "program_parse.y" +#line 1325 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3635,7 +3637,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1328 "program_parse.y" +#line 1330 "program_parse.y" { YYERROR; ;} @@ -3644,7 +3646,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1332 "program_parse.y" +#line 1334 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3654,7 +3656,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1339 "program_parse.y" +#line 1341 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3663,7 +3665,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1343 "program_parse.y" +#line 1345 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3672,7 +3674,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1348 "program_parse.y" +#line 1350 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3689,7 +3691,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1361 "program_parse.y" +#line 1363 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3701,7 +3703,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1369 "program_parse.y" +#line 1371 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3715,7 +3717,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1386 "program_parse.y" +#line 1388 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3728,7 +3730,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1396 "program_parse.y" +#line 1398 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3738,7 +3740,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1401 "program_parse.y" +#line 1403 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3748,7 +3750,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1408 "program_parse.y" +#line 1410 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3761,7 +3763,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1418 "program_parse.y" +#line 1420 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3774,7 +3776,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1427 "program_parse.y" +#line 1429 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3784,7 +3786,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1432 "program_parse.y" +#line 1434 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3794,7 +3796,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1439 "program_parse.y" +#line 1441 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3807,7 +3809,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1449 "program_parse.y" +#line 1451 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3820,7 +3822,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1459 "program_parse.y" +#line 1461 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3833,7 +3835,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1474 "program_parse.y" +#line 1476 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3843,7 +3845,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1481 "program_parse.y" +#line 1483 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3853,7 +3855,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1486 "program_parse.y" +#line 1488 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -3863,7 +3865,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1493 "program_parse.y" +#line 1495 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3873,7 +3875,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1498 "program_parse.y" +#line 1500 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -3884,7 +3886,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1505 "program_parse.y" +#line 1507 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -3896,7 +3898,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1513 "program_parse.y" +#line 1515 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -3909,7 +3911,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1523 "program_parse.y" +#line 1525 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -3918,7 +3920,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1527 "program_parse.y" +#line 1529 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -3927,42 +3929,42 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1532 "program_parse.y" +#line 1534 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 218: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1535 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 219: /* Line 1455 of yacc.c */ -#line 1534 "program_parse.y" +#line 1536 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 220: /* Line 1455 of yacc.c */ -#line 1537 "program_parse.y" +#line 1539 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1540 "program_parse.y" +#line 1542 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 224: /* Line 1455 of yacc.c */ -#line 1544 "program_parse.y" +#line 1546 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -3973,7 +3975,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1550 "program_parse.y" +#line 1552 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -3984,7 +3986,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1558 "program_parse.y" +#line 1560 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4000,7 +4002,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1571 "program_parse.y" +#line 1573 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4014,7 +4016,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1580 "program_parse.y" +#line 1582 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4028,7 +4030,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1589 "program_parse.y" +#line 1591 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4037,7 +4039,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1593 "program_parse.y" +#line 1595 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4051,7 +4053,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1602 "program_parse.y" +#line 1604 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4065,7 +4067,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1611 "program_parse.y" +#line 1613 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4079,7 +4081,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1622 "program_parse.y" +#line 1624 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4088,7 +4090,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1628 "program_parse.y" +#line 1630 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4099,7 +4101,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1634 "program_parse.y" +#line 1636 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4113,7 +4115,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1643 "program_parse.y" +#line 1645 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4127,7 +4129,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1654 "program_parse.y" +#line 1656 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4136,7 +4138,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1658 "program_parse.y" +#line 1660 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4150,7 +4152,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1667 "program_parse.y" +#line 1669 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4164,91 +4166,91 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1677 "program_parse.y" +#line 1679 "program_parse.y" { (yyval.integer) = 0; ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1678 "program_parse.y" +#line 1680 "program_parse.y" { (yyval.integer) = 0; ;} break; case 242: /* Line 1455 of yacc.c */ -#line 1679 "program_parse.y" +#line 1681 "program_parse.y" { (yyval.integer) = 1; ;} break; case 243: /* Line 1455 of yacc.c */ -#line 1682 "program_parse.y" +#line 1684 "program_parse.y" { (yyval.integer) = 0; ;} break; case 244: /* Line 1455 of yacc.c */ -#line 1683 "program_parse.y" +#line 1685 "program_parse.y" { (yyval.integer) = 0; ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1684 "program_parse.y" +#line 1686 "program_parse.y" { (yyval.integer) = 1; ;} break; case 246: /* Line 1455 of yacc.c */ -#line 1687 "program_parse.y" +#line 1689 "program_parse.y" { (yyval.integer) = 0; ;} break; case 247: /* Line 1455 of yacc.c */ -#line 1688 "program_parse.y" +#line 1690 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1691 "program_parse.y" +#line 1693 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1692 "program_parse.y" +#line 1694 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1695 "program_parse.y" +#line 1697 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1696 "program_parse.y" +#line 1698 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1700 "program_parse.y" +#line 1702 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4262,7 +4264,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1711 "program_parse.y" +#line 1713 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4276,7 +4278,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1722 "program_parse.y" +#line 1724 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4290,7 +4292,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1733 "program_parse.y" +#line 1735 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4314,7 +4316,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4318 "program_parse.tab.c" +#line 4320 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4533,7 +4535,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1753 "program_parse.y" +#line 1755 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 39e3ee1f1e..0260196210 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -590,7 +590,9 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ | paramSingleItemUse { init_src_reg(& $$); - $$.Base.File = $1.param_binding_type; + $$.Base.File = ($1.name != NULL) + ? $1.param_binding_type + : PROGRAM_CONSTANT; $$.Base.Index = $1.param_binding_begin; } ; -- cgit v1.2.3 From aec429170681567414de70814f69244758323e75 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 12:29:48 -0700 Subject: parser: Initialize unused instruction source registers The 965 driver expects unused source registers (e.g., SrcReg[2] of a DP3 instruction) to have a register file of PROGRAM_UNDEFINED. Initializing these source registers ensures that this happens. --- src/mesa/shader/program_parse.tab.c | 4 ++++ src/mesa/shader/program_parse.y | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index bf48b9752f..cb5fa7cd71 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4558,11 +4558,15 @@ asm_instruction_ctor(gl_inst_opcode op, if (src1 != NULL) { inst->Base.SrcReg[1] = src1->Base; inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); } if (src2 != NULL) { inst->Base.SrcReg[2] = src2->Base; inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); } } diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 0260196210..fe9022b121 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1774,11 +1774,15 @@ asm_instruction_ctor(gl_inst_opcode op, if (src1 != NULL) { inst->Base.SrcReg[1] = src1->Base; inst->SrcReg[1] = *src1; + } else { + init_src_reg(& inst->SrcReg[1]); } if (src2 != NULL) { inst->Base.SrcReg[2] = src2->Base; inst->SrcReg[2] = *src2; + } else { + init_src_reg(& inst->SrcReg[2]); } } -- cgit v1.2.3 From 44843c753301db0e8f8343745777479465f34ccc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 15:06:49 -0700 Subject: parser: Clean up generation of error strings during assembly --- src/mesa/shader/program_parse.tab.c | 61 ++++++++++++++++++++++++++++++++++--- src/mesa/shader/program_parse.y | 61 ++++++++++++++++++++++++++++++++++--- src/mesa/shader/program_parser.h | 11 ++++--- 3 files changed, 120 insertions(+), 13 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index cb5fa7cd71..8f8dae9223 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4801,15 +4801,57 @@ initialize_symbol_from_const(struct gl_program *prog, } +char * +make_error_string(const char *fmt, ...) +{ + int length; + char *str; + va_list args; + + va_start(args, fmt); + + /* Call vsnprintf once to determine how large the final string is. Call it + * again to do the actual formatting. from the vsnprintf manual page: + * + * Upon successful return, these functions return the number of + * characters printed (not including the trailing '\0' used to end + * output to strings). + */ + length = 1 + vsnprintf(NULL, 0, fmt, args); + + str = _mesa_malloc(length); + if (str) { + vsnprintf(str, length, fmt, args); + } + + va_end(args); + + return str; +} + + void yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) { - (void) state; + char *err_str; + - fprintf(stderr, "line %u, char %u: error: %s\n", locp->first_line, - locp->first_column, s); + err_str = make_error_string("glProgramStringARB(%s)\n", s); + if (err_str) { + _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str); + _mesa_free(err_str); + } + + err_str = make_error_string("line %u, char %u: error: %s\n", + locp->first_line, locp->first_column, s); + _mesa_set_program_error(state->ctx, locp->position, err_str); + + if (err_str) { + _mesa_free(err_str); + } } + GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state) @@ -4819,6 +4861,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, unsigned i; GLubyte *strz; + state->ctx = ctx; state->prog->Target = target; state->prog->Parameters = _mesa_new_parameter_list(); @@ -4877,8 +4920,18 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_program_lexer_dtor(state->scanner); + if (ctx->Program.ErrorPos != -1) { + return GL_FALSE; + } + if (! _mesa_layout_parameters(state)) { - fprintf(stderr, "error: layout\n"); + struct YYLTYPE loc; + + loc.first_line = 0; + loc.first_column = 0; + loc.position = len; + + yyerror(& loc, state, "invalid PARAM usage"); return GL_FALSE; } diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index fe9022b121..6881562902 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2017,15 +2017,57 @@ initialize_symbol_from_const(struct gl_program *prog, } +char * +make_error_string(const char *fmt, ...) +{ + int length; + char *str; + va_list args; + + va_start(args, fmt); + + /* Call vsnprintf once to determine how large the final string is. Call it + * again to do the actual formatting. from the vsnprintf manual page: + * + * Upon successful return, these functions return the number of + * characters printed (not including the trailing '\0' used to end + * output to strings). + */ + length = 1 + vsnprintf(NULL, 0, fmt, args); + + str = _mesa_malloc(length); + if (str) { + vsnprintf(str, length, fmt, args); + } + + va_end(args); + + return str; +} + + void yyerror(YYLTYPE *locp, struct asm_parser_state *state, const char *s) { - (void) state; + char *err_str; + - fprintf(stderr, "line %u, char %u: error: %s\n", locp->first_line, - locp->first_column, s); + err_str = make_error_string("glProgramStringARB(%s)\n", s); + if (err_str) { + _mesa_error(state->ctx, GL_INVALID_OPERATION, err_str); + _mesa_free(err_str); + } + + err_str = make_error_string("line %u, char %u: error: %s\n", + locp->first_line, locp->first_column, s); + _mesa_set_program_error(state->ctx, locp->position, err_str); + + if (err_str) { + _mesa_free(err_str); + } } + GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state) @@ -2035,6 +2077,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, unsigned i; GLubyte *strz; + state->ctx = ctx; state->prog->Target = target; state->prog->Parameters = _mesa_new_parameter_list(); @@ -2093,8 +2136,18 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, _mesa_program_lexer_dtor(state->scanner); + if (ctx->Program.ErrorPos != -1) { + return GL_FALSE; + } + if (! _mesa_layout_parameters(state)) { - fprintf(stderr, "error: layout\n"); + struct YYLTYPE loc; + + loc.first_line = 0; + loc.first_column = 0; + loc.position = len; + + yyerror(& loc, state, "invalid PARAM usage"); return GL_FALSE; } diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index 20190470ea..aeb2efd7ab 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -24,6 +24,11 @@ #include "main/config.h" +#ifndef MTYPES_H +struct __GLcontextRec; +typedef struct __GLcontextRec GLcontext; +#endif + enum asm_type { at_none, at_address, @@ -119,6 +124,7 @@ struct asm_instruction { struct asm_parser_state { + GLcontext *ctx; struct gl_program *prog; /** @@ -213,11 +219,6 @@ typedef struct YYLTYPE { #define YYLTYPE_IS_TRIVIAL 1 -#ifndef MTYPES_H -struct __GLcontextRec; -typedef struct __GLcontextRec GLcontext; -#endif - extern GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state); -- cgit v1.2.3 From c2ee82d6931ad180334b2fcb0028050d65cdd40d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 15:27:31 -0700 Subject: parser: Set NumParameters --- src/mesa/shader/program_parse.tab.c | 2 ++ src/mesa/shader/program_parse.y | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 8f8dae9223..40d48d597b 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4959,6 +4959,8 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, } state->prog->NumInstructions++; + state->prog->NumParameters = state->prog->Parameters->NumParameters; + /* * Initialize native counts to logical counts. The device driver may * change them if program is translated into a hardware program. diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 6881562902..81b06ac13c 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2175,6 +2175,8 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, } state->prog->NumInstructions++; + state->prog->NumParameters = state->prog->Parameters->NumParameters; + /* * Initialize native counts to logical counts. The device driver may * change them if program is translated into a hardware program. -- cgit v1.2.3 From 5f090bb0740c424f74f21abf4b657b9b292418c5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 15:28:31 -0700 Subject: GIT ignore program_parse.output --- src/mesa/shader/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 src/mesa/shader/.gitignore diff --git a/src/mesa/shader/.gitignore b/src/mesa/shader/.gitignore new file mode 100644 index 0000000000..086fd9a705 --- /dev/null +++ b/src/mesa/shader/.gitignore @@ -0,0 +1 @@ +program_parse.output -- cgit v1.2.3 From 28b13038d84db1c4e1e56e15d310b30ddffcb7bd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 16:03:32 -0700 Subject: parser: Ensure that param_binding_type is set correctly --- src/mesa/shader/program_parse.tab.c | 4 ++++ src/mesa/shader/program_parse.y | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 40d48d597b..0ea0e24106 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4702,6 +4702,7 @@ initialize_symbol_from_state(struct gl_program *prog, memcpy(state_tokens, tokens, sizeof(state_tokens)); param_var->type = at_param; + param_var->param_binding_type = PROGRAM_STATE_VAR; /* If we are adding a STATE_MATRIX that has multiple rows, we need to * unroll it and call add_state_reference() for each row @@ -4753,6 +4754,8 @@ initialize_symbol_from_param(struct gl_program *prog, || (state_tokens[1] == STATE_LOCAL)); param_var->type = at_param; + param_var->param_binding_type = (state_tokens[1] == STATE_ENV) + ? PROGRAM_ENV_PARAM : PROGRAM_LOCAL_PARAM; /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements, * we need to unroll it and call add_state_reference() for each row @@ -4792,6 +4795,7 @@ initialize_symbol_from_const(struct gl_program *prog, NULL, 0x0); param_var->type = at_param; + param_var->param_binding_type = PROGRAM_CONSTANT; if (param_var->param_binding_begin == ~0U) param_var->param_binding_begin = idx; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 81b06ac13c..a0bec96924 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1918,6 +1918,7 @@ initialize_symbol_from_state(struct gl_program *prog, memcpy(state_tokens, tokens, sizeof(state_tokens)); param_var->type = at_param; + param_var->param_binding_type = PROGRAM_STATE_VAR; /* If we are adding a STATE_MATRIX that has multiple rows, we need to * unroll it and call add_state_reference() for each row @@ -1969,6 +1970,8 @@ initialize_symbol_from_param(struct gl_program *prog, || (state_tokens[1] == STATE_LOCAL)); param_var->type = at_param; + param_var->param_binding_type = (state_tokens[1] == STATE_ENV) + ? PROGRAM_ENV_PARAM : PROGRAM_LOCAL_PARAM; /* If we are adding a STATE_ENV or STATE_LOCAL that has multiple elements, * we need to unroll it and call add_state_reference() for each row @@ -2008,6 +2011,7 @@ initialize_symbol_from_const(struct gl_program *prog, NULL, 0x0); param_var->type = at_param; + param_var->param_binding_type = PROGRAM_CONSTANT; if (param_var->param_binding_begin == ~0U) param_var->param_binding_begin = idx; -- cgit v1.2.3 From 0db5ef074169589bc4d665094147aa284a5496d7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 16:21:54 -0700 Subject: parser: Track a few more frag prog related values --- src/mesa/shader/program_parse.tab.c | 477 +++++++++++++++++++----------------- src/mesa/shader/program_parse.y | 11 + 2 files changed, 261 insertions(+), 227 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 0ea0e24106..452782e832 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -739,31 +739,31 @@ static const yytype_int16 yyrhs[] = static const yytype_uint16 yyrline[] = { 0, 240, 240, 243, 251, 260, 261, 264, 282, 283, - 286, 301, 304, 305, 308, 309, 310, 311, 312, 313, - 314, 317, 318, 321, 327, 334, 341, 349, 356, 364, - 375, 381, 387, 388, 389, 390, 391, 394, 406, 419, - 432, 454, 463, 472, 479, 488, 516, 558, 569, 590, - 600, 606, 630, 647, 647, 649, 656, 668, 669, 670, - 673, 685, 697, 715, 726, 738, 740, 741, 742, 743, - 746, 746, 746, 746, 747, 750, 751, 752, 753, 754, - 755, 758, 776, 780, 786, 790, 794, 798, 802, 806, - 810, 814, 820, 831, 831, 832, 834, 838, 842, 846, - 852, 852, 854, 870, 893, 896, 907, 913, 919, 920, - 927, 933, 939, 947, 953, 959, 967, 973, 979, 987, - 988, 991, 992, 993, 994, 995, 996, 997, 998, 999, - 1000, 1003, 1012, 1016, 1020, 1026, 1035, 1039, 1043, 1047, - 1051, 1057, 1063, 1070, 1075, 1083, 1093, 1095, 1103, 1109, - 1113, 1117, 1123, 1134, 1143, 1147, 1152, 1156, 1160, 1164, - 1170, 1177, 1181, 1187, 1195, 1206, 1213, 1217, 1223, 1233, - 1244, 1248, 1266, 1275, 1278, 1284, 1288, 1292, 1298, 1309, - 1314, 1319, 1324, 1329, 1333, 1341, 1344, 1349, 1362, 1370, - 1383, 1383, 1385, 1385, 1387, 1397, 1402, 1409, 1419, 1428, - 1433, 1440, 1450, 1460, 1472, 1472, 1473, 1473, 1475, 1482, - 1487, 1494, 1499, 1505, 1513, 1524, 1528, 1534, 1535, 1536, - 1539, 1539, 1542, 1542, 1545, 1551, 1559, 1572, 1581, 1590, - 1594, 1603, 1612, 1623, 1630, 1635, 1644, 1656, 1659, 1668, - 1679, 1680, 1681, 1684, 1685, 1686, 1689, 1690, 1693, 1694, - 1697, 1698, 1701, 1712, 1723, 1734 + 286, 301, 304, 309, 316, 317, 318, 319, 320, 321, + 322, 325, 326, 329, 335, 342, 349, 357, 364, 372, + 385, 392, 398, 399, 400, 401, 402, 405, 417, 430, + 443, 465, 474, 483, 490, 499, 527, 569, 580, 601, + 611, 617, 641, 658, 658, 660, 667, 679, 680, 681, + 684, 696, 708, 726, 737, 749, 751, 752, 753, 754, + 757, 757, 757, 757, 758, 761, 762, 763, 764, 765, + 766, 769, 787, 791, 797, 801, 805, 809, 813, 817, + 821, 825, 831, 842, 842, 843, 845, 849, 853, 857, + 863, 863, 865, 881, 904, 907, 918, 924, 930, 931, + 938, 944, 950, 958, 964, 970, 978, 984, 990, 998, + 999, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, + 1011, 1014, 1023, 1027, 1031, 1037, 1046, 1050, 1054, 1058, + 1062, 1068, 1074, 1081, 1086, 1094, 1104, 1106, 1114, 1120, + 1124, 1128, 1134, 1145, 1154, 1158, 1163, 1167, 1171, 1175, + 1181, 1188, 1192, 1198, 1206, 1217, 1224, 1228, 1234, 1244, + 1255, 1259, 1277, 1286, 1289, 1295, 1299, 1303, 1309, 1320, + 1325, 1330, 1335, 1340, 1344, 1352, 1355, 1360, 1373, 1381, + 1394, 1394, 1396, 1396, 1398, 1408, 1413, 1420, 1430, 1439, + 1444, 1451, 1461, 1471, 1483, 1483, 1484, 1484, 1486, 1493, + 1498, 1505, 1510, 1516, 1524, 1535, 1539, 1545, 1546, 1547, + 1550, 1550, 1553, 1553, 1556, 1562, 1570, 1583, 1592, 1601, + 1605, 1614, 1623, 1634, 1641, 1646, 1655, 1667, 1670, 1679, + 1690, 1691, 1692, 1695, 1696, 1697, 1700, 1701, 1704, 1705, + 1708, 1709, 1712, 1723, 1734, 1745 }; #endif @@ -2094,10 +2094,30 @@ yyreduce: ;} break; + case 12: + +/* Line 1455 of yacc.c */ +#line 305 "program_parse.y" + { + (yyval.inst) = (yyvsp[(1) - (1)].inst); + state->prog->NumAluInstructions++; + ;} + break; + + case 13: + +/* Line 1455 of yacc.c */ +#line 310 "program_parse.y" + { + (yyval.inst) = (yyvsp[(1) - (1)].inst); + state->prog->NumTexInstructions++; + ;} + break; + case 23: /* Line 1455 of yacc.c */ -#line 322 "program_parse.y" +#line 330 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2106,7 +2126,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 328 "program_parse.y" +#line 336 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2116,7 +2136,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 335 "program_parse.y" +#line 343 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2126,7 +2146,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 342 "program_parse.y" +#line 350 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2136,7 +2156,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 350 "program_parse.y" +#line 358 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2146,7 +2166,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 358 "program_parse.y" +#line 366 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2156,13 +2176,15 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 365 "program_parse.y" +#line 373 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; (yyval.inst)->Base.TexSrcUnit = (yyvsp[(6) - (8)].integer); (yyval.inst)->Base.TexSrcTarget = (yyvsp[(8) - (8)].integer); + + state->prog->TexturesUsed[(yyvsp[(6) - (8)].integer)] |= (1U << (yyvsp[(8) - (8)].integer)); } ;} break; @@ -2170,16 +2192,17 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 376 "program_parse.y" +#line 386 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); + state->fragment.UsesKill = 1; ;} break; case 31: /* Line 1455 of yacc.c */ -#line 382 "program_parse.y" +#line 393 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2188,42 +2211,42 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 387 "program_parse.y" +#line 398 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 388 "program_parse.y" +#line 399 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 389 "program_parse.y" +#line 400 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 390 "program_parse.y" +#line 401 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 391 "program_parse.y" +#line 402 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 395 "program_parse.y" +#line 406 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2238,7 +2261,7 @@ yyreduce: case 38: /* Line 1455 of yacc.c */ -#line 407 "program_parse.y" +#line 418 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2254,7 +2277,7 @@ yyreduce: case 39: /* Line 1455 of yacc.c */ -#line 420 "program_parse.y" +#line 431 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2270,7 +2293,7 @@ yyreduce: case 40: /* Line 1455 of yacc.c */ -#line 433 "program_parse.y" +#line 444 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2295,7 +2318,7 @@ yyreduce: case 41: /* Line 1455 of yacc.c */ -#line 455 "program_parse.y" +#line 466 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2307,7 +2330,7 @@ yyreduce: case 42: /* Line 1455 of yacc.c */ -#line 464 "program_parse.y" +#line 475 "program_parse.y" { (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); @@ -2319,7 +2342,7 @@ yyreduce: case 43: /* Line 1455 of yacc.c */ -#line 473 "program_parse.y" +#line 484 "program_parse.y" { (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2329,7 +2352,7 @@ yyreduce: case 44: /* Line 1455 of yacc.c */ -#line 480 "program_parse.y" +#line 491 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2343,7 +2366,7 @@ yyreduce: case 45: /* Line 1455 of yacc.c */ -#line 489 "program_parse.y" +#line 500 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2374,7 +2397,7 @@ yyreduce: case 46: /* Line 1455 of yacc.c */ -#line 517 "program_parse.y" +#line 528 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2421,7 +2444,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 559 "program_parse.y" +#line 570 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2437,7 +2460,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 570 "program_parse.y" +#line 581 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2463,7 +2486,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 591 "program_parse.y" +#line 602 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2476,7 +2499,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 601 "program_parse.y" +#line 612 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2487,7 +2510,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 607 "program_parse.y" +#line 618 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2514,7 +2537,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 631 "program_parse.y" +#line 642 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2534,7 +2557,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 650 "program_parse.y" +#line 661 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2544,7 +2567,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 657 "program_parse.y" +#line 668 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2559,28 +2582,28 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 668 "program_parse.y" +#line 679 "program_parse.y" { (yyval.integer) = 0; ;} break; case 58: /* Line 1455 of yacc.c */ -#line 669 "program_parse.y" +#line 680 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 59: /* Line 1455 of yacc.c */ -#line 670 "program_parse.y" +#line 681 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 60: /* Line 1455 of yacc.c */ -#line 674 "program_parse.y" +#line 685 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2595,7 +2618,7 @@ yyreduce: case 61: /* Line 1455 of yacc.c */ -#line 686 "program_parse.y" +#line 697 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2610,7 +2633,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 698 "program_parse.y" +#line 709 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2631,7 +2654,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 716 "program_parse.y" +#line 727 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2645,7 +2668,7 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 727 "program_parse.y" +#line 738 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2660,21 +2683,21 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 743 "program_parse.y" +#line 754 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 74: /* Line 1455 of yacc.c */ -#line 747 "program_parse.y" +#line 758 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 759 "program_parse.y" +#line 770 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2695,7 +2718,7 @@ yyreduce: case 82: /* Line 1455 of yacc.c */ -#line 777 "program_parse.y" +#line 788 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2704,7 +2727,7 @@ yyreduce: case 83: /* Line 1455 of yacc.c */ -#line 781 "program_parse.y" +#line 792 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2713,7 +2736,7 @@ yyreduce: case 84: /* Line 1455 of yacc.c */ -#line 787 "program_parse.y" +#line 798 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2722,7 +2745,7 @@ yyreduce: case 85: /* Line 1455 of yacc.c */ -#line 791 "program_parse.y" +#line 802 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2731,7 +2754,7 @@ yyreduce: case 86: /* Line 1455 of yacc.c */ -#line 795 "program_parse.y" +#line 806 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2740,7 +2763,7 @@ yyreduce: case 87: /* Line 1455 of yacc.c */ -#line 799 "program_parse.y" +#line 810 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); ;} @@ -2749,7 +2772,7 @@ yyreduce: case 88: /* Line 1455 of yacc.c */ -#line 803 "program_parse.y" +#line 814 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_FOG; ;} @@ -2758,7 +2781,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 807 "program_parse.y" +#line 818 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2767,7 +2790,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 811 "program_parse.y" +#line 822 "program_parse.y" { YYERROR; ;} @@ -2776,7 +2799,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 815 "program_parse.y" +#line 826 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2785,7 +2808,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 821 "program_parse.y" +#line 832 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2799,7 +2822,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 835 "program_parse.y" +#line 846 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2808,7 +2831,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 839 "program_parse.y" +#line 850 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2817,7 +2840,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 843 "program_parse.y" +#line 854 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2826,7 +2849,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 847 "program_parse.y" +#line 858 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2835,7 +2858,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 855 "program_parse.y" +#line 866 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2854,7 +2877,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 871 "program_parse.y" +#line 882 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -2879,7 +2902,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 893 "program_parse.y" +#line 904 "program_parse.y" { (yyval.integer) = 0; ;} @@ -2888,7 +2911,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 897 "program_parse.y" +#line 908 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -2902,7 +2925,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 908 "program_parse.y" +#line 919 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -2911,7 +2934,7 @@ yyreduce: case 107: /* Line 1455 of yacc.c */ -#line 914 "program_parse.y" +#line 925 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -2920,7 +2943,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 921 "program_parse.y" +#line 932 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -2930,7 +2953,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 928 "program_parse.y" +#line 939 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2941,7 +2964,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 934 "program_parse.y" +#line 945 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2952,7 +2975,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 940 "program_parse.y" +#line 951 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2963,7 +2986,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 948 "program_parse.y" +#line 959 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2974,7 +2997,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 954 "program_parse.y" +#line 965 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2985,7 +3008,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 960 "program_parse.y" +#line 971 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2996,7 +3019,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 968 "program_parse.y" +#line 979 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3007,7 +3030,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 974 "program_parse.y" +#line 985 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3018,7 +3041,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 980 "program_parse.y" +#line 991 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3029,91 +3052,91 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 987 "program_parse.y" +#line 998 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 120: /* Line 1455 of yacc.c */ -#line 988 "program_parse.y" +#line 999 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 121: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 1002 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 122: /* Line 1455 of yacc.c */ -#line 992 "program_parse.y" +#line 1003 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 123: /* Line 1455 of yacc.c */ -#line 993 "program_parse.y" +#line 1004 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 124: /* Line 1455 of yacc.c */ -#line 994 "program_parse.y" +#line 1005 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 125: /* Line 1455 of yacc.c */ -#line 995 "program_parse.y" +#line 1006 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 126: /* Line 1455 of yacc.c */ -#line 996 "program_parse.y" +#line 1007 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 997 "program_parse.y" +#line 1008 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 998 "program_parse.y" +#line 1009 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1010 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1000 "program_parse.y" +#line 1011 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1004 "program_parse.y" +#line 1015 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3125,7 +3148,7 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1013 "program_parse.y" +#line 1024 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3134,7 +3157,7 @@ yyreduce: case 133: /* Line 1455 of yacc.c */ -#line 1017 "program_parse.y" +#line 1028 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3143,7 +3166,7 @@ yyreduce: case 134: /* Line 1455 of yacc.c */ -#line 1021 "program_parse.y" +#line 1032 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3152,7 +3175,7 @@ yyreduce: case 135: /* Line 1455 of yacc.c */ -#line 1027 "program_parse.y" +#line 1038 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3164,7 +3187,7 @@ yyreduce: case 136: /* Line 1455 of yacc.c */ -#line 1036 "program_parse.y" +#line 1047 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3173,7 +3196,7 @@ yyreduce: case 137: /* Line 1455 of yacc.c */ -#line 1040 "program_parse.y" +#line 1051 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3182,7 +3205,7 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1044 "program_parse.y" +#line 1055 "program_parse.y" { (yyval.integer) = STATE_ATTENUATION; ;} @@ -3191,7 +3214,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1048 "program_parse.y" +#line 1059 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3200,7 +3223,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" +#line 1063 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3209,7 +3232,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" +#line 1069 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3218,7 +3241,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1064 "program_parse.y" +#line 1075 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3228,7 +3251,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1071 "program_parse.y" +#line 1082 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3238,7 +3261,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1076 "program_parse.y" +#line 1087 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3249,7 +3272,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1095 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3262,7 +3285,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1096 "program_parse.y" +#line 1107 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3273,7 +3296,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1115 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3282,7 +3305,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1110 "program_parse.y" +#line 1121 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3291,7 +3314,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1114 "program_parse.y" +#line 1125 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3300,7 +3323,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" +#line 1129 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3309,7 +3332,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1124 "program_parse.y" +#line 1135 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3323,7 +3346,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" +#line 1146 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3335,7 +3358,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1155 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3344,7 +3367,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1148 "program_parse.y" +#line 1159 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3353,7 +3376,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1153 "program_parse.y" +#line 1164 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3362,7 +3385,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1157 "program_parse.y" +#line 1168 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3371,7 +3394,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1172 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3380,7 +3403,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1165 "program_parse.y" +#line 1176 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3389,7 +3412,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1171 "program_parse.y" +#line 1182 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3399,7 +3422,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1178 "program_parse.y" +#line 1189 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3408,7 +3431,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1182 "program_parse.y" +#line 1193 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3417,7 +3440,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1188 "program_parse.y" +#line 1199 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3428,7 +3451,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1196 "program_parse.y" +#line 1207 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3442,7 +3465,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1207 "program_parse.y" +#line 1218 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3452,7 +3475,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" +#line 1225 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3461,7 +3484,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1218 "program_parse.y" +#line 1229 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3470,7 +3493,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1224 "program_parse.y" +#line 1235 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3483,7 +3506,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1245 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3496,7 +3519,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1255 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3506,7 +3529,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1249 "program_parse.y" +#line 1260 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3527,7 +3550,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1267 "program_parse.y" +#line 1278 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3538,7 +3561,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1275 "program_parse.y" +#line 1286 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3547,7 +3570,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1279 "program_parse.y" +#line 1290 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3556,7 +3579,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" +#line 1296 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3565,7 +3588,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1289 "program_parse.y" +#line 1300 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3574,7 +3597,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1293 "program_parse.y" +#line 1304 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3583,7 +3606,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1299 "program_parse.y" +#line 1310 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3597,7 +3620,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1310 "program_parse.y" +#line 1321 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3607,7 +3630,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1315 "program_parse.y" +#line 1326 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3617,7 +3640,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1320 "program_parse.y" +#line 1331 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3627,7 +3650,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1325 "program_parse.y" +#line 1336 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3637,7 +3660,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1330 "program_parse.y" +#line 1341 "program_parse.y" { YYERROR; ;} @@ -3646,7 +3669,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1334 "program_parse.y" +#line 1345 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3656,7 +3679,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1341 "program_parse.y" +#line 1352 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3665,7 +3688,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1345 "program_parse.y" +#line 1356 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3674,7 +3697,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1350 "program_parse.y" +#line 1361 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3691,7 +3714,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1363 "program_parse.y" +#line 1374 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3703,7 +3726,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1371 "program_parse.y" +#line 1382 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3717,7 +3740,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1388 "program_parse.y" +#line 1399 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3730,7 +3753,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1398 "program_parse.y" +#line 1409 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3740,7 +3763,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1403 "program_parse.y" +#line 1414 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3750,7 +3773,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1410 "program_parse.y" +#line 1421 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3763,7 +3786,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1420 "program_parse.y" +#line 1431 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3776,7 +3799,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1429 "program_parse.y" +#line 1440 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3786,7 +3809,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1434 "program_parse.y" +#line 1445 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3796,7 +3819,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1441 "program_parse.y" +#line 1452 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3809,7 +3832,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1451 "program_parse.y" +#line 1462 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3822,7 +3845,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1461 "program_parse.y" +#line 1472 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3835,7 +3858,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1476 "program_parse.y" +#line 1487 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3845,7 +3868,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1483 "program_parse.y" +#line 1494 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3855,7 +3878,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1488 "program_parse.y" +#line 1499 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -3865,7 +3888,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1495 "program_parse.y" +#line 1506 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3875,7 +3898,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1500 "program_parse.y" +#line 1511 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -3886,7 +3909,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1507 "program_parse.y" +#line 1518 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -3898,7 +3921,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1515 "program_parse.y" +#line 1526 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -3911,7 +3934,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1525 "program_parse.y" +#line 1536 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -3920,7 +3943,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1529 "program_parse.y" +#line 1540 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -3929,42 +3952,42 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1534 "program_parse.y" +#line 1545 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 218: /* Line 1455 of yacc.c */ -#line 1535 "program_parse.y" +#line 1546 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 219: /* Line 1455 of yacc.c */ -#line 1536 "program_parse.y" +#line 1547 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 220: /* Line 1455 of yacc.c */ -#line 1539 "program_parse.y" +#line 1550 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1542 "program_parse.y" +#line 1553 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 224: /* Line 1455 of yacc.c */ -#line 1546 "program_parse.y" +#line 1557 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -3975,7 +3998,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1552 "program_parse.y" +#line 1563 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -3986,7 +4009,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" +#line 1571 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4002,7 +4025,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1573 "program_parse.y" +#line 1584 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4016,7 +4039,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1582 "program_parse.y" +#line 1593 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4030,7 +4053,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1591 "program_parse.y" +#line 1602 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4039,7 +4062,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1595 "program_parse.y" +#line 1606 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4053,7 +4076,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1604 "program_parse.y" +#line 1615 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4067,7 +4090,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1613 "program_parse.y" +#line 1624 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4081,7 +4104,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1624 "program_parse.y" +#line 1635 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4090,7 +4113,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1630 "program_parse.y" +#line 1641 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4101,7 +4124,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1636 "program_parse.y" +#line 1647 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4115,7 +4138,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1645 "program_parse.y" +#line 1656 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4129,7 +4152,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1656 "program_parse.y" +#line 1667 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4138,7 +4161,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1660 "program_parse.y" +#line 1671 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4152,7 +4175,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" +#line 1680 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4166,91 +4189,91 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1679 "program_parse.y" +#line 1690 "program_parse.y" { (yyval.integer) = 0; ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1691 "program_parse.y" { (yyval.integer) = 0; ;} break; case 242: /* Line 1455 of yacc.c */ -#line 1681 "program_parse.y" +#line 1692 "program_parse.y" { (yyval.integer) = 1; ;} break; case 243: /* Line 1455 of yacc.c */ -#line 1684 "program_parse.y" +#line 1695 "program_parse.y" { (yyval.integer) = 0; ;} break; case 244: /* Line 1455 of yacc.c */ -#line 1685 "program_parse.y" +#line 1696 "program_parse.y" { (yyval.integer) = 0; ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1686 "program_parse.y" +#line 1697 "program_parse.y" { (yyval.integer) = 1; ;} break; case 246: /* Line 1455 of yacc.c */ -#line 1689 "program_parse.y" +#line 1700 "program_parse.y" { (yyval.integer) = 0; ;} break; case 247: /* Line 1455 of yacc.c */ -#line 1690 "program_parse.y" +#line 1701 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1693 "program_parse.y" +#line 1704 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1694 "program_parse.y" +#line 1705 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1708 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1698 "program_parse.y" +#line 1709 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1702 "program_parse.y" +#line 1713 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4264,7 +4287,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1713 "program_parse.y" +#line 1724 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4278,7 +4301,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1735 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4292,7 +4315,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1735 "program_parse.y" +#line 1746 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4316,7 +4339,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4320 "program_parse.tab.c" +#line 4343 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4535,7 +4558,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1755 "program_parse.y" +#line 1766 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index a0bec96924..95d6c0ea31 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -302,7 +302,15 @@ statement: instruction ';' ; instruction: ALU_instruction + { + $$ = $1; + state->prog->NumAluInstructions++; + } | TexInstruction + { + $$ = $1; + state->prog->NumTexInstructions++; + } ; ALU_instruction: ARL_instruction @@ -368,6 +376,8 @@ SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ', $$->Base.SaturateMode = $1.SaturateMode; $$->Base.TexSrcUnit = $6; $$->Base.TexSrcTarget = $8; + + state->prog->TexturesUsed[$6] |= (1U << $8); } } ; @@ -375,6 +385,7 @@ SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ', KIL_instruction: KIL swizzleSrcReg { $$ = asm_instruction_ctor(OPCODE_KIL, NULL, & $2, NULL, NULL); + state->fragment.UsesKill = 1; } ; -- cgit v1.2.3 From ef80c2012dff343eb5ff571cea8377ff6a87c0c5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 22 Jul 2009 17:13:08 -0700 Subject: parser: Clean up a bunch of silly compiler warnings --- src/mesa/shader/program_parse.tab.c | 511 ++++++++++++++++++------------------ src/mesa/shader/program_parse.tab.h | 2 +- src/mesa/shader/program_parse.y | 33 ++- 3 files changed, 280 insertions(+), 266 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 452782e832..a23ac2d473 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -97,6 +97,8 @@ #include #include "main/mtypes.h" +#include "main/imports.h" +#include "program.h" #include "prog_parameter.h" #include "prog_parameter_layout.h" #include "prog_statevars.h" @@ -111,6 +113,9 @@ extern void yy_delete_buffer(void *); static struct asm_symbol *declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, struct YYLTYPE *locp); +static int add_state_reference(struct gl_program_parameter_list *param_list, + const gl_state_index tokens[STATE_LENGTH]); + static int initialize_symbol_from_state(struct gl_program *prog, struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]); @@ -122,6 +127,8 @@ static int initialize_symbol_from_const(struct gl_program *prog, static int yyparse(struct asm_parser_state *state); +static char *make_error_string(const char *fmt, ...); + static void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state, const char *s); @@ -163,7 +170,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, /* Line 189 of yacc.c */ -#line 167 "program_parse.tab.c" +#line 174 "program_parse.tab.c" /* Enabling traces. */ #ifndef YYDEBUG @@ -296,7 +303,7 @@ typedef union YYSTYPE { /* Line 214 of yacc.c */ -#line 100 "program_parse.y" +#line 107 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; @@ -318,7 +325,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 322 "program_parse.tab.c" +#line 329 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -342,14 +349,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 233 "program_parse.y" +#line 240 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 353 "program_parse.tab.c" +#line 360 "program_parse.tab.c" #ifdef short # undef short @@ -738,32 +745,32 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 240, 240, 243, 251, 260, 261, 264, 282, 283, - 286, 301, 304, 309, 316, 317, 318, 319, 320, 321, - 322, 325, 326, 329, 335, 342, 349, 357, 364, 372, - 385, 392, 398, 399, 400, 401, 402, 405, 417, 430, - 443, 465, 474, 483, 490, 499, 527, 569, 580, 601, - 611, 617, 641, 658, 658, 660, 667, 679, 680, 681, - 684, 696, 708, 726, 737, 749, 751, 752, 753, 754, - 757, 757, 757, 757, 758, 761, 762, 763, 764, 765, - 766, 769, 787, 791, 797, 801, 805, 809, 813, 817, - 821, 825, 831, 842, 842, 843, 845, 849, 853, 857, - 863, 863, 865, 881, 904, 907, 918, 924, 930, 931, - 938, 944, 950, 958, 964, 970, 978, 984, 990, 998, - 999, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010, - 1011, 1014, 1023, 1027, 1031, 1037, 1046, 1050, 1054, 1058, - 1062, 1068, 1074, 1081, 1086, 1094, 1104, 1106, 1114, 1120, - 1124, 1128, 1134, 1145, 1154, 1158, 1163, 1167, 1171, 1175, - 1181, 1188, 1192, 1198, 1206, 1217, 1224, 1228, 1234, 1244, - 1255, 1259, 1277, 1286, 1289, 1295, 1299, 1303, 1309, 1320, - 1325, 1330, 1335, 1340, 1344, 1352, 1355, 1360, 1373, 1381, - 1394, 1394, 1396, 1396, 1398, 1408, 1413, 1420, 1430, 1439, - 1444, 1451, 1461, 1471, 1483, 1483, 1484, 1484, 1486, 1493, - 1498, 1505, 1510, 1516, 1524, 1535, 1539, 1545, 1546, 1547, - 1550, 1550, 1553, 1553, 1556, 1562, 1570, 1583, 1592, 1601, - 1605, 1614, 1623, 1634, 1641, 1646, 1655, 1667, 1670, 1679, - 1690, 1691, 1692, 1695, 1696, 1697, 1700, 1701, 1704, 1705, - 1708, 1709, 1712, 1723, 1734, 1745 + 0, 247, 247, 250, 258, 267, 268, 271, 289, 290, + 293, 308, 311, 316, 323, 324, 325, 326, 327, 328, + 329, 332, 333, 336, 342, 349, 356, 364, 371, 379, + 392, 399, 405, 406, 407, 408, 409, 412, 424, 437, + 450, 472, 481, 490, 497, 506, 534, 576, 587, 608, + 618, 624, 648, 665, 665, 667, 674, 686, 687, 688, + 691, 703, 715, 733, 744, 756, 758, 759, 760, 761, + 764, 764, 764, 764, 765, 768, 769, 770, 771, 772, + 773, 776, 794, 798, 804, 808, 812, 816, 820, 824, + 828, 832, 838, 849, 849, 850, 852, 856, 860, 864, + 870, 870, 872, 888, 911, 914, 925, 931, 937, 938, + 945, 951, 957, 965, 971, 977, 985, 991, 997, 1005, + 1006, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, + 1018, 1021, 1030, 1034, 1038, 1044, 1053, 1057, 1061, 1065, + 1069, 1075, 1081, 1088, 1093, 1101, 1111, 1113, 1121, 1127, + 1131, 1135, 1141, 1152, 1161, 1165, 1170, 1174, 1178, 1182, + 1188, 1195, 1199, 1205, 1213, 1224, 1231, 1235, 1241, 1251, + 1262, 1266, 1284, 1293, 1296, 1302, 1306, 1310, 1316, 1327, + 1332, 1337, 1342, 1347, 1351, 1359, 1362, 1367, 1380, 1388, + 1401, 1401, 1403, 1403, 1405, 1415, 1420, 1427, 1437, 1446, + 1451, 1458, 1468, 1478, 1490, 1490, 1491, 1491, 1493, 1500, + 1505, 1512, 1517, 1523, 1531, 1542, 1546, 1552, 1553, 1554, + 1557, 1557, 1560, 1560, 1563, 1569, 1577, 1590, 1599, 1608, + 1612, 1621, 1630, 1641, 1648, 1653, 1662, 1674, 1677, 1686, + 1697, 1698, 1699, 1702, 1703, 1704, 1707, 1708, 1711, 1712, + 1715, 1716, 1719, 1730, 1741, 1752 }; #endif @@ -2031,7 +2038,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 244 "program_parse.y" +#line 251 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2044,7 +2051,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 252 "program_parse.y" +#line 259 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2056,7 +2063,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 265 "program_parse.y" +#line 272 "program_parse.y" { int valid = 0; @@ -2077,7 +2084,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 287 "program_parse.y" +#line 294 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2097,7 +2104,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 305 "program_parse.y" +#line 312 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2107,7 +2114,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 310 "program_parse.y" +#line 317 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2117,7 +2124,7 @@ yyreduce: case 23: /* Line 1455 of yacc.c */ -#line 330 "program_parse.y" +#line 337 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2126,7 +2133,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 336 "program_parse.y" +#line 343 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2136,7 +2143,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 343 "program_parse.y" +#line 350 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2146,7 +2153,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 350 "program_parse.y" +#line 357 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2156,7 +2163,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 358 "program_parse.y" +#line 365 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2166,7 +2173,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 366 "program_parse.y" +#line 373 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2176,7 +2183,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 373 "program_parse.y" +#line 380 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2192,7 +2199,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 386 "program_parse.y" +#line 393 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2202,7 +2209,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 393 "program_parse.y" +#line 400 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2211,42 +2218,42 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 398 "program_parse.y" +#line 405 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 399 "program_parse.y" +#line 406 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 400 "program_parse.y" +#line 407 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 401 "program_parse.y" +#line 408 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 402 "program_parse.y" +#line 409 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 406 "program_parse.y" +#line 413 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2261,7 +2268,7 @@ yyreduce: case 38: /* Line 1455 of yacc.c */ -#line 418 "program_parse.y" +#line 425 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2277,7 +2284,7 @@ yyreduce: case 39: /* Line 1455 of yacc.c */ -#line 431 "program_parse.y" +#line 438 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2293,7 +2300,7 @@ yyreduce: case 40: /* Line 1455 of yacc.c */ -#line 444 "program_parse.y" +#line 451 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2318,7 +2325,7 @@ yyreduce: case 41: /* Line 1455 of yacc.c */ -#line 466 "program_parse.y" +#line 473 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2330,7 +2337,7 @@ yyreduce: case 42: /* Line 1455 of yacc.c */ -#line 475 "program_parse.y" +#line 482 "program_parse.y" { (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); @@ -2342,7 +2349,7 @@ yyreduce: case 43: /* Line 1455 of yacc.c */ -#line 484 "program_parse.y" +#line 491 "program_parse.y" { (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2352,7 +2359,7 @@ yyreduce: case 44: /* Line 1455 of yacc.c */ -#line 491 "program_parse.y" +#line 498 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2366,7 +2373,7 @@ yyreduce: case 45: /* Line 1455 of yacc.c */ -#line 500 "program_parse.y" +#line 507 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2397,7 +2404,7 @@ yyreduce: case 46: /* Line 1455 of yacc.c */ -#line 528 "program_parse.y" +#line 535 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2444,7 +2451,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 570 "program_parse.y" +#line 577 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2460,10 +2467,10 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 581 "program_parse.y" +#line 588 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr - && ((yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { + && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { yyerror(& (yylsp[(3) - (4)]), state, "out of bounds array access"); YYERROR; } @@ -2486,7 +2493,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 602 "program_parse.y" +#line 609 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2499,7 +2506,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 612 "program_parse.y" +#line 619 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2510,7 +2517,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 618 "program_parse.y" +#line 625 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2537,7 +2544,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 642 "program_parse.y" +#line 649 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2557,7 +2564,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 661 "program_parse.y" +#line 668 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2567,7 +2574,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 668 "program_parse.y" +#line 675 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2582,28 +2589,28 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 679 "program_parse.y" +#line 686 "program_parse.y" { (yyval.integer) = 0; ;} break; case 58: /* Line 1455 of yacc.c */ -#line 680 "program_parse.y" +#line 687 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 59: /* Line 1455 of yacc.c */ -#line 681 "program_parse.y" +#line 688 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 60: /* Line 1455 of yacc.c */ -#line 685 "program_parse.y" +#line 692 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2618,7 +2625,7 @@ yyreduce: case 61: /* Line 1455 of yacc.c */ -#line 697 "program_parse.y" +#line 704 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2633,7 +2640,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 709 "program_parse.y" +#line 716 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2654,7 +2661,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 727 "program_parse.y" +#line 734 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2668,7 +2675,7 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 738 "program_parse.y" +#line 745 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2683,21 +2690,21 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 754 "program_parse.y" +#line 761 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 74: /* Line 1455 of yacc.c */ -#line 758 "program_parse.y" +#line 765 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 770 "program_parse.y" +#line 777 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2718,7 +2725,7 @@ yyreduce: case 82: /* Line 1455 of yacc.c */ -#line 788 "program_parse.y" +#line 795 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2727,7 +2734,7 @@ yyreduce: case 83: /* Line 1455 of yacc.c */ -#line 792 "program_parse.y" +#line 799 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2736,7 +2743,7 @@ yyreduce: case 84: /* Line 1455 of yacc.c */ -#line 798 "program_parse.y" +#line 805 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2745,7 +2752,7 @@ yyreduce: case 85: /* Line 1455 of yacc.c */ -#line 802 "program_parse.y" +#line 809 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2754,7 +2761,7 @@ yyreduce: case 86: /* Line 1455 of yacc.c */ -#line 806 "program_parse.y" +#line 813 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2763,7 +2770,7 @@ yyreduce: case 87: /* Line 1455 of yacc.c */ -#line 810 "program_parse.y" +#line 817 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); ;} @@ -2772,7 +2779,7 @@ yyreduce: case 88: /* Line 1455 of yacc.c */ -#line 814 "program_parse.y" +#line 821 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_FOG; ;} @@ -2781,7 +2788,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 818 "program_parse.y" +#line 825 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2790,7 +2797,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 822 "program_parse.y" +#line 829 "program_parse.y" { YYERROR; ;} @@ -2799,7 +2806,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 826 "program_parse.y" +#line 833 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2808,9 +2815,9 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 832 "program_parse.y" +#line 839 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); YYERROR; } @@ -2822,7 +2829,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 846 "program_parse.y" +#line 853 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2831,7 +2838,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 850 "program_parse.y" +#line 857 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2840,7 +2847,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 854 "program_parse.y" +#line 861 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2849,7 +2856,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 858 "program_parse.y" +#line 865 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2858,7 +2865,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 866 "program_parse.y" +#line 873 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2877,9 +2884,9 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 882 "program_parse.y" +#line 889 "program_parse.y" { - if (((yyvsp[(4) - (6)].integer) != 0) && ((yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { + if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, "parameter array size and number of bindings must match"); YYERROR; @@ -2902,7 +2909,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 904 "program_parse.y" +#line 911 "program_parse.y" { (yyval.integer) = 0; ;} @@ -2911,9 +2918,9 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 908 "program_parse.y" +#line 915 "program_parse.y" { - if (((yyvsp[(1) - (1)].integer) < 1) || ((yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { + if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); YYERROR; } else { @@ -2925,7 +2932,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 919 "program_parse.y" +#line 926 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -2934,7 +2941,7 @@ yyreduce: case 107: /* Line 1455 of yacc.c */ -#line 925 "program_parse.y" +#line 932 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -2943,7 +2950,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 939 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -2953,7 +2960,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 939 "program_parse.y" +#line 946 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2964,7 +2971,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 945 "program_parse.y" +#line 952 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2975,7 +2982,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 951 "program_parse.y" +#line 958 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2986,7 +2993,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 959 "program_parse.y" +#line 966 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2997,7 +3004,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 965 "program_parse.y" +#line 972 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3008,7 +3015,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 971 "program_parse.y" +#line 978 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3019,7 +3026,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 979 "program_parse.y" +#line 986 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3030,7 +3037,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 985 "program_parse.y" +#line 992 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3041,7 +3048,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 998 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3052,91 +3059,91 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 998 "program_parse.y" +#line 1005 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 120: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1006 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 121: /* Line 1455 of yacc.c */ -#line 1002 "program_parse.y" +#line 1009 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 122: /* Line 1455 of yacc.c */ -#line 1003 "program_parse.y" +#line 1010 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 123: /* Line 1455 of yacc.c */ -#line 1004 "program_parse.y" +#line 1011 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 124: /* Line 1455 of yacc.c */ -#line 1005 "program_parse.y" +#line 1012 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 125: /* Line 1455 of yacc.c */ -#line 1006 "program_parse.y" +#line 1013 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 126: /* Line 1455 of yacc.c */ -#line 1007 "program_parse.y" +#line 1014 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1008 "program_parse.y" +#line 1015 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1009 "program_parse.y" +#line 1016 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1010 "program_parse.y" +#line 1017 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1011 "program_parse.y" +#line 1018 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1022 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3148,7 +3155,7 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1024 "program_parse.y" +#line 1031 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3157,7 +3164,7 @@ yyreduce: case 133: /* Line 1455 of yacc.c */ -#line 1028 "program_parse.y" +#line 1035 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3166,7 +3173,7 @@ yyreduce: case 134: /* Line 1455 of yacc.c */ -#line 1032 "program_parse.y" +#line 1039 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3175,7 +3182,7 @@ yyreduce: case 135: /* Line 1455 of yacc.c */ -#line 1038 "program_parse.y" +#line 1045 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3187,7 +3194,7 @@ yyreduce: case 136: /* Line 1455 of yacc.c */ -#line 1047 "program_parse.y" +#line 1054 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3196,7 +3203,7 @@ yyreduce: case 137: /* Line 1455 of yacc.c */ -#line 1051 "program_parse.y" +#line 1058 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3205,7 +3212,7 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1055 "program_parse.y" +#line 1062 "program_parse.y" { (yyval.integer) = STATE_ATTENUATION; ;} @@ -3214,7 +3221,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1059 "program_parse.y" +#line 1066 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3223,7 +3230,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1063 "program_parse.y" +#line 1070 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3232,7 +3239,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1069 "program_parse.y" +#line 1076 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3241,7 +3248,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1075 "program_parse.y" +#line 1082 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3251,7 +3258,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1082 "program_parse.y" +#line 1089 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3261,7 +3268,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1087 "program_parse.y" +#line 1094 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3272,7 +3279,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1095 "program_parse.y" +#line 1102 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3285,7 +3292,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1107 "program_parse.y" +#line 1114 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3296,7 +3303,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1115 "program_parse.y" +#line 1122 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3305,7 +3312,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1121 "program_parse.y" +#line 1128 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3314,7 +3321,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1125 "program_parse.y" +#line 1132 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3323,7 +3330,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1129 "program_parse.y" +#line 1136 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3332,9 +3339,9 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" +#line 1142 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->MaxLights) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); YYERROR; } @@ -3346,7 +3353,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1146 "program_parse.y" +#line 1153 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3358,7 +3365,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1162 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3367,7 +3374,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1159 "program_parse.y" +#line 1166 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3376,7 +3383,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1164 "program_parse.y" +#line 1171 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3385,7 +3392,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1168 "program_parse.y" +#line 1175 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3394,7 +3401,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1172 "program_parse.y" +#line 1179 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3403,7 +3410,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1176 "program_parse.y" +#line 1183 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3412,7 +3419,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1182 "program_parse.y" +#line 1189 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3422,7 +3429,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1189 "program_parse.y" +#line 1196 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3431,7 +3438,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1193 "program_parse.y" +#line 1200 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3440,7 +3447,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1199 "program_parse.y" +#line 1206 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3451,9 +3458,9 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1207 "program_parse.y" +#line 1214 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); YYERROR; } @@ -3465,7 +3472,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1218 "program_parse.y" +#line 1225 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3475,7 +3482,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1225 "program_parse.y" +#line 1232 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3484,7 +3491,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1229 "program_parse.y" +#line 1236 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3493,7 +3500,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1235 "program_parse.y" +#line 1242 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3506,7 +3513,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1245 "program_parse.y" +#line 1252 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3519,7 +3526,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1255 "program_parse.y" +#line 1262 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3529,7 +3536,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1267 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3550,7 +3557,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1278 "program_parse.y" +#line 1285 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3561,7 +3568,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1286 "program_parse.y" +#line 1293 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3570,7 +3577,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1290 "program_parse.y" +#line 1297 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3579,7 +3586,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1296 "program_parse.y" +#line 1303 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3588,7 +3595,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1300 "program_parse.y" +#line 1307 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3597,7 +3604,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1304 "program_parse.y" +#line 1311 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3606,7 +3613,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1310 "program_parse.y" +#line 1317 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3620,7 +3627,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1321 "program_parse.y" +#line 1328 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3630,7 +3637,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1326 "program_parse.y" +#line 1333 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3640,7 +3647,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1331 "program_parse.y" +#line 1338 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3650,7 +3657,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1336 "program_parse.y" +#line 1343 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3660,7 +3667,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1341 "program_parse.y" +#line 1348 "program_parse.y" { YYERROR; ;} @@ -3669,7 +3676,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1345 "program_parse.y" +#line 1352 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3679,7 +3686,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1352 "program_parse.y" +#line 1359 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3688,7 +3695,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1356 "program_parse.y" +#line 1363 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3697,7 +3704,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1361 "program_parse.y" +#line 1368 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3714,7 +3721,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" +#line 1381 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3726,9 +3733,9 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1382 "program_parse.y" +#line 1389 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); YYERROR; } @@ -3740,7 +3747,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1399 "program_parse.y" +#line 1406 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3753,7 +3760,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1409 "program_parse.y" +#line 1416 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3763,7 +3770,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1414 "program_parse.y" +#line 1421 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3773,7 +3780,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1421 "program_parse.y" +#line 1428 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3786,7 +3793,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1431 "program_parse.y" +#line 1438 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3799,7 +3806,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1440 "program_parse.y" +#line 1447 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3809,7 +3816,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1445 "program_parse.y" +#line 1452 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3819,7 +3826,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1452 "program_parse.y" +#line 1459 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3832,9 +3839,9 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1462 "program_parse.y" +#line 1469 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); YYERROR; } @@ -3845,9 +3852,9 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1472 "program_parse.y" +#line 1479 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); YYERROR; } @@ -3858,7 +3865,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1487 "program_parse.y" +#line 1494 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3868,7 +3875,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1494 "program_parse.y" +#line 1501 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3878,7 +3885,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1499 "program_parse.y" +#line 1506 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -3888,7 +3895,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1506 "program_parse.y" +#line 1513 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3898,7 +3905,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1511 "program_parse.y" +#line 1518 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -3909,7 +3916,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1518 "program_parse.y" +#line 1525 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -3921,7 +3928,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1526 "program_parse.y" +#line 1533 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -3934,7 +3941,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1536 "program_parse.y" +#line 1543 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -3943,7 +3950,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1540 "program_parse.y" +#line 1547 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -3952,42 +3959,42 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1545 "program_parse.y" +#line 1552 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 218: /* Line 1455 of yacc.c */ -#line 1546 "program_parse.y" +#line 1553 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 219: /* Line 1455 of yacc.c */ -#line 1547 "program_parse.y" +#line 1554 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 220: /* Line 1455 of yacc.c */ -#line 1550 "program_parse.y" +#line 1557 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1553 "program_parse.y" +#line 1560 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 224: /* Line 1455 of yacc.c */ -#line 1557 "program_parse.y" +#line 1564 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -3998,7 +4005,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1563 "program_parse.y" +#line 1570 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4009,7 +4016,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1571 "program_parse.y" +#line 1578 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4025,7 +4032,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1584 "program_parse.y" +#line 1591 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4039,7 +4046,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1593 "program_parse.y" +#line 1600 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4053,7 +4060,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1602 "program_parse.y" +#line 1609 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4062,7 +4069,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1606 "program_parse.y" +#line 1613 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4076,7 +4083,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1615 "program_parse.y" +#line 1622 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4090,7 +4097,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1624 "program_parse.y" +#line 1631 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4104,7 +4111,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1635 "program_parse.y" +#line 1642 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4113,7 +4120,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1641 "program_parse.y" +#line 1648 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4124,7 +4131,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1647 "program_parse.y" +#line 1654 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4138,7 +4145,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1656 "program_parse.y" +#line 1663 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4152,7 +4159,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1667 "program_parse.y" +#line 1674 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4161,7 +4168,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1671 "program_parse.y" +#line 1678 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4175,7 +4182,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1687 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4189,93 +4196,93 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1690 "program_parse.y" +#line 1697 "program_parse.y" { (yyval.integer) = 0; ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1691 "program_parse.y" +#line 1698 "program_parse.y" { (yyval.integer) = 0; ;} break; case 242: /* Line 1455 of yacc.c */ -#line 1692 "program_parse.y" +#line 1699 "program_parse.y" { (yyval.integer) = 1; ;} break; case 243: /* Line 1455 of yacc.c */ -#line 1695 "program_parse.y" +#line 1702 "program_parse.y" { (yyval.integer) = 0; ;} break; case 244: /* Line 1455 of yacc.c */ -#line 1696 "program_parse.y" +#line 1703 "program_parse.y" { (yyval.integer) = 0; ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1704 "program_parse.y" { (yyval.integer) = 1; ;} break; case 246: /* Line 1455 of yacc.c */ -#line 1700 "program_parse.y" +#line 1707 "program_parse.y" { (yyval.integer) = 0; ;} break; case 247: /* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" +#line 1708 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1704 "program_parse.y" +#line 1711 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1705 "program_parse.y" +#line 1712 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1715 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1709 "program_parse.y" +#line 1716 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1713 "program_parse.y" +#line 1720 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); YYERROR; } @@ -4287,9 +4294,9 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1731 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); YYERROR; } @@ -4301,9 +4308,9 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1735 "program_parse.y" +#line 1742 "program_parse.y" { - if ((yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { + if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); YYERROR; } @@ -4315,7 +4322,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1746 "program_parse.y" +#line 1753 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4339,7 +4346,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4343 "program_parse.tab.c" +#line 4350 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4558,7 +4565,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1766 "program_parse.y" +#line 1773 "program_parse.y" struct asm_instruction * @@ -4571,7 +4578,7 @@ asm_instruction_ctor(gl_inst_opcode op, struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); if (inst) { - _mesa_init_instructions(inst, 1); + _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; inst->Base.DstReg = *dst; diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index 007b06fcc1..7dd1c02bdc 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -145,7 +145,7 @@ typedef union YYSTYPE { /* Line 1676 of yacc.c */ -#line 100 "program_parse.y" +#line 107 "program_parse.y" struct asm_instruction *inst; struct asm_symbol *sym; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 95d6c0ea31..93fc91c581 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -26,6 +26,8 @@ #include #include "main/mtypes.h" +#include "main/imports.h" +#include "program.h" #include "prog_parameter.h" #include "prog_parameter_layout.h" #include "prog_statevars.h" @@ -40,6 +42,9 @@ extern void yy_delete_buffer(void *); static struct asm_symbol *declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, struct YYLTYPE *locp); +static int add_state_reference(struct gl_program_parameter_list *param_list, + const gl_state_index tokens[STATE_LENGTH]); + static int initialize_symbol_from_state(struct gl_program *prog, struct asm_symbol *param_var, const gl_state_index tokens[STATE_LENGTH]); @@ -51,6 +56,8 @@ static int initialize_symbol_from_const(struct gl_program *prog, static int yyparse(struct asm_parser_state *state); +static char *make_error_string(const char *fmt, ...); + static void yyerror(struct YYLTYPE *locp, struct asm_parser_state *state, const char *s); @@ -580,7 +587,7 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ | progParamArray '[' progParamArrayMem ']' { if (! $3.Base.RelAddr - && ($3.Base.Index >= $1->param_binding_length)) { + && ((unsigned) $3.Base.Index >= $1->param_binding_length)) { yyerror(& @3, state, "out of bounds array access"); YYERROR; } @@ -830,7 +837,7 @@ vtxAttribItem: POSITION vtxAttribNum: INTEGER { - if ($1 >= state->limits->MaxAttribs) { + if ((unsigned) $1 >= state->limits->MaxAttribs) { yyerror(& @1, state, "invalid vertex attribute reference"); YYERROR; } @@ -880,7 +887,7 @@ PARAM_singleStmt: PARAM IDENTIFIER paramSingleInit PARAM_multipleStmt: PARAM IDENTIFIER '[' optArraySize ']' paramMultipleInit { - if (($4 != 0) && ($4 != $6.param_binding_length)) { + if (($4 != 0) && ((unsigned) $4 != $6.param_binding_length)) { yyerror(& @4, state, "parameter array size and number of bindings must match"); YYERROR; @@ -906,7 +913,7 @@ optArraySize: } | INTEGER { - if (($1 < 1) || ($1 >= state->limits->MaxParameters)) { + if (($1 < 1) || ((unsigned) $1 >= state->limits->MaxParameters)) { yyerror(& @1, state, "invalid parameter array size"); YYERROR; } else { @@ -1133,7 +1140,7 @@ ambDiffSpecProperty: AMBIENT stateLightNumber: INTEGER { - if ($1 >= state->MaxLights) { + if ((unsigned) $1 >= state->MaxLights) { yyerror(& @1, state, "invalid light selector"); YYERROR; } @@ -1205,7 +1212,7 @@ stateClipPlaneItem: CLIP '[' stateClipPlaneNum ']' PLANE stateClipPlaneNum: INTEGER { - if ($1 >= state->MaxClipPlanes) { + if ((unsigned) $1 >= state->MaxClipPlanes) { yyerror(& @1, state, "invalid clip plane selector"); YYERROR; } @@ -1380,7 +1387,7 @@ statePaletteMatNum: INTEGER ; stateProgramMatNum: INTEGER { - if ($1 >= state->MaxProgramMatrices) { + if ((unsigned) $1 >= state->MaxProgramMatrices) { yyerror(& @1, state, "invalid program matrix selector"); YYERROR; } @@ -1460,7 +1467,7 @@ progLocalParam: PROGRAM LOCAL '[' progLocalParamNum ']' progEnvParamNum: INTEGER { - if ($1 >= state->limits->MaxEnvParams) { + if ((unsigned) $1 >= state->limits->MaxEnvParams) { yyerror(& @1, state, "invalid environment parameter reference"); YYERROR; } @@ -1470,7 +1477,7 @@ progEnvParamNum: INTEGER progLocalParamNum: INTEGER { - if ($1 >= state->limits->MaxLocalParams) { + if ((unsigned) $1 >= state->limits->MaxLocalParams) { yyerror(& @1, state, "invalid local parameter reference"); YYERROR; } @@ -1711,7 +1718,7 @@ optLegacyTexUnitNum: { $$ = 0; } texCoordUnitNum: INTEGER { - if ($1 >= state->MaxTextureCoordUnits) { + if ((unsigned) $1 >= state->MaxTextureCoordUnits) { yyerror(& @1, state, "invalid texture coordinate unit selector"); YYERROR; } @@ -1722,7 +1729,7 @@ texCoordUnitNum: INTEGER texImageUnitNum: INTEGER { - if ($1 >= state->MaxTextureImageUnits) { + if ((unsigned) $1 >= state->MaxTextureImageUnits) { yyerror(& @1, state, "invalid texture image unit selector"); YYERROR; } @@ -1733,7 +1740,7 @@ texImageUnitNum: INTEGER legacyTexUnitNum: INTEGER { - if ($1 >= state->MaxTextureUnits) { + if ((unsigned) $1 >= state->MaxTextureUnits) { yyerror(& @1, state, "invalid texture unit selector"); YYERROR; } @@ -1775,7 +1782,7 @@ asm_instruction_ctor(gl_inst_opcode op, struct asm_instruction *inst = calloc(1, sizeof(struct asm_instruction)); if (inst) { - _mesa_init_instructions(inst, 1); + _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; inst->Base.DstReg = *dst; -- cgit v1.2.3 From 6f8214cae613bc3bead215214e092c07793975e7 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 24 Jul 2009 17:33:30 -0700 Subject: ARB prog: get frag prog texture info from the right place This gets basic texturing working. w00t! --- src/mesa/shader/arbprogparse.c | 6 +++--- src/mesa/shader/program_parser.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 36470b669c..42a5378999 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -3971,11 +3971,11 @@ _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, program->Base.InputsRead = prog.InputsRead; program->Base.OutputsWritten = prog.OutputsWritten; for (i = 0; i < MAX_TEXTURE_IMAGE_UNITS; i++) { - program->Base.TexturesUsed[i] = state.fragment.TexturesUsed[i]; - if (state.fragment.TexturesUsed[i]) + program->Base.TexturesUsed[i] = prog.TexturesUsed[i]; + if (prog.TexturesUsed[i]) program->Base.SamplersUsed |= (1 << i); } - program->Base.ShadowSamplers = state.fragment.ShadowSamplers; + program->Base.ShadowSamplers = prog.ShadowSamplers; switch (state.option.Fog) { case OPTION_FOG_EXP: program->FogOption = GL_EXP; break; case OPTION_FOG_EXP2: program->FogOption = GL_EXP2; break; diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index aeb2efd7ab..b4c24ec92c 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -194,8 +194,6 @@ struct asm_parser_state { } option; struct { - unsigned TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; - unsigned ShadowSamplers; unsigned UsesKill:1; } fragment; }; -- cgit v1.2.3 From f3cba9d66a5b45f4afeda3763f9ec1fb53e2ec89 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 24 Jul 2009 18:01:59 -0700 Subject: ARB prog parse: Fix cut-and-paste error for constant vectors --- src/mesa/shader/program_parse.tab.c | 110 +++++++++++++++++++----------------- src/mesa/shader/program_parse.y | 12 +++- 2 files changed, 67 insertions(+), 55 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index a23ac2d473..945d77656a 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -766,11 +766,11 @@ static const yytype_uint16 yyrline[] = 1332, 1337, 1342, 1347, 1351, 1359, 1362, 1367, 1380, 1388, 1401, 1401, 1403, 1403, 1405, 1415, 1420, 1427, 1437, 1446, 1451, 1458, 1468, 1478, 1490, 1490, 1491, 1491, 1493, 1500, - 1505, 1512, 1517, 1523, 1531, 1542, 1546, 1552, 1553, 1554, - 1557, 1557, 1560, 1560, 1563, 1569, 1577, 1590, 1599, 1608, - 1612, 1621, 1630, 1641, 1648, 1653, 1662, 1674, 1677, 1686, - 1697, 1698, 1699, 1702, 1703, 1704, 1707, 1708, 1711, 1712, - 1715, 1716, 1719, 1730, 1741, 1752 + 1505, 1512, 1520, 1528, 1537, 1548, 1552, 1558, 1559, 1560, + 1563, 1563, 1566, 1566, 1569, 1575, 1583, 1596, 1605, 1614, + 1618, 1627, 1636, 1647, 1654, 1659, 1668, 1680, 1683, 1692, + 1703, 1704, 1705, 1708, 1709, 1710, 1713, 1714, 1717, 1718, + 1721, 1722, 1725, 1736, 1747, 1758 }; #endif @@ -3899,49 +3899,55 @@ yyreduce: { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); + (yyval.vector).data[1] = 0.0f; + (yyval.vector).data[2] = 0.0f; + (yyval.vector).data[3] = 0.0f; ;} break; case 212: /* Line 1455 of yacc.c */ -#line 1518 "program_parse.y" +#line 1521 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); (yyval.vector).data[1] = (yyvsp[(4) - (5)].real); + (yyval.vector).data[2] = 0.0f; + (yyval.vector).data[3] = 0.0f; ;} break; case 213: /* Line 1455 of yacc.c */ -#line 1525 "program_parse.y" +#line 1530 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); (yyval.vector).data[1] = (yyvsp[(4) - (7)].real); - (yyval.vector).data[1] = (yyvsp[(6) - (7)].real); + (yyval.vector).data[2] = (yyvsp[(6) - (7)].real); + (yyval.vector).data[3] = 0.0f; ;} break; case 214: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1539 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); (yyval.vector).data[1] = (yyvsp[(4) - (9)].real); - (yyval.vector).data[1] = (yyvsp[(6) - (9)].real); - (yyval.vector).data[1] = (yyvsp[(8) - (9)].real); + (yyval.vector).data[2] = (yyvsp[(6) - (9)].real); + (yyval.vector).data[3] = (yyvsp[(8) - (9)].real); ;} break; case 215: /* Line 1455 of yacc.c */ -#line 1543 "program_parse.y" +#line 1549 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -3950,7 +3956,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1547 "program_parse.y" +#line 1553 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -3959,42 +3965,42 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1552 "program_parse.y" +#line 1558 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 218: /* Line 1455 of yacc.c */ -#line 1553 "program_parse.y" +#line 1559 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 219: /* Line 1455 of yacc.c */ -#line 1554 "program_parse.y" +#line 1560 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 220: /* Line 1455 of yacc.c */ -#line 1557 "program_parse.y" +#line 1563 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" +#line 1566 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 224: /* Line 1455 of yacc.c */ -#line 1564 "program_parse.y" +#line 1570 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4005,7 +4011,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1570 "program_parse.y" +#line 1576 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4016,7 +4022,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1578 "program_parse.y" +#line 1584 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4032,7 +4038,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1591 "program_parse.y" +#line 1597 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4046,7 +4052,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1600 "program_parse.y" +#line 1606 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4060,7 +4066,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1609 "program_parse.y" +#line 1615 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4069,7 +4075,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1613 "program_parse.y" +#line 1619 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4083,7 +4089,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1622 "program_parse.y" +#line 1628 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4097,7 +4103,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1631 "program_parse.y" +#line 1637 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4111,7 +4117,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1642 "program_parse.y" +#line 1648 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4120,7 +4126,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1648 "program_parse.y" +#line 1654 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4131,7 +4137,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1654 "program_parse.y" +#line 1660 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4145,7 +4151,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1663 "program_parse.y" +#line 1669 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4159,7 +4165,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1674 "program_parse.y" +#line 1680 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4168,7 +4174,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1678 "program_parse.y" +#line 1684 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4182,7 +4188,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1687 "program_parse.y" +#line 1693 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4196,91 +4202,91 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1703 "program_parse.y" { (yyval.integer) = 0; ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1698 "program_parse.y" +#line 1704 "program_parse.y" { (yyval.integer) = 0; ;} break; case 242: /* Line 1455 of yacc.c */ -#line 1699 "program_parse.y" +#line 1705 "program_parse.y" { (yyval.integer) = 1; ;} break; case 243: /* Line 1455 of yacc.c */ -#line 1702 "program_parse.y" +#line 1708 "program_parse.y" { (yyval.integer) = 0; ;} break; case 244: /* Line 1455 of yacc.c */ -#line 1703 "program_parse.y" +#line 1709 "program_parse.y" { (yyval.integer) = 0; ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1704 "program_parse.y" +#line 1710 "program_parse.y" { (yyval.integer) = 1; ;} break; case 246: /* Line 1455 of yacc.c */ -#line 1707 "program_parse.y" +#line 1713 "program_parse.y" { (yyval.integer) = 0; ;} break; case 247: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1714 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1711 "program_parse.y" +#line 1717 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1712 "program_parse.y" +#line 1718 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1715 "program_parse.y" +#line 1721 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1716 "program_parse.y" +#line 1722 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1726 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4294,7 +4300,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1731 "program_parse.y" +#line 1737 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4308,7 +4314,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1742 "program_parse.y" +#line 1748 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4322,7 +4328,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1753 "program_parse.y" +#line 1759 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4346,7 +4352,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4350 "program_parse.tab.c" +#line 4356 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4565,7 +4571,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1773 "program_parse.y" +#line 1779 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 93fc91c581..8521a97b4f 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1513,12 +1513,17 @@ paramConstVector: '{' signedFloatConstant '}' { $$.count = 1; $$.data[0] = $2; + $$.data[1] = 0.0f; + $$.data[2] = 0.0f; + $$.data[3] = 0.0f; } | '{' signedFloatConstant ',' signedFloatConstant '}' { $$.count = 2; $$.data[0] = $2; $$.data[1] = $4; + $$.data[2] = 0.0f; + $$.data[3] = 0.0f; } | '{' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant '}' @@ -1526,7 +1531,8 @@ paramConstVector: '{' signedFloatConstant '}' $$.count = 3; $$.data[0] = $2; $$.data[1] = $4; - $$.data[1] = $6; + $$.data[2] = $6; + $$.data[3] = 0.0f; } | '{' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant '}' @@ -1534,8 +1540,8 @@ paramConstVector: '{' signedFloatConstant '}' $$.count = 4; $$.data[0] = $2; $$.data[1] = $4; - $$.data[1] = $6; - $$.data[1] = $8; + $$.data[2] = $6; + $$.data[3] = $8; } ; -- cgit v1.2.3 From a7400e736467b7b032ee0d8a8bad25a0a65e782b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 24 Jul 2009 18:03:02 -0700 Subject: ARB prog: _mesa_print_program output should go to same place as _mesa_printf --- src/mesa/shader/prog_print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/prog_print.c b/src/mesa/shader/prog_print.c index de7fef1f86..441496bf5f 100644 --- a/src/mesa/shader/prog_print.c +++ b/src/mesa/shader/prog_print.c @@ -816,7 +816,7 @@ _mesa_fprint_program_opt(FILE *f, void _mesa_print_program(const struct gl_program *prog) { - _mesa_fprint_program_opt(stdout, prog, PROG_PRINT_DEBUG, GL_TRUE); + _mesa_fprint_program_opt(stderr, prog, PROG_PRINT_DEBUG, GL_TRUE); } -- cgit v1.2.3 From 258f640edab9ca9e71ee255ebe5ddae4b9d0d871 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 24 Jul 2009 18:14:47 -0700 Subject: ARB prog: Layout parameters from parameter type, not src type Use the type stored in the Parameters array to determine the layout instead of the type in the instruction register field. Also, update the instruction register field based on the parameter type. This makes Google Earth work exactly like with Mesa master. --- src/mesa/shader/prog_parameter_layout.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/prog_parameter_layout.c b/src/mesa/shader/prog_parameter_layout.c index f374636f11..4d67eca902 100644 --- a/src/mesa/shader/prog_parameter_layout.c +++ b/src/mesa/shader/prog_parameter_layout.c @@ -170,10 +170,15 @@ _mesa_layout_parameters(struct asm_parser_state *state) } + if ((inst->SrcReg[i].Base.File <= PROGRAM_VARYING ) + || (inst->SrcReg[i].Base.File >= PROGRAM_WRITE_ONLY)) { + continue; + } + inst->Base.SrcReg[i] = inst->SrcReg[i].Base; p = & state->prog->Parameters->Parameters[idx]; - switch (inst->SrcReg[i].Base.File) { + switch (p->Type) { case PROGRAM_CONSTANT: { const float *const v = state->prog->Parameters->ParameterValues[idx]; @@ -194,6 +199,9 @@ _mesa_layout_parameters(struct asm_parser_state *state) default: break; } + + inst->SrcReg[i].Base.File = p->Type; + inst->Base.SrcReg[i].File = p->Type; } } -- cgit v1.2.3 From 0044d3ba94f9041492ea90cf8961fd8b55daefda Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 12:17:06 -0700 Subject: Add destructor for hash_table --- src/mesa/shader/hash_table.c | 15 ++++++++++++--- src/mesa/shader/hash_table.h | 9 +++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/hash_table.c b/src/mesa/shader/hash_table.c index 9b8f251bcc..3ff603b368 100644 --- a/src/mesa/shader/hash_table.c +++ b/src/mesa/shader/hash_table.c @@ -68,7 +68,8 @@ hash_table_ctor(unsigned num_buckets, hash_func_t hash, num_buckets = 16; } - ht = malloc(sizeof(*ht) + ((num_buckets - 1) * sizeof(ht->buckets[0]))); + ht = _mesa_malloc(sizeof(*ht) + ((num_buckets - 1) + * sizeof(ht->buckets[0]))); if (ht != NULL) { ht->hash = hash; ht->compare = compare; @@ -83,6 +84,14 @@ hash_table_ctor(unsigned num_buckets, hash_func_t hash, } +void +hash_table_dtor(struct hash_table *ht) +{ + hash_table_clear(ht); + _mesa_free(ht); +} + + void hash_table_clear(struct hash_table *ht) { @@ -94,7 +103,7 @@ hash_table_clear(struct hash_table *ht) for (i = 0; i < ht->num_buckets; i++) { foreach_s(node, temp, & ht->buckets[i]) { remove_from_list(node); - free(node); + _mesa_free(node); } assert(is_empty_list(& ht->buckets[i])); @@ -128,7 +137,7 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key) const unsigned bucket = hash_value % ht->num_buckets; struct hash_node *node; - node = calloc(1, sizeof(*node)); + node = _mesa_calloc(1, sizeof(*node)); node->data = data; node->key = key; diff --git a/src/mesa/shader/hash_table.h b/src/mesa/shader/hash_table.h index 83ae7f07c7..7b302f5dbe 100644 --- a/src/mesa/shader/hash_table.h +++ b/src/mesa/shader/hash_table.h @@ -53,6 +53,15 @@ extern struct hash_table *hash_table_ctor(unsigned num_buckets, hash_func_t hash, hash_compare_func_t compare); +/** + * Release all memory associated with a hash table + * + * \warning + * This function cannot release memory occupied either by keys or data. + */ +extern void hash_table_dtor(struct hash_table *ht); + + /** * Flush all entries from a hash table * -- cgit v1.2.3 From 946ea82bff530ac7aa8f5ebe56704fde62e14e86 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 12:19:14 -0700 Subject: Add destructor for symbol_table --- src/mesa/shader/symbol_table.c | 20 +++++++++++++++++--- src/mesa/shader/symbol_table.h | 1 + 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/symbol_table.c b/src/mesa/shader/symbol_table.c index b90c495cdb..71ce1287f5 100644 --- a/src/mesa/shader/symbol_table.c +++ b/src/mesa/shader/symbol_table.c @@ -325,10 +325,24 @@ _mesa_symbol_table_ctor(void) { struct _mesa_symbol_table *table = calloc(1, sizeof(*table)); - table->ht = hash_table_ctor(32, hash_table_string_hash, - hash_table_string_compare); + if (table != NULL) { + table->ht = hash_table_ctor(32, hash_table_string_hash, + hash_table_string_compare); - _mesa_symbol_table_push_scope(table); + _mesa_symbol_table_push_scope(table); + } return table; } + + +void +_mesa_symbol_table_dtor(struct _mesa_symbol_table *table) +{ + while (table->current_scope != NULL) { + _mesa_symbol_table_pop_scope(table); + } + + hash_table_dtor(table->ht); + free(table); +} diff --git a/src/mesa/shader/symbol_table.h b/src/mesa/shader/symbol_table.h index c543615761..0c054ef139 100644 --- a/src/mesa/shader/symbol_table.h +++ b/src/mesa/shader/symbol_table.h @@ -38,6 +38,7 @@ extern void *_mesa_symbol_table_find_symbol( extern struct _mesa_symbol_table *_mesa_symbol_table_ctor(void); +extern void _mesa_symbol_table_dtor(struct _mesa_symbol_table *); extern struct _mesa_symbol_table_iterator *_mesa_symbol_table_iterator_ctor( struct _mesa_symbol_table *table, int name_space, const char *name); -- cgit v1.2.3 From 94b45567047fd681666f261f1ad0164049f0491a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 12:21:26 -0700 Subject: ARB prog: Clean up several memory leaks As far as I am able to determine via code inspection and using Valgrind, that should be all of the leaks in the parser. --- src/mesa/shader/program_parse.tab.c | 35 ++++++++++++++++++++++++++++++----- src/mesa/shader/program_parse.y | 35 ++++++++++++++++++++++++++++++----- src/mesa/shader/program_parser.h | 9 +++++++++ 3 files changed, 69 insertions(+), 10 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 945d77656a..a49cfeb483 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4700,6 +4700,8 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, } _mesa_symbol_table_add_symbol(state->st, 0, s->name, s); + s->next = state->sym; + state->sym = s; } return s; @@ -4900,6 +4902,9 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, struct asm_instruction *inst; unsigned i; GLubyte *strz; + GLboolean result = GL_FALSE; + void *temp; + struct asm_symbol *sym; state->ctx = ctx; state->prog->Target = target; @@ -4961,7 +4966,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, if (ctx->Program.ErrorPos != -1) { - return GL_FALSE; + goto error; } if (! _mesa_layout_parameters(state)) { @@ -4972,7 +4977,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, loc.position = len; yyerror(& loc, state, "invalid PARAM usage"); - return GL_FALSE; + goto error; } @@ -4986,8 +4991,6 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, struct asm_instruction *const temp = inst->next; state->prog->Instructions[i] = inst->Base; - _mesa_free(inst); - inst = temp; } @@ -5011,6 +5014,28 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->prog->NumNativeAttributes = state->prog->NumAttributes; state->prog->NumNativeAddressRegs = state->prog->NumAddressRegs; - return GL_TRUE; + result = GL_TRUE; + +error: + for (inst = state->inst_head; inst != NULL; inst = temp) { + temp = inst->next; + _mesa_free(inst); + } + + state->inst_head = NULL; + state->inst_tail = NULL; + + for (sym = state->sym; sym != NULL; sym = temp) { + temp = sym->next; + + _mesa_free(sym->name); + _mesa_free(sym); + } + state->sym = NULL; + + _mesa_symbol_table_dtor(state->st); + state->st = NULL; + + return result; } diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 8521a97b4f..92e035997a 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1904,6 +1904,8 @@ declare_variable(struct asm_parser_state *state, char *name, enum asm_type t, } _mesa_symbol_table_add_symbol(state->st, 0, s->name, s); + s->next = state->sym; + state->sym = s; } return s; @@ -2104,6 +2106,9 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, struct asm_instruction *inst; unsigned i; GLubyte *strz; + GLboolean result = GL_FALSE; + void *temp; + struct asm_symbol *sym; state->ctx = ctx; state->prog->Target = target; @@ -2165,7 +2170,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, if (ctx->Program.ErrorPos != -1) { - return GL_FALSE; + goto error; } if (! _mesa_layout_parameters(state)) { @@ -2176,7 +2181,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, loc.position = len; yyerror(& loc, state, "invalid PARAM usage"); - return GL_FALSE; + goto error; } @@ -2190,8 +2195,6 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, struct asm_instruction *const temp = inst->next; state->prog->Instructions[i] = inst->Base; - _mesa_free(inst); - inst = temp; } @@ -2215,5 +2218,27 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->prog->NumNativeAttributes = state->prog->NumAttributes; state->prog->NumNativeAddressRegs = state->prog->NumAddressRegs; - return GL_TRUE; + result = GL_TRUE; + +error: + for (inst = state->inst_head; inst != NULL; inst = temp) { + temp = inst->next; + _mesa_free(inst); + } + + state->inst_head = NULL; + state->inst_tail = NULL; + + for (sym = state->sym; sym != NULL; sym = temp) { + temp = sym->next; + + _mesa_free((void *) sym->name); + _mesa_free(sym); + } + state->sym = NULL; + + _mesa_symbol_table_dtor(state->st); + state->st = NULL; + + return result; } diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index b4c24ec92c..e17ffd2322 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -39,6 +39,7 @@ enum asm_type { }; struct asm_symbol { + struct asm_symbol *next; /**< List linkage for freeing. */ const char *name; enum asm_type type; unsigned attrib_binding; @@ -134,6 +135,14 @@ struct asm_parser_state { struct _mesa_symbol_table *st; + /** + * Linked list of symbols + * + * This list is \b only used when cleaning up compiler state and freeing + * memory. + */ + struct asm_symbol *sym; + /** * State for the lexer. */ -- cgit v1.2.3 From 6d3ccaf3665ce4c137cdeb614a518e58d4cd8aef Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 12:38:52 -0700 Subject: ARB prog: Delete comment about possibly needing to free a buffer Valgrind doesn't complain about a leak here, so delete the comment about possibly needing to free the state returned by yy_scan_bytes. --- src/mesa/shader/program_lexer.l | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index 2d20772631..c952f09040 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -474,9 +474,5 @@ _mesa_program_lexer_ctor(void **scanner, struct asm_parser_state *state, void _mesa_program_lexer_dtor(void *scanner) { - /* FINISHME: It's not clear to me whether or not the buffer state returned - * FINISHME: by yy_scan_bytes in _mesa_program_lexer_ctor needs to be - * FINISHME: explicitly destroyed here or not. - */ yylex_destroy(scanner); } -- cgit v1.2.3 From be32fb779beecf4bbd61c42c7eb0f8ca988a9831 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 12:48:44 -0700 Subject: ARB prog: Update generated files missed on previous two commits The changes are, as it turns out, purely cosmetic. --- src/mesa/shader/lex.yy.c | 4 ---- src/mesa/shader/program_parse.tab.c | 4 ++-- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 120e18eb19..e2b0da9cbe 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -3521,10 +3521,6 @@ _mesa_program_lexer_ctor(void **scanner, struct asm_parser_state *state, void _mesa_program_lexer_dtor(void *scanner) { - /* FINISHME: It's not clear to me whether or not the buffer state returned - * FINISHME: by yy_scan_bytes in _mesa_program_lexer_ctor needs to be - * FINISHME: explicitly destroyed here or not. - */ yylex_destroy(scanner); } diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index a49cfeb483..6ea10f8567 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4966,7 +4966,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, if (ctx->Program.ErrorPos != -1) { - goto error; + goto error; } if (! _mesa_layout_parameters(state)) { @@ -5028,7 +5028,7 @@ error: for (sym = state->sym; sym != NULL; sym = temp) { temp = sym->next; - _mesa_free(sym->name); + _mesa_free((void *) sym->name); _mesa_free(sym); } state->sym = NULL; -- cgit v1.2.3 From 054ab5a50a324b1d64fe403a65a2a392ba0c09fd Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 14:11:38 -0700 Subject: ARB prog parser: Correct handling of some extensions that interact w/ARB_vp --- src/mesa/shader/program_parse.tab.c | 359 ++++++++++++++++++---------------- src/mesa/shader/program_parse.y | 17 ++ src/mesa/shader/program_parse_extra.c | 13 +- 3 files changed, 211 insertions(+), 178 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 6ea10f8567..2558ae56f5 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -753,24 +753,24 @@ static const yytype_uint16 yyrline[] = 618, 624, 648, 665, 665, 667, 674, 686, 687, 688, 691, 703, 715, 733, 744, 756, 758, 759, 760, 761, 764, 764, 764, 764, 765, 768, 769, 770, 771, 772, - 773, 776, 794, 798, 804, 808, 812, 816, 820, 824, - 828, 832, 838, 849, 849, 850, 852, 856, 860, 864, - 870, 870, 872, 888, 911, 914, 925, 931, 937, 938, - 945, 951, 957, 965, 971, 977, 985, 991, 997, 1005, - 1006, 1009, 1010, 1011, 1012, 1013, 1014, 1015, 1016, 1017, - 1018, 1021, 1030, 1034, 1038, 1044, 1053, 1057, 1061, 1065, - 1069, 1075, 1081, 1088, 1093, 1101, 1111, 1113, 1121, 1127, - 1131, 1135, 1141, 1152, 1161, 1165, 1170, 1174, 1178, 1182, - 1188, 1195, 1199, 1205, 1213, 1224, 1231, 1235, 1241, 1251, - 1262, 1266, 1284, 1293, 1296, 1302, 1306, 1310, 1316, 1327, - 1332, 1337, 1342, 1347, 1351, 1359, 1362, 1367, 1380, 1388, - 1401, 1401, 1403, 1403, 1405, 1415, 1420, 1427, 1437, 1446, - 1451, 1458, 1468, 1478, 1490, 1490, 1491, 1491, 1493, 1500, - 1505, 1512, 1520, 1528, 1537, 1548, 1552, 1558, 1559, 1560, - 1563, 1563, 1566, 1566, 1569, 1575, 1583, 1596, 1605, 1614, - 1618, 1627, 1636, 1647, 1654, 1659, 1668, 1680, 1683, 1692, - 1703, 1704, 1705, 1708, 1709, 1710, 1713, 1714, 1717, 1718, - 1721, 1722, 1725, 1736, 1747, 1758 + 773, 776, 794, 798, 804, 808, 812, 816, 825, 834, + 838, 843, 849, 860, 860, 861, 863, 867, 871, 875, + 881, 881, 883, 899, 922, 925, 936, 942, 948, 949, + 956, 962, 968, 976, 982, 988, 996, 1002, 1008, 1016, + 1017, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, + 1029, 1032, 1041, 1045, 1049, 1055, 1064, 1068, 1072, 1081, + 1085, 1091, 1097, 1104, 1109, 1117, 1127, 1129, 1137, 1143, + 1147, 1151, 1157, 1168, 1177, 1181, 1186, 1190, 1194, 1198, + 1204, 1211, 1215, 1221, 1229, 1240, 1247, 1251, 1257, 1267, + 1278, 1282, 1300, 1309, 1312, 1318, 1322, 1326, 1332, 1343, + 1348, 1353, 1358, 1363, 1368, 1376, 1379, 1384, 1397, 1405, + 1418, 1418, 1420, 1420, 1422, 1432, 1437, 1444, 1454, 1463, + 1468, 1475, 1485, 1495, 1507, 1507, 1508, 1508, 1510, 1517, + 1522, 1529, 1537, 1545, 1554, 1565, 1569, 1575, 1576, 1577, + 1580, 1580, 1583, 1583, 1586, 1592, 1600, 1613, 1622, 1631, + 1635, 1644, 1653, 1664, 1671, 1676, 1685, 1697, 1700, 1709, + 1720, 1721, 1722, 1725, 1726, 1727, 1730, 1731, 1734, 1735, + 1738, 1739, 1742, 1753, 1764, 1775 }; #endif @@ -2772,6 +2772,11 @@ yyreduce: /* Line 1455 of yacc.c */ #line 817 "program_parse.y" { + if (!state->ctx->Extensions.EXT_secondary_color) { + yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); + YYERROR; + } + (yyval.attrib) = VERT_ATTRIB_COLOR0 + (yyvsp[(2) - (2)].integer); ;} break; @@ -2779,8 +2784,13 @@ yyreduce: case 88: /* Line 1455 of yacc.c */ -#line 821 "program_parse.y" +#line 826 "program_parse.y" { + if (!state->ctx->Extensions.EXT_fog_coord) { + yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); + YYERROR; + } + (yyval.attrib) = VERT_ATTRIB_FOG; ;} break; @@ -2788,7 +2798,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 825 "program_parse.y" +#line 835 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2797,8 +2807,9 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 829 "program_parse.y" +#line 839 "program_parse.y" { + yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; @@ -2806,7 +2817,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 833 "program_parse.y" +#line 844 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2815,7 +2826,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 839 "program_parse.y" +#line 850 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2829,7 +2840,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 853 "program_parse.y" +#line 864 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2838,7 +2849,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 857 "program_parse.y" +#line 868 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2847,7 +2858,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 861 "program_parse.y" +#line 872 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2856,7 +2867,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 865 "program_parse.y" +#line 876 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2865,7 +2876,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 873 "program_parse.y" +#line 884 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2884,7 +2895,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 889 "program_parse.y" +#line 900 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -2909,7 +2920,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 911 "program_parse.y" +#line 922 "program_parse.y" { (yyval.integer) = 0; ;} @@ -2918,7 +2929,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 915 "program_parse.y" +#line 926 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -2932,7 +2943,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 926 "program_parse.y" +#line 937 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -2941,7 +2952,7 @@ yyreduce: case 107: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 943 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -2950,7 +2961,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 939 "program_parse.y" +#line 950 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -2960,7 +2971,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 946 "program_parse.y" +#line 957 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2971,7 +2982,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 952 "program_parse.y" +#line 963 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2982,7 +2993,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 958 "program_parse.y" +#line 969 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2993,7 +3004,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 966 "program_parse.y" +#line 977 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3004,7 +3015,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 972 "program_parse.y" +#line 983 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3015,7 +3026,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 978 "program_parse.y" +#line 989 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3026,7 +3037,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 986 "program_parse.y" +#line 997 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3037,7 +3048,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 992 "program_parse.y" +#line 1003 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3048,7 +3059,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 998 "program_parse.y" +#line 1009 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3059,91 +3070,91 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1005 "program_parse.y" +#line 1016 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 120: /* Line 1455 of yacc.c */ -#line 1006 "program_parse.y" +#line 1017 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 121: /* Line 1455 of yacc.c */ -#line 1009 "program_parse.y" +#line 1020 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 122: /* Line 1455 of yacc.c */ -#line 1010 "program_parse.y" +#line 1021 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 123: /* Line 1455 of yacc.c */ -#line 1011 "program_parse.y" +#line 1022 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 124: /* Line 1455 of yacc.c */ -#line 1012 "program_parse.y" +#line 1023 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 125: /* Line 1455 of yacc.c */ -#line 1013 "program_parse.y" +#line 1024 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 126: /* Line 1455 of yacc.c */ -#line 1014 "program_parse.y" +#line 1025 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1015 "program_parse.y" +#line 1026 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1016 "program_parse.y" +#line 1027 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1017 "program_parse.y" +#line 1028 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1018 "program_parse.y" +#line 1029 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1022 "program_parse.y" +#line 1033 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3155,7 +3166,7 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1031 "program_parse.y" +#line 1042 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3164,7 +3175,7 @@ yyreduce: case 133: /* Line 1455 of yacc.c */ -#line 1035 "program_parse.y" +#line 1046 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3173,7 +3184,7 @@ yyreduce: case 134: /* Line 1455 of yacc.c */ -#line 1039 "program_parse.y" +#line 1050 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3182,7 +3193,7 @@ yyreduce: case 135: /* Line 1455 of yacc.c */ -#line 1045 "program_parse.y" +#line 1056 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3194,7 +3205,7 @@ yyreduce: case 136: /* Line 1455 of yacc.c */ -#line 1054 "program_parse.y" +#line 1065 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3203,7 +3214,7 @@ yyreduce: case 137: /* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" +#line 1069 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3212,8 +3223,13 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1062 "program_parse.y" +#line 1073 "program_parse.y" { + if (!state->ctx->Extensions.EXT_point_parameters) { + yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); + YYERROR; + } + (yyval.integer) = STATE_ATTENUATION; ;} break; @@ -3221,7 +3237,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1066 "program_parse.y" +#line 1082 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3230,7 +3246,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1070 "program_parse.y" +#line 1086 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3239,7 +3255,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1076 "program_parse.y" +#line 1092 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3248,7 +3264,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1082 "program_parse.y" +#line 1098 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3258,7 +3274,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1089 "program_parse.y" +#line 1105 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3268,7 +3284,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1094 "program_parse.y" +#line 1110 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3279,7 +3295,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1102 "program_parse.y" +#line 1118 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3292,7 +3308,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1114 "program_parse.y" +#line 1130 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3303,7 +3319,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1122 "program_parse.y" +#line 1138 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3312,7 +3328,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1128 "program_parse.y" +#line 1144 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3321,7 +3337,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1132 "program_parse.y" +#line 1148 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3330,7 +3346,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1136 "program_parse.y" +#line 1152 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3339,7 +3355,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1142 "program_parse.y" +#line 1158 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3353,7 +3369,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1153 "program_parse.y" +#line 1169 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3365,7 +3381,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1178 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3374,7 +3390,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1166 "program_parse.y" +#line 1182 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3383,7 +3399,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1171 "program_parse.y" +#line 1187 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3392,7 +3408,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1175 "program_parse.y" +#line 1191 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3401,7 +3417,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1179 "program_parse.y" +#line 1195 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3410,7 +3426,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1183 "program_parse.y" +#line 1199 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3419,7 +3435,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1189 "program_parse.y" +#line 1205 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3429,7 +3445,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1196 "program_parse.y" +#line 1212 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3438,7 +3454,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1200 "program_parse.y" +#line 1216 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3447,7 +3463,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1206 "program_parse.y" +#line 1222 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3458,7 +3474,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" +#line 1230 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3472,7 +3488,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1225 "program_parse.y" +#line 1241 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3482,7 +3498,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1232 "program_parse.y" +#line 1248 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3491,7 +3507,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1236 "program_parse.y" +#line 1252 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3500,7 +3516,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1242 "program_parse.y" +#line 1258 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3513,7 +3529,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1252 "program_parse.y" +#line 1268 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3526,7 +3542,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1262 "program_parse.y" +#line 1278 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3536,7 +3552,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1267 "program_parse.y" +#line 1283 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3557,7 +3573,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" +#line 1301 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3568,7 +3584,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1293 "program_parse.y" +#line 1309 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3577,7 +3593,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1297 "program_parse.y" +#line 1313 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3586,7 +3602,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1303 "program_parse.y" +#line 1319 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3595,7 +3611,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1307 "program_parse.y" +#line 1323 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3604,7 +3620,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1311 "program_parse.y" +#line 1327 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3613,7 +3629,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1317 "program_parse.y" +#line 1333 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3627,7 +3643,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1328 "program_parse.y" +#line 1344 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3637,7 +3653,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1333 "program_parse.y" +#line 1349 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3647,7 +3663,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" +#line 1354 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3657,7 +3673,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1343 "program_parse.y" +#line 1359 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3667,8 +3683,9 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1348 "program_parse.y" +#line 1364 "program_parse.y" { + yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; @@ -3676,7 +3693,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1352 "program_parse.y" +#line 1369 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3686,7 +3703,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1359 "program_parse.y" +#line 1376 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3695,7 +3712,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1363 "program_parse.y" +#line 1380 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3704,7 +3721,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" +#line 1385 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3721,7 +3738,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1381 "program_parse.y" +#line 1398 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3733,7 +3750,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1389 "program_parse.y" +#line 1406 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3747,7 +3764,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1406 "program_parse.y" +#line 1423 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3760,7 +3777,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1416 "program_parse.y" +#line 1433 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3770,7 +3787,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1421 "program_parse.y" +#line 1438 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3780,7 +3797,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1428 "program_parse.y" +#line 1445 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3793,7 +3810,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1438 "program_parse.y" +#line 1455 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3806,7 +3823,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1447 "program_parse.y" +#line 1464 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3816,7 +3833,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1452 "program_parse.y" +#line 1469 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3826,7 +3843,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1459 "program_parse.y" +#line 1476 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3839,7 +3856,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1469 "program_parse.y" +#line 1486 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3852,7 +3869,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1479 "program_parse.y" +#line 1496 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3865,7 +3882,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1494 "program_parse.y" +#line 1511 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3875,7 +3892,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" +#line 1518 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3885,7 +3902,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1506 "program_parse.y" +#line 1523 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -3895,7 +3912,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1513 "program_parse.y" +#line 1530 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3908,7 +3925,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1521 "program_parse.y" +#line 1538 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -3921,7 +3938,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1530 "program_parse.y" +#line 1547 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -3934,7 +3951,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1539 "program_parse.y" +#line 1556 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -3947,7 +3964,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1549 "program_parse.y" +#line 1566 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -3956,7 +3973,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1553 "program_parse.y" +#line 1570 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -3965,42 +3982,42 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1558 "program_parse.y" +#line 1575 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 218: /* Line 1455 of yacc.c */ -#line 1559 "program_parse.y" +#line 1576 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 219: /* Line 1455 of yacc.c */ -#line 1560 "program_parse.y" +#line 1577 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 220: /* Line 1455 of yacc.c */ -#line 1563 "program_parse.y" +#line 1580 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1566 "program_parse.y" +#line 1583 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 224: /* Line 1455 of yacc.c */ -#line 1570 "program_parse.y" +#line 1587 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4011,7 +4028,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1576 "program_parse.y" +#line 1593 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4022,7 +4039,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1584 "program_parse.y" +#line 1601 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4038,7 +4055,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1597 "program_parse.y" +#line 1614 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4052,7 +4069,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1606 "program_parse.y" +#line 1623 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4066,7 +4083,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1615 "program_parse.y" +#line 1632 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4075,7 +4092,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1619 "program_parse.y" +#line 1636 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4089,7 +4106,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1628 "program_parse.y" +#line 1645 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4103,7 +4120,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1637 "program_parse.y" +#line 1654 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4117,7 +4134,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1648 "program_parse.y" +#line 1665 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4126,7 +4143,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1654 "program_parse.y" +#line 1671 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4137,7 +4154,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1660 "program_parse.y" +#line 1677 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4151,7 +4168,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" +#line 1686 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4165,7 +4182,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1697 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4174,7 +4191,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1684 "program_parse.y" +#line 1701 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4188,7 +4205,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1693 "program_parse.y" +#line 1710 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4202,91 +4219,91 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1703 "program_parse.y" +#line 1720 "program_parse.y" { (yyval.integer) = 0; ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1704 "program_parse.y" +#line 1721 "program_parse.y" { (yyval.integer) = 0; ;} break; case 242: /* Line 1455 of yacc.c */ -#line 1705 "program_parse.y" +#line 1722 "program_parse.y" { (yyval.integer) = 1; ;} break; case 243: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1725 "program_parse.y" { (yyval.integer) = 0; ;} break; case 244: /* Line 1455 of yacc.c */ -#line 1709 "program_parse.y" +#line 1726 "program_parse.y" { (yyval.integer) = 0; ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1710 "program_parse.y" +#line 1727 "program_parse.y" { (yyval.integer) = 1; ;} break; case 246: /* Line 1455 of yacc.c */ -#line 1713 "program_parse.y" +#line 1730 "program_parse.y" { (yyval.integer) = 0; ;} break; case 247: /* Line 1455 of yacc.c */ -#line 1714 "program_parse.y" +#line 1731 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1717 "program_parse.y" +#line 1734 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1718 "program_parse.y" +#line 1735 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1721 "program_parse.y" +#line 1738 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1722 "program_parse.y" +#line 1739 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1726 "program_parse.y" +#line 1743 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4300,7 +4317,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1737 "program_parse.y" +#line 1754 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4314,7 +4331,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1748 "program_parse.y" +#line 1765 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4328,7 +4345,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1759 "program_parse.y" +#line 1776 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4352,7 +4369,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4356 "program_parse.tab.c" +#line 4373 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4571,7 +4588,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1779 "program_parse.y" +#line 1796 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 92e035997a..852c26b31f 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -815,10 +815,20 @@ vtxAttribItem: POSITION } | COLOR optColorType { + if (!state->ctx->Extensions.EXT_secondary_color) { + yyerror(& @2, state, "GL_EXT_secondary_color not supported"); + YYERROR; + } + $$ = VERT_ATTRIB_COLOR0 + $2; } | FOGCOORD { + if (!state->ctx->Extensions.EXT_fog_coord) { + yyerror(& @1, state, "GL_EXT_fog_coord not supported"); + YYERROR; + } + $$ = VERT_ATTRIB_FOG; } | TEXCOORD optTexCoordUnitNum @@ -827,6 +837,7 @@ vtxAttribItem: POSITION } | MATRIXINDEX '[' vtxWeightNum ']' { + yyerror(& @1, state, "GL_ARB_matrix_palette not supported"); YYERROR; } | VTXATTRIB '[' vtxAttribNum ']' @@ -1060,6 +1071,11 @@ stateLightProperty: ambDiffSpecProperty } | ATTENUATION { + if (!state->ctx->Extensions.EXT_point_parameters) { + yyerror(& @1, state, "GL_ARB_point_parameters not supported"); + YYERROR; + } + $$ = STATE_ATTENUATION; } | SPOT stateSpotProperty @@ -1346,6 +1362,7 @@ stateMatrixName: MODELVIEW stateOptModMatNum } | PALETTE '[' statePaletteMatNum ']' { + yyerror(& @1, state, "GL_ARB_matrix_palette not supported"); YYERROR; } | MAT_PROGRAM '[' stateProgramMatNum ']' diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index b365267d4d..f4643d12da 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -91,17 +91,16 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) return 0; } else if (strcmp(option, "draw_buffers") == 0) { - /* FINISHME: This should validate that the driver support the - * FINISHME: GL_ARB_draw_buffers extension. + /* Don't need to check extension availability because all Mesa-based + * drivers support GL_ARB_draw_buffers. */ state->option.DrawBuffers = 1; return 1; } else if (strcmp(option, "fragment_program_shadow") == 0) { - /* FINISHME: This should validate that the driver support the - * FINISHME: GL_ARB_fragment_program_shadow extension. - */ - state->option.Shadow = 1; - return 1; + if (state->ctx->Extensions.ARB_fragment_program_shadow) { + state->option.Shadow = 1; + return 1; + } } } -- cgit v1.2.3 From 4821099429ec059dc00a28f448bc3c537296ab55 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 15:46:07 -0700 Subject: ARB prog: Fix parameters to _mesa_calloc So totally awesome that _mesa_calloc has a different parameter signature than calloc. Why do these libc wrappers still exist?!? --- src/mesa/shader/hash_table.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/hash_table.c b/src/mesa/shader/hash_table.c index 3ff603b368..a28a53ce02 100644 --- a/src/mesa/shader/hash_table.c +++ b/src/mesa/shader/hash_table.c @@ -137,7 +137,7 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key) const unsigned bucket = hash_value % ht->num_buckets; struct hash_node *node; - node = _mesa_calloc(1, sizeof(*node)); + node = _mesa_calloc(sizeof(*node)); node->data = data; node->key = key; -- cgit v1.2.3 From 88018e2e073909ae807f16707f2701e068900926 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 15:47:52 -0700 Subject: ARB prog parser: Fix handling of RECT Require that GL_{ARB,EXT,NV}_texture_rectangle be supported before allowing use of RECT texture target. --- src/mesa/shader/lex.yy.c | 365 ++++++++++++++-------------- src/mesa/shader/program_lexer.l | 3 +- src/mesa/shader/program_parse.tab.c | 467 ++++++++++++++++++------------------ src/mesa/shader/program_parse.y | 3 + src/mesa/shader/program_parser.h | 1 + 5 files changed, 424 insertions(+), 415 deletions(-) diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index e2b0da9cbe..d5f3b09eb7 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -893,6 +893,7 @@ static yyconst flex_int16_t yy_chk[971] = #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_rect (yyextra->option.TexRect) #define return_token_or_IDENTIFIER(condition, token) \ do { \ @@ -985,7 +986,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 989 "lex.yy.c" +#line 990 "lex.yy.c" #define INITIAL 0 @@ -1231,10 +1232,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 132 "program_lexer.l" +#line 133 "program_lexer.l" -#line 1238 "lex.yy.c" +#line 1239 "lex.yy.c" yylval = yylval_param; @@ -1323,17 +1324,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 134 "program_lexer.l" +#line 135 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 135 "program_lexer.l" +#line 136 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 136 "program_lexer.l" +#line 137 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1341,712 +1342,712 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 140 "program_lexer.l" +#line 141 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 141 "program_lexer.l" +#line 142 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 142 "program_lexer.l" +#line 143 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 143 "program_lexer.l" +#line 144 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 144 "program_lexer.l" +#line 145 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 146 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 147 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 149 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, OFF); } YY_BREAK case 12: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 150 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } YY_BREAK case 13: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 151 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, OFF); } YY_BREAK case 14: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 152 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } YY_BREAK case 15: YY_RULE_SETUP -#line 152 "program_lexer.l" +#line 153 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, OFF); } YY_BREAK case 16: YY_RULE_SETUP -#line 154 "program_lexer.l" +#line 155 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } YY_BREAK case 17: YY_RULE_SETUP -#line 155 "program_lexer.l" +#line 156 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } YY_BREAK case 18: YY_RULE_SETUP -#line 156 "program_lexer.l" +#line 157 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } YY_BREAK case 19: YY_RULE_SETUP -#line 157 "program_lexer.l" +#line 158 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } YY_BREAK case 20: YY_RULE_SETUP -#line 159 "program_lexer.l" +#line 160 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, OFF); } YY_BREAK case 21: YY_RULE_SETUP -#line 160 "program_lexer.l" +#line 161 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } YY_BREAK case 22: YY_RULE_SETUP -#line 161 "program_lexer.l" +#line 162 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, OFF); } YY_BREAK case 23: YY_RULE_SETUP -#line 162 "program_lexer.l" +#line 163 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } YY_BREAK case 24: YY_RULE_SETUP -#line 163 "program_lexer.l" +#line 164 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, OFF); } YY_BREAK case 25: YY_RULE_SETUP -#line 164 "program_lexer.l" +#line 165 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } YY_BREAK case 26: YY_RULE_SETUP -#line 165 "program_lexer.l" +#line 166 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, OFF); } YY_BREAK case 27: YY_RULE_SETUP -#line 166 "program_lexer.l" +#line 167 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } YY_BREAK case 28: YY_RULE_SETUP -#line 168 "program_lexer.l" +#line 169 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, OFF); } YY_BREAK case 29: YY_RULE_SETUP -#line 169 "program_lexer.l" +#line 170 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } YY_BREAK case 30: YY_RULE_SETUP -#line 170 "program_lexer.l" +#line 171 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } YY_BREAK case 31: YY_RULE_SETUP -#line 172 "program_lexer.l" +#line 173 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, OFF); } YY_BREAK case 32: YY_RULE_SETUP -#line 173 "program_lexer.l" +#line 174 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } YY_BREAK case 33: YY_RULE_SETUP -#line 174 "program_lexer.l" +#line 175 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, OFF); } YY_BREAK case 34: YY_RULE_SETUP -#line 175 "program_lexer.l" +#line 176 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } YY_BREAK case 35: YY_RULE_SETUP -#line 177 "program_lexer.l" +#line 178 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, OFF); } YY_BREAK case 36: YY_RULE_SETUP -#line 179 "program_lexer.l" +#line 180 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, OFF); } YY_BREAK case 37: YY_RULE_SETUP -#line 180 "program_lexer.l" +#line 181 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } YY_BREAK case 38: YY_RULE_SETUP -#line 181 "program_lexer.l" +#line 182 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, OFF); } YY_BREAK case 39: YY_RULE_SETUP -#line 182 "program_lexer.l" +#line 183 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } YY_BREAK case 40: YY_RULE_SETUP -#line 183 "program_lexer.l" +#line 184 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } YY_BREAK case 41: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 185 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } YY_BREAK case 42: YY_RULE_SETUP -#line 185 "program_lexer.l" +#line 186 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } YY_BREAK case 43: YY_RULE_SETUP -#line 187 "program_lexer.l" +#line 188 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, OFF); } YY_BREAK case 44: YY_RULE_SETUP -#line 188 "program_lexer.l" +#line 189 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } YY_BREAK case 45: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 190 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, OFF); } YY_BREAK case 46: YY_RULE_SETUP -#line 190 "program_lexer.l" +#line 191 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } YY_BREAK case 47: YY_RULE_SETUP -#line 191 "program_lexer.l" +#line 192 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, OFF); } YY_BREAK case 48: YY_RULE_SETUP -#line 192 "program_lexer.l" +#line 193 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } YY_BREAK case 49: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, OFF); } YY_BREAK case 50: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } YY_BREAK case 51: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, OFF); } YY_BREAK case 52: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 197 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } YY_BREAK case 53: YY_RULE_SETUP -#line 198 "program_lexer.l" +#line 199 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, OFF); } YY_BREAK case 54: YY_RULE_SETUP -#line 199 "program_lexer.l" +#line 200 "program_lexer.l" { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } YY_BREAK case 55: YY_RULE_SETUP -#line 201 "program_lexer.l" +#line 202 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, OFF); } YY_BREAK case 56: YY_RULE_SETUP -#line 202 "program_lexer.l" +#line 203 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } YY_BREAK case 57: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 204 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, OFF); } YY_BREAK case 58: YY_RULE_SETUP -#line 204 "program_lexer.l" +#line 205 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } YY_BREAK case 59: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 207 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } YY_BREAK case 60: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 208 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } YY_BREAK case 61: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 209 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, OFF); } YY_BREAK case 62: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 210 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } YY_BREAK case 63: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 211 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } YY_BREAK case 64: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } YY_BREAK case 65: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, OFF); } YY_BREAK case 66: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } YY_BREAK case 67: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 215 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, OFF); } YY_BREAK case 68: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } YY_BREAK case 69: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, OFF); } YY_BREAK case 70: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } YY_BREAK case 71: YY_RULE_SETUP -#line 219 "program_lexer.l" +#line 220 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } YY_BREAK case 72: YY_RULE_SETUP -#line 220 "program_lexer.l" +#line 221 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } YY_BREAK case 73: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 222 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } YY_BREAK case 74: YY_RULE_SETUP -#line 222 "program_lexer.l" +#line 223 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } YY_BREAK case 75: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } YY_BREAK case 76: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } YY_BREAK case 77: YY_RULE_SETUP -#line 226 "program_lexer.l" +#line 227 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, OFF); } YY_BREAK case 78: YY_RULE_SETUP -#line 227 "program_lexer.l" +#line 228 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } YY_BREAK case 79: YY_RULE_SETUP -#line 229 "program_lexer.l" +#line 230 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 80: YY_RULE_SETUP -#line 230 "program_lexer.l" +#line 231 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 81: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 232 "program_lexer.l" { return PROGRAM; } YY_BREAK case 82: YY_RULE_SETUP -#line 232 "program_lexer.l" +#line 233 "program_lexer.l" { return STATE; } YY_BREAK case 83: YY_RULE_SETUP -#line 233 "program_lexer.l" +#line 234 "program_lexer.l" { return RESULT; } YY_BREAK case 84: YY_RULE_SETUP -#line 235 "program_lexer.l" +#line 236 "program_lexer.l" { return AMBIENT; } YY_BREAK case 85: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 237 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, ATTENUATION); } YY_BREAK case 86: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 238 "program_lexer.l" { return BACK; } YY_BREAK case 87: YY_RULE_SETUP -#line 238 "program_lexer.l" +#line 239 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 88: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 240 "program_lexer.l" { return COLOR; } YY_BREAK case 89: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 241 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 90: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 242 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 91: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 243 "program_lexer.l" { return DIRECTION; } YY_BREAK case 92: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 244 "program_lexer.l" { return EMISSION; } YY_BREAK case 93: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 245 "program_lexer.l" { return ENV; } YY_BREAK case 94: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 246 "program_lexer.l" { return EYE; } YY_BREAK case 95: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 247 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 96: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 248 "program_lexer.l" { return FOG; } YY_BREAK case 97: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 249 "program_lexer.l" { return FRONT; } YY_BREAK case 98: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 250 "program_lexer.l" { return HALF; } YY_BREAK case 99: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 251 "program_lexer.l" { return INVERSE; } YY_BREAK case 100: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 252 "program_lexer.l" { return INVTRANS; } YY_BREAK case 101: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 253 "program_lexer.l" { return LIGHT; } YY_BREAK case 102: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 254 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 103: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 255 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 104: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 256 "program_lexer.l" { return LOCAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 257 "program_lexer.l" { return MATERIAL; } YY_BREAK case 106: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 258 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 107: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 259 "program_lexer.l" { return MATRIX; } YY_BREAK case 108: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 260 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 109: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 261 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 110: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 262 "program_lexer.l" { return MVP; } YY_BREAK case 111: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 263 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 264 "program_lexer.l" { return OBJECT; } YY_BREAK case 113: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 265 "program_lexer.l" { return PALETTE; } YY_BREAK case 114: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 266 "program_lexer.l" { return PARAMS; } YY_BREAK case 115: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 267 "program_lexer.l" { return PLANE; } YY_BREAK case 116: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 268 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT); } YY_BREAK case 117: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 269 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 118: YY_RULE_SETUP -#line 269 "program_lexer.l" +#line 270 "program_lexer.l" { return POSITION; } YY_BREAK case 119: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 271 "program_lexer.l" { return PRIMARY; } YY_BREAK case 120: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 272 "program_lexer.l" { return PROJECTION; } YY_BREAK case 121: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 273 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 122: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 274 "program_lexer.l" { return ROW; } YY_BREAK case 123: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 275 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 124: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 276 "program_lexer.l" { return SECONDARY; } YY_BREAK case 125: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 277 "program_lexer.l" { return SHININESS; } YY_BREAK case 126: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 278 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE); } YY_BREAK case 127: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 279 "program_lexer.l" { return SPECULAR; } YY_BREAK case 128: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 280 "program_lexer.l" { return SPOT; } YY_BREAK case 129: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 281 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 130: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 282 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 131: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 283 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 132: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 284 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 133: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 285 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 134: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 135: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 287 "program_lexer.l" { return TEXTURE; } YY_BREAK case 136: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 288 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 137: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 289 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 138: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 290 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 139: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 292 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 140: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 293 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 141: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 294 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 142: YY_RULE_SETUP -#line 294 "program_lexer.l" +#line 295 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 143: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 144: YY_RULE_SETUP -#line 296 "program_lexer.l" -{ return_token_or_IDENTIFIER(require_ARB_fp, TEX_RECT); } +#line 297 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 145: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 299 "program_lexer.l" { yylval->string = strdup(yytext); return IDENTIFIER; @@ -2054,12 +2055,12 @@ YY_RULE_SETUP YY_BREAK case 146: YY_RULE_SETUP -#line 303 "program_lexer.l" +#line 304 "program_lexer.l" { return DOT_DOT; } YY_BREAK case 147: YY_RULE_SETUP -#line 305 "program_lexer.l" +#line 306 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; @@ -2067,7 +2068,7 @@ YY_RULE_SETUP YY_BREAK case 148: YY_RULE_SETUP -#line 309 "program_lexer.l" +#line 310 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2079,7 +2080,7 @@ case 149: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 313 "program_lexer.l" +#line 314 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2087,7 +2088,7 @@ YY_RULE_SETUP YY_BREAK case 150: YY_RULE_SETUP -#line 317 "program_lexer.l" +#line 318 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2095,7 +2096,7 @@ YY_RULE_SETUP YY_BREAK case 151: YY_RULE_SETUP -#line 321 "program_lexer.l" +#line 322 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; @@ -2103,7 +2104,7 @@ YY_RULE_SETUP YY_BREAK case 152: YY_RULE_SETUP -#line 326 "program_lexer.l" +#line 327 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2112,7 +2113,7 @@ YY_RULE_SETUP YY_BREAK case 153: YY_RULE_SETUP -#line 332 "program_lexer.l" +#line 333 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2122,7 +2123,7 @@ YY_RULE_SETUP YY_BREAK case 154: YY_RULE_SETUP -#line 338 "program_lexer.l" +#line 339 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2131,7 +2132,7 @@ YY_RULE_SETUP YY_BREAK case 155: YY_RULE_SETUP -#line 343 "program_lexer.l" +#line 344 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2140,7 +2141,7 @@ YY_RULE_SETUP YY_BREAK case 156: YY_RULE_SETUP -#line 349 "program_lexer.l" +#line 350 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2150,7 +2151,7 @@ YY_RULE_SETUP YY_BREAK case 157: YY_RULE_SETUP -#line 355 "program_lexer.l" +#line 356 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2160,7 +2161,7 @@ YY_RULE_SETUP YY_BREAK case 158: YY_RULE_SETUP -#line 361 "program_lexer.l" +#line 362 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2169,7 +2170,7 @@ YY_RULE_SETUP YY_BREAK case 159: YY_RULE_SETUP -#line 367 "program_lexer.l" +#line 368 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2179,7 +2180,7 @@ YY_RULE_SETUP YY_BREAK case 160: YY_RULE_SETUP -#line 374 "program_lexer.l" +#line 375 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2191,7 +2192,7 @@ YY_RULE_SETUP YY_BREAK case 161: YY_RULE_SETUP -#line 383 "program_lexer.l" +#line 384 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; @@ -2200,7 +2201,7 @@ YY_RULE_SETUP YY_BREAK case 162: YY_RULE_SETUP -#line 389 "program_lexer.l" +#line 390 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2210,7 +2211,7 @@ YY_RULE_SETUP YY_BREAK case 163: YY_RULE_SETUP -#line 395 "program_lexer.l" +#line 396 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; @@ -2219,7 +2220,7 @@ YY_RULE_SETUP YY_BREAK case 164: YY_RULE_SETUP -#line 400 "program_lexer.l" +#line 401 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; @@ -2228,7 +2229,7 @@ YY_RULE_SETUP YY_BREAK case 165: YY_RULE_SETUP -#line 406 "program_lexer.l" +#line 407 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2238,7 +2239,7 @@ YY_RULE_SETUP YY_BREAK case 166: YY_RULE_SETUP -#line 412 "program_lexer.l" +#line 413 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2248,7 +2249,7 @@ YY_RULE_SETUP YY_BREAK case 167: YY_RULE_SETUP -#line 418 "program_lexer.l" +#line 419 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; @@ -2257,7 +2258,7 @@ YY_RULE_SETUP YY_BREAK case 168: YY_RULE_SETUP -#line 424 "program_lexer.l" +#line 425 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2267,7 +2268,7 @@ YY_RULE_SETUP YY_BREAK case 169: YY_RULE_SETUP -#line 432 "program_lexer.l" +#line 433 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2281,7 +2282,7 @@ YY_RULE_SETUP YY_BREAK case 170: YY_RULE_SETUP -#line 443 "program_lexer.l" +#line 444 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2293,13 +2294,13 @@ YY_RULE_SETUP YY_BREAK case 171: YY_RULE_SETUP -#line 452 "program_lexer.l" +#line 453 "program_lexer.l" { return DOT; } YY_BREAK case 172: /* rule 172 can match eol */ YY_RULE_SETUP -#line 454 "program_lexer.l" +#line 455 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2310,7 +2311,7 @@ YY_RULE_SETUP YY_BREAK case 173: YY_RULE_SETUP -#line 461 "program_lexer.l" +#line 462 "program_lexer.l" /* eat whitespace */ ; YY_BREAK case 174: @@ -2318,20 +2319,20 @@ case 174: yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 462 "program_lexer.l" +#line 463 "program_lexer.l" /* eat comments */ ; YY_BREAK case 175: YY_RULE_SETUP -#line 463 "program_lexer.l" +#line 464 "program_lexer.l" { return yytext[0]; } YY_BREAK case 176: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 465 "program_lexer.l" ECHO; YY_BREAK -#line 2335 "lex.yy.c" +#line 2336 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -3506,7 +3507,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 464 "program_lexer.l" +#line 465 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index c952f09040..2a5f0a8542 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -29,6 +29,7 @@ #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_rect (yyextra->option.TexRect) #define return_token_or_IDENTIFIER(condition, token) \ do { \ @@ -293,7 +294,7 @@ texture { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_U 2D { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } 3D { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } CUBE { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } -RECT { return_token_or_IDENTIFIER(require_ARB_fp, TEX_RECT); } +RECT { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } [_a-zA-Z$][_a-zA-Z0-9$]* { yylval->string = strdup(yytext); diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 2558ae56f5..37630863a8 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -745,32 +745,32 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 247, 247, 250, 258, 267, 268, 271, 289, 290, - 293, 308, 311, 316, 323, 324, 325, 326, 327, 328, - 329, 332, 333, 336, 342, 349, 356, 364, 371, 379, - 392, 399, 405, 406, 407, 408, 409, 412, 424, 437, - 450, 472, 481, 490, 497, 506, 534, 576, 587, 608, - 618, 624, 648, 665, 665, 667, 674, 686, 687, 688, - 691, 703, 715, 733, 744, 756, 758, 759, 760, 761, - 764, 764, 764, 764, 765, 768, 769, 770, 771, 772, - 773, 776, 794, 798, 804, 808, 812, 816, 825, 834, - 838, 843, 849, 860, 860, 861, 863, 867, 871, 875, - 881, 881, 883, 899, 922, 925, 936, 942, 948, 949, - 956, 962, 968, 976, 982, 988, 996, 1002, 1008, 1016, - 1017, 1020, 1021, 1022, 1023, 1024, 1025, 1026, 1027, 1028, - 1029, 1032, 1041, 1045, 1049, 1055, 1064, 1068, 1072, 1081, - 1085, 1091, 1097, 1104, 1109, 1117, 1127, 1129, 1137, 1143, - 1147, 1151, 1157, 1168, 1177, 1181, 1186, 1190, 1194, 1198, - 1204, 1211, 1215, 1221, 1229, 1240, 1247, 1251, 1257, 1267, - 1278, 1282, 1300, 1309, 1312, 1318, 1322, 1326, 1332, 1343, - 1348, 1353, 1358, 1363, 1368, 1376, 1379, 1384, 1397, 1405, - 1418, 1418, 1420, 1420, 1422, 1432, 1437, 1444, 1454, 1463, - 1468, 1475, 1485, 1495, 1507, 1507, 1508, 1508, 1510, 1517, - 1522, 1529, 1537, 1545, 1554, 1565, 1569, 1575, 1576, 1577, - 1580, 1580, 1583, 1583, 1586, 1592, 1600, 1613, 1622, 1631, - 1635, 1644, 1653, 1664, 1671, 1676, 1685, 1697, 1700, 1709, - 1720, 1721, 1722, 1725, 1726, 1727, 1730, 1731, 1734, 1735, - 1738, 1739, 1742, 1753, 1764, 1775 + 0, 247, 247, 250, 258, 270, 271, 274, 292, 293, + 296, 311, 314, 319, 326, 327, 328, 329, 330, 331, + 332, 335, 336, 339, 345, 352, 359, 367, 374, 382, + 395, 402, 408, 409, 410, 411, 412, 415, 427, 440, + 453, 475, 484, 493, 500, 509, 537, 579, 590, 611, + 621, 627, 651, 668, 668, 670, 677, 689, 690, 691, + 694, 706, 718, 736, 747, 759, 761, 762, 763, 764, + 767, 767, 767, 767, 768, 771, 772, 773, 774, 775, + 776, 779, 797, 801, 807, 811, 815, 819, 828, 837, + 841, 846, 852, 863, 863, 864, 866, 870, 874, 878, + 884, 884, 886, 902, 925, 928, 939, 945, 951, 952, + 959, 965, 971, 979, 985, 991, 999, 1005, 1011, 1019, + 1020, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, + 1032, 1035, 1044, 1048, 1052, 1058, 1067, 1071, 1075, 1084, + 1088, 1094, 1100, 1107, 1112, 1120, 1130, 1132, 1140, 1146, + 1150, 1154, 1160, 1171, 1180, 1184, 1189, 1193, 1197, 1201, + 1207, 1214, 1218, 1224, 1232, 1243, 1250, 1254, 1260, 1270, + 1281, 1285, 1303, 1312, 1315, 1321, 1325, 1329, 1335, 1346, + 1351, 1356, 1361, 1366, 1371, 1379, 1382, 1387, 1400, 1408, + 1421, 1421, 1423, 1423, 1425, 1435, 1440, 1447, 1457, 1466, + 1471, 1478, 1488, 1498, 1510, 1510, 1511, 1511, 1513, 1520, + 1525, 1532, 1540, 1548, 1557, 1568, 1572, 1578, 1579, 1580, + 1583, 1583, 1586, 1586, 1589, 1595, 1603, 1616, 1625, 1634, + 1638, 1647, 1656, 1667, 1674, 1679, 1688, 1700, 1703, 1712, + 1723, 1724, 1725, 1728, 1729, 1730, 1733, 1734, 1737, 1738, + 1741, 1742, 1745, 1756, 1767, 1778 }; #endif @@ -2057,13 +2057,16 @@ yyreduce: yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); } state->mode = ARB_fragment; + + state->option.TexRect = + (state->ctx->Extensions.NV_texture_rectangle != GL_FALSE); ;} break; case 7: /* Line 1455 of yacc.c */ -#line 272 "program_parse.y" +#line 275 "program_parse.y" { int valid = 0; @@ -2084,7 +2087,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 294 "program_parse.y" +#line 297 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2104,7 +2107,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 312 "program_parse.y" +#line 315 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2114,7 +2117,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 317 "program_parse.y" +#line 320 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2124,7 +2127,7 @@ yyreduce: case 23: /* Line 1455 of yacc.c */ -#line 337 "program_parse.y" +#line 340 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2133,7 +2136,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 343 "program_parse.y" +#line 346 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2143,7 +2146,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 350 "program_parse.y" +#line 353 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2153,7 +2156,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 357 "program_parse.y" +#line 360 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2163,7 +2166,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 365 "program_parse.y" +#line 368 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2173,7 +2176,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 373 "program_parse.y" +#line 376 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2183,7 +2186,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 380 "program_parse.y" +#line 383 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2199,7 +2202,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 393 "program_parse.y" +#line 396 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2209,7 +2212,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 400 "program_parse.y" +#line 403 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2218,42 +2221,42 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 405 "program_parse.y" +#line 408 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 406 "program_parse.y" +#line 409 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 407 "program_parse.y" +#line 410 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 408 "program_parse.y" +#line 411 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 409 "program_parse.y" +#line 412 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 413 "program_parse.y" +#line 416 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2268,7 +2271,7 @@ yyreduce: case 38: /* Line 1455 of yacc.c */ -#line 425 "program_parse.y" +#line 428 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2284,7 +2287,7 @@ yyreduce: case 39: /* Line 1455 of yacc.c */ -#line 438 "program_parse.y" +#line 441 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2300,7 +2303,7 @@ yyreduce: case 40: /* Line 1455 of yacc.c */ -#line 451 "program_parse.y" +#line 454 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2325,7 +2328,7 @@ yyreduce: case 41: /* Line 1455 of yacc.c */ -#line 473 "program_parse.y" +#line 476 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2337,7 +2340,7 @@ yyreduce: case 42: /* Line 1455 of yacc.c */ -#line 482 "program_parse.y" +#line 485 "program_parse.y" { (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); @@ -2349,7 +2352,7 @@ yyreduce: case 43: /* Line 1455 of yacc.c */ -#line 491 "program_parse.y" +#line 494 "program_parse.y" { (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2359,7 +2362,7 @@ yyreduce: case 44: /* Line 1455 of yacc.c */ -#line 498 "program_parse.y" +#line 501 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2373,7 +2376,7 @@ yyreduce: case 45: /* Line 1455 of yacc.c */ -#line 507 "program_parse.y" +#line 510 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2404,7 +2407,7 @@ yyreduce: case 46: /* Line 1455 of yacc.c */ -#line 535 "program_parse.y" +#line 538 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2451,7 +2454,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 577 "program_parse.y" +#line 580 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2467,7 +2470,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 588 "program_parse.y" +#line 591 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2493,7 +2496,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 609 "program_parse.y" +#line 612 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2506,7 +2509,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 619 "program_parse.y" +#line 622 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2517,7 +2520,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 625 "program_parse.y" +#line 628 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2544,7 +2547,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 649 "program_parse.y" +#line 652 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2564,7 +2567,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 668 "program_parse.y" +#line 671 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2574,7 +2577,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 675 "program_parse.y" +#line 678 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2589,28 +2592,28 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 686 "program_parse.y" +#line 689 "program_parse.y" { (yyval.integer) = 0; ;} break; case 58: /* Line 1455 of yacc.c */ -#line 687 "program_parse.y" +#line 690 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 59: /* Line 1455 of yacc.c */ -#line 688 "program_parse.y" +#line 691 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 60: /* Line 1455 of yacc.c */ -#line 692 "program_parse.y" +#line 695 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2625,7 +2628,7 @@ yyreduce: case 61: /* Line 1455 of yacc.c */ -#line 704 "program_parse.y" +#line 707 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2640,7 +2643,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 716 "program_parse.y" +#line 719 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2661,7 +2664,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 734 "program_parse.y" +#line 737 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2675,7 +2678,7 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 745 "program_parse.y" +#line 748 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2690,21 +2693,21 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 761 "program_parse.y" +#line 764 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 74: /* Line 1455 of yacc.c */ -#line 765 "program_parse.y" +#line 768 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 777 "program_parse.y" +#line 780 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2725,7 +2728,7 @@ yyreduce: case 82: /* Line 1455 of yacc.c */ -#line 795 "program_parse.y" +#line 798 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2734,7 +2737,7 @@ yyreduce: case 83: /* Line 1455 of yacc.c */ -#line 799 "program_parse.y" +#line 802 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2743,7 +2746,7 @@ yyreduce: case 84: /* Line 1455 of yacc.c */ -#line 805 "program_parse.y" +#line 808 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2752,7 +2755,7 @@ yyreduce: case 85: /* Line 1455 of yacc.c */ -#line 809 "program_parse.y" +#line 812 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2761,7 +2764,7 @@ yyreduce: case 86: /* Line 1455 of yacc.c */ -#line 813 "program_parse.y" +#line 816 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2770,7 +2773,7 @@ yyreduce: case 87: /* Line 1455 of yacc.c */ -#line 817 "program_parse.y" +#line 820 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2784,7 +2787,7 @@ yyreduce: case 88: /* Line 1455 of yacc.c */ -#line 826 "program_parse.y" +#line 829 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2798,7 +2801,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 835 "program_parse.y" +#line 838 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2807,7 +2810,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 839 "program_parse.y" +#line 842 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -2817,7 +2820,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 844 "program_parse.y" +#line 847 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2826,7 +2829,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 850 "program_parse.y" +#line 853 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2840,7 +2843,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 864 "program_parse.y" +#line 867 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2849,7 +2852,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 868 "program_parse.y" +#line 871 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2858,7 +2861,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 872 "program_parse.y" +#line 875 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2867,7 +2870,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 876 "program_parse.y" +#line 879 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2876,7 +2879,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 884 "program_parse.y" +#line 887 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2895,7 +2898,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 900 "program_parse.y" +#line 903 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -2920,7 +2923,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 922 "program_parse.y" +#line 925 "program_parse.y" { (yyval.integer) = 0; ;} @@ -2929,7 +2932,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 926 "program_parse.y" +#line 929 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -2943,7 +2946,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 937 "program_parse.y" +#line 940 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -2952,7 +2955,7 @@ yyreduce: case 107: /* Line 1455 of yacc.c */ -#line 943 "program_parse.y" +#line 946 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -2961,7 +2964,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 950 "program_parse.y" +#line 953 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -2971,7 +2974,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 957 "program_parse.y" +#line 960 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2982,7 +2985,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 963 "program_parse.y" +#line 966 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2993,7 +2996,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 969 "program_parse.y" +#line 972 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3004,7 +3007,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 977 "program_parse.y" +#line 980 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3015,7 +3018,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 983 "program_parse.y" +#line 986 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3026,7 +3029,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 989 "program_parse.y" +#line 992 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3037,7 +3040,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 997 "program_parse.y" +#line 1000 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3048,7 +3051,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1003 "program_parse.y" +#line 1006 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3059,7 +3062,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1009 "program_parse.y" +#line 1012 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3070,91 +3073,91 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1016 "program_parse.y" +#line 1019 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 120: /* Line 1455 of yacc.c */ -#line 1017 "program_parse.y" +#line 1020 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 121: /* Line 1455 of yacc.c */ -#line 1020 "program_parse.y" +#line 1023 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 122: /* Line 1455 of yacc.c */ -#line 1021 "program_parse.y" +#line 1024 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 123: /* Line 1455 of yacc.c */ -#line 1022 "program_parse.y" +#line 1025 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 124: /* Line 1455 of yacc.c */ -#line 1023 "program_parse.y" +#line 1026 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 125: /* Line 1455 of yacc.c */ -#line 1024 "program_parse.y" +#line 1027 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 126: /* Line 1455 of yacc.c */ -#line 1025 "program_parse.y" +#line 1028 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1026 "program_parse.y" +#line 1029 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1027 "program_parse.y" +#line 1030 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1028 "program_parse.y" +#line 1031 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1029 "program_parse.y" +#line 1032 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1033 "program_parse.y" +#line 1036 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3166,7 +3169,7 @@ yyreduce: case 132: /* Line 1455 of yacc.c */ -#line 1042 "program_parse.y" +#line 1045 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3175,7 +3178,7 @@ yyreduce: case 133: /* Line 1455 of yacc.c */ -#line 1046 "program_parse.y" +#line 1049 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3184,7 +3187,7 @@ yyreduce: case 134: /* Line 1455 of yacc.c */ -#line 1050 "program_parse.y" +#line 1053 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3193,7 +3196,7 @@ yyreduce: case 135: /* Line 1455 of yacc.c */ -#line 1056 "program_parse.y" +#line 1059 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3205,7 +3208,7 @@ yyreduce: case 136: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1068 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3214,7 +3217,7 @@ yyreduce: case 137: /* Line 1455 of yacc.c */ -#line 1069 "program_parse.y" +#line 1072 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3223,7 +3226,7 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1073 "program_parse.y" +#line 1076 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3237,7 +3240,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1082 "program_parse.y" +#line 1085 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3246,7 +3249,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1086 "program_parse.y" +#line 1089 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3255,7 +3258,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1092 "program_parse.y" +#line 1095 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3264,7 +3267,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" +#line 1101 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3274,7 +3277,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1105 "program_parse.y" +#line 1108 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3284,7 +3287,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1110 "program_parse.y" +#line 1113 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3295,7 +3298,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1118 "program_parse.y" +#line 1121 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3308,7 +3311,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1130 "program_parse.y" +#line 1133 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3319,7 +3322,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1138 "program_parse.y" +#line 1141 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3328,7 +3331,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1147 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3337,7 +3340,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1148 "program_parse.y" +#line 1151 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3346,7 +3349,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1152 "program_parse.y" +#line 1155 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3355,7 +3358,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1161 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3369,7 +3372,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1169 "program_parse.y" +#line 1172 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3381,7 +3384,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1178 "program_parse.y" +#line 1181 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3390,7 +3393,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1182 "program_parse.y" +#line 1185 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3399,7 +3402,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1187 "program_parse.y" +#line 1190 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3408,7 +3411,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1191 "program_parse.y" +#line 1194 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3417,7 +3420,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1195 "program_parse.y" +#line 1198 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3426,7 +3429,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1199 "program_parse.y" +#line 1202 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3435,7 +3438,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1205 "program_parse.y" +#line 1208 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3445,7 +3448,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1212 "program_parse.y" +#line 1215 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3454,7 +3457,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1216 "program_parse.y" +#line 1219 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3463,7 +3466,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1222 "program_parse.y" +#line 1225 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3474,7 +3477,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1230 "program_parse.y" +#line 1233 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3488,7 +3491,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1241 "program_parse.y" +#line 1244 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3498,7 +3501,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1248 "program_parse.y" +#line 1251 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3507,7 +3510,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1252 "program_parse.y" +#line 1255 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3516,7 +3519,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1258 "program_parse.y" +#line 1261 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3529,7 +3532,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1268 "program_parse.y" +#line 1271 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3542,7 +3545,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1278 "program_parse.y" +#line 1281 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3552,7 +3555,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1283 "program_parse.y" +#line 1286 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3573,7 +3576,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1301 "program_parse.y" +#line 1304 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3584,7 +3587,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1309 "program_parse.y" +#line 1312 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3593,7 +3596,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1313 "program_parse.y" +#line 1316 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3602,7 +3605,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1319 "program_parse.y" +#line 1322 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3611,7 +3614,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1323 "program_parse.y" +#line 1326 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3620,7 +3623,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1327 "program_parse.y" +#line 1330 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3629,7 +3632,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1333 "program_parse.y" +#line 1336 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3643,7 +3646,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1344 "program_parse.y" +#line 1347 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3653,7 +3656,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1349 "program_parse.y" +#line 1352 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3663,7 +3666,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1354 "program_parse.y" +#line 1357 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3673,7 +3676,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1359 "program_parse.y" +#line 1362 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3683,7 +3686,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" +#line 1367 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3693,7 +3696,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1369 "program_parse.y" +#line 1372 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3703,7 +3706,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1376 "program_parse.y" +#line 1379 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3712,7 +3715,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1380 "program_parse.y" +#line 1383 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3721,7 +3724,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1385 "program_parse.y" +#line 1388 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3738,7 +3741,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1398 "program_parse.y" +#line 1401 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3750,7 +3753,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1406 "program_parse.y" +#line 1409 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3764,7 +3767,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1423 "program_parse.y" +#line 1426 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3777,7 +3780,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1433 "program_parse.y" +#line 1436 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3787,7 +3790,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1438 "program_parse.y" +#line 1441 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3797,7 +3800,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1445 "program_parse.y" +#line 1448 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3810,7 +3813,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1455 "program_parse.y" +#line 1458 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3823,7 +3826,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1464 "program_parse.y" +#line 1467 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3833,7 +3836,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1469 "program_parse.y" +#line 1472 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3843,7 +3846,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1476 "program_parse.y" +#line 1479 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3856,7 +3859,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1486 "program_parse.y" +#line 1489 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3869,7 +3872,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1496 "program_parse.y" +#line 1499 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3882,7 +3885,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1511 "program_parse.y" +#line 1514 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3892,7 +3895,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1518 "program_parse.y" +#line 1521 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3902,7 +3905,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1523 "program_parse.y" +#line 1526 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -3912,7 +3915,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1530 "program_parse.y" +#line 1533 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3925,7 +3928,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1538 "program_parse.y" +#line 1541 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -3938,7 +3941,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1547 "program_parse.y" +#line 1550 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -3951,7 +3954,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1556 "program_parse.y" +#line 1559 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -3964,7 +3967,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1566 "program_parse.y" +#line 1569 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -3973,7 +3976,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1570 "program_parse.y" +#line 1573 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -3982,42 +3985,42 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1575 "program_parse.y" +#line 1578 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 218: /* Line 1455 of yacc.c */ -#line 1576 "program_parse.y" +#line 1579 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 219: /* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" +#line 1580 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 220: /* Line 1455 of yacc.c */ -#line 1580 "program_parse.y" +#line 1583 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1583 "program_parse.y" +#line 1586 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 224: /* Line 1455 of yacc.c */ -#line 1587 "program_parse.y" +#line 1590 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4028,7 +4031,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1593 "program_parse.y" +#line 1596 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4039,7 +4042,7 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1601 "program_parse.y" +#line 1604 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4055,7 +4058,7 @@ yyreduce: case 227: /* Line 1455 of yacc.c */ -#line 1614 "program_parse.y" +#line 1617 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4069,7 +4072,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1623 "program_parse.y" +#line 1626 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4083,7 +4086,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1632 "program_parse.y" +#line 1635 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4092,7 +4095,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1636 "program_parse.y" +#line 1639 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4106,7 +4109,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1645 "program_parse.y" +#line 1648 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4120,7 +4123,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1654 "program_parse.y" +#line 1657 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4134,7 +4137,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1665 "program_parse.y" +#line 1668 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4143,7 +4146,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1671 "program_parse.y" +#line 1674 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4154,7 +4157,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1677 "program_parse.y" +#line 1680 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4168,7 +4171,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1686 "program_parse.y" +#line 1689 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4182,7 +4185,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1700 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4191,7 +4194,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" +#line 1704 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4205,7 +4208,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1710 "program_parse.y" +#line 1713 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4219,91 +4222,91 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1723 "program_parse.y" { (yyval.integer) = 0; ;} break; case 241: /* Line 1455 of yacc.c */ -#line 1721 "program_parse.y" +#line 1724 "program_parse.y" { (yyval.integer) = 0; ;} break; case 242: /* Line 1455 of yacc.c */ -#line 1722 "program_parse.y" +#line 1725 "program_parse.y" { (yyval.integer) = 1; ;} break; case 243: /* Line 1455 of yacc.c */ -#line 1725 "program_parse.y" +#line 1728 "program_parse.y" { (yyval.integer) = 0; ;} break; case 244: /* Line 1455 of yacc.c */ -#line 1726 "program_parse.y" +#line 1729 "program_parse.y" { (yyval.integer) = 0; ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1727 "program_parse.y" +#line 1730 "program_parse.y" { (yyval.integer) = 1; ;} break; case 246: /* Line 1455 of yacc.c */ -#line 1730 "program_parse.y" +#line 1733 "program_parse.y" { (yyval.integer) = 0; ;} break; case 247: /* Line 1455 of yacc.c */ -#line 1731 "program_parse.y" +#line 1734 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1734 "program_parse.y" +#line 1737 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1735 "program_parse.y" +#line 1738 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1738 "program_parse.y" +#line 1741 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1739 "program_parse.y" +#line 1742 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1743 "program_parse.y" +#line 1746 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4317,7 +4320,7 @@ yyreduce: case 253: /* Line 1455 of yacc.c */ -#line 1754 "program_parse.y" +#line 1757 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4331,7 +4334,7 @@ yyreduce: case 254: /* Line 1455 of yacc.c */ -#line 1765 "program_parse.y" +#line 1768 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4345,7 +4348,7 @@ yyreduce: case 255: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 1779 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4369,7 +4372,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4373 "program_parse.tab.c" +#line 4376 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4588,7 +4591,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1796 "program_parse.y" +#line 1799 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 852c26b31f..f4a1de0487 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -261,6 +261,9 @@ language: ARBvp_10 yyerror(& @1, state, "invalid vertex program header"); } state->mode = ARB_fragment; + + state->option.TexRect = + (state->ctx->Extensions.NV_texture_rectangle != GL_FALSE); } ; diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index e17ffd2322..b9731439a0 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -200,6 +200,7 @@ struct asm_parser_state { unsigned PrecisionHint:2; unsigned DrawBuffers:1; unsigned Shadow:1; + unsigned TexRect:1; } option; struct { -- cgit v1.2.3 From 1edd13bf23c7a9dad00420f519a35f75b27e853b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 16:24:49 -0700 Subject: ARB prog parser: Add support for GL_ARB_fragment_program_shadow Passes the piglit asmparsertest shadow-0[123].txt tests and progs/demos/shadowtex. --- src/mesa/shader/lex.yy.c | 1279 +++++++++++++------------- src/mesa/shader/program_lexer.l | 4 + src/mesa/shader/program_parse.tab.c | 1679 ++++++++++++++++++----------------- src/mesa/shader/program_parse.tab.h | 27 +- src/mesa/shader/program_parse.y | 40 +- 5 files changed, 1578 insertions(+), 1451 deletions(-) diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index d5f3b09eb7..1809d1e7f7 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -357,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 176 -#define YY_END_OF_BUFFER 177 +#define YY_NUM_RULES 179 +#define YY_END_OF_BUFFER 180 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -366,79 +366,80 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[645] = +static yyconst flex_int16_t yy_accept[658] = { 0, - 0, 0, 177, 175, 173, 172, 175, 175, 145, 171, - 147, 147, 147, 147, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 173, 0, 0, 174, 145, 0, - 146, 148, 168, 168, 0, 0, 0, 0, 168, 0, - 0, 0, 0, 0, 0, 0, 132, 169, 133, 134, - 159, 159, 159, 159, 0, 147, 0, 140, 141, 142, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 167, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 166, 166, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 165, - 165, 165, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 156, 156, 156, 157, 157, 158, 149, 148, - 149, 0, 150, 11, 13, 145, 15, 145, 16, 18, - 145, 20, 22, 24, 26, 6, 28, 30, 31, 33, - 35, 38, 36, 40, 41, 43, 45, 47, 49, 51, - - 145, 145, 145, 53, 55, 145, 57, 59, 61, 63, - 65, 67, 69, 145, 71, 73, 75, 77, 145, 145, - 145, 145, 145, 145, 0, 0, 0, 0, 148, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 93, - 94, 96, 0, 164, 0, 0, 0, 0, 0, 0, - 110, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 163, 162, 162, 122, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 153, 153, 154, 155, 0, - 151, 145, 145, 145, 145, 145, 145, 145, 143, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - - 145, 145, 145, 145, 145, 145, 145, 145, 145, 144, - 145, 145, 145, 145, 145, 145, 145, 10, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 0, 170, - 0, 0, 0, 86, 87, 0, 0, 0, 0, 0, - 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 180, 178, 176, 175, 178, 178, 148, 174, + 150, 150, 150, 150, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 176, 0, 0, 177, 148, 0, + 149, 151, 171, 171, 0, 0, 0, 0, 171, 0, + 0, 0, 0, 0, 0, 0, 132, 172, 133, 134, + 162, 162, 162, 162, 0, 150, 0, 140, 141, 142, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 170, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 169, 169, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 161, 0, 0, 0, 126, 0, 128, 0, 0, - 0, 0, 0, 0, 160, 152, 145, 145, 145, 4, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - - 9, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 82, 145, 145, - 0, 0, 0, 0, 0, 88, 89, 0, 0, 0, - 0, 97, 0, 0, 101, 104, 0, 0, 0, 0, - 0, 0, 0, 115, 116, 0, 0, 0, 0, 121, + 168, 168, 168, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 159, 159, 159, 160, 160, 161, 152, + 151, 152, 0, 153, 11, 13, 148, 15, 148, 16, + 18, 148, 20, 22, 24, 26, 6, 28, 30, 31, + 33, 35, 38, 36, 40, 41, 43, 45, 47, 49, + + 51, 148, 148, 148, 53, 55, 148, 57, 59, 61, + 148, 63, 65, 67, 69, 148, 71, 73, 75, 77, + 148, 148, 148, 148, 148, 148, 0, 0, 0, 0, + 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 93, 94, 96, 0, 167, 0, 0, 0, 0, + 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 166, 165, 165, 122, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 156, 156, 157, + 158, 0, 154, 148, 148, 148, 148, 148, 148, 148, + 143, 148, 148, 148, 148, 148, 148, 148, 148, 148, + + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 144, 148, 148, 148, 148, 148, 148, 148, 148, + 10, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 0, 173, 0, 0, 0, 86, 87, 0, 0, + 0, 0, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 145, 145, 145, 5, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 145, 145, - 145, 7, 8, 145, 145, 145, 145, 145, 145, 145, - 145, 145, 145, 145, 145, 145, 145, 145, 83, 145, - - 79, 0, 0, 0, 0, 137, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 107, 0, 111, 112, 0, - 114, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 130, 131, 0, 0, 138, 12, 3, 14, 17, - 19, 21, 23, 25, 27, 29, 32, 34, 39, 37, - 42, 44, 46, 48, 50, 52, 54, 56, 58, 60, - 62, 64, 66, 68, 70, 72, 74, 76, 78, 145, - 81, 139, 0, 0, 84, 0, 90, 0, 0, 0, - 99, 0, 0, 0, 0, 0, 0, 113, 0, 0, - 119, 106, 0, 0, 0, 0, 0, 0, 135, 0, - - 80, 0, 0, 0, 0, 92, 95, 100, 0, 0, - 105, 0, 0, 0, 118, 0, 0, 0, 0, 127, - 129, 0, 2, 1, 0, 91, 0, 103, 0, 109, - 117, 0, 0, 124, 125, 136, 0, 102, 0, 120, - 123, 85, 108, 0 + 0, 0, 0, 0, 164, 0, 0, 0, 126, 0, + 128, 0, 0, 0, 0, 0, 0, 163, 155, 148, + 148, 148, 4, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + + 148, 148, 148, 9, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 82, 148, 148, 0, 0, 0, 0, 0, 88, + 89, 0, 0, 0, 0, 97, 0, 0, 101, 104, + 0, 0, 0, 0, 0, 0, 0, 115, 116, 0, + 0, 0, 0, 121, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 148, 148, 148, 5, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + 148, 148, 148, 148, 148, 7, 8, 148, 148, 148, + 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, + + 148, 148, 148, 83, 148, 79, 0, 0, 0, 0, + 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 107, 0, 111, 112, 0, 114, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 130, 131, 0, 0, + 138, 12, 3, 14, 17, 19, 21, 23, 25, 27, + 29, 32, 34, 39, 37, 42, 44, 46, 48, 50, + 52, 54, 56, 58, 60, 62, 148, 148, 148, 64, + 66, 68, 70, 72, 74, 76, 78, 148, 81, 139, + 0, 0, 84, 0, 90, 0, 0, 0, 99, 0, + 0, 0, 0, 0, 0, 113, 0, 0, 119, 106, + + 0, 0, 0, 0, 0, 0, 135, 0, 145, 146, + 148, 80, 0, 0, 0, 0, 92, 95, 100, 0, + 0, 105, 0, 0, 0, 118, 0, 0, 0, 0, + 127, 129, 0, 148, 2, 1, 0, 91, 0, 103, + 0, 109, 117, 0, 0, 124, 125, 136, 147, 0, + 102, 0, 120, 123, 85, 108, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -484,157 +485,161 @@ static yyconst flex_int32_t yy_meta[66] = 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[649] = +static yyconst flex_int16_t yy_base[662] = { 0, - 0, 0, 904, 905, 901, 905, 898, 898, 0, 64, - 80, 95, 117, 882, 115, 53, 38, 58, 55, 876, - 121, 122, 67, 54, 115, 134, 65, 869, 840, 839, - 851, 835, 849, 848, 889, 875, 886, 905, 0, 169, - 905, 153, 133, 136, 17, 110, 131, 43, 148, 848, - 834, 121, 146, 832, 844, 147, 905, 189, 190, 86, - 189, 177, 185, 193, 250, 262, 273, 905, 905, 905, - 852, 865, 859, 856, 847, 850, 846, 861, 255, 843, - 857, 149, 843, 856, 847, 860, 837, 848, 839, 162, - 840, 831, 840, 831, 830, 831, 825, 831, 842, 828, - - 825, 837, 828, 821, 837, 814, 165, 190, 833, 810, - 795, 790, 807, 783, 788, 813, 144, 803, 225, 798, - 286, 261, 800, 781, 263, 791, 787, 782, 96, 788, - 774, 790, 787, 778, 270, 273, 780, 769, 783, 786, - 768, 783, 770, 767, 774, 264, 782, 160, 269, 285, - 288, 295, 759, 776, 777, 770, 752, 234, 753, 775, - 766, 227, 284, 291, 295, 299, 303, 307, 905, 364, - 375, 381, 387, 774, 205, 797, 0, 780, 771, 770, - 789, 768, 767, 766, 765, 0, 764, 0, 763, 762, - 0, 761, 760, 0, 759, 758, 757, 756, 755, 754, - - 769, 762, 775, 750, 749, 754, 747, 746, 745, 744, - 743, 742, 741, 750, 739, 738, 737, 736, 728, 727, - 712, 712, 711, 710, 752, 725, 713, 393, 400, 375, - 717, 280, 714, 708, 708, 702, 715, 715, 700, 905, - 905, 715, 703, 377, 710, 39, 707, 713, 376, 708, - 905, 699, 706, 705, 708, 694, 693, 697, 692, 294, - 697, 384, 396, 398, 905, 689, 687, 687, 695, 696, - 678, 401, 683, 689, 364, 386, 394, 399, 403, 460, - 466, 702, 714, 700, 699, 707, 697, 696, 0, 695, - 694, 693, 692, 691, 690, 689, 688, 687, 686, 685, - - 684, 683, 682, 681, 684, 677, 684, 677, 676, 0, - 675, 674, 673, 672, 671, 670, 669, 0, 668, 667, - 666, 665, 644, 638, 643, 649, 632, 647, 374, 905, - 646, 636, 640, 905, 905, 630, 639, 625, 642, 625, - 628, 622, 905, 623, 622, 619, 626, 619, 627, 623, - 633, 630, 612, 618, 625, 609, 608, 626, 608, 620, - 619, 905, 618, 608, 612, 905, 599, 905, 604, 604, - 612, 595, 596, 606, 905, 905, 637, 619, 635, 0, - 633, 633, 632, 631, 630, 629, 628, 627, 626, 625, - 624, 623, 622, 621, 620, 619, 618, 617, 604, 597, - - 0, 614, 613, 612, 611, 610, 609, 608, 607, 606, - 605, 604, 603, 602, 572, 575, 555, 0, 556, 549, - 556, 555, 556, 548, 566, 905, 905, 548, 546, 556, - 549, 905, 544, 561, 429, 905, 552, 536, 537, 546, - 537, 536, 536, 905, 535, 544, 534, 550, 547, 905, - 546, 544, 533, 534, 530, 522, 529, 524, 525, 520, - 545, 545, 543, 0, 542, 541, 540, 539, 538, 537, - 536, 535, 534, 533, 532, 531, 530, 529, 528, 527, - 526, 0, 0, 525, 524, 523, 522, 521, 520, 519, - 518, 517, 516, 515, 514, 513, 492, 492, 0, 499, - - 0, 532, 531, 481, 499, 905, 494, 489, 482, 478, - 490, 480, 478, 474, 490, 481, 480, 905, 905, 483, - 905, 478, 471, 460, 471, 463, 467, 480, 475, 478, - 460, 905, 905, 472, 461, 905, 0, 0, 0, 0, + 0, 0, 917, 918, 914, 918, 911, 911, 0, 64, + 80, 95, 117, 895, 115, 53, 38, 58, 55, 889, + 121, 122, 67, 54, 115, 137, 65, 882, 853, 852, + 864, 848, 862, 861, 902, 888, 899, 918, 0, 172, + 918, 156, 136, 139, 17, 107, 134, 43, 151, 861, + 847, 109, 149, 845, 857, 150, 918, 192, 193, 86, + 192, 180, 188, 196, 253, 265, 276, 918, 918, 918, + 865, 878, 872, 869, 860, 863, 859, 874, 258, 856, + 870, 170, 856, 869, 860, 873, 850, 861, 852, 135, + 853, 844, 853, 844, 843, 844, 838, 844, 855, 841, + + 838, 850, 853, 840, 833, 849, 826, 157, 189, 845, + 822, 807, 802, 819, 795, 800, 825, 150, 815, 124, + 810, 289, 264, 812, 793, 266, 803, 799, 794, 224, + 800, 786, 802, 799, 790, 273, 276, 792, 781, 795, + 798, 780, 795, 782, 779, 786, 267, 794, 163, 272, + 288, 291, 298, 771, 788, 789, 782, 764, 238, 765, + 787, 778, 287, 294, 298, 302, 306, 310, 314, 918, + 371, 382, 388, 394, 786, 208, 809, 0, 792, 783, + 782, 801, 780, 779, 778, 777, 0, 776, 0, 775, + 774, 0, 773, 772, 0, 771, 770, 769, 768, 767, + + 766, 781, 774, 787, 762, 761, 766, 759, 758, 757, + 777, 755, 754, 753, 752, 761, 750, 749, 748, 747, + 739, 738, 723, 723, 722, 721, 763, 736, 724, 400, + 407, 382, 728, 283, 725, 719, 719, 713, 726, 726, + 711, 918, 918, 726, 714, 384, 721, 39, 718, 724, + 383, 719, 918, 710, 717, 716, 719, 705, 704, 708, + 703, 92, 708, 391, 403, 405, 918, 700, 698, 698, + 706, 707, 689, 408, 694, 700, 371, 393, 401, 406, + 410, 467, 473, 713, 725, 711, 710, 718, 708, 707, + 0, 706, 705, 704, 703, 702, 701, 700, 699, 698, + + 697, 696, 695, 694, 693, 692, 695, 688, 695, 688, + 687, 0, 686, 685, 684, 687, 682, 681, 680, 679, + 0, 678, 677, 676, 675, 654, 648, 653, 659, 642, + 657, 161, 918, 656, 646, 650, 918, 918, 640, 649, + 635, 652, 635, 638, 632, 918, 633, 632, 629, 636, + 629, 637, 633, 643, 640, 622, 628, 635, 619, 618, + 636, 618, 630, 629, 918, 628, 618, 622, 918, 609, + 918, 614, 614, 622, 605, 606, 616, 918, 918, 647, + 629, 645, 0, 643, 643, 642, 641, 640, 639, 638, + 637, 636, 635, 634, 633, 632, 631, 630, 629, 628, + + 627, 614, 607, 0, 624, 623, 622, 621, 620, 598, + 618, 617, 616, 615, 614, 613, 612, 611, 581, 584, + 564, 0, 565, 558, 565, 564, 565, 557, 575, 918, + 918, 557, 555, 565, 558, 918, 553, 570, 239, 918, + 561, 545, 546, 555, 546, 545, 545, 918, 544, 553, + 543, 559, 556, 918, 555, 553, 542, 543, 539, 531, + 538, 533, 534, 529, 554, 554, 552, 0, 551, 550, + 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, + 539, 538, 537, 536, 535, 0, 0, 534, 533, 532, + 531, 530, 478, 529, 528, 527, 526, 525, 524, 523, + + 522, 501, 501, 0, 508, 0, 541, 540, 490, 508, + 918, 503, 498, 491, 487, 499, 489, 487, 483, 499, + 490, 489, 918, 918, 492, 918, 487, 480, 469, 480, + 472, 476, 489, 484, 487, 469, 918, 918, 481, 470, + 918, 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, 455, - 0, 0, 505, 504, 905, 452, 905, 456, 456, 465, - 905, 449, 463, 451, 453, 450, 458, 905, 436, 447, - 905, 905, 451, 447, 439, 432, 426, 439, 905, 396, - - 0, 443, 437, 392, 378, 905, 905, 905, 378, 338, - 905, 337, 317, 307, 905, 296, 290, 275, 275, 905, - 905, 288, 905, 905, 268, 905, 261, 905, 264, 905, - 905, 213, 158, 905, 905, 905, 128, 905, 75, 905, - 905, 905, 905, 905, 484, 487, 489, 493 + 0, 0, 0, 0, 0, 0, 505, 503, 496, 0, + 0, 0, 0, 0, 0, 0, 0, 449, 0, 0, + 499, 498, 918, 446, 918, 450, 450, 459, 918, 443, + 457, 445, 447, 444, 452, 918, 430, 441, 918, 918, + + 445, 441, 434, 432, 404, 416, 918, 395, 0, 0, + 430, 0, 433, 429, 381, 373, 918, 918, 918, 344, + 344, 918, 343, 292, 309, 918, 293, 292, 279, 284, + 918, 918, 292, 302, 918, 918, 271, 918, 264, 918, + 267, 918, 918, 242, 236, 918, 918, 918, 0, 215, + 918, 121, 918, 918, 918, 918, 918, 509, 512, 514, + 518 } ; -static yyconst flex_int16_t yy_def[649] = +static yyconst flex_int16_t yy_def[662] = { 0, - 644, 1, 644, 644, 644, 644, 644, 645, 646, 644, - 644, 647, 647, 13, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 644, 644, 645, 644, 646, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 648, 644, 644, 644, 644, 644, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - - 646, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 646, 646, 646, 646, 646, 646, 646, 646, - 646, 646, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - - 646, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 0, 644, 644, 644, 644 + 657, 1, 657, 657, 657, 657, 657, 658, 659, 657, + 657, 660, 660, 13, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 657, 657, 658, 657, 659, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 661, 657, 657, 657, 657, 657, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + + 659, 659, 659, 659, 659, 659, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + + 657, 657, 657, 657, 657, 657, 657, 657, 659, 659, + 659, 659, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 659, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 659, 657, + 657, 657, 657, 657, 657, 657, 0, 657, 657, 657, + 657 } ; -static yyconst flex_int16_t yy_nxt[971] = +static yyconst flex_int16_t yy_nxt[984] = { 0, 4, 5, 6, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, 19, @@ -642,109 +647,111 @@ static yyconst flex_int16_t yy_nxt[971] = 25, 26, 27, 9, 9, 9, 28, 9, 9, 9, 9, 9, 9, 9, 29, 9, 9, 9, 9, 9, 9, 9, 9, 9, 30, 9, 31, 32, 33, 9, - 34, 9, 9, 9, 9, 40, 79, 126, 96, 80, - 127, 41, 42, 42, 42, 42, 42, 42, 76, 83, - 77, 97, 344, 107, 81, 84, 78, 65, 66, 66, - 66, 66, 66, 66, 82, 94, 133, 345, 67, 134, + 34, 9, 9, 9, 9, 40, 79, 127, 96, 80, + 128, 41, 42, 42, 42, 42, 42, 42, 76, 83, + 77, 97, 347, 108, 81, 84, 78, 65, 66, 66, + 66, 66, 66, 66, 82, 94, 134, 348, 67, 135, - 95, 108, 65, 43, 44, 45, 46, 47, 48, 49, + 95, 109, 65, 43, 44, 45, 46, 47, 48, 49, 50, 51, 68, 67, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 67, 65, 61, 62, 63, 64, 159, - 71, 98, 72, 99, 69, 67, 90, 643, 67, 73, - 237, 86, 160, 87, 91, 74, 100, 75, 88, 92, - 101, 89, 238, 128, 102, 93, 103, 129, 104, 187, - 67, 42, 42, 42, 42, 42, 42, 105, 139, 106, - 40, 121, 122, 122, 140, 125, 122, 188, 122, 196, - 642, 122, 130, 131, 123, 141, 146, 135, 136, 122, - 214, 124, 122, 122, 132, 123, 121, 147, 197, 142, - - 148, 215, 124, 149, 122, 216, 143, 257, 117, 118, - 45, 46, 47, 48, 641, 50, 51, 258, 217, 52, - 53, 54, 55, 56, 57, 119, 59, 60, 150, 151, - 120, 154, 161, 155, 152, 283, 156, 157, 163, 162, - 164, 165, 153, 284, 158, 122, 166, 162, 162, 167, - 162, 162, 162, 162, 168, 162, 162, 162, 170, 170, - 170, 170, 170, 170, 227, 640, 182, 183, 171, 65, - 66, 66, 66, 66, 66, 66, 184, 270, 153, 172, - 67, 173, 173, 173, 173, 173, 173, 271, 275, 275, - 275, 275, 228, 171, 229, 229, 229, 229, 229, 229, - - 230, 230, 230, 230, 233, 67, 230, 639, 230, 230, - 230, 638, 244, 230, 254, 230, 259, 230, 230, 230, - 255, 637, 260, 332, 230, 230, 230, 262, 230, 230, - 230, 636, 635, 230, 263, 264, 333, 261, 634, 359, - 230, 230, 360, 633, 230, 275, 275, 275, 275, 632, - 631, 230, 276, 275, 275, 277, 278, 275, 275, 275, - 275, 275, 275, 275, 279, 275, 275, 275, 275, 275, - 275, 275, 42, 42, 42, 42, 42, 42, 630, 629, - 628, 280, 121, 281, 281, 281, 281, 281, 281, 173, - 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, - - 173, 229, 229, 229, 229, 229, 229, 121, 229, 229, - 229, 229, 229, 229, 330, 330, 330, 330, 421, 348, - 330, 627, 330, 330, 330, 375, 375, 375, 375, 330, - 626, 330, 349, 330, 422, 330, 330, 362, 330, 625, - 330, 330, 369, 330, 370, 624, 371, 375, 375, 375, - 375, 623, 330, 622, 330, 376, 375, 375, 375, 372, - 375, 375, 375, 375, 375, 375, 375, 375, 281, 281, - 281, 281, 281, 281, 281, 281, 281, 281, 281, 281, - 513, 621, 620, 514, 37, 37, 37, 37, 39, 619, - 39, 66, 66, 169, 169, 618, 169, 617, 616, 615, - - 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, - 604, 603, 602, 601, 600, 599, 598, 597, 596, 595, - 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, - 584, 583, 582, 581, 580, 579, 578, 577, 576, 575, - 574, 573, 572, 571, 570, 569, 568, 567, 566, 565, - 564, 563, 562, 561, 560, 559, 558, 557, 556, 555, - 554, 553, 552, 551, 550, 549, 548, 547, 546, 545, - 544, 543, 542, 541, 540, 539, 538, 537, 536, 535, - 534, 533, 532, 531, 530, 529, 528, 527, 526, 525, - 524, 523, 522, 521, 520, 519, 518, 517, 516, 515, - - 512, 511, 510, 509, 508, 507, 506, 505, 504, 503, - 502, 501, 500, 499, 498, 497, 496, 495, 494, 493, - 492, 491, 490, 489, 488, 487, 486, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 471, 470, 469, 468, 467, 466, 465, 464, 463, - 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, - 452, 451, 450, 449, 448, 447, 446, 445, 444, 443, - 442, 441, 440, 439, 438, 437, 436, 435, 434, 433, - 432, 431, 430, 429, 428, 427, 426, 425, 424, 423, - 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, - - 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, - 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, - 390, 389, 388, 387, 386, 385, 384, 383, 382, 381, - 380, 379, 378, 377, 374, 373, 368, 367, 366, 365, - 364, 363, 361, 358, 357, 356, 355, 354, 353, 352, - 351, 350, 347, 346, 343, 342, 341, 340, 339, 338, - 337, 336, 335, 334, 331, 261, 233, 329, 328, 327, - 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, - 316, 315, 314, 313, 312, 311, 310, 309, 308, 307, - 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, - - 296, 295, 294, 293, 292, 291, 290, 289, 288, 287, - 286, 285, 282, 274, 273, 272, 269, 268, 267, 266, - 265, 256, 253, 252, 251, 250, 249, 248, 247, 246, - 245, 243, 242, 241, 240, 239, 236, 235, 234, 232, - 231, 161, 226, 225, 224, 223, 222, 221, 220, 219, - 218, 213, 212, 211, 210, 209, 208, 207, 206, 205, - 204, 203, 202, 201, 200, 199, 198, 195, 194, 193, - 192, 191, 190, 189, 186, 185, 181, 180, 179, 178, - 177, 176, 175, 174, 145, 144, 138, 137, 38, 116, - 35, 115, 114, 113, 112, 111, 110, 109, 85, 70, - - 38, 36, 35, 644, 3, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644 + 58, 59, 60, 67, 65, 61, 62, 63, 64, 160, + 71, 98, 72, 99, 69, 67, 90, 362, 67, 73, + 363, 86, 161, 87, 91, 74, 100, 75, 88, 92, + 129, 89, 197, 101, 130, 93, 140, 102, 103, 104, + 67, 105, 141, 229, 42, 42, 42, 42, 42, 42, + 106, 198, 107, 40, 122, 123, 123, 154, 126, 123, + 188, 123, 216, 656, 123, 131, 132, 124, 142, 147, + 136, 137, 123, 217, 125, 123, 123, 133, 189, 122, + + 148, 124, 143, 149, 218, 425, 150, 123, 125, 144, + 259, 118, 119, 45, 46, 47, 48, 219, 50, 51, + 260, 426, 52, 53, 54, 55, 56, 57, 120, 59, + 60, 151, 152, 121, 155, 162, 156, 153, 285, 157, + 158, 164, 163, 165, 166, 154, 286, 159, 123, 167, + 163, 163, 168, 163, 163, 163, 163, 169, 163, 163, + 163, 171, 171, 171, 171, 171, 171, 655, 239, 183, + 184, 172, 65, 66, 66, 66, 66, 66, 66, 185, + 240, 272, 173, 67, 174, 174, 174, 174, 174, 174, + 518, 273, 654, 519, 653, 230, 172, 231, 231, 231, + + 231, 231, 231, 232, 232, 232, 232, 235, 67, 232, + 652, 232, 232, 232, 651, 246, 232, 256, 232, 261, + 232, 232, 232, 257, 650, 262, 335, 232, 232, 232, + 264, 232, 232, 232, 649, 648, 232, 265, 266, 336, + 263, 647, 646, 232, 232, 645, 644, 232, 277, 277, + 277, 277, 643, 642, 232, 277, 277, 277, 277, 278, + 277, 277, 279, 280, 277, 277, 277, 277, 277, 277, + 277, 281, 277, 277, 277, 277, 277, 277, 277, 42, + 42, 42, 42, 42, 42, 641, 640, 639, 282, 122, + 283, 283, 283, 283, 283, 283, 174, 174, 174, 174, + + 174, 174, 174, 174, 174, 174, 174, 174, 231, 231, + 231, 231, 231, 231, 122, 231, 231, 231, 231, 231, + 231, 333, 333, 333, 333, 638, 351, 333, 637, 333, + 333, 333, 378, 378, 378, 378, 333, 636, 333, 352, + 333, 635, 333, 333, 365, 333, 634, 333, 333, 372, + 333, 373, 633, 374, 378, 378, 378, 378, 632, 333, + 631, 333, 379, 378, 378, 378, 375, 378, 378, 378, + 378, 378, 378, 378, 378, 283, 283, 283, 283, 283, + 283, 283, 283, 283, 283, 283, 283, 567, 568, 630, + 629, 628, 627, 626, 625, 624, 623, 622, 621, 620, + + 619, 618, 617, 616, 615, 614, 613, 612, 569, 37, + 37, 37, 37, 39, 611, 39, 66, 66, 170, 170, + 610, 170, 609, 608, 607, 606, 605, 604, 603, 602, + 601, 600, 599, 598, 597, 596, 595, 594, 593, 592, + 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, + 581, 580, 579, 578, 577, 576, 575, 574, 573, 572, + 571, 570, 566, 565, 564, 563, 562, 561, 560, 559, + 558, 557, 556, 555, 554, 553, 552, 551, 550, 549, + 548, 547, 546, 545, 544, 543, 542, 541, 540, 539, + 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, + + 528, 527, 526, 525, 524, 523, 522, 521, 520, 517, + 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, + 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, + 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, + 486, 485, 484, 483, 482, 481, 480, 479, 478, 477, + 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, + 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, + 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, + 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, + 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, + + 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, + 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, + 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, + 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, + 384, 383, 382, 381, 380, 377, 376, 371, 370, 369, + 368, 367, 366, 364, 361, 360, 359, 358, 357, 356, + 355, 354, 353, 350, 349, 346, 345, 344, 343, 342, + 341, 340, 339, 338, 337, 334, 263, 235, 332, 331, + 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, + 320, 319, 318, 317, 316, 315, 314, 313, 312, 311, + + 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, + 300, 299, 298, 297, 296, 295, 294, 293, 292, 291, + 290, 289, 288, 287, 284, 276, 275, 274, 271, 270, + 269, 268, 267, 258, 255, 254, 253, 252, 251, 250, + 249, 248, 247, 245, 244, 243, 242, 241, 238, 237, + 236, 234, 233, 162, 228, 227, 226, 225, 224, 223, + 222, 221, 220, 215, 214, 213, 212, 211, 210, 209, + 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, + 196, 195, 194, 193, 192, 191, 190, 187, 186, 182, + 181, 180, 179, 178, 177, 176, 175, 146, 145, 139, + + 138, 38, 117, 35, 116, 115, 114, 113, 112, 111, + 110, 85, 70, 38, 36, 35, 657, 3, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657 } ; -static yyconst flex_int16_t yy_chk[971] = +static yyconst flex_int16_t yy_chk[984] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -754,104 +761,106 @@ static yyconst flex_int16_t yy_chk[971] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 10, 17, 45, 24, 17, 45, 10, 10, 10, 10, 10, 10, 10, 16, 19, - 16, 24, 246, 27, 18, 19, 16, 11, 11, 11, - 11, 11, 11, 11, 18, 23, 48, 246, 11, 48, + 16, 24, 248, 27, 18, 19, 16, 11, 11, 11, + 11, 11, 11, 11, 18, 23, 48, 248, 11, 48, 23, 27, 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 12, 12, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 13, 10, 10, 10, 10, 60, - 15, 25, 15, 25, 13, 13, 22, 639, 12, 15, - 129, 21, 60, 21, 22, 15, 25, 15, 21, 22, - 26, 21, 129, 46, 26, 22, 26, 46, 26, 82, - 13, 42, 42, 42, 42, 42, 42, 26, 52, 26, - 40, 42, 43, 43, 52, 44, 44, 82, 43, 90, - 637, 44, 47, 47, 43, 53, 56, 49, 49, 43, - 107, 43, 44, 49, 47, 117, 42, 56, 90, 53, - - 56, 107, 117, 56, 49, 108, 53, 148, 40, 40, - 40, 40, 40, 40, 633, 40, 40, 148, 108, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 58, 58, - 40, 59, 61, 59, 58, 175, 59, 59, 62, 62, - 62, 62, 58, 175, 59, 58, 63, 63, 63, 63, - 61, 61, 61, 61, 64, 64, 64, 64, 65, 65, - 65, 65, 65, 65, 119, 632, 79, 79, 65, 66, - 66, 66, 66, 66, 66, 66, 79, 158, 119, 67, - 66, 67, 67, 67, 67, 67, 67, 158, 162, 162, - 162, 162, 121, 65, 121, 121, 121, 121, 121, 121, - - 122, 122, 125, 125, 125, 66, 122, 629, 125, 135, - 135, 627, 136, 136, 146, 135, 149, 122, 136, 125, - 146, 625, 149, 232, 150, 150, 135, 151, 151, 136, - 150, 622, 619, 151, 152, 152, 232, 150, 618, 260, - 152, 150, 260, 617, 151, 163, 163, 163, 163, 616, - 614, 152, 164, 164, 164, 164, 165, 165, 165, 165, - 166, 166, 166, 166, 167, 167, 167, 167, 168, 168, - 168, 168, 170, 170, 170, 170, 170, 170, 613, 612, - 610, 171, 170, 171, 171, 171, 171, 171, 171, 172, - 172, 172, 172, 172, 172, 173, 173, 173, 173, 173, - - 173, 228, 228, 228, 228, 228, 228, 170, 229, 229, - 229, 229, 229, 229, 230, 230, 244, 244, 329, 249, - 230, 609, 244, 262, 262, 275, 275, 275, 275, 262, - 605, 230, 249, 244, 329, 263, 263, 264, 264, 604, - 262, 263, 272, 264, 272, 603, 272, 276, 276, 276, - 276, 602, 263, 600, 264, 277, 277, 277, 277, 272, - 278, 278, 278, 278, 279, 279, 279, 279, 280, 280, - 280, 280, 280, 280, 281, 281, 281, 281, 281, 281, - 435, 598, 597, 435, 645, 645, 645, 645, 646, 596, - 646, 647, 647, 648, 648, 595, 648, 594, 593, 590, - - 589, 587, 586, 585, 584, 583, 582, 580, 579, 578, - 576, 574, 573, 570, 535, 534, 531, 530, 529, 528, - 527, 526, 525, 524, 523, 522, 520, 517, 516, 515, - 514, 513, 512, 511, 510, 509, 508, 507, 505, 504, - 503, 502, 500, 498, 497, 496, 495, 494, 493, 492, - 491, 490, 489, 488, 487, 486, 485, 484, 481, 480, - 479, 478, 477, 476, 475, 474, 473, 472, 471, 470, - 469, 468, 467, 466, 465, 463, 462, 461, 460, 459, - 458, 457, 456, 455, 454, 453, 452, 451, 449, 448, - 447, 446, 445, 443, 442, 441, 440, 439, 438, 437, - - 434, 433, 431, 430, 429, 428, 425, 424, 423, 422, - 421, 420, 419, 417, 416, 415, 414, 413, 412, 411, - 410, 409, 408, 407, 406, 405, 404, 403, 402, 400, - 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, - 389, 388, 387, 386, 385, 384, 383, 382, 381, 379, - 378, 377, 374, 373, 372, 371, 370, 369, 367, 365, - 364, 363, 361, 360, 359, 358, 357, 356, 355, 354, - 353, 352, 351, 350, 349, 348, 347, 346, 345, 344, - 342, 341, 340, 339, 338, 337, 336, 333, 332, 331, - 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, - - 317, 316, 315, 314, 313, 312, 311, 309, 308, 307, - 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, - 296, 295, 294, 293, 292, 291, 290, 288, 287, 286, - 285, 284, 283, 282, 274, 273, 271, 270, 269, 268, - 267, 266, 261, 259, 258, 257, 256, 255, 254, 253, - 252, 250, 248, 247, 245, 243, 242, 239, 238, 237, - 236, 235, 234, 233, 231, 227, 226, 225, 224, 223, - 222, 221, 220, 219, 218, 217, 216, 215, 214, 213, - 212, 211, 210, 209, 208, 207, 206, 205, 204, 203, - 202, 201, 200, 199, 198, 197, 196, 195, 193, 192, - - 190, 189, 187, 185, 184, 183, 182, 181, 180, 179, - 178, 176, 174, 161, 160, 159, 157, 156, 155, 154, - 153, 147, 145, 144, 143, 142, 141, 140, 139, 138, - 137, 134, 133, 132, 131, 130, 128, 127, 126, 124, - 123, 120, 118, 116, 115, 114, 113, 112, 111, 110, - 109, 106, 105, 104, 103, 102, 101, 100, 99, 98, - 97, 96, 95, 94, 93, 92, 91, 89, 88, 87, - 86, 85, 84, 83, 81, 80, 78, 77, 76, 75, - 74, 73, 72, 71, 55, 54, 51, 50, 37, 36, - 35, 34, 33, 32, 31, 30, 29, 28, 20, 14, - - 8, 7, 5, 3, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 644 + 15, 25, 15, 25, 13, 13, 22, 262, 12, 15, + 262, 21, 60, 21, 22, 15, 25, 15, 21, 22, + 46, 21, 90, 26, 46, 22, 52, 26, 26, 26, + 13, 26, 52, 120, 42, 42, 42, 42, 42, 42, + 26, 90, 26, 40, 42, 43, 43, 120, 44, 44, + 82, 43, 108, 652, 44, 47, 47, 43, 53, 56, + 49, 49, 43, 108, 43, 44, 49, 47, 82, 42, + + 56, 118, 53, 56, 109, 332, 56, 49, 118, 53, + 149, 40, 40, 40, 40, 40, 40, 109, 40, 40, + 149, 332, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 58, 58, 40, 59, 61, 59, 58, 176, 59, + 59, 62, 62, 62, 62, 58, 176, 59, 58, 63, + 63, 63, 63, 61, 61, 61, 61, 64, 64, 64, + 64, 65, 65, 65, 65, 65, 65, 650, 130, 79, + 79, 65, 66, 66, 66, 66, 66, 66, 66, 79, + 130, 159, 67, 66, 67, 67, 67, 67, 67, 67, + 439, 159, 645, 439, 644, 122, 65, 122, 122, 122, + + 122, 122, 122, 123, 123, 126, 126, 126, 66, 123, + 641, 126, 136, 136, 639, 137, 137, 147, 136, 150, + 123, 137, 126, 147, 637, 150, 234, 151, 151, 136, + 152, 152, 137, 151, 634, 633, 152, 153, 153, 234, + 151, 630, 629, 153, 151, 628, 627, 152, 163, 163, + 163, 163, 625, 624, 153, 164, 164, 164, 164, 165, + 165, 165, 165, 166, 166, 166, 166, 167, 167, 167, + 167, 168, 168, 168, 168, 169, 169, 169, 169, 171, + 171, 171, 171, 171, 171, 623, 621, 620, 172, 171, + 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, + + 173, 173, 174, 174, 174, 174, 174, 174, 230, 230, + 230, 230, 230, 230, 171, 231, 231, 231, 231, 231, + 231, 232, 232, 246, 246, 616, 251, 232, 615, 246, + 264, 264, 277, 277, 277, 277, 264, 614, 232, 251, + 246, 613, 265, 265, 266, 266, 611, 264, 265, 274, + 266, 274, 608, 274, 278, 278, 278, 278, 606, 265, + 605, 266, 279, 279, 279, 279, 274, 280, 280, 280, + 280, 281, 281, 281, 281, 282, 282, 282, 282, 282, + 282, 283, 283, 283, 283, 283, 283, 493, 493, 604, + 603, 602, 601, 598, 597, 595, 594, 593, 592, 591, + + 590, 588, 587, 586, 584, 582, 581, 578, 493, 658, + 658, 658, 658, 659, 569, 659, 660, 660, 661, 661, + 568, 661, 567, 540, 539, 536, 535, 534, 533, 532, + 531, 530, 529, 528, 527, 525, 522, 521, 520, 519, + 518, 517, 516, 515, 514, 513, 512, 510, 509, 508, + 507, 505, 503, 502, 501, 500, 499, 498, 497, 496, + 495, 494, 492, 491, 490, 489, 488, 485, 484, 483, + 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, + 472, 471, 470, 469, 467, 466, 465, 464, 463, 462, + 461, 460, 459, 458, 457, 456, 455, 453, 452, 451, + + 450, 449, 447, 446, 445, 444, 443, 442, 441, 438, + 437, 435, 434, 433, 432, 429, 428, 427, 426, 425, + 424, 423, 421, 420, 419, 418, 417, 416, 415, 414, + 413, 412, 411, 410, 409, 408, 407, 406, 405, 403, + 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, + 392, 391, 390, 389, 388, 387, 386, 385, 384, 382, + 381, 380, 377, 376, 375, 374, 373, 372, 370, 368, + 367, 366, 364, 363, 362, 361, 360, 359, 358, 357, + 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, + 345, 344, 343, 342, 341, 340, 339, 336, 335, 334, + + 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, + 320, 319, 318, 317, 316, 315, 314, 313, 311, 310, + 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, + 299, 298, 297, 296, 295, 294, 293, 292, 290, 289, + 288, 287, 286, 285, 284, 276, 275, 273, 272, 271, + 270, 269, 268, 263, 261, 260, 259, 258, 257, 256, + 255, 254, 252, 250, 249, 247, 245, 244, 241, 240, + 239, 238, 237, 236, 235, 233, 229, 228, 227, 226, + 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, + 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, + + 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, + 194, 193, 191, 190, 188, 186, 185, 184, 183, 182, + 181, 180, 179, 177, 175, 162, 161, 160, 158, 157, + 156, 155, 154, 148, 146, 145, 144, 143, 142, 141, + 140, 139, 138, 135, 134, 133, 132, 131, 129, 128, + 127, 125, 124, 121, 119, 117, 116, 115, 114, 113, + 112, 111, 110, 107, 106, 105, 104, 103, 102, 101, + 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, + 89, 88, 87, 86, 85, 84, 83, 81, 80, 78, + 77, 76, 75, 74, 73, 72, 71, 55, 54, 51, + + 50, 37, 36, 35, 34, 33, 32, 31, 30, 29, + 28, 20, 14, 8, 7, 5, 3, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, + 657, 657, 657 } ; /* The intent behind this definition is that it'll catch @@ -893,6 +902,7 @@ static yyconst flex_int16_t yy_chk[971] = #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define return_token_or_IDENTIFIER(condition, token) \ @@ -986,7 +996,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 990 "lex.yy.c" +#line 1000 "lex.yy.c" #define INITIAL 0 @@ -1232,10 +1242,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 133 "program_lexer.l" +#line 134 "program_lexer.l" -#line 1239 "lex.yy.c" +#line 1249 "lex.yy.c" yylval = yylval_param; @@ -1292,13 +1302,13 @@ yy_match: 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 >= 645 ) + if ( yy_current_state >= 658 ) 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_base[yy_current_state] != 905 ); + while ( yy_base[yy_current_state] != 918 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1324,17 +1334,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 135 "program_lexer.l" +#line 136 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 136 "program_lexer.l" +#line 137 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 137 "program_lexer.l" +#line 138 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1342,778 +1352,793 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 141 "program_lexer.l" +#line 142 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 142 "program_lexer.l" +#line 143 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 143 "program_lexer.l" +#line 144 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 144 "program_lexer.l" +#line 145 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 146 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 147 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 148 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 149 "program_lexer.l" +#line 150 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, OFF); } YY_BREAK case 12: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 151 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } YY_BREAK case 13: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 152 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, OFF); } YY_BREAK case 14: YY_RULE_SETUP -#line 152 "program_lexer.l" +#line 153 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } YY_BREAK case 15: YY_RULE_SETUP -#line 153 "program_lexer.l" +#line 154 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, OFF); } YY_BREAK case 16: YY_RULE_SETUP -#line 155 "program_lexer.l" +#line 156 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } YY_BREAK case 17: YY_RULE_SETUP -#line 156 "program_lexer.l" +#line 157 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } YY_BREAK case 18: YY_RULE_SETUP -#line 157 "program_lexer.l" +#line 158 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } YY_BREAK case 19: YY_RULE_SETUP -#line 158 "program_lexer.l" +#line 159 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } YY_BREAK case 20: YY_RULE_SETUP -#line 160 "program_lexer.l" +#line 161 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, OFF); } YY_BREAK case 21: YY_RULE_SETUP -#line 161 "program_lexer.l" +#line 162 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } YY_BREAK case 22: YY_RULE_SETUP -#line 162 "program_lexer.l" +#line 163 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, OFF); } YY_BREAK case 23: YY_RULE_SETUP -#line 163 "program_lexer.l" +#line 164 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } YY_BREAK case 24: YY_RULE_SETUP -#line 164 "program_lexer.l" +#line 165 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, OFF); } YY_BREAK case 25: YY_RULE_SETUP -#line 165 "program_lexer.l" +#line 166 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } YY_BREAK case 26: YY_RULE_SETUP -#line 166 "program_lexer.l" +#line 167 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, OFF); } YY_BREAK case 27: YY_RULE_SETUP -#line 167 "program_lexer.l" +#line 168 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } YY_BREAK case 28: YY_RULE_SETUP -#line 169 "program_lexer.l" +#line 170 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, OFF); } YY_BREAK case 29: YY_RULE_SETUP -#line 170 "program_lexer.l" +#line 171 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } YY_BREAK case 30: YY_RULE_SETUP -#line 171 "program_lexer.l" +#line 172 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } YY_BREAK case 31: YY_RULE_SETUP -#line 173 "program_lexer.l" +#line 174 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, OFF); } YY_BREAK case 32: YY_RULE_SETUP -#line 174 "program_lexer.l" +#line 175 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } YY_BREAK case 33: YY_RULE_SETUP -#line 175 "program_lexer.l" +#line 176 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, OFF); } YY_BREAK case 34: YY_RULE_SETUP -#line 176 "program_lexer.l" +#line 177 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } YY_BREAK case 35: YY_RULE_SETUP -#line 178 "program_lexer.l" +#line 179 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, OFF); } YY_BREAK case 36: YY_RULE_SETUP -#line 180 "program_lexer.l" +#line 181 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, OFF); } YY_BREAK case 37: YY_RULE_SETUP -#line 181 "program_lexer.l" +#line 182 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } YY_BREAK case 38: YY_RULE_SETUP -#line 182 "program_lexer.l" +#line 183 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, OFF); } YY_BREAK case 39: YY_RULE_SETUP -#line 183 "program_lexer.l" +#line 184 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } YY_BREAK case 40: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 185 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } YY_BREAK case 41: YY_RULE_SETUP -#line 185 "program_lexer.l" +#line 186 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } YY_BREAK case 42: YY_RULE_SETUP -#line 186 "program_lexer.l" +#line 187 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } YY_BREAK case 43: YY_RULE_SETUP -#line 188 "program_lexer.l" +#line 189 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, OFF); } YY_BREAK case 44: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 190 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } YY_BREAK case 45: YY_RULE_SETUP -#line 190 "program_lexer.l" +#line 191 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, OFF); } YY_BREAK case 46: YY_RULE_SETUP -#line 191 "program_lexer.l" +#line 192 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } YY_BREAK case 47: YY_RULE_SETUP -#line 192 "program_lexer.l" +#line 193 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, OFF); } YY_BREAK case 48: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } YY_BREAK case 49: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, OFF); } YY_BREAK case 50: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } YY_BREAK case 51: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 197 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, OFF); } YY_BREAK case 52: YY_RULE_SETUP -#line 197 "program_lexer.l" +#line 198 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } YY_BREAK case 53: YY_RULE_SETUP -#line 199 "program_lexer.l" +#line 200 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, OFF); } YY_BREAK case 54: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 201 "program_lexer.l" { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } YY_BREAK case 55: YY_RULE_SETUP -#line 202 "program_lexer.l" +#line 203 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, OFF); } YY_BREAK case 56: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 204 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } YY_BREAK case 57: YY_RULE_SETUP -#line 204 "program_lexer.l" +#line 205 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, OFF); } YY_BREAK case 58: YY_RULE_SETUP -#line 205 "program_lexer.l" +#line 206 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } YY_BREAK case 59: YY_RULE_SETUP -#line 207 "program_lexer.l" +#line 208 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } YY_BREAK case 60: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 209 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } YY_BREAK case 61: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 210 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, OFF); } YY_BREAK case 62: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 211 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } YY_BREAK case 63: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } YY_BREAK case 64: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } YY_BREAK case 65: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, OFF); } YY_BREAK case 66: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 215 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } YY_BREAK case 67: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, OFF); } YY_BREAK case 68: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } YY_BREAK case 69: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, OFF); } YY_BREAK case 70: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } YY_BREAK case 71: YY_RULE_SETUP -#line 220 "program_lexer.l" +#line 221 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } YY_BREAK case 72: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 222 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } YY_BREAK case 73: YY_RULE_SETUP -#line 222 "program_lexer.l" +#line 223 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } YY_BREAK case 74: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } YY_BREAK case 75: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } YY_BREAK case 76: YY_RULE_SETUP -#line 225 "program_lexer.l" +#line 226 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } YY_BREAK case 77: YY_RULE_SETUP -#line 227 "program_lexer.l" +#line 228 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, OFF); } YY_BREAK case 78: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 229 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } YY_BREAK case 79: YY_RULE_SETUP -#line 230 "program_lexer.l" +#line 231 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 80: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 232 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 81: YY_RULE_SETUP -#line 232 "program_lexer.l" +#line 233 "program_lexer.l" { return PROGRAM; } YY_BREAK case 82: YY_RULE_SETUP -#line 233 "program_lexer.l" +#line 234 "program_lexer.l" { return STATE; } YY_BREAK case 83: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 235 "program_lexer.l" { return RESULT; } YY_BREAK case 84: YY_RULE_SETUP -#line 236 "program_lexer.l" +#line 237 "program_lexer.l" { return AMBIENT; } YY_BREAK case 85: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 238 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, ATTENUATION); } YY_BREAK case 86: YY_RULE_SETUP -#line 238 "program_lexer.l" +#line 239 "program_lexer.l" { return BACK; } YY_BREAK case 87: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 240 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 88: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 241 "program_lexer.l" { return COLOR; } YY_BREAK case 89: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 242 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 90: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 243 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 91: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 244 "program_lexer.l" { return DIRECTION; } YY_BREAK case 92: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 245 "program_lexer.l" { return EMISSION; } YY_BREAK case 93: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 246 "program_lexer.l" { return ENV; } YY_BREAK case 94: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 247 "program_lexer.l" { return EYE; } YY_BREAK case 95: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 248 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 96: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 249 "program_lexer.l" { return FOG; } YY_BREAK case 97: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 250 "program_lexer.l" { return FRONT; } YY_BREAK case 98: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 251 "program_lexer.l" { return HALF; } YY_BREAK case 99: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 252 "program_lexer.l" { return INVERSE; } YY_BREAK case 100: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 253 "program_lexer.l" { return INVTRANS; } YY_BREAK case 101: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 254 "program_lexer.l" { return LIGHT; } YY_BREAK case 102: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 255 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 103: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 256 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 104: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 257 "program_lexer.l" { return LOCAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 258 "program_lexer.l" { return MATERIAL; } YY_BREAK case 106: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 259 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 107: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 260 "program_lexer.l" { return MATRIX; } YY_BREAK case 108: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 261 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 109: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 262 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 110: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 263 "program_lexer.l" { return MVP; } YY_BREAK case 111: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 264 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 265 "program_lexer.l" { return OBJECT; } YY_BREAK case 113: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 266 "program_lexer.l" { return PALETTE; } YY_BREAK case 114: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 267 "program_lexer.l" { return PARAMS; } YY_BREAK case 115: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 268 "program_lexer.l" { return PLANE; } YY_BREAK case 116: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 269 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT); } YY_BREAK case 117: YY_RULE_SETUP -#line 269 "program_lexer.l" +#line 270 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 118: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 271 "program_lexer.l" { return POSITION; } YY_BREAK case 119: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 272 "program_lexer.l" { return PRIMARY; } YY_BREAK case 120: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 273 "program_lexer.l" { return PROJECTION; } YY_BREAK case 121: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 274 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 122: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 275 "program_lexer.l" { return ROW; } YY_BREAK case 123: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 276 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 124: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 277 "program_lexer.l" { return SECONDARY; } YY_BREAK case 125: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 278 "program_lexer.l" { return SHININESS; } YY_BREAK case 126: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 279 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE); } YY_BREAK case 127: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 280 "program_lexer.l" { return SPECULAR; } YY_BREAK case 128: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 281 "program_lexer.l" { return SPOT; } YY_BREAK case 129: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 282 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 130: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 283 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 131: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 284 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 132: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 285 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 133: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 134: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 287 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 135: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 288 "program_lexer.l" { return TEXTURE; } YY_BREAK case 136: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 289 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 137: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 290 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 138: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 291 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 139: YY_RULE_SETUP -#line 292 "program_lexer.l" +#line 293 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 140: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 294 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 141: YY_RULE_SETUP -#line 294 "program_lexer.l" +#line 295 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 142: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 143: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 297 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 144: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 298 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 145: YY_RULE_SETUP #line 299 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } + YY_BREAK +case 146: +YY_RULE_SETUP +#line 300 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } + YY_BREAK +case 147: +YY_RULE_SETUP +#line 301 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } + YY_BREAK +case 148: +YY_RULE_SETUP +#line 303 "program_lexer.l" { yylval->string = strdup(yytext); return IDENTIFIER; } YY_BREAK -case 146: +case 149: YY_RULE_SETUP -#line 304 "program_lexer.l" +#line 308 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 147: +case 150: YY_RULE_SETUP -#line 306 "program_lexer.l" +#line 310 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 148: +case 151: YY_RULE_SETUP -#line 310 "program_lexer.l" +#line 314 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 149: -/* rule 149 can match eol */ +case 152: +/* rule 152 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 314 "program_lexer.l" +#line 318 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 150: +case 153: YY_RULE_SETUP -#line 318 "program_lexer.l" +#line 322 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 151: +case 154: YY_RULE_SETUP -#line 322 "program_lexer.l" +#line 326 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 152: +case 155: YY_RULE_SETUP -#line 327 "program_lexer.l" +#line 331 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 153: +case 156: YY_RULE_SETUP -#line 333 "program_lexer.l" +#line 337 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2121,27 +2146,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 154: +case 157: YY_RULE_SETUP -#line 339 "program_lexer.l" +#line 343 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 155: +case 158: YY_RULE_SETUP -#line 344 "program_lexer.l" +#line 348 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 156: +case 159: YY_RULE_SETUP -#line 350 "program_lexer.l" +#line 354 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2149,9 +2174,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 157: +case 160: YY_RULE_SETUP -#line 356 "program_lexer.l" +#line 360 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2159,18 +2184,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 158: +case 161: YY_RULE_SETUP -#line 362 "program_lexer.l" +#line 366 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 159: +case 162: YY_RULE_SETUP -#line 368 "program_lexer.l" +#line 372 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2178,9 +2203,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 160: +case 163: YY_RULE_SETUP -#line 375 "program_lexer.l" +#line 379 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2190,18 +2215,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 161: +case 164: YY_RULE_SETUP -#line 384 "program_lexer.l" +#line 388 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 162: +case 165: YY_RULE_SETUP -#line 390 "program_lexer.l" +#line 394 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2209,27 +2234,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 163: +case 166: YY_RULE_SETUP -#line 396 "program_lexer.l" +#line 400 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 164: +case 167: YY_RULE_SETUP -#line 401 "program_lexer.l" +#line 405 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 165: +case 168: YY_RULE_SETUP -#line 407 "program_lexer.l" +#line 411 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2237,9 +2262,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 166: +case 169: YY_RULE_SETUP -#line 413 "program_lexer.l" +#line 417 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2247,18 +2272,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 167: +case 170: YY_RULE_SETUP -#line 419 "program_lexer.l" +#line 423 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 168: +case 171: YY_RULE_SETUP -#line 425 "program_lexer.l" +#line 429 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2266,9 +2291,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 169: +case 172: YY_RULE_SETUP -#line 433 "program_lexer.l" +#line 437 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2280,9 +2305,9 @@ YY_RULE_SETUP } } YY_BREAK -case 170: +case 173: YY_RULE_SETUP -#line 444 "program_lexer.l" +#line 448 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2292,15 +2317,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 171: +case 174: YY_RULE_SETUP -#line 453 "program_lexer.l" +#line 457 "program_lexer.l" { return DOT; } YY_BREAK -case 172: -/* rule 172 can match eol */ +case 175: +/* rule 175 can match eol */ YY_RULE_SETUP -#line 455 "program_lexer.l" +#line 459 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2309,30 +2334,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 173: +case 176: YY_RULE_SETUP -#line 462 "program_lexer.l" +#line 466 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 174: +case 177: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 463 "program_lexer.l" +#line 467 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 175: +case 178: YY_RULE_SETUP -#line 464 "program_lexer.l" +#line 468 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 176: +case 179: YY_RULE_SETUP -#line 465 "program_lexer.l" +#line 469 "program_lexer.l" ECHO; YY_BREAK -#line 2336 "lex.yy.c" +#line 2361 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2626,7 +2651,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 645 ) + if ( yy_current_state >= 658 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2655,11 +2680,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 645 ) + if ( yy_current_state >= 658 ) 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 == 644); + yy_is_jam = (yy_current_state == 657); return yy_is_jam ? 0 : yy_current_state; } @@ -3507,7 +3532,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 465 "program_lexer.l" +#line 469 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index 2a5f0a8542..e4837ccb16 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -29,6 +29,7 @@ #define require_ARB_vp (yyextra->mode == ARB_vertex) #define require_ARB_fp (yyextra->mode == ARB_fragment) +#define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) #define return_token_or_IDENTIFIER(condition, token) \ @@ -295,6 +296,9 @@ texture { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_U 3D { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } CUBE { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } RECT { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } +SHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } +SHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } +SHADOWRECT { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } [_a-zA-Z$][_a-zA-Z0-9$]* { yylval->string = strdup(yytext); diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 37630863a8..3d8aa7707c 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -282,17 +282,20 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, TEX_3D = 340, TEX_CUBE = 341, TEX_RECT = 342, - VERTEX = 343, - VTXATTRIB = 344, - WEIGHT = 345, - IDENTIFIER = 346, - MASK4 = 347, - MASK3 = 348, - MASK2 = 349, - MASK1 = 350, - SWIZZLE = 351, - DOT_DOT = 352, - DOT = 353 + TEX_SHADOW1D = 343, + TEX_SHADOW2D = 344, + TEX_SHADOWRECT = 345, + VERTEX = 346, + VTXATTRIB = 347, + WEIGHT = 348, + IDENTIFIER = 349, + MASK4 = 350, + MASK3 = 351, + MASK2 = 352, + MASK1 = 353, + SWIZZLE = 354, + DOT_DOT = 355, + DOT = 356 }; #endif @@ -325,7 +328,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 329 "program_parse.tab.c" +#line 332 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -349,14 +352,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 240 "program_parse.y" +#line 241 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 360 "program_parse.tab.c" +#line 363 "program_parse.tab.c" #ifdef short # undef short @@ -573,20 +576,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 335 +#define YYLAST 334 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 108 +#define YYNTOKENS 111 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 133 /* YYNRULES -- Number of rules. */ -#define YYNRULES 255 +#define YYNRULES 258 /* YYNRULES -- Number of states. */ -#define YYNSTATES 424 +#define YYNSTATES 427 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 353 +#define YYMAXUTOK 356 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -598,15 +601,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 103, 100, 104, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 99, - 2, 105, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 106, 103, 107, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 102, + 2, 108, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 101, 2, 102, 2, 2, 2, 2, 2, 2, + 2, 104, 2, 105, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 106, 2, 107, 2, 2, 2, 2, + 2, 2, 2, 109, 2, 110, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -629,7 +632,7 @@ static const yytype_uint8 yytranslate[] = 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, 94, - 95, 96, 97, 98 + 95, 96, 97, 98, 99, 100, 101 }; #if YYDEBUG @@ -640,137 +643,138 @@ static const yytype_uint16 yyprhs[] = 0, 0, 3, 8, 10, 12, 15, 16, 20, 23, 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 57, 62, 67, 74, 81, 90, - 99, 102, 105, 107, 109, 111, 113, 115, 122, 126, - 130, 133, 136, 144, 147, 149, 151, 153, 155, 160, - 162, 164, 166, 168, 170, 172, 174, 178, 179, 182, - 185, 187, 189, 191, 193, 195, 197, 199, 201, 203, - 204, 206, 208, 210, 212, 213, 215, 217, 219, 221, - 223, 225, 230, 233, 236, 238, 241, 243, 246, 248, - 251, 256, 261, 263, 264, 268, 270, 272, 275, 277, - 280, 282, 284, 288, 295, 296, 298, 301, 306, 308, - 312, 314, 316, 318, 320, 322, 324, 326, 328, 330, - 332, 335, 338, 341, 344, 347, 350, 353, 356, 359, - 362, 365, 369, 371, 373, 375, 381, 383, 385, 387, - 390, 392, 394, 397, 399, 402, 409, 411, 415, 417, - 419, 421, 423, 425, 430, 432, 434, 436, 438, 440, - 442, 445, 447, 449, 455, 457, 460, 462, 464, 470, - 473, 474, 481, 485, 486, 488, 490, 492, 494, 496, - 499, 501, 503, 506, 511, 516, 517, 519, 521, 523, - 525, 527, 529, 531, 533, 539, 541, 545, 551, 557, - 559, 563, 569, 571, 573, 575, 577, 579, 581, 583, - 585, 587, 591, 597, 605, 615, 618, 621, 623, 625, - 626, 627, 631, 632, 636, 640, 642, 647, 650, 653, - 656, 659, 663, 666, 670, 671, 673, 675, 676, 678, - 680, 681, 683, 685, 686, 688, 690, 691, 695, 696, - 700, 701, 705, 707, 709, 711 + 99, 102, 105, 107, 109, 111, 113, 115, 117, 119, + 121, 128, 132, 136, 139, 142, 150, 153, 155, 157, + 159, 161, 166, 168, 170, 172, 174, 176, 178, 180, + 184, 185, 188, 191, 193, 195, 197, 199, 201, 203, + 205, 207, 209, 210, 212, 214, 216, 218, 219, 221, + 223, 225, 227, 229, 231, 236, 239, 242, 244, 247, + 249, 252, 254, 257, 262, 267, 269, 270, 274, 276, + 278, 281, 283, 286, 288, 290, 294, 301, 302, 304, + 307, 312, 314, 318, 320, 322, 324, 326, 328, 330, + 332, 334, 336, 338, 341, 344, 347, 350, 353, 356, + 359, 362, 365, 368, 371, 375, 377, 379, 381, 387, + 389, 391, 393, 396, 398, 400, 403, 405, 408, 415, + 417, 421, 423, 425, 427, 429, 431, 436, 438, 440, + 442, 444, 446, 448, 451, 453, 455, 461, 463, 466, + 468, 470, 476, 479, 480, 487, 491, 492, 494, 496, + 498, 500, 502, 505, 507, 509, 512, 517, 522, 523, + 525, 527, 529, 531, 533, 535, 537, 539, 545, 547, + 551, 557, 563, 565, 569, 575, 577, 579, 581, 583, + 585, 587, 589, 591, 593, 597, 603, 611, 621, 624, + 627, 629, 631, 632, 633, 637, 638, 642, 646, 648, + 653, 656, 659, 662, 665, 669, 672, 676, 677, 679, + 681, 682, 684, 686, 687, 689, 691, 692, 694, 696, + 697, 701, 702, 706, 707, 711, 713, 715, 717 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 109, 0, -1, 110, 111, 113, 12, -1, 3, -1, - 4, -1, 111, 112, -1, -1, 8, 91, 99, -1, - 113, 114, -1, -1, 115, 99, -1, 151, 99, -1, - 116, -1, 117, -1, 118, -1, 119, -1, 120, -1, - 121, -1, 122, -1, 123, -1, 128, -1, 124, -1, - 125, -1, 19, 132, 100, 129, -1, 18, 131, 100, - 130, -1, 16, 131, 100, 129, -1, 14, 131, 100, - 129, 100, 129, -1, 13, 131, 100, 130, 100, 130, - -1, 17, 131, 100, 130, 100, 130, 100, 130, -1, - 15, 131, 100, 130, 100, 126, 100, 127, -1, 20, - 130, -1, 82, 235, -1, 83, -1, 84, -1, 85, - -1, 86, -1, 87, -1, 21, 131, 100, 136, 100, - 133, -1, 221, 136, 148, -1, 221, 136, 149, -1, - 137, 150, -1, 145, 147, -1, 134, 100, 134, 100, - 134, 100, 134, -1, 221, 135, -1, 22, -1, 91, - -1, 91, -1, 153, -1, 138, 101, 139, 102, -1, - 167, -1, 228, -1, 91, -1, 91, -1, 140, -1, - 141, -1, 22, -1, 145, 146, 142, -1, -1, 103, - 143, -1, 104, 144, -1, 22, -1, 22, -1, 91, - -1, 95, -1, 95, -1, 95, -1, 95, -1, 92, - -1, 96, -1, -1, 92, -1, 93, -1, 94, -1, - 95, -1, -1, 152, -1, 159, -1, 222, -1, 224, - -1, 227, -1, 240, -1, 7, 91, 105, 153, -1, - 88, 154, -1, 37, 158, -1, 59, -1, 90, 156, - -1, 52, -1, 28, 233, -1, 36, -1, 73, 234, - -1, 49, 101, 157, 102, -1, 89, 101, 155, 102, - -1, 22, -1, -1, 101, 157, 102, -1, 22, -1, - 59, -1, 28, 233, -1, 36, -1, 73, 234, -1, - 160, -1, 161, -1, 10, 91, 163, -1, 10, 91, - 101, 162, 102, 164, -1, -1, 22, -1, 105, 166, - -1, 105, 106, 165, 107, -1, 168, -1, 165, 100, - 168, -1, 170, -1, 205, -1, 215, -1, 170, -1, - 205, -1, 216, -1, 169, -1, 206, -1, 215, -1, - 170, -1, 72, 194, -1, 72, 171, -1, 72, 173, - -1, 72, 176, -1, 72, 178, -1, 72, 184, -1, - 72, 180, -1, 72, 187, -1, 72, 189, -1, 72, - 191, -1, 72, 193, -1, 46, 232, 172, -1, 182, - -1, 32, -1, 68, -1, 42, 101, 183, 102, 174, - -1, 182, -1, 59, -1, 25, -1, 71, 175, -1, - 39, -1, 31, -1, 43, 177, -1, 24, -1, 232, - 66, -1, 44, 101, 183, 102, 232, 179, -1, 182, - -1, 74, 236, 181, -1, 28, -1, 24, -1, 30, - -1, 70, -1, 22, -1, 75, 234, 185, 186, -1, - 34, -1, 53, -1, 78, -1, 79, -1, 77, -1, - 76, -1, 35, 188, -1, 28, -1, 55, -1, 27, - 101, 190, 102, 56, -1, 22, -1, 57, 192, -1, - 69, -1, 25, -1, 196, 65, 101, 199, 102, -1, - 196, 195, -1, -1, 65, 101, 199, 97, 199, 102, - -1, 48, 200, 197, -1, -1, 198, -1, 40, -1, - 81, -1, 41, -1, 22, -1, 50, 201, -1, 62, - -1, 51, -1, 80, 234, -1, 54, 101, 203, 102, - -1, 47, 101, 204, 102, -1, -1, 202, -1, 22, - -1, 22, -1, 22, -1, 209, -1, 212, -1, 207, - -1, 210, -1, 61, 33, 101, 208, 102, -1, 213, - -1, 213, 97, 213, -1, 61, 33, 101, 213, 102, - -1, 61, 45, 101, 211, 102, -1, 214, -1, 214, - 97, 214, -1, 61, 45, 101, 214, 102, -1, 22, - -1, 22, -1, 217, -1, 219, -1, 218, -1, 219, - -1, 220, -1, 23, -1, 22, -1, 106, 220, 107, - -1, 106, 220, 100, 220, 107, -1, 106, 220, 100, - 220, 100, 220, 107, -1, 106, 220, 100, 220, 100, - 220, 100, 220, 107, -1, 221, 23, -1, 221, 22, - -1, 103, -1, 104, -1, -1, -1, 11, 223, 226, - -1, -1, 5, 225, 226, -1, 226, 100, 91, -1, - 91, -1, 9, 91, 105, 228, -1, 64, 59, -1, - 64, 36, -1, 64, 229, -1, 64, 58, -1, 64, - 73, 234, -1, 64, 29, -1, 28, 230, 231, -1, - -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, - -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, - -1, 101, 237, 102, -1, -1, 101, 238, 102, -1, - -1, 101, 239, 102, -1, 22, -1, 22, -1, 22, - -1, 6, 91, 105, 91, -1 + 112, 0, -1, 113, 114, 116, 12, -1, 3, -1, + 4, -1, 114, 115, -1, -1, 8, 94, 102, -1, + 116, 117, -1, -1, 118, 102, -1, 154, 102, -1, + 119, -1, 120, -1, 121, -1, 122, -1, 123, -1, + 124, -1, 125, -1, 126, -1, 131, -1, 127, -1, + 128, -1, 19, 135, 103, 132, -1, 18, 134, 103, + 133, -1, 16, 134, 103, 132, -1, 14, 134, 103, + 132, 103, 132, -1, 13, 134, 103, 133, 103, 133, + -1, 17, 134, 103, 133, 103, 133, 103, 133, -1, + 15, 134, 103, 133, 103, 129, 103, 130, -1, 20, + 133, -1, 82, 238, -1, 83, -1, 84, -1, 85, + -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, + -1, 21, 134, 103, 139, 103, 136, -1, 224, 139, + 151, -1, 224, 139, 152, -1, 140, 153, -1, 148, + 150, -1, 137, 103, 137, 103, 137, 103, 137, -1, + 224, 138, -1, 22, -1, 94, -1, 94, -1, 156, + -1, 141, 104, 142, 105, -1, 170, -1, 231, -1, + 94, -1, 94, -1, 143, -1, 144, -1, 22, -1, + 148, 149, 145, -1, -1, 106, 146, -1, 107, 147, + -1, 22, -1, 22, -1, 94, -1, 98, -1, 98, + -1, 98, -1, 98, -1, 95, -1, 99, -1, -1, + 95, -1, 96, -1, 97, -1, 98, -1, -1, 155, + -1, 162, -1, 225, -1, 227, -1, 230, -1, 243, + -1, 7, 94, 108, 156, -1, 91, 157, -1, 37, + 161, -1, 59, -1, 93, 159, -1, 52, -1, 28, + 236, -1, 36, -1, 73, 237, -1, 49, 104, 160, + 105, -1, 92, 104, 158, 105, -1, 22, -1, -1, + 104, 160, 105, -1, 22, -1, 59, -1, 28, 236, + -1, 36, -1, 73, 237, -1, 163, -1, 164, -1, + 10, 94, 166, -1, 10, 94, 104, 165, 105, 167, + -1, -1, 22, -1, 108, 169, -1, 108, 109, 168, + 110, -1, 171, -1, 168, 103, 171, -1, 173, -1, + 208, -1, 218, -1, 173, -1, 208, -1, 219, -1, + 172, -1, 209, -1, 218, -1, 173, -1, 72, 197, + -1, 72, 174, -1, 72, 176, -1, 72, 179, -1, + 72, 181, -1, 72, 187, -1, 72, 183, -1, 72, + 190, -1, 72, 192, -1, 72, 194, -1, 72, 196, + -1, 46, 235, 175, -1, 185, -1, 32, -1, 68, + -1, 42, 104, 186, 105, 177, -1, 185, -1, 59, + -1, 25, -1, 71, 178, -1, 39, -1, 31, -1, + 43, 180, -1, 24, -1, 235, 66, -1, 44, 104, + 186, 105, 235, 182, -1, 185, -1, 74, 239, 184, + -1, 28, -1, 24, -1, 30, -1, 70, -1, 22, + -1, 75, 237, 188, 189, -1, 34, -1, 53, -1, + 78, -1, 79, -1, 77, -1, 76, -1, 35, 191, + -1, 28, -1, 55, -1, 27, 104, 193, 105, 56, + -1, 22, -1, 57, 195, -1, 69, -1, 25, -1, + 199, 65, 104, 202, 105, -1, 199, 198, -1, -1, + 65, 104, 202, 100, 202, 105, -1, 48, 203, 200, + -1, -1, 201, -1, 40, -1, 81, -1, 41, -1, + 22, -1, 50, 204, -1, 62, -1, 51, -1, 80, + 237, -1, 54, 104, 206, 105, -1, 47, 104, 207, + 105, -1, -1, 205, -1, 22, -1, 22, -1, 22, + -1, 212, -1, 215, -1, 210, -1, 213, -1, 61, + 33, 104, 211, 105, -1, 216, -1, 216, 100, 216, + -1, 61, 33, 104, 216, 105, -1, 61, 45, 104, + 214, 105, -1, 217, -1, 217, 100, 217, -1, 61, + 45, 104, 217, 105, -1, 22, -1, 22, -1, 220, + -1, 222, -1, 221, -1, 222, -1, 223, -1, 23, + -1, 22, -1, 109, 223, 110, -1, 109, 223, 103, + 223, 110, -1, 109, 223, 103, 223, 103, 223, 110, + -1, 109, 223, 103, 223, 103, 223, 103, 223, 110, + -1, 224, 23, -1, 224, 22, -1, 106, -1, 107, + -1, -1, -1, 11, 226, 229, -1, -1, 5, 228, + 229, -1, 229, 103, 94, -1, 94, -1, 9, 94, + 108, 231, -1, 64, 59, -1, 64, 36, -1, 64, + 232, -1, 64, 58, -1, 64, 73, 237, -1, 64, + 29, -1, 28, 233, 234, -1, -1, 38, -1, 26, + -1, -1, 60, -1, 67, -1, -1, 38, -1, 26, + -1, -1, 60, -1, 67, -1, -1, 104, 240, 105, + -1, -1, 104, 241, 105, -1, -1, 104, 242, 105, + -1, 22, -1, 22, -1, 22, -1, 6, 94, 108, + 94, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 247, 247, 250, 258, 270, 271, 274, 292, 293, - 296, 311, 314, 319, 326, 327, 328, 329, 330, 331, - 332, 335, 336, 339, 345, 352, 359, 367, 374, 382, - 395, 402, 408, 409, 410, 411, 412, 415, 427, 440, - 453, 475, 484, 493, 500, 509, 537, 579, 590, 611, - 621, 627, 651, 668, 668, 670, 677, 689, 690, 691, - 694, 706, 718, 736, 747, 759, 761, 762, 763, 764, - 767, 767, 767, 767, 768, 771, 772, 773, 774, 775, - 776, 779, 797, 801, 807, 811, 815, 819, 828, 837, - 841, 846, 852, 863, 863, 864, 866, 870, 874, 878, - 884, 884, 886, 902, 925, 928, 939, 945, 951, 952, - 959, 965, 971, 979, 985, 991, 999, 1005, 1011, 1019, - 1020, 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, - 1032, 1035, 1044, 1048, 1052, 1058, 1067, 1071, 1075, 1084, - 1088, 1094, 1100, 1107, 1112, 1120, 1130, 1132, 1140, 1146, - 1150, 1154, 1160, 1171, 1180, 1184, 1189, 1193, 1197, 1201, - 1207, 1214, 1218, 1224, 1232, 1243, 1250, 1254, 1260, 1270, - 1281, 1285, 1303, 1312, 1315, 1321, 1325, 1329, 1335, 1346, - 1351, 1356, 1361, 1366, 1371, 1379, 1382, 1387, 1400, 1408, - 1421, 1421, 1423, 1423, 1425, 1435, 1440, 1447, 1457, 1466, - 1471, 1478, 1488, 1498, 1510, 1510, 1511, 1511, 1513, 1520, - 1525, 1532, 1540, 1548, 1557, 1568, 1572, 1578, 1579, 1580, - 1583, 1583, 1586, 1586, 1589, 1595, 1603, 1616, 1625, 1634, - 1638, 1647, 1656, 1667, 1674, 1679, 1688, 1700, 1703, 1712, - 1723, 1724, 1725, 1728, 1729, 1730, 1733, 1734, 1737, 1738, - 1741, 1742, 1745, 1756, 1767, 1778 + 0, 248, 248, 251, 259, 271, 272, 275, 293, 294, + 297, 312, 315, 320, 327, 328, 329, 330, 331, 332, + 333, 336, 337, 340, 346, 353, 360, 368, 375, 383, + 428, 435, 441, 442, 443, 444, 445, 446, 447, 448, + 451, 463, 476, 489, 511, 520, 529, 536, 545, 573, + 615, 626, 647, 657, 663, 687, 704, 704, 706, 713, + 725, 726, 727, 730, 742, 754, 772, 783, 795, 797, + 798, 799, 800, 803, 803, 803, 803, 804, 807, 808, + 809, 810, 811, 812, 815, 833, 837, 843, 847, 851, + 855, 864, 873, 877, 882, 888, 899, 899, 900, 902, + 906, 910, 914, 920, 920, 922, 938, 961, 964, 975, + 981, 987, 988, 995, 1001, 1007, 1015, 1021, 1027, 1035, + 1041, 1047, 1055, 1056, 1059, 1060, 1061, 1062, 1063, 1064, + 1065, 1066, 1067, 1068, 1071, 1080, 1084, 1088, 1094, 1103, + 1107, 1111, 1120, 1124, 1130, 1136, 1143, 1148, 1156, 1166, + 1168, 1176, 1182, 1186, 1190, 1196, 1207, 1216, 1220, 1225, + 1229, 1233, 1237, 1243, 1250, 1254, 1260, 1268, 1279, 1286, + 1290, 1296, 1306, 1317, 1321, 1339, 1348, 1351, 1357, 1361, + 1365, 1371, 1382, 1387, 1392, 1397, 1402, 1407, 1415, 1418, + 1423, 1436, 1444, 1457, 1457, 1459, 1459, 1461, 1471, 1476, + 1483, 1493, 1502, 1507, 1514, 1524, 1534, 1546, 1546, 1547, + 1547, 1549, 1556, 1561, 1568, 1576, 1584, 1593, 1604, 1608, + 1614, 1615, 1616, 1619, 1619, 1622, 1622, 1625, 1631, 1639, + 1652, 1661, 1670, 1674, 1683, 1692, 1703, 1710, 1715, 1724, + 1736, 1739, 1748, 1759, 1760, 1761, 1764, 1765, 1766, 1769, + 1770, 1773, 1774, 1777, 1778, 1781, 1792, 1803, 1814 }; #endif @@ -792,10 +796,11 @@ static const char *const yytname[] = "SCENECOLOR", "SECONDARY", "SHININESS", "SIZE", "SPECULAR", "SPOT", "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R", "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D", - "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "VERTEX", "VTXATTRIB", - "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", - "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", - "'}'", "$accept", "program", "language", "optionSequence", "option", + "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D", + "TEX_SHADOW2D", "TEX_SHADOWRECT", "VERTEX", "VTXATTRIB", "WEIGHT", + "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", "DOT_DOT", + "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", "'}'", + "$accept", "program", "language", "optionSequence", "option", "statementSequence", "statement", "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction", "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", @@ -852,40 +857,41 @@ static const yytype_uint16 yytoknum[] = 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, 349, 350, 351, 352, 353, 59, - 44, 91, 93, 43, 45, 61, 123, 125 + 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, + 355, 356, 59, 44, 91, 93, 43, 45, 61, 123, + 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 108, 109, 110, 110, 111, 111, 112, 113, 113, - 114, 114, 115, 115, 116, 116, 116, 116, 116, 116, - 116, 117, 117, 118, 119, 120, 121, 122, 123, 124, - 125, 126, 127, 127, 127, 127, 127, 128, 129, 130, - 131, 132, 133, 134, 135, 135, 136, 136, 136, 136, - 137, 137, 138, 139, 139, 140, 141, 142, 142, 142, - 143, 144, 145, 146, 147, 148, 149, 149, 149, 149, - 150, 150, 150, 150, 150, 151, 151, 151, 151, 151, - 151, 152, 153, 153, 154, 154, 154, 154, 154, 154, - 154, 154, 155, 156, 156, 157, 158, 158, 158, 158, - 159, 159, 160, 161, 162, 162, 163, 164, 165, 165, - 166, 166, 166, 167, 167, 167, 168, 168, 168, 169, - 169, 170, 170, 170, 170, 170, 170, 170, 170, 170, - 170, 171, 172, 172, 172, 173, 174, 174, 174, 174, - 174, 175, 176, 177, 177, 178, 179, 180, 181, 182, - 182, 182, 183, 184, 185, 185, 186, 186, 186, 186, - 187, 188, 188, 189, 190, 191, 192, 192, 193, 194, - 195, 195, 196, 197, 197, 198, 198, 198, 199, 200, - 200, 200, 200, 200, 200, 201, 201, 202, 203, 204, - 205, 205, 206, 206, 207, 208, 208, 209, 210, 211, - 211, 212, 213, 214, 215, 215, 216, 216, 217, 218, - 218, 219, 219, 219, 219, 220, 220, 221, 221, 221, - 223, 222, 225, 224, 226, 226, 227, 228, 228, 228, - 228, 228, 228, 229, 230, 230, 230, 231, 231, 231, - 232, 232, 232, 233, 233, 233, 234, 234, 235, 235, - 236, 236, 237, 238, 239, 240 + 0, 111, 112, 113, 113, 114, 114, 115, 116, 116, + 117, 117, 118, 118, 119, 119, 119, 119, 119, 119, + 119, 120, 120, 121, 122, 123, 124, 125, 126, 127, + 128, 129, 130, 130, 130, 130, 130, 130, 130, 130, + 131, 132, 133, 134, 135, 136, 137, 138, 138, 139, + 139, 139, 139, 140, 140, 141, 142, 142, 143, 144, + 145, 145, 145, 146, 147, 148, 149, 150, 151, 152, + 152, 152, 152, 153, 153, 153, 153, 153, 154, 154, + 154, 154, 154, 154, 155, 156, 156, 157, 157, 157, + 157, 157, 157, 157, 157, 158, 159, 159, 160, 161, + 161, 161, 161, 162, 162, 163, 164, 165, 165, 166, + 167, 168, 168, 169, 169, 169, 170, 170, 170, 171, + 171, 171, 172, 172, 173, 173, 173, 173, 173, 173, + 173, 173, 173, 173, 174, 175, 175, 175, 176, 177, + 177, 177, 177, 177, 178, 179, 180, 180, 181, 182, + 183, 184, 185, 185, 185, 186, 187, 188, 188, 189, + 189, 189, 189, 190, 191, 191, 192, 193, 194, 195, + 195, 196, 197, 198, 198, 199, 200, 200, 201, 201, + 201, 202, 203, 203, 203, 203, 203, 203, 204, 204, + 205, 206, 207, 208, 208, 209, 209, 210, 211, 211, + 212, 213, 214, 214, 215, 216, 217, 218, 218, 219, + 219, 220, 221, 221, 222, 222, 222, 222, 223, 223, + 224, 224, 224, 226, 225, 228, 227, 229, 229, 230, + 231, 231, 231, 231, 231, 231, 232, 233, 233, 233, + 234, 234, 234, 235, 235, 235, 236, 236, 236, 237, + 237, 238, 238, 239, 239, 240, 241, 242, 243 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -894,95 +900,95 @@ static const yytype_uint8 yyr2[] = 0, 2, 4, 1, 1, 2, 0, 3, 2, 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, - 2, 2, 1, 1, 1, 1, 1, 6, 3, 3, - 2, 2, 7, 2, 1, 1, 1, 1, 4, 1, - 1, 1, 1, 1, 1, 1, 3, 0, 2, 2, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, - 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, - 1, 4, 2, 2, 1, 2, 1, 2, 1, 2, - 4, 4, 1, 0, 3, 1, 1, 2, 1, 2, - 1, 1, 3, 6, 0, 1, 2, 4, 1, 3, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 3, 1, 1, 1, 5, 1, 1, 1, 2, - 1, 1, 2, 1, 2, 6, 1, 3, 1, 1, - 1, 1, 1, 4, 1, 1, 1, 1, 1, 1, - 2, 1, 1, 5, 1, 2, 1, 1, 5, 2, - 0, 6, 3, 0, 1, 1, 1, 1, 1, 2, - 1, 1, 2, 4, 4, 0, 1, 1, 1, 1, - 1, 1, 1, 1, 5, 1, 3, 5, 5, 1, - 3, 5, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 3, 5, 7, 9, 2, 2, 1, 1, 0, - 0, 3, 0, 3, 3, 1, 4, 2, 2, 2, - 2, 3, 2, 3, 0, 1, 1, 0, 1, 1, - 0, 1, 1, 0, 1, 1, 0, 3, 0, 3, - 0, 3, 1, 1, 1, 4 + 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, + 6, 3, 3, 2, 2, 7, 2, 1, 1, 1, + 1, 4, 1, 1, 1, 1, 1, 1, 1, 3, + 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, + 1, 1, 1, 1, 4, 2, 2, 1, 2, 1, + 2, 1, 2, 4, 4, 1, 0, 3, 1, 1, + 2, 1, 2, 1, 1, 3, 6, 0, 1, 2, + 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 3, 1, 1, 1, 5, 1, + 1, 1, 2, 1, 1, 2, 1, 2, 6, 1, + 3, 1, 1, 1, 1, 1, 4, 1, 1, 1, + 1, 1, 1, 2, 1, 1, 5, 1, 2, 1, + 1, 5, 2, 0, 6, 3, 0, 1, 1, 1, + 1, 1, 2, 1, 1, 2, 4, 4, 0, 1, + 1, 1, 1, 1, 1, 1, 1, 5, 1, 3, + 5, 5, 1, 3, 5, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 3, 5, 7, 9, 2, 2, + 1, 1, 0, 0, 3, 0, 3, 3, 1, 4, + 2, 2, 2, 2, 3, 2, 3, 0, 1, 1, + 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, + 3, 0, 3, 0, 3, 1, 1, 1, 4 }; /* 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[] = +static const yytype_uint16 yydefact[] = { 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 222, 0, 0, 0, 0, 220, 2, 0, 0, - 0, 0, 0, 0, 0, 219, 0, 8, 0, 12, + 0, 225, 0, 0, 0, 0, 223, 2, 0, 0, + 0, 0, 0, 0, 0, 222, 0, 8, 0, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, - 0, 75, 76, 100, 101, 77, 78, 79, 80, 7, - 0, 0, 0, 0, 0, 0, 0, 51, 0, 74, - 50, 0, 0, 0, 0, 0, 62, 0, 0, 217, - 218, 30, 0, 0, 10, 11, 225, 223, 0, 0, - 0, 104, 219, 102, 221, 234, 232, 228, 230, 227, - 246, 229, 219, 70, 71, 72, 73, 40, 219, 219, - 219, 219, 219, 219, 64, 41, 210, 209, 0, 0, - 0, 0, 46, 219, 69, 0, 47, 49, 113, 114, - 190, 191, 115, 206, 207, 0, 0, 255, 81, 226, - 105, 0, 106, 110, 111, 112, 204, 205, 208, 0, - 236, 235, 237, 0, 231, 0, 0, 0, 0, 25, - 0, 24, 23, 243, 98, 96, 246, 83, 0, 0, - 0, 0, 0, 240, 0, 240, 0, 0, 250, 246, - 121, 122, 123, 124, 126, 125, 127, 128, 129, 130, - 0, 243, 88, 0, 86, 84, 246, 0, 93, 82, - 0, 67, 66, 68, 39, 0, 0, 224, 0, 216, - 215, 238, 239, 233, 252, 0, 219, 219, 0, 0, - 219, 244, 245, 97, 99, 0, 0, 0, 161, 162, - 160, 0, 143, 242, 241, 142, 0, 0, 0, 0, - 185, 181, 0, 180, 246, 173, 167, 166, 165, 0, - 0, 0, 0, 87, 0, 89, 0, 0, 85, 219, - 211, 55, 0, 53, 54, 0, 219, 0, 103, 247, - 27, 26, 65, 38, 248, 0, 0, 202, 0, 203, - 0, 164, 0, 152, 0, 144, 0, 149, 150, 133, - 134, 151, 131, 132, 0, 187, 179, 186, 0, 182, - 175, 177, 176, 172, 174, 254, 0, 148, 147, 154, - 155, 0, 0, 95, 0, 92, 0, 0, 0, 48, - 63, 57, 37, 0, 0, 219, 0, 31, 0, 219, - 197, 201, 0, 0, 240, 189, 0, 188, 0, 251, - 159, 158, 156, 157, 153, 178, 0, 90, 91, 94, - 219, 212, 0, 0, 56, 219, 44, 45, 43, 0, - 0, 0, 108, 116, 119, 117, 192, 193, 118, 253, - 0, 32, 33, 34, 35, 36, 29, 28, 163, 138, - 140, 137, 0, 135, 136, 0, 184, 183, 168, 0, - 60, 58, 61, 59, 0, 0, 0, 120, 170, 219, - 107, 249, 141, 139, 145, 146, 219, 213, 219, 0, - 0, 0, 169, 109, 0, 0, 0, 195, 0, 199, - 0, 214, 219, 194, 0, 198, 0, 0, 42, 196, - 200, 0, 0, 171 + 0, 78, 79, 103, 104, 80, 81, 82, 83, 7, + 0, 0, 0, 0, 0, 0, 0, 54, 0, 77, + 53, 0, 0, 0, 0, 0, 65, 0, 0, 220, + 221, 30, 0, 0, 10, 11, 228, 226, 0, 0, + 0, 107, 222, 105, 224, 237, 235, 231, 233, 230, + 249, 232, 222, 73, 74, 75, 76, 43, 222, 222, + 222, 222, 222, 222, 67, 44, 213, 212, 0, 0, + 0, 0, 49, 222, 72, 0, 50, 52, 116, 117, + 193, 194, 118, 209, 210, 0, 0, 258, 84, 229, + 108, 0, 109, 113, 114, 115, 207, 208, 211, 0, + 239, 238, 240, 0, 234, 0, 0, 0, 0, 25, + 0, 24, 23, 246, 101, 99, 249, 86, 0, 0, + 0, 0, 0, 243, 0, 243, 0, 0, 253, 249, + 124, 125, 126, 127, 129, 128, 130, 131, 132, 133, + 0, 246, 91, 0, 89, 87, 249, 0, 96, 85, + 0, 70, 69, 71, 42, 0, 0, 227, 0, 219, + 218, 241, 242, 236, 255, 0, 222, 222, 0, 0, + 222, 247, 248, 100, 102, 0, 0, 0, 164, 165, + 163, 0, 146, 245, 244, 145, 0, 0, 0, 0, + 188, 184, 0, 183, 249, 176, 170, 169, 168, 0, + 0, 0, 0, 90, 0, 92, 0, 0, 88, 222, + 214, 58, 0, 56, 57, 0, 222, 0, 106, 250, + 27, 26, 68, 41, 251, 0, 0, 205, 0, 206, + 0, 167, 0, 155, 0, 147, 0, 152, 153, 136, + 137, 154, 134, 135, 0, 190, 182, 189, 0, 185, + 178, 180, 179, 175, 177, 257, 0, 151, 150, 157, + 158, 0, 0, 98, 0, 95, 0, 0, 0, 51, + 66, 60, 40, 0, 0, 222, 0, 31, 0, 222, + 200, 204, 0, 0, 243, 192, 0, 191, 0, 254, + 162, 161, 159, 160, 156, 181, 0, 93, 94, 97, + 222, 215, 0, 0, 59, 222, 47, 48, 46, 0, + 0, 0, 111, 119, 122, 120, 195, 196, 121, 256, + 0, 32, 33, 34, 35, 36, 37, 38, 39, 29, + 28, 166, 141, 143, 140, 0, 138, 139, 0, 187, + 186, 171, 0, 63, 61, 64, 62, 0, 0, 0, + 123, 173, 222, 110, 252, 144, 142, 148, 149, 222, + 216, 222, 0, 0, 0, 172, 112, 0, 0, 0, + 198, 0, 202, 0, 217, 222, 197, 0, 201, 0, + 0, 45, 199, 203, 0, 0, 174 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 265, 366, + 31, 32, 33, 34, 35, 36, 37, 38, 265, 369, 39, 146, 71, 58, 67, 312, 313, 348, 114, 59, - 115, 252, 253, 254, 344, 381, 383, 68, 311, 105, + 115, 252, 253, 254, 344, 384, 386, 68, 311, 105, 263, 194, 97, 40, 41, 116, 189, 306, 248, 304, 157, 42, 43, 44, 131, 83, 258, 351, 132, 117, - 352, 353, 118, 170, 282, 171, 373, 393, 172, 225, - 173, 394, 174, 298, 283, 274, 175, 301, 334, 176, - 220, 177, 272, 178, 238, 179, 387, 402, 180, 293, + 352, 353, 118, 170, 282, 171, 376, 396, 172, 225, + 173, 397, 174, 298, 283, 274, 175, 301, 334, 176, + 220, 177, 272, 178, 238, 179, 390, 405, 180, 293, 294, 336, 235, 286, 287, 328, 326, 119, 355, 356, - 406, 120, 357, 408, 121, 268, 270, 358, 122, 136, + 409, 120, 357, 411, 121, 268, 270, 358, 122, 136, 123, 124, 138, 72, 45, 55, 46, 50, 77, 47, 60, 91, 142, 203, 226, 213, 144, 317, 240, 205, 360, 296, 48 @@ -990,201 +996,201 @@ static const yytype_int16 yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -371 +#define YYPACT_NINF -374 static const yytype_int16 yypact[] = { - 159, -371, -371, 34, -371, -371, 66, 11, -371, 140, - -22, -371, 25, 37, 51, 53, -371, -371, -28, -28, - -28, -28, -28, -28, 74, 102, -28, -371, 80, -371, - -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, - 82, -371, -371, -371, -371, -371, -371, -371, -371, -371, - 120, -6, 107, 108, 91, 120, 61, -371, 93, 105, - -371, 114, 115, 116, 117, 118, -371, 119, 87, -371, - -371, -371, -15, 121, -371, -371, -371, 122, 129, -17, - 160, 201, -3, -371, 122, 21, -371, -371, -371, -371, - 124, -371, 102, -371, -371, -371, -371, -371, 102, 102, - 102, 102, 102, 102, -371, -371, -371, -371, 68, 72, - 8, -11, 126, 102, 99, 127, -371, -371, -371, -371, - -371, -371, -371, -371, -371, -15, 135, -371, -371, -371, - -371, 130, -371, -371, -371, -371, -371, -371, -371, 185, - -371, -371, 48, 207, -371, 136, 137, -15, 138, -371, - 139, -371, -371, 64, -371, -371, 124, -371, 141, 142, - 143, 9, 144, 88, 145, 83, 86, 24, 146, 124, - -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, - 175, 64, -371, 147, -371, -371, 124, 148, 150, -371, - 73, -371, -371, -371, -371, -10, 152, -371, 151, -371, - -371, -371, -371, -371, -371, 153, 102, 102, 155, 171, - 102, -371, -371, -371, -371, 219, 232, 235, -371, -371, - -371, 237, -371, -371, -371, -371, 194, 237, 0, 161, - 239, -371, 163, -371, 124, -14, -371, -371, -371, 243, - 238, 58, 166, -371, 246, -371, 247, 246, -371, 102, - -371, -371, 168, -371, -371, 176, 102, 167, -371, -371, - -371, -371, -371, -371, 173, 172, 177, -371, 174, -371, - 178, -371, 179, -371, 180, -371, 181, -371, -371, -371, - -371, -371, -371, -371, 253, -371, -371, -371, 256, -371, - -371, -371, -371, -371, -371, -371, 182, -371, -371, -371, - -371, 125, 257, -371, 183, -371, 186, 187, 76, -371, - -371, 106, -371, 190, -7, 26, 265, -371, 103, 102, - -371, -371, 236, 36, 83, -371, 189, -371, 191, -371, - -371, -371, -371, -371, -371, -371, 192, -371, -371, -371, - 102, -371, 273, 274, -371, 102, -371, -371, -371, 90, - 8, 77, -371, -371, -371, -371, -371, -371, -371, -371, - 195, -371, -371, -371, -371, -371, -371, -371, -371, -371, - -371, -371, 267, -371, -371, 15, -371, -371, -371, 78, - -371, -371, -371, -371, 199, 200, 202, -371, 240, 26, - -371, -371, -371, -371, -371, -371, 102, -371, 102, 219, - 232, 203, -371, -371, 193, 206, 208, 205, 209, 215, - 257, -371, 102, -371, 219, -371, 232, 41, -371, -371, - -371, 257, 211, -371 + 154, -374, -374, 33, -374, -374, 35, -31, -374, 166, + 27, -374, 55, 66, 72, 96, -374, -374, -34, -34, + -34, -34, -34, -34, 115, 87, -34, -374, 108, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + 109, -374, -374, -374, -374, -374, -374, -374, -374, -374, + 118, 105, 106, 107, -5, 118, 92, -374, 113, 102, + -374, 114, 116, 117, 119, 120, -374, 121, 97, -374, + -374, -374, -15, 122, -374, -374, -374, 123, 124, -17, + 157, 205, -16, -374, 123, 13, -374, -374, -374, -374, + 128, -374, 87, -374, -374, -374, -374, -374, 87, 87, + 87, 87, 87, 87, -374, -374, -374, -374, 19, 40, + 23, -11, 132, 87, 93, 134, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -15, 135, -374, -374, -374, + -374, 136, -374, -374, -374, -374, -374, -374, -374, 183, + -374, -374, 57, 206, -374, 137, 139, -15, 140, -374, + 141, -374, -374, 80, -374, -374, 128, -374, 142, 143, + 144, 6, 145, 85, 146, 26, 65, -1, 147, 128, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + 172, 80, -374, 148, -374, -374, 128, 149, 150, -374, + 58, -374, -374, -374, -374, -10, 152, -374, 131, -374, + -374, -374, -374, -374, -374, 151, 87, 87, 159, 163, + 87, -374, -374, -374, -374, 237, 238, 239, -374, -374, + -374, 240, -374, -374, -374, -374, 198, 240, 76, 161, + 244, -374, 164, -374, 128, -4, -374, -374, -374, 245, + 241, 1, 167, -374, 248, -374, 250, 248, -374, 87, + -374, -374, 168, -374, -374, 176, 87, 169, -374, -374, + -374, -374, -374, -374, 171, 173, 174, -374, 175, -374, + 177, -374, 178, -374, 179, -374, 180, -374, -374, -374, + -374, -374, -374, -374, 257, -374, -374, -374, 259, -374, + -374, -374, -374, -374, -374, -374, 181, -374, -374, -374, + -374, 125, 265, -374, 185, -374, 186, 187, 59, -374, + -374, 101, -374, 190, -7, -2, 266, -374, 48, 87, + -374, -374, 242, 71, 26, -374, 189, -374, 191, -374, + -374, -374, -374, -374, -374, -374, 192, -374, -374, -374, + 87, -374, 273, 277, -374, 87, -374, -374, -374, 81, + 23, 60, -374, -374, -374, -374, -374, -374, -374, -374, + 195, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, 270, -374, -374, 2, -374, + -374, -374, 86, -374, -374, -374, -374, 199, 200, 201, + -374, 243, -2, -374, -374, -374, -374, -374, -374, 87, + -374, 87, 237, 238, 202, -374, -374, 193, 204, 208, + 209, 210, 214, 265, -374, 87, -374, 237, -374, 238, + 43, -374, -374, -374, 265, 211, -374 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, - -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, - -371, -94, -88, 149, -371, -371, -326, -371, -92, -371, - -371, -371, -371, -371, -371, -371, -371, 123, -371, -371, - -371, -371, -371, -371, -371, 241, -371, -371, -371, 70, - -371, -371, -371, -371, -371, -371, -371, -371, -371, -371, - -74, -371, -81, -371, -371, -371, -371, -371, -371, -371, - -371, -371, -371, -371, -295, 92, -371, -371, -371, -371, - -371, -371, -371, -371, -371, -371, -371, -371, -29, -371, - -371, -368, -371, -371, -371, -371, -371, 242, -371, -371, - -371, -371, -371, -371, -371, -370, -306, 244, -371, -371, - -371, -80, -110, -82, -371, -371, -371, -371, 268, -371, - 245, -371, -371, -371, -160, 154, -146, -371, -371, -371, - -371, -371, -371 + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -374, -94, -88, 133, -374, -374, -326, -374, -98, -374, + -374, -374, -374, -374, -374, -374, -374, 126, -374, -374, + -374, -374, -374, -374, -374, 246, -374, -374, -374, 73, + -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, + -74, -374, -81, -374, -374, -374, -374, -374, -374, -374, + -374, -374, -374, -374, -295, 95, -374, -374, -374, -374, + -374, -374, -374, -374, -374, -374, -374, -374, -27, -374, + -374, -371, -374, -374, -374, -374, -374, 247, -374, -374, + -374, -374, -374, -374, -374, -373, -317, 249, -374, -374, + -374, -80, -110, -82, -374, -374, -374, -374, 269, -374, + 252, -374, -374, -374, -160, 153, -146, -374, -374, -374, + -374, -374, -374 }; /* 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 -53 +#define YYTABLE_NINF -56 static const yytype_int16 yytable[] = { 139, 133, 137, 190, 145, 228, 149, 106, 107, 152, - 214, 148, 251, 150, 151, 346, 147, 181, 147, 384, - 108, 147, 108, 241, 277, 182, 290, 291, 374, 407, - 278, 139, 279, 196, 5, 160, 56, 218, 183, 277, - 245, 184, 417, 161, 419, 278, 109, 140, 185, 236, - 162, 163, 164, 422, 165, 208, 166, 110, 109, 141, - 277, 369, 186, 57, 219, 167, 278, 292, 280, 110, - 281, 111, 405, 111, 7, 370, 112, 49, 187, 188, - 395, 66, 168, 169, 347, 281, 418, 349, 289, 85, - 86, 113, 299, 237, 409, 371, 153, 87, 350, 78, - 69, 70, 10, 113, 154, 158, 281, 372, 201, 223, - 420, 300, 222, 261, 223, 202, 51, 159, 260, 88, - 89, 224, 266, 385, 211, 147, 224, 155, 52, 69, - 70, 212, 113, 229, 90, 386, 230, 231, 421, 308, - 232, 156, 53, 378, 54, 11, 12, 13, 233, 14, - 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, - 25, 26, 1, 2, 375, 66, 234, 139, 61, 62, - 63, 64, 65, 249, 314, 73, 340, 389, 396, 74, - 250, 75, 104, 341, 390, 397, 361, 362, 363, 364, - 365, 191, 81, 92, 192, 193, 82, 93, 94, 95, - 96, 330, 331, 332, 333, 69, 70, 199, 200, 342, - 343, 76, 79, 80, 98, 99, 100, 101, 102, 103, - 127, 125, 126, 130, 56, 143, 197, -52, 195, 204, - 379, 367, 198, 139, 354, 137, 206, 207, 209, 210, - 242, 267, 215, 216, 217, 221, 227, 239, 244, 246, - 262, 247, 256, 264, 269, 259, 257, 271, 139, 273, - 275, 285, 284, 314, 288, 295, 297, 302, 303, 305, - 309, 310, 318, 315, 316, 325, 320, 319, 327, 335, - 321, 322, 323, 324, 329, 337, 404, 359, 338, 339, - 345, 376, 368, 377, 378, 380, 382, 391, 392, 398, - 411, 399, 414, 400, 410, 401, 412, 139, 354, 137, - 413, 415, 416, 423, 139, 403, 314, 307, 255, 276, - 128, 388, 0, 84, 134, 129, 135, 0, 0, 0, - 314, 0, 0, 0, 0, 243 + 214, 148, 251, 150, 151, 346, 147, 181, 147, 387, + 108, 147, 108, 241, 236, 182, 277, 196, 377, 410, + 56, 139, 278, 5, 218, 299, 290, 291, 183, 140, + 245, 184, 420, 7, 422, 109, 109, 153, 185, 208, + 160, 141, 223, 425, 300, 154, 110, 110, 161, 349, + 57, 219, 186, 10, 224, 162, 163, 164, 237, 165, + 350, 166, 281, 158, 111, 408, 111, 292, 155, 112, + 167, 187, 188, 398, 66, 159, 412, 347, 289, 421, + 69, 70, 156, 113, 113, 277, 372, 168, 169, 81, + 277, 278, 423, 82, 69, 70, 278, 113, 279, 222, + 373, 223, 229, 261, 388, 230, 231, 201, 260, 232, + 85, 86, 266, 224, 202, 147, 389, 233, 87, 49, + 374, 361, 362, 363, 364, 365, 366, 367, 368, 308, + 211, 281, 375, 424, 280, 234, 281, 212, 381, 51, + 88, 89, 61, 62, 63, 64, 65, 1, 2, 73, + 52, 249, 340, 392, 378, 90, 53, 139, 250, 341, + 393, 11, 12, 13, 314, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 191, 399, + 54, 192, 193, 69, 70, 104, 400, 93, 94, 95, + 96, 330, 331, 332, 333, 199, 200, 342, 343, 66, + 74, 75, 76, 78, 79, 80, 92, 98, 127, 99, + 100, 56, 101, 102, 103, 125, 126, 130, 204, 197, + 382, 370, 143, 139, 354, 137, -55, 242, 195, 257, + 206, 198, 207, 209, 210, 264, 215, 216, 217, 221, + 227, 239, 244, 246, 247, 256, 259, 262, 139, 267, + 269, 271, 273, 314, 275, 284, 285, 295, 288, 297, + 303, 302, 305, 309, 310, 316, 318, 319, 315, 325, + 320, 327, 321, 322, 323, 324, 329, 335, 359, 407, + 337, 338, 339, 345, 379, 383, 380, 381, 371, 385, + 394, 395, 401, 414, 402, 403, 413, 415, 404, 417, + 139, 354, 137, 416, 419, 418, 426, 139, 406, 314, + 307, 255, 276, 391, 84, 128, 0, 0, 0, 134, + 0, 135, 129, 314, 243 }; static const yytype_int16 yycheck[] = { 82, 82, 82, 113, 92, 165, 100, 22, 23, 103, 156, 99, 22, 101, 102, 22, 98, 28, 100, 345, - 37, 103, 37, 169, 24, 36, 40, 41, 323, 399, - 30, 113, 32, 125, 0, 27, 64, 28, 49, 24, - 186, 52, 410, 35, 414, 30, 61, 26, 59, 25, - 42, 43, 44, 421, 46, 147, 48, 72, 61, 38, - 24, 25, 73, 91, 55, 57, 30, 81, 68, 72, - 70, 88, 398, 88, 8, 39, 91, 99, 89, 90, - 375, 91, 74, 75, 91, 70, 412, 61, 234, 28, - 29, 106, 34, 69, 400, 59, 28, 36, 72, 105, - 103, 104, 91, 106, 36, 33, 70, 71, 60, 26, - 416, 53, 24, 207, 26, 67, 91, 45, 206, 58, - 59, 38, 210, 33, 60, 207, 38, 59, 91, 103, - 104, 67, 106, 47, 73, 45, 50, 51, 97, 249, - 54, 73, 91, 102, 91, 5, 6, 7, 62, 9, - 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, - 20, 21, 3, 4, 324, 91, 80, 249, 19, 20, - 21, 22, 23, 100, 256, 26, 100, 100, 100, 99, - 107, 99, 95, 107, 107, 107, 83, 84, 85, 86, - 87, 92, 101, 100, 95, 96, 105, 92, 93, 94, - 95, 76, 77, 78, 79, 103, 104, 22, 23, 103, - 104, 91, 105, 105, 100, 100, 100, 100, 100, 100, - 91, 100, 100, 22, 64, 101, 91, 101, 101, 22, - 340, 319, 102, 315, 315, 315, 100, 100, 100, 100, - 65, 22, 101, 101, 101, 101, 101, 101, 101, 101, - 95, 101, 100, 82, 22, 102, 105, 22, 340, 22, - 66, 22, 101, 345, 101, 22, 28, 101, 22, 22, - 102, 95, 100, 106, 101, 22, 102, 100, 22, 22, - 102, 102, 102, 102, 102, 102, 396, 22, 102, 102, - 100, 102, 56, 102, 102, 22, 22, 102, 31, 100, - 107, 101, 97, 101, 101, 65, 100, 389, 389, 389, - 102, 102, 97, 102, 396, 389, 398, 247, 195, 227, - 79, 350, -1, 55, 82, 80, 82, -1, -1, -1, - 412, -1, -1, -1, -1, 181 + 37, 103, 37, 169, 25, 36, 24, 125, 323, 402, + 64, 113, 30, 0, 28, 34, 40, 41, 49, 26, + 186, 52, 413, 8, 417, 61, 61, 28, 59, 147, + 27, 38, 26, 424, 53, 36, 72, 72, 35, 61, + 94, 55, 73, 94, 38, 42, 43, 44, 69, 46, + 72, 48, 70, 33, 91, 401, 91, 81, 59, 94, + 57, 92, 93, 378, 94, 45, 403, 94, 234, 415, + 106, 107, 73, 109, 109, 24, 25, 74, 75, 104, + 24, 30, 419, 108, 106, 107, 30, 109, 32, 24, + 39, 26, 47, 207, 33, 50, 51, 60, 206, 54, + 28, 29, 210, 38, 67, 207, 45, 62, 36, 102, + 59, 83, 84, 85, 86, 87, 88, 89, 90, 249, + 60, 70, 71, 100, 68, 80, 70, 67, 105, 94, + 58, 59, 19, 20, 21, 22, 23, 3, 4, 26, + 94, 103, 103, 103, 324, 73, 94, 249, 110, 110, + 110, 5, 6, 7, 256, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 95, 103, + 94, 98, 99, 106, 107, 98, 110, 95, 96, 97, + 98, 76, 77, 78, 79, 22, 23, 106, 107, 94, + 102, 102, 94, 108, 108, 108, 103, 103, 94, 103, + 103, 64, 103, 103, 103, 103, 103, 22, 22, 94, + 340, 319, 104, 315, 315, 315, 104, 65, 104, 108, + 103, 105, 103, 103, 103, 82, 104, 104, 104, 104, + 104, 104, 104, 104, 104, 103, 105, 98, 340, 22, + 22, 22, 22, 345, 66, 104, 22, 22, 104, 28, + 22, 104, 22, 105, 98, 104, 103, 103, 109, 22, + 105, 22, 105, 105, 105, 105, 105, 22, 22, 399, + 105, 105, 105, 103, 105, 22, 105, 105, 56, 22, + 105, 31, 103, 110, 104, 104, 104, 103, 65, 100, + 392, 392, 392, 105, 100, 105, 105, 399, 392, 401, + 247, 195, 227, 350, 55, 79, -1, -1, -1, 82, + -1, 82, 80, 415, 181 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 109, 110, 0, 111, 8, 112, 113, - 91, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 128, - 151, 152, 159, 160, 161, 222, 224, 227, 240, 99, - 225, 91, 91, 91, 91, 223, 64, 91, 131, 137, - 228, 131, 131, 131, 131, 131, 91, 132, 145, 103, - 104, 130, 221, 131, 99, 99, 91, 226, 105, 105, - 105, 101, 105, 163, 226, 28, 29, 36, 58, 59, - 73, 229, 100, 92, 93, 94, 95, 150, 100, 100, - 100, 100, 100, 100, 95, 147, 22, 23, 37, 61, - 72, 88, 91, 106, 136, 138, 153, 167, 170, 205, - 209, 212, 216, 218, 219, 100, 100, 91, 153, 228, - 22, 162, 166, 170, 205, 215, 217, 219, 220, 221, - 26, 38, 230, 101, 234, 130, 129, 221, 130, 129, - 130, 130, 129, 28, 36, 59, 73, 158, 33, 45, + 0, 3, 4, 112, 113, 0, 114, 8, 115, 116, + 94, 5, 6, 7, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 117, 118, 119, + 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, + 154, 155, 162, 163, 164, 225, 227, 230, 243, 102, + 228, 94, 94, 94, 94, 226, 64, 94, 134, 140, + 231, 134, 134, 134, 134, 134, 94, 135, 148, 106, + 107, 133, 224, 134, 102, 102, 94, 229, 108, 108, + 108, 104, 108, 166, 229, 28, 29, 36, 58, 59, + 73, 232, 103, 95, 96, 97, 98, 153, 103, 103, + 103, 103, 103, 103, 98, 150, 22, 23, 37, 61, + 72, 91, 94, 109, 139, 141, 156, 170, 173, 208, + 212, 215, 219, 221, 222, 103, 103, 94, 156, 231, + 22, 165, 169, 173, 208, 218, 220, 222, 223, 224, + 26, 38, 233, 104, 237, 133, 132, 224, 133, 132, + 133, 133, 132, 28, 36, 59, 73, 161, 33, 45, 27, 35, 42, 43, 44, 46, 48, 57, 74, 75, - 171, 173, 176, 178, 180, 184, 187, 189, 191, 193, - 196, 28, 36, 49, 52, 59, 73, 89, 90, 154, - 220, 92, 95, 96, 149, 101, 136, 91, 102, 22, - 23, 60, 67, 231, 22, 237, 100, 100, 136, 100, - 100, 60, 67, 233, 234, 101, 101, 101, 28, 55, - 188, 101, 24, 26, 38, 177, 232, 101, 232, 47, - 50, 51, 54, 62, 80, 200, 25, 69, 192, 101, - 236, 234, 65, 233, 101, 234, 101, 101, 156, 100, - 107, 22, 139, 140, 141, 145, 100, 105, 164, 102, - 130, 129, 95, 148, 82, 126, 130, 22, 213, 22, - 214, 22, 190, 22, 183, 66, 183, 24, 30, 32, - 68, 70, 172, 182, 101, 22, 201, 202, 101, 234, - 40, 41, 81, 197, 198, 22, 239, 28, 181, 34, - 53, 185, 101, 22, 157, 22, 155, 157, 220, 102, - 95, 146, 133, 134, 221, 106, 101, 235, 100, 100, - 102, 102, 102, 102, 102, 22, 204, 22, 203, 102, - 76, 77, 78, 79, 186, 22, 199, 102, 102, 102, - 100, 107, 103, 104, 142, 100, 22, 91, 135, 61, - 72, 165, 168, 169, 170, 206, 207, 210, 215, 22, - 238, 83, 84, 85, 86, 87, 127, 130, 56, 25, - 39, 59, 71, 174, 182, 232, 102, 102, 102, 220, - 22, 143, 22, 144, 134, 33, 45, 194, 196, 100, - 107, 102, 31, 175, 179, 182, 100, 107, 100, 101, - 101, 65, 195, 168, 220, 134, 208, 213, 211, 214, - 101, 107, 100, 102, 97, 102, 97, 199, 134, 213, - 214, 97, 199, 102 + 174, 176, 179, 181, 183, 187, 190, 192, 194, 196, + 199, 28, 36, 49, 52, 59, 73, 92, 93, 157, + 223, 95, 98, 99, 152, 104, 139, 94, 105, 22, + 23, 60, 67, 234, 22, 240, 103, 103, 139, 103, + 103, 60, 67, 236, 237, 104, 104, 104, 28, 55, + 191, 104, 24, 26, 38, 180, 235, 104, 235, 47, + 50, 51, 54, 62, 80, 203, 25, 69, 195, 104, + 239, 237, 65, 236, 104, 237, 104, 104, 159, 103, + 110, 22, 142, 143, 144, 148, 103, 108, 167, 105, + 133, 132, 98, 151, 82, 129, 133, 22, 216, 22, + 217, 22, 193, 22, 186, 66, 186, 24, 30, 32, + 68, 70, 175, 185, 104, 22, 204, 205, 104, 237, + 40, 41, 81, 200, 201, 22, 242, 28, 184, 34, + 53, 188, 104, 22, 160, 22, 158, 160, 223, 105, + 98, 149, 136, 137, 224, 109, 104, 238, 103, 103, + 105, 105, 105, 105, 105, 22, 207, 22, 206, 105, + 76, 77, 78, 79, 189, 22, 202, 105, 105, 105, + 103, 110, 106, 107, 145, 103, 22, 94, 138, 61, + 72, 168, 171, 172, 173, 209, 210, 213, 218, 22, + 241, 83, 84, 85, 86, 87, 88, 89, 90, 130, + 133, 56, 25, 39, 59, 71, 177, 185, 235, 105, + 105, 105, 223, 22, 146, 22, 147, 137, 33, 45, + 197, 199, 103, 110, 105, 31, 178, 182, 185, 103, + 110, 103, 104, 104, 65, 198, 171, 223, 137, 211, + 216, 214, 217, 104, 110, 103, 105, 100, 105, 100, + 202, 137, 216, 217, 100, 202, 105 }; #define yyerrok (yyerrstatus = 0) @@ -2038,7 +2044,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 251 "program_parse.y" +#line 252 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2051,7 +2057,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 259 "program_parse.y" +#line 260 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2066,7 +2072,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 275 "program_parse.y" +#line 276 "program_parse.y" { int valid = 0; @@ -2087,7 +2093,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 297 "program_parse.y" +#line 298 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2107,7 +2113,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 315 "program_parse.y" +#line 316 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2117,7 +2123,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 320 "program_parse.y" +#line 321 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2127,7 +2133,7 @@ yyreduce: case 23: /* Line 1455 of yacc.c */ -#line 340 "program_parse.y" +#line 341 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2136,7 +2142,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 346 "program_parse.y" +#line 347 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2146,7 +2152,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 353 "program_parse.y" +#line 354 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2156,7 +2162,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 360 "program_parse.y" +#line 361 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2166,7 +2172,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 368 "program_parse.y" +#line 369 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2176,7 +2182,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 376 "program_parse.y" +#line 377 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2186,15 +2192,47 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 383 "program_parse.y" +#line 384 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { + const GLbitfield tex_mask = (1U << (yyvsp[(6) - (8)].integer)); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; (yyval.inst)->Base.TexSrcUnit = (yyvsp[(6) - (8)].integer); - (yyval.inst)->Base.TexSrcTarget = (yyvsp[(8) - (8)].integer); - state->prog->TexturesUsed[(yyvsp[(6) - (8)].integer)] |= (1U << (yyvsp[(8) - (8)].integer)); + if ((yyvsp[(8) - (8)].integer) < 0) { + shadow_tex = tex_mask; + + (yyval.inst)->Base.TexSrcTarget = -(yyvsp[(8) - (8)].integer); + (yyval.inst)->Base.TexShadow = 1; + } else { + (yyval.inst)->Base.TexSrcTarget = (yyvsp[(8) - (8)].integer); + } + + target_mask = (1U << (yyval.inst)->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[(yyvsp[(6) - (8)].integer)] != 0) + && ((state->prog->TexturesUsed[(yyvsp[(6) - (8)].integer)] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& (yylsp[(8) - (8)]), state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[(yyvsp[(6) - (8)].integer)] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; } ;} break; @@ -2202,7 +2240,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 396 "program_parse.y" +#line 429 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2212,7 +2250,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 403 "program_parse.y" +#line 436 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2221,42 +2259,63 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 408 "program_parse.y" +#line 441 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 409 "program_parse.y" +#line 442 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 410 "program_parse.y" +#line 443 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 411 "program_parse.y" +#line 444 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 412 "program_parse.y" +#line 445 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 416 "program_parse.y" +#line 446 "program_parse.y" + { (yyval.integer) = -TEXTURE_1D_INDEX; ;} + break; + + case 38: + +/* Line 1455 of yacc.c */ +#line 447 "program_parse.y" + { (yyval.integer) = -TEXTURE_2D_INDEX; ;} + break; + + case 39: + +/* Line 1455 of yacc.c */ +#line 448 "program_parse.y" + { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} + break; + + case 40: + +/* Line 1455 of yacc.c */ +#line 452 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2268,10 +2327,10 @@ yyreduce: ;} break; - case 38: + case 41: /* Line 1455 of yacc.c */ -#line 428 "program_parse.y" +#line 464 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2284,10 +2343,10 @@ yyreduce: ;} break; - case 39: + case 42: /* Line 1455 of yacc.c */ -#line 441 "program_parse.y" +#line 477 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2300,10 +2359,10 @@ yyreduce: ;} break; - case 40: + case 43: /* Line 1455 of yacc.c */ -#line 454 "program_parse.y" +#line 490 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2325,10 +2384,10 @@ yyreduce: ;} break; - case 41: + case 44: /* Line 1455 of yacc.c */ -#line 476 "program_parse.y" +#line 512 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2337,10 +2396,10 @@ yyreduce: ;} break; - case 42: + case 45: /* Line 1455 of yacc.c */ -#line 485 "program_parse.y" +#line 521 "program_parse.y" { (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); @@ -2349,20 +2408,20 @@ yyreduce: ;} break; - case 43: + case 46: /* Line 1455 of yacc.c */ -#line 494 "program_parse.y" +#line 530 "program_parse.y" { (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 44: + case 47: /* Line 1455 of yacc.c */ -#line 501 "program_parse.y" +#line 537 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2373,10 +2432,10 @@ yyreduce: ;} break; - case 45: + case 48: /* Line 1455 of yacc.c */ -#line 510 "program_parse.y" +#line 546 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2404,10 +2463,10 @@ yyreduce: ;} break; - case 46: + case 49: /* Line 1455 of yacc.c */ -#line 538 "program_parse.y" +#line 574 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2451,10 +2510,10 @@ yyreduce: ;} break; - case 47: + case 50: /* Line 1455 of yacc.c */ -#line 580 "program_parse.y" +#line 616 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2467,10 +2526,10 @@ yyreduce: ;} break; - case 48: + case 51: /* Line 1455 of yacc.c */ -#line 591 "program_parse.y" +#line 627 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2493,10 +2552,10 @@ yyreduce: ;} break; - case 49: + case 52: /* Line 1455 of yacc.c */ -#line 612 "program_parse.y" +#line 648 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2506,10 +2565,10 @@ yyreduce: ;} break; - case 50: + case 53: /* Line 1455 of yacc.c */ -#line 622 "program_parse.y" +#line 658 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2517,10 +2576,10 @@ yyreduce: ;} break; - case 51: + case 54: /* Line 1455 of yacc.c */ -#line 628 "program_parse.y" +#line 664 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2544,10 +2603,10 @@ yyreduce: ;} break; - case 52: + case 55: /* Line 1455 of yacc.c */ -#line 652 "program_parse.y" +#line 688 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2564,20 +2623,20 @@ yyreduce: ;} break; - case 55: + case 58: /* Line 1455 of yacc.c */ -#line 671 "program_parse.y" +#line 707 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 56: + case 59: /* Line 1455 of yacc.c */ -#line 678 "program_parse.y" +#line 714 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2589,31 +2648,31 @@ yyreduce: ;} break; - case 57: + case 60: /* Line 1455 of yacc.c */ -#line 689 "program_parse.y" +#line 725 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 58: + case 61: /* Line 1455 of yacc.c */ -#line 690 "program_parse.y" +#line 726 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 59: + case 62: /* Line 1455 of yacc.c */ -#line 691 "program_parse.y" +#line 727 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 60: + case 63: /* Line 1455 of yacc.c */ -#line 695 "program_parse.y" +#line 731 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2625,10 +2684,10 @@ yyreduce: ;} break; - case 61: + case 64: /* Line 1455 of yacc.c */ -#line 707 "program_parse.y" +#line 743 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2640,10 +2699,10 @@ yyreduce: ;} break; - case 62: + case 65: /* Line 1455 of yacc.c */ -#line 719 "program_parse.y" +#line 755 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2661,10 +2720,10 @@ yyreduce: ;} break; - case 63: + case 66: /* Line 1455 of yacc.c */ -#line 737 "program_parse.y" +#line 773 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2675,10 +2734,10 @@ yyreduce: ;} break; - case 64: + case 67: /* Line 1455 of yacc.c */ -#line 748 "program_parse.y" +#line 784 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2690,24 +2749,24 @@ yyreduce: ;} break; - case 69: + case 72: /* Line 1455 of yacc.c */ -#line 764 "program_parse.y" +#line 800 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 74: + case 77: /* Line 1455 of yacc.c */ -#line 768 "program_parse.y" +#line 804 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 81: + case 84: /* Line 1455 of yacc.c */ -#line 780 "program_parse.y" +#line 816 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2725,55 +2784,55 @@ yyreduce: ;} break; - case 82: + case 85: /* Line 1455 of yacc.c */ -#line 798 "program_parse.y" +#line 834 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 83: + case 86: /* Line 1455 of yacc.c */ -#line 802 "program_parse.y" +#line 838 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 84: + case 87: /* Line 1455 of yacc.c */ -#line 808 "program_parse.y" +#line 844 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 85: + case 88: /* Line 1455 of yacc.c */ -#line 812 "program_parse.y" +#line 848 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 86: + case 89: /* Line 1455 of yacc.c */ -#line 816 "program_parse.y" +#line 852 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 87: + case 90: /* Line 1455 of yacc.c */ -#line 820 "program_parse.y" +#line 856 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2784,10 +2843,10 @@ yyreduce: ;} break; - case 88: + case 91: /* Line 1455 of yacc.c */ -#line 829 "program_parse.y" +#line 865 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2798,38 +2857,38 @@ yyreduce: ;} break; - case 89: + case 92: /* Line 1455 of yacc.c */ -#line 838 "program_parse.y" +#line 874 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 90: + case 93: /* Line 1455 of yacc.c */ -#line 842 "program_parse.y" +#line 878 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 91: + case 94: /* Line 1455 of yacc.c */ -#line 847 "program_parse.y" +#line 883 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 92: + case 95: /* Line 1455 of yacc.c */ -#line 853 "program_parse.y" +#line 889 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2840,46 +2899,46 @@ yyreduce: ;} break; - case 96: + case 99: /* Line 1455 of yacc.c */ -#line 867 "program_parse.y" +#line 903 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 97: + case 100: /* Line 1455 of yacc.c */ -#line 871 "program_parse.y" +#line 907 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 98: + case 101: /* Line 1455 of yacc.c */ -#line 875 "program_parse.y" +#line 911 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 99: + case 102: /* Line 1455 of yacc.c */ -#line 879 "program_parse.y" +#line 915 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 102: + case 105: /* Line 1455 of yacc.c */ -#line 887 "program_parse.y" +#line 923 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2895,10 +2954,10 @@ yyreduce: ;} break; - case 103: + case 106: /* Line 1455 of yacc.c */ -#line 903 "program_parse.y" +#line 939 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -2920,19 +2979,19 @@ yyreduce: ;} break; - case 104: + case 107: /* Line 1455 of yacc.c */ -#line 925 "program_parse.y" +#line 961 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 105: + case 108: /* Line 1455 of yacc.c */ -#line 929 "program_parse.y" +#line 965 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -2943,38 +3002,38 @@ yyreduce: ;} break; - case 106: + case 109: /* Line 1455 of yacc.c */ -#line 940 "program_parse.y" +#line 976 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 107: + case 110: /* Line 1455 of yacc.c */ -#line 946 "program_parse.y" +#line 982 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 109: + case 112: /* Line 1455 of yacc.c */ -#line 953 "program_parse.y" +#line 989 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 110: + case 113: /* Line 1455 of yacc.c */ -#line 960 "program_parse.y" +#line 996 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2982,10 +3041,10 @@ yyreduce: ;} break; - case 111: + case 114: /* Line 1455 of yacc.c */ -#line 966 "program_parse.y" +#line 1002 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -2993,10 +3052,10 @@ yyreduce: ;} break; - case 112: + case 115: /* Line 1455 of yacc.c */ -#line 972 "program_parse.y" +#line 1008 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3004,10 +3063,10 @@ yyreduce: ;} break; - case 113: + case 116: /* Line 1455 of yacc.c */ -#line 980 "program_parse.y" +#line 1016 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3015,10 +3074,10 @@ yyreduce: ;} break; - case 114: + case 117: /* Line 1455 of yacc.c */ -#line 986 "program_parse.y" +#line 1022 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3026,10 +3085,10 @@ yyreduce: ;} break; - case 115: + case 118: /* Line 1455 of yacc.c */ -#line 992 "program_parse.y" +#line 1028 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3037,10 +3096,10 @@ yyreduce: ;} break; - case 116: + case 119: /* Line 1455 of yacc.c */ -#line 1000 "program_parse.y" +#line 1036 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3048,10 +3107,10 @@ yyreduce: ;} break; - case 117: + case 120: /* Line 1455 of yacc.c */ -#line 1006 "program_parse.y" +#line 1042 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3059,10 +3118,10 @@ yyreduce: ;} break; - case 118: + case 121: /* Line 1455 of yacc.c */ -#line 1012 "program_parse.y" +#line 1048 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3070,94 +3129,94 @@ yyreduce: ;} break; - case 119: + case 122: /* Line 1455 of yacc.c */ -#line 1019 "program_parse.y" +#line 1055 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 120: + case 123: /* Line 1455 of yacc.c */ -#line 1020 "program_parse.y" +#line 1056 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 121: + case 124: /* Line 1455 of yacc.c */ -#line 1023 "program_parse.y" +#line 1059 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 122: + case 125: /* Line 1455 of yacc.c */ -#line 1024 "program_parse.y" +#line 1060 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 123: + case 126: /* Line 1455 of yacc.c */ -#line 1025 "program_parse.y" +#line 1061 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 124: + case 127: /* Line 1455 of yacc.c */ -#line 1026 "program_parse.y" +#line 1062 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 125: + case 128: /* Line 1455 of yacc.c */ -#line 1027 "program_parse.y" +#line 1063 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 126: + case 129: /* Line 1455 of yacc.c */ -#line 1028 "program_parse.y" +#line 1064 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 127: + case 130: /* Line 1455 of yacc.c */ -#line 1029 "program_parse.y" +#line 1065 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 128: + case 131: /* Line 1455 of yacc.c */ -#line 1030 "program_parse.y" +#line 1066 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 129: + case 132: /* Line 1455 of yacc.c */ -#line 1031 "program_parse.y" +#line 1067 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 130: + case 133: /* Line 1455 of yacc.c */ -#line 1032 "program_parse.y" +#line 1068 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 131: + case 134: /* Line 1455 of yacc.c */ -#line 1036 "program_parse.y" +#line 1072 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3166,37 +3225,37 @@ yyreduce: ;} break; - case 132: + case 135: /* Line 1455 of yacc.c */ -#line 1045 "program_parse.y" +#line 1081 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 133: + case 136: /* Line 1455 of yacc.c */ -#line 1049 "program_parse.y" +#line 1085 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 134: + case 137: /* Line 1455 of yacc.c */ -#line 1053 "program_parse.y" +#line 1089 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 135: + case 138: /* Line 1455 of yacc.c */ -#line 1059 "program_parse.y" +#line 1095 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3205,28 +3264,28 @@ yyreduce: ;} break; - case 136: + case 139: /* Line 1455 of yacc.c */ -#line 1068 "program_parse.y" +#line 1104 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 137: + case 140: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1108 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 138: + case 141: /* Line 1455 of yacc.c */ -#line 1076 "program_parse.y" +#line 1112 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3237,57 +3296,57 @@ yyreduce: ;} break; - case 139: + case 142: /* Line 1455 of yacc.c */ -#line 1085 "program_parse.y" +#line 1121 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 140: + case 143: /* Line 1455 of yacc.c */ -#line 1089 "program_parse.y" +#line 1125 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 141: + case 144: /* Line 1455 of yacc.c */ -#line 1095 "program_parse.y" +#line 1131 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 142: + case 145: /* Line 1455 of yacc.c */ -#line 1101 "program_parse.y" +#line 1137 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 143: + case 146: /* Line 1455 of yacc.c */ -#line 1108 "program_parse.y" +#line 1144 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 144: + case 147: /* Line 1455 of yacc.c */ -#line 1113 "program_parse.y" +#line 1149 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3295,10 +3354,10 @@ yyreduce: ;} break; - case 145: + case 148: /* Line 1455 of yacc.c */ -#line 1121 "program_parse.y" +#line 1157 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3308,10 +3367,10 @@ yyreduce: ;} break; - case 147: + case 150: /* Line 1455 of yacc.c */ -#line 1133 "program_parse.y" +#line 1169 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3319,46 +3378,46 @@ yyreduce: ;} break; - case 148: + case 151: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1177 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 149: + case 152: /* Line 1455 of yacc.c */ -#line 1147 "program_parse.y" +#line 1183 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 150: + case 153: /* Line 1455 of yacc.c */ -#line 1151 "program_parse.y" +#line 1187 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 151: + case 154: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1191 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 152: + case 155: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1197 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3369,10 +3428,10 @@ yyreduce: ;} break; - case 153: + case 156: /* Line 1455 of yacc.c */ -#line 1172 "program_parse.y" +#line 1208 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3381,92 +3440,92 @@ yyreduce: ;} break; - case 154: + case 157: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1217 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 155: + case 158: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1221 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 156: + case 159: /* Line 1455 of yacc.c */ -#line 1190 "program_parse.y" +#line 1226 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 157: + case 160: /* Line 1455 of yacc.c */ -#line 1194 "program_parse.y" +#line 1230 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 158: + case 161: /* Line 1455 of yacc.c */ -#line 1198 "program_parse.y" +#line 1234 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 159: + case 162: /* Line 1455 of yacc.c */ -#line 1202 "program_parse.y" +#line 1238 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 160: + case 163: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1244 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 161: + case 164: /* Line 1455 of yacc.c */ -#line 1215 "program_parse.y" +#line 1251 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 162: + case 165: /* Line 1455 of yacc.c */ -#line 1219 "program_parse.y" +#line 1255 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 163: + case 166: /* Line 1455 of yacc.c */ -#line 1225 "program_parse.y" +#line 1261 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3474,10 +3533,10 @@ yyreduce: ;} break; - case 164: + case 167: /* Line 1455 of yacc.c */ -#line 1233 "program_parse.y" +#line 1269 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3488,38 +3547,38 @@ yyreduce: ;} break; - case 165: + case 168: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1280 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 166: + case 169: /* Line 1455 of yacc.c */ -#line 1251 "program_parse.y" +#line 1287 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 167: + case 170: /* Line 1455 of yacc.c */ -#line 1255 "program_parse.y" +#line 1291 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 168: + case 171: /* Line 1455 of yacc.c */ -#line 1261 "program_parse.y" +#line 1297 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3529,10 +3588,10 @@ yyreduce: ;} break; - case 169: + case 172: /* Line 1455 of yacc.c */ -#line 1271 "program_parse.y" +#line 1307 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3542,20 +3601,20 @@ yyreduce: ;} break; - case 170: + case 173: /* Line 1455 of yacc.c */ -#line 1281 "program_parse.y" +#line 1317 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 171: + case 174: /* Line 1455 of yacc.c */ -#line 1286 "program_parse.y" +#line 1322 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3573,10 +3632,10 @@ yyreduce: ;} break; - case 172: + case 175: /* Line 1455 of yacc.c */ -#line 1304 "program_parse.y" +#line 1340 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3584,55 +3643,55 @@ yyreduce: ;} break; - case 173: + case 176: /* Line 1455 of yacc.c */ -#line 1312 "program_parse.y" +#line 1348 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 174: + case 177: /* Line 1455 of yacc.c */ -#line 1316 "program_parse.y" +#line 1352 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 175: + case 178: /* Line 1455 of yacc.c */ -#line 1322 "program_parse.y" +#line 1358 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 176: + case 179: /* Line 1455 of yacc.c */ -#line 1326 "program_parse.y" +#line 1362 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 177: + case 180: /* Line 1455 of yacc.c */ -#line 1330 "program_parse.y" +#line 1366 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 178: + case 181: /* Line 1455 of yacc.c */ -#line 1336 "program_parse.y" +#line 1372 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3643,88 +3702,88 @@ yyreduce: ;} break; - case 179: + case 182: /* Line 1455 of yacc.c */ -#line 1347 "program_parse.y" +#line 1383 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 180: + case 183: /* Line 1455 of yacc.c */ -#line 1352 "program_parse.y" +#line 1388 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 181: + case 184: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1393 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 182: + case 185: /* Line 1455 of yacc.c */ -#line 1362 "program_parse.y" +#line 1398 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 183: + case 186: /* Line 1455 of yacc.c */ -#line 1367 "program_parse.y" +#line 1403 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 184: + case 187: /* Line 1455 of yacc.c */ -#line 1372 "program_parse.y" +#line 1408 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 185: + case 188: /* Line 1455 of yacc.c */ -#line 1379 "program_parse.y" +#line 1415 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 186: + case 189: /* Line 1455 of yacc.c */ -#line 1383 "program_parse.y" +#line 1419 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 187: + case 190: /* Line 1455 of yacc.c */ -#line 1388 "program_parse.y" +#line 1424 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3738,10 +3797,10 @@ yyreduce: ;} break; - case 188: + case 191: /* Line 1455 of yacc.c */ -#line 1401 "program_parse.y" +#line 1437 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3750,10 +3809,10 @@ yyreduce: ;} break; - case 189: + case 192: /* Line 1455 of yacc.c */ -#line 1409 "program_parse.y" +#line 1445 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3764,10 +3823,10 @@ yyreduce: ;} break; - case 194: + case 197: /* Line 1455 of yacc.c */ -#line 1426 "program_parse.y" +#line 1462 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3777,30 +3836,30 @@ yyreduce: ;} break; - case 195: + case 198: /* Line 1455 of yacc.c */ -#line 1436 "program_parse.y" +#line 1472 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 196: + case 199: /* Line 1455 of yacc.c */ -#line 1441 "program_parse.y" +#line 1477 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 197: + case 200: /* Line 1455 of yacc.c */ -#line 1448 "program_parse.y" +#line 1484 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3810,10 +3869,10 @@ yyreduce: ;} break; - case 198: + case 201: /* Line 1455 of yacc.c */ -#line 1458 "program_parse.y" +#line 1494 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3823,30 +3882,30 @@ yyreduce: ;} break; - case 199: + case 202: /* Line 1455 of yacc.c */ -#line 1467 "program_parse.y" +#line 1503 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 200: + case 203: /* Line 1455 of yacc.c */ -#line 1472 "program_parse.y" +#line 1508 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 201: + case 204: /* Line 1455 of yacc.c */ -#line 1479 "program_parse.y" +#line 1515 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3856,10 +3915,10 @@ yyreduce: ;} break; - case 202: + case 205: /* Line 1455 of yacc.c */ -#line 1489 "program_parse.y" +#line 1525 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3869,10 +3928,10 @@ yyreduce: ;} break; - case 203: + case 206: /* Line 1455 of yacc.c */ -#line 1499 "program_parse.y" +#line 1535 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3882,40 +3941,40 @@ yyreduce: ;} break; - case 208: + case 211: /* Line 1455 of yacc.c */ -#line 1514 "program_parse.y" +#line 1550 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); ;} break; - case 209: + case 212: /* Line 1455 of yacc.c */ -#line 1521 "program_parse.y" +#line 1557 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); ;} break; - case 210: + case 213: /* Line 1455 of yacc.c */ -#line 1526 "program_parse.y" +#line 1562 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); ;} break; - case 211: + case 214: /* Line 1455 of yacc.c */ -#line 1533 "program_parse.y" +#line 1569 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3925,10 +3984,10 @@ yyreduce: ;} break; - case 212: + case 215: /* Line 1455 of yacc.c */ -#line 1541 "program_parse.y" +#line 1577 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -3938,10 +3997,10 @@ yyreduce: ;} break; - case 213: + case 216: /* Line 1455 of yacc.c */ -#line 1550 "program_parse.y" +#line 1586 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -3951,10 +4010,10 @@ yyreduce: ;} break; - case 214: + case 217: /* Line 1455 of yacc.c */ -#line 1559 "program_parse.y" +#line 1595 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -3964,63 +4023,63 @@ yyreduce: ;} break; - case 215: + case 218: /* Line 1455 of yacc.c */ -#line 1569 "program_parse.y" +#line 1605 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 216: + case 219: /* Line 1455 of yacc.c */ -#line 1573 "program_parse.y" +#line 1609 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 217: + case 220: /* Line 1455 of yacc.c */ -#line 1578 "program_parse.y" +#line 1614 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 218: + case 221: /* Line 1455 of yacc.c */ -#line 1579 "program_parse.y" +#line 1615 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 219: + case 222: /* Line 1455 of yacc.c */ -#line 1580 "program_parse.y" +#line 1616 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 220: + case 223: /* Line 1455 of yacc.c */ -#line 1583 "program_parse.y" +#line 1619 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 222: + case 225: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1622 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 224: + case 227: /* Line 1455 of yacc.c */ -#line 1590 "program_parse.y" +#line 1626 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4028,10 +4087,10 @@ yyreduce: ;} break; - case 225: + case 228: /* Line 1455 of yacc.c */ -#line 1596 "program_parse.y" +#line 1632 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4039,10 +4098,10 @@ yyreduce: ;} break; - case 226: + case 229: /* Line 1455 of yacc.c */ -#line 1604 "program_parse.y" +#line 1640 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4055,10 +4114,10 @@ yyreduce: ;} break; - case 227: + case 230: /* Line 1455 of yacc.c */ -#line 1617 "program_parse.y" +#line 1653 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4069,10 +4128,10 @@ yyreduce: ;} break; - case 228: + case 231: /* Line 1455 of yacc.c */ -#line 1626 "program_parse.y" +#line 1662 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4083,19 +4142,19 @@ yyreduce: ;} break; - case 229: + case 232: /* Line 1455 of yacc.c */ -#line 1635 "program_parse.y" +#line 1671 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 230: + case 233: /* Line 1455 of yacc.c */ -#line 1639 "program_parse.y" +#line 1675 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4106,10 +4165,10 @@ yyreduce: ;} break; - case 231: + case 234: /* Line 1455 of yacc.c */ -#line 1648 "program_parse.y" +#line 1684 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4120,10 +4179,10 @@ yyreduce: ;} break; - case 232: + case 235: /* Line 1455 of yacc.c */ -#line 1657 "program_parse.y" +#line 1693 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4134,19 +4193,19 @@ yyreduce: ;} break; - case 233: + case 236: /* Line 1455 of yacc.c */ -#line 1668 "program_parse.y" +#line 1704 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 234: + case 237: /* Line 1455 of yacc.c */ -#line 1674 "program_parse.y" +#line 1710 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4154,10 +4213,10 @@ yyreduce: ;} break; - case 235: + case 238: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1716 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4168,10 +4227,10 @@ yyreduce: ;} break; - case 236: + case 239: /* Line 1455 of yacc.c */ -#line 1689 "program_parse.y" +#line 1725 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4182,19 +4241,19 @@ yyreduce: ;} break; - case 237: + case 240: /* Line 1455 of yacc.c */ -#line 1700 "program_parse.y" +#line 1736 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 238: + case 241: /* Line 1455 of yacc.c */ -#line 1704 "program_parse.y" +#line 1740 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4205,10 +4264,10 @@ yyreduce: ;} break; - case 239: + case 242: /* Line 1455 of yacc.c */ -#line 1713 "program_parse.y" +#line 1749 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4219,94 +4278,94 @@ yyreduce: ;} break; - case 240: + case 243: /* Line 1455 of yacc.c */ -#line 1723 "program_parse.y" +#line 1759 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 241: + case 244: /* Line 1455 of yacc.c */ -#line 1724 "program_parse.y" +#line 1760 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 242: + case 245: /* Line 1455 of yacc.c */ -#line 1725 "program_parse.y" +#line 1761 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 243: + case 246: /* Line 1455 of yacc.c */ -#line 1728 "program_parse.y" +#line 1764 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 244: + case 247: /* Line 1455 of yacc.c */ -#line 1729 "program_parse.y" +#line 1765 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 245: + case 248: /* Line 1455 of yacc.c */ -#line 1730 "program_parse.y" +#line 1766 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 246: + case 249: /* Line 1455 of yacc.c */ -#line 1733 "program_parse.y" +#line 1769 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 247: + case 250: /* Line 1455 of yacc.c */ -#line 1734 "program_parse.y" +#line 1770 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 248: + case 251: /* Line 1455 of yacc.c */ -#line 1737 "program_parse.y" +#line 1773 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 249: + case 252: /* Line 1455 of yacc.c */ -#line 1738 "program_parse.y" +#line 1774 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 250: + case 253: /* Line 1455 of yacc.c */ -#line 1741 "program_parse.y" +#line 1777 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 251: + case 254: /* Line 1455 of yacc.c */ -#line 1742 "program_parse.y" +#line 1778 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 252: + case 255: /* Line 1455 of yacc.c */ -#line 1746 "program_parse.y" +#line 1782 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4317,10 +4376,10 @@ yyreduce: ;} break; - case 253: + case 256: /* Line 1455 of yacc.c */ -#line 1757 "program_parse.y" +#line 1793 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4331,10 +4390,10 @@ yyreduce: ;} break; - case 254: + case 257: /* Line 1455 of yacc.c */ -#line 1768 "program_parse.y" +#line 1804 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4345,10 +4404,10 @@ yyreduce: ;} break; - case 255: + case 258: /* Line 1455 of yacc.c */ -#line 1779 "program_parse.y" +#line 1815 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4372,7 +4431,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4376 "program_parse.tab.c" +#line 4435 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4591,7 +4650,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1799 "program_parse.y" +#line 1835 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index 7dd1c02bdc..4fd6531801 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -124,17 +124,20 @@ TEX_3D = 340, TEX_CUBE = 341, TEX_RECT = 342, - VERTEX = 343, - VTXATTRIB = 344, - WEIGHT = 345, - IDENTIFIER = 346, - MASK4 = 347, - MASK3 = 348, - MASK2 = 349, - MASK1 = 350, - SWIZZLE = 351, - DOT_DOT = 352, - DOT = 353 + TEX_SHADOW1D = 343, + TEX_SHADOW2D = 344, + TEX_SHADOWRECT = 345, + VERTEX = 346, + VTXATTRIB = 347, + WEIGHT = 348, + IDENTIFIER = 349, + MASK4 = 350, + MASK3 = 351, + MASK2 = 352, + MASK1 = 353, + SWIZZLE = 354, + DOT_DOT = 355, + DOT = 356 }; #endif @@ -167,7 +170,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 171 "program_parse.tab.h" +#line 174 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index f4a1de0487..5008446514 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -157,6 +157,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %token SCENECOLOR SECONDARY SHININESS SIZE SPECULAR SPOT STATE %token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE %token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT +%token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT %token VERTEX VTXATTRIB %token WEIGHT @@ -383,11 +384,43 @@ SAMPLE_instruction: SAMPLE_OP maskedDstReg ',' swizzleSrcReg ',' texImageUnit ', { $$ = asm_instruction_ctor($1.Opcode, & $2, & $4, NULL, NULL); if ($$ != NULL) { + const GLbitfield tex_mask = (1U << $6); + GLbitfield shadow_tex = 0; + GLbitfield target_mask = 0; + + $$->Base.SaturateMode = $1.SaturateMode; $$->Base.TexSrcUnit = $6; - $$->Base.TexSrcTarget = $8; - state->prog->TexturesUsed[$6] |= (1U << $8); + if ($8 < 0) { + shadow_tex = tex_mask; + + $$->Base.TexSrcTarget = -$8; + $$->Base.TexShadow = 1; + } else { + $$->Base.TexSrcTarget = $8; + } + + target_mask = (1U << $$->Base.TexSrcTarget); + + /* If this texture unit was previously accessed and that access + * had a different texture target, generate an error. + * + * If this texture unit was previously accessed and that access + * had a different shadow mode, generate an error. + */ + if ((state->prog->TexturesUsed[$6] != 0) + && ((state->prog->TexturesUsed[$6] != target_mask) + || ((state->prog->ShadowSamplers & tex_mask) + != shadow_tex))) { + yyerror(& @8, state, + "multiple targets used on one texture image unit"); + YYERROR; + } + + + state->prog->TexturesUsed[$6] |= target_mask; + state->prog->ShadowSamplers |= shadow_tex; } } ; @@ -410,6 +443,9 @@ texTarget: TEX_1D { $$ = TEXTURE_1D_INDEX; } | TEX_3D { $$ = TEXTURE_3D_INDEX; } | TEX_CUBE { $$ = TEXTURE_CUBE_INDEX; } | TEX_RECT { $$ = TEXTURE_RECT_INDEX; } + | TEX_SHADOW1D { $$ = -TEXTURE_1D_INDEX; } + | TEX_SHADOW2D { $$ = -TEXTURE_2D_INDEX; } + | TEX_SHADOWRECT { $$ = -TEXTURE_RECT_INDEX; } ; SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle -- cgit v1.2.3 From 41d5696628a5eef62cd671711b33edea9344977d Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 16:33:16 -0700 Subject: ARB prog parser: More robust error message for bad OPTION string --- src/mesa/shader/program_parse.tab.c | 474 ++++++++++++++++++------------------ src/mesa/shader/program_parse.y | 6 +- 2 files changed, 244 insertions(+), 236 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 3d8aa7707c..2842c42e64 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -749,32 +749,32 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 248, 248, 251, 259, 271, 272, 275, 293, 294, - 297, 312, 315, 320, 327, 328, 329, 330, 331, 332, - 333, 336, 337, 340, 346, 353, 360, 368, 375, 383, - 428, 435, 441, 442, 443, 444, 445, 446, 447, 448, - 451, 463, 476, 489, 511, 520, 529, 536, 545, 573, - 615, 626, 647, 657, 663, 687, 704, 704, 706, 713, - 725, 726, 727, 730, 742, 754, 772, 783, 795, 797, - 798, 799, 800, 803, 803, 803, 803, 804, 807, 808, - 809, 810, 811, 812, 815, 833, 837, 843, 847, 851, - 855, 864, 873, 877, 882, 888, 899, 899, 900, 902, - 906, 910, 914, 920, 920, 922, 938, 961, 964, 975, - 981, 987, 988, 995, 1001, 1007, 1015, 1021, 1027, 1035, - 1041, 1047, 1055, 1056, 1059, 1060, 1061, 1062, 1063, 1064, - 1065, 1066, 1067, 1068, 1071, 1080, 1084, 1088, 1094, 1103, - 1107, 1111, 1120, 1124, 1130, 1136, 1143, 1148, 1156, 1166, - 1168, 1176, 1182, 1186, 1190, 1196, 1207, 1216, 1220, 1225, - 1229, 1233, 1237, 1243, 1250, 1254, 1260, 1268, 1279, 1286, - 1290, 1296, 1306, 1317, 1321, 1339, 1348, 1351, 1357, 1361, - 1365, 1371, 1382, 1387, 1392, 1397, 1402, 1407, 1415, 1418, - 1423, 1436, 1444, 1457, 1457, 1459, 1459, 1461, 1471, 1476, - 1483, 1493, 1502, 1507, 1514, 1524, 1534, 1546, 1546, 1547, - 1547, 1549, 1556, 1561, 1568, 1576, 1584, 1593, 1604, 1608, - 1614, 1615, 1616, 1619, 1619, 1622, 1622, 1625, 1631, 1639, - 1652, 1661, 1670, 1674, 1683, 1692, 1703, 1710, 1715, 1724, - 1736, 1739, 1748, 1759, 1760, 1761, 1764, 1765, 1766, 1769, - 1770, 1773, 1774, 1777, 1778, 1781, 1792, 1803, 1814 + 0, 248, 248, 251, 259, 271, 272, 275, 297, 298, + 301, 316, 319, 324, 331, 332, 333, 334, 335, 336, + 337, 340, 341, 344, 350, 357, 364, 372, 379, 387, + 432, 439, 445, 446, 447, 448, 449, 450, 451, 452, + 455, 467, 480, 493, 515, 524, 533, 540, 549, 577, + 619, 630, 651, 661, 667, 691, 708, 708, 710, 717, + 729, 730, 731, 734, 746, 758, 776, 787, 799, 801, + 802, 803, 804, 807, 807, 807, 807, 808, 811, 812, + 813, 814, 815, 816, 819, 837, 841, 847, 851, 855, + 859, 868, 877, 881, 886, 892, 903, 903, 904, 906, + 910, 914, 918, 924, 924, 926, 942, 965, 968, 979, + 985, 991, 992, 999, 1005, 1011, 1019, 1025, 1031, 1039, + 1045, 1051, 1059, 1060, 1063, 1064, 1065, 1066, 1067, 1068, + 1069, 1070, 1071, 1072, 1075, 1084, 1088, 1092, 1098, 1107, + 1111, 1115, 1124, 1128, 1134, 1140, 1147, 1152, 1160, 1170, + 1172, 1180, 1186, 1190, 1194, 1200, 1211, 1220, 1224, 1229, + 1233, 1237, 1241, 1247, 1254, 1258, 1264, 1272, 1283, 1290, + 1294, 1300, 1310, 1321, 1325, 1343, 1352, 1355, 1361, 1365, + 1369, 1375, 1386, 1391, 1396, 1401, 1406, 1411, 1419, 1422, + 1427, 1440, 1448, 1461, 1461, 1463, 1463, 1465, 1475, 1480, + 1487, 1497, 1506, 1511, 1518, 1528, 1538, 1550, 1550, 1551, + 1551, 1553, 1560, 1565, 1572, 1580, 1588, 1597, 1608, 1612, + 1618, 1619, 1620, 1623, 1623, 1626, 1626, 1629, 1635, 1643, + 1656, 1665, 1674, 1678, 1687, 1696, 1707, 1714, 1719, 1728, + 1740, 1743, 1752, 1763, 1764, 1765, 1768, 1769, 1770, 1773, + 1774, 1777, 1778, 1781, 1782, 1785, 1796, 1807, 1818 }; #endif @@ -2084,7 +2084,11 @@ yyreduce: if (!valid) { - yyerror(& (yylsp[(2) - (3)]), state, "invalid option string"); + const char *const err_str = (state->mode == ARB_vertex) + ? "invalid ARB vertex program option" + : "invalid ARB fragment program option"; + + yyerror(& (yylsp[(2) - (3)]), state, err_str); YYERROR; } ;} @@ -2093,7 +2097,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 298 "program_parse.y" +#line 302 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2113,7 +2117,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 316 "program_parse.y" +#line 320 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2123,7 +2127,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 321 "program_parse.y" +#line 325 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2133,7 +2137,7 @@ yyreduce: case 23: /* Line 1455 of yacc.c */ -#line 341 "program_parse.y" +#line 345 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2142,7 +2146,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 347 "program_parse.y" +#line 351 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2152,7 +2156,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 354 "program_parse.y" +#line 358 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2162,7 +2166,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 361 "program_parse.y" +#line 365 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2172,7 +2176,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 369 "program_parse.y" +#line 373 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2182,7 +2186,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 377 "program_parse.y" +#line 381 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2192,7 +2196,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 384 "program_parse.y" +#line 388 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2240,7 +2244,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 429 "program_parse.y" +#line 433 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2250,7 +2254,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 436 "program_parse.y" +#line 440 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2259,63 +2263,63 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 441 "program_parse.y" +#line 445 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 442 "program_parse.y" +#line 446 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 443 "program_parse.y" +#line 447 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 444 "program_parse.y" +#line 448 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 445 "program_parse.y" +#line 449 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 446 "program_parse.y" +#line 450 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 38: /* Line 1455 of yacc.c */ -#line 447 "program_parse.y" +#line 451 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 39: /* Line 1455 of yacc.c */ -#line 448 "program_parse.y" +#line 452 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 40: /* Line 1455 of yacc.c */ -#line 452 "program_parse.y" +#line 456 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2330,7 +2334,7 @@ yyreduce: case 41: /* Line 1455 of yacc.c */ -#line 464 "program_parse.y" +#line 468 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2346,7 +2350,7 @@ yyreduce: case 42: /* Line 1455 of yacc.c */ -#line 477 "program_parse.y" +#line 481 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2362,7 +2366,7 @@ yyreduce: case 43: /* Line 1455 of yacc.c */ -#line 490 "program_parse.y" +#line 494 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2387,7 +2391,7 @@ yyreduce: case 44: /* Line 1455 of yacc.c */ -#line 512 "program_parse.y" +#line 516 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2399,7 +2403,7 @@ yyreduce: case 45: /* Line 1455 of yacc.c */ -#line 521 "program_parse.y" +#line 525 "program_parse.y" { (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); @@ -2411,7 +2415,7 @@ yyreduce: case 46: /* Line 1455 of yacc.c */ -#line 530 "program_parse.y" +#line 534 "program_parse.y" { (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2421,7 +2425,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 537 "program_parse.y" +#line 541 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2435,7 +2439,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 546 "program_parse.y" +#line 550 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2466,7 +2470,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 574 "program_parse.y" +#line 578 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2513,7 +2517,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 616 "program_parse.y" +#line 620 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2529,7 +2533,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 627 "program_parse.y" +#line 631 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2555,7 +2559,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 648 "program_parse.y" +#line 652 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2568,7 +2572,7 @@ yyreduce: case 53: /* Line 1455 of yacc.c */ -#line 658 "program_parse.y" +#line 662 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2579,7 +2583,7 @@ yyreduce: case 54: /* Line 1455 of yacc.c */ -#line 664 "program_parse.y" +#line 668 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2606,7 +2610,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 688 "program_parse.y" +#line 692 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2626,7 +2630,7 @@ yyreduce: case 58: /* Line 1455 of yacc.c */ -#line 707 "program_parse.y" +#line 711 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2636,7 +2640,7 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 714 "program_parse.y" +#line 718 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2651,28 +2655,28 @@ yyreduce: case 60: /* Line 1455 of yacc.c */ -#line 725 "program_parse.y" +#line 729 "program_parse.y" { (yyval.integer) = 0; ;} break; case 61: /* Line 1455 of yacc.c */ -#line 726 "program_parse.y" +#line 730 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 62: /* Line 1455 of yacc.c */ -#line 727 "program_parse.y" +#line 731 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 63: /* Line 1455 of yacc.c */ -#line 731 "program_parse.y" +#line 735 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2687,7 +2691,7 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 743 "program_parse.y" +#line 747 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2702,7 +2706,7 @@ yyreduce: case 65: /* Line 1455 of yacc.c */ -#line 755 "program_parse.y" +#line 759 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2723,7 +2727,7 @@ yyreduce: case 66: /* Line 1455 of yacc.c */ -#line 773 "program_parse.y" +#line 777 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2737,7 +2741,7 @@ yyreduce: case 67: /* Line 1455 of yacc.c */ -#line 784 "program_parse.y" +#line 788 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2752,21 +2756,21 @@ yyreduce: case 72: /* Line 1455 of yacc.c */ -#line 800 "program_parse.y" +#line 804 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 77: /* Line 1455 of yacc.c */ -#line 804 "program_parse.y" +#line 808 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 84: /* Line 1455 of yacc.c */ -#line 816 "program_parse.y" +#line 820 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2787,7 +2791,7 @@ yyreduce: case 85: /* Line 1455 of yacc.c */ -#line 834 "program_parse.y" +#line 838 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2796,7 +2800,7 @@ yyreduce: case 86: /* Line 1455 of yacc.c */ -#line 838 "program_parse.y" +#line 842 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2805,7 +2809,7 @@ yyreduce: case 87: /* Line 1455 of yacc.c */ -#line 844 "program_parse.y" +#line 848 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2814,7 +2818,7 @@ yyreduce: case 88: /* Line 1455 of yacc.c */ -#line 848 "program_parse.y" +#line 852 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2823,7 +2827,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 852 "program_parse.y" +#line 856 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2832,7 +2836,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 856 "program_parse.y" +#line 860 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2846,7 +2850,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 865 "program_parse.y" +#line 869 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2860,7 +2864,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 874 "program_parse.y" +#line 878 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2869,7 +2873,7 @@ yyreduce: case 93: /* Line 1455 of yacc.c */ -#line 878 "program_parse.y" +#line 882 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -2879,7 +2883,7 @@ yyreduce: case 94: /* Line 1455 of yacc.c */ -#line 883 "program_parse.y" +#line 887 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2888,7 +2892,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 889 "program_parse.y" +#line 893 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2902,7 +2906,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 903 "program_parse.y" +#line 907 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2911,7 +2915,7 @@ yyreduce: case 100: /* Line 1455 of yacc.c */ -#line 907 "program_parse.y" +#line 911 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2920,7 +2924,7 @@ yyreduce: case 101: /* Line 1455 of yacc.c */ -#line 911 "program_parse.y" +#line 915 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2929,7 +2933,7 @@ yyreduce: case 102: /* Line 1455 of yacc.c */ -#line 915 "program_parse.y" +#line 919 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2938,7 +2942,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 923 "program_parse.y" +#line 927 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2957,7 +2961,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 939 "program_parse.y" +#line 943 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -2982,7 +2986,7 @@ yyreduce: case 107: /* Line 1455 of yacc.c */ -#line 961 "program_parse.y" +#line 965 "program_parse.y" { (yyval.integer) = 0; ;} @@ -2991,7 +2995,7 @@ yyreduce: case 108: /* Line 1455 of yacc.c */ -#line 965 "program_parse.y" +#line 969 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3005,7 +3009,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 976 "program_parse.y" +#line 980 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3014,7 +3018,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 982 "program_parse.y" +#line 986 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3023,7 +3027,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 989 "program_parse.y" +#line 993 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3033,7 +3037,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 996 "program_parse.y" +#line 1000 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3044,7 +3048,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 1002 "program_parse.y" +#line 1006 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3055,7 +3059,7 @@ yyreduce: case 115: /* Line 1455 of yacc.c */ -#line 1008 "program_parse.y" +#line 1012 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3066,7 +3070,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 1016 "program_parse.y" +#line 1020 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3077,7 +3081,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1022 "program_parse.y" +#line 1026 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3088,7 +3092,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1028 "program_parse.y" +#line 1032 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3099,7 +3103,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1036 "program_parse.y" +#line 1040 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3110,7 +3114,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1042 "program_parse.y" +#line 1046 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3121,7 +3125,7 @@ yyreduce: case 121: /* Line 1455 of yacc.c */ -#line 1048 "program_parse.y" +#line 1052 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3132,91 +3136,91 @@ yyreduce: case 122: /* Line 1455 of yacc.c */ -#line 1055 "program_parse.y" +#line 1059 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 123: /* Line 1455 of yacc.c */ -#line 1056 "program_parse.y" +#line 1060 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 124: /* Line 1455 of yacc.c */ -#line 1059 "program_parse.y" +#line 1063 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 125: /* Line 1455 of yacc.c */ -#line 1060 "program_parse.y" +#line 1064 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 126: /* Line 1455 of yacc.c */ -#line 1061 "program_parse.y" +#line 1065 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1062 "program_parse.y" +#line 1066 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1063 "program_parse.y" +#line 1067 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1064 "program_parse.y" +#line 1068 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1069 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1066 "program_parse.y" +#line 1070 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 132: /* Line 1455 of yacc.c */ -#line 1067 "program_parse.y" +#line 1071 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1068 "program_parse.y" +#line 1072 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1076 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3228,7 +3232,7 @@ yyreduce: case 135: /* Line 1455 of yacc.c */ -#line 1081 "program_parse.y" +#line 1085 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3237,7 +3241,7 @@ yyreduce: case 136: /* Line 1455 of yacc.c */ -#line 1085 "program_parse.y" +#line 1089 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3246,7 +3250,7 @@ yyreduce: case 137: /* Line 1455 of yacc.c */ -#line 1089 "program_parse.y" +#line 1093 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3255,7 +3259,7 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1095 "program_parse.y" +#line 1099 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3267,7 +3271,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1108 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3276,7 +3280,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1108 "program_parse.y" +#line 1112 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3285,7 +3289,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" +#line 1116 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3299,7 +3303,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1121 "program_parse.y" +#line 1125 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3308,7 +3312,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1125 "program_parse.y" +#line 1129 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3317,7 +3321,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1131 "program_parse.y" +#line 1135 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3326,7 +3330,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" +#line 1141 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3336,7 +3340,7 @@ yyreduce: case 146: /* Line 1455 of yacc.c */ -#line 1144 "program_parse.y" +#line 1148 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3346,7 +3350,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1149 "program_parse.y" +#line 1153 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3357,7 +3361,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1157 "program_parse.y" +#line 1161 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3370,7 +3374,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1169 "program_parse.y" +#line 1173 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3381,7 +3385,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1177 "program_parse.y" +#line 1181 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3390,7 +3394,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1183 "program_parse.y" +#line 1187 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3399,7 +3403,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1187 "program_parse.y" +#line 1191 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3408,7 +3412,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1191 "program_parse.y" +#line 1195 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3417,7 +3421,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1197 "program_parse.y" +#line 1201 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3431,7 +3435,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1212 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3443,7 +3447,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1217 "program_parse.y" +#line 1221 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3452,7 +3456,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1225 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3461,7 +3465,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" +#line 1230 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3470,7 +3474,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1230 "program_parse.y" +#line 1234 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3479,7 +3483,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1238 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3488,7 +3492,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1238 "program_parse.y" +#line 1242 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3497,7 +3501,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1248 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3507,7 +3511,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1251 "program_parse.y" +#line 1255 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3516,7 +3520,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1255 "program_parse.y" +#line 1259 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3525,7 +3529,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1261 "program_parse.y" +#line 1265 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3536,7 +3540,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1269 "program_parse.y" +#line 1273 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3550,7 +3554,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1280 "program_parse.y" +#line 1284 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3560,7 +3564,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1287 "program_parse.y" +#line 1291 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3569,7 +3573,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1291 "program_parse.y" +#line 1295 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3578,7 +3582,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1297 "program_parse.y" +#line 1301 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3591,7 +3595,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1307 "program_parse.y" +#line 1311 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3604,7 +3608,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1317 "program_parse.y" +#line 1321 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3614,7 +3618,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1322 "program_parse.y" +#line 1326 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3635,7 +3639,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1340 "program_parse.y" +#line 1344 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3646,7 +3650,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1348 "program_parse.y" +#line 1352 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3655,7 +3659,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1352 "program_parse.y" +#line 1356 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3664,7 +3668,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1358 "program_parse.y" +#line 1362 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3673,7 +3677,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1362 "program_parse.y" +#line 1366 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3682,7 +3686,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1366 "program_parse.y" +#line 1370 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3691,7 +3695,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1372 "program_parse.y" +#line 1376 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3705,7 +3709,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1383 "program_parse.y" +#line 1387 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3715,7 +3719,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1388 "program_parse.y" +#line 1392 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3725,7 +3729,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1393 "program_parse.y" +#line 1397 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3735,7 +3739,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1398 "program_parse.y" +#line 1402 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3745,7 +3749,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1403 "program_parse.y" +#line 1407 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3755,7 +3759,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1408 "program_parse.y" +#line 1412 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3765,7 +3769,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1415 "program_parse.y" +#line 1419 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3774,7 +3778,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1419 "program_parse.y" +#line 1423 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3783,7 +3787,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1424 "program_parse.y" +#line 1428 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3800,7 +3804,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1437 "program_parse.y" +#line 1441 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3812,7 +3816,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1445 "program_parse.y" +#line 1449 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3826,7 +3830,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1462 "program_parse.y" +#line 1466 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3839,7 +3843,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1472 "program_parse.y" +#line 1476 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3849,7 +3853,7 @@ yyreduce: case 199: /* Line 1455 of yacc.c */ -#line 1477 "program_parse.y" +#line 1481 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3859,7 +3863,7 @@ yyreduce: case 200: /* Line 1455 of yacc.c */ -#line 1484 "program_parse.y" +#line 1488 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3872,7 +3876,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1494 "program_parse.y" +#line 1498 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3885,7 +3889,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1503 "program_parse.y" +#line 1507 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3895,7 +3899,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1508 "program_parse.y" +#line 1512 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3905,7 +3909,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1515 "program_parse.y" +#line 1519 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3918,7 +3922,7 @@ yyreduce: case 205: /* Line 1455 of yacc.c */ -#line 1525 "program_parse.y" +#line 1529 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3931,7 +3935,7 @@ yyreduce: case 206: /* Line 1455 of yacc.c */ -#line 1535 "program_parse.y" +#line 1539 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3944,7 +3948,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1550 "program_parse.y" +#line 1554 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3954,7 +3958,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1557 "program_parse.y" +#line 1561 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3964,7 +3968,7 @@ yyreduce: case 213: /* Line 1455 of yacc.c */ -#line 1562 "program_parse.y" +#line 1566 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -3974,7 +3978,7 @@ yyreduce: case 214: /* Line 1455 of yacc.c */ -#line 1569 "program_parse.y" +#line 1573 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3987,7 +3991,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1577 "program_parse.y" +#line 1581 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4000,7 +4004,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1590 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4013,7 +4017,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1595 "program_parse.y" +#line 1599 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4026,7 +4030,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1605 "program_parse.y" +#line 1609 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4035,7 +4039,7 @@ yyreduce: case 219: /* Line 1455 of yacc.c */ -#line 1609 "program_parse.y" +#line 1613 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4044,42 +4048,42 @@ yyreduce: case 220: /* Line 1455 of yacc.c */ -#line 1614 "program_parse.y" +#line 1618 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 221: /* Line 1455 of yacc.c */ -#line 1615 "program_parse.y" +#line 1619 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1616 "program_parse.y" +#line 1620 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 223: /* Line 1455 of yacc.c */ -#line 1619 "program_parse.y" +#line 1623 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 225: /* Line 1455 of yacc.c */ -#line 1622 "program_parse.y" +#line 1626 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 227: /* Line 1455 of yacc.c */ -#line 1626 "program_parse.y" +#line 1630 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4090,7 +4094,7 @@ yyreduce: case 228: /* Line 1455 of yacc.c */ -#line 1632 "program_parse.y" +#line 1636 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4101,7 +4105,7 @@ yyreduce: case 229: /* Line 1455 of yacc.c */ -#line 1640 "program_parse.y" +#line 1644 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4117,7 +4121,7 @@ yyreduce: case 230: /* Line 1455 of yacc.c */ -#line 1653 "program_parse.y" +#line 1657 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4131,7 +4135,7 @@ yyreduce: case 231: /* Line 1455 of yacc.c */ -#line 1662 "program_parse.y" +#line 1666 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4145,7 +4149,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1671 "program_parse.y" +#line 1675 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4154,7 +4158,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1675 "program_parse.y" +#line 1679 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4168,7 +4172,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1684 "program_parse.y" +#line 1688 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4182,7 +4186,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1693 "program_parse.y" +#line 1697 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4196,7 +4200,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1704 "program_parse.y" +#line 1708 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4205,7 +4209,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1710 "program_parse.y" +#line 1714 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4216,7 +4220,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1716 "program_parse.y" +#line 1720 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4230,7 +4234,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1725 "program_parse.y" +#line 1729 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4244,7 +4248,7 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1736 "program_parse.y" +#line 1740 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4253,7 +4257,7 @@ yyreduce: case 241: /* Line 1455 of yacc.c */ -#line 1740 "program_parse.y" +#line 1744 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4267,7 +4271,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1749 "program_parse.y" +#line 1753 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4281,91 +4285,91 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1759 "program_parse.y" +#line 1763 "program_parse.y" { (yyval.integer) = 0; ;} break; case 244: /* Line 1455 of yacc.c */ -#line 1760 "program_parse.y" +#line 1764 "program_parse.y" { (yyval.integer) = 0; ;} break; case 245: /* Line 1455 of yacc.c */ -#line 1761 "program_parse.y" +#line 1765 "program_parse.y" { (yyval.integer) = 1; ;} break; case 246: /* Line 1455 of yacc.c */ -#line 1764 "program_parse.y" +#line 1768 "program_parse.y" { (yyval.integer) = 0; ;} break; case 247: /* Line 1455 of yacc.c */ -#line 1765 "program_parse.y" +#line 1769 "program_parse.y" { (yyval.integer) = 0; ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1766 "program_parse.y" +#line 1770 "program_parse.y" { (yyval.integer) = 1; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1769 "program_parse.y" +#line 1773 "program_parse.y" { (yyval.integer) = 0; ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1770 "program_parse.y" +#line 1774 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1773 "program_parse.y" +#line 1777 "program_parse.y" { (yyval.integer) = 0; ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1774 "program_parse.y" +#line 1778 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 253: /* Line 1455 of yacc.c */ -#line 1777 "program_parse.y" +#line 1781 "program_parse.y" { (yyval.integer) = 0; ;} break; case 254: /* Line 1455 of yacc.c */ -#line 1778 "program_parse.y" +#line 1782 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 255: /* Line 1455 of yacc.c */ -#line 1782 "program_parse.y" +#line 1786 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4379,7 +4383,7 @@ yyreduce: case 256: /* Line 1455 of yacc.c */ -#line 1793 "program_parse.y" +#line 1797 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4393,7 +4397,7 @@ yyreduce: case 257: /* Line 1455 of yacc.c */ -#line 1804 "program_parse.y" +#line 1808 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4407,7 +4411,7 @@ yyreduce: case 258: /* Line 1455 of yacc.c */ -#line 1815 "program_parse.y" +#line 1819 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4431,7 +4435,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4435 "program_parse.tab.c" +#line 4439 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4650,7 +4654,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1835 "program_parse.y" +#line 1839 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 5008446514..63a176dc8d 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -284,7 +284,11 @@ option: OPTION IDENTIFIER ';' if (!valid) { - yyerror(& @2, state, "invalid option string"); + const char *const err_str = (state->mode == ARB_vertex) + ? "invalid ARB vertex program option" + : "invalid ARB fragment program option"; + + yyerror(& @2, state, err_str); YYERROR; } } -- cgit v1.2.3 From aafd5762593aa01f2d612f4d769d1af383422c1c Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 27 Jul 2009 17:22:21 -0700 Subject: ARB prog parser: Add support for GL_MESA_texture_array This isn't really tested yet as no drivers actually support this extension. --- src/mesa/shader/lex.yy.c | 1319 +++++++++++++------------- src/mesa/shader/program_lexer.l | 5 + src/mesa/shader/program_parse.tab.c | 1657 +++++++++++++++++---------------- src/mesa/shader/program_parse.tab.h | 28 +- src/mesa/shader/program_parse.y | 5 + src/mesa/shader/program_parse_extra.c | 9 + src/mesa/shader/program_parser.h | 1 + 7 files changed, 1560 insertions(+), 1464 deletions(-) diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 1809d1e7f7..6202ca44c8 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -357,8 +357,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner ); *yy_cp = '\0'; \ yyg->yy_c_buf_p = yy_cp; -#define YY_NUM_RULES 179 -#define YY_END_OF_BUFFER 180 +#define YY_NUM_RULES 183 +#define YY_END_OF_BUFFER 184 /* This struct is not used in this scanner, but its presence is necessary. */ struct yy_trans_info @@ -366,80 +366,82 @@ struct yy_trans_info flex_int32_t yy_verify; flex_int32_t yy_nxt; }; -static yyconst flex_int16_t yy_accept[658] = +static yyconst flex_int16_t yy_accept[675] = { 0, - 0, 0, 180, 178, 176, 175, 178, 178, 148, 174, - 150, 150, 150, 150, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 176, 0, 0, 177, 148, 0, - 149, 151, 171, 171, 0, 0, 0, 0, 171, 0, - 0, 0, 0, 0, 0, 0, 132, 172, 133, 134, - 162, 162, 162, 162, 0, 150, 0, 140, 141, 142, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 170, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 169, 169, 0, 0, 0, + 0, 0, 184, 182, 180, 179, 182, 182, 152, 178, + 154, 154, 154, 154, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 180, 0, 0, 181, 152, 0, + 153, 155, 175, 175, 0, 0, 0, 0, 175, 0, + 0, 0, 0, 0, 0, 0, 132, 176, 133, 134, + 166, 166, 166, 166, 0, 154, 0, 140, 141, 142, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 174, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 173, 173, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 168, 168, 168, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 159, 159, 159, 160, 160, 161, 152, - 151, 152, 0, 153, 11, 13, 148, 15, 148, 16, - 18, 148, 20, 22, 24, 26, 6, 28, 30, 31, - 33, 35, 38, 36, 40, 41, 43, 45, 47, 49, - - 51, 148, 148, 148, 53, 55, 148, 57, 59, 61, - 148, 63, 65, 67, 69, 148, 71, 73, 75, 77, - 148, 148, 148, 148, 148, 148, 0, 0, 0, 0, - 151, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 93, 94, 96, 0, 167, 0, 0, 0, 0, - 0, 0, 110, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 166, 165, 165, 122, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 156, 156, 157, - 158, 0, 154, 148, 148, 148, 148, 148, 148, 148, - 143, 148, 148, 148, 148, 148, 148, 148, 148, 148, - - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 144, 148, 148, 148, 148, 148, 148, 148, 148, - 10, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 0, 173, 0, 0, 0, 86, 87, 0, 0, - 0, 0, 0, 0, 0, 98, 0, 0, 0, 0, + 172, 172, 172, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 163, 163, 163, 164, 164, 165, 156, + 155, 156, 0, 157, 11, 13, 152, 15, 152, 152, + 16, 18, 152, 20, 22, 24, 26, 6, 28, 30, + 31, 33, 35, 38, 36, 40, 41, 43, 45, 47, + + 49, 51, 152, 152, 152, 53, 55, 152, 57, 59, + 61, 152, 63, 65, 67, 69, 152, 71, 73, 75, + 77, 152, 152, 152, 152, 152, 152, 0, 0, 0, + 0, 155, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 93, 94, 96, 0, 171, 0, 0, 0, + 0, 0, 0, 110, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 170, 169, 169, 122, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 160, 160, + 161, 162, 0, 158, 152, 152, 152, 152, 152, 152, + 152, 152, 143, 152, 152, 152, 152, 152, 152, 152, + + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 144, 152, 152, 152, 152, 152, 152, + 152, 152, 10, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 0, 177, 0, 0, 0, 86, 87, + 0, 0, 0, 0, 0, 0, 0, 98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 164, 0, 0, 0, 126, 0, - 128, 0, 0, 0, 0, 0, 0, 163, 155, 148, - 148, 148, 4, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - - 148, 148, 148, 9, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 82, 148, 148, 0, 0, 0, 0, 0, 88, - 89, 0, 0, 0, 0, 97, 0, 0, 101, 104, - 0, 0, 0, 0, 0, 0, 0, 115, 116, 0, - 0, 0, 0, 121, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 148, 148, 148, 5, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - 148, 148, 148, 148, 148, 7, 8, 148, 148, 148, - 148, 148, 148, 148, 148, 148, 148, 148, 148, 148, - - 148, 148, 148, 83, 148, 79, 0, 0, 0, 0, - 137, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 107, 0, 111, 112, 0, 114, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 130, 131, 0, 0, - 138, 12, 3, 14, 17, 19, 21, 23, 25, 27, - 29, 32, 34, 39, 37, 42, 44, 46, 48, 50, - 52, 54, 56, 58, 60, 62, 148, 148, 148, 64, - 66, 68, 70, 72, 74, 76, 78, 148, 81, 139, - 0, 0, 84, 0, 90, 0, 0, 0, 99, 0, - 0, 0, 0, 0, 0, 113, 0, 0, 119, 106, - - 0, 0, 0, 0, 0, 0, 135, 0, 145, 146, - 148, 80, 0, 0, 0, 0, 92, 95, 100, 0, + 0, 0, 0, 0, 0, 0, 168, 0, 0, 0, + 126, 0, 128, 0, 0, 0, 0, 0, 0, 167, + 159, 152, 152, 152, 4, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + + 152, 152, 152, 152, 152, 152, 9, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 82, 152, 152, 0, 0, 0, + 0, 0, 88, 89, 0, 0, 0, 0, 97, 0, + 0, 101, 104, 0, 0, 0, 0, 0, 0, 0, + 115, 116, 0, 0, 0, 0, 121, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 152, 152, 152, + 152, 152, 152, 5, 152, 152, 152, 152, 152, 152, + 152, 152, 152, 152, 152, 152, 152, 152, 152, 152, + 152, 7, 8, 152, 152, 152, 152, 152, 152, 152, + + 152, 152, 152, 152, 152, 152, 152, 152, 152, 83, + 152, 79, 0, 0, 0, 0, 137, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 107, 0, 111, 112, + 0, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 130, 131, 0, 0, 138, 12, 3, 14, + 148, 149, 152, 17, 19, 21, 23, 25, 27, 29, + 32, 34, 39, 37, 42, 44, 46, 48, 50, 52, + 54, 56, 58, 60, 62, 152, 152, 152, 64, 66, + 68, 70, 72, 74, 76, 78, 152, 81, 139, 0, + 0, 84, 0, 90, 0, 0, 0, 99, 0, 0, + + 0, 0, 0, 0, 113, 0, 0, 119, 106, 0, + 0, 0, 0, 0, 0, 135, 0, 152, 145, 146, + 152, 80, 0, 0, 0, 0, 92, 95, 100, 0, 0, 105, 0, 0, 0, 118, 0, 0, 0, 0, - 127, 129, 0, 148, 2, 1, 0, 91, 0, 103, - 0, 109, 117, 0, 0, 124, 125, 136, 147, 0, - 102, 0, 120, 123, 85, 108, 0 + 127, 129, 0, 152, 152, 2, 1, 0, 91, 0, + 103, 0, 109, 117, 0, 0, 124, 125, 136, 152, + 147, 0, 102, 0, 120, 123, 152, 85, 108, 152, + 152, 150, 151, 0 } ; static yyconst flex_int32_t yy_ec[256] = @@ -452,12 +454,12 @@ static yyconst flex_int32_t yy_ec[256] = 12, 13, 14, 14, 14, 14, 14, 1, 1, 1, 1, 1, 1, 1, 15, 16, 17, 18, 19, 20, 21, 22, 23, 6, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 6, 38, - 1, 1, 1, 1, 39, 1, 40, 41, 42, 43, + 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, + 1, 1, 1, 1, 40, 1, 41, 42, 43, 44, - 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, - 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, - 64, 65, 1, 1, 1, 1, 1, 1, 1, 1, + 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, + 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, + 65, 66, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -474,284 +476,289 @@ static yyconst flex_int32_t yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst flex_int32_t yy_meta[66] = +static yyconst flex_int32_t yy_meta[67] = { 0, 1, 1, 1, 1, 1, 2, 1, 3, 4, 4, 4, 4, 4, 4, 2, 2, 2, 4, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 2, 4, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 2 + 2, 2, 2, 2, 2, 2 } ; -static yyconst flex_int16_t yy_base[662] = +static yyconst flex_int16_t yy_base[679] = { 0, - 0, 0, 917, 918, 914, 918, 911, 911, 0, 64, - 80, 95, 117, 895, 115, 53, 38, 58, 55, 889, - 121, 122, 67, 54, 115, 137, 65, 882, 853, 852, - 864, 848, 862, 861, 902, 888, 899, 918, 0, 172, - 918, 156, 136, 139, 17, 107, 134, 43, 151, 861, - 847, 109, 149, 845, 857, 150, 918, 192, 193, 86, - 192, 180, 188, 196, 253, 265, 276, 918, 918, 918, - 865, 878, 872, 869, 860, 863, 859, 874, 258, 856, - 870, 170, 856, 869, 860, 873, 850, 861, 852, 135, - 853, 844, 853, 844, 843, 844, 838, 844, 855, 841, - - 838, 850, 853, 840, 833, 849, 826, 157, 189, 845, - 822, 807, 802, 819, 795, 800, 825, 150, 815, 124, - 810, 289, 264, 812, 793, 266, 803, 799, 794, 224, - 800, 786, 802, 799, 790, 273, 276, 792, 781, 795, - 798, 780, 795, 782, 779, 786, 267, 794, 163, 272, - 288, 291, 298, 771, 788, 789, 782, 764, 238, 765, - 787, 778, 287, 294, 298, 302, 306, 310, 314, 918, - 371, 382, 388, 394, 786, 208, 809, 0, 792, 783, - 782, 801, 780, 779, 778, 777, 0, 776, 0, 775, - 774, 0, 773, 772, 0, 771, 770, 769, 768, 767, - - 766, 781, 774, 787, 762, 761, 766, 759, 758, 757, - 777, 755, 754, 753, 752, 761, 750, 749, 748, 747, - 739, 738, 723, 723, 722, 721, 763, 736, 724, 400, - 407, 382, 728, 283, 725, 719, 719, 713, 726, 726, - 711, 918, 918, 726, 714, 384, 721, 39, 718, 724, - 383, 719, 918, 710, 717, 716, 719, 705, 704, 708, - 703, 92, 708, 391, 403, 405, 918, 700, 698, 698, - 706, 707, 689, 408, 694, 700, 371, 393, 401, 406, - 410, 467, 473, 713, 725, 711, 710, 718, 708, 707, - 0, 706, 705, 704, 703, 702, 701, 700, 699, 698, - - 697, 696, 695, 694, 693, 692, 695, 688, 695, 688, - 687, 0, 686, 685, 684, 687, 682, 681, 680, 679, - 0, 678, 677, 676, 675, 654, 648, 653, 659, 642, - 657, 161, 918, 656, 646, 650, 918, 918, 640, 649, - 635, 652, 635, 638, 632, 918, 633, 632, 629, 636, - 629, 637, 633, 643, 640, 622, 628, 635, 619, 618, - 636, 618, 630, 629, 918, 628, 618, 622, 918, 609, - 918, 614, 614, 622, 605, 606, 616, 918, 918, 647, - 629, 645, 0, 643, 643, 642, 641, 640, 639, 638, - 637, 636, 635, 634, 633, 632, 631, 630, 629, 628, - - 627, 614, 607, 0, 624, 623, 622, 621, 620, 598, - 618, 617, 616, 615, 614, 613, 612, 611, 581, 584, - 564, 0, 565, 558, 565, 564, 565, 557, 575, 918, - 918, 557, 555, 565, 558, 918, 553, 570, 239, 918, - 561, 545, 546, 555, 546, 545, 545, 918, 544, 553, - 543, 559, 556, 918, 555, 553, 542, 543, 539, 531, - 538, 533, 534, 529, 554, 554, 552, 0, 551, 550, - 549, 548, 547, 546, 545, 544, 543, 542, 541, 540, - 539, 538, 537, 536, 535, 0, 0, 534, 533, 532, - 531, 530, 478, 529, 528, 527, 526, 525, 524, 523, - - 522, 501, 501, 0, 508, 0, 541, 540, 490, 508, - 918, 503, 498, 491, 487, 499, 489, 487, 483, 499, - 490, 489, 918, 918, 492, 918, 487, 480, 469, 480, - 472, 476, 489, 484, 487, 469, 918, 918, 481, 470, - 918, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 935, 936, 932, 936, 929, 929, 0, 65, + 81, 97, 119, 913, 116, 54, 39, 59, 56, 907, + 112, 129, 68, 55, 129, 133, 66, 900, 870, 869, + 881, 865, 879, 878, 920, 906, 917, 936, 0, 168, + 936, 162, 136, 143, 17, 117, 126, 43, 145, 878, + 864, 90, 174, 862, 874, 147, 936, 191, 192, 137, + 189, 179, 193, 197, 255, 267, 278, 936, 936, 936, + 883, 896, 890, 128, 879, 882, 878, 893, 260, 875, + 889, 189, 875, 888, 879, 892, 869, 880, 871, 233, + 872, 863, 872, 863, 862, 863, 857, 863, 874, 860, + + 857, 869, 872, 859, 852, 868, 844, 167, 190, 864, + 840, 825, 820, 837, 813, 818, 844, 241, 833, 110, + 828, 295, 256, 830, 811, 274, 821, 817, 812, 225, + 818, 804, 820, 817, 808, 277, 281, 810, 799, 813, + 816, 798, 813, 800, 797, 804, 241, 812, 149, 271, + 289, 299, 303, 789, 806, 807, 800, 782, 282, 783, + 805, 796, 288, 299, 303, 307, 311, 315, 319, 936, + 377, 388, 394, 400, 804, 199, 828, 0, 827, 810, + 800, 799, 819, 797, 796, 795, 794, 0, 793, 0, + 792, 791, 0, 790, 789, 0, 788, 787, 786, 785, + + 784, 783, 799, 792, 805, 779, 778, 784, 776, 775, + 774, 795, 772, 771, 770, 769, 779, 767, 766, 765, + 764, 756, 755, 740, 740, 739, 738, 781, 753, 741, + 406, 414, 388, 745, 280, 742, 736, 736, 730, 743, + 743, 728, 936, 936, 743, 731, 390, 738, 39, 735, + 741, 284, 736, 936, 727, 734, 733, 736, 722, 721, + 725, 720, 200, 725, 392, 400, 402, 936, 717, 715, + 715, 723, 724, 706, 393, 711, 717, 391, 398, 402, + 406, 410, 468, 474, 731, 743, 729, 728, 721, 735, + 725, 724, 0, 723, 722, 721, 720, 719, 718, 717, + + 716, 715, 714, 713, 712, 711, 710, 709, 712, 705, + 712, 705, 704, 0, 703, 702, 701, 704, 699, 698, + 697, 696, 0, 695, 694, 693, 692, 670, 664, 669, + 675, 658, 673, 249, 936, 672, 662, 666, 936, 936, + 656, 665, 651, 668, 651, 654, 648, 936, 649, 648, + 645, 652, 645, 653, 649, 659, 656, 638, 644, 651, + 635, 634, 652, 634, 646, 645, 936, 644, 634, 638, + 936, 625, 936, 630, 630, 638, 621, 622, 632, 936, + 936, 664, 646, 662, 0, 323, 660, 660, 659, 658, + 657, 656, 655, 654, 653, 652, 651, 650, 649, 648, + + 647, 646, 645, 644, 631, 624, 0, 641, 640, 639, + 638, 637, 615, 635, 634, 633, 632, 631, 630, 629, + 628, 597, 600, 580, 0, 581, 574, 581, 580, 581, + 573, 591, 936, 936, 573, 571, 581, 574, 936, 569, + 586, 257, 936, 577, 561, 562, 571, 562, 561, 561, + 936, 560, 569, 559, 575, 572, 936, 571, 569, 558, + 559, 555, 547, 554, 549, 550, 545, 571, 571, 569, + 583, 582, 577, 0, 565, 564, 563, 562, 561, 560, + 559, 558, 557, 556, 555, 554, 553, 552, 551, 550, + 549, 0, 0, 548, 547, 546, 545, 544, 479, 543, + + 542, 541, 540, 539, 538, 537, 536, 514, 514, 0, + 521, 0, 555, 554, 503, 521, 936, 516, 511, 504, + 500, 512, 502, 500, 496, 512, 503, 502, 936, 936, + 505, 936, 500, 493, 482, 493, 485, 489, 502, 497, + 500, 482, 936, 936, 494, 483, 936, 0, 0, 0, + 0, 0, 522, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 505, 503, 496, 0, - 0, 0, 0, 0, 0, 0, 0, 449, 0, 0, - 499, 498, 918, 446, 918, 450, 450, 459, 918, 443, - 457, 445, 447, 444, 452, 918, 430, 441, 918, 918, - - 445, 441, 434, 432, 404, 416, 918, 395, 0, 0, - 430, 0, 433, 429, 381, 373, 918, 918, 918, 344, - 344, 918, 343, 292, 309, 918, 293, 292, 279, 284, - 918, 918, 292, 302, 918, 918, 271, 918, 264, 918, - 267, 918, 918, 242, 236, 918, 918, 918, 0, 215, - 918, 121, 918, 918, 918, 918, 918, 509, 512, 514, - 518 + 0, 0, 0, 0, 0, 518, 517, 515, 0, 0, + 0, 0, 0, 0, 0, 0, 473, 0, 0, 524, + 523, 936, 470, 936, 474, 474, 483, 936, 467, 481, + + 469, 470, 462, 464, 936, 442, 453, 936, 936, 457, + 453, 446, 444, 444, 457, 936, 441, 481, 0, 0, + 481, 0, 488, 487, 446, 440, 936, 936, 936, 448, + 448, 936, 447, 396, 407, 936, 396, 390, 356, 335, + 936, 936, 348, 364, 327, 936, 936, 304, 936, 306, + 936, 311, 936, 936, 242, 226, 936, 936, 936, 161, + 0, 114, 936, 96, 936, 936, 338, 936, 936, 118, + 86, 0, 0, 936, 510, 513, 515, 519 } ; -static yyconst flex_int16_t yy_def[662] = +static yyconst flex_int16_t yy_def[679] = { 0, - 657, 1, 657, 657, 657, 657, 657, 658, 659, 657, - 657, 660, 660, 13, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 657, 657, 658, 657, 659, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 661, 657, 657, 657, 657, 657, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - - 659, 659, 659, 659, 659, 659, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 659, 659, 659, 659, 659, 659, 659, 659, 659, 659, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - - 657, 657, 657, 657, 657, 657, 657, 657, 659, 659, - 659, 659, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 659, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 659, 657, - 657, 657, 657, 657, 657, 657, 0, 657, 657, 657, - 657 + 674, 1, 674, 674, 674, 674, 674, 675, 676, 674, + 674, 677, 677, 13, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 674, 674, 675, 674, 676, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 678, 674, 674, 674, 674, 674, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, + 676, 676, 676, 676, 676, 676, 676, 676, 676, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 676, 676, 676, + 676, 676, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 676, 676, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 676, + 676, 674, 674, 674, 674, 674, 676, 674, 674, 676, + 676, 676, 676, 0, 674, 674, 674, 674 } ; -static yyconst flex_int16_t yy_nxt[984] = +static yyconst flex_int16_t yy_nxt[1003] = { 0, 4, 5, 6, 7, 8, 9, 4, 10, 11, 12, 13, 14, 11, 11, 15, 9, 16, 17, 18, 19, 9, 9, 9, 20, 21, 22, 9, 23, 24, 9, 25, 26, 27, 9, 9, 9, 28, 9, 9, 9, - 9, 9, 9, 9, 29, 9, 9, 9, 9, 9, - 9, 9, 9, 9, 30, 9, 31, 32, 33, 9, - 34, 9, 9, 9, 9, 40, 79, 127, 96, 80, - 128, 41, 42, 42, 42, 42, 42, 42, 76, 83, - 77, 97, 347, 108, 81, 84, 78, 65, 66, 66, - 66, 66, 66, 66, 82, 94, 134, 348, 67, 135, - - 95, 109, 65, 43, 44, 45, 46, 47, 48, 49, - 50, 51, 68, 67, 52, 53, 54, 55, 56, 57, - 58, 59, 60, 67, 65, 61, 62, 63, 64, 160, - 71, 98, 72, 99, 69, 67, 90, 362, 67, 73, - 363, 86, 161, 87, 91, 74, 100, 75, 88, 92, - 129, 89, 197, 101, 130, 93, 140, 102, 103, 104, - 67, 105, 141, 229, 42, 42, 42, 42, 42, 42, - 106, 198, 107, 40, 122, 123, 123, 154, 126, 123, - 188, 123, 216, 656, 123, 131, 132, 124, 142, 147, - 136, 137, 123, 217, 125, 123, 123, 133, 189, 122, - - 148, 124, 143, 149, 218, 425, 150, 123, 125, 144, - 259, 118, 119, 45, 46, 47, 48, 219, 50, 51, - 260, 426, 52, 53, 54, 55, 56, 57, 120, 59, - 60, 151, 152, 121, 155, 162, 156, 153, 285, 157, - 158, 164, 163, 165, 166, 154, 286, 159, 123, 167, - 163, 163, 168, 163, 163, 163, 163, 169, 163, 163, - 163, 171, 171, 171, 171, 171, 171, 655, 239, 183, - 184, 172, 65, 66, 66, 66, 66, 66, 66, 185, - 240, 272, 173, 67, 174, 174, 174, 174, 174, 174, - 518, 273, 654, 519, 653, 230, 172, 231, 231, 231, - - 231, 231, 231, 232, 232, 232, 232, 235, 67, 232, - 652, 232, 232, 232, 651, 246, 232, 256, 232, 261, - 232, 232, 232, 257, 650, 262, 335, 232, 232, 232, - 264, 232, 232, 232, 649, 648, 232, 265, 266, 336, - 263, 647, 646, 232, 232, 645, 644, 232, 277, 277, - 277, 277, 643, 642, 232, 277, 277, 277, 277, 278, - 277, 277, 279, 280, 277, 277, 277, 277, 277, 277, - 277, 281, 277, 277, 277, 277, 277, 277, 277, 42, - 42, 42, 42, 42, 42, 641, 640, 639, 282, 122, - 283, 283, 283, 283, 283, 283, 174, 174, 174, 174, - - 174, 174, 174, 174, 174, 174, 174, 174, 231, 231, - 231, 231, 231, 231, 122, 231, 231, 231, 231, 231, - 231, 333, 333, 333, 333, 638, 351, 333, 637, 333, - 333, 333, 378, 378, 378, 378, 333, 636, 333, 352, - 333, 635, 333, 333, 365, 333, 634, 333, 333, 372, - 333, 373, 633, 374, 378, 378, 378, 378, 632, 333, - 631, 333, 379, 378, 378, 378, 375, 378, 378, 378, - 378, 378, 378, 378, 378, 283, 283, 283, 283, 283, - 283, 283, 283, 283, 283, 283, 283, 567, 568, 630, - 629, 628, 627, 626, 625, 624, 623, 622, 621, 620, - - 619, 618, 617, 616, 615, 614, 613, 612, 569, 37, - 37, 37, 37, 39, 611, 39, 66, 66, 170, 170, - 610, 170, 609, 608, 607, 606, 605, 604, 603, 602, - 601, 600, 599, 598, 597, 596, 595, 594, 593, 592, - 591, 590, 589, 588, 587, 586, 585, 584, 583, 582, - 581, 580, 579, 578, 577, 576, 575, 574, 573, 572, - 571, 570, 566, 565, 564, 563, 562, 561, 560, 559, - 558, 557, 556, 555, 554, 553, 552, 551, 550, 549, - 548, 547, 546, 545, 544, 543, 542, 541, 540, 539, - 538, 537, 536, 535, 534, 533, 532, 531, 530, 529, - - 528, 527, 526, 525, 524, 523, 522, 521, 520, 517, - 516, 515, 514, 513, 512, 511, 510, 509, 508, 507, - 506, 505, 504, 503, 502, 501, 500, 499, 498, 497, - 496, 495, 494, 493, 492, 491, 490, 489, 488, 487, - 486, 485, 484, 483, 482, 481, 480, 479, 478, 477, - 476, 475, 474, 473, 472, 471, 470, 469, 468, 467, + 9, 9, 9, 9, 9, 29, 9, 9, 9, 9, + 9, 9, 9, 9, 9, 30, 9, 31, 32, 33, + 9, 34, 9, 9, 9, 9, 40, 79, 127, 96, + 80, 128, 41, 42, 42, 42, 42, 42, 42, 76, + 83, 77, 97, 349, 108, 81, 84, 78, 65, 66, + 66, 66, 66, 66, 66, 82, 94, 134, 350, 67, + + 135, 95, 109, 673, 65, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 68, 67, 52, 53, 54, 55, + 56, 57, 58, 59, 60, 67, 65, 61, 62, 63, + 64, 71, 86, 72, 87, 672, 69, 67, 140, 88, + 73, 67, 89, 90, 141, 98, 74, 99, 75, 101, + 230, 91, 178, 102, 103, 104, 92, 105, 179, 669, + 100, 129, 93, 67, 154, 130, 106, 668, 107, 40, + 42, 42, 42, 42, 42, 42, 123, 123, 131, 132, + 122, 160, 123, 126, 123, 136, 137, 147, 124, 123, + 133, 123, 217, 123, 161, 125, 667, 260, 148, 189, + + 123, 149, 123, 218, 150, 219, 122, 261, 118, 119, + 45, 46, 47, 48, 142, 50, 51, 190, 220, 52, + 53, 54, 55, 56, 57, 120, 59, 60, 143, 286, + 121, 151, 152, 162, 155, 144, 156, 153, 287, 157, + 158, 164, 163, 165, 166, 154, 364, 159, 123, 365, + 198, 163, 163, 163, 163, 167, 163, 163, 168, 169, + 163, 163, 163, 171, 171, 171, 171, 171, 171, 199, + 240, 184, 185, 172, 65, 66, 66, 66, 66, 66, + 66, 186, 241, 666, 173, 67, 174, 174, 174, 174, + 174, 174, 257, 124, 428, 665, 233, 233, 258, 172, + + 125, 231, 233, 232, 232, 232, 232, 232, 232, 524, + 429, 67, 525, 233, 233, 233, 236, 233, 233, 262, + 233, 247, 233, 233, 337, 263, 273, 233, 353, 233, + 233, 233, 471, 472, 233, 233, 274, 338, 233, 265, + 233, 354, 264, 266, 267, 233, 233, 670, 671, 233, + 278, 278, 278, 278, 473, 664, 233, 663, 662, 661, + 233, 278, 278, 278, 278, 279, 278, 278, 280, 281, + 278, 278, 278, 278, 278, 278, 278, 282, 278, 278, + 278, 278, 278, 278, 278, 42, 42, 42, 42, 42, + 42, 660, 659, 658, 283, 122, 284, 284, 284, 284, + + 284, 284, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 174, 232, 232, 232, 232, 232, 232, + 657, 122, 232, 232, 232, 232, 232, 232, 335, 335, + 335, 335, 335, 335, 335, 374, 335, 375, 335, 376, + 335, 335, 367, 335, 656, 335, 335, 335, 335, 335, + 655, 654, 377, 380, 380, 380, 380, 335, 653, 335, + 380, 380, 380, 380, 381, 380, 380, 380, 380, 380, + 380, 380, 380, 380, 380, 380, 284, 284, 284, 284, + 284, 284, 284, 284, 284, 284, 284, 284, 576, 577, + 652, 651, 650, 649, 648, 647, 646, 645, 644, 643, + + 642, 641, 640, 639, 638, 637, 636, 635, 634, 578, + 37, 37, 37, 37, 39, 633, 39, 66, 66, 170, + 170, 632, 170, 631, 630, 629, 628, 627, 626, 625, + 624, 623, 622, 621, 620, 619, 618, 617, 616, 615, + 614, 613, 612, 611, 610, 609, 608, 607, 606, 605, + 604, 603, 602, 601, 600, 599, 598, 597, 596, 595, + 594, 593, 592, 591, 590, 589, 588, 587, 586, 585, + 584, 583, 582, 581, 580, 579, 575, 574, 573, 572, + 571, 570, 569, 568, 567, 566, 565, 564, 563, 562, + 561, 560, 559, 558, 557, 556, 555, 554, 553, 552, + + 551, 550, 549, 548, 547, 546, 545, 544, 543, 542, + 541, 540, 539, 538, 537, 536, 535, 534, 533, 532, + 531, 530, 529, 528, 527, 526, 523, 522, 521, 520, + 519, 518, 517, 516, 515, 514, 513, 512, 511, 510, + 509, 508, 507, 506, 505, 504, 503, 502, 501, 500, + 499, 498, 497, 496, 495, 494, 493, 492, 491, 490, + 489, 488, 487, 486, 485, 484, 483, 482, 481, 480, + 479, 478, 477, 476, 475, 474, 470, 469, 468, 467, 466, 465, 464, 463, 462, 461, 460, 459, 458, 457, 456, 455, 454, 453, 452, 451, 450, 449, 448, 447, - 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, - 436, 435, 434, 433, 432, 431, 430, 429, 428, 427, + 446, 445, 444, 443, 442, 441, 440, 439, 438, 437, + 436, 435, 434, 433, 432, 431, 430, 427, 426, 425, 424, 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, 413, 412, 411, 410, 409, 408, 407, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, 392, 391, 390, 389, 388, 387, 386, 385, - 384, 383, 382, 381, 380, 377, 376, 371, 370, 369, - 368, 367, 366, 364, 361, 360, 359, 358, 357, 356, - 355, 354, 353, 350, 349, 346, 345, 344, 343, 342, - 341, 340, 339, 338, 337, 334, 263, 235, 332, 331, + 384, 383, 382, 379, 378, 373, 372, 371, 370, 369, + 368, 366, 363, 362, 361, 360, 359, 358, 357, 356, + 355, 352, 351, 348, 347, 346, 345, 344, 343, 342, + 341, 340, 339, 336, 264, 236, 334, 333, 332, 331, + 330, 329, 328, 327, 326, 325, 324, 323, 322, 321, 320, 319, 318, 317, 316, 315, 314, 313, 312, 311, - 310, 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, 294, 293, 292, 291, - 290, 289, 288, 287, 284, 276, 275, 274, 271, 270, - 269, 268, 267, 258, 255, 254, 253, 252, 251, 250, - 249, 248, 247, 245, 244, 243, 242, 241, 238, 237, - 236, 234, 233, 162, 228, 227, 226, 225, 224, 223, - 222, 221, 220, 215, 214, 213, 212, 211, 210, 209, - 208, 207, 206, 205, 204, 203, 202, 201, 200, 199, - 196, 195, 194, 193, 192, 191, 190, 187, 186, 182, - 181, 180, 179, 178, 177, 176, 175, 146, 145, 139, - - 138, 38, 117, 35, 116, 115, 114, 113, 112, 111, - 110, 85, 70, 38, 36, 35, 657, 3, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657 + 290, 289, 288, 285, 277, 276, 275, 272, 271, 270, + 269, 268, 259, 256, 255, 254, 253, 252, 251, 250, + 249, 248, 246, 245, 244, 243, 242, 239, 238, 237, + 235, 234, 162, 229, 228, 227, 226, 225, 224, 223, + 222, 221, 216, 215, 214, 213, 212, 211, 210, 209, + 208, 207, 206, 205, 204, 203, 202, 201, 200, 197, + + 196, 195, 194, 193, 192, 191, 188, 187, 183, 182, + 181, 180, 177, 176, 175, 146, 145, 139, 138, 38, + 117, 35, 116, 115, 114, 113, 112, 111, 110, 85, + 70, 38, 36, 35, 674, 3, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + + 674, 674 } ; -static yyconst flex_int16_t yy_chk[984] = +static yyconst flex_int16_t yy_chk[1003] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -759,108 +766,111 @@ static yyconst flex_int16_t yy_chk[984] = 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 10, 17, 45, 24, 17, - 45, 10, 10, 10, 10, 10, 10, 10, 16, 19, - 16, 24, 248, 27, 18, 19, 16, 11, 11, 11, - 11, 11, 11, 11, 18, 23, 48, 248, 11, 48, - - 23, 27, 12, 10, 10, 10, 10, 10, 10, 10, - 10, 10, 12, 12, 10, 10, 10, 10, 10, 10, - 10, 10, 10, 11, 13, 10, 10, 10, 10, 60, - 15, 25, 15, 25, 13, 13, 22, 262, 12, 15, - 262, 21, 60, 21, 22, 15, 25, 15, 21, 22, - 46, 21, 90, 26, 46, 22, 52, 26, 26, 26, - 13, 26, 52, 120, 42, 42, 42, 42, 42, 42, - 26, 90, 26, 40, 42, 43, 43, 120, 44, 44, - 82, 43, 108, 652, 44, 47, 47, 43, 53, 56, - 49, 49, 43, 108, 43, 44, 49, 47, 82, 42, - - 56, 118, 53, 56, 109, 332, 56, 49, 118, 53, - 149, 40, 40, 40, 40, 40, 40, 109, 40, 40, - 149, 332, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 58, 58, 40, 59, 61, 59, 58, 176, 59, - 59, 62, 62, 62, 62, 58, 176, 59, 58, 63, - 63, 63, 63, 61, 61, 61, 61, 64, 64, 64, - 64, 65, 65, 65, 65, 65, 65, 650, 130, 79, - 79, 65, 66, 66, 66, 66, 66, 66, 66, 79, - 130, 159, 67, 66, 67, 67, 67, 67, 67, 67, - 439, 159, 645, 439, 644, 122, 65, 122, 122, 122, - - 122, 122, 122, 123, 123, 126, 126, 126, 66, 123, - 641, 126, 136, 136, 639, 137, 137, 147, 136, 150, - 123, 137, 126, 147, 637, 150, 234, 151, 151, 136, - 152, 152, 137, 151, 634, 633, 152, 153, 153, 234, - 151, 630, 629, 153, 151, 628, 627, 152, 163, 163, - 163, 163, 625, 624, 153, 164, 164, 164, 164, 165, - 165, 165, 165, 166, 166, 166, 166, 167, 167, 167, - 167, 168, 168, 168, 168, 169, 169, 169, 169, 171, - 171, 171, 171, 171, 171, 623, 621, 620, 172, 171, - 172, 172, 172, 172, 172, 172, 173, 173, 173, 173, - - 173, 173, 174, 174, 174, 174, 174, 174, 230, 230, - 230, 230, 230, 230, 171, 231, 231, 231, 231, 231, - 231, 232, 232, 246, 246, 616, 251, 232, 615, 246, - 264, 264, 277, 277, 277, 277, 264, 614, 232, 251, - 246, 613, 265, 265, 266, 266, 611, 264, 265, 274, - 266, 274, 608, 274, 278, 278, 278, 278, 606, 265, - 605, 266, 279, 279, 279, 279, 274, 280, 280, 280, - 280, 281, 281, 281, 281, 282, 282, 282, 282, 282, - 282, 283, 283, 283, 283, 283, 283, 493, 493, 604, - 603, 602, 601, 598, 597, 595, 594, 593, 592, 591, - - 590, 588, 587, 586, 584, 582, 581, 578, 493, 658, - 658, 658, 658, 659, 569, 659, 660, 660, 661, 661, - 568, 661, 567, 540, 539, 536, 535, 534, 533, 532, - 531, 530, 529, 528, 527, 525, 522, 521, 520, 519, - 518, 517, 516, 515, 514, 513, 512, 510, 509, 508, - 507, 505, 503, 502, 501, 500, 499, 498, 497, 496, - 495, 494, 492, 491, 490, 489, 488, 485, 484, 483, - 482, 481, 480, 479, 478, 477, 476, 475, 474, 473, - 472, 471, 470, 469, 467, 466, 465, 464, 463, 462, - 461, 460, 459, 458, 457, 456, 455, 453, 452, 451, - - 450, 449, 447, 446, 445, 444, 443, 442, 441, 438, - 437, 435, 434, 433, 432, 429, 428, 427, 426, 425, - 424, 423, 421, 420, 419, 418, 417, 416, 415, 414, - 413, 412, 411, 410, 409, 408, 407, 406, 405, 403, + 1, 1, 1, 1, 1, 1, 10, 17, 45, 24, + 17, 45, 10, 10, 10, 10, 10, 10, 10, 16, + 19, 16, 24, 249, 27, 18, 19, 16, 11, 11, + 11, 11, 11, 11, 11, 18, 23, 48, 249, 11, + + 48, 23, 27, 671, 12, 10, 10, 10, 10, 10, + 10, 10, 10, 10, 12, 12, 10, 10, 10, 10, + 10, 10, 10, 10, 10, 11, 13, 10, 10, 10, + 10, 15, 21, 15, 21, 670, 13, 13, 52, 21, + 15, 12, 21, 22, 52, 25, 15, 25, 15, 26, + 120, 22, 74, 26, 26, 26, 22, 26, 74, 664, + 25, 46, 22, 13, 120, 46, 26, 662, 26, 40, + 42, 42, 42, 42, 42, 42, 43, 43, 47, 47, + 42, 60, 43, 44, 44, 49, 49, 56, 43, 44, + 47, 49, 108, 43, 60, 43, 660, 149, 56, 82, + + 44, 56, 49, 108, 56, 109, 42, 149, 40, 40, + 40, 40, 40, 40, 53, 40, 40, 82, 109, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 53, 176, + 40, 58, 58, 61, 59, 53, 59, 58, 176, 59, + 59, 62, 62, 62, 62, 58, 263, 59, 58, 263, + 90, 61, 61, 61, 61, 63, 63, 63, 63, 64, + 64, 64, 64, 65, 65, 65, 65, 65, 65, 90, + 130, 79, 79, 65, 66, 66, 66, 66, 66, 66, + 66, 79, 130, 656, 67, 66, 67, 67, 67, 67, + 67, 67, 147, 118, 334, 655, 123, 123, 147, 65, + + 118, 122, 123, 122, 122, 122, 122, 122, 122, 442, + 334, 66, 442, 123, 126, 126, 126, 136, 136, 150, + 126, 137, 137, 136, 235, 150, 159, 137, 252, 151, + 151, 126, 386, 386, 136, 151, 159, 235, 137, 152, + 152, 252, 151, 153, 153, 152, 151, 667, 667, 153, + 163, 163, 163, 163, 386, 652, 152, 650, 648, 645, + 153, 164, 164, 164, 164, 165, 165, 165, 165, 166, + 166, 166, 166, 167, 167, 167, 167, 168, 168, 168, + 168, 169, 169, 169, 169, 171, 171, 171, 171, 171, + 171, 644, 643, 640, 172, 171, 172, 172, 172, 172, + + 172, 172, 173, 173, 173, 173, 173, 173, 174, 174, + 174, 174, 174, 174, 231, 231, 231, 231, 231, 231, + 639, 171, 232, 232, 232, 232, 232, 232, 233, 233, + 247, 247, 265, 265, 233, 275, 247, 275, 265, 275, + 266, 266, 267, 267, 638, 233, 266, 247, 267, 265, + 637, 635, 275, 278, 278, 278, 278, 266, 634, 267, + 279, 279, 279, 279, 280, 280, 280, 280, 281, 281, + 281, 281, 282, 282, 282, 282, 283, 283, 283, 283, + 283, 283, 284, 284, 284, 284, 284, 284, 499, 499, + 633, 631, 630, 626, 625, 624, 623, 621, 618, 617, + + 615, 614, 613, 612, 611, 610, 607, 606, 604, 499, + 675, 675, 675, 675, 676, 603, 676, 677, 677, 678, + 678, 602, 678, 601, 600, 599, 597, 596, 595, 593, + 591, 590, 587, 578, 577, 576, 553, 546, 545, 542, + 541, 540, 539, 538, 537, 536, 535, 534, 533, 531, + 528, 527, 526, 525, 524, 523, 522, 521, 520, 519, + 518, 516, 515, 514, 513, 511, 509, 508, 507, 506, + 505, 504, 503, 502, 501, 500, 498, 497, 496, 495, + 494, 491, 490, 489, 488, 487, 486, 485, 484, 483, + 482, 481, 480, 479, 478, 477, 476, 475, 473, 472, + + 471, 470, 469, 468, 467, 466, 465, 464, 463, 462, + 461, 460, 459, 458, 456, 455, 454, 453, 452, 450, + 449, 448, 447, 446, 445, 444, 441, 440, 438, 437, + 436, 435, 432, 431, 430, 429, 428, 427, 426, 424, + 423, 422, 421, 420, 419, 418, 417, 416, 415, 414, + 413, 412, 411, 410, 409, 408, 406, 405, 404, 403, 402, 401, 400, 399, 398, 397, 396, 395, 394, 393, - 392, 391, 390, 389, 388, 387, 386, 385, 384, 382, - 381, 380, 377, 376, 375, 374, 373, 372, 370, 368, - 367, 366, 364, 363, 362, 361, 360, 359, 358, 357, - 356, 355, 354, 353, 352, 351, 350, 349, 348, 347, - 345, 344, 343, 342, 341, 340, 339, 336, 335, 334, - - 331, 330, 329, 328, 327, 326, 325, 324, 323, 322, - 320, 319, 318, 317, 316, 315, 314, 313, 311, 310, - 309, 308, 307, 306, 305, 304, 303, 302, 301, 300, - 299, 298, 297, 296, 295, 294, 293, 292, 290, 289, - 288, 287, 286, 285, 284, 276, 275, 273, 272, 271, - 270, 269, 268, 263, 261, 260, 259, 258, 257, 256, - 255, 254, 252, 250, 249, 247, 245, 244, 241, 240, - 239, 238, 237, 236, 235, 233, 229, 228, 227, 226, - 225, 224, 223, 222, 221, 220, 219, 218, 217, 216, - 215, 214, 213, 212, 211, 210, 209, 208, 207, 206, - - 205, 204, 203, 202, 201, 200, 199, 198, 197, 196, - 194, 193, 191, 190, 188, 186, 185, 184, 183, 182, - 181, 180, 179, 177, 175, 162, 161, 160, 158, 157, - 156, 155, 154, 148, 146, 145, 144, 143, 142, 141, - 140, 139, 138, 135, 134, 133, 132, 131, 129, 128, - 127, 125, 124, 121, 119, 117, 116, 115, 114, 113, - 112, 111, 110, 107, 106, 105, 104, 103, 102, 101, - 100, 99, 98, 97, 96, 95, 94, 93, 92, 91, - 89, 88, 87, 86, 85, 84, 83, 81, 80, 78, - 77, 76, 75, 74, 73, 72, 71, 55, 54, 51, - - 50, 37, 36, 35, 34, 33, 32, 31, 30, 29, - 28, 20, 14, 8, 7, 5, 3, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 657, 657, 657, 657, - 657, 657, 657 + 392, 391, 390, 389, 388, 387, 384, 383, 382, 379, + 378, 377, 376, 375, 374, 372, 370, 369, 368, 366, + 365, 364, 363, 362, 361, 360, 359, 358, 357, 356, + + 355, 354, 353, 352, 351, 350, 349, 347, 346, 345, + 344, 343, 342, 341, 338, 337, 336, 333, 332, 331, + 330, 329, 328, 327, 326, 325, 324, 322, 321, 320, + 319, 318, 317, 316, 315, 313, 312, 311, 310, 309, + 308, 307, 306, 305, 304, 303, 302, 301, 300, 299, + 298, 297, 296, 295, 294, 292, 291, 290, 289, 288, + 287, 286, 285, 277, 276, 274, 273, 272, 271, 270, + 269, 264, 262, 261, 260, 259, 258, 257, 256, 255, + 253, 251, 250, 248, 246, 245, 242, 241, 240, 239, + 238, 237, 236, 234, 230, 229, 228, 227, 226, 225, + + 224, 223, 222, 221, 220, 219, 218, 217, 216, 215, + 214, 213, 212, 211, 210, 209, 208, 207, 206, 205, + 204, 203, 202, 201, 200, 199, 198, 197, 195, 194, + 192, 191, 189, 187, 186, 185, 184, 183, 182, 181, + 180, 179, 177, 175, 162, 161, 160, 158, 157, 156, + 155, 154, 148, 146, 145, 144, 143, 142, 141, 140, + 139, 138, 135, 134, 133, 132, 131, 129, 128, 127, + 125, 124, 121, 119, 117, 116, 115, 114, 113, 112, + 111, 110, 107, 106, 105, 104, 103, 102, 101, 100, + 99, 98, 97, 96, 95, 94, 93, 92, 91, 89, + + 88, 87, 86, 85, 84, 83, 81, 80, 78, 77, + 76, 75, 73, 72, 71, 55, 54, 51, 50, 37, + 36, 35, 34, 33, 32, 31, 30, 29, 28, 20, + 14, 8, 7, 5, 3, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + 674, 674, 674, 674, 674, 674, 674, 674, 674, 674, + + 674, 674 } ; /* The intent behind this definition is that it'll catch @@ -904,6 +914,7 @@ static yyconst flex_int16_t yy_chk[984] = #define require_ARB_fp (yyextra->mode == ARB_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) +#define require_texarray (yyextra->option.TexArray) #define return_token_or_IDENTIFIER(condition, token) \ do { \ @@ -996,7 +1007,7 @@ swiz_from_char(char c) } while(0); #define YY_EXTRA_TYPE struct asm_parser_state * -#line 1000 "lex.yy.c" +#line 1011 "lex.yy.c" #define INITIAL 0 @@ -1242,10 +1253,10 @@ YY_DECL register int yy_act; struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; -#line 134 "program_lexer.l" +#line 135 "program_lexer.l" -#line 1249 "lex.yy.c" +#line 1260 "lex.yy.c" yylval = yylval_param; @@ -1302,13 +1313,13 @@ yy_match: 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 >= 658 ) + if ( yy_current_state >= 675 ) 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_base[yy_current_state] != 918 ); + while ( yy_base[yy_current_state] != 936 ); yy_find_action: yy_act = yy_accept[yy_current_state]; @@ -1334,17 +1345,17 @@ do_action: /* This label is used only to access EOF actions. */ case 1: YY_RULE_SETUP -#line 136 "program_lexer.l" +#line 137 "program_lexer.l" { return ARBvp_10; } YY_BREAK case 2: YY_RULE_SETUP -#line 137 "program_lexer.l" +#line 138 "program_lexer.l" { return ARBfp_10; } YY_BREAK case 3: YY_RULE_SETUP -#line 138 "program_lexer.l" +#line 139 "program_lexer.l" { yylval->integer = at_address; return_token_or_IDENTIFIER(require_ARB_vp, ADDRESS); @@ -1352,793 +1363,813 @@ YY_RULE_SETUP YY_BREAK case 4: YY_RULE_SETUP -#line 142 "program_lexer.l" +#line 143 "program_lexer.l" { return ALIAS; } YY_BREAK case 5: YY_RULE_SETUP -#line 143 "program_lexer.l" +#line 144 "program_lexer.l" { return ATTRIB; } YY_BREAK case 6: YY_RULE_SETUP -#line 144 "program_lexer.l" +#line 145 "program_lexer.l" { return END; } YY_BREAK case 7: YY_RULE_SETUP -#line 145 "program_lexer.l" +#line 146 "program_lexer.l" { return OPTION; } YY_BREAK case 8: YY_RULE_SETUP -#line 146 "program_lexer.l" +#line 147 "program_lexer.l" { return OUTPUT; } YY_BREAK case 9: YY_RULE_SETUP -#line 147 "program_lexer.l" +#line 148 "program_lexer.l" { return PARAM; } YY_BREAK case 10: YY_RULE_SETUP -#line 148 "program_lexer.l" +#line 149 "program_lexer.l" { yylval->integer = at_temp; return TEMP; } YY_BREAK case 11: YY_RULE_SETUP -#line 150 "program_lexer.l" +#line 151 "program_lexer.l" { return_opcode( 1, VECTOR_OP, ABS, OFF); } YY_BREAK case 12: YY_RULE_SETUP -#line 151 "program_lexer.l" +#line 152 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, ABS, ZERO_ONE); } YY_BREAK case 13: YY_RULE_SETUP -#line 152 "program_lexer.l" +#line 153 "program_lexer.l" { return_opcode( 1, BIN_OP, ADD, OFF); } YY_BREAK case 14: YY_RULE_SETUP -#line 153 "program_lexer.l" +#line 154 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, ADD, ZERO_ONE); } YY_BREAK case 15: YY_RULE_SETUP -#line 154 "program_lexer.l" +#line 155 "program_lexer.l" { return_opcode(require_ARB_vp, ARL, ARL, OFF); } YY_BREAK case 16: YY_RULE_SETUP -#line 156 "program_lexer.l" +#line 157 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, OFF); } YY_BREAK case 17: YY_RULE_SETUP -#line 157 "program_lexer.l" +#line 158 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, CMP, ZERO_ONE); } YY_BREAK case 18: YY_RULE_SETUP -#line 158 "program_lexer.l" +#line 159 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, OFF); } YY_BREAK case 19: YY_RULE_SETUP -#line 159 "program_lexer.l" +#line 160 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, COS, ZERO_ONE); } YY_BREAK case 20: YY_RULE_SETUP -#line 161 "program_lexer.l" +#line 162 "program_lexer.l" { return_opcode( 1, BIN_OP, DP3, OFF); } YY_BREAK case 21: YY_RULE_SETUP -#line 162 "program_lexer.l" +#line 163 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP3, ZERO_ONE); } YY_BREAK case 22: YY_RULE_SETUP -#line 163 "program_lexer.l" +#line 164 "program_lexer.l" { return_opcode( 1, BIN_OP, DP4, OFF); } YY_BREAK case 23: YY_RULE_SETUP -#line 164 "program_lexer.l" +#line 165 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DP4, ZERO_ONE); } YY_BREAK case 24: YY_RULE_SETUP -#line 165 "program_lexer.l" +#line 166 "program_lexer.l" { return_opcode( 1, BIN_OP, DPH, OFF); } YY_BREAK case 25: YY_RULE_SETUP -#line 166 "program_lexer.l" +#line 167 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DPH, ZERO_ONE); } YY_BREAK case 26: YY_RULE_SETUP -#line 167 "program_lexer.l" +#line 168 "program_lexer.l" { return_opcode( 1, BIN_OP, DST, OFF); } YY_BREAK case 27: YY_RULE_SETUP -#line 168 "program_lexer.l" +#line 169 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, DST, ZERO_ONE); } YY_BREAK case 28: YY_RULE_SETUP -#line 170 "program_lexer.l" +#line 171 "program_lexer.l" { return_opcode( 1, SCALAR_OP, EX2, OFF); } YY_BREAK case 29: YY_RULE_SETUP -#line 171 "program_lexer.l" +#line 172 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, EX2, ZERO_ONE); } YY_BREAK case 30: YY_RULE_SETUP -#line 172 "program_lexer.l" +#line 173 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, EXP, OFF); } YY_BREAK case 31: YY_RULE_SETUP -#line 174 "program_lexer.l" +#line 175 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FLR, OFF); } YY_BREAK case 32: YY_RULE_SETUP -#line 175 "program_lexer.l" +#line 176 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FLR, ZERO_ONE); } YY_BREAK case 33: YY_RULE_SETUP -#line 176 "program_lexer.l" +#line 177 "program_lexer.l" { return_opcode( 1, VECTOR_OP, FRC, OFF); } YY_BREAK case 34: YY_RULE_SETUP -#line 177 "program_lexer.l" +#line 178 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, FRC, ZERO_ONE); } YY_BREAK case 35: YY_RULE_SETUP -#line 179 "program_lexer.l" +#line 180 "program_lexer.l" { return_opcode(require_ARB_fp, KIL, KIL, OFF); } YY_BREAK case 36: YY_RULE_SETUP -#line 181 "program_lexer.l" +#line 182 "program_lexer.l" { return_opcode( 1, VECTOR_OP, LIT, OFF); } YY_BREAK case 37: YY_RULE_SETUP -#line 182 "program_lexer.l" +#line 183 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, LIT, ZERO_ONE); } YY_BREAK case 38: YY_RULE_SETUP -#line 183 "program_lexer.l" +#line 184 "program_lexer.l" { return_opcode( 1, SCALAR_OP, LG2, OFF); } YY_BREAK case 39: YY_RULE_SETUP -#line 184 "program_lexer.l" +#line 185 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, LG2, ZERO_ONE); } YY_BREAK case 40: YY_RULE_SETUP -#line 185 "program_lexer.l" +#line 186 "program_lexer.l" { return_opcode(require_ARB_vp, SCALAR_OP, LOG, OFF); } YY_BREAK case 41: YY_RULE_SETUP -#line 186 "program_lexer.l" +#line 187 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, OFF); } YY_BREAK case 42: YY_RULE_SETUP -#line 187 "program_lexer.l" +#line 188 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, LRP, ZERO_ONE); } YY_BREAK case 43: YY_RULE_SETUP -#line 189 "program_lexer.l" +#line 190 "program_lexer.l" { return_opcode( 1, TRI_OP, MAD, OFF); } YY_BREAK case 44: YY_RULE_SETUP -#line 190 "program_lexer.l" +#line 191 "program_lexer.l" { return_opcode(require_ARB_fp, TRI_OP, MAD, ZERO_ONE); } YY_BREAK case 45: YY_RULE_SETUP -#line 191 "program_lexer.l" +#line 192 "program_lexer.l" { return_opcode( 1, BIN_OP, MAX, OFF); } YY_BREAK case 46: YY_RULE_SETUP -#line 192 "program_lexer.l" +#line 193 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MAX, ZERO_ONE); } YY_BREAK case 47: YY_RULE_SETUP -#line 193 "program_lexer.l" +#line 194 "program_lexer.l" { return_opcode( 1, BIN_OP, MIN, OFF); } YY_BREAK case 48: YY_RULE_SETUP -#line 194 "program_lexer.l" +#line 195 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MIN, ZERO_ONE); } YY_BREAK case 49: YY_RULE_SETUP -#line 195 "program_lexer.l" +#line 196 "program_lexer.l" { return_opcode( 1, VECTOR_OP, MOV, OFF); } YY_BREAK case 50: YY_RULE_SETUP -#line 196 "program_lexer.l" +#line 197 "program_lexer.l" { return_opcode(require_ARB_fp, VECTOR_OP, MOV, ZERO_ONE); } YY_BREAK case 51: YY_RULE_SETUP -#line 197 "program_lexer.l" +#line 198 "program_lexer.l" { return_opcode( 1, BIN_OP, MUL, OFF); } YY_BREAK case 52: YY_RULE_SETUP -#line 198 "program_lexer.l" +#line 199 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, MUL, ZERO_ONE); } YY_BREAK case 53: YY_RULE_SETUP -#line 200 "program_lexer.l" +#line 201 "program_lexer.l" { return_opcode( 1, BINSC_OP, POW, OFF); } YY_BREAK case 54: YY_RULE_SETUP -#line 201 "program_lexer.l" +#line 202 "program_lexer.l" { return_opcode(require_ARB_fp, BINSC_OP, POW, ZERO_ONE); } YY_BREAK case 55: YY_RULE_SETUP -#line 203 "program_lexer.l" +#line 204 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RCP, OFF); } YY_BREAK case 56: YY_RULE_SETUP -#line 204 "program_lexer.l" +#line 205 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RCP, ZERO_ONE); } YY_BREAK case 57: YY_RULE_SETUP -#line 205 "program_lexer.l" +#line 206 "program_lexer.l" { return_opcode( 1, SCALAR_OP, RSQ, OFF); } YY_BREAK case 58: YY_RULE_SETUP -#line 206 "program_lexer.l" +#line 207 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, RSQ, ZERO_ONE); } YY_BREAK case 59: YY_RULE_SETUP -#line 208 "program_lexer.l" +#line 209 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, OFF); } YY_BREAK case 60: YY_RULE_SETUP -#line 209 "program_lexer.l" +#line 210 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SCS, ZERO_ONE); } YY_BREAK case 61: YY_RULE_SETUP -#line 210 "program_lexer.l" +#line 211 "program_lexer.l" { return_opcode( 1, BIN_OP, SGE, OFF); } YY_BREAK case 62: YY_RULE_SETUP -#line 211 "program_lexer.l" +#line 212 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SGE, ZERO_ONE); } YY_BREAK case 63: YY_RULE_SETUP -#line 212 "program_lexer.l" +#line 213 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, OFF); } YY_BREAK case 64: YY_RULE_SETUP -#line 213 "program_lexer.l" +#line 214 "program_lexer.l" { return_opcode(require_ARB_fp, SCALAR_OP, SIN, ZERO_ONE); } YY_BREAK case 65: YY_RULE_SETUP -#line 214 "program_lexer.l" +#line 215 "program_lexer.l" { return_opcode( 1, BIN_OP, SLT, OFF); } YY_BREAK case 66: YY_RULE_SETUP -#line 215 "program_lexer.l" +#line 216 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SLT, ZERO_ONE); } YY_BREAK case 67: YY_RULE_SETUP -#line 216 "program_lexer.l" +#line 217 "program_lexer.l" { return_opcode( 1, BIN_OP, SUB, OFF); } YY_BREAK case 68: YY_RULE_SETUP -#line 217 "program_lexer.l" +#line 218 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, SUB, ZERO_ONE); } YY_BREAK case 69: YY_RULE_SETUP -#line 218 "program_lexer.l" +#line 219 "program_lexer.l" { return_opcode( 1, SWZ, SWZ, OFF); } YY_BREAK case 70: YY_RULE_SETUP -#line 219 "program_lexer.l" +#line 220 "program_lexer.l" { return_opcode(require_ARB_fp, SWZ, SWZ, ZERO_ONE); } YY_BREAK case 71: YY_RULE_SETUP -#line 221 "program_lexer.l" +#line 222 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, OFF); } YY_BREAK case 72: YY_RULE_SETUP -#line 222 "program_lexer.l" +#line 223 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TEX, ZERO_ONE); } YY_BREAK case 73: YY_RULE_SETUP -#line 223 "program_lexer.l" +#line 224 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, OFF); } YY_BREAK case 74: YY_RULE_SETUP -#line 224 "program_lexer.l" +#line 225 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXB, ZERO_ONE); } YY_BREAK case 75: YY_RULE_SETUP -#line 225 "program_lexer.l" +#line 226 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, OFF); } YY_BREAK case 76: YY_RULE_SETUP -#line 226 "program_lexer.l" +#line 227 "program_lexer.l" { return_opcode(require_ARB_fp, SAMPLE_OP, TXP, ZERO_ONE); } YY_BREAK case 77: YY_RULE_SETUP -#line 228 "program_lexer.l" +#line 229 "program_lexer.l" { return_opcode( 1, BIN_OP, XPD, OFF); } YY_BREAK case 78: YY_RULE_SETUP -#line 229 "program_lexer.l" +#line 230 "program_lexer.l" { return_opcode(require_ARB_fp, BIN_OP, XPD, ZERO_ONE); } YY_BREAK case 79: YY_RULE_SETUP -#line 231 "program_lexer.l" +#line 232 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_vp, VERTEX); } YY_BREAK case 80: YY_RULE_SETUP -#line 232 "program_lexer.l" +#line 233 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, FRAGMENT); } YY_BREAK case 81: YY_RULE_SETUP -#line 233 "program_lexer.l" +#line 234 "program_lexer.l" { return PROGRAM; } YY_BREAK case 82: YY_RULE_SETUP -#line 234 "program_lexer.l" +#line 235 "program_lexer.l" { return STATE; } YY_BREAK case 83: YY_RULE_SETUP -#line 235 "program_lexer.l" +#line 236 "program_lexer.l" { return RESULT; } YY_BREAK case 84: YY_RULE_SETUP -#line 237 "program_lexer.l" +#line 238 "program_lexer.l" { return AMBIENT; } YY_BREAK case 85: YY_RULE_SETUP -#line 238 "program_lexer.l" +#line 239 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, ATTENUATION); } YY_BREAK case 86: YY_RULE_SETUP -#line 239 "program_lexer.l" +#line 240 "program_lexer.l" { return BACK; } YY_BREAK case 87: YY_RULE_SETUP -#line 240 "program_lexer.l" +#line 241 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, CLIP); } YY_BREAK case 88: YY_RULE_SETUP -#line 241 "program_lexer.l" +#line 242 "program_lexer.l" { return COLOR; } YY_BREAK case 89: YY_RULE_SETUP -#line 242 "program_lexer.l" +#line 243 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, DEPTH); } YY_BREAK case 90: YY_RULE_SETUP -#line 243 "program_lexer.l" +#line 244 "program_lexer.l" { return DIFFUSE; } YY_BREAK case 91: YY_RULE_SETUP -#line 244 "program_lexer.l" +#line 245 "program_lexer.l" { return DIRECTION; } YY_BREAK case 92: YY_RULE_SETUP -#line 245 "program_lexer.l" +#line 246 "program_lexer.l" { return EMISSION; } YY_BREAK case 93: YY_RULE_SETUP -#line 246 "program_lexer.l" +#line 247 "program_lexer.l" { return ENV; } YY_BREAK case 94: YY_RULE_SETUP -#line 247 "program_lexer.l" +#line 248 "program_lexer.l" { return EYE; } YY_BREAK case 95: YY_RULE_SETUP -#line 248 "program_lexer.l" +#line 249 "program_lexer.l" { return FOGCOORD; } YY_BREAK case 96: YY_RULE_SETUP -#line 249 "program_lexer.l" +#line 250 "program_lexer.l" { return FOG; } YY_BREAK case 97: YY_RULE_SETUP -#line 250 "program_lexer.l" +#line 251 "program_lexer.l" { return FRONT; } YY_BREAK case 98: YY_RULE_SETUP -#line 251 "program_lexer.l" +#line 252 "program_lexer.l" { return HALF; } YY_BREAK case 99: YY_RULE_SETUP -#line 252 "program_lexer.l" +#line 253 "program_lexer.l" { return INVERSE; } YY_BREAK case 100: YY_RULE_SETUP -#line 253 "program_lexer.l" +#line 254 "program_lexer.l" { return INVTRANS; } YY_BREAK case 101: YY_RULE_SETUP -#line 254 "program_lexer.l" +#line 255 "program_lexer.l" { return LIGHT; } YY_BREAK case 102: YY_RULE_SETUP -#line 255 "program_lexer.l" +#line 256 "program_lexer.l" { return LIGHTMODEL; } YY_BREAK case 103: YY_RULE_SETUP -#line 256 "program_lexer.l" +#line 257 "program_lexer.l" { return LIGHTPROD; } YY_BREAK case 104: YY_RULE_SETUP -#line 257 "program_lexer.l" +#line 258 "program_lexer.l" { return LOCAL; } YY_BREAK case 105: YY_RULE_SETUP -#line 258 "program_lexer.l" +#line 259 "program_lexer.l" { return MATERIAL; } YY_BREAK case 106: YY_RULE_SETUP -#line 259 "program_lexer.l" +#line 260 "program_lexer.l" { return MAT_PROGRAM; } YY_BREAK case 107: YY_RULE_SETUP -#line 260 "program_lexer.l" +#line 261 "program_lexer.l" { return MATRIX; } YY_BREAK case 108: YY_RULE_SETUP -#line 261 "program_lexer.l" +#line 262 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, MATRIXINDEX); } YY_BREAK case 109: YY_RULE_SETUP -#line 262 "program_lexer.l" +#line 263 "program_lexer.l" { return MODELVIEW; } YY_BREAK case 110: YY_RULE_SETUP -#line 263 "program_lexer.l" +#line 264 "program_lexer.l" { return MVP; } YY_BREAK case 111: YY_RULE_SETUP -#line 264 "program_lexer.l" +#line 265 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, NORMAL); } YY_BREAK case 112: YY_RULE_SETUP -#line 265 "program_lexer.l" +#line 266 "program_lexer.l" { return OBJECT; } YY_BREAK case 113: YY_RULE_SETUP -#line 266 "program_lexer.l" +#line 267 "program_lexer.l" { return PALETTE; } YY_BREAK case 114: YY_RULE_SETUP -#line 267 "program_lexer.l" +#line 268 "program_lexer.l" { return PARAMS; } YY_BREAK case 115: YY_RULE_SETUP -#line 268 "program_lexer.l" +#line 269 "program_lexer.l" { return PLANE; } YY_BREAK case 116: YY_RULE_SETUP -#line 269 "program_lexer.l" +#line 270 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINT); } YY_BREAK case 117: YY_RULE_SETUP -#line 270 "program_lexer.l" +#line 271 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, POINTSIZE); } YY_BREAK case 118: YY_RULE_SETUP -#line 271 "program_lexer.l" +#line 272 "program_lexer.l" { return POSITION; } YY_BREAK case 119: YY_RULE_SETUP -#line 272 "program_lexer.l" +#line 273 "program_lexer.l" { return PRIMARY; } YY_BREAK case 120: YY_RULE_SETUP -#line 273 "program_lexer.l" +#line 274 "program_lexer.l" { return PROJECTION; } YY_BREAK case 121: YY_RULE_SETUP -#line 274 "program_lexer.l" +#line 275 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, RANGE); } YY_BREAK case 122: YY_RULE_SETUP -#line 275 "program_lexer.l" +#line 276 "program_lexer.l" { return ROW; } YY_BREAK case 123: YY_RULE_SETUP -#line 276 "program_lexer.l" +#line 277 "program_lexer.l" { return SCENECOLOR; } YY_BREAK case 124: YY_RULE_SETUP -#line 277 "program_lexer.l" +#line 278 "program_lexer.l" { return SECONDARY; } YY_BREAK case 125: YY_RULE_SETUP -#line 278 "program_lexer.l" +#line 279 "program_lexer.l" { return SHININESS; } YY_BREAK case 126: YY_RULE_SETUP -#line 279 "program_lexer.l" +#line 280 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, SIZE); } YY_BREAK case 127: YY_RULE_SETUP -#line 280 "program_lexer.l" +#line 281 "program_lexer.l" { return SPECULAR; } YY_BREAK case 128: YY_RULE_SETUP -#line 281 "program_lexer.l" +#line 282 "program_lexer.l" { return SPOT; } YY_BREAK case 129: YY_RULE_SETUP -#line 282 "program_lexer.l" +#line 283 "program_lexer.l" { return TEXCOORD; } YY_BREAK case 130: YY_RULE_SETUP -#line 283 "program_lexer.l" +#line 284 "program_lexer.l" { return_token_or_DOT(require_ARB_fp, TEXENV); } YY_BREAK case 131: YY_RULE_SETUP -#line 284 "program_lexer.l" +#line 285 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN); } YY_BREAK case 132: YY_RULE_SETUP -#line 285 "program_lexer.l" +#line 286 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_Q); } YY_BREAK case 133: YY_RULE_SETUP -#line 286 "program_lexer.l" +#line 287 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_S); } YY_BREAK case 134: YY_RULE_SETUP -#line 287 "program_lexer.l" +#line 288 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, TEXGEN_T); } YY_BREAK case 135: YY_RULE_SETUP -#line 288 "program_lexer.l" +#line 289 "program_lexer.l" { return TEXTURE; } YY_BREAK case 136: YY_RULE_SETUP -#line 289 "program_lexer.l" +#line 290 "program_lexer.l" { return TRANSPOSE; } YY_BREAK case 137: YY_RULE_SETUP -#line 290 "program_lexer.l" +#line 291 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, VTXATTRIB); } YY_BREAK case 138: YY_RULE_SETUP -#line 291 "program_lexer.l" +#line 292 "program_lexer.l" { return_token_or_DOT(require_ARB_vp, WEIGHT); } YY_BREAK case 139: YY_RULE_SETUP -#line 293 "program_lexer.l" +#line 294 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEXTURE_UNIT); } YY_BREAK case 140: YY_RULE_SETUP -#line 294 "program_lexer.l" +#line 295 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_1D); } YY_BREAK case 141: YY_RULE_SETUP -#line 295 "program_lexer.l" +#line 296 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_2D); } YY_BREAK case 142: YY_RULE_SETUP -#line 296 "program_lexer.l" +#line 297 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_3D); } YY_BREAK case 143: YY_RULE_SETUP -#line 297 "program_lexer.l" +#line 298 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp, TEX_CUBE); } YY_BREAK case 144: YY_RULE_SETUP -#line 298 "program_lexer.l" +#line 299 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_rect, TEX_RECT); } YY_BREAK case 145: YY_RULE_SETUP -#line 299 "program_lexer.l" +#line 300 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } YY_BREAK case 146: YY_RULE_SETUP -#line 300 "program_lexer.l" +#line 301 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } YY_BREAK case 147: YY_RULE_SETUP -#line 301 "program_lexer.l" +#line 302 "program_lexer.l" { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } YY_BREAK case 148: YY_RULE_SETUP #line 303 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } + YY_BREAK +case 149: +YY_RULE_SETUP +#line 304 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } + YY_BREAK +case 150: +YY_RULE_SETUP +#line 305 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } + YY_BREAK +case 151: +YY_RULE_SETUP +#line 306 "program_lexer.l" +{ return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } + YY_BREAK +case 152: +YY_RULE_SETUP +#line 308 "program_lexer.l" { yylval->string = strdup(yytext); return IDENTIFIER; } YY_BREAK -case 149: +case 153: YY_RULE_SETUP -#line 308 "program_lexer.l" +#line 313 "program_lexer.l" { return DOT_DOT; } YY_BREAK -case 150: +case 154: YY_RULE_SETUP -#line 310 "program_lexer.l" +#line 315 "program_lexer.l" { yylval->integer = strtol(yytext, NULL, 10); return INTEGER; } YY_BREAK -case 151: +case 155: YY_RULE_SETUP -#line 314 "program_lexer.l" +#line 319 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 152: -/* rule 152 can match eol */ +case 156: +/* rule 156 can match eol */ *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 318 "program_lexer.l" +#line 323 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 153: +case 157: YY_RULE_SETUP -#line 322 "program_lexer.l" +#line 327 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 154: +case 158: YY_RULE_SETUP -#line 326 "program_lexer.l" +#line 331 "program_lexer.l" { yylval->real = strtod(yytext, NULL); return REAL; } YY_BREAK -case 155: +case 159: YY_RULE_SETUP -#line 331 "program_lexer.l" +#line 336 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return MASK4; } YY_BREAK -case 156: +case 160: YY_RULE_SETUP -#line 337 "program_lexer.l" +#line 342 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2146,27 +2177,27 @@ YY_RULE_SETUP return MASK3; } YY_BREAK -case 157: +case 161: YY_RULE_SETUP -#line 343 "program_lexer.l" +#line 348 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return MASK3; } YY_BREAK -case 158: +case 162: YY_RULE_SETUP -#line 348 "program_lexer.l" +#line 353 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return MASK3; } YY_BREAK -case 159: +case 163: YY_RULE_SETUP -#line 354 "program_lexer.l" +#line 359 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2174,9 +2205,9 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 160: +case 164: YY_RULE_SETUP -#line 360 "program_lexer.l" +#line 365 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2184,18 +2215,18 @@ YY_RULE_SETUP return MASK2; } YY_BREAK -case 161: +case 165: YY_RULE_SETUP -#line 366 "program_lexer.l" +#line 371 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return MASK2; } YY_BREAK -case 162: +case 166: YY_RULE_SETUP -#line 372 "program_lexer.l" +#line 377 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2203,9 +2234,9 @@ YY_RULE_SETUP return MASK1; } YY_BREAK -case 163: +case 167: YY_RULE_SETUP -#line 379 "program_lexer.l" +#line 384 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2215,18 +2246,18 @@ YY_RULE_SETUP return SWIZZLE; } YY_BREAK -case 164: +case 168: YY_RULE_SETUP -#line 388 "program_lexer.l" +#line 393 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_NOOP; yylval->swiz_mask.mask = WRITEMASK_XYZW; return_token_or_DOT(require_ARB_fp, MASK4); } YY_BREAK -case 165: +case 169: YY_RULE_SETUP -#line 394 "program_lexer.l" +#line 399 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XY @@ -2234,27 +2265,27 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 166: +case 170: YY_RULE_SETUP -#line 400 "program_lexer.l" +#line 405 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_XZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 167: +case 171: YY_RULE_SETUP -#line 405 "program_lexer.l" +#line 410 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_YZW; return_token_or_DOT(require_ARB_fp, MASK3); } YY_BREAK -case 168: +case 172: YY_RULE_SETUP -#line 411 "program_lexer.l" +#line 416 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_X @@ -2262,9 +2293,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 169: +case 173: YY_RULE_SETUP -#line 417 "program_lexer.l" +#line 422 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_Y @@ -2272,18 +2303,18 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 170: +case 174: YY_RULE_SETUP -#line 423 "program_lexer.l" +#line 428 "program_lexer.l" { yylval->swiz_mask.swizzle = SWIZZLE_INVAL; yylval->swiz_mask.mask = WRITEMASK_ZW; return_token_or_DOT(require_ARB_fp, MASK2); } YY_BREAK -case 171: +case 175: YY_RULE_SETUP -#line 429 "program_lexer.l" +#line 434 "program_lexer.l" { const unsigned s = swiz_from_char(yytext[1]); yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(s, s, s, s); @@ -2291,9 +2322,9 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, MASK1); } YY_BREAK -case 172: +case 176: YY_RULE_SETUP -#line 437 "program_lexer.l" +#line 442 "program_lexer.l" { if (require_ARB_vp) { return TEXGEN_R; @@ -2305,9 +2336,9 @@ YY_RULE_SETUP } } YY_BREAK -case 173: +case 177: YY_RULE_SETUP -#line 448 "program_lexer.l" +#line 453 "program_lexer.l" { yylval->swiz_mask.swizzle = MAKE_SWIZZLE4(swiz_from_char(yytext[1]), swiz_from_char(yytext[2]), @@ -2317,15 +2348,15 @@ YY_RULE_SETUP return_token_or_DOT(require_ARB_fp, SWIZZLE); } YY_BREAK -case 174: +case 178: YY_RULE_SETUP -#line 457 "program_lexer.l" +#line 462 "program_lexer.l" { return DOT; } YY_BREAK -case 175: -/* rule 175 can match eol */ +case 179: +/* rule 179 can match eol */ YY_RULE_SETUP -#line 459 "program_lexer.l" +#line 464 "program_lexer.l" { yylloc->first_line++; yylloc->first_column = 1; @@ -2334,30 +2365,30 @@ YY_RULE_SETUP yylloc->position++; } YY_BREAK -case 176: +case 180: YY_RULE_SETUP -#line 466 "program_lexer.l" +#line 471 "program_lexer.l" /* eat whitespace */ ; YY_BREAK -case 177: +case 181: *yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ yyg->yy_c_buf_p = yy_cp -= 1; YY_DO_BEFORE_ACTION; /* set up yytext again */ YY_RULE_SETUP -#line 467 "program_lexer.l" +#line 472 "program_lexer.l" /* eat comments */ ; YY_BREAK -case 178: +case 182: YY_RULE_SETUP -#line 468 "program_lexer.l" +#line 473 "program_lexer.l" { return yytext[0]; } YY_BREAK -case 179: +case 183: YY_RULE_SETUP -#line 469 "program_lexer.l" +#line 474 "program_lexer.l" ECHO; YY_BREAK -#line 2361 "lex.yy.c" +#line 2392 "lex.yy.c" case YY_STATE_EOF(INITIAL): yyterminate(); @@ -2651,7 +2682,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 658 ) + if ( yy_current_state >= 675 ) yy_c = yy_meta[(unsigned int) yy_c]; } yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c]; @@ -2680,11 +2711,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner) 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 >= 658 ) + if ( yy_current_state >= 675 ) 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 == 657); + yy_is_jam = (yy_current_state == 674); return yy_is_jam ? 0 : yy_current_state; } @@ -3532,7 +3563,7 @@ void yyfree (void * ptr , yyscan_t yyscanner) #define YYTABLES_NAME "yytables" -#line 469 "program_lexer.l" +#line 474 "program_lexer.l" diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index e4837ccb16..e1069ab4d7 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -31,6 +31,7 @@ #define require_ARB_fp (yyextra->mode == ARB_fragment) #define require_shadow (yyextra->option.Shadow) #define require_rect (yyextra->option.TexRect) +#define require_texarray (yyextra->option.TexArray) #define return_token_or_IDENTIFIER(condition, token) \ do { \ @@ -299,6 +300,10 @@ RECT { return_token_or_IDENTIFIER(require_ARB_fp && require SHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW1D); } SHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow, TEX_SHADOW2D); } SHADOWRECT { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_rect, TEX_SHADOWRECT); } +ARRAY1D { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY1D); } +ARRAY2D { return_token_or_IDENTIFIER(require_ARB_fp && require_texarray, TEX_ARRAY2D); } +ARRAYSHADOW1D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW1D); } +ARRAYSHADOW2D { return_token_or_IDENTIFIER(require_ARB_fp && require_shadow && require_texarray, TEX_ARRAYSHADOW2D); } [_a-zA-Z$][_a-zA-Z0-9$]* { yylval->string = strdup(yytext); diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 2842c42e64..4a05d106be 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -285,17 +285,21 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, TEX_SHADOW1D = 343, TEX_SHADOW2D = 344, TEX_SHADOWRECT = 345, - VERTEX = 346, - VTXATTRIB = 347, - WEIGHT = 348, - IDENTIFIER = 349, - MASK4 = 350, - MASK3 = 351, - MASK2 = 352, - MASK1 = 353, - SWIZZLE = 354, - DOT_DOT = 355, - DOT = 356 + TEX_ARRAY1D = 346, + TEX_ARRAY2D = 347, + TEX_ARRAYSHADOW1D = 348, + TEX_ARRAYSHADOW2D = 349, + VERTEX = 350, + VTXATTRIB = 351, + WEIGHT = 352, + IDENTIFIER = 353, + MASK4 = 354, + MASK3 = 355, + MASK2 = 356, + MASK1 = 357, + SWIZZLE = 358, + DOT_DOT = 359, + DOT = 360 }; #endif @@ -328,7 +332,7 @@ typedef union YYSTYPE /* Line 214 of yacc.c */ -#line 332 "program_parse.tab.c" +#line 336 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -352,14 +356,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 241 "program_parse.y" +#line 242 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 363 "program_parse.tab.c" +#line 367 "program_parse.tab.c" #ifdef short # undef short @@ -576,20 +580,20 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 334 +#define YYLAST 337 /* YYNTOKENS -- Number of terminals. */ -#define YYNTOKENS 111 +#define YYNTOKENS 115 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 133 /* YYNRULES -- Number of rules. */ -#define YYNRULES 258 +#define YYNRULES 262 /* YYNRULES -- Number of states. */ -#define YYNSTATES 427 +#define YYNSTATES 431 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 -#define YYMAXUTOK 356 +#define YYMAXUTOK 360 #define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) @@ -601,15 +605,15 @@ static const yytype_uint8 yytranslate[] = 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 106, 103, 107, 2, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 2, 102, - 2, 108, 2, 2, 2, 2, 2, 2, 2, 2, + 2, 2, 2, 110, 107, 111, 2, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 2, 106, + 2, 112, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 104, 2, 105, 2, 2, 2, 2, 2, 2, + 2, 108, 2, 109, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 109, 2, 110, 2, 2, 2, 2, + 2, 2, 2, 113, 2, 114, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -632,7 +636,8 @@ static const yytype_uint8 yytranslate[] = 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, 94, - 95, 96, 97, 98, 99, 100, 101 + 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, + 105 }; #if YYDEBUG @@ -644,137 +649,139 @@ static const yytype_uint16 yyprhs[] = 24, 27, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 52, 57, 62, 67, 74, 81, 90, 99, 102, 105, 107, 109, 111, 113, 115, 117, 119, - 121, 128, 132, 136, 139, 142, 150, 153, 155, 157, - 159, 161, 166, 168, 170, 172, 174, 176, 178, 180, - 184, 185, 188, 191, 193, 195, 197, 199, 201, 203, - 205, 207, 209, 210, 212, 214, 216, 218, 219, 221, - 223, 225, 227, 229, 231, 236, 239, 242, 244, 247, - 249, 252, 254, 257, 262, 267, 269, 270, 274, 276, - 278, 281, 283, 286, 288, 290, 294, 301, 302, 304, - 307, 312, 314, 318, 320, 322, 324, 326, 328, 330, - 332, 334, 336, 338, 341, 344, 347, 350, 353, 356, - 359, 362, 365, 368, 371, 375, 377, 379, 381, 387, - 389, 391, 393, 396, 398, 400, 403, 405, 408, 415, - 417, 421, 423, 425, 427, 429, 431, 436, 438, 440, - 442, 444, 446, 448, 451, 453, 455, 461, 463, 466, - 468, 470, 476, 479, 480, 487, 491, 492, 494, 496, - 498, 500, 502, 505, 507, 509, 512, 517, 522, 523, - 525, 527, 529, 531, 533, 535, 537, 539, 545, 547, - 551, 557, 563, 565, 569, 575, 577, 579, 581, 583, - 585, 587, 589, 591, 593, 597, 603, 611, 621, 624, - 627, 629, 631, 632, 633, 637, 638, 642, 646, 648, - 653, 656, 659, 662, 665, 669, 672, 676, 677, 679, - 681, 682, 684, 686, 687, 689, 691, 692, 694, 696, - 697, 701, 702, 706, 707, 711, 713, 715, 717 + 121, 123, 125, 127, 129, 136, 140, 144, 147, 150, + 158, 161, 163, 165, 167, 169, 174, 176, 178, 180, + 182, 184, 186, 188, 192, 193, 196, 199, 201, 203, + 205, 207, 209, 211, 213, 215, 217, 218, 220, 222, + 224, 226, 227, 229, 231, 233, 235, 237, 239, 244, + 247, 250, 252, 255, 257, 260, 262, 265, 270, 275, + 277, 278, 282, 284, 286, 289, 291, 294, 296, 298, + 302, 309, 310, 312, 315, 320, 322, 326, 328, 330, + 332, 334, 336, 338, 340, 342, 344, 346, 349, 352, + 355, 358, 361, 364, 367, 370, 373, 376, 379, 383, + 385, 387, 389, 395, 397, 399, 401, 404, 406, 408, + 411, 413, 416, 423, 425, 429, 431, 433, 435, 437, + 439, 444, 446, 448, 450, 452, 454, 456, 459, 461, + 463, 469, 471, 474, 476, 478, 484, 487, 488, 495, + 499, 500, 502, 504, 506, 508, 510, 513, 515, 517, + 520, 525, 530, 531, 533, 535, 537, 539, 541, 543, + 545, 547, 553, 555, 559, 565, 571, 573, 577, 583, + 585, 587, 589, 591, 593, 595, 597, 599, 601, 605, + 611, 619, 629, 632, 635, 637, 639, 640, 641, 645, + 646, 650, 654, 656, 661, 664, 667, 670, 673, 677, + 680, 684, 685, 687, 689, 690, 692, 694, 695, 697, + 699, 700, 702, 704, 705, 709, 710, 714, 715, 719, + 721, 723, 725 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ static const yytype_int16 yyrhs[] = { - 112, 0, -1, 113, 114, 116, 12, -1, 3, -1, - 4, -1, 114, 115, -1, -1, 8, 94, 102, -1, - 116, 117, -1, -1, 118, 102, -1, 154, 102, -1, - 119, -1, 120, -1, 121, -1, 122, -1, 123, -1, - 124, -1, 125, -1, 126, -1, 131, -1, 127, -1, - 128, -1, 19, 135, 103, 132, -1, 18, 134, 103, - 133, -1, 16, 134, 103, 132, -1, 14, 134, 103, - 132, 103, 132, -1, 13, 134, 103, 133, 103, 133, - -1, 17, 134, 103, 133, 103, 133, 103, 133, -1, - 15, 134, 103, 133, 103, 129, 103, 130, -1, 20, - 133, -1, 82, 238, -1, 83, -1, 84, -1, 85, + 116, 0, -1, 117, 118, 120, 12, -1, 3, -1, + 4, -1, 118, 119, -1, -1, 8, 98, 106, -1, + 120, 121, -1, -1, 122, 106, -1, 158, 106, -1, + 123, -1, 124, -1, 125, -1, 126, -1, 127, -1, + 128, -1, 129, -1, 130, -1, 135, -1, 131, -1, + 132, -1, 19, 139, 107, 136, -1, 18, 138, 107, + 137, -1, 16, 138, 107, 136, -1, 14, 138, 107, + 136, 107, 136, -1, 13, 138, 107, 137, 107, 137, + -1, 17, 138, 107, 137, 107, 137, 107, 137, -1, + 15, 138, 107, 137, 107, 133, 107, 134, -1, 20, + 137, -1, 82, 242, -1, 83, -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, - -1, 21, 134, 103, 139, 103, 136, -1, 224, 139, - 151, -1, 224, 139, 152, -1, 140, 153, -1, 148, - 150, -1, 137, 103, 137, 103, 137, 103, 137, -1, - 224, 138, -1, 22, -1, 94, -1, 94, -1, 156, - -1, 141, 104, 142, 105, -1, 170, -1, 231, -1, - 94, -1, 94, -1, 143, -1, 144, -1, 22, -1, - 148, 149, 145, -1, -1, 106, 146, -1, 107, 147, - -1, 22, -1, 22, -1, 94, -1, 98, -1, 98, - -1, 98, -1, 98, -1, 95, -1, 99, -1, -1, - 95, -1, 96, -1, 97, -1, 98, -1, -1, 155, - -1, 162, -1, 225, -1, 227, -1, 230, -1, 243, - -1, 7, 94, 108, 156, -1, 91, 157, -1, 37, - 161, -1, 59, -1, 93, 159, -1, 52, -1, 28, - 236, -1, 36, -1, 73, 237, -1, 49, 104, 160, - 105, -1, 92, 104, 158, 105, -1, 22, -1, -1, - 104, 160, 105, -1, 22, -1, 59, -1, 28, 236, - -1, 36, -1, 73, 237, -1, 163, -1, 164, -1, - 10, 94, 166, -1, 10, 94, 104, 165, 105, 167, - -1, -1, 22, -1, 108, 169, -1, 108, 109, 168, - 110, -1, 171, -1, 168, 103, 171, -1, 173, -1, - 208, -1, 218, -1, 173, -1, 208, -1, 219, -1, - 172, -1, 209, -1, 218, -1, 173, -1, 72, 197, - -1, 72, 174, -1, 72, 176, -1, 72, 179, -1, - 72, 181, -1, 72, 187, -1, 72, 183, -1, 72, - 190, -1, 72, 192, -1, 72, 194, -1, 72, 196, - -1, 46, 235, 175, -1, 185, -1, 32, -1, 68, - -1, 42, 104, 186, 105, 177, -1, 185, -1, 59, - -1, 25, -1, 71, 178, -1, 39, -1, 31, -1, - 43, 180, -1, 24, -1, 235, 66, -1, 44, 104, - 186, 105, 235, 182, -1, 185, -1, 74, 239, 184, - -1, 28, -1, 24, -1, 30, -1, 70, -1, 22, - -1, 75, 237, 188, 189, -1, 34, -1, 53, -1, - 78, -1, 79, -1, 77, -1, 76, -1, 35, 191, - -1, 28, -1, 55, -1, 27, 104, 193, 105, 56, - -1, 22, -1, 57, 195, -1, 69, -1, 25, -1, - 199, 65, 104, 202, 105, -1, 199, 198, -1, -1, - 65, 104, 202, 100, 202, 105, -1, 48, 203, 200, - -1, -1, 201, -1, 40, -1, 81, -1, 41, -1, - 22, -1, 50, 204, -1, 62, -1, 51, -1, 80, - 237, -1, 54, 104, 206, 105, -1, 47, 104, 207, - 105, -1, -1, 205, -1, 22, -1, 22, -1, 22, - -1, 212, -1, 215, -1, 210, -1, 213, -1, 61, - 33, 104, 211, 105, -1, 216, -1, 216, 100, 216, - -1, 61, 33, 104, 216, 105, -1, 61, 45, 104, - 214, 105, -1, 217, -1, 217, 100, 217, -1, 61, - 45, 104, 217, 105, -1, 22, -1, 22, -1, 220, - -1, 222, -1, 221, -1, 222, -1, 223, -1, 23, - -1, 22, -1, 109, 223, 110, -1, 109, 223, 103, - 223, 110, -1, 109, 223, 103, 223, 103, 223, 110, - -1, 109, 223, 103, 223, 103, 223, 103, 223, 110, - -1, 224, 23, -1, 224, 22, -1, 106, -1, 107, - -1, -1, -1, 11, 226, 229, -1, -1, 5, 228, - 229, -1, 229, 103, 94, -1, 94, -1, 9, 94, - 108, 231, -1, 64, 59, -1, 64, 36, -1, 64, - 232, -1, 64, 58, -1, 64, 73, 237, -1, 64, - 29, -1, 28, 233, 234, -1, -1, 38, -1, 26, - -1, -1, 60, -1, 67, -1, -1, 38, -1, 26, - -1, -1, 60, -1, 67, -1, -1, 104, 240, 105, - -1, -1, 104, 241, 105, -1, -1, 104, 242, 105, - -1, 22, -1, 22, -1, 22, -1, 6, 94, 108, - 94, -1 + -1, 91, -1, 92, -1, 93, -1, 94, -1, 21, + 138, 107, 143, 107, 140, -1, 228, 143, 155, -1, + 228, 143, 156, -1, 144, 157, -1, 152, 154, -1, + 141, 107, 141, 107, 141, 107, 141, -1, 228, 142, + -1, 22, -1, 98, -1, 98, -1, 160, -1, 145, + 108, 146, 109, -1, 174, -1, 235, -1, 98, -1, + 98, -1, 147, -1, 148, -1, 22, -1, 152, 153, + 149, -1, -1, 110, 150, -1, 111, 151, -1, 22, + -1, 22, -1, 98, -1, 102, -1, 102, -1, 102, + -1, 102, -1, 99, -1, 103, -1, -1, 99, -1, + 100, -1, 101, -1, 102, -1, -1, 159, -1, 166, + -1, 229, -1, 231, -1, 234, -1, 247, -1, 7, + 98, 112, 160, -1, 95, 161, -1, 37, 165, -1, + 59, -1, 97, 163, -1, 52, -1, 28, 240, -1, + 36, -1, 73, 241, -1, 49, 108, 164, 109, -1, + 96, 108, 162, 109, -1, 22, -1, -1, 108, 164, + 109, -1, 22, -1, 59, -1, 28, 240, -1, 36, + -1, 73, 241, -1, 167, -1, 168, -1, 10, 98, + 170, -1, 10, 98, 108, 169, 109, 171, -1, -1, + 22, -1, 112, 173, -1, 112, 113, 172, 114, -1, + 175, -1, 172, 107, 175, -1, 177, -1, 212, -1, + 222, -1, 177, -1, 212, -1, 223, -1, 176, -1, + 213, -1, 222, -1, 177, -1, 72, 201, -1, 72, + 178, -1, 72, 180, -1, 72, 183, -1, 72, 185, + -1, 72, 191, -1, 72, 187, -1, 72, 194, -1, + 72, 196, -1, 72, 198, -1, 72, 200, -1, 46, + 239, 179, -1, 189, -1, 32, -1, 68, -1, 42, + 108, 190, 109, 181, -1, 189, -1, 59, -1, 25, + -1, 71, 182, -1, 39, -1, 31, -1, 43, 184, + -1, 24, -1, 239, 66, -1, 44, 108, 190, 109, + 239, 186, -1, 189, -1, 74, 243, 188, -1, 28, + -1, 24, -1, 30, -1, 70, -1, 22, -1, 75, + 241, 192, 193, -1, 34, -1, 53, -1, 78, -1, + 79, -1, 77, -1, 76, -1, 35, 195, -1, 28, + -1, 55, -1, 27, 108, 197, 109, 56, -1, 22, + -1, 57, 199, -1, 69, -1, 25, -1, 203, 65, + 108, 206, 109, -1, 203, 202, -1, -1, 65, 108, + 206, 104, 206, 109, -1, 48, 207, 204, -1, -1, + 205, -1, 40, -1, 81, -1, 41, -1, 22, -1, + 50, 208, -1, 62, -1, 51, -1, 80, 241, -1, + 54, 108, 210, 109, -1, 47, 108, 211, 109, -1, + -1, 209, -1, 22, -1, 22, -1, 22, -1, 216, + -1, 219, -1, 214, -1, 217, -1, 61, 33, 108, + 215, 109, -1, 220, -1, 220, 104, 220, -1, 61, + 33, 108, 220, 109, -1, 61, 45, 108, 218, 109, + -1, 221, -1, 221, 104, 221, -1, 61, 45, 108, + 221, 109, -1, 22, -1, 22, -1, 224, -1, 226, + -1, 225, -1, 226, -1, 227, -1, 23, -1, 22, + -1, 113, 227, 114, -1, 113, 227, 107, 227, 114, + -1, 113, 227, 107, 227, 107, 227, 114, -1, 113, + 227, 107, 227, 107, 227, 107, 227, 114, -1, 228, + 23, -1, 228, 22, -1, 110, -1, 111, -1, -1, + -1, 11, 230, 233, -1, -1, 5, 232, 233, -1, + 233, 107, 98, -1, 98, -1, 9, 98, 112, 235, + -1, 64, 59, -1, 64, 36, -1, 64, 236, -1, + 64, 58, -1, 64, 73, 241, -1, 64, 29, -1, + 28, 237, 238, -1, -1, 38, -1, 26, -1, -1, + 60, -1, 67, -1, -1, 38, -1, 26, -1, -1, + 60, -1, 67, -1, -1, 108, 244, 109, -1, -1, + 108, 245, 109, -1, -1, 108, 246, 109, -1, 22, + -1, 22, -1, 22, -1, 6, 98, 112, 98, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 248, 248, 251, 259, 271, 272, 275, 297, 298, - 301, 316, 319, 324, 331, 332, 333, 334, 335, 336, - 337, 340, 341, 344, 350, 357, 364, 372, 379, 387, - 432, 439, 445, 446, 447, 448, 449, 450, 451, 452, - 455, 467, 480, 493, 515, 524, 533, 540, 549, 577, - 619, 630, 651, 661, 667, 691, 708, 708, 710, 717, - 729, 730, 731, 734, 746, 758, 776, 787, 799, 801, - 802, 803, 804, 807, 807, 807, 807, 808, 811, 812, - 813, 814, 815, 816, 819, 837, 841, 847, 851, 855, - 859, 868, 877, 881, 886, 892, 903, 903, 904, 906, - 910, 914, 918, 924, 924, 926, 942, 965, 968, 979, - 985, 991, 992, 999, 1005, 1011, 1019, 1025, 1031, 1039, - 1045, 1051, 1059, 1060, 1063, 1064, 1065, 1066, 1067, 1068, - 1069, 1070, 1071, 1072, 1075, 1084, 1088, 1092, 1098, 1107, - 1111, 1115, 1124, 1128, 1134, 1140, 1147, 1152, 1160, 1170, - 1172, 1180, 1186, 1190, 1194, 1200, 1211, 1220, 1224, 1229, - 1233, 1237, 1241, 1247, 1254, 1258, 1264, 1272, 1283, 1290, - 1294, 1300, 1310, 1321, 1325, 1343, 1352, 1355, 1361, 1365, - 1369, 1375, 1386, 1391, 1396, 1401, 1406, 1411, 1419, 1422, - 1427, 1440, 1448, 1461, 1461, 1463, 1463, 1465, 1475, 1480, - 1487, 1497, 1506, 1511, 1518, 1528, 1538, 1550, 1550, 1551, - 1551, 1553, 1560, 1565, 1572, 1580, 1588, 1597, 1608, 1612, - 1618, 1619, 1620, 1623, 1623, 1626, 1626, 1629, 1635, 1643, - 1656, 1665, 1674, 1678, 1687, 1696, 1707, 1714, 1719, 1728, - 1740, 1743, 1752, 1763, 1764, 1765, 1768, 1769, 1770, 1773, - 1774, 1777, 1778, 1781, 1782, 1785, 1796, 1807, 1818 + 0, 249, 249, 252, 260, 272, 273, 276, 298, 299, + 302, 317, 320, 325, 332, 333, 334, 335, 336, 337, + 338, 341, 342, 345, 351, 358, 365, 373, 380, 388, + 433, 440, 446, 447, 448, 449, 450, 451, 452, 453, + 454, 455, 456, 457, 460, 472, 485, 498, 520, 529, + 538, 545, 554, 582, 624, 635, 656, 666, 672, 696, + 713, 713, 715, 722, 734, 735, 736, 739, 751, 763, + 781, 792, 804, 806, 807, 808, 809, 812, 812, 812, + 812, 813, 816, 817, 818, 819, 820, 821, 824, 842, + 846, 852, 856, 860, 864, 873, 882, 886, 891, 897, + 908, 908, 909, 911, 915, 919, 923, 929, 929, 931, + 947, 970, 973, 984, 990, 996, 997, 1004, 1010, 1016, + 1024, 1030, 1036, 1044, 1050, 1056, 1064, 1065, 1068, 1069, + 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1080, 1089, + 1093, 1097, 1103, 1112, 1116, 1120, 1129, 1133, 1139, 1145, + 1152, 1157, 1165, 1175, 1177, 1185, 1191, 1195, 1199, 1205, + 1216, 1225, 1229, 1234, 1238, 1242, 1246, 1252, 1259, 1263, + 1269, 1277, 1288, 1295, 1299, 1305, 1315, 1326, 1330, 1348, + 1357, 1360, 1366, 1370, 1374, 1380, 1391, 1396, 1401, 1406, + 1411, 1416, 1424, 1427, 1432, 1445, 1453, 1466, 1466, 1468, + 1468, 1470, 1480, 1485, 1492, 1502, 1511, 1516, 1523, 1533, + 1543, 1555, 1555, 1556, 1556, 1558, 1565, 1570, 1577, 1585, + 1593, 1602, 1613, 1617, 1623, 1624, 1625, 1628, 1628, 1631, + 1631, 1634, 1640, 1648, 1661, 1670, 1679, 1683, 1692, 1701, + 1712, 1719, 1724, 1733, 1745, 1748, 1757, 1768, 1769, 1770, + 1773, 1774, 1775, 1778, 1779, 1782, 1783, 1786, 1787, 1790, + 1801, 1812, 1823 }; #endif @@ -797,10 +804,11 @@ static const char *const yytname[] = "STATE", "TEXCOORD", "TEXENV", "TEXGEN", "TEXGEN_Q", "TEXGEN_R", "TEXGEN_S", "TEXGEN_T", "TEXTURE", "TRANSPOSE", "TEXTURE_UNIT", "TEX_1D", "TEX_2D", "TEX_3D", "TEX_CUBE", "TEX_RECT", "TEX_SHADOW1D", - "TEX_SHADOW2D", "TEX_SHADOWRECT", "VERTEX", "VTXATTRIB", "WEIGHT", - "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", "DOT_DOT", - "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", "'}'", - "$accept", "program", "language", "optionSequence", "option", + "TEX_SHADOW2D", "TEX_SHADOWRECT", "TEX_ARRAY1D", "TEX_ARRAY2D", + "TEX_ARRAYSHADOW1D", "TEX_ARRAYSHADOW2D", "VERTEX", "VTXATTRIB", + "WEIGHT", "IDENTIFIER", "MASK4", "MASK3", "MASK2", "MASK1", "SWIZZLE", + "DOT_DOT", "DOT", "';'", "','", "'['", "']'", "'+'", "'-'", "'='", "'{'", + "'}'", "$accept", "program", "language", "optionSequence", "option", "statementSequence", "statement", "instruction", "ALU_instruction", "TexInstruction", "ARL_instruction", "VECTORop_instruction", "SCALARop_instruction", "BINSCop_instruction", "BINop_instruction", @@ -858,40 +866,41 @@ static const yytype_uint16 yytoknum[] = 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, - 355, 356, 59, 44, 91, 93, 43, 45, 61, 123, - 125 + 355, 356, 357, 358, 359, 360, 59, 44, 91, 93, + 43, 45, 61, 123, 125 }; # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ static const yytype_uint8 yyr1[] = { - 0, 111, 112, 113, 113, 114, 114, 115, 116, 116, - 117, 117, 118, 118, 119, 119, 119, 119, 119, 119, - 119, 120, 120, 121, 122, 123, 124, 125, 126, 127, - 128, 129, 130, 130, 130, 130, 130, 130, 130, 130, - 131, 132, 133, 134, 135, 136, 137, 138, 138, 139, - 139, 139, 139, 140, 140, 141, 142, 142, 143, 144, - 145, 145, 145, 146, 147, 148, 149, 150, 151, 152, - 152, 152, 152, 153, 153, 153, 153, 153, 154, 154, - 154, 154, 154, 154, 155, 156, 156, 157, 157, 157, - 157, 157, 157, 157, 157, 158, 159, 159, 160, 161, - 161, 161, 161, 162, 162, 163, 164, 165, 165, 166, - 167, 168, 168, 169, 169, 169, 170, 170, 170, 171, - 171, 171, 172, 172, 173, 173, 173, 173, 173, 173, - 173, 173, 173, 173, 174, 175, 175, 175, 176, 177, - 177, 177, 177, 177, 178, 179, 180, 180, 181, 182, - 183, 184, 185, 185, 185, 186, 187, 188, 188, 189, - 189, 189, 189, 190, 191, 191, 192, 193, 194, 195, - 195, 196, 197, 198, 198, 199, 200, 200, 201, 201, - 201, 202, 203, 203, 203, 203, 203, 203, 204, 204, - 205, 206, 207, 208, 208, 209, 209, 210, 211, 211, - 212, 213, 214, 214, 215, 216, 217, 218, 218, 219, - 219, 220, 221, 221, 222, 222, 222, 222, 223, 223, - 224, 224, 224, 226, 225, 228, 227, 229, 229, 230, - 231, 231, 231, 231, 231, 231, 232, 233, 233, 233, - 234, 234, 234, 235, 235, 235, 236, 236, 236, 237, - 237, 238, 238, 239, 239, 240, 241, 242, 243 + 0, 115, 116, 117, 117, 118, 118, 119, 120, 120, + 121, 121, 122, 122, 123, 123, 123, 123, 123, 123, + 123, 124, 124, 125, 126, 127, 128, 129, 130, 131, + 132, 133, 134, 134, 134, 134, 134, 134, 134, 134, + 134, 134, 134, 134, 135, 136, 137, 138, 139, 140, + 141, 142, 142, 143, 143, 143, 143, 144, 144, 145, + 146, 146, 147, 148, 149, 149, 149, 150, 151, 152, + 153, 154, 155, 156, 156, 156, 156, 157, 157, 157, + 157, 157, 158, 158, 158, 158, 158, 158, 159, 160, + 160, 161, 161, 161, 161, 161, 161, 161, 161, 162, + 163, 163, 164, 165, 165, 165, 165, 166, 166, 167, + 168, 169, 169, 170, 171, 172, 172, 173, 173, 173, + 174, 174, 174, 175, 175, 175, 176, 176, 177, 177, + 177, 177, 177, 177, 177, 177, 177, 177, 178, 179, + 179, 179, 180, 181, 181, 181, 181, 181, 182, 183, + 184, 184, 185, 186, 187, 188, 189, 189, 189, 190, + 191, 192, 192, 193, 193, 193, 193, 194, 195, 195, + 196, 197, 198, 199, 199, 200, 201, 202, 202, 203, + 204, 204, 205, 205, 205, 206, 207, 207, 207, 207, + 207, 207, 208, 208, 209, 210, 211, 212, 212, 213, + 213, 214, 215, 215, 216, 217, 218, 218, 219, 220, + 221, 222, 222, 223, 223, 224, 225, 225, 226, 226, + 226, 226, 227, 227, 228, 228, 228, 230, 229, 232, + 231, 233, 233, 234, 235, 235, 235, 235, 235, 235, + 236, 237, 237, 237, 238, 238, 238, 239, 239, 239, + 240, 240, 240, 241, 241, 242, 242, 243, 243, 244, + 245, 246, 247 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -901,28 +910,29 @@ static const yytype_uint8 yyr2[] = 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 4, 4, 4, 6, 6, 8, 8, 2, 2, 1, 1, 1, 1, 1, 1, 1, 1, - 6, 3, 3, 2, 2, 7, 2, 1, 1, 1, - 1, 4, 1, 1, 1, 1, 1, 1, 1, 3, - 0, 2, 2, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, - 1, 1, 1, 1, 4, 2, 2, 1, 2, 1, - 2, 1, 2, 4, 4, 1, 0, 3, 1, 1, - 2, 1, 2, 1, 1, 3, 6, 0, 1, 2, - 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, - 2, 2, 2, 2, 3, 1, 1, 1, 5, 1, - 1, 1, 2, 1, 1, 2, 1, 2, 6, 1, - 3, 1, 1, 1, 1, 1, 4, 1, 1, 1, - 1, 1, 1, 2, 1, 1, 5, 1, 2, 1, - 1, 5, 2, 0, 6, 3, 0, 1, 1, 1, - 1, 1, 2, 1, 1, 2, 4, 4, 0, 1, - 1, 1, 1, 1, 1, 1, 1, 5, 1, 3, - 5, 5, 1, 3, 5, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 3, 5, 7, 9, 2, 2, - 1, 1, 0, 0, 3, 0, 3, 3, 1, 4, - 2, 2, 2, 2, 3, 2, 3, 0, 1, 1, - 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, - 3, 0, 3, 0, 3, 1, 1, 1, 4 + 1, 1, 1, 1, 6, 3, 3, 2, 2, 7, + 2, 1, 1, 1, 1, 4, 1, 1, 1, 1, + 1, 1, 1, 3, 0, 2, 2, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, + 1, 0, 1, 1, 1, 1, 1, 1, 4, 2, + 2, 1, 2, 1, 2, 1, 2, 4, 4, 1, + 0, 3, 1, 1, 2, 1, 2, 1, 1, 3, + 6, 0, 1, 2, 4, 1, 3, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, + 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, + 1, 1, 5, 1, 1, 1, 2, 1, 1, 2, + 1, 2, 6, 1, 3, 1, 1, 1, 1, 1, + 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, + 5, 1, 2, 1, 1, 5, 2, 0, 6, 3, + 0, 1, 1, 1, 1, 1, 2, 1, 1, 2, + 4, 4, 0, 1, 1, 1, 1, 1, 1, 1, + 1, 5, 1, 3, 5, 5, 1, 3, 5, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, + 7, 9, 2, 2, 1, 1, 0, 0, 3, 0, + 3, 3, 1, 4, 2, 2, 2, 2, 3, 2, + 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, + 0, 1, 1, 0, 3, 0, 3, 0, 3, 1, + 1, 1, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -931,64 +941,65 @@ static const yytype_uint8 yyr2[] = static const yytype_uint16 yydefact[] = { 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 225, 0, 0, 0, 0, 223, 2, 0, 0, - 0, 0, 0, 0, 0, 222, 0, 8, 0, 12, + 0, 229, 0, 0, 0, 0, 227, 2, 0, 0, + 0, 0, 0, 0, 0, 226, 0, 8, 0, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, - 0, 78, 79, 103, 104, 80, 81, 82, 83, 7, - 0, 0, 0, 0, 0, 0, 0, 54, 0, 77, - 53, 0, 0, 0, 0, 0, 65, 0, 0, 220, - 221, 30, 0, 0, 10, 11, 228, 226, 0, 0, - 0, 107, 222, 105, 224, 237, 235, 231, 233, 230, - 249, 232, 222, 73, 74, 75, 76, 43, 222, 222, - 222, 222, 222, 222, 67, 44, 213, 212, 0, 0, - 0, 0, 49, 222, 72, 0, 50, 52, 116, 117, - 193, 194, 118, 209, 210, 0, 0, 258, 84, 229, - 108, 0, 109, 113, 114, 115, 207, 208, 211, 0, - 239, 238, 240, 0, 234, 0, 0, 0, 0, 25, - 0, 24, 23, 246, 101, 99, 249, 86, 0, 0, - 0, 0, 0, 243, 0, 243, 0, 0, 253, 249, - 124, 125, 126, 127, 129, 128, 130, 131, 132, 133, - 0, 246, 91, 0, 89, 87, 249, 0, 96, 85, - 0, 70, 69, 71, 42, 0, 0, 227, 0, 219, - 218, 241, 242, 236, 255, 0, 222, 222, 0, 0, - 222, 247, 248, 100, 102, 0, 0, 0, 164, 165, - 163, 0, 146, 245, 244, 145, 0, 0, 0, 0, - 188, 184, 0, 183, 249, 176, 170, 169, 168, 0, - 0, 0, 0, 90, 0, 92, 0, 0, 88, 222, - 214, 58, 0, 56, 57, 0, 222, 0, 106, 250, - 27, 26, 68, 41, 251, 0, 0, 205, 0, 206, - 0, 167, 0, 155, 0, 147, 0, 152, 153, 136, - 137, 154, 134, 135, 0, 190, 182, 189, 0, 185, - 178, 180, 179, 175, 177, 257, 0, 151, 150, 157, - 158, 0, 0, 98, 0, 95, 0, 0, 0, 51, - 66, 60, 40, 0, 0, 222, 0, 31, 0, 222, - 200, 204, 0, 0, 243, 192, 0, 191, 0, 254, - 162, 161, 159, 160, 156, 181, 0, 93, 94, 97, - 222, 215, 0, 0, 59, 222, 47, 48, 46, 0, - 0, 0, 111, 119, 122, 120, 195, 196, 121, 256, - 0, 32, 33, 34, 35, 36, 37, 38, 39, 29, - 28, 166, 141, 143, 140, 0, 138, 139, 0, 187, - 186, 171, 0, 63, 61, 64, 62, 0, 0, 0, - 123, 173, 222, 110, 252, 144, 142, 148, 149, 222, - 216, 222, 0, 0, 0, 172, 112, 0, 0, 0, - 198, 0, 202, 0, 217, 222, 197, 0, 201, 0, - 0, 45, 199, 203, 0, 0, 174 + 0, 82, 83, 107, 108, 84, 85, 86, 87, 7, + 0, 0, 0, 0, 0, 0, 0, 58, 0, 81, + 57, 0, 0, 0, 0, 0, 69, 0, 0, 224, + 225, 30, 0, 0, 10, 11, 232, 230, 0, 0, + 0, 111, 226, 109, 228, 241, 239, 235, 237, 234, + 253, 236, 226, 77, 78, 79, 80, 47, 226, 226, + 226, 226, 226, 226, 71, 48, 217, 216, 0, 0, + 0, 0, 53, 226, 76, 0, 54, 56, 120, 121, + 197, 198, 122, 213, 214, 0, 0, 262, 88, 233, + 112, 0, 113, 117, 118, 119, 211, 212, 215, 0, + 243, 242, 244, 0, 238, 0, 0, 0, 0, 25, + 0, 24, 23, 250, 105, 103, 253, 90, 0, 0, + 0, 0, 0, 247, 0, 247, 0, 0, 257, 253, + 128, 129, 130, 131, 133, 132, 134, 135, 136, 137, + 0, 250, 95, 0, 93, 91, 253, 0, 100, 89, + 0, 74, 73, 75, 46, 0, 0, 231, 0, 223, + 222, 245, 246, 240, 259, 0, 226, 226, 0, 0, + 226, 251, 252, 104, 106, 0, 0, 0, 168, 169, + 167, 0, 150, 249, 248, 149, 0, 0, 0, 0, + 192, 188, 0, 187, 253, 180, 174, 173, 172, 0, + 0, 0, 0, 94, 0, 96, 0, 0, 92, 226, + 218, 62, 0, 60, 61, 0, 226, 0, 110, 254, + 27, 26, 72, 45, 255, 0, 0, 209, 0, 210, + 0, 171, 0, 159, 0, 151, 0, 156, 157, 140, + 141, 158, 138, 139, 0, 194, 186, 193, 0, 189, + 182, 184, 183, 179, 181, 261, 0, 155, 154, 161, + 162, 0, 0, 102, 0, 99, 0, 0, 0, 55, + 70, 64, 44, 0, 0, 226, 0, 31, 0, 226, + 204, 208, 0, 0, 247, 196, 0, 195, 0, 258, + 166, 165, 163, 164, 160, 185, 0, 97, 98, 101, + 226, 219, 0, 0, 63, 226, 51, 52, 50, 0, + 0, 0, 115, 123, 126, 124, 199, 200, 125, 260, + 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 29, 28, 170, 145, 147, 144, 0, + 142, 143, 0, 191, 190, 175, 0, 67, 65, 68, + 66, 0, 0, 0, 127, 177, 226, 114, 256, 148, + 146, 152, 153, 226, 220, 226, 0, 0, 0, 176, + 116, 0, 0, 0, 202, 0, 206, 0, 221, 226, + 201, 0, 205, 0, 0, 49, 203, 207, 0, 0, + 178 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 265, 369, + 31, 32, 33, 34, 35, 36, 37, 38, 265, 373, 39, 146, 71, 58, 67, 312, 313, 348, 114, 59, - 115, 252, 253, 254, 344, 384, 386, 68, 311, 105, + 115, 252, 253, 254, 344, 388, 390, 68, 311, 105, 263, 194, 97, 40, 41, 116, 189, 306, 248, 304, 157, 42, 43, 44, 131, 83, 258, 351, 132, 117, - 352, 353, 118, 170, 282, 171, 376, 396, 172, 225, - 173, 397, 174, 298, 283, 274, 175, 301, 334, 176, - 220, 177, 272, 178, 238, 179, 390, 405, 180, 293, + 352, 353, 118, 170, 282, 171, 380, 400, 172, 225, + 173, 401, 174, 298, 283, 274, 175, 301, 334, 176, + 220, 177, 272, 178, 238, 179, 394, 409, 180, 293, 294, 336, 235, 286, 287, 328, 326, 119, 355, 356, - 409, 120, 357, 411, 121, 268, 270, 358, 122, 136, + 413, 120, 357, 415, 121, 268, 270, 358, 122, 136, 123, 124, 138, 72, 45, 55, 46, 50, 77, 47, 60, 91, 142, 203, 226, 213, 144, 317, 240, 205, 360, 296, 48 @@ -996,201 +1007,203 @@ static const yytype_int16 yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -374 +#define YYPACT_NINF -377 static const yytype_int16 yypact[] = { - 154, -374, -374, 33, -374, -374, 35, -31, -374, 166, - 27, -374, 55, 66, 72, 96, -374, -374, -34, -34, - -34, -34, -34, -34, 115, 87, -34, -374, 108, -374, - -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, - 109, -374, -374, -374, -374, -374, -374, -374, -374, -374, - 118, 105, 106, 107, -5, 118, 92, -374, 113, 102, - -374, 114, 116, 117, 119, 120, -374, 121, 97, -374, - -374, -374, -15, 122, -374, -374, -374, 123, 124, -17, - 157, 205, -16, -374, 123, 13, -374, -374, -374, -374, - 128, -374, 87, -374, -374, -374, -374, -374, 87, 87, - 87, 87, 87, 87, -374, -374, -374, -374, 19, 40, - 23, -11, 132, 87, 93, 134, -374, -374, -374, -374, - -374, -374, -374, -374, -374, -15, 135, -374, -374, -374, - -374, 136, -374, -374, -374, -374, -374, -374, -374, 183, - -374, -374, 57, 206, -374, 137, 139, -15, 140, -374, - 141, -374, -374, 80, -374, -374, 128, -374, 142, 143, - 144, 6, 145, 85, 146, 26, 65, -1, 147, 128, - -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, - 172, 80, -374, 148, -374, -374, 128, 149, 150, -374, - 58, -374, -374, -374, -374, -10, 152, -374, 131, -374, - -374, -374, -374, -374, -374, 151, 87, 87, 159, 163, - 87, -374, -374, -374, -374, 237, 238, 239, -374, -374, - -374, 240, -374, -374, -374, -374, 198, 240, 76, 161, - 244, -374, 164, -374, 128, -4, -374, -374, -374, 245, - 241, 1, 167, -374, 248, -374, 250, 248, -374, 87, - -374, -374, 168, -374, -374, 176, 87, 169, -374, -374, - -374, -374, -374, -374, 171, 173, 174, -374, 175, -374, - 177, -374, 178, -374, 179, -374, 180, -374, -374, -374, - -374, -374, -374, -374, 257, -374, -374, -374, 259, -374, - -374, -374, -374, -374, -374, -374, 181, -374, -374, -374, - -374, 125, 265, -374, 185, -374, 186, 187, 59, -374, - -374, 101, -374, 190, -7, -2, 266, -374, 48, 87, - -374, -374, 242, 71, 26, -374, 189, -374, 191, -374, - -374, -374, -374, -374, -374, -374, 192, -374, -374, -374, - 87, -374, 273, 277, -374, 87, -374, -374, -374, 81, - 23, 60, -374, -374, -374, -374, -374, -374, -374, -374, - 195, -374, -374, -374, -374, -374, -374, -374, -374, -374, - -374, -374, -374, -374, -374, 270, -374, -374, 2, -374, - -374, -374, 86, -374, -374, -374, -374, 199, 200, 201, - -374, 243, -2, -374, -374, -374, -374, -374, -374, 87, - -374, 87, 237, 238, 202, -374, -374, 193, 204, 208, - 209, 210, 214, 265, -374, 87, -374, 237, -374, 238, - 43, -374, -374, -374, 265, 211, -374 + 205, -377, -377, 34, -377, -377, 50, -17, -377, 166, + -16, -377, 12, 26, 36, 65, -377, -377, -31, -31, + -31, -31, -31, -31, 72, -67, -31, -377, 108, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + 109, -377, -377, -377, -377, -377, -377, -377, -377, -377, + 118, 28, 106, 107, 54, 118, 78, -377, 110, 101, + -377, 113, 114, 115, 116, 117, -377, 119, 123, -377, + -377, -377, -15, 120, -377, -377, -377, 121, 131, -13, + 168, 214, -34, -377, 121, 27, -377, -377, -377, -377, + 129, -377, -67, -377, -377, -377, -377, -377, -67, -67, + -67, -67, -67, -67, -377, -377, -377, -377, 1, 88, + 84, 0, 130, -67, 66, 132, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -15, 141, -377, -377, -377, + -377, 133, -377, -377, -377, -377, -377, -377, -377, 188, + -377, -377, -25, 219, -377, 136, 137, -15, 138, -377, + 139, -377, -377, 4, -377, -377, 129, -377, 140, 142, + 143, 40, 144, 63, 145, 91, 58, 16, 146, 129, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + 182, 4, -377, 147, -377, -377, 129, 148, 149, -377, + 41, -377, -377, -377, -377, -7, 152, -377, 150, -377, + -377, -377, -377, -377, -377, 151, -67, -67, 159, 167, + -67, -377, -377, -377, -377, 242, 243, 244, -377, -377, + -377, 245, -377, -377, -377, -377, 202, 245, 24, 161, + 248, -377, 163, -377, 129, 22, -377, -377, -377, 250, + 246, -2, 165, -377, 253, -377, 254, 253, -377, -67, + -377, -377, 169, -377, -377, 175, -67, 170, -377, -377, + -377, -377, -377, -377, 171, 173, 174, -377, 176, -377, + 177, -377, 178, -377, 179, -377, 180, -377, -377, -377, + -377, -377, -377, -377, 260, -377, -377, -377, 262, -377, + -377, -377, -377, -377, -377, -377, 181, -377, -377, -377, + -377, 128, 269, -377, 183, -377, 185, 186, 42, -377, + -377, 102, -377, 189, -5, -11, 275, -377, 105, -67, + -377, -377, 247, 45, 91, -377, 190, -377, 191, -377, + -377, -377, -377, -377, -377, -377, 192, -377, -377, -377, + -67, -377, 276, 280, -377, -67, -377, -377, -377, 90, + 84, 46, -377, -377, -377, -377, -377, -377, -377, -377, + 195, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, 274, + -377, -377, -4, -377, -377, -377, 47, -377, -377, -377, + -377, 199, 200, 201, -377, 252, -11, -377, -377, -377, + -377, -377, -377, -67, -377, -67, 242, 243, 203, -377, + -377, 193, 206, 209, 208, 210, 216, 269, -377, -67, + -377, 242, -377, 243, 48, -377, -377, -377, 269, 213, + -377 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, - -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, - -374, -94, -88, 133, -374, -374, -326, -374, -98, -374, - -374, -374, -374, -374, -374, -374, -374, 126, -374, -374, - -374, -374, -374, -374, -374, 246, -374, -374, -374, 73, - -374, -374, -374, -374, -374, -374, -374, -374, -374, -374, - -74, -374, -81, -374, -374, -374, -374, -374, -374, -374, - -374, -374, -374, -374, -295, 95, -374, -374, -374, -374, - -374, -374, -374, -374, -374, -374, -374, -374, -27, -374, - -374, -371, -374, -374, -374, -374, -374, 247, -374, -374, - -374, -374, -374, -374, -374, -373, -317, 249, -374, -374, - -374, -80, -110, -82, -374, -374, -374, -374, 269, -374, - 252, -374, -374, -374, -160, 153, -146, -374, -374, -374, - -374, -374, -374 + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -377, -94, -88, 124, -377, -377, -333, -377, -100, -377, + -377, -377, -377, -377, -377, -377, -377, 134, -377, -377, + -377, -377, -377, -377, -377, 231, -377, -377, -377, 77, + -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, + -71, -377, -81, -377, -377, -377, -377, -377, -377, -377, + -377, -377, -377, -377, -304, 99, -377, -377, -377, -377, + -377, -377, -377, -377, -377, -377, -377, -377, -23, -377, + -377, -286, -377, -377, -377, -377, -377, 249, -377, -377, + -377, -377, -377, -377, -377, -376, -368, 251, -377, -377, + -377, -80, -110, -82, -377, -377, -377, -377, 273, -377, + 255, -377, -377, -377, -160, 153, -146, -377, -377, -377, + -377, -377, -377 }; /* 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 -56 +#define YYTABLE_NINF -60 static const yytype_int16 yytable[] = { 139, 133, 137, 190, 145, 228, 149, 106, 107, 152, - 214, 148, 251, 150, 151, 346, 147, 181, 147, 387, - 108, 147, 108, 241, 236, 182, 277, 196, 377, 410, - 56, 139, 278, 5, 218, 299, 290, 291, 183, 140, - 245, 184, 420, 7, 422, 109, 109, 153, 185, 208, - 160, 141, 223, 425, 300, 154, 110, 110, 161, 349, - 57, 219, 186, 10, 224, 162, 163, 164, 237, 165, - 350, 166, 281, 158, 111, 408, 111, 292, 155, 112, - 167, 187, 188, 398, 66, 159, 412, 347, 289, 421, - 69, 70, 156, 113, 113, 277, 372, 168, 169, 81, - 277, 278, 423, 82, 69, 70, 278, 113, 279, 222, - 373, 223, 229, 261, 388, 230, 231, 201, 260, 232, - 85, 86, 266, 224, 202, 147, 389, 233, 87, 49, - 374, 361, 362, 363, 364, 365, 366, 367, 368, 308, - 211, 281, 375, 424, 280, 234, 281, 212, 381, 51, - 88, 89, 61, 62, 63, 64, 65, 1, 2, 73, - 52, 249, 340, 392, 378, 90, 53, 139, 250, 341, - 393, 11, 12, 13, 314, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 191, 399, - 54, 192, 193, 69, 70, 104, 400, 93, 94, 95, - 96, 330, 331, 332, 333, 199, 200, 342, 343, 66, - 74, 75, 76, 78, 79, 80, 92, 98, 127, 99, - 100, 56, 101, 102, 103, 125, 126, 130, 204, 197, - 382, 370, 143, 139, 354, 137, -55, 242, 195, 257, - 206, 198, 207, 209, 210, 264, 215, 216, 217, 221, - 227, 239, 244, 246, 247, 256, 259, 262, 139, 267, - 269, 271, 273, 314, 275, 284, 285, 295, 288, 297, - 303, 302, 305, 309, 310, 316, 318, 319, 315, 325, - 320, 327, 321, 322, 323, 324, 329, 335, 359, 407, - 337, 338, 339, 345, 379, 383, 380, 381, 371, 385, - 394, 395, 401, 414, 402, 403, 413, 415, 404, 417, - 139, 354, 137, 416, 419, 418, 426, 139, 406, 314, - 307, 255, 276, 391, 84, 128, 0, 0, 0, 134, - 0, 135, 129, 314, 243 + 214, 148, 391, 150, 151, 251, 147, 346, 147, 381, + 277, 147, 108, 241, 108, 196, 278, 109, 181, 153, + 414, 139, 299, 56, 5, 201, 182, 154, 110, 416, + 245, 236, 202, 69, 70, 426, 109, 208, 277, 183, + 349, 300, 184, 140, 278, 427, 279, 110, 7, 185, + 155, 350, 290, 291, 211, 141, 281, 57, 218, 277, + 376, 212, 412, 186, 156, 278, 69, 70, 402, 113, + 111, 10, 111, 112, 377, 237, 425, 222, 289, 223, + 49, 66, 280, 347, 281, 219, 187, 188, 113, 69, + 70, 224, 113, 292, 378, 229, 85, 86, 230, 231, + 51, 160, 232, 261, 87, 281, 379, 223, 260, 161, + 233, 158, 266, 392, 52, 147, 162, 163, 164, 224, + 165, 424, 166, 159, 53, 393, 88, 89, 234, 308, + 78, 167, 429, 61, 62, 63, 64, 65, 249, 340, + 73, 90, 428, 396, 403, 250, 341, 385, 168, 169, + 397, 404, 81, 54, 382, 191, 82, 139, 192, 193, + 66, 11, 12, 13, 314, 14, 15, 16, 17, 18, + 19, 20, 21, 22, 23, 24, 25, 26, 361, 362, + 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 93, 94, 95, 96, 330, 331, 332, 333, 1, 2, + 199, 200, 342, 343, 74, 75, 76, 92, 79, 80, + 98, 99, 100, 101, 102, 104, 103, 125, 126, 127, + 386, 374, 56, 139, 354, 137, 130, 143, -59, 197, + 195, 204, 198, 206, 207, 209, 210, 242, 215, 264, + 216, 217, 221, 227, 239, 244, 246, 247, 139, 256, + 259, 262, 257, 314, 267, 269, 271, 273, 275, 284, + 285, 288, 295, 302, 297, 303, 305, 310, 309, 316, + 318, 319, 325, 315, 327, 320, 321, 322, 323, 324, + 329, 335, 337, 411, 338, 339, 345, 359, 387, 383, + 384, 385, 389, 375, 398, 399, 405, 418, 406, 407, + 128, 417, 421, 419, 139, 354, 137, 408, 420, 422, + 423, 139, 430, 314, 307, 410, 276, 395, 84, 255, + 0, 134, 0, 135, 243, 129, 0, 314 }; static const yytype_int16 yycheck[] = { 82, 82, 82, 113, 92, 165, 100, 22, 23, 103, - 156, 99, 22, 101, 102, 22, 98, 28, 100, 345, - 37, 103, 37, 169, 25, 36, 24, 125, 323, 402, - 64, 113, 30, 0, 28, 34, 40, 41, 49, 26, - 186, 52, 413, 8, 417, 61, 61, 28, 59, 147, - 27, 38, 26, 424, 53, 36, 72, 72, 35, 61, - 94, 55, 73, 94, 38, 42, 43, 44, 69, 46, - 72, 48, 70, 33, 91, 401, 91, 81, 59, 94, - 57, 92, 93, 378, 94, 45, 403, 94, 234, 415, - 106, 107, 73, 109, 109, 24, 25, 74, 75, 104, - 24, 30, 419, 108, 106, 107, 30, 109, 32, 24, - 39, 26, 47, 207, 33, 50, 51, 60, 206, 54, - 28, 29, 210, 38, 67, 207, 45, 62, 36, 102, - 59, 83, 84, 85, 86, 87, 88, 89, 90, 249, - 60, 70, 71, 100, 68, 80, 70, 67, 105, 94, - 58, 59, 19, 20, 21, 22, 23, 3, 4, 26, - 94, 103, 103, 103, 324, 73, 94, 249, 110, 110, - 110, 5, 6, 7, 256, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 95, 103, - 94, 98, 99, 106, 107, 98, 110, 95, 96, 97, - 98, 76, 77, 78, 79, 22, 23, 106, 107, 94, - 102, 102, 94, 108, 108, 108, 103, 103, 94, 103, - 103, 64, 103, 103, 103, 103, 103, 22, 22, 94, - 340, 319, 104, 315, 315, 315, 104, 65, 104, 108, - 103, 105, 103, 103, 103, 82, 104, 104, 104, 104, - 104, 104, 104, 104, 104, 103, 105, 98, 340, 22, - 22, 22, 22, 345, 66, 104, 22, 22, 104, 28, - 22, 104, 22, 105, 98, 104, 103, 103, 109, 22, - 105, 22, 105, 105, 105, 105, 105, 22, 22, 399, - 105, 105, 105, 103, 105, 22, 105, 105, 56, 22, - 105, 31, 103, 110, 104, 104, 104, 103, 65, 100, - 392, 392, 392, 105, 100, 105, 105, 399, 392, 401, - 247, 195, 227, 350, 55, 79, -1, -1, -1, 82, - -1, 82, 80, 415, 181 + 156, 99, 345, 101, 102, 22, 98, 22, 100, 323, + 24, 103, 37, 169, 37, 125, 30, 61, 28, 28, + 406, 113, 34, 64, 0, 60, 36, 36, 72, 407, + 186, 25, 67, 110, 111, 421, 61, 147, 24, 49, + 61, 53, 52, 26, 30, 423, 32, 72, 8, 59, + 59, 72, 40, 41, 60, 38, 70, 98, 28, 24, + 25, 67, 405, 73, 73, 30, 110, 111, 382, 113, + 95, 98, 95, 98, 39, 69, 419, 24, 234, 26, + 106, 98, 68, 98, 70, 55, 96, 97, 113, 110, + 111, 38, 113, 81, 59, 47, 28, 29, 50, 51, + 98, 27, 54, 207, 36, 70, 71, 26, 206, 35, + 62, 33, 210, 33, 98, 207, 42, 43, 44, 38, + 46, 417, 48, 45, 98, 45, 58, 59, 80, 249, + 112, 57, 428, 19, 20, 21, 22, 23, 107, 107, + 26, 73, 104, 107, 107, 114, 114, 109, 74, 75, + 114, 114, 108, 98, 324, 99, 112, 249, 102, 103, + 98, 5, 6, 7, 256, 9, 10, 11, 12, 13, + 14, 15, 16, 17, 18, 19, 20, 21, 83, 84, + 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, + 99, 100, 101, 102, 76, 77, 78, 79, 3, 4, + 22, 23, 110, 111, 106, 106, 98, 107, 112, 112, + 107, 107, 107, 107, 107, 102, 107, 107, 107, 98, + 340, 319, 64, 315, 315, 315, 22, 108, 108, 98, + 108, 22, 109, 107, 107, 107, 107, 65, 108, 82, + 108, 108, 108, 108, 108, 108, 108, 108, 340, 107, + 109, 102, 112, 345, 22, 22, 22, 22, 66, 108, + 22, 108, 22, 108, 28, 22, 22, 102, 109, 108, + 107, 107, 22, 113, 22, 109, 109, 109, 109, 109, + 109, 22, 109, 403, 109, 109, 107, 22, 22, 109, + 109, 109, 22, 56, 109, 31, 107, 114, 108, 108, + 79, 108, 104, 107, 396, 396, 396, 65, 109, 109, + 104, 403, 109, 405, 247, 396, 227, 350, 55, 195, + -1, 82, -1, 82, 181, 80, -1, 419 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ static const yytype_uint8 yystos[] = { - 0, 3, 4, 112, 113, 0, 114, 8, 115, 116, - 94, 5, 6, 7, 9, 10, 11, 12, 13, 14, - 15, 16, 17, 18, 19, 20, 21, 117, 118, 119, - 120, 121, 122, 123, 124, 125, 126, 127, 128, 131, - 154, 155, 162, 163, 164, 225, 227, 230, 243, 102, - 228, 94, 94, 94, 94, 226, 64, 94, 134, 140, - 231, 134, 134, 134, 134, 134, 94, 135, 148, 106, - 107, 133, 224, 134, 102, 102, 94, 229, 108, 108, - 108, 104, 108, 166, 229, 28, 29, 36, 58, 59, - 73, 232, 103, 95, 96, 97, 98, 153, 103, 103, - 103, 103, 103, 103, 98, 150, 22, 23, 37, 61, - 72, 91, 94, 109, 139, 141, 156, 170, 173, 208, - 212, 215, 219, 221, 222, 103, 103, 94, 156, 231, - 22, 165, 169, 173, 208, 218, 220, 222, 223, 224, - 26, 38, 233, 104, 237, 133, 132, 224, 133, 132, - 133, 133, 132, 28, 36, 59, 73, 161, 33, 45, + 0, 3, 4, 116, 117, 0, 118, 8, 119, 120, + 98, 5, 6, 7, 9, 10, 11, 12, 13, 14, + 15, 16, 17, 18, 19, 20, 21, 121, 122, 123, + 124, 125, 126, 127, 128, 129, 130, 131, 132, 135, + 158, 159, 166, 167, 168, 229, 231, 234, 247, 106, + 232, 98, 98, 98, 98, 230, 64, 98, 138, 144, + 235, 138, 138, 138, 138, 138, 98, 139, 152, 110, + 111, 137, 228, 138, 106, 106, 98, 233, 112, 112, + 112, 108, 112, 170, 233, 28, 29, 36, 58, 59, + 73, 236, 107, 99, 100, 101, 102, 157, 107, 107, + 107, 107, 107, 107, 102, 154, 22, 23, 37, 61, + 72, 95, 98, 113, 143, 145, 160, 174, 177, 212, + 216, 219, 223, 225, 226, 107, 107, 98, 160, 235, + 22, 169, 173, 177, 212, 222, 224, 226, 227, 228, + 26, 38, 237, 108, 241, 137, 136, 228, 137, 136, + 137, 137, 136, 28, 36, 59, 73, 165, 33, 45, 27, 35, 42, 43, 44, 46, 48, 57, 74, 75, - 174, 176, 179, 181, 183, 187, 190, 192, 194, 196, - 199, 28, 36, 49, 52, 59, 73, 92, 93, 157, - 223, 95, 98, 99, 152, 104, 139, 94, 105, 22, - 23, 60, 67, 234, 22, 240, 103, 103, 139, 103, - 103, 60, 67, 236, 237, 104, 104, 104, 28, 55, - 191, 104, 24, 26, 38, 180, 235, 104, 235, 47, - 50, 51, 54, 62, 80, 203, 25, 69, 195, 104, - 239, 237, 65, 236, 104, 237, 104, 104, 159, 103, - 110, 22, 142, 143, 144, 148, 103, 108, 167, 105, - 133, 132, 98, 151, 82, 129, 133, 22, 216, 22, - 217, 22, 193, 22, 186, 66, 186, 24, 30, 32, - 68, 70, 175, 185, 104, 22, 204, 205, 104, 237, - 40, 41, 81, 200, 201, 22, 242, 28, 184, 34, - 53, 188, 104, 22, 160, 22, 158, 160, 223, 105, - 98, 149, 136, 137, 224, 109, 104, 238, 103, 103, - 105, 105, 105, 105, 105, 22, 207, 22, 206, 105, - 76, 77, 78, 79, 189, 22, 202, 105, 105, 105, - 103, 110, 106, 107, 145, 103, 22, 94, 138, 61, - 72, 168, 171, 172, 173, 209, 210, 213, 218, 22, - 241, 83, 84, 85, 86, 87, 88, 89, 90, 130, - 133, 56, 25, 39, 59, 71, 177, 185, 235, 105, - 105, 105, 223, 22, 146, 22, 147, 137, 33, 45, - 197, 199, 103, 110, 105, 31, 178, 182, 185, 103, - 110, 103, 104, 104, 65, 198, 171, 223, 137, 211, - 216, 214, 217, 104, 110, 103, 105, 100, 105, 100, - 202, 137, 216, 217, 100, 202, 105 + 178, 180, 183, 185, 187, 191, 194, 196, 198, 200, + 203, 28, 36, 49, 52, 59, 73, 96, 97, 161, + 227, 99, 102, 103, 156, 108, 143, 98, 109, 22, + 23, 60, 67, 238, 22, 244, 107, 107, 143, 107, + 107, 60, 67, 240, 241, 108, 108, 108, 28, 55, + 195, 108, 24, 26, 38, 184, 239, 108, 239, 47, + 50, 51, 54, 62, 80, 207, 25, 69, 199, 108, + 243, 241, 65, 240, 108, 241, 108, 108, 163, 107, + 114, 22, 146, 147, 148, 152, 107, 112, 171, 109, + 137, 136, 102, 155, 82, 133, 137, 22, 220, 22, + 221, 22, 197, 22, 190, 66, 190, 24, 30, 32, + 68, 70, 179, 189, 108, 22, 208, 209, 108, 241, + 40, 41, 81, 204, 205, 22, 246, 28, 188, 34, + 53, 192, 108, 22, 164, 22, 162, 164, 227, 109, + 102, 153, 140, 141, 228, 113, 108, 242, 107, 107, + 109, 109, 109, 109, 109, 22, 211, 22, 210, 109, + 76, 77, 78, 79, 193, 22, 206, 109, 109, 109, + 107, 114, 110, 111, 149, 107, 22, 98, 142, 61, + 72, 172, 175, 176, 177, 213, 214, 217, 222, 22, + 245, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 134, 137, 56, 25, 39, 59, 71, + 181, 189, 239, 109, 109, 109, 227, 22, 150, 22, + 151, 141, 33, 45, 201, 203, 107, 114, 109, 31, + 182, 186, 189, 107, 114, 107, 108, 108, 65, 202, + 175, 227, 141, 215, 220, 218, 221, 108, 114, 107, + 109, 104, 109, 104, 206, 141, 220, 221, 104, 206, + 109 }; #define yyerrok (yyerrstatus = 0) @@ -2044,7 +2057,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 252 "program_parse.y" +#line 253 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2057,7 +2070,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 260 "program_parse.y" +#line 261 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2072,7 +2085,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 276 "program_parse.y" +#line 277 "program_parse.y" { int valid = 0; @@ -2097,7 +2110,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 302 "program_parse.y" +#line 303 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2117,7 +2130,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 320 "program_parse.y" +#line 321 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2127,7 +2140,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 325 "program_parse.y" +#line 326 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2137,7 +2150,7 @@ yyreduce: case 23: /* Line 1455 of yacc.c */ -#line 345 "program_parse.y" +#line 346 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2146,7 +2159,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 351 "program_parse.y" +#line 352 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2156,7 +2169,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 358 "program_parse.y" +#line 359 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2166,7 +2179,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 365 "program_parse.y" +#line 366 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2176,7 +2189,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 373 "program_parse.y" +#line 374 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2186,7 +2199,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 381 "program_parse.y" +#line 382 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2196,7 +2209,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 388 "program_parse.y" +#line 389 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2244,7 +2257,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 433 "program_parse.y" +#line 434 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2254,7 +2267,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 440 "program_parse.y" +#line 441 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2263,63 +2276,91 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 445 "program_parse.y" +#line 446 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 446 "program_parse.y" +#line 447 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 447 "program_parse.y" +#line 448 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 448 "program_parse.y" +#line 449 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 449 "program_parse.y" +#line 450 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 450 "program_parse.y" +#line 451 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 38: /* Line 1455 of yacc.c */ -#line 451 "program_parse.y" +#line 452 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 39: /* Line 1455 of yacc.c */ -#line 452 "program_parse.y" +#line 453 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 40: +/* Line 1455 of yacc.c */ +#line 454 "program_parse.y" + { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} + break; + + case 41: + +/* Line 1455 of yacc.c */ +#line 455 "program_parse.y" + { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} + break; + + case 42: + /* Line 1455 of yacc.c */ #line 456 "program_parse.y" + { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} + break; + + case 43: + +/* Line 1455 of yacc.c */ +#line 457 "program_parse.y" + { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} + break; + + case 44: + +/* Line 1455 of yacc.c */ +#line 461 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2331,10 +2372,10 @@ yyreduce: ;} break; - case 41: + case 45: /* Line 1455 of yacc.c */ -#line 468 "program_parse.y" +#line 473 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2347,10 +2388,10 @@ yyreduce: ;} break; - case 42: + case 46: /* Line 1455 of yacc.c */ -#line 481 "program_parse.y" +#line 486 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2363,10 +2404,10 @@ yyreduce: ;} break; - case 43: + case 47: /* Line 1455 of yacc.c */ -#line 494 "program_parse.y" +#line 499 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2388,10 +2429,10 @@ yyreduce: ;} break; - case 44: + case 48: /* Line 1455 of yacc.c */ -#line 516 "program_parse.y" +#line 521 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2400,10 +2441,10 @@ yyreduce: ;} break; - case 45: + case 49: /* Line 1455 of yacc.c */ -#line 525 "program_parse.y" +#line 530 "program_parse.y" { (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); @@ -2412,20 +2453,20 @@ yyreduce: ;} break; - case 46: + case 50: /* Line 1455 of yacc.c */ -#line 534 "program_parse.y" +#line 539 "program_parse.y" { (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; - case 47: + case 51: /* Line 1455 of yacc.c */ -#line 541 "program_parse.y" +#line 546 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2436,10 +2477,10 @@ yyreduce: ;} break; - case 48: + case 52: /* Line 1455 of yacc.c */ -#line 550 "program_parse.y" +#line 555 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2467,10 +2508,10 @@ yyreduce: ;} break; - case 49: + case 53: /* Line 1455 of yacc.c */ -#line 578 "program_parse.y" +#line 583 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2514,10 +2555,10 @@ yyreduce: ;} break; - case 50: + case 54: /* Line 1455 of yacc.c */ -#line 620 "program_parse.y" +#line 625 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2530,10 +2571,10 @@ yyreduce: ;} break; - case 51: + case 55: /* Line 1455 of yacc.c */ -#line 631 "program_parse.y" +#line 636 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2556,10 +2597,10 @@ yyreduce: ;} break; - case 52: + case 56: /* Line 1455 of yacc.c */ -#line 652 "program_parse.y" +#line 657 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2569,10 +2610,10 @@ yyreduce: ;} break; - case 53: + case 57: /* Line 1455 of yacc.c */ -#line 662 "program_parse.y" +#line 667 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2580,10 +2621,10 @@ yyreduce: ;} break; - case 54: + case 58: /* Line 1455 of yacc.c */ -#line 668 "program_parse.y" +#line 673 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2607,10 +2648,10 @@ yyreduce: ;} break; - case 55: + case 59: /* Line 1455 of yacc.c */ -#line 692 "program_parse.y" +#line 697 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2627,20 +2668,20 @@ yyreduce: ;} break; - case 58: + case 62: /* Line 1455 of yacc.c */ -#line 711 "program_parse.y" +#line 716 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); ;} break; - case 59: + case 63: /* Line 1455 of yacc.c */ -#line 718 "program_parse.y" +#line 723 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2652,31 +2693,31 @@ yyreduce: ;} break; - case 60: + case 64: /* Line 1455 of yacc.c */ -#line 729 "program_parse.y" +#line 734 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 61: + case 65: /* Line 1455 of yacc.c */ -#line 730 "program_parse.y" +#line 735 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 62: + case 66: /* Line 1455 of yacc.c */ -#line 731 "program_parse.y" +#line 736 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; - case 63: + case 67: /* Line 1455 of yacc.c */ -#line 735 "program_parse.y" +#line 740 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2688,10 +2729,10 @@ yyreduce: ;} break; - case 64: + case 68: /* Line 1455 of yacc.c */ -#line 747 "program_parse.y" +#line 752 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2703,10 +2744,10 @@ yyreduce: ;} break; - case 65: + case 69: /* Line 1455 of yacc.c */ -#line 759 "program_parse.y" +#line 764 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2724,10 +2765,10 @@ yyreduce: ;} break; - case 66: + case 70: /* Line 1455 of yacc.c */ -#line 777 "program_parse.y" +#line 782 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2738,10 +2779,10 @@ yyreduce: ;} break; - case 67: + case 71: /* Line 1455 of yacc.c */ -#line 788 "program_parse.y" +#line 793 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2753,24 +2794,24 @@ yyreduce: ;} break; - case 72: + case 76: /* Line 1455 of yacc.c */ -#line 804 "program_parse.y" +#line 809 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 77: + case 81: /* Line 1455 of yacc.c */ -#line 808 "program_parse.y" +#line 813 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; - case 84: + case 88: /* Line 1455 of yacc.c */ -#line 820 "program_parse.y" +#line 825 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2788,55 +2829,55 @@ yyreduce: ;} break; - case 85: + case 89: /* Line 1455 of yacc.c */ -#line 838 "program_parse.y" +#line 843 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 86: + case 90: /* Line 1455 of yacc.c */ -#line 842 "program_parse.y" +#line 847 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} break; - case 87: + case 91: /* Line 1455 of yacc.c */ -#line 848 "program_parse.y" +#line 853 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} break; - case 88: + case 92: /* Line 1455 of yacc.c */ -#line 852 "program_parse.y" +#line 857 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} break; - case 89: + case 93: /* Line 1455 of yacc.c */ -#line 856 "program_parse.y" +#line 861 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} break; - case 90: + case 94: /* Line 1455 of yacc.c */ -#line 860 "program_parse.y" +#line 865 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2847,10 +2888,10 @@ yyreduce: ;} break; - case 91: + case 95: /* Line 1455 of yacc.c */ -#line 869 "program_parse.y" +#line 874 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2861,38 +2902,38 @@ yyreduce: ;} break; - case 92: + case 96: /* Line 1455 of yacc.c */ -#line 878 "program_parse.y" +#line 883 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 93: + case 97: /* Line 1455 of yacc.c */ -#line 882 "program_parse.y" +#line 887 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 94: + case 98: /* Line 1455 of yacc.c */ -#line 887 "program_parse.y" +#line 892 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} break; - case 95: + case 99: /* Line 1455 of yacc.c */ -#line 893 "program_parse.y" +#line 898 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2903,46 +2944,46 @@ yyreduce: ;} break; - case 99: + case 103: /* Line 1455 of yacc.c */ -#line 907 "program_parse.y" +#line 912 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} break; - case 100: + case 104: /* Line 1455 of yacc.c */ -#line 911 "program_parse.y" +#line 916 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} break; - case 101: + case 105: /* Line 1455 of yacc.c */ -#line 915 "program_parse.y" +#line 920 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} break; - case 102: + case 106: /* Line 1455 of yacc.c */ -#line 919 "program_parse.y" +#line 924 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} break; - case 105: + case 109: /* Line 1455 of yacc.c */ -#line 927 "program_parse.y" +#line 932 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -2958,10 +2999,10 @@ yyreduce: ;} break; - case 106: + case 110: /* Line 1455 of yacc.c */ -#line 943 "program_parse.y" +#line 948 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -2983,19 +3024,19 @@ yyreduce: ;} break; - case 107: + case 111: /* Line 1455 of yacc.c */ -#line 965 "program_parse.y" +#line 970 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 108: + case 112: /* Line 1455 of yacc.c */ -#line 969 "program_parse.y" +#line 974 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3006,38 +3047,38 @@ yyreduce: ;} break; - case 109: + case 113: /* Line 1455 of yacc.c */ -#line 980 "program_parse.y" +#line 985 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} break; - case 110: + case 114: /* Line 1455 of yacc.c */ -#line 986 "program_parse.y" +#line 991 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} break; - case 112: + case 116: /* Line 1455 of yacc.c */ -#line 993 "program_parse.y" +#line 998 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); ;} break; - case 113: + case 117: /* Line 1455 of yacc.c */ -#line 1000 "program_parse.y" +#line 1005 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3045,10 +3086,10 @@ yyreduce: ;} break; - case 114: + case 118: /* Line 1455 of yacc.c */ -#line 1006 "program_parse.y" +#line 1011 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3056,10 +3097,10 @@ yyreduce: ;} break; - case 115: + case 119: /* Line 1455 of yacc.c */ -#line 1012 "program_parse.y" +#line 1017 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3067,10 +3108,10 @@ yyreduce: ;} break; - case 116: + case 120: /* Line 1455 of yacc.c */ -#line 1020 "program_parse.y" +#line 1025 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3078,10 +3119,10 @@ yyreduce: ;} break; - case 117: + case 121: /* Line 1455 of yacc.c */ -#line 1026 "program_parse.y" +#line 1031 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3089,10 +3130,10 @@ yyreduce: ;} break; - case 118: + case 122: /* Line 1455 of yacc.c */ -#line 1032 "program_parse.y" +#line 1037 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3100,10 +3141,10 @@ yyreduce: ;} break; - case 119: + case 123: /* Line 1455 of yacc.c */ -#line 1040 "program_parse.y" +#line 1045 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3111,10 +3152,10 @@ yyreduce: ;} break; - case 120: + case 124: /* Line 1455 of yacc.c */ -#line 1046 "program_parse.y" +#line 1051 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3122,10 +3163,10 @@ yyreduce: ;} break; - case 121: + case 125: /* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" +#line 1057 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3133,94 +3174,94 @@ yyreduce: ;} break; - case 122: + case 126: /* Line 1455 of yacc.c */ -#line 1059 "program_parse.y" +#line 1064 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; - case 123: + case 127: /* Line 1455 of yacc.c */ -#line 1060 "program_parse.y" +#line 1065 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 124: + case 128: /* Line 1455 of yacc.c */ -#line 1063 "program_parse.y" +#line 1068 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 125: + case 129: /* Line 1455 of yacc.c */ -#line 1064 "program_parse.y" +#line 1069 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 126: + case 130: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1070 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 127: + case 131: /* Line 1455 of yacc.c */ -#line 1066 "program_parse.y" +#line 1071 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 128: + case 132: /* Line 1455 of yacc.c */ -#line 1067 "program_parse.y" +#line 1072 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 129: + case 133: /* Line 1455 of yacc.c */ -#line 1068 "program_parse.y" +#line 1073 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 130: + case 134: /* Line 1455 of yacc.c */ -#line 1069 "program_parse.y" +#line 1074 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 131: + case 135: /* Line 1455 of yacc.c */ -#line 1070 "program_parse.y" +#line 1075 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 132: + case 136: /* Line 1455 of yacc.c */ -#line 1071 "program_parse.y" +#line 1076 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 133: + case 137: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1077 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; - case 134: + case 138: /* Line 1455 of yacc.c */ -#line 1076 "program_parse.y" +#line 1081 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3229,37 +3270,37 @@ yyreduce: ;} break; - case 135: + case 139: /* Line 1455 of yacc.c */ -#line 1085 "program_parse.y" +#line 1090 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 136: + case 140: /* Line 1455 of yacc.c */ -#line 1089 "program_parse.y" +#line 1094 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 137: + case 141: /* Line 1455 of yacc.c */ -#line 1093 "program_parse.y" +#line 1098 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 138: + case 142: /* Line 1455 of yacc.c */ -#line 1099 "program_parse.y" +#line 1104 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3268,28 +3309,28 @@ yyreduce: ;} break; - case 139: + case 143: /* Line 1455 of yacc.c */ -#line 1108 "program_parse.y" +#line 1113 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 140: + case 144: /* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" +#line 1117 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 141: + case 145: /* Line 1455 of yacc.c */ -#line 1116 "program_parse.y" +#line 1121 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3300,57 +3341,57 @@ yyreduce: ;} break; - case 142: + case 146: /* Line 1455 of yacc.c */ -#line 1125 "program_parse.y" +#line 1130 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 143: + case 147: /* Line 1455 of yacc.c */ -#line 1129 "program_parse.y" +#line 1134 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 144: + case 148: /* Line 1455 of yacc.c */ -#line 1135 "program_parse.y" +#line 1140 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 145: + case 149: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1146 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 146: + case 150: /* Line 1455 of yacc.c */ -#line 1148 "program_parse.y" +#line 1153 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 147: + case 151: /* Line 1455 of yacc.c */ -#line 1153 "program_parse.y" +#line 1158 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3358,10 +3399,10 @@ yyreduce: ;} break; - case 148: + case 152: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1166 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3371,10 +3412,10 @@ yyreduce: ;} break; - case 150: + case 154: /* Line 1455 of yacc.c */ -#line 1173 "program_parse.y" +#line 1178 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3382,46 +3423,46 @@ yyreduce: ;} break; - case 151: + case 155: /* Line 1455 of yacc.c */ -#line 1181 "program_parse.y" +#line 1186 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 152: + case 156: /* Line 1455 of yacc.c */ -#line 1187 "program_parse.y" +#line 1192 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 153: + case 157: /* Line 1455 of yacc.c */ -#line 1191 "program_parse.y" +#line 1196 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 154: + case 158: /* Line 1455 of yacc.c */ -#line 1195 "program_parse.y" +#line 1200 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 155: + case 159: /* Line 1455 of yacc.c */ -#line 1201 "program_parse.y" +#line 1206 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3432,10 +3473,10 @@ yyreduce: ;} break; - case 156: + case 160: /* Line 1455 of yacc.c */ -#line 1212 "program_parse.y" +#line 1217 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3444,92 +3485,92 @@ yyreduce: ;} break; - case 157: + case 161: /* Line 1455 of yacc.c */ -#line 1221 "program_parse.y" +#line 1226 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 158: + case 162: /* Line 1455 of yacc.c */ -#line 1225 "program_parse.y" +#line 1230 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 159: + case 163: /* Line 1455 of yacc.c */ -#line 1230 "program_parse.y" +#line 1235 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 160: + case 164: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1239 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 161: + case 165: /* Line 1455 of yacc.c */ -#line 1238 "program_parse.y" +#line 1243 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 162: + case 166: /* Line 1455 of yacc.c */ -#line 1242 "program_parse.y" +#line 1247 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 163: + case 167: /* Line 1455 of yacc.c */ -#line 1248 "program_parse.y" +#line 1253 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 164: + case 168: /* Line 1455 of yacc.c */ -#line 1255 "program_parse.y" +#line 1260 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 165: + case 169: /* Line 1455 of yacc.c */ -#line 1259 "program_parse.y" +#line 1264 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 166: + case 170: /* Line 1455 of yacc.c */ -#line 1265 "program_parse.y" +#line 1270 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3537,10 +3578,10 @@ yyreduce: ;} break; - case 167: + case 171: /* Line 1455 of yacc.c */ -#line 1273 "program_parse.y" +#line 1278 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3551,38 +3592,38 @@ yyreduce: ;} break; - case 168: + case 172: /* Line 1455 of yacc.c */ -#line 1284 "program_parse.y" +#line 1289 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 169: + case 173: /* Line 1455 of yacc.c */ -#line 1291 "program_parse.y" +#line 1296 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 170: + case 174: /* Line 1455 of yacc.c */ -#line 1295 "program_parse.y" +#line 1300 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 171: + case 175: /* Line 1455 of yacc.c */ -#line 1301 "program_parse.y" +#line 1306 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3592,10 +3633,10 @@ yyreduce: ;} break; - case 172: + case 176: /* Line 1455 of yacc.c */ -#line 1311 "program_parse.y" +#line 1316 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3605,20 +3646,20 @@ yyreduce: ;} break; - case 173: + case 177: /* Line 1455 of yacc.c */ -#line 1321 "program_parse.y" +#line 1326 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 174: + case 178: /* Line 1455 of yacc.c */ -#line 1326 "program_parse.y" +#line 1331 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3636,10 +3677,10 @@ yyreduce: ;} break; - case 175: + case 179: /* Line 1455 of yacc.c */ -#line 1344 "program_parse.y" +#line 1349 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3647,55 +3688,55 @@ yyreduce: ;} break; - case 176: + case 180: /* Line 1455 of yacc.c */ -#line 1352 "program_parse.y" +#line 1357 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 177: + case 181: /* Line 1455 of yacc.c */ -#line 1356 "program_parse.y" +#line 1361 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 178: + case 182: /* Line 1455 of yacc.c */ -#line 1362 "program_parse.y" +#line 1367 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 179: + case 183: /* Line 1455 of yacc.c */ -#line 1366 "program_parse.y" +#line 1371 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 180: + case 184: /* Line 1455 of yacc.c */ -#line 1370 "program_parse.y" +#line 1375 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 181: + case 185: /* Line 1455 of yacc.c */ -#line 1376 "program_parse.y" +#line 1381 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3706,88 +3747,88 @@ yyreduce: ;} break; - case 182: + case 186: /* Line 1455 of yacc.c */ -#line 1387 "program_parse.y" +#line 1392 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 183: + case 187: /* Line 1455 of yacc.c */ -#line 1392 "program_parse.y" +#line 1397 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 184: + case 188: /* Line 1455 of yacc.c */ -#line 1397 "program_parse.y" +#line 1402 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 185: + case 189: /* Line 1455 of yacc.c */ -#line 1402 "program_parse.y" +#line 1407 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 186: + case 190: /* Line 1455 of yacc.c */ -#line 1407 "program_parse.y" +#line 1412 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 187: + case 191: /* Line 1455 of yacc.c */ -#line 1412 "program_parse.y" +#line 1417 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 188: + case 192: /* Line 1455 of yacc.c */ -#line 1419 "program_parse.y" +#line 1424 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 189: + case 193: /* Line 1455 of yacc.c */ -#line 1423 "program_parse.y" +#line 1428 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 190: + case 194: /* Line 1455 of yacc.c */ -#line 1428 "program_parse.y" +#line 1433 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3801,10 +3842,10 @@ yyreduce: ;} break; - case 191: + case 195: /* Line 1455 of yacc.c */ -#line 1441 "program_parse.y" +#line 1446 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3813,10 +3854,10 @@ yyreduce: ;} break; - case 192: + case 196: /* Line 1455 of yacc.c */ -#line 1449 "program_parse.y" +#line 1454 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3827,10 +3868,10 @@ yyreduce: ;} break; - case 197: + case 201: /* Line 1455 of yacc.c */ -#line 1466 "program_parse.y" +#line 1471 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3840,30 +3881,30 @@ yyreduce: ;} break; - case 198: + case 202: /* Line 1455 of yacc.c */ -#line 1476 "program_parse.y" +#line 1481 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 199: + case 203: /* Line 1455 of yacc.c */ -#line 1481 "program_parse.y" +#line 1486 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 200: + case 204: /* Line 1455 of yacc.c */ -#line 1488 "program_parse.y" +#line 1493 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3873,10 +3914,10 @@ yyreduce: ;} break; - case 201: + case 205: /* Line 1455 of yacc.c */ -#line 1498 "program_parse.y" +#line 1503 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3886,30 +3927,30 @@ yyreduce: ;} break; - case 202: + case 206: /* Line 1455 of yacc.c */ -#line 1507 "program_parse.y" +#line 1512 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 203: + case 207: /* Line 1455 of yacc.c */ -#line 1512 "program_parse.y" +#line 1517 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 204: + case 208: /* Line 1455 of yacc.c */ -#line 1519 "program_parse.y" +#line 1524 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3919,10 +3960,10 @@ yyreduce: ;} break; - case 205: + case 209: /* Line 1455 of yacc.c */ -#line 1529 "program_parse.y" +#line 1534 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3932,10 +3973,10 @@ yyreduce: ;} break; - case 206: + case 210: /* Line 1455 of yacc.c */ -#line 1539 "program_parse.y" +#line 1544 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3945,40 +3986,40 @@ yyreduce: ;} break; - case 211: + case 215: /* Line 1455 of yacc.c */ -#line 1554 "program_parse.y" +#line 1559 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); ;} break; - case 212: + case 216: /* Line 1455 of yacc.c */ -#line 1561 "program_parse.y" +#line 1566 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); ;} break; - case 213: + case 217: /* Line 1455 of yacc.c */ -#line 1566 "program_parse.y" +#line 1571 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); ;} break; - case 214: + case 218: /* Line 1455 of yacc.c */ -#line 1573 "program_parse.y" +#line 1578 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -3988,10 +4029,10 @@ yyreduce: ;} break; - case 215: + case 219: /* Line 1455 of yacc.c */ -#line 1581 "program_parse.y" +#line 1586 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4001,10 +4042,10 @@ yyreduce: ;} break; - case 216: + case 220: /* Line 1455 of yacc.c */ -#line 1590 "program_parse.y" +#line 1595 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4014,10 +4055,10 @@ yyreduce: ;} break; - case 217: + case 221: /* Line 1455 of yacc.c */ -#line 1599 "program_parse.y" +#line 1604 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4027,63 +4068,63 @@ yyreduce: ;} break; - case 218: + case 222: /* Line 1455 of yacc.c */ -#line 1609 "program_parse.y" +#line 1614 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 219: + case 223: /* Line 1455 of yacc.c */ -#line 1613 "program_parse.y" +#line 1618 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 220: + case 224: /* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" +#line 1623 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 221: + case 225: /* Line 1455 of yacc.c */ -#line 1619 "program_parse.y" +#line 1624 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 222: + case 226: /* Line 1455 of yacc.c */ -#line 1620 "program_parse.y" +#line 1625 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 223: + case 227: /* Line 1455 of yacc.c */ -#line 1623 "program_parse.y" +#line 1628 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 225: + case 229: /* Line 1455 of yacc.c */ -#line 1626 "program_parse.y" +#line 1631 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 227: + case 231: /* Line 1455 of yacc.c */ -#line 1630 "program_parse.y" +#line 1635 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4091,10 +4132,10 @@ yyreduce: ;} break; - case 228: + case 232: /* Line 1455 of yacc.c */ -#line 1636 "program_parse.y" +#line 1641 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4102,10 +4143,10 @@ yyreduce: ;} break; - case 229: + case 233: /* Line 1455 of yacc.c */ -#line 1644 "program_parse.y" +#line 1649 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4118,10 +4159,10 @@ yyreduce: ;} break; - case 230: + case 234: /* Line 1455 of yacc.c */ -#line 1657 "program_parse.y" +#line 1662 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4132,10 +4173,10 @@ yyreduce: ;} break; - case 231: + case 235: /* Line 1455 of yacc.c */ -#line 1666 "program_parse.y" +#line 1671 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4146,19 +4187,19 @@ yyreduce: ;} break; - case 232: + case 236: /* Line 1455 of yacc.c */ -#line 1675 "program_parse.y" +#line 1680 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 233: + case 237: /* Line 1455 of yacc.c */ -#line 1679 "program_parse.y" +#line 1684 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4169,10 +4210,10 @@ yyreduce: ;} break; - case 234: + case 238: /* Line 1455 of yacc.c */ -#line 1688 "program_parse.y" +#line 1693 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4183,10 +4224,10 @@ yyreduce: ;} break; - case 235: + case 239: /* Line 1455 of yacc.c */ -#line 1697 "program_parse.y" +#line 1702 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4197,19 +4238,19 @@ yyreduce: ;} break; - case 236: + case 240: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1713 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 237: + case 241: /* Line 1455 of yacc.c */ -#line 1714 "program_parse.y" +#line 1719 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4217,10 +4258,10 @@ yyreduce: ;} break; - case 238: + case 242: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1725 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4231,10 +4272,10 @@ yyreduce: ;} break; - case 239: + case 243: /* Line 1455 of yacc.c */ -#line 1729 "program_parse.y" +#line 1734 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4245,19 +4286,19 @@ yyreduce: ;} break; - case 240: + case 244: /* Line 1455 of yacc.c */ -#line 1740 "program_parse.y" +#line 1745 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 241: + case 245: /* Line 1455 of yacc.c */ -#line 1744 "program_parse.y" +#line 1749 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4268,10 +4309,10 @@ yyreduce: ;} break; - case 242: + case 246: /* Line 1455 of yacc.c */ -#line 1753 "program_parse.y" +#line 1758 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4282,94 +4323,94 @@ yyreduce: ;} break; - case 243: + case 247: /* Line 1455 of yacc.c */ -#line 1763 "program_parse.y" +#line 1768 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 244: + case 248: /* Line 1455 of yacc.c */ -#line 1764 "program_parse.y" +#line 1769 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 245: + case 249: /* Line 1455 of yacc.c */ -#line 1765 "program_parse.y" +#line 1770 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 246: + case 250: /* Line 1455 of yacc.c */ -#line 1768 "program_parse.y" +#line 1773 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 247: + case 251: /* Line 1455 of yacc.c */ -#line 1769 "program_parse.y" +#line 1774 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 248: + case 252: /* Line 1455 of yacc.c */ -#line 1770 "program_parse.y" +#line 1775 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 249: + case 253: /* Line 1455 of yacc.c */ -#line 1773 "program_parse.y" +#line 1778 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 250: + case 254: /* Line 1455 of yacc.c */ -#line 1774 "program_parse.y" +#line 1779 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 251: + case 255: /* Line 1455 of yacc.c */ -#line 1777 "program_parse.y" +#line 1782 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 252: + case 256: /* Line 1455 of yacc.c */ -#line 1778 "program_parse.y" +#line 1783 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 253: + case 257: /* Line 1455 of yacc.c */ -#line 1781 "program_parse.y" +#line 1786 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: + case 258: /* Line 1455 of yacc.c */ -#line 1782 "program_parse.y" +#line 1787 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 255: + case 259: /* Line 1455 of yacc.c */ -#line 1786 "program_parse.y" +#line 1791 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4380,10 +4421,10 @@ yyreduce: ;} break; - case 256: + case 260: /* Line 1455 of yacc.c */ -#line 1797 "program_parse.y" +#line 1802 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4394,10 +4435,10 @@ yyreduce: ;} break; - case 257: + case 261: /* Line 1455 of yacc.c */ -#line 1808 "program_parse.y" +#line 1813 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4408,10 +4449,10 @@ yyreduce: ;} break; - case 258: + case 262: /* Line 1455 of yacc.c */ -#line 1819 "program_parse.y" +#line 1824 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4435,7 +4476,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4439 "program_parse.tab.c" +#line 4480 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4654,7 +4695,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1839 "program_parse.y" +#line 1844 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index 4fd6531801..e7264079e9 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -127,17 +127,21 @@ TEX_SHADOW1D = 343, TEX_SHADOW2D = 344, TEX_SHADOWRECT = 345, - VERTEX = 346, - VTXATTRIB = 347, - WEIGHT = 348, - IDENTIFIER = 349, - MASK4 = 350, - MASK3 = 351, - MASK2 = 352, - MASK1 = 353, - SWIZZLE = 354, - DOT_DOT = 355, - DOT = 356 + TEX_ARRAY1D = 346, + TEX_ARRAY2D = 347, + TEX_ARRAYSHADOW1D = 348, + TEX_ARRAYSHADOW2D = 349, + VERTEX = 350, + VTXATTRIB = 351, + WEIGHT = 352, + IDENTIFIER = 353, + MASK4 = 354, + MASK3 = 355, + MASK2 = 356, + MASK1 = 357, + SWIZZLE = 358, + DOT_DOT = 359, + DOT = 360 }; #endif @@ -170,7 +174,7 @@ typedef union YYSTYPE /* Line 1676 of yacc.c */ -#line 174 "program_parse.tab.h" +#line 178 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 63a176dc8d..9e7c9e444d 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -158,6 +158,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %token TEXCOORD TEXENV TEXGEN TEXGEN_Q TEXGEN_R TEXGEN_S TEXGEN_T TEXTURE TRANSPOSE %token TEXTURE_UNIT TEX_1D TEX_2D TEX_3D TEX_CUBE TEX_RECT %token TEX_SHADOW1D TEX_SHADOW2D TEX_SHADOWRECT +%token TEX_ARRAY1D TEX_ARRAY2D TEX_ARRAYSHADOW1D TEX_ARRAYSHADOW2D %token VERTEX VTXATTRIB %token WEIGHT @@ -450,6 +451,10 @@ texTarget: TEX_1D { $$ = TEXTURE_1D_INDEX; } | TEX_SHADOW1D { $$ = -TEXTURE_1D_INDEX; } | TEX_SHADOW2D { $$ = -TEXTURE_2D_INDEX; } | TEX_SHADOWRECT { $$ = -TEXTURE_RECT_INDEX; } + | TEX_ARRAY1D { $$ = TEXTURE_1D_ARRAY_INDEX; } + | TEX_ARRAY2D { $$ = TEXTURE_2D_ARRAY_INDEX; } + | TEX_ARRAYSHADOW1D { $$ = -TEXTURE_1D_ARRAY_INDEX; } + | TEX_ARRAYSHADOW2D { $$ = -TEXTURE_2D_ARRAY_INDEX; } ; SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle diff --git a/src/mesa/shader/program_parse_extra.c b/src/mesa/shader/program_parse_extra.c index f4643d12da..8e4be606f1 100644 --- a/src/mesa/shader/program_parse_extra.c +++ b/src/mesa/shader/program_parse_extra.c @@ -102,6 +102,15 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) return 1; } } + } else if (strncmp(option, "MESA_", 5) == 0) { + option += 5; + + if (strcmp(option, "texture_array") == 0) { + if (state->ctx->Extensions.MESA_texture_array) { + state->option.TexArray = 1; + return 1; + } + } } return 0; diff --git a/src/mesa/shader/program_parser.h b/src/mesa/shader/program_parser.h index b9731439a0..fa47d84565 100644 --- a/src/mesa/shader/program_parser.h +++ b/src/mesa/shader/program_parser.h @@ -201,6 +201,7 @@ struct asm_parser_state { unsigned DrawBuffers:1; unsigned Shadow:1; unsigned TexRect:1; + unsigned TexArray:1; } option; struct { -- cgit v1.2.3 From 86b33b5649710f351d241ce6890200ac1f38f724 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Jul 2009 21:56:42 -0700 Subject: ARB prog parser: Set correct register file for OUTPUT variables --- src/mesa/shader/program_parse.tab.c | 401 ++++++++++++++++++------------------ src/mesa/shader/program_parse.y | 11 +- 2 files changed, 213 insertions(+), 199 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 4a05d106be..83c7419493 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -760,28 +760,28 @@ static const yytype_uint16 yyrline[] = 338, 341, 342, 345, 351, 358, 365, 373, 380, 388, 433, 440, 446, 447, 448, 449, 450, 451, 452, 453, 454, 455, 456, 457, 460, 472, 485, 498, 520, 529, - 538, 545, 554, 582, 624, 635, 656, 666, 672, 696, - 713, 713, 715, 722, 734, 735, 736, 739, 751, 763, - 781, 792, 804, 806, 807, 808, 809, 812, 812, 812, - 812, 813, 816, 817, 818, 819, 820, 821, 824, 842, - 846, 852, 856, 860, 864, 873, 882, 886, 891, 897, - 908, 908, 909, 911, 915, 919, 923, 929, 929, 931, - 947, 970, 973, 984, 990, 996, 997, 1004, 1010, 1016, - 1024, 1030, 1036, 1044, 1050, 1056, 1064, 1065, 1068, 1069, - 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1080, 1089, - 1093, 1097, 1103, 1112, 1116, 1120, 1129, 1133, 1139, 1145, - 1152, 1157, 1165, 1175, 1177, 1185, 1191, 1195, 1199, 1205, - 1216, 1225, 1229, 1234, 1238, 1242, 1246, 1252, 1259, 1263, - 1269, 1277, 1288, 1295, 1299, 1305, 1315, 1326, 1330, 1348, - 1357, 1360, 1366, 1370, 1374, 1380, 1391, 1396, 1401, 1406, - 1411, 1416, 1424, 1427, 1432, 1445, 1453, 1466, 1466, 1468, - 1468, 1470, 1480, 1485, 1492, 1502, 1511, 1516, 1523, 1533, - 1543, 1555, 1555, 1556, 1556, 1558, 1565, 1570, 1577, 1585, - 1593, 1602, 1613, 1617, 1623, 1624, 1625, 1628, 1628, 1631, - 1631, 1634, 1640, 1648, 1661, 1670, 1679, 1683, 1692, 1701, - 1712, 1719, 1724, 1733, 1745, 1748, 1757, 1768, 1769, 1770, - 1773, 1774, 1775, 1778, 1779, 1782, 1783, 1786, 1787, 1790, - 1801, 1812, 1823 + 538, 545, 554, 582, 624, 635, 656, 666, 672, 703, + 720, 720, 722, 729, 741, 742, 743, 746, 758, 770, + 788, 799, 811, 813, 814, 815, 816, 819, 819, 819, + 819, 820, 823, 824, 825, 826, 827, 828, 831, 849, + 853, 859, 863, 867, 871, 880, 889, 893, 898, 904, + 915, 915, 916, 918, 922, 926, 930, 936, 936, 938, + 954, 977, 980, 991, 997, 1003, 1004, 1011, 1017, 1023, + 1031, 1037, 1043, 1051, 1057, 1063, 1071, 1072, 1075, 1076, + 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1087, 1096, + 1100, 1104, 1110, 1119, 1123, 1127, 1136, 1140, 1146, 1152, + 1159, 1164, 1172, 1182, 1184, 1192, 1198, 1202, 1206, 1212, + 1223, 1232, 1236, 1241, 1245, 1249, 1253, 1259, 1266, 1270, + 1276, 1284, 1295, 1302, 1306, 1312, 1322, 1333, 1337, 1355, + 1364, 1367, 1373, 1377, 1381, 1387, 1398, 1403, 1408, 1413, + 1418, 1423, 1431, 1434, 1439, 1452, 1460, 1473, 1473, 1475, + 1475, 1477, 1487, 1492, 1499, 1509, 1518, 1523, 1530, 1540, + 1550, 1562, 1562, 1563, 1563, 1565, 1572, 1577, 1584, 1592, + 1600, 1609, 1620, 1624, 1630, 1631, 1632, 1635, 1635, 1638, + 1638, 1641, 1647, 1655, 1668, 1677, 1686, 1690, 1699, 1708, + 1719, 1726, 1731, 1740, 1752, 1755, 1764, 1775, 1776, 1777, + 1780, 1781, 1782, 1785, 1786, 1789, 1790, 1793, 1794, 1797, + 1808, 1819, 1830 }; #endif @@ -2638,12 +2638,19 @@ yyreduce: } init_dst_reg(& (yyval.dst_reg)); - if (s->type == at_temp) { + switch (s->type) { + case at_temp: (yyval.dst_reg).File = PROGRAM_TEMPORARY; (yyval.dst_reg).Index = s->temp_binding; - } else { + break; + case at_output: + (yyval.dst_reg).File = PROGRAM_OUTPUT; + (yyval.dst_reg).Index = s->output_binding; + break; + default: (yyval.dst_reg).File = s->param_binding_type; (yyval.dst_reg).Index = s->param_binding_begin; + break; } ;} break; @@ -2651,7 +2658,7 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 697 "program_parse.y" +#line 704 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2671,7 +2678,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 716 "program_parse.y" +#line 723 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2681,7 +2688,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 723 "program_parse.y" +#line 730 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2696,28 +2703,28 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 734 "program_parse.y" +#line 741 "program_parse.y" { (yyval.integer) = 0; ;} break; case 65: /* Line 1455 of yacc.c */ -#line 735 "program_parse.y" +#line 742 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 66: /* Line 1455 of yacc.c */ -#line 736 "program_parse.y" +#line 743 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 67: /* Line 1455 of yacc.c */ -#line 740 "program_parse.y" +#line 747 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2732,7 +2739,7 @@ yyreduce: case 68: /* Line 1455 of yacc.c */ -#line 752 "program_parse.y" +#line 759 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2747,7 +2754,7 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 764 "program_parse.y" +#line 771 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2768,7 +2775,7 @@ yyreduce: case 70: /* Line 1455 of yacc.c */ -#line 782 "program_parse.y" +#line 789 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2782,7 +2789,7 @@ yyreduce: case 71: /* Line 1455 of yacc.c */ -#line 793 "program_parse.y" +#line 800 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2797,21 +2804,21 @@ yyreduce: case 76: /* Line 1455 of yacc.c */ -#line 809 "program_parse.y" +#line 816 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 813 "program_parse.y" +#line 820 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: /* Line 1455 of yacc.c */ -#line 825 "program_parse.y" +#line 832 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2832,7 +2839,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 843 "program_parse.y" +#line 850 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2841,7 +2848,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 847 "program_parse.y" +#line 854 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2850,7 +2857,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 853 "program_parse.y" +#line 860 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2859,7 +2866,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 857 "program_parse.y" +#line 864 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2868,7 +2875,7 @@ yyreduce: case 93: /* Line 1455 of yacc.c */ -#line 861 "program_parse.y" +#line 868 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2877,7 +2884,7 @@ yyreduce: case 94: /* Line 1455 of yacc.c */ -#line 865 "program_parse.y" +#line 872 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2891,7 +2898,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 874 "program_parse.y" +#line 881 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2905,7 +2912,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 883 "program_parse.y" +#line 890 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2914,7 +2921,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 887 "program_parse.y" +#line 894 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -2924,7 +2931,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 892 "program_parse.y" +#line 899 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2933,7 +2940,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 898 "program_parse.y" +#line 905 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2947,7 +2954,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 912 "program_parse.y" +#line 919 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2956,7 +2963,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 916 "program_parse.y" +#line 923 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2965,7 +2972,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 920 "program_parse.y" +#line 927 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2974,7 +2981,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 924 "program_parse.y" +#line 931 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2983,7 +2990,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 939 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3002,7 +3009,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 948 "program_parse.y" +#line 955 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3027,7 +3034,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 970 "program_parse.y" +#line 977 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3036,7 +3043,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 974 "program_parse.y" +#line 981 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3050,7 +3057,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 985 "program_parse.y" +#line 992 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3059,7 +3066,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 991 "program_parse.y" +#line 998 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3068,7 +3075,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 998 "program_parse.y" +#line 1005 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3078,7 +3085,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1005 "program_parse.y" +#line 1012 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3089,7 +3096,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1011 "program_parse.y" +#line 1018 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3100,7 +3107,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1017 "program_parse.y" +#line 1024 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3111,7 +3118,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1025 "program_parse.y" +#line 1032 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3122,7 +3129,7 @@ yyreduce: case 121: /* Line 1455 of yacc.c */ -#line 1031 "program_parse.y" +#line 1038 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3133,7 +3140,7 @@ yyreduce: case 122: /* Line 1455 of yacc.c */ -#line 1037 "program_parse.y" +#line 1044 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3144,7 +3151,7 @@ yyreduce: case 123: /* Line 1455 of yacc.c */ -#line 1045 "program_parse.y" +#line 1052 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3155,7 +3162,7 @@ yyreduce: case 124: /* Line 1455 of yacc.c */ -#line 1051 "program_parse.y" +#line 1058 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3166,7 +3173,7 @@ yyreduce: case 125: /* Line 1455 of yacc.c */ -#line 1057 "program_parse.y" +#line 1064 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3177,91 +3184,91 @@ yyreduce: case 126: /* Line 1455 of yacc.c */ -#line 1064 "program_parse.y" +#line 1071 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1072 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1068 "program_parse.y" +#line 1075 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1069 "program_parse.y" +#line 1076 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1070 "program_parse.y" +#line 1077 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1071 "program_parse.y" +#line 1078 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 132: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1079 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1073 "program_parse.y" +#line 1080 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1074 "program_parse.y" +#line 1081 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1075 "program_parse.y" +#line 1082 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1076 "program_parse.y" +#line 1083 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1077 "program_parse.y" +#line 1084 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1081 "program_parse.y" +#line 1088 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3273,7 +3280,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1090 "program_parse.y" +#line 1097 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3282,7 +3289,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1094 "program_parse.y" +#line 1101 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3291,7 +3298,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" +#line 1105 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3300,7 +3307,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1104 "program_parse.y" +#line 1111 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3312,7 +3319,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1113 "program_parse.y" +#line 1120 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3321,7 +3328,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1117 "program_parse.y" +#line 1124 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3330,7 +3337,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1121 "program_parse.y" +#line 1128 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3344,7 +3351,7 @@ yyreduce: case 146: /* Line 1455 of yacc.c */ -#line 1130 "program_parse.y" +#line 1137 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3353,7 +3360,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1134 "program_parse.y" +#line 1141 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3362,7 +3369,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1140 "program_parse.y" +#line 1147 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3371,7 +3378,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1146 "program_parse.y" +#line 1153 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3381,7 +3388,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1153 "program_parse.y" +#line 1160 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3391,7 +3398,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1158 "program_parse.y" +#line 1165 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3402,7 +3409,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1166 "program_parse.y" +#line 1173 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3415,7 +3422,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1178 "program_parse.y" +#line 1185 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3426,7 +3433,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1186 "program_parse.y" +#line 1193 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3435,7 +3442,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1192 "program_parse.y" +#line 1199 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3444,7 +3451,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1196 "program_parse.y" +#line 1203 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3453,7 +3460,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1200 "program_parse.y" +#line 1207 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3462,7 +3469,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1206 "program_parse.y" +#line 1213 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3476,7 +3483,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1217 "program_parse.y" +#line 1224 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3488,7 +3495,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" +#line 1233 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3497,7 +3504,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1230 "program_parse.y" +#line 1237 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3506,7 +3513,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1235 "program_parse.y" +#line 1242 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3515,7 +3522,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1239 "program_parse.y" +#line 1246 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3524,7 +3531,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1243 "program_parse.y" +#line 1250 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3533,7 +3540,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1247 "program_parse.y" +#line 1254 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3542,7 +3549,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1253 "program_parse.y" +#line 1260 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3552,7 +3559,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1267 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3561,7 +3568,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1264 "program_parse.y" +#line 1271 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3570,7 +3577,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1270 "program_parse.y" +#line 1277 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3581,7 +3588,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1278 "program_parse.y" +#line 1285 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3595,7 +3602,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1289 "program_parse.y" +#line 1296 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3605,7 +3612,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1296 "program_parse.y" +#line 1303 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3614,7 +3621,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1300 "program_parse.y" +#line 1307 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3623,7 +3630,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1306 "program_parse.y" +#line 1313 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3636,7 +3643,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1316 "program_parse.y" +#line 1323 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3649,7 +3656,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1326 "program_parse.y" +#line 1333 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3659,7 +3666,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1331 "program_parse.y" +#line 1338 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3680,7 +3687,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1349 "program_parse.y" +#line 1356 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3691,7 +3698,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1364 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3700,7 +3707,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1361 "program_parse.y" +#line 1368 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3709,7 +3716,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1367 "program_parse.y" +#line 1374 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3718,7 +3725,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1371 "program_parse.y" +#line 1378 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3727,7 +3734,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1375 "program_parse.y" +#line 1382 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3736,7 +3743,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1381 "program_parse.y" +#line 1388 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3750,7 +3757,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1392 "program_parse.y" +#line 1399 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3760,7 +3767,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1397 "program_parse.y" +#line 1404 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3770,7 +3777,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1402 "program_parse.y" +#line 1409 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3780,7 +3787,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1407 "program_parse.y" +#line 1414 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3790,7 +3797,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1412 "program_parse.y" +#line 1419 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3800,7 +3807,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1417 "program_parse.y" +#line 1424 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3810,7 +3817,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1424 "program_parse.y" +#line 1431 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3819,7 +3826,7 @@ yyreduce: case 193: /* Line 1455 of yacc.c */ -#line 1428 "program_parse.y" +#line 1435 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3828,7 +3835,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1433 "program_parse.y" +#line 1440 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3845,7 +3852,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1446 "program_parse.y" +#line 1453 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3857,7 +3864,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1454 "program_parse.y" +#line 1461 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3871,7 +3878,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1471 "program_parse.y" +#line 1478 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3884,7 +3891,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1481 "program_parse.y" +#line 1488 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3894,7 +3901,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1486 "program_parse.y" +#line 1493 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3904,7 +3911,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1493 "program_parse.y" +#line 1500 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3917,7 +3924,7 @@ yyreduce: case 205: /* Line 1455 of yacc.c */ -#line 1503 "program_parse.y" +#line 1510 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3930,7 +3937,7 @@ yyreduce: case 206: /* Line 1455 of yacc.c */ -#line 1512 "program_parse.y" +#line 1519 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3940,7 +3947,7 @@ yyreduce: case 207: /* Line 1455 of yacc.c */ -#line 1517 "program_parse.y" +#line 1524 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3950,7 +3957,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1524 "program_parse.y" +#line 1531 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3963,7 +3970,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1534 "program_parse.y" +#line 1541 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3976,7 +3983,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1544 "program_parse.y" +#line 1551 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3989,7 +3996,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1559 "program_parse.y" +#line 1566 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -3999,7 +4006,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1566 "program_parse.y" +#line 1573 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4009,7 +4016,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1571 "program_parse.y" +#line 1578 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4019,7 +4026,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1578 "program_parse.y" +#line 1585 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4032,7 +4039,7 @@ yyreduce: case 219: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1593 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4045,7 +4052,7 @@ yyreduce: case 220: /* Line 1455 of yacc.c */ -#line 1595 "program_parse.y" +#line 1602 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4058,7 +4065,7 @@ yyreduce: case 221: /* Line 1455 of yacc.c */ -#line 1604 "program_parse.y" +#line 1611 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4071,7 +4078,7 @@ yyreduce: case 222: /* Line 1455 of yacc.c */ -#line 1614 "program_parse.y" +#line 1621 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4080,7 +4087,7 @@ yyreduce: case 223: /* Line 1455 of yacc.c */ -#line 1618 "program_parse.y" +#line 1625 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4089,42 +4096,42 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1623 "program_parse.y" +#line 1630 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 225: /* Line 1455 of yacc.c */ -#line 1624 "program_parse.y" +#line 1631 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 226: /* Line 1455 of yacc.c */ -#line 1625 "program_parse.y" +#line 1632 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 227: /* Line 1455 of yacc.c */ -#line 1628 "program_parse.y" +#line 1635 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 229: /* Line 1455 of yacc.c */ -#line 1631 "program_parse.y" +#line 1638 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 231: /* Line 1455 of yacc.c */ -#line 1635 "program_parse.y" +#line 1642 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4135,7 +4142,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1641 "program_parse.y" +#line 1648 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4146,7 +4153,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1649 "program_parse.y" +#line 1656 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4162,7 +4169,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1662 "program_parse.y" +#line 1669 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4176,7 +4183,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1671 "program_parse.y" +#line 1678 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4190,7 +4197,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1680 "program_parse.y" +#line 1687 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4199,7 +4206,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1684 "program_parse.y" +#line 1691 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4213,7 +4220,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1693 "program_parse.y" +#line 1700 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4227,7 +4234,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1702 "program_parse.y" +#line 1709 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4241,7 +4248,7 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1713 "program_parse.y" +#line 1720 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4250,7 +4257,7 @@ yyreduce: case 241: /* Line 1455 of yacc.c */ -#line 1719 "program_parse.y" +#line 1726 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4261,7 +4268,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1725 "program_parse.y" +#line 1732 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4275,7 +4282,7 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1734 "program_parse.y" +#line 1741 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4289,7 +4296,7 @@ yyreduce: case 244: /* Line 1455 of yacc.c */ -#line 1745 "program_parse.y" +#line 1752 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4298,7 +4305,7 @@ yyreduce: case 245: /* Line 1455 of yacc.c */ -#line 1749 "program_parse.y" +#line 1756 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4312,7 +4319,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1758 "program_parse.y" +#line 1765 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4326,91 +4333,91 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1768 "program_parse.y" +#line 1775 "program_parse.y" { (yyval.integer) = 0; ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1769 "program_parse.y" +#line 1776 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1770 "program_parse.y" +#line 1777 "program_parse.y" { (yyval.integer) = 1; ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1773 "program_parse.y" +#line 1780 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1774 "program_parse.y" +#line 1781 "program_parse.y" { (yyval.integer) = 0; ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1775 "program_parse.y" +#line 1782 "program_parse.y" { (yyval.integer) = 1; ;} break; case 253: /* Line 1455 of yacc.c */ -#line 1778 "program_parse.y" +#line 1785 "program_parse.y" { (yyval.integer) = 0; ;} break; case 254: /* Line 1455 of yacc.c */ -#line 1779 "program_parse.y" +#line 1786 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 255: /* Line 1455 of yacc.c */ -#line 1782 "program_parse.y" +#line 1789 "program_parse.y" { (yyval.integer) = 0; ;} break; case 256: /* Line 1455 of yacc.c */ -#line 1783 "program_parse.y" +#line 1790 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 257: /* Line 1455 of yacc.c */ -#line 1786 "program_parse.y" +#line 1793 "program_parse.y" { (yyval.integer) = 0; ;} break; case 258: /* Line 1455 of yacc.c */ -#line 1787 "program_parse.y" +#line 1794 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 259: /* Line 1455 of yacc.c */ -#line 1791 "program_parse.y" +#line 1798 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4424,7 +4431,7 @@ yyreduce: case 260: /* Line 1455 of yacc.c */ -#line 1802 "program_parse.y" +#line 1809 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4438,7 +4445,7 @@ yyreduce: case 261: /* Line 1455 of yacc.c */ -#line 1813 "program_parse.y" +#line 1820 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4452,7 +4459,7 @@ yyreduce: case 262: /* Line 1455 of yacc.c */ -#line 1824 "program_parse.y" +#line 1831 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4476,7 +4483,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4480 "program_parse.tab.c" +#line 4487 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4695,7 +4702,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1844 "program_parse.y" +#line 1851 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 9e7c9e444d..225dc0d5b9 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -683,12 +683,19 @@ dstReg: resultBinding } init_dst_reg(& $$); - if (s->type == at_temp) { + switch (s->type) { + case at_temp: $$.File = PROGRAM_TEMPORARY; $$.Index = s->temp_binding; - } else { + break; + case at_output: + $$.File = PROGRAM_OUTPUT; + $$.Index = s->output_binding; + break; + default: $$.File = s->param_binding_type; $$.Index = s->param_binding_begin; + break; } } ; -- cgit v1.2.3 From 648dac4251de69d2949026af3dec0b0befee734b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Jul 2009 21:57:28 -0700 Subject: ARB prog parser: Set component negation mask for SWZ instruction --- src/mesa/shader/program_parse.tab.c | 421 ++++++++++++++++++------------------ src/mesa/shader/program_parse.y | 1 + 2 files changed, 212 insertions(+), 210 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 83c7419493..dbe2fa229c 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -759,29 +759,29 @@ static const yytype_uint16 yyrline[] = 302, 317, 320, 325, 332, 333, 334, 335, 336, 337, 338, 341, 342, 345, 351, 358, 365, 373, 380, 388, 433, 440, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 460, 472, 485, 498, 520, 529, - 538, 545, 554, 582, 624, 635, 656, 666, 672, 703, - 720, 720, 722, 729, 741, 742, 743, 746, 758, 770, - 788, 799, 811, 813, 814, 815, 816, 819, 819, 819, - 819, 820, 823, 824, 825, 826, 827, 828, 831, 849, - 853, 859, 863, 867, 871, 880, 889, 893, 898, 904, - 915, 915, 916, 918, 922, 926, 930, 936, 936, 938, - 954, 977, 980, 991, 997, 1003, 1004, 1011, 1017, 1023, - 1031, 1037, 1043, 1051, 1057, 1063, 1071, 1072, 1075, 1076, - 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1087, 1096, - 1100, 1104, 1110, 1119, 1123, 1127, 1136, 1140, 1146, 1152, - 1159, 1164, 1172, 1182, 1184, 1192, 1198, 1202, 1206, 1212, - 1223, 1232, 1236, 1241, 1245, 1249, 1253, 1259, 1266, 1270, - 1276, 1284, 1295, 1302, 1306, 1312, 1322, 1333, 1337, 1355, - 1364, 1367, 1373, 1377, 1381, 1387, 1398, 1403, 1408, 1413, - 1418, 1423, 1431, 1434, 1439, 1452, 1460, 1473, 1473, 1475, - 1475, 1477, 1487, 1492, 1499, 1509, 1518, 1523, 1530, 1540, - 1550, 1562, 1562, 1563, 1563, 1565, 1572, 1577, 1584, 1592, - 1600, 1609, 1620, 1624, 1630, 1631, 1632, 1635, 1635, 1638, - 1638, 1641, 1647, 1655, 1668, 1677, 1686, 1690, 1699, 1708, - 1719, 1726, 1731, 1740, 1752, 1755, 1764, 1775, 1776, 1777, - 1780, 1781, 1782, 1785, 1786, 1789, 1790, 1793, 1794, 1797, - 1808, 1819, 1830 + 454, 455, 456, 457, 460, 473, 486, 499, 521, 530, + 539, 546, 555, 583, 625, 636, 657, 667, 673, 704, + 721, 721, 723, 730, 742, 743, 744, 747, 759, 771, + 789, 800, 812, 814, 815, 816, 817, 820, 820, 820, + 820, 821, 824, 825, 826, 827, 828, 829, 832, 850, + 854, 860, 864, 868, 872, 881, 890, 894, 899, 905, + 916, 916, 917, 919, 923, 927, 931, 937, 937, 939, + 955, 978, 981, 992, 998, 1004, 1005, 1012, 1018, 1024, + 1032, 1038, 1044, 1052, 1058, 1064, 1072, 1073, 1076, 1077, + 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1088, 1097, + 1101, 1105, 1111, 1120, 1124, 1128, 1137, 1141, 1147, 1153, + 1160, 1165, 1173, 1183, 1185, 1193, 1199, 1203, 1207, 1213, + 1224, 1233, 1237, 1242, 1246, 1250, 1254, 1260, 1267, 1271, + 1277, 1285, 1296, 1303, 1307, 1313, 1323, 1334, 1338, 1356, + 1365, 1368, 1374, 1378, 1382, 1388, 1399, 1404, 1409, 1414, + 1419, 1424, 1432, 1435, 1440, 1453, 1461, 1474, 1474, 1476, + 1476, 1478, 1488, 1493, 1500, 1510, 1519, 1524, 1531, 1541, + 1551, 1563, 1563, 1564, 1564, 1566, 1573, 1578, 1585, 1593, + 1601, 1610, 1621, 1625, 1631, 1632, 1633, 1636, 1636, 1639, + 1639, 1642, 1648, 1656, 1669, 1678, 1687, 1691, 1700, 1709, + 1720, 1727, 1732, 1741, 1753, 1756, 1765, 1776, 1777, 1778, + 1781, 1782, 1783, 1786, 1787, 1790, 1791, 1794, 1795, 1798, + 1809, 1820, 1831 }; #endif @@ -2366,6 +2366,7 @@ yyreduce: * FIXME: to the existing swizzle? */ (yyvsp[(4) - (6)].src_reg).Base.Swizzle = (yyvsp[(6) - (6)].swiz_mask).swizzle; + (yyvsp[(4) - (6)].src_reg).Base.Negate = (yyvsp[(6) - (6)].swiz_mask).mask; (yyval.inst) = asm_instruction_ctor(OPCODE_SWZ, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2375,7 +2376,7 @@ yyreduce: case 45: /* Line 1455 of yacc.c */ -#line 473 "program_parse.y" +#line 474 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2391,7 +2392,7 @@ yyreduce: case 46: /* Line 1455 of yacc.c */ -#line 486 "program_parse.y" +#line 487 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2407,7 +2408,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 499 "program_parse.y" +#line 500 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2432,7 +2433,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 521 "program_parse.y" +#line 522 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2444,7 +2445,7 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 530 "program_parse.y" +#line 531 "program_parse.y" { (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); @@ -2456,7 +2457,7 @@ yyreduce: case 50: /* Line 1455 of yacc.c */ -#line 539 "program_parse.y" +#line 540 "program_parse.y" { (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; @@ -2466,7 +2467,7 @@ yyreduce: case 51: /* Line 1455 of yacc.c */ -#line 546 "program_parse.y" +#line 547 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2480,7 +2481,7 @@ yyreduce: case 52: /* Line 1455 of yacc.c */ -#line 555 "program_parse.y" +#line 556 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2511,7 +2512,7 @@ yyreduce: case 53: /* Line 1455 of yacc.c */ -#line 583 "program_parse.y" +#line 584 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2558,7 +2559,7 @@ yyreduce: case 54: /* Line 1455 of yacc.c */ -#line 625 "program_parse.y" +#line 626 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2574,7 +2575,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 636 "program_parse.y" +#line 637 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2600,7 +2601,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 657 "program_parse.y" +#line 658 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2613,7 +2614,7 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 667 "program_parse.y" +#line 668 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2624,7 +2625,7 @@ yyreduce: case 58: /* Line 1455 of yacc.c */ -#line 673 "program_parse.y" +#line 674 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2658,7 +2659,7 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 704 "program_parse.y" +#line 705 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2678,7 +2679,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 723 "program_parse.y" +#line 724 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2688,7 +2689,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 730 "program_parse.y" +#line 731 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2703,28 +2704,28 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 741 "program_parse.y" +#line 742 "program_parse.y" { (yyval.integer) = 0; ;} break; case 65: /* Line 1455 of yacc.c */ -#line 742 "program_parse.y" +#line 743 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 66: /* Line 1455 of yacc.c */ -#line 743 "program_parse.y" +#line 744 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 67: /* Line 1455 of yacc.c */ -#line 747 "program_parse.y" +#line 748 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2739,7 +2740,7 @@ yyreduce: case 68: /* Line 1455 of yacc.c */ -#line 759 "program_parse.y" +#line 760 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2754,7 +2755,7 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 771 "program_parse.y" +#line 772 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2775,7 +2776,7 @@ yyreduce: case 70: /* Line 1455 of yacc.c */ -#line 789 "program_parse.y" +#line 790 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2789,7 +2790,7 @@ yyreduce: case 71: /* Line 1455 of yacc.c */ -#line 800 "program_parse.y" +#line 801 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2804,21 +2805,21 @@ yyreduce: case 76: /* Line 1455 of yacc.c */ -#line 816 "program_parse.y" +#line 817 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 820 "program_parse.y" +#line 821 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: /* Line 1455 of yacc.c */ -#line 832 "program_parse.y" +#line 833 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2839,7 +2840,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 850 "program_parse.y" +#line 851 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2848,7 +2849,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 854 "program_parse.y" +#line 855 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2857,7 +2858,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 860 "program_parse.y" +#line 861 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2866,7 +2867,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 864 "program_parse.y" +#line 865 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2875,7 +2876,7 @@ yyreduce: case 93: /* Line 1455 of yacc.c */ -#line 868 "program_parse.y" +#line 869 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2884,7 +2885,7 @@ yyreduce: case 94: /* Line 1455 of yacc.c */ -#line 872 "program_parse.y" +#line 873 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2898,7 +2899,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 881 "program_parse.y" +#line 882 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2912,7 +2913,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 890 "program_parse.y" +#line 891 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2921,7 +2922,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 894 "program_parse.y" +#line 895 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -2931,7 +2932,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 899 "program_parse.y" +#line 900 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2940,7 +2941,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 905 "program_parse.y" +#line 906 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2954,7 +2955,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 919 "program_parse.y" +#line 920 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2963,7 +2964,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 923 "program_parse.y" +#line 924 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2972,7 +2973,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 927 "program_parse.y" +#line 928 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2981,7 +2982,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 931 "program_parse.y" +#line 932 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2990,7 +2991,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 939 "program_parse.y" +#line 940 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3009,7 +3010,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 955 "program_parse.y" +#line 956 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3034,7 +3035,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 977 "program_parse.y" +#line 978 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3043,7 +3044,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 981 "program_parse.y" +#line 982 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3057,7 +3058,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 992 "program_parse.y" +#line 993 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3066,7 +3067,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 998 "program_parse.y" +#line 999 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3075,7 +3076,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 1005 "program_parse.y" +#line 1006 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3085,7 +3086,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1012 "program_parse.y" +#line 1013 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3096,7 +3097,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1018 "program_parse.y" +#line 1019 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3107,7 +3108,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1024 "program_parse.y" +#line 1025 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3118,7 +3119,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1032 "program_parse.y" +#line 1033 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3129,7 +3130,7 @@ yyreduce: case 121: /* Line 1455 of yacc.c */ -#line 1038 "program_parse.y" +#line 1039 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3140,7 +3141,7 @@ yyreduce: case 122: /* Line 1455 of yacc.c */ -#line 1044 "program_parse.y" +#line 1045 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3151,7 +3152,7 @@ yyreduce: case 123: /* Line 1455 of yacc.c */ -#line 1052 "program_parse.y" +#line 1053 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3162,7 +3163,7 @@ yyreduce: case 124: /* Line 1455 of yacc.c */ -#line 1058 "program_parse.y" +#line 1059 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3173,7 +3174,7 @@ yyreduce: case 125: /* Line 1455 of yacc.c */ -#line 1064 "program_parse.y" +#line 1065 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3184,91 +3185,91 @@ yyreduce: case 126: /* Line 1455 of yacc.c */ -#line 1071 "program_parse.y" +#line 1072 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1073 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1075 "program_parse.y" +#line 1076 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1076 "program_parse.y" +#line 1077 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1077 "program_parse.y" +#line 1078 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1078 "program_parse.y" +#line 1079 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 132: /* Line 1455 of yacc.c */ -#line 1079 "program_parse.y" +#line 1080 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1080 "program_parse.y" +#line 1081 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1081 "program_parse.y" +#line 1082 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1082 "program_parse.y" +#line 1083 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1083 "program_parse.y" +#line 1084 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1085 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1088 "program_parse.y" +#line 1089 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3280,7 +3281,7 @@ yyreduce: case 139: /* Line 1455 of yacc.c */ -#line 1097 "program_parse.y" +#line 1098 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3289,7 +3290,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1101 "program_parse.y" +#line 1102 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3298,7 +3299,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1105 "program_parse.y" +#line 1106 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3307,7 +3308,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1111 "program_parse.y" +#line 1112 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3319,7 +3320,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1120 "program_parse.y" +#line 1121 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3328,7 +3329,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1124 "program_parse.y" +#line 1125 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3337,7 +3338,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1128 "program_parse.y" +#line 1129 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3351,7 +3352,7 @@ yyreduce: case 146: /* Line 1455 of yacc.c */ -#line 1137 "program_parse.y" +#line 1138 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3360,7 +3361,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1141 "program_parse.y" +#line 1142 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3369,7 +3370,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1147 "program_parse.y" +#line 1148 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3378,7 +3379,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1153 "program_parse.y" +#line 1154 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3388,7 +3389,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1160 "program_parse.y" +#line 1161 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3398,7 +3399,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1165 "program_parse.y" +#line 1166 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3409,7 +3410,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1173 "program_parse.y" +#line 1174 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3422,7 +3423,7 @@ yyreduce: case 154: /* Line 1455 of yacc.c */ -#line 1185 "program_parse.y" +#line 1186 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3433,7 +3434,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1193 "program_parse.y" +#line 1194 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3442,7 +3443,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1199 "program_parse.y" +#line 1200 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3451,7 +3452,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1203 "program_parse.y" +#line 1204 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3460,7 +3461,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1207 "program_parse.y" +#line 1208 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3469,7 +3470,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1213 "program_parse.y" +#line 1214 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3483,7 +3484,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1224 "program_parse.y" +#line 1225 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3495,7 +3496,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1233 "program_parse.y" +#line 1234 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3504,7 +3505,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1237 "program_parse.y" +#line 1238 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3513,7 +3514,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1242 "program_parse.y" +#line 1243 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3522,7 +3523,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1246 "program_parse.y" +#line 1247 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3531,7 +3532,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1250 "program_parse.y" +#line 1251 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3540,7 +3541,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1254 "program_parse.y" +#line 1255 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3549,7 +3550,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1260 "program_parse.y" +#line 1261 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3559,7 +3560,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1267 "program_parse.y" +#line 1268 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3568,7 +3569,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1271 "program_parse.y" +#line 1272 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3577,7 +3578,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1277 "program_parse.y" +#line 1278 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3588,7 +3589,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1285 "program_parse.y" +#line 1286 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3602,7 +3603,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1296 "program_parse.y" +#line 1297 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3612,7 +3613,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1303 "program_parse.y" +#line 1304 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3621,7 +3622,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1307 "program_parse.y" +#line 1308 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3630,7 +3631,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1313 "program_parse.y" +#line 1314 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3643,7 +3644,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1323 "program_parse.y" +#line 1324 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3656,7 +3657,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1333 "program_parse.y" +#line 1334 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3666,7 +3667,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1338 "program_parse.y" +#line 1339 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3687,7 +3688,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1356 "program_parse.y" +#line 1357 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3698,7 +3699,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1364 "program_parse.y" +#line 1365 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3707,7 +3708,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1368 "program_parse.y" +#line 1369 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3716,7 +3717,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1374 "program_parse.y" +#line 1375 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3725,7 +3726,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1378 "program_parse.y" +#line 1379 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3734,7 +3735,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1382 "program_parse.y" +#line 1383 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3743,7 +3744,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1388 "program_parse.y" +#line 1389 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3757,7 +3758,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1399 "program_parse.y" +#line 1400 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3767,7 +3768,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1404 "program_parse.y" +#line 1405 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3777,7 +3778,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1409 "program_parse.y" +#line 1410 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3787,7 +3788,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1414 "program_parse.y" +#line 1415 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3797,7 +3798,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1419 "program_parse.y" +#line 1420 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3807,7 +3808,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1424 "program_parse.y" +#line 1425 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3817,7 +3818,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1431 "program_parse.y" +#line 1432 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3826,7 +3827,7 @@ yyreduce: case 193: /* Line 1455 of yacc.c */ -#line 1435 "program_parse.y" +#line 1436 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3835,7 +3836,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1440 "program_parse.y" +#line 1441 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3852,7 +3853,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1453 "program_parse.y" +#line 1454 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3864,7 +3865,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1461 "program_parse.y" +#line 1462 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3878,7 +3879,7 @@ yyreduce: case 201: /* Line 1455 of yacc.c */ -#line 1478 "program_parse.y" +#line 1479 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3891,7 +3892,7 @@ yyreduce: case 202: /* Line 1455 of yacc.c */ -#line 1488 "program_parse.y" +#line 1489 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3901,7 +3902,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1493 "program_parse.y" +#line 1494 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3911,7 +3912,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1500 "program_parse.y" +#line 1501 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3924,7 +3925,7 @@ yyreduce: case 205: /* Line 1455 of yacc.c */ -#line 1510 "program_parse.y" +#line 1511 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3937,7 +3938,7 @@ yyreduce: case 206: /* Line 1455 of yacc.c */ -#line 1519 "program_parse.y" +#line 1520 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3947,7 +3948,7 @@ yyreduce: case 207: /* Line 1455 of yacc.c */ -#line 1524 "program_parse.y" +#line 1525 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3957,7 +3958,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1531 "program_parse.y" +#line 1532 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3970,7 +3971,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1541 "program_parse.y" +#line 1542 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3983,7 +3984,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1551 "program_parse.y" +#line 1552 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3996,7 +3997,7 @@ yyreduce: case 215: /* Line 1455 of yacc.c */ -#line 1566 "program_parse.y" +#line 1567 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4006,7 +4007,7 @@ yyreduce: case 216: /* Line 1455 of yacc.c */ -#line 1573 "program_parse.y" +#line 1574 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4016,7 +4017,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1578 "program_parse.y" +#line 1579 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4026,7 +4027,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1585 "program_parse.y" +#line 1586 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4039,7 +4040,7 @@ yyreduce: case 219: /* Line 1455 of yacc.c */ -#line 1593 "program_parse.y" +#line 1594 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4052,7 +4053,7 @@ yyreduce: case 220: /* Line 1455 of yacc.c */ -#line 1602 "program_parse.y" +#line 1603 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4065,7 +4066,7 @@ yyreduce: case 221: /* Line 1455 of yacc.c */ -#line 1611 "program_parse.y" +#line 1612 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4078,7 +4079,7 @@ yyreduce: case 222: /* Line 1455 of yacc.c */ -#line 1621 "program_parse.y" +#line 1622 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4087,7 +4088,7 @@ yyreduce: case 223: /* Line 1455 of yacc.c */ -#line 1625 "program_parse.y" +#line 1626 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4096,42 +4097,42 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1630 "program_parse.y" +#line 1631 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 225: /* Line 1455 of yacc.c */ -#line 1631 "program_parse.y" +#line 1632 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 226: /* Line 1455 of yacc.c */ -#line 1632 "program_parse.y" +#line 1633 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 227: /* Line 1455 of yacc.c */ -#line 1635 "program_parse.y" +#line 1636 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 229: /* Line 1455 of yacc.c */ -#line 1638 "program_parse.y" +#line 1639 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 231: /* Line 1455 of yacc.c */ -#line 1642 "program_parse.y" +#line 1643 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4142,7 +4143,7 @@ yyreduce: case 232: /* Line 1455 of yacc.c */ -#line 1648 "program_parse.y" +#line 1649 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4153,7 +4154,7 @@ yyreduce: case 233: /* Line 1455 of yacc.c */ -#line 1656 "program_parse.y" +#line 1657 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4169,7 +4170,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1669 "program_parse.y" +#line 1670 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4183,7 +4184,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1678 "program_parse.y" +#line 1679 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4197,7 +4198,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1687 "program_parse.y" +#line 1688 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4206,7 +4207,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1691 "program_parse.y" +#line 1692 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4220,7 +4221,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1700 "program_parse.y" +#line 1701 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4234,7 +4235,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1709 "program_parse.y" +#line 1710 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4248,7 +4249,7 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1720 "program_parse.y" +#line 1721 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4257,7 +4258,7 @@ yyreduce: case 241: /* Line 1455 of yacc.c */ -#line 1726 "program_parse.y" +#line 1727 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4268,7 +4269,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1732 "program_parse.y" +#line 1733 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4282,7 +4283,7 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1741 "program_parse.y" +#line 1742 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4296,7 +4297,7 @@ yyreduce: case 244: /* Line 1455 of yacc.c */ -#line 1752 "program_parse.y" +#line 1753 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4305,7 +4306,7 @@ yyreduce: case 245: /* Line 1455 of yacc.c */ -#line 1756 "program_parse.y" +#line 1757 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4319,7 +4320,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1765 "program_parse.y" +#line 1766 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4333,91 +4334,91 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1775 "program_parse.y" +#line 1776 "program_parse.y" { (yyval.integer) = 0; ;} break; case 248: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 1777 "program_parse.y" { (yyval.integer) = 0; ;} break; case 249: /* Line 1455 of yacc.c */ -#line 1777 "program_parse.y" +#line 1778 "program_parse.y" { (yyval.integer) = 1; ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1780 "program_parse.y" +#line 1781 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1781 "program_parse.y" +#line 1782 "program_parse.y" { (yyval.integer) = 0; ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1782 "program_parse.y" +#line 1783 "program_parse.y" { (yyval.integer) = 1; ;} break; case 253: /* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" +#line 1786 "program_parse.y" { (yyval.integer) = 0; ;} break; case 254: /* Line 1455 of yacc.c */ -#line 1786 "program_parse.y" +#line 1787 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 255: /* Line 1455 of yacc.c */ -#line 1789 "program_parse.y" +#line 1790 "program_parse.y" { (yyval.integer) = 0; ;} break; case 256: /* Line 1455 of yacc.c */ -#line 1790 "program_parse.y" +#line 1791 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 257: /* Line 1455 of yacc.c */ -#line 1793 "program_parse.y" +#line 1794 "program_parse.y" { (yyval.integer) = 0; ;} break; case 258: /* Line 1455 of yacc.c */ -#line 1794 "program_parse.y" +#line 1795 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 259: /* Line 1455 of yacc.c */ -#line 1798 "program_parse.y" +#line 1799 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4431,7 +4432,7 @@ yyreduce: case 260: /* Line 1455 of yacc.c */ -#line 1809 "program_parse.y" +#line 1810 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4445,7 +4446,7 @@ yyreduce: case 261: /* Line 1455 of yacc.c */ -#line 1820 "program_parse.y" +#line 1821 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4459,7 +4460,7 @@ yyreduce: case 262: /* Line 1455 of yacc.c */ -#line 1831 "program_parse.y" +#line 1832 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4483,7 +4484,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4487 "program_parse.tab.c" +#line 4488 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4702,7 +4703,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1851 "program_parse.y" +#line 1852 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 225dc0d5b9..6c50491ffc 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -463,6 +463,7 @@ SWZ_instruction: SWZ maskedDstReg ',' srcReg ',' extendedSwizzle * FIXME: to the existing swizzle? */ $4.Base.Swizzle = $6.swizzle; + $4.Base.Negate = $6.mask; $$ = asm_instruction_ctor(OPCODE_SWZ, & $2, & $4, NULL, NULL); $$->Base.SaturateMode = $1.SaturateMode; -- cgit v1.2.3 From 4c5879ff3185e03b3baf0ed2765e06a951b35e9e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 29 Jul 2009 09:47:14 -0700 Subject: ARB prog parser: Set NumAttributes based on the number of attribs read --- src/mesa/shader/program_parse.tab.c | 1 + src/mesa/shader/program_parse.y | 1 + 2 files changed, 2 insertions(+) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index dbe2fa229c..5b807ce853 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -5135,6 +5135,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->prog->NumInstructions++; state->prog->NumParameters = state->prog->Parameters->NumParameters; + state->prog->NumAttributes = _mesa_bitcount(state->prog->InputsRead); /* * Initialize native counts to logical counts. The device driver may diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 6c50491ffc..c7e36096e0 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2280,6 +2280,7 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->prog->NumInstructions++; state->prog->NumParameters = state->prog->Parameters->NumParameters; + state->prog->NumAttributes = _mesa_bitcount(state->prog->InputsRead); /* * Initialize native counts to logical counts. The device driver may -- cgit v1.2.3 From 8a430dd4dad8520a7a37573e03d85cfb6316cb56 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 29 Jul 2009 09:50:06 -0700 Subject: Indentation fixes. --- src/mesa/shader/program_parse.tab.c | 16 ++++++++-------- src/mesa/shader/program_parse.y | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 5b807ce853..906c6b4738 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -2540,14 +2540,14 @@ yyreduce: (yyval.src_reg).Base.Index = s->param_binding_begin; break; case at_attrib: - (yyval.src_reg).Base.File = PROGRAM_INPUT; - (yyval.src_reg).Base.Index = s->attrib_binding; - state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); - - if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { - YYERROR; - } - break; + (yyval.src_reg).Base.File = PROGRAM_INPUT; + (yyval.src_reg).Base.Index = s->attrib_binding; + state->prog->InputsRead |= (1U << (yyval.src_reg).Base.Index); + + if (!validate_inputs(& (yylsp[(1) - (1)]), state)) { + YYERROR; + } + break; default: YYERROR; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index c7e36096e0..251cf7d309 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -608,14 +608,14 @@ srcReg: IDENTIFIER /* temporaryReg | progParamSingle */ $$.Base.Index = s->param_binding_begin; break; case at_attrib: - $$.Base.File = PROGRAM_INPUT; - $$.Base.Index = s->attrib_binding; - state->prog->InputsRead |= (1U << $$.Base.Index); - - if (!validate_inputs(& @1, state)) { - YYERROR; - } - break; + $$.Base.File = PROGRAM_INPUT; + $$.Base.Index = s->attrib_binding; + state->prog->InputsRead |= (1U << $$.Base.Index); + + if (!validate_inputs(& @1, state)) { + YYERROR; + } + break; default: YYERROR; -- cgit v1.2.3 From e511633985ebdb423d1addefa1267a03a76da33b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 29 Jul 2009 20:07:59 -0700 Subject: ARB prog: Fix the order of swizzle application The swizzle used to generate the "original" value from the value stored in the parameter array happens before the swizzle specified in the instruction. This fixes problems seen in progs/vp/vp-tris with arl-*.txt. --- src/mesa/shader/prog_parameter_layout.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/prog_parameter_layout.c b/src/mesa/shader/prog_parameter_layout.c index 4d67eca902..8f2b306220 100644 --- a/src/mesa/shader/prog_parameter_layout.c +++ b/src/mesa/shader/prog_parameter_layout.c @@ -187,7 +187,7 @@ _mesa_layout_parameters(struct asm_parser_state *state) _mesa_add_unnamed_constant(layout, v, p->Size, & swizzle); inst->Base.SrcReg[i].Swizzle = - _mesa_combine_swizzles(inst->Base.SrcReg[i].Swizzle, swizzle); + _mesa_combine_swizzles(swizzle, inst->Base.SrcReg[i].Swizzle); break; } -- cgit v1.2.3 From 333bb4f291b224ed82d87ade7ac157fb93fc5d12 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 29 Jul 2009 20:41:48 -0700 Subject: ARB prog parser: Finish implementing fp state.depth.range --- src/mesa/shader/program_parse.tab.c | 1151 ++++++++++++++++++----------------- src/mesa/shader/program_parse.y | 9 +- 2 files changed, 594 insertions(+), 566 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 906c6b4738..ae35bd3fef 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -580,16 +580,16 @@ union yyalloc /* YYFINAL -- State number of the termination state. */ #define YYFINAL 5 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 337 +#define YYLAST 340 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 115 /* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 133 +#define YYNNTS 134 /* YYNRULES -- Number of rules. */ -#define YYNRULES 262 +#define YYNRULES 264 /* YYNRULES -- Number of states. */ -#define YYNSTATES 431 +#define YYNSTATES 434 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 @@ -658,20 +658,20 @@ static const yytype_uint16 yyprhs[] = 277, 278, 282, 284, 286, 289, 291, 294, 296, 298, 302, 309, 310, 312, 315, 320, 322, 326, 328, 330, 332, 334, 336, 338, 340, 342, 344, 346, 349, 352, - 355, 358, 361, 364, 367, 370, 373, 376, 379, 383, - 385, 387, 389, 395, 397, 399, 401, 404, 406, 408, - 411, 413, 416, 423, 425, 429, 431, 433, 435, 437, - 439, 444, 446, 448, 450, 452, 454, 456, 459, 461, - 463, 469, 471, 474, 476, 478, 484, 487, 488, 495, - 499, 500, 502, 504, 506, 508, 510, 513, 515, 517, - 520, 525, 530, 531, 533, 535, 537, 539, 541, 543, - 545, 547, 553, 555, 559, 565, 571, 573, 577, 583, - 585, 587, 589, 591, 593, 595, 597, 599, 601, 605, - 611, 619, 629, 632, 635, 637, 639, 640, 641, 645, - 646, 650, 654, 656, 661, 664, 667, 670, 673, 677, - 680, 684, 685, 687, 689, 690, 692, 694, 695, 697, - 699, 700, 702, 704, 705, 709, 710, 714, 715, 719, - 721, 723, 725 + 355, 358, 361, 364, 367, 370, 373, 376, 379, 382, + 386, 388, 390, 392, 398, 400, 402, 404, 407, 409, + 411, 414, 416, 419, 426, 428, 432, 434, 436, 438, + 440, 442, 447, 449, 451, 453, 455, 457, 459, 462, + 464, 466, 472, 474, 477, 479, 481, 487, 490, 491, + 498, 502, 503, 505, 507, 509, 511, 513, 516, 518, + 520, 523, 528, 533, 534, 536, 538, 540, 542, 545, + 547, 549, 551, 553, 559, 561, 565, 571, 577, 579, + 583, 589, 591, 593, 595, 597, 599, 601, 603, 605, + 607, 611, 617, 625, 635, 638, 641, 643, 645, 646, + 647, 651, 652, 656, 660, 662, 667, 670, 673, 676, + 679, 683, 686, 690, 691, 693, 695, 696, 698, 700, + 701, 703, 705, 706, 708, 710, 711, 715, 716, 720, + 721, 725, 727, 729, 731 }; /* YYRHS -- A `-1'-separated list of the rules' RHS. */ @@ -687,69 +687,70 @@ static const yytype_int16 yyrhs[] = 136, 107, 136, -1, 13, 138, 107, 137, 107, 137, -1, 17, 138, 107, 137, 107, 137, 107, 137, -1, 15, 138, 107, 137, 107, 133, 107, 134, -1, 20, - 137, -1, 82, 242, -1, 83, -1, 84, -1, 85, + 137, -1, 82, 243, -1, 83, -1, 84, -1, 85, -1, 86, -1, 87, -1, 88, -1, 89, -1, 90, -1, 91, -1, 92, -1, 93, -1, 94, -1, 21, - 138, 107, 143, 107, 140, -1, 228, 143, 155, -1, - 228, 143, 156, -1, 144, 157, -1, 152, 154, -1, - 141, 107, 141, 107, 141, 107, 141, -1, 228, 142, + 138, 107, 143, 107, 140, -1, 229, 143, 155, -1, + 229, 143, 156, -1, 144, 157, -1, 152, 154, -1, + 141, 107, 141, 107, 141, 107, 141, -1, 229, 142, -1, 22, -1, 98, -1, 98, -1, 160, -1, 145, - 108, 146, 109, -1, 174, -1, 235, -1, 98, -1, + 108, 146, 109, -1, 174, -1, 236, -1, 98, -1, 98, -1, 147, -1, 148, -1, 22, -1, 152, 153, 149, -1, -1, 110, 150, -1, 111, 151, -1, 22, -1, 22, -1, 98, -1, 102, -1, 102, -1, 102, -1, 102, -1, 99, -1, 103, -1, -1, 99, -1, 100, -1, 101, -1, 102, -1, -1, 159, -1, 166, - -1, 229, -1, 231, -1, 234, -1, 247, -1, 7, + -1, 230, -1, 232, -1, 235, -1, 248, -1, 7, 98, 112, 160, -1, 95, 161, -1, 37, 165, -1, - 59, -1, 97, 163, -1, 52, -1, 28, 240, -1, - 36, -1, 73, 241, -1, 49, 108, 164, 109, -1, + 59, -1, 97, 163, -1, 52, -1, 28, 241, -1, + 36, -1, 73, 242, -1, 49, 108, 164, 109, -1, 96, 108, 162, 109, -1, 22, -1, -1, 108, 164, - 109, -1, 22, -1, 59, -1, 28, 240, -1, 36, - -1, 73, 241, -1, 167, -1, 168, -1, 10, 98, + 109, -1, 22, -1, 59, -1, 28, 241, -1, 36, + -1, 73, 242, -1, 167, -1, 168, -1, 10, 98, 170, -1, 10, 98, 108, 169, 109, 171, -1, -1, 22, -1, 112, 173, -1, 112, 113, 172, 114, -1, - 175, -1, 172, 107, 175, -1, 177, -1, 212, -1, - 222, -1, 177, -1, 212, -1, 223, -1, 176, -1, - 213, -1, 222, -1, 177, -1, 72, 201, -1, 72, + 175, -1, 172, 107, 175, -1, 177, -1, 213, -1, + 223, -1, 177, -1, 213, -1, 224, -1, 176, -1, + 214, -1, 223, -1, 177, -1, 72, 201, -1, 72, 178, -1, 72, 180, -1, 72, 183, -1, 72, 185, -1, 72, 191, -1, 72, 187, -1, 72, 194, -1, - 72, 196, -1, 72, 198, -1, 72, 200, -1, 46, - 239, 179, -1, 189, -1, 32, -1, 68, -1, 42, - 108, 190, 109, 181, -1, 189, -1, 59, -1, 25, - -1, 71, 182, -1, 39, -1, 31, -1, 43, 184, - -1, 24, -1, 239, 66, -1, 44, 108, 190, 109, - 239, 186, -1, 189, -1, 74, 243, 188, -1, 28, - -1, 24, -1, 30, -1, 70, -1, 22, -1, 75, - 241, 192, 193, -1, 34, -1, 53, -1, 78, -1, - 79, -1, 77, -1, 76, -1, 35, 195, -1, 28, - -1, 55, -1, 27, 108, 197, 109, 56, -1, 22, - -1, 57, 199, -1, 69, -1, 25, -1, 203, 65, - 108, 206, 109, -1, 203, 202, -1, -1, 65, 108, - 206, 104, 206, 109, -1, 48, 207, 204, -1, -1, - 205, -1, 40, -1, 81, -1, 41, -1, 22, -1, - 50, 208, -1, 62, -1, 51, -1, 80, 241, -1, - 54, 108, 210, 109, -1, 47, 108, 211, 109, -1, - -1, 209, -1, 22, -1, 22, -1, 22, -1, 216, - -1, 219, -1, 214, -1, 217, -1, 61, 33, 108, - 215, 109, -1, 220, -1, 220, 104, 220, -1, 61, - 33, 108, 220, 109, -1, 61, 45, 108, 218, 109, - -1, 221, -1, 221, 104, 221, -1, 61, 45, 108, - 221, 109, -1, 22, -1, 22, -1, 224, -1, 226, - -1, 225, -1, 226, -1, 227, -1, 23, -1, 22, - -1, 113, 227, 114, -1, 113, 227, 107, 227, 114, - -1, 113, 227, 107, 227, 107, 227, 114, -1, 113, - 227, 107, 227, 107, 227, 107, 227, 114, -1, 228, - 23, -1, 228, 22, -1, 110, -1, 111, -1, -1, - -1, 11, 230, 233, -1, -1, 5, 232, 233, -1, - 233, 107, 98, -1, 98, -1, 9, 98, 112, 235, - -1, 64, 59, -1, 64, 36, -1, 64, 236, -1, - 64, 58, -1, 64, 73, 241, -1, 64, 29, -1, - 28, 237, 238, -1, -1, 38, -1, 26, -1, -1, - 60, -1, 67, -1, -1, 38, -1, 26, -1, -1, - 60, -1, 67, -1, -1, 108, 244, 109, -1, -1, - 108, 245, 109, -1, -1, 108, 246, 109, -1, 22, - -1, 22, -1, 22, -1, 6, 98, 112, 98, -1 + 72, 196, -1, 72, 198, -1, 72, 200, -1, 72, + 212, -1, 46, 240, 179, -1, 189, -1, 32, -1, + 68, -1, 42, 108, 190, 109, 181, -1, 189, -1, + 59, -1, 25, -1, 71, 182, -1, 39, -1, 31, + -1, 43, 184, -1, 24, -1, 240, 66, -1, 44, + 108, 190, 109, 240, 186, -1, 189, -1, 74, 244, + 188, -1, 28, -1, 24, -1, 30, -1, 70, -1, + 22, -1, 75, 242, 192, 193, -1, 34, -1, 53, + -1, 78, -1, 79, -1, 77, -1, 76, -1, 35, + 195, -1, 28, -1, 55, -1, 27, 108, 197, 109, + 56, -1, 22, -1, 57, 199, -1, 69, -1, 25, + -1, 203, 65, 108, 206, 109, -1, 203, 202, -1, + -1, 65, 108, 206, 104, 206, 109, -1, 48, 207, + 204, -1, -1, 205, -1, 40, -1, 81, -1, 41, + -1, 22, -1, 50, 208, -1, 62, -1, 51, -1, + 80, 242, -1, 54, 108, 210, 109, -1, 47, 108, + 211, 109, -1, -1, 209, -1, 22, -1, 22, -1, + 22, -1, 29, 63, -1, 217, -1, 220, -1, 215, + -1, 218, -1, 61, 33, 108, 216, 109, -1, 221, + -1, 221, 104, 221, -1, 61, 33, 108, 221, 109, + -1, 61, 45, 108, 219, 109, -1, 222, -1, 222, + 104, 222, -1, 61, 45, 108, 222, 109, -1, 22, + -1, 22, -1, 225, -1, 227, -1, 226, -1, 227, + -1, 228, -1, 23, -1, 22, -1, 113, 228, 114, + -1, 113, 228, 107, 228, 114, -1, 113, 228, 107, + 228, 107, 228, 114, -1, 113, 228, 107, 228, 107, + 228, 107, 228, 114, -1, 229, 23, -1, 229, 22, + -1, 110, -1, 111, -1, -1, -1, 11, 231, 234, + -1, -1, 5, 233, 234, -1, 234, 107, 98, -1, + 98, -1, 9, 98, 112, 236, -1, 64, 59, -1, + 64, 36, -1, 64, 237, -1, 64, 58, -1, 64, + 73, 242, -1, 64, 29, -1, 28, 238, 239, -1, + -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, + -1, 38, -1, 26, -1, -1, 60, -1, 67, -1, + -1, 108, 245, 109, -1, -1, 108, 246, 109, -1, + -1, 108, 247, 109, -1, 22, -1, 22, -1, 22, + -1, 6, 98, 112, 98, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ @@ -768,20 +769,20 @@ static const yytype_uint16 yyrline[] = 916, 916, 917, 919, 923, 927, 931, 937, 937, 939, 955, 978, 981, 992, 998, 1004, 1005, 1012, 1018, 1024, 1032, 1038, 1044, 1052, 1058, 1064, 1072, 1073, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1088, 1097, - 1101, 1105, 1111, 1120, 1124, 1128, 1137, 1141, 1147, 1153, - 1160, 1165, 1173, 1183, 1185, 1193, 1199, 1203, 1207, 1213, - 1224, 1233, 1237, 1242, 1246, 1250, 1254, 1260, 1267, 1271, - 1277, 1285, 1296, 1303, 1307, 1313, 1323, 1334, 1338, 1356, - 1365, 1368, 1374, 1378, 1382, 1388, 1399, 1404, 1409, 1414, - 1419, 1424, 1432, 1435, 1440, 1453, 1461, 1474, 1474, 1476, - 1476, 1478, 1488, 1493, 1500, 1510, 1519, 1524, 1531, 1541, - 1551, 1563, 1563, 1564, 1564, 1566, 1573, 1578, 1585, 1593, - 1601, 1610, 1621, 1625, 1631, 1632, 1633, 1636, 1636, 1639, - 1639, 1642, 1648, 1656, 1669, 1678, 1687, 1691, 1700, 1709, - 1720, 1727, 1732, 1741, 1753, 1756, 1765, 1776, 1777, 1778, - 1781, 1782, 1783, 1786, 1787, 1790, 1791, 1794, 1795, 1798, - 1809, 1820, 1831 + 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1089, + 1098, 1102, 1106, 1112, 1121, 1125, 1129, 1138, 1142, 1148, + 1154, 1161, 1166, 1174, 1184, 1186, 1194, 1200, 1204, 1208, + 1214, 1225, 1234, 1238, 1243, 1247, 1251, 1255, 1261, 1268, + 1272, 1278, 1286, 1297, 1304, 1308, 1314, 1324, 1335, 1339, + 1357, 1366, 1369, 1375, 1379, 1383, 1389, 1400, 1405, 1410, + 1415, 1420, 1425, 1433, 1436, 1441, 1454, 1462, 1473, 1481, + 1481, 1483, 1483, 1485, 1495, 1500, 1507, 1517, 1526, 1531, + 1538, 1548, 1558, 1570, 1570, 1571, 1571, 1573, 1580, 1585, + 1592, 1600, 1608, 1617, 1628, 1632, 1638, 1639, 1640, 1643, + 1643, 1646, 1646, 1649, 1655, 1663, 1676, 1685, 1694, 1698, + 1707, 1716, 1727, 1734, 1739, 1748, 1760, 1763, 1772, 1783, + 1784, 1785, 1788, 1789, 1790, 1793, 1794, 1797, 1798, 1801, + 1802, 1805, 1816, 1827, 1838 }; #endif @@ -836,15 +837,16 @@ static const char *const yytname[] = "stateMatrixRows", "optMatrixRows", "stateMatrixItem", "stateOptMatModifier", "stateMatModifier", "stateMatrixRowNum", "stateMatrixName", "stateOptModMatNum", "stateModMatNum", - "statePaletteMatNum", "stateProgramMatNum", "programSingleItem", - "programMultipleItem", "progEnvParams", "progEnvParamNums", - "progEnvParam", "progLocalParams", "progLocalParamNums", - "progLocalParam", "progEnvParamNum", "progLocalParamNum", - "paramConstDecl", "paramConstUse", "paramConstScalarDecl", - "paramConstScalarUse", "paramConstVector", "signedFloatConstant", - "optionalSign", "TEMP_statement", "@1", "ADDRESS_statement", "@2", - "varNameList", "OUTPUT_statement", "resultBinding", "resultColBinding", - "optResultFaceType", "optResultColorType", "optFaceType", "optColorType", + "statePaletteMatNum", "stateProgramMatNum", "stateDepthItem", + "programSingleItem", "programMultipleItem", "progEnvParams", + "progEnvParamNums", "progEnvParam", "progLocalParams", + "progLocalParamNums", "progLocalParam", "progEnvParamNum", + "progLocalParamNum", "paramConstDecl", "paramConstUse", + "paramConstScalarDecl", "paramConstScalarUse", "paramConstVector", + "signedFloatConstant", "optionalSign", "TEMP_statement", "@1", + "ADDRESS_statement", "@2", "varNameList", "OUTPUT_statement", + "resultBinding", "resultColBinding", "optResultFaceType", + "optResultColorType", "optFaceType", "optColorType", "optTexCoordUnitNum", "optTexImageUnitNum", "optLegacyTexUnitNum", "texCoordUnitNum", "texImageUnitNum", "legacyTexUnitNum", "ALIAS_statement", 0 @@ -887,20 +889,20 @@ static const yytype_uint8 yyr1[] = 163, 163, 164, 165, 165, 165, 165, 166, 166, 167, 168, 169, 169, 170, 171, 172, 172, 173, 173, 173, 174, 174, 174, 175, 175, 175, 176, 176, 177, 177, - 177, 177, 177, 177, 177, 177, 177, 177, 178, 179, - 179, 179, 180, 181, 181, 181, 181, 181, 182, 183, - 184, 184, 185, 186, 187, 188, 189, 189, 189, 190, - 191, 192, 192, 193, 193, 193, 193, 194, 195, 195, - 196, 197, 198, 199, 199, 200, 201, 202, 202, 203, - 204, 204, 205, 205, 205, 206, 207, 207, 207, 207, - 207, 207, 208, 208, 209, 210, 211, 212, 212, 213, - 213, 214, 215, 215, 216, 217, 218, 218, 219, 220, - 221, 222, 222, 223, 223, 224, 225, 225, 226, 226, - 226, 226, 227, 227, 228, 228, 228, 230, 229, 232, - 231, 233, 233, 234, 235, 235, 235, 235, 235, 235, - 236, 237, 237, 237, 238, 238, 238, 239, 239, 239, - 240, 240, 240, 241, 241, 242, 242, 243, 243, 244, - 245, 246, 247 + 177, 177, 177, 177, 177, 177, 177, 177, 177, 178, + 179, 179, 179, 180, 181, 181, 181, 181, 181, 182, + 183, 184, 184, 185, 186, 187, 188, 189, 189, 189, + 190, 191, 192, 192, 193, 193, 193, 193, 194, 195, + 195, 196, 197, 198, 199, 199, 200, 201, 202, 202, + 203, 204, 204, 205, 205, 205, 206, 207, 207, 207, + 207, 207, 207, 208, 208, 209, 210, 211, 212, 213, + 213, 214, 214, 215, 216, 216, 217, 218, 219, 219, + 220, 221, 222, 223, 223, 224, 224, 225, 226, 226, + 227, 227, 227, 227, 228, 228, 229, 229, 229, 231, + 230, 233, 232, 234, 234, 235, 236, 236, 236, 236, + 236, 236, 237, 238, 238, 238, 239, 239, 239, 240, + 240, 240, 241, 241, 241, 242, 242, 243, 243, 244, + 244, 245, 246, 247, 248 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ @@ -919,20 +921,20 @@ static const yytype_uint8 yyr2[] = 0, 3, 1, 1, 2, 1, 2, 1, 1, 3, 6, 0, 1, 2, 4, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, - 2, 2, 2, 2, 2, 2, 2, 2, 3, 1, - 1, 1, 5, 1, 1, 1, 2, 1, 1, 2, - 1, 2, 6, 1, 3, 1, 1, 1, 1, 1, - 4, 1, 1, 1, 1, 1, 1, 2, 1, 1, - 5, 1, 2, 1, 1, 5, 2, 0, 6, 3, - 0, 1, 1, 1, 1, 1, 2, 1, 1, 2, - 4, 4, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 5, 1, 3, 5, 5, 1, 3, 5, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 3, 5, - 7, 9, 2, 2, 1, 1, 0, 0, 3, 0, - 3, 3, 1, 4, 2, 2, 2, 2, 3, 2, - 3, 0, 1, 1, 0, 1, 1, 0, 1, 1, - 0, 1, 1, 0, 3, 0, 3, 0, 3, 1, - 1, 1, 4 + 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, + 1, 1, 1, 5, 1, 1, 1, 2, 1, 1, + 2, 1, 2, 6, 1, 3, 1, 1, 1, 1, + 1, 4, 1, 1, 1, 1, 1, 1, 2, 1, + 1, 5, 1, 2, 1, 1, 5, 2, 0, 6, + 3, 0, 1, 1, 1, 1, 1, 2, 1, 1, + 2, 4, 4, 0, 1, 1, 1, 1, 2, 1, + 1, 1, 1, 5, 1, 3, 5, 5, 1, 3, + 5, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 3, 5, 7, 9, 2, 2, 1, 1, 0, 0, + 3, 0, 3, 3, 1, 4, 2, 2, 2, 2, + 3, 2, 3, 0, 1, 1, 0, 1, 1, 0, + 1, 1, 0, 1, 1, 0, 3, 0, 3, 0, + 3, 1, 1, 1, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state @@ -941,138 +943,138 @@ static const yytype_uint8 yyr2[] = static const yytype_uint16 yydefact[] = { 0, 3, 4, 0, 6, 1, 9, 0, 5, 0, - 0, 229, 0, 0, 0, 0, 227, 2, 0, 0, - 0, 0, 0, 0, 0, 226, 0, 8, 0, 12, + 0, 231, 0, 0, 0, 0, 229, 2, 0, 0, + 0, 0, 0, 0, 0, 228, 0, 8, 0, 12, 13, 14, 15, 16, 17, 18, 19, 21, 22, 20, 0, 82, 83, 107, 108, 84, 85, 86, 87, 7, 0, 0, 0, 0, 0, 0, 0, 58, 0, 81, - 57, 0, 0, 0, 0, 0, 69, 0, 0, 224, - 225, 30, 0, 0, 10, 11, 232, 230, 0, 0, - 0, 111, 226, 109, 228, 241, 239, 235, 237, 234, - 253, 236, 226, 77, 78, 79, 80, 47, 226, 226, - 226, 226, 226, 226, 71, 48, 217, 216, 0, 0, - 0, 0, 53, 226, 76, 0, 54, 56, 120, 121, - 197, 198, 122, 213, 214, 0, 0, 262, 88, 233, - 112, 0, 113, 117, 118, 119, 211, 212, 215, 0, - 243, 242, 244, 0, 238, 0, 0, 0, 0, 25, - 0, 24, 23, 250, 105, 103, 253, 90, 0, 0, - 0, 0, 0, 247, 0, 247, 0, 0, 257, 253, - 128, 129, 130, 131, 133, 132, 134, 135, 136, 137, - 0, 250, 95, 0, 93, 91, 253, 0, 100, 89, - 0, 74, 73, 75, 46, 0, 0, 231, 0, 223, - 222, 245, 246, 240, 259, 0, 226, 226, 0, 0, - 226, 251, 252, 104, 106, 0, 0, 0, 168, 169, - 167, 0, 150, 249, 248, 149, 0, 0, 0, 0, - 192, 188, 0, 187, 253, 180, 174, 173, 172, 0, - 0, 0, 0, 94, 0, 96, 0, 0, 92, 226, - 218, 62, 0, 60, 61, 0, 226, 0, 110, 254, - 27, 26, 72, 45, 255, 0, 0, 209, 0, 210, - 0, 171, 0, 159, 0, 151, 0, 156, 157, 140, - 141, 158, 138, 139, 0, 194, 186, 193, 0, 189, - 182, 184, 183, 179, 181, 261, 0, 155, 154, 161, - 162, 0, 0, 102, 0, 99, 0, 0, 0, 55, - 70, 64, 44, 0, 0, 226, 0, 31, 0, 226, - 204, 208, 0, 0, 247, 196, 0, 195, 0, 258, - 166, 165, 163, 164, 160, 185, 0, 97, 98, 101, - 226, 219, 0, 0, 63, 226, 51, 52, 50, 0, - 0, 0, 115, 123, 126, 124, 199, 200, 125, 260, - 0, 32, 33, 34, 35, 36, 37, 38, 39, 40, - 41, 42, 43, 29, 28, 170, 145, 147, 144, 0, - 142, 143, 0, 191, 190, 175, 0, 67, 65, 68, - 66, 0, 0, 0, 127, 177, 226, 114, 256, 148, - 146, 152, 153, 226, 220, 226, 0, 0, 0, 176, - 116, 0, 0, 0, 202, 0, 206, 0, 221, 226, - 201, 0, 205, 0, 0, 49, 203, 207, 0, 0, - 178 + 57, 0, 0, 0, 0, 0, 69, 0, 0, 226, + 227, 30, 0, 0, 10, 11, 234, 232, 0, 0, + 0, 111, 228, 109, 230, 243, 241, 237, 239, 236, + 255, 238, 228, 77, 78, 79, 80, 47, 228, 228, + 228, 228, 228, 228, 71, 48, 219, 218, 0, 0, + 0, 0, 53, 228, 76, 0, 54, 56, 120, 121, + 199, 200, 122, 215, 216, 0, 0, 264, 88, 235, + 112, 0, 113, 117, 118, 119, 213, 214, 217, 0, + 245, 244, 246, 0, 240, 0, 0, 0, 0, 25, + 0, 24, 23, 252, 105, 103, 255, 90, 0, 0, + 0, 0, 0, 0, 249, 0, 249, 0, 0, 259, + 255, 128, 129, 130, 131, 133, 132, 134, 135, 136, + 137, 0, 138, 252, 95, 0, 93, 91, 255, 0, + 100, 89, 0, 74, 73, 75, 46, 0, 0, 233, + 0, 225, 224, 247, 248, 242, 261, 0, 228, 228, + 0, 0, 228, 253, 254, 104, 106, 0, 0, 0, + 198, 169, 170, 168, 0, 151, 251, 250, 150, 0, + 0, 0, 0, 193, 189, 0, 188, 255, 181, 175, + 174, 173, 0, 0, 0, 0, 94, 0, 96, 0, + 0, 92, 228, 220, 62, 0, 60, 61, 0, 228, + 0, 110, 256, 27, 26, 72, 45, 257, 0, 0, + 211, 0, 212, 0, 172, 0, 160, 0, 152, 0, + 157, 158, 141, 142, 159, 139, 140, 0, 195, 187, + 194, 0, 190, 183, 185, 184, 180, 182, 263, 0, + 156, 155, 162, 163, 0, 0, 102, 0, 99, 0, + 0, 0, 55, 70, 64, 44, 0, 0, 228, 0, + 31, 0, 228, 206, 210, 0, 0, 249, 197, 0, + 196, 0, 260, 167, 166, 164, 165, 161, 186, 0, + 97, 98, 101, 228, 221, 0, 0, 63, 228, 51, + 52, 50, 0, 0, 0, 115, 123, 126, 124, 201, + 202, 125, 262, 0, 32, 33, 34, 35, 36, 37, + 38, 39, 40, 41, 42, 43, 29, 28, 171, 146, + 148, 145, 0, 143, 144, 0, 192, 191, 176, 0, + 67, 65, 68, 66, 0, 0, 0, 127, 178, 228, + 114, 258, 149, 147, 153, 154, 228, 222, 228, 0, + 0, 0, 177, 116, 0, 0, 0, 204, 0, 208, + 0, 223, 228, 203, 0, 207, 0, 0, 49, 205, + 209, 0, 0, 179 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int16 yydefgoto[] = { -1, 3, 4, 6, 8, 9, 27, 28, 29, 30, - 31, 32, 33, 34, 35, 36, 37, 38, 265, 373, - 39, 146, 71, 58, 67, 312, 313, 348, 114, 59, - 115, 252, 253, 254, 344, 388, 390, 68, 311, 105, - 263, 194, 97, 40, 41, 116, 189, 306, 248, 304, - 157, 42, 43, 44, 131, 83, 258, 351, 132, 117, - 352, 353, 118, 170, 282, 171, 380, 400, 172, 225, - 173, 401, 174, 298, 283, 274, 175, 301, 334, 176, - 220, 177, 272, 178, 238, 179, 394, 409, 180, 293, - 294, 336, 235, 286, 287, 328, 326, 119, 355, 356, - 413, 120, 357, 415, 121, 268, 270, 358, 122, 136, - 123, 124, 138, 72, 45, 55, 46, 50, 77, 47, - 60, 91, 142, 203, 226, 213, 144, 317, 240, 205, - 360, 296, 48 + 31, 32, 33, 34, 35, 36, 37, 38, 268, 376, + 39, 146, 71, 58, 67, 315, 316, 351, 114, 59, + 115, 255, 256, 257, 347, 391, 393, 68, 314, 105, + 266, 196, 97, 40, 41, 116, 191, 309, 251, 307, + 157, 42, 43, 44, 131, 83, 261, 354, 132, 117, + 355, 356, 118, 171, 285, 172, 383, 403, 173, 228, + 174, 404, 175, 301, 286, 277, 176, 304, 337, 177, + 223, 178, 275, 179, 241, 180, 397, 412, 181, 296, + 297, 339, 238, 289, 290, 331, 329, 182, 119, 358, + 359, 416, 120, 360, 418, 121, 271, 273, 361, 122, + 136, 123, 124, 138, 72, 45, 55, 46, 50, 77, + 47, 60, 91, 142, 205, 229, 215, 144, 320, 243, + 207, 363, 299, 48 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -377 +#define YYPACT_NINF -334 static const yytype_int16 yypact[] = { - 205, -377, -377, 34, -377, -377, 50, -17, -377, 166, - -16, -377, 12, 26, 36, 65, -377, -377, -31, -31, - -31, -31, -31, -31, 72, -67, -31, -377, 108, -377, - -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, - 109, -377, -377, -377, -377, -377, -377, -377, -377, -377, - 118, 28, 106, 107, 54, 118, 78, -377, 110, 101, - -377, 113, 114, 115, 116, 117, -377, 119, 123, -377, - -377, -377, -15, 120, -377, -377, -377, 121, 131, -13, - 168, 214, -34, -377, 121, 27, -377, -377, -377, -377, - 129, -377, -67, -377, -377, -377, -377, -377, -67, -67, - -67, -67, -67, -67, -377, -377, -377, -377, 1, 88, - 84, 0, 130, -67, 66, 132, -377, -377, -377, -377, - -377, -377, -377, -377, -377, -15, 141, -377, -377, -377, - -377, 133, -377, -377, -377, -377, -377, -377, -377, 188, - -377, -377, -25, 219, -377, 136, 137, -15, 138, -377, - 139, -377, -377, 4, -377, -377, 129, -377, 140, 142, - 143, 40, 144, 63, 145, 91, 58, 16, 146, 129, - -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, - 182, 4, -377, 147, -377, -377, 129, 148, 149, -377, - 41, -377, -377, -377, -377, -7, 152, -377, 150, -377, - -377, -377, -377, -377, -377, 151, -67, -67, 159, 167, - -67, -377, -377, -377, -377, 242, 243, 244, -377, -377, - -377, 245, -377, -377, -377, -377, 202, 245, 24, 161, - 248, -377, 163, -377, 129, 22, -377, -377, -377, 250, - 246, -2, 165, -377, 253, -377, 254, 253, -377, -67, - -377, -377, 169, -377, -377, 175, -67, 170, -377, -377, - -377, -377, -377, -377, 171, 173, 174, -377, 176, -377, - 177, -377, 178, -377, 179, -377, 180, -377, -377, -377, - -377, -377, -377, -377, 260, -377, -377, -377, 262, -377, - -377, -377, -377, -377, -377, -377, 181, -377, -377, -377, - -377, 128, 269, -377, 183, -377, 185, 186, 42, -377, - -377, 102, -377, 189, -5, -11, 275, -377, 105, -67, - -377, -377, 247, 45, 91, -377, 190, -377, 191, -377, - -377, -377, -377, -377, -377, -377, 192, -377, -377, -377, - -67, -377, 276, 280, -377, -67, -377, -377, -377, 90, - 84, 46, -377, -377, -377, -377, -377, -377, -377, -377, - 195, -377, -377, -377, -377, -377, -377, -377, -377, -377, - -377, -377, -377, -377, -377, -377, -377, -377, -377, 274, - -377, -377, -4, -377, -377, -377, 47, -377, -377, -377, - -377, 199, 200, 201, -377, 252, -11, -377, -377, -377, - -377, -377, -377, -67, -377, -67, 242, 243, 203, -377, - -377, 193, 206, 209, 208, 210, 216, 269, -377, -67, - -377, 242, -377, 243, 48, -377, -377, -377, 269, 213, - -377 + 134, -334, -334, 41, -334, -334, 47, -49, -334, 169, + 20, -334, 34, 61, 75, 115, -334, -334, -19, -19, + -19, -19, -19, -19, 116, 44, -19, -334, 109, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + 110, -334, -334, -334, -334, -334, -334, -334, -334, -334, + 119, 106, 107, 111, -22, 119, 4, -334, 5, 104, + -334, 113, 114, 117, 118, 120, -334, 121, 124, -334, + -334, -334, -15, 122, -334, -334, -334, 123, 133, -14, + 158, 210, -11, -334, 123, 21, -334, -334, -334, -334, + 127, -334, 44, -334, -334, -334, -334, -334, 44, 44, + 44, 44, 44, 44, -334, -334, -334, -334, 1, 68, + 87, -1, 132, 44, 65, 135, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -15, 141, -334, -334, -334, + -334, 136, -334, -334, -334, -334, -334, -334, -334, 149, + -334, -334, 58, 219, -334, 137, 139, -15, 140, -334, + 142, -334, -334, 74, -334, -334, 127, -334, 143, 144, + 145, 179, 15, 146, 81, 147, 83, 89, 0, 148, + 127, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, 183, -334, 74, -334, 150, -334, -334, 127, 151, + 152, -334, 43, -334, -334, -334, -334, -10, 155, -334, + 138, -334, -334, -334, -334, -334, -334, 154, 44, 44, + 162, 175, 44, -334, -334, -334, -334, 243, 245, 246, + -334, -334, -334, -334, 247, -334, -334, -334, -334, 204, + 247, -4, 163, 250, -334, 165, -334, 127, 27, -334, + -334, -334, 252, 248, 18, 167, -334, 255, -334, 256, + 255, -334, 44, -334, -334, 170, -334, -334, 178, 44, + 168, -334, -334, -334, -334, -334, -334, 174, 176, 177, + -334, 180, -334, 181, -334, 182, -334, 184, -334, 185, + -334, -334, -334, -334, -334, -334, -334, 263, -334, -334, + -334, 264, -334, -334, -334, -334, -334, -334, -334, 186, + -334, -334, -334, -334, 131, 265, -334, 188, -334, 189, + 190, 46, -334, -334, 101, -334, 193, -5, -7, 266, + -334, 108, 44, -334, -334, 236, 14, 83, -334, 192, + -334, 194, -334, -334, -334, -334, -334, -334, -334, 195, + -334, -334, -334, 44, -334, 280, 283, -334, 44, -334, + -334, -334, 78, 87, 49, -334, -334, -334, -334, -334, + -334, -334, -334, 197, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, 276, -334, -334, 6, -334, -334, -334, 51, + -334, -334, -334, -334, 201, 202, 203, -334, 244, -7, + -334, -334, -334, -334, -334, -334, 44, -334, 44, 243, + 245, 205, -334, -334, 198, 207, 206, 212, 211, 217, + 265, -334, 44, -334, 243, -334, 245, -17, -334, -334, + -334, 265, 213, -334 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int16 yypgoto[] = { - -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, - -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, - -377, -94, -88, 124, -377, -377, -333, -377, -100, -377, - -377, -377, -377, -377, -377, -377, -377, 134, -377, -377, - -377, -377, -377, -377, -377, 231, -377, -377, -377, 77, - -377, -377, -377, -377, -377, -377, -377, -377, -377, -377, - -71, -377, -81, -377, -377, -377, -377, -377, -377, -377, - -377, -377, -377, -377, -304, 99, -377, -377, -377, -377, - -377, -377, -377, -377, -377, -377, -377, -377, -23, -377, - -377, -286, -377, -377, -377, -377, -377, 249, -377, -377, - -377, -377, -377, -377, -377, -376, -368, 251, -377, -377, - -377, -80, -110, -82, -377, -377, -377, -377, 273, -377, - 255, -377, -377, -377, -160, 153, -146, -377, -377, -377, - -377, -377, -377 + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -334, -94, -88, 126, -334, -334, -333, -334, -91, -334, + -334, -334, -334, -334, -334, -334, -334, 128, -334, -334, + -334, -334, -334, -334, -334, 249, -334, -334, -334, 73, + -334, -334, -334, -334, -334, -334, -334, -334, -334, -334, + -72, -334, -81, -334, -334, -334, -334, -334, -334, -334, + -334, -334, -334, -334, -307, 99, -334, -334, -334, -334, + -334, -334, -334, -334, -334, -334, -334, -334, -23, -334, + -334, -303, -334, -334, -334, -334, -334, -334, 251, -334, + -334, -334, -334, -334, -334, -334, -327, -316, 253, -334, + -334, -334, -80, -110, -82, -334, -334, -334, -334, 277, + -334, 254, -334, -334, -334, -161, 153, -146, -334, -334, + -334, -334, -334, -334 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -1082,78 +1084,80 @@ static const yytype_int16 yypgoto[] = #define YYTABLE_NINF -60 static const yytype_int16 yytable[] = { - 139, 133, 137, 190, 145, 228, 149, 106, 107, 152, - 214, 148, 391, 150, 151, 251, 147, 346, 147, 381, - 277, 147, 108, 241, 108, 196, 278, 109, 181, 153, - 414, 139, 299, 56, 5, 201, 182, 154, 110, 416, - 245, 236, 202, 69, 70, 426, 109, 208, 277, 183, - 349, 300, 184, 140, 278, 427, 279, 110, 7, 185, - 155, 350, 290, 291, 211, 141, 281, 57, 218, 277, - 376, 212, 412, 186, 156, 278, 69, 70, 402, 113, - 111, 10, 111, 112, 377, 237, 425, 222, 289, 223, - 49, 66, 280, 347, 281, 219, 187, 188, 113, 69, - 70, 224, 113, 292, 378, 229, 85, 86, 230, 231, - 51, 160, 232, 261, 87, 281, 379, 223, 260, 161, - 233, 158, 266, 392, 52, 147, 162, 163, 164, 224, - 165, 424, 166, 159, 53, 393, 88, 89, 234, 308, - 78, 167, 429, 61, 62, 63, 64, 65, 249, 340, - 73, 90, 428, 396, 403, 250, 341, 385, 168, 169, - 397, 404, 81, 54, 382, 191, 82, 139, 192, 193, - 66, 11, 12, 13, 314, 14, 15, 16, 17, 18, - 19, 20, 21, 22, 23, 24, 25, 26, 361, 362, - 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, - 93, 94, 95, 96, 330, 331, 332, 333, 1, 2, - 199, 200, 342, 343, 74, 75, 76, 92, 79, 80, - 98, 99, 100, 101, 102, 104, 103, 125, 126, 127, - 386, 374, 56, 139, 354, 137, 130, 143, -59, 197, - 195, 204, 198, 206, 207, 209, 210, 242, 215, 264, - 216, 217, 221, 227, 239, 244, 246, 247, 139, 256, - 259, 262, 257, 314, 267, 269, 271, 273, 275, 284, - 285, 288, 295, 302, 297, 303, 305, 310, 309, 316, - 318, 319, 325, 315, 327, 320, 321, 322, 323, 324, - 329, 335, 337, 411, 338, 339, 345, 359, 387, 383, - 384, 385, 389, 375, 398, 399, 405, 418, 406, 407, - 128, 417, 421, 419, 139, 354, 137, 408, 420, 422, - 423, 139, 430, 314, 307, 410, 276, 395, 84, 255, - 0, 134, 0, 135, 243, 129, 0, 314 + 139, 133, 137, 192, 145, 231, 149, 106, 107, 152, + 216, 148, 254, 150, 151, 394, 147, 349, 147, 384, + 280, 147, 108, 108, 244, 239, 281, 183, 282, 153, + 280, 139, 85, 86, 198, 184, 281, 154, 280, 379, + 87, 5, 248, 221, 281, 56, 109, 140, 185, 10, + 109, 186, 302, 380, 352, 7, 210, 110, 187, 141, + 155, 110, 88, 89, 283, 353, 284, 293, 294, 240, + 222, 303, 188, 381, 156, 415, 284, 90, 405, 57, + 111, 111, 417, 112, 284, 382, 81, 431, 66, 428, + 82, 292, 388, 350, 419, 189, 190, 429, 113, 69, + 70, 158, 113, 69, 70, 225, 113, 226, 295, 226, + 430, 395, 92, 159, 160, 264, 161, 427, 203, 227, + 263, 227, 162, 396, 269, 204, 49, 147, 432, 163, + 164, 165, 51, 166, 213, 167, 232, 1, 2, 233, + 234, 214, 311, 235, 168, 61, 62, 63, 64, 65, + 252, 236, 73, 343, 69, 70, 399, 253, 406, 52, + 344, 169, 170, 400, 193, 407, 385, 194, 195, 237, + 139, 201, 202, 53, 11, 12, 13, 317, 14, 15, + 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, + 26, 364, 365, 366, 367, 368, 369, 370, 371, 372, + 373, 374, 375, 93, 94, 95, 96, 333, 334, 335, + 336, 345, 346, 54, 66, 74, 75, 76, 78, 79, + 98, 99, 56, 80, 100, 101, 104, 102, 103, 125, + 126, 127, 130, 389, 377, 143, 139, 357, 137, 199, + -59, 206, 220, 197, 208, 200, 209, 211, 245, 212, + 260, 217, 218, 219, 224, 230, 242, 267, 247, 249, + 250, 139, 259, 262, 265, 270, 317, 272, 274, 276, + 278, 287, 288, 291, 298, 305, 300, 306, 308, 312, + 313, 318, 319, 321, 322, 328, 330, 338, 362, 323, + 324, 325, 378, 326, 327, 332, 414, 340, 341, 342, + 348, 386, 390, 387, 388, 392, 401, 402, 408, 411, + 409, 410, 421, 420, 422, 423, 424, 139, 357, 137, + 425, 426, 433, 310, 139, 258, 317, 413, 128, 279, + 398, 0, 84, 134, 129, 135, 246, 0, 0, 0, + 317 }; static const yytype_int16 yycheck[] = { - 82, 82, 82, 113, 92, 165, 100, 22, 23, 103, - 156, 99, 345, 101, 102, 22, 98, 22, 100, 323, - 24, 103, 37, 169, 37, 125, 30, 61, 28, 28, - 406, 113, 34, 64, 0, 60, 36, 36, 72, 407, - 186, 25, 67, 110, 111, 421, 61, 147, 24, 49, - 61, 53, 52, 26, 30, 423, 32, 72, 8, 59, - 59, 72, 40, 41, 60, 38, 70, 98, 28, 24, - 25, 67, 405, 73, 73, 30, 110, 111, 382, 113, - 95, 98, 95, 98, 39, 69, 419, 24, 234, 26, - 106, 98, 68, 98, 70, 55, 96, 97, 113, 110, - 111, 38, 113, 81, 59, 47, 28, 29, 50, 51, - 98, 27, 54, 207, 36, 70, 71, 26, 206, 35, - 62, 33, 210, 33, 98, 207, 42, 43, 44, 38, - 46, 417, 48, 45, 98, 45, 58, 59, 80, 249, - 112, 57, 428, 19, 20, 21, 22, 23, 107, 107, - 26, 73, 104, 107, 107, 114, 114, 109, 74, 75, - 114, 114, 108, 98, 324, 99, 112, 249, 102, 103, - 98, 5, 6, 7, 256, 9, 10, 11, 12, 13, - 14, 15, 16, 17, 18, 19, 20, 21, 83, 84, - 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, - 99, 100, 101, 102, 76, 77, 78, 79, 3, 4, - 22, 23, 110, 111, 106, 106, 98, 107, 112, 112, - 107, 107, 107, 107, 107, 102, 107, 107, 107, 98, - 340, 319, 64, 315, 315, 315, 22, 108, 108, 98, - 108, 22, 109, 107, 107, 107, 107, 65, 108, 82, - 108, 108, 108, 108, 108, 108, 108, 108, 340, 107, - 109, 102, 112, 345, 22, 22, 22, 22, 66, 108, - 22, 108, 22, 108, 28, 22, 22, 102, 109, 108, - 107, 107, 22, 113, 22, 109, 109, 109, 109, 109, - 109, 22, 109, 403, 109, 109, 107, 22, 22, 109, - 109, 109, 22, 56, 109, 31, 107, 114, 108, 108, - 79, 108, 104, 107, 396, 396, 396, 65, 109, 109, - 104, 403, 109, 405, 247, 396, 227, 350, 55, 195, - -1, 82, -1, 82, 181, 80, -1, 419 + 82, 82, 82, 113, 92, 166, 100, 22, 23, 103, + 156, 99, 22, 101, 102, 348, 98, 22, 100, 326, + 24, 103, 37, 37, 170, 25, 30, 28, 32, 28, + 24, 113, 28, 29, 125, 36, 30, 36, 24, 25, + 36, 0, 188, 28, 30, 64, 61, 26, 49, 98, + 61, 52, 34, 39, 61, 8, 147, 72, 59, 38, + 59, 72, 58, 59, 68, 72, 70, 40, 41, 69, + 55, 53, 73, 59, 73, 408, 70, 73, 385, 98, + 95, 95, 409, 98, 70, 71, 108, 104, 98, 422, + 112, 237, 109, 98, 410, 96, 97, 424, 113, 110, + 111, 33, 113, 110, 111, 24, 113, 26, 81, 26, + 426, 33, 107, 45, 27, 209, 29, 420, 60, 38, + 208, 38, 35, 45, 212, 67, 106, 209, 431, 42, + 43, 44, 98, 46, 60, 48, 47, 3, 4, 50, + 51, 67, 252, 54, 57, 19, 20, 21, 22, 23, + 107, 62, 26, 107, 110, 111, 107, 114, 107, 98, + 114, 74, 75, 114, 99, 114, 327, 102, 103, 80, + 252, 22, 23, 98, 5, 6, 7, 259, 9, 10, + 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, + 21, 83, 84, 85, 86, 87, 88, 89, 90, 91, + 92, 93, 94, 99, 100, 101, 102, 76, 77, 78, + 79, 110, 111, 98, 98, 106, 106, 98, 112, 112, + 107, 107, 64, 112, 107, 107, 102, 107, 107, 107, + 107, 98, 22, 343, 322, 108, 318, 318, 318, 98, + 108, 22, 63, 108, 107, 109, 107, 107, 65, 107, + 112, 108, 108, 108, 108, 108, 108, 82, 108, 108, + 108, 343, 107, 109, 102, 22, 348, 22, 22, 22, + 66, 108, 22, 108, 22, 108, 28, 22, 22, 109, + 102, 113, 108, 107, 107, 22, 22, 22, 22, 109, + 109, 109, 56, 109, 109, 109, 406, 109, 109, 109, + 107, 109, 22, 109, 109, 22, 109, 31, 107, 65, + 108, 108, 114, 108, 107, 109, 104, 399, 399, 399, + 109, 104, 109, 250, 406, 197, 408, 399, 79, 230, + 353, -1, 55, 82, 80, 82, 183, -1, -1, -1, + 422 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing @@ -1164,46 +1168,46 @@ static const yytype_uint8 yystos[] = 98, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 135, - 158, 159, 166, 167, 168, 229, 231, 234, 247, 106, - 232, 98, 98, 98, 98, 230, 64, 98, 138, 144, - 235, 138, 138, 138, 138, 138, 98, 139, 152, 110, - 111, 137, 228, 138, 106, 106, 98, 233, 112, 112, - 112, 108, 112, 170, 233, 28, 29, 36, 58, 59, - 73, 236, 107, 99, 100, 101, 102, 157, 107, 107, + 158, 159, 166, 167, 168, 230, 232, 235, 248, 106, + 233, 98, 98, 98, 98, 231, 64, 98, 138, 144, + 236, 138, 138, 138, 138, 138, 98, 139, 152, 110, + 111, 137, 229, 138, 106, 106, 98, 234, 112, 112, + 112, 108, 112, 170, 234, 28, 29, 36, 58, 59, + 73, 237, 107, 99, 100, 101, 102, 157, 107, 107, 107, 107, 107, 107, 102, 154, 22, 23, 37, 61, - 72, 95, 98, 113, 143, 145, 160, 174, 177, 212, - 216, 219, 223, 225, 226, 107, 107, 98, 160, 235, - 22, 169, 173, 177, 212, 222, 224, 226, 227, 228, - 26, 38, 237, 108, 241, 137, 136, 228, 137, 136, + 72, 95, 98, 113, 143, 145, 160, 174, 177, 213, + 217, 220, 224, 226, 227, 107, 107, 98, 160, 236, + 22, 169, 173, 177, 213, 223, 225, 227, 228, 229, + 26, 38, 238, 108, 242, 137, 136, 229, 137, 136, 137, 137, 136, 28, 36, 59, 73, 165, 33, 45, - 27, 35, 42, 43, 44, 46, 48, 57, 74, 75, - 178, 180, 183, 185, 187, 191, 194, 196, 198, 200, - 203, 28, 36, 49, 52, 59, 73, 96, 97, 161, - 227, 99, 102, 103, 156, 108, 143, 98, 109, 22, - 23, 60, 67, 238, 22, 244, 107, 107, 143, 107, - 107, 60, 67, 240, 241, 108, 108, 108, 28, 55, - 195, 108, 24, 26, 38, 184, 239, 108, 239, 47, - 50, 51, 54, 62, 80, 207, 25, 69, 199, 108, - 243, 241, 65, 240, 108, 241, 108, 108, 163, 107, - 114, 22, 146, 147, 148, 152, 107, 112, 171, 109, - 137, 136, 102, 155, 82, 133, 137, 22, 220, 22, - 221, 22, 197, 22, 190, 66, 190, 24, 30, 32, - 68, 70, 179, 189, 108, 22, 208, 209, 108, 241, - 40, 41, 81, 204, 205, 22, 246, 28, 188, 34, - 53, 192, 108, 22, 164, 22, 162, 164, 227, 109, - 102, 153, 140, 141, 228, 113, 108, 242, 107, 107, - 109, 109, 109, 109, 109, 22, 211, 22, 210, 109, - 76, 77, 78, 79, 193, 22, 206, 109, 109, 109, - 107, 114, 110, 111, 149, 107, 22, 98, 142, 61, - 72, 172, 175, 176, 177, 213, 214, 217, 222, 22, - 245, 83, 84, 85, 86, 87, 88, 89, 90, 91, - 92, 93, 94, 134, 137, 56, 25, 39, 59, 71, - 181, 189, 239, 109, 109, 109, 227, 22, 150, 22, - 151, 141, 33, 45, 201, 203, 107, 114, 109, 31, - 182, 186, 189, 107, 114, 107, 108, 108, 65, 202, - 175, 227, 141, 215, 220, 218, 221, 108, 114, 107, - 109, 104, 109, 104, 206, 141, 220, 221, 104, 206, - 109 + 27, 29, 35, 42, 43, 44, 46, 48, 57, 74, + 75, 178, 180, 183, 185, 187, 191, 194, 196, 198, + 200, 203, 212, 28, 36, 49, 52, 59, 73, 96, + 97, 161, 228, 99, 102, 103, 156, 108, 143, 98, + 109, 22, 23, 60, 67, 239, 22, 245, 107, 107, + 143, 107, 107, 60, 67, 241, 242, 108, 108, 108, + 63, 28, 55, 195, 108, 24, 26, 38, 184, 240, + 108, 240, 47, 50, 51, 54, 62, 80, 207, 25, + 69, 199, 108, 244, 242, 65, 241, 108, 242, 108, + 108, 163, 107, 114, 22, 146, 147, 148, 152, 107, + 112, 171, 109, 137, 136, 102, 155, 82, 133, 137, + 22, 221, 22, 222, 22, 197, 22, 190, 66, 190, + 24, 30, 32, 68, 70, 179, 189, 108, 22, 208, + 209, 108, 242, 40, 41, 81, 204, 205, 22, 247, + 28, 188, 34, 53, 192, 108, 22, 164, 22, 162, + 164, 228, 109, 102, 153, 140, 141, 229, 113, 108, + 243, 107, 107, 109, 109, 109, 109, 109, 22, 211, + 22, 210, 109, 76, 77, 78, 79, 193, 22, 206, + 109, 109, 109, 107, 114, 110, 111, 149, 107, 22, + 98, 142, 61, 72, 172, 175, 176, 177, 214, 215, + 218, 223, 22, 246, 83, 84, 85, 86, 87, 88, + 89, 90, 91, 92, 93, 94, 134, 137, 56, 25, + 39, 59, 71, 181, 189, 240, 109, 109, 109, 228, + 22, 150, 22, 151, 141, 33, 45, 201, 203, 107, + 114, 109, 31, 182, 186, 189, 107, 114, 107, 108, + 108, 65, 202, 175, 228, 141, 216, 221, 219, 222, + 108, 114, 107, 109, 104, 109, 104, 206, 141, 221, + 222, 104, 206, 109 }; #define yyerrok (yyerrstatus = 0) @@ -3269,7 +3273,14 @@ yyreduce: case 138: /* Line 1455 of yacc.c */ -#line 1089 "program_parse.y" +#line 1086 "program_parse.y" + { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} + break; + + case 139: + +/* Line 1455 of yacc.c */ +#line 1090 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3278,37 +3289,37 @@ yyreduce: ;} break; - case 139: + case 140: /* Line 1455 of yacc.c */ -#line 1098 "program_parse.y" +#line 1099 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 140: + case 141: /* Line 1455 of yacc.c */ -#line 1102 "program_parse.y" +#line 1103 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} break; - case 141: + case 142: /* Line 1455 of yacc.c */ -#line 1106 "program_parse.y" +#line 1107 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} break; - case 142: + case 143: /* Line 1455 of yacc.c */ -#line 1112 "program_parse.y" +#line 1113 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3317,28 +3328,28 @@ yyreduce: ;} break; - case 143: + case 144: /* Line 1455 of yacc.c */ -#line 1121 "program_parse.y" +#line 1122 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 144: + case 145: /* Line 1455 of yacc.c */ -#line 1125 "program_parse.y" +#line 1126 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} break; - case 145: + case 146: /* Line 1455 of yacc.c */ -#line 1129 "program_parse.y" +#line 1130 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3349,57 +3360,57 @@ yyreduce: ;} break; - case 146: + case 147: /* Line 1455 of yacc.c */ -#line 1138 "program_parse.y" +#line 1139 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; - case 147: + case 148: /* Line 1455 of yacc.c */ -#line 1142 "program_parse.y" +#line 1143 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} break; - case 148: + case 149: /* Line 1455 of yacc.c */ -#line 1148 "program_parse.y" +#line 1149 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} break; - case 149: + case 150: /* Line 1455 of yacc.c */ -#line 1154 "program_parse.y" +#line 1155 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; ;} break; - case 150: + case 151: /* Line 1455 of yacc.c */ -#line 1161 "program_parse.y" +#line 1162 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; ;} break; - case 151: + case 152: /* Line 1455 of yacc.c */ -#line 1166 "program_parse.y" +#line 1167 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3407,10 +3418,10 @@ yyreduce: ;} break; - case 152: + case 153: /* Line 1455 of yacc.c */ -#line 1174 "program_parse.y" +#line 1175 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3420,10 +3431,10 @@ yyreduce: ;} break; - case 154: + case 155: /* Line 1455 of yacc.c */ -#line 1186 "program_parse.y" +#line 1187 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3431,46 +3442,46 @@ yyreduce: ;} break; - case 155: + case 156: /* Line 1455 of yacc.c */ -#line 1194 "program_parse.y" +#line 1195 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} break; - case 156: + case 157: /* Line 1455 of yacc.c */ -#line 1200 "program_parse.y" +#line 1201 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} break; - case 157: + case 158: /* Line 1455 of yacc.c */ -#line 1204 "program_parse.y" +#line 1205 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} break; - case 158: + case 159: /* Line 1455 of yacc.c */ -#line 1208 "program_parse.y" +#line 1209 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} break; - case 159: + case 160: /* Line 1455 of yacc.c */ -#line 1214 "program_parse.y" +#line 1215 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3481,10 +3492,10 @@ yyreduce: ;} break; - case 160: + case 161: /* Line 1455 of yacc.c */ -#line 1225 "program_parse.y" +#line 1226 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3493,92 +3504,92 @@ yyreduce: ;} break; - case 161: + case 162: /* Line 1455 of yacc.c */ -#line 1234 "program_parse.y" +#line 1235 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} break; - case 162: + case 163: /* Line 1455 of yacc.c */ -#line 1238 "program_parse.y" +#line 1239 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} break; - case 163: + case 164: /* Line 1455 of yacc.c */ -#line 1243 "program_parse.y" +#line 1244 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} break; - case 164: + case 165: /* Line 1455 of yacc.c */ -#line 1247 "program_parse.y" +#line 1248 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} break; - case 165: + case 166: /* Line 1455 of yacc.c */ -#line 1251 "program_parse.y" +#line 1252 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} break; - case 166: + case 167: /* Line 1455 of yacc.c */ -#line 1255 "program_parse.y" +#line 1256 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} break; - case 167: + case 168: /* Line 1455 of yacc.c */ -#line 1261 "program_parse.y" +#line 1262 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 168: + case 169: /* Line 1455 of yacc.c */ -#line 1268 "program_parse.y" +#line 1269 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} break; - case 169: + case 170: /* Line 1455 of yacc.c */ -#line 1272 "program_parse.y" +#line 1273 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} break; - case 170: + case 171: /* Line 1455 of yacc.c */ -#line 1278 "program_parse.y" +#line 1279 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3586,10 +3597,10 @@ yyreduce: ;} break; - case 171: + case 172: /* Line 1455 of yacc.c */ -#line 1286 "program_parse.y" +#line 1287 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3600,38 +3611,38 @@ yyreduce: ;} break; - case 172: + case 173: /* Line 1455 of yacc.c */ -#line 1297 "program_parse.y" +#line 1298 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); ;} break; - case 173: + case 174: /* Line 1455 of yacc.c */ -#line 1304 "program_parse.y" +#line 1305 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} break; - case 174: + case 175: /* Line 1455 of yacc.c */ -#line 1308 "program_parse.y" +#line 1309 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} break; - case 175: + case 176: /* Line 1455 of yacc.c */ -#line 1314 "program_parse.y" +#line 1315 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3641,10 +3652,10 @@ yyreduce: ;} break; - case 176: + case 177: /* Line 1455 of yacc.c */ -#line 1324 "program_parse.y" +#line 1325 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3654,20 +3665,20 @@ yyreduce: ;} break; - case 177: + case 178: /* Line 1455 of yacc.c */ -#line 1334 "program_parse.y" +#line 1335 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; ;} break; - case 178: + case 179: /* Line 1455 of yacc.c */ -#line 1339 "program_parse.y" +#line 1340 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3685,10 +3696,10 @@ yyreduce: ;} break; - case 179: + case 180: /* Line 1455 of yacc.c */ -#line 1357 "program_parse.y" +#line 1358 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3696,55 +3707,55 @@ yyreduce: ;} break; - case 180: + case 181: /* Line 1455 of yacc.c */ -#line 1365 "program_parse.y" +#line 1366 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 181: + case 182: /* Line 1455 of yacc.c */ -#line 1369 "program_parse.y" +#line 1370 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 182: + case 183: /* Line 1455 of yacc.c */ -#line 1375 "program_parse.y" +#line 1376 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} break; - case 183: + case 184: /* Line 1455 of yacc.c */ -#line 1379 "program_parse.y" +#line 1380 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} break; - case 184: + case 185: /* Line 1455 of yacc.c */ -#line 1383 "program_parse.y" +#line 1384 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} break; - case 185: + case 186: /* Line 1455 of yacc.c */ -#line 1389 "program_parse.y" +#line 1390 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3755,88 +3766,88 @@ yyreduce: ;} break; - case 186: + case 187: /* Line 1455 of yacc.c */ -#line 1400 "program_parse.y" +#line 1401 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 187: + case 188: /* Line 1455 of yacc.c */ -#line 1405 "program_parse.y" +#line 1406 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; ;} break; - case 188: + case 189: /* Line 1455 of yacc.c */ -#line 1410 "program_parse.y" +#line 1411 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; ;} break; - case 189: + case 190: /* Line 1455 of yacc.c */ -#line 1415 "program_parse.y" +#line 1416 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); ;} break; - case 190: + case 191: /* Line 1455 of yacc.c */ -#line 1420 "program_parse.y" +#line 1421 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; ;} break; - case 191: + case 192: /* Line 1455 of yacc.c */ -#line 1425 "program_parse.y" +#line 1426 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); ;} break; - case 192: + case 193: /* Line 1455 of yacc.c */ -#line 1432 "program_parse.y" +#line 1433 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 193: + case 194: /* Line 1455 of yacc.c */ -#line 1436 "program_parse.y" +#line 1437 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 194: + case 195: /* Line 1455 of yacc.c */ -#line 1441 "program_parse.y" +#line 1442 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3850,10 +3861,10 @@ yyreduce: ;} break; - case 195: + case 196: /* Line 1455 of yacc.c */ -#line 1454 "program_parse.y" +#line 1455 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3862,10 +3873,10 @@ yyreduce: ;} break; - case 196: + case 197: /* Line 1455 of yacc.c */ -#line 1462 "program_parse.y" +#line 1463 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3876,10 +3887,20 @@ yyreduce: ;} break; - case 201: + case 198: /* Line 1455 of yacc.c */ -#line 1479 "program_parse.y" +#line 1474 "program_parse.y" + { + memset((yyval.state), 0, sizeof((yyval.state))); + (yyval.state)[0] = STATE_DEPTH_RANGE; + ;} + break; + + case 203: + +/* Line 1455 of yacc.c */ +#line 1486 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3889,30 +3910,30 @@ yyreduce: ;} break; - case 202: + case 204: /* Line 1455 of yacc.c */ -#line 1489 "program_parse.y" +#line 1496 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 203: + case 205: /* Line 1455 of yacc.c */ -#line 1494 "program_parse.y" +#line 1501 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 204: + case 206: /* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" +#line 1508 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3922,10 +3943,10 @@ yyreduce: ;} break; - case 205: + case 207: /* Line 1455 of yacc.c */ -#line 1511 "program_parse.y" +#line 1518 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3935,30 +3956,30 @@ yyreduce: ;} break; - case 206: + case 208: /* Line 1455 of yacc.c */ -#line 1520 "program_parse.y" +#line 1527 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); ;} break; - case 207: + case 209: /* Line 1455 of yacc.c */ -#line 1525 "program_parse.y" +#line 1532 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); ;} break; - case 208: + case 210: /* Line 1455 of yacc.c */ -#line 1532 "program_parse.y" +#line 1539 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3968,10 +3989,10 @@ yyreduce: ;} break; - case 209: + case 211: /* Line 1455 of yacc.c */ -#line 1542 "program_parse.y" +#line 1549 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -3981,10 +4002,10 @@ yyreduce: ;} break; - case 210: + case 212: /* Line 1455 of yacc.c */ -#line 1552 "program_parse.y" +#line 1559 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -3994,40 +4015,40 @@ yyreduce: ;} break; - case 215: + case 217: /* Line 1455 of yacc.c */ -#line 1567 "program_parse.y" +#line 1574 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); ;} break; - case 216: + case 218: /* Line 1455 of yacc.c */ -#line 1574 "program_parse.y" +#line 1581 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); ;} break; - case 217: + case 219: /* Line 1455 of yacc.c */ -#line 1579 "program_parse.y" +#line 1586 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); ;} break; - case 218: + case 220: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1593 "program_parse.y" { (yyval.vector).count = 1; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4037,10 +4058,10 @@ yyreduce: ;} break; - case 219: + case 221: /* Line 1455 of yacc.c */ -#line 1594 "program_parse.y" +#line 1601 "program_parse.y" { (yyval.vector).count = 2; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4050,10 +4071,10 @@ yyreduce: ;} break; - case 220: + case 222: /* Line 1455 of yacc.c */ -#line 1603 "program_parse.y" +#line 1610 "program_parse.y" { (yyval.vector).count = 3; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4063,10 +4084,10 @@ yyreduce: ;} break; - case 221: + case 223: /* Line 1455 of yacc.c */ -#line 1612 "program_parse.y" +#line 1619 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4076,63 +4097,63 @@ yyreduce: ;} break; - case 222: + case 224: /* Line 1455 of yacc.c */ -#line 1622 "program_parse.y" +#line 1629 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} break; - case 223: + case 225: /* Line 1455 of yacc.c */ -#line 1626 "program_parse.y" +#line 1633 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} break; - case 224: + case 226: /* Line 1455 of yacc.c */ -#line 1631 "program_parse.y" +#line 1638 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 225: + case 227: /* Line 1455 of yacc.c */ -#line 1632 "program_parse.y" +#line 1639 "program_parse.y" { (yyval.negate) = TRUE; ;} break; - case 226: + case 228: /* Line 1455 of yacc.c */ -#line 1633 "program_parse.y" +#line 1640 "program_parse.y" { (yyval.negate) = FALSE; ;} break; - case 227: + case 229: /* Line 1455 of yacc.c */ -#line 1636 "program_parse.y" +#line 1643 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 229: + case 231: /* Line 1455 of yacc.c */ -#line 1639 "program_parse.y" +#line 1646 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; - case 231: + case 233: /* Line 1455 of yacc.c */ -#line 1643 "program_parse.y" +#line 1650 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4140,10 +4161,10 @@ yyreduce: ;} break; - case 232: + case 234: /* Line 1455 of yacc.c */ -#line 1649 "program_parse.y" +#line 1656 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4151,10 +4172,10 @@ yyreduce: ;} break; - case 233: + case 235: /* Line 1455 of yacc.c */ -#line 1657 "program_parse.y" +#line 1664 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4167,10 +4188,10 @@ yyreduce: ;} break; - case 234: + case 236: /* Line 1455 of yacc.c */ -#line 1670 "program_parse.y" +#line 1677 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4181,10 +4202,10 @@ yyreduce: ;} break; - case 235: + case 237: /* Line 1455 of yacc.c */ -#line 1679 "program_parse.y" +#line 1686 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4195,19 +4216,19 @@ yyreduce: ;} break; - case 236: + case 238: /* Line 1455 of yacc.c */ -#line 1688 "program_parse.y" +#line 1695 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} break; - case 237: + case 239: /* Line 1455 of yacc.c */ -#line 1692 "program_parse.y" +#line 1699 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4218,10 +4239,10 @@ yyreduce: ;} break; - case 238: + case 240: /* Line 1455 of yacc.c */ -#line 1701 "program_parse.y" +#line 1708 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4232,10 +4253,10 @@ yyreduce: ;} break; - case 239: + case 241: /* Line 1455 of yacc.c */ -#line 1710 "program_parse.y" +#line 1717 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4246,19 +4267,19 @@ yyreduce: ;} break; - case 240: + case 242: /* Line 1455 of yacc.c */ -#line 1721 "program_parse.y" +#line 1728 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} break; - case 241: + case 243: /* Line 1455 of yacc.c */ -#line 1727 "program_parse.y" +#line 1734 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4266,10 +4287,10 @@ yyreduce: ;} break; - case 242: + case 244: /* Line 1455 of yacc.c */ -#line 1733 "program_parse.y" +#line 1740 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4280,10 +4301,10 @@ yyreduce: ;} break; - case 243: + case 245: /* Line 1455 of yacc.c */ -#line 1742 "program_parse.y" +#line 1749 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4294,19 +4315,19 @@ yyreduce: ;} break; - case 244: + case 246: /* Line 1455 of yacc.c */ -#line 1753 "program_parse.y" +#line 1760 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 245: + case 247: /* Line 1455 of yacc.c */ -#line 1757 "program_parse.y" +#line 1764 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4317,10 +4338,10 @@ yyreduce: ;} break; - case 246: + case 248: /* Line 1455 of yacc.c */ -#line 1766 "program_parse.y" +#line 1773 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4331,94 +4352,94 @@ yyreduce: ;} break; - case 247: + case 249: /* Line 1455 of yacc.c */ -#line 1776 "program_parse.y" +#line 1783 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 248: + case 250: /* Line 1455 of yacc.c */ -#line 1777 "program_parse.y" +#line 1784 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 249: + case 251: /* Line 1455 of yacc.c */ -#line 1778 "program_parse.y" +#line 1785 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 250: + case 252: /* Line 1455 of yacc.c */ -#line 1781 "program_parse.y" +#line 1788 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 251: + case 253: /* Line 1455 of yacc.c */ -#line 1782 "program_parse.y" +#line 1789 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 252: + case 254: /* Line 1455 of yacc.c */ -#line 1783 "program_parse.y" +#line 1790 "program_parse.y" { (yyval.integer) = 1; ;} break; - case 253: + case 255: /* Line 1455 of yacc.c */ -#line 1786 "program_parse.y" +#line 1793 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 254: + case 256: /* Line 1455 of yacc.c */ -#line 1787 "program_parse.y" +#line 1794 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 255: + case 257: /* Line 1455 of yacc.c */ -#line 1790 "program_parse.y" +#line 1797 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 256: + case 258: /* Line 1455 of yacc.c */ -#line 1791 "program_parse.y" +#line 1798 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 257: + case 259: /* Line 1455 of yacc.c */ -#line 1794 "program_parse.y" +#line 1801 "program_parse.y" { (yyval.integer) = 0; ;} break; - case 258: + case 260: /* Line 1455 of yacc.c */ -#line 1795 "program_parse.y" +#line 1802 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; - case 259: + case 261: /* Line 1455 of yacc.c */ -#line 1799 "program_parse.y" +#line 1806 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4429,10 +4450,10 @@ yyreduce: ;} break; - case 260: + case 262: /* Line 1455 of yacc.c */ -#line 1810 "program_parse.y" +#line 1817 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4443,10 +4464,10 @@ yyreduce: ;} break; - case 261: + case 263: /* Line 1455 of yacc.c */ -#line 1821 "program_parse.y" +#line 1828 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4457,10 +4478,10 @@ yyreduce: ;} break; - case 262: + case 264: /* Line 1455 of yacc.c */ -#line 1832 "program_parse.y" +#line 1839 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4484,7 +4505,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4488 "program_parse.tab.c" +#line 4509 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4703,7 +4724,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1852 "program_parse.y" +#line 1859 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 251cf7d309..91a4036cbb 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -205,7 +205,7 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type stateLightItem stateLightModelItem stateLightProdItem %type stateTexGenItem stateFogItem stateClipPlaneItem statePointItem %type stateMatrixItem stateMatrixRow stateMatrixRows -%type stateTexEnvItem +%type stateTexEnvItem stateDepthItem %type stateLModProperty %type stateMatrixName optMatrixRows @@ -1083,6 +1083,7 @@ stateSingleItem: STATE stateMaterialItem { memcpy($$, $2, sizeof($$)); } | STATE stateClipPlaneItem { memcpy($$, $2, sizeof($$)); } | STATE statePointItem { memcpy($$, $2, sizeof($$)); } | STATE stateMatrixRow { memcpy($$, $2, sizeof($$)); } + | STATE stateDepthItem { memcpy($$, $2, sizeof($$)); } ; stateMaterialItem: MATERIAL optFaceType stateMatProperty @@ -1469,6 +1470,12 @@ stateProgramMatNum: INTEGER } ; +stateDepthItem: DEPTH RANGE + { + memset($$, 0, sizeof($$)); + $$[0] = STATE_DEPTH_RANGE; + } + ; programSingleItem: progEnvParam | progLocalParam; -- cgit v1.2.3 From cbe4133109c95fa6b90d8a601c78f043db456809 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 29 Jul 2009 20:42:28 -0700 Subject: ARB prog lexer: attenuation is not just for vp --- src/mesa/shader/lex.yy.c | 2 +- src/mesa/shader/program_lexer.l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/lex.yy.c b/src/mesa/shader/lex.yy.c index 6202ca44c8..0ff4baca5e 100644 --- a/src/mesa/shader/lex.yy.c +++ b/src/mesa/shader/lex.yy.c @@ -1769,7 +1769,7 @@ YY_RULE_SETUP case 85: YY_RULE_SETUP #line 239 "program_lexer.l" -{ return_token_or_DOT(require_ARB_vp, ATTENUATION); } +{ return ATTENUATION; } YY_BREAK case 86: YY_RULE_SETUP diff --git a/src/mesa/shader/program_lexer.l b/src/mesa/shader/program_lexer.l index e1069ab4d7..05978311ec 100644 --- a/src/mesa/shader/program_lexer.l +++ b/src/mesa/shader/program_lexer.l @@ -236,7 +236,7 @@ state { return STATE; } result { return RESULT; } {dot}ambient { return AMBIENT; } -{dot}attenuation { return_token_or_DOT(require_ARB_vp, ATTENUATION); } +{dot}attenuation { return ATTENUATION; } {dot}back { return BACK; } {dot}clip { return_token_or_DOT(require_ARB_vp, CLIP); } {dot}color { return COLOR; } -- cgit v1.2.3 From 48183ca8b6adfbb9555428cb8414b821fdd15717 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 29 Jul 2009 20:51:38 -0700 Subject: ARB prog parser: Get program limits from the context Some debug code from the older stand-alone version of the assembler was hanging around and needed to go. --- src/mesa/shader/program_parse.tab.c | 27 +++------------------------ src/mesa/shader/program_parse.y | 27 +++------------------------ 2 files changed, 6 insertions(+), 48 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index ae35bd3fef..6c3c239cfa 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -5051,7 +5051,6 @@ GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state) { - struct gl_program_constants limits; struct asm_instruction *inst; unsigned i; GLubyte *strz; @@ -5077,29 +5076,9 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->st = _mesa_symbol_table_ctor(); - /* All of these limits should come from ctx. - */ - limits.MaxInstructions = 128; - limits.MaxAluInstructions = 128; - limits.MaxTexInstructions = 128; - limits.MaxTexIndirections = 128; - limits.MaxAttribs = 16; - limits.MaxTemps = 128; - limits.MaxAddressRegs = 1; - limits.MaxParameters = 128; - limits.MaxLocalParams = 256; - limits.MaxEnvParams = 128; - limits.MaxNativeInstructions = 128; - limits.MaxNativeAluInstructions = 128; - limits.MaxNativeTexInstructions = 128; - limits.MaxNativeTexIndirections = 128; - limits.MaxNativeAttribs = 16; - limits.MaxNativeTemps = 128; - limits.MaxNativeAddressRegs = 1; - limits.MaxNativeParameters = 128; - limits.MaxUniformComponents = 0; - - state->limits = & limits; + state->limits = (target == GL_VERTEX_PROGRAM_ARB) + ? & ctx->Const.VertexProgram + : & ctx->Const.FragmentProgram; state->MaxTextureImageUnits = 16; state->MaxTextureCoordUnits = 8; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 91a4036cbb..65f713303b 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -2182,7 +2182,6 @@ GLboolean _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, GLsizei len, struct asm_parser_state *state) { - struct gl_program_constants limits; struct asm_instruction *inst; unsigned i; GLubyte *strz; @@ -2208,29 +2207,9 @@ _mesa_parse_arb_program(GLcontext *ctx, GLenum target, const GLubyte *str, state->st = _mesa_symbol_table_ctor(); - /* All of these limits should come from ctx. - */ - limits.MaxInstructions = 128; - limits.MaxAluInstructions = 128; - limits.MaxTexInstructions = 128; - limits.MaxTexIndirections = 128; - limits.MaxAttribs = 16; - limits.MaxTemps = 128; - limits.MaxAddressRegs = 1; - limits.MaxParameters = 128; - limits.MaxLocalParams = 256; - limits.MaxEnvParams = 128; - limits.MaxNativeInstructions = 128; - limits.MaxNativeAluInstructions = 128; - limits.MaxNativeTexInstructions = 128; - limits.MaxNativeTexIndirections = 128; - limits.MaxNativeAttribs = 16; - limits.MaxNativeTemps = 128; - limits.MaxNativeAddressRegs = 1; - limits.MaxNativeParameters = 128; - limits.MaxUniformComponents = 0; - - state->limits = & limits; + state->limits = (target == GL_VERTEX_PROGRAM_ARB) + ? & ctx->Const.VertexProgram + : & ctx->Const.FragmentProgram; state->MaxTextureImageUnits = 16; state->MaxTextureCoordUnits = 8; -- cgit v1.2.3 From 600710907c5b72cf33e0b3ca6dc7e0d2a1a8ab25 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 29 Jul 2009 21:07:41 -0700 Subject: ARP prog parser: Implement the spec, not what makes sense --- src/mesa/shader/program_parse.tab.c | 133 +++++++++++++++++++----------------- src/mesa/shader/program_parse.y | 27 +++++--- 2 files changed, 89 insertions(+), 71 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 6c3c239cfa..1d07198897 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -777,12 +777,12 @@ static const yytype_uint16 yyrline[] = 1357, 1366, 1369, 1375, 1379, 1383, 1389, 1400, 1405, 1410, 1415, 1420, 1425, 1433, 1436, 1441, 1454, 1462, 1473, 1481, 1481, 1483, 1483, 1485, 1495, 1500, 1507, 1517, 1526, 1531, - 1538, 1548, 1558, 1570, 1570, 1571, 1571, 1573, 1580, 1585, - 1592, 1600, 1608, 1617, 1628, 1632, 1638, 1639, 1640, 1643, - 1643, 1646, 1646, 1649, 1655, 1663, 1676, 1685, 1694, 1698, - 1707, 1716, 1727, 1734, 1739, 1748, 1760, 1763, 1772, 1783, - 1784, 1785, 1788, 1789, 1790, 1793, 1794, 1797, 1798, 1801, - 1802, 1805, 1816, 1827, 1838 + 1538, 1548, 1558, 1570, 1570, 1571, 1571, 1573, 1583, 1591, + 1601, 1609, 1617, 1626, 1637, 1641, 1647, 1648, 1649, 1652, + 1652, 1655, 1655, 1658, 1664, 1672, 1685, 1694, 1703, 1707, + 1716, 1725, 1736, 1743, 1748, 1757, 1769, 1772, 1781, 1792, + 1793, 1794, 1797, 1798, 1799, 1802, 1803, 1806, 1807, 1810, + 1811, 1814, 1825, 1836, 1847 }; #endif @@ -4020,74 +4020,83 @@ yyreduce: /* Line 1455 of yacc.c */ #line 1574 "program_parse.y" { - (yyval.vector).count = 1; + (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); + (yyval.vector).data[1] = (yyvsp[(1) - (1)].real); + (yyval.vector).data[2] = (yyvsp[(1) - (1)].real); + (yyval.vector).data[3] = (yyvsp[(1) - (1)].real); ;} break; case 218: /* Line 1455 of yacc.c */ -#line 1581 "program_parse.y" +#line 1584 "program_parse.y" { - (yyval.vector).count = 1; + (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); + (yyval.vector).data[1] = 0.0f; + (yyval.vector).data[2] = 0.0f; + (yyval.vector).data[3] = 1.0f; ;} break; case 219: /* Line 1455 of yacc.c */ -#line 1586 "program_parse.y" +#line 1592 "program_parse.y" { - (yyval.vector).count = 1; + (yyval.vector).count = 4; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); + (yyval.vector).data[1] = 0.0f; + (yyval.vector).data[2] = 0.0f; + (yyval.vector).data[3] = 1.0f; ;} break; case 220: /* Line 1455 of yacc.c */ -#line 1593 "program_parse.y" +#line 1602 "program_parse.y" { - (yyval.vector).count = 1; + (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); (yyval.vector).data[1] = 0.0f; (yyval.vector).data[2] = 0.0f; - (yyval.vector).data[3] = 0.0f; + (yyval.vector).data[3] = 1.0f; ;} break; case 221: /* Line 1455 of yacc.c */ -#line 1601 "program_parse.y" +#line 1610 "program_parse.y" { - (yyval.vector).count = 2; + (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); (yyval.vector).data[1] = (yyvsp[(4) - (5)].real); (yyval.vector).data[2] = 0.0f; - (yyval.vector).data[3] = 0.0f; + (yyval.vector).data[3] = 1.0f; ;} break; case 222: /* Line 1455 of yacc.c */ -#line 1610 "program_parse.y" +#line 1619 "program_parse.y" { - (yyval.vector).count = 3; + (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); (yyval.vector).data[1] = (yyvsp[(4) - (7)].real); (yyval.vector).data[2] = (yyvsp[(6) - (7)].real); - (yyval.vector).data[3] = 0.0f; + (yyval.vector).data[3] = 1.0f; ;} break; case 223: /* Line 1455 of yacc.c */ -#line 1619 "program_parse.y" +#line 1628 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4100,7 +4109,7 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1629 "program_parse.y" +#line 1638 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4109,7 +4118,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1633 "program_parse.y" +#line 1642 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4118,42 +4127,42 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1638 "program_parse.y" +#line 1647 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 227: /* Line 1455 of yacc.c */ -#line 1639 "program_parse.y" +#line 1648 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 228: /* Line 1455 of yacc.c */ -#line 1640 "program_parse.y" +#line 1649 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 229: /* Line 1455 of yacc.c */ -#line 1643 "program_parse.y" +#line 1652 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 231: /* Line 1455 of yacc.c */ -#line 1646 "program_parse.y" +#line 1655 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 233: /* Line 1455 of yacc.c */ -#line 1650 "program_parse.y" +#line 1659 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4164,7 +4173,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1656 "program_parse.y" +#line 1665 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4175,7 +4184,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1664 "program_parse.y" +#line 1673 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4191,7 +4200,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1677 "program_parse.y" +#line 1686 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4205,7 +4214,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1686 "program_parse.y" +#line 1695 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4219,7 +4228,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1695 "program_parse.y" +#line 1704 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4228,7 +4237,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1699 "program_parse.y" +#line 1708 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4242,7 +4251,7 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1717 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4256,7 +4265,7 @@ yyreduce: case 241: /* Line 1455 of yacc.c */ -#line 1717 "program_parse.y" +#line 1726 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4270,7 +4279,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1728 "program_parse.y" +#line 1737 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4279,7 +4288,7 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1734 "program_parse.y" +#line 1743 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4290,7 +4299,7 @@ yyreduce: case 244: /* Line 1455 of yacc.c */ -#line 1740 "program_parse.y" +#line 1749 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4304,7 +4313,7 @@ yyreduce: case 245: /* Line 1455 of yacc.c */ -#line 1749 "program_parse.y" +#line 1758 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4318,7 +4327,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1760 "program_parse.y" +#line 1769 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4327,7 +4336,7 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1764 "program_parse.y" +#line 1773 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4341,7 +4350,7 @@ yyreduce: case 248: /* Line 1455 of yacc.c */ -#line 1773 "program_parse.y" +#line 1782 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4355,91 +4364,91 @@ yyreduce: case 249: /* Line 1455 of yacc.c */ -#line 1783 "program_parse.y" +#line 1792 "program_parse.y" { (yyval.integer) = 0; ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1784 "program_parse.y" +#line 1793 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1785 "program_parse.y" +#line 1794 "program_parse.y" { (yyval.integer) = 1; ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1788 "program_parse.y" +#line 1797 "program_parse.y" { (yyval.integer) = 0; ;} break; case 253: /* Line 1455 of yacc.c */ -#line 1789 "program_parse.y" +#line 1798 "program_parse.y" { (yyval.integer) = 0; ;} break; case 254: /* Line 1455 of yacc.c */ -#line 1790 "program_parse.y" +#line 1799 "program_parse.y" { (yyval.integer) = 1; ;} break; case 255: /* Line 1455 of yacc.c */ -#line 1793 "program_parse.y" +#line 1802 "program_parse.y" { (yyval.integer) = 0; ;} break; case 256: /* Line 1455 of yacc.c */ -#line 1794 "program_parse.y" +#line 1803 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 257: /* Line 1455 of yacc.c */ -#line 1797 "program_parse.y" +#line 1806 "program_parse.y" { (yyval.integer) = 0; ;} break; case 258: /* Line 1455 of yacc.c */ -#line 1798 "program_parse.y" +#line 1807 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 259: /* Line 1455 of yacc.c */ -#line 1801 "program_parse.y" +#line 1810 "program_parse.y" { (yyval.integer) = 0; ;} break; case 260: /* Line 1455 of yacc.c */ -#line 1802 "program_parse.y" +#line 1811 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 261: /* Line 1455 of yacc.c */ -#line 1806 "program_parse.y" +#line 1815 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4453,7 +4462,7 @@ yyreduce: case 262: /* Line 1455 of yacc.c */ -#line 1817 "program_parse.y" +#line 1826 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4467,7 +4476,7 @@ yyreduce: case 263: /* Line 1455 of yacc.c */ -#line 1828 "program_parse.y" +#line 1837 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4481,7 +4490,7 @@ yyreduce: case 264: /* Line 1455 of yacc.c */ -#line 1839 "program_parse.y" +#line 1848 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4505,7 +4514,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4509 "program_parse.tab.c" +#line 4518 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4724,7 +4733,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1859 "program_parse.y" +#line 1868 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 65f713303b..9a5907a4e0 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1572,47 +1572,56 @@ paramConstUse: paramConstScalarUse | paramConstVector; paramConstScalarDecl: signedFloatConstant { - $$.count = 1; + $$.count = 4; $$.data[0] = $1; + $$.data[1] = $1; + $$.data[2] = $1; + $$.data[3] = $1; } ; paramConstScalarUse: REAL { - $$.count = 1; + $$.count = 4; $$.data[0] = $1; + $$.data[1] = 0.0f; + $$.data[2] = 0.0f; + $$.data[3] = 1.0f; } | INTEGER { - $$.count = 1; + $$.count = 4; $$.data[0] = (float) $1; + $$.data[1] = 0.0f; + $$.data[2] = 0.0f; + $$.data[3] = 1.0f; } ; paramConstVector: '{' signedFloatConstant '}' { - $$.count = 1; + $$.count = 4; $$.data[0] = $2; $$.data[1] = 0.0f; $$.data[2] = 0.0f; - $$.data[3] = 0.0f; + $$.data[3] = 1.0f; } | '{' signedFloatConstant ',' signedFloatConstant '}' { - $$.count = 2; + $$.count = 4; $$.data[0] = $2; $$.data[1] = $4; $$.data[2] = 0.0f; - $$.data[3] = 0.0f; + $$.data[3] = 1.0f; } | '{' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant '}' { - $$.count = 3; + $$.count = 4; $$.data[0] = $2; $$.data[1] = $4; $$.data[2] = $6; - $$.data[3] = 0.0f; + $$.data[3] = 1.0f; } | '{' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant ',' signedFloatConstant '}' -- cgit v1.2.3 From 17534ab88ce29119f79de8abfcc4170471e8f5a4 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Jul 2009 09:41:35 -0700 Subject: ARB prog parser: Prevent NULL ptr deref for KIL instruction The KIL instruction doesn't have a destination register, so dereferencing dst in asm_instruction_ctor would cause a segfault. --- src/mesa/shader/program_parse.tab.c | 10 +++++++++- src/mesa/shader/program_parse.y | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 1d07198897..9b4c4e8277 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -4748,7 +4748,15 @@ asm_instruction_ctor(gl_inst_opcode op, if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - inst->Base.DstReg = *dst; + + /* In the core ARB extensions only the KIL instruction doesn't have a + * destination register. + */ + if (dst == NULL) { + init_dst_reg(& inst->Base.DstReg); + } else { + inst->Base.DstReg = *dst; + } inst->Base.SrcReg[0] = src0->Base; inst->SrcReg[0] = *src0; diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 9a5907a4e0..1a214b38ae 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -1879,7 +1879,15 @@ asm_instruction_ctor(gl_inst_opcode op, if (inst) { _mesa_init_instructions(& inst->Base, 1); inst->Base.Opcode = op; - inst->Base.DstReg = *dst; + + /* In the core ARB extensions only the KIL instruction doesn't have a + * destination register. + */ + if (dst == NULL) { + init_dst_reg(& inst->Base.DstReg); + } else { + inst->Base.DstReg = *dst; + } inst->Base.SrcReg[0] = src0->Base; inst->SrcReg[0] = *src0; -- cgit v1.2.3 From 565a2a8f38f1407e2122b2dbfa4a0bc5bb881dd3 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Jul 2009 10:51:43 -0700 Subject: ARB prog parser: Add support for RGBA components to SWZ instruction in fp --- src/mesa/shader/program_parse.tab.c | 577 ++++++++++++++++++++---------------- src/mesa/shader/program_parse.tab.h | 9 +- src/mesa/shader/program_parse.y | 85 +++++- 3 files changed, 398 insertions(+), 273 deletions(-) diff --git a/src/mesa/shader/program_parse.tab.c b/src/mesa/shader/program_parse.tab.c index 9b4c4e8277..856bcbe874 100644 --- a/src/mesa/shader/program_parse.tab.c +++ b/src/mesa/shader/program_parse.tab.c @@ -329,10 +329,17 @@ typedef union YYSTYPE struct asm_vector vector; gl_inst_opcode opcode; + struct { + unsigned swz; + unsigned rgba_valid:1; + unsigned xyzw_valid:1; + unsigned negate:1; + } ext_swizzle; + /* Line 214 of yacc.c */ -#line 336 "program_parse.tab.c" +#line 343 "program_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -356,14 +363,14 @@ typedef struct YYLTYPE /* Copy the second part of user declarations. */ /* Line 264 of yacc.c */ -#line 242 "program_parse.y" +#line 249 "program_parse.y" extern int yylex(YYSTYPE *yylval_param, YYLTYPE *yylloc_param, void *yyscanner); /* Line 264 of yacc.c */ -#line 367 "program_parse.tab.c" +#line 374 "program_parse.tab.c" #ifdef short # undef short @@ -756,33 +763,33 @@ static const yytype_int16 yyrhs[] = /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ static const yytype_uint16 yyrline[] = { - 0, 249, 249, 252, 260, 272, 273, 276, 298, 299, - 302, 317, 320, 325, 332, 333, 334, 335, 336, 337, - 338, 341, 342, 345, 351, 358, 365, 373, 380, 388, - 433, 440, 446, 447, 448, 449, 450, 451, 452, 453, - 454, 455, 456, 457, 460, 473, 486, 499, 521, 530, - 539, 546, 555, 583, 625, 636, 657, 667, 673, 704, - 721, 721, 723, 730, 742, 743, 744, 747, 759, 771, - 789, 800, 812, 814, 815, 816, 817, 820, 820, 820, - 820, 821, 824, 825, 826, 827, 828, 829, 832, 850, - 854, 860, 864, 868, 872, 881, 890, 894, 899, 905, - 916, 916, 917, 919, 923, 927, 931, 937, 937, 939, - 955, 978, 981, 992, 998, 1004, 1005, 1012, 1018, 1024, - 1032, 1038, 1044, 1052, 1058, 1064, 1072, 1073, 1076, 1077, - 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1089, - 1098, 1102, 1106, 1112, 1121, 1125, 1129, 1138, 1142, 1148, - 1154, 1161, 1166, 1174, 1184, 1186, 1194, 1200, 1204, 1208, - 1214, 1225, 1234, 1238, 1243, 1247, 1251, 1255, 1261, 1268, - 1272, 1278, 1286, 1297, 1304, 1308, 1314, 1324, 1335, 1339, - 1357, 1366, 1369, 1375, 1379, 1383, 1389, 1400, 1405, 1410, - 1415, 1420, 1425, 1433, 1436, 1441, 1454, 1462, 1473, 1481, - 1481, 1483, 1483, 1485, 1495, 1500, 1507, 1517, 1526, 1531, - 1538, 1548, 1558, 1570, 1570, 1571, 1571, 1573, 1583, 1591, - 1601, 1609, 1617, 1626, 1637, 1641, 1647, 1648, 1649, 1652, - 1652, 1655, 1655, 1658, 1664, 1672, 1685, 1694, 1703, 1707, - 1716, 1725, 1736, 1743, 1748, 1757, 1769, 1772, 1781, 1792, - 1793, 1794, 1797, 1798, 1799, 1802, 1803, 1806, 1807, 1810, - 1811, 1814, 1825, 1836, 1847 + 0, 256, 256, 259, 267, 279, 280, 283, 305, 306, + 309, 324, 327, 332, 339, 340, 341, 342, 343, 344, + 345, 348, 349, 352, 358, 365, 372, 380, 387, 395, + 440, 447, 453, 454, 455, 456, 457, 458, 459, 460, + 461, 462, 463, 464, 467, 480, 493, 506, 528, 537, + 570, 577, 592, 642, 684, 695, 716, 726, 732, 763, + 780, 780, 782, 789, 801, 802, 803, 806, 818, 830, + 848, 859, 871, 873, 874, 875, 876, 879, 879, 879, + 879, 880, 883, 884, 885, 886, 887, 888, 891, 909, + 913, 919, 923, 927, 931, 940, 949, 953, 958, 964, + 975, 975, 976, 978, 982, 986, 990, 996, 996, 998, + 1014, 1037, 1040, 1051, 1057, 1063, 1064, 1071, 1077, 1083, + 1091, 1097, 1103, 1111, 1117, 1123, 1131, 1132, 1135, 1136, + 1137, 1138, 1139, 1140, 1141, 1142, 1143, 1144, 1145, 1148, + 1157, 1161, 1165, 1171, 1180, 1184, 1188, 1197, 1201, 1207, + 1213, 1220, 1225, 1233, 1243, 1245, 1253, 1259, 1263, 1267, + 1273, 1284, 1293, 1297, 1302, 1306, 1310, 1314, 1320, 1327, + 1331, 1337, 1345, 1356, 1363, 1367, 1373, 1383, 1394, 1398, + 1416, 1425, 1428, 1434, 1438, 1442, 1448, 1459, 1464, 1469, + 1474, 1479, 1484, 1492, 1495, 1500, 1513, 1521, 1532, 1540, + 1540, 1542, 1542, 1544, 1554, 1559, 1566, 1576, 1585, 1590, + 1597, 1607, 1617, 1629, 1629, 1630, 1630, 1632, 1642, 1650, + 1660, 1668, 1676, 1685, 1696, 1700, 1706, 1707, 1708, 1711, + 1711, 1714, 1714, 1717, 1723, 1731, 1744, 1753, 1762, 1766, + 1775, 1784, 1795, 1802, 1807, 1816, 1828, 1831, 1840, 1851, + 1852, 1853, 1856, 1857, 1858, 1861, 1862, 1865, 1866, 1869, + 1870, 1873, 1884, 1895, 1906 }; #endif @@ -2061,7 +2068,7 @@ yyreduce: case 3: /* Line 1455 of yacc.c */ -#line 253 "program_parse.y" +#line 260 "program_parse.y" { if (state->prog->Target != GL_VERTEX_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid fragment program header"); @@ -2074,7 +2081,7 @@ yyreduce: case 4: /* Line 1455 of yacc.c */ -#line 261 "program_parse.y" +#line 268 "program_parse.y" { if (state->prog->Target != GL_FRAGMENT_PROGRAM_ARB) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex program header"); @@ -2089,7 +2096,7 @@ yyreduce: case 7: /* Line 1455 of yacc.c */ -#line 277 "program_parse.y" +#line 284 "program_parse.y" { int valid = 0; @@ -2114,7 +2121,7 @@ yyreduce: case 10: /* Line 1455 of yacc.c */ -#line 303 "program_parse.y" +#line 310 "program_parse.y" { if ((yyvsp[(1) - (2)].inst) != NULL) { if (state->inst_tail == NULL) { @@ -2134,7 +2141,7 @@ yyreduce: case 12: /* Line 1455 of yacc.c */ -#line 321 "program_parse.y" +#line 328 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumAluInstructions++; @@ -2144,7 +2151,7 @@ yyreduce: case 13: /* Line 1455 of yacc.c */ -#line 326 "program_parse.y" +#line 333 "program_parse.y" { (yyval.inst) = (yyvsp[(1) - (1)].inst); state->prog->NumTexInstructions++; @@ -2154,7 +2161,7 @@ yyreduce: case 23: /* Line 1455 of yacc.c */ -#line 346 "program_parse.y" +#line 353 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_ARL, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); ;} @@ -2163,7 +2170,7 @@ yyreduce: case 24: /* Line 1455 of yacc.c */ -#line 352 "program_parse.y" +#line 359 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2173,7 +2180,7 @@ yyreduce: case 25: /* Line 1455 of yacc.c */ -#line 359 "program_parse.y" +#line 366 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (4)].temp_inst).Opcode, & (yyvsp[(2) - (4)].dst_reg), & (yyvsp[(4) - (4)].src_reg), NULL, NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (4)].temp_inst).SaturateMode; @@ -2183,7 +2190,7 @@ yyreduce: case 26: /* Line 1455 of yacc.c */ -#line 366 "program_parse.y" +#line 373 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2193,7 +2200,7 @@ yyreduce: case 27: /* Line 1455 of yacc.c */ -#line 374 "program_parse.y" +#line 381 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (6)].temp_inst).Opcode, & (yyvsp[(2) - (6)].dst_reg), & (yyvsp[(4) - (6)].src_reg), & (yyvsp[(6) - (6)].src_reg), NULL); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (6)].temp_inst).SaturateMode; @@ -2203,7 +2210,7 @@ yyreduce: case 28: /* Line 1455 of yacc.c */ -#line 382 "program_parse.y" +#line 389 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), & (yyvsp[(6) - (8)].src_reg), & (yyvsp[(8) - (8)].src_reg)); (yyval.inst)->Base.SaturateMode = (yyvsp[(1) - (8)].temp_inst).SaturateMode; @@ -2213,7 +2220,7 @@ yyreduce: case 29: /* Line 1455 of yacc.c */ -#line 389 "program_parse.y" +#line 396 "program_parse.y" { (yyval.inst) = asm_instruction_ctor((yyvsp[(1) - (8)].temp_inst).Opcode, & (yyvsp[(2) - (8)].dst_reg), & (yyvsp[(4) - (8)].src_reg), NULL, NULL); if ((yyval.inst) != NULL) { @@ -2261,7 +2268,7 @@ yyreduce: case 30: /* Line 1455 of yacc.c */ -#line 434 "program_parse.y" +#line 441 "program_parse.y" { (yyval.inst) = asm_instruction_ctor(OPCODE_KIL, NULL, & (yyvsp[(2) - (2)].src_reg), NULL, NULL); state->fragment.UsesKill = 1; @@ -2271,7 +2278,7 @@ yyreduce: case 31: /* Line 1455 of yacc.c */ -#line 441 "program_parse.y" +#line 448 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -2280,91 +2287,91 @@ yyreduce: case 32: /* Line 1455 of yacc.c */ -#line 446 "program_parse.y" +#line 453 "program_parse.y" { (yyval.integer) = TEXTURE_1D_INDEX; ;} break; case 33: /* Line 1455 of yacc.c */ -#line 447 "program_parse.y" +#line 454 "program_parse.y" { (yyval.integer) = TEXTURE_2D_INDEX; ;} break; case 34: /* Line 1455 of yacc.c */ -#line 448 "program_parse.y" +#line 455 "program_parse.y" { (yyval.integer) = TEXTURE_3D_INDEX; ;} break; case 35: /* Line 1455 of yacc.c */ -#line 449 "program_parse.y" +#line 456 "program_parse.y" { (yyval.integer) = TEXTURE_CUBE_INDEX; ;} break; case 36: /* Line 1455 of yacc.c */ -#line 450 "program_parse.y" +#line 457 "program_parse.y" { (yyval.integer) = TEXTURE_RECT_INDEX; ;} break; case 37: /* Line 1455 of yacc.c */ -#line 451 "program_parse.y" +#line 458 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_INDEX; ;} break; case 38: /* Line 1455 of yacc.c */ -#line 452 "program_parse.y" +#line 459 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_INDEX; ;} break; case 39: /* Line 1455 of yacc.c */ -#line 453 "program_parse.y" +#line 460 "program_parse.y" { (yyval.integer) = -TEXTURE_RECT_INDEX; ;} break; case 40: /* Line 1455 of yacc.c */ -#line 454 "program_parse.y" +#line 461 "program_parse.y" { (yyval.integer) = TEXTURE_1D_ARRAY_INDEX; ;} break; case 41: /* Line 1455 of yacc.c */ -#line 455 "program_parse.y" +#line 462 "program_parse.y" { (yyval.integer) = TEXTURE_2D_ARRAY_INDEX; ;} break; case 42: /* Line 1455 of yacc.c */ -#line 456 "program_parse.y" +#line 463 "program_parse.y" { (yyval.integer) = -TEXTURE_1D_ARRAY_INDEX; ;} break; case 43: /* Line 1455 of yacc.c */ -#line 457 "program_parse.y" +#line 464 "program_parse.y" { (yyval.integer) = -TEXTURE_2D_ARRAY_INDEX; ;} break; case 44: /* Line 1455 of yacc.c */ -#line 461 "program_parse.y" +#line 468 "program_parse.y" { /* FIXME: Is this correct? Should the extenedSwizzle be applied * FIXME: to the existing swizzle? @@ -2380,7 +2387,7 @@ yyreduce: case 45: /* Line 1455 of yacc.c */ -#line 474 "program_parse.y" +#line 481 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2396,7 +2403,7 @@ yyreduce: case 46: /* Line 1455 of yacc.c */ -#line 487 "program_parse.y" +#line 494 "program_parse.y" { (yyval.src_reg) = (yyvsp[(2) - (3)].src_reg); @@ -2412,7 +2419,7 @@ yyreduce: case 47: /* Line 1455 of yacc.c */ -#line 500 "program_parse.y" +#line 507 "program_parse.y" { (yyval.dst_reg) = (yyvsp[(1) - (2)].dst_reg); (yyval.dst_reg).WriteMask = (yyvsp[(2) - (2)].swiz_mask).mask; @@ -2437,7 +2444,7 @@ yyreduce: case 48: /* Line 1455 of yacc.c */ -#line 522 "program_parse.y" +#line 529 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_ADDRESS; @@ -2449,43 +2456,73 @@ yyreduce: case 49: /* Line 1455 of yacc.c */ -#line 531 "program_parse.y" - { - (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].swiz_mask).swizzle, (yyvsp[(3) - (7)].swiz_mask).swizzle, - (yyvsp[(5) - (7)].swiz_mask).swizzle, (yyvsp[(7) - (7)].swiz_mask).swizzle); - (yyval.swiz_mask).mask = ((yyvsp[(1) - (7)].swiz_mask).mask) | ((yyvsp[(3) - (7)].swiz_mask).mask << 1) | ((yyvsp[(5) - (7)].swiz_mask).mask << 2) - | ((yyvsp[(7) - (7)].swiz_mask).mask << 3); +#line 538 "program_parse.y" + { + const unsigned xyzw_valid = + ((yyvsp[(1) - (7)].ext_swizzle).xyzw_valid << 0) + | ((yyvsp[(3) - (7)].ext_swizzle).xyzw_valid << 1) + | ((yyvsp[(5) - (7)].ext_swizzle).xyzw_valid << 2) + | ((yyvsp[(7) - (7)].ext_swizzle).xyzw_valid << 3); + const unsigned rgba_valid = + ((yyvsp[(1) - (7)].ext_swizzle).rgba_valid << 0) + | ((yyvsp[(3) - (7)].ext_swizzle).rgba_valid << 1) + | ((yyvsp[(5) - (7)].ext_swizzle).rgba_valid << 2) + | ((yyvsp[(7) - (7)].ext_swizzle).rgba_valid << 3); + + /* All of the swizzle components have to be valid in either RGBA + * or XYZW. Note that 0 and 1 are valid in both, so both masks + * can have some bits set. + * + * We somewhat deviate from the spec here. It would be really hard + * to figure out which component is the error, and there probably + * isn't a lot of benefit. + */ + if ((rgba_valid != 0x0f) && (xyzw_valid != 0x0f)) { + yyerror(& (yylsp[(1) - (7)]), state, "cannot combine RGBA and XYZW swizzle " + "components"); + YYERROR; + } + + (yyval.swiz_mask).swizzle = MAKE_SWIZZLE4((yyvsp[(1) - (7)].ext_swizzle).swz, (yyvsp[(3) - (7)].ext_swizzle).swz, (yyvsp[(5) - (7)].ext_swizzle).swz, (yyvsp[(7) - (7)].ext_swizzle).swz); + (yyval.swiz_mask).mask = ((yyvsp[(1) - (7)].ext_swizzle).negate) | ((yyvsp[(3) - (7)].ext_swizzle).negate << 1) | ((yyvsp[(5) - (7)].ext_swizzle).negate << 2) + | ((yyvsp[(7) - (7)].ext_swizzle).negate << 3); ;} break; case 50: /* Line 1455 of yacc.c */ -#line 540 "program_parse.y" +#line 571 "program_parse.y" { - (yyval.swiz_mask).swizzle = (yyvsp[(2) - (2)].integer); - (yyval.swiz_mask).mask = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; + (yyval.ext_swizzle) = (yyvsp[(2) - (2)].ext_swizzle); + (yyval.ext_swizzle).negate = ((yyvsp[(1) - (2)].negate)) ? 1 : 0; ;} break; case 51: /* Line 1455 of yacc.c */ -#line 547 "program_parse.y" +#line 578 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) != 0) && ((yyvsp[(1) - (1)].integer) != 1)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); YYERROR; } - (yyval.integer) = ((yyvsp[(1) - (1)].integer) == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; + (yyval.ext_swizzle).swz = ((yyvsp[(1) - (1)].integer) == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; + + /* 0 and 1 are valid for both RGBA swizzle names and XYZW + * swizzle names. + */ + (yyval.ext_swizzle).xyzw_valid = 1; + (yyval.ext_swizzle).rgba_valid = 1; ;} break; case 52: /* Line 1455 of yacc.c */ -#line 556 "program_parse.y" +#line 593 "program_parse.y" { if (strlen((yyvsp[(1) - (1)].string)) > 1) { yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); @@ -2494,17 +2531,39 @@ yyreduce: switch ((yyvsp[(1) - (1)].string)[0]) { case 'x': - (yyval.integer) = SWIZZLE_X; + (yyval.ext_swizzle).swz = SWIZZLE_X; + (yyval.ext_swizzle).xyzw_valid = 1; break; case 'y': - (yyval.integer) = SWIZZLE_Y; + (yyval.ext_swizzle).swz = SWIZZLE_Y; + (yyval.ext_swizzle).xyzw_valid = 1; break; case 'z': - (yyval.integer) = SWIZZLE_Z; + (yyval.ext_swizzle).swz = SWIZZLE_Z; + (yyval.ext_swizzle).xyzw_valid = 1; break; case 'w': - (yyval.integer) = SWIZZLE_W; + (yyval.ext_swizzle).swz = SWIZZLE_W; + (yyval.ext_swizzle).xyzw_valid = 1; + break; + + case 'r': + (yyval.ext_swizzle).swz = SWIZZLE_X; + (yyval.ext_swizzle).rgba_valid = 1; + break; + case 'g': + (yyval.ext_swizzle).swz = SWIZZLE_Y; + (yyval.ext_swizzle).rgba_valid = 1; + break; + case 'b': + (yyval.ext_swizzle).swz = SWIZZLE_Z; + (yyval.ext_swizzle).rgba_valid = 1; break; + case 'a': + (yyval.ext_swizzle).swz = SWIZZLE_W; + (yyval.ext_swizzle).rgba_valid = 1; + break; + default: yyerror(& (yylsp[(1) - (1)]), state, "invalid extended swizzle selector"); YYERROR; @@ -2516,7 +2575,7 @@ yyreduce: case 53: /* Line 1455 of yacc.c */ -#line 584 "program_parse.y" +#line 643 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2563,7 +2622,7 @@ yyreduce: case 54: /* Line 1455 of yacc.c */ -#line 626 "program_parse.y" +#line 685 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = PROGRAM_INPUT; @@ -2579,7 +2638,7 @@ yyreduce: case 55: /* Line 1455 of yacc.c */ -#line 637 "program_parse.y" +#line 696 "program_parse.y" { if (! (yyvsp[(3) - (4)].src_reg).Base.RelAddr && ((unsigned) (yyvsp[(3) - (4)].src_reg).Base.Index >= (yyvsp[(1) - (4)].sym)->param_binding_length)) { @@ -2605,7 +2664,7 @@ yyreduce: case 56: /* Line 1455 of yacc.c */ -#line 658 "program_parse.y" +#line 717 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.File = ((yyvsp[(1) - (1)].temp_sym).name != NULL) @@ -2618,7 +2677,7 @@ yyreduce: case 57: /* Line 1455 of yacc.c */ -#line 668 "program_parse.y" +#line 727 "program_parse.y" { init_dst_reg(& (yyval.dst_reg)); (yyval.dst_reg).File = PROGRAM_OUTPUT; @@ -2629,7 +2688,7 @@ yyreduce: case 58: /* Line 1455 of yacc.c */ -#line 674 "program_parse.y" +#line 733 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2663,7 +2722,7 @@ yyreduce: case 59: /* Line 1455 of yacc.c */ -#line 705 "program_parse.y" +#line 764 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2683,7 +2742,7 @@ yyreduce: case 62: /* Line 1455 of yacc.c */ -#line 724 "program_parse.y" +#line 783 "program_parse.y" { init_src_reg(& (yyval.src_reg)); (yyval.src_reg).Base.Index = (yyvsp[(1) - (1)].integer); @@ -2693,7 +2752,7 @@ yyreduce: case 63: /* Line 1455 of yacc.c */ -#line 731 "program_parse.y" +#line 790 "program_parse.y" { /* FINISHME: Add support for multiple address registers. */ @@ -2708,28 +2767,28 @@ yyreduce: case 64: /* Line 1455 of yacc.c */ -#line 742 "program_parse.y" +#line 801 "program_parse.y" { (yyval.integer) = 0; ;} break; case 65: /* Line 1455 of yacc.c */ -#line 743 "program_parse.y" +#line 802 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} break; case 66: /* Line 1455 of yacc.c */ -#line 744 "program_parse.y" +#line 803 "program_parse.y" { (yyval.integer) = -(yyvsp[(2) - (2)].integer); ;} break; case 67: /* Line 1455 of yacc.c */ -#line 748 "program_parse.y" +#line 807 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 63)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2744,7 +2803,7 @@ yyreduce: case 68: /* Line 1455 of yacc.c */ -#line 760 "program_parse.y" +#line 819 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 0) || ((yyvsp[(1) - (1)].integer) > 64)) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2759,7 +2818,7 @@ yyreduce: case 69: /* Line 1455 of yacc.c */ -#line 772 "program_parse.y" +#line 831 "program_parse.y" { struct asm_symbol *const s = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(1) - (1)].string)); @@ -2780,7 +2839,7 @@ yyreduce: case 70: /* Line 1455 of yacc.c */ -#line 790 "program_parse.y" +#line 849 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, "invalid address component selector"); @@ -2794,7 +2853,7 @@ yyreduce: case 71: /* Line 1455 of yacc.c */ -#line 801 "program_parse.y" +#line 860 "program_parse.y" { if ((yyvsp[(1) - (1)].swiz_mask).mask != WRITEMASK_X) { yyerror(& (yylsp[(1) - (1)]), state, @@ -2809,21 +2868,21 @@ yyreduce: case 76: /* Line 1455 of yacc.c */ -#line 817 "program_parse.y" +#line 876 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 81: /* Line 1455 of yacc.c */ -#line 821 "program_parse.y" +#line 880 "program_parse.y" { (yyval.swiz_mask).swizzle = SWIZZLE_NOOP; (yyval.swiz_mask).mask = WRITEMASK_XYZW; ;} break; case 88: /* Line 1455 of yacc.c */ -#line 833 "program_parse.y" +#line 892 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_attrib, & (yylsp[(2) - (4)])); @@ -2844,7 +2903,7 @@ yyreduce: case 89: /* Line 1455 of yacc.c */ -#line 851 "program_parse.y" +#line 910 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2853,7 +2912,7 @@ yyreduce: case 90: /* Line 1455 of yacc.c */ -#line 855 "program_parse.y" +#line 914 "program_parse.y" { (yyval.attrib) = (yyvsp[(2) - (2)].attrib); ;} @@ -2862,7 +2921,7 @@ yyreduce: case 91: /* Line 1455 of yacc.c */ -#line 861 "program_parse.y" +#line 920 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_POS; ;} @@ -2871,7 +2930,7 @@ yyreduce: case 92: /* Line 1455 of yacc.c */ -#line 865 "program_parse.y" +#line 924 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_WEIGHT; ;} @@ -2880,7 +2939,7 @@ yyreduce: case 93: /* Line 1455 of yacc.c */ -#line 869 "program_parse.y" +#line 928 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_NORMAL; ;} @@ -2889,7 +2948,7 @@ yyreduce: case 94: /* Line 1455 of yacc.c */ -#line 873 "program_parse.y" +#line 932 "program_parse.y" { if (!state->ctx->Extensions.EXT_secondary_color) { yyerror(& (yylsp[(2) - (2)]), state, "GL_EXT_secondary_color not supported"); @@ -2903,7 +2962,7 @@ yyreduce: case 95: /* Line 1455 of yacc.c */ -#line 882 "program_parse.y" +#line 941 "program_parse.y" { if (!state->ctx->Extensions.EXT_fog_coord) { yyerror(& (yylsp[(1) - (1)]), state, "GL_EXT_fog_coord not supported"); @@ -2917,7 +2976,7 @@ yyreduce: case 96: /* Line 1455 of yacc.c */ -#line 891 "program_parse.y" +#line 950 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2926,7 +2985,7 @@ yyreduce: case 97: /* Line 1455 of yacc.c */ -#line 895 "program_parse.y" +#line 954 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -2936,7 +2995,7 @@ yyreduce: case 98: /* Line 1455 of yacc.c */ -#line 900 "program_parse.y" +#line 959 "program_parse.y" { (yyval.attrib) = VERT_ATTRIB_GENERIC0 + (yyvsp[(3) - (4)].integer); ;} @@ -2945,7 +3004,7 @@ yyreduce: case 99: /* Line 1455 of yacc.c */ -#line 906 "program_parse.y" +#line 965 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxAttribs) { yyerror(& (yylsp[(1) - (1)]), state, "invalid vertex attribute reference"); @@ -2959,7 +3018,7 @@ yyreduce: case 103: /* Line 1455 of yacc.c */ -#line 920 "program_parse.y" +#line 979 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_WPOS; ;} @@ -2968,7 +3027,7 @@ yyreduce: case 104: /* Line 1455 of yacc.c */ -#line 924 "program_parse.y" +#line 983 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_COL0 + (yyvsp[(2) - (2)].integer); ;} @@ -2977,7 +3036,7 @@ yyreduce: case 105: /* Line 1455 of yacc.c */ -#line 928 "program_parse.y" +#line 987 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_FOGC; ;} @@ -2986,7 +3045,7 @@ yyreduce: case 106: /* Line 1455 of yacc.c */ -#line 932 "program_parse.y" +#line 991 "program_parse.y" { (yyval.attrib) = FRAG_ATTRIB_TEX0 + (yyvsp[(2) - (2)].integer); ;} @@ -2995,7 +3054,7 @@ yyreduce: case 109: /* Line 1455 of yacc.c */ -#line 940 "program_parse.y" +#line 999 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (3)].string), at_param, & (yylsp[(2) - (3)])); @@ -3014,7 +3073,7 @@ yyreduce: case 110: /* Line 1455 of yacc.c */ -#line 956 "program_parse.y" +#line 1015 "program_parse.y" { if (((yyvsp[(4) - (6)].integer) != 0) && ((unsigned) (yyvsp[(4) - (6)].integer) != (yyvsp[(6) - (6)].temp_sym).param_binding_length)) { yyerror(& (yylsp[(4) - (6)]), state, @@ -3039,7 +3098,7 @@ yyreduce: case 111: /* Line 1455 of yacc.c */ -#line 978 "program_parse.y" +#line 1037 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3048,7 +3107,7 @@ yyreduce: case 112: /* Line 1455 of yacc.c */ -#line 982 "program_parse.y" +#line 1041 "program_parse.y" { if (((yyvsp[(1) - (1)].integer) < 1) || ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxParameters)) { yyerror(& (yylsp[(1) - (1)]), state, "invalid parameter array size"); @@ -3062,7 +3121,7 @@ yyreduce: case 113: /* Line 1455 of yacc.c */ -#line 993 "program_parse.y" +#line 1052 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(2) - (2)].temp_sym); ;} @@ -3071,7 +3130,7 @@ yyreduce: case 114: /* Line 1455 of yacc.c */ -#line 999 "program_parse.y" +#line 1058 "program_parse.y" { (yyval.temp_sym) = (yyvsp[(3) - (4)].temp_sym); ;} @@ -3080,7 +3139,7 @@ yyreduce: case 116: /* Line 1455 of yacc.c */ -#line 1006 "program_parse.y" +#line 1065 "program_parse.y" { (yyvsp[(1) - (3)].temp_sym).param_binding_length += (yyvsp[(3) - (3)].temp_sym).param_binding_length; (yyval.temp_sym) = (yyvsp[(1) - (3)].temp_sym); @@ -3090,7 +3149,7 @@ yyreduce: case 117: /* Line 1455 of yacc.c */ -#line 1013 "program_parse.y" +#line 1072 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3101,7 +3160,7 @@ yyreduce: case 118: /* Line 1455 of yacc.c */ -#line 1019 "program_parse.y" +#line 1078 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3112,7 +3171,7 @@ yyreduce: case 119: /* Line 1455 of yacc.c */ -#line 1025 "program_parse.y" +#line 1084 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3123,7 +3182,7 @@ yyreduce: case 120: /* Line 1455 of yacc.c */ -#line 1033 "program_parse.y" +#line 1092 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3134,7 +3193,7 @@ yyreduce: case 121: /* Line 1455 of yacc.c */ -#line 1039 "program_parse.y" +#line 1098 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3145,7 +3204,7 @@ yyreduce: case 122: /* Line 1455 of yacc.c */ -#line 1045 "program_parse.y" +#line 1104 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3156,7 +3215,7 @@ yyreduce: case 123: /* Line 1455 of yacc.c */ -#line 1053 "program_parse.y" +#line 1112 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3167,7 +3226,7 @@ yyreduce: case 124: /* Line 1455 of yacc.c */ -#line 1059 "program_parse.y" +#line 1118 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3178,7 +3237,7 @@ yyreduce: case 125: /* Line 1455 of yacc.c */ -#line 1065 "program_parse.y" +#line 1124 "program_parse.y" { memset(& (yyval.temp_sym), 0, sizeof((yyval.temp_sym))); (yyval.temp_sym).param_binding_begin = ~0; @@ -3189,98 +3248,98 @@ yyreduce: case 126: /* Line 1455 of yacc.c */ -#line 1072 "program_parse.y" +#line 1131 "program_parse.y" { memcpy((yyval.state), (yyvsp[(1) - (1)].state), sizeof((yyval.state))); ;} break; case 127: /* Line 1455 of yacc.c */ -#line 1073 "program_parse.y" +#line 1132 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 128: /* Line 1455 of yacc.c */ -#line 1076 "program_parse.y" +#line 1135 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 129: /* Line 1455 of yacc.c */ -#line 1077 "program_parse.y" +#line 1136 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 130: /* Line 1455 of yacc.c */ -#line 1078 "program_parse.y" +#line 1137 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 131: /* Line 1455 of yacc.c */ -#line 1079 "program_parse.y" +#line 1138 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 132: /* Line 1455 of yacc.c */ -#line 1080 "program_parse.y" +#line 1139 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 133: /* Line 1455 of yacc.c */ -#line 1081 "program_parse.y" +#line 1140 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 134: /* Line 1455 of yacc.c */ -#line 1082 "program_parse.y" +#line 1141 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 135: /* Line 1455 of yacc.c */ -#line 1083 "program_parse.y" +#line 1142 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 136: /* Line 1455 of yacc.c */ -#line 1084 "program_parse.y" +#line 1143 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 137: /* Line 1455 of yacc.c */ -#line 1085 "program_parse.y" +#line 1144 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 138: /* Line 1455 of yacc.c */ -#line 1086 "program_parse.y" +#line 1145 "program_parse.y" { memcpy((yyval.state), (yyvsp[(2) - (2)].state), sizeof((yyval.state))); ;} break; case 139: /* Line 1455 of yacc.c */ -#line 1090 "program_parse.y" +#line 1149 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_MATERIAL; @@ -3292,7 +3351,7 @@ yyreduce: case 140: /* Line 1455 of yacc.c */ -#line 1099 "program_parse.y" +#line 1158 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3301,7 +3360,7 @@ yyreduce: case 141: /* Line 1455 of yacc.c */ -#line 1103 "program_parse.y" +#line 1162 "program_parse.y" { (yyval.integer) = STATE_EMISSION; ;} @@ -3310,7 +3369,7 @@ yyreduce: case 142: /* Line 1455 of yacc.c */ -#line 1107 "program_parse.y" +#line 1166 "program_parse.y" { (yyval.integer) = STATE_SHININESS; ;} @@ -3319,7 +3378,7 @@ yyreduce: case 143: /* Line 1455 of yacc.c */ -#line 1113 "program_parse.y" +#line 1172 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHT; @@ -3331,7 +3390,7 @@ yyreduce: case 144: /* Line 1455 of yacc.c */ -#line 1122 "program_parse.y" +#line 1181 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3340,7 +3399,7 @@ yyreduce: case 145: /* Line 1455 of yacc.c */ -#line 1126 "program_parse.y" +#line 1185 "program_parse.y" { (yyval.integer) = STATE_POSITION; ;} @@ -3349,7 +3408,7 @@ yyreduce: case 146: /* Line 1455 of yacc.c */ -#line 1130 "program_parse.y" +#line 1189 "program_parse.y" { if (!state->ctx->Extensions.EXT_point_parameters) { yyerror(& (yylsp[(1) - (1)]), state, "GL_ARB_point_parameters not supported"); @@ -3363,7 +3422,7 @@ yyreduce: case 147: /* Line 1455 of yacc.c */ -#line 1139 "program_parse.y" +#line 1198 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (2)].integer); ;} @@ -3372,7 +3431,7 @@ yyreduce: case 148: /* Line 1455 of yacc.c */ -#line 1143 "program_parse.y" +#line 1202 "program_parse.y" { (yyval.integer) = STATE_HALF_VECTOR; ;} @@ -3381,7 +3440,7 @@ yyreduce: case 149: /* Line 1455 of yacc.c */ -#line 1149 "program_parse.y" +#line 1208 "program_parse.y" { (yyval.integer) = STATE_SPOT_DIRECTION; ;} @@ -3390,7 +3449,7 @@ yyreduce: case 150: /* Line 1455 of yacc.c */ -#line 1155 "program_parse.y" +#line 1214 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (2)].state)[1]; @@ -3400,7 +3459,7 @@ yyreduce: case 151: /* Line 1455 of yacc.c */ -#line 1162 "program_parse.y" +#line 1221 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_AMBIENT; @@ -3410,7 +3469,7 @@ yyreduce: case 152: /* Line 1455 of yacc.c */ -#line 1167 "program_parse.y" +#line 1226 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTMODEL_SCENECOLOR; @@ -3421,7 +3480,7 @@ yyreduce: case 153: /* Line 1455 of yacc.c */ -#line 1175 "program_parse.y" +#line 1234 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_LIGHTPROD; @@ -3434,7 +3493,7 @@ yyreduce: case 155: /* Line 1455 of yacc.c */ -#line 1187 "program_parse.y" +#line 1246 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(3) - (3)].integer); @@ -3445,7 +3504,7 @@ yyreduce: case 156: /* Line 1455 of yacc.c */ -#line 1195 "program_parse.y" +#line 1254 "program_parse.y" { (yyval.integer) = STATE_TEXENV_COLOR; ;} @@ -3454,7 +3513,7 @@ yyreduce: case 157: /* Line 1455 of yacc.c */ -#line 1201 "program_parse.y" +#line 1260 "program_parse.y" { (yyval.integer) = STATE_AMBIENT; ;} @@ -3463,7 +3522,7 @@ yyreduce: case 158: /* Line 1455 of yacc.c */ -#line 1205 "program_parse.y" +#line 1264 "program_parse.y" { (yyval.integer) = STATE_DIFFUSE; ;} @@ -3472,7 +3531,7 @@ yyreduce: case 159: /* Line 1455 of yacc.c */ -#line 1209 "program_parse.y" +#line 1268 "program_parse.y" { (yyval.integer) = STATE_SPECULAR; ;} @@ -3481,7 +3540,7 @@ yyreduce: case 160: /* Line 1455 of yacc.c */ -#line 1215 "program_parse.y" +#line 1274 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxLights) { yyerror(& (yylsp[(1) - (1)]), state, "invalid light selector"); @@ -3495,7 +3554,7 @@ yyreduce: case 161: /* Line 1455 of yacc.c */ -#line 1226 "program_parse.y" +#line 1285 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_TEXGEN; @@ -3507,7 +3566,7 @@ yyreduce: case 162: /* Line 1455 of yacc.c */ -#line 1235 "program_parse.y" +#line 1294 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S; ;} @@ -3516,7 +3575,7 @@ yyreduce: case 163: /* Line 1455 of yacc.c */ -#line 1239 "program_parse.y" +#line 1298 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_OBJECT_S; ;} @@ -3525,7 +3584,7 @@ yyreduce: case 164: /* Line 1455 of yacc.c */ -#line 1244 "program_parse.y" +#line 1303 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_S - STATE_TEXGEN_EYE_S; ;} @@ -3534,7 +3593,7 @@ yyreduce: case 165: /* Line 1455 of yacc.c */ -#line 1248 "program_parse.y" +#line 1307 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_T - STATE_TEXGEN_EYE_S; ;} @@ -3543,7 +3602,7 @@ yyreduce: case 166: /* Line 1455 of yacc.c */ -#line 1252 "program_parse.y" +#line 1311 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_R - STATE_TEXGEN_EYE_S; ;} @@ -3552,7 +3611,7 @@ yyreduce: case 167: /* Line 1455 of yacc.c */ -#line 1256 "program_parse.y" +#line 1315 "program_parse.y" { (yyval.integer) = STATE_TEXGEN_EYE_Q - STATE_TEXGEN_EYE_S; ;} @@ -3561,7 +3620,7 @@ yyreduce: case 168: /* Line 1455 of yacc.c */ -#line 1262 "program_parse.y" +#line 1321 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3571,7 +3630,7 @@ yyreduce: case 169: /* Line 1455 of yacc.c */ -#line 1269 "program_parse.y" +#line 1328 "program_parse.y" { (yyval.integer) = STATE_FOG_COLOR; ;} @@ -3580,7 +3639,7 @@ yyreduce: case 170: /* Line 1455 of yacc.c */ -#line 1273 "program_parse.y" +#line 1332 "program_parse.y" { (yyval.integer) = STATE_FOG_PARAMS; ;} @@ -3589,7 +3648,7 @@ yyreduce: case 171: /* Line 1455 of yacc.c */ -#line 1279 "program_parse.y" +#line 1338 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_CLIPPLANE; @@ -3600,7 +3659,7 @@ yyreduce: case 172: /* Line 1455 of yacc.c */ -#line 1287 "program_parse.y" +#line 1346 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxClipPlanes) { yyerror(& (yylsp[(1) - (1)]), state, "invalid clip plane selector"); @@ -3614,7 +3673,7 @@ yyreduce: case 173: /* Line 1455 of yacc.c */ -#line 1298 "program_parse.y" +#line 1357 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = (yyvsp[(2) - (2)].integer); @@ -3624,7 +3683,7 @@ yyreduce: case 174: /* Line 1455 of yacc.c */ -#line 1305 "program_parse.y" +#line 1364 "program_parse.y" { (yyval.integer) = STATE_POINT_SIZE; ;} @@ -3633,7 +3692,7 @@ yyreduce: case 175: /* Line 1455 of yacc.c */ -#line 1309 "program_parse.y" +#line 1368 "program_parse.y" { (yyval.integer) = STATE_POINT_ATTENUATION; ;} @@ -3642,7 +3701,7 @@ yyreduce: case 176: /* Line 1455 of yacc.c */ -#line 1315 "program_parse.y" +#line 1374 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (5)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (5)].state)[1]; @@ -3655,7 +3714,7 @@ yyreduce: case 177: /* Line 1455 of yacc.c */ -#line 1325 "program_parse.y" +#line 1384 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (2)].state)[0]; (yyval.state)[1] = (yyvsp[(1) - (2)].state)[1]; @@ -3668,7 +3727,7 @@ yyreduce: case 178: /* Line 1455 of yacc.c */ -#line 1335 "program_parse.y" +#line 1394 "program_parse.y" { (yyval.state)[2] = 0; (yyval.state)[3] = 3; @@ -3678,7 +3737,7 @@ yyreduce: case 179: /* Line 1455 of yacc.c */ -#line 1340 "program_parse.y" +#line 1399 "program_parse.y" { /* It seems logical that the matrix row range specifier would have * to specify a range or more than one row (i.e., $5 > $3). @@ -3699,7 +3758,7 @@ yyreduce: case 180: /* Line 1455 of yacc.c */ -#line 1358 "program_parse.y" +#line 1417 "program_parse.y" { (yyval.state)[0] = (yyvsp[(2) - (3)].state)[0]; (yyval.state)[1] = (yyvsp[(2) - (3)].state)[1]; @@ -3710,7 +3769,7 @@ yyreduce: case 181: /* Line 1455 of yacc.c */ -#line 1366 "program_parse.y" +#line 1425 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3719,7 +3778,7 @@ yyreduce: case 182: /* Line 1455 of yacc.c */ -#line 1370 "program_parse.y" +#line 1429 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3728,7 +3787,7 @@ yyreduce: case 183: /* Line 1455 of yacc.c */ -#line 1376 "program_parse.y" +#line 1435 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVERSE; ;} @@ -3737,7 +3796,7 @@ yyreduce: case 184: /* Line 1455 of yacc.c */ -#line 1380 "program_parse.y" +#line 1439 "program_parse.y" { (yyval.integer) = STATE_MATRIX_TRANSPOSE; ;} @@ -3746,7 +3805,7 @@ yyreduce: case 185: /* Line 1455 of yacc.c */ -#line 1384 "program_parse.y" +#line 1443 "program_parse.y" { (yyval.integer) = STATE_MATRIX_INVTRANS; ;} @@ -3755,7 +3814,7 @@ yyreduce: case 186: /* Line 1455 of yacc.c */ -#line 1390 "program_parse.y" +#line 1449 "program_parse.y" { if ((yyvsp[(1) - (1)].integer) > 3) { yyerror(& (yylsp[(1) - (1)]), state, "invalid matrix row reference"); @@ -3769,7 +3828,7 @@ yyreduce: case 187: /* Line 1455 of yacc.c */ -#line 1401 "program_parse.y" +#line 1460 "program_parse.y" { (yyval.state)[0] = STATE_MODELVIEW_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3779,7 +3838,7 @@ yyreduce: case 188: /* Line 1455 of yacc.c */ -#line 1406 "program_parse.y" +#line 1465 "program_parse.y" { (yyval.state)[0] = STATE_PROJECTION_MATRIX; (yyval.state)[1] = 0; @@ -3789,7 +3848,7 @@ yyreduce: case 189: /* Line 1455 of yacc.c */ -#line 1411 "program_parse.y" +#line 1470 "program_parse.y" { (yyval.state)[0] = STATE_MVP_MATRIX; (yyval.state)[1] = 0; @@ -3799,7 +3858,7 @@ yyreduce: case 190: /* Line 1455 of yacc.c */ -#line 1416 "program_parse.y" +#line 1475 "program_parse.y" { (yyval.state)[0] = STATE_TEXTURE_MATRIX; (yyval.state)[1] = (yyvsp[(2) - (2)].integer); @@ -3809,7 +3868,7 @@ yyreduce: case 191: /* Line 1455 of yacc.c */ -#line 1421 "program_parse.y" +#line 1480 "program_parse.y" { yyerror(& (yylsp[(1) - (4)]), state, "GL_ARB_matrix_palette not supported"); YYERROR; @@ -3819,7 +3878,7 @@ yyreduce: case 192: /* Line 1455 of yacc.c */ -#line 1426 "program_parse.y" +#line 1485 "program_parse.y" { (yyval.state)[0] = STATE_PROGRAM_MATRIX; (yyval.state)[1] = (yyvsp[(3) - (4)].integer); @@ -3829,7 +3888,7 @@ yyreduce: case 193: /* Line 1455 of yacc.c */ -#line 1433 "program_parse.y" +#line 1492 "program_parse.y" { (yyval.integer) = 0; ;} @@ -3838,7 +3897,7 @@ yyreduce: case 194: /* Line 1455 of yacc.c */ -#line 1437 "program_parse.y" +#line 1496 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} @@ -3847,7 +3906,7 @@ yyreduce: case 195: /* Line 1455 of yacc.c */ -#line 1442 "program_parse.y" +#line 1501 "program_parse.y" { /* Since GL_ARB_vertex_blend isn't supported, only modelview matrix * zero is valid. @@ -3864,7 +3923,7 @@ yyreduce: case 196: /* Line 1455 of yacc.c */ -#line 1455 "program_parse.y" +#line 1514 "program_parse.y" { /* Since GL_ARB_matrix_palette isn't supported, just let any value * through here. The error will be generated later. @@ -3876,7 +3935,7 @@ yyreduce: case 197: /* Line 1455 of yacc.c */ -#line 1463 "program_parse.y" +#line 1522 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxProgramMatrices) { yyerror(& (yylsp[(1) - (1)]), state, "invalid program matrix selector"); @@ -3890,7 +3949,7 @@ yyreduce: case 198: /* Line 1455 of yacc.c */ -#line 1474 "program_parse.y" +#line 1533 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = STATE_DEPTH_RANGE; @@ -3900,7 +3959,7 @@ yyreduce: case 203: /* Line 1455 of yacc.c */ -#line 1486 "program_parse.y" +#line 1545 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3913,7 +3972,7 @@ yyreduce: case 204: /* Line 1455 of yacc.c */ -#line 1496 "program_parse.y" +#line 1555 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3923,7 +3982,7 @@ yyreduce: case 205: /* Line 1455 of yacc.c */ -#line 1501 "program_parse.y" +#line 1560 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3933,7 +3992,7 @@ yyreduce: case 206: /* Line 1455 of yacc.c */ -#line 1508 "program_parse.y" +#line 1567 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3946,7 +4005,7 @@ yyreduce: case 207: /* Line 1455 of yacc.c */ -#line 1518 "program_parse.y" +#line 1577 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3959,7 +4018,7 @@ yyreduce: case 208: /* Line 1455 of yacc.c */ -#line 1527 "program_parse.y" +#line 1586 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (1)].integer); (yyval.state)[1] = (yyvsp[(1) - (1)].integer); @@ -3969,7 +4028,7 @@ yyreduce: case 209: /* Line 1455 of yacc.c */ -#line 1532 "program_parse.y" +#line 1591 "program_parse.y" { (yyval.state)[0] = (yyvsp[(1) - (3)].integer); (yyval.state)[1] = (yyvsp[(3) - (3)].integer); @@ -3979,7 +4038,7 @@ yyreduce: case 210: /* Line 1455 of yacc.c */ -#line 1539 "program_parse.y" +#line 1598 "program_parse.y" { memset((yyval.state), 0, sizeof((yyval.state))); (yyval.state)[0] = state->state_param_enum; @@ -3992,7 +4051,7 @@ yyreduce: case 211: /* Line 1455 of yacc.c */ -#line 1549 "program_parse.y" +#line 1608 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxEnvParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid environment parameter reference"); @@ -4005,7 +4064,7 @@ yyreduce: case 212: /* Line 1455 of yacc.c */ -#line 1559 "program_parse.y" +#line 1618 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->limits->MaxLocalParams) { yyerror(& (yylsp[(1) - (1)]), state, "invalid local parameter reference"); @@ -4018,7 +4077,7 @@ yyreduce: case 217: /* Line 1455 of yacc.c */ -#line 1574 "program_parse.y" +#line 1633 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4031,7 +4090,7 @@ yyreduce: case 218: /* Line 1455 of yacc.c */ -#line 1584 "program_parse.y" +#line 1643 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(1) - (1)].real); @@ -4044,7 +4103,7 @@ yyreduce: case 219: /* Line 1455 of yacc.c */ -#line 1592 "program_parse.y" +#line 1651 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (float) (yyvsp[(1) - (1)].integer); @@ -4057,7 +4116,7 @@ yyreduce: case 220: /* Line 1455 of yacc.c */ -#line 1602 "program_parse.y" +#line 1661 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (3)].real); @@ -4070,7 +4129,7 @@ yyreduce: case 221: /* Line 1455 of yacc.c */ -#line 1610 "program_parse.y" +#line 1669 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (5)].real); @@ -4083,7 +4142,7 @@ yyreduce: case 222: /* Line 1455 of yacc.c */ -#line 1619 "program_parse.y" +#line 1678 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (7)].real); @@ -4096,7 +4155,7 @@ yyreduce: case 223: /* Line 1455 of yacc.c */ -#line 1628 "program_parse.y" +#line 1687 "program_parse.y" { (yyval.vector).count = 4; (yyval.vector).data[0] = (yyvsp[(2) - (9)].real); @@ -4109,7 +4168,7 @@ yyreduce: case 224: /* Line 1455 of yacc.c */ -#line 1638 "program_parse.y" +#line 1697 "program_parse.y" { (yyval.real) = ((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].real) : (yyvsp[(2) - (2)].real); ;} @@ -4118,7 +4177,7 @@ yyreduce: case 225: /* Line 1455 of yacc.c */ -#line 1642 "program_parse.y" +#line 1701 "program_parse.y" { (yyval.real) = (float)(((yyvsp[(1) - (2)].negate)) ? -(yyvsp[(2) - (2)].integer) : (yyvsp[(2) - (2)].integer)); ;} @@ -4127,42 +4186,42 @@ yyreduce: case 226: /* Line 1455 of yacc.c */ -#line 1647 "program_parse.y" +#line 1706 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 227: /* Line 1455 of yacc.c */ -#line 1648 "program_parse.y" +#line 1707 "program_parse.y" { (yyval.negate) = TRUE; ;} break; case 228: /* Line 1455 of yacc.c */ -#line 1649 "program_parse.y" +#line 1708 "program_parse.y" { (yyval.negate) = FALSE; ;} break; case 229: /* Line 1455 of yacc.c */ -#line 1652 "program_parse.y" +#line 1711 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 231: /* Line 1455 of yacc.c */ -#line 1655 "program_parse.y" +#line 1714 "program_parse.y" { (yyval.integer) = (yyvsp[(1) - (1)].integer); ;} break; case 233: /* Line 1455 of yacc.c */ -#line 1659 "program_parse.y" +#line 1718 "program_parse.y" { if (!declare_variable(state, (yyvsp[(3) - (3)].string), (yyvsp[(0) - (3)].integer), & (yylsp[(3) - (3)]))) { YYERROR; @@ -4173,7 +4232,7 @@ yyreduce: case 234: /* Line 1455 of yacc.c */ -#line 1665 "program_parse.y" +#line 1724 "program_parse.y" { if (!declare_variable(state, (yyvsp[(1) - (1)].string), (yyvsp[(0) - (1)].integer), & (yylsp[(1) - (1)]))) { YYERROR; @@ -4184,7 +4243,7 @@ yyreduce: case 235: /* Line 1455 of yacc.c */ -#line 1673 "program_parse.y" +#line 1732 "program_parse.y" { struct asm_symbol *const s = declare_variable(state, (yyvsp[(2) - (4)].string), at_output, & (yylsp[(2) - (4)])); @@ -4200,7 +4259,7 @@ yyreduce: case 236: /* Line 1455 of yacc.c */ -#line 1686 "program_parse.y" +#line 1745 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_HPOS; @@ -4214,7 +4273,7 @@ yyreduce: case 237: /* Line 1455 of yacc.c */ -#line 1695 "program_parse.y" +#line 1754 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_FOGC; @@ -4228,7 +4287,7 @@ yyreduce: case 238: /* Line 1455 of yacc.c */ -#line 1704 "program_parse.y" +#line 1763 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (2)].result); ;} @@ -4237,7 +4296,7 @@ yyreduce: case 239: /* Line 1455 of yacc.c */ -#line 1708 "program_parse.y" +#line 1767 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_PSIZ; @@ -4251,7 +4310,7 @@ yyreduce: case 240: /* Line 1455 of yacc.c */ -#line 1717 "program_parse.y" +#line 1776 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.result) = VERT_RESULT_TEX0 + (yyvsp[(3) - (3)].integer); @@ -4265,7 +4324,7 @@ yyreduce: case 241: /* Line 1455 of yacc.c */ -#line 1726 "program_parse.y" +#line 1785 "program_parse.y" { if (state->mode == ARB_fragment) { (yyval.result) = FRAG_RESULT_DEPTH; @@ -4279,7 +4338,7 @@ yyreduce: case 242: /* Line 1455 of yacc.c */ -#line 1737 "program_parse.y" +#line 1796 "program_parse.y" { (yyval.result) = (yyvsp[(2) - (3)].integer) + (yyvsp[(3) - (3)].integer); ;} @@ -4288,7 +4347,7 @@ yyreduce: case 243: /* Line 1455 of yacc.c */ -#line 1743 "program_parse.y" +#line 1802 "program_parse.y" { (yyval.integer) = (state->mode == ARB_vertex) ? VERT_RESULT_COL0 @@ -4299,7 +4358,7 @@ yyreduce: case 244: /* Line 1455 of yacc.c */ -#line 1749 "program_parse.y" +#line 1808 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_COL0; @@ -4313,7 +4372,7 @@ yyreduce: case 245: /* Line 1455 of yacc.c */ -#line 1758 "program_parse.y" +#line 1817 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = VERT_RESULT_BFC0; @@ -4327,7 +4386,7 @@ yyreduce: case 246: /* Line 1455 of yacc.c */ -#line 1769 "program_parse.y" +#line 1828 "program_parse.y" { (yyval.integer) = 0; ;} @@ -4336,7 +4395,7 @@ yyreduce: case 247: /* Line 1455 of yacc.c */ -#line 1773 "program_parse.y" +#line 1832 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 0; @@ -4350,7 +4409,7 @@ yyreduce: case 248: /* Line 1455 of yacc.c */ -#line 1782 "program_parse.y" +#line 1841 "program_parse.y" { if (state->mode == ARB_vertex) { (yyval.integer) = 1; @@ -4364,91 +4423,91 @@ yyreduce: case 249: /* Line 1455 of yacc.c */ -#line 1792 "program_parse.y" +#line 1851 "program_parse.y" { (yyval.integer) = 0; ;} break; case 250: /* Line 1455 of yacc.c */ -#line 1793 "program_parse.y" +#line 1852 "program_parse.y" { (yyval.integer) = 0; ;} break; case 251: /* Line 1455 of yacc.c */ -#line 1794 "program_parse.y" +#line 1853 "program_parse.y" { (yyval.integer) = 1; ;} break; case 252: /* Line 1455 of yacc.c */ -#line 1797 "program_parse.y" +#line 1856 "program_parse.y" { (yyval.integer) = 0; ;} break; case 253: /* Line 1455 of yacc.c */ -#line 1798 "program_parse.y" +#line 1857 "program_parse.y" { (yyval.integer) = 0; ;} break; case 254: /* Line 1455 of yacc.c */ -#line 1799 "program_parse.y" +#line 1858 "program_parse.y" { (yyval.integer) = 1; ;} break; case 255: /* Line 1455 of yacc.c */ -#line 1802 "program_parse.y" +#line 1861 "program_parse.y" { (yyval.integer) = 0; ;} break; case 256: /* Line 1455 of yacc.c */ -#line 1803 "program_parse.y" +#line 1862 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 257: /* Line 1455 of yacc.c */ -#line 1806 "program_parse.y" +#line 1865 "program_parse.y" { (yyval.integer) = 0; ;} break; case 258: /* Line 1455 of yacc.c */ -#line 1807 "program_parse.y" +#line 1866 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 259: /* Line 1455 of yacc.c */ -#line 1810 "program_parse.y" +#line 1869 "program_parse.y" { (yyval.integer) = 0; ;} break; case 260: /* Line 1455 of yacc.c */ -#line 1811 "program_parse.y" +#line 1870 "program_parse.y" { (yyval.integer) = (yyvsp[(2) - (3)].integer); ;} break; case 261: /* Line 1455 of yacc.c */ -#line 1815 "program_parse.y" +#line 1874 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureCoordUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture coordinate unit selector"); @@ -4462,7 +4521,7 @@ yyreduce: case 262: /* Line 1455 of yacc.c */ -#line 1826 "program_parse.y" +#line 1885 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureImageUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture image unit selector"); @@ -4476,7 +4535,7 @@ yyreduce: case 263: /* Line 1455 of yacc.c */ -#line 1837 "program_parse.y" +#line 1896 "program_parse.y" { if ((unsigned) (yyvsp[(1) - (1)].integer) >= state->MaxTextureUnits) { yyerror(& (yylsp[(1) - (1)]), state, "invalid texture unit selector"); @@ -4490,7 +4549,7 @@ yyreduce: case 264: /* Line 1455 of yacc.c */ -#line 1848 "program_parse.y" +#line 1907 "program_parse.y" { struct asm_symbol *exist = (struct asm_symbol *) _mesa_symbol_table_find_symbol(state->st, 0, (yyvsp[(2) - (4)].string)); @@ -4514,7 +4573,7 @@ yyreduce: /* Line 1455 of yacc.c */ -#line 4518 "program_parse.tab.c" +#line 4577 "program_parse.tab.c" default: break; } YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); @@ -4733,7 +4792,7 @@ yyreturn: /* Line 1675 of yacc.c */ -#line 1868 "program_parse.y" +#line 1927 "program_parse.y" struct asm_instruction * diff --git a/src/mesa/shader/program_parse.tab.h b/src/mesa/shader/program_parse.tab.h index e7264079e9..de08fb747f 100644 --- a/src/mesa/shader/program_parse.tab.h +++ b/src/mesa/shader/program_parse.tab.h @@ -171,10 +171,17 @@ typedef union YYSTYPE struct asm_vector vector; gl_inst_opcode opcode; + struct { + unsigned swz; + unsigned rgba_valid:1; + unsigned xyzw_valid:1; + unsigned negate:1; + } ext_swizzle; + /* Line 1676 of yacc.c */ -#line 178 "program_parse.tab.h" +#line 185 "program_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ diff --git a/src/mesa/shader/program_parse.y b/src/mesa/shader/program_parse.y index 1a214b38ae..b4ba5b03f0 100644 --- a/src/mesa/shader/program_parse.y +++ b/src/mesa/shader/program_parse.y @@ -121,6 +121,13 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, int negate; struct asm_vector vector; gl_inst_opcode opcode; + + struct { + unsigned swz; + unsigned rgba_valid:1; + unsigned xyzw_valid:1; + unsigned negate:1; + } ext_swizzle; } %token ARBvp_10 ARBfp_10 @@ -175,9 +182,9 @@ static struct asm_instruction *asm_instruction_ctor(gl_inst_opcode op, %type dstReg maskedDstReg maskedAddrReg %type srcReg scalarSrcReg swizzleSrcReg -%type scalarSuffix swizzleSuffix extendedSwizzle extSwizComp +%type scalarSuffix swizzleSuffix extendedSwizzle +%type extSwizComp extSwizSel %type optionalMask -%type extSwizSel %type progParamArray %type addrRegRelOffset addrRegPosOffset addrRegNegOffset @@ -529,17 +536,41 @@ maskedAddrReg: addrReg addrWriteMask extendedSwizzle: extSwizComp ',' extSwizComp ',' extSwizComp ',' extSwizComp { - $$.swizzle = MAKE_SWIZZLE4($1.swizzle, $3.swizzle, - $5.swizzle, $7.swizzle); - $$.mask = ($1.mask) | ($3.mask << 1) | ($5.mask << 2) - | ($7.mask << 3); + const unsigned xyzw_valid = + ($1.xyzw_valid << 0) + | ($3.xyzw_valid << 1) + | ($5.xyzw_valid << 2) + | ($7.xyzw_valid << 3); + const unsigned rgba_valid = + ($1.rgba_valid << 0) + | ($3.rgba_valid << 1) + | ($5.rgba_valid << 2) + | ($7.rgba_valid << 3); + + /* All of the swizzle components have to be valid in either RGBA + * or XYZW. Note that 0 and 1 are valid in both, so both masks + * can have some bits set. + * + * We somewhat deviate from the spec here. It would be really hard + * to figure out which component is the error, and there probably + * isn't a lot of benefit. + */ + if ((rgba_valid != 0x0f) && (xyzw_valid != 0x0f)) { + yyerror(& @1, state, "cannot combine RGBA and XYZW swizzle " + "components"); + YYERROR; + } + + $$.swizzle = MAKE_SWIZZLE4($1.swz, $3.swz, $5.swz, $7.swz); + $$.mask = ($1.negate) | ($3.negate << 1) | ($5.negate << 2) + | ($7.negate << 3); } ; extSwizComp: optionalSign extSwizSel { - $$.swizzle = $2; - $$.mask = ($1) ? 1 : 0; + $$ = $2; + $$.negate = ($1) ? 1 : 0; } ; @@ -550,7 +581,13 @@ extSwizSel: INTEGER YYERROR; } - $$ = ($1 == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; + $$.swz = ($1 == 0) ? SWIZZLE_ZERO : SWIZZLE_ONE; + + /* 0 and 1 are valid for both RGBA swizzle names and XYZW + * swizzle names. + */ + $$.xyzw_valid = 1; + $$.rgba_valid = 1; } | IDENTIFIER { @@ -561,17 +598,39 @@ extSwizSel: INTEGER switch ($1[0]) { case 'x': - $$ = SWIZZLE_X; + $$.swz = SWIZZLE_X; + $$.xyzw_valid = 1; break; case 'y': - $$ = SWIZZLE_Y; + $$.swz = SWIZZLE_Y; + $$.xyzw_valid = 1; break; case 'z': - $$ = SWIZZLE_Z; + $$.swz = SWIZZLE_Z; + $$.xyzw_valid = 1; break; case 'w': - $$ = SWIZZLE_W; + $$.swz = SWIZZLE_W; + $$.xyzw_valid = 1; + break; + + case 'r': + $$.swz = SWIZZLE_X; + $$.rgba_valid = 1; + break; + case 'g': + $$.swz = SWIZZLE_Y; + $$.rgba_valid = 1; break; + case 'b': + $$.swz = SWIZZLE_Z; + $$.rgba_valid = 1; + break; + case 'a': + $$.swz = SWIZZLE_W; + $$.rgba_valid = 1; + break; + default: yyerror(& @1, state, "invalid extended swizzle selector"); YYERROR; -- cgit v1.2.3 From ea8db5c3329bdee6ea0ca9b347730ec348d7c0af Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Jul 2009 11:05:07 -0700 Subject: ARB prog: Revert some changes to debug output --- src/mesa/shader/arbprogparse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 42a5378999..36ddc373b0 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -4073,10 +4073,8 @@ _mesa_parse_arb_vertex_program(GLcontext *ctx, GLenum target, _mesa_free_parameter_list(program->Base.Parameters); program->Base.Parameters = prog.Parameters; -#if 1 || DEBUG_VP +#if DEBUG_VP _mesa_printf("____________Vertex program %u __________\n", program->Base.Id); _mesa_print_program(&program->Base); - _mesa_printf("inputs = 0x%04x, outputs = 0x%04x\n", program->Base.InputsRead, - program->Base.OutputsWritten); #endif } -- cgit v1.2.3 From 0b5af41c6fae2809f4567a7cecbd207e5e4f3ab5 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Thu, 30 Jul 2009 11:19:56 -0700 Subject: ARB prog parser: Delete the old parser --- src/mesa/shader/arbprogparse.c | 3861 -------------------------------------- src/mesa/shader/arbprogram.syn | 2824 ---------------------------- src/mesa/shader/arbprogram_syn.h | 1350 ------------- 3 files changed, 8035 deletions(-) delete mode 100644 src/mesa/shader/arbprogram.syn delete mode 100644 src/mesa/shader/arbprogram_syn.h diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index 36ddc373b0..8596aa2eea 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -65,3867 +65,6 @@ having three separate program parameter arrays. #include "prog_instruction.h" #include "program_parser.h" -/** - * This is basically a union of the vertex_program and fragment_program - * structs that we can use to parse the program into - * - * XXX we can probably get rid of this entirely someday. - */ -struct arb_program -{ - struct gl_program Base; - - GLuint Position; /* Just used for error reporting while parsing */ - GLuint MajorVersion; - GLuint MinorVersion; - - /* ARB_vertex_progmra options */ - GLboolean HintPositionInvariant; - - /* ARB_fragment_progmra options */ - GLenum PrecisionOption; /* GL_DONT_CARE, GL_NICEST or GL_FASTEST */ - GLenum FogOption; /* GL_NONE, GL_LINEAR, GL_EXP or GL_EXP2 */ - - /* ARB_fragment_program specifics */ - GLbitfield TexturesUsed[MAX_TEXTURE_IMAGE_UNITS]; - GLbitfield ShadowSamplers; - GLuint NumAluInstructions; - GLuint NumTexInstructions; - GLuint NumTexIndirections; - - GLboolean UsesKill; -}; - - -#if 0 -/* TODO: - * Fragment Program Stuff: - * ----------------------------------------------------- - * - * - things from Michal's email - * + overflow on atoi - * + not-overflowing floats (don't use parse_integer..) - * + can remove range checking in arbparse.c - * - * - check all limits of number of various variables - * + parameters - * - * - test! test! test! - * - * Vertex Program Stuff: - * ----------------------------------------------------- - * - Optimize param array usage and count limits correctly, see spec, - * section 2.14.3.7 - * + Record if an array is reference absolutly or relatively (or both) - * + For absolute arrays, store a bitmap of accesses - * + For single parameters, store an access flag - * + After parsing, make a parameter cleanup and merging pass, where - * relative arrays are layed out first, followed by abs arrays, and - * finally single state. - * + Remap offsets for param src and dst registers - * + Now we can properly count parameter usage - * - * - Multiple state binding errors in param arrays (see spec, just before - * section 2.14.3.3) - * - grep for XXX - * - * Mesa Stuff - * ----------------------------------------------------- - * - User clipping planes vs. PositionInvariant - * - Is it sufficient to just multiply by the mvp to transform in the - * PositionInvariant case? Or do we need something more involved? - * - * - vp_src swizzle is GLubyte, fp_src swizzle is GLuint - * - fetch state listed in program_parameters list - * + WTF should this go??? - * + currently in nvvertexec.c and s_nvfragprog.c - * - * - allow for multiple address registers (and fetch address regs properly) - * - * Cosmetic Stuff - * ----------------------------------------------------- - * - remove any leftover unused grammer.c stuff (dict_ ?) - * - fix grammer.c error handling so its not static - * - #ifdef around stuff pertaining to extentions - * - * Outstanding Questions: - * ----------------------------------------------------- - * - ARB_matrix_palette / ARB_vertex_blend -- not supported - * what gets hacked off because of this: - * + VERTEX_ATTRIB_MATRIXINDEX - * + VERTEX_ATTRIB_WEIGHT - * + MATRIX_MODELVIEW - * + MATRIX_PALETTE - * - * - When can we fetch env/local params from their own register files, and - * when to we have to fetch them into the main state register file? - * (think arrays) - * - * Grammar Changes: - * ----------------------------------------------------- - */ - -/* Changes since moving the file to shader directory - -2004-III-4 ------------------------------------------------------------ -- added #include "grammar_mesa.h" -- removed grammar specific code part (it resides now in grammar.c) -- added GL_ARB_fragment_program_shadow tokens -- modified #include "arbparse_syn.h" -- major changes inside _mesa_parse_arb_program() -- check the program string for '\0' characters -- copy the program string to a one-byte-longer location to have - it null-terminated -- position invariance test (not writing to result.position) moved - to syntax part -*/ - -typedef GLubyte *production; - - -/** - * This is the text describing the rules to parse the grammar - */ -LONGSTRING static char arb_grammar_text[] = -#include "arbprogram_syn.h" -; - -/** - * These should match up with the values defined in arbprogram.syn - */ - -/* - Changes: - - changed and merged V_* and F_* opcode values to OP_*. - - added GL_ARB_fragment_program_shadow specific tokens (michal) -*/ -#define REVISION 0x0a - -/* program type */ -#define FRAGMENT_PROGRAM 0x01 -#define VERTEX_PROGRAM 0x02 - -/* program section */ -#define OPTION 0x01 -#define INSTRUCTION 0x02 -#define DECLARATION 0x03 -#define END 0x04 - -/* GL_ARB_fragment_program option */ -#define ARB_PRECISION_HINT_FASTEST 0x00 -#define ARB_PRECISION_HINT_NICEST 0x01 -#define ARB_FOG_EXP 0x02 -#define ARB_FOG_EXP2 0x03 -#define ARB_FOG_LINEAR 0x04 - -/* GL_ARB_vertex_program option */ -#define ARB_POSITION_INVARIANT 0x05 - -/* GL_ARB_fragment_program_shadow option */ -#define ARB_FRAGMENT_PROGRAM_SHADOW 0x06 - -/* GL_ARB_draw_buffers option */ -#define ARB_DRAW_BUFFERS 0x07 - -/* GL_MESA_texture_array option */ -#define MESA_TEXTURE_ARRAY 0x08 - -/* GL_ARB_fragment_program instruction class */ -#define OP_ALU_INST 0x00 -#define OP_TEX_INST 0x01 - -/* GL_ARB_vertex_program instruction class */ -/* OP_ALU_INST */ - -/* GL_ARB_fragment_program instruction type */ -#define OP_ALU_VECTOR 0x00 -#define OP_ALU_SCALAR 0x01 -#define OP_ALU_BINSC 0x02 -#define OP_ALU_BIN 0x03 -#define OP_ALU_TRI 0x04 -#define OP_ALU_SWZ 0x05 -#define OP_TEX_SAMPLE 0x06 -#define OP_TEX_KIL 0x07 - -/* GL_ARB_vertex_program instruction type */ -#define OP_ALU_ARL 0x08 -/* OP_ALU_VECTOR */ -/* OP_ALU_SCALAR */ -/* OP_ALU_BINSC */ -/* OP_ALU_BIN */ -/* OP_ALU_TRI */ -/* OP_ALU_SWZ */ - -/* GL_ARB_fragment_program instruction code */ -#define OP_ABS 0x00 -#define OP_ABS_SAT 0x1B -#define OP_FLR 0x09 -#define OP_FLR_SAT 0x26 -#define OP_FRC 0x0A -#define OP_FRC_SAT 0x27 -#define OP_LIT 0x0C -#define OP_LIT_SAT 0x2A -#define OP_MOV 0x11 -#define OP_MOV_SAT 0x30 -#define OP_COS 0x1F -#define OP_COS_SAT 0x20 -#define OP_EX2 0x07 -#define OP_EX2_SAT 0x25 -#define OP_LG2 0x0B -#define OP_LG2_SAT 0x29 -#define OP_RCP 0x14 -#define OP_RCP_SAT 0x33 -#define OP_RSQ 0x15 -#define OP_RSQ_SAT 0x34 -#define OP_SIN 0x38 -#define OP_SIN_SAT 0x39 -#define OP_SCS 0x35 -#define OP_SCS_SAT 0x36 -#define OP_POW 0x13 -#define OP_POW_SAT 0x32 -#define OP_ADD 0x01 -#define OP_ADD_SAT 0x1C -#define OP_DP3 0x03 -#define OP_DP3_SAT 0x21 -#define OP_DP4 0x04 -#define OP_DP4_SAT 0x22 -#define OP_DPH 0x05 -#define OP_DPH_SAT 0x23 -#define OP_DST 0x06 -#define OP_DST_SAT 0x24 -#define OP_MAX 0x0F -#define OP_MAX_SAT 0x2E -#define OP_MIN 0x10 -#define OP_MIN_SAT 0x2F -#define OP_MUL 0x12 -#define OP_MUL_SAT 0x31 -#define OP_SGE 0x16 -#define OP_SGE_SAT 0x37 -#define OP_SLT 0x17 -#define OP_SLT_SAT 0x3A -#define OP_SUB 0x18 -#define OP_SUB_SAT 0x3B -#define OP_XPD 0x1A -#define OP_XPD_SAT 0x43 -#define OP_CMP 0x1D -#define OP_CMP_SAT 0x1E -#define OP_LRP 0x2B -#define OP_LRP_SAT 0x2C -#define OP_MAD 0x0E -#define OP_MAD_SAT 0x2D -#define OP_SWZ 0x19 -#define OP_SWZ_SAT 0x3C -#define OP_TEX 0x3D -#define OP_TEX_SAT 0x3E -#define OP_TXB 0x3F -#define OP_TXB_SAT 0x40 -#define OP_TXP 0x41 -#define OP_TXP_SAT 0x42 -#define OP_KIL 0x28 - -/* GL_ARB_vertex_program instruction code */ -#define OP_ARL 0x02 -/* OP_ABS */ -/* OP_FLR */ -/* OP_FRC */ -/* OP_LIT */ -/* OP_MOV */ -/* OP_EX2 */ -#define OP_EXP 0x08 -/* OP_LG2 */ -#define OP_LOG 0x0D -/* OP_RCP */ -/* OP_RSQ */ -/* OP_POW */ -/* OP_ADD */ -/* OP_DP3 */ -/* OP_DP4 */ -/* OP_DPH */ -/* OP_DST */ -/* OP_MAX */ -/* OP_MIN */ -/* OP_MUL */ -/* OP_SGE */ -/* OP_SLT */ -/* OP_SUB */ -/* OP_XPD */ -/* OP_MAD */ -/* OP_SWZ */ - -/* fragment attribute binding */ -#define FRAGMENT_ATTRIB_COLOR 0x01 -#define FRAGMENT_ATTRIB_TEXCOORD 0x02 -#define FRAGMENT_ATTRIB_FOGCOORD 0x03 -#define FRAGMENT_ATTRIB_POSITION 0x04 - -/* vertex attribute binding */ -#define VERTEX_ATTRIB_POSITION 0x01 -#define VERTEX_ATTRIB_WEIGHT 0x02 -#define VERTEX_ATTRIB_NORMAL 0x03 -#define VERTEX_ATTRIB_COLOR 0x04 -#define VERTEX_ATTRIB_FOGCOORD 0x05 -#define VERTEX_ATTRIB_TEXCOORD 0x06 -#define VERTEX_ATTRIB_MATRIXINDEX 0x07 -#define VERTEX_ATTRIB_GENERIC 0x08 - -/* fragment result binding */ -#define FRAGMENT_RESULT_COLOR 0x01 -#define FRAGMENT_RESULT_DEPTH 0x02 - -/* vertex result binding */ -#define VERTEX_RESULT_POSITION 0x01 -#define VERTEX_RESULT_COLOR 0x02 -#define VERTEX_RESULT_FOGCOORD 0x03 -#define VERTEX_RESULT_POINTSIZE 0x04 -#define VERTEX_RESULT_TEXCOORD 0x05 - -/* texture target */ -#define TEXTARGET_1D 0x01 -#define TEXTARGET_2D 0x02 -#define TEXTARGET_3D 0x03 -#define TEXTARGET_RECT 0x04 -#define TEXTARGET_CUBE 0x05 -/* GL_ARB_fragment_program_shadow */ -#define TEXTARGET_SHADOW1D 0x06 -#define TEXTARGET_SHADOW2D 0x07 -#define TEXTARGET_SHADOWRECT 0x08 -/* GL_MESA_texture_array */ -#define TEXTARGET_1D_ARRAY 0x09 -#define TEXTARGET_2D_ARRAY 0x0a -#define TEXTARGET_SHADOW1D_ARRAY 0x0b -#define TEXTARGET_SHADOW2D_ARRAY 0x0c - -/* face type */ -#define FACE_FRONT 0x00 -#define FACE_BACK 0x01 - -/* color type */ -#define COLOR_PRIMARY 0x00 -#define COLOR_SECONDARY 0x01 - -/* component */ -#define COMPONENT_X 0x00 -#define COMPONENT_Y 0x01 -#define COMPONENT_Z 0x02 -#define COMPONENT_W 0x03 -#define COMPONENT_0 0x04 -#define COMPONENT_1 0x05 - -/* array index type */ -#define ARRAY_INDEX_ABSOLUTE 0x00 -#define ARRAY_INDEX_RELATIVE 0x01 - -/* matrix name */ -#define MATRIX_MODELVIEW 0x01 -#define MATRIX_PROJECTION 0x02 -#define MATRIX_MVP 0x03 -#define MATRIX_TEXTURE 0x04 -#define MATRIX_PALETTE 0x05 -#define MATRIX_PROGRAM 0x06 - -/* matrix modifier */ -#define MATRIX_MODIFIER_IDENTITY 0x00 -#define MATRIX_MODIFIER_INVERSE 0x01 -#define MATRIX_MODIFIER_TRANSPOSE 0x02 -#define MATRIX_MODIFIER_INVTRANS 0x03 - -/* constant type */ -#define CONSTANT_SCALAR 0x01 -#define CONSTANT_VECTOR 0x02 - -/* program param type */ -#define PROGRAM_PARAM_ENV 0x01 -#define PROGRAM_PARAM_LOCAL 0x02 - -/* register type */ -#define REGISTER_ATTRIB 0x01 -#define REGISTER_PARAM 0x02 -#define REGISTER_RESULT 0x03 -#define REGISTER_ESTABLISHED_NAME 0x04 - -/* param binding */ -#define PARAM_NULL 0x00 -#define PARAM_ARRAY_ELEMENT 0x01 -#define PARAM_STATE_ELEMENT 0x02 -#define PARAM_PROGRAM_ELEMENT 0x03 -#define PARAM_PROGRAM_ELEMENTS 0x04 -#define PARAM_CONSTANT 0x05 - -/* param state property */ -#define STATE_MATERIAL_PARSER 0x01 -#define STATE_LIGHT_PARSER 0x02 -#define STATE_LIGHT_MODEL 0x03 -#define STATE_LIGHT_PROD 0x04 -#define STATE_FOG 0x05 -#define STATE_MATRIX_ROWS 0x06 -/* GL_ARB_fragment_program */ -#define STATE_TEX_ENV 0x07 -#define STATE_DEPTH 0x08 -/* GL_ARB_vertex_program */ -#define STATE_TEX_GEN 0x09 -#define STATE_CLIP_PLANE 0x0A -#define STATE_POINT 0x0B - -/* state material property */ -#define MATERIAL_AMBIENT 0x01 -#define MATERIAL_DIFFUSE 0x02 -#define MATERIAL_SPECULAR 0x03 -#define MATERIAL_EMISSION 0x04 -#define MATERIAL_SHININESS 0x05 - -/* state light property */ -#define LIGHT_AMBIENT 0x01 -#define LIGHT_DIFFUSE 0x02 -#define LIGHT_SPECULAR 0x03 -#define LIGHT_POSITION 0x04 -#define LIGHT_ATTENUATION 0x05 -#define LIGHT_HALF 0x06 -#define LIGHT_SPOT_DIRECTION 0x07 - -/* state light model property */ -#define LIGHT_MODEL_AMBIENT 0x01 -#define LIGHT_MODEL_SCENECOLOR 0x02 - -/* state light product property */ -#define LIGHT_PROD_AMBIENT 0x01 -#define LIGHT_PROD_DIFFUSE 0x02 -#define LIGHT_PROD_SPECULAR 0x03 - -/* state texture environment property */ -#define TEX_ENV_COLOR 0x01 - -/* state texture generation coord property */ -#define TEX_GEN_EYE 0x01 -#define TEX_GEN_OBJECT 0x02 - -/* state fog property */ -#define FOG_COLOR 0x01 -#define FOG_PARAMS 0x02 - -/* state depth property */ -#define DEPTH_RANGE 0x01 - -/* state point parameters property */ -#define POINT_SIZE 0x01 -#define POINT_ATTENUATION 0x02 - -/* declaration */ -#define ATTRIB 0x01 -#define PARAM 0x02 -#define TEMP 0x03 -#define OUTPUT 0x04 -#define ALIAS 0x05 -/* GL_ARB_vertex_program */ -#define ADDRESS 0x06 - -/*----------------------------------------------------------------------- - * From here on down is the semantic checking portion - * - */ - -/** - * Variable Table Handling functions - */ -typedef enum -{ - vt_none, - vt_address, - vt_attrib, - vt_param, - vt_temp, - vt_output, - vt_alias -} var_type; - - -/** - * Setting an explicit field for each of the binding properties is a bit - * wasteful of space, but it should be much more clear when reading later on.. - */ -struct var_cache -{ - const GLubyte *name; /* don't free() - no need */ - var_type type; - GLuint address_binding; /* The index of the address register we should - * be using */ - GLuint attrib_binding; /* For type vt_attrib, see nvfragprog.h for values */ - GLuint attrib_is_generic; /* If the attrib was specified through a generic - * vertex attrib */ - GLuint temp_binding; /* The index of the temp register we are to use */ - GLuint output_binding; /* Output/result register number */ - struct var_cache *alias_binding; /* For type vt_alias, points to the var_cache entry - * that this is aliased to */ - GLuint param_binding_type; /* {PROGRAM_STATE_VAR, PROGRAM_LOCAL_PARAM, - * PROGRAM_ENV_PARAM} */ - GLuint param_binding_begin; /* This is the offset into the program_parameter_list where - * the tokens representing our bound state (or constants) - * start */ - GLuint param_binding_length; /* This is how many entries in the the program_parameter_list - * we take up with our state tokens or constants. Note that - * this is _not_ the same as the number of param registers - * we eventually use */ - GLuint swizzle; /**< swizzle to access this variable */ - struct var_cache *next; -}; - -static GLvoid -var_cache_create (struct var_cache **va) -{ - *va = (struct var_cache *) _mesa_malloc (sizeof (struct var_cache)); - if (*va) { - (**va).name = NULL; - (**va).type = vt_none; - (**va).attrib_binding = ~0; - (**va).attrib_is_generic = 0; - (**va).temp_binding = ~0; - (**va).output_binding = ~0; - (**va).param_binding_type = ~0; - (**va).param_binding_begin = ~0; - (**va).param_binding_length = ~0; - (**va).alias_binding = NULL; - (**va).swizzle = SWIZZLE_XYZW; - (**va).next = NULL; - } -} - -static GLvoid -var_cache_destroy (struct var_cache **va) -{ - if (*va) { - var_cache_destroy (&(**va).next); - _mesa_free (*va); - *va = NULL; - } -} - -static GLvoid -var_cache_append (struct var_cache **va, struct var_cache *nv) -{ - if (*va) - var_cache_append (&(**va).next, nv); - else - *va = nv; -} - -static struct var_cache * -var_cache_find (struct var_cache *va, const GLubyte * name) -{ - /*struct var_cache *first = va;*/ - - while (va) { - if (!_mesa_strcmp ( (const char*) name, (const char*) va->name)) { - if (va->type == vt_alias) - return va->alias_binding; - return va; - } - - va = va->next; - } - - return NULL; -} - - - -/** - * Called when an error is detected while parsing/compiling a program. - * Sets the ctx->Program.ErrorString field to descript and records a - * GL_INVALID_OPERATION error. - * \param position position of error in program string - * \param descrip verbose error description - */ -static void -program_error(GLcontext *ctx, GLint position, const char *descrip) -{ - if (descrip) { - const char *prefix = "glProgramString(", *suffix = ")"; - char *str = (char *) _mesa_malloc(_mesa_strlen(descrip) + - _mesa_strlen(prefix) + - _mesa_strlen(suffix) + 1); - if (str) { - _mesa_sprintf(str, "%s%s%s", prefix, descrip, suffix); - _mesa_error(ctx, GL_INVALID_OPERATION, str); - _mesa_free(str); - } - } - _mesa_set_program_error(ctx, position, descrip); -} - - -/** - * As above, but with an extra string parameter for more info. - */ -static void -program_error2(GLcontext *ctx, GLint position, const char *descrip, - const char *var) -{ - if (descrip) { - const char *prefix = "glProgramString(", *suffix = ")"; - char *str = (char *) _mesa_malloc(_mesa_strlen(descrip) + - _mesa_strlen(": ") + - _mesa_strlen(var) + - _mesa_strlen(prefix) + - _mesa_strlen(suffix) + 1); - if (str) { - _mesa_sprintf(str, "%s%s: %s%s", prefix, descrip, var, suffix); - _mesa_error(ctx, GL_INVALID_OPERATION, str); - _mesa_free(str); - } - } - { - char *str = (char *) _mesa_malloc(_mesa_strlen(descrip) + - _mesa_strlen(": ") + - _mesa_strlen(var) + 1); - if (str) { - _mesa_sprintf(str, "%s: %s", descrip, var); - } - _mesa_set_program_error(ctx, position, str); - if (str) { - _mesa_free(str); - } - } -} - - - -/** - * constructs an integer from 4 GLubytes in LE format - */ -static GLuint -parse_position (const GLubyte ** inst) -{ - GLuint value; - - value = (GLuint) (*(*inst)++); - value += (GLuint) (*(*inst)++) * 0x100; - value += (GLuint) (*(*inst)++) * 0x10000; - value += (GLuint) (*(*inst)++) * 0x1000000; - - return value; -} - -/** - * This will, given a string, lookup the string as a variable name in the - * var cache. If the name is found, the var cache node corresponding to the - * var name is returned. If it is not found, a new entry is allocated - * - * \param I Points into the binary array where the string identifier begins - * \param found 1 if the string was found in the var_cache, 0 if it was allocated - * \return The location on the var_cache corresponding the the string starting at I - */ -static struct var_cache * -parse_string (const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program, GLuint * found) -{ - const GLubyte *i = *inst; - struct var_cache *va = NULL; - (void) Program; - - *inst += _mesa_strlen ((char *) i) + 1; - - va = var_cache_find (*vc_head, i); - - if (va) { - *found = 1; - return va; - } - - *found = 0; - var_cache_create (&va); - va->name = (const GLubyte *) i; - - var_cache_append (vc_head, va); - - return va; -} - -static char * -parse_string_without_adding (const GLubyte ** inst, struct arb_program *Program) -{ - const GLubyte *i = *inst; - (void) Program; - - *inst += _mesa_strlen ((char *) i) + 1; - - return (char *) i; -} - -/** - * \return -1 if we parse '-', return 1 otherwise - */ -static GLint -parse_sign (const GLubyte ** inst) -{ - /*return *(*inst)++ != '+'; */ - - if (**inst == '-') { - (*inst)++; - return -1; - } - else if (**inst == '+') { - (*inst)++; - return 1; - } - - return 1; -} - -/** - * parses and returns signed integer - */ -static GLint -parse_integer (const GLubyte ** inst, struct arb_program *Program) -{ - GLint sign; - GLint value; - - /* check if *inst points to '+' or '-' - * if yes, grab the sign and increment *inst - */ - sign = parse_sign (inst); - - /* now check if *inst points to 0 - * if yes, increment the *inst and return the default value - */ - if (**inst == 0) { - (*inst)++; - return 0; - } - - /* parse the integer as you normally would do it */ - value = _mesa_atoi (parse_string_without_adding (inst, Program)); - - /* now, after terminating 0 there is a position - * to parse it - parse_position() - */ - Program->Position = parse_position (inst); - - return value * sign; -} - -/** - Accumulate this string of digits, and return them as - a large integer represented in floating point (for range). - If scale is not NULL, also accumulates a power-of-ten - integer scale factor that represents the number of digits - in the string. -*/ -static GLdouble -parse_float_string(const GLubyte ** inst, struct arb_program *Program, GLdouble *scale) -{ - GLdouble value = 0.0; - GLdouble oscale = 1.0; - - if (**inst == 0) { /* this string of digits is empty-- do nothing */ - (*inst)++; - } - else { /* nonempty string-- parse out the digits */ - while (**inst >= '0' && **inst <= '9') { - GLubyte digit = *((*inst)++); - value = value * 10.0 + (GLint) (digit - '0'); - oscale *= 10.0; - } - assert(**inst == 0); /* integer string should end with 0 */ - (*inst)++; /* skip over terminating 0 */ - Program->Position = parse_position(inst); /* skip position (from integer) */ - } - if (scale) - *scale = oscale; - return value; -} - -/** - Parse an unsigned floating-point number from this stream of tokenized - characters. Example floating-point formats supported: - 12.34 - 12 - 0.34 - .34 - 12.34e-4 - */ -static GLfloat -parse_float (const GLubyte ** inst, struct arb_program *Program) -{ - GLint exponent; - GLdouble whole, fraction, fracScale = 1.0; - - whole = parse_float_string(inst, Program, 0); - fraction = parse_float_string(inst, Program, &fracScale); - - /* Parse signed exponent */ - exponent = parse_integer(inst, Program); /* This is the exponent */ - - /* Assemble parts of floating-point number: */ - return (GLfloat) ((whole + fraction / fracScale) * - _mesa_pow(10.0, (GLfloat) exponent)); -} - - -/** - */ -static GLfloat -parse_signed_float (const GLubyte ** inst, struct arb_program *Program) -{ - GLint sign = parse_sign (inst); - GLfloat value = parse_float (inst, Program); - return value * sign; -} - -/** - * This picks out a constant value from the parsed array. The constant vector is r - * returned in the *values array, which should be of length 4. - * - * \param values - return the vector constant values. - * \param size - returns the number elements in valuesOut [1..4] - */ -static GLvoid -parse_constant(const GLubyte ** inst, GLfloat *values, GLint *size, - struct arb_program *Program, - GLboolean use) -{ - GLuint components, i; - - switch (*(*inst)++) { - case CONSTANT_SCALAR: - if (use == GL_TRUE) { - values[0] = - values[1] = - values[2] = values[3] = parse_float (inst, Program); - } - else { - values[0] = - values[1] = - values[2] = values[3] = parse_signed_float (inst, Program); - } - *size = 1; - break; - case CONSTANT_VECTOR: - values[0] = values[1] = values[2] = 0; - values[3] = 1; - components = *(*inst)++; - for (i = 0; i < components; i++) { - values[i] = parse_signed_float (inst, Program); - } - *size = 4; - break; - default: - _mesa_problem(NULL, "unexpected case in parse_constant()"); - values[0] = 0.0F; - *size = 0; - } -} - -/** - * \param offset The offset from the address register that we should - * address - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_relative_offset(GLcontext *ctx, const GLubyte **inst, - struct arb_program *Program, GLint *offset) -{ - (void) ctx; - *offset = parse_integer(inst, Program); - return 0; -} - -/** - * \param color 0 if color type is primary, 1 if color type is secondary - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_color_type (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Program, - GLint * color) -{ - (void) ctx; (void) Program; - *color = *(*inst)++ != COLOR_PRIMARY; - return 0; -} - -/** - * Get an integer corresponding to a generic vertex attribute. - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_generic_attrib_num(GLcontext *ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint *attrib) -{ - GLint i = parse_integer(inst, Program); - - if ((i < 0) || (i >= MAX_VERTEX_GENERIC_ATTRIBS)) - { - program_error(ctx, Program->Position, - "Invalid generic vertex attribute index"); - return 1; - } - - *attrib = (GLuint) i; - - return 0; -} - - -/** - * \param color The index of the color buffer to write into - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_output_color_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint * color) -{ - GLint i = parse_integer (inst, Program); - - if ((i < 0) || (i >= (int)ctx->Const.MaxDrawBuffers)) { - *color = 0; - program_error(ctx, Program->Position, "Invalid draw buffer index"); - return 1; - } - - *color = (GLuint) i; - return 0; -} - - -/** - * Validate the index of a texture coordinate - * - * \param coord The texture unit index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_texcoord_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint * coord) -{ - GLint i = parse_integer (inst, Program); - - if ((i < 0) || (i >= (int)ctx->Const.MaxTextureCoordUnits)) { - program_error(ctx, Program->Position, "Invalid texture coordinate index"); - return 1; - } - - *coord = (GLuint) i; - return 0; -} - - -/** - * Validate the index of a texture image unit - * - * \param coord The texture unit index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_teximage_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLuint * coord) -{ - GLint i = parse_integer (inst, Program); - - if ((i < 0) || (i >= (int)ctx->Const.MaxTextureImageUnits)) { - char s[100]; - _mesa_snprintf(s, sizeof(s), "Invalid texture image index %d (%u is max)", - i, ctx->Const.MaxTextureImageUnits); - program_error(ctx, Program->Position, s); - return 1; - } - - *coord = (GLuint) i; - return 0; -} - - -/** - * \param coord The weight index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_weight_num (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Program, - GLint * coord) -{ - *coord = parse_integer (inst, Program); - - if ((*coord < 0) || (*coord >= 1)) { - program_error(ctx, Program->Position, "Invalid weight index"); - return 1; - } - - return 0; -} - -/** - * \param coord The clip plane index - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_clipplane_num (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, GLint * coord) -{ - *coord = parse_integer (inst, Program); - - if ((*coord < 0) || (*coord >= (GLint) ctx->Const.MaxClipPlanes)) { - program_error(ctx, Program->Position, "Invalid clip plane index"); - return 1; - } - - return 0; -} - - -/** - * \return 0 on front face, 1 on back face - */ -static GLuint -parse_face_type (const GLubyte ** inst) -{ - switch (*(*inst)++) { - case FACE_FRONT: - return 0; - - case FACE_BACK: - return 1; - } - return 0; -} - - -/** - * Given a matrix and a modifier token on the binary array, return tokens - * that _mesa_fetch_state() [program.c] can understand. - * - * \param matrix - the matrix we are talking about - * \param matrix_idx - the index of the matrix we have (for texture & program matricies) - * \param matrix_modifier - the matrix modifier (trans, inv, etc) - * \return 0 on sucess, 1 on failure - */ -static GLuint -parse_matrix (GLcontext * ctx, const GLubyte ** inst, struct arb_program *Program, - GLint * matrix, GLint * matrix_idx, GLint * matrix_modifier) -{ - GLubyte mat = *(*inst)++; - - *matrix_idx = 0; - - switch (mat) { - case MATRIX_MODELVIEW: - *matrix = STATE_MODELVIEW_MATRIX; - *matrix_idx = parse_integer (inst, Program); - if (*matrix_idx > 0) { - program_error(ctx, Program->Position, - "ARB_vertex_blend not supported"); - return 1; - } - break; - - case MATRIX_PROJECTION: - *matrix = STATE_PROJECTION_MATRIX; - break; - - case MATRIX_MVP: - *matrix = STATE_MVP_MATRIX; - break; - - case MATRIX_TEXTURE: - *matrix = STATE_TEXTURE_MATRIX; - *matrix_idx = parse_integer (inst, Program); - if (*matrix_idx >= (GLint) ctx->Const.MaxTextureUnits) { - program_error(ctx, Program->Position, "Invalid Texture Unit"); - /* bad *matrix_id */ - return 1; - } - break; - - /* This is not currently supported (ARB_matrix_palette) */ - case MATRIX_PALETTE: - *matrix_idx = parse_integer (inst, Program); - program_error(ctx, Program->Position, - "ARB_matrix_palette not supported"); - return 1; - break; - - case MATRIX_PROGRAM: - *matrix = STATE_PROGRAM_MATRIX; - *matrix_idx = parse_integer (inst, Program); - if (*matrix_idx >= (GLint) ctx->Const.MaxProgramMatrices) { - program_error(ctx, Program->Position, "Invalid Program Matrix"); - /* bad *matrix_idx */ - return 1; - } - break; - } - - switch (*(*inst)++) { - case MATRIX_MODIFIER_IDENTITY: - *matrix_modifier = 0; - break; - case MATRIX_MODIFIER_INVERSE: - *matrix_modifier = STATE_MATRIX_INVERSE; - break; - case MATRIX_MODIFIER_TRANSPOSE: - *matrix_modifier = STATE_MATRIX_TRANSPOSE; - break; - case MATRIX_MODIFIER_INVTRANS: - *matrix_modifier = STATE_MATRIX_INVTRANS; - break; - } - - return 0; -} - - -/** - * This parses a state string (rather, the binary version of it) into - * a 6-token sequence as described in _mesa_fetch_state() [program.c] - * - * \param inst - the start in the binary arry to start working from - * \param state_tokens - the storage for the 6-token state description - * \return - 0 on sucess, 1 on error - */ -static GLuint -parse_state_single_item (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, - gl_state_index state_tokens[STATE_LENGTH]) -{ - GLubyte token = *(*inst)++; - - switch (token) { - case STATE_MATERIAL_PARSER: - state_tokens[0] = STATE_MATERIAL; - state_tokens[1] = parse_face_type (inst); - switch (*(*inst)++) { - case MATERIAL_AMBIENT: - state_tokens[2] = STATE_AMBIENT; - break; - case MATERIAL_DIFFUSE: - state_tokens[2] = STATE_DIFFUSE; - break; - case MATERIAL_SPECULAR: - state_tokens[2] = STATE_SPECULAR; - break; - case MATERIAL_EMISSION: - state_tokens[2] = STATE_EMISSION; - break; - case MATERIAL_SHININESS: - state_tokens[2] = STATE_SHININESS; - break; - } - break; - - case STATE_LIGHT_PARSER: - state_tokens[0] = STATE_LIGHT; - state_tokens[1] = parse_integer (inst, Program); - - /* Check the value of state_tokens[1] against the # of lights */ - if (state_tokens[1] >= (GLint) ctx->Const.MaxLights) { - program_error(ctx, Program->Position, "Invalid Light Number"); - /* bad state_tokens[1] */ - return 1; - } - - switch (*(*inst)++) { - case LIGHT_AMBIENT: - state_tokens[2] = STATE_AMBIENT; - break; - case LIGHT_DIFFUSE: - state_tokens[2] = STATE_DIFFUSE; - break; - case LIGHT_SPECULAR: - state_tokens[2] = STATE_SPECULAR; - break; - case LIGHT_POSITION: - state_tokens[2] = STATE_POSITION; - break; - case LIGHT_ATTENUATION: - state_tokens[2] = STATE_ATTENUATION; - break; - case LIGHT_HALF: - state_tokens[2] = STATE_HALF_VECTOR; - break; - case LIGHT_SPOT_DIRECTION: - state_tokens[2] = STATE_SPOT_DIRECTION; - break; - } - break; - - case STATE_LIGHT_MODEL: - switch (*(*inst)++) { - case LIGHT_MODEL_AMBIENT: - state_tokens[0] = STATE_LIGHTMODEL_AMBIENT; - break; - case LIGHT_MODEL_SCENECOLOR: - state_tokens[0] = STATE_LIGHTMODEL_SCENECOLOR; - state_tokens[1] = parse_face_type (inst); - break; - } - break; - - case STATE_LIGHT_PROD: - state_tokens[0] = STATE_LIGHTPROD; - state_tokens[1] = parse_integer (inst, Program); - - /* Check the value of state_tokens[1] against the # of lights */ - if (state_tokens[1] >= (GLint) ctx->Const.MaxLights) { - program_error(ctx, Program->Position, "Invalid Light Number"); - /* bad state_tokens[1] */ - return 1; - } - - state_tokens[2] = parse_face_type (inst); - switch (*(*inst)++) { - case LIGHT_PROD_AMBIENT: - state_tokens[3] = STATE_AMBIENT; - break; - case LIGHT_PROD_DIFFUSE: - state_tokens[3] = STATE_DIFFUSE; - break; - case LIGHT_PROD_SPECULAR: - state_tokens[3] = STATE_SPECULAR; - break; - } - break; - - - case STATE_FOG: - switch (*(*inst)++) { - case FOG_COLOR: - state_tokens[0] = STATE_FOG_COLOR; - break; - case FOG_PARAMS: - state_tokens[0] = STATE_FOG_PARAMS; - break; - } - break; - - case STATE_TEX_ENV: - state_tokens[1] = parse_integer (inst, Program); - switch (*(*inst)++) { - case TEX_ENV_COLOR: - state_tokens[0] = STATE_TEXENV_COLOR; - break; - } - break; - - case STATE_TEX_GEN: - { - GLuint type, coord; - - state_tokens[0] = STATE_TEXGEN; - /*state_tokens[1] = parse_integer (inst, Program);*/ /* Texture Unit */ - - if (parse_texcoord_num (ctx, inst, Program, &coord)) - return 1; - state_tokens[1] = coord; - - /* EYE or OBJECT */ - type = *(*inst)++; - - /* 0 - s, 1 - t, 2 - r, 3 - q */ - coord = *(*inst)++; - - if (type == TEX_GEN_EYE) { - switch (coord) { - case COMPONENT_X: - state_tokens[2] = STATE_TEXGEN_EYE_S; - break; - case COMPONENT_Y: - state_tokens[2] = STATE_TEXGEN_EYE_T; - break; - case COMPONENT_Z: - state_tokens[2] = STATE_TEXGEN_EYE_R; - break; - case COMPONENT_W: - state_tokens[2] = STATE_TEXGEN_EYE_Q; - break; - default: - _mesa_problem(ctx, "bad texgen component in " - "parse_state_single_item()"); - } - } - else { - switch (coord) { - case COMPONENT_X: - state_tokens[2] = STATE_TEXGEN_OBJECT_S; - break; - case COMPONENT_Y: - state_tokens[2] = STATE_TEXGEN_OBJECT_T; - break; - case COMPONENT_Z: - state_tokens[2] = STATE_TEXGEN_OBJECT_R; - break; - case COMPONENT_W: - state_tokens[2] = STATE_TEXGEN_OBJECT_Q; - break; - default: - _mesa_problem(ctx, "bad texgen component in " - "parse_state_single_item()"); - } - } - } - break; - - case STATE_DEPTH: - switch (*(*inst)++) { - case DEPTH_RANGE: - state_tokens[0] = STATE_DEPTH_RANGE; - break; - } - break; - - case STATE_CLIP_PLANE: - state_tokens[0] = STATE_CLIPPLANE; - if (parse_clipplane_num (ctx, inst, Program, - (GLint *) &state_tokens[1])) - return 1; - break; - - case STATE_POINT: - switch (*(*inst)++) { - case POINT_SIZE: - state_tokens[0] = STATE_POINT_SIZE; - break; - - case POINT_ATTENUATION: - state_tokens[0] = STATE_POINT_ATTENUATION; - break; - } - break; - - /* XXX: I think this is the correct format for a matrix row */ - case STATE_MATRIX_ROWS: - if (parse_matrix(ctx, inst, Program, - (GLint *) &state_tokens[0], - (GLint *) &state_tokens[1], - (GLint *) &state_tokens[4])) - return 1; - - state_tokens[2] = parse_integer (inst, Program); /* The first row to grab */ - - if ((**inst) != 0) { /* Either the last row, 0 */ - state_tokens[3] = parse_integer (inst, Program); - if (state_tokens[3] < state_tokens[2]) { - program_error(ctx, Program->Position, - "Second matrix index less than the first"); - /* state_tokens[4] vs. state_tokens[3] */ - return 1; - } - } - else { - state_tokens[3] = state_tokens[2]; - (*inst)++; - } - break; - } - - return 0; -} - -/** - * This parses a state string (rather, the binary version of it) into - * a 6-token similar for the state fetching code in program.c - * - * One might ask, why fetch these parameters into just like you fetch - * state when they are already stored in other places? - * - * Because of array offsets -> We can stick env/local parameters in the - * middle of a parameter array and then index someplace into the array - * when we execute. - * - * One optimization might be to only do this for the cases where the - * env/local parameters end up inside of an array, and leave the - * single parameters (or arrays of pure env/local pareameters) in their - * respective register files. - * - * For ENV parameters, the format is: - * state_tokens[0] = STATE_FRAGMENT_PROGRAM / STATE_VERTEX_PROGRAM - * state_tokens[1] = STATE_ENV - * state_tokens[2] = the parameter index - * - * for LOCAL parameters, the format is: - * state_tokens[0] = STATE_FRAGMENT_PROGRAM / STATE_VERTEX_PROGRAM - * state_tokens[1] = STATE_LOCAL - * state_tokens[2] = the parameter index - * - * \param inst - the start in the binary arry to start working from - * \param state_tokens - the storage for the 6-token state description - * \return - 0 on sucess, 1 on failure - */ -static GLuint -parse_program_single_item (GLcontext * ctx, const GLubyte ** inst, - struct arb_program *Program, - gl_state_index state_tokens[STATE_LENGTH]) -{ - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) - state_tokens[0] = STATE_FRAGMENT_PROGRAM; - else - state_tokens[0] = STATE_VERTEX_PROGRAM; - - - switch (*(*inst)++) { - case PROGRAM_PARAM_ENV: - state_tokens[1] = STATE_ENV; - state_tokens[2] = parse_integer (inst, Program); - - /* Check state_tokens[2] against the number of ENV parameters available */ - if (((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.FragmentProgram.MaxEnvParams)) - || - ((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.VertexProgram.MaxEnvParams))) { - program_error(ctx, Program->Position, - "Invalid Program Env Parameter"); - /* bad state_tokens[2] */ - return 1; - } - - break; - - case PROGRAM_PARAM_LOCAL: - state_tokens[1] = STATE_LOCAL; - state_tokens[2] = parse_integer (inst, Program); - - /* Check state_tokens[2] against the number of LOCAL parameters available */ - if (((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.FragmentProgram.MaxLocalParams)) - || - ((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) && - (state_tokens[2] >= (GLint) ctx->Const.VertexProgram.MaxLocalParams))) { - program_error(ctx, Program->Position, - "Invalid Program Local Parameter"); - /* bad state_tokens[2] */ - return 1; - } - break; - } - - return 0; -} - -/** - * For ARB_vertex_program, programs are not allowed to use both an explicit - * vertex attribute and a generic vertex attribute corresponding to the same - * state. See section 2.14.3.1 of the GL_ARB_vertex_program spec. - * - * This will walk our var_cache and make sure that nobody does anything fishy. - * - * \return 0 on sucess, 1 on error - */ -static GLuint -generic_attrib_check(struct var_cache *vc_head) -{ - int a; - struct var_cache *curr; - GLboolean explicitAttrib[MAX_VERTEX_GENERIC_ATTRIBS], - genericAttrib[MAX_VERTEX_GENERIC_ATTRIBS]; - - for (a=0; atype == vt_attrib) { - if (curr->attrib_is_generic) { - GLuint attr = (curr->attrib_binding == 0) - ? 0 : (curr->attrib_binding - VERT_ATTRIB_GENERIC0); - assert(attr < MAX_VERTEX_GENERIC_ATTRIBS); - genericAttrib[attr] = GL_TRUE; - } - else { - assert(curr->attrib_binding < MAX_VERTEX_GENERIC_ATTRIBS); - explicitAttrib[ curr->attrib_binding ] = GL_TRUE; - } - } - - curr = curr->next; - } - - for (a=0; aBase.Target == GL_FRAGMENT_PROGRAM_ARB) { - switch (*(*inst)++) { - case FRAGMENT_ATTRIB_COLOR: - { - GLint coord; - err = parse_color_type (ctx, inst, Program, &coord); - *inputReg = FRAG_ATTRIB_COL0 + coord; - } - break; - case FRAGMENT_ATTRIB_TEXCOORD: - { - GLuint texcoord = 0; - err = parse_texcoord_num (ctx, inst, Program, &texcoord); - *inputReg = FRAG_ATTRIB_TEX0 + texcoord; - } - break; - case FRAGMENT_ATTRIB_FOGCOORD: - *inputReg = FRAG_ATTRIB_FOGC; - break; - case FRAGMENT_ATTRIB_POSITION: - *inputReg = FRAG_ATTRIB_WPOS; - break; - default: - err = 1; - break; - } - } - else { - switch (*(*inst)++) { - case VERTEX_ATTRIB_POSITION: - *inputReg = VERT_ATTRIB_POS; - break; - - case VERTEX_ATTRIB_WEIGHT: - { - GLint weight; - err = parse_weight_num (ctx, inst, Program, &weight); - *inputReg = VERT_ATTRIB_WEIGHT; -#if 1 - /* hack for Warcraft (see bug 8060) */ - _mesa_warning(ctx, "Application error: vertex program uses 'vertex.weight' but GL_ARB_vertex_blend not supported."); - break; -#else - program_error(ctx, Program->Position, - "ARB_vertex_blend not supported"); - return 1; -#endif - } - - case VERTEX_ATTRIB_NORMAL: - *inputReg = VERT_ATTRIB_NORMAL; - break; - - case VERTEX_ATTRIB_COLOR: - { - GLint color; - err = parse_color_type (ctx, inst, Program, &color); - if (color) { - *inputReg = VERT_ATTRIB_COLOR1; - } - else { - *inputReg = VERT_ATTRIB_COLOR0; - } - } - break; - - case VERTEX_ATTRIB_FOGCOORD: - *inputReg = VERT_ATTRIB_FOG; - break; - - case VERTEX_ATTRIB_TEXCOORD: - { - GLuint unit = 0; - err = parse_texcoord_num (ctx, inst, Program, &unit); - *inputReg = VERT_ATTRIB_TEX0 + unit; - } - break; - - case VERTEX_ATTRIB_MATRIXINDEX: - /* Not supported at this time */ - { - const char *msg = "ARB_palette_matrix not supported"; - parse_integer (inst, Program); - program_error(ctx, Program->Position, msg); - } - return 1; - - case VERTEX_ATTRIB_GENERIC: - { - GLuint attrib; - err = parse_generic_attrib_num(ctx, inst, Program, &attrib); - if (!err) { - *is_generic = 1; - /* Add VERT_ATTRIB_GENERIC0 here because ARB_vertex_program's - * attributes do not alias the conventional vertex - * attributes. - */ - if (attrib > 0) - *inputReg = attrib + VERT_ATTRIB_GENERIC0; - else - *inputReg = 0; - } - } - break; - - default: - err = 1; - break; - } - } - - if (err) { - program_error(ctx, Program->Position, "Bad attribute binding"); - } - - return err; -} - - -/** - * This translates between a binary token for an output variable type - * and the mesa token for the same thing. - * - * \param inst The parsed tokens - * \param outputReg Returned index/number of the output register, - * one of the VERT_RESULT_* or FRAG_RESULT_* values. - */ -static GLuint -parse_result_binding(GLcontext *ctx, const GLubyte **inst, - GLuint *outputReg, struct arb_program *Program) -{ - const GLubyte token = *(*inst)++; - - switch (token) { - case FRAGMENT_RESULT_COLOR: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - GLuint out_color; - - /* This gets result of the color buffer we're supposed to - * draw into. This pertains to GL_ARB_draw_buffers. - */ - parse_output_color_num(ctx, inst, Program, &out_color); - ASSERT(out_color < MAX_DRAW_BUFFERS); - *outputReg = FRAG_RESULT_COLOR; - } - else { - /* for vtx programs, this is VERTEX_RESULT_POSITION */ - *outputReg = VERT_RESULT_HPOS; - } - break; - - case FRAGMENT_RESULT_DEPTH: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - /* for frag programs, this is FRAGMENT_RESULT_DEPTH */ - *outputReg = FRAG_RESULT_DEPTH; - } - else { - /* for vtx programs, this is VERTEX_RESULT_COLOR */ - GLint color_type; - GLuint face_type = parse_face_type(inst); - GLint err = parse_color_type(ctx, inst, Program, &color_type); - if (err) - return 1; - - if (face_type) { - /* back face */ - if (color_type) { - *outputReg = VERT_RESULT_BFC1; /* secondary color */ - } - else { - *outputReg = VERT_RESULT_BFC0; /* primary color */ - } - } - else { - /* front face */ - if (color_type) { - *outputReg = VERT_RESULT_COL1; /* secondary color */ - } - /* primary color */ - else { - *outputReg = VERT_RESULT_COL0; /* primary color */ - } - } - } - break; - - case VERTEX_RESULT_FOGCOORD: - *outputReg = VERT_RESULT_FOGC; - break; - - case VERTEX_RESULT_POINTSIZE: - *outputReg = VERT_RESULT_PSIZ; - break; - - case VERTEX_RESULT_TEXCOORD: - { - GLuint unit; - if (parse_texcoord_num (ctx, inst, Program, &unit)) - return 1; - *outputReg = VERT_RESULT_TEX0 + unit; - } - break; - } - - Program->Base.OutputsWritten |= (1 << *outputReg); - - return 0; -} - - -/** - * This handles the declaration of ATTRIB variables - * - * XXX: Still needs - * parse_vert_attrib_binding(), or something like that - * - * \return 0 on sucess, 1 on error - */ -static GLint -parse_attrib (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *attrib_var; - - attrib_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) attrib_var->name); - return 1; - } - - attrib_var->type = vt_attrib; - - if (parse_attrib_binding(ctx, inst, Program, &attrib_var->attrib_binding, - &attrib_var->attrib_is_generic)) - return 1; - - if (generic_attrib_check(*vc_head)) { - program_error(ctx, Program->Position, - "Cannot use both a generic vertex attribute " - "and a specific attribute of the same type"); - return 1; - } - - Program->Base.NumAttributes++; - return 0; -} - -/** - * \param use -- TRUE if we're called when declaring implicit parameters, - * FALSE if we're declaraing variables. This has to do with - * if we get a signed or unsigned float for scalar constants - */ -static GLuint -parse_param_elements (GLcontext * ctx, const GLubyte ** inst, - struct var_cache *param_var, - struct arb_program *Program, GLboolean use) -{ - GLint idx; - GLuint err = 0; - gl_state_index state_tokens[STATE_LENGTH] = {0, 0, 0, 0, 0}; - - GLubyte token = *(*inst)++; - - switch (token) { - case PARAM_STATE_ELEMENT: - if (parse_state_single_item (ctx, inst, Program, state_tokens)) - return 1; - - /* If we adding STATE_MATRIX that has multiple rows, we need to - * unroll it and call _mesa_add_state_reference() for each row - */ - if ((state_tokens[0] == STATE_MODELVIEW_MATRIX || - state_tokens[0] == STATE_PROJECTION_MATRIX || - state_tokens[0] == STATE_MVP_MATRIX || - state_tokens[0] == STATE_TEXTURE_MATRIX || - state_tokens[0] == STATE_PROGRAM_MATRIX) - && (state_tokens[2] != state_tokens[3])) { - GLint row; - const GLint first_row = state_tokens[2]; - const GLint last_row = state_tokens[3]; - - for (row = first_row; row <= last_row; row++) { - state_tokens[2] = state_tokens[3] = row; - - idx = _mesa_add_state_reference(Program->Base.Parameters, - state_tokens); - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_length++; - } - } - else { - idx = _mesa_add_state_reference(Program->Base.Parameters, - state_tokens); - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_length++; - } - break; - - case PARAM_PROGRAM_ELEMENT: - if (parse_program_single_item (ctx, inst, Program, state_tokens)) - return 1; - idx = _mesa_add_state_reference (Program->Base.Parameters, state_tokens); - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_length++; - - /* Check if there is more: 0 -> we're done, else its an integer */ - if (**inst) { - GLuint out_of_range, new_idx; - GLuint start_idx = state_tokens[2] + 1; - GLuint end_idx = parse_integer (inst, Program); - - out_of_range = 0; - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - if (((state_tokens[1] == STATE_ENV) - && (end_idx >= ctx->Const.FragmentProgram.MaxEnvParams)) - || ((state_tokens[1] == STATE_LOCAL) - && (end_idx >= - ctx->Const.FragmentProgram.MaxLocalParams))) - out_of_range = 1; - } - else { - if (((state_tokens[1] == STATE_ENV) - && (end_idx >= ctx->Const.VertexProgram.MaxEnvParams)) - || ((state_tokens[1] == STATE_LOCAL) - && (end_idx >= - ctx->Const.VertexProgram.MaxLocalParams))) - out_of_range = 1; - } - if (out_of_range) { - program_error(ctx, Program->Position, - "Invalid Program Parameter"); /*end_idx*/ - return 1; - } - - for (new_idx = start_idx; new_idx <= end_idx; new_idx++) { - state_tokens[2] = new_idx; - idx = _mesa_add_state_reference(Program->Base.Parameters, - state_tokens); - param_var->param_binding_length++; - } - } - else { - (*inst)++; - } - break; - - case PARAM_CONSTANT: - /* parsing something like {1.0, 2.0, 3.0, 4.0} */ - { - GLfloat const_values[4]; - GLint size; - parse_constant(inst, const_values, &size, Program, use); - if (param_var->name[0] == ' ') { - /* this is an unnamed constant */ - idx = _mesa_add_unnamed_constant(Program->Base.Parameters, - const_values, size, - ¶m_var->swizzle); - } - else { - /* named parameter/constant */ - idx = _mesa_add_named_constant(Program->Base.Parameters, - (char *) param_var->name, - const_values, size); - } - if (param_var->param_binding_begin == ~0U) - param_var->param_binding_begin = idx; - param_var->param_binding_type = PROGRAM_STATE_VAR; - /* Note: when we reference this parameter in an instruction later, - * we'll check if it's really a constant/immediate and set the - * instruction register type appropriately. - */ - param_var->param_binding_length++; - } - break; - - default: - program_error(ctx, Program->Position, - "Unexpected token (in parse_param_elements())"); - return 1; - } - - Program->Base.NumParameters = Program->Base.Parameters->NumParameters; - - /* Make sure we haven't blown past our parameter limits */ - if (((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) && - (Program->Base.NumParameters > - ctx->Const.VertexProgram.MaxLocalParams)) - || ((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) - && (Program->Base.NumParameters > - ctx->Const.FragmentProgram.MaxLocalParams))) { - program_error(ctx, Program->Position, "Too many parameter variables"); - return 1; - } - - return err; -} - - -/** - * This picks out PARAM program parameter bindings. - * - * XXX: This needs to be stressed & tested - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_param (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found, err; - GLint specified_length; - struct var_cache *param_var; - - err = 0; - param_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) param_var->name); - return 1; - } - - specified_length = parse_integer (inst, Program); - - if (specified_length < 0) { - program_error(ctx, Program->Position, "Negative parameter array length"); - return 1; - } - - param_var->type = vt_param; - param_var->param_binding_length = 0; - - /* Right now, everything is shoved into the main state register file. - * - * In the future, it would be nice to leave things ENV/LOCAL params - * in their respective register files, if possible - */ - param_var->param_binding_type = PROGRAM_STATE_VAR; - - /* Remember to: - * * - add each guy to the parameter list - * * - increment the param_var->param_binding_len - * * - store the param_var->param_binding_begin for the first one - * * - compare the actual len to the specified len at the end - */ - while (**inst != PARAM_NULL) { - if (parse_param_elements (ctx, inst, param_var, Program, GL_FALSE)) - return 1; - } - - /* Test array length here! */ - if (specified_length) { - if (specified_length != (int)param_var->param_binding_length) { - program_error(ctx, Program->Position, - "Declared parameter array length does not match parameter list"); - } - } - - (*inst)++; - - return 0; -} - -/** - * - */ -static GLuint -parse_param_use (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program, struct var_cache **new_var) -{ - struct var_cache *param_var; - - /* First, insert a dummy entry into the var_cache */ - var_cache_create (¶m_var); - param_var->name = (const GLubyte *) " "; - param_var->type = vt_param; - - param_var->param_binding_length = 0; - /* Don't fill in binding_begin; We use the default value of -1 - * to tell if its already initialized, elsewhere. - * - * param_var->param_binding_begin = 0; - */ - param_var->param_binding_type = PROGRAM_STATE_VAR; - - var_cache_append (vc_head, param_var); - - /* Then fill it with juicy parameter goodness */ - if (parse_param_elements (ctx, inst, param_var, Program, GL_TRUE)) - return 1; - - *new_var = param_var; - - return 0; -} - - -/** - * This handles the declaration of TEMP variables - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_temp (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *temp_var; - - while (**inst != 0) { - temp_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) temp_var->name); - return 1; - } - - temp_var->type = vt_temp; - - if (((Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) && - (Program->Base.NumTemporaries >= - ctx->Const.FragmentProgram.MaxTemps)) - || ((Program->Base.Target == GL_VERTEX_PROGRAM_ARB) - && (Program->Base.NumTemporaries >= - ctx->Const.VertexProgram.MaxTemps))) { - program_error(ctx, Program->Position, - "Too many TEMP variables declared"); - return 1; - } - - temp_var->temp_binding = Program->Base.NumTemporaries; - Program->Base.NumTemporaries++; - } - (*inst)++; - - return 0; -} - -/** - * This handles variables of the OUTPUT variety - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_output (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *output_var; - GLuint err; - - output_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) output_var->name); - return 1; - } - - output_var->type = vt_output; - - err = parse_result_binding(ctx, inst, &output_var->output_binding, Program); - return err; -} - -/** - * This handles variables of the ALIAS kind - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_alias (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *temp_var; - - temp_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) temp_var->name); - return 1; - } - - temp_var->type = vt_alias; - temp_var->alias_binding = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (!found) - { - program_error2(ctx, Program->Position, - "Undefined alias value", - (char *) temp_var->alias_binding->name); - return 1; - } - - return 0; -} - -/** - * This handles variables of the ADDRESS kind - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_address (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLuint found; - struct var_cache *temp_var; - - while (**inst != 0) { - temp_var = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - if (found) { - program_error2(ctx, Program->Position, - "Duplicate variable declaration", - (char *) temp_var->name); - return 1; - } - - temp_var->type = vt_address; - - if (Program->Base.NumAddressRegs >= - ctx->Const.VertexProgram.MaxAddressRegs) { - const char *msg = "Too many ADDRESS variables declared"; - program_error(ctx, Program->Position, msg); - return 1; - } - - temp_var->address_binding = Program->Base.NumAddressRegs; - Program->Base.NumAddressRegs++; - } - (*inst)++; - - return 0; -} - -/** - * Parse a program declaration - * - * \return 0 on sucess, 1 on error - */ -static GLint -parse_declaration (GLcontext * ctx, const GLubyte ** inst, struct var_cache **vc_head, - struct arb_program *Program) -{ - GLint err = 0; - - switch (*(*inst)++) { - case ADDRESS: - err = parse_address (ctx, inst, vc_head, Program); - break; - - case ALIAS: - err = parse_alias (ctx, inst, vc_head, Program); - break; - - case ATTRIB: - err = parse_attrib (ctx, inst, vc_head, Program); - break; - - case OUTPUT: - err = parse_output (ctx, inst, vc_head, Program); - break; - - case PARAM: - err = parse_param (ctx, inst, vc_head, Program); - break; - - case TEMP: - err = parse_temp (ctx, inst, vc_head, Program); - break; - } - - return err; -} - -/** - * Handle the parsing out of a masked destination register, either for a - * vertex or fragment program. - * - * If we are a vertex program, make sure we don't write to - * result.position if we have specified that the program is - * position invariant - * - * \param File - The register file we write to - * \param Index - The register index we write to - * \param WriteMask - The mask controlling which components we write (1->write) - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_masked_dst_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *Program, - gl_register_file *File, GLuint *Index, GLint *WriteMask) -{ - GLuint tmp, result; - struct var_cache *dst; - - /* We either have a result register specified, or a - * variable that may or may not be writable - */ - switch (*(*inst)++) { - case REGISTER_RESULT: - if (parse_result_binding(ctx, inst, Index, Program)) - return 1; - *File = PROGRAM_OUTPUT; - break; - - case REGISTER_ESTABLISHED_NAME: - dst = parse_string (inst, vc_head, Program, &result); - Program->Position = parse_position (inst); - - /* If the name has never been added to our symbol table, we're hosed */ - if (!result) { - program_error(ctx, Program->Position, "0: Undefined variable"); - return 1; - } - - switch (dst->type) { - case vt_output: - *File = PROGRAM_OUTPUT; - *Index = dst->output_binding; - break; - - case vt_temp: - *File = PROGRAM_TEMPORARY; - *Index = dst->temp_binding; - break; - - /* If the var type is not vt_output or vt_temp, no go */ - default: - program_error(ctx, Program->Position, - "Destination register is read only"); - return 1; - } - break; - - default: - program_error(ctx, Program->Position, - "Unexpected opcode in parse_masked_dst_reg()"); - return 1; - } - - - /* Position invariance test */ - /* This test is done now in syntax portion - when position invariance OPTION - is specified, "result.position" rule is disabled so there is no way - to write the position - */ - /*if ((Program->HintPositionInvariant) && (*File == PROGRAM_OUTPUT) && - (*Index == 0)) { - program_error(ctx, Program->Position, - "Vertex program specified position invariance and wrote vertex position"); - }*/ - - /* And then the mask. - * w,a -> bit 0 - * z,b -> bit 1 - * y,g -> bit 2 - * x,r -> bit 3 - * - * ==> Need to reverse the order of bits for this! - */ - tmp = (GLint) *(*inst)++; - *WriteMask = (((tmp>>3) & 0x1) | - ((tmp>>1) & 0x2) | - ((tmp<<1) & 0x4) | - ((tmp<<3) & 0x8)); - - return 0; -} - - -/** - * Handle the parsing of a address register - * - * \param Index - The register index we write to - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_address_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, GLint * Index) -{ - struct var_cache *dst; - GLuint result; - - *Index = 0; /* XXX */ - - dst = parse_string (inst, vc_head, Program, &result); - Program->Position = parse_position (inst); - - /* If the name has never been added to our symbol table, we're hosed */ - if (!result) { - program_error(ctx, Program->Position, "Undefined variable"); - return 1; - } - - if (dst->type != vt_address) { - program_error(ctx, Program->Position, "Variable is not of type ADDRESS"); - return 1; - } - - return 0; -} - -#if 0 /* unused */ -/** - * Handle the parsing out of a masked address register - * - * \param Index - The register index we write to - * \param WriteMask - The mask controlling which components we write (1->write) - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_masked_address_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, GLint * Index, - GLboolean * WriteMask) -{ - if (parse_address_reg (ctx, inst, vc_head, Program, Index)) - return 1; - - /* This should be 0x8 */ - (*inst)++; - - /* Writemask of .x is implied */ - WriteMask[0] = 1; - WriteMask[1] = WriteMask[2] = WriteMask[3] = 0; - - return 0; -} -#endif - -/** - * Parse out a swizzle mask. - * - * Basically convert COMPONENT_X/Y/Z/W to SWIZZLE_X/Y/Z/W - * - * The len parameter allows us to grab 4 components for a vector - * swizzle, or just 1 component for a scalar src register selection - */ -static void -parse_swizzle_mask(const GLubyte ** inst, GLubyte *swizzle, GLint len) -{ - GLint i; - - for (i = 0; i < 4; i++) - swizzle[i] = i; - - for (i = 0; i < len; i++) { - switch (*(*inst)++) { - case COMPONENT_X: - swizzle[i] = SWIZZLE_X; - break; - case COMPONENT_Y: - swizzle[i] = SWIZZLE_Y; - break; - case COMPONENT_Z: - swizzle[i] = SWIZZLE_Z; - break; - case COMPONENT_W: - swizzle[i] = SWIZZLE_W; - break; - default: - _mesa_problem(NULL, "bad component in parse_swizzle_mask()"); - return; - } - } - - if (len == 1) - swizzle[1] = swizzle[2] = swizzle[3] = swizzle[0]; -} - - -/** - * Parse an extended swizzle mask which is a sequence of - * four x/y/z/w/0/1 tokens. - * \return swizzle four swizzle values - * \return negateMask four element bitfield - */ -static void -parse_extended_swizzle_mask(const GLubyte **inst, GLubyte swizzle[4], - GLubyte *negateMask) -{ - GLint i; - - *negateMask = 0x0; - for (i = 0; i < 4; i++) { - GLubyte swz; - if (parse_sign(inst) == -1) - *negateMask |= (1 << i); - - swz = *(*inst)++; - - switch (swz) { - case COMPONENT_0: - swizzle[i] = SWIZZLE_ZERO; - break; - case COMPONENT_1: - swizzle[i] = SWIZZLE_ONE; - break; - case COMPONENT_X: - swizzle[i] = SWIZZLE_X; - break; - case COMPONENT_Y: - swizzle[i] = SWIZZLE_Y; - break; - case COMPONENT_Z: - swizzle[i] = SWIZZLE_Z; - break; - case COMPONENT_W: - swizzle[i] = SWIZZLE_W; - break; - default: - _mesa_problem(NULL, "bad case in parse_extended_swizzle_mask()"); - return; - } - } -} - - -static GLuint -parse_src_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, - gl_register_file * File, GLint * Index, GLuint *swizzle, - GLboolean *IsRelOffset ) -{ - struct var_cache *src; - GLuint binding, is_generic, found; - GLint offset; - - *IsRelOffset = 0; - - *swizzle = SWIZZLE_XYZW; /* default */ - - /* And the binding for the src */ - switch (*(*inst)++) { - case REGISTER_ATTRIB: - if (parse_attrib_binding - (ctx, inst, Program, &binding, &is_generic)) - return 1; - *File = PROGRAM_INPUT; - *Index = binding; - - /* We need to insert a dummy variable into the var_cache so we can - * catch generic vertex attrib aliasing errors - */ - var_cache_create(&src); - src->type = vt_attrib; - src->name = (const GLubyte *) "Dummy Attrib Variable"; - src->attrib_binding = binding; - src->attrib_is_generic = is_generic; - var_cache_append(vc_head, src); - if (generic_attrib_check(*vc_head)) { - program_error(ctx, Program->Position, - "Cannot use both a generic vertex attribute " - "and a specific attribute of the same type"); - return 1; - } - break; - - case REGISTER_PARAM: - switch (**inst) { - case PARAM_ARRAY_ELEMENT: - (*inst)++; - src = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - if (!found) { - program_error2(ctx, Program->Position, - "Undefined variable", - (char *) src->name); - return 1; - } - - *File = (gl_register_file) src->param_binding_type; - - switch (*(*inst)++) { - case ARRAY_INDEX_ABSOLUTE: - offset = parse_integer (inst, Program); - - if ((offset < 0) - || (offset >= (int)src->param_binding_length)) { - program_error(ctx, Program->Position, - "Index out of range"); - /* offset, src->name */ - return 1; - } - - *Index = src->param_binding_begin + offset; - *swizzle = src->swizzle; - break; - - case ARRAY_INDEX_RELATIVE: - { - GLint addr_reg_idx, rel_off; - - /* First, grab the address regiseter */ - if (parse_address_reg (ctx, inst, vc_head, Program, &addr_reg_idx)) - return 1; - - /* And the .x */ - ((*inst)++); - ((*inst)++); - ((*inst)++); - ((*inst)++); - - /* Then the relative offset */ - if (parse_relative_offset(ctx, inst, Program, &rel_off)) return 1; - - /* And store it properly */ - *Index = src->param_binding_begin + rel_off; - *IsRelOffset = 1; - *swizzle = src->swizzle; - } - break; - } - break; - - default: - if (parse_param_use (ctx, inst, vc_head, Program, &src)) - return 1; - - *File = (gl_register_file) src->param_binding_type; - *Index = src->param_binding_begin; - *swizzle = src->swizzle; - break; - } - break; - - case REGISTER_ESTABLISHED_NAME: - src = parse_string (inst, vc_head, Program, &found); - Program->Position = parse_position (inst); - - /* If the name has never been added to our symbol table, we're hosed */ - if (!found) { - program_error(ctx, Program->Position, - "3: Undefined variable"); /* src->name */ - return 1; - } - - switch (src->type) { - case vt_attrib: - *File = PROGRAM_INPUT; - *Index = src->attrib_binding; - break; - - /* XXX: We have to handle offsets someplace in here! -- or are those above? */ - case vt_param: - *File = (gl_register_file) src->param_binding_type; - *Index = src->param_binding_begin; - break; - - case vt_temp: - *File = PROGRAM_TEMPORARY; - *Index = src->temp_binding; - break; - - /* If the var type is vt_output no go */ - default: - program_error(ctx, Program->Position, - "destination register is read only"); - /* bad src->name */ - return 1; - } - break; - - default: - program_error(ctx, Program->Position, - "Unknown token in parse_src_reg"); - return 1; - } - - if (*File == PROGRAM_STATE_VAR) { - gl_register_file file; - - /* If we're referencing the Program->Parameters[] array, check if the - * parameter is really a constant/literal. If so, set File to CONSTANT. - */ - assert(*Index < (GLint) Program->Base.Parameters->NumParameters); - file = Program->Base.Parameters->Parameters[*Index].Type; - if (file == PROGRAM_CONSTANT) - *File = PROGRAM_CONSTANT; - } - - /* Add attributes to InputsRead only if they are used the program. - * This avoids the handling of unused ATTRIB declarations in the drivers. */ - if (*File == PROGRAM_INPUT) - Program->Base.InputsRead |= (1 << *Index); - - return 0; -} - - -static GLuint -swizzle_swizzle(GLuint baseSwizzle, const GLubyte swizzle[4]) -{ - GLuint i, swz, s[4]; - for (i = 0; i < 4; i++) { - GLuint c = swizzle[i]; - if (c <= SWIZZLE_W) - s[i] = GET_SWZ(baseSwizzle, c); - else - s[i] = c; - } - swz = MAKE_SWIZZLE4(s[0], s[1], s[2], s[3]); - return swz; -} - -/** - * Parse vertex/fragment program vector source register. - */ -static GLuint -parse_vector_src_reg(GLcontext *ctx, const GLubyte **inst, - struct var_cache **vc_head, - struct arb_program *program, - struct prog_src_register *reg) -{ - gl_register_file file; - GLint index; - GLubyte negateMask; - GLubyte swizzle[4]; - GLboolean isRelOffset; - GLuint baseSwizzle; - - /* Grab the sign */ - negateMask = (parse_sign (inst) == -1) ? NEGATE_XYZW : NEGATE_NONE; - - /* And the src reg */ - if (parse_src_reg(ctx, inst, vc_head, program, &file, &index, &baseSwizzle, - &isRelOffset)) - return 1; - - /* finally, the swizzle */ - parse_swizzle_mask(inst, swizzle, 4); - - reg->File = file; - reg->Index = index; - reg->Swizzle = swizzle_swizzle(baseSwizzle, swizzle); - reg->Negate = negateMask; - reg->RelAddr = isRelOffset; - return 0; -} - - -/** - * Parse vertex/fragment program scalar source register. - */ -static GLuint -parse_scalar_src_reg(GLcontext *ctx, const GLubyte **inst, - struct var_cache **vc_head, - struct arb_program *program, - struct prog_src_register *reg) -{ - gl_register_file file; - GLint index; - GLubyte negateMask; - GLubyte swizzle[4]; - GLboolean isRelOffset; - GLuint baseSwizzle; - - /* Grab the sign */ - negateMask = (parse_sign (inst) == -1) ? NEGATE_XYZW : NEGATE_NONE; - - /* And the src reg */ - if (parse_src_reg(ctx, inst, vc_head, program, &file, &index, &baseSwizzle, - &isRelOffset)) - return 1; - - /* finally, the swizzle */ - parse_swizzle_mask(inst, swizzle, 1); - - reg->File = file; - reg->Index = index; - reg->Swizzle = swizzle_swizzle(baseSwizzle, swizzle); - reg->Negate = negateMask; - reg->RelAddr = isRelOffset; - return 0; -} - - -/** - * Parse vertex/fragment program destination register. - * \return 1 if error, 0 if no error. - */ -static GLuint -parse_dst_reg(GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *program, - struct prog_dst_register *reg ) -{ - GLint mask; - GLuint idx; - gl_register_file file; - - if (parse_masked_dst_reg (ctx, inst, vc_head, program, &file, &idx, &mask)) - return 1; - - reg->File = file; - reg->Index = idx; - reg->WriteMask = mask; - return 0; -} - - -/** - * This is a big mother that handles getting opcodes into the instruction - * and handling the src & dst registers for fragment program instructions - * \return 1 if error, 0 if no error - */ -static GLuint -parse_fp_instruction (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *Program, - struct prog_instruction *fp) -{ - GLint a; - GLuint texcoord; - GLubyte instClass, type, code; - GLboolean rel; - GLuint shadow_tex = 0; - - _mesa_init_instructions(fp, 1); - - /* OP_ALU_INST or OP_TEX_INST */ - instClass = *(*inst)++; - - /* OP_ALU_{VECTOR, SCALAR, BINSC, BIN, TRI, SWZ}, - * OP_TEX_{SAMPLE, KIL} - */ - type = *(*inst)++; - - /* The actual opcode name */ - code = *(*inst)++; - - /* Increment the correct count */ - switch (instClass) { - case OP_ALU_INST: - Program->NumAluInstructions++; - break; - case OP_TEX_INST: - Program->NumTexInstructions++; - break; - } - - switch (type) { - case OP_ALU_VECTOR: - switch (code) { - case OP_ABS_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_ABS: - fp->Opcode = OPCODE_ABS; - break; - - case OP_FLR_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_FLR: - fp->Opcode = OPCODE_FLR; - break; - - case OP_FRC_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_FRC: - fp->Opcode = OPCODE_FRC; - break; - - case OP_LIT_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_LIT: - fp->Opcode = OPCODE_LIT; - break; - - case OP_MOV_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MOV: - fp->Opcode = OPCODE_MOV; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - break; - - case OP_ALU_SCALAR: - switch (code) { - case OP_COS_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_COS: - fp->Opcode = OPCODE_COS; - break; - - case OP_EX2_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_EX2: - fp->Opcode = OPCODE_EX2; - break; - - case OP_LG2_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_LG2: - fp->Opcode = OPCODE_LG2; - break; - - case OP_RCP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_RCP: - fp->Opcode = OPCODE_RCP; - break; - - case OP_RSQ_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_RSQ: - fp->Opcode = OPCODE_RSQ; - break; - - case OP_SIN_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SIN: - fp->Opcode = OPCODE_SIN; - break; - - case OP_SCS_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SCS: - - fp->Opcode = OPCODE_SCS; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - break; - - case OP_ALU_BINSC: - switch (code) { - case OP_POW_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_POW: - fp->Opcode = OPCODE_POW; - break; - } - - if (parse_dst_reg(ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - for (a = 0; a < 2; a++) { - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[a])) - return 1; - } - break; - - - case OP_ALU_BIN: - switch (code) { - case OP_ADD_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_ADD: - fp->Opcode = OPCODE_ADD; - break; - - case OP_DP3_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DP3: - fp->Opcode = OPCODE_DP3; - break; - - case OP_DP4_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DP4: - fp->Opcode = OPCODE_DP4; - break; - - case OP_DPH_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DPH: - fp->Opcode = OPCODE_DPH; - break; - - case OP_DST_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_DST: - fp->Opcode = OPCODE_DST; - break; - - case OP_MAX_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MAX: - fp->Opcode = OPCODE_MAX; - break; - - case OP_MIN_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MIN: - fp->Opcode = OPCODE_MIN; - break; - - case OP_MUL_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MUL: - fp->Opcode = OPCODE_MUL; - break; - - case OP_SGE_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SGE: - fp->Opcode = OPCODE_SGE; - break; - - case OP_SLT_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SLT: - fp->Opcode = OPCODE_SLT; - break; - - case OP_SUB_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SUB: - fp->Opcode = OPCODE_SUB; - break; - - case OP_XPD_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_XPD: - fp->Opcode = OPCODE_XPD; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - for (a = 0; a < 2; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_TRI: - switch (code) { - case OP_CMP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_CMP: - fp->Opcode = OPCODE_CMP; - break; - - case OP_LRP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_LRP: - fp->Opcode = OPCODE_LRP; - break; - - case OP_MAD_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_MAD: - fp->Opcode = OPCODE_MAD; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - for (a = 0; a < 3; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_SWZ: - switch (code) { - case OP_SWZ_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_SWZ: - fp->Opcode = OPCODE_SWZ; - break; - } - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - { - GLubyte swizzle[4]; - GLubyte negateMask; - gl_register_file file; - GLint index; - GLuint baseSwizzle; - - if (parse_src_reg(ctx, inst, vc_head, Program, &file, &index, - &baseSwizzle, &rel)) - return 1; - parse_extended_swizzle_mask(inst, swizzle, &negateMask); - fp->SrcReg[0].File = file; - fp->SrcReg[0].Index = index; - fp->SrcReg[0].Negate = negateMask; - fp->SrcReg[0].Swizzle = MAKE_SWIZZLE4(swizzle[0], - swizzle[1], - swizzle[2], - swizzle[3]); - } - break; - - case OP_TEX_SAMPLE: - switch (code) { - case OP_TEX_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_TEX: - fp->Opcode = OPCODE_TEX; - break; - - case OP_TXP_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_TXP: - fp->Opcode = OPCODE_TXP; - break; - - case OP_TXB_SAT: - fp->SaturateMode = SATURATE_ZERO_ONE; - case OP_TXB: - fp->Opcode = OPCODE_TXB; - break; - } - - if (parse_dst_reg (ctx, inst, vc_head, Program, &fp->DstReg)) - return 1; - - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - - /* texImageUnit */ - if (parse_teximage_num (ctx, inst, Program, &texcoord)) - return 1; - fp->TexSrcUnit = texcoord; - - /* texTarget */ - switch (*(*inst)++) { - case TEXTARGET_SHADOW1D: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_1D: - fp->TexSrcTarget = TEXTURE_1D_INDEX; - break; - case TEXTARGET_SHADOW2D: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_2D: - fp->TexSrcTarget = TEXTURE_2D_INDEX; - break; - case TEXTARGET_3D: - fp->TexSrcTarget = TEXTURE_3D_INDEX; - break; - case TEXTARGET_SHADOWRECT: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_RECT: - fp->TexSrcTarget = TEXTURE_RECT_INDEX; - break; - case TEXTARGET_CUBE: - fp->TexSrcTarget = TEXTURE_CUBE_INDEX; - break; - case TEXTARGET_SHADOW1D_ARRAY: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_1D_ARRAY: - fp->TexSrcTarget = TEXTURE_1D_ARRAY_INDEX; - break; - case TEXTARGET_SHADOW2D_ARRAY: - shadow_tex = 1 << texcoord; - /* FALLTHROUGH */ - case TEXTARGET_2D_ARRAY: - fp->TexSrcTarget = TEXTURE_2D_ARRAY_INDEX; - break; - } - - if (shadow_tex) - fp->TexShadow = 1; - - /* Don't test the first time a particular sampler is seen. Each time - * after that, make sure the shadow state is the same. - */ - if ((_mesa_bitcount(Program->TexturesUsed[texcoord]) > 0) - && ((Program->ShadowSamplers & (1 << texcoord)) != shadow_tex)) { - program_error(ctx, Program->Position, - "texture image unit used for shadow sampling and non-shadow sampling"); - return 1; - } - - Program->TexturesUsed[texcoord] |= (1 << fp->TexSrcTarget); - /* Check that both "2D" and "CUBE" (for example) aren't both used */ - if (_mesa_bitcount(Program->TexturesUsed[texcoord]) > 1) { - program_error(ctx, Program->Position, - "multiple targets used on one texture image unit"); - return 1; - } - - - Program->ShadowSamplers |= shadow_tex; - break; - - case OP_TEX_KIL: - Program->UsesKill = 1; - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &fp->SrcReg[0])) - return 1; - fp->Opcode = OPCODE_KIL; - break; - default: - _mesa_problem(ctx, "bad type 0x%x in parse_fp_instruction()", type); - return 1; - } - - return 0; -} - - -/** - * Handle the parsing out of a masked address register - * - * \param Index - The register index we write to - * \param WriteMask - The mask controlling which components we write (1->write) - * - * \return 0 on sucess, 1 on error - */ -static GLuint -parse_vp_address_reg (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, - struct arb_program *Program, - struct prog_dst_register *reg) -{ - GLint idx; - - if (parse_address_reg (ctx, inst, vc_head, Program, &idx)) - return 1; - - /* This should be 0x8 */ - (*inst)++; - - reg->File = PROGRAM_ADDRESS; - reg->Index = idx; - - /* Writemask of .x is implied */ - reg->WriteMask = 0x1; - return 0; -} - - -/** - * This is a big mother that handles getting opcodes into the instruction - * and handling the src & dst registers for vertex program instructions - */ -static GLuint -parse_vp_instruction (GLcontext * ctx, const GLubyte ** inst, - struct var_cache **vc_head, struct arb_program *Program, - struct prog_instruction *vp) -{ - GLint a; - GLubyte type, code; - - /* OP_ALU_{ARL, VECTOR, SCALAR, BINSC, BIN, TRI, SWZ} */ - type = *(*inst)++; - - /* The actual opcode name */ - code = *(*inst)++; - - _mesa_init_instructions(vp, 1); - - switch (type) { - /* XXX: */ - case OP_ALU_ARL: - vp->Opcode = OPCODE_ARL; - - /* Remember to set SrcReg.RelAddr; */ - - /* Get the masked address register [dst] */ - if (parse_vp_address_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - vp->DstReg.File = PROGRAM_ADDRESS; - - /* Get a scalar src register */ - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[0])) - return 1; - - break; - - case OP_ALU_VECTOR: - switch (code) { - case OP_ABS: - vp->Opcode = OPCODE_ABS; - break; - case OP_FLR: - vp->Opcode = OPCODE_FLR; - break; - case OP_FRC: - vp->Opcode = OPCODE_FRC; - break; - case OP_LIT: - vp->Opcode = OPCODE_LIT; - break; - case OP_MOV: - vp->Opcode = OPCODE_MOV; - break; - } - - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[0])) - return 1; - break; - - case OP_ALU_SCALAR: - switch (code) { - case OP_EX2: - vp->Opcode = OPCODE_EX2; - break; - case OP_EXP: - vp->Opcode = OPCODE_EXP; - break; - case OP_LG2: - vp->Opcode = OPCODE_LG2; - break; - case OP_LOG: - vp->Opcode = OPCODE_LOG; - break; - case OP_RCP: - vp->Opcode = OPCODE_RCP; - break; - case OP_RSQ: - vp->Opcode = OPCODE_RSQ; - break; - } - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[0])) - return 1; - break; - - case OP_ALU_BINSC: - switch (code) { - case OP_POW: - vp->Opcode = OPCODE_POW; - break; - } - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - for (a = 0; a < 2; a++) { - if (parse_scalar_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_BIN: - switch (code) { - case OP_ADD: - vp->Opcode = OPCODE_ADD; - break; - case OP_DP3: - vp->Opcode = OPCODE_DP3; - break; - case OP_DP4: - vp->Opcode = OPCODE_DP4; - break; - case OP_DPH: - vp->Opcode = OPCODE_DPH; - break; - case OP_DST: - vp->Opcode = OPCODE_DST; - break; - case OP_MAX: - vp->Opcode = OPCODE_MAX; - break; - case OP_MIN: - vp->Opcode = OPCODE_MIN; - break; - case OP_MUL: - vp->Opcode = OPCODE_MUL; - break; - case OP_SGE: - vp->Opcode = OPCODE_SGE; - break; - case OP_SLT: - vp->Opcode = OPCODE_SLT; - break; - case OP_SUB: - vp->Opcode = OPCODE_SUB; - break; - case OP_XPD: - vp->Opcode = OPCODE_XPD; - break; - } - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - for (a = 0; a < 2; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_TRI: - switch (code) { - case OP_MAD: - vp->Opcode = OPCODE_MAD; - break; - } - - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - for (a = 0; a < 3; a++) { - if (parse_vector_src_reg(ctx, inst, vc_head, Program, &vp->SrcReg[a])) - return 1; - } - break; - - case OP_ALU_SWZ: - switch (code) { - case OP_SWZ: - vp->Opcode = OPCODE_SWZ; - break; - } - { - GLubyte swizzle[4]; - GLubyte negateMask; - GLboolean relAddr; - gl_register_file file; - GLint index; - GLuint baseSwizzle; - - if (parse_dst_reg(ctx, inst, vc_head, Program, &vp->DstReg)) - return 1; - - if (parse_src_reg(ctx, inst, vc_head, Program, &file, &index, - &baseSwizzle, &relAddr)) - return 1; - parse_extended_swizzle_mask (inst, swizzle, &negateMask); - vp->SrcReg[0].File = file; - vp->SrcReg[0].Index = index; - vp->SrcReg[0].Negate = negateMask; - vp->SrcReg[0].Swizzle = MAKE_SWIZZLE4(swizzle[0], - swizzle[1], - swizzle[2], - swizzle[3]); - vp->SrcReg[0].RelAddr = relAddr; - } - break; - } - return 0; -} - -#if DEBUG_PARSING - -static GLvoid -debug_variables (GLcontext * ctx, struct var_cache *vc_head, - struct arb_program *Program) -{ - struct var_cache *vc; - GLint a, b; - - fprintf (stderr, "debug_variables, vc_head: %p\n", (void*) vc_head); - - /* First of all, print out the contents of the var_cache */ - vc = vc_head; - while (vc) { - fprintf (stderr, "[%p]\n", (void*) vc); - switch (vc->type) { - case vt_none: - fprintf (stderr, "UNDEFINED %s\n", vc->name); - break; - case vt_attrib: - fprintf (stderr, "ATTRIB %s\n", vc->name); - fprintf (stderr, " binding: 0x%x\n", vc->attrib_binding); - break; - case vt_param: - fprintf (stderr, "PARAM %s begin: %d len: %d\n", vc->name, - vc->param_binding_begin, vc->param_binding_length); - b = vc->param_binding_begin; - for (a = 0; a < vc->param_binding_length; a++) { - fprintf (stderr, "%s\n", - Program->Base.Parameters->Parameters[a + b].Name); - if (Program->Base.Parameters->Parameters[a + b].Type == PROGRAM_STATE_VAR) { - char *s; - s = _mesa_program_state_string(Program->Base.Parameters->Parameters - [a + b].StateIndexes); - fprintf(stderr, "%s\n", s); - _mesa_free(s); - } - else - fprintf (stderr, "%f %f %f %f\n", - Program->Base.Parameters->ParameterValues[a + b][0], - Program->Base.Parameters->ParameterValues[a + b][1], - Program->Base.Parameters->ParameterValues[a + b][2], - Program->Base.Parameters->ParameterValues[a + b][3]); - } - break; - case vt_temp: - fprintf (stderr, "TEMP %s\n", vc->name); - fprintf (stderr, " binding: 0x%x\n", vc->temp_binding); - break; - case vt_output: - fprintf (stderr, "OUTPUT %s\n", vc->name); - fprintf (stderr, " binding: 0x%x\n", vc->output_binding); - break; - case vt_alias: - fprintf (stderr, "ALIAS %s\n", vc->name); - fprintf (stderr, " binding: 0x%p (%s)\n", - (void*) vc->alias_binding, vc->alias_binding->name); - break; - default: - /* nothing */ - ; - } - vc = vc->next; - } -} - -#endif /* DEBUG_PARSING */ - - -/** - * The main loop for parsing a fragment or vertex program - * - * \return 1 on error, 0 on success - */ -static GLint -parse_instructions(GLcontext * ctx, const GLubyte * inst, - struct var_cache **vc_head, struct arb_program *Program) -{ - const GLuint maxInst = (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) - ? ctx->Const.FragmentProgram.MaxInstructions - : ctx->Const.VertexProgram.MaxInstructions; - GLint err = 0; - - ASSERT(MAX_PROGRAM_INSTRUCTIONS >= maxInst); - - Program->MajorVersion = (GLuint) * inst++; - Program->MinorVersion = (GLuint) * inst++; - - while (*inst != END) { - switch (*inst++) { - - case OPTION: - switch (*inst++) { - case ARB_PRECISION_HINT_FASTEST: - Program->PrecisionOption = GL_FASTEST; - break; - - case ARB_PRECISION_HINT_NICEST: - Program->PrecisionOption = GL_NICEST; - break; - - case ARB_FOG_EXP: - Program->FogOption = GL_EXP; - break; - - case ARB_FOG_EXP2: - Program->FogOption = GL_EXP2; - break; - - case ARB_FOG_LINEAR: - Program->FogOption = GL_LINEAR; - break; - - case ARB_POSITION_INVARIANT: - if (Program->Base.Target == GL_VERTEX_PROGRAM_ARB) - Program->HintPositionInvariant = GL_TRUE; - break; - - case ARB_FRAGMENT_PROGRAM_SHADOW: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - /* TODO ARB_fragment_program_shadow code */ - } - break; - - case ARB_DRAW_BUFFERS: - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - /* do nothing for now */ - } - break; - - case MESA_TEXTURE_ARRAY: - /* do nothing for now */ - break; - } - break; - - case INSTRUCTION: - /* check length */ - if (Program->Base.NumInstructions + 1 >= maxInst) { - program_error(ctx, Program->Position, - "Max instruction count exceeded"); - return 1; - } - Program->Position = parse_position (&inst); - /* parse the current instruction */ - if (Program->Base.Target == GL_FRAGMENT_PROGRAM_ARB) { - err = parse_fp_instruction (ctx, &inst, vc_head, Program, - &Program->Base.Instructions[Program->Base.NumInstructions]); - } - else { - err = parse_vp_instruction (ctx, &inst, vc_head, Program, - &Program->Base.Instructions[Program->Base.NumInstructions]); - } - - /* increment instuction count */ - Program->Base.NumInstructions++; - break; - - case DECLARATION: - err = parse_declaration (ctx, &inst, vc_head, Program); - break; - - default: - break; - } - - if (err) - break; - } - - /* Finally, tag on an OPCODE_END instruction */ - { - const GLuint numInst = Program->Base.NumInstructions; - _mesa_init_instructions(Program->Base.Instructions + numInst, 1); - Program->Base.Instructions[numInst].Opcode = OPCODE_END; - } - Program->Base.NumInstructions++; - - /* - * Initialize native counts to logical counts. The device driver may - * change them if program is translated into a hardware program. - */ - Program->Base.NumNativeInstructions = Program->Base.NumInstructions; - Program->Base.NumNativeTemporaries = Program->Base.NumTemporaries; - Program->Base.NumNativeParameters = Program->Base.NumParameters; - Program->Base.NumNativeAttributes = Program->Base.NumAttributes; - Program->Base.NumNativeAddressRegs = Program->Base.NumAddressRegs; - - return err; -} - - -/* XXX temporary */ -LONGSTRING static char core_grammar_text[] = -#include "shader/grammar/grammar_syn.h" -; - - -/** - * Set a grammar parameter. - * \param name the grammar parameter - * \param value the new parameter value - * \return 0 if OK, 1 if error - */ -static int -set_reg8 (GLcontext *ctx, grammar id, const char *name, GLubyte value) -{ - char error_msg[300]; - GLint error_pos; - - if (grammar_set_reg8 (id, (const byte *) name, value)) - return 0; - - grammar_get_last_error ((byte *) error_msg, 300, &error_pos); - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, "Grammar Register Error"); - return 1; -} - - -/** - * Enable support for the given language option in the parser. - * \return 1 if OK, 0 if error - */ -static int -enable_ext(GLcontext *ctx, grammar id, const char *name) -{ - return !set_reg8(ctx, id, name, 1); -} - - -/** - * Enable parser extensions based on which OpenGL extensions are supported - * by this rendering context. - * - * \return GL_TRUE if OK, GL_FALSE if error. - */ -static GLboolean -enable_parser_extensions(GLcontext *ctx, grammar id) -{ -#if 0 - /* These are not supported at this time */ - if ((ctx->Extensions.ARB_vertex_blend || - ctx->Extensions.EXT_vertex_weighting) - && !enable_ext(ctx, id, "vertex_blend")) - return GL_FALSE; - if (ctx->Extensions.ARB_matrix_palette - && !enable_ext(ctx, id, "matrix_palette")) - return GL_FALSE; -#endif - if (ctx->Extensions.ARB_fragment_program_shadow - && !enable_ext(ctx, id, "fragment_program_shadow")) - return GL_FALSE; - if (ctx->Extensions.EXT_point_parameters - && !enable_ext(ctx, id, "point_parameters")) - return GL_FALSE; - if (ctx->Extensions.EXT_secondary_color - && !enable_ext(ctx, id, "secondary_color")) - return GL_FALSE; - if (ctx->Extensions.EXT_fog_coord - && !enable_ext(ctx, id, "fog_coord")) - return GL_FALSE; - if (ctx->Extensions.NV_texture_rectangle - && !enable_ext(ctx, id, "texture_rectangle")) - return GL_FALSE; - if (!enable_ext(ctx, id, "draw_buffers")) - return GL_FALSE; - if (ctx->Extensions.MESA_texture_array - && !enable_ext(ctx, id, "texture_array")) - return GL_FALSE; -#if 1 - /* hack for Warcraft (see bug 8060) */ - enable_ext(ctx, id, "vertex_blend"); -#endif - - return GL_TRUE; -} - - -/** - * This kicks everything off. - * - * \param ctx - The GL Context - * \param str - The program string - * \param len - The program string length - * \param program - The arb_program struct to return all the parsed info in - * \return GL_TRUE on sucess, GL_FALSE on error - */ -static GLboolean -_mesa_parse_arb_program(GLcontext *ctx, GLenum target, - const GLubyte *str, GLsizei len, - struct arb_program *program) -{ - GLint a, err, error_pos; - char error_msg[300]; - GLuint parsed_len; - struct var_cache *vc_head; - grammar arbprogram_syn_id; - GLubyte *parsed, *inst; - GLubyte *strz = NULL; - static int arbprogram_syn_is_ok = 0; /* XXX temporary */ - - /* set the program target before parsing */ - program->Base.Target = target; - - /* Reset error state */ - _mesa_set_program_error(ctx, -1, NULL); - - /* check if arb_grammar_text (arbprogram.syn) is syntactically correct */ - if (!arbprogram_syn_is_ok) { - /* One-time initialization of parsing system */ - grammar grammar_syn_id; - GLuint parsed_len; - - grammar_syn_id = grammar_load_from_text ((byte *) core_grammar_text); - if (grammar_syn_id == 0) { - grammar_get_last_error ((byte *) error_msg, 300, &error_pos); - /* XXX this is not a GL error - it's an implementation bug! - FIX */ - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, - "glProgramStringARB(Error loading grammar rule set)"); - return GL_FALSE; - } - - err = !grammar_check(grammar_syn_id, (byte *) arb_grammar_text, - &parsed, &parsed_len); - - /* 'parsed' is unused here */ - _mesa_free (parsed); - parsed = NULL; - - /* NOTE: we can't destroy grammar_syn_id right here because - * grammar_destroy() can reset the last error - */ - if (err) { - /* XXX this is not a GL error - it's an implementation bug! - FIX */ - grammar_get_last_error ((byte *) error_msg, 300, &error_pos); - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, - "glProgramString(Error loading grammar rule set"); - grammar_destroy (grammar_syn_id); - return GL_FALSE; - } - - grammar_destroy (grammar_syn_id); - - arbprogram_syn_is_ok = 1; - } - - /* create the grammar object */ - arbprogram_syn_id = grammar_load_from_text ((byte *) arb_grammar_text); - if (arbprogram_syn_id == 0) { - /* XXX this is not a GL error - it's an implementation bug! - FIX */ - grammar_get_last_error ((GLubyte *) error_msg, 300, &error_pos); - _mesa_set_program_error (ctx, error_pos, error_msg); - _mesa_error (ctx, GL_INVALID_OPERATION, - "glProgramString(Error loading grammer rule set)"); - return GL_FALSE; - } - - /* Set program_target register value */ - if (set_reg8 (ctx, arbprogram_syn_id, "program_target", - program->Base.Target == GL_FRAGMENT_PROGRAM_ARB ? 0x10 : 0x20)) { - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - - if (!enable_parser_extensions(ctx, arbprogram_syn_id)) { - grammar_destroy(arbprogram_syn_id); - return GL_FALSE; - } - - /* check for NULL character occurences */ - { - GLint i; - for (i = 0; i < len; i++) { - if (str[i] == '\0') { - program_error(ctx, i, "illegal character"); - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - } - } - - /* copy the program string to a null-terminated string */ - strz = (GLubyte *) _mesa_malloc (len + 1); - if (!strz) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glProgramStringARB"); - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - _mesa_memcpy (strz, str, len); - strz[len] = '\0'; - - /* do a fast check on program string - initial production buffer is 4K */ - err = !grammar_fast_check(arbprogram_syn_id, strz, - &parsed, &parsed_len, 0x1000); - - /* Syntax parse error */ - if (err) { - grammar_get_last_error((GLubyte *) error_msg, 300, &error_pos); - program_error(ctx, error_pos, error_msg); - -#if DEBUG_PARSING - /* useful for debugging */ - do { - int line, col; - char *s; - fprintf(stderr, "program: %s\n", (char *) strz); - fprintf(stderr, "Error Pos: %d\n", ctx->Program.ErrorPos); - s = (char *) _mesa_find_line_column(strz, strz+ctx->Program.ErrorPos, - &line, &col); - fprintf(stderr, "line %d col %d: %s\n", line, col, s); - } while (0); -#endif - - _mesa_free(strz); - _mesa_free(parsed); - - grammar_destroy (arbprogram_syn_id); - return GL_FALSE; - } - - grammar_destroy (arbprogram_syn_id); - - /* - * Program string is syntactically correct at this point - * Parse the tokenized version of the program now, generating - * vertex/fragment program instructions. - */ - - /* Initialize the arb_program struct */ - program->Base.String = strz; - program->Base.Instructions = _mesa_alloc_instructions(MAX_PROGRAM_INSTRUCTIONS); - program->Base.NumInstructions = - program->Base.NumTemporaries = - program->Base.NumParameters = - program->Base.NumAttributes = program->Base.NumAddressRegs = 0; - program->Base.Parameters = _mesa_new_parameter_list (); - program->Base.InputsRead = 0x0; - program->Base.OutputsWritten = 0x0; - program->Position = 0; - program->MajorVersion = program->MinorVersion = 0; - program->PrecisionOption = GL_DONT_CARE; - program->FogOption = GL_NONE; - program->HintPositionInvariant = GL_FALSE; - for (a = 0; a < MAX_TEXTURE_IMAGE_UNITS; a++) - program->TexturesUsed[a] = 0x0; - program->ShadowSamplers = 0x0; - program->NumAluInstructions = - program->NumTexInstructions = - program->NumTexIndirections = 0; - program->UsesKill = 0; - - vc_head = NULL; - err = GL_FALSE; - - /* Start examining the tokens in the array */ - inst = parsed; - - /* Check the grammer rev */ - if (*inst++ != REVISION) { - program_error (ctx, 0, "Grammar version mismatch"); - err = GL_TRUE; - } - else { - /* ignore program target */ - inst++; - err = parse_instructions(ctx, inst, &vc_head, program); - } - - /*debug_variables(ctx, vc_head, program); */ - - /* We're done with the parsed binary array */ - var_cache_destroy (&vc_head); - - _mesa_free (parsed); - - /* Reallocate the instruction array from size [MAX_PROGRAM_INSTRUCTIONS] - * to size [ap.Base.NumInstructions]. - */ - program->Base.Instructions - = _mesa_realloc_instructions(program->Base.Instructions, - MAX_PROGRAM_INSTRUCTIONS, - program->Base.NumInstructions); - - return !err; -} -#endif - void _mesa_parse_arb_fragment_program(GLcontext* ctx, GLenum target, diff --git a/src/mesa/shader/arbprogram.syn b/src/mesa/shader/arbprogram.syn deleted file mode 100644 index b12c6a0eda..0000000000 --- a/src/mesa/shader/arbprogram.syn +++ /dev/null @@ -1,2824 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.2 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - /** - * \file arbprogram.syn - * ARB_fragment/vertex_program syntax - * \author Michal Krol - */ - -.syntax program; - -/* - This value must be incremented every time emit code values or structure of the production - array changes. This value is placed at the beginning of the production array. The loader - compares the value with its REVISION value. If they do not match, the loader is not up - to date. -*/ -.emtcode REVISION 0x0a - -/* program type */ -.emtcode FRAGMENT_PROGRAM 0x01 -.emtcode VERTEX_PROGRAM 0x02 - -/* program section */ -.emtcode OPTION 0x01 -.emtcode INSTRUCTION 0x02 -.emtcode DECLARATION 0x03 -.emtcode END 0x04 - -/* GL_ARB_fragment_program option */ -.emtcode ARB_PRECISION_HINT_FASTEST 0x00 -.emtcode ARB_PRECISION_HINT_NICEST 0x01 -.emtcode ARB_FOG_EXP 0x02 -.emtcode ARB_FOG_EXP2 0x03 -.emtcode ARB_FOG_LINEAR 0x04 - -/* GL_ARB_vertex_program option */ -.emtcode ARB_POSITION_INVARIANT 0x05 - -/* GL_ARB_fragment_program_shadow option */ -.emtcode ARB_FRAGMENT_PROGRAM_SHADOW 0x06 - -/* GL_ARB_draw_buffers option */ -.emtcode ARB_DRAW_BUFFERS 0x07 - -/* GL_MESA_texture_array option */ -.emtcode MESA_TEXTURE_ARRAY 0x08 - -/* GL_ARB_fragment_program instruction class */ -.emtcode OP_ALU_INST 0x00 -.emtcode OP_TEX_INST 0x01 - -/* GL_ARB_vertex_program instruction class */ -/* OP_ALU_INST */ - -/* GL_ARB_fragment_program instruction type */ -.emtcode OP_ALU_VECTOR 0x00 -.emtcode OP_ALU_SCALAR 0x01 -.emtcode OP_ALU_BINSC 0x02 -.emtcode OP_ALU_BIN 0x03 -.emtcode OP_ALU_TRI 0x04 -.emtcode OP_ALU_SWZ 0x05 -.emtcode OP_TEX_SAMPLE 0x06 -.emtcode OP_TEX_KIL 0x07 - -/* GL_ARB_vertex_program instruction type */ -.emtcode OP_ALU_ARL 0x08 -/* OP_ALU_VECTOR */ -/* OP_ALU_SCALAR */ -/* OP_ALU_BINSC */ -/* OP_ALU_BIN */ -/* OP_ALU_TRI */ -/* OP_ALU_SWZ */ - -/* GL_ARB_fragment_program instruction code */ -.emtcode OP_ABS 0x00 -.emtcode OP_ABS_SAT 0x1B -.emtcode OP_FLR 0x09 -.emtcode OP_FLR_SAT 0x26 -.emtcode OP_FRC 0x0A -.emtcode OP_FRC_SAT 0x27 -.emtcode OP_LIT 0x0C -.emtcode OP_LIT_SAT 0x2A -.emtcode OP_MOV 0x11 -.emtcode OP_MOV_SAT 0x30 -.emtcode OP_COS 0x1F -.emtcode OP_COS_SAT 0x20 -.emtcode OP_EX2 0x07 -.emtcode OP_EX2_SAT 0x25 -.emtcode OP_LG2 0x0B -.emtcode OP_LG2_SAT 0x29 -.emtcode OP_RCP 0x14 -.emtcode OP_RCP_SAT 0x33 -.emtcode OP_RSQ 0x15 -.emtcode OP_RSQ_SAT 0x34 -.emtcode OP_SIN 0x38 -.emtcode OP_SIN_SAT 0x39 -.emtcode OP_SCS 0x35 -.emtcode OP_SCS_SAT 0x36 -.emtcode OP_POW 0x13 -.emtcode OP_POW_SAT 0x32 -.emtcode OP_ADD 0x01 -.emtcode OP_ADD_SAT 0x1C -.emtcode OP_DP3 0x03 -.emtcode OP_DP3_SAT 0x21 -.emtcode OP_DP4 0x04 -.emtcode OP_DP4_SAT 0x22 -.emtcode OP_DPH 0x05 -.emtcode OP_DPH_SAT 0x23 -.emtcode OP_DST 0x06 -.emtcode OP_DST_SAT 0x24 -.emtcode OP_MAX 0x0F -.emtcode OP_MAX_SAT 0x2E -.emtcode OP_MIN 0x10 -.emtcode OP_MIN_SAT 0x2F -.emtcode OP_MUL 0x12 -.emtcode OP_MUL_SAT 0x31 -.emtcode OP_SGE 0x16 -.emtcode OP_SGE_SAT 0x37 -.emtcode OP_SLT 0x17 -.emtcode OP_SLT_SAT 0x3A -.emtcode OP_SUB 0x18 -.emtcode OP_SUB_SAT 0x3B -.emtcode OP_XPD 0x1A -.emtcode OP_XPD_SAT 0x43 -.emtcode OP_CMP 0x1D -.emtcode OP_CMP_SAT 0x1E -.emtcode OP_LRP 0x2B -.emtcode OP_LRP_SAT 0x2C -.emtcode OP_MAD 0x0E -.emtcode OP_MAD_SAT 0x2D -.emtcode OP_SWZ 0x19 -.emtcode OP_SWZ_SAT 0x3C -.emtcode OP_TEX 0x3D -.emtcode OP_TEX_SAT 0x3E -.emtcode OP_TXB 0x3F -.emtcode OP_TXB_SAT 0x40 -.emtcode OP_TXP 0x41 -.emtcode OP_TXP_SAT 0x42 -.emtcode OP_KIL 0x28 - -/* GL_ARB_vertex_program instruction code */ -.emtcode OP_ARL 0x02 -/* OP_ABS */ -/* OP_FLR */ -/* OP_FRC */ -/* OP_LIT */ -/* OP_MOV */ -/* OP_EX2 */ -.emtcode OP_EXP 0x08 -/* OP_LG2 */ -.emtcode OP_LOG 0x0D -/* OP_RCP */ -/* OP_RSQ */ -/* OP_POW */ -/* OP_ADD */ -/* OP_DP3 */ -/* OP_DP4 */ -/* OP_DPH */ -/* OP_DST */ -/* OP_MAX */ -/* OP_MIN */ -/* OP_MUL */ -/* OP_SGE */ -/* OP_SLT */ -/* OP_SUB */ -/* OP_XPD */ -/* OP_MAD */ -/* OP_SWZ */ - -/* fragment attribute binding */ -.emtcode FRAGMENT_ATTRIB_COLOR 0x01 -.emtcode FRAGMENT_ATTRIB_TEXCOORD 0x02 -.emtcode FRAGMENT_ATTRIB_FOGCOORD 0x03 -.emtcode FRAGMENT_ATTRIB_POSITION 0x04 - -/* vertex attribute binding */ -.emtcode VERTEX_ATTRIB_POSITION 0x01 -.emtcode VERTEX_ATTRIB_WEIGHT 0x02 -.emtcode VERTEX_ATTRIB_NORMAL 0x03 -.emtcode VERTEX_ATTRIB_COLOR 0x04 -.emtcode VERTEX_ATTRIB_FOGCOORD 0x05 -.emtcode VERTEX_ATTRIB_TEXCOORD 0x06 -.emtcode VERTEX_ATTRIB_MATRIXINDEX 0x07 -.emtcode VERTEX_ATTRIB_GENERIC 0x08 - -/* fragment result binding */ -.emtcode FRAGMENT_RESULT_COLOR 0x01 -.emtcode FRAGMENT_RESULT_DEPTH 0x02 - -/* vertex result binding */ -.emtcode VERTEX_RESULT_POSITION 0x01 -.emtcode VERTEX_RESULT_COLOR 0x02 -.emtcode VERTEX_RESULT_FOGCOORD 0x03 -.emtcode VERTEX_RESULT_POINTSIZE 0x04 -.emtcode VERTEX_RESULT_TEXCOORD 0x05 - -/* texture target */ -.emtcode TEXTARGET_1D 0x01 -.emtcode TEXTARGET_2D 0x02 -.emtcode TEXTARGET_3D 0x03 -.emtcode TEXTARGET_RECT 0x04 -.emtcode TEXTARGET_CUBE 0x05 -/* GL_ARB_fragment_program_shadow */ -.emtcode TEXTARGET_SHADOW1D 0x06 -.emtcode TEXTARGET_SHADOW2D 0x07 -.emtcode TEXTARGET_SHADOWRECT 0x08 -/* GL_MESA_texture_array */ -.emtcode TEXTARGET_1D_ARRAY 0x09 -.emtcode TEXTARGET_2D_ARRAY 0x0a -.emtcode TEXTARGET_SHADOW1D_ARRAY 0x0b -.emtcode TEXTARGET_SHADOW2D_ARRAY 0x0c - -/* face type */ -.emtcode FACE_FRONT 0x00 -.emtcode FACE_BACK 0x01 - -/* color type */ -.emtcode COLOR_PRIMARY 0x00 -.emtcode COLOR_SECONDARY 0x01 - -/* component */ -.emtcode COMPONENT_X 0x00 -.emtcode COMPONENT_Y 0x01 -.emtcode COMPONENT_Z 0x02 -.emtcode COMPONENT_W 0x03 -.emtcode COMPONENT_0 0x04 -.emtcode COMPONENT_1 0x05 - -/* array index type */ -.emtcode ARRAY_INDEX_ABSOLUTE 0x00 -.emtcode ARRAY_INDEX_RELATIVE 0x01 - -/* matrix name */ -.emtcode MATRIX_MODELVIEW 0x01 -.emtcode MATRIX_PROJECTION 0x02 -.emtcode MATRIX_MVP 0x03 -.emtcode MATRIX_TEXTURE 0x04 -.emtcode MATRIX_PALETTE 0x05 -.emtcode MATRIX_PROGRAM 0x06 - -/* matrix modifier */ -.emtcode MATRIX_MODIFIER_IDENTITY 0x00 -.emtcode MATRIX_MODIFIER_INVERSE 0x01 -.emtcode MATRIX_MODIFIER_TRANSPOSE 0x02 -.emtcode MATRIX_MODIFIER_INVTRANS 0x03 - -/* constant type */ -.emtcode CONSTANT_SCALAR 0x01 -.emtcode CONSTANT_VECTOR 0x02 - -/* program param type */ -.emtcode PROGRAM_PARAM_ENV 0x01 -.emtcode PROGRAM_PARAM_LOCAL 0x02 - -/* register type */ -.emtcode REGISTER_ATTRIB 0x01 -.emtcode REGISTER_PARAM 0x02 -.emtcode REGISTER_RESULT 0x03 -.emtcode REGISTER_ESTABLISHED_NAME 0x04 - -/* param binding */ -.emtcode PARAM_NULL 0x00 -.emtcode PARAM_ARRAY_ELEMENT 0x01 -.emtcode PARAM_STATE_ELEMENT 0x02 -.emtcode PARAM_PROGRAM_ELEMENT 0x03 -.emtcode PARAM_PROGRAM_ELEMENTS 0x04 -.emtcode PARAM_CONSTANT 0x05 - -/* param state property */ -.emtcode STATE_MATERIAL 0x01 -.emtcode STATE_LIGHT 0x02 -.emtcode STATE_LIGHT_MODEL 0x03 -.emtcode STATE_LIGHT_PROD 0x04 -.emtcode STATE_FOG 0x05 -.emtcode STATE_MATRIX_ROWS 0x06 -/* GL_ARB_fragment_program */ -.emtcode STATE_TEX_ENV 0x07 -.emtcode STATE_DEPTH 0x08 -/* GL_ARB_vertex_program */ -.emtcode STATE_TEX_GEN 0x09 -.emtcode STATE_CLIP_PLANE 0x0A -.emtcode STATE_POINT 0x0B - -/* state material property */ -.emtcode MATERIAL_AMBIENT 0x01 -.emtcode MATERIAL_DIFFUSE 0x02 -.emtcode MATERIAL_SPECULAR 0x03 -.emtcode MATERIAL_EMISSION 0x04 -.emtcode MATERIAL_SHININESS 0x05 - -/* state light property */ -.emtcode LIGHT_AMBIENT 0x01 -.emtcode LIGHT_DIFFUSE 0x02 -.emtcode LIGHT_SPECULAR 0x03 -.emtcode LIGHT_POSITION 0x04 -.emtcode LIGHT_ATTENUATION 0x05 -.emtcode LIGHT_HALF 0x06 -.emtcode LIGHT_SPOT_DIRECTION 0x07 - -/* state light model property */ -.emtcode LIGHT_MODEL_AMBIENT 0x01 -.emtcode LIGHT_MODEL_SCENECOLOR 0x02 - -/* state light product property */ -.emtcode LIGHT_PROD_AMBIENT 0x01 -.emtcode LIGHT_PROD_DIFFUSE 0x02 -.emtcode LIGHT_PROD_SPECULAR 0x03 - -/* state texture environment property */ -.emtcode TEX_ENV_COLOR 0x01 - -/* state texture generation coord property */ -.emtcode TEX_GEN_EYE 0x01 -.emtcode TEX_GEN_OBJECT 0x02 - -/* state fog property */ -.emtcode FOG_COLOR 0x01 -.emtcode FOG_PARAMS 0x02 - -/* state depth property */ -.emtcode DEPTH_RANGE 0x01 - -/* state point parameters property */ -.emtcode POINT_SIZE 0x01 -.emtcode POINT_ATTENUATION 0x02 - -/* declaration */ -.emtcode ATTRIB 0x01 -.emtcode PARAM 0x02 -.emtcode TEMP 0x03 -.emtcode OUTPUT 0x04 -.emtcode ALIAS 0x05 -/* GL_ARB_vertex_program */ -.emtcode ADDRESS 0x06 - -/* error messages */ -.errtext UNKNOWN_PROGRAM_SIGNATURE "1001: '$e_signature$': unknown program signature" -.errtext MISSING_END_OR_INVALID_STATEMENT "1002: '$e_statement$': invalid statement" -.errtext CODE_AFTER_END "1003: '$e_statement$': code after 'END' keyword" -.errtext INVALID_PROGRAM_OPTION "1004: '$e_identifier$': invalid program option" -.errtext EXT_SWIZ_COMP_EXPECTED "1005: extended swizzle component expected but '$e_token$' found" -.errtext TEX_TARGET_EXPECTED "1006: texture target expected but '$e_token$' found" -.errtext TEXTURE_EXPECTED "1007: 'texture' expected but '$e_identifier$' found" -.errtext SOURCE_REGISTER_EXPECTED "1008: source register expected but '$e_token$' found" -.errtext DESTINATION_REGISTER_EXPECTED "1009: destination register expected but '$e_token$' found" -.errtext INVALID_ADDRESS_COMPONENT "1010: '$e_identifier$': invalid address component" -.errtext INVALID_ADDRESS_WRITEMASK "1011: '$e_identifier$': invalid address writemask" -.errtext INVALID_COMPONENT "1012: '$e_charordigit$': invalid component" -.errtext INVALID_SUFFIX "1013: '$e_identifier$': invalid suffix" -.errtext INVALID_WRITEMASK "1014: '$e_identifier$': invalid writemask" -.errtext FRAGMENT_EXPECTED "1015: 'fragment' expected but '$e_identifier$' found" -.errtext VERTEX_EXPECTED "1016: 'vertex' expected but '$e_identifier$' found" -.errtext INVALID_FRAGMENT_PROPERTY "1017: '$e_identifier$': invalid fragment property" -.errtext INVALID_VERTEX_PROPERTY "1018: '$e_identifier$': invalid vertex property" -.errtext INVALID_STATE_PROPERTY "1019: '$e_identifier$': invalid state property" -.errtext INVALID_MATERIAL_PROPERTY "1020: '$e_identifier$': invalid material property" -.errtext INVALID_LIGHT_PROPERTY "1021: '$e_identifier$': invalid light property" -.errtext INVALID_SPOT_PROPERTY "1022: '$e_identifier$': invalid spot property" -.errtext INVALID_LIGHTMODEL_PROPERTY "1023: '$e_identifier$': invalid light model property" -.errtext INVALID_LIGHTPROD_PROPERTY "1024: '$e_identifier$': invalid light product property" -.errtext INVALID_TEXENV_PROPERTY "1025: '$e_identifier$': invalid texture environment property" -.errtext INVALID_TEXGEN_PROPERTY "1026: '$e_identifier$': invalid texture generating property" -.errtext INVALID_TEXGEN_COORD "1027: '$e_identifier$': invalid texture generating coord" -.errtext INVALID_FOG_PROPERTY "1028: '$e_identifier$': invalid fog property" -.errtext INVALID_DEPTH_PROPERTY "1029: '$e_identifier$': invalid depth property" -.errtext INVALID_CLIPPLANE_PROPERTY "1030: '$e_identifier$': invalid clip plane property" -.errtext INVALID_POINT_PROPERTY "1031: '$e_identifier$': invalid point property" -.errtext MATRIX_ROW_SELECTOR_OR_MODIFIER_EXPECTED "1032: matrix row selector or modifier expected but '$e_token$' found" -.errtext INVALID_MATRIX_NAME "1033: '$e_identifier$': invalid matrix name" -.errtext INVALID_PROGRAM_PROPERTY "1034: '$e_identifier$': invalid program property" -.errtext RESULT_EXPECTED "1035: 'result' expected but '$e_token$' found" -.errtext INVALID_RESULT_PROPERTY "1036: '$e_identifier$': invalid result property" -.errtext INVALID_FACE_PROPERTY "1037: '$e_identifier$': invalid face property" -.errtext INVALID_COLOR_PROPERTY "1038: '$e_identifier$': invalid color property" -.errtext IDENTIFIER_EXPECTED "1039: identifier expected but '$e_token$' found" -.errtext RESERVED_KEYWORD "1040: use of reserved keyword as an identifier" -.errtext INTEGER_EXPECTED "1041: integer value expected but '$e_token$' found" -.errtext MISSING_SEMICOLON "1042: ';' expected but '$e_token$' found" -.errtext MISSING_COMMA "1043: ',' expected but '$e_token$' found" -.errtext MISSING_LBRACKET "1044: '[' expected but '$e_token$' found" -.errtext MISSING_RBRACKET "1045: ']' expected but '$e_token$' found" -.errtext MISSING_DOT "1046: '.' expected but '$e_token$' found" -.errtext MISSING_EQUAL "1047: '=' expected but '$e_token$' found" -.errtext MISSING_LBRACE "1048: '{' expected but '$e_token$' found" -.errtext MISSING_RBRACE "1049: '}' expected but '$e_token$' found" -.errtext MISSING_DOTDOT "1050: '..' expected but '$e_token$' found" -.errtext MISSING_FRACTION_OR_EXPONENT "1051: missing fraction part or exponent" -.errtext MISSING_DOT_OR_EXPONENT "1052: missing '.' or exponent" -.errtext EXPONENT_VALUE_EXPECTED "1053: exponent value expected" -.errtext INTEGER_OUT_OF_RANGE "1054: integer value out of range" -.errtext OPERATION_NEEDS_DESTINATION_VARIABLE "1055: operation needs destination variable" -.errtext OPERATION_NEEDS_SOURCE_VARIABLE "1056: operation needs source variable" -.errtext ADDRESS_REGISTER_EXPECTED "1057: address register expected but '$e_token$' found" -.errtext ADDRESS_REGISTER_OR_INTEGER_EXPECTED "1058: address register or integer literal expected but '$e_token$' found" - -/* extension presence condition registers */ - -/* GL_ARB_vertex_blend */ -/* GL_EXT_vertex_weighting */ -.regbyte vertex_blend 0x00 - -/* GL_ARB_matrix_palette */ -.regbyte matrix_palette 0x00 - -/* GL_ARB_point_parameters */ -/* GL_EXT_point_parameters */ -.regbyte point_parameters 0x00 - -/* GL_EXT_secondary_color */ -.regbyte secondary_color 0x00 - -/* GL_EXT_fog_coord */ -.regbyte fog_coord 0x00 - -/* GL_EXT_texture_rectangle */ -/* GL_NV_texture_rectangle */ -.regbyte texture_rectangle 0x00 - -/* GL_ARB_fragment_program_shadow */ -.regbyte fragment_program_shadow 0x00 - -/* GL_ARB_draw_buffers */ -.regbyte draw_buffers 0x00 - -/* GL_MESA_texture_array */ -.regbyte texture_array 0x00 - -/* option presence condition registers */ -/* they are all initially set to zero - when a particular OPTION is encountered, the appropriate */ -/* register is set to 1 to indicate that the OPTION was specified. */ - -/* GL_ARB_fragment_program */ -.regbyte ARB_precision_hint_fastest 0x00 -.regbyte ARB_precision_hint_nicest 0x00 -.regbyte ARB_fog_exp 0x00 -.regbyte ARB_fog_exp2 0x00 -.regbyte ARB_fog_linear 0x00 - -/* GL_ARB_vertex_program */ -.regbyte ARB_position_invariant 0x00 - -/* GL_ARB_fragment_program_shadow */ -.regbyte ARB_fragment_program_shadow 0x00 - -/* GL_ARB_draw_buffers */ -.regbyte ARB_draw_buffers 0x00 - -/* GL_MESA_texture_array */ -.regbyte MESA_texture_array 0x00 - -/* program target condition register */ -/* this syntax script deals with two program targets - VERTEX_PROGRAM and FRAGMENT_PROGRAM. */ -/* to distinguish between them we need a register that will store for us the current target. */ -/* the client will typically set the register to apropriate value before parsing a particular */ -/* program. the mapping between program targets and their values is listed below. */ -/* */ -/* program target register value */ -/* ---------------------------------------------- */ -/* FRAGMENT_PROGRAM 0x10 */ -/* VERTEX_PROGRAM 0x20 */ -/* */ -/* the initial value of the register is 0 to catch potential errors with not setting the register */ -/* with the proper value. */ -.regbyte program_target 0x00 - -/* - ::= "END" -*/ -program - programs .error UNKNOWN_PROGRAM_SIGNATURE .emit REVISION; -programs - .if (program_target == 0x10) frag_program_1_0 .emit FRAGMENT_PROGRAM .emit 0x01 .emit 0x00 .or - .if (program_target == 0x20) vert_program_1_0 .emit VERTEX_PROGRAM .emit 0x01 .emit 0x00; -frag_program_1_0 - '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'f' .and 'p' .and '1' .and '.' .and '0' .and - optional_space .and fp_optionSequence .and fp_statementSequence .and - "END" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and - '\0' .error CODE_AFTER_END; -vert_program_1_0 - '!' .and '!' .and 'A' .and 'R' .and 'B' .and 'v' .and 'p' .and '1' .and '.' .and '0' .and - optional_space .and vp_optionSequence .and vp_statementSequence .and - "END" .error MISSING_END_OR_INVALID_STATEMENT .emit END .and optional_space .and - '\0' .error CODE_AFTER_END; - -/* - ::=