Backed out changeset fe104053f4f2 (bug 861039) for compilation failures
authorEd Morley <emorley@mozilla.com>
Mon, 13 May 2013 12:44:41 +0100
changeset 131768 5a3487239596c1b0fe54cf46ff466cc2d9d45e35
parent 131767 fb0fbf5c76f816ba08b5b77870b2001123ae0ed6
child 131769 d256188763e7710c303c78fbc7a41fee92c15864
push id24671
push userryanvm@gmail.com
push dateMon, 13 May 2013 20:32:09 +0000
treeherdermozilla-central@81dd97739fa1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs861039
milestone23.0a1
backs outfe104053f4f21800b393ffde868d77ed8a2a3a3f
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset fe104053f4f2 (bug 861039) for compilation failures
content/canvas/src/WebGLContextGL.cpp
gfx/angle/.gitignore
gfx/angle/AUTHORS
gfx/angle/CONTRIBUTORS
gfx/angle/DEPS
gfx/angle/LICENSE
gfx/angle/Makefile.in
gfx/angle/README.mozilla
gfx/angle/angle-build-d3dcompiler-list.patch
gfx/angle/angle-build-dedupe-debug-cpp-h.patch
gfx/angle/angle-build-dedupe-preproc-files.patch
gfx/angle/angle-build-khrplatform-h-path.patch
gfx/angle/angle-cross-compilation.patch
gfx/angle/angle-default-clamp-strat.patch
gfx/angle/angle-long-ident-spooky-hash.patch
gfx/angle/angle-r1638.patch
gfx/angle/build/common.gypi
gfx/angle/extensions/ANGLE_depth_texture.txt
gfx/angle/extensions/ANGLE_framebuffer_blit.txt
gfx/angle/extensions/ANGLE_instanced_arrays.txt
gfx/angle/extensions/ANGLE_multiple_render_targets.txt
gfx/angle/extensions/ANGLE_pack_reverse_row_order.txt
gfx/angle/extensions/ANGLE_texture_compression_dxt.txt
gfx/angle/extensions/ANGLE_texture_usage.txt
gfx/angle/extensions/ANGLE_translated_shader_source.txt
gfx/angle/extensions/EXT_draw_buffers.txt
gfx/angle/include/GLSLANG/ShaderLang.h
gfx/angle/src/build_angle.gypi
gfx/angle/src/common/debug.cpp
gfx/angle/src/common/system.h
gfx/angle/src/common/version.h
gfx/angle/src/compiler/ArrayBoundsClamper.cpp
gfx/angle/src/compiler/ArrayBoundsClamper.h
gfx/angle/src/compiler/BaseTypes.h
gfx/angle/src/compiler/Compiler.cpp
gfx/angle/src/compiler/ConstantUnion.h
gfx/angle/src/compiler/DetectDiscontinuity.cpp
gfx/angle/src/compiler/DetectDiscontinuity.h
gfx/angle/src/compiler/Diagnostics.h
gfx/angle/src/compiler/DirectiveHandler.h
gfx/angle/src/compiler/ExtensionBehavior.h
gfx/angle/src/compiler/ForLoopUnroll.cpp
gfx/angle/src/compiler/Initialize.cpp
gfx/angle/src/compiler/Intermediate.cpp
gfx/angle/src/compiler/MapLongVariableNames.cpp
gfx/angle/src/compiler/MapLongVariableNames.h
gfx/angle/src/compiler/OutputESSL.cpp
gfx/angle/src/compiler/OutputESSL.h
gfx/angle/src/compiler/OutputGLSL.cpp
gfx/angle/src/compiler/OutputGLSL.h
gfx/angle/src/compiler/OutputGLSLBase.cpp
gfx/angle/src/compiler/OutputGLSLBase.h
gfx/angle/src/compiler/OutputHLSL.cpp
gfx/angle/src/compiler/ParseHelper.cpp
gfx/angle/src/compiler/ParseHelper.h
gfx/angle/src/compiler/ShHandle.h
gfx/angle/src/compiler/ShaderLang.cpp
gfx/angle/src/compiler/SymbolTable.h
gfx/angle/src/compiler/TranslatorESSL.cpp
gfx/angle/src/compiler/TranslatorGLSL.cpp
gfx/angle/src/compiler/UnfoldShortCircuit.cpp
gfx/angle/src/compiler/ValidateLimitations.cpp
gfx/angle/src/compiler/VariablePacker.cpp
gfx/angle/src/compiler/glslang.h
gfx/angle/src/compiler/glslang.l
gfx/angle/src/compiler/glslang.y
gfx/angle/src/compiler/glslang_lex.cpp
gfx/angle/src/compiler/glslang_tab.cpp
gfx/angle/src/compiler/intermediate.h
gfx/angle/src/compiler/osinclude.h
gfx/angle/src/compiler/ossource_nspr.cpp
gfx/angle/src/compiler/parseConst.cpp
gfx/angle/src/compiler/preprocessor/Diagnostics.h
gfx/angle/src/compiler/preprocessor/DiagnosticsBase.cpp
gfx/angle/src/compiler/preprocessor/DiagnosticsBase.h
gfx/angle/src/compiler/preprocessor/DirectiveHandler.h
gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.cpp
gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.h
gfx/angle/src/compiler/preprocessor/DirectiveParser.cpp
gfx/angle/src/compiler/preprocessor/ExpressionParser.cpp
gfx/angle/src/compiler/preprocessor/ExpressionParser.y
gfx/angle/src/compiler/preprocessor/Input.cpp
gfx/angle/src/compiler/preprocessor/Input.h
gfx/angle/src/compiler/preprocessor/MacroExpander.cpp
gfx/angle/src/compiler/preprocessor/Preprocessor.cpp
gfx/angle/src/compiler/preprocessor/Preprocessor.h
gfx/angle/src/compiler/preprocessor/PreprocessorDiagnostics.cpp
gfx/angle/src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp
gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
gfx/angle/src/compiler/preprocessor/Tokenizer.h
gfx/angle/src/compiler/preprocessor/Tokenizer.l
gfx/angle/src/compiler/preprocessor/preprocessor.vcxproj
gfx/angle/src/compiler/translator_common.vcxproj
gfx/angle/src/libEGL/Display.cpp
gfx/angle/src/libEGL/Display.h
gfx/angle/src/libEGL/Makefile.in
gfx/angle/src/libEGL/Surface.cpp
gfx/angle/src/libEGL/Surface.h
gfx/angle/src/libEGL/libEGL.vcxproj
gfx/angle/src/libGLESv2/Context.cpp
gfx/angle/src/libGLESv2/Context.h
gfx/angle/src/libGLESv2/D3DConstantTable.cpp
gfx/angle/src/libGLESv2/Makefile.in
gfx/angle/src/libGLESv2/ProgramBinary.cpp
gfx/angle/src/libGLESv2/Shader.cpp
gfx/angle/src/libGLESv2/mathutil.h
gfx/angle/src/libGLESv2/utilities.cpp
gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
gfx/angle/src/third_party/compiler/ArrayBoundsClamper.h
gfx/angle/src/third_party/compiler/LICENSE
gfx/angle/src/third_party/compiler/README.angle
--- a/content/canvas/src/WebGLContextGL.cpp
+++ b/content/canvas/src/WebGLContextGL.cpp
@@ -4278,17 +4278,16 @@ WebGLContext::CompileShader(WebGLShader 
                                        SH_WEBGL_SPEC,
                                        targetShaderSourceLanguage,
                                        &resources);
 
         int compileOptions = SH_ATTRIBUTES_UNIFORMS |
                              SH_ENFORCE_PACKING_RESTRICTIONS;
 
         // we want to do this everywhere, but:
-//TODO: Enable on windows:
 #ifndef XP_WIN // to do this on Windows, we need ANGLE r1719, 1733, 1734.
 #ifndef XP_MACOSX // to do this on Mac, we need to do it only on Mac OSX > 10.6 as this
                   // causes the shader compiler in 10.6 to crash
         compileOptions |= SH_CLAMP_INDIRECT_ARRAY_BOUNDS;
 #endif
 #endif
 
         if (useShaderSourceTranslation) {
@@ -4305,58 +4304,57 @@ WebGLContext::CompileShader(WebGLShader 
                 if (gl->Vendor() == gl::GLContext::VendorIntel) {
                     compileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS;
                 }
             }
 #endif
         }
 
         if (!ShCompile(compiler, &s, 1, compileOptions)) {
-            size_t len = 0;
+            int len = 0;
             ShGetInfo(compiler, SH_INFO_LOG_LENGTH, &len);
 
             if (len) {
                 nsAutoCString info;
                 info.SetLength(len);
                 ShGetInfoLog(compiler, info.BeginWriting());
                 shader->SetTranslationFailure(info);
             } else {
                 shader->SetTranslationFailure(NS_LITERAL_CSTRING("Internal error: failed to get shader info log"));
             }
             ShDestruct(compiler);
             shader->SetCompileStatus(false);
             return;
         }
 
-        size_t num_attributes = 0;
+        int num_attributes = 0;
         ShGetInfo(compiler, SH_ACTIVE_ATTRIBUTES, &num_attributes);
-        size_t num_uniforms = 0;
+        int num_uniforms = 0;
         ShGetInfo(compiler, SH_ACTIVE_UNIFORMS, &num_uniforms);
-        size_t attrib_max_length = 0;
+        int attrib_max_length = 0;
         ShGetInfo(compiler, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, &attrib_max_length);
-        size_t uniform_max_length = 0;
+        int uniform_max_length = 0;
         ShGetInfo(compiler, SH_ACTIVE_UNIFORM_MAX_LENGTH, &uniform_max_length);
-        size_t mapped_max_length = 0;
+        int mapped_max_length = 0;
         ShGetInfo(compiler, SH_MAPPED_NAME_MAX_LENGTH, &mapped_max_length);
 
         shader->mAttribMaxNameLength = attrib_max_length;
 
         shader->mAttributes.Clear();
         shader->mUniforms.Clear();
         shader->mUniformInfos.Clear();
 
         nsAutoArrayPtr<char> attribute_name(new char[attrib_max_length+1]);
         nsAutoArrayPtr<char> uniform_name(new char[uniform_max_length+1]);
         nsAutoArrayPtr<char> mapped_name(new char[mapped_max_length+1]);
 
