blob: 62693f29a77b8a25cc28a9fe072d81cb363692d6 [file] [log] [blame]
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00001//
Nicolas Capens16004fc2014-06-11 11:29:11 -04002// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00003// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
Geoff Lang0a73dd82014-11-19 16:18:08 -05006#ifndef COMPILER_TRANSLATOR_PARSECONTEXT_H_
7#define COMPILER_TRANSLATOR_PARSECONTEXT_H_
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +00008
Jamie Madilld4a3a312014-06-25 16:04:56 -04009#include "compiler/translator/Compiler.h"
Geoff Lang17732822013-08-29 13:46:49 -040010#include "compiler/translator/Diagnostics.h"
11#include "compiler/translator/DirectiveHandler.h"
Jamie Madillb1a85f42014-08-19 15:23:24 -040012#include "compiler/translator/Intermediate.h"
Geoff Lang17732822013-08-29 13:46:49 -040013#include "compiler/translator/SymbolTable.h"
daniel@transgaming.comb401a922012-10-26 18:58:24 +000014#include "compiler/preprocessor/Preprocessor.h"
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000015
Jamie Madill06145232015-05-13 13:10:01 -040016struct TMatrixFields
17{
daniel@transgaming.com0578f812010-05-17 09:58:39 +000018 bool wholeRow;
19 bool wholeCol;
20 int row;
21 int col;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000022};
23
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +000024//
25// The following are extra variables needed during parsing, grouped together so
26// they can be passed to the parser without needing a global.
27//
Jamie Madill6e06b1f2015-05-14 10:01:17 -040028class TParseContext : angle::NonCopyable
Jamie Madill06145232015-05-13 13:10:01 -040029{
Jamie Madill6e06b1f2015-05-14 10:01:17 -040030 public:
Jamie Madill06145232015-05-13 13:10:01 -040031 TParseContext(TSymbolTable &symt,
32 TExtensionBehavior &ext,
33 TIntermediate &interm,
34 sh::GLenum type,
35 ShShaderSpec spec,
36 int options,
37 bool checksPrecErrors,
38 TInfoSink &is,
39 bool debugShaderPrecisionSupported)
40 : intermediate(interm),
41 symbolTable(symt),
Corentin Wallezbc99bb62015-05-14 17:42:20 -040042 mDeferredSingleDeclarationErrorCheck(false),
Jamie Madill6e06b1f2015-05-14 10:01:17 -040043 mShaderType(type),
44 mShaderSpec(spec),
Corentin Wallezbc99bb62015-05-14 17:42:20 -040045 mShaderVersion(100),
Jamie Madill6e06b1f2015-05-14 10:01:17 -040046 mTreeRoot(nullptr),
Jamie Madill06145232015-05-13 13:10:01 -040047 mLoopNestingLevel(0),
Jamie Madill6e06b1f2015-05-14 10:01:17 -040048 mStructNestingLevel(0),
Jamie Madill06145232015-05-13 13:10:01 -040049 mSwitchNestingLevel(0),
Jamie Madill6e06b1f2015-05-14 10:01:17 -040050 mCurrentFunctionType(nullptr),
Jamie Madill06145232015-05-13 13:10:01 -040051 mFunctionReturnsValue(false),
Jamie Madill6e06b1f2015-05-14 10:01:17 -040052 mChecksPrecisionErrors(checksPrecErrors),
53 mFragmentPrecisionHigh(false),
54 mDefaultMatrixPacking(EmpColumnMajor),
55 mDefaultBlockStorage(EbsShared),
56 mDiagnostics(is),
Jamie Madill6e06b1f2015-05-14 10:01:17 -040057 mDirectiveHandler(ext, mDiagnostics, mShaderVersion, debugShaderPrecisionSupported),
58 mPreprocessor(&mDiagnostics, &mDirectiveHandler),
59 mScanner(nullptr),
Jamie Madill14e95b32015-05-07 10:10:41 -040060 mUsesFragData(false),
61 mUsesFragColor(false)
Olli Etuahofa33d582015-04-09 14:33:12 +030062 {
63 }
Jamie Madill06145232015-05-13 13:10:01 -040064
Jamie Madill6e06b1f2015-05-14 10:01:17 -040065 const pp::Preprocessor &getPreprocessor() const { return mPreprocessor; }
66 pp::Preprocessor &getPreprocessor() { return mPreprocessor; }
67 void *getScanner() const { return mScanner; }
68 void setScanner(void *scanner) { mScanner = scanner; }
69 int getShaderVersion() const { return mShaderVersion; }
70 sh::GLenum getShaderType() const { return mShaderType; }
71 ShShaderSpec getShaderSpec() const { return mShaderSpec; }
72 int numErrors() const { return mDiagnostics.numErrors(); }
73 TInfoSink &infoSink() { return mDiagnostics.infoSink(); }
Jamie Madill06145232015-05-13 13:10:01 -040074 void error(const TSourceLoc &loc, const char *reason, const char *token,
75 const char *extraInfo="");
76 void warning(const TSourceLoc &loc, const char *reason, const char *token,
77 const char *extraInfo="");
Jamie Madill14e95b32015-05-07 10:10:41 -040078
daniel@transgaming.com0578f812010-05-17 09:58:39 +000079 void recover();
Jamie Madill6e06b1f2015-05-14 10:01:17 -040080 TIntermNode *getTreeRoot() const { return mTreeRoot; }
81 void setTreeRoot(TIntermNode *treeRoot) { mTreeRoot = treeRoot; }
82
83 bool getFragmentPrecisionHigh() const { return mFragmentPrecisionHigh; }
84 void setFragmentPrecisionHigh(bool fragmentPrecisionHigh)
85 {
86 mFragmentPrecisionHigh = fragmentPrecisionHigh;
87 }
88
89 bool getFunctionReturnsValue() const { return mFunctionReturnsValue; }
90 void setFunctionReturnsValue(bool functionReturnsValue)
91 {
92 mFunctionReturnsValue = functionReturnsValue;
93 }
94
95 void setLoopNestingLevel(int loopNestintLevel)
96 {
97 mLoopNestingLevel = loopNestintLevel;
98 }
99
100 const TType *getCurrentFunctionType() const { return mCurrentFunctionType; }
101 void setCurrentFunctionType(const TType *currentFunctionType)
102 {
103 mCurrentFunctionType = currentFunctionType;
104 }
105
106 void incrLoopNestingLevel() { ++mLoopNestingLevel; }
107 void decrLoopNestingLevel() { --mLoopNestingLevel; }
108
109 void incrSwitchNestingLevel() { ++mSwitchNestingLevel; }
110 void decrSwitchNestingLevel() { --mSwitchNestingLevel; }
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000111
Jamie Madill5c097022014-08-20 16:38:32 -0400112 // This method is guaranteed to succeed, even if no variable with 'name' exists.
113 const TVariable *getNamedVariable(const TSourceLoc &location, const TString *name, const TSymbol *symbol);
114
Jamie Madill06145232015-05-13 13:10:01 -0400115 bool parseVectorFields(const TString&, int vecSize, TVectorFields&, const TSourceLoc &line);
116 bool parseMatrixFields(const TString&, int matCols, int matRows, TMatrixFields&, const TSourceLoc &line);
alokp@chromium.org75fe6b72011-08-14 05:31:22 +0000117
Jamie Madill06145232015-05-13 13:10:01 -0400118 bool reservedErrorCheck(const TSourceLoc &line, const TString &identifier);
119 void assignError(const TSourceLoc &line, const char *op, TString left, TString right);
120 void unaryOpError(const TSourceLoc &line, const char *op, TString operand);
121 void binaryOpError(const TSourceLoc &line, const char *op, TString left, TString right);
122 bool precisionErrorCheck(const TSourceLoc &line, TPrecision precision, TBasicType type);
123 bool lValueErrorCheck(const TSourceLoc &line, const char *op, TIntermTyped*);
124 bool constErrorCheck(TIntermTyped *node);
125 bool integerErrorCheck(TIntermTyped *node, const char *token);
126 bool globalErrorCheck(const TSourceLoc &line, bool global, const char *token);
127 bool constructorErrorCheck(const TSourceLoc &line, TIntermNode*, TFunction&, TOperator, TType*);
128 bool arraySizeErrorCheck(const TSourceLoc &line, TIntermTyped *expr, int &size);
Olli Etuaho3739d232015-04-08 12:23:44 +0300129 bool arrayQualifierErrorCheck(const TSourceLoc &line, const TPublicType &type);
Jamie Madill06145232015-05-13 13:10:01 -0400130 bool arrayTypeErrorCheck(const TSourceLoc &line, const TPublicType &type);
Olli Etuaho6ed7bbe2015-04-07 18:08:46 +0300131 bool voidErrorCheck(const TSourceLoc &line, const TString &identifier, const TBasicType &type);
Jamie Madill075edd82013-07-08 13:30:19 -0400132 bool boolErrorCheck(const TSourceLoc&, const TIntermTyped*);
133 bool boolErrorCheck(const TSourceLoc&, const TPublicType&);
Jamie Madill06145232015-05-13 13:10:01 -0400134 bool samplerErrorCheck(const TSourceLoc &line, const TPublicType &pType, const char *reason);
135 bool locationDeclaratorListCheck(const TSourceLoc &line, const TPublicType &pType);
136 bool parameterSamplerErrorCheck(const TSourceLoc &line, TQualifier qualifier, const TType &type);
137 bool paramErrorCheck(const TSourceLoc &line, TQualifier qualifier, TQualifier paramQualifier, TType *type);
138 bool extensionErrorCheck(const TSourceLoc &line, const TString&);
139 bool singleDeclarationErrorCheck(const TPublicType &publicType, const TSourceLoc &identifierLocation);
140 bool layoutLocationErrorCheck(const TSourceLoc &location, const TLayoutQualifier &layoutQualifier);
Olli Etuahob6e07a62015-02-16 12:22:10 +0200141 bool functionCallLValueErrorCheck(const TFunction *fnCandidate, TIntermAggregate *);
Olli Etuaho37ad4742015-04-27 13:18:50 +0300142 void es3InvariantErrorCheck(const TQualifier qualifier, const TSourceLoc &invariantLocation);
alokp@chromium.org8b851c62012-06-15 16:25:11 +0000143
Jamie Madill6e06b1f2015-05-14 10:01:17 -0400144 const TPragma &pragma() const { return mDirectiveHandler.pragma(); }
145 const TExtensionBehavior &extensionBehavior() const { return mDirectiveHandler.extensionBehavior(); }
Jamie Madill06145232015-05-13 13:10:01 -0400146 bool supportsExtension(const char *extension);
147 bool isExtensionEnabled(const char *extension) const;
148 void handleExtensionDirective(const TSourceLoc &loc, const char *extName, const char *behavior);
149 void handlePragmaDirective(const TSourceLoc &loc, const char *name, const char *value, bool stdgl);
alokp@chromium.org75fe6b72011-08-14 05:31:22 +0000150
Jamie Madill06145232015-05-13 13:10:01 -0400151 bool containsSampler(const TType &type);
152 bool areAllChildConst(TIntermAggregate *aggrNode);
153 const TFunction* findFunction(
154 const TSourceLoc &line, TFunction *pfnCall, int inputShaderVersion, bool *builtIn = 0);
155 bool executeInitializer(const TSourceLoc &line,
156 const TString &identifier,
157 const TPublicType &pType,
158 TIntermTyped *initializer,
159 TIntermNode **intermNode);
alokp@chromium.org75fe6b72011-08-14 05:31:22 +0000160
Jamie Madill06145232015-05-13 13:10:01 -0400161 TPublicType addFullySpecifiedType(TQualifier qualifier,
162 bool invariant,
163 TLayoutQualifier layoutQualifier,
164 const TPublicType &typeSpecifier);
Olli Etuahoe7847b02015-03-16 11:56:12 +0200165
Olli Etuahofa33d582015-04-09 14:33:12 +0300166 TIntermAggregate *parseSingleDeclaration(TPublicType &publicType,
Jamie Madill06145232015-05-13 13:10:01 -0400167 const TSourceLoc &identifierOrTypeLocation,
168 const TString &identifier);
Olli Etuahoe7847b02015-03-16 11:56:12 +0200169 TIntermAggregate *parseSingleArrayDeclaration(TPublicType &publicType,
Jamie Madill06145232015-05-13 13:10:01 -0400170 const TSourceLoc &identifierLocation,
171 const TString &identifier,
172 const TSourceLoc &indexLocation,
173 TIntermTyped *indexExpression);
174 TIntermAggregate *parseSingleInitDeclaration(const TPublicType &publicType,
175 const TSourceLoc &identifierLocation,
176 const TString &identifier,
177 const TSourceLoc &initLocation,
178 TIntermTyped *initializer);
Jamie Madill47e3ec02014-08-20 16:38:33 -0400179
Olli Etuaho3875ffd2015-04-10 16:45:14 +0300180 // Parse a declaration like "type a[n] = initializer"
181 // Note that this does not apply to declarations like "type[n] a = initializer"
182 TIntermAggregate *parseSingleArrayInitDeclaration(TPublicType &publicType,
Jamie Madill06145232015-05-13 13:10:01 -0400183 const TSourceLoc &identifierLocation,
184 const TString &identifier,
185 const TSourceLoc &indexLocation,
186 TIntermTyped *indexExpression,
187 const TSourceLoc &initLocation,
188 TIntermTyped *initializer);
Olli Etuaho3875ffd2015-04-10 16:45:14 +0300189
Jamie Madill06145232015-05-13 13:10:01 -0400190 TIntermAggregate *parseInvariantDeclaration(const TSourceLoc &invariantLoc,
191 const TSourceLoc &identifierLoc,
192 const TString *identifier,
193 const TSymbol *symbol);
Olli Etuahoe7847b02015-03-16 11:56:12 +0200194
Jamie Madill06145232015-05-13 13:10:01 -0400195 TIntermAggregate *parseDeclarator(TPublicType &publicType,
196 TIntermAggregate *aggregateDeclaration,
197 const TSourceLoc &identifierLocation,
198 const TString &identifier);
199 TIntermAggregate *parseArrayDeclarator(TPublicType &publicType,
200 TIntermAggregate *aggregateDeclaration,
201 const TSourceLoc &identifierLocation,
202 const TString &identifier,
203 const TSourceLoc &arrayLocation,
204 TIntermTyped *indexExpression);
205 TIntermAggregate *parseInitDeclarator(const TPublicType &publicType,
206 TIntermAggregate *aggregateDeclaration,
207 const TSourceLoc &identifierLocation,
208 const TString &identifier,
209 const TSourceLoc &initLocation,
210 TIntermTyped *initializer);
Olli Etuahoe7847b02015-03-16 11:56:12 +0200211
Olli Etuaho3875ffd2015-04-10 16:45:14 +0300212 // Parse a declarator like "a[n] = initializer"
Jamie Madill06145232015-05-13 13:10:01 -0400213 TIntermAggregate *parseArrayInitDeclarator(const TPublicType &publicType,
214 TIntermAggregate *aggregateDeclaration,
215 const TSourceLoc &identifierLocation,
216 const TString &identifier,
217 const TSourceLoc &indexLocation,
218 TIntermTyped *indexExpression,
219 const TSourceLoc &initLocation,
220 TIntermTyped *initializer);
Olli Etuaho3875ffd2015-04-10 16:45:14 +0300221
Jamie Madilla295edf2013-06-06 11:56:48 -0400222 void parseGlobalLayoutQualifier(const TPublicType &typeQualifier);
Jamie Madill06145232015-05-13 13:10:01 -0400223 TFunction *addConstructorFunc(const TPublicType &publicType);
224 TIntermTyped *addConstructor(TIntermNode *arguments,
225 TType *type,
226 TOperator op,
227 TFunction *fnCall,
228 const TSourceLoc &line);
229 TIntermTyped *foldConstConstructor(TIntermAggregate *aggrNode, const TType &type);
230 TIntermTyped *addConstVectorNode(TVectorFields&, TIntermTyped*, const TSourceLoc&);
231 TIntermTyped *addConstMatrixNode(int, TIntermTyped*, const TSourceLoc&);
232 TIntermTyped *addConstArrayNode(int index, TIntermTyped *node, const TSourceLoc &line);
233 TIntermTyped *addConstStruct(
234 const TString &identifier, TIntermTyped *node, const TSourceLoc& line);
235 TIntermTyped *addIndexExpression(TIntermTyped *baseExpression,
236 const TSourceLoc& location,
237 TIntermTyped *indexExpression);
238 TIntermTyped* addFieldSelectionExpression(TIntermTyped *baseExpression,
239 const TSourceLoc &dotLocation,
240 const TString &fieldString,
241 const TSourceLoc &fieldLocation);
shannonwoods@chromium.orga9100882013-05-30 00:11:39 +0000242
Jamie Madill06145232015-05-13 13:10:01 -0400243 TFieldList *addStructDeclaratorList(const TPublicType &typeSpecifier, TFieldList *fieldList);
244 TPublicType addStructure(const TSourceLoc &structLine,
245 const TSourceLoc &nameLine,
246 const TString *structName,
247 TFieldList *fieldList);
kbr@chromium.org476541f2011-10-27 21:14:51 +0000248
Jamie Madill06145232015-05-13 13:10:01 -0400249 TIntermAggregate* addInterfaceBlock(const TPublicType &typeQualifier,
250 const TSourceLoc &nameLine,
251 const TString &blockName,
252 TFieldList *fieldList,
253 const TString *instanceName,
254 const TSourceLoc &instanceLine,
255 TIntermTyped *arrayIndex,
256 const TSourceLoc& arrayIndexLine);
shannonwoods@chromium.org5668c5d2013-05-30 00:11:48 +0000257
Jamie Madill06145232015-05-13 13:10:01 -0400258 TLayoutQualifier parseLayoutQualifier(
259 const TString &qualifierType, const TSourceLoc &qualifierTypeLine);
260 TLayoutQualifier parseLayoutQualifier(const TString &qualifierType,
261 const TSourceLoc &qualifierTypeLine,
262 const TString &intValueString,
263 int intValue,
264 const TSourceLoc &intValueLine);
Jamie Madilla5efff92013-06-06 11:56:47 -0400265 TLayoutQualifier joinLayoutQualifiers(TLayoutQualifier leftQualifier, TLayoutQualifier rightQualifier);
Jamie Madillf2e0f9b2013-08-26 16:39:42 -0400266 TPublicType joinInterpolationQualifiers(const TSourceLoc &interpolationLoc, TQualifier interpolationQualifier,
267 const TSourceLoc &storageLoc, TQualifier storageQualifier);
shannonwoods@chromium.org302adfe2013-05-30 00:21:06 +0000268
kbr@chromium.org476541f2011-10-27 21:14:51 +0000269 // Performs an error check for embedded struct declarations.
270 // Returns true if an error was raised due to the declaration of
271 // this struct.
Jamie Madill06145232015-05-13 13:10:01 -0400272 bool enterStructDeclaration(const TSourceLoc &line, const TString &identifier);
kbr@chromium.org476541f2011-10-27 21:14:51 +0000273 void exitStructDeclaration();
274
Jamie Madill06145232015-05-13 13:10:01 -0400275 bool structNestingErrorCheck(const TSourceLoc &line, const TField &field);
Olli Etuaho09b22472015-02-11 11:47:26 +0200276
Olli Etuahoa3a36662015-02-17 13:46:51 +0200277 TIntermSwitch *addSwitch(TIntermTyped *init, TIntermAggregate *statementList, const TSourceLoc &loc);
278 TIntermCase *addCase(TIntermTyped *condition, const TSourceLoc &loc);
279 TIntermCase *addDefault(const TSourceLoc &loc);
280
Jamie Madill06145232015-05-13 13:10:01 -0400281 TIntermTyped *addUnaryMath(TOperator op, TIntermTyped *child, const TSourceLoc &loc);
282 TIntermTyped *addUnaryMathLValue(TOperator op, TIntermTyped *child, const TSourceLoc &loc);
283 TIntermTyped *addBinaryMath(
284 TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
285 TIntermTyped *addBinaryMathBooleanResult(
286 TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
287 TIntermTyped *addAssign(
288 TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
Olli Etuaho49300862015-02-20 14:54:49 +0200289
290 TIntermBranch *addBranch(TOperator op, const TSourceLoc &loc);
291 TIntermBranch *addBranch(TOperator op, TIntermTyped *returnValue, const TSourceLoc &loc);
Olli Etuahoc4ba3be2015-03-02 14:42:24 +0200292
Jamie Madill06145232015-05-13 13:10:01 -0400293 TIntermTyped *addFunctionCallOrMethod(TFunction *fnCall,
294 TIntermNode *paramNode,
295 TIntermNode *thisNode,
296 const TSourceLoc &loc,
297 bool *fatalError);
Olli Etuahofc1806e2015-03-17 13:03:11 +0200298
Jamie Madill06145232015-05-13 13:10:01 -0400299 TIntermTyped *addTernarySelection(
300 TIntermTyped *cond, TIntermTyped *trueBlock, TIntermTyped *falseBlock, const TSourceLoc &line);
Olli Etuaho52901742015-04-15 13:42:45 +0300301
Jamie Madill6e06b1f2015-05-14 10:01:17 -0400302 // TODO(jmadill): make these private
303 TIntermediate &intermediate; // to hold and build a parse tree
304 TSymbolTable &symbolTable; // symbol table that goes with the language currently being parsed
305
Olli Etuahofc1806e2015-03-17 13:03:11 +0200306 private:
Olli Etuaho2935c582015-04-08 14:32:06 +0300307 bool declareVariable(const TSourceLoc &line, const TString &identifier, const TType &type, TVariable **variable);
308
Olli Etuaho376f1b52015-04-13 13:23:41 +0300309 bool nonInitErrorCheck(const TSourceLoc &line, const TString &identifier, TPublicType *type);
310
Jamie Madill06145232015-05-13 13:10:01 -0400311 TIntermTyped *addBinaryMathInternal(
312 TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
313 TIntermTyped *createAssign(
314 TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
Olli Etuahof6c694b2015-03-26 14:50:53 +0200315 // The funcReturnType parameter is expected to be non-null when the operation is a built-in function.
316 // It is expected to be null for other unary operators.
Jamie Madill06145232015-05-13 13:10:01 -0400317 TIntermTyped *createUnaryMath(
318 TOperator op, TIntermTyped *child, const TSourceLoc &loc, const TType *funcReturnType);
Olli Etuahod6b14282015-03-17 14:31:35 +0200319
Olli Etuaho47fd36a2015-03-19 14:22:24 +0200320 // Return true if the checks pass
Jamie Madill06145232015-05-13 13:10:01 -0400321 bool binaryOpCommonCheck(
322 TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &loc);
Olli Etuahofa33d582015-04-09 14:33:12 +0300323
324 // Set to true when the last/current declarator list was started with an empty declaration.
325 bool mDeferredSingleDeclarationErrorCheck;
Jamie Madill6e06b1f2015-05-14 10:01:17 -0400326
327 sh::GLenum mShaderType; // vertex or fragment language (future: pack or unpack)
328 ShShaderSpec mShaderSpec; // The language specification compiler conforms to - GLES2 or WebGL.
329 int mShaderVersion;
Jamie Madill6e06b1f2015-05-14 10:01:17 -0400330 TIntermNode *mTreeRoot; // root of parse tree being created
331 int mLoopNestingLevel; // 0 if outside all loops
332 int mStructNestingLevel; // incremented while parsing a struct declaration
333 int mSwitchNestingLevel; // 0 if outside all switch statements
334 const TType *mCurrentFunctionType; // the return type of the function that's currently being parsed
335 bool mFunctionReturnsValue; // true if a non-void function has a return
336 bool mChecksPrecisionErrors; // true if an error will be generated when a variable is declared without precision, explicit or implicit.
337 bool mFragmentPrecisionHigh; // true if highp precision is supported in the fragment language.
338 TLayoutMatrixPacking mDefaultMatrixPacking;
339 TLayoutBlockStorage mDefaultBlockStorage;
340 TString mHashErrMsg;
341 TDiagnostics mDiagnostics;
342 TDirectiveHandler mDirectiveHandler;
343 pp::Preprocessor mPreprocessor;
344 void *mScanner;
Jamie Madill14e95b32015-05-07 10:10:41 -0400345 bool mUsesFragData; // track if we are using both gl_FragData and gl_FragColor
346 bool mUsesFragColor;
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000347};
348
Jamie Madill06145232015-05-13 13:10:01 -0400349int PaParseStrings(
350 size_t count, const char *const string[], const int length[], TParseContext *context);
daniel@transgaming.com4f39fd92010-03-08 20:26:45 +0000351
Geoff Lang0a73dd82014-11-19 16:18:08 -0500352#endif // COMPILER_TRANSLATOR_PARSECONTEXT_H_