LEFT | RIGHT |
1 // | 1 // |
2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. | 2 // Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved. |
3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
5 // | 5 // |
6 | 6 |
7 #include "compiler/Initialize.h" | 7 #include "compiler/Initialize.h" |
8 #include "compiler/ParseHelper.h" | 8 #include "compiler/ParseHelper.h" |
9 #include "compiler/ShHandle.h" | 9 #include "compiler/ShHandle.h" |
10 #include "compiler/ValidateLimitations.h" | 10 #include "compiler/ValidateLimitations.h" |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 (PaParseStrings(numStrings - firstSource, &shaderStrings[firstSource], N
ULL, &parseContext) == 0) && | 142 (PaParseStrings(numStrings - firstSource, &shaderStrings[firstSource], N
ULL, &parseContext) == 0) && |
143 (parseContext.treeRoot != NULL); | 143 (parseContext.treeRoot != NULL); |
144 if (success) { | 144 if (success) { |
145 TIntermNode* root = parseContext.treeRoot; | 145 TIntermNode* root = parseContext.treeRoot; |
146 success = intermediate.postProcess(root); | 146 success = intermediate.postProcess(root); |
147 | 147 |
148 if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING)) | 148 if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING)) |
149 success = validateLimitations(root); | 149 success = validateLimitations(root); |
150 | 150 |
151 // Call mapLongVariableNames() before collectAttribsUniforms() so in | 151 // Call mapLongVariableNames() before collectAttribsUniforms() so in |
152 // collectAttribsUniforms() we already have the mapped symbol names so | 152 // collectAttribsUniforms() we already have the mapped symbol names and |
153 // we could composite variable names with structures and so. | 153 // we could composite mapped and original variable names. |
154 if (compileOptions & SH_MAP_LONG_VARIABLE_NAMES) | 154 if (compileOptions & SH_MAP_LONG_VARIABLE_NAMES) |
155 mapLongVariableNames(root); | 155 mapLongVariableNames(root); |
156 | 156 |
157 if (success && (compileOptions & SH_ATTRIBUTES_UNIFORMS)) | 157 if (success && (compileOptions & SH_ATTRIBUTES_UNIFORMS)) |
158 collectAttribsUniforms(root); | 158 collectAttribsUniforms(root); |
159 | 159 |
160 if (success && (compileOptions & SH_INTERMEDIATE_TREE)) | 160 if (success && (compileOptions & SH_INTERMEDIATE_TREE)) |
161 intermediate.outputTree(root); | 161 intermediate.outputTree(root); |
162 | 162 |
163 if (success && (compileOptions & SH_OBJECT_CODE)) | 163 if (success && (compileOptions & SH_OBJECT_CODE)) |
(...skipping 30 matching lines...) Expand all Loading... |
194 } | 194 } |
195 | 195 |
196 bool TCompiler::validateLimitations(TIntermNode* root) { | 196 bool TCompiler::validateLimitations(TIntermNode* root) { |
197 ValidateLimitations validate(shaderType, infoSink.info); | 197 ValidateLimitations validate(shaderType, infoSink.info); |
198 root->traverse(&validate); | 198 root->traverse(&validate); |
199 return validate.numErrors() == 0; | 199 return validate.numErrors() == 0; |
200 } | 200 } |
201 | 201 |
202 void TCompiler::collectAttribsUniforms(TIntermNode* root) | 202 void TCompiler::collectAttribsUniforms(TIntermNode* root) |
203 { | 203 { |
204 CollectAttribsUniforms collect(symbolTable, attribs, uniforms); | 204 CollectAttribsUniforms collect(attribs, uniforms); |
205 root->traverse(&collect); | 205 root->traverse(&collect); |
206 } | 206 } |
207 | 207 |
208 void TCompiler::mapLongVariableNames(TIntermNode* root) | 208 void TCompiler::mapLongVariableNames(TIntermNode* root) |
209 { | 209 { |
210 MapLongVariableNames map(symbolTable); | 210 MapLongVariableNames map; |
211 root->traverse(&map); | 211 root->traverse(&map); |
212 } | 212 } |
213 | 213 |
214 int TCompiler::getMappedNameMaxLength() const | 214 int TCompiler::getMappedNameMaxLength() const |
215 { | 215 { |
216 return MAX_SYMBOL_NAME_SIZE + 1; | 216 return MAX_IDENTIFIER_NAME_SIZE + 1; |
217 } | 217 } |
LEFT | RIGHT |