-        for (size_t i = 0; i < num_uniforms; i++) {
-            size_t length;
-            int size;
+        for (int i = 0; i < num_uniforms; i++) {
+            int length, size;
             ShDataType type;
-            ShGetActiveUniform(compiler, (int)i,
+            ShGetActiveUniform(compiler, i,
                                 &length, &size, &type,
                                 uniform_name,
                                 mapped_name);
             if (useShaderSourceTranslation) {
                 shader->mUniforms.AppendElement(WebGLMappedIdentifier(
                                                     nsDependentCString(uniform_name),
                                                     nsDependentCString(mapped_name)));
             }
@@ -4371,30 +4369,29 @@ WebGLContext::CompileShader(WebGLShader 
             shader->mUniformInfos.AppendElement(WebGLUniformInfo(
                                                     size,
                                                     mappedNameLastChar == ']',
                                                     type));
         }
 
         if (useShaderSourceTranslation) {
 
-            for (size_t i = 0; i < num_attributes; i++) {
-                size_t length;
-                int size;
+            for (int i = 0; i < num_attributes; i++) {
+                int length, size;
                 ShDataType type;
-                ShGetActiveAttrib(compiler, (int)i,
+                ShGetActiveAttrib(compiler, i,
                                   &length, &size, &type,
                                   attribute_name,
                                   mapped_name);
                 shader->mAttributes.AppendElement(WebGLMappedIdentifier(
                                                     nsDependentCString(attribute_name),
                                                     nsDependentCString(mapped_name)));
             }
 
-            size_t len = 0;
+            int len = 0;
             ShGetInfo(compiler, SH_OBJECT_CODE_LENGTH, &len);
 
             nsAutoCString translatedSrc;
             translatedSrc.SetLength(len);
             ShGetObjectCode(compiler, translatedSrc.BeginWriting());
 
             const char *ts = translatedSrc.get();
 
new file mode 100644
--- /dev/null
+++ b/gfx/angle/.gitignore
@@ -0,0 +1,9 @@
+Debug
+Release
+*.sdf
+*.ncb
+*.suo
+*.vcproj.*
+*.vcxproj.user
+patches-*
+*.target.mk
--- a/gfx/angle/AUTHORS
+++ b/gfx/angle/AUTHORS
@@ -7,16 +7,17 @@
 #	Name or Organization
 # Email addresses for individuals are tracked elsewhere to avoid spam.
 
 Google Inc.
 TransGaming Inc.
 3DLabs Inc. Ltd.
 
 Adobe Systems Inc.
+Apple Inc.
 Autodesk, Inc.
 Cloud Party, Inc.
 Intel Corporation
 Mozilla Corporation
 Turbulenz
 Klarälvdalens Datakonsult AB
 
 Jacek Caban
@@ -25,9 +26,8 @@ Ginn Chen
 James Hauxwell
 Sam Hocevar
 Pierre Leveille
 Jonathan Liu
 Boying Lu
 Aitor Moreno
 Yuri O'Donnell
 Josh Soref
-Evan Wallace
--- a/gfx/angle/CONTRIBUTORS
+++ b/gfx/angle/CONTRIBUTORS
@@ -1,74 +1,73 @@
-# This is the official list of people who can contribute
-# (and who have contributed) code to the ANGLE project
-# repository.
-# The AUTHORS file lists the copyright holders; this file
-# lists people.  For example, Google employees are listed here
-# but not in AUTHORS, because Google holds the copyright.
-#
-
-TransGaming Inc.
- Nicolas Capens
- Daniel Koch
- Andrew Lewycky
- Gavriel State
- Shannon Woods
-
-Google Inc.
- Brent Austin
- Michael Bai
- John Bauman
- Peter Beverloo
- Steve Block
- Rachel Blum
- Eric Boren
- Henry Bridge
- Nat Duca
- Peter Kasting
- Vangelis Kokkevis
- Zhenyao Mo
- Daniel Nicoara
- Alastair Patrick
- Alok Priyadarshi
- Kenneth Russell
- Brian Salomon
- Gregg Tavares
- Jeff Timanus
- Ben Vanik
- Adrienne Walker
- thestig@chromium.org
- Justin Schuh
-
-Adobe Systems Inc.
- Alexandru Chiculita
- Steve Minns
- Max Vujovic
-
-Autodesk, Inc.
- Ranger Harke
-
-Cloud Party, Inc.
- Conor Dickinson
-
-Intel Corporation
- Jin Yang
- Andy Chen
- Josh Triplett
-
-Klarälvdalens Datakonsult AB
- Milian Wolff
-
-Mozilla Corp.
- Ehsan Akhgari
- Jeff Gilbert
- Mike Hommey
- Benoit Jacob
- Makoto Kato
- Vladimir Vukicevic
-
-Turbulenz
- Michael Braithwaite
-
-Ulrik Persson (ddefrostt)
-Mark Banner (standard8mbp)
-David Kilzer
-
+# This is the official list of people who can contribute
+# (and who have contributed) code to the ANGLE project
+# repository.
+# The AUTHORS file lists the copyright holders; this file
+# lists people.  For example, Google employees are listed here
+# but not in AUTHORS, because Google holds the copyright.
+#
+
+TransGaming Inc.
+ Nicolas Capens
+ Daniel Koch
+ Andrew Lewycky
+ Gavriel State
+ Shannon Woods
+
+Google Inc.
+ Brent Austin
+ Michael Bai
+ John Bauman
+ Peter Beverloo
+ Steve Block
+ Rachel Blum
+ Eric Boren
+ Henry Bridge
+ Nat Duca
+ Peter Kasting
+ Vangelis Kokkevis
+ Zhenyao Mo
+ Daniel Nicoara
+ Alastair Patrick
+ Alok Priyadarshi
+ Kenneth Russell
+ Brian Salomon
+ Gregg Tavares
+ Jeff Timanus
+ Ben Vanik
+ Adrienne Walker
+ thestig@chromium.org
+
+Adobe Systems Inc.
+ Alexandru Chiculita
+ Steve Minns
+ Max Vujovic
+
+Autodesk, Inc.
+ Ranger Harke
+
+Cloud Party, Inc.
+ Conor Dickinson
+
+Intel Corporation
+ Jin Yang
+ Andy Chen
+ Josh Triplett
+
+Klarälvdalens Datakonsult AB
+ Milian Wolff
+
+Mozilla Corp.
+ Ehsan Akhgari
+ Jeff Gilbert
+ Mike Hommey
+ Benoit Jacob
+ Makoto Kato
+ Vladimir Vukicevic
+
+Turbulenz
+ Michael Braithwaite
+
+Ulrik Persson (ddefrostt)
+Mark Banner (standard8mbp)
+David Kilzer
+
--- a/gfx/angle/DEPS
+++ b/gfx/angle/DEPS
@@ -1,11 +1,11 @@
 deps = {
   "trunk/third_party/gyp":
-      "http://gyp.googlecode.com/svn/trunk@1564",
+      "http://gyp.googlecode.com/svn/trunk@1080",
 
   "trunk/third_party/googletest":
       "http://googletest.googlecode.com/svn/trunk@573", #release 1.6.0
 
   "trunk/third_party/googlemock":
       "http://googlemock.googlecode.com/svn/trunk@387", #release 1.6.0
 }
 
--- a/gfx/angle/LICENSE
+++ b/gfx/angle/LICENSE
@@ -1,9 +1,9 @@
-// Copyright (C) 2002-2013 The ANGLE Project Authors. 
+// Copyright (C) 2002-2010 The ANGLE Project Authors. 
 // All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
 // modification, are permitted provided that the following conditions
 // are met:
 //
 //     Redistributions of source code must retain the above copyright
 //     notice, this list of conditions and the following disclaimer.
--- a/gfx/angle/Makefile.in
+++ b/gfx/angle/Makefile.in
@@ -12,24 +12,24 @@ include $(DEPTH)/config/autoconf.mk
 LIBRARY_NAME   = angle
 LIBXUL_LIBRARY = 1
 ifeq (WINNT,$(OS_TARGET))
 VISIBILITY_FLAGS =
 endif
 
 # The below is a rough translation of build_angle.gypi:
 DEFINES += -DANGLE_DISABLE_TRACE
-DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1
+DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
 
 # Target: 'preprocessor'
 # src/compiler/preprocessor:
 VPATH += $(srcdir)/src/compiler/preprocessor
 CPPSRCS += \
-  DiagnosticsBase.cpp \
-  DirectiveHandlerBase.cpp \
+  PreprocessorDiagnostics.cpp \
+  PreprocessorDirectiveHandler.cpp \
   DirectiveParser.cpp \
   ExpressionParser.cpp \
   Input.cpp \
   Lexer.cpp \
   Macro.cpp \
   MacroExpander.cpp \
   Preprocessor.cpp \
   Token.cpp \
@@ -43,16 +43,17 @@ LOCAL_INCLUDES += \
   -I$(srcdir)/include/KHR \
   -I$(srcdir)/src
 
 DEFINES += -DCOMPILER_IMPLEMENTATION
 
 VPATH += $(srcdir)/src/compiler
 # src/compiler:
 CPPSRCS += \
+  ArrayBoundsClamper.cpp \
   BuiltInFunctionEmulator.cpp \
   Compiler.cpp \
   compiler_debug.cpp \
   DetectRecursion.cpp \
   Diagnostics.cpp \
   DirectiveHandler.cpp \
   ForLoopUnroll.cpp \
   glslang_lex.cpp \
@@ -89,22 +90,16 @@ CPPSRCS += \
 
 VPATH += $(srcdir)/src/compiler/timing
 # src/compiler/timing:
 CPPSRCS += \
   RestrictFragmentShaderTiming.cpp \
   RestrictVertexShaderTiming.cpp \
   $(NULL)
 
-VPATH += $(srcdir)/src/third_party/compiler
-# src/third_party/compiler:
-CPPSRCS += \
-  ArrayBoundsClamper.cpp \
-  $(NULL)
-
 ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
 CPPSRCS += ossource_win.cpp
 else
 CPPSRCS += ossource_posix.cpp
 endif
 
 
 # Target: 'translator_glsl'
--- a/gfx/angle/README.mozilla
+++ b/gfx/angle/README.mozilla
@@ -1,40 +1,42 @@
 This is the ANGLE project, from http://code.google.com/p/angleproject/
 
-Current revision: r2042
+Current revision: r1561
 
 
 == Applied local patches ==
 In this order:
   angle-build-stdcall-alias.patch:
     Fix an issue GCC has with linking to undecorated stdcalls.
     
   angle-build-dedupe-debug-cpp-h.patch:
     Rename: "src/compiler/debug.{cpp,h}"
     To:     "src/compiler/compiler_debug.{cpp,h}"
     Repair includes accordingly.
     
-  angle-build-d3dcompiler-list.patch:
-    Move `ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES` define from make files to
-    Display.cpp, where it's used.
-    
-  angle-build-khrplatform-h-path.patch:
-    Fix include path for khrplatform.h.
+  angle-build-dedupe-preproc-files.patch:
+    Rename: "src/compiler/preprocessor/Diagnostics.cpp"
+    To:     "src/compiler/preprocessor/PreprocessorDiagnostics.cpp"
+    Rename: "src/compiler/preprocessor/DirectiveHandler.cpp"
+    To:     "src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp"
   
   angle-long-ident-spooky-hash.patch:
     Use Spooky Hash for long identifier hashing. See bug 676071.
   
   angle-faceforward-emu.patch:
     Adds emulation for faceforward(float,float,float), which is needed to
     prevent crashing on Mac+Intel. See bug 771406.
-  
-  angle-default-clamp-strat.patch:
-    Fixes TCompiler::Init to treat `resources.ArrayIndexClampingStrategy`
-    as a request for the default strategy.
+
+  angle-r1638.patch
+    Adds uniform array index clamping on non-Windows platforms.
+    Windows would require r1719, r1733, r1734.
+
+  angle-cross-compilation.patch
+    Fixes cross compilation on case sensitive OSes.
 
 In addition to these patches, the Makefile.in files are ours, they're not present in
 upsteam ANGLE. Therefore, changes made to the Makefile.in files should not be stored
 in the local .patch files.
 
 
 == How to do a clean-slate upgrade ==
 1.  Backup our moz-specific files:
deleted file mode 100644
--- a/gfx/angle/angle-build-d3dcompiler-list.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From: Jeff Gilbert <jgilbert@mozilla.com>
-
-diff --git a/gfx/angle/src/libEGL/Display.cpp b/gfx/angle/src/libEGL/Display.cpp
---- a/gfx/angle/src/libEGL/Display.cpp
-+++ b/gfx/angle/src/libEGL/Display.cpp
-@@ -26,16 +26,22 @@
- // The "Debug This Pixel..." feature in PIX often fails when using the
- // D3D9Ex interfaces.  In order to get debug pixel to work on a Vista/Win 7
- // machine, define "ANGLE_ENABLE_D3D9EX=0" in your project file.
- #if !defined(ANGLE_ENABLE_D3D9EX)
- // Enables use of the IDirect3D9Ex interface, when available
- #define ANGLE_ENABLE_D3D9EX 1
- #endif // !defined(ANGLE_ENABLE_D3D9EX)
- 
-+#define ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES \
-+    {                                            \
-+        TEXT("d3dcompiler_46.dll"),              \
-+        TEXT("d3dcompiler_43.dll")               \
-+    }
-+
- namespace egl
- {
- namespace
- {
-     typedef std::map<EGLNativeDisplayType, Display*> DisplayMap; 
-     DisplayMap displays;
- }
- 
--- a/gfx/angle/angle-build-dedupe-debug-cpp-h.patch
+++ b/gfx/angle/angle-build-dedupe-debug-cpp-h.patch
@@ -53,45 +53,45 @@ diff --git a/gfx/angle/src/compiler/Outp
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  //
  
  #include "compiler/OutputGLSLBase.h"
 -#include "compiler/debug.h"
 +#include "compiler/compiler_debug.h"
  
- #include <cfloat>
- 
  namespace
  {
  TString arrayBrackets(const TType& type)
  {
      ASSERT(type.isArray());
+     TInfoSinkBase out;
+     out << "[" << type.getArraySize() << "]";
 diff --git a/gfx/angle/src/compiler/OutputHLSL.cpp b/gfx/angle/src/compiler/OutputHLSL.cpp
 --- a/gfx/angle/src/compiler/OutputHLSL.cpp
 +++ b/gfx/angle/src/compiler/OutputHLSL.cpp
 @@ -2,17 +2,17 @@
  // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
  // Use of this source code is governed by a BSD-style license that can be
  // found in the LICENSE file.
  //
  
  #include "compiler/OutputHLSL.h"
  
  #include "common/angleutils.h"
 -#include "compiler/debug.h"
 +#include "compiler/compiler_debug.h"
- #include "compiler/DetectDiscontinuity.h"
  #include "compiler/InfoSink.h"
- #include "compiler/SearchSymbol.h"
  #include "compiler/UnfoldShortCircuit.h"
+ #include "compiler/SearchSymbol.h"
+ #include "compiler/DetectDiscontinuity.h"
  
+ #include <stdio.h>
  #include <algorithm>
- #include <cfloat>
- #include <stdio.h>
+ 
 diff --git a/gfx/angle/src/compiler/Types.h b/gfx/angle/src/compiler/Types.h
 --- a/gfx/angle/src/compiler/Types.h
 +++ b/gfx/angle/src/compiler/Types.h
 @@ -4,17 +4,17 @@
  // found in the LICENSE file.
  //
  
  #ifndef _TYPES_INCLUDED
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-build-dedupe-preproc-files.patch
@@ -0,0 +1,8 @@
+From: Jeff Gilbert <jgilbert@mozilla.com>
+
+diff --git a/gfx/angle/src/compiler/preprocessor/Diagnostics.cpp b/gfx/angle/src/compiler/preprocessor/PreprocessorDiagnostics.cpp
+rename from gfx/angle/src/compiler/preprocessor/Diagnostics.cpp
+rename to gfx/angle/src/compiler/preprocessor/PreprocessorDiagnostics.cpp
+diff --git a/gfx/angle/src/compiler/preprocessor/DirectiveHandler.cpp b/gfx/angle/src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp
+rename from gfx/angle/src/compiler/preprocessor/DirectiveHandler.cpp
+rename to gfx/angle/src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp
deleted file mode 100644
--- a/gfx/angle/angle-build-khrplatform-h-path.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-From: Jeff Gilbert <jgilbert@mozilla.com>
-
-diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h
---- a/gfx/angle/include/GLSLANG/ShaderLang.h
-+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
-@@ -18,17 +18,17 @@
- #else  // defined(WIN32)
- #define COMPILER_EXPORT __attribute__((visibility("default")))
- #endif
- 
- #else  // defined(COMPONENT_BUILD)
- #define COMPILER_EXPORT
- #endif
- 
--#include "KHR/khrplatform.h"
-+#include "khrplatform.h"
- #include <stddef.h>
- 
- //
- // This is the platform independent interface between an OGL driver
- // and the shading language compiler.
- //
- 
- #ifdef __cplusplus
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-cross-compilation.patch
@@ -0,0 +1,27 @@
+From: Jacek Caban <jacek@codeweavers.com>
+Fixed ANGLE cross compilation on case sensitive OSes
+
+
+diff --git a/gfx/angle/src/libEGL/Display.h b/gfx/angle/src/libEGL/Display.h
+index aedc8e7..2162265 100644
+--- a/gfx/angle/src/libEGL/Display.h
++++ b/gfx/angle/src/libEGL/Display.h
+@@ -11,17 +11,17 @@
+ #ifndef LIBEGL_DISPLAY_H_
+ #define LIBEGL_DISPLAY_H_
+ 
+ #ifndef WIN32_LEAN_AND_MEAN
+ #define WIN32_LEAN_AND_MEAN
+ #endif
+ #include <windows.h>
+ #include <d3d9.h>
+-#include <D3Dcompiler.h>
++#include <d3dcompiler.h>
+ 
+ #include <set>
+ #include <vector>
+ 
+ #include "libGLESv2/Context.h"
+ 
+ #include "libEGL/Config.h"
+ #include "libEGL/ShaderCache.h"
deleted file mode 100644
--- a/gfx/angle/angle-default-clamp-strat.patch
+++ /dev/null
@@ -1,52 +0,0 @@
-From: Jeff Gilbert <jgilbert@mozilla.com>
-
-diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp
---- a/gfx/angle/src/compiler/Compiler.cpp
-+++ b/gfx/angle/src/compiler/Compiler.cpp
-@@ -124,18 +124,21 @@ bool TCompiler::Init(const ShBuiltInReso
-     TScopedPoolAllocator scopedAlloc(&allocator, false);
- 
-     // Generate built-in symbol table.
-     if (!InitBuiltInSymbolTable(resources))
-         return false;
-     InitExtensionBehavior(resources, extensionBehavior);
-     fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
- 
--    arrayBoundsClamper.SetClampingStrategy(resources.ArrayIndexClampingStrategy);
--    clampingStrategy = resources.ArrayIndexClampingStrategy;
-+    // ArrayIndexClampingStrategy's enum starts at 1, so 0 is 'default'.
-+    if (resources.ArrayIndexClampingStrategy) {
-+        clampingStrategy = resources.ArrayIndexClampingStrategy;
-+    }
-+    arrayBoundsClamper.SetClampingStrategy(clampingStrategy);
- 
-     hashFunction = resources.HashFunction;
- 
-     return true;
- }
- 
- bool TCompiler::compile(const char* const shaderStrings[],
-                         size_t numStrings,
-diff --git a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
---- a/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
-+++ b/gfx/angle/src/third_party/compiler/ArrayBoundsClamper.cpp
-@@ -72,16 +72,19 @@ private:
- ArrayBoundsClamper::ArrayBoundsClamper()
-     : mClampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC)
-     , mArrayBoundsClampDefinitionNeeded(false)
- {
- }
- 
- void ArrayBoundsClamper::SetClampingStrategy(ShArrayIndexClampingStrategy clampingStrategy)
- {
-+    ASSERT(clampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC ||
-+           clampingStrategy == SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION);
-+
-     mClampingStrategy = clampingStrategy;
- }
- 
- void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root)
- {
-     ASSERT(root);
- 
-     ArrayBoundsClamperMarker clamper;
--- a/gfx/angle/angle-long-ident-spooky-hash.patch
+++ b/gfx/angle/angle-long-ident-spooky-hash.patch
@@ -1,15 +1,15 @@
 # HG changeset patch
-# Parent 262218204644915abb2add8aa52195c24035c293
+# Parent 6a165b9e45205190517515abec94429715303081
 
 diff --git a/gfx/angle/Makefile.in b/gfx/angle/Makefile.in
 --- a/gfx/angle/Makefile.in
 +++ b/gfx/angle/Makefile.in
-@@ -84,16 +84,17 @@ CPPSRCS += \
+@@ -73,16 +73,17 @@ CPPSRCS += \
    intermOut.cpp \
    IntermTraverse.cpp \
    MapLongVariableNames.cpp \
    parseConst.cpp \
    ParseHelper.cpp \
    PoolAlloc.cpp \
    QualifierAlive.cpp \
    RemoveTree.cpp \
@@ -32,17 +32,17 @@ diff --git a/gfx/angle/src/compiler/MapL
  // found in the LICENSE file.
  //
  
  #include "compiler/MapLongVariableNames.h"
 +#include "spooky.h"
  
  namespace {
  
- TString mapLongName(size_t id, const TString& name, bool isGlobal)
+ TString mapLongName(int id, const TString& name, bool isGlobal)
  {
      ASSERT(name.size() > MAX_SHORTENED_IDENTIFIER_SIZE);
      TStringStream stream;
 -    stream << "webgl_";
 -    if (isGlobal)
 -        stream << "g";
 -    stream << id;
 -    if (name[0] != '_')
@@ -718,17 +718,17 @@ new file mode 100644
 +    uint8  m_remainder;          // length of unhashed data stashed in m_data
 +};
 +
 +
 +
 diff --git a/gfx/angle/src/libGLESv2/Makefile.in b/gfx/angle/src/libGLESv2/Makefile.in
 --- a/gfx/angle/src/libGLESv2/Makefile.in
 +++ b/gfx/angle/src/libGLESv2/Makefile.in
-@@ -91,16 +91,17 @@ CPPSRCS += \
+@@ -86,16 +86,17 @@ CPPSRCS += \
    intermOut.cpp \
    IntermTraverse.cpp \
    MapLongVariableNames.cpp \
    parseConst.cpp \
    ParseHelper.cpp \
    PoolAlloc.cpp \
    QualifierAlive.cpp \
    RemoveTree.cpp \
new file mode 100644
--- /dev/null
+++ b/gfx/angle/angle-r1638.patch
@@ -0,0 +1,475 @@
+# HG changeset patch
+# Parent faf255e4400222ee23c29ddcc76fb3dce56145f4
+
+diff --git a/gfx/angle/AUTHORS b/gfx/angle/AUTHORS
+--- a/gfx/angle/AUTHORS
++++ b/gfx/angle/AUTHORS
+@@ -7,16 +7,17 @@
+ #	Name or Organization
+ # Email addresses for individuals are tracked elsewhere to avoid spam.
+ 
+ Google Inc.
+ TransGaming Inc.
+ 3DLabs Inc. Ltd.
+ 
+ Adobe Systems Inc.
++Apple Inc.
+ Autodesk, Inc.
+ Cloud Party, Inc.
+ Intel Corporation
+ Mozilla Corporation
+ Turbulenz
+ Klarälvdalens Datakonsult AB
+ 
+ Jacek Caban
+diff --git a/gfx/angle/Makefile.in b/gfx/angle/Makefile.in
+--- a/gfx/angle/Makefile.in
++++ b/gfx/angle/Makefile.in
+@@ -51,16 +51,17 @@ LOCAL_INCLUDES += \
+   -I$(srcdir)/include/KHR \
+   -I$(srcdir)/src
+ 
+ DEFINES += -DCOMPILER_IMPLEMENTATION
+ 
+ VPATH += $(srcdir)/src/compiler
+ # src/compiler:
+ CPPSRCS += \
++  ArrayBoundsClamper.cpp \
+   BuiltInFunctionEmulator.cpp \
+   Compiler.cpp \
+   compiler_debug.cpp \
+   DetectRecursion.cpp \
+   Diagnostics.cpp \
+   DirectiveHandler.cpp \
+   ForLoopUnroll.cpp \
+   glslang_lex.cpp \
+diff --git a/gfx/angle/README.mozilla b/gfx/angle/README.mozilla
+--- a/gfx/angle/README.mozilla
++++ b/gfx/angle/README.mozilla
+@@ -21,16 +21,20 @@ In this order:
+   
+   angle-long-ident-spooky-hash.patch:
+     Use Spooky Hash for long identifier hashing. See bug 676071.
+   
+   angle-faceforward-emu.patch:
+     Adds emulation for faceforward(float,float,float), which is needed to
+     prevent crashing on Mac+Intel. See bug 771406.
+ 
++  angle-r1638.patch
++    Adds uniform array index clamping on non-Windows platforms.
++    Windows would require r1719, r1733, r1734.
++
+ In addition to these patches, the Makefile.in files are ours, they're not present in
+ upsteam ANGLE. Therefore, changes made to the Makefile.in files should not be stored
+ in the local .patch files.
+ 
+ 
+ == How to do a clean-slate upgrade ==
+ 1.  Backup our moz-specific files:
+       README.mozilla
+diff --git a/gfx/angle/include/GLSLANG/ShaderLang.h b/gfx/angle/include/GLSLANG/ShaderLang.h
+--- a/gfx/angle/include/GLSLANG/ShaderLang.h
++++ b/gfx/angle/include/GLSLANG/ShaderLang.h
+@@ -145,17 +145,23 @@ typedef enum {
+   // restrictions on fragment shaders.
+   // This flag only has an effect if all of the following are true:
+   // - The shader spec is SH_WEBGL_SPEC.
+   // - The compile options contain the SH_TIMING_RESTRICTIONS flag.
+   // - The shader type is SH_FRAGMENT_SHADER.
+   SH_DEPENDENCY_GRAPH = 0x0400,
+ 
+   // Enforce the GLSL 1.017 Appendix A section 7 packing restrictions.
+-  SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800
++  SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800,
++
++  // This flag ensures all indirect (expression-based) array indexing
++  // is clamped to the bounds of the array. This ensures, for example,
++  // that you cannot read off the end of a uniform, whether an array
++  // vec234, or mat234 type.
++  SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x1000
+ } ShCompileOptions;
+ 
+ //
+ // Driver must call this first, once, before doing any other
+ // compiler operations.
+ // If the function succeeds, the return value is nonzero, else zero.
+ //
+ COMPILER_EXPORT int ShInitialize();
+diff --git a/gfx/angle/src/build_angle.gypi b/gfx/angle/src/build_angle.gypi
+--- a/gfx/angle/src/build_angle.gypi
++++ b/gfx/angle/src/build_angle.gypi
+@@ -54,16 +54,18 @@
+       'include_dirs': [
+         '.',
+         '../include',
+       ],
+       'defines': [
+         'COMPILER_IMPLEMENTATION',
+       ],
+       'sources': [
++        'compiler/ArrayBoundsClamper.cpp',
++        'compiler/ArrayBoundsClamper.h',
+         'compiler/BaseTypes.h',
+         'compiler/BuiltInFunctionEmulator.cpp',
+         'compiler/BuiltInFunctionEmulator.h',
+         'compiler/Common.h',
+         'compiler/Compiler.cpp',
+         'compiler/ConstantUnion.h',
+         'compiler/debug.cpp',
+         'compiler/debug.h',
+diff --git a/gfx/angle/src/compiler/Compiler.cpp b/gfx/angle/src/compiler/Compiler.cpp
+--- a/gfx/angle/src/compiler/Compiler.cpp
++++ b/gfx/angle/src/compiler/Compiler.cpp
+@@ -1,14 +1,15 @@
+ //
+ // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
+ // Use of this source code is governed by a BSD-style license that can be
+ // found in the LICENSE file.
+ //
+ 
++#include "compiler/ArrayBoundsClamper.h"
+ #include "compiler/BuiltInFunctionEmulator.h"
+ #include "compiler/DetectRecursion.h"
+ #include "compiler/ForLoopUnroll.h"
+ #include "compiler/Initialize.h"
+ #include "compiler/InitializeParseContext.h"
+ #include "compiler/MapLongVariableNames.h"
+ #include "compiler/ParseHelper.h"
+ #include "compiler/RenameFunction.h"
+@@ -187,16 +188,20 @@ bool TCompiler::compile(const char* cons
+         // Unroll for-loop markup needs to happen after validateLimitations pass.
+         if (success && (compileOptions & SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX))
+             ForLoopUnroll::MarkForLoopsWithIntegerIndicesForUnrolling(root);
+ 
+         // Built-in function emulation needs to happen after validateLimitations pass.
+         if (success && (compileOptions & SH_EMULATE_BUILT_IN_FUNCTIONS))
+             builtInFunctionEmulator.MarkBuiltInFunctionsForEmulation(root);
+ 
++        // Clamping uniform array bounds needs to happen after validateLimitations pass.
++        if (success && (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS))
++            arrayBoundsClamper.MarkIndirectArrayBoundsForClamping(root);
++
+         // Call mapLongVariableNames() before collectAttribsUniforms() so in
+         // collectAttribsUniforms() we already have the mapped symbol names and
+         // we could composite mapped and original variable names.
+         // Also, if we hash all the names, then no need to do this for long names.
+         if (success && (compileOptions & SH_MAP_LONG_VARIABLE_NAMES) && hashFunction == NULL)
+             mapLongVariableNames(root);
+ 
+         if (success && (compileOptions & SH_ATTRIBUTES_UNIFORMS)) {
+@@ -232,16 +237,17 @@ bool TCompiler::InitBuiltInSymbolTable(c
+ 
+     builtIns.initialize(shaderType, shaderSpec, resources);
+     return InitializeSymbolTable(builtIns.getBuiltInStrings(),
+         shaderType, shaderSpec, resources, infoSink, symbolTable);
+ }
+ 
+ void TCompiler::clearResults()
+ {
++    arrayBoundsClamper.Cleanup();
+     infoSink.info.erase();
+     infoSink.obj.erase();
+     infoSink.debug.erase();
+ 
+     attribs.clear();
+     uniforms.clear();
+ 
+     builtInFunctionEmulator.Cleanup();
+@@ -348,8 +354,14 @@ const TExtensionBehavior& TCompiler::get
+ {
+     return extensionBehavior;
+ }
+ 
+ const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const
+ {
+     return builtInFunctionEmulator;
+ }
++
++const ArrayBoundsClamper& TCompiler::getArrayBoundsClamper() const
++{
++    return arrayBoundsClamper;
++}
++
+diff --git a/gfx/angle/src/compiler/OutputGLSLBase.cpp b/gfx/angle/src/compiler/OutputGLSLBase.cpp
+--- a/gfx/angle/src/compiler/OutputGLSLBase.cpp
++++ b/gfx/angle/src/compiler/OutputGLSLBase.cpp
+@@ -207,18 +207,47 @@ bool TOutputGLSLBase::visitBinary(Visit 
+         case EOpVectorTimesMatrixAssign:
+         case EOpVectorTimesScalarAssign:
+         case EOpMatrixTimesScalarAssign:
+         case EOpMatrixTimesMatrixAssign:
+             writeTriplet(visit, "(", " *= ", ")");
+             break;
+ 
+         case EOpIndexDirect:
++            writeTriplet(visit, NULL, "[", "]");
++            break;
+         case EOpIndexIndirect:
+-            writeTriplet(visit, NULL, "[", "]");
++            if (node->getAddIndexClamp())
++            {
++                if (visit == InVisit)
++                {
++                    out << "[webgl_int_clamp(";
++                }
++                else if (visit == PostVisit)
++                {
++                    int maxSize;
++                    TIntermTyped *left = node->getLeft();
++                    TType leftType = left->getType();
++
++                    if (left->isArray())
++                    {
++                        // The shader will fail validation if the array length is not > 0.
++                        maxSize = leftType.getArraySize() - 1;
++                    }
++                    else
++                    {
++                        maxSize = leftType.getNominalSize() - 1;
++                    }
++                    out << ", 0, " << maxSize << ")]";
++                }
++            }
++            else
++            {
++                writeTriplet(visit, NULL, "[", "]");
++            }
+             break;
+         case EOpIndexDirectStruct:
+             if (visit == InVisit)
+             {
+                 out << ".";
+                 // TODO(alokp): ASSERT
+                 out << hashName(node->getType().getFieldName());
+                 visitChildren = false;
+diff --git a/gfx/angle/src/compiler/ShHandle.h b/gfx/angle/src/compiler/ShHandle.h
+--- a/gfx/angle/src/compiler/ShHandle.h
++++ b/gfx/angle/src/compiler/ShHandle.h
+@@ -11,16 +11,17 @@
+ // Machine independent part of the compiler private objects
+ // sent as ShHandle to the driver.
+ //
+ // This should not be included by driver code.
+ //
+ 
+ #include "GLSLANG/ShaderLang.h"
+ 
++#include "compiler/ArrayBoundsClamper.h"
+ #include "compiler/BuiltInFunctionEmulator.h"
+ #include "compiler/ExtensionBehavior.h"
+ #include "compiler/HashNames.h"
+ #include "compiler/InfoSink.h"
+ #include "compiler/SymbolTable.h"
+ #include "compiler/VariableInfo.h"
+ 
+ class LongNameMap;
+@@ -101,30 +102,32 @@ protected:
+     // Returns true if the shader does not use samplers.
+     bool enforceVertexShaderTimingRestrictions(TIntermNode* root);
+     // Returns true if the shader does not use sampler dependent values to affect control 
+     // flow or in operations whose time can depend on the input values.
+     bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph);
+     // Get built-in extensions with default behavior.
+     const TExtensionBehavior& getExtensionBehavior() const;
+ 
++    const ArrayBoundsClamper& getArrayBoundsClamper() const;
+     const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
+ 
+ private:
+     ShShaderType shaderType;
+     ShShaderSpec shaderSpec;
+ 
+     int maxUniformVectors;
+ 
+     // Built-in symbol table for the given language, spec, and resources.
+     // It is preserved from compile-to-compile.
+     TSymbolTable symbolTable;
+     // Built-in extensions with default behavior.
+     TExtensionBehavior extensionBehavior;
+ 
++    ArrayBoundsClamper arrayBoundsClamper;
+     BuiltInFunctionEmulator builtInFunctionEmulator;
+ 
+     // Results of compilation.
+     TInfoSink infoSink;  // Output sink.
+     TVariableInfoList attribs;  // Active attributes in the compiled shader.
+     TVariableInfoList uniforms;  // Active uniforms in the compiled shader.
+ 
+     // Cached copy of the ref-counted singleton.
+diff --git a/gfx/angle/src/compiler/TranslatorESSL.cpp b/gfx/angle/src/compiler/TranslatorESSL.cpp
+--- a/gfx/angle/src/compiler/TranslatorESSL.cpp
++++ b/gfx/angle/src/compiler/TranslatorESSL.cpp
+@@ -17,16 +17,19 @@ void TranslatorESSL::translate(TIntermNo
+ 
+     // Write built-in extension behaviors.
+     writeExtensionBehavior();
+ 
+     // Write emulated built-in functions if needed.
+     getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
+         sink, getShaderType() == SH_FRAGMENT_SHADER);
+ 
++    // Write array bounds clamping emulation if needed.
++    getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
++
+     // Write translated shader.
+     TOutputESSL outputESSL(sink, getHashFunction(), getNameMap(), getSymbolTable());
+     root->traverse(&outputESSL);
+ }
+ 
+ void TranslatorESSL::writeExtensionBehavior() {
+     TInfoSinkBase& sink = getInfoSink().obj;
+     const TExtensionBehavior& extensionBehavior = getExtensionBehavior();
+diff --git a/gfx/angle/src/compiler/TranslatorGLSL.cpp b/gfx/angle/src/compiler/TranslatorGLSL.cpp
+--- a/gfx/angle/src/compiler/TranslatorGLSL.cpp
++++ b/gfx/angle/src/compiler/TranslatorGLSL.cpp
+@@ -30,12 +30,15 @@ void TranslatorGLSL::translate(TIntermNo
+ 
+     // Write GLSL version.
+     writeVersion(getShaderType(), root, sink);
+ 
+     // Write emulated built-in functions if needed.
+     getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
+         sink, false);
+ 
++    // Write array bounds clamping emulation if needed.
++    getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
++
+     // Write translated shader.
+     TOutputGLSL outputGLSL(sink, getHashFunction(), getNameMap(), getSymbolTable());
+     root->traverse(&outputGLSL);
+ }
+diff --git a/gfx/angle/src/compiler/intermOut.cpp b/gfx/angle/src/compiler/intermOut.cpp
+--- a/gfx/angle/src/compiler/intermOut.cpp
++++ b/gfx/angle/src/compiler/intermOut.cpp
+@@ -37,17 +37,17 @@ protected:
+ 
+ TString TType::getCompleteString() const
+ {
+     TStringStream stream;
+ 
+     if (qualifier != EvqTemporary && qualifier != EvqGlobal)
+         stream << getQualifierString() << " " << getPrecisionString() << " ";
+     if (array)
+-        stream << "array of ";
++        stream << "array[" << getArraySize() << "] of ";
+     if (matrix)
+         stream << size << "X" << size << " matrix of ";
+     else if (size > 1)
+         stream << size << "-component vector of ";
+ 
+     stream << getBasicString();
+     return stream.str();
+ }
+diff --git a/gfx/angle/src/compiler/intermediate.h b/gfx/angle/src/compiler/intermediate.h
+--- a/gfx/angle/src/compiler/intermediate.h
++++ b/gfx/angle/src/compiler/intermediate.h
+@@ -386,30 +386,36 @@ protected:
+     TOperator op;
+ };
+ 
+ //
+ // Nodes for all the basic binary math operators.
+ //
+ class TIntermBinary : public TIntermOperator {
+ public:
+-    TIntermBinary(TOperator o) : TIntermOperator(o) {}
++    TIntermBinary(TOperator o) : TIntermOperator(o), addIndexClamp(false) {}
+ 
+     virtual TIntermBinary* getAsBinaryNode() { return this; }
+     virtual void traverse(TIntermTraverser*);
+ 
+     void setLeft(TIntermTyped* n) { left = n; }
+     void setRight(TIntermTyped* n) { right = n; }
+     TIntermTyped* getLeft() const { return left; }
+     TIntermTyped* getRight() const { return right; }
+     bool promote(TInfoSink&);
+ 
++    void setAddIndexClamp() { addIndexClamp = true; }
++    bool getAddIndexClamp() { return addIndexClamp; }
++
+ protected:
+     TIntermTyped* left;
+     TIntermTyped* right;
++
++    // If set to true, wrap any EOpIndexIndirect with a clamp to bounds.
++    bool addIndexClamp;
+ };
+ 
+ //
+ // Nodes for unary math operators.
+ //
+ class TIntermUnary : public TIntermOperator {
+ public:
+     TIntermUnary(TOperator o, TType& t) : TIntermOperator(o, t), operand(0), useEmulatedFunction(false) {}
+diff --git a/gfx/angle/src/compiler/translator_common.vcxproj b/gfx/angle/src/compiler/translator_common.vcxproj
+--- a/gfx/angle/src/compiler/translator_common.vcxproj
++++ b/gfx/angle/src/compiler/translator_common.vcxproj
+@@ -133,16 +133,17 @@
+       </PrecompiledHeader>
+       <WarningLevel>Level4</WarningLevel>
+       <TreatWarningAsError>true</TreatWarningAsError>
+       <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+       <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4267;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+     </ClCompile>
+   </ItemDefinitionGroup>
+   <ItemGroup>
++    <ClCompile Include="ArrayBoundsClamper.cpp" />
+     <ClCompile Include="BuiltInFunctionEmulator.cpp" />
+     <ClCompile Include="Compiler.cpp" />
+     <ClCompile Include="debug.cpp" />
+     <ClCompile Include="DetectRecursion.cpp" />
+     <ClCompile Include="Diagnostics.cpp" />
+     <ClCompile Include="DirectiveHandler.cpp" />
+     <ClCompile Include="ForLoopUnroll.cpp" />
+     <ClCompile Include="InfoSink.cpp" />
+@@ -220,16 +221,17 @@
+       <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+       </Message>
+       <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+       </Command>
+       <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Outputs)</Outputs>
+     </CustomBuild>
+   </ItemGroup>
+   <ItemGroup>
++    <ClInclude Include="ArrayBoundsClamper.h" />
+     <ClInclude Include="BaseTypes.h" />
+     <ClInclude Include="BuiltInFunctionEmulator.h" />
+     <ClInclude Include="Common.h" />
+     <ClInclude Include="ConstantUnion.h" />
+     <ClInclude Include="debug.h" />
+     <ClInclude Include="DetectRecursion.h" />
+     <ClInclude Include="Diagnostics.h" />
+     <ClInclude Include="DirectiveHandler.h" />
+@@ -274,9 +276,9 @@
+       <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
+       <LinkLibraryDependencies>true</LinkLibraryDependencies>
+       <UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
+     </ProjectReference>
+   </ItemGroup>
+   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+   <ImportGroup Label="ExtensionTargets">
+   </ImportGroup>
+-</Project>
+\ No newline at end of file
++</Project>
+diff --git a/gfx/angle/src/libGLESv2/Makefile.in b/gfx/angle/src/libGLESv2/Makefile.in
+--- a/gfx/angle/src/libGLESv2/Makefile.in
++++ b/gfx/angle/src/libGLESv2/Makefile.in
+@@ -64,16 +64,17 @@ LOCAL_INCLUDES = \
+   -I$(srcdir)/../../include/KHR \
+   -I$(srcdir)/..
+ 
+ DEFINES += -DCOMPILER_IMPLEMENTATION
+ 
+ VPATH += $(srcdir)/../compiler
+ # src/compiler:
+ CPPSRCS += \
++  ArrayBoundsClamper.cpp \
+   BuiltInFunctionEmulator.cpp \
+   Compiler.cpp \
+   compiler_debug.cpp \
+   DetectRecursion.cpp \
+   Diagnostics.cpp \
+   DirectiveHandler.cpp \
+   ForLoopUnroll.cpp \
+   glslang_lex.cpp \
--- a/gfx/angle/build/common.gypi
+++ b/gfx/angle/build/common.gypi
@@ -64,43 +64,31 @@
               '_WINDOWS',
               'NOMINMAX',
               'WIN32',
               'WIN32_LEAN_AND_MEAN',
               'WINVER=0x0600',
             ],
             'RuntimeTypeInfo': 'false',
             'WarningLevel': '4',
-            'DisableSpecificWarnings': [4100, 4127, 4189, 4239, 4244, 4245, 4512, 4702],
+            'DisableSpecificWarnings': '4100;4127;4189;4239;4244;4245;4512;4702',
           },
           'VCLinkerTool': {
             'FixedBaseAddress': '1',
             'GenerateDebugInformation': 'true',
             'ImportLibrary': '$(OutDir)\\lib\\$(TargetName).lib',
             'MapFileName': '$(OutDir)\\$(TargetName).map',
             # Most of the executables we'll ever create are tests
             # and utilities with console output.
             'SubSystem': '1',  # /SUBSYSTEM:CONSOLE
-            'AdditionalLibraryDirectories': [
-              '$(ProgramFiles)/Windows Kits/8.0/Lib/win8/um/x86',
-            ],
-          },
-          'VCLibrarianTool': {
-            'AdditionalLibraryDirectories': [
-              '$(ProgramFiles)/Windows Kits/8.0/Lib/win8/um/x86',
-            ],
           },
           'VCResourceCompilerTool': {
             'Culture': '1033',
           },
         },
-        'msvs_system_include_dirs': [
-          '$(ProgramFiles)/Windows Kits/8.0/Include/shared',
-          '$(ProgramFiles)/Windows Kits/8.0/Include/um',
-        ],
       },  # Common
       'Debug': {
         'inherit_from': ['Common'],
         'msvs_settings': {
           'VCCLCompilerTool': {
             'Optimization': '0',  # /Od
             'PreprocessorDefinitions': ['_DEBUG'],
             'BasicRuntimeChecks': '3',
--- a/gfx/angle/extensions/ANGLE_depth_texture.txt
+++ b/gfx/angle/extensions/ANGLE_depth_texture.txt
@@ -4,36 +4,34 @@ Name
 
 Name Strings
 
     GL_ANGLE_depth_texture
 
 Contributors
 
     Nicolas Capens, TransGaming
-    Daniel Koch, TransGaming
-    Shannon Woods, TransGaming
     Kenneth Russell, Google
     Vangelis Kokkevis, Google
     Gregg Tavares, Google
     Contributors to OES_depth_texture
     Contributors to OES_packed_depth_stencil
 
 Contact
 
-    Shannon Woods, TransGaming (shannon 'dot' woods 'at' transgaming.com)
+    Daniel Koch, TransGaming (daniel 'at' transgaming.com)
 
 Status
 
     Implemented in ANGLE.
 
 Version
 
-    Last Modified Date: February 25, 2013
-    Revision: #4
+    Last Modifed Date: June 4, 2012
+    Revision: #3
 
 Number
 
     TBD
 
 Dependencies
 
     OpenGL ES 2.0 is required.
@@ -86,17 +84,17 @@ Additions to Chapter 2 of the OpenGL ES 
     "Texture Access" add a new paragraph before the last paragraph add
     this line:
 
     "The stencil index texture internal component is ignored if the base
     internal format is DEPTH_STENCIL_OES.
 
     If a vertex shader uses..."
 
-Additions to Chapter 3 of the OpenGL ES 2.0 specification (Rasterization)
+Additions to Chapter 3 of the OpenGL ES 2.0 specification (Rasterizatoin)
 
     Add the following rows to Table 3.2 (page 62):
 
       type Parameter           GL Data Type    Special
       ------------------------------------------------
       ...                      ...              ...
       UNSIGNED_SHORT           ushort           No
       UNSIGNED_INT             uint             No
@@ -216,28 +214,29 @@ Additions to Chapter 3 of the OpenGL ES 
 
     "3.7.8-1/2 Depth/Stencil Textures
 
     If the currently bound texture's base internal format is DEPTH_COMPONENT or
     DEPTH_STENCIL_OES, then the output of the texture unit is as described
     below. Otherwise, the texture unit operates in the normal manner.
 
     Let <D_t> be the depth texture value, provided by the shader's texture lookup
-    function. Then the effective texture value is computed as follows:
+    function. Then the effective texture value, <L_t> or <A_t> is computed
+    as follows:
             <Tau> = <D_t>
 
     If the texture image has a base internal format of DEPTH_STENCIL_OES, then
     the stencil index texture component is ignored.  The texture value <Tau> does
     not include a stencil index component, but includes only the depth
     component.
 
-    The resulting <Tau> is assigned to <R_t>. In some implementations, <Tau> is
-    also assigned to <G_t>, <B_t>, or <A_t>. Thus in table 3.12, textures with
-    depth component data behave as if their base internal format is RGBA, with
-    values in <G_t>, <B_t>, and <A_t> being implementation dependent."
+    The resulting <Tau> is assigned to <L_t>. In some implementations, 
+    <Tau> is also assigned to <A_t>. Thus in table 3.12, textures with
+    depth component data behave as if their base internal format is
+    either LUMINANCE or LUMINANCE_ALPHA."
 
     Add the following to section 3.7.11 "Mipmap Generation":
 
     "If the level zero array contains depth or depth-stencil data, the
      error INVALID_OPERATION is generated."
 
     Insert a new paragraph after the first paragraph of the "Texture Access"
     subsection of section 3.8.2 on page 87, which says:
@@ -359,18 +358,18 @@ New State
 Issues
 
     1) What are the differences between this extension and OES_depth_texture
        and OES_packed_depth_stencil?
     
        RESOLVED: This extension:
          - does not support loading pre-baked depth stencil data via 
            TexImage2D or TexSubImage2D.
-         - allows variability in the y-, z-, and w-components of the sample
-           results from depth textures.
+         - allows variability in w-component of the sample results from
+           depth textures.
          - only supports one level textures.
          - explicitly lists the errors for unsupported functionality.
            Since these were not clearly specified in the OES_depth_texture
            extension there may be differences in error values between 
            implementations of OES_depth_texture and ANGLE_depth_texture.
        This specification was also rebased to apply against the OpenGL ES 2.0
        specification instead of the OpenGL specification, making it more 
        obvious what all the functionality changes are.
@@ -388,15 +387,13 @@ Issues
        be for fitlered texturing. However since it is not possible to
        render to non-zero-level texture levels in OpenGL ES 2.0, and since
        this extension forbids loading existing data and GenerateMipmap on 
        depth textures, it is impossible to initialize or specify contents
        for non-zero levels of depth textures.
 
 Revision History
  
-    02/25/2013  swoods  revise to allow texture lookup to guarantee depth values
-                        only in red channel of sample result.
     06/04/2012  dgkoch  fix errors, disallow multi-level depth textures.
     05/30/2012  dgkoch  minor updates and add issues.
     05/23/2012  dgkoch  intial revision based on OES_depth_texture and 
                         OES_packed_depth_stencil and rebased against the ES 2.0 spec
 
--- a/gfx/angle/extensions/ANGLE_framebuffer_blit.txt
+++ b/gfx/angle/extensions/ANGLE_framebuffer_blit.txt
@@ -19,18 +19,18 @@ Contact
     Daniel Koch, TransGaming Inc. (daniel 'at' transgaming 'dot' com)
 
 Status
 
     Implemented in ANGLE ES2
 
 Version
 
-    Last Modified Date: Sept 22, 2012
-    Author Revision: 4
+    Last Modified Date: Aug 6, 2010
+    Author Revision: 3
 
 Number
 
     OpenGL ES Extension #83
 
 Dependencies
 
     OpenGL ES 2.0 is required.
@@ -104,21 +104,17 @@ Operations and the Framebuffer)
     "While an application-created framebuffer object is bound to
     DRAW_FRAMEBUFFER_ANGLE, the pixel ownership test always passes."
 
     Add to 4.3.1 (Reading Pixels), right before the subsection titled
     "Obtaining Pixels from the Framebuffer":
 
     "Calling ReadPixels generates INVALID_FRAMEBUFFER_OPERATION if
     the object bound to READ_FRAMEBUFFER_BINDING_ANGLE is not "framebuffer
-    complete" (section 4.4.4.2). GetIntegerv generates an INVALID_OPERATION
-    error if the object bound to READ_FRAMEBUFFER_BINDING_ANGLE is not
-    framebuffer complete, or if the GL is using a framebuffer object 
-    (i.e. READ_FRAMEBUFFER_BINDING_ANGLE is non-zero) and there is no color
-    attachment."
+    complete" (section 4.4.4.2)."
 
     Insert a new section 4.3.2 titled "Copying Pixels" and renumber the
     subsequent sections.  Add the following text:
 
     "BlitFramebufferANGLE transfers a rectangle of pixel values from one
     region of the read framebuffer to another in the draw framebuffer.
 
     BlitFramebufferANGLE(int srcX0, int srcY0, int srcX1, int srcY1,
@@ -313,20 +309,16 @@ Errors
     The error INVALID_FRAMEBUFFER_OPERATION is generated if
     BlitFramebufferANGLE is called while the
     draw framebuffer is not framebuffer complete.
 
     The error INVALID_FRAMEBUFFER_OPERATION is generated if
     BlitFramebufferANGLE, ReadPixels, CopyTex{Sub}Image*, is called while the
     read framebuffer is not framebuffer complete.
 
-    The error INVALID_OPERATION is generated if GetIntegerv is called
-    while the read framebuffer is not framebuffer complete, or if there
-    is no color attachment present on the read framebuffer object.
-
     The error INVALID_VALUE is generated by BlitFramebufferANGLE if
     <mask> has any bits set other than those named by
     COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT.
 
     The error INVALID_OPERATION is generated if BlitFramebufferANGLE is
     called and <mask> includes DEPTH_BUFFER_BIT or STENCIL_BUFFER_BIT
     and the source and destination depth or stencil buffer formats do
     not match.
@@ -427,11 +419,9 @@ Revision History
       - rebased changes against the OpenGL ES 2.0 specification
       - added ANGLE-specific restrictions
     Revision 2, 2010/07/15
       - clarifications of implicit clamping to buffer sizes (from ARB_fbo)
       - clarify that D/S restricts apply after the scissor is applied
       - improve some error language
     Revision 3, 2010/08/06
       - add additional contributors, update implementation status
-    Revision 4, 2012/09/22
-      - document errors for GetIntegerv.
 
--- a/gfx/angle/extensions/ANGLE_instanced_arrays.txt
+++ b/gfx/angle/extensions/ANGLE_instanced_arrays.txt
@@ -24,17 +24,17 @@ Status
 
 Version
 
     Last Modified Date: February 8, 2012
     Author Revision: 3
 
 Number
 
-    OpenGL ES Extension #109
+    OpenGL ES Extension #??
 
 Dependencies
 
     OpenGL ES 2.0 is required.
 
     This extension is written against the OpenGL ES 2.0 Specification.
 
 Overview
new file mode 100644
--- /dev/null
+++ b/gfx/angle/extensions/ANGLE_multiple_render_targets.txt
@@ -0,0 +1,383 @@
+Name
+
+    ANGLE_multiple_render_targets
+
+Name Strings
+
+    GL_ANGLE_multiple_render_targets
+
+Contributors
+
+    Contributors to GL_NV_draw_buffers
+    Contributors to GL_NV_fbo_color_attachments
+    Contributors to the OpenGL ES 2.0 specification
+    Contributors to the OpenGLSL ES 1.0.17 specification
+    Contributors to the OpenGL ES 3.0 specification
+    Nicolas Capens, TransGaming Inc.
+    Daniel Koch, TransGaming Inc.
+    Alastair Patrick, Google Inc.
+    Members of the WebGL working group
+
+Contact
+
+    Daniel Koch <daniel> <at> <transgaming> <dot> <com>
+
+Status
+
+    Incomplete -- do not implement!
+
+Version
+
+    Last Modified Data: November 13, 2012
+    Revision: #5
+
+Number
+
+    TBD
+
+Dependencies
+
+    OpenGL ES 2.0 is required.
+
+    The extension is written against the OpenGL ES 2.0 specification.
+
+    ANGLE_framebuffer_blit affects the definition of this extension.
+    APPLE_framebuffer_multisample affects the definitin of this extension.
+
+Overview
+
+    This extension increases the number of available framebuffer object
+    color attachment points, extends OpenGL ES 2.0 to allow multiple output
+    colors, and provides a mechanism for directing those outputs to
+    multiple color buffers.
+
+    This extension is similar to the combination of the GL_NV_draw_buffers
+    and GL_NV_fbo_color_attachments extensions, but imposes certain
+    restrictions informed by the OpenGL ES 3.0 API.
+
+New Procedures and Functions
+
+      void DrawBuffersANGLE(sizei n, const enum *bufs);
+
+New Tokens
+
+    Accepted by the <pname> parameter of GetIntegerv:
+
+        MAX_COLOR_ATTACHMENTS_ANGLE                  0x8CDF
+
+    Accepted by the <pname> parameters of GetIntegerv and GetFloatv:
+
+        MAX_DRAW_BUFFERS_ANGLE                  0x8824
+        DRAW_BUFFER0_ANGLE                      0x8825
+        DRAW_BUFFER1_ANGLE                      0x8826
+        DRAW_BUFFER2_ANGLE                      0x8827
+        DRAW_BUFFER3_ANGLE                      0x8828
+        DRAW_BUFFER4_ANGLE                      0x8829
+        DRAW_BUFFER5_ANGLE                      0x882A
+        DRAW_BUFFER6_ANGLE                      0x882B
+        DRAW_BUFFER7_ANGLE                      0x882C
+        DRAW_BUFFER8_ANGLE                      0x882D
+        DRAW_BUFFER9_ANGLE                      0x882E
+        DRAW_BUFFER10_ANGLE                     0x882F
+        DRAW_BUFFER11_ANGLE                     0x8830
+        DRAW_BUFFER12_ANGLE                     0x8831
+        DRAW_BUFFER13_ANGLE                     0x8832
+        DRAW_BUFFER14_ANGLE                     0x8833
+        DRAW_BUFFER15_ANGLE                     0x8834
+
+    Accepted by the <attachment> parameter of FramebufferRenderbuffer,
+    FramebufferTexture2D and GetFramebufferAttachmentParameteriv, and by
+    the <bufs> parameter of DrawBuffersANGLE:
+
+        COLOR_ATTACHMENT0_ANGLE                      0x8CE0
+        COLOR_ATTACHMENT1_ANGLE                      0x8CE1
+        COLOR_ATTACHMENT2_ANGLE                      0x8CE2
+        COLOR_ATTACHMENT3_ANGLE                      0x8CE3
+        COLOR_ATTACHMENT4_ANGLE                      0x8CE4
+        COLOR_ATTACHMENT5_ANGLE                      0x8CE5
+        COLOR_ATTACHMENT6_ANGLE                      0x8CE6
+        COLOR_ATTACHMENT7_ANGLE                      0x8CE7
+        COLOR_ATTACHMENT8_ANGLE                      0x8CE8
+        COLOR_ATTACHMENT9_ANGLE                      0x8CE9
+        COLOR_ATTACHMENT10_ANGLE                     0x8CEA
+        COLOR_ATTACHMENT11_ANGLE                     0x8CEB
+        COLOR_ATTACHMENT12_ANGLE                     0x8CEC
+        COLOR_ATTACHMENT13_ANGLE                     0x8CED
+        COLOR_ATTACHMENT14_ANGLE                     0x8CEE
+        COLOR_ATTACHMENT15_ANGLE                     0x8CEF
+
+    The COLOR_ATTACHMENT0_ANGLE constant is equal to the
+    COLOR_ATTACHMENT0 constant.
+
+    Each COLOR_ATTACHMENT<i>_ANGLE adheres to COLOR_ATTACHMENT<i>_ANGLE
+    = COLOR_ATTACHMENT0_ANGLE + <i>.
+
+Changes to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
+
+    Section 3.2, (Multisampling). Replace the second paragraph:
+
+    An additional buffer, called the multisample buffer, is added to the
+    window system-provided framebuffer. Pixel sample values, including
+    color, depth, and stencil values, are stored in this buffer. Samples
+    contain separate color values for each fragment color. When the
+    window system-provided framebuffer includes a multisample buffer, it
+    does not include depth or stencil buffers, even if the multisample
+    buffer does not store depth or stencil values. Color buffers do
+    coexist with the multisample buffer, however.
+
+    Section 3.8.2, (Shader Execution) Replace subsection "Shader
+    Outputs":
+
+    The OpenGL ES Shading Language specification describes the values
+    that may be output by a fragment shader. These are gl_FragColor and
+    gl_FragData[n].  The final fragment color values or the final
+    fragment data values written by a fragment shader are clamped to the
+    range [0, 1] and then converted to fixed-point as described in
+    section 2.1.2 for framebuffer color components.
+
+    Writing to gl_FragColor specifies the fragment color (color number
+    zero) that will be used by subsequent stages of the pipeline.
+    Writing to gl_FragData[n] specifies the value of fragment color
+    number n. Any colors, or color components, associated with a
+    fragment that are not written by the fragment shader are undefined.
+    A fragment shader may not statically assign values to both
+    gl_FragColor and gl_FragData. In this case, a compile or link error
+    will result. A shader statically assigns a value to a variable if,
+    after preprocessing, it contains a statement that would write to the
+    variable, whether or not run-time flow of control will cause that
+    statement to be executed.
+
+Changes to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment
+Operations and the Frame Buffer)
+
+    Insert Table 4.3 (and renumber subsequent tables): Arguments to
+    DrawBuffersANGLE when the context is bound to a framebuffer
+    object, and the buffers they indicate. <i> in
+    COLOR_ATTACHMENT<i>_ANGLE may range from zero to the value of
+    MAX_COLOR_ATTACHMENTS_ANGLE minus one.
+
+    Symbolic Constant                         Meaning
+    -----------------                         ---------------------
+    NONE                                      No buffer
+
+    COLOR_ATTACHMENT<i>_ANGLE (see caption)   Output fragment color to image 
+                                              attached at color attachment
+                                              point i
+
+
+    Replace Section 4.2.1, "Selecting a Buffer for Writing" with the following:
+
+    "By default, color values are written into the front buffer for
+    single buffered surfaces or into the back buffer for back buffered
+    surfaces as determined when making the context current. To control
+    the color buffer into which each of the fragment color values is
+    written, DrawBuffersANGLE is used.
+
+    The command
+
+      void DrawBuffersANGLE(sizei n, const enum *bufs);
+
+    defines the draw buffers to which all fragment colors are written.
+    <n> specifies the number of buffers in <bufs>. <bufs> is a pointer
+    to an array of symbolic constants specifying the buffer to which
+    each fragment color is written.
+
+    Each buffer listed in <bufs> must be BACK, NONE, or one of the
+    values from table 4.3. Further, acceptable values for the constants
+    in <bufs> depend on whether the GL is using the default framebuffer
+    (i.e., DRAW_FRAMEBUFFER_BINDING is zero), or a framebuffer object
+    (i.e., DRAW_FRAMEBUFFER_BINDING is non-zero). For more information
+    about framebuffer objects, see section 4.4.
+
+    If the GL is bound to the default framebuffer, then <n> must be 1
+    and the constant must be BACK or NONE. When draw buffer zero is
+    BACK, color values are written into the sole buffer for single-
+    buffered contexts, or into the back buffer for double-buffered
+    contexts. If DrawBuffersANGLE is supplied with a constant other than
+    BACK and NONE, the error INVALID_OPERATION is generated.
+
+    If the GL is bound to a draw framebuffer object, then each of the
+    constants must be one of the values listed in table 4.3.
+
+    In both cases, the draw buffers being defined correspond in order to
+    the respective fragment colors. The draw buffer for fragment
+    colors beyond <n> is set to NONE.
+
+    The maximum number of draw buffers is implementation-dependent. The
+    number of draw buffers supported can be queried by calling
+    GetIntegerv with the symbolic constant MAX_DRAW_BUFFERS_ANGLE. An
+    INVALID_VALUE error is generated if <n> is greater than
+    MAX_DRAW_BUFFERS_ANGLE.
+
+    If the GL is bound to a draw framebuffer object, the <i>th buffer listed
+    in <bufs> must be COLOR_ATTACHMENT<i>_ANGLE or NONE. Specifying a
+    buffer out of order, BACK, or COLOR_ATTACHMENT<m>_ANGLE where <m> is
+    greater than or equal to the value of MAX_COLOR_ATTACHMENTS_ANGLE,
+    will generate the error INVALID_OPERATION.
+
+    If a fragment shader writes to "gl_FragColor", DrawBuffersANGLE 
+    specifies a set of draw buffers into which the color written to
+    "gl_FragColor" is written. If a fragment shader writes to
+    "gl_FragData", DrawBuffersANGLE specifies a set of draw buffers
+    into which each of the multiple output colors defined by these
+    variables are separately written. If a fragment shader writes to
+    neither "gl_FragColor" nor "gl_FragData" the values of the
+    fragment colors following shader execution are undefined, and may
+    differ for each fragment color.
+
+    Indicating a buffer or buffers using DrawBuffersANGLE causes
+    subsequent pixel color value writes to affect the indicated
+    buffers. If the GL is bound to a draw framebuffer object and a draw
+    buffer selects an attachment that has no image attached, then that
+    fragment color is not written.
+
+    Specifying NONE as the draw buffer for a fragment color will inhibit
+    that fragment color from being written.
+
+    The state required to handle color buffer selection for each
+    framebuffer is an integer for each supported fragment color. For the
+    default framebuffer, in the initial state the draw buffer for
+    fragment color zero is BACK if there is a default framebuffer
+    associated with the context, otherwise NONE. For framebuffer
+    objects, in the initial state the draw buffer for fragment color
+    zero is COLOR_ATTACHMENT0_ANGLE.
+
+    For both the default framebuffer and framebuffer objects, the
+    initial state of draw buffers for fragment colors other than zero is
+    NONE.
+
+    The value of the draw buffer selected for fragment color <i> can be
+    queried by calling GetIntegerv with the symbolic constant
+    DRAW_BUFFER<i>_ANGLE."
+
+    Replace the second paragraph of Section 4.4.1 (Binding and Managing
+    Framebuffer Objects) with the following:
+
+    "The namespace for framebuffer objects is the unsigned integers, with
+    zero reserved by OpenGL ES to refer to the default framebuffer. A
+    framebuffer object is created by binding an unused name to the
+    target FRAMEBUFFER, DRAW_FRAMEBUFFER, or READ_FRAMEBUFFER. The binding
+    is effected by calling
+
+        void BindFramebuffer(enum target, uint framebuffer);
+
+    with <target> set the desired framebuffer target and <framebuffer> set 
+    to the unused name. The resulting framebuffer object is a new state 
+    vector. There is a number of color attachment points, plus one each
+    for the depth and stencil attachment points. The number of color attachment
+    points is equal to the value of MAX_COLOR_ATTACHMENTS_ANGLE."
+
+Changes to Chapter 3 of the OpenGL ES Shading Language 1.0.17 Specification (Basics)
+
+    Add a new section:
+
+    3.4.1 GL_ANGLE_multiple_render_targets Extension
+
+    To use the GL_ANGLE_multiple_render_targets extension in a shader it
+    must be enabled using the #extension directive.
+
+    The shading language preprocessor #define
+    GL_ANGLE_multiple_render_targets will be defined to 1, if the
+    GL_ANGLE_multiple_render_targets extension is supported.
+
+Dependencies on ANGLE_framebuffer_blit and APPLE_framebuffer_multisample:
+
+    If neither ANGLE_framebuffer_blit nor APPLE_framebuffer_multisample are
+    supported, then all references to "draw framebuffers" should be replaced
+    with references to "framebuffers". References to DRAW_FRAMEBUFFER_BINDING
+    should be replaced with references to FRAMEBUFFER_BINDING. References to
+    DRAW_FRAMEBUFFER and READ_FRAMEBUFFER should be removed.
+
+    If ANGLE_framebuffer_blit is supported, DRAW_FRAMEBUFFER_BINDING, DRAW_FRAMEBUFFER
+    and READ_FRAMEBUFFER all refer to corresponding _ANGLE suffixed names
+    (they have the same token values).
+
+    If APPLE_framebuffer_multisample is supported, DRAW_FRAMEBUFFER_BINDING,
+    DRAW_FRAMEBUFFER and READ_FRAMEBUFFER all refer to the corresponding _APPLE
+    suffixed names (they have the same token values).
+
+Errors
+
+    <TBD>
+
+New State
+
+    Add Table 6.X Framebuffer (State per framebuffer object):
+
+    State                 Type Get Command  Initial Value Description 
+    ---------------       ---- ------------ ------------- -----------
+    DRAW_BUFFER<i>_ANGLE  Z10* GetIntegerv  see 4.2.1     Draw buffer selected 
+							  for fragment color i
+
+    Add to Table 6.18 (Implementation Dependent Values)
+
+    Get value                    Type Get Cmnd    Minimum Value Description             Sec.
+    ------------------------     ---- ----------- ------------- -----------             -----
+    MAX_DRAW_BUFFERS_ANGLE       Z+   GetIntegerv 1             Maximum number of       4.2.1
+                                                                active draw buffers
+    MAX_COLOR_ATTACHMENTS_ANGLE  Z+   GetIntegerv 1             Number of framebuffer   4.4.1
+                                                                color attachment points
+Issues
+
+    See ARB_draw_buffers for relevant issues.
+
+  1) Differences from NV_draw_buffers + NV_fbo_color_attachments?
+
+   - interactions with blit_framebuffer
+   - MAX limits are global instead of per-fbo (TBD - Issue 2)
+   - no broadcast from gl_FragColor (TBD - Issue 3)
+   - can be used to with default framebuffer to set NONE/BACK (TBD - Issue 4)
+
+   2) Should the MAX_DRAW_BUFFERS_ANGLE and MAX_COLOR_ATTACHMENTS_ANGLE limits
+    be per-framebuffer values or implementation dependent constants?
+
+    DISCUSSION: In ARB_draw_buffers this was per-context (see Issue 2).
+    EXT_framebuffer_object (and subsequently ARB_framebuffer_object, and GL 3.0
+    through GL 4.2) made these queries framebuffer-dependent. 
+    However GL in 4.3 and GLES 3.0, these limits were moved from 
+    framebuffer-dependent state to implementation-dependent state after
+    much discussion (Bug 7990).
+
+    NV_draw_buffers has MAX_DRAW_BUFFERS listed as per-framebuffer state,
+    but NV_fbo_color_attachments has MAX_COLOR_ATTACHMENTS as an 
+    implementation-dependent constant.
+
+    This is relevant because some implementations are not able to support 
+    multisampling in conjuction with multiple color attachments.  If the
+    query is per-framebuffer, they can report a maximum of one attachment
+    when there are multisampled attachments, but a higher limit when only
+    single-sampled attachments are present.
+
+   3) Should we support broadcast from gl_FragColor to all gl_FragData[x]
+    or should it be synonymous with gl_FragData[0]?
+
+    DISCUSSION: With NV_draw_buffers, writing to gl_FragColor writes to all
+    the enabled draw buffers (ie broadcast). In OpenGL ES 3.0 when using 
+    ESSL 1.0, gl_FragColor is equivalent to writing a single output to 
+    gl_FragData[0] and multiple outputs are not possible. When using ESSL 3.0,
+    only user-defined out variables may be used.
+
+    If broadcast is supported, some implementations may have to replace
+    writes to gl_FragColor with replicated writes to all possible gl_FragData
+    locations when this extension is enabled.
+
+   4) Should we allow DrawBuffersANGLE to be called when the default FBO is bound?
+
+    DISCUSSION: NV_draw_buffers specifies that DrawBuffersNV errors with 
+    INVALID_OPERATION when the default FBO is bound. OpenGL ES 3.0 allows
+    DrawBuffers to toggle between BACK and NONE on the default FBO.
+
+    An implementation that does not natively support disabling the drawbuffer
+    on the default FBO could emulate this by disabling color writes.
+
+
+Revision History
+
+    11/13/2012  dgkoch  add revision history
+                        add text from updated ES 3.0 spec
+                        add issues for discussion
+    10/16/2012  kbr     update name string
+    10/16/2012  kbr     remove restrition requiring draw buffer 0 to be non-NULL
+    10/12/2012  kbr     remove references to GetDoublev and ReadBuffer
+    10/11/2012  kbr     initial draft extension
+
--- a/gfx/angle/extensions/ANGLE_pack_reverse_row_order.txt
+++ b/gfx/angle/extensions/ANGLE_pack_reverse_row_order.txt
@@ -1,8 +1,9 @@
+                                             
 Name
 
     ANGLE_pack_reverse_row_order
 
 Name Strings
 
     GL_ANGLE_pack_reverse_row_order
 
@@ -21,17 +22,17 @@ Status
 
 Version
 
     Last Modified Date: February 22, 2011
     Author Revision: 22
 
 Number
 
-    OpenGL ES Extension #110
+    TBD
 
 Dependencies
 
     OpenGL 1.5 or OpenGL ES 1.0 are required.
 
     Some of the functionality of this extension is not supported
     when implemented against OpenGL ES.
 
--- a/gfx/angle/extensions/ANGLE_texture_compression_dxt.txt
+++ b/gfx/angle/extensions/ANGLE_texture_compression_dxt.txt
@@ -1,15 +1,14 @@
 Name
 
     ANGLE_texture_compression_dxt
 
 Name Strings
 
-    GL_ANGLE_texture_compression_dxt1
     GL_ANGLE_texture_compression_dxt3
     GL_ANGLE_texture_compression_dxt5
 
 Contributors
 
     Gregg Tavares, Google Inc.
     Daniel Koch, TransGaming Inc.
     Al Patrick, Google Inc.
@@ -19,145 +18,56 @@ Contacts
     Gregg Tavares, Google Inc. (gman 'at' google 'dot' com)
 
 Status
 
     Implemented in ANGLE ES2
 
 Version
 
-    Last Modified Date: Sept 22, 2012
-    Author Revision: 2
+    Last Modified Date: Aug 2, 2011
 
 Number
 
-    OpenGL ES Extension #111
+    OpenGL ES Extension #..
 
 Dependencies
 
-    Requires OpenGL ES 1.0.
+    Requires OpenGL ES 2.0.
 
     The extension is written against the OpenGL ES 2.0 specification.
 
 Overview
 
     These extensions are exactly the same as EXT_texture_compression_dxt1
-    except they additionally expose the COMPRESSED_RGBA_S3TC_DXT3_ANGLE and
-    COMPRESSED_RGBA_S3TC_DXT5_ANGLE formats and have a size restrictions
-    such that the size must be a multiple of four (except for mip levels
-    where the dimensions are either 2 or 1).
+    except they expose the formats COMPRESSED_RGBA_S3TC_DXT3_ANGLE and
+    COMPRESSED_RGBA_S3TC_DXT5_ANGLE respectively.
 
     See EXT_texture_compression_dxt1 for the full list of changes. Also
     see EXT_texture_compression_s3tc for a description of the formats.
 
-IP Status
-
-    A license to the S3TC Intellectual Property may be necessary for 
-    implementation of this extension.  You should consult with your 
-    Attorney to determine the need for a license.
-
 New Procedures and Functions
 
     None.
 
 New Types
 
     None.
 
 New Tokens
 
     Accepted by the <internalformat> parameter of CompressedTexImage2D
     and the <format> parameter of CompressedTexSubImage2D:
 
-    COMPRESSED_RGB_S3TC_DXT1_ANGLE                    0x83F0
-    COMPRESSED_RGBA_S3TC_DXT1_ANGLE                   0x83F1
     COMPRESSED_RGBA_S3TC_DXT3_ANGLE                   0x83F2
     COMPRESSED_RGBA_S3TC_DXT5_ANGLE                   0x83F3
 
-Additions to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
-
-    Add the following to Section 3.7.3 (Compressed Texture Images)
-    (at the end of the description of the CompressedTexImage2D command):
-
-    Compressed Internal Format        Base Internal Format
-    ==========================        ====================
-    COMPRESSED_RGB_S3TC_DXT1_ANGLE    RGB
-    COMPRESSED_RGBA_S3TC_DXT1_ANGLE   RGBA
-    COMPRESSED_RGBA_S3TC_DXT3_ANGLE   RGBA
-    COMPRESSED_RGBA_S3TC_DXT5_ANGLE   RGBA
-
-    Table 3.x: Specific Compressed Internal Formats
-
-    If <internalformat> is one of the S3TC formats listed in Table 3.x,
-    the compressed texture is stored in the appropriate S3TC compressed
-    texture format (see Appendix). The GL and the S3TC texture compression
-    algorithm support only 2D images without borders.
-
-    CompressedTexImage2D will produce the INVALID_OPERATION error when
-    <internalformat> is one of the values from Table 3.x under the following
-    conditions: 
-
-      * <border> is non-zero.
-      * <width> is not one, two, or a multiple of four.
-      * <height> is not one, two, or a multiple of four.
-
-    Add the following to Section 3.7.3 (Compressed Texture Images)
-    (at the end of the description of the CompressedTexSubImage2D command):
-
-    If the internal format of the texture image being modified is listed
-    in Table 3.x, the texture is stored in the appropriate S3TC compressed
-    texture format (see Appendix). Since DXT/S3TC images are easily edited
-    along 4x4 texel boundaries, the limitations of CompressedTexSubImage2D
-    are relaxed. CompressedTexSubImage2D will result in an INVALID_OPERATION
-    error only if one of the following conditions occurs:
-
-      * <width> is not a multiple of four or equal to TEXTURE_WIDTH.
-      * <height> is not a multipls of four or equal to TEXTURE_HEIGHT.
-      * <xoffset> or <yoffset> is not a multiple of four.
-      * <format> does not match the internal format of the texture image
-        being modified.
-
-    The following restrictions at the end of section 3.7.3 do not apply
-    to S3TC DXT texture formats, since subimage modification is straightforward
-    as long as the subimage is properly aligned.
-
 Errors
 
-    INVALID_OPERATION is generated by CompressedTexImage2D if <internalformat>
-    is one of the compressed internal formats from Table 3.x and any of the 
-    following apply:
-      - <border> is not equal to zero.
-      - <width> is not one, two, or a multiple of four. 
-      - <height> is not one, two, or a multiple of four. 
-
-    INVALID_OPERATION is generated by TexImage2D and CopyTexImage2D if
-    <internalformat> is one of the compressed internal formats from
-    Table 3.x.
-
-    INVALID_OPERATION is generated by TexSubImage2D and CopyTexSubImage2D
-    if the internal format of the texture currently bound to <target> is
-    one of the compressed internal formats from Table 3.x.
-
-    INVALID_OPERATION is generated by CompressedTexSubImage2D if <format>
-    is one of the compressed interal formats from Table 3.x and any of the
-    following apply:
-      - <width> is not a multiple of four or equal to TEXTURE_WIDTH;
-      - <height> is not a multiple of four or equal to TEXTURE_HEIGHT;
-      - <xoffset> or <yoffset> is not a multiple of four;
-      - <format> does not match the internal format of the texture image
-      being modified.
+    None.
 
 New State
 
     None.
 
-Appendix: 
-
-    The format for the S3TC Compressed Texture Images Formats is documented
-    in the appendix of EXT_texture_compression_s3tc.
-
 Revision History
 
-    Revision 1, 2010/08/06 - gman
-      - Initial revision
-    Revision 2, 2012/09/22 - dgkoch
-      - Added DXT1 formats and documented multiple of 4 restriction.
 
--- a/gfx/angle/extensions/ANGLE_texture_usage.txt
+++ b/gfx/angle/extensions/ANGLE_texture_usage.txt
@@ -21,17 +21,17 @@ Status
 
 Version
 
     Last Modified Date:  November 10, 2011
     Version:             2
 
 Number
 
-    OpenGL ES Extension #112 
+    TBD 
 
 Dependencies
 
     This extension is written against the OpenGL ES 2.0 Specification.
 
 Overview
 
     In some implementations it is advantageous to know the expected
--- a/gfx/angle/extensions/ANGLE_translated_shader_source.txt
+++ b/gfx/angle/extensions/ANGLE_translated_shader_source.txt
@@ -23,17 +23,17 @@ Status
 
 Version
 
     Last Modified Date: October 5, 2011
     Author Revision: 2
 
 Number
 
-    OpenGL ES Extension #113
+    OpenGL ES Extension #??
 
 Dependencies
 
     OpenGL ES 2.0 is required.
 
     The extension is written against the OpenGL ES 2.0 specification.
 
 Overview
deleted file mode 100644
--- a/gfx/angle/extensions/EXT_draw_buffers.txt
+++ /dev/null
@@ -1,542 +0,0 @@
-Name
-
-    EXT_draw_buffers
-
-Name Strings
-
-    GL_EXT_draw_buffers
-
-Contributors
-
-    Contributors to GL_NV_draw_buffers
-    Contributors to GL_NV_fbo_color_attachments
-    Contributors to the OpenGL ES 2.0 specification
-    Contributors to the OpenGLSL ES 1.0.17 specification
-    Contributors to the OpenGL ES 3.0 specification
-    Nicolas Capens, TransGaming Inc.
-    Daniel Koch, TransGaming Inc.
-    Alastair Patrick, Google Inc.
-    Kenneth Russell, Google Inc.
-    Greg Roth, NVIDIA Corporation
-    Ben Bowman, Imagination Technologies
-    Members of the WebGL and OpenGL ES working groups
-
-Contact
-
-    Daniel Koch (daniel 'at' transgaming.com)
-
-Status
-
-    Draft Complete 
-
-Version
-
-    Last Modified Date: January 30, 2013
-    Revision: #7
-
-Number
-
-    TBD
-
-Dependencies
-
-    OpenGL ES 2.0 is required.
-
-    The extension is written against the OpenGL ES 2.0 specification.
-
-    ANGLE_framebuffer_blit affects the definition of this extension.
-    APPLE_framebuffer_multisample affects the definitin of this extension.
-
-Overview
-
-    This extension increases the number of available framebuffer object
-    color attachment points, extends OpenGL ES 2.0 to allow multiple output
-    colors, and provides a mechanism for directing those outputs to
-    multiple color buffers.
-
-    This extension is similar to the combination of the GL_NV_draw_buffers
-    and GL_NV_fbo_color_attachments extensions, but imposes certain
-    restrictions informed by the OpenGL ES 3.0 API.
-
-New Procedures and Functions
-
-      void DrawBuffersEXT(sizei n, const enum *bufs);
-
-New Tokens
-
-    Accepted by the <pname> parameter of GetIntegerv:
-
-        MAX_COLOR_ATTACHMENTS_EXT             0x8CDF
-
-    Accepted by the <pname> parameters of GetIntegerv and GetFloatv:
-
-        MAX_DRAW_BUFFERS_EXT                  0x8824
-        DRAW_BUFFER0_EXT                      0x8825
-        DRAW_BUFFER1_EXT                      0x8826
-        DRAW_BUFFER2_EXT                      0x8827
-        DRAW_BUFFER3_EXT                      0x8828
-        DRAW_BUFFER4_EXT                      0x8829
-        DRAW_BUFFER5_EXT                      0x882A
-        DRAW_BUFFER6_EXT                      0x882B
-        DRAW_BUFFER7_EXT                      0x882C
-        DRAW_BUFFER8_EXT                      0x882D
-        DRAW_BUFFER9_EXT                      0x882E
-        DRAW_BUFFER10_EXT                     0x882F
-        DRAW_BUFFER11_EXT                     0x8830
-        DRAW_BUFFER12_EXT                     0x8831
-        DRAW_BUFFER13_EXT                     0x8832
-        DRAW_BUFFER14_EXT                     0x8833
-        DRAW_BUFFER15_EXT                     0x8834
-
-    Accepted by the <attachment> parameter of FramebufferRenderbuffer,
-    FramebufferTexture2D and GetFramebufferAttachmentParameteriv, and by
-    the <bufs> parameter of DrawBuffersEXT:
-
-        COLOR_ATTACHMENT0_EXT                      0x8CE0
-        COLOR_ATTACHMENT1_EXT                      0x8CE1
-        COLOR_ATTACHMENT2_EXT                      0x8CE2
-        COLOR_ATTACHMENT3_EXT                      0x8CE3
-        COLOR_ATTACHMENT4_EXT                      0x8CE4
-        COLOR_ATTACHMENT5_EXT                      0x8CE5
-        COLOR_ATTACHMENT6_EXT                      0x8CE6
-        COLOR_ATTACHMENT7_EXT                      0x8CE7
-        COLOR_ATTACHMENT8_EXT                      0x8CE8
-        COLOR_ATTACHMENT9_EXT                      0x8CE9
-        COLOR_ATTACHMENT10_EXT                     0x8CEA
-        COLOR_ATTACHMENT11_EXT                     0x8CEB
-        COLOR_ATTACHMENT12_EXT                     0x8CEC
-        COLOR_ATTACHMENT13_EXT                     0x8CED
-        COLOR_ATTACHMENT14_EXT                     0x8CEE
-        COLOR_ATTACHMENT15_EXT                     0x8CEF
-
-    The COLOR_ATTACHMENT0_EXT constant is equal to the
-    COLOR_ATTACHMENT0 constant.
-
-    Each COLOR_ATTACHMENT<i>_EXT adheres to COLOR_ATTACHMENT<i>_EXT
-    = COLOR_ATTACHMENT0_EXT + <i>.
-
-Changes to Chapter 3 of the OpenGL ES 2.0 Specification (Rasterization)
-
-    Section 3.2, (Multisampling). Replace the second paragraph:
-
-    An additional buffer, called the multisample buffer, is added to the
-    window system-provided framebuffer. Pixel sample values, including
-    color, depth, and stencil values, are stored in this buffer. Samples
-    contain separate color values for each fragment color. When the
-    window system-provided framebuffer includes a multisample buffer, it
-    does not include depth or stencil buffers, even if the multisample
-    buffer does not store depth or stencil values. Color buffers do
-    coexist with the multisample buffer, however.
-
-    Section 3.8.2, (Shader Execution) Replace subsection "Shader
-    Outputs":
-
-    The OpenGL ES Shading Language specification describes the values
-    that may be output by a fragment shader. These are gl_FragColor and
-    gl_FragData[n].  The final fragment color values or the final
-    fragment data values written by a fragment shader are clamped to the
-    range [0, 1] and then converted to fixed-point as described in
-    section 2.1.2 for framebuffer color components.
-
-    Writing to gl_FragColor specifies the fragment color (color number
-    zero) that will be used by subsequent stages of the pipeline.
-    Writing to gl_FragData[n] specifies the value of fragment color
-    number n. Any colors, or color components, associated with a
-    fragment that are not written by the fragment shader are undefined.
-    A fragment shader may not statically assign values to both
-    gl_FragColor and gl_FragData. In this case, a compile or link error
-    will result. A shader statically assigns a value to a variable if,
-    after preprocessing, it contains a statement that would write to the
-    variable, whether or not run-time flow of control will cause that
-    statement to be executed.
-
-Changes to Chapter 4 of the OpenGL ES 2.0 Specification (Per-Fragment
-Operations and the Frame Buffer)
-
-    Modify the overview of Chapter 4 and replace the sentences
-    of the fifth paragraph which read: 
-
-    "The name of the color buffer of an application-created framebuffer
-    object is COLOR_ATTACHMENT0. The names of the depth and stencil buffers
-    are DEPTH_ATTACHMENT and STENCIL_ATTACHMENT." 
-
-    With the following:
-
-    "A framebuffer object has an array of color buffer attachment points,
-    numbered zero through <n>, a depth buffer attachment point, and a
-    stencil buffer attachment point." 
-
-    Insert Table 4.3 to Section 4.2.1 (and renumber subsequent tables):
-
-    Symbolic Constant                       Meaning
-    -----------------                       ---------------------
-    NONE                                    No buffer
-
-    COLOR_ATTACHMENT<i>_EXT (see caption)   Output fragment color to image 
-                                            attached at color attachment
-                                            point i
-
-    Table 4.3: Arguments to DrawBuffersEXT when the context is bound to a
-    framebuffer object, and the buffers they indicate. <i> in
-    COLOR_ATTACHMENT<i>_EXT may range from zero to the value of
-    MAX_COLOR_ATTACHMENTS_EXT minus one.
-
-    Replace Section 4.2.1, "Selecting a Buffer for Writing" with the following:
-
-    "By default, color values are written into the front buffer for
-    single buffered surfaces or into the back buffer for back buffered
-    surfaces as determined when making the context current. To control
-    the color buffer into which each of the fragment color values is
-    written, DrawBuffersEXT is used.
-
-    The command
-
-      void DrawBuffersEXT(sizei n, const enum *bufs);
-
-    defines the draw buffers to which all fragment colors are written.
-    <n> specifies the number of buffers in <bufs>. <bufs> is a pointer
-    to an array of symbolic constants specifying the buffer to which
-    each fragment color is written.
-
-    Each buffer listed in <bufs> must be BACK, NONE, or one of the
-    values from table 4.3. Further, acceptable values for the constants
-    in <bufs> depend on whether the GL is using the default framebuffer
-    (i.e., DRAW_FRAMEBUFFER_BINDING is zero), or a framebuffer object
-    (i.e., DRAW_FRAMEBUFFER_BINDING is non-zero). For more information
-    about framebuffer objects, see section 4.4.
-
-    If the GL is bound to the default framebuffer, then <n> must be 1
-    and the constant must be BACK or NONE. When draw buffer zero is
-    BACK, color values are written into the sole buffer for single-
-    buffered contexts, or into the back buffer for double-buffered
-    contexts. If DrawBuffersEXT is supplied with a constant other than
-    BACK and NONE, the error INVALID_OPERATION is generated.
-
-    If the GL is bound to a draw framebuffer object, then each of the
-    constants must be one of the values listed in table 4.3.
-
-    In both cases, the draw buffers being defined correspond in order to
-    the respective fragment colors. The draw buffer for fragment
-    colors beyond <n> is set to NONE.
-
-    The maximum number of draw buffers is implementation-dependent. The
-    number of draw buffers supported can be queried by calling
-    GetIntegerv with the symbolic constant MAX_DRAW_BUFFERS_EXT. An
-    INVALID_VALUE error is generated if <n> is greater than
-    MAX_DRAW_BUFFERS_EXT.
-
-    If the GL is bound to a draw framebuffer object, the <i>th buffer listed
-    in <bufs> must be COLOR_ATTACHMENT<i>_EXT or NONE. Specifying a
-    buffer out of order, BACK, or COLOR_ATTACHMENT<m>_EXT where <m> is
-    greater than or equal to the value of MAX_COLOR_ATTACHMENTS_EXT,
-    will generate the error INVALID_OPERATION.
-
-    If a fragment shader writes to "gl_FragColor", DrawBuffersEXT 
-    specifies the set of draw buffers into which the color 
-    written to "gl_FragColor" is written. If a fragment shader writes to
-    "gl_FragData", DrawBuffersEXT specifies a set of draw buffers
-    into which each of the multiple output colors defined by these
-    variables are separately written. If a fragment shader writes to
-    neither "gl_FragColor" nor "gl_FragData" the values of the
-    fragment colors following shader execution are undefined, and may
-    differ for each fragment color.
-
-    Indicating a buffer or buffers using DrawBuffersEXT causes
-    subsequent pixel color value writes to affect the indicated
-    buffers. If the GL is bound to a draw framebuffer object and a draw
-    buffer selects an attachment that has no image attached, then that
-    fragment color is not written.
-
-    Specifying NONE as the draw buffer for a fragment color will inhibit
-    that fragment color from being written.
-
-    The state required to handle color buffer selection for each
-    framebuffer is an integer for each supported fragment color. For the
-    default framebuffer, in the initial state the draw buffer for
-    fragment color zero is BACK if there is a default framebuffer
-    associated with the context, otherwise NONE. For framebuffer
-    objects, in the initial state the draw buffer for fragment color
-    zero is COLOR_ATTACHMENT0_EXT.
-
-    For both the default framebuffer and framebuffer objects, the
-    initial state of draw buffers for fragment colors other than zero is
-    NONE.
-
-    The value of the draw buffer selected for fragment color <i> can be
-    queried by calling GetIntegerv with the symbolic constant
-    DRAW_BUFFER<i>_EXT."
-
-    Modify Section 4.2.3 (Clearing the Buffers) and replace the first
-    two paragraphs with the following:
-
-    "The GL provides a means for setting portions of every pixel in a
-    particular buffer to the same value.  The argument to
-    
-        void Clear(bitfield buf);
-
-    is the bitwise OR of a number of values indicating which buffers are
-    to be cleared. The values are COLOR_BUFFER_BIT, DEPTH_BUFFER_BIT, and
-    STENCIL_BUFFER_BIT, indicating the buffers currently enabled for color
-    writing, the depth buffer, and the stencil buffer (see below), 
-    respectively. The value to which each buffer is cleared depends on
-    the setting of the clear value for that buffer.  If the mask is not a
-    bitwise OR of the specified values, then the error INVALID_VALUE is
-    generated.
-
-        void ClearColor(clampf r, clampf, g, clampf b, clampf a);
-   
-    sets the clear value for fixed-point color buffers.  Each of the
-    specified components is clamped to [0, 1] and converted to fixed-point
-    as described in section 2.1.2 for framebuffer color components."
-
-    Replace the second paragraph of Section 4.4.1 (Binding and Managing
-    Framebuffer Objects) with the following:
-
-    "The namespace for framebuffer objects is the unsigned integers, with
-    zero reserved by OpenGL ES to refer to the default framebuffer. A
-    framebuffer object is created by binding an unused name to the
-    target FRAMEBUFFER, DRAW_FRAMEBUFFER, or READ_FRAMEBUFFER. The binding
-    is effected by calling
-
-        void BindFramebuffer(enum target, uint framebuffer);
-
-    with <target> set the desired framebuffer target and <framebuffer> set 
-    to the unused name. The resulting framebuffer object is a new state 
-    vector. There is a number of color attachment points, plus one each
-    for the depth and stencil attachment points. The number of color attachment
-    points is equal to the value of MAX_COLOR_ATTACHMENTS_EXT."
-
-    Replace the third item in the bulleted list in Section 4.4.1 (Binding
-    and Managing Framebuffer Objects) with the following:
-
-    " * The only color buffer bitplanes are the ones defined by the
-    framebuffer attachments points named COLOR_ATTACHMENT0_EXT through
-    COLOR_ATTACHMENT<n>_EXT."
-
-    Modify Section 4.4.3 (Renderbuffer Objects) in the 
-    "Attaching Renderbuffer Images to a Framebuffer" subsection as follows:
-
-    Insert the following table:
-
-    Name of attachment
-    ---------------------------------------
-    COLOR_ATTACHMENT<i>_EXT (see caption)
-    DEPTH_ATTACHMENT
-    STENCIL_ATTACHMENT
-
-    Table 4.x: Framebuffer attachment points. <i> in COLOR_ATTACHMENT<i>_EXT
-    may range from zero to the value of MAX_COLOR_ATTACHMENTS_EXT minus 1.
-
-    Modify the third sentence of the paragraph following the definition of
-    FramebufferRenderbuffer to be as follows:
-
-    "<attachment> should be set to one of the attachment points of the 
-    framebuffer listed in Table 4.x." 
-
-    Modify Section 4.4.3 (Renderbuffer Objects) in the "Attaching Texture
-    Images to a Framebuffer" subsection as follows:
-
-    Modify the last sentence of the paragraph following the definition of
-    FramebufferTexture2D to be as follows:
-
-    "<attachment> must be one of the attachment points of the framebuffer
-    listed in Table 4.x."
-
-    Modify Section 4.4.5 (Framebuffer Completeness) and replace the 3rd
-    item in the bulleted list in the "Framebuffer Attachment Completeness"
-    subsection with the following:
-
-    " * If <attachment> is COLOR_ATTACHMENT<i>_EXT, then <image> must
-    have a color-renderable internal format."
-
-Changes to Chapter 6 of the OpenGL ES 2.0 Specification (State and
-State Requests)
-
-    In section 6.1.3 (Enumerated Queries) modify the third sentence in
-    the definition of GetFramebufferAttachmentParameteriv to be as follows:
-
-    "<attachment> must be one of the attachment points of the framebuffer
-    listed in Table 4.x."
-
-Changes to Chapter 3 of the OpenGL ES Shading Language 1.0.17 Specification (Basics)
-
-    Add a new section:
-
-    3.4.1 GL_EXT_draw_buffers Extension
-
-    To use the GL_EXT_draw_buffers extension in a shader it
-    must be enabled using the #extension directive.
-
-    The shading language preprocessor #define
-    GL_EXT_draw_buffers will be defined to 1, if the
-    GL_EXT_draw_buffers extension is supported.
-
-Dependencies on ANGLE_framebuffer_blit and APPLE_framebuffer_multisample:
-
-    If neither ANGLE_framebuffer_blit nor APPLE_framebuffer_multisample are
-    supported, then all references to "draw framebuffers" should be replaced
-    with references to "framebuffers". References to DRAW_FRAMEBUFFER_BINDING
-    should be replaced with references to FRAMEBUFFER_BINDING. References to
-    DRAW_FRAMEBUFFER and READ_FRAMEBUFFER should be removed.
-
-    If ANGLE_framebuffer_blit is supported, DRAW_FRAMEBUFFER_BINDING, DRAW_FRAMEBUFFER
-    and READ_FRAMEBUFFER all refer to corresponding _ANGLE suffixed names
-    (they have the same token values).
-
-    If APPLE_framebuffer_multisample is supported, DRAW_FRAMEBUFFER_BINDING,
-    DRAW_FRAMEBUFFER and READ_FRAMEBUFFER all refer to the corresponding _APPLE
-    suffixed names (they have the same token values).
-
-Errors
-
-    The INVALID_OPERATION error is generated if DrawBuffersEXT is called
-    when the default framebuffer is bound and any of the following conditions
-    hold: 
-     - <n> is greater than 1 and less than MAX_DRAW_BUFFERS_EXT,
-     - <bufs> contains a value other than BACK or NONE.
-
-    The INVALID_OPERATION error is generated if DrawBuffersEXT is called
-    when bound to a draw framebuffer object and any of the following
-    conditions hold:
-     - the <i>th value in <bufs> is not COLOR_ATTACHMENT<i>_EXT or NONE.
-
-    The INVALID_VALUE error is generated if DrawBuffersEXT is called
-    with a value of <n> which is greater than MAX_DRAW_BUFFERS_EXT.
-
-    The INVALID_ENUM error is generated by FramebufferRenderbuffer if
-    the <attachment> parameter is not one of the values listed in Table 4.x.
-
-    The INVALID_ENUM error is generated by FramebufferTexture2D if
-    the <attachment> parameter is not one of the values listed in Table 4.x.
-
-    The INVALID_ENUM error is generated by GetFramebufferAttachmentParameteriv
-    if the <attachment> parameter is not one of the values listed in Table 4.x.
-
-New State
-
-    Add Table 6.X Framebuffer (State per framebuffer object):
-
-    State               Type Get Command  Initial Value Description 
-    ------------------  ---- ------------ ------------- -----------
-    DRAW_BUFFER<i>_EXT  Z10* GetIntegerv  see 4.2.1     Draw buffer selected 
-							  for fragment color i
-
-    Add to Table 6.18 (Implementation Dependent Values)
-
-    Get value                 Type Get Cmnd    Minimum Value Description             Sec.
-    --------------------      ---- ----------- ------------- -----------             -----
-    MAX_DRAW_BUFFERS_EXT      Z+   GetIntegerv 1             Maximum number of       4.2.1
-                                                             active draw buffers
-    MAX_COLOR_ATTACHMENTS_EXT Z+   GetIntegerv 1             Number of framebuffer   4.4.1
-                                                             color attachment points
-Issues
-
-    See ARB_draw_buffers for relevant issues.
-
-  1) What are the differences between this extension and NV_draw_buffers
-    + NV_fbo_color_attachments?
-
-    RESOLVED. This extension:
-     - adds interactions with blit_framebuffer and the separate 
-       draw/read binding points
-     - The draw buffer and color attachment limits are global instead
-       of per-fbo (see Issue 2)
-     - can be used to with default framebuffer to set NONE/BACK (see Issue 4)
-     - retains the ordering restrictions on color attachments that are 
-       imposed by ES 3.0.
-
-   2) Should the MAX_DRAW_BUFFERS_EXT and MAX_COLOR_ATTACHMENTS_EXT limits
-    be per-framebuffer values or implementation dependent constants?
-
-    DISCUSSION: In ARB_draw_buffers this was per-context (see Issue 2).
-    EXT_framebuffer_object (and subsequently ARB_framebuffer_object, and GL 3.0
-    through GL 4.2) made these queries framebuffer-dependent. 
-    However in GL 4.3 and GLES 3.0, these limits were changed from 
-    framebuffer-dependent state to implementation-dependent state after
-    much discussion (Bug 7990).
-
-    NV_draw_buffers has MAX_DRAW_BUFFERS listed as per-framebuffer state,
-    but NV_fbo_color_attachments has MAX_COLOR_ATTACHMENTS as an 
-    implementation-dependent constant.
-
-    This is relevant because some implementations are not able to support 
-    multisampling in conjuction with multiple color attachments.  If the
-    query is per-framebuffer, they can report a maximum of one attachment
-    when there are multisampled attachments, but a higher limit when only
-    single-sampled attachments are present.
-
-    RESOLVED. Make this global context state as this is most consistent 
-    with GLES 3.0 and updated GL drivers. In an implementation cannot
-    support multisampling in conjunction with multiple color attachments,
-    perhaps such an implementation could report FBO incomplete in this 
-    situation, but this is less than desirable.
-
-   3) Should we support broadcast from gl_FragColor to all gl_FragData[x]
-    or should it be synonymous with gl_FragData[0]?
-
-    DISCUSSION: With NV_draw_buffers, writing to gl_FragColor writes to all
-    the enabled draw buffers (ie broadcast). In OpenGL ES 3.0 when using 
-    ESSL 1.0, gl_FragColor is equivalent to writing a single output to 
-    gl_FragData[0] and multiple outputs are not possible. When using ESSL 3.0,
-    only user-defined out variables may be used.
-
-    If broadcast is supported, some implementations may have to replace
-    writes to gl_FragColor with replicated writes to all possible gl_FragData
-    locations when this extension is enabled.
-
-    RESOLVED: Writes to gl_FragColor are broadcast to all enabled color
-    buffers. ES 3.0 using ESSL 1.0 doesn't support broadcast because
-    ESSL 1.0 was not extended to have multiple color outputs (but that is
-    what this extension adds). ESSL 3.0 doesn't support the broadcast because
-    it doesn't have the gl_FragColor variable at all, and only has user-
-    defined out variables. This extension extends ESSL 1.0 to have multiple
-    color outputs. Broadcasting from gl_FragColor to all enabled color 
-    buffers is the most consistent with existing draw buffer extensions to
-    date (both NV_draw_buffers and desktop GL).
-    
-   4) Should we allow DrawBuffersEXT to be called when the default FBO is
-    bound?
-
-    DISCUSSION: NV_draw_buffers specifies that DrawBuffersNV errors with 
-    INVALID_OPERATION when the default FBO is bound. OpenGL ES 3.0 allows
-    DrawBuffers to toggle between BACK and NONE on the default FBO.
-
-    An implementation that does not natively support disabling the drawbuffer
-    on the default FBO could emulate this by disabling color writes.
-
-    RESOLVED: Allow DrawBuffersEXT to be called for the default FBO. This
-    is more forward looking and is compatible with ES 3.0.
-
-   5) What are the requirements on the color attachment sizes and formats?
-    
-    RESOLVED: ES 2.0 requires that all color buffers attached to application-
-    created framebuffer objects must have the same number of bitplanes
-    (Chapter 4 overview p91). ES 2.0 also requires that all attached images
-    have the same width and height (Section 4.4.5 Framebuffer Completeness).
-    This extension does not lift those requirements, and failing to meet
-    them will result in an incomplete FBO.
-
-   6) Does this have any interactions with glClear?
-
-    RESOLVED: Yes. When multiple color buffers are enabled for writing,
-    glClear clears all of the color buffers.  Added language clarifying
-    that glClear and glClearColor may affect multiple color buffers.
-
-Revision History
-
-    01/30/2013  dgkoch  add issue 6 and clear interactions
-                        renamed to EXT_draw_buffers based on feedback
-                        changed resolution of issue 3.
-    01/23/2013  dgkoch  add resolutions to issues 2-4.
-                        add issue 5.
-                        Add Table 4.x and update various explicit
-                        references to COLOR_ATTACHMENT0.
-                        Add errors.
-    11/13/2012  dgkoch  add revision history
-                        add text from updated ES 3.0 spec
-                        add issues for discussion
-    10/16/2012  kbr     update name string
-    10/16/2012  kbr     remove restrition requiring draw buffer 0 to be non-NULL
-    10/12/2012  kbr     remove references to GetDoublev and ReadBuffer
-    10/11/2012  kbr     initial draft extension
-
--- a/gfx/angle/include/GLSLANG/ShaderLang.h
+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
@@ -19,30 +19,29 @@
 #define COMPILER_EXPORT __attribute__((visibility("default")))
 #endif
 
 #else  // defined(COMPONENT_BUILD)
 #define COMPILER_EXPORT
 #endif
 
 #include "khrplatform.h"
