Commit 91627bc7 by alokp@chromium.org

Removed code for unsupported pack-unpack language.

Review URL: https://codereview.appspot.com/9685045 git-svn-id: https://angleproject.googlecode.com/svn/trunk@2246 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 19aa9265
...@@ -90,10 +90,6 @@ enum TQualifier ...@@ -90,10 +90,6 @@ enum TQualifier
EvqInvariantVaryingOut, // vertex shaders only read/write EvqInvariantVaryingOut, // vertex shaders only read/write
EvqUniform, // Readonly, vertex and fragment EvqUniform, // Readonly, vertex and fragment
// pack/unpack input and output
EvqInput,
EvqOutput,
// parameters // parameters
EvqIn, EvqIn,
EvqOut, EvqOut,
...@@ -137,8 +133,6 @@ inline const char* getQualifierString(TQualifier q) ...@@ -137,8 +133,6 @@ inline const char* getQualifierString(TQualifier q)
case EvqIn: return "in"; break; case EvqIn: return "in"; break;
case EvqOut: return "out"; break; case EvqOut: return "out"; break;
case EvqInOut: return "inout"; break; case EvqInOut: return "inout"; break;
case EvqInput: return "input"; break;
case EvqOutput: return "output"; break;
case EvqPosition: return "Position"; break; case EvqPosition: return "Position"; break;
case EvqPointSize: return "PointSize"; break; case EvqPointSize: return "PointSize"; break;
case EvqFragCoord: return "FragCoord"; break; case EvqFragCoord: return "FragCoord"; break;
......
...@@ -319,7 +319,6 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& line, const char* op, TIn ...@@ -319,7 +319,6 @@ bool TParseContext::lValueErrorCheck(const TSourceLoc& line, const char* op, TIn
case EvqAttribute: message = "can't modify an attribute"; break; case EvqAttribute: message = "can't modify an attribute"; break;
case EvqUniform: message = "can't modify a uniform"; break; case EvqUniform: message = "can't modify a uniform"; break;
case EvqVaryingIn: message = "can't modify a varying"; break; case EvqVaryingIn: message = "can't modify a varying"; break;
case EvqInput: message = "can't modify an input"; break;
case EvqFragCoord: message = "can't modify gl_FragCoord"; break; case EvqFragCoord: message = "can't modify gl_FragCoord"; break;
case EvqFrontFacing: message = "can't modify gl_FrontFacing"; break; case EvqFrontFacing: message = "can't modify gl_FrontFacing"; break;
case EvqPointCoord: message = "can't modify gl_PointCoord"; break; case EvqPointCoord: message = "can't modify gl_PointCoord"; break;
......
...@@ -103,14 +103,6 @@ static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason) ...@@ -103,14 +103,6 @@ static void yyerror(YYLTYPE* yylloc, TParseContext* context, const char* reason)
} \ } \
} while (0) } while (0)
#define FRAG_VERT_ONLY(S, L) { \
if (context->shaderType != SH_FRAGMENT_SHADER && \
context->shaderType != SH_VERTEX_SHADER) { \
context->error(L, " supported in vertex/fragment shaders only ", S); \
context->recover(); \
} \
}
#define VERTEX_ONLY(S, L) { \ #define VERTEX_ONLY(S, L) { \
if (context->shaderType != SH_VERTEX_SHADER) { \ if (context->shaderType != SH_VERTEX_SHADER) { \
context->error(L, " supported in vertex shaders only ", S); \ context->error(L, " supported in vertex shaders only ", S); \
...@@ -647,33 +639,33 @@ function_identifier ...@@ -647,33 +639,33 @@ function_identifier
case EbtFloat: case EbtFloat:
if ($1.matrix) { if ($1.matrix) {
switch($1.size) { switch($1.size) {
case 2: op = EOpConstructMat2; break; case 2: op = EOpConstructMat2; break;
case 3: op = EOpConstructMat3; break; case 3: op = EOpConstructMat3; break;
case 4: op = EOpConstructMat4; break; case 4: op = EOpConstructMat4; break;
} }
} else { } else {
switch($1.size) { switch($1.size) {
case 1: op = EOpConstructFloat; break; case 1: op = EOpConstructFloat; break;
case 2: op = EOpConstructVec2; break; case 2: op = EOpConstructVec2; break;
case 3: op = EOpConstructVec3; break; case 3: op = EOpConstructVec3; break;
case 4: op = EOpConstructVec4; break; case 4: op = EOpConstructVec4; break;
} }
} }
break; break;
case EbtInt: case EbtInt:
switch($1.size) { switch($1.size) {
case 1: op = EOpConstructInt; break; case 1: op = EOpConstructInt; break;
case 2: FRAG_VERT_ONLY("ivec2", @1); op = EOpConstructIVec2; break; case 2: op = EOpConstructIVec2; break;
case 3: FRAG_VERT_ONLY("ivec3", @1); op = EOpConstructIVec3; break; case 3: op = EOpConstructIVec3; break;
case 4: FRAG_VERT_ONLY("ivec4", @1); op = EOpConstructIVec4; break; case 4: op = EOpConstructIVec4; break;
} }
break; break;
case EbtBool: case EbtBool:
switch($1.size) { switch($1.size) {
case 1: op = EOpConstructBool; break; case 1: op = EOpConstructBool; break;
case 2: FRAG_VERT_ONLY("bvec2", @1); op = EOpConstructBVec2; break; case 2: op = EOpConstructBVec2; break;
case 3: FRAG_VERT_ONLY("bvec3", @1); op = EOpConstructBVec3; break; case 3: op = EOpConstructBVec3; break;
case 4: FRAG_VERT_ONLY("bvec4", @1); op = EOpConstructBVec4; break; case 4: op = EOpConstructBVec4; break;
} }
break; break;
default: break; default: break;
...@@ -753,7 +745,6 @@ unary_operator ...@@ -753,7 +745,6 @@ unary_operator
multiplicative_expression multiplicative_expression
: unary_expression { $$ = $1; } : unary_expression { $$ = $1; }
| multiplicative_expression STAR unary_expression { | multiplicative_expression STAR unary_expression {
FRAG_VERT_ONLY("*", @2);
$$ = context->intermediate.addBinaryMath(EOpMul, $1, $3, @2, context->symbolTable); $$ = context->intermediate.addBinaryMath(EOpMul, $1, $3, @2, context->symbolTable);
if ($$ == 0) { if ($$ == 0) {
context->binaryOpError(@2, "*", $1->getCompleteString(), $3->getCompleteString()); context->binaryOpError(@2, "*", $1->getCompleteString(), $3->getCompleteString());
...@@ -762,7 +753,6 @@ multiplicative_expression ...@@ -762,7 +753,6 @@ multiplicative_expression
} }
} }
| multiplicative_expression SLASH unary_expression { | multiplicative_expression SLASH unary_expression {
FRAG_VERT_ONLY("/", @2);
$$ = context->intermediate.addBinaryMath(EOpDiv, $1, $3, @2, context->symbolTable); $$ = context->intermediate.addBinaryMath(EOpDiv, $1, $3, @2, context->symbolTable);
if ($$ == 0) { if ($$ == 0) {
context->binaryOpError(@2, "/", $1->getCompleteString(), $3->getCompleteString()); context->binaryOpError(@2, "/", $1->getCompleteString(), $3->getCompleteString());
...@@ -951,11 +941,11 @@ assignment_expression ...@@ -951,11 +941,11 @@ assignment_expression
; ;
assignment_operator assignment_operator
: EQUAL { $$.op = EOpAssign; } : EQUAL { $$.op = EOpAssign; }
| MUL_ASSIGN { FRAG_VERT_ONLY("*=", @1); $$.op = EOpMulAssign; } | MUL_ASSIGN { $$.op = EOpMulAssign; }
| DIV_ASSIGN { FRAG_VERT_ONLY("/=", @1); $$.op = EOpDivAssign; } | DIV_ASSIGN { $$.op = EOpDivAssign; }
| ADD_ASSIGN { $$.op = EOpAddAssign; } | ADD_ASSIGN { $$.op = EOpAddAssign; }
| SUB_ASSIGN { $$.op = EOpSubAssign; } | SUB_ASSIGN { $$.op = EOpSubAssign; }
; ;
expression expression
...@@ -1404,76 +1394,8 @@ single_declaration ...@@ -1404,76 +1394,8 @@ single_declaration
$$.intermAggregate = context->intermediate.makeAggregate(symbol, @2); $$.intermAggregate = context->intermediate.makeAggregate(symbol, @2);
} }
} }
//
// Place holder for the pack/unpack languages.
//
// | buffer_specifier {
// $$.intermAggregate = 0;
// }
; ;
// Grammar Note: No 'enum', or 'typedef'.
//
// Place holder for the pack/unpack languages.
//
//%type <interm> buffer_declaration
//%type <interm.type> buffer_specifier input_or_output buffer_declaration_list
//buffer_specifier
// : input_or_output LEFT_BRACE buffer_declaration_list RIGHT_BRACE {
// }
// ;
//
//input_or_output
// : INPUT {
// if (context->globalErrorCheck(@1, context->symbolTable.atGlobalLevel(), "input"))
// context->recover();
// UNPACK_ONLY("input", @1);
// $$.qualifier = EvqInput;
// }
// | OUTPUT {
// if (context->globalErrorCheck(@1, context->symbolTable.atGlobalLevel(), "output"))
// context->recover();
// PACK_ONLY("output", @1);
// $$.qualifier = EvqOutput;
// }
// ;
//
// Place holder for the pack/unpack languages.
//
//buffer_declaration_list
// : buffer_declaration {
// }
// | buffer_declaration_list buffer_declaration {
// }
// ;
//
// Input/output semantics:
// float must be 16 or 32 bits
// float alignment restrictions?
// check for only one input and only one output
// sum of bitfields has to be multiple of 32
//
//
// Place holder for the pack/unpack languages.
//
//buffer_declaration
// : type_specifier IDENTIFIER COLON constant_expression SEMICOLON {
// if (context->reservedErrorCheck(@2, *$2.string, context))
// context->recover();
// $$.variable = new TVariable($2.string, $1);
// if (! context->symbolTable.insert(*$$.variable)) {
// context->error(@2, "redefinition", $$.variable->getName().c_str());
// context->recover();
// // don't have to delete $$.variable, the pool pop will take care of it
// }
// }
// ;
fully_specified_type fully_specified_type
: type_specifier { : type_specifier {
$$ = $1; $$ = $1;
...@@ -1603,11 +1525,6 @@ type_specifier_nonarray ...@@ -1603,11 +1525,6 @@ type_specifier_nonarray
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtBool, qual, @1); $$.setBasic(EbtBool, qual, @1);
} }
// | UNSIGNED INT_TYPE {
// PACK_UNPACK_ONLY("unsigned", @1);
// TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
// $$.setBasic(EbtInt, qual, @1);
// }
| VEC2 { | VEC2 {
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
...@@ -1654,30 +1571,25 @@ type_specifier_nonarray ...@@ -1654,30 +1571,25 @@ type_specifier_nonarray
$$.setAggregate(4); $$.setAggregate(4);
} }
| MATRIX2 { | MATRIX2 {
FRAG_VERT_ONLY("mat2", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
$$.setAggregate(2, true); $$.setAggregate(2, true);
} }
| MATRIX3 { | MATRIX3 {
FRAG_VERT_ONLY("mat3", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
$$.setAggregate(3, true); $$.setAggregate(3, true);
} }
| MATRIX4 { | MATRIX4 {
FRAG_VERT_ONLY("mat4", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtFloat, qual, @1); $$.setBasic(EbtFloat, qual, @1);
$$.setAggregate(4, true); $$.setAggregate(4, true);
} }
| SAMPLER2D { | SAMPLER2D {
FRAG_VERT_ONLY("sampler2D", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSampler2D, qual, @1); $$.setBasic(EbtSampler2D, qual, @1);
} }
| SAMPLERCUBE { | SAMPLERCUBE {
FRAG_VERT_ONLY("samplerCube", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSamplerCube, qual, @1); $$.setBasic(EbtSamplerCube, qual, @1);
} }
...@@ -1686,7 +1598,6 @@ type_specifier_nonarray ...@@ -1686,7 +1598,6 @@ type_specifier_nonarray
context->error(@1, "unsupported type", "samplerExternalOES"); context->error(@1, "unsupported type", "samplerExternalOES");
context->recover(); context->recover();
} }
FRAG_VERT_ONLY("samplerExternalOES", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSamplerExternalOES, qual, @1); $$.setBasic(EbtSamplerExternalOES, qual, @1);
} }
...@@ -1695,12 +1606,10 @@ type_specifier_nonarray ...@@ -1695,12 +1606,10 @@ type_specifier_nonarray
context->error(@1, "unsupported type", "sampler2DRect"); context->error(@1, "unsupported type", "sampler2DRect");
context->recover(); context->recover();
} }
FRAG_VERT_ONLY("sampler2DRect", @1);
TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; TQualifier qual = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
$$.setBasic(EbtSampler2DRect, qual, @1); $$.setBasic(EbtSampler2DRect, qual, @1);
} }
| struct_specifier { | struct_specifier {
FRAG_VERT_ONLY("struct", @1);
$$ = $1; $$ = $1;
$$.qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary; $$.qualifier = context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary;
} }
......
/* A Bison parser, made by GNU Bison 2.4.2. */ /* A Bison parser, made by GNU Bison 2.7. */
/* Skeleton interface for Bison's Yacc-like parsers in C /* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
Foundation, Inc.
This program is free software: you can redistribute it and/or modify This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
...@@ -31,6 +30,15 @@ ...@@ -31,6 +30,15 @@
This special exception was added by the Free Software Foundation in This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */ version 2.2 of Bison. */
#ifndef YY_YY_GLSLANG_TAB_H_INCLUDED
# define YY_YY_GLSLANG_TAB_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int yydebug;
#endif
/* "%code requires" blocks. */ /* "%code requires" blocks. */
...@@ -142,7 +150,6 @@ ...@@ -142,7 +150,6 @@
#endif #endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE typedef union YYSTYPE
{ {
...@@ -184,8 +191,6 @@ typedef union YYSTYPE ...@@ -184,8 +191,6 @@ typedef union YYSTYPE
# define YYSTYPE_IS_DECLARED 1 # define YYSTYPE_IS_DECLARED 1
#endif #endif
#if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED #if ! defined YYLTYPE && ! defined YYLTYPE_IS_DECLARED
typedef struct YYLTYPE typedef struct YYLTYPE
{ {
...@@ -200,4 +205,18 @@ typedef struct YYLTYPE ...@@ -200,4 +205,18 @@ typedef struct YYLTYPE
#endif #endif
#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 (TParseContext* context);
#else
int yyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_YY_GLSLANG_TAB_H_INCLUDED */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment