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.
7
#ifndef COMPILER_VARIABLE_INFO_H_
8
#define COMPILER_VARIABLE_INFO_H_
10
#include "GLSLANG/ShaderLang.h"
11
#include "compiler/intermediate.h"
13
// Provides information about a variable.
14
// It is currently being used to store info about active attribs and uniforms.
15
struct TVariableInfo {
16
TVariableInfo(ShDataType type, int size);
20
TPersistString mappedName;
24
typedef std::vector<TVariableInfo> TVariableInfoList;
26
// Traverses intermediate tree to collect all attributes and uniforms.
27
class CollectAttribsUniforms : public TIntermTraverser {
29
CollectAttribsUniforms(TVariableInfoList& attribs,
30
TVariableInfoList& uniforms);
32
virtual void visitSymbol(TIntermSymbol*);
33
virtual void visitConstantUnion(TIntermConstantUnion*);
34
virtual bool visitBinary(Visit, TIntermBinary*);
35
virtual bool visitUnary(Visit, TIntermUnary*);
36
virtual bool visitSelection(Visit, TIntermSelection*);
37
virtual bool visitAggregate(Visit, TIntermAggregate*);
38
virtual bool visitLoop(Visit, TIntermLoop*);
39
virtual bool visitBranch(Visit, TIntermBranch*);
42
TVariableInfoList& mAttribs;
43
TVariableInfoList& mUniforms;
46
#endif // COMPILER_VARIABLE_INFO_H_