RetroArch
ParseHelper.h
Go to the documentation of this file.
1 //
2 // Copyright (C) 2002-2005 3Dlabs Inc. Ltd.
3 // Copyright (C) 2012-2013 LunarG, Inc.
4 //
5 // All rights reserved.
6 //
7 // Redistribution and use in source and binary forms, with or without
8 // modification, are permitted provided that the following conditions
9 // are met:
10 //
11 // Redistributions of source code must retain the above copyright
12 // notice, this list of conditions and the following disclaimer.
13 //
14 // Redistributions in binary form must reproduce the above
15 // copyright notice, this list of conditions and the following
16 // disclaimer in the documentation and/or other materials provided
17 // with the distribution.
18 //
19 // Neither the name of 3Dlabs Inc. Ltd. nor the names of its
20 // contributors may be used to endorse or promote products derived
21 // from this software without specific prior written permission.
22 //
23 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26 // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27 // COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28 // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29 // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 // LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33 // ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 // POSSIBILITY OF SUCH DAMAGE.
35 //
36 
37 //
38 // This header defines a two-level parse-helper hierarchy, derived from
39 // TParseVersions:
40 // - TParseContextBase: sharable across multiple parsers
41 // - TParseContext: GLSL specific helper
42 //
43 
44 #ifndef _PARSER_HELPER_INCLUDED_
45 #define _PARSER_HELPER_INCLUDED_
46 
47 #include <cstdarg>
48 #include <functional>
49 
50 #include "parseVersions.h"
51 #include "../Include/ShHandle.h"
52 #include "SymbolTable.h"
53 #include "localintermediate.h"
54 #include "Scan.h"
55 #include "attribute.h"
56 
57 namespace glslang {
58 
59 struct TPragma {
60  TPragma(bool o, bool d) : optimize(o), debug(d) { }
61  bool optimize;
62  bool debug;
64 };
65 
66 class TScanContext;
67 class TPpContext;
68 
69 typedef std::set<int> TIdSetType;
70 
71 //
72 // Sharable code (as well as what's in TParseVersions) across
73 // parse helpers.
74 //
76 public:
80  const TString* entryPoint = nullptr)
82  scopeMangler("::"),
89  globalUniformBlock(nullptr),
90  globalUniformBinding(TQualifier::layoutBindingEnd),
91  globalUniformSet(TQualifier::layoutSetEnd)
92  {
93  if (entryPoint != nullptr)
95  }
96  virtual ~TParseContextBase() { }
97 
98  virtual void C_DECL error(const TSourceLoc&, const char* szReason, const char* szToken,
99  const char* szExtraInfoFormat, ...);
100  virtual void C_DECL warn(const TSourceLoc&, const char* szReason, const char* szToken,
101  const char* szExtraInfoFormat, ...);
102  virtual void C_DECL ppError(const TSourceLoc&, const char* szReason, const char* szToken,
103  const char* szExtraInfoFormat, ...);
104  virtual void C_DECL ppWarn(const TSourceLoc&, const char* szReason, const char* szToken,
105  const char* szExtraInfoFormat, ...);
106 
107  virtual void setLimits(const TBuiltInResource&) = 0;
108 
109  void checkIndex(const TSourceLoc&, const TType&, int& index);
110 
111  EShLanguage getLanguage() const { return language; }
115  TPpContext* getPpContext() const { return ppContext; }
116 
117  virtual void setLineCallback(const std::function<void(int, int, bool, int, const char*)>& func) { lineCallback = func; }
118  virtual void setExtensionCallback(const std::function<void(int, const char*, const char*)>& func) { extensionCallback = func; }
119  virtual void setVersionCallback(const std::function<void(int, int, const char*)>& func) { versionCallback = func; }
120  virtual void setPragmaCallback(const std::function<void(int, const TVector<TString>&)>& func) { pragmaCallback = func; }
121  virtual void setErrorCallback(const std::function<void(int, const char*)>& func) { errorCallback = func; }
122 
123  virtual void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op) = 0;
124  virtual bool lineContinuationCheck(const TSourceLoc&, bool endOfComment) = 0;
125  virtual bool lineDirectiveShouldSetNextLine() const = 0;
126  virtual void handlePragma(const TSourceLoc&, const TVector<TString>&) = 0;
127 
128  virtual bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false) = 0;
129 
130  virtual void notifyVersion(int line, int version, const char* type_string)
131  {
132  if (versionCallback)
133  versionCallback(line, version, type_string);
134  }
135  virtual void notifyErrorDirective(int line, const char* error_message)
136  {
137  if (errorCallback)
138  errorCallback(line, error_message);
139  }
140  virtual void notifyLineDirective(int curLineNo, int newLineNo, bool hasSource, int sourceNum, const char* sourceName)
141  {
142  if (lineCallback)
143  lineCallback(curLineNo, newLineNo, hasSource, sourceNum, sourceName);
144  }
145  virtual void notifyExtensionDirective(int line, const char* extension, const char* behavior)
146  {
147  if (extensionCallback)
148  extensionCallback(line, extension, behavior);
149  }
150 
151  // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
152  virtual void growGlobalUniformBlock(const TSourceLoc&, TType&, const TString& memberName, TTypeList* typeList = nullptr);
153 
154  // Potentially rename shader entry point function
156  {
157  // Replace the entry point name given in the shader with the real entry point name,
158  // if there is a substitution.
159  if (name != nullptr && *name == sourceEntryPointName && intermediate.getEntryPointName().size() > 0)
161  }
162 
163  virtual bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
164  virtual void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*);
165 
166  const char* const scopeMangler;
167 
168  // Basic parsing state, easily accessible to the grammar
169 
170  TSymbolTable& symbolTable; // symbol table that goes with the current language, version, and profile
171  int statementNestingLevel; // 0 if outside all flow control or compound statements
172  int loopNestingLevel; // 0 if outside all loops
173  int structNestingLevel; // 0 if outside blocks and structures
174  int controlFlowNestingLevel; // 0 if outside all flow control
175  const TType* currentFunctionType; // the return type of the function that's currently being parsed
176  bool functionReturnsValue; // true if a non-void function has a return
177  // if inside a function, true if the function is the entry point and this is after a return statement
179  // case, node, case, case, node, ...; ensure only one node between cases; stack of them for nesting
181  // the statementNestingLevel the current switch statement is at, which must match the level of its case statements
184 
185 protected:
188 
189  const bool parsingBuiltins; // true if parsing built-in symbols/functions
190  TVector<TSymbol*> linkageSymbols; // will be transferred to 'linkage', after all editing is done, order preserving
196 
197  // These, if set, will be called when a line, pragma ... is preprocessed.
198  // They will be called with any parameters to the original directive.
199  std::function<void(int, int, bool, int, const char*)> lineCallback;
200  std::function<void(int, const TVector<TString>&)> pragmaCallback;
201  std::function<void(int, int, const char*)> versionCallback;
202  std::function<void(int, const char*, const char*)> extensionCallback;
203  std::function<void(int, const char*)> errorCallback;
204 
205  // see implementation for detail
207  std::function<bool(const TType&, const TType&, TOperator, int arg)>,
208  std::function<bool(const TType&, const TType&, const TType&)>,
209  /* output */ bool& tie);
210 
211  virtual void parseSwizzleSelector(const TSourceLoc&, const TString&, int size,
213 
214  // Manage the global uniform block (default uniforms in GLSL, $Global in HLSL)
215  TVariable* globalUniformBlock; // the actual block, inserted into the symbol table
216  unsigned int globalUniformBinding; // the block's binding number
217  unsigned int globalUniformSet; // the block's set number
218  int firstNewMember; // the index of the first member not yet inserted into the symbol table
219  // override this to set the language-specific name
220  virtual const char* getGlobalUniformBlockName() const { return ""; }
221  virtual void setUniformBlockDefaults(TType&) const { }
223  virtual void outputMessage(const TSourceLoc&, const char* szReason, const char* szToken,
224  const char* szExtraInfoFormat, TPrefixType prefix,
225  va_list args);
226  virtual void trackLinkage(TSymbol& symbol);
227  virtual void makeEditable(TSymbol*&);
228  virtual TVariable* getEditableVariable(const char* name);
229  virtual void finish();
230 };
231 
232 //
233 // Manage the state for when to respect precision qualifiers and when to warn about
234 // the defaults being different than might be expected.
235 //
237 public:
239  virtual ~TPrecisionManager() {}
240 
241  void respectPrecisionQualifiers() { obey = true; }
242  bool respectingPrecisionQualifiers() const { return obey; }
243  bool shouldWarnAboutDefaults() const { return warn; }
244  void defaultWarningGiven() { warn = false; }
245  void warnAboutDefaults() { warn = true; }
247  {
248  explicitIntDefault = true;
250  warn = false;
251  }
253  {
254  explicitFloatDefault = true;
255  if (explicitIntDefault)
256  warn = false;
257  }
258 
259 protected:
260  bool obey; // respect precision qualifiers
261  bool warn; // need to give a warning about the defaults
262  bool explicitIntDefault; // user set the default for int/uint
263  bool explicitFloatDefault; // user set the default for float
264 };
265 
266 //
267 // GLSL-specific parse helper. Should have GLSL in the name, but that's
268 // too big of a change for comparing branches at the moment, and perhaps
269 // impacts downstream consumers as well.
270 //
272 public:
275  const TString* entryPoint = nullptr);
276  virtual ~TParseContext();
277 
279  void setPrecisionDefaults();
280 
281  void setLimits(const TBuiltInResource&) override;
282  bool parseShaderStrings(TPpContext&, TInputScanner& input, bool versionWillBeError = false) override;
283  void parserError(const char* s); // for bison's yyerror
284 
285  void reservedErrorCheck(const TSourceLoc&, const TString&);
286  void reservedPpErrorCheck(const TSourceLoc&, const char* name, const char* op) override;
287  bool lineContinuationCheck(const TSourceLoc&, bool endOfComment) override;
288  bool lineDirectiveShouldSetNextLine() const override;
289  bool builtInName(const TString&);
290 
291  void handlePragma(const TSourceLoc&, const TVector<TString>&) override;
292  TIntermTyped* handleVariable(const TSourceLoc&, TSymbol* symbol, const TString* string);
295 
296  void makeEditable(TSymbol*&) override;
297  bool isIoResizeArray(const TType&) const;
298  void fixIoArraySize(const TSourceLoc&, TType&);
299  void ioArrayCheck(const TSourceLoc&, const TType&, const TString& identifier);
301  void checkIoArraysConsistency(const TSourceLoc&, bool tailOnly = false);
302  int getIoArrayImplicitSize() const;
303  void checkIoArrayConsistency(const TSourceLoc&, int requiredSize, const char* feature, TType&, const TString&);
304 
306  TIntermTyped* handleUnaryMath(const TSourceLoc&, const char* str, TOperator op, TIntermTyped* childNode);
308  void blockMemberExtensionCheck(const TSourceLoc&, const TIntermTyped* base, const TString& field);
309  TFunction* handleFunctionDeclarator(const TSourceLoc&, TFunction& function, bool prototype);
315  void checkLocation(const TSourceLoc&, TOperator);
317  void addInputArgumentConversions(const TFunction&, TIntermNode*&) const;
319  void builtInOpCheck(const TSourceLoc&, const TFunction&, TIntermOperator&);
322  void samplerConstructorLocationCheck(const TSourceLoc&, const char* token, TIntermNode*);
326 
327  void assignError(const TSourceLoc&, const char* op, TString left, TString right);
328  void unaryOpError(const TSourceLoc&, const char* op, TString operand);
329  void binaryOpError(const TSourceLoc&, const char* op, TString left, TString right);
330  void variableCheck(TIntermTyped*& nodePtr);
331  bool lValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override;
332  void rValueErrorCheck(const TSourceLoc&, const char* op, TIntermTyped*) override;
333  void constantValueCheck(TIntermTyped* node, const char* token);
334  void integerCheck(const TIntermTyped* node, const char* token);
335  void globalCheck(const TSourceLoc&, const char* token);
339  bool arrayQualifierError(const TSourceLoc&, const TQualifier&);
340  bool arrayError(const TSourceLoc&, const TType&);
341  void arraySizeRequiredCheck(const TSourceLoc&, const TArraySizes&);
342  void structArrayCheck(const TSourceLoc&, const TType& structure);
343  void arraySizesCheck(const TSourceLoc&, const TQualifier&, TArraySizes*, const TIntermTyped* initializer, bool lastMember);
344  void arrayOfArrayVersionCheck(const TSourceLoc&, const TArraySizes*);
345  bool voidErrorCheck(const TSourceLoc&, const TString&, TBasicType);
346  void boolCheck(const TSourceLoc&, const TIntermTyped*);
347  void boolCheck(const TSourceLoc&, const TPublicType&);
348  void samplerCheck(const TSourceLoc&, const TType&, const TString& identifier, TIntermTyped* initializer);
349  void atomicUintCheck(const TSourceLoc&, const TType&, const TString& identifier);
350  void transparentOpaqueCheck(const TSourceLoc&, const TType&, const TString& identifier);
353  void globalQualifierTypeCheck(const TSourceLoc&, const TQualifier&, const TPublicType&);
354  bool structQualifierErrorCheck(const TSourceLoc&, const TPublicType& pType);
355  void mergeQualifiers(const TSourceLoc&, TQualifier& dst, const TQualifier& src, bool force);
360  void parameterTypeCheck(const TSourceLoc&, TStorageQualifier qualifier, const TType& type);
361  bool containsFieldWithBasicType(const TType& type ,TBasicType basicType);
363  void redeclareBuiltinBlock(const TSourceLoc&, TTypeList& typeList, const TString& blockName, const TString* instanceName, TArraySizes* arraySizes);
365  void paramCheckFix(const TSourceLoc&, const TQualifier&, TType& type);
366  void nestedBlockCheck(const TSourceLoc&);
367  void nestedStructCheck(const TSourceLoc&);
368  void arrayObjectCheck(const TSourceLoc&, const TType&, const char* op);
369  void opaqueCheck(const TSourceLoc&, const TType&, const char* op);
370  void specializationCheck(const TSourceLoc&, const TType&, const char* op);
371  void structTypeCheck(const TSourceLoc&, TPublicType&);
373  void arrayLimitCheck(const TSourceLoc&, const TString&, int size);
374  void limitCheck(const TSourceLoc&, int value, const char* limit, const char* feature);
375 
376  void inductiveLoopBodyCheck(TIntermNode*, int loopIndexId, TSymbolTable&);
378 
381  void mergeObjectLayoutQualifiers(TQualifier& dest, const TQualifier& src, bool inheritOnly);
382  void layoutObjectCheck(const TSourceLoc&, const TSymbol&);
383  void layoutMemberLocationArrayCheck(const TSourceLoc&, bool memberWithLocation, TArraySizes* arraySizes);
384  void layoutTypeCheck(const TSourceLoc&, const TType&);
385  void layoutQualifierCheck(const TSourceLoc&, const TQualifier&);
387  void fixOffset(const TSourceLoc&, TSymbol&);
388 
389  const TFunction* findFunction(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
390  const TFunction* findFunctionExact(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
391  const TFunction* findFunction120(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
392  const TFunction* findFunction400(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
393  const TFunction* findFunctionExplicitTypes(const TSourceLoc& loc, const TFunction& call, bool& builtIn);
394  void declareTypeDefaults(const TSourceLoc&, const TPublicType&);
395  TIntermNode* declareVariable(const TSourceLoc&, TString& identifier, const TPublicType&, TArraySizes* typeArray = 0, TIntermTyped* initializer = 0);
398  TIntermTyped* constructBuiltIn(const TType&, TOperator, TIntermTyped*, const TSourceLoc&, bool subset);
399  void declareBlock(const TSourceLoc&, TTypeList& typeList, const TString* instanceName = 0, TArraySizes* arraySizes = 0);
400  void blockStageIoCheck(const TSourceLoc&, const TQualifier&);
401  void blockQualifierCheck(const TSourceLoc&, const TQualifier&, bool instanceName);
402  void fixBlockLocations(const TSourceLoc&, TQualifier&, TTypeList&, bool memberWithLocation, bool memberWithoutLocation);
405  void addQualifierToExisting(const TSourceLoc&, TQualifier, const TString& identifier);
407  void invariantCheck(const TSourceLoc&, const TQualifier&);
409  void wrapupSwitchSubsequence(TIntermAggregate* statements, TIntermNode* branchNode);
411 
413  TAttributes* makeAttributes(const TString& identifier) const;
414  TAttributes* makeAttributes(const TString& identifier, TIntermNode* node) const;
416 
417  // Determine selection control from attributes
420 
421  // Determine loop control from attributes
423 
424 protected:
425  void nonInitConstCheck(const TSourceLoc&, TString& identifier, TType& type);
426  void inheritGlobalDefaults(TQualifier& dst) const;
427  TVariable* makeInternalVariable(const char* name, const TType&) const;
428  TVariable* declareNonArray(const TSourceLoc&, const TString& identifier, const TType&);
429  void declareArray(const TSourceLoc&, const TString& identifier, const TType&, TSymbol*&);
430  void checkRuntimeSizable(const TSourceLoc&, const TIntermTyped&);
431  bool isRuntimeLength(const TIntermTyped&) const;
433  TIntermTyped* convertInitializerList(const TSourceLoc&, const TType&, TIntermTyped* initializer);
434  void finish() override;
435 
436 public:
437  //
438  // Generally, bison productions, the scanner, and the PP need read/write access to these; just give them direct access
439  //
440 
441  // Current state of parsing
442  bool inMain; // if inside a function, true if the function is main
448 
449 protected:
452 
453  static const int maxSamplerIndex = EsdNumDims * (EbtNumTypes * (2 * 2 * 2 * 2 * 2)); // see computeSamplerTypeIndex()
460  int* atomicUintOffsets; // to become an array of the right size to hold an offset per binding point
461  TString currentCaller; // name of last function body entered (not valid when at global scope)
465 
466  //
467  // Geometry shader input arrays:
468  // - array sizing is based on input primitive and/or explicit size
469  //
470  // Tessellation control output arrays:
471  // - array sizing is based on output layout(vertices=...) and/or explicit size
472  //
473  // Both:
474  // - array sizing is retroactive
475  // - built-in block redeclarations interact with this
476  //
477  // Design:
478  // - use a per-context "resize-list", a list of symbols whose array sizes
479  // can be fixed
480  //
481  // - the resize-list starts empty at beginning of user-shader compilation, it does
482  // not have built-ins in it
483  //
484  // - on built-in array use: copyUp() symbol and add it to the resize-list
485  //
486  // - on user array declaration: add it to the resize-list
487  //
488  // - on block redeclaration: copyUp() symbol and add it to the resize-list
489  // * note, that appropriately gives an error if redeclaring a block that
490  // was already used and hence already copied-up
491  //
492  // - on seeing a layout declaration that sizes the array, fix everything in the
493  // resize-list, giving errors for mismatch
494  //
495  // - on seeing an array size declaration, give errors on mismatch between it and previous
496  // array-sizing declarations
497  //
499 };
500 
501 } // end namespace glslang
502 
503 #endif // _PARSER_HELPER_INCLUDED_
GLenum GLenum variable
Definition: glext.h:9938
Definition: localintermediate.h:62
Definition: Types.h:1103
std::set< int > TIdSetType
Definition: ParseHelper.h:67
TIntermTyped * addOutputArgumentConversions(const TFunction &, TIntermAggregate &) const
Definition: ParseHelper.cpp:1317
TIntermTyped * handleLengthMethod(const TSourceLoc &, TFunction *, TIntermNode *)
Definition: ParseHelper.cpp:1226
void fixBlockUniformOffsets(TQualifier &, TTypeList &)
Definition: ParseHelper.cpp:6361
Definition: parseVersions.h:55
bool parseShaderStrings(TPpContext &, TInputScanner &input, bool versionWillBeError=false) override
Definition: ParseHelper.cpp:187
Definition: PpContext.h:189
TIntermTyped * convertInitializerList(const TSourceLoc &, const TType &, TIntermTyped *initializer)
Definition: ParseHelper.cpp:5641
bool forwardCompatible
Definition: parseVersions.h:131
void invariantCheck(const TSourceLoc &, const TQualifier &)
Definition: ParseHelper.cpp:6472
GLuint const GLchar * name
Definition: glext.h:6671
void structTypeCheck(const TSourceLoc &, TPublicType &)
Definition: ParseHelper.cpp:3795
TLimits & limits
Definition: ParseHelper.h:447
void inductiveLoopCheck(const TSourceLoc &, TIntermNode *init, TIntermLoop *loop)
Definition: ParseHelper.cpp:3836
TOperator
Definition: intermediate.h:66
bool structQualifierErrorCheck(const TSourceLoc &, const TPublicType &pType)
TAttributeType
Definition: attribute.h:45
void inductiveLoopBodyCheck(TIntermNode *, int loopIndexId, TSymbolTable &)
Definition: limits.cpp:132
TVariable * globalUniformBlock
Definition: ParseHelper.h:215
void nestedStructCheck(const TSourceLoc &)
Definition: ParseHelper.cpp:3767
Definition: arrays.h:57
TIntermTyped * handleUnaryMath(const TSourceLoc &, const char *str, TOperator op, TIntermTyped *childNode)
Definition: ParseHelper.cpp:629
int version
Definition: parseVersions.h:127
int getIoArrayImplicitSize() const
Definition: ParseHelper.cpp:572
set set set set set set set macro pixldst1 op
Definition: pixman-arm-neon-asm.h:54
void nestedBlockCheck(const TSourceLoc &)
Definition: ParseHelper.cpp:3760
void addInputArgumentConversions(const TFunction &, TIntermNode *&) const
Definition: ParseHelper.cpp:1280
void nonOpBuiltInCheck(const TSourceLoc &, const TFunction &, TIntermAggregate &)
Definition: ParseHelper.cpp:1725
Definition: InfoSink.h:138
Definition: Versions.h:83
TIntermNode * executeInitializer(const TSourceLoc &, TIntermTyped *initializer, TVariable *variable)
Definition: ParseHelper.cpp:5503
void layoutObjectCheck(const TSourceLoc &, const TSymbol &)
Definition: ParseHelper.cpp:4576
EShLanguage
Definition: ShaderLang.h:90
void opaqueCheck(const TSourceLoc &, const TType &, const char *op)
Definition: ParseHelper.cpp:3783
void blockQualifierCheck(const TSourceLoc &, const TQualifier &, bool instanceName)
Definition: ParseHelper.cpp:6249
void limitCheck(const TSourceLoc &, int value, const char *limit, const char *feature)
Definition: ParseHelper.cpp:3948
std::function< void(int, int, bool, int, const char *)> lineCallback
Definition: ParseHelper.h:199
virtual bool lineDirectiveShouldSetNextLine() const =0
void handleSelectionAttributes(const TAttributes &attributes, TIntermNode *)
Definition: attribute.cpp:149
void checkLocation(const TSourceLoc &, TOperator)
Definition: ParseHelper.cpp:1203
void handleIoResizeArrayAccess(const TSourceLoc &, TIntermTyped *base)
Definition: ParseHelper.cpp:526
Definition: Common.h:231
void setScanContext(TScanContext *c)
Definition: ParseHelper.h:112
Definition: SymbolTable.h:151
void constantValueCheck(TIntermTyped *node, const char *token)
Definition: ParseHelper.cpp:2107
void paramCheckFixStorage(const TSourceLoc &, const TStorageQualifier &, TType &type)
Definition: ParseHelper.cpp:3708
virtual void trackLinkage(TSymbol &symbol)
Definition: ParseContextBase.cpp:232
Definition: Common.h:186
TIntermNode * handleReturnValue(const TSourceLoc &, TIntermTyped *)
Definition: ParseHelper.cpp:1180
virtual void rValueErrorCheck(const TSourceLoc &, const char *op, TIntermTyped *)
Definition: ParseContextBase.cpp:200
TSymbolTable & symbolTable
Definition: ParseHelper.h:170
bool explicitFloatDefault
Definition: ParseHelper.h:263
void setPpContext(TPpContext *c)
Definition: ParseHelper.h:114
TIntermTyped * addConstructor(const TSourceLoc &, TIntermNode *, const TType &)
Definition: ParseHelper.cpp:5732
TPrecisionQualifier getDefaultPrecision(TPublicType &)
Definition: ParseHelper.cpp:2980
virtual void setExtensionCallback(const std::function< void(int, const char *, const char *)> &func)
Definition: ParseHelper.h:118
Definition: ParseHelper.h:75
std::function< void(int, const TVector< TString > &)> pragmaCallback
Definition: ParseHelper.h:200
GLsizeiptr size
Definition: glext.h:6559
bool functionReturnsValue
Definition: ParseHelper.h:176
GLint limit
Definition: glext.h:11233
void reservedErrorCheck(const TSourceLoc &, const TString &)
Definition: ParseHelper.cpp:2138
bool lValueErrorCheck(const TSourceLoc &, const char *op, TIntermTyped *) override
Definition: ParseHelper.cpp:1980
Definition: localintermediate.h:210
TString * NewPoolTString(const char *s)
Definition: Common.h:156
virtual const char * getGlobalUniformBlockName() const
Definition: ParseHelper.h:220
virtual TVariable * getEditableVariable(const char *name)
Definition: ParseContextBase.cpp:282
Definition: ResourceLimits.h:52
int loopNestingLevel
Definition: ParseHelper.h:172
EShLanguage language
Definition: parseVersions.h:129
bool obeyPrecisionQualifiers() const
Definition: ParseHelper.h:278
Definition: SymbolTable.h:539
unsigned int globalUniformSet
Definition: ParseHelper.h:217
GLdouble s
Definition: glext.h:6390
void declareTypeDefaults(const TSourceLoc &, const TPublicType &)
Definition: ParseHelper.cpp:5344
TBuiltInResource resources
Definition: ParseHelper.h:446
TScanContext * scanContext
Definition: ParseHelper.h:191
TAttributes * mergeAttributes(TAttributes *, TAttributes *) const
Definition: attribute.cpp:140
void samplerConstructorLocationCheck(const TSourceLoc &, const char *token, TIntermNode *)
Definition: ParseHelper.cpp:1855
void userFunctionCallCheck(const TSourceLoc &, TIntermAggregate &)
Definition: ParseHelper.cpp:1844
Definition: SymbolTable.h:216
virtual void notifyLineDirective(int curLineNo, int newLineNo, bool hasSource, int sourceNum, const char *sourceName)
Definition: ParseHelper.h:140
void arraySizeRequiredCheck(const TSourceLoc &, const TArraySizes &)
Definition: ParseHelper.cpp:3123
TAttributeType attributeFromName(const TString &name) const
Definition: attribute.cpp:96
const TFunction * findFunctionExact(const TSourceLoc &loc, const TFunction &call, bool &builtIn)
Definition: ParseHelper.cpp:5086
void renameShaderFunction(TString *&name) const
Definition: ParseHelper.h:155
typedef void(__stdcall *PFN_DESTRUCTION_CALLBACK)(void *pData)
void unaryOpError(const TSourceLoc &, const char *op, TString operand)
Definition: ParseHelper.cpp:1918
void samplerCheck(const TSourceLoc &, const TType &, const TString &identifier, TIntermTyped *initializer)
Definition: ParseHelper.cpp:2574
void arrayObjectCheck(const TSourceLoc &, const TType &, const char *op)
Definition: ParseHelper.cpp:3774
void parameterTypeCheck(const TSourceLoc &, TStorageQualifier qualifier, const TType &type)
Definition: ParseHelper.cpp:3011
void defaultWarningGiven()
Definition: ParseHelper.h:244
const char * entryPoint
Definition: Hlsl.FromFile.cpp:45
bool inMain
Definition: ParseHelper.h:442
Definition: intermediate.h:1234
void handleSwitchAttributes(const TAttributes &attributes, TIntermNode *)
Definition: attribute.cpp:178
void paramCheckFix(const TSourceLoc &, const TQualifier &, TType &type)
Definition: ParseHelper.cpp:3731
virtual void C_DECL warn(const TSourceLoc &, const char *szReason, const char *szToken, const char *szExtraInfoFormat,...)
Definition: ParseContextBase.cpp:84
bool containsFieldWithBasicType(const TType &type, TBasicType basicType)
Definition: ParseHelper.cpp:3017
void specializationCheck(const TSourceLoc &, const TType &, const char *op)
Definition: ParseHelper.cpp:3789
GLenum GLenum GLenum input
Definition: glext.h:9938
GLdouble GLdouble right
Definition: glext.h:11766
Definition: Types.h:1003
void transparentOpaqueCheck(const TSourceLoc &, const TType &, const TString &identifier)
Definition: ParseHelper.cpp:2610
bool postEntryPointReturn
Definition: ParseHelper.h:178
virtual ~TParseContext()
Definition: ParseHelper.cpp:98
Definition: ParseHelper.h:271
const GLubyte * c
Definition: glext.h:9812
const std::string & getEntryPointName() const
Definition: localintermediate.h:264
Definition: Types.h:74
Definition: intermediate.h:1076
unsigned int globalUniformBinding
Definition: ParseHelper.h:216
void arraySizesCheck(const TSourceLoc &, const TQualifier &, TArraySizes *, const TIntermTyped *initializer, bool lastMember)
Definition: ParseHelper.cpp:3139
Definition: ParseHelper.h:59
void wrapupSwitchSubsequence(TIntermAggregate *statements, TIntermNode *branchNode)
Definition: ParseHelper.cpp:6681
TScanContext * getScanContext() const
Definition: ParseHelper.h:113
virtual void reservedPpErrorCheck(const TSourceLoc &, const char *name, const char *op)=0
Definition: intermediate.h:988
bool constructorTextureSamplerError(const TSourceLoc &, const TFunction &)
Definition: ParseHelper.cpp:2488
static GX2AttribVar attributes[]
Definition: bokeh.c:713
virtual void handlePragma(const TSourceLoc &, const TVector< TString > &)=0
bool lineDirectiveShouldSetNextLine() const override
Definition: ParseHelper.cpp:3343
virtual void notifyVersion(int line, int version, const char *type_string)
Definition: ParseHelper.h:130
virtual void setUniformBlockDefaults(TType &) const
Definition: ParseHelper.h:221
bool arrayQualifierError(const TSourceLoc &, const TQualifier &)
Definition: ParseHelper.cpp:3077
void fixOffset(const TSourceLoc &, TSymbol &)
Definition: ParseHelper.cpp:5016
TIntermTyped * constructBuiltIn(const TType &, TOperator, TIntermTyped *, const TSourceLoc &, bool subset)
Definition: ParseHelper.cpp:5820
void respectPrecisionQualifiers()
Definition: ParseHelper.h:241
void handleIndexLimits(const TSourceLoc &, TIntermTyped *base, TIntermTyped *index)
Definition: ParseHelper.cpp:451
TIntermTyped * handleBracketDereference(const TSourceLoc &, TIntermTyped *base, TIntermTyped *index)
Definition: ParseHelper.cpp:355
GLenum type
Definition: glext.h:6233
virtual void finalizeGlobalUniformBlockLayout(TVariable &)
Definition: ParseHelper.h:222
bool voidErrorCheck(const TSourceLoc &, const TString &, TBasicType)
Definition: ParseHelper.cpp:2550
void checkIoArrayConsistency(const TSourceLoc &, int requiredSize, const char *feature, TType &, const TString &)
Definition: ParseHelper.cpp:582
Definition: Types.h:1169
bool isRuntimeLength(const TIntermTyped &) const
Definition: ParseHelper.cpp:3317
EProfile
Definition: Versions.h:51
virtual void setErrorCallback(const std::function< void(int, const char *)> &func)
Definition: ParseHelper.h:121
void handlePragma(const TSourceLoc &, const TVector< TString > &) override
Definition: ParseHelper.cpp:210
int firstNewMember
Definition: ParseHelper.h:218
void addQualifierToExisting(const TSourceLoc &, TQualifier, const TString &identifier)
Definition: ParseHelper.cpp:6421
Definition: Types.h:418
TPrefixType
Definition: InfoSink.h:47
void handleLoopAttributes(const TAttributes &attributes, TIntermNode *)
Definition: attribute.cpp:207
void redeclareBuiltinBlock(const TSourceLoc &, TTypeList &typeList, const TString &blockName, const TString *instanceName, TArraySizes *arraySizes)
Definition: ParseHelper.cpp:3517
void setDefaultPrecision(const TSourceLoc &, TPublicType &, TPrecisionQualifier)
Definition: ParseHelper.cpp:2930
Definition: ParseHelper.h:236
virtual bool lineContinuationCheck(const TSourceLoc &, bool endOfComment)=0
void globalQualifierTypeCheck(const TSourceLoc &, const TQualifier &, const TPublicType &)
Definition: ParseHelper.cpp:2682
bool obey
Definition: ParseHelper.h:260
GLenum func
Definition: glext.h:6668
const TFunction * findFunction120(const TSourceLoc &loc, const TFunction &call, bool &builtIn)
Definition: ParseHelper.cpp:5099
void checkIoArraysConsistency(const TSourceLoc &, bool tailOnly=false)
Definition: ParseHelper.cpp:549
virtual void growGlobalUniformBlock(const TSourceLoc &, TType &, const TString &memberName, TTypeList *typeList=nullptr)
Definition: ParseContextBase.cpp:560
TParseContextBase & operator=(TParseContextBase &)
Definition: Types.h:71
virtual void C_DECL ppWarn(const TSourceLoc &, const char *szReason, const char *szToken, const char *szExtraInfoFormat,...)
Definition: ParseContextBase.cpp:107
EProfile profile
Definition: parseVersions.h:128
void finish() override
Definition: ParseHelper.cpp:3961
virtual ~TPrecisionManager()
Definition: ParseHelper.h:239
const TString * blockName
Definition: ParseHelper.h:443
void reservedPpErrorCheck(const TSourceLoc &, const char *name, const char *op) override
Definition: ParseHelper.cpp:2163
void nonInitConstCheck(const TSourceLoc &, TString &identifier, TType &type)
Definition: ParseHelper.cpp:3351
std::function< void(int, const char *)> errorCallback
Definition: ParseHelper.h:203
void binaryOpError(const TSourceLoc &, const char *op, TString left, TString right)
Definition: ParseHelper.cpp:1928
virtual void C_DECL error(const TSourceLoc &, const char *szReason, const char *szToken, const char *szExtraInfoFormat,...)
Definition: ParseContextBase.cpp:70
bool explicitIntDefault
Definition: ParseHelper.h:262
virtual void setLineCallback(const std::function< void(int, int, bool, int, const char *)> &func)
Definition: ParseHelper.h:117
void arrayOfArrayVersionCheck(const TSourceLoc &, const TArraySizes *)
Definition: ParseHelper.cpp:3205
void mergeObjectLayoutQualifiers(TQualifier &dest, const TQualifier &src, bool inheritOnly)
Definition: ParseHelper.cpp:4517
TList< TIntermSequence * > switchSequenceStack
Definition: ParseHelper.h:180
void constantIndexExpressionCheck(TIntermNode *)
Definition: limits.cpp:188
TParseContext(TSymbolTable &, TIntermediate &, bool parsingBuiltins, int version, EProfile, const SpvVersion &spvVersion, EShLanguage, TInfoSink &, bool forwardCompatible=false, EShMessages messages=EShMsgDefault, const TString *entryPoint=nullptr)
Definition: ParseHelper.cpp:51
TIntermTyped * handleBuiltInFunctionCall(TSourceLoc, TIntermNode *arguments, const TFunction &function)
Definition: ParseHelper.cpp:1059
void memberQualifierCheck(glslang::TPublicType &)
Definition: ParseHelper.cpp:2631
GLenum src
Definition: glext.h:6980
int * atomicUintOffsets
Definition: ParseHelper.h:460
TIntermTyped * constructAggregate(TIntermNode *, const TType &, int, const TSourceLoc &)
Definition: ParseHelper.cpp:5987
void assignError(const TSourceLoc &, const char *op, TString left, TString right)
Definition: ParseHelper.cpp:1909
TVector< TSymbol * > linkageSymbols
Definition: ParseHelper.h:190
void checkNoShaderLayouts(const TSourceLoc &, const TShaderQualifiers &)
Definition: ParseHelper.cpp:4977
dictionary args
Definition: test_shaders.py:20
TPragmaTable pragmaTable
Definition: ParseHelper.h:63
void explicitIntDefaultSeen()
Definition: ParseHelper.h:246
const TFunction * findFunction400(const TSourceLoc &loc, const TFunction &call, bool &builtIn)
Definition: ParseHelper.cpp:5207
const TFunction * findFunction(const TSourceLoc &loc, const TFunction &call, bool &builtIn)
Definition: ParseHelper.cpp:5055
TInfoSink & infoSink
Definition: parseVersions.h:124
void globalCheck(const TSourceLoc &, const char *token)
Definition: ParseHelper.cpp:2129
virtual void notifyExtensionDirective(int line, const char *extension, const char *behavior)
Definition: ParseHelper.h:145
void fixBlockLocations(const TSourceLoc &, TQualifier &, TTypeList &, bool memberWithLocation, bool memberWithoutLocation)
Definition: ParseHelper.cpp:6287
int statementNestingLevel
Definition: ParseHelper.h:171
void integerCheck(const TIntermTyped *node, const char *token)
Definition: ParseHelper.cpp:2117
void globalQualifierFixCheck(const TSourceLoc &, TQualifier &)
Definition: ParseHelper.cpp:2644
Definition: intermediate.h:1482
Definition: arrays.h:222
bool builtInName(const TString &)
Definition: ParseHelper.cpp:2224
Definition: ScanContext.h:54
void arrayLimitCheck(const TSourceLoc &, const TString &, int size)
Definition: ParseHelper.cpp:3936
Definition: arrays.h:46
virtual void setLimits(const TBuiltInResource &)=0
void precisionQualifierCheck(const TSourceLoc &, TBasicType, TQualifier &)
Definition: ParseHelper.cpp:2988
void warnAboutDefaults()
Definition: ParseHelper.h:245
TStorageQualifier
Definition: BaseTypes.h:81
TQualifier globalOutputDefaults
Definition: ParseHelper.h:459
TQualifier currentBlockQualifier
Definition: ParseHelper.h:444
TString sourceEntryPointName
Definition: ParseHelper.h:195
std::function< void(int, int, const char *)> versionCallback
Definition: ParseHelper.h:201
GLuint index
Definition: glext.h:6671
TIntermTyped * handleDotDereference(const TSourceLoc &, TIntermTyped *base, const TString &field)
Definition: ParseHelper.cpp:646
void layoutMemberLocationArrayCheck(const TSourceLoc &, bool memberWithLocation, TArraySizes *arraySizes)
Definition: ParseHelper.cpp:4651
void setLayoutQualifier(const TSourceLoc &, TPublicType &, TString &)
Definition: ParseHelper.cpp:4026
void updateStandaloneQualifierDefaults(const TSourceLoc &, const TPublicType &)
Definition: ParseHelper.cpp:6492
void boolCheck(const TSourceLoc &, const TIntermTyped *)
Definition: ParseHelper.cpp:2561
void setLimits(const TBuiltInResource &) override
Definition: ParseHelper.cpp:159
TFunction * handleFunctionDeclarator(const TSourceLoc &, TFunction &function, bool prototype)
Definition: ParseHelper.cpp:772
TList< int > switchLevel
Definition: ParseHelper.h:182
void arraySizeCheck(const TSourceLoc &, TIntermTyped *expr, TArraySize &)
Definition: ParseHelper.cpp:3036
bool shouldWarnAboutDefaults() const
Definition: ParseHelper.h:243
virtual void makeEditable(TSymbol *&)
Definition: ParseContextBase.cpp:267
const TFunction * selectFunction(const TVector< const TFunction *>, const TFunction &, std::function< bool(const TType &, const TType &, TOperator, int arg)>, std::function< bool(const TType &, const TType &, const TType &)>, bool &tie)
TVariable * makeInternalVariable(const char *name, const TType &) const
Definition: ParseHelper.cpp:5464
TIdSetType inductiveLoopIds
Definition: ParseHelper.h:462
void layoutQualifierCheck(const TSourceLoc &, const TQualifier &)
Definition: ParseHelper.cpp:4878
TPrecisionManager precisionManager
Definition: ParseHelper.h:455
void declareArray(const TSourceLoc &, const TString &identifier, const TType &, TSymbol *&)
Definition: ParseHelper.cpp:3221
TIntermAggregate * handleFunctionDefinition(const TSourceLoc &, TFunction &)
Definition: ParseHelper.cpp:840
TQualifier globalUniformDefaults
Definition: ParseHelper.h:457
void makeEditable(TSymbol *&) override
Definition: ParseHelper.cpp:471
Definition: SymbolTable.h:81
void parserError(const char *s)
Definition: ParseHelper.cpp:202
bool debug
Definition: ParseHelper.h:62
void blockStageIoCheck(const TSourceLoc &, const TQualifier &)
Definition: ParseHelper.cpp:6213
#define C_DECL
Definition: ShaderLang.h:58
void declareBlock(const TSourceLoc &, TTypeList &typeList, const TString *instanceName=0, TArraySizes *arraySizes=0)
Definition: ParseHelper.cpp:6003
TIntermTyped * handleBinaryMath(const TSourceLoc &, const char *str, TOperator op, TIntermTyped *left, TIntermTyped *right)
Definition: ParseHelper.cpp:598
virtual bool parseShaderStrings(TPpContext &, TInputScanner &input, bool versionWillBeError=false)=0
bool anyIndexLimits
Definition: ParseHelper.h:463
int computeSamplerTypeIndex(TSampler &)
Definition: ParseHelper.cpp:2965
TIntermNode * addSwitch(const TSourceLoc &, TIntermTyped *expression, TIntermAggregate *body)
Definition: ParseHelper.cpp:6717
TVector< TIntermTyped * > needsIndexLimitationChecking
Definition: ParseHelper.h:464
void checkPrecisionQualifier(const TSourceLoc &, TPrecisionQualifier)
Definition: ParseHelper.cpp:1897
bool isIoResizeArray(const TType &) const
Definition: ParseHelper.cpp:481
const TFunction * findFunctionExplicitTypes(const TSourceLoc &loc, const TFunction &call, bool &builtIn)
Definition: ParseHelper.cpp:5272
TPpContext * getPpContext() const
Definition: ParseHelper.h:115
bool optimize
Definition: ParseHelper.h:61
std::function< void(int, const char *, const char *)> extensionCallback
Definition: ParseHelper.h:202
bool constructorError(const TSourceLoc &, TIntermNode *, TFunction &, TOperator, TType &)
Definition: ParseHelper.cpp:2248
const char *const scopeMangler
Definition: ParseHelper.h:166
TBuiltInResource resources
Definition: ParseHelper.h:193
TPrecisionQualifier
Definition: BaseTypes.h:375
TIntermTyped * handleVariable(const TSourceLoc &, TSymbol *symbol, const TString *string)
Definition: ParseHelper.cpp:279
TBasicType
Definition: BaseTypes.h:46
TIntermTyped * handleFunctionCall(const TSourceLoc &, TFunction *, TIntermNode *)
Definition: ParseHelper.cpp:935
void computeBuiltinPrecisions(TIntermTyped &, const TFunction &)
Definition: ParseHelper.cpp:1115
int structNestingLevel
Definition: ParseHelper.h:173
TString currentCaller
Definition: ParseHelper.h:461
TIntermNode * declareVariable(const TSourceLoc &, TString &identifier, const TPublicType &, TArraySizes *typeArray=0, TIntermTyped *initializer=0)
Definition: ParseHelper.cpp:5370
void explicitFloatDefaultSeen()
Definition: ParseHelper.h:252
virtual void parseSwizzleSelector(const TSourceLoc &, const TString &, int size, TSwizzleSelectors< TVectorSelector > &)
Definition: ParseContextBase.cpp:460
static const int maxSamplerIndex
Definition: ParseHelper.h:453
virtual void setVersionCallback(const std::function< void(int, int, const char *)> &func)
Definition: ParseHelper.h:119
Definition: ResourceLimits.h:40
TPrecisionQualifier defaultPrecision[EbtNumTypes]
Definition: ParseHelper.h:445
GLsizei const GLfloat * value
Definition: glext.h:6709
virtual void outputMessage(const TSourceLoc &, const char *szReason, const char *szToken, const char *szExtraInfoFormat, TPrefixType prefix, va_list args)
Definition: ParseContextBase.cpp:51
TAttributes * makeAttributes(const TString &identifier) const
Definition: attribute.cpp:115
static void expr(LexState *ls, expdesc *v)
Definition: lparser.c:1078
bool warn
Definition: ParseHelper.h:261
void inheritGlobalDefaults(TQualifier &dst) const
Definition: ParseHelper.cpp:5448
GLenum GLenum dst
Definition: glext.h:6980
TSymbol * redeclareBuiltinVariable(const TSourceLoc &, const TString &, const TQualifier &, const TShaderQualifiers &)
Definition: ParseHelper.cpp:3373
TPpContext * ppContext
Definition: ParseHelper.h:192
void rValueErrorCheck(const TSourceLoc &, const char *op, TIntermTyped *) override
Definition: ParseHelper.cpp:2090
static void field(LexState *ls, struct ConsControl *cc)
Definition: lparser.c:702
const TType * currentFunctionType
Definition: ParseHelper.h:175
TPrecisionQualifier defaultSamplerPrecision[maxSamplerIndex]
Definition: ParseHelper.h:454
#define false
Definition: ordinals.h:83
void variableCheck(TIntermTyped *&nodePtr)
Definition: ParseHelper.cpp:1941
EShMessages
Definition: ShaderLang.h:204
virtual ~TParseContextBase()
Definition: ParseHelper.h:96
virtual void notifyErrorDirective(int line, const char *error_message)
Definition: ParseHelper.h:135
TLimits & limits
Definition: ParseHelper.h:194
virtual bool lValueErrorCheck(const TSourceLoc &, const char *op, TIntermTyped *)
Definition: ParseContextBase.cpp:122
EShLanguage getLanguage() const
Definition: ParseHelper.h:111
TFunction * handleConstructorCall(const TSourceLoc &, const TPublicType &)
Definition: ParseHelper.cpp:1864
void handlePrecisionQualifier(const TSourceLoc &, TQualifier &, TPrecisionQualifier)
Definition: ParseHelper.cpp:1889
void fixIoArraySize(const TSourceLoc &, TType &)
Definition: ParseHelper.cpp:489
void builtInOpCheck(const TSourceLoc &, const TFunction &, TIntermOperator &)
Definition: ParseHelper.cpp:1387
#define true
Definition: ordinals.h:82
bool arrayError(const TSourceLoc &, const TType &)
Definition: ParseHelper.cpp:3098
GLint left
Definition: glext.h:8393
void setPrecisionDefaults()
Definition: ParseHelper.cpp:105
void atomicUintCheck(const TSourceLoc &, const TType &, const TString &identifier)
Definition: ParseHelper.cpp:2599
bool lineContinuationCheck(const TSourceLoc &, bool endOfComment) override
Definition: ParseHelper.cpp:2196
void fixBlockXfbOffsets(TQualifier &, TTypeList &)
Definition: ParseHelper.cpp:6324
void structArrayCheck(const TSourceLoc &, const TType &structure)
Definition: ParseHelper.cpp:3129
Definition: intermediate.h:1042
TPragma(bool o, bool d)
Definition: ParseHelper.h:60
TParseContext & operator=(TParseContext &)
const char * extension
Definition: civetweb.c:4908
struct TPragma contextPragma
Definition: ParseHelper.h:183
TQualifier globalInputDefaults
Definition: ParseHelper.h:458
EShMessages messages
Definition: parseVersions.h:136
const bool parsingBuiltins
Definition: ParseHelper.h:189
Definition: Scan.h:52
TVariable * declareNonArray(const TSourceLoc &, const TString &identifier, const TType &)
Definition: ParseHelper.cpp:5479
void ioArrayCheck(const TSourceLoc &, const TType &, const TString &identifier)
Definition: ParseHelper.cpp:511
static uint8_t body[]
Definition: remotepad.h:4
TParseContextBase(TSymbolTable &symbolTable, TIntermediate &interm, bool parsingBuiltins, int version, EProfile profile, const SpvVersion &spvVersion, EShLanguage language, TInfoSink &infoSink, bool forwardCompatible, EShMessages messages, const TString *entryPoint=nullptr)
Definition: ParseHelper.h:77
Definition: ShaderLang.h:205
any call(F fn, Args &&... args)
Definition: peglib.h:337
int controlFlowNestingLevel
Definition: ParseHelper.h:174
void mergeQualifiers(const TSourceLoc &, TQualifier &dst, const TQualifier &src, bool force)
Definition: ParseHelper.cpp:2845
void checkIndex(const TSourceLoc &, const TType &, int &index)
Definition: ParseContextBase.cpp:240
void blockMemberExtensionCheck(const TSourceLoc &, const TIntermTyped *base, const TString &field)
Definition: ParseHelper.cpp:758
Definition: lobject.h:303
const char *const str
Definition: portlistingparse.c:18
void layoutTypeCheck(const TSourceLoc &, const TType &)
Definition: ParseHelper.cpp:4662
TPrecisionManager()
Definition: ParseHelper.h:238
Definition: BaseTypes.h:68
virtual void setPragmaCallback(const std::function< void(int, const TVector< TString > &)> &func)
Definition: ParseHelper.h:120
bool respectingPrecisionQualifiers() const
Definition: ParseHelper.h:242
virtual void finish()
Definition: ParseContextBase.cpp:601
SpvVersion spvVersion
Definition: parseVersions.h:130
TIntermediate & intermediate
Definition: parseVersions.h:132
TVector< TSymbol * > ioArraySymbolResizeList
Definition: ParseHelper.h:498
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d &reg2 endm macro vzip8 reg2 vzip d d &reg2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld [DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld init[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp local skip1 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
Definition: pixman-arm-neon-asm.h:600
TQualifier globalBufferDefaults
Definition: ParseHelper.h:456
void checkRuntimeSizable(const TSourceLoc &, const TIntermTyped &)
Definition: ParseHelper.cpp:3302
Definition: Common.h:247
virtual void C_DECL ppError(const TSourceLoc &, const char *szReason, const char *szToken, const char *szExtraInfoFormat,...)
Definition: ParseContextBase.cpp:95