-#include <stddef.h>
 
 //
 // This is the platform independent interface between an OGL driver
 // and the shading language compiler.
 //
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 // Version number for shader translation API.
 // It is incremented everytime the API changes.
-#define ANGLE_SH_VERSION 110
+#define SH_VERSION 107
 
 //
 // The names of the following enums have been derived by replacing GL prefix
 // with SH. For example, SH_INFO_LOG_LENGTH is equivalent to GL_INFO_LOG_LENGTH.
 // The enum values are also equal to the values of their GL counterpart. This
 // is done to make it easier for applications to use the shader library.
 //
 typedef enum {
@@ -151,46 +150,35 @@ typedef enum {
   SH_DEPENDENCY_GRAPH = 0x0400,
 
   // Enforce the GLSL 1.017 Appendix A section 7 packing restrictions.
   SH_ENFORCE_PACKING_RESTRICTIONS = 0x0800,
 
   // This flag ensures all indirect (expression-based) array indexing
   // is clamped to the bounds of the array. This ensures, for example,
   // that you cannot read off the end of a uniform, whether an array
-  // vec234, or mat234 type. The ShArrayIndexClampingStrategy enum,
-  // specified in the ShBuiltInResources when constructing the
-  // compiler, selects the strategy for the clamping implementation.
+  // vec234, or mat234 type.
   SH_CLAMP_INDIRECT_ARRAY_BOUNDS = 0x1000
 } ShCompileOptions;
 
-// Defines alternate strategies for implementing array index clamping.
-typedef enum {
-  // Use the clamp intrinsic for array index clamping.
-  SH_CLAMP_WITH_CLAMP_INTRINSIC = 1,
-
-  // Use a user-defined function for array index clamping.
-  SH_CLAMP_WITH_USER_DEFINED_INT_CLAMP_FUNCTION
-} ShArrayIndexClampingStrategy;
-
 //
 // Driver must call this first, once, before doing any other
 // compiler operations.
 // If the function succeeds, the return value is nonzero, else zero.
 //
 COMPILER_EXPORT int ShInitialize();
 //
 // Driver should call this at shutdown.
 // If the function succeeds, the return value is nonzero, else zero.
 //
 COMPILER_EXPORT int ShFinalize();
 
 // The 64 bits hash function. The first parameter is the input string; the
 // second parameter is the string length.
-typedef khronos_uint64_t (*ShHashFunction64)(const char*, size_t);
+typedef khronos_uint64_t (*ShHashFunction64)(const char*, unsigned int);
 
 //
 // Implementation dependent built-in resources (constants and extensions).
 // The names for these resources has been obtained by stripping gl_/GL_.
 //
 typedef struct
 {
     // Constants.
@@ -203,30 +191,21 @@ typedef struct
     int MaxFragmentUniformVectors;
     int MaxDrawBuffers;
 
     // Extensions.
     // Set to 1 to enable the extension, else 0.
     int OES_standard_derivatives;
     int OES_EGL_image_external;
     int ARB_texture_rectangle;
-    int EXT_draw_buffers;
-
-    // Set to 1 if highp precision is supported in the fragment language.
-    // Default is 0.
-    int FragmentPrecisionHigh;
 
     // Name Hashing.
     // Set a 64 bit hash function to enable user-defined name hashing.
     // Default is NULL.
     ShHashFunction64 HashFunction;
-
-    // Selects a strategy to use when implementing array index clamping.
-    // Default is SH_CLAMP_WITH_CLAMP_INTRINSIC.
-    ShArrayIndexClampingStrategy ArrayIndexClampingStrategy;
 } ShBuiltInResources;
 
 //
 // Initialize built-in resources with minimum expected values.
 //
 COMPILER_EXPORT void ShInitBuiltInResources(ShBuiltInResources* resources);
 
 //
@@ -280,17 +259,17 @@ COMPILER_EXPORT void ShDestruct(ShHandle
 //                 Can be queried by calling ShGetObjectCode().
 // SH_ATTRIBUTES_UNIFORMS: Extracts attributes and uniforms.
 //                         Can be queried by calling ShGetActiveAttrib() and
 //                         ShGetActiveUniform().
 //
 COMPILER_EXPORT int ShCompile(
     const ShHandle handle,
     const char* const shaderStrings[],
-    size_t numStrings,
+    const int numStrings,
     int compileOptions
     );
 
 // Returns a parameter from a compiled shader.
 // Parameters:
 // handle: Specifies the compiler
 // pname: Specifies the parameter to query.
 // The following parameters are defined:
@@ -308,21 +287,21 @@ COMPILER_EXPORT int ShCompile(
 //                               termination character.
 // SH_MAPPED_NAME_MAX_LENGTH: the length of the mapped variable name including
 //                            the null termination character.
 // SH_NAME_MAX_LENGTH: the max length of a user-defined name including the
 //                     null termination character.
 // SH_HASHED_NAME_MAX_LENGTH: the max length of a hashed name including the
 //                            null termination character.
 // SH_HASHED_NAMES_COUNT: the number of hashed names from the latest compile.
-//
+// 
 // params: Requested parameter
 COMPILER_EXPORT void ShGetInfo(const ShHandle handle,
                                ShShaderInfo pname,
-                               size_t* params);
+                               int* params);
 
 // Returns nul-terminated information log for a compiled shader.
 // Parameters:
 // handle: Specifies the compiler
 // infoLog: Specifies an array of characters that is used to return
 //          the information log. It is assumed that infoLog has enough memory
 //          to accomodate the information log. The size of the buffer required
 //          to store the returned information log can be obtained by calling
@@ -355,17 +334,17 @@ COMPILER_EXPORT void ShGetObjectCode(con
 //       calling ShGetInfo with SH_ACTIVE_ATTRIBUTE_MAX_LENGTH.
 // mappedName: Returns a null terminated string containing the mapped name of
 //             the attribute variable, It is assumed that mappedName has enough
 //             memory (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care
 //             about the mapped name. If the name is not mapped, then name and
 //             mappedName are the same.
 COMPILER_EXPORT void ShGetActiveAttrib(const ShHandle handle,
                                        int index,
-                                       size_t* length,
+                                       int* length,
                                        int* size,
                                        ShDataType* type,
                                        char* name,
                                        char* mappedName);
 
 // Returns information about an active uniform variable.
 // Parameters:
 // handle: Specifies the compiler
@@ -382,17 +361,17 @@ COMPILER_EXPORT void ShGetActiveAttrib(c
 //       ShGetInfo with SH_ACTIVE_UNIFORMS_MAX_LENGTH.
 // mappedName: Returns a null terminated string containing the mapped name of
 //             the uniform variable, It is assumed that mappedName has enough
 //             memory (SH_MAPPED_NAME_MAX_LENGTH), or NULL if don't care
 //             about the mapped name. If the name is not mapped, then name and
 //             mappedName are the same.
 COMPILER_EXPORT void ShGetActiveUniform(const ShHandle handle,
                                         int index,
-                                        size_t* length,
+                                        int* length,
                                         int* size,
                                         ShDataType* type,
                                         char* name,
                                         char* mappedName);
 
 // Returns information about a name hashing entry from the latest compile.
 // Parameters:
 // handle: Specifies the compiler
--- a/gfx/angle/src/build_angle.gypi
+++ b/gfx/angle/src/build_angle.gypi
@@ -4,31 +4,30 @@
 
 {
   'variables': {
     'angle_code': 1,
   },
   'target_defaults': {
     'defines': [
       'ANGLE_DISABLE_TRACE',
-      'ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1',
-      'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ TEXT("d3dcompiler_46.dll"), TEXT("d3dcompiler_43.dll") }',
+      'ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES={ L"d3dcompiler_46.dll", L"d3dcompiler_43.dll" }',
     ],
   },
   'targets': [
     {
       'target_name': 'preprocessor',
       'type': 'static_library',
       'include_dirs': [
       ],
       'sources': [
-        'compiler/preprocessor/DiagnosticsBase.cpp',
-        'compiler/preprocessor/DiagnosticsBase.h',
-        'compiler/preprocessor/DirectiveHandlerBase.cpp',
-        'compiler/preprocessor/DirectiveHandlerBase.h',
+        'compiler/preprocessor/Diagnostics.cpp',
+        'compiler/preprocessor/Diagnostics.h',
+        'compiler/preprocessor/DirectiveHandler.cpp',
+        'compiler/preprocessor/DirectiveHandler.h',
         'compiler/preprocessor/DirectiveParser.cpp',
         'compiler/preprocessor/DirectiveParser.h',
         'compiler/preprocessor/ExpressionParser.cpp',
         'compiler/preprocessor/ExpressionParser.h',
         'compiler/preprocessor/Input.cpp',
         'compiler/preprocessor/Input.h',
         'compiler/preprocessor/length_limits.h',
         'compiler/preprocessor/Lexer.cpp',
@@ -42,33 +41,31 @@
         'compiler/preprocessor/Preprocessor.cpp',
         'compiler/preprocessor/Preprocessor.h',
         'compiler/preprocessor/SourceLocation.h',
         'compiler/preprocessor/Token.cpp',
         'compiler/preprocessor/Token.h',
         'compiler/preprocessor/Tokenizer.cpp',
         'compiler/preprocessor/Tokenizer.h',
       ],
-      # TODO(jschuh): http://crbug.com/167187
-      'msvs_disabled_warnings': [
-        4267,
-      ],      
     },
     {
       'target_name': 'translator_common',
       'type': 'static_library',
       'dependencies': ['preprocessor'],
       'include_dirs': [
         '.',
         '../include',
       ],
       'defines': [
         'COMPILER_IMPLEMENTATION',
       ],
       'sources': [
+        'compiler/ArrayBoundsClamper.cpp',
+        'compiler/ArrayBoundsClamper.h',
         'compiler/BaseTypes.h',
         'compiler/BuiltInFunctionEmulator.cpp',
         'compiler/BuiltInFunctionEmulator.h',
         'compiler/Common.h',
         'compiler/Compiler.cpp',
         'compiler/ConstantUnion.h',
         'compiler/debug.cpp',
         'compiler/debug.h',
@@ -134,23 +131,19 @@
         'compiler/depgraph/DependencyGraphOutput.cpp',
         'compiler/depgraph/DependencyGraphOutput.h',
         'compiler/depgraph/DependencyGraphTraverse.cpp',
         # Timing restrictions
         'compiler/timing/RestrictFragmentShaderTiming.cpp',
         'compiler/timing/RestrictFragmentShaderTiming.h',
         'compiler/timing/RestrictVertexShaderTiming.cpp',
         'compiler/timing/RestrictVertexShaderTiming.h',
-        'third_party/compiler/ArrayBoundsClamper.cpp',
-        'third_party/compiler/ArrayBoundsClamper.h',
       ],
       'conditions': [
         ['OS=="win"', {
-          # TODO(jschuh): http://crbug.com/167187 size_t -> int
-          'msvs_disabled_warnings': [ 4267 ],
           'sources': ['compiler/ossource_win.cpp'],
         }, { # else: posix
           'sources': ['compiler/ossource_posix.cpp'],
         }],
       ],
     },
     {
       'target_name': 'translator_glsl',
@@ -174,18 +167,16 @@
         'compiler/ShaderLang.cpp',
         'compiler/TranslatorESSL.cpp',
         'compiler/TranslatorESSL.h',
         'compiler/TranslatorGLSL.cpp',
         'compiler/TranslatorGLSL.h',
         'compiler/VersionGLSL.cpp',
         'compiler/VersionGLSL.h',
       ],
-      # TODO(jschuh): http://crbug.com/167187 size_t -> int
-      'msvs_disabled_warnings': [ 4267 ],
     },
   ],
   'conditions': [
     ['OS=="win"', {
       'targets': [
         {
           'target_name': 'translator_hlsl',
           'type': '<(component)',
@@ -206,26 +197,25 @@
             'compiler/OutputHLSL.h',
             'compiler/TranslatorHLSL.cpp',
             'compiler/TranslatorHLSL.h',
             'compiler/UnfoldShortCircuit.cpp',
             'compiler/UnfoldShortCircuit.h',
             'compiler/SearchSymbol.cpp',
             'compiler/SearchSymbol.h',
           ],
-          # TODO(jschuh): http://crbug.com/167187 size_t -> int
-          'msvs_disabled_warnings': [ 4267 ],
         },
         {
           'target_name': 'libGLESv2',
           'type': 'shared_library',
           'dependencies': ['translator_hlsl'],
           'include_dirs': [
             '.',
             '../include',
+            '$(DXSDK_DIR)/include',
           ],
           'sources': [
             'common/angleutils.h',
             'common/debug.cpp',
             'common/debug.h',
             'common/RefCountObject.cpp',
             'common/RefCountObject.h',
             'common/version.h',
@@ -269,33 +259,33 @@
             'libGLESv2/Shader.cpp',
             'libGLESv2/Shader.h',
             'libGLESv2/Texture.cpp',
             'libGLESv2/TextureSSE2.cpp',
             'libGLESv2/Texture.h',
             'libGLESv2/utilities.cpp',
             'libGLESv2/utilities.h',
           ],
-          # TODO(jschuh): http://crbug.com/167187 size_t -> int
-          'msvs_disabled_warnings': [ 4267 ],
           'msvs_settings': {
             'VCLinkerTool': {
+              'AdditionalLibraryDirectories': ['$(DXSDK_DIR)/lib/x86'],
               'AdditionalDependencies': [
                 'd3d9.lib',
               ],
             }
           },
         },
         {
           'target_name': 'libEGL',
           'type': 'shared_library',
           'dependencies': ['libGLESv2'],
           'include_dirs': [
             '.',
             '../include',
+            '$(DXSDK_DIR)/include',
           ],
           'sources': [
             'common/angleutils.h',
             'common/debug.cpp',
             'common/debug.h',
             'common/RefCountObject.cpp',
             'common/RefCountObject.h',
             'common/version.h',
@@ -306,24 +296,27 @@
             'libEGL/libEGL.cpp',
             'libEGL/libEGL.def',
             'libEGL/libEGL.rc',
             'libEGL/main.cpp',
             'libEGL/main.h',
             'libEGL/Surface.cpp',
             'libEGL/Surface.h',
           ],
-          # TODO(jschuh): http://crbug.com/167187 size_t -> int
-          'msvs_disabled_warnings': [ 4267 ],
           'msvs_settings': {
             'VCLinkerTool': {
+              'AdditionalLibraryDirectories': ['$(DXSDK_DIR)/lib/x86'],
               'AdditionalDependencies': [
                 'd3d9.lib',
                 'dxguid.lib',
+                'dwmapi.lib',
               ],
+              'DelayLoadDLLs': [
+                'dwmapi.dll',
+              ]
             }
           },
         },
       ],
     }],
   ],
 }
 
--- a/gfx/angle/src/common/debug.cpp
+++ b/gfx/angle/src/common/debug.cpp
@@ -5,19 +5,18 @@
 //
 
 // debug.cpp: Debugging utilities.
 
 #include "common/debug.h"
 
 #include <stdio.h>
 #include <stdarg.h>
-
-#include "common/system.h"
 #include <d3d9.h>
+#include <windows.h>
 
 namespace gl
 {
 
 typedef void (WINAPI *PerfOutputFunction)(D3DCOLOR, LPCWSTR);
 
 static void output(bool traceFileDebugOnly, PerfOutputFunction perfFunc, const char *format, va_list vararg)
 {
deleted file mode 100644
--- a/gfx/angle/src/common/system.h
+++ /dev/null
@@ -1,30 +0,0 @@
-//
-// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// system.h: Includes Windows system headers and undefines macros that conflict.
-
-#ifndef COMMON_SYSTEM_H
-#define COMMON_SYSTEM_H
-
-#if !defined(WIN32_LEAN_AND_MEAN)
-#define WIN32_LEAN_AND_MEAN
-#endif
-
-#include <windows.h>
-#include <d3d9.h>
-#include <D3Dcompiler.h>
-#include <d3d9types.h>
-#include <mmsystem.h>
-
-#if defined(min)
-#undef min
-#endif
-
-#if defined(max)
-#undef max
-#endif
-
-#endif   // COMMON_SYSTEM_H
--- a/gfx/angle/src/common/version.h
+++ b/gfx/angle/src/common/version.h
@@ -1,12 +1,10 @@
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 2040
+#define BUILD_REVISION 1560
 
 #define STRINGIFY(x) #x
 #define MACRO_STRINGIFY(x) STRINGIFY(x)
 
 #define REVISION_STRING MACRO_STRINGIFY(BUILD_REVISION)
 #define VERSION_STRING MACRO_STRINGIFY(MAJOR_VERSION) "." MACRO_STRINGIFY(MINOR_VERSION) "." MACRO_STRINGIFY(BUILD_VERSION) "." MACRO_STRINGIFY(BUILD_REVISION)
-
-#define VERSION_DWORD ((MAJOR_VERSION << 24) | (MINOR_VERSION << 16) | BUILD_REVISION)
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/ArrayBoundsClamper.cpp
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "compiler/ArrayBoundsClamper.h"
+
+const char* kIntClampBegin = "// BEGIN: Generated code for array bounds clamping\n\n";
+const char* kIntClampEnd = "// END: Generated code for array bounds clamping\n\n";
+const char* kIntClampDefinition = "int webgl_int_clamp(int value, int minValue, int maxValue) { return ((value < minValue) ? minValue : ((value > maxValue) ? maxValue : value)); }\n\n";
+
+namespace {
+
+class ArrayBoundsClamperMarker : public TIntermTraverser {
+public:
+    ArrayBoundsClamperMarker()
+        : mNeedsClamp(false)
+   {
+   }
+
+   virtual bool visitBinary(Visit visit, TIntermBinary* node)
+   {
+       if (node->getOp() == EOpIndexIndirect)
+       {
+           TIntermTyped* left = node->getLeft();
+           if (left->isArray() || left->isVector() || left->isMatrix())
+           {
+               node->setAddIndexClamp();
+               mNeedsClamp = true;
+           }
+       }
+       return true;
+   }
+
+    bool GetNeedsClamp() { return mNeedsClamp; }
+
+private:
+    bool mNeedsClamp;
+};
+
+}  // anonymous namespace
+
+ArrayBoundsClamper::ArrayBoundsClamper()
+    : mArrayBoundsClampDefinitionNeeded(false)
+{
+}
+
+void ArrayBoundsClamper::OutputClampingFunctionDefinition(TInfoSinkBase& out) const
+{
+    if (!mArrayBoundsClampDefinitionNeeded)
+    {
+        return;
+    }
+    out << kIntClampBegin << kIntClampDefinition << kIntClampEnd;
+}
+
+void ArrayBoundsClamper::MarkIndirectArrayBoundsForClamping(TIntermNode* root)
+{
+    ASSERT(root);
+
+    ArrayBoundsClamperMarker clamper;
+    root->traverse(&clamper);
+    if (clamper.GetNeedsClamp())
+    {
+        SetArrayBoundsClampDefinitionNeeded();
+    }
+}
+
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/ArrayBoundsClamper.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2012 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef COMPILER_ARRAY_BOUNDS_CLAMPER_H_
+#define COMPILER_ARRAY_BOUNDS_CLAMPER_H_
+
+#include "GLSLANG/ShaderLang.h"
+
+#include "compiler/InfoSink.h"
+#include "compiler/intermediate.h"
+
+class ArrayBoundsClamper {
+public:
+    ArrayBoundsClamper();
+
+    // Output array clamp function source into the shader source.
+    void OutputClampingFunctionDefinition(TInfoSinkBase& out) const;
+
+    // Marks nodes in the tree that index arrays indirectly as
+    // requiring clamping.
+    void MarkIndirectArrayBoundsForClamping(TIntermNode* root);
+
+    void Cleanup()
+    {
+        mArrayBoundsClampDefinitionNeeded = false;
+    }
+
+private:
+    bool GetArrayBoundsClampDefinitionNeeded() const { return mArrayBoundsClampDefinitionNeeded; }
+    void SetArrayBoundsClampDefinitionNeeded() { mArrayBoundsClampDefinitionNeeded = true; }
+    
+    bool mArrayBoundsClampDefinitionNeeded;
+};
+
+#endif // COMPILER_ARRAY_BOUNDS_CLAMPER_H_
--- a/gfx/angle/src/compiler/BaseTypes.h
+++ b/gfx/angle/src/compiler/BaseTypes.h
@@ -11,17 +11,17 @@
 // Precision qualifiers
 //
 enum TPrecision
 {
     // These need to be kept sorted
     EbpUndefined,
     EbpLow,
     EbpMedium,
-    EbpHigh
+    EbpHigh,
 };
 
 inline const char* getPrecisionString(TPrecision p)
 {
     switch(p)
     {
     case EbpHigh:		return "highp";		break;
     case EbpMedium:		return "mediump";	break;
@@ -42,17 +42,17 @@ enum TBasicType
     EbtGuardSamplerBegin,  // non type:  see implementation of IsSampler()
     EbtSampler2D,
     EbtSamplerCube,
     EbtSamplerExternalOES,  // Only valid if OES_EGL_image_external exists.
     EbtSampler2DRect,       // Only valid if GL_ARB_texture_rectangle exists.
     EbtGuardSamplerEnd,    // non type:  see implementation of IsSampler()
     EbtStruct,
     EbtAddress,            // should be deprecated??
-    EbtInvariant          // used as a type when qualifying a previously declared variable as being invariant
+    EbtInvariant,          // used as a type when qualifying a previously declared variable as being invariant
 };
 
 inline const char* getBasicString(TBasicType t)
 {
     switch (t)
     {
     case EbtVoid:              return "void";              break;
     case EbtFloat:             return "float";             break;
@@ -109,17 +109,17 @@ enum TQualifier
     EvqFrontFacing,
     EvqPointCoord,
 
     // built-ins written by fragment shader
     EvqFragColor,
     EvqFragData,
 
     // end of list
-    EvqLast
+    EvqLast,
 };
 
 //
 // This is just for debug print out, carried along with the definitions above.
 //
 inline const char* getQualifierString(TQualifier q)
 {
     switch(q)
--- a/gfx/angle/src/compiler/Compiler.cpp
+++ b/gfx/angle/src/compiler/Compiler.cpp
@@ -1,30 +1,30 @@
 //
 // Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
+#include "compiler/ArrayBoundsClamper.h"
 #include "compiler/BuiltInFunctionEmulator.h"
 #include "compiler/DetectRecursion.h"
 #include "compiler/ForLoopUnroll.h"
 #include "compiler/Initialize.h"
 #include "compiler/InitializeParseContext.h"
 #include "compiler/MapLongVariableNames.h"
 #include "compiler/ParseHelper.h"
 #include "compiler/RenameFunction.h"
 #include "compiler/ShHandle.h"
 #include "compiler/ValidateLimitations.h"
 #include "compiler/VariablePacker.h"
 #include "compiler/depgraph/DependencyGraph.h"
 #include "compiler/depgraph/DependencyGraphOutput.h"
 #include "compiler/timing/RestrictFragmentShaderTiming.h"
 #include "compiler/timing/RestrictVertexShaderTiming.h"
-#include "third_party/compiler/ArrayBoundsClamper.h"
 
 bool isWebGLBasedSpec(ShShaderSpec spec)
 {
      return spec == SH_WEBGL_SPEC || spec == SH_CSS_SHADERS_SPEC;
 }
 
 namespace {
 bool InitializeSymbolTable(
@@ -33,17 +33,16 @@ bool InitializeSymbolTable(
     TInfoSink& infoSink, TSymbolTable& symbolTable)
 {
     TIntermediate intermediate(infoSink);
     TExtensionBehavior extBehavior;
     InitExtensionBehavior(resources, extBehavior);
     // The builtins deliberately don't specify precisions for the function
     // arguments and return types. For that reason we don't try to check them.
     TParseContext parseContext(symbolTable, extBehavior, intermediate, type, spec, 0, false, NULL, infoSink);
-    parseContext.fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
 
     GlobalParseContext = &parseContext;
 
     assert(symbolTable.isEmpty());       
     //
     // Parse the built-ins.  This should only happen once per
     // language symbol table.
     //
@@ -98,18 +97,16 @@ TShHandleBase::TShHandleBase() {
 TShHandleBase::~TShHandleBase() {
     SetGlobalPoolAllocator(NULL);
     allocator.popAll();
 }
 
 TCompiler::TCompiler(ShShaderType type, ShShaderSpec spec)
     : shaderType(type),
       shaderSpec(spec),
-      fragmentPrecisionHigh(false),
-      clampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC),
       builtInFunctionEmulator(type)
 {
     longNameMap = LongNameMap::GetInstance();
 }
 
 TCompiler::~TCompiler()
 {
     ASSERT(longNameMap);
@@ -122,57 +119,49 @@ bool TCompiler::Init(const ShBuiltInReso
         resources.MaxVertexUniformVectors :
         resources.MaxFragmentUniformVectors;
     TScopedPoolAllocator scopedAlloc(&allocator, false);
 
     // Generate built-in symbol table.
     if (!InitBuiltInSymbolTable(resources))
         return false;
     InitExtensionBehavior(resources, extensionBehavior);
-    fragmentPrecisionHigh = resources.FragmentPrecisionHigh == 1;
-
-    // ArrayIndexClampingStrategy's enum starts at 1, so 0 is 'default'.
-    if (resources.ArrayIndexClampingStrategy) {
-        clampingStrategy = resources.ArrayIndexClampingStrategy;
-    }
-    arrayBoundsClamper.SetClampingStrategy(clampingStrategy);
 
     hashFunction = resources.HashFunction;
 
     return true;
 }
 
 bool TCompiler::compile(const char* const shaderStrings[],
-                        size_t numStrings,
+                        const int numStrings,
                         int compileOptions)
 {
     TScopedPoolAllocator scopedAlloc(&allocator, true);
     clearResults();
 
     if (numStrings == 0)
         return true;
 
     // If compiling for WebGL, validate loop and indexing as well.
     if (isWebGLBasedSpec(shaderSpec))
         compileOptions |= SH_VALIDATE_LOOP_INDEXING;
 
     // First string is path of source file if flag is set. The actual source follows.
     const char* sourcePath = NULL;
-    size_t firstSource = 0;
+    int firstSource = 0;
     if (compileOptions & SH_SOURCE_PATH)
     {
         sourcePath = shaderStrings[0];
         ++firstSource;
     }
 
     TIntermediate intermediate(infoSink);
     TParseContext parseContext(symbolTable, extensionBehavior, intermediate,
                                shaderType, shaderSpec, compileOptions, true,
                                sourcePath, infoSink);
-    parseContext.fragmentPrecisionHigh = fragmentPrecisionHigh;
     GlobalParseContext = &parseContext;
 
     // We preserve symbols at the built-in level from compile-to-compile.
     // Start pushing the user-defined symbols at global level.
     symbolTable.push();
     if (!symbolTable.atGlobalLevel())
         infoSink.info.message(EPrefixInternalError, "Wrong symbol table level");
 
@@ -361,22 +350,18 @@ int TCompiler::getMappedNameMaxLength() 
     return MAX_SHORTENED_IDENTIFIER_SIZE + 1;
 }
 
 const TExtensionBehavior& TCompiler::getExtensionBehavior() const
 {
     return extensionBehavior;
 }
 
+const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const
+{
+    return builtInFunctionEmulator;
+}
+
 const ArrayBoundsClamper& TCompiler::getArrayBoundsClamper() const
 {
     return arrayBoundsClamper;
 }
 
-ShArrayIndexClampingStrategy TCompiler::getArrayIndexClampingStrategy() const
-{
-    return clampingStrategy;
-}
-
-const BuiltInFunctionEmulator& TCompiler::getBuiltInFunctionEmulator() const
-{
-    return builtInFunctionEmulator;
-}
--- a/gfx/angle/src/compiler/ConstantUnion.h
+++ b/gfx/angle/src/compiler/ConstantUnion.h
@@ -1,25 +1,24 @@
 //
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #ifndef _CONSTANT_UNION_INCLUDED_
 #define _CONSTANT_UNION_INCLUDED_
 
 #include <assert.h>
 
 class ConstantUnion {
 public:
     ConstantUnion()
     {
         iConst = 0;
-        type = EbtVoid;
     }
 
     POOL_ALLOCATOR_NEW_DELETE(GlobalPoolAllocator)        
     void setIConst(int i) {iConst = i; type = EbtInt; }
     void setFConst(float f) {fConst = f; type = EbtFloat; }
     void setBConst(bool b) {bConst = b; type = EbtBool; }
 
     int getIConst() { return iConst; }
--- a/gfx/angle/src/compiler/DetectDiscontinuity.cpp
+++ b/gfx/angle/src/compiler/DetectDiscontinuity.cpp
@@ -11,56 +11,36 @@
 #include "compiler/DetectDiscontinuity.h"
 
 #include "compiler/ParseHelper.h"
 
 namespace sh
 {
 bool DetectLoopDiscontinuity::traverse(TIntermNode *node)
 {
-    mLoopDepth = 0;
     mLoopDiscontinuity = false;
     node->traverse(this);
     return mLoopDiscontinuity;
 }
 
-bool DetectLoopDiscontinuity::visitLoop(Visit visit, TIntermLoop *loop)
-{
-    if (visit == PreVisit)
-    {
-        ++mLoopDepth;
-    }
-    else if (visit == PostVisit)
-    {
-        --mLoopDepth;
-    }
-
-    return true;
-}
-
 bool DetectLoopDiscontinuity::visitBranch(Visit visit, TIntermBranch *node)
 {
     if (mLoopDiscontinuity)
     {
         return false;
     }
 
-    if (!mLoopDepth)
-    {
-        return true;
-    }
-
     switch (node->getFlowOp())
     {
       case EOpKill:
         break;
       case EOpBreak:
       case EOpContinue:
+        mLoopDiscontinuity = true;
       case EOpReturn:
-        mLoopDiscontinuity = true;
         break;
       default: UNREACHABLE();
     }
 
     return !mLoopDiscontinuity;
 }
 
 bool DetectLoopDiscontinuity::visitAggregate(Visit visit, TIntermAggregate *node)
--- a/gfx/angle/src/compiler/DetectDiscontinuity.h
+++ b/gfx/angle/src/compiler/DetectDiscontinuity.h
@@ -18,20 +18,18 @@ namespace sh
 // Checks whether a loop can run for a variable number of iterations
 class DetectLoopDiscontinuity : public TIntermTraverser
 {
   public:
     bool traverse(TIntermNode *node);
 
   protected:
     bool visitBranch(Visit visit, TIntermBranch *node);
-    bool visitLoop(Visit visit, TIntermLoop *loop);
     bool visitAggregate(Visit visit, TIntermAggregate *node);
 
-    int mLoopDepth;
     bool mLoopDiscontinuity;
 };
 
 bool containsLoopDiscontinuity(TIntermNode *node);
 
 // Checks for intrinsic functions which compute gradients
 class DetectGradientOperation : public TIntermTraverser
 {
--- a/gfx/angle/src/compiler/Diagnostics.h
+++ b/gfx/angle/src/compiler/Diagnostics.h
@@ -2,17 +2,17 @@
 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #ifndef COMPILER_DIAGNOSTICS_H_
 #define COMPILER_DIAGNOSTICS_H_
 
-#include "compiler/preprocessor/DiagnosticsBase.h"
+#include "compiler/preprocessor/Diagnostics.h"
 
 class TInfoSink;
 
 class TDiagnostics : public pp::Diagnostics
 {
   public:
     TDiagnostics(TInfoSink& infoSink);
     virtual ~TDiagnostics();
--- a/gfx/angle/src/compiler/DirectiveHandler.h
+++ b/gfx/angle/src/compiler/DirectiveHandler.h
@@ -4,17 +4,17 @@
 // found in the LICENSE file.
 //
 
 #ifndef COMPILER_DIRECTIVE_HANDLER_H_
 #define COMPILER_DIRECTIVE_HANDLER_H_
 
 #include "compiler/ExtensionBehavior.h"
 #include "compiler/Pragma.h"
-#include "compiler/preprocessor/DirectiveHandlerBase.h"
+#include "compiler/preprocessor/DirectiveHandler.h"
 
 class TDiagnostics;
 
 class TDirectiveHandler : public pp::DirectiveHandler
 {
   public:
     TDirectiveHandler(TExtensionBehavior& extBehavior,
                       TDiagnostics& diagnostics);
--- a/gfx/angle/src/compiler/ExtensionBehavior.h
+++ b/gfx/angle/src/compiler/ExtensionBehavior.h
@@ -11,17 +11,17 @@
 #include <string>
 
 typedef enum
 {
     EBhRequire,
     EBhEnable,
     EBhWarn,
     EBhDisable,
-    EBhUndefined
+    EBhUndefined,
 } TBehavior;
 
 inline const char* getBehaviorString(TBehavior b)
 {
     switch(b)
     {
       case EBhRequire: return "require";
       case EBhEnable: return "enable";
--- a/gfx/angle/src/compiler/ForLoopUnroll.cpp
+++ b/gfx/angle/src/compiler/ForLoopUnroll.cpp
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/ForLoopUnroll.h"
 
 namespace {
 
@@ -205,11 +205,11 @@ int ForLoopUnroll::getLoopIncrement(TInt
     }
 
     return increment;
 }
 
 int ForLoopUnroll::evaluateIntConstant(TIntermConstantUnion* node)
 {
     ASSERT((node != NULL) && (node->getUnionArrayPointer() != NULL));
-    return node->getIConst(0);
+    return node->getUnionArrayPointer()->getIConst();
 }
 
--- a/gfx/angle/src/compiler/Initialize.cpp
+++ b/gfx/angle/src/compiler/Initialize.cpp
@@ -649,11 +649,9 @@ void InitExtensionBehavior(const ShBuilt
                            TExtensionBehavior& extBehavior)
 {
     if (resources.OES_standard_derivatives)
         extBehavior["GL_OES_standard_derivatives"] = EBhUndefined;
     if (resources.OES_EGL_image_external)
         extBehavior["GL_OES_EGL_image_external"] = EBhUndefined;
     if (resources.ARB_texture_rectangle)
         extBehavior["GL_ARB_texture_rectangle"] = EBhUndefined;
-    if (resources.EXT_draw_buffers)
-        extBehavior["GL_EXT_draw_buffers"] = EBhUndefined;
 }
--- a/gfx/angle/src/compiler/Intermediate.cpp
+++ b/gfx/angle/src/compiler/Intermediate.cpp
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 //
 // Build the intermediate representation.
 //
 
@@ -588,17 +588,17 @@ TIntermAggregate* TIntermediate::makeAgg
 TIntermNode* TIntermediate::addSelection(TIntermTyped* cond, TIntermNodePair nodePair, TSourceLoc line)
 {
     //
     // For compile time constant selections, prune the code and
     // test now.
     //
 
     if (cond->getAsTyped() && cond->getAsTyped()->getAsConstantUnion()) {
-        if (cond->getAsConstantUnion()->getBConst(0) == true)
+        if (cond->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->getBConst() == true)
             return nodePair.node1 ? setAggregateOperator(nodePair.node1, EOpSequence, nodePair.node1->getLine()) : NULL;
         else
             return nodePair.node2 ? setAggregateOperator(nodePair.node2, EOpSequence, nodePair.node2->getLine()) : NULL;
     }
 
     TIntermSelection* node = new TIntermSelection(cond, nodePair.node1, nodePair.node2);
     node->setLine(line);
 
@@ -642,17 +642,17 @@ TIntermTyped* TIntermediate::addSelectio
             return 0;
     }
 
     //
     // See if all the operands are constant, then fold it otherwise not.
     //
 
     if (cond->getAsConstantUnion() && trueBlock->getAsConstantUnion() && falseBlock->getAsConstantUnion()) {
-        if (cond->getAsConstantUnion()->getBConst(0))
+        if (cond->getAsConstantUnion()->getUnionArrayPointer()->getBConst())
             return trueBlock;
         else
             return falseBlock;
     }
 
     //
     // Make a selection node.
     //
@@ -841,17 +841,16 @@ bool TIntermUnary::promote(TInfoSink&)
             return true;
 
         default:
             if (operand->getBasicType() != EbtFloat)
                 return false;
     }
 
     setType(operand->getType());
-    type.setQualifier(EvqTemporary);
 
     return true;
 }
 
 //
 // Establishes the type of the resultant operation, as well as
 // makes the operator the correct one for the operands.
 //
@@ -1158,17 +1157,17 @@ TIntermTyped* TIntermConstantUnion::fold
             case EOpDiv:
                 tempConstArray = new ConstantUnion[objectSize];
                 {// support MSVC++6.0
                     for (int i = 0; i < objectSize; i++) {
                         switch (getType().getBasicType()) {
             case EbtFloat:
                 if (rightUnionArray[i] == 0.0f) {
                     infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", getLine());
-                    tempConstArray[i].setFConst(unionArray[i].getFConst() < 0 ? -FLT_MAX : FLT_MAX);
+                    tempConstArray[i].setFConst(FLT_MAX);
                 } else
                     tempConstArray[i].setFConst(unionArray[i].getFConst() / rightUnionArray[i].getFConst());
                 break;
 
             case EbtInt:
                 if (rightUnionArray[i] == 0) {
                     infoSink.info.message(EPrefixWarning, "Divide by zero error during constant folding", getLine());
                     tempConstArray[i].setIConst(INT_MAX);
@@ -1373,65 +1372,66 @@ TIntermTyped* TIntermConstantUnion::fold
         newNode = new TIntermConstantUnion(tempConstArray, getType());
         newNode->setLine(getLine());
         return newNode;
     }
 }
 
 TIntermTyped* TIntermediate::promoteConstantUnion(TBasicType promoteTo, TIntermConstantUnion* node)
 {
+    ConstantUnion *rightUnionArray = node->getUnionArrayPointer();
     int size = node->getType().getObjectSize();
 
     ConstantUnion *leftUnionArray = new ConstantUnion[size];
 
     for (int i=0; i < size; i++) {
 
         switch (promoteTo) {
             case EbtFloat:
                 switch (node->getType().getBasicType()) {
                     case EbtInt:
-                        leftUnionArray[i].setFConst(static_cast<float>(node->getIConst(i)));
+                        leftUnionArray[i].setFConst(static_cast<float>(rightUnionArray[i].getIConst()));
                         break;
                     case EbtBool:
-                        leftUnionArray[i].setFConst(static_cast<float>(node->getBConst(i)));
+                        leftUnionArray[i].setFConst(static_cast<float>(rightUnionArray[i].getBConst()));
                         break;
                     case EbtFloat:
-                        leftUnionArray[i].setFConst(static_cast<float>(node->getFConst(i)));
+                        leftUnionArray[i] = rightUnionArray[i];
                         break;
                     default:
                         infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine());
                         return 0;
                 }
                 break;
             case EbtInt:
                 switch (node->getType().getBasicType()) {
                     case EbtInt:
-                        leftUnionArray[i].setIConst(static_cast<int>(node->getIConst(i)));
+                        leftUnionArray[i] = rightUnionArray[i];
                         break;
                     case EbtBool:
-                        leftUnionArray[i].setIConst(static_cast<int>(node->getBConst(i)));
+                        leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getBConst()));
                         break;
                     case EbtFloat:
-                        leftUnionArray[i].setIConst(static_cast<int>(node->getFConst(i)));
+                        leftUnionArray[i].setIConst(static_cast<int>(rightUnionArray[i].getFConst()));
                         break;
                     default:
                         infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine());
                         return 0;
                 }
                 break;
             case EbtBool:
                 switch (node->getType().getBasicType()) {
                     case EbtInt:
-                        leftUnionArray[i].setBConst(node->getIConst(i) != 0);
+                        leftUnionArray[i].setBConst(rightUnionArray[i].getIConst() != 0);
                         break;
                     case EbtBool:
-                        leftUnionArray[i].setBConst(node->getBConst(i));
+                        leftUnionArray[i] = rightUnionArray[i];
                         break;
                     case EbtFloat:
-                        leftUnionArray[i].setBConst(node->getFConst(i) != 0.0f);
+                        leftUnionArray[i].setBConst(rightUnionArray[i].getFConst() != 0.0f);
                         break;
                     default:
                         infoSink.info.message(EPrefixInternalError, "Cannot promote", node->getLine());
                         return 0;
                 }
 
                 break;
             default:
--- a/gfx/angle/src/compiler/MapLongVariableNames.cpp
+++ b/gfx/angle/src/compiler/MapLongVariableNames.cpp
@@ -4,17 +4,17 @@
 // found in the LICENSE file.
 //
 
 #include "compiler/MapLongVariableNames.h"
 #include "spooky.h"
 
 namespace {
 
-TString mapLongName(size_t id, const TString& name, bool isGlobal)
+TString mapLongName(int id, const TString& name, bool isGlobal)
 {
     ASSERT(name.size() > MAX_SHORTENED_IDENTIFIER_SIZE);
     TStringStream stream;
     uint64 hash = SpookyHash::Hash64(name.data(), name.length(), 0);
 
     // We want to avoid producing a string with a double underscore,
     // which would be an illegal GLSL identifier. We can assume that the
     // original identifier doesn't have a double underscore, otherwise
@@ -72,17 +72,17 @@ const char* LongNameMap::Find(const char
 }
 
 void LongNameMap::Insert(const char* originalName, const char* mappedName)
 {
     mLongNameMap.insert(std::map<std::string, std::string>::value_type(
         originalName, mappedName));
 }
 
-size_t LongNameMap::Size() const
+int LongNameMap::Size() const
 {
     return mLongNameMap.size();
 }
 
 MapLongVariableNames::MapLongVariableNames(LongNameMap* globalMap)
 {
     ASSERT(globalMap);
     mGlobalMap = globalMap;
@@ -117,13 +117,13 @@ bool MapLongVariableNames::visitLoop(Vis
 }
 
 TString MapLongVariableNames::mapGlobalLongName(const TString& name)
 {
     ASSERT(mGlobalMap);
     const char* mappedName = mGlobalMap->Find(name.c_str());
     if (mappedName != NULL)
         return mappedName;
-    size_t id = mGlobalMap->Size();
+    int id = mGlobalMap->Size();
     TString rt = mapLongName(id, name, true);
     mGlobalMap->Insert(name.c_str(), rt.c_str());
     return rt;
 }
--- a/gfx/angle/src/compiler/MapLongVariableNames.h
+++ b/gfx/angle/src/compiler/MapLongVariableNames.h
@@ -26,17 +26,17 @@ public:
     // Return the mapped name if <originalName, mappedName> is in the map;
     // otherwise, return NULL.
     const char* Find(const char* originalName) const;
 
     // Insert a pair into the map.
     void Insert(const char* originalName, const char* mappedName);
 
     // Return the number of entries in the map.
-    size_t Size() const;
+    int Size() const;
 
 private:
     LongNameMap();
     ~LongNameMap();
 
     size_t refCount;
     std::map<std::string, std::string> mLongNameMap;
 };
--- a/gfx/angle/src/compiler/OutputESSL.cpp
+++ b/gfx/angle/src/compiler/OutputESSL.cpp
@@ -2,21 +2,20 @@
 // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/OutputESSL.h"
 
 TOutputESSL::TOutputESSL(TInfoSinkBase& objSink,
-                         ShArrayIndexClampingStrategy clampingStrategy,
                          ShHashFunction64 hashFunction,
                          NameMap& nameMap,
                          TSymbolTable& symbolTable)
-    : TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable)
+    : TOutputGLSLBase(objSink, hashFunction, nameMap, symbolTable)
 {
 }
 
 bool TOutputESSL::writeVariablePrecision(TPrecision precision)
 {
     if (precision == EbpUndefined)
         return false;
 
--- a/gfx/angle/src/compiler/OutputESSL.h
+++ b/gfx/angle/src/compiler/OutputESSL.h
@@ -8,17 +8,16 @@
 #define CROSSCOMPILERGLSL_OUTPUTESSL_H_
 
 #include "compiler/OutputGLSLBase.h"
 
 class TOutputESSL : public TOutputGLSLBase
 {
 public:
     TOutputESSL(TInfoSinkBase& objSink,
-                ShArrayIndexClampingStrategy clampingStrategy,
                 ShHashFunction64 hashFunction,
                 NameMap& nameMap,
                 TSymbolTable& symbolTable);
 
 protected:
     virtual bool writeVariablePrecision(TPrecision precision);
 };
 
--- a/gfx/angle/src/compiler/OutputGLSL.cpp
+++ b/gfx/angle/src/compiler/OutputGLSL.cpp
@@ -2,20 +2,19 @@
 // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/OutputGLSL.h"
 
 TOutputGLSL::TOutputGLSL(TInfoSinkBase& objSink,
-                         ShArrayIndexClampingStrategy clampingStrategy,
                          ShHashFunction64 hashFunction,
                          NameMap& nameMap,
                          TSymbolTable& symbolTable)
-    : TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable)
+    : TOutputGLSLBase(objSink, hashFunction, nameMap, symbolTable)
 {
 }
 
 bool TOutputGLSL::writeVariablePrecision(TPrecision)
 {
     return false;
 }
--- a/gfx/angle/src/compiler/OutputGLSL.h
+++ b/gfx/angle/src/compiler/OutputGLSL.h
@@ -8,17 +8,16 @@
 #define CROSSCOMPILERGLSL_OUTPUTGLSL_H_
 
 #include "compiler/OutputGLSLBase.h"
 
 class TOutputGLSL : public TOutputGLSLBase
 {
 public:
     TOutputGLSL(TInfoSinkBase& objSink,
-                ShArrayIndexClampingStrategy clampingStrategy,
                 ShHashFunction64 hashFunction,
                 NameMap& nameMap,
                 TSymbolTable& symbolTable);
 
 protected:
     virtual bool writeVariablePrecision(TPrecision);
 };
 
--- a/gfx/angle/src/compiler/OutputGLSLBase.cpp
+++ b/gfx/angle/src/compiler/OutputGLSLBase.cpp
@@ -2,18 +2,16 @@
 // Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/OutputGLSLBase.h"
 #include "compiler/compiler_debug.h"
 
-#include <cfloat>
-
 namespace
 {
 TString arrayBrackets(const TType& type)
 {
     ASSERT(type.isArray());
     TInfoSinkBase out;
     out << "[" << type.getArraySize() << "]";
     return TString(out.c_str());
@@ -35,24 +33,22 @@ bool isSingleStatement(TIntermNode* node
     {
         return false;
     }
     return true;
 }
 }  // namespace
 
 TOutputGLSLBase::TOutputGLSLBase(TInfoSinkBase& objSink,
-                                 ShArrayIndexClampingStrategy clampingStrategy,
                                  ShHashFunction64 hashFunction,
                                  NameMap& nameMap,
                                  TSymbolTable& symbolTable)
     : TIntermTraverser(true, true, true),
       mObjSink(objSink),
       mDeclaringVariables(false),
-      mClampingStrategy(clampingStrategy),
       mHashFunction(hashFunction),
       mNameMap(nameMap),
       mSymbolTable(symbolTable)
 {
 }
 
 void TOutputGLSLBase::writeTriplet(Visit visit, const char* preStr, const char* inStr, const char* postStr)
 {
@@ -154,17 +150,17 @@ const ConstantUnion* TOutputGLSLBase::wr
     {
         int size = type.getObjectSize();
         bool writeType = size > 1;
         if (writeType) out << getTypeName(type) << "(";
         for (int i = 0; i < size; ++i, ++pConstUnion)
         {
             switch (pConstUnion->getType())
             {
-                case EbtFloat: out << std::min(FLT_MAX, std::max(-FLT_MAX, pConstUnion->getFConst())); break;
+                case EbtFloat: out << pConstUnion->getFConst(); break;
                 case EbtInt: out << pConstUnion->getIConst(); break;
                 case EbtBool: out << pConstUnion->getBConst(); break;
                 default: UNREACHABLE();
             }
             if (i != size - 1) out << ", ";
         }
         if (writeType) out << ")";
     }
@@ -218,62 +214,47 @@ bool TOutputGLSLBase::visitBinary(Visit 
         case EOpIndexDirect:
             writeTriplet(visit, NULL, "[", "]");
             break;
         case EOpIndexIndirect:
             if (node->getAddIndexClamp())
             {
                 if (visit == InVisit)
                 {
-                    if (mClampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC) {
-                        out << "[int(clamp(float(";
-                    } else {
-                        out << "[webgl_int_clamp(";
-                    }
+                    out << "[webgl_int_clamp(";
                 }
                 else if (visit == PostVisit)
                 {
                     int maxSize;
                     TIntermTyped *left = node->getLeft();
                     TType leftType = left->getType();
 
                     if (left->isArray())
                     {
                         // The shader will fail validation if the array length is not > 0.
                         maxSize = leftType.getArraySize() - 1;
                     }
                     else
                     {
                         maxSize = leftType.getNominalSize() - 1;
                     }
-
-                    if (mClampingStrategy == SH_CLAMP_WITH_CLAMP_INTRINSIC) {
-                        out << "), 0.0, float(" << maxSize << ")))]";
-                    } else {
-                        out << ", 0, " << maxSize << ")]";
-                    }
+                    out << ", 0, " << maxSize << ")]";
                 }
             }
             else
             {
                 writeTriplet(visit, NULL, "[", "]");
             }
             break;
         case EOpIndexDirectStruct:
             if (visit == InVisit)
             {
                 out << ".";
                 // TODO(alokp): ASSERT
-                TString fieldName = node->getType().getFieldName();
-
-                const TType& structType = node->getLeft()->getType();
-                if (!mSymbolTable.findBuiltIn(structType.getTypeName()))
-                    fieldName = hashName(fieldName);
-
-                out << fieldName;
+                out << hashName(node->getType().getFieldName());
                 visitChildren = false;
             }
             break;
         case EOpVectorSwizzle:
             if (visit == InVisit)
             {
                 out << ".";
                 TIntermAggregate* rightChild = node->getRight()->getAsAggregate();
--- a/gfx/angle/src/compiler/OutputGLSLBase.h
+++ b/gfx/angle/src/compiler/OutputGLSLBase.h
@@ -12,17 +12,16 @@
 #include "compiler/ForLoopUnroll.h"
 #include "compiler/intermediate.h"
 #include "compiler/ParseHelper.h"
 
 class TOutputGLSLBase : public TIntermTraverser
 {
 public:
     TOutputGLSLBase(TInfoSinkBase& objSink,
-                    ShArrayIndexClampingStrategy clampingStrategy,
                     ShHashFunction64 hashFunction,
                     NameMap& nameMap,
                     TSymbolTable& symbolTable);
 
 protected:
     TInfoSinkBase& objSink() { return mObjSink; }
     void writeTriplet(Visit visit, const char* preStr, const char* inStr, const char* postStr);
     void writeVariableType(const TType& type);
@@ -58,19 +57,16 @@ private:
     // Structs are declared as the tree is traversed. This set contains all
     // the structs already declared. It is maintained so that a struct is
     // declared only once.
     typedef std::set<TString> DeclaredStructs;
     DeclaredStructs mDeclaredStructs;
 
     ForLoopUnroll mLoopUnroll;
 
-    ShArrayIndexClampingStrategy mClampingStrategy;
-
     // name hashing.
     ShHashFunction64 mHashFunction;
-
     NameMap& mNameMap;
 
     TSymbolTable& mSymbolTable;
 };
 
 #endif  // CROSSCOMPILERGLSL_OUTPUTGLSLBASE_H_
--- a/gfx/angle/src/compiler/OutputHLSL.cpp
+++ b/gfx/angle/src/compiler/OutputHLSL.cpp
@@ -3,24 +3,23 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/OutputHLSL.h"
 
 #include "common/angleutils.h"
 #include "compiler/compiler_debug.h"
-#include "compiler/DetectDiscontinuity.h"
 #include "compiler/InfoSink.h"
-#include "compiler/SearchSymbol.h"
 #include "compiler/UnfoldShortCircuit.h"
+#include "compiler/SearchSymbol.h"
+#include "compiler/DetectDiscontinuity.h"
 
+#include <stdio.h>
 #include <algorithm>
-#include <cfloat>
-#include <stdio.h>
 
 namespace sh
 {
 // Integer to TString conversion
 TString str(int i)
 {
     char buffer[20];
     snprintf(buffer, sizeof(buffer), "%d", i);
@@ -94,17 +93,17 @@ OutputHLSL::OutputHLSL(TParseContext &co
 
 OutputHLSL::~OutputHLSL()
 {
     delete mUnfoldShortCircuit;
 }
 
 void OutputHLSL::output()
 {
-    mContainsLoopDiscontinuity = mContext.shaderType == SH_FRAGMENT_SHADER && containsLoopDiscontinuity(mContext.treeRoot);
+    mContainsLoopDiscontinuity = containsLoopDiscontinuity(mContext.treeRoot);
 
     mContext.treeRoot->traverse(this);   // Output the body first to determine what has to go in the header
     header();
 
     mContext.infoSink().obj << mHeader.c_str();
     mContext.infoSink().obj << mBody.c_str();
 }
 
@@ -969,17 +968,17 @@ bool OutputHLSL::visitBinary(Visit visit
                 TIntermSequence &sequence = swizzle->getSequence();
 
                 for (TIntermSequence::iterator sit = sequence.begin(); sit != sequence.end(); sit++)
                 {
                     TIntermConstantUnion *element = (*sit)->getAsConstantUnion();
 
                     if (element)
                     {
-                        int i = element->getIConst(0);
+                        int i = element->getUnionArrayPointer()[0].getIConst();
 
                         switch (i)
                         {
                         case 0: out << "x"; break;
                         case 1: out << "y"; break;
                         case 2: out << "z"; break;
                         case 3: out << "w"; break;
                         default: UNREACHABLE();
@@ -1774,17 +1773,17 @@ void OutputHLSL::visitConstantUnion(TInt
 {
     writeConstantUnion(node->getType(), node->getUnionArrayPointer());
 }
 
 bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
 {
     bool wasDiscontinuous = mInsideDiscontinuousLoop;
 
-    if (mContainsLoopDiscontinuity && !mInsideDiscontinuousLoop)
+    if (!mInsideDiscontinuousLoop)
     {
         mInsideDiscontinuousLoop = containsLoopDiscontinuity(node);
     }
 
     if (handleExcessiveLoop(node))
     {
         return false;
     }
@@ -1972,17 +1971,17 @@ bool OutputHLSL::handleExcessiveLoop(TIn
                     TIntermSymbol *symbol = assign->getLeft()->getAsSymbolNode();
                     TIntermConstantUnion *constant = assign->getRight()->getAsConstantUnion();
 
                     if (symbol && constant)
                     {
                         if (constant->getBasicType() == EbtInt && constant->getNominalSize() == 1)
                         {
                             index = symbol;
-                            initial = constant->getIConst(0);
+                            initial = constant->getUnionArrayPointer()[0].getIConst();
                         }
                     }
                 }
             }
         }
     }
 
     // Parse comparator and limit value
@@ -1994,17 +1993,17 @@ bool OutputHLSL::handleExcessiveLoop(TIn
         {
             TIntermConstantUnion *constant = test->getRight()->getAsConstantUnion();
 
             if (constant)
             {
                 if (constant->getBasicType() == EbtInt && constant->getNominalSize() == 1)
                 {
                     comparator = test->getOp();
-                    limit = constant->getIConst(0);
+                    limit = constant->getUnionArrayPointer()[0].getIConst();
                 }
             }
         }
     }
 
     // Parse increment
     if (index != NULL && comparator != EOpNull && node->getExpression())
     {
@@ -2015,17 +2014,17 @@ bool OutputHLSL::handleExcessiveLoop(TIn
         {
             TOperator op = binaryTerminal->getOp();
             TIntermConstantUnion *constant = binaryTerminal->getRight()->getAsConstantUnion();
 
             if (constant)
             {
                 if (constant->getBasicType() == EbtInt && constant->getNominalSize() == 1)
                 {
-                    int value = constant->getIConst(0);
+                    int value = constant->getUnionArrayPointer()[0].getIConst();
 
                     switch (op)
                     {
                       case EOpAddAssign: increment = value;  break;
                       case EOpSubAssign: increment = -value; break;
                       default: UNIMPLEMENTED();
                     }
                 }
@@ -2561,17 +2560,17 @@ const ConstantUnion *OutputHLSL::writeCo
         {
             out << typeString(type) << "(";
         }
 
         for (int i = 0; i < size; i++, constUnion++)
         {
             switch (constUnion->getType())
             {
-              case EbtFloat: out << std::min(FLT_MAX, std::max(-FLT_MAX, constUnion->getFConst())); break;
+              case EbtFloat: out << constUnion->getFConst(); break;
               case EbtInt:   out << constUnion->getIConst(); break;
               case EbtBool:  out << constUnion->getBConst(); break;
               default: UNREACHABLE();
             }
 
             if (i != size - 1)
             {
                 out << ", ";
--- a/gfx/angle/src/compiler/ParseHelper.cpp
+++ b/gfx/angle/src/compiler/ParseHelper.cpp
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #include "compiler/ParseHelper.h"
 
 #include <stdarg.h>
 #include <stdio.h>
@@ -28,17 +28,17 @@ bool TParseContext::parseVectorFields(co
     if (fields.num > 4) {
         error(line, "illegal vector field selection", compString.c_str());
         return false;
     }
 
     enum {
         exyzw,
         ergba,
-        estpq
+        estpq,
     } fieldSet[4];
 
     for (int i = 0; i < fields.num; ++i) {
         switch (compString[i])  {
         case 'x': 
             fields.offsets[i] = 0;
             fieldSet[i] = exyzw;
             break;
@@ -281,17 +281,17 @@ bool TParseContext::lValueErrorCheck(int
             if (!errorReturn) {
                 int offset[4] = {0,0,0,0};
 
                 TIntermTyped* rightNode = binaryNode->getRight();
                 TIntermAggregate *aggrNode = rightNode->getAsAggregate();
                 
                 for (TIntermSequence::iterator p = aggrNode->getSequence().begin(); 
                                                p != aggrNode->getSequence().end(); p++) {
-                    int value = (*p)->getAsTyped()->getAsConstantUnion()->getIConst(0);
+                    int value = (*p)->getAsTyped()->getAsConstantUnion()->getUnionArrayPointer()->getIConst();
                     offset[value]++;     
                     if (offset[value] > 1) {
                         error(line, " l-value of swizzle cannot have duplicate components", op);
 
                         return true;
                     }
                 }
             } 
@@ -488,17 +488,17 @@ bool TParseContext::constructorErrorChec
     //
 
     int size = 0;
     bool constType = true;
     bool full = false;
     bool overFull = false;
     bool matrixInMatrix = false;
     bool arrayArg = false;
-    for (size_t i = 0; i < function.getParamCount(); ++i) {
+    for (int i = 0; i < function.getParamCount(); ++i) {
         const TParameter& param = function.getParam(i);
         size += param.type->getObjectSize();
         
         if (constructingMatrix && param.type->isMatrix())
             matrixInMatrix = true;
         if (full)
             overFull = true;
         if (op != EOpConstructStruct && !type->isArray() && size >= type->getObjectSize())
@@ -507,17 +507,17 @@ bool TParseContext::constructorErrorChec
             constType = false;
         if (param.type->isArray())
             arrayArg = true;
     }
     
     if (constType)
         type->setQualifier(EvqConst);
 
-    if (type->isArray() && static_cast<size_t>(type->getArraySize()) != function.getParamCount()) {
+    if (type->isArray() && type->getArraySize() != function.getParamCount()) {
         error(line, "array constructor needs one argument per array element", "constructor");
         return true;
     }
 
     if (arrayArg && op != EOpConstructStruct) {
         error(line, "constructing from a non-dereferenced array", "constructor");
         return true;
     }
@@ -675,17 +675,17 @@ bool TParseContext::containsSampler(TTyp
 bool TParseContext::arraySizeErrorCheck(int line, TIntermTyped* expr, int& size)
 {
     TIntermConstantUnion* constant = expr->getAsConstantUnion();
     if (constant == 0 || constant->getBasicType() != EbtInt) {
         error(line, "array size must be a constant integer expression", "");
         return true;
     }
 
-    size = constant->getIConst(0);
+    size = constant->getUnionArrayPointer()->getIConst();
 
     if (size <= 0) {
         error(line, "array size must be a positive integer", "");
         size = 1;
         return true;
     }
 
     return false;
@@ -1308,16 +1308,17 @@ TIntermTyped* TParseContext::constructSt
 TIntermTyped* TParseContext::addConstVectorNode(TVectorFields& fields, TIntermTyped* node, TSourceLoc line)
 {
     TIntermTyped* typedNode;
     TIntermConstantUnion* tempConstantNode = node->getAsConstantUnion();
 
     ConstantUnion *unionArray;
     if (tempConstantNode) {
         unionArray = tempConstantNode->getUnionArrayPointer();
+        ASSERT(unionArray);
 
         if (!unionArray) {
             return node;
         }
     } else { // The node has to be either a symbol node or an aggregate node or a tempConstant node, else, its an error
         error(line, "Cannot offset into the vector", "Error");
         recover();
 
@@ -1501,17 +1502,17 @@ bool TParseContext::structNestingErrorCh
     return false;
 }
 
 //
 // Parse an array of strings using yyparse.
 //
 // Returns 0 for success.
 //
-int PaParseStrings(size_t count, const char* const string[], const int length[],
+int PaParseStrings(int count, const char* const string[], const int length[],
                    TParseContext* context) {
     if ((count == 0) || (string == NULL))
         return 1;
 
     if (glslang_initialize(context))
         return 1;
 
     int error = glslang_scan(count, string, length, context);
--- a/gfx/angle/src/compiler/ParseHelper.h
+++ b/gfx/angle/src/compiler/ParseHelper.h
@@ -53,17 +53,16 @@ struct TParseContext {
     TIntermNode* treeRoot;       // root of parse tree being created
     bool lexAfterType;           // true if we've recognized a type, so can only be looking for an identifier
     int loopNestingLevel;        // 0 if outside all loops
     int structNestingLevel;      // incremented while parsing a struct declaration
     bool inTypeParen;            // true if in parentheses, looking only for an identifier
     const TType* currentFunctionType;  // the return type of the function that's currently being parsed
     bool functionReturnsValue;   // true if a non-void function has a return
     bool checksPrecisionErrors;  // true if an error will be generated when a variable is declared without precision, explicit or implicit.
-    bool fragmentPrecisionHigh;  // true if highp precision is supported in the fragment language.
     TString HashErrMsg;
     bool AfterEOF;
     TDiagnostics diagnostics;
     TDirectiveHandler directiveHandler;
     pp::Preprocessor preprocessor;
     void* scanner;
 
     int numErrors() const { return diagnostics.numErrors(); }
@@ -130,12 +129,12 @@ struct TParseContext {
     // Returns true if an error was raised due to the declaration of
     // this struct.
     bool enterStructDeclaration(TSourceLoc line, const TString& identifier);
     void exitStructDeclaration();
 
     bool structNestingErrorCheck(TSourceLoc line, const TType& fieldType);
 };
 
-int PaParseStrings(size_t count, const char* const string[], const int length[],
+int PaParseStrings(int count, const char* const string[], const int length[],
                    TParseContext* context);
 
 #endif // _PARSER_HELPER_INCLUDED_
--- a/gfx/angle/src/compiler/ShHandle.h
+++ b/gfx/angle/src/compiler/ShHandle.h
@@ -11,23 +11,23 @@
 // Machine independent part of the compiler private objects
 // sent as ShHandle to the driver.
 //
 // This should not be included by driver code.
 //
 
 #include "GLSLANG/ShaderLang.h"
 
+#include "compiler/ArrayBoundsClamper.h"
 #include "compiler/BuiltInFunctionEmulator.h"
 #include "compiler/ExtensionBehavior.h"
 #include "compiler/HashNames.h"
 #include "compiler/InfoSink.h"
 #include "compiler/SymbolTable.h"
 #include "compiler/VariableInfo.h"
-#include "third_party/compiler/ArrayBoundsClamper.h"
 
 class LongNameMap;
 class TCompiler;
 class TDependencyGraph;
 
 //
 // Helper function to identify specs that are based on the WebGL spec,
 // like the CSS Shaders spec.
@@ -56,17 +56,17 @@ protected:
 class TCompiler : public TShHandleBase {
 public:
     TCompiler(ShShaderType type, ShShaderSpec spec);
     virtual ~TCompiler();
     virtual TCompiler* getAsCompiler() { return this; }
 
     bool Init(const ShBuiltInResources& resources);
     bool compile(const char* const shaderStrings[],
-                 size_t numStrings,
+                 const int numStrings,
                  int compileOptions);
 
     // Get results of the last compilation.
     TInfoSink& getInfoSink() { return infoSink; }
     const TVariableInfoList& getAttribs() const { return attribs; }
     const TVariableInfoList& getUniforms() const { return uniforms; }
     int getMappedNameMaxLength() const;
 
@@ -103,34 +103,31 @@ protected:
     bool enforceVertexShaderTimingRestrictions(TIntermNode* root);
     // Returns true if the shader does not use sampler dependent values to affect control 
     // flow or in operations whose time can depend on the input values.
     bool enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph);
     // Get built-in extensions with default behavior.
     const TExtensionBehavior& getExtensionBehavior() const;
 
     const ArrayBoundsClamper& getArrayBoundsClamper() const;
-    ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
     const BuiltInFunctionEmulator& getBuiltInFunctionEmulator() const;
 
 private:
     ShShaderType shaderType;
     ShShaderSpec shaderSpec;
 
     int maxUniformVectors;
 
     // Built-in symbol table for the given language, spec, and resources.
     // It is preserved from compile-to-compile.
     TSymbolTable symbolTable;
     // Built-in extensions with default behavior.
     TExtensionBehavior extensionBehavior;
-    bool fragmentPrecisionHigh;
 
     ArrayBoundsClamper arrayBoundsClamper;
-    ShArrayIndexClampingStrategy clampingStrategy;
     BuiltInFunctionEmulator builtInFunctionEmulator;
 
     // Results of compilation.
     TInfoSink infoSink;  // Output sink.
     TVariableInfoList attribs;  // Active attributes in the compiled shader.
     TVariableInfoList uniforms;  // Active uniforms in the compiled shader.
 
     // Cached copy of the ref-counted singleton.
--- a/gfx/angle/src/compiler/ShaderLang.cpp
+++ b/gfx/angle/src/compiler/ShaderLang.cpp
@@ -16,36 +16,36 @@
 #include "compiler/ShHandle.h"
 
 //
 // This is the platform independent interface between an OGL driver
 // and the shading language compiler.
 //
 
 static bool checkActiveUniformAndAttribMaxLengths(const ShHandle handle,
-                                                  size_t expectedValue)
+                                                  int expectedValue)
 {
-    size_t activeUniformLimit = 0;
+    int activeUniformLimit = 0;
     ShGetInfo(handle, SH_ACTIVE_UNIFORM_MAX_LENGTH, &activeUniformLimit);
-    size_t activeAttribLimit = 0;
+    int activeAttribLimit = 0;
     ShGetInfo(handle, SH_ACTIVE_ATTRIBUTE_MAX_LENGTH, &activeAttribLimit);
     return (expectedValue == activeUniformLimit && expectedValue == activeAttribLimit);
 }
 
-static bool checkMappedNameMaxLength(const ShHandle handle, size_t expectedValue)
+static bool checkMappedNameMaxLength(const ShHandle handle, int expectedValue)
 {
-    size_t mappedNameMaxLength = 0;
+    int mappedNameMaxLength = 0;
     ShGetInfo(handle, SH_MAPPED_NAME_MAX_LENGTH, &mappedNameMaxLength);
     return (expectedValue == mappedNameMaxLength);
 }
 
 static void getVariableInfo(ShShaderInfo varType,
                             const ShHandle handle,
                             int index,
-                            size_t* length,
+                            int* length,
                             int* size,
                             ShDataType* type,
                             char* name,
                             char* mappedName)
 {
     if (!handle || !size || !type || !name)
         return;
     ASSERT((varType == SH_ACTIVE_ATTRIBUTES) ||
@@ -64,24 +64,24 @@ static void getVariableInfo(ShShaderInfo
     const TVariableInfo& varInfo = varList[index];
     if (length) *length = varInfo.name.size();
     *size = varInfo.size;
     *type = varInfo.type;
 
     // This size must match that queried by
     // SH_ACTIVE_UNIFORM_MAX_LENGTH and SH_ACTIVE_ATTRIBUTE_MAX_LENGTH
     // in ShGetInfo, below.
-    size_t activeUniformAndAttribLength = 1 + MAX_SYMBOL_NAME_LEN;
+    int activeUniformAndAttribLength = 1 + MAX_SYMBOL_NAME_LEN;
     ASSERT(checkActiveUniformAndAttribMaxLengths(handle, activeUniformAndAttribLength));
     strncpy(name, varInfo.name.c_str(), activeUniformAndAttribLength);
     name[activeUniformAndAttribLength - 1] = 0;
     if (mappedName) {
         // This size must match that queried by
         // SH_MAPPED_NAME_MAX_LENGTH in ShGetInfo, below.
-        size_t maxMappedNameLength = 1 + MAX_SYMBOL_NAME_LEN;
+        int maxMappedNameLength = 1 + MAX_SYMBOL_NAME_LEN;
         ASSERT(checkMappedNameMaxLength(handle, maxMappedNameLength));
         strncpy(mappedName, varInfo.mappedName.c_str(), maxMappedNameLength);
         mappedName[maxMappedNameLength - 1] = 0;
     }
 }
 
 //
 // Driver must call this first, once, before doing any other
@@ -120,25 +120,19 @@ void ShInitBuiltInResources(ShBuiltInRes
     resources->MaxTextureImageUnits = 8;
     resources->MaxFragmentUniformVectors = 16;
     resources->MaxDrawBuffers = 1;
 
     // Extensions.
     resources->OES_standard_derivatives = 0;
     resources->OES_EGL_image_external = 0;
     resources->ARB_texture_rectangle = 0;
-    resources->EXT_draw_buffers = 0;
-
-    // Disable highp precision in fragment shader by default.
-    resources->FragmentPrecisionHigh = 0;
 
     // Disable name hashing by default.
     resources->HashFunction = NULL;
-
-    resources->ArrayIndexClampingStrategy = SH_CLAMP_WITH_CLAMP_INTRINSIC;
 }
 
 //
 // Driver calls these to create and destroy compiler objects.
 //
 ShHandle ShConstructCompiler(ShShaderType type, ShShaderSpec spec,
                              ShShaderOutput output,
                              const ShBuiltInResources* resources)
@@ -176,17 +170,17 @@ void ShDestruct(ShHandle handle)
 // in the given compile object.
 //
 // Return:  The return value of ShCompile is really boolean, indicating
 // success or failure.
 //
 int ShCompile(
     const ShHandle handle,
     const char* const shaderStrings[],
-    size_t numStrings,
+    const int numStrings,
     int compileOptions)
 {
     if (!InitThread())
         return 0;
 
     if (handle == 0)
         return 0;
 
@@ -194,17 +188,17 @@ int ShCompile(
     TCompiler* compiler = base->getAsCompiler();
     if (compiler == 0)
         return 0;
 
     bool success = compiler->compile(shaderStrings, numStrings, compileOptions);
     return success ? 1 : 0;
 }
 
-void ShGetInfo(const ShHandle handle, ShShaderInfo pname, size_t* params)
+void ShGetInfo(const ShHandle handle, ShShaderInfo pname, int* params)
 {
     if (!handle || !params)
         return;
 
     TShHandleBase* base = static_cast<TShHandleBase*>(handle);
     TCompiler* compiler = base->getAsCompiler();
     if (!compiler) return;
 
@@ -282,29 +276,29 @@ void ShGetObjectCode(const ShHandle hand
     if (!compiler) return;
 
     TInfoSink& infoSink = compiler->getInfoSink();
     strcpy(objCode, infoSink.obj.c_str());
 }
 
 void ShGetActiveAttrib(const ShHandle handle,
                        int index,
-                       size_t* length,
+                       int* length,
                        int* size,
                        ShDataType* type,
                        char* name,
                        char* mappedName)
 {
     getVariableInfo(SH_ACTIVE_ATTRIBUTES,
                     handle, index, length, size, type, name, mappedName);
 }
 
 void ShGetActiveUniform(const ShHandle handle,
                         int index,
-                        size_t* length,
+                        int* length,
                         int* size,
                         ShDataType* type,
                         char* name,
                         char* mappedName)
 {
     getVariableInfo(SH_ACTIVE_UNIFORMS,
                     handle, index, length, size, type, name, mappedName);
 }
@@ -325,29 +319,29 @@ void ShGetNameHashingEntry(const ShHandl
     if (index >= static_cast<int>(nameMap.size()))
         return;
 
     NameMap::const_iterator it = nameMap.begin();
     for (int i = 0; i < index; ++i)
         ++it;
 
     size_t len = it->first.length() + 1;
-    size_t max_len = 0;
+    int max_len = 0;
     ShGetInfo(handle, SH_NAME_MAX_LENGTH, &max_len);
-    if (len > max_len) {
+    if (static_cast<int>(len) > max_len) {
         ASSERT(false);
         len = max_len;
     }
     strncpy(name, it->first.c_str(), len);
     // To be on the safe side in case the source is longer than expected.
-    name[len - 1] = '\0';
+    name[len] = '\0';
 
     len = it->second.length() + 1;
     max_len = 0;
     ShGetInfo(handle, SH_HASHED_NAME_MAX_LENGTH, &max_len);
-    if (len > max_len) {
+    if (static_cast<int>(len) > max_len) {
         ASSERT(false);
         len = max_len;
     }
     strncpy(hashedName, it->second.c_str(), len);
     // To be on the safe side in case the source is longer than expected.
-    hashedName[len - 1] = '\0';
+    hashedName[len] = '\0';
 }
--- a/gfx/angle/src/compiler/SymbolTable.h
+++ b/gfx/angle/src/compiler/SymbolTable.h
@@ -164,18 +164,18 @@ public:
     TOperator getBuiltInOp() const { return op; }
 
     void relateToExtension(const TString& ext) { extension = ext; }
     const TString& getExtension() const { return extension; }
 
     void setDefined() { defined = true; }
     bool isDefined() { return defined; }
 
-    size_t getParamCount() const { return parameters.size(); }  
-    const TParameter& getParam(size_t i) const { return parameters[i]; }
+    int getParamCount() const { return static_cast<int>(parameters.size()); }  
+    const TParameter& getParam(int i) const { return parameters[i]; }
 
     virtual void dump(TInfoSink &infoSink) const;
     TFunction(const TFunction&, TStructureMap& remapper);
     virtual TFunction* clone(TStructureMap& remapper);
 
 protected:
     typedef TVector<TParameter> TParamList;
     TParamList parameters;
@@ -318,26 +318,20 @@ public:
     }
     void relateToExtension(const char* name, const TString& ext) {
         table[0]->relateToExtension(name, ext);
     }
     int getMaxSymbolId() { return uniqueId; }
     void dump(TInfoSink &infoSink) const;
     void copyTable(const TSymbolTable& copyOf);
 
-    bool setDefaultPrecision( const TPublicType& type, TPrecision prec ){
-        if (IsSampler(type.type))
-            return true;  // Skip sampler types for the time being
-        if (type.type != EbtFloat && type.type != EbtInt)
-            return false; // Only set default precision for int/float
-        if (type.size != 1 || type.matrix || type.array)
-            return false; // Not allowed to set for aggregate types
+    void setDefaultPrecision( TBasicType type, TPrecision prec ){
+        if( type != EbtFloat && type != EbtInt ) return; // Only set default precision for int/float
         int indexOfLastElement = static_cast<int>(precisionStack.size()) - 1;
-        precisionStack[indexOfLastElement][type.type] = prec; // Uses map operator [], overwrites the current value
-        return true;
+        precisionStack[indexOfLastElement][type] = prec; // Uses map operator [], overwrites the current value
     }
 
     // Searches down the precisionStack for a precision qualifier for the specified TBasicType
     TPrecision getDefaultPrecision( TBasicType type){
         if( type != EbtFloat && type != EbtInt ) return EbpUndefined;
         int level = static_cast<int>(precisionStack.size()) - 1;
         assert( level >= 0); // Just to be safe. Should not happen.
         PrecisionStackLevel::iterator it;
--- a/gfx/angle/src/compiler/TranslatorESSL.cpp
+++ b/gfx/angle/src/compiler/TranslatorESSL.cpp
@@ -21,17 +21,17 @@ void TranslatorESSL::translate(TIntermNo
     // Write emulated built-in functions if needed.
     getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
         sink, getShaderType() == SH_FRAGMENT_SHADER);
 
     // Write array bounds clamping emulation if needed.
     getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
 
     // Write translated shader.
-    TOutputESSL outputESSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), getSymbolTable());
+    TOutputESSL outputESSL(sink, getHashFunction(), getNameMap(), getSymbolTable());
     root->traverse(&outputESSL);
 }
 
 void TranslatorESSL::writeExtensionBehavior() {
     TInfoSinkBase& sink = getInfoSink().obj;
     const TExtensionBehavior& extensionBehavior = getExtensionBehavior();
     for (TExtensionBehavior::const_iterator iter = extensionBehavior.begin();
          iter != extensionBehavior.end(); ++iter) {
--- a/gfx/angle/src/compiler/TranslatorGLSL.cpp
+++ b/gfx/angle/src/compiler/TranslatorGLSL.cpp
@@ -34,11 +34,11 @@ void TranslatorGLSL::translate(TIntermNo
     // Write emulated built-in functions if needed.
     getBuiltInFunctionEmulator().OutputEmulatedFunctionDefinition(
         sink, false);
 
     // Write array bounds clamping emulation if needed.
     getArrayBoundsClamper().OutputClampingFunctionDefinition(sink);
 
     // Write translated shader.
-    TOutputGLSL outputGLSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(), getSymbolTable());
+    TOutputGLSL outputGLSL(sink, getHashFunction(), getNameMap(), getSymbolTable());
     root->traverse(&outputGLSL);
 }
--- a/gfx/angle/src/compiler/UnfoldShortCircuit.cpp
+++ b/gfx/angle/src/compiler/UnfoldShortCircuit.cpp
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2012 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 // UnfoldShortCircuit is an AST traverser to output short-circuiting operators as if-else statements.
 // The results are assigned to s# temporaries, which are used by the main translator instead of
 // the original expression.
 //
 
@@ -106,18 +106,16 @@ bool UnfoldShortCircuit::visitSelection(
 
     // Unfold "b ? x : y" into "type s; if(b) s = x; else s = y;"
     if (node->usesTernaryOperator())
     {
         int i = mTemporaryIndex;
 
         out << mOutputHLSL->typeString(node->getType()) << " s" << i << ";\n";
 
-        out << "{\n";
-
         mTemporaryIndex = i + 1;
         node->getCondition()->traverse(this);
         out << "if(";
         mTemporaryIndex = i + 1;
         node->getCondition()->traverse(mOutputHLSL);
         out << ")\n"
                "{\n";
         mTemporaryIndex = i + 1;
@@ -132,18 +130,16 @@ bool UnfoldShortCircuit::visitSelection(
         mTemporaryIndex = i + 1;
         node->getFalseBlock()->traverse(this);
         out << "    s" << i << " = ";
         mTemporaryIndex = i + 1;
         node->getFalseBlock()->traverse(mOutputHLSL);
         out << ";\n"
                "}\n";
 
-        out << "}\n";
-
         mTemporaryIndex = i + 1;
     }
 
     return false;
 }
 
 bool UnfoldShortCircuit::visitLoop(Visit visit, TIntermLoop *node)
 {
--- a/gfx/angle/src/compiler/ValidateLimitations.cpp
+++ b/gfx/angle/src/compiler/ValidateLimitations.cpp
@@ -416,17 +416,17 @@ bool ValidateLimitations::validateFuncti
 {
     ASSERT(node->getOp() == EOpFunctionCall);
 
     // If not within loop body, there is nothing to check.
     if (!withinLoopBody())
         return true;
 
     // List of param indices for which loop indices are used as argument.
-    typedef std::vector<size_t> ParamIndex;
+    typedef std::vector<int> ParamIndex;
     ParamIndex pIndex;
     TIntermSequence& params = node->getSequence();
     for (TIntermSequence::size_type i = 0; i < params.size(); ++i) {
         TIntermSymbol* symbol = params[i]->getAsSymbolNode();
         if (symbol && isLoopIndex(symbol))
             pIndex.push_back(i);
     }
     // If none of the loop indices are used as arguments,
--- a/gfx/angle/src/compiler/VariablePacker.cpp
+++ b/gfx/angle/src/compiler/VariablePacker.cpp
@@ -80,17 +80,17 @@ int VariablePacker::GetNumComponentsPerR
 int VariablePacker::GetNumRows(ShDataType type)
 {
     switch (type) {
         case SH_FLOAT_MAT4:
             return 4;
         case SH_FLOAT_MAT3:
             return 3;
         case SH_FLOAT_MAT2:
-            return 2;
+            return 1;
         case SH_FLOAT_VEC4:
         case SH_INT_VEC4:
         case SH_BOOL_VEC4:
         case SH_FLOAT_VEC3:
         case SH_INT_VEC3:
         case SH_BOOL_VEC3:
         case SH_FLOAT_VEC2:
         case SH_INT_VEC2:
--- a/gfx/angle/src/compiler/glslang.h
+++ b/gfx/angle/src/compiler/glslang.h
@@ -3,14 +3,14 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 struct TParseContext;
 extern int glslang_initialize(TParseContext* context);
 extern int glslang_finalize(TParseContext* context);
 
-extern int glslang_scan(size_t count,
+extern int glslang_scan(int count,
                         const char* const string[],
                         const int length[],
                         TParseContext* context);
 extern int glslang_parse(TParseContext* context);
 
--- a/gfx/angle/src/compiler/glslang.l
+++ b/gfx/angle/src/compiler/glslang.l
@@ -46,17 +46,17 @@ WHICH GENERATES THE GLSL ES LEXER (glsla
 #ifdef _MSC_VER
 #pragma warning(disable : 4102)
 #endif
 
 #define YY_USER_ACTION yylval->lex.line = yylineno;
 #define YY_INPUT(buf, result, max_size) \
     result = string_input(buf, max_size, yyscanner);
 
-static yy_size_t string_input(char* buf, yy_size_t max_size, yyscan_t yyscanner);
+static int string_input(char* buf, int max_size, yyscan_t yyscanner);
 static int check_type(yyscan_t yyscanner);
 static int reserved_word(yyscan_t yyscanner);
 %}
 
 %option noyywrap nounput never-interactive
 %option yylineno reentrant bison-bridge
 %option stack
 %option extra-type="TParseContext*"
@@ -198,20 +198,20 @@ O           [0-7]
 "namespace"    { return reserved_word(yyscanner); }
 "using"        { return reserved_word(yyscanner); }
 
 {L}({L}|{D})*       {
    yylval->lex.string = NewPoolTString(yytext); 
    return check_type(yyscanner);
 }
 
-0[xX]{H}+         { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); }
-0{O}+             { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); }
+0[xX]{H}+         { yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
+0{O}+             { yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
 0{D}+             { context->error(yylineno, "Invalid Octal number.", yytext); context->recover(); return 0;}
-{D}+              { yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); }
+{D}+              { yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
 
 {D}+{E}           { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
 {D}+"."{D}*({E})? { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
 "."{D}+({E})?     { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
 
 "+="            {  return(ADD_ASSIGN); }
 "-="            {  return(SUB_ASSIGN); }
 "*="            {  return(MUL_ASSIGN); }
@@ -267,21 +267,21 @@ 0{D}+             { context->error(yylin
 <FIELDS>[ \t\v\f\r] {}
 
 [ \t\v\n\f\r]   {  }
 <*><<EOF>>      { context->AfterEOF = true; yyterminate(); }
 <*>.            { context->warning(yylineno, "Unknown char", yytext, ""); return 0; }
 
 %%
 
-yy_size_t string_input(char* buf, yy_size_t max_size, yyscan_t yyscanner) {
+int string_input(char* buf, int max_size, yyscan_t yyscanner) {
     pp::Token token;
     yyget_extra(yyscanner)->preprocessor.lex(&token);
-    yy_size_t len = token.type == pp::Token::LAST ? 0 : token.text.size();
-    if (len < max_size)
+    int len = token.type == pp::Token::LAST ? 0 : token.text.size();
+    if ((len > 0) && (len < max_size))
         memcpy(buf, token.text.c_str(), len);
     yyset_lineno(EncodeSourceLoc(token.location.file, token.location.line), yyscanner);
 
     if (len >= max_size)
         YY_FATAL_ERROR("Input buffer overflow");
     else if (len > 0)
         buf[len++] = ' ';
     return len;
@@ -336,30 +336,27 @@ int glslang_finalize(TParseContext* cont
     if (scanner == NULL) return 0;
     
     context->scanner = NULL;
     yylex_destroy(scanner);
 
     return 0;
 }
 
-int glslang_scan(size_t count, const char* const string[], const int length[],
+int glslang_scan(int count, const char* const string[], const int length[],
                  TParseContext* context) {
     yyrestart(NULL, context->scanner);
     yyset_lineno(EncodeSourceLoc(0, 1), context->scanner);
     context->AfterEOF = false;
 
     // Initialize preprocessor.
     if (!context->preprocessor.init(count, string, length))
         return 1;
 
     // Define extension macros.
     const TExtensionBehavior& extBehavior = context->extensionBehavior();
     for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
          iter != extBehavior.end(); ++iter) {
         context->preprocessor.predefineMacro(iter->first.c_str(), 1);
     }
-    if (context->fragmentPrecisionHigh)
-        context->preprocessor.predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
-
     return 0;
 }
 
--- a/gfx/angle/src/compiler/glslang.y
+++ b/gfx/angle/src/compiler/glslang.y
@@ -1,11 +1,11 @@
 /*
 //
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 This file contains the Yacc grammar for GLSL ES.
 Based on ANSI C Yacc grammar:
 http://www.lysator.liu.se/c/ANSI-C-grammar-y.html
 
@@ -33,19 +33,16 @@ WHICH GENERATES THE GLSL ES PARSER (glsl
 #pragma warning(disable: 4505)
 #pragma warning(disable: 4701)
 #endif
 
 #include "compiler/SymbolTable.h"
 #include "compiler/ParseHelper.h"
 #include "GLSLANG/ShaderLang.h"
 
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
-
 #define YYLEX_PARAM context->scanner
 %}
 
 %expect 1 /* One shift reduce conflict because of if | else */
 %pure-parser
 %parse-param {TParseContext* context}
 
 %union {
@@ -240,46 +237,46 @@ postfix_expression
             if ($1->getAsSymbolNode())
                 context->error($2.line, " left of '[' is not of type array, matrix, or vector ", $1->getAsSymbolNode()->getSymbol().c_str());
             else
                 context->error($2.line, " left of '[' is not of type array, matrix, or vector ", "expression");
             context->recover();
         }
         if ($1->getType().getQualifier() == EvqConst && $3->getQualifier() == EvqConst) {
             if ($1->isArray()) { // constant folding for arrays
-                $$ = context->addConstArrayNode($3->getAsConstantUnion()->getIConst(0), $1, $2.line);
+                $$ = context->addConstArrayNode($3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), $1, $2.line);
             } else if ($1->isVector()) {  // constant folding for vectors
                 TVectorFields fields;
                 fields.num = 1;
-                fields.offsets[0] = $3->getAsConstantUnion()->getIConst(0); // need to do it this way because v.xy sends fields integer array
+                fields.offsets[0] = $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(); // need to do it this way because v.xy sends fields integer array
                 $$ = context->addConstVectorNode(fields, $1, $2.line);
             } else if ($1->isMatrix()) { // constant folding for matrices
-                $$ = context->addConstMatrixNode($3->getAsConstantUnion()->getIConst(0), $1, $2.line);
+                $$ = context->addConstMatrixNode($3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), $1, $2.line);
             }
         } else {
             if ($3->getQualifier() == EvqConst) {
-                if (($1->isVector() || $1->isMatrix()) && $1->getType().getNominalSize() <= $3->getAsConstantUnion()->getIConst(0) && !$1->isArray() ) {
+                if (($1->isVector() || $1->isMatrix()) && $1->getType().getNominalSize() <= $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() && !$1->isArray() ) {
                     std::stringstream extraInfoStream;
-                    extraInfoStream << "field selection out of range '" << $3->getAsConstantUnion()->getIConst(0) << "'";
+                    extraInfoStream << "field selection out of range '" << $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'";
                     std::string extraInfo = extraInfoStream.str();
                     context->error($2.line, "", "[", extraInfo.c_str());
                     context->recover();
                 } else {
                     if ($1->isArray()) {
                         if ($1->getType().getArraySize() == 0) {
-                            if ($1->getType().getMaxArraySize() <= $3->getAsConstantUnion()->getIConst(0)) {
-                                if (context->arraySetMaxSize($1->getAsSymbolNode(), $1->getTypePointer(), $3->getAsConstantUnion()->getIConst(0), true, $2.line))
+                            if ($1->getType().getMaxArraySize() <= $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst()) {
+                                if (context->arraySetMaxSize($1->getAsSymbolNode(), $1->getTypePointer(), $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), true, $2.line))
                                     context->recover();
                             } else {
                                 if (context->arraySetMaxSize($1->getAsSymbolNode(), $1->getTypePointer(), 0, false, $2.line))
                                     context->recover();
                             }
-                        } else if ( $3->getAsConstantUnion()->getIConst(0) >= $1->getType().getArraySize()) {
+                        } else if ( $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() >= $1->getType().getArraySize()) {
                             std::stringstream extraInfoStream;
-                            extraInfoStream << "array index out of range '" << $3->getAsConstantUnion()->getIConst(0) << "'";
+                            extraInfoStream << "array index out of range '" << $3->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'";
                             std::string extraInfo = extraInfoStream.str();
                             context->error($2.line, "", "[", extraInfo.c_str());
                             context->recover();
                         }
                     }
                     $$ = context->intermediate.addIndex(EOpIndexDirect, $1, $3, $2.line);
                 }
             } else {
@@ -519,17 +516,17 @@ function_call
                     // this is how we know whether the given function is a builtIn function or a user defined function
                     // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
                     // if builtIn == true, it's definitely a builtIn function with EOpNull
                     if (!builtIn)
                         $$->getAsAggregate()->setUserDefined();
                     $$->getAsAggregate()->setName(fnCandidate->getMangledName());
 
                     TQualifier qual;
-                    for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
+                    for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
                         qual = fnCandidate->getParam(i).type->getQualifier();
                         if (qual == EvqOut || qual == EvqInOut) {
                             if (context->lValueErrorCheck($$->getLine(), "assign", $$->getAsAggregate()->getSequence()[i]->getAsTyped())) {
                                 context->error($1.intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
                                 context->recover();
                             }
                         }
                     }
@@ -960,17 +957,17 @@ constant_expression
 declaration
     : function_prototype SEMICOLON   {
         TFunction &function = *($1.function);
         
         TIntermAggregate *prototype = new TIntermAggregate;
         prototype->setType(function.getReturnType());
         prototype->setName(function.getName());
         
-        for (size_t i = 0; i < function.getParamCount(); i++)
+        for (int i = 0; i < function.getParamCount(); i++)
         {
             const TParameter &param = function.getParam(i);
             if (param.name != 0)
             {
                 TVariable *variable = new TVariable(param.name, *param.type);
                 
                 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), $1.line), $1.line);
             }
@@ -986,24 +983,17 @@ declaration
         context->symbolTable.pop();
     }
     | init_declarator_list SEMICOLON {
         if ($1.intermAggregate)
             $1.intermAggregate->setOp(EOpDeclaration);
         $$ = $1.intermAggregate;
     }
     | PRECISION precision_qualifier type_specifier_no_prec SEMICOLON {
-        if (($2 == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
-            context->error($1.line, "precision is not supported in fragment shader", "highp");
-            context->recover();
-        }
-        if (!context->symbolTable.setDefaultPrecision( $3, $2 )) {
-            context->error($1.line, "illegal type argument for default precision qualifier", getBasicString($3.type));
-            context->recover();
-        }
+        context->symbolTable.setDefaultPrecision( $3.type, $2 );
         $$ = 0;
     }
     ;
 
 function_prototype
     : function_declarator RIGHT_PAREN  {
         //
         // Multiple declarations of the same function are allowed.
@@ -1014,17 +1004,17 @@ function_prototype
         // Redeclarations are allowed.  But, return types and parameter qualifiers must match.
         //
         TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find($1->getMangledName()));
         if (prevDec) {
             if (prevDec->getReturnType() != $1->getReturnType()) {
                 context->error($2.line, "overloaded functions must have the same return type", $1->getReturnType().getBasicString());
                 context->recover();
             }
-            for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
+            for (int i = 0; i < prevDec->getParamCount(); ++i) {
                 if (prevDec->getParam(i).type->getQualifier() != $1->getParam(i).type->getQualifier()) {
                     context->error($2.line, "overloaded functions must have the same parameter qualifiers", $1->getParam(i).type->getQualifierString());
                     context->recover();
                 }
             }
         }
 
         //
@@ -2084,17 +2074,17 @@ function_definition
         // Insert parameters into the symbol table.
         // If the parameter has no name, it's not an error, just don't insert it
         // (could be used for unused args).
         //
         // Also, accumulate the list of parameters into the HIL, so lower level code
         // knows where to find parameters.
         //
         TIntermAggregate* paramNodes = new TIntermAggregate;
-        for (size_t i = 0; i < function->getParamCount(); i++) {
+        for (int i = 0; i < function->getParamCount(); i++) {
             const TParameter& param = function->getParam(i);
             if (param.name != 0) {
                 TVariable *variable = new TVariable(param.name, *param.type);
                 //
                 // Insert the parameters with name in the symbol table.
                 //
                 if (! context->symbolTable.insert(*variable)) {
                     context->error($1.line, "redefinition", variable->getName().c_str());
@@ -2144,8 +2134,9 @@ function_definition
     }
     ;
 
 %%
 
 int glslang_parse(TParseContext* context) {
     return yyparse(context);
 }
+
--- a/gfx/angle/src/compiler/glslang_lex.cpp
+++ b/gfx/angle/src/compiler/glslang_lex.cpp
@@ -63,17 +63,16 @@
 
 #include <inttypes.h>
 typedef int8_t flex_int8_t;
 typedef uint8_t flex_uint8_t;
 typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -187,35 +186,30 @@ typedef void* yyscan_t;
  */
 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
 #define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
     /* Note: We specifically omit the test for yy_rule_can_match_eol because it requires
      *       access to the local variable yy_act. Since yyless() is a macro, it would break
      *       existing scanners that call yyless() from OUTSIDE yylex. 
      *       One obvious solution it to make yy_act a global. I tried that, and saw
      *       a 5% performance hit in a non-yylineno scanner, because yy_act is
      *       normally declared as a register variable-- so it is not worth it.
      */
     #define  YY_LESS_LINENO(n) \
             do { \
-                yy_size_t yyl;\
+                int yyl;\
                 for ( yyl = n; yyl < yyleng; ++yyl )\
                     if ( yytext[yyl] == '\n' )\
                         --yylineno;\
             }while(0)
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
 	do \
@@ -227,16 +221,21 @@ typedef size_t yy_size_t;
 		YY_RESTORE_YY_MORE_OFFSET \
 		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
 		} \
 	while ( 0 )
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
 	{
 	FILE *yy_input_file;
 
 	char *yy_ch_buf;		/* input buffer */
 	char *yy_buf_pos;		/* current position in input buffer */
@@ -244,17 +243,17 @@ struct yy_buffer_state
 	/* Size of input buffer in bytes, not including room for EOB
 	 * characters.
 	 */
 	yy_size_t yy_buf_size;
 
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	yy_size_t yy_n_chars;
+	int yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
 	 * delete it.
 	 */
 	int yy_is_our_buffer;
 
 	/* Whether this is an "interactive" input source; if so, and
@@ -323,17 +322,17 @@ void yypop_buffer_state (yyscan_t yyscan
 static void yyensure_buffer_stack (yyscan_t yyscanner );
 static void yy_load_buffer_state (yyscan_t yyscanner );
 static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
 
 #define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
 
 YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
 
 void *yyalloc (yy_size_t ,yyscan_t yyscanner );
 void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
 void yyfree (void * ,yyscan_t yyscanner );
 
 #define yy_new_buffer yy_create_buffer
 
 #define yy_set_interactive(is_interactive) \
@@ -374,17 +373,17 @@ static yy_state_type yy_try_NUL_trans (y
 static int yy_get_next_buffer (yyscan_t yyscanner );
 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
 
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
 	yyg->yytext_ptr = yy_bp; \
-	yyleng = (yy_size_t) (yy_cp - yy_bp); \
+	yyleng = (size_t) (yy_cp - yy_bp); \
 	yyg->yy_hold_char = *yy_cp; \
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
 #define YY_NUM_RULES 155
 #define YY_END_OF_BUFFER 156
 /* This struct is not used in this scanner,
    but its presence is necessary. */
@@ -816,17 +815,17 @@ WHICH GENERATES THE GLSL ES LEXER (glsla
 #ifdef _MSC_VER
 #pragma warning(disable : 4102)
 #endif
 
 #define YY_USER_ACTION yylval->lex.line = yylineno;
 #define YY_INPUT(buf, result, max_size) \
     result = string_input(buf, max_size, yyscanner);
 
-static yy_size_t string_input(char* buf, yy_size_t max_size, yyscan_t yyscanner);
+static int string_input(char* buf, int max_size, yyscan_t yyscanner);
 static int check_type(yyscan_t yyscanner);
 static int reserved_word(yyscan_t yyscanner);
 
 #define INITIAL 0
 #define COMMENT 1
 #define FIELDS 2
 
 #define YY_EXTRA_TYPE TParseContext*
@@ -839,18 +838,18 @@ struct yyguts_t
     YY_EXTRA_TYPE yyextra_r;
 
     /* The rest are the same as the globals declared in the non-reentrant scanner. */
     FILE *yyin_r, *yyout_r;
     size_t yy_buffer_stack_top; /**< index of top of stack. */
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    yy_size_t yy_n_chars;
-    yy_size_t yyleng_r;
+    int yy_n_chars;
+    int yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
     int yy_did_buffer_switch_on_eof;
     int yy_start_stack_ptr;
     int yy_start_stack_depth;
     int *yy_start_stack;
     yy_state_type yy_last_accepting_state;
@@ -893,17 +892,17 @@ void yyset_extra (YY_EXTRA_TYPE user_def
 FILE *yyget_in (yyscan_t yyscanner );
 
 void yyset_in  (FILE * in_str ,yyscan_t yyscanner );
 
 FILE *yyget_out (yyscan_t yyscanner );
 
 void yyset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-yy_size_t yyget_leng (yyscan_t yyscanner );
+int yyget_leng (yyscan_t yyscanner );
 
 char *yyget_text (yyscan_t yyscanner );
 
 int yyget_lineno (yyscan_t yyscanner );
 
 void yyset_lineno (int line_number ,yyscan_t yyscanner );
 
 YYSTYPE * yyget_lval (yyscan_t yyscanner );
@@ -962,17 +961,17 @@ static int input (yyscan_t yyscanner );
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  * is returned in "result".
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		yy_size_t n; \
+		int n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
 		if ( c == '\n' ) \
 			buf[n++] = (char) c; \
 		if ( c == EOF && ferror( yyin ) ) \
 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
 		result = n; \
@@ -1121,17 +1120,17 @@ yy_match:
 
 yy_find_action:
 		yy_act = yy_accept[yy_current_state];
 
 		YY_DO_BEFORE_ACTION;
 
 		if ( yy_act != YY_END_OF_BUFFER && yy_rule_can_match_eol[yy_act] )
 			{
-			yy_size_t yyl;
+			int yyl;
 			for ( yyl = 0; yyl < yyleng; ++yyl )
 				if ( yytext[yyl] == '\n' )
 					   
     do{ yylineno++;
         yycolumn=0;
     }while(0)
 ;
 			}
@@ -1538,29 +1537,29 @@ case 98:
 YY_RULE_SETUP
 {
    yylval->lex.string = NewPoolTString(yytext); 
    return check_type(yyscanner);
 }
 	YY_BREAK
 case 99:
 YY_RULE_SETUP
-{ yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); }
+{ yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
 	YY_BREAK
 case 100:
 YY_RULE_SETUP
-{ yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); }
+{ yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
 	YY_BREAK
 case 101:
 YY_RULE_SETUP
 { context->error(yylineno, "Invalid Octal number.", yytext); context->recover(); return 0;}
 	YY_BREAK
 case 102:
 YY_RULE_SETUP
-{ yylval->lex.i = static_cast<int>(strtol(yytext, 0, 0)); return(INTCONSTANT); }
+{ yylval->lex.i = strtol(yytext, 0, 0); return(INTCONSTANT); }
 	YY_BREAK
 case 103:
 YY_RULE_SETUP
 { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
 	YY_BREAK
 case 104:
 YY_RULE_SETUP
 { yylval->lex.f = static_cast<float>(atof_dot(yytext)); return(FLOATCONSTANT); }
@@ -1959,31 +1958,31 @@ static int yy_get_next_buffer (yyscan_t 
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 		/* don't do the read, it's not guaranteed to return an EOF,
 		 * just force an EOF
 		 */
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
 
 	else
 		{
-			yy_size_t num_to_read =
+			int num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
 
 			/* just a shorter name for the current buffer */
 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
 			int yy_c_buf_p_offset =
 				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 			if ( b->yy_is_our_buffer )
 				{
-				yy_size_t new_size = b->yy_buf_size * 2;
+				int new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
 					b->yy_buf_size += b->yy_buf_size / 8;
 				else
 					b->yy_buf_size *= 2;
 
 				b->yy_ch_buf = (char *)
 					/* Include room in for 2 EOB chars. */
@@ -2004,17 +2003,17 @@ static int yy_get_next_buffer (yyscan_t 
 
 			}
 
 		if ( num_to_read > YY_READ_BUF_SIZE )
 			num_to_read = YY_READ_BUF_SIZE;
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, num_to_read );
+			yyg->yy_n_chars, (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
 
 	if ( yyg->yy_n_chars == 0 )
 		{
 		if ( number_to_move == YY_MORE_ADJ )
 			{
@@ -2129,17 +2128,17 @@ static int yy_get_next_buffer (yyscan_t 
 		 * valid NUL; if not, then we've hit the end of the buffer.
 		 */
 		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
 			/* This was really a NUL. */
 			*yyg->yy_c_buf_p = '\0';
 
 		else
 			{ /* need more input */
-			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 			++yyg->yy_c_buf_p;
 
 			switch ( yy_get_next_buffer( yyscanner ) )
 				{
 				case EOB_ACT_LAST_MATCH:
 					/* This happens because yy_g_n_b()
 					 * sees that we've accumulated a
 					 * token and flags that we need to
@@ -2153,17 +2152,17 @@ static int yy_get_next_buffer (yyscan_t 
 					/* Reset buffer status. */
 					yyrestart(yyin ,yyscanner);
 
 					/*FALLTHROUGH*/
 
 				case EOB_ACT_END_OF_FILE:
 					{
 					if ( yywrap(yyscanner ) )
-						return 0;
+						return EOF;
 
 					if ( ! yyg->yy_did_buffer_switch_on_eof )
 						YY_NEW_FILE;
 #ifdef __cplusplus
 					return yyinput(yyscanner);
 #else
 					return input(yyscanner);
 #endif
@@ -2416,17 +2415,17 @@ void yypop_buffer_state (yyscan_t yyscan
 	}
 }
 
 /* Allocates the stack if it does not exist.
  *  Guarantees space for at least one push.
  */
 static void yyensure_buffer_stack (yyscan_t yyscanner)
 {
-	yy_size_t num_to_alloc;
+	int num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 	if (!yyg->yy_buffer_stack) {
 
 		/* First allocation is just for 2 elements, since we don't know if this
 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
 		 * immediate realloc on the next call.
          */
@@ -2514,21 +2513,22 @@ YY_BUFFER_STATE yy_scan_string (yyconst 
 
 /** Setup the input buffer state to scan the given bytes. The next call to yylex() will
  * scan from a @e copy of @a bytes.
  * @param bytes the byte buffer to scan
  * @param len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n, i;
+	yy_size_t n;
+	int i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
 	buf = (char *) yyalloc(n ,yyscanner );
 	if ( ! buf )
 		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
 
 	for ( i = 0; i < _yybytes_len; ++i )
@@ -2668,17 +2668,17 @@ FILE *yyget_out  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyout;
 }
 
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-yy_size_t yyget_leng  (yyscan_t yyscanner)
+int yyget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
 }
 
 /** Get the current token.
  * @param yyscanner The scanner object.
  */
@@ -2943,21 +2943,21 @@ void *yyrealloc  (void * ptr, yy_size_t 
 
 void yyfree (void * ptr , yyscan_t yyscanner)
 {
 	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
 }
 
 #define YYTABLES_NAME "yytables"
 
-yy_size_t string_input(char* buf, yy_size_t max_size, yyscan_t yyscanner) {
+int string_input(char* buf, int max_size, yyscan_t yyscanner) {
     pp::Token token;
     yyget_extra(yyscanner)->preprocessor.lex(&token);
-    yy_size_t len = token.type == pp::Token::LAST ? 0 : token.text.size();
-    if (len < max_size)
+    int len = token.type == pp::Token::LAST ? 0 : token.text.size();
+    if ((len > 0) && (len < max_size))
         memcpy(buf, token.text.c_str(), len);
     yyset_lineno(EncodeSourceLoc(token.location.file, token.location.line),yyscanner);
 
     if (len >= max_size)
         YY_FATAL_ERROR("Input buffer overflow");
     else if (len > 0)
         buf[len++] = ' ';
     return len;
@@ -3012,30 +3012,27 @@ int glslang_finalize(TParseContext* cont
     if (scanner == NULL) return 0;
     
     context->scanner = NULL;
     yylex_destroy(scanner);
 
     return 0;
 }
 
-int glslang_scan(size_t count, const char* const string[], const int length[],
+int glslang_scan(int count, const char* const string[], const int length[],
                  TParseContext* context) {
     yyrestart(NULL,context->scanner);
     yyset_lineno(EncodeSourceLoc(0, 1),context->scanner);
     context->AfterEOF = false;
 
     // Initialize preprocessor.
     if (!context->preprocessor.init(count, string, length))
         return 1;
 
     // Define extension macros.
     const TExtensionBehavior& extBehavior = context->extensionBehavior();
     for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
          iter != extBehavior.end(); ++iter) {
         context->preprocessor.predefineMacro(iter->first.c_str(), 1);
     }
-    if (context->fragmentPrecisionHigh)
-        context->preprocessor.predefineMacro("GL_FRAGMENT_PRECISION_HIGH", 1);
-
     return 0;
 }
 
--- a/gfx/angle/src/compiler/glslang_tab.cpp
+++ b/gfx/angle/src/compiler/glslang_tab.cpp
@@ -86,19 +86,16 @@
 #pragma warning(disable: 4505)
 #pragma warning(disable: 4701)
 #endif
 
 #include "compiler/SymbolTable.h"
 #include "compiler/ParseHelper.h"
 #include "GLSLANG/ShaderLang.h"
 
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
-
 #define YYLEX_PARAM context->scanner
 
 
 
 /* Enabling traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
 #endif
@@ -655,37 +652,37 @@ static const yytype_int16 yyrhs[] =
       82,    -1,    13,    82,    -1,    20,    82,    -1,    20,   124,
       82,    -1,    19,    82,    -1,   176,    -1,   175,   176,    -1,
      177,    -1,   126,    -1,    -1,   127,   178,   161,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   168,   168,   203,   206,   219,   224,   229,   235,   238,
-     317,   320,   421,   431,   444,   452,   552,   555,   563,   567,
-     574,   578,   585,   591,   600,   608,   663,   670,   680,   683,
-     693,   703,   724,   725,   726,   731,   732,   741,   753,   754,
-     762,   773,   777,   778,   788,   798,   808,   821,   822,   832,
-     845,   849,   853,   857,   858,   871,   872,   885,   886,   899,
-     900,   917,   918,   931,   932,   933,   934,   935,   939,   942,
-     953,   961,   988,   993,  1007,  1045,  1048,  1055,  1063,  1084,
-    1105,  1116,  1145,  1150,  1160,  1165,  1175,  1178,  1181,  1184,
-    1190,  1197,  1200,  1222,  1240,  1264,  1287,  1291,  1309,  1317,
-    1349,  1369,  1458,  1467,  1490,  1493,  1499,  1507,  1515,  1523,
-    1533,  1540,  1543,  1546,  1552,  1555,  1570,  1574,  1578,  1582,
-    1591,  1596,  1601,  1606,  1611,  1616,  1621,  1626,  1631,  1636,
-    1642,  1648,  1654,  1659,  1664,  1673,  1682,  1687,  1700,  1700,
-    1714,  1714,  1723,  1726,  1741,  1777,  1781,  1787,  1795,  1811,
-    1815,  1819,  1820,  1826,  1827,  1828,  1829,  1830,  1834,  1835,
-    1835,  1835,  1845,  1846,  1850,  1850,  1851,  1851,  1856,  1859,
-    1869,  1872,  1878,  1879,  1883,  1891,  1895,  1905,  1910,  1927,
-    1927,  1932,  1932,  1939,  1939,  1947,  1950,  1956,  1959,  1965,
-    1969,  1976,  1983,  1990,  1997,  2008,  2017,  2021,  2028,  2031,
-    2037,  2037
+       0,   165,   165,   200,   203,   216,   221,   226,   232,   235,
+     314,   317,   418,   428,   441,   449,   549,   552,   560,   564,
+     571,   575,   582,   588,   597,   605,   660,   667,   677,   680,
+     690,   700,   721,   722,   723,   728,   729,   738,   750,   751,
+     759,   770,   774,   775,   785,   795,   805,   818,   819,   829,
+     842,   846,   850,   854,   855,   868,   869,   882,   883,   896,
+     897,   914,   915,   928,   929,   930,   931,   932,   936,   939,
+     950,   958,   985,   990,   997,  1035,  1038,  1045,  1053,  1074,
+    1095,  1106,  1135,  1140,  1150,  1155,  1165,  1168,  1171,  1174,
+    1180,  1187,  1190,  1212,  1230,  1254,  1277,  1281,  1299,  1307,
+    1339,  1359,  1448,  1457,  1480,  1483,  1489,  1497,  1505,  1513,
+    1523,  1530,  1533,  1536,  1542,  1545,  1560,  1564,  1568,  1572,
+    1581,  1586,  1591,  1596,  1601,  1606,  1611,  1616,  1621,  1626,
+    1632,  1638,  1644,  1649,  1654,  1663,  1672,  1677,  1690,  1690,
+    1704,  1704,  1713,  1716,  1731,  1767,  1771,  1777,  1785,  1801,
+    1805,  1809,  1810,  1816,  1817,  1818,  1819,  1820,  1824,  1825,
+    1825,  1825,  1835,  1836,  1840,  1840,  1841,  1841,  1846,  1849,
+    1859,  1862,  1868,  1869,  1873,  1881,  1885,  1895,  1900,  1917,
+    1917,  1922,  1922,  1929,  1929,  1937,  1940,  1946,  1949,  1955,
+    1959,  1966,  1973,  1980,  1987,  1998,  2007,  2011,  2018,  2021,
+    2027,  2027
 };
 #endif
 
 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
@@ -2166,46 +2163,46 @@ yyreduce:
             if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode())
                 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", (yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode()->getSymbol().c_str());
             else
                 context->error((yyvsp[(2) - (4)].lex).line, " left of '[' is not of type array, matrix, or vector ", "expression");
             context->recover();
         }
         if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getQualifier() == EvqConst && (yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
             if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) { // constant folding for arrays
-                (yyval.interm.intermTypedNode) = context->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
+                (yyval.interm.intermTypedNode) = context->addConstArrayNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
             } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector()) {  // constant folding for vectors
                 TVectorFields fields;
                 fields.num = 1;
-                fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0); // need to do it this way because v.xy sends fields integer array
+                fields.offsets[0] = (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(); // need to do it this way because v.xy sends fields integer array
                 (yyval.interm.intermTypedNode) = context->addConstVectorNode(fields, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
             } else if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) { // constant folding for matrices
-                (yyval.interm.intermTypedNode) = context->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
+                (yyval.interm.intermTypedNode) = context->addConstMatrixNode((yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
             }
         } else {
             if ((yyvsp[(3) - (4)].interm.intermTypedNode)->getQualifier() == EvqConst) {
-                if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() ) {
+                if (((yyvsp[(1) - (4)].interm.intermTypedNode)->isVector() || (yyvsp[(1) - (4)].interm.intermTypedNode)->isMatrix()) && (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getNominalSize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() && !(yyvsp[(1) - (4)].interm.intermTypedNode)->isArray() ) {
                     std::stringstream extraInfoStream;
-                    extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
+                    extraInfoStream << "field selection out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'";
                     std::string extraInfo = extraInfoStream.str();
                     context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
                     context->recover();
                 } else {
                     if ((yyvsp[(1) - (4)].interm.intermTypedNode)->isArray()) {
                         if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize() == 0) {
-                            if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0)) {
-                                if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0), true, (yyvsp[(2) - (4)].lex).line))
+                            if ((yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getMaxArraySize() <= (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst()) {
+                                if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst(), true, (yyvsp[(2) - (4)].lex).line))
                                     context->recover();
                             } else {
                                 if (context->arraySetMaxSize((yyvsp[(1) - (4)].interm.intermTypedNode)->getAsSymbolNode(), (yyvsp[(1) - (4)].interm.intermTypedNode)->getTypePointer(), 0, false, (yyvsp[(2) - (4)].lex).line))
                                     context->recover();
                             }
-                        } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) {
+                        } else if ( (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() >= (yyvsp[(1) - (4)].interm.intermTypedNode)->getType().getArraySize()) {
                             std::stringstream extraInfoStream;
-                            extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getIConst(0) << "'";
+                            extraInfoStream << "array index out of range '" << (yyvsp[(3) - (4)].interm.intermTypedNode)->getAsConstantUnion()->getUnionArrayPointer()->getIConst() << "'";
                             std::string extraInfo = extraInfoStream.str();
                             context->error((yyvsp[(2) - (4)].lex).line, "", "[", extraInfo.c_str());
                             context->recover();
                         }
                     }
                     (yyval.interm.intermTypedNode) = context->intermediate.addIndex(EOpIndexDirect, (yyvsp[(1) - (4)].interm.intermTypedNode), (yyvsp[(3) - (4)].interm.intermTypedNode), (yyvsp[(2) - (4)].lex).line);
                 }
             } else {
@@ -2463,17 +2460,17 @@ yyreduce:
                     // this is how we know whether the given function is a builtIn function or a user defined function
                     // if builtIn == false, it's a userDefined -> could be an overloaded builtIn function also
                     // if builtIn == true, it's definitely a builtIn function with EOpNull
                     if (!builtIn)
                         (yyval.interm.intermTypedNode)->getAsAggregate()->setUserDefined();
                     (yyval.interm.intermTypedNode)->getAsAggregate()->setName(fnCandidate->getMangledName());
 
                     TQualifier qual;
-                    for (size_t i = 0; i < fnCandidate->getParamCount(); ++i) {
+                    for (int i = 0; i < fnCandidate->getParamCount(); ++i) {
                         qual = fnCandidate->getParam(i).type->getQualifier();
                         if (qual == EvqOut || qual == EvqInOut) {
                             if (context->lValueErrorCheck((yyval.interm.intermTypedNode)->getLine(), "assign", (yyval.interm.intermTypedNode)->getAsAggregate()->getSequence()[i]->getAsTyped())) {
                                 context->error((yyvsp[(1) - (1)].interm).intermNode->getLine(), "Constant value cannot be passed for 'out' or 'inout' parameters.", "Error");
                                 context->recover();
                             }
                         }
                     }
@@ -3049,17 +3046,17 @@ yyreduce:
 
     {
         TFunction &function = *((yyvsp[(1) - (2)].interm).function);
         
         TIntermAggregate *prototype = new TIntermAggregate;
         prototype->setType(function.getReturnType());
         prototype->setName(function.getName());
         
-        for (size_t i = 0; i < function.getParamCount(); i++)
+        for (int i = 0; i < function.getParamCount(); i++)
         {
             const TParameter &param = function.getParam(i);
             if (param.name != 0)
             {
                 TVariable *variable = new TVariable(param.name, *param.type);
                 
                 prototype = context->intermediate.growAggregate(prototype, context->intermediate.addSymbol(variable->getUniqueId(), variable->getName(), variable->getType(), (yyvsp[(1) - (2)].interm).line), (yyvsp[(1) - (2)].interm).line);
             }
@@ -3083,24 +3080,17 @@ yyreduce:
             (yyvsp[(1) - (2)].interm).intermAggregate->setOp(EOpDeclaration);
         (yyval.interm.intermNode) = (yyvsp[(1) - (2)].interm).intermAggregate;
     }
     break;
 
   case 73:
 
     {
-        if (((yyvsp[(2) - (4)].interm.precision) == EbpHigh) && (context->shaderType == SH_FRAGMENT_SHADER) && !context->fragmentPrecisionHigh) {
-            context->error((yyvsp[(1) - (4)].lex).line, "precision is not supported in fragment shader", "highp");
-            context->recover();
-        }
-        if (!context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type), (yyvsp[(2) - (4)].interm.precision) )) {
-            context->error((yyvsp[(1) - (4)].lex).line, "illegal type argument for default precision qualifier", getBasicString((yyvsp[(3) - (4)].interm.type).type));
-            context->recover();
-        }
+        context->symbolTable.setDefaultPrecision( (yyvsp[(3) - (4)].interm.type).type, (yyvsp[(2) - (4)].interm.precision) );
         (yyval.interm.intermNode) = 0;
     }
     break;
 
   case 74:
 
     {
         //
@@ -3112,17 +3102,17 @@ yyreduce:
         // Redeclarations are allowed.  But, return types and parameter qualifiers must match.
         //
         TFunction* prevDec = static_cast<TFunction*>(context->symbolTable.find((yyvsp[(1) - (2)].interm.function)->getMangledName()));
         if (prevDec) {
             if (prevDec->getReturnType() != (yyvsp[(1) - (2)].interm.function)->getReturnType()) {
                 context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same return type", (yyvsp[(1) - (2)].interm.function)->getReturnType().getBasicString());
                 context->recover();
             }
-            for (size_t i = 0; i < prevDec->getParamCount(); ++i) {
+            for (int i = 0; i < prevDec->getParamCount(); ++i) {
                 if (prevDec->getParam(i).type->getQualifier() != (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifier()) {
                     context->error((yyvsp[(2) - (2)].lex).line, "overloaded functions must have the same parameter qualifiers", (yyvsp[(1) - (2)].interm.function)->getParam(i).type->getQualifierString());
                     context->recover();
                 }
             }
         }
 
         //
@@ -4478,17 +4468,17 @@ yyreduce:
         // Insert parameters into the symbol table.
         // If the parameter has no name, it's not an error, just don't insert it
         // (could be used for unused args).
         //
         // Also, accumulate the list of parameters into the HIL, so lower level code
         // knows where to find parameters.
         //
         TIntermAggregate* paramNodes = new TIntermAggregate;
-        for (size_t i = 0; i < function->getParamCount(); i++) {
+        for (int i = 0; i < function->getParamCount(); i++) {
             const TParameter& param = function->getParam(i);
             if (param.name != 0) {
                 TVariable *variable = new TVariable(param.name, *param.type);
                 //
                 // Insert the parameters with name in the symbol table.
                 //
                 if (! context->symbolTable.insert(*variable)) {
                     context->error((yyvsp[(1) - (1)].interm).line, "redefinition", variable->getName().c_str());
@@ -4755,8 +4745,9 @@ yyreturn:
 
 
 
 
 int glslang_parse(TParseContext* context) {
     return yyparse(context);
 }
 
+
--- a/gfx/angle/src/compiler/intermediate.h
+++ b/gfx/angle/src/compiler/intermediate.h
@@ -1,10 +1,10 @@
 //
-// Copyright (c) 2002-2013 The ANGLE Project Authors. All rights reserved.
+// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 //
 // Definition of the in-memory high-level intermediate representation
 // of shaders.  This is a tree that parser creates.
 //
@@ -178,17 +178,17 @@ enum TOperator {
     EOpInitialize,
     EOpAddAssign,
     EOpSubAssign,
     EOpMulAssign,
     EOpVectorTimesMatrixAssign,
     EOpVectorTimesScalarAssign,
     EOpMatrixTimesScalarAssign,
     EOpMatrixTimesMatrixAssign,
-    EOpDivAssign
+    EOpDivAssign,
 };
 
 extern const char* getOperatorString(TOperator op);
 
 class TIntermTraverser;
 class TIntermAggregate;
 class TIntermBinary;
 class TIntermUnary;
@@ -264,17 +264,17 @@ protected:
 };
 
 //
 // Handle for, do-while, and while loops.
 //
 enum TLoopType {
     ELoopFor,
     ELoopWhile,
-    ELoopDoWhile
+    ELoopDoWhile,
 };
 
 class TIntermLoop : public TIntermNode {
 public:
     TIntermLoop(TLoopType aType,
                 TIntermNode *aInit, TIntermTyped* aCond, TIntermTyped* aExpr,
                 TIntermNode* aBody) :
             type(aType),
@@ -353,20 +353,17 @@ protected:
     TString originalSymbol;
 };
 
 class TIntermConstantUnion : public TIntermTyped {
 public:
     TIntermConstantUnion(ConstantUnion *unionPointer, const TType& t) : TIntermTyped(t), unionArrayPointer(unionPointer) { }
 
     ConstantUnion* getUnionArrayPointer() const { return unionArrayPointer; }
-    
-    int getIConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getIConst() : 0; }
-    float getFConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getFConst() : 0.0f; }
-    bool getBConst(int index) const { return unionArrayPointer ? unionArrayPointer[index].getBConst() : false; }
+    void setUnionArrayPointer(ConstantUnion *c) { unionArrayPointer = c; }
 
     virtual TIntermConstantUnion* getAsConstantUnion()  { return this; }
     virtual void traverse(TIntermTraverser*);
 
     TIntermTyped* fold(TOperator, TIntermTyped*, TInfoSink&);
 
 protected:
     ConstantUnion *unionArrayPointer;
--- a/gfx/angle/src/compiler/osinclude.h
+++ b/gfx/angle/src/compiler/osinclude.h
@@ -39,18 +39,18 @@
 
 //
 // Thread Local Storage Operations
 //
 #if defined(ANGLE_OS_WIN)
 typedef DWORD OS_TLSIndex;
 #define OS_INVALID_TLS_INDEX (TLS_OUT_OF_INDEXES)
 #elif defined(ANGLE_OS_POSIX)
-typedef pthread_key_t OS_TLSIndex;
-#define OS_INVALID_TLS_INDEX (static_cast<OS_TLSIndex>(-1))
+typedef unsigned int OS_TLSIndex;
+#define OS_INVALID_TLS_INDEX 0xFFFFFFFF
 #endif  // ANGLE_OS_WIN
 
 OS_TLSIndex OS_AllocTLSIndex();
 bool OS_SetTLSValue(OS_TLSIndex nIndex, void *lpvValue);
 bool OS_FreeTLSIndex(OS_TLSIndex nIndex);
 
 inline void* OS_GetTLSValue(OS_TLSIndex nIndex)
 {
new file mode 100644
--- a/gfx/angle/src/compiler/parseConst.cpp
+++ b/gfx/angle/src/compiler/parseConst.cpp
@@ -146,23 +146,16 @@ bool TConstTraverser::visitSelection(Vis
 {
     infoSink.info.message(EPrefixInternalError, "Selection Node found in constant constructor", node->getLine());
     error = true;
     return false;
 }
 
 void TConstTraverser::visitConstantUnion(TIntermConstantUnion* node)
 {
-    if (!node->getUnionArrayPointer())
-    {
-        // The constant was not initialized, this should already have been logged
-        assert(infoSink.info.size() != 0);
-        return;
-    }
-
     ConstantUnion* leftUnionArray = unionArray;
     int instanceSize = type.getObjectSize();
 
     if (index >= instanceSize)
         return;
 
     if (!singleConstantParam) {
         int size = node->getType().getObjectSize();
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/preprocessor/Diagnostics.h
@@ -0,0 +1,87 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
+#define COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
+
+#include <string>
+
+namespace pp
+{
+
+struct SourceLocation;
+
+// Base class for reporting diagnostic messages.
+// Derived classes are responsible for formatting and printing the messages.
+class Diagnostics
+{
+  public:
+    enum Severity
+    {
+        ERROR,
+        WARNING
+    };
+    enum ID
+    {
+        ERROR_BEGIN,
+        INTERNAL_ERROR,
+        OUT_OF_MEMORY,
+        INVALID_CHARACTER,
+        INVALID_NUMBER,
+        INTEGER_OVERFLOW,
+        FLOAT_OVERFLOW,
+        TOKEN_TOO_LONG,
+        INVALID_EXPRESSION,
+        DIVISION_BY_ZERO,
+        EOF_IN_COMMENT,
+        UNEXPECTED_TOKEN,
+        DIRECTIVE_INVALID_NAME,
+        MACRO_NAME_RESERVED,
+        MACRO_REDEFINED,
+        MACRO_PREDEFINED_REDEFINED,
+        MACRO_PREDEFINED_UNDEFINED,
+        MACRO_UNTERMINATED_INVOCATION,
+        MACRO_TOO_FEW_ARGS,
+        MACRO_TOO_MANY_ARGS,
+        CONDITIONAL_ENDIF_WITHOUT_IF,
+        CONDITIONAL_ELSE_WITHOUT_IF,
+        CONDITIONAL_ELSE_AFTER_ELSE,
+        CONDITIONAL_ELIF_WITHOUT_IF,
+        CONDITIONAL_ELIF_AFTER_ELSE,
+        CONDITIONAL_UNTERMINATED,
+        INVALID_EXTENSION_NAME,
+        INVALID_EXTENSION_BEHAVIOR,
+        INVALID_EXTENSION_DIRECTIVE,
+        INVALID_VERSION_NUMBER,
+        INVALID_VERSION_DIRECTIVE,
+        VERSION_NOT_FIRST_STATEMENT,
+        INVALID_LINE_NUMBER,
+        INVALID_FILE_NUMBER,
+        INVALID_LINE_DIRECTIVE,
+        ERROR_END,
+
+        WARNING_BEGIN,
+        EOF_IN_DIRECTIVE,
+        CONDITIONAL_UNEXPECTED_TOKEN,
+        UNRECOGNIZED_PRAGMA,
+        WARNING_END
+    };
+
+    virtual ~Diagnostics();
+
+    void report(ID id, const SourceLocation& loc, const std::string& text);
+
+  protected:
+    Severity severity(ID id);
+    std::string message(ID id);
+
+    virtual void print(ID id,
+                       const SourceLocation& loc,
+                       const std::string& text) = 0;
+};
+
+}  // namespace pp
+#endif  // COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
deleted file mode 100644
--- a/gfx/angle/src/compiler/preprocessor/DiagnosticsBase.cpp
+++ /dev/null
@@ -1,127 +0,0 @@
-//
-// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-#include "DiagnosticsBase.h"
-
-#include <cassert>
-
-namespace pp
-{
-
-Diagnostics::~Diagnostics()
-{
-}
-
-void Diagnostics::report(ID id,
-                         const SourceLocation& loc,
-                         const std::string& text)
-{
-    // TODO(alokp): Keep a count of errors and warnings.
-    print(id, loc, text);
-}
-
-Diagnostics::Severity Diagnostics::severity(ID id)
-{
-    if ((id > ERROR_BEGIN) && (id < ERROR_END))
-        return ERROR;
-
-    if ((id > WARNING_BEGIN) && (id < WARNING_END))
-        return WARNING;
-
-    assert(false);
-    return ERROR;
-}
-
-std::string Diagnostics::message(ID id)
-{
-    switch (id)
-    {
-      // Errors begin.
-      case INTERNAL_ERROR:
-          return "internal error";
-      case OUT_OF_MEMORY:
-          return "out of memory";
-      case INVALID_CHARACTER:
-          return "invalid character";
-      case INVALID_NUMBER:
-          return "invalid number";
-      case INTEGER_OVERFLOW:
-          return "integer overflow";
-      case FLOAT_OVERFLOW:
-          return "float overflow";
-      case TOKEN_TOO_LONG:
-          return "token too long";
-      case INVALID_EXPRESSION:
-          return "invalid expression";
-      case DIVISION_BY_ZERO:
-          return "division by zero";
-      case EOF_IN_COMMENT:
-          return "unexpected end of file found in comment";
-      case UNEXPECTED_TOKEN:
-          return "unexpected token";
-      case DIRECTIVE_INVALID_NAME:
-          return "invalid directive name";
-      case MACRO_NAME_RESERVED:
-          return "macro name is reserved";
-      case MACRO_REDEFINED:
-          return "macro redefined";
-      case MACRO_PREDEFINED_REDEFINED:
-          return "predefined macro redefined";
-      case MACRO_PREDEFINED_UNDEFINED:
-          return "predefined macro undefined";
-      case MACRO_UNTERMINATED_INVOCATION:
-          return "unterminated macro invocation";
-      case MACRO_TOO_FEW_ARGS:
-          return "Not enough arguments for macro";
-      case MACRO_TOO_MANY_ARGS:
-          return "Too many arguments for macro";
-      case CONDITIONAL_ENDIF_WITHOUT_IF:
-          return "unexpected #endif found without a matching #if";
-      case CONDITIONAL_ELSE_WITHOUT_IF:
-          return "unexpected #else found without a matching #if";
-      case CONDITIONAL_ELSE_AFTER_ELSE:
-          return "unexpected #else found after another #else";
-      case CONDITIONAL_ELIF_WITHOUT_IF:
-          return "unexpected #elif found without a matching #if";
-      case CONDITIONAL_ELIF_AFTER_ELSE:
-          return "unexpected #elif found after #else";
-      case CONDITIONAL_UNTERMINATED:
-          return "unexpected end of file found in conditional block";
-      case INVALID_EXTENSION_NAME:
-          return "invalid extension name";
-      case INVALID_EXTENSION_BEHAVIOR:
-          return "invalid extension behavior";
-      case INVALID_EXTENSION_DIRECTIVE:
-          return "invalid extension directive";
-      case INVALID_VERSION_NUMBER:
-          return "invalid version number";
-      case INVALID_VERSION_DIRECTIVE:
-          return "invalid version directive";
-      case VERSION_NOT_FIRST_STATEMENT:
-        return "#version directive must occur before anything else, "
-               "except for comments and white space";
-      case INVALID_LINE_NUMBER:
-          return "invalid line number";
-      case INVALID_FILE_NUMBER:
-          return "invalid file number";
-      case INVALID_LINE_DIRECTIVE:
-          return "invalid line directive";
-      // Errors end.
-      // Warnings begin.
-      case EOF_IN_DIRECTIVE:
-          return "unexpected end of file found in directive";
-      case CONDITIONAL_UNEXPECTED_TOKEN:
-          return "unexpected token after conditional expression";
-      case UNRECOGNIZED_PRAGMA:
-          return "unrecognized pragma";
-      // Warnings end.
-      default:
-          assert(false);
-          return "";
-    }
-}
-
-}  // namespace pp
deleted file mode 100644
--- a/gfx/angle/src/compiler/preprocessor/DiagnosticsBase.h
+++ /dev/null
@@ -1,87 +0,0 @@
-//
-// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-#ifndef COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
-#define COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
-
-#include <string>
-
-namespace pp
-{
-
-struct SourceLocation;
-
-// Base class for reporting diagnostic messages.
-// Derived classes are responsible for formatting and printing the messages.
-class Diagnostics
-{
-  public:
-    enum Severity
-    {
-        ERROR,
-        WARNING
-    };
-    enum ID
-    {
-        ERROR_BEGIN,
-        INTERNAL_ERROR,
-        OUT_OF_MEMORY,
-        INVALID_CHARACTER,
-        INVALID_NUMBER,
-        INTEGER_OVERFLOW,
-        FLOAT_OVERFLOW,
-        TOKEN_TOO_LONG,
-        INVALID_EXPRESSION,
-        DIVISION_BY_ZERO,
-        EOF_IN_COMMENT,
-        UNEXPECTED_TOKEN,
-        DIRECTIVE_INVALID_NAME,
-        MACRO_NAME_RESERVED,
-        MACRO_REDEFINED,
-        MACRO_PREDEFINED_REDEFINED,
-        MACRO_PREDEFINED_UNDEFINED,
-        MACRO_UNTERMINATED_INVOCATION,
-        MACRO_TOO_FEW_ARGS,
-        MACRO_TOO_MANY_ARGS,
-        CONDITIONAL_ENDIF_WITHOUT_IF,
-        CONDITIONAL_ELSE_WITHOUT_IF,
-        CONDITIONAL_ELSE_AFTER_ELSE,
-        CONDITIONAL_ELIF_WITHOUT_IF,
-        CONDITIONAL_ELIF_AFTER_ELSE,
-        CONDITIONAL_UNTERMINATED,
-        INVALID_EXTENSION_NAME,
-        INVALID_EXTENSION_BEHAVIOR,
-        INVALID_EXTENSION_DIRECTIVE,
-        INVALID_VERSION_NUMBER,
-        INVALID_VERSION_DIRECTIVE,
-        VERSION_NOT_FIRST_STATEMENT,
-        INVALID_LINE_NUMBER,
-        INVALID_FILE_NUMBER,
-        INVALID_LINE_DIRECTIVE,
-        ERROR_END,
-
-        WARNING_BEGIN,
-        EOF_IN_DIRECTIVE,
-        CONDITIONAL_UNEXPECTED_TOKEN,
-        UNRECOGNIZED_PRAGMA,
-        WARNING_END
-    };
-
-    virtual ~Diagnostics();
-
-    void report(ID id, const SourceLocation& loc, const std::string& text);
-
-  protected:
-    Severity severity(ID id);
-    std::string message(ID id);
-
-    virtual void print(ID id,
-                       const SourceLocation& loc,
-                       const std::string& text) = 0;
-};
-
-}  // namespace pp
-#endif  // COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/preprocessor/DirectiveHandler.h
@@ -0,0 +1,43 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
+#define COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
+
+#include <string>
+
+namespace pp
+{
+
+struct SourceLocation;
+
+// Base class for handling directives.
+// Preprocessor uses this class to notify the clients about certain
+// preprocessor directives. Derived classes are responsible for
+// handling them in an appropriate manner.
+class DirectiveHandler
+{
+  public:
+    virtual ~DirectiveHandler();
+
+    virtual void handleError(const SourceLocation& loc,
+                             const std::string& msg) = 0;
+
+    // Handle pragma of form: #pragma name[(value)]
+    virtual void handlePragma(const SourceLocation& loc,
+                              const std::string& name,
+                              const std::string& value) = 0;
+
+    virtual void handleExtension(const SourceLocation& loc,
+                                 const std::string& name,
+                                 const std::string& behavior) = 0;
+
+    virtual void handleVersion(const SourceLocation& loc,
+                               int version) = 0;
+};
+
+}  // namespace pp
+#endif  // COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
deleted file mode 100644
--- a/gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.cpp
+++ /dev/null
@@ -1,16 +0,0 @@
-//
-// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-#include "DirectiveHandlerBase.h"
-
-namespace pp
-{
-
-DirectiveHandler::~DirectiveHandler()
-{
-}
-
-}  // namespace pp
deleted file mode 100644
--- a/gfx/angle/src/compiler/preprocessor/DirectiveHandlerBase.h
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-#ifndef COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
-#define COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
-
-#include <string>
-
-namespace pp
-{
-
-struct SourceLocation;
-
-// Base class for handling directives.
-// Preprocessor uses this class to notify the clients about certain
-// preprocessor directives. Derived classes are responsible for
-// handling them in an appropriate manner.
-class DirectiveHandler
-{
-  public:
-    virtual ~DirectiveHandler();
-
-    virtual void handleError(const SourceLocation& loc,
-                             const std::string& msg) = 0;
-
-    // Handle pragma of form: #pragma name[(value)]
-    virtual void handlePragma(const SourceLocation& loc,
-                              const std::string& name,
-                              const std::string& value) = 0;
-
-    virtual void handleExtension(const SourceLocation& loc,
-                                 const std::string& name,
-                                 const std::string& behavior) = 0;
-
-    virtual void handleVersion(const SourceLocation& loc,
-                               int version) = 0;
-};
-
-}  // namespace pp
-#endif  // COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
--- a/gfx/angle/src/compiler/preprocessor/DirectiveParser.cpp
+++ b/gfx/angle/src/compiler/preprocessor/DirectiveParser.cpp
@@ -5,18 +5,18 @@
 //
 
 #include "DirectiveParser.h"
 
 #include <cassert>
 #include <cstdlib>
 #include <sstream>
 
-#include "DiagnosticsBase.h"
-#include "DirectiveHandlerBase.h"
+#include "Diagnostics.h"
+#include "DirectiveHandler.h"
 #include "ExpressionParser.h"
 #include "MacroExpander.h"
 #include "Token.h"
 #include "Tokenizer.h"
 
 namespace {
 enum DirectiveType
 {
--- a/gfx/angle/src/compiler/preprocessor/ExpressionParser.cpp
+++ b/gfx/angle/src/compiler/preprocessor/ExpressionParser.cpp
@@ -80,42 +80,36 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 // This file is auto-generated by generate_parser.sh. DO NOT EDIT!
 
 #if defined(__GNUC__)
 // Triggered by the auto-generated pplval variable.
-#if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#else
 #pragma GCC diagnostic ignored "-Wuninitialized"
-#endif
 #elif defined(_MSC_VER)
 #pragma warning(disable: 4065 4701)
 #endif
 
 #include "ExpressionParser.h"
 
 #include <cassert>
 #include <sstream>
 
-#include "DiagnosticsBase.h"
+#include "Diagnostics.h"
 #include "Lexer.h"
 #include "Token.h"
 
 #if defined(_MSC_VER)
 typedef __int64 YYSTYPE;
 #else
 #include <stdint.h>
 typedef intmax_t YYSTYPE;
 #endif  // _MSC_VER
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_DECLARED 1
 
 namespace {
 struct Context
 {
     pp::Diagnostics* diagnostics;
     pp::Lexer* lexer;
@@ -468,19 +462,19 @@ static const yytype_int8 yyrhs[] =
       -1,    29,    20,    29,    -1,    29,    19,    29,    -1,    23,
       29,    -1,    24,    29,    -1,    18,    29,    -1,    17,    29,
       -1,    25,    29,    26,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
 static const yytype_uint8 yyrline[] =
 {
-       0,    90,    90,    97,    98,   101,   104,   107,   110,   113,
-     116,   119,   122,   125,   128,   131,   134,   137,   140,   143,
-     156,   169,   172,   175,   178,   181,   184
+       0,    85,    85,    92,    93,    96,    99,   102,   105,   108,
+     111,   114,   117,   120,   123,   126,   129,   132,   135,   138,
+     151,   164,   167,   170,   173,   176,   179
 };
 #endif
 
 #if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
    First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
 static const char *const yytname[] =
 {
--- a/gfx/angle/src/compiler/preprocessor/ExpressionParser.y
+++ b/gfx/angle/src/compiler/preprocessor/ExpressionParser.y
@@ -17,42 +17,36 @@ WHICH GENERATES THE GLSL ES preprocessor
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 // This file is auto-generated by generate_parser.sh. DO NOT EDIT!
 
 #if defined(__GNUC__)
 // Triggered by the auto-generated pplval variable.
-#if !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
-#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
-#else
 #pragma GCC diagnostic ignored "-Wuninitialized"
-#endif
 #elif defined(_MSC_VER)
 #pragma warning(disable: 4065 4701)
 #endif
 
 #include "ExpressionParser.h"
 
 #include <cassert>
 #include <sstream>
 
-#include "DiagnosticsBase.h"
+#include "Diagnostics.h"
 #include "Lexer.h"
 #include "Token.h"
 
 #if defined(_MSC_VER)
 typedef __int64 YYSTYPE;
 #else
 #include <stdint.h>
 typedef intmax_t YYSTYPE;
 #endif  // _MSC_VER
-#define YYENABLE_NLS 0
-#define YYLTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_TRIVIAL 1
 #define YYSTYPE_IS_DECLARED 1
 
 namespace {
 struct Context
 {
     pp::Diagnostics* diagnostics;
     pp::Lexer* lexer;
--- a/gfx/angle/src/compiler/preprocessor/Input.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Input.cpp
@@ -12,34 +12,35 @@
 
 namespace pp
 {
 
 Input::Input() : mCount(0), mString(0)
 {
 }
 
-Input::Input(size_t count, const char* const string[], const int length[]) :
+Input::Input(int count, const char* const string[], const int length[]) :
     mCount(count),
     mString(string)
 {
+    assert(mCount >= 0);
     mLength.reserve(mCount);
-    for (size_t i = 0; i < mCount; ++i)
+    for (int i = 0; i < mCount; ++i)
     {
         int len = length ? length[i] : -1;
         mLength.push_back(len < 0 ? std::strlen(mString[i]) : len);
     }
 }
 
-size_t Input::read(char* buf, size_t maxSize)
+int Input::read(char* buf, int maxSize)
 {
-    size_t nRead = 0;
+    int nRead = 0;
     while ((nRead < maxSize) && (mReadLoc.sIndex < mCount))
     {
-        size_t size = mLength[mReadLoc.sIndex] - mReadLoc.cIndex;
+        int size = mLength[mReadLoc.sIndex] - mReadLoc.cIndex;
         size = std::min(size, maxSize);
         std::memcpy(buf + nRead, mString[mReadLoc.sIndex] + mReadLoc.cIndex, size);
         nRead += size;
         mReadLoc.cIndex += size;
 
         // Advance string if we reached the end of current string.
         if (mReadLoc.cIndex == mLength[mReadLoc.sIndex])
         {
--- a/gfx/angle/src/compiler/preprocessor/Input.h
+++ b/gfx/angle/src/compiler/preprocessor/Input.h
@@ -2,48 +2,47 @@
 // Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #ifndef COMPILER_PREPROCESSOR_INPUT_H_
 #define COMPILER_PREPROCESSOR_INPUT_H_
 
-#include <stddef.h>
 #include <vector>
 
 namespace pp
 {
 
 // Holds and reads input for Lexer.
 class Input
 {
   public:
     Input();
-    Input(size_t count, const char* const string[], const int length[]);
+    Input(int count, const char* const string[], const int length[]);
 
-    size_t count() const { return mCount; }
-    const char* string(size_t index) const { return mString[index]; }
-    size_t length(size_t index) const { return mLength[index]; }
+    int count() const { return mCount; }
+    const char* string(int index) const { return mString[index]; }
+    int length(int index) const { return mLength[index]; }
 
-    size_t read(char* buf, size_t maxSize);
+    int read(char* buf, int maxSize);
 
     struct Location
     {
-        size_t sIndex;  // String index;
-        size_t cIndex;  // Char index.
+        int sIndex;  // String index;
+        int cIndex;  // Char index.
 
         Location() : sIndex(0), cIndex(0) { }
     };
     const Location& readLoc() const { return mReadLoc; }
 
   private:
     // Input.
-    size_t mCount;
+    int mCount;
     const char* const* mString;
-    std::vector<size_t> mLength;
+    std::vector<int> mLength;
 
     Location mReadLoc;
 };
 
 }  // namespace pp
 #endif  // COMPILER_PREPROCESSOR_INPUT_H_
 
--- a/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp
+++ b/gfx/angle/src/compiler/preprocessor/MacroExpander.cpp
@@ -4,17 +4,17 @@
 // found in the LICENSE file.
 //
 
 #include "MacroExpander.h"
 
 #include <algorithm>
 #include <sstream>
 
-#include "DiagnosticsBase.h"
+#include "Diagnostics.h"
 #include "Token.h"
 
 namespace pp
 {
 
 class TokenLexer : public Lexer
 {
  public:
--- a/gfx/angle/src/compiler/preprocessor/Preprocessor.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Preprocessor.cpp
@@ -4,17 +4,17 @@
 // found in the LICENSE file.
 //
 
 #include "Preprocessor.h"
 
 #include <cassert>
 #include <sstream>
 
-#include "DiagnosticsBase.h"
+#include "Diagnostics.h"
 #include "DirectiveParser.h"
 #include "Macro.h"
 #include "MacroExpander.h"
 #include "Token.h"
 #include "Tokenizer.h"
 
 namespace pp
 {
@@ -43,17 +43,17 @@ Preprocessor::Preprocessor(Diagnostics* 
     mImpl = new PreprocessorImpl(diagnostics, directiveHandler);
 }
 
 Preprocessor::~Preprocessor()
 {
     delete mImpl;
 }
 
-bool Preprocessor::init(size_t count,
+bool Preprocessor::init(int count,
                         const char* const string[],
                         const int length[])
 {
     static const int kGLSLVersion = 100;
 
     // Add standard pre-defined macros.
     predefineMacro("__LINE__", 0);
     predefineMacro("__FILE__", 0);
--- a/gfx/angle/src/compiler/preprocessor/Preprocessor.h
+++ b/gfx/angle/src/compiler/preprocessor/Preprocessor.h
@@ -2,18 +2,16 @@
 // Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #ifndef COMPILER_PREPROCESSOR_PREPROCESSOR_H_
 #define COMPILER_PREPROCESSOR_PREPROCESSOR_H_
 
-#include <stddef.h>
-
 #include "pp_utils.h"
 
 namespace pp
 {
 
 class Diagnostics;
 class DirectiveHandler;
 struct PreprocessorImpl;
@@ -29,17 +27,17 @@ class Preprocessor
     // string: specifies an array of pointers to strings.
     // length: specifies an array of string lengths.
     // If length is NULL, each string is assumed to be null terminated.
     // If length is a value other than NULL, it points to an array containing
     // a string length for each of the corresponding elements of string.
     // Each element in the length array may contain the length of the
     // corresponding string or a value less than 0 to indicate that the string
     // is null terminated.
-    bool init(size_t count, const char* const string[], const int length[]);
+    bool init(int count, const char* const string[], const int length[]);
     // Adds a pre-defined macro.
     void predefineMacro(const char* name, int value);
 
     void lex(Token* token);
 
   private:
     PP_DISALLOW_COPY_AND_ASSIGN(Preprocessor);
 
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/preprocessor/PreprocessorDiagnostics.cpp
@@ -0,0 +1,127 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "Diagnostics.h"
+
+#include <cassert>
+
+namespace pp
+{
+
+Diagnostics::~Diagnostics()
+{
+}
+
+void Diagnostics::report(ID id,
+                         const SourceLocation& loc,
+                         const std::string& text)
+{
+    // TODO(alokp): Keep a count of errors and warnings.
+    print(id, loc, text);
+}
+
+Diagnostics::Severity Diagnostics::severity(ID id)
+{
+    if ((id > ERROR_BEGIN) && (id < ERROR_END))
+        return ERROR;
+
+    if ((id > WARNING_BEGIN) && (id < WARNING_END))
+        return WARNING;
+
+    assert(false);
+    return ERROR;
+}
+
+std::string Diagnostics::message(ID id)
+{
+    switch (id)
+    {
+      // Errors begin.
+      case INTERNAL_ERROR:
+          return "internal error";
+      case OUT_OF_MEMORY:
+          return "out of memory";
+      case INVALID_CHARACTER:
+          return "invalid character";
+      case INVALID_NUMBER:
+          return "invalid number";
+      case INTEGER_OVERFLOW:
+          return "integer overflow";
+      case FLOAT_OVERFLOW:
+          return "float overflow";
+      case TOKEN_TOO_LONG:
+          return "token too long";
+      case INVALID_EXPRESSION:
+          return "invalid expression";
+      case DIVISION_BY_ZERO:
+          return "division by zero";
+      case EOF_IN_COMMENT:
+          return "unexpected end of file found in comment";
+      case UNEXPECTED_TOKEN:
+          return "unexpected token";
+      case DIRECTIVE_INVALID_NAME:
+          return "invalid directive name";
+      case MACRO_NAME_RESERVED:
+          return "macro name is reserved";
+      case MACRO_REDEFINED:
+          return "macro redefined";
+      case MACRO_PREDEFINED_REDEFINED:
+          return "predefined macro redefined";
+      case MACRO_PREDEFINED_UNDEFINED:
+          return "predefined macro undefined";
+      case MACRO_UNTERMINATED_INVOCATION:
+          return "unterminated macro invocation";
+      case MACRO_TOO_FEW_ARGS:
+          return "Not enough arguments for macro";
+      case MACRO_TOO_MANY_ARGS:
+          return "Too many arguments for macro";
+      case CONDITIONAL_ENDIF_WITHOUT_IF:
+          return "unexpected #endif found without a matching #if";
+      case CONDITIONAL_ELSE_WITHOUT_IF:
+          return "unexpected #else found without a matching #if";
+      case CONDITIONAL_ELSE_AFTER_ELSE:
+          return "unexpected #else found after another #else";
+      case CONDITIONAL_ELIF_WITHOUT_IF:
+          return "unexpected #elif found without a matching #if";
+      case CONDITIONAL_ELIF_AFTER_ELSE:
+          return "unexpected #elif found after #else";
+      case CONDITIONAL_UNTERMINATED:
+          return "unexpected end of file found in conditional block";
+      case INVALID_EXTENSION_NAME:
+          return "invalid extension name";
+      case INVALID_EXTENSION_BEHAVIOR:
+          return "invalid extension behavior";
+      case INVALID_EXTENSION_DIRECTIVE:
+          return "invalid extension directive";
+      case INVALID_VERSION_NUMBER:
+          return "invalid version number";
+      case INVALID_VERSION_DIRECTIVE:
+          return "invalid version directive";
+      case VERSION_NOT_FIRST_STATEMENT:
+        return "#version directive must occur before anything else, "
+               "except for comments and white space";
+      case INVALID_LINE_NUMBER:
+          return "invalid line number";
+      case INVALID_FILE_NUMBER:
+          return "invalid file number";
+      case INVALID_LINE_DIRECTIVE:
+          return "invalid line directive";
+      // Errors end.
+      // Warnings begin.
+      case EOF_IN_DIRECTIVE:
+          return "unexpected end of file found in directive";
+      case CONDITIONAL_UNEXPECTED_TOKEN:
+          return "unexpected token after conditional expression";
+      case UNRECOGNIZED_PRAGMA:
+          return "unrecognized pragma";
+      // Warnings end.
+      default:
+          assert(false);
+          return "";
+    }
+}
+
+}  // namespace pp
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/preprocessor/PreprocessorDirectiveHandler.cpp
@@ -0,0 +1,16 @@
+//
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "DirectiveHandler.h"
+
+namespace pp
+{
+
+DirectiveHandler::~DirectiveHandler()
+{
+}
+
+}  // namespace pp
--- a/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
+++ b/gfx/angle/src/compiler/preprocessor/Tokenizer.cpp
@@ -51,17 +51,16 @@
 
 #include <inttypes.h>
 typedef int8_t flex_int8_t;
 typedef uint8_t flex_uint8_t;
 typedef int16_t flex_int16_t;
 typedef uint16_t flex_uint16_t;
 typedef int32_t flex_int32_t;
 typedef uint32_t flex_uint32_t;
-typedef uint64_t flex_uint64_t;
 #else
 typedef signed char flex_int8_t;
 typedef short int flex_int16_t;
 typedef int flex_int32_t;
 typedef unsigned char flex_uint8_t; 
 typedef unsigned short int flex_uint16_t;
 typedef unsigned int flex_uint32_t;
 #endif /* ! C99 */
@@ -175,21 +174,16 @@ typedef void* yyscan_t;
  */
 #define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
 
 #ifndef YY_TYPEDEF_YY_BUFFER_STATE
 #define YY_TYPEDEF_YY_BUFFER_STATE
 typedef struct yy_buffer_state *YY_BUFFER_STATE;
 #endif
 
-#ifndef YY_TYPEDEF_YY_SIZE_T
-#define YY_TYPEDEF_YY_SIZE_T
-typedef size_t yy_size_t;
-#endif
-
 #define EOB_ACT_CONTINUE_SCAN 0
 #define EOB_ACT_END_OF_FILE 1
 #define EOB_ACT_LAST_MATCH 2
 
     #define YY_LESS_LINENO(n)
     
 /* Return all but the first "n" matched characters back to the input stream. */
 #define yyless(n) \
@@ -202,16 +196,21 @@ typedef size_t yy_size_t;
 		YY_RESTORE_YY_MORE_OFFSET \
 		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
 		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
 		} \
 	while ( 0 )
 
 #define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
 
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
 #ifndef YY_STRUCT_YY_BUFFER_STATE
 #define YY_STRUCT_YY_BUFFER_STATE
 struct yy_buffer_state
 	{
 	FILE *yy_input_file;
 
 	char *yy_ch_buf;		/* input buffer */
 	char *yy_buf_pos;		/* current position in input buffer */
@@ -219,17 +218,17 @@ struct yy_buffer_state
 	/* Size of input buffer in bytes, not including room for EOB
 	 * characters.
 	 */
 	yy_size_t yy_buf_size;
 
 	/* Number of characters read into yy_ch_buf, not including EOB
 	 * characters.
 	 */
-	yy_size_t yy_n_chars;
+	int yy_n_chars;
 
 	/* Whether we "own" the buffer - i.e., we know we created it,
 	 * and can realloc() it to grow it, and should free() it to
 	 * delete it.
 	 */
 	int yy_is_our_buffer;
 
 	/* Whether this is an "interactive" input source; if so, and
@@ -298,17 +297,17 @@ void pppop_buffer_state (yyscan_t yyscan
 static void ppensure_buffer_stack (yyscan_t yyscanner );
 static void pp_load_buffer_state (yyscan_t yyscanner );
 static void pp_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
 
 #define YY_FLUSH_BUFFER pp_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
 
 YY_BUFFER_STATE pp_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
 YY_BUFFER_STATE pp_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
-YY_BUFFER_STATE pp_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );
+YY_BUFFER_STATE pp_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
 
 void *ppalloc (yy_size_t ,yyscan_t yyscanner );
 void *pprealloc (void *,yy_size_t ,yyscan_t yyscanner );
 void ppfree (void * ,yyscan_t yyscanner );
 
 #define yy_new_buffer pp_create_buffer
 
 #define yy_set_interactive(is_interactive) \
@@ -349,17 +348,17 @@ static yy_state_type yy_try_NUL_trans (y
 static int yy_get_next_buffer (yyscan_t yyscanner );
 static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
 
 /* Done after the current pattern has been matched and before the
  * corresponding action - sets up yytext.
  */
 #define YY_DO_BEFORE_ACTION \
 	yyg->yytext_ptr = yy_bp; \
-	yyleng = (yy_size_t) (yy_cp - yy_bp); \
+	yyleng = (size_t) (yy_cp - yy_bp); \
 	yyg->yy_hold_char = *yy_cp; \
 	*yy_cp = '\0'; \
 	yyg->yy_c_buf_p = yy_cp;
 
 #define YY_NUM_RULES 37
 #define YY_END_OF_BUFFER 38
 /* This struct is not used in this scanner,
    but its presence is necessary. */
@@ -512,17 +511,17 @@ This file contains the Lex specification
 Based on Microsoft Visual Studio 2010 Preprocessor Grammar:
 http://msdn.microsoft.com/en-us/library/2scxys89.aspx
 
 IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
 */
 
 #include "Tokenizer.h"
 
-#include "DiagnosticsBase.h"
+#include "Diagnostics.h"
 #include "Token.h"
 
 #if defined(__GNUC__)
 // Triggered by the auto-generated yy_fatal_error function.
 #pragma GCC diagnostic ignored "-Wmissing-noreturn"
 #endif
 
 typedef std::string YYSTYPE;
@@ -571,18 +570,18 @@ struct yyguts_t
     YY_EXTRA_TYPE yyextra_r;
 
     /* The rest are the same as the globals declared in the non-reentrant scanner. */
     FILE *yyin_r, *yyout_r;
     size_t yy_buffer_stack_top; /**< index of top of stack. */
     size_t yy_buffer_stack_max; /**< capacity of stack. */
     YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
     char yy_hold_char;
-    yy_size_t yy_n_chars;
-    yy_size_t yyleng_r;
+    int yy_n_chars;
+    int yyleng_r;
     char *yy_c_buf_p;
     int yy_init;
     int yy_start;
     int yy_did_buffer_switch_on_eof;
     int yy_start_stack_ptr;
     int yy_start_stack_depth;
     int *yy_start_stack;
     yy_state_type yy_last_accepting_state;
@@ -629,17 +628,17 @@ void ppset_extra (YY_EXTRA_TYPE user_def
 FILE *ppget_in (yyscan_t yyscanner );
 
 void ppset_in  (FILE * in_str ,yyscan_t yyscanner );
 
 FILE *ppget_out (yyscan_t yyscanner );
 
 void ppset_out  (FILE * out_str ,yyscan_t yyscanner );
 
-yy_size_t ppget_leng (yyscan_t yyscanner );
+int ppget_leng (yyscan_t yyscanner );
 
 char *ppget_text (yyscan_t yyscanner );
 
 int ppget_lineno (yyscan_t yyscanner );
 
 void ppset_lineno (int line_number ,yyscan_t yyscanner );
 
 YYSTYPE * ppget_lval (yyscan_t yyscanner );
@@ -696,17 +695,17 @@ static int input (yyscan_t yyscanner );
 /* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
  * is returned in "result".
  */
 #ifndef YY_INPUT
 #define YY_INPUT(buf,result,max_size) \
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
 		{ \
 		int c = '*'; \
-		yy_size_t n; \
+		int n; \
 		for ( n = 0; n < max_size && \
 			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
 			buf[n] = (char) c; \
 		if ( c == '\n' ) \
 			buf[n++] = (char) c; \
 		if ( c == EOF && ferror( yyin ) ) \
 			YY_FATAL_ERROR( "input in flex scanner failed" ); \
 		result = n; \
@@ -1114,24 +1113,23 @@ YY_RULE_SETUP
 	YY_BREAK
 case YY_STATE_EOF(INITIAL):
 case YY_STATE_EOF(COMMENT):
 {
     // YY_USER_ACTION is not invoked for handling EOF.
     // Set the location for EOF token manually.
     pp::Input* input = &yyextra->input;
     pp::Input::Location* scanLoc = &yyextra->scanLoc;
-    yy_size_t sIndexMax = input->count() ? input->count() - 1 : 0;
+    int sIndexMax = std::max(0, input->count() - 1);
     if (scanLoc->sIndex != sIndexMax)
     {
         // We can only reach here if there are empty strings at the
         // end of the input.
         scanLoc->sIndex = sIndexMax; scanLoc->cIndex = 0;
-        // FIXME: this is not 64-bit clean.
-        yyfileno = static_cast<int>(sIndexMax); yylineno = 1;
+        yyfileno = sIndexMax; yylineno = 1;
     }
     yylloc->file = yyfileno;
     yylloc->line = yylineno;
     yylval->clear();
 
     if (YY_START == COMMENT)
     {
         yyextra->diagnostics->report(pp::Diagnostics::EOF_IN_COMMENT,
@@ -1325,31 +1323,31 @@ static int yy_get_next_buffer (yyscan_t 
 	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
 		/* don't do the read, it's not guaranteed to return an EOF,
 		 * just force an EOF
 		 */
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
 
 	else
 		{
-			yy_size_t num_to_read =
+			int num_to_read =
 			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
 
 		while ( num_to_read <= 0 )
 			{ /* Not enough room in the buffer - grow it. */
 
 			/* just a shorter name for the current buffer */
 			YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
 
 			int yy_c_buf_p_offset =
 				(int) (yyg->yy_c_buf_p - b->yy_ch_buf);
 
 			if ( b->yy_is_our_buffer )
 				{
-				yy_size_t new_size = b->yy_buf_size * 2;
+				int new_size = b->yy_buf_size * 2;
 
 				if ( new_size <= 0 )
 					b->yy_buf_size += b->yy_buf_size / 8;
 				else
 					b->yy_buf_size *= 2;
 
 				b->yy_ch_buf = (char *)
 					/* Include room in for 2 EOB chars. */
@@ -1370,17 +1368,17 @@ static int yy_get_next_buffer (yyscan_t 
 
 			}
 
 		if ( num_to_read > YY_READ_BUF_SIZE )
 			num_to_read = YY_READ_BUF_SIZE;
 
 		/* Read in more data. */
 		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
-			yyg->yy_n_chars, num_to_read );
+			yyg->yy_n_chars, (size_t) num_to_read );
 
 		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
 		}
 
 	if ( yyg->yy_n_chars == 0 )
 		{
 		if ( number_to_move == YY_MORE_ADJ )
 			{
@@ -1495,17 +1493,17 @@ static int yy_get_next_buffer (yyscan_t 
 		 * valid NUL; if not, then we've hit the end of the buffer.
 		 */
 		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
 			/* This was really a NUL. */
 			*yyg->yy_c_buf_p = '\0';
 
 		else
 			{ /* need more input */
-			yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
 			++yyg->yy_c_buf_p;
 
 			switch ( yy_get_next_buffer( yyscanner ) )
 				{
 				case EOB_ACT_LAST_MATCH:
 					/* This happens because yy_g_n_b()
 					 * sees that we've accumulated a
 					 * token and flags that we need to
@@ -1519,17 +1517,17 @@ static int yy_get_next_buffer (yyscan_t 
 					/* Reset buffer status. */
 					pprestart(yyin ,yyscanner);
 
 					/*FALLTHROUGH*/
 
 				case EOB_ACT_END_OF_FILE:
 					{
 					if ( ppwrap(yyscanner ) )
-						return 0;
+						return EOF;
 
 					if ( ! yyg->yy_did_buffer_switch_on_eof )
 						YY_NEW_FILE;
 #ifdef __cplusplus
 					return yyinput(yyscanner);
 #else
 					return input(yyscanner);
 #endif
@@ -1775,17 +1773,17 @@ void pppop_buffer_state (yyscan_t yyscan
 	}
 }
 
 /* Allocates the stack if it does not exist.
  *  Guarantees space for at least one push.
  */
 static void ppensure_buffer_stack (yyscan_t yyscanner)
 {
-	yy_size_t num_to_alloc;
+	int num_to_alloc;
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
 
 	if (!yyg->yy_buffer_stack) {
 
 		/* First allocation is just for 2 elements, since we don't know if this
 		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
 		 * immediate realloc on the next call.
          */
@@ -1873,21 +1871,22 @@ YY_BUFFER_STATE pp_scan_string (yyconst 
 
 /** Setup the input buffer state to scan the given bytes. The next call to pplex() will
  * scan from a @e copy of @a bytes.
  * @param bytes the byte buffer to scan
  * @param len the number of bytes in the buffer pointed to by @a bytes.
  * @param yyscanner The scanner object.
  * @return the newly allocated buffer state object.
  */
-YY_BUFFER_STATE pp_scan_bytes  (yyconst char * yybytes, yy_size_t  _yybytes_len , yyscan_t yyscanner)
+YY_BUFFER_STATE pp_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
 {
 	YY_BUFFER_STATE b;
 	char *buf;
-	yy_size_t n, i;
+	yy_size_t n;
+	int i;
     
 	/* Get memory for full buffer, including space for trailing EOB's. */
 	n = _yybytes_len + 2;
 	buf = (char *) ppalloc(n ,yyscanner );
 	if ( ! buf )
 		YY_FATAL_ERROR( "out of dynamic memory in pp_scan_bytes()" );
 
 	for ( i = 0; i < _yybytes_len; ++i )
@@ -1987,17 +1986,17 @@ FILE *ppget_out  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyout;
 }
 
 /** Get the length of the current token.
  * @param yyscanner The scanner object.
  */
-yy_size_t ppget_leng  (yyscan_t yyscanner)
+int ppget_leng  (yyscan_t yyscanner)
 {
     struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
     return yyleng;
 }
 
 /** Get the current token.
  * @param yyscanner The scanner object.
  */
@@ -2290,18 +2289,19 @@ Tokenizer::Tokenizer(Diagnostics* diagno
     mContext.diagnostics = diagnostics;
 }
 
 Tokenizer::~Tokenizer()
 {
     destroyScanner();
 }
 
-bool Tokenizer::init(size_t count, const char* const string[], const int length[])
+bool Tokenizer::init(int count, const char* const string[], const int length[])
 {
+    if (count < 0) return false;
     if ((count > 0) && (string == 0)) return false;
 
     mContext.input = Input(count, string, length);
     return initScanner();
 }
 
 void Tokenizer::setFileNumber(int file)
 {
--- a/gfx/angle/src/compiler/preprocessor/Tokenizer.h
+++ b/gfx/angle/src/compiler/preprocessor/Tokenizer.h
@@ -32,17 +32,17 @@ class Tokenizer : public Lexer
         bool leadingSpace;
         bool lineStart;
     };
     static const std::size_t kMaxTokenLength;
 
     Tokenizer(Diagnostics* diagnostics);
     ~Tokenizer();
 
-    bool init(size_t count, const char* const string[], const int length[]);
+    bool init(int count, const char* const string[], const int length[]);
 
     void setFileNumber(int file);
     void setLineNumber(int line);
 
     virtual void lex(Token* token);
 
   private:
     PP_DISALLOW_COPY_AND_ASSIGN(Tokenizer);
--- a/gfx/angle/src/compiler/preprocessor/Tokenizer.l
+++ b/gfx/angle/src/compiler/preprocessor/Tokenizer.l
@@ -20,17 +20,17 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO
 //
 
 // This file is auto-generated by generate_parser.sh. DO NOT EDIT!
 }
 
 %{
 #include "Tokenizer.h"
 
-#include "DiagnosticsBase.h"
+#include "Diagnostics.h"
 #include "Token.h"
 
 #if defined(__GNUC__)
 // Triggered by the auto-generated yy_fatal_error function.
 #pragma GCC diagnostic ignored "-Wmissing-noreturn"
 #endif
 
 typedef std::string YYSTYPE;
@@ -234,24 +234,23 @@ FRACTIONAL_CONSTANT  ({DIGIT}*"."{DIGIT}
     return pp::Token::PP_OTHER;
 }
 
 <*><<EOF>> {
     // YY_USER_ACTION is not invoked for handling EOF.
     // Set the location for EOF token manually.
     pp::Input* input = &yyextra->input;
     pp::Input::Location* scanLoc = &yyextra->scanLoc;
-    yy_size_t sIndexMax = input->count() ? input->count() - 1 : 0;
+    int sIndexMax = std::max(0, input->count() - 1);
     if (scanLoc->sIndex != sIndexMax)
     {
         // We can only reach here if there are empty strings at the
         // end of the input.
         scanLoc->sIndex = sIndexMax; scanLoc->cIndex = 0;
-        // FIXME: this is not 64-bit clean.
-        yyfileno = static_cast<int>(sIndexMax); yylineno = 1;
+        yyfileno = sIndexMax; yylineno = 1;
     }
     yylloc->file = yyfileno;
     yylloc->line = yylineno;
     yylval->clear();
 
     if (YY_START == COMMENT)
     {
         yyextra->diagnostics->report(pp::Diagnostics::EOF_IN_COMMENT,
@@ -274,18 +273,19 @@ Tokenizer::Tokenizer(Diagnostics* diagno
     mContext.diagnostics = diagnostics;
 }
 
 Tokenizer::~Tokenizer()
 {
     destroyScanner();
 }
 
-bool Tokenizer::init(size_t count, const char* const string[], const int length[])
+bool Tokenizer::init(int count, const char* const string[], const int length[])
 {
+    if (count < 0) return false;
     if ((count > 0) && (string == 0)) return false;
 
     mContext.input = Input(count, string, length);
     return initScanner();
 }
 
 void Tokenizer::setFileNumber(int file)
 {
--- a/gfx/angle/src/compiler/preprocessor/preprocessor.vcxproj
+++ b/gfx/angle/src/compiler/preprocessor/preprocessor.vcxproj
@@ -1,169 +1,169 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}</ProjectGuid>
-    <RootNamespace>preprocessor</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="DiagnosticsBase.cpp" />
-    <ClCompile Include="DirectiveHandlerBase.cpp" />
-    <ClCompile Include="DirectiveParser.cpp" />
-    <ClCompile Include="ExpressionParser.cpp" />
-    <ClCompile Include="Input.cpp" />
-    <ClCompile Include="Lexer.cpp" />
-    <ClCompile Include="Macro.cpp" />
-    <ClCompile Include="MacroExpander.cpp" />
-    <ClCompile Include="Preprocessor.cpp" />
-    <ClCompile Include="Token.cpp" />
-    <ClCompile Include="Tokenizer.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="length_limits.h" />
-    <ClInclude Include="DiagnosticsBase.h" />
-    <ClInclude Include="DirectiveHandlerBase.h" />
-    <ClInclude Include="DirectiveParser.h" />
-    <ClInclude Include="ExpressionParser.h" />
-    <ClInclude Include="Input.h" />
-    <ClInclude Include="Lexer.h" />
-    <ClInclude Include="Macro.h" />
-    <ClInclude Include="MacroExpander.h" />
-    <ClInclude Include="numeric_lex.h" />
-    <ClInclude Include="pp_utils.h" />
-    <ClInclude Include="Preprocessor.h" />
-    <ClInclude Include="SourceLocation.h" />
-    <ClInclude Include="Token.h" />
-    <ClInclude Include="Tokenizer.h" />
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}</ProjectGuid>
+    <RootNamespace>preprocessor</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;4267;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="Diagnostics.cpp" />
+    <ClCompile Include="DirectiveHandler.cpp" />
+    <ClCompile Include="DirectiveParser.cpp" />
+    <ClCompile Include="ExpressionParser.cpp" />
+    <ClCompile Include="Input.cpp" />
+    <ClCompile Include="Lexer.cpp" />
+    <ClCompile Include="Macro.cpp" />
+    <ClCompile Include="MacroExpander.cpp" />
+    <ClCompile Include="Preprocessor.cpp" />
+    <ClCompile Include="Token.cpp" />
+    <ClCompile Include="Tokenizer.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="length_limits.h" />
+    <ClInclude Include="Diagnostics.h" />
+    <ClInclude Include="DirectiveHandler.h" />
+    <ClInclude Include="DirectiveParser.h" />
+    <ClInclude Include="ExpressionParser.h" />
+    <ClInclude Include="Input.h" />
+    <ClInclude Include="Lexer.h" />
+    <ClInclude Include="Macro.h" />
+    <ClInclude Include="MacroExpander.h" />
+    <ClInclude Include="numeric_lex.h" />
+    <ClInclude Include="pp_utils.h" />
+    <ClInclude Include="Preprocessor.h" />
+    <ClInclude Include="SourceLocation.h" />
+    <ClInclude Include="Token.h" />
+    <ClInclude Include="Tokenizer.h" />
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
 </Project>
\ No newline at end of file
--- a/gfx/angle/src/compiler/translator_common.vcxproj
+++ b/gfx/angle/src/compiler/translator_common.vcxproj
@@ -1,284 +1,284 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}</ProjectGuid>
-    <RootNamespace>compiler</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>NotSet</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>NotSet</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>NotSet</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
-    <CharacterSet>NotSet</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\common\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\common\</IntDir>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4267;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4267;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="BuiltInFunctionEmulator.cpp" />
-    <ClCompile Include="Compiler.cpp" />
-    <ClCompile Include="debug.cpp" />
-    <ClCompile Include="DetectRecursion.cpp" />
-    <ClCompile Include="Diagnostics.cpp" />
-    <ClCompile Include="DirectiveHandler.cpp" />
-    <ClCompile Include="ForLoopUnroll.cpp" />
-    <ClCompile Include="InfoSink.cpp" />
-    <ClCompile Include="Initialize.cpp" />
-    <ClCompile Include="InitializeDll.cpp" />
-    <ClCompile Include="InitializeParseContext.cpp" />
-    <ClCompile Include="Intermediate.cpp" />
-    <ClCompile Include="intermOut.cpp" />
-    <ClCompile Include="IntermTraverse.cpp" />
-    <ClCompile Include="MapLongVariableNames.cpp" />
-    <ClCompile Include="ossource_win.cpp" />
-    <ClCompile Include="parseConst.cpp" />
-    <ClCompile Include="ParseHelper.cpp" />
-    <ClCompile Include="PoolAlloc.cpp" />
-    <ClCompile Include="QualifierAlive.cpp" />
-    <ClCompile Include="RemoveTree.cpp" />
-    <ClCompile Include="ShaderLang.cpp" />
-    <ClCompile Include="SymbolTable.cpp" />
-    <ClCompile Include="util.cpp" />
-    <ClCompile Include="ValidateLimitations.cpp" />
-    <ClCompile Include="VariableInfo.cpp" />
-    <ClCompile Include="VariablePacker.cpp" />
-    <ClCompile Include="glslang_lex.cpp" />
-    <ClCompile Include="glslang_tab.cpp" />
-    <ClCompile Include="depgraph\DependencyGraph.cpp" />
-    <ClCompile Include="depgraph\DependencyGraphBuilder.cpp" />
-    <ClCompile Include="depgraph\DependencyGraphOutput.cpp" />
-    <ClCompile Include="depgraph\DependencyGraphTraverse.cpp" />
-    <ClCompile Include="timing\RestrictFragmentShaderTiming.cpp" />
-    <ClCompile Include="timing\RestrictVertexShaderTiming.cpp" />
-    <ClCompile Include="..\third_party\compiler\ArrayBoundsClamper.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <CustomBuild Include="glslang.l">
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-      </Command>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-      </Command>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-      </Command>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalInputs)</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-      </Command>
-      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalInputs)</AdditionalInputs>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Outputs)</Outputs>
-    </CustomBuild>
-    <CustomBuild Include="glslang.y">
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-      </Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-      </Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-      </Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Outputs)</Outputs>
-      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-      </Message>
-      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-      </Command>
-      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Outputs)</Outputs>
-    </CustomBuild>
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="BaseTypes.h" />
-    <ClInclude Include="BuiltInFunctionEmulator.h" />
-    <ClInclude Include="Common.h" />
-    <ClInclude Include="ConstantUnion.h" />
-    <ClInclude Include="debug.h" />
-    <ClInclude Include="DetectRecursion.h" />
-    <ClInclude Include="Diagnostics.h" />
-    <ClInclude Include="DirectiveHandler.h" />
-    <ClInclude Include="ForLoopUnroll.h" />
-    <ClInclude Include="HashNames.h" />
-    <ClInclude Include="InfoSink.h" />
-    <ClInclude Include="Initialize.h" />
-    <ClInclude Include="InitializeDll.h" />
-    <ClInclude Include="InitializeGlobals.h" />
-    <ClInclude Include="InitializeParseContext.h" />
-    <ClInclude Include="intermediate.h" />
-    <ClInclude Include="localintermediate.h" />
-    <ClInclude Include="MapLongVariableNames.h" />
-    <ClInclude Include="MMap.h" />
-    <ClInclude Include="osinclude.h" />
-    <ClInclude Include="ParseHelper.h" />
-    <ClInclude Include="PoolAlloc.h" />
-    <ClInclude Include="QualifierAlive.h" />
-    <ClInclude Include="RemoveTree.h" />
-    <ClInclude Include="RenameFunction.h" />
-    <ClInclude Include="..\..\include\GLSLANG\ResourceLimits.h" />
-    <ClInclude Include="..\..\include\GLSLANG\ShaderLang.h" />
-    <ClInclude Include="ShHandle.h" />
-    <ClInclude Include="SymbolTable.h" />
-    <ClInclude Include="Types.h" />
-    <ClInclude Include="util.h" />
-    <ClInclude Include="ValidateLimitations.h" />
-    <ClInclude Include="VariableInfo.h" />
-    <ClInclude Include="VariablePacker.h" />
-    <ClInclude Include="glslang_tab.h" />
-    <ClInclude Include="timing\RestrictFragmentShaderTiming.h" />
-    <ClInclude Include="timing\RestrictVertexShaderTiming.h" />
-    <ClInclude Include="depgraph\DependencyGraph.h" />
-    <ClInclude Include="depgraph\DependencyGraphBuilder.h" />
-    <ClInclude Include="depgraph\DependencyGraphOutput.h" />
-    <ClInclude Include="..\third_party\compiler\ArrayBoundsClamper.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="preprocessor\preprocessor.vcxproj">
-      <Project>{fbe32df3-0fb0-4f2f-a424-2c21bd7bc325}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-      <Private>true</Private>
-      <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
-      <LinkLibraryDependencies>true</LinkLibraryDependencies>
-      <UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
-</Project>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}</ProjectGuid>
+    <RootNamespace>compiler</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <CharacterSet>NotSet</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\common\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\common\</IntDir>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4267;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+    <Midl>
+      <TargetEnvironment>X64</TargetEnvironment>
+    </Midl>
+    <ClCompile>
+      <Optimization>MaxSpeed</Optimization>
+      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
+      <AdditionalIncludeDirectories>$(ProjectDir);$(ProjectDir)../;$(ProjectDir)../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4267;4512;4702;4718;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+  </ItemDefinitionGroup>
+  <ItemGroup>
+    <ClCompile Include="ArrayBoundsClamper.cpp" />
+    <ClCompile Include="BuiltInFunctionEmulator.cpp" />
+    <ClCompile Include="Compiler.cpp" />
+    <ClCompile Include="debug.cpp" />
+    <ClCompile Include="DetectRecursion.cpp" />
+    <ClCompile Include="Diagnostics.cpp" />
+    <ClCompile Include="DirectiveHandler.cpp" />
+    <ClCompile Include="ForLoopUnroll.cpp" />
+    <ClCompile Include="InfoSink.cpp" />
+    <ClCompile Include="Initialize.cpp" />
+    <ClCompile Include="InitializeDll.cpp" />
+    <ClCompile Include="InitializeParseContext.cpp" />
+    <ClCompile Include="Intermediate.cpp" />
+    <ClCompile Include="intermOut.cpp" />
+    <ClCompile Include="IntermTraverse.cpp" />
+    <ClCompile Include="MapLongVariableNames.cpp" />
+    <ClCompile Include="ossource_win.cpp" />
+    <ClCompile Include="parseConst.cpp" />
+    <ClCompile Include="ParseHelper.cpp" />
+    <ClCompile Include="PoolAlloc.cpp" />
+    <ClCompile Include="QualifierAlive.cpp" />
+    <ClCompile Include="RemoveTree.cpp" />
+    <ClCompile Include="ShaderLang.cpp" />
+    <ClCompile Include="SymbolTable.cpp" />
+    <ClCompile Include="util.cpp" />
+    <ClCompile Include="ValidateLimitations.cpp" />
+    <ClCompile Include="VariableInfo.cpp" />
+    <ClCompile Include="VariablePacker.cpp" />
+    <ClCompile Include="glslang_lex.cpp" />
+    <ClCompile Include="glslang_tab.cpp" />
+    <ClCompile Include="depgraph\DependencyGraph.cpp" />
+    <ClCompile Include="depgraph\DependencyGraphBuilder.cpp" />
+    <ClCompile Include="depgraph\DependencyGraphOutput.cpp" />
+    <ClCompile Include="depgraph\DependencyGraphTraverse.cpp" />
+    <ClCompile Include="timing\RestrictFragmentShaderTiming.cpp" />
+    <ClCompile Include="timing\RestrictVertexShaderTiming.cpp" />
+  </ItemGroup>
+  <ItemGroup>
+    <CustomBuild Include="glslang.l">
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </Command>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalInputs)</AdditionalInputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+      </Command>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(AdditionalInputs)</AdditionalInputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </Command>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalInputs)</AdditionalInputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+      </Command>
+      <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(AdditionalInputs)</AdditionalInputs>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Outputs)</Outputs>
+    </CustomBuild>
+    <CustomBuild Include="glslang.y">
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+      </Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+      </Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+      </Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(Outputs)</Outputs>
+      <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+      </Message>
+      <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+      </Command>
+      <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">%(Outputs)</Outputs>
+    </CustomBuild>
+  </ItemGroup>
+  <ItemGroup>
+    <ClInclude Include="ArrayBoundsClamper.h" />
+    <ClInclude Include="BaseTypes.h" />
+    <ClInclude Include="BuiltInFunctionEmulator.h" />
+    <ClInclude Include="Common.h" />
+    <ClInclude Include="ConstantUnion.h" />
+    <ClInclude Include="debug.h" />
+    <ClInclude Include="DetectRecursion.h" />
+    <ClInclude Include="Diagnostics.h" />
+    <ClInclude Include="DirectiveHandler.h" />
+    <ClInclude Include="ForLoopUnroll.h" />
+    <ClInclude Include="HashNames.h" />
+    <ClInclude Include="InfoSink.h" />
+    <ClInclude Include="Initialize.h" />
+    <ClInclude Include="InitializeDll.h" />
+    <ClInclude Include="InitializeGlobals.h" />
+    <ClInclude Include="InitializeParseContext.h" />
+    <ClInclude Include="intermediate.h" />
+    <ClInclude Include="localintermediate.h" />
+    <ClInclude Include="MapLongVariableNames.h" />
+    <ClInclude Include="MMap.h" />
+    <ClInclude Include="osinclude.h" />
+    <ClInclude Include="ParseHelper.h" />
+    <ClInclude Include="PoolAlloc.h" />
+    <ClInclude Include="QualifierAlive.h" />
+    <ClInclude Include="RemoveTree.h" />
+    <ClInclude Include="RenameFunction.h" />
+    <ClInclude Include="..\..\include\GLSLANG\ResourceLimits.h" />
+    <ClInclude Include="..\..\include\GLSLANG\ShaderLang.h" />
+    <ClInclude Include="ShHandle.h" />
+    <ClInclude Include="SymbolTable.h" />
+    <ClInclude Include="Types.h" />
+    <ClInclude Include="util.h" />
+    <ClInclude Include="ValidateLimitations.h" />
+    <ClInclude Include="VariableInfo.h" />
+    <ClInclude Include="VariablePacker.h" />
+    <ClInclude Include="glslang_tab.h" />
+    <ClInclude Include="timing\RestrictFragmentShaderTiming.h" />
+    <ClInclude Include="timing\RestrictVertexShaderTiming.h" />
+    <ClInclude Include="depgraph\DependencyGraph.h" />
+    <ClInclude Include="depgraph\DependencyGraphBuilder.h" />
+    <ClInclude Include="depgraph\DependencyGraphOutput.h" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="preprocessor\preprocessor.vcxproj">
+      <Project>{fbe32df3-0fb0-4f2f-a424-2c21bd7bc325}</Project>
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+      <Private>true</Private>
+      <CopyLocalSatelliteAssemblies>false</CopyLocalSatelliteAssemblies>
+      <LinkLibraryDependencies>true</LinkLibraryDependencies>
+      <UseLibraryDependencyInputs>true</UseLibraryDependencyInputs>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+  <ImportGroup Label="ExtensionTargets">
+  </ImportGroup>
+</Project>
--- a/gfx/angle/src/libEGL/Display.cpp
+++ b/gfx/angle/src/libEGL/Display.cpp
@@ -26,22 +26,16 @@
 // The "Debug This Pixel..." feature in PIX often fails when using the
 // D3D9Ex interfaces.  In order to get debug pixel to work on a Vista/Win 7
 // machine, define "ANGLE_ENABLE_D3D9EX=0" in your project file.
 #if !defined(ANGLE_ENABLE_D3D9EX)
 // Enables use of the IDirect3D9Ex interface, when available
 #define ANGLE_ENABLE_D3D9EX 1
 #endif // !defined(ANGLE_ENABLE_D3D9EX)
 
-#define ANGLE_PRELOADED_D3DCOMPILER_MODULE_NAMES \
-    {                                            \
-        TEXT("d3dcompiler_46.dll"),              \
-        TEXT("d3dcompiler_43.dll")               \
-    }
-
 namespace egl
 {
 namespace
 {
     typedef std::map<EGLNativeDisplayType, Display*> DisplayMap; 
     DisplayMap displays;
 }
 
@@ -478,20 +472,16 @@ bool Display::getConfigAttrib(EGLConfig 
         return false;
     }
 
     return true;
 }
 
 bool Display::createDevice()
 {
-    if (!isInitialized())
-    {
-        return error(EGL_NOT_INITIALIZED, false);
-    }
     D3DPRESENT_PARAMETERS presentParameters = getDefaultPresentParameters();
     DWORD behaviorFlags = D3DCREATE_FPU_PRESERVE | D3DCREATE_NOWINDOWCHANGES;
 
     HRESULT result = mD3d9->CreateDevice(mAdapter, mDeviceType, mDeviceWindow, behaviorFlags | D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_PUREDEVICE, &presentParameters, &mDevice);
 
     if (result == D3DERR_OUTOFVIDEOMEMORY || result == E_OUTOFMEMORY || result == D3DERR_DEVICELOST)
     {
         return error(EGL_BAD_ALLOC, false);
@@ -913,28 +903,26 @@ D3DCAPS9 Display::getDeviceCaps()
 
 D3DADAPTER_IDENTIFIER9 *Display::getAdapterIdentifier()
 {
     return &mAdapterIdentifier;
 }
 
 bool Display::testDeviceLost()
 {
-    bool isLost = false;
-
     if (mDeviceEx)
     {
-        isLost = FAILED(mDeviceEx->CheckDeviceState(NULL));
+        return FAILED(mDeviceEx->CheckDeviceState(NULL));
     }
     else if (mDevice)
     {
-        isLost = FAILED(mDevice->TestCooperativeLevel());
+        return FAILED(mDevice->TestCooperativeLevel());
     }
 
-    return isLost;
+    return false;   // No device yet, so no reset required
 }
 
 bool Display::testDeviceResettable()
 {
     HRESULT status = D3D_OK;
 
     if (mDeviceEx)
     {
@@ -1148,17 +1136,17 @@ bool Display::getLuminanceAlphaTextureSu
     return SUCCEEDED(mD3d9->CheckDeviceFormat(mAdapter, mDeviceType, currentDisplayMode.Format, 0, D3DRTYPE_TEXTURE, D3DFMT_A8L8));
 }
 
 float Display::getTextureFilterAnisotropySupport() const
 {
     // Must support a minimum of 2:1 anisotropy for max anisotropy to be considered supported, per the spec
     if ((mDeviceCaps.RasterCaps & D3DPRASTERCAPS_ANISOTROPY) && (mDeviceCaps.MaxAnisotropy >= 2))
     {
-        return static_cast<float>(mDeviceCaps.MaxAnisotropy);
+        return mDeviceCaps.MaxAnisotropy;
     }
     return 1.0f;
 }
 
 D3DPOOL Display::getBufferPool(DWORD usage) const
 {
     if (mD3d9Ex != NULL)
     {
--- a/gfx/angle/src/libEGL/Display.h
+++ b/gfx/angle/src/libEGL/Display.h
@@ -6,19 +6,22 @@
 
 // Display.h: Defines the egl::Display class, representing the abstract
 // display on which graphics are drawn. Implements EGLDisplay.
 // [EGL 1.4] section 2.1.2 page 3.
 
 #ifndef LIBEGL_DISPLAY_H_
 #define LIBEGL_DISPLAY_H_
 
-#include "common/system.h"
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <windows.h>
 #include <d3d9.h>
-#include <D3Dcompiler.h>
+#include <d3dcompiler.h>
 
 #include <set>
 #include <vector>
 
 #include "libGLESv2/Context.h"
 
 #include "libEGL/Config.h"
 #include "libEGL/ShaderCache.h"
--- a/gfx/angle/src/libEGL/Makefile.in
+++ b/gfx/angle/src/libEGL/Makefile.in
@@ -6,40 +6,36 @@ DEPTH     = @DEPTH@
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
 # On Windows, we don't automatically get "lib" prepended, but we need it.
 LIBRARY_NAME     = libEGL
+MODULE_NAME      = libegl
 FORCE_SHARED_LIB = 1
 
 # ANGLE uses the STL, so we can't use our derpy STL wrappers.
 STL_FLAGS =
 
 # ANGLE uses exceptions internally, so we need to have exception handling
 # support
 ENABLE_CXX_EXCEPTIONS = 1
 
-ifeq ($(MOZ_WIDGET_TOOLKIT),windows)
-# Enable unwind semantics for exception handlers in response to warning C4530.
-OS_CPPFLAGS += -EHsc
-endif
-
 # Since we're building off in our own world, we don't want to have
 # mozilla-config.h and -DMOZILLA_CLIENT automatically included and defined, so
 # we just overwrite OS_COMPILE_C(XX)FLAGS.
 OS_COMPILE_CFLAGS   = $(OS_CPPFLAGS)
 OS_COMPILE_CXXFLAGS = $(OS_CPPFLAGS)
 
 DEFINES += -DANGLE_BUILD -DNOMINMAX -DLIBEGL_EXPORTS -D_CRT_SECURE_NO_DEPRECATE
 
 DEFINES += -DANGLE_DISABLE_TRACE
-DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL1
+DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
 
 ifndef MOZ_DEBUG
 DEFINES += -D_SECURE_SCL=0
 endif
 
 # Below is a transcription of the EGL target from build_angle.gypi.
 
 # Target: 'libEGL'
--- a/gfx/angle/src/libEGL/Surface.cpp
+++ b/gfx/angle/src/libEGL/Surface.cpp
@@ -13,16 +13,18 @@
 #include "libEGL/Surface.h"
 
 #include "common/debug.h"
 #include "libGLESv2/Texture.h"
 
 #include "libEGL/main.h"
 #include "libEGL/Display.h"
 
+#include <dwmapi.h>
+
 namespace egl
 {
 
 Surface::Surface(Display *display, const Config *config, HWND window, EGLint postSubBufferSupported) 
     : mDisplay(display), mConfig(config), mWindow(window), mPostSubBufferSupported(postSubBufferSupported)
 {
     mSwapChain = NULL;
     mBackBuffer = NULL;
@@ -71,16 +73,34 @@ Surface::~Surface()
 
 bool Surface::initialize()
 {
     ASSERT(!mSwapChain && !mOffscreenTexture && !mDepthStencil);
 
     if (!resetSwapChain())
       return false;
 
+    // Modify present parameters for this window, if we are composited,
+    // to minimize the amount of queuing done by DWM between our calls to
+    // present and the actual screen.
+    if (mWindow && (getComparableOSVersion() >= versionWindowsVista)) {
+      BOOL isComposited;
+      HRESULT result = DwmIsCompositionEnabled(&isComposited);
+      if (SUCCEEDED(result) && isComposited) {
+        DWM_PRESENT_PARAMETERS presentParams;
+        memset(&presentParams, 0, sizeof(presentParams));
+        presentParams.cbSize = sizeof(DWM_PRESENT_PARAMETERS);
+        presentParams.cBuffer = 2;
+
+        result = DwmSetPresentParameters(mWindow, &presentParams);
+        if (FAILED(result))
+          ERR("Unable to set present parameters: 0x%08X", result);
+      }
+    }
+
     return true;
 }
 
 void Surface::release()
 {
     if (mSwapChain)
     {
         mSwapChain->Release();
@@ -318,48 +338,16 @@ bool Surface::resetSwapChain(int backbuf
 
     mWidth = backbufferWidth;
     mHeight = backbufferHeight;
 
     mPresentIntervalDirty = false;
     return true;
 }
 
-void Surface::recreateAdditionalSwapChain()
-{
-    if (!mSwapChain)
-    {
-        return;
-    }
-
-    IDirect3DDevice9 *device = mDisplay->getDevice();
-    if (device == NULL)
-    {
-        return;
-    }
-
-    D3DPRESENT_PARAMETERS presentParameters;
-    HRESULT result = mSwapChain->GetPresentParameters(&presentParameters);
-    ASSERT(SUCCEEDED(result));
-
-    IDirect3DSwapChain9* newSwapChain = NULL;
-    result = device->CreateAdditionalSwapChain(&presentParameters, &newSwapChain);
-    if (FAILED(result))
-    {
-        return;
-    }
-
-    mSwapChain->Release();
-    mSwapChain = newSwapChain;
-
-    mBackBuffer->Release();
-    result = mSwapChain->GetBackBuffer(0, D3DBACKBUFFER_TYPE_MONO, &mBackBuffer);
-    ASSERT(SUCCEEDED(result));
-}
-
 bool Surface::swapRect(EGLint x, EGLint y, EGLint width, EGLint height)
 {
     if (!mSwapChain)
     {
         return true;
     }
 
     if (x + width > mWidth)
--- a/gfx/angle/src/libEGL/Surface.h
+++ b/gfx/angle/src/libEGL/Surface.h
@@ -59,18 +59,16 @@ class Surface
 
     virtual EGLenum getTextureFormat() const;
     virtual EGLenum getTextureTarget() const;
     virtual D3DFORMAT getFormat() const;
 
     virtual void setBoundTexture(gl::Texture2D *texture);
     virtual gl::Texture2D *getBoundTexture() const;
 
-    void recreateAdditionalSwapChain();
-
 private:
     DISALLOW_COPY_AND_ASSIGN(Surface);
 
     Display *const mDisplay;
     IDirect3DSwapChain9 *mSwapChain;
     IDirect3DSurface9 *mBackBuffer;
     IDirect3DSurface9 *mDepthStencil;
     IDirect3DSurface9* mRenderTarget;
--- a/gfx/angle/src/libEGL/libEGL.vcxproj
+++ b/gfx/angle/src/libEGL/libEGL.vcxproj
@@ -1,262 +1,262 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <ItemGroup Label="ProjectConfigurations">
-    <ProjectConfiguration Include="Debug|Win32">
-      <Configuration>Debug</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Debug|x64">
-      <Configuration>Debug</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|Win32">
-      <Configuration>Release</Configuration>
-      <Platform>Win32</Platform>
-    </ProjectConfiguration>
-    <ProjectConfiguration Include="Release|x64">
-      <Configuration>Release</Configuration>
-      <Platform>x64</Platform>
-    </ProjectConfiguration>
-  </ItemGroup>
-  <PropertyGroup Label="Globals">
-    <ProjectGuid>{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}</ProjectGuid>
-    <RootNamespace>libEGL</RootNamespace>
-    <Keyword>Win32Proj</Keyword>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-    <WholeProgramOptimization>true</WholeProgramOptimization>
-  </PropertyGroup>
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
-    <ConfigurationType>DynamicLibrary</ConfigurationType>
-    <CharacterSet>Unicode</CharacterSet>
-  </PropertyGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
-  <ImportGroup Label="ExtensionSettings">
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
-  </ImportGroup>
-  <PropertyGroup Label="UserMacros" />
-  <PropertyGroup>
-    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
-    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
-    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
-    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath)</LibraryPath>
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath)</LibraryPath>
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath)</LibraryPath>
-    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath)</LibraryPath>
-  </PropertyGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(ProjectDir)/..; $(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBEGL_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <AdditionalDependencies>d3d9.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <ModuleDefinitionFile>libEGL.def</ModuleDefinitionFile>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <DataExecutionPrevention>
-      </DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>%40echo on
-mkdir "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.dll" "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
-%40echo off
-</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>$(ProjectDir)/..; $(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>ANGLE_DISABLE_TRACE;WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBEGL_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <TreatWarningAsError>true</TreatWarningAsError>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-    </ClCompile>
-    <Link>
-      <AdditionalDependencies>d3d9.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <ModuleDefinitionFile>libEGL.def</ModuleDefinitionFile>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <DataExecutionPrevention>
-      </DataExecutionPrevention>
-      <TargetMachine>MachineX86</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>%40echo on
-mkdir "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.dll" "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
-%40echo off
-</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>$(ProjectDir)/..; $(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBEGL_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <MinimalRebuild>true</MinimalRebuild>
-      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
-      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <TreatWarningAsError>true</TreatWarningAsError>
-    </ClCompile>
-    <Link>
-      <AdditionalDependencies>d3d9.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <ModuleDefinitionFile>libEGL.def</ModuleDefinitionFile>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <DataExecutionPrevention>
-      </DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>%40echo on
-mkdir "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.dll" "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
-%40echo off
-</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
-    <Midl>
-      <TargetEnvironment>X64</TargetEnvironment>
-    </Midl>
-    <ClCompile>
-      <Optimization>MaxSpeed</Optimization>
-      <InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
-      <AdditionalIncludeDirectories>$(ProjectDir)/..; $(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;LIBEGL_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;_SECURE_SCL=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
-      <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
-      <PrecompiledHeader>
-      </PrecompiledHeader>
-      <WarningLevel>Level4</WarningLevel>
-      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
-      <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
-      <TreatWarningAsError>true</TreatWarningAsError>
-    </ClCompile>
-    <Link>
-      <AdditionalDependencies>d3d9.lib;dxguid.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <ModuleDefinitionFile>libEGL.def</ModuleDefinitionFile>
-      <DelayLoadDLLs>%(DelayLoadDLLs)</DelayLoadDLLs>
-      <GenerateDebugInformation>true</GenerateDebugInformation>
-      <SubSystem>Windows</SubSystem>
-      <OptimizeReferences>true</OptimizeReferences>
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>
-      <RandomizedBaseAddress>false</RandomizedBaseAddress>
-      <DataExecutionPrevention>
-      </DataExecutionPrevention>
-      <TargetMachine>MachineX64</TargetMachine>
-    </Link>
-    <PostBuildEvent>
-      <Command>%40echo on
-mkdir "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.dll" "$(ProjectDir)..\..\lib\$(Configuration)\"
-copy "$(OutDir)libEGL.lib" "$(ProjectDir)..\..\lib\$(Configuration)\"
-%40echo off
-</Command>
-    </PostBuildEvent>
-  </ItemDefinitionGroup>
-  <ItemGroup>
-    <ClCompile Include="Config.cpp" />
-    <ClCompile Include="..\Common\debug.cpp" />
-    <ClCompile Include="Display.cpp" />
-    <ClCompile Include="libEGL.cpp" />
-    <ClCompile Include="main.cpp" />
-    <ClCompile Include="Surface.cpp" />
-  </ItemGroup>
-  <ItemGroup>
-    <ClInclude Include="Config.h" />
-    <ClInclude Include="Display.h" />
-    <ClInclude Include="..\..\include\EGL\egl.h" />
-    <ClInclude Include="..\..\include\EGL\eglext.h" />
-    <ClInclude Include="..\..\include\EGL\eglplatform.h" />
-    <ClInclude Include="main.h" />
-    <ClInclude Include="resource.h" />
-    <ClInclude Include="Surface.h" />
-    <ClInclude Include="..\common\version.h" />
-  </ItemGroup>
-  <ItemGroup>
-    <None Include="libEGL.def" />
-  </ItemGroup>
-  <ItemGroup>
-    <ResourceCompile Include="libEGL.rc" />
-  </ItemGroup>
-  <ItemGroup>
-    <ProjectReference Include="..\libGLESv2\libGLESv2.vcxproj">
-      <Project>{b5871a7a-968c-42e3-a33b-981e6f448e78}</Project>
-      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
-    </ProjectReference>
-  </ItemGroup>
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-  <ImportGroup Label="ExtensionTargets">
-  </ImportGroup>
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <ItemGroup Label="ProjectConfigurations">
+    <ProjectConfiguration Include="Debug|Win32">
+      <Configuration>Debug</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Debug|x64">
+      <Configuration>Debug</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|Win32">
+      <Configuration>Release</Configuration>
+      <Platform>Win32</Platform>
+    </ProjectConfiguration>
+    <ProjectConfiguration Include="Release|x64">
+      <Configuration>Release</Configuration>
+      <Platform>x64</Platform>
+    </ProjectConfiguration>
+  </ItemGroup>
+  <PropertyGroup Label="Globals">
+    <ProjectGuid>{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}</ProjectGuid>
+    <RootNamespace>libEGL</RootNamespace>
+    <Keyword>Win32Proj</Keyword>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+    <WholeProgramOptimization>true</WholeProgramOptimization>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
+    <CharacterSet>Unicode</CharacterSet>
+  </PropertyGroup>
+  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+  <ImportGroup Label="ExtensionSettings">
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+  </ImportGroup>
+  <PropertyGroup Label="UserMacros" />
+  <PropertyGroup>
+    <_ProjectFileVersion>10.0.40219.1</_ProjectFileVersion>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</LinkIncremental>
+    <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)$(Platform)\$(Configuration)\</OutDir>
+    <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(Platform)\$(Configuration)\</IntDir>
+    <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental>
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(LibraryPath)</LibraryPath>
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(LibraryPath)</LibraryPath>
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(LibraryPath)</LibraryPath>
+    <LibraryPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(LibraryPath)</LibraryPath>
+  </PropertyGroup>
+  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+    <ClCompile>
+      <Optimization>Disabled</Optimization>
+      <AdditionalIncludeDirectories>$(ProjectDir)/..; $(ProjectDir)/../../include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;LIBEGL_EXPORTS;_CRT_SECURE_NO_DEPRECATE;NOMINMAX;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <MinimalRebuild>true</MinimalRebuild>
+      <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+      <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+      <PrecompiledHeader>
+      </PrecompiledHeader>
+      <WarningLevel>Level4</WarningLevel>
+      <TreatWarningAsError>true</TreatWarningAsError>
+      <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+      <DisableSpecificWarnings>4100;4127;4189;4239;4244;4245;4512;4702;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+    </ClCompile>
+    <Link>
+      <AdditionalDependencies>d3d9.lib;dxguid.lib;dwmapi.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <ModuleDefinitionFile>libEGL.def</ModuleDefinitionFile>
+      <DelayLoadDLLs>dwmapi.dll;%(DelayLoadDLLs)</DelayLoadDLLs>
+      <GenerateDebugInformation>true</GenerateDebugInformation>
+      <SubSystem>Windows</SubSystem>
+      <RandomizedBaseAddress>false</RandomizedBaseAddress>
+      <DataExecutionPrevention>
+      </DataExecutionPrevention>
+      <TargetMachine>MachineX86</TargetMachine>
+    </Link>
+    <PostBuildEvent>
+      <Command>%40echo on
+mkdir "$(ProjectDir)..\..\lib\$(Configuration)\"
+copy "$(OutDir)libEGL.dll" "$(ProjectDir)..\..\lib\$(Configuration)\"