Added API to enforce GLSL limitations mandated by WebGL.
BUG=48
Review URL: http://codereview.appspot.com/3005042
git-svn-id: https://angleproject.googlecode.com/svn/trunk@476 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/compiler/Compiler.cpp b/src/compiler/Compiler.cpp
index dc5a8a1..322595b 100644
--- a/src/compiler/Compiler.cpp
+++ b/src/compiler/Compiler.cpp
@@ -78,6 +78,11 @@
if (numStrings == 0)
return true;
+ // If compiling for WebGL, validate control-flow and indexing as well.
+ if (shaderSpec == SH_WEBGL_SPEC) {
+ compileOptions |= SH_VALIDATE_CONTROL_FLOW | SH_VALIDATE_INDEXING;
+ }
+
TIntermediate intermediate(infoSink);
TParseContext parseContext(symbolTable, extensionBehavior, intermediate,
shaderType, shaderSpec, infoSink);