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_MAP_LONG_VARIABLE_NAMES_H_
8 #define COMPILER_MAP_LONG_VARIABLE_NAMES_H_
10 #include "GLSLANG/ShaderLang.h"
12 #include "compiler/intermediate.h"
13 #include "compiler/VariableInfo.h"
15 // This size does not include '\0' in the end.
16 #define MAX_IDENTIFIER_NAME_SIZE 32
18 // Traverses intermediate tree to map attributes and uniforms names that are
19 // longer than MAX_IDENTIFIER_NAME_SIZE to MAX_IDENTIFIER_NAME_SIZE.
20 class MapLongVariableNames : public TIntermTraverser {
22 MapLongVariableNames(TMap<TString, TString>& varyingLongNameMap);
24 virtual void visitSymbol(TIntermSymbol*);
25 virtual void visitConstantUnion(TIntermConstantUnion*);
26 virtual bool visitBinary(Visit, TIntermBinary*);
27 virtual bool visitUnary(Visit, TIntermUnary*);
28 virtual bool visitSelection(Visit, TIntermSelection*);
29 virtual bool visitAggregate(Visit, TIntermAggregate*);
30 virtual bool visitLoop(Visit, TIntermLoop*);
31 virtual bool visitBranch(Visit, TIntermBranch*);
34 TString mapVaryingLongName(const TString& name);
36 TMap<TString, TString>& mVaryingLongNameMap;
39 #endif // COMPILER_MAP_LONG_VARIABLE_NAMES_H_