1 : //
2 : // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
3 : // Use of this source code is governed by a BSD-style license that can be
4 : // found in the LICENSE file.
5 : //
6 :
7 : #ifndef COMPILER_VARIABLE_INFO_H_
8 : #define COMPILER_VARIABLE_INFO_H_
9 :
10 : #include "GLSLANG/ShaderLang.h"
11 : #include "compiler/intermediate.h"
12 :
13 : // Provides information about a variable.
14 : // It is currently being used to store info about active attribs and uniforms.
15 0 : struct TVariableInfo {
16 : TPersistString name;
17 : TPersistString mappedName;
18 : ShDataType type;
19 : int size;
20 : };
21 : typedef std::vector<TVariableInfo> TVariableInfoList;
22 :
23 : // Traverses intermediate tree to collect all attributes and uniforms.
24 : class CollectAttribsUniforms : public TIntermTraverser {
25 : public:
26 : CollectAttribsUniforms(TVariableInfoList& attribs,
27 : TVariableInfoList& uniforms);
28 :
29 : virtual void visitSymbol(TIntermSymbol*);
30 : virtual void visitConstantUnion(TIntermConstantUnion*);
31 : virtual bool visitBinary(Visit, TIntermBinary*);
32 : virtual bool visitUnary(Visit, TIntermUnary*);
33 : virtual bool visitSelection(Visit, TIntermSelection*);
34 : virtual bool visitAggregate(Visit, TIntermAggregate*);
35 : virtual bool visitLoop(Visit, TIntermLoop*);
36 : virtual bool visitBranch(Visit, TIntermBranch*);
37 :
38 : private:
39 : TVariableInfoList& mAttribs;
40 : TVariableInfoList& mUniforms;
41 : };
42 :
43 : #endif // COMPILER_VARIABLE_INFO_H_
|