Bug 774755 - 1/8 - Update ANGLE to r1242 - no review
authorBenoit Jacob <bjacob@mozilla.com>
Wed, 25 Jul 2012 12:13:45 -0400
changeset 100447 15e240011e108c58b8acc745dbe233578c5514e3
parent 100446 e5e8d176ac96e7e79f3385f7ad6712c62d917ff9
child 100448 c4a4804b2420ffa82a27f8e98b0f4d768c9629dd
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
bugs774755
milestone17.0a1
Bug 774755 - 1/8 - Update ANGLE to r1242 - no review
content/canvas/test/webgl/failing_tests_windows.txt
gfx/angle/AUTHORS
gfx/angle/CONTRIBUTORS
gfx/angle/DEPS
gfx/angle/Makefile.in
gfx/angle/README.mozilla
gfx/angle/angle-enforce-readpixels-spec.patch
gfx/angle/angle-impl-read-bgra.patch
gfx/angle/angle-intrinsic-msvc2005.patch
gfx/angle/angle-long-identifier-hash-spooky.patch
gfx/angle/angle-renaming-debug.patch
gfx/angle/angle-use-xmalloc.patch
gfx/angle/build/common.gypi
gfx/angle/extensions/ANGLE_depth_texture.txt
gfx/angle/extensions/ANGLE_program_binary.txt
gfx/angle/extensions/ANGLE_timer_query.txt
gfx/angle/include/GLES2/gl2ext.h
gfx/angle/include/GLSLANG/ShaderLang.h
gfx/angle/samples/gles2_book/Common/esUtil.vcproj
gfx/angle/samples/gles2_book/Hello_Triangle/Hello_Triangle.vcproj
gfx/angle/samples/gles2_book/MipMap2D/MipMap2D.vcproj
gfx/angle/samples/gles2_book/MultiTexture/MultiTexture.vcproj
gfx/angle/samples/gles2_book/ParticleSystem/ParticleSystem.vcproj
gfx/angle/samples/gles2_book/PostSubBuffer/PostSubBuffer.vcproj
gfx/angle/samples/gles2_book/Simple_Texture2D/Simple_Texture2D.vcproj
gfx/angle/samples/gles2_book/Simple_TextureCubemap/Simple_TextureCubemap.vcproj
gfx/angle/samples/gles2_book/Simple_VertexShader/Simple_VertexShader.vcproj
gfx/angle/samples/gles2_book/Stencil_Test/Stencil_Test.vcproj
gfx/angle/samples/gles2_book/TextureWrap/TextureWrap.vcproj
gfx/angle/samples/samples.sln
gfx/angle/samples/translator/essl_to_hlsl.vcproj
gfx/angle/samples/translator/translator.cpp
gfx/angle/src/ANGLE.sln
gfx/angle/src/build_angle.gyp
gfx/angle/src/common/angleutils.h
gfx/angle/src/common/version.h
gfx/angle/src/compiler/Compiler.cpp
gfx/angle/src/compiler/DetectDiscontinuity.cpp
gfx/angle/src/compiler/DetectDiscontinuity.h
gfx/angle/src/compiler/Diagnostics.cpp
gfx/angle/src/compiler/Diagnostics.h
gfx/angle/src/compiler/DirectiveHandler.cpp
gfx/angle/src/compiler/DirectiveHandler.h
gfx/angle/src/compiler/ExtensionBehavior.h
gfx/angle/src/compiler/Initialize.cpp
gfx/angle/src/compiler/InitializeParseContext.cpp
gfx/angle/src/compiler/InitializeParseContext.h
gfx/angle/src/compiler/Intermediate.cpp
gfx/angle/src/compiler/MapLongVariableNames.cpp
gfx/angle/src/compiler/OutputGLSLBase.cpp
gfx/angle/src/compiler/OutputHLSL.cpp
gfx/angle/src/compiler/OutputHLSL.h
gfx/angle/src/compiler/ParseHelper.cpp
gfx/angle/src/compiler/ParseHelper.h
gfx/angle/src/compiler/PoolAlloc.cpp
gfx/angle/src/compiler/Pragma.h
gfx/angle/src/compiler/RenameFunction.h
gfx/angle/src/compiler/ShHandle.h
gfx/angle/src/compiler/SymbolTable.cpp
gfx/angle/src/compiler/SymbolTable.h
gfx/angle/src/compiler/TranslatorHLSL.cpp
gfx/angle/src/compiler/Types.h
gfx/angle/src/compiler/UnfoldSelect.cpp
gfx/angle/src/compiler/UnfoldSelect.h
gfx/angle/src/compiler/UnfoldShortCircuit.cpp
gfx/angle/src/compiler/UnfoldShortCircuit.h
gfx/angle/src/compiler/ValidateLimitations.cpp
gfx/angle/src/compiler/compilerdebug.cpp
gfx/angle/src/compiler/compilerdebug.h
gfx/angle/src/compiler/debug.cpp
gfx/angle/src/compiler/debug.h
gfx/angle/src/compiler/depgraph/DependencyGraph.cpp
gfx/angle/src/compiler/depgraph/DependencyGraph.h
gfx/angle/src/compiler/depgraph/DependencyGraphBuilder.cpp
gfx/angle/src/compiler/depgraph/DependencyGraphBuilder.h
gfx/angle/src/compiler/depgraph/DependencyGraphOutput.cpp
gfx/angle/src/compiler/depgraph/DependencyGraphOutput.h
gfx/angle/src/compiler/depgraph/DependencyGraphTraverse.cpp
gfx/angle/src/compiler/generate_parser.sh
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/preprocessor/atom.c
gfx/angle/src/compiler/preprocessor/cpp.c
gfx/angle/src/compiler/preprocessor/cpp.h
gfx/angle/src/compiler/preprocessor/lexer_glue.cpp
gfx/angle/src/compiler/preprocessor/lexer_glue.h
gfx/angle/src/compiler/preprocessor/new/Context.cpp
gfx/angle/src/compiler/preprocessor/new/Context.h
gfx/angle/src/compiler/preprocessor/new/Diagnostics.cpp
gfx/angle/src/compiler/preprocessor/new/Diagnostics.h
gfx/angle/src/compiler/preprocessor/new/DirectiveHandler.cpp
gfx/angle/src/compiler/preprocessor/new/DirectiveHandler.h
gfx/angle/src/compiler/preprocessor/new/DirectiveParser.cpp
gfx/angle/src/compiler/preprocessor/new/DirectiveParser.h
gfx/angle/src/compiler/preprocessor/new/ExpressionParser.cpp
gfx/angle/src/compiler/preprocessor/new/ExpressionParser.h
gfx/angle/src/compiler/preprocessor/new/ExpressionParser.y
gfx/angle/src/compiler/preprocessor/new/Input.cpp
gfx/angle/src/compiler/preprocessor/new/Input.h
gfx/angle/src/compiler/preprocessor/new/Lexer.cpp
gfx/angle/src/compiler/preprocessor/new/Lexer.h
gfx/angle/src/compiler/preprocessor/new/Macro.cpp
gfx/angle/src/compiler/preprocessor/new/Macro.h
gfx/angle/src/compiler/preprocessor/new/MacroExpander.cpp
gfx/angle/src/compiler/preprocessor/new/MacroExpander.h
gfx/angle/src/compiler/preprocessor/new/Preprocessor.cpp
gfx/angle/src/compiler/preprocessor/new/Preprocessor.h
gfx/angle/src/compiler/preprocessor/new/SourceLocation.h
gfx/angle/src/compiler/preprocessor/new/Token.cpp
gfx/angle/src/compiler/preprocessor/new/Token.h
gfx/angle/src/compiler/preprocessor/new/Tokenizer.cpp
gfx/angle/src/compiler/preprocessor/new/Tokenizer.h
gfx/angle/src/compiler/preprocessor/new/Tokenizer.l
gfx/angle/src/compiler/preprocessor/new/generate_parser.sh
gfx/angle/src/compiler/preprocessor/new/numeric_lex.h
gfx/angle/src/compiler/preprocessor/new/pp.l
gfx/angle/src/compiler/preprocessor/new/pp.y
gfx/angle/src/compiler/preprocessor/new/pp_lex.cpp
gfx/angle/src/compiler/preprocessor/new/pp_tab.cpp
gfx/angle/src/compiler/preprocessor/new/pp_tab.h
gfx/angle/src/compiler/preprocessor/new/preprocessor.vcproj
gfx/angle/src/compiler/preprocessor/new/token_type.h
gfx/angle/src/compiler/preprocessor/scanner.c
gfx/angle/src/compiler/preprocessor/symbols.h
gfx/angle/src/compiler/preprocessor/tokens.c
gfx/angle/src/compiler/spooky.cpp
gfx/angle/src/compiler/spooky.h
gfx/angle/src/compiler/timing/RestrictFragmentShaderTiming.cpp
gfx/angle/src/compiler/timing/RestrictFragmentShaderTiming.h
gfx/angle/src/compiler/timing/RestrictVertexShaderTiming.cpp
gfx/angle/src/compiler/timing/RestrictVertexShaderTiming.h
gfx/angle/src/compiler/translator_common.vcproj
gfx/angle/src/compiler/translator_hlsl.vcproj
gfx/angle/src/libEGL/Display.cpp
gfx/angle/src/libEGL/Display.h
gfx/angle/src/libEGL/Makefile.in
gfx/angle/src/libEGL/ShaderCache.h
gfx/angle/src/libEGL/Surface.cpp
gfx/angle/src/libEGL/Surface.h
gfx/angle/src/libEGL/libEGL.cpp
gfx/angle/src/libEGL/libEGL.vcproj
gfx/angle/src/libEGL/main.cpp
gfx/angle/src/libGLESv2/BinaryStream.h
gfx/angle/src/libGLESv2/Blit.cpp
gfx/angle/src/libGLESv2/Blit.h
gfx/angle/src/libGLESv2/Context.cpp
gfx/angle/src/libGLESv2/Context.h
gfx/angle/src/libGLESv2/Framebuffer.cpp
gfx/angle/src/libGLESv2/Framebuffer.h
gfx/angle/src/libGLESv2/Makefile.in
gfx/angle/src/libGLESv2/Program.cpp
gfx/angle/src/libGLESv2/Program.h
gfx/angle/src/libGLESv2/ProgramBinary.cpp
gfx/angle/src/libGLESv2/ProgramBinary.h
gfx/angle/src/libGLESv2/Renderbuffer.cpp
gfx/angle/src/libGLESv2/Renderbuffer.h
gfx/angle/src/libGLESv2/Shader.h
gfx/angle/src/libGLESv2/Texture.cpp
gfx/angle/src/libGLESv2/Texture.h
gfx/angle/src/libGLESv2/VertexDataManager.cpp
gfx/angle/src/libGLESv2/libGLESv2.cpp
gfx/angle/src/libGLESv2/libGLESv2.def
gfx/angle/src/libGLESv2/libGLESv2.vcproj
gfx/angle/src/libGLESv2/mathutil.h
gfx/angle/src/libGLESv2/shaders/Blit.ps
gfx/angle/src/libGLESv2/shaders/Blit.vs
gfx/angle/src/libGLESv2/shaders/componentmaskps.h
gfx/angle/src/libGLESv2/shaders/flipyvs.h
gfx/angle/src/libGLESv2/shaders/generate_shaders.bat
gfx/angle/src/libGLESv2/shaders/luminanceps.h
gfx/angle/src/libGLESv2/shaders/passthroughps.h
gfx/angle/src/libGLESv2/shaders/standardvs.h
gfx/angle/src/libGLESv2/utilities.cpp
gfx/angle/src/libGLESv2/utilities.h
gfx/angle/tests/build_tests.gyp
gfx/angle/tests/preprocessor_tests/MockDiagnostics.h
gfx/angle/tests/preprocessor_tests/MockDirectiveHandler.h
gfx/angle/tests/preprocessor_tests/PreprocessorTest.cpp
gfx/angle/tests/preprocessor_tests/PreprocessorTest.h
gfx/angle/tests/preprocessor_tests/char_test.cpp
gfx/angle/tests/preprocessor_tests/comment_test.cpp
gfx/angle/tests/preprocessor_tests/define_test.cpp
gfx/angle/tests/preprocessor_tests/error_test.cpp
gfx/angle/tests/preprocessor_tests/extension_test.cpp
gfx/angle/tests/preprocessor_tests/identifier_test.cpp
gfx/angle/tests/preprocessor_tests/if_test.cpp
gfx/angle/tests/preprocessor_tests/input_test.cpp
gfx/angle/tests/preprocessor_tests/location_test.cpp
gfx/angle/tests/preprocessor_tests/number_test.cpp
gfx/angle/tests/preprocessor_tests/operator_test.cpp
gfx/angle/tests/preprocessor_tests/pragma_test.cpp
gfx/angle/tests/preprocessor_tests/space_test.cpp
gfx/angle/tests/preprocessor_tests/token_test.cpp
gfx/angle/tests/preprocessor_tests/version_test.cpp
--- a/content/canvas/test/webgl/failing_tests_windows.txt
+++ b/content/canvas/test/webgl/failing_tests_windows.txt
@@ -0,0 +1,2 @@
+conformance/glsl/functions/glsl-function-atan-xy.html
+conformance/glsl/misc/struct-nesting-under-maximum.html
--- a/gfx/angle/AUTHORS
+++ b/gfx/angle/AUTHORS
@@ -8,8 +8,10 @@
 # The email address is not required for organizations.
 
 TransGaming Inc.
 
 Google Inc.
 
 3DLabs Inc. Ltd.
 
+Cloud Party, Inc.
+
--- a/gfx/angle/CONTRIBUTORS
+++ b/gfx/angle/CONTRIBUTORS
@@ -12,16 +12,17 @@ TransGaming Inc.
  Andrew Lewycky
  Gavriel State
  Shannon Woods
 
 Google Inc.
  Brent Austin
  Michael Bai
  John Bauman
+ Steve Block
  Henry Bridge
  Nat Duca
  Vangelis Kokkevis
  Zhenyao Mo
  Daniel Nicoara
  Alastair Patrick
  Alok Priyadarshi
  Kenneth Russell
@@ -34,18 +35,26 @@ Mozilla Corp.
  Mike Hommey
  Benoit Jacob
  Makoto Kato
  Vladimir Vukicevic
 
 Apple Inc.
  David Kilzer
 
+Adobe Systems Inc.
+ Alexandru Chiculita
+ Max Vujovic
+
+Cloud Party, Inc.
+ Conor Dickinson
+
 Aitor Moreno <aitormoreno at gmail.com>
 Jim Hauxwell <james at dattrax.co.uk>
 ddefrostt
 timeless
 Yore Apex
 Mark Callow
 Yuriy O'Donnell
 Sam Hocevar
 Pierre Leveille
+Jin Yang
 
--- a/gfx/angle/DEPS
+++ b/gfx/angle/DEPS
@@ -1,14 +1,17 @@
 deps = {
   "trunk/third_party/gyp":
       "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
 }
 
 hooks = [
   {
     # A change to a .gyp, .gypi, or to GYP itself should run the generator.
     "pattern": ".",
     "action": ["python", "trunk/build/gyp_angle"],
   },
--- a/gfx/angle/Makefile.in
+++ b/gfx/angle/Makefile.in
@@ -1,12 +1,44 @@
 # 
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+# ***** BEGIN LICENSE BLOCK *****
+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
+#
+# The contents of this file are subject to the Mozilla Public License Version
+# 1.1 (the "License"); you may not use this file except in compliance with
+# the License. You may obtain a copy of the License at
+# http://www.mozilla.org/MPL/
+#
+# Software distributed under the License is distributed on an "AS IS" basis,
+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+# for the specific language governing rights and limitations under the
+# License.
+#
+# The Original Code is gecko.
+#
+# The Initial Developer of the Original Code is
+#   Mozilla 
+# Portions created by the Initial Developer are Copyright (C) 2010
+# the Initial Developer. All Rights Reserved.
+#
+# Contributor(s):
+#
+# Alternatively, the contents of this file may be used under the terms of
+# either of the GNU General Public License Version 2 or later (the "GPL"),
+# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
+# in which case the provisions of the GPL or the LGPL are applicable instead
+# of those above. If you wish to allow use of your version of this file only
+# under the terms of either the GPL or the LGPL, and not to allow others to
+# use your version of this file under the terms of the MPL, indicate your
+# decision by deleting the provisions above and replace them with the notice
+# and other provisions required by the GPL or the LGPL. If you do not delete
+# the provisions above, a recipient may use your version of this file under
+# the terms of any one of the MPL, the GPL or the LGPL.
+#
+# ***** END LICENSE BLOCK *****
 
 DEPTH		= ../..
 topsrcdir	= @top_srcdir@
 srcdir		= @srcdir@
 VPATH		= @srcdir@
 
 include $(DEPTH)/config/autoconf.mk
 
@@ -23,17 +55,16 @@ EXPORTS_angle = \
 	include/GLSLANG/ShaderLang.h \
 	$(NULL)
 
 LOCAL_INCLUDES += -I$(srcdir)/include -I$(srcdir)/src
 
 VPATH += $(srcdir)/src
 VPATH += $(srcdir)/src/compiler
 VPATH += $(srcdir)/src/compiler/preprocessor
-VPATH += $(srcdir)/src/compiler/preprocessor/new
 
 CPPSRCS = \
 	Compiler.cpp \
         DetectRecursion.cpp \
         InfoSink.cpp \
         Initialize.cpp \
         InitializeDll.cpp \
         Intermediate.cpp \
@@ -42,30 +73,23 @@ CPPSRCS = \
         parseConst.cpp \
         ParseHelper.cpp \
         PoolAlloc.cpp \
         QualifierAlive.cpp \
         RemoveTree.cpp \
         ShaderLang.cpp \
         SymbolTable.cpp \
         VariableInfo.cpp \
-        compilerdebug.cpp \
+        debug.cpp \
         ossource_nspr.cpp \
         util.cpp \
         ValidateLimitations.cpp \
         ForLoopUnroll.cpp \
         MapLongVariableNames.cpp \
-        spooky.cpp \
         BuiltInFunctionEmulator.cpp \
-        Input.cpp \
-        Lexer.cpp \
-        pp_lex.cpp \
-        Preprocessor.cpp \
-        Token.cpp \
-        lexer_glue.cpp \
         $(NULL)
 
 # flex/yacc generated files
 CPPSRCS += \
         glslang_lex.cpp \
         glslang_tab.cpp \
         $(NULL)
 
@@ -103,17 +127,17 @@ CSRCS   = \
 	$(NULL)
 
 DEFINES += -DANGLE_USE_NSPR -DANGLE_BUILD -DCOMPILER_IMPLEMENTATION
 
 #these defines are from ANGLE's build_angle.gyp
 DEFINES += -DANGLE_DISABLE_TRACE
 DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
 
-ifdef MOZ_ANGLE_RENDERER
+ifdef MOZ_ANGLE
 
 # libEGL depends on (links against!) libGLESv2!
 DIRS = src/libGLESv2 src/libEGL
 
 libs::
 	expand "$(MOZ_D3DX9_CAB)" -F:$(MOZ_D3DX9_DLL) "$(DIST)/bin"
 	expand "$(MOZ_D3DCOMPILER_CAB)" -F:$(MOZ_D3DCOMPILER_DLL) "$(DIST)/bin"
 
--- a/gfx/angle/README.mozilla
+++ b/gfx/angle/README.mozilla
@@ -1,21 +1,22 @@
 This is the ANGLE project, from http://code.google.com/p/angleproject/
 
-Current revision: r1042
+Current revision: r963
 
 == Applied local patches ==
 
 In this order:
   angle-renaming-debug.patch - rename debug.h to compilerdebug.h to avoid conflict in our makefiles
   angle-intrinsic-msvc2005.patch - work around a MSVC 2005 compile error
   angle-use-xmalloc.patch - see bug 680840. Can drop this patch whenever the new preprocessor lands.
+  angle-castrate-bug-241.patch - see bug 699033 / angle bug 241
   angle-enforce-readpixels-spec.patch - see bug 724476.
   angle-impl-read-bgra.patch - see bug 724476.
-  angle-long-identifier-hash-spooky.patch - see bug 676071
+  gfx/angle/angle-long-identifier-hash-spooky.patch - see bug 676071
 
 In addition to these patches, the Makefile.in files are ours, they're not present in upsteam ANGLE.
 
 == How to update this ANGLE copy ==
 
 1. Unapply patches
 2. Apply diff with new ANGLE version
 3. Reapply patches.
--- a/gfx/angle/angle-enforce-readpixels-spec.patch
+++ b/gfx/angle/angle-enforce-readpixels-spec.patch
@@ -1,10 +1,11 @@
-# HG changeset patch
-# Parent 8d84c8d4e3ed41a4941afdf9d51819b19ca64716
+From: Jeff Gilbert <jgilbert@mozilla.com>
+Bug 724476 - ANGLE Bug 293 - Enforce readPixels format/type semantics
+
 diff --git a/gfx/angle/src/libGLESv2/libGLESv2.cpp b/gfx/angle/src/libGLESv2/libGLESv2.cpp
 --- a/gfx/angle/src/libGLESv2/libGLESv2.cpp
 +++ b/gfx/angle/src/libGLESv2/libGLESv2.cpp
 @@ -98,27 +98,16 @@ bool validReadFormatType(GLenum format, 
          switch (type)
          {
            case GL_UNSIGNED_BYTE:
              break;
--- a/gfx/angle/angle-impl-read-bgra.patch
+++ b/gfx/angle/angle-impl-read-bgra.patch
@@ -1,14 +1,15 @@
-# HG changeset patch
-# Parent 8b838be49f115022e403c850c24b28ad62d72ad6
+From: Jeff Gilbert <jgilbert@mozilla.com>
+Bug 724476 - ANGLE Bug 294 - Use BGRA/UBYTE as exposed fast format/type for readPixels
+
 diff --git a/gfx/angle/src/libGLESv2/Context.cpp b/gfx/angle/src/libGLESv2/Context.cpp
 --- a/gfx/angle/src/libGLESv2/Context.cpp
 +++ b/gfx/angle/src/libGLESv2/Context.cpp
-@@ -2518,16 +2518,17 @@ void Context::readPixels(GLint x, GLint 
+@@ -2520,16 +2520,17 @@ void Context::readPixels(GLint x, GLint 
      {
          if (desc.Format == D3DFMT_A8R8G8B8 &&
              format == GL_BGRA_EXT &&
              type == GL_UNSIGNED_BYTE)
          {
              // Fast path for EXT_read_format_bgra, given
              // an RGBA source buffer.  Note that buffers with no
              // alpha go through the slow path below.
@@ -16,17 +17,17 @@ diff --git a/gfx/angle/src/libGLESv2/Con
              memcpy(dest + j * outputPitch,
                     source + j * inputPitch,
                     (rect.right - rect.left) * 4);
              continue;
          }
  
          for (int i = 0; i < rect.right - rect.left; i++)
          {
-@@ -2665,20 +2666,20 @@ void Context::readPixels(GLint x, GLint 
+@@ -2666,20 +2667,20 @@ void Context::readPixels(GLint x, GLint 
                          ((unsigned short)(     a + 0.5f) << 15) |
                          ((unsigned short)(31 * r + 0.5f) << 10) |
                          ((unsigned short)(31 * g + 0.5f) << 5) |
                          ((unsigned short)(31 * b + 0.5f) << 0);
                      break;
                    default: UNREACHABLE();
                  }
                  break;
--- a/gfx/angle/angle-intrinsic-msvc2005.patch
+++ b/gfx/angle/angle-intrinsic-msvc2005.patch
@@ -1,10 +1,10 @@
 # HG changeset patch
-# Parent 4ef86d96d456866537beea57b0a4451cf919cd34
+# Parent 6ee54a11fd135a2b594db77f7eaf83f06ee7b1d8
 diff --git a/gfx/angle/src/libGLESv2/Texture.cpp b/gfx/angle/src/libGLESv2/Texture.cpp
 --- a/gfx/angle/src/libGLESv2/Texture.cpp
 +++ b/gfx/angle/src/libGLESv2/Texture.cpp
 @@ -8,16 +8,22 @@
  // Texture2D and TextureCubeMap. Implements GL texture objects and related
  // functionality. [OpenGL ES 2.0.24] section 3.7 page 63.
  
  #include "libGLESv2/Texture.h"
--- a/gfx/angle/angle-long-identifier-hash-spooky.patch
+++ b/gfx/angle/angle-long-identifier-hash-spooky.patch
@@ -1,10 +1,11 @@
 # HG changeset patch
-# Parent 268bda9ac676b6f4cca5aa044d0dcefff2008535
+# Parent 69255fe4cb94f1681bc9200db37c0ad3de171abc
+
 diff --git a/gfx/angle/Makefile.in b/gfx/angle/Makefile.in
 --- a/gfx/angle/Makefile.in
 +++ b/gfx/angle/Makefile.in
 @@ -79,16 +79,17 @@ CPPSRCS = \
          SymbolTable.cpp \
          VariableInfo.cpp \
          compilerdebug.cpp \
          ossource_nspr.cpp \
--- a/gfx/angle/angle-renaming-debug.patch
+++ b/gfx/angle/angle-renaming-debug.patch
@@ -1,14 +1,14 @@
 # HG changeset patch
-# Parent f22671e05062a082c7b22192868b804fbf42653b
+# Parent 326590fb862cf7e277487f48c7a434bde3566ea0
 diff --git a/gfx/angle/Makefile.in b/gfx/angle/Makefile.in
 --- a/gfx/angle/Makefile.in
 +++ b/gfx/angle/Makefile.in
-@@ -73,17 +73,17 @@ CPPSRCS = \
+@@ -75,17 +75,17 @@ CPPSRCS = \
          parseConst.cpp \
          ParseHelper.cpp \
          PoolAlloc.cpp \
          QualifierAlive.cpp \
          RemoveTree.cpp \
          ShaderLang.cpp \
          SymbolTable.cpp \
          VariableInfo.cpp \
@@ -43,17 +43,17 @@ diff --git a/gfx/angle/src/compiler/Outp
      TInfoSinkBase out;
      if (type.isMatrix())
      {
 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
 @@ -1,17 +1,17 @@
  //
- // Copyright (c) 2002-2012 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/OutputHLSL.h"
  
 -#include "compiler/debug.h"
 +#include "compiler/compilerdebug.h"
@@ -186,13 +186,13 @@ diff --git a/gfx/angle/src/compiler/prep
  #include <string.h>
  #include <ctype.h>
  
 -#include "compiler/debug.h"
 +#include "compiler/compilerdebug.h"
  #include "compiler/preprocessor/slglobals.h"
  #include "compiler/util.h"
  
- #if defined(_MSC_VER)
- #pragma warning(disable: 4054)
- #pragma warning(disable: 4152)
- #endif
+ ///////////////////////////////////////////////////////////////////////////////////////////////
+ //////////////////////// Preprocessor and Token Recorder and Playback: ////////////////////////
+ ///////////////////////////////////////////////////////////////////////////////////////////////
  
+ /*
--- a/gfx/angle/angle-use-xmalloc.patch
+++ b/gfx/angle/angle-use-xmalloc.patch
@@ -1,25 +1,25 @@
 # HG changeset patch
-# Parent 6ccfe6b908da8ade8b37e772ed8a9f3c494d8ef9
+# Parent 93033f21b121382b50e5bc9787edf704d6906508
 diff --git a/gfx/angle/Makefile.in b/gfx/angle/Makefile.in
 --- a/gfx/angle/Makefile.in
 +++ b/gfx/angle/Makefile.in
-@@ -127,16 +127,18 @@ CSRCS   = \
+@@ -129,16 +129,18 @@ CSRCS   = \
  	$(NULL)
  
  DEFINES += -DANGLE_USE_NSPR -DANGLE_BUILD -DCOMPILER_IMPLEMENTATION
  
  #these defines are from ANGLE's build_angle.gyp
  DEFINES += -DANGLE_DISABLE_TRACE
  DEFINES += -DANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0
  
 +EXTRA_DSO_LDOPTS = $(MOZALLOC_LIB)
 +
- ifdef MOZ_ANGLE_RENDERER
+ ifdef MOZ_ANGLE
  
  # libEGL depends on (links against!) libGLESv2!
  DIRS = src/libGLESv2 src/libEGL
  
  libs::
  	expand "$(MOZ_D3DX9_CAB)" -F:$(MOZ_D3DX9_DLL) "$(DIST)/bin"
  	expand "$(MOZ_D3DCOMPILER_CAB)" -F:$(MOZ_D3DCOMPILER_DLL) "$(DIST)/bin"
 diff --git a/gfx/angle/src/compiler/preprocessor/atom.c b/gfx/angle/src/compiler/preprocessor/atom.c
--- a/gfx/angle/build/common.gypi
+++ b/gfx/angle/build/common.gypi
@@ -1,15 +1,31 @@
 # Copyright (c) 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.
 
 {
   'variables': {
     'component%': 'static_library',
+    'gcc_or_clang_warnings': [
+      '-Wall',
+      '-Wchar-subscripts',
+      '-Werror',
+      '-Wextra',
+      '-Wformat=2',
+      '-Winit-self',
+      '-Wno-sign-compare',
+      '-Wno-unused-function',
+      '-Wno-unused-parameter',
+      '-Wno-unknown-pragmas',
+      '-Wpacked',
+      '-Wpointer-arith',
+      '-Wundef',
+      '-Wwrite-strings',
+    ],
   },
   'target_defaults': {
     'default_configuration': 'Debug',
     'variables': {
       'warn_as_error%': 1,
     },
     'target_conditions': [
       ['warn_as_error == 1', {
new file mode 100644
--- /dev/null
+++ b/gfx/angle/extensions/ANGLE_depth_texture.txt
@@ -0,0 +1,399 @@
+Name
+
+    ANGLE_depth_texture
+
+Name Strings
+
+    GL_ANGLE_depth_texture
+
+Contributors
+
+    Nicolas Capens, TransGaming
+    Kenneth Russell, Google
+    Vangelis Kokkevis, Google
+    Gregg Tavares, Google
+    Contributors to OES_depth_texture
+    Contributors to OES_packed_depth_stencil
+
+Contact
+
+    Daniel Koch, TransGaming (daniel 'at' transgaming.com)
+
+Status
+
+    Implemented in ANGLE.
+
+Version
+
+    Last Modifed Date: June 4, 2012
+    Revision: #3
+
+Number
+
+    TBD
+
+Dependencies
+
+    OpenGL ES 2.0 is required.
+    This extension is written against the OpenGL ES 2.0.25 specification
+
+    OES_packed_depth_stencil affects the definition of this extension.
+
+    EXT_texture_storage affects the definition of this extension.
+
+Overview
+
+    This extension defines support for 2D depth and depth-stencil
+    textures in an OpenGL ES implementation.
+
+    This extension incorporates the depth texturing functionality of 
+    OES_depth_texture and OES_packed_depth_stencil, but does not 
+    provide the ability to load existing data via TexImage2D or
+    TexSubImage2D. This extension also allows implementation 
+    variability in which components from a sampled depth texture
+    contain the depth data. Depth textures created with this
+    extension only support 1 level.
+
+New Procedures and Functions
+
+    None
+
+New Tokens
+
+    Accepted by the <format> parameter of TexImage2D and TexSubImage2D and
+    <internalformat> parameter of TexImage2D:
+    
+        DEPTH_COMPONENT             0x1902
+        DEPTH_STENCIL_OES           0x84F9
+        
+    Accepted by the <type> parameter of TexImage2D, TexSubImage2D: 
+
+        UNSIGNED_SHORT              0x1403
+        UNSIGNED_INT                0x1405
+        UNSIGNED_INT_24_8_OES       0x84FA
+
+    Accepted by the <internalformat> parameter of TexStorage2DEXT:
+
+        DEPTH_COMPONENT16           0x81A5
+        DEPTH_COMPONENT32_OES       0x81A7
+        DEPTH24_STENCIL8_OES        0x88F0
+
+Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL Operation)
+
+    Update Section 2.10.5 "Shader Execution" in the subsection titled 
+    "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 (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
+      UNSIGNED_INT_24_8_OES    uint             Yes
+
+    Add the following rows to Table 3.3 (page 62):
+
+      Format Name       Element Meaning and Order      Target Buffer
+      ------------------------------------------------------------------
+      ...               ...                            ...
+      DEPTH_COMPONENT   Depth                          Depth
+      DEPTH_STENCIL_OES Depth and Stencil Index        Depth and Stencil
+      ...               ...                            ...
+
+    Add a row to Table 3.5 "Packed pixel formats" (page 64):
+
+      type Parameter               GL Type  Components  Pixel Formats
+      ------------------------------------------------------------------
+      ...                          ...      ...         ...
+      UNSIGNED_INT_24_8_OES        uint     2           DEPTH_STENCIL_OES
+
+    Add a new table after Table 3.6 (page 64):
+
+    UNSIGNED_INT_24_8_OES
+
+       31 30 29 28 27 26 ... 12 11 10 9 8 7 6 5 4 3 2 1 0
+      +----------------------------------+---------------+
+      |           1st Component          | 2nd Component |
+      +----------------------------------+---------------+
+
+      Table 3.6.B: UNSIGNED_INT formats
+
+    Add a row to Table 3.7 "Packed pixel field assignments" (page 65):
+
+      Format            |  1st     2nd     3rd     4th
+      ------------------+-------------------------------
+      ...               |  ...     ...     ...     ...
+      DEPTH_STENCIL_OES |  depth   stencil N/A     N/A
+
+    Add the following paragraph to the end of the section "Conversion to
+    floating-point" (page 65):
+
+    "For groups of components that contain both standard components and index
+    elements, such as DEPTH_STENCIL_OES, the index elements are not converted."
+
+    In section 3.7.1 "Texture Image Specification", update page 67 to
+    say:
+
+    "The selected groups are processed as described in section 3.6.2, stopping
+    just before final conversion.  Each R, G, B, A, or depth value so generated
+    is clamped to [0, 1], while the stencil index values are masked by 2^n-1,
+    where n is the number of stencil bits in the internal format resolution
+    (see below).
+
+    Components are then selected from the resulting R, G, B, A, depth, or
+    stencil index values to obtain a texture with the base internal format
+    specified by <internalformat>.  Table 3.8 summarizes the mapping of R, G,
+    B, A, depth, or stencil values to texture components, as a function of the
+    base internal format of the texture image.  <internalformat> may be
+    specified as one of the internal format symbolic constants listed in
+    table 3.8. Specifying a value for <internalformat> that is not one of the
+    above values generates the error INVALID_VALUE. If <internalformat> does
+    not match <format>, the error INVALID_OPERATION is generated.
+
+    Textures with a base internal format of DEPTH_COMPONENT or 
+    DEPTH_STENCIL_OES are supported by texture image specification commands
+    only if <target> is TEXTURE_2D.  Using these formats in conjunction with
+    any other <target> will result in an INVALID_OPERATION error.
+
+    Textures with a base internal format of DEPTH_COMPONENT or
+    DEPTH_STENCIL_OES only support one level of image data.  Specifying a
+    non-zero value for <level> will result in an INVALID_OPERATION error.
+
+    Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL_OES
+    require either depth component data or depth/stencil component data.
+    Textures with other base internal formats require RGBA component data.  The
+    error INVALID_OPERATION is generated if the base internal format is
+    DEPTH_COMPONENT or DEPTH_STENCIL_OES and <format> is not DEPTH_COMPONENT or
+    DEPTH_STENCIL_OES, or if the base internal format is not DEPTH_COMPONENT or
+    DEPTH_STENCIL_OES and <format> is DEPTH_COMPONENT or DEPTH_STENCIL_OES.
+
+    Textures with a base internal format of DEPTH_COMPONENT or
+    DEPTH_STENCIL_OES do not support loading image data via the TexImage
+    commands. They can only have their contents specified by rendering
+    to them. The INVALID_OPERATION error is generated by the TexImage2D
+    command if <data> is not NULL for such textures."
+
+    Add a row to table 3.8 (page 68), and update the title of the
+    second column:
+
+      Base Internal Format  RGBA, Depth and Stencil Values  Internal Components
+      -------------------------------------------------------------------------
+      ...                   ...                             ...
+      DEPTH_COMPONENT       Depth                           D
+      DEPTH_STENCIL_OES     Depth,Stencil                   D,S
+      ...                   ...                             ...
+
+    Update the caption for table 3.8 (page 68)
+
+    "Table 3.8: Conversion from RGBA, depth, and stencil pixel components to
+    internal texture components.  Texture components R, G, B, A, and L are 
+    converted back to RGBA colors during filtering as shown in table 3.12.
+    Texture components D are converted to RGBA colors as described in 
+    section 3.7.8-1/2."
+
+    Add the following to section 3.7.2 "Alternate Texture Image Specification
+    Commands":
+
+    "CopyTexImage2D and CopyTexSubImage2D generate the INVALID_OPERATION 
+    error if the base internal format of the destination texture is 
+    DEPTH_COMPONENT or DEPTH_STENCIL_OES.
+
+    TexSubImage2D generates the INVALID_OPERATION error if the base internal
+    format of the texture is DEPTH_COMPONENT or DEPTH_STENCIL_OES."
+
+    Add a new section between sections 3.7.8 and 3.7.9:
+
+    "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, <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 <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:
+
+    "Texture lookups involving textures with depth component data generate
+    a texture source color by using depth data directly, as described in
+    section 3.7.8-1/2.  The stencil texture internal component is ignored
+    if the base internal format is DEPTH_STENCIL_OES."
+
+Additions to Chapter 4 of the OpenGL ES 2.0 specification (Per-Fragment
+Operations and the Framebuffer)
+
+    In section 4.4.5 "Framebuffer Completeness", replace the the 3rd
+    paragraph with the following text:
+
+     "* An internal format is color-renderable if it is one of the formats
+        from table 4.5 noted as color-renderable or if it is unsized format
+        RGBA or RGB. No other formats, including compressed internal formats,
+        are color-renderable.
+
+      * An internal format is depth-renderable if it is one of the sized
+        internal formats from table 4.5 noted as depth-renderable, if it
+        is the unsized format DEPTH_COMPONENT or if it is the internal 
+        format value of DEPTH24_STENCIL8_OES. No other formats are 
+        depth-renderable.
+
+      * An internal format is stencil-renderable if it is one of the sized 
+        internal formats from table 4.5 noted as stencil-renderable or if it
+        is DEPTH24_STENCIL8_OES. No other formats are stencil-renderable."
+
+Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special
+Functions)
+
+    None.
+
+Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State
+Requests)
+
+    None.
+
+Interactions with OES_packed_depth_stencil
+
+    If OES_packed_depth_stencil is not supported, mentions of
+    DEPTH_STENCIL_OES and UNSIGNED_INT_24_8_OES as a format/type combinations
+    for TexImage2D and TexSubImage2D are omitted. Mentions of
+    the internal format DEPTH24_STENCIL8_OES are also omitted.
+
+Interactions with EXT_texture_storage
+
+    If EXT_texture_storage is supported the following internalformat
+    to format/type mappings are used:
+
+        <internalformat>       <format>           <type>
+        ----------------       --------           ------
+        DEPTH_COMPONENT16      DEPTH_COMPONENT    UNSIGNED_SHORT
+        DEPTH_COMPONENT32_OES  DEPTH_COMPONENT    UNSIGNED_INT
+        DEPTH24_STENCIL8_OES   DEPTH_STENCIL_OES  UNSIGNED_INT
+
+    Textures with the above <internalformats> only support one level of
+    image data. Specifying a value other than one for the <levels> parameter
+    to TexStorage2DEXT will result in an INVALID_OPERATION error.
+
+    If EXT_texture_storage is not supported, ignore any references
+    to TexStorage2DEXT. 
+
+Errors
+
+    The error INVALID_OPERATION is generated by TexImage2D if <format> and 
+    <internalformat> are DEPTH_COMPONENT and <type> is not UNSIGNED_SHORT,
+    or UNSIGNED_INT.
+
+    The error INVALID_OPERATION is generated by TexSubImage2D if <format> is 
+    DEPTH_COMPONENT and <type> is not UNSIGNED_SHORT, or UNSIGNED_INT.
+
+    The error INVALID_OPERATION is generated by TexImage2D if <format> and
+    <internalformat> are not DEPTH_COMPONENT and <type> is UNSIGNED_SHORT,
+    or UNSIGNED_INT.
+
+    The error INVALID_OPERATION is generated by TexSubImage2D if <format> is
+    not DEPTH_COMPONENT and <type> is UNSIGNED_SHORT, or UNSIGNED_INT.
+
+    The error INVALID_OPERATION is generated by TexImage2D if <format> and
+    <internalformat> are DEPTH_STENCIL_OES and <type> is not
+    UNSIGNED_INT_24_8_OES. 
+
+    The error INVALID_OPERATION is generated by TexSubImage2D if <format>
+    is DEPTH_STENCIL_OES and <type> is not UNSIGNED_INT_24_8_OES. 
+
+    The error INVALID_OPERATION is generated by TexImage2D if <format> and
+    <internalformat> is not DEPTH_STENCIL_OES and <type> is 
+    UNSIGNED_INT_24_8_OES.
+
+    The error INVALID_OPERATION is generated by TexSubImage2D if <format>
+    is not DEPTH_STENCIL_OES and <type> is UNSIGNED_INT_24_8_OES.
+
+    The error INVALID_OPERATION is generated in the following situations:
+    - TexImage2D is called with <format> and <internalformat> of
+      DEPTH_COMPONENT or DEPTH_STENCIL_OES and
+       - <target> is not TEXTURE_2D,
+       - <data> is not NULL, or
+       - <level> is not zero.
+    - TexSubImage2D is called with <format> of DEPTH_COMPONENT or 
+      DEPTH_STENCIL_OES.
+    - TexStorage2DEXT is called with <internalformat> of DEPTH_COMPONENT16,
+      DEPTH_COMPONENT32_OES, or DEPTH24_STENCIL8_OES, and 
+       - <target> is not TEXTURE_2D, or
+       - <levels> is not one.
+    - CopyTexImage2D is called with an <internalformat> that has a base
+      internal format of DEPTH_COMPONENT or DEPTH_STENCIL_OES.
+    - CopyTexSubImage2D is called with a target texture that has a base
+      internal format of DEPTH_COMPONENT or DEPTH_STENCIL_OES.
+    - GenerateMipmap is called on a texture that has a base internal format
+      of DEPTH_COMPONENT or DEPTH_STENCIL_OES.
+    
+New State
+
+    None.
+
+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 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.
+
+    2) Why does TexSubImage2D accept the new format/type combinations even
+       though it does not actually support loading data?
+
+       RESOLVED: This was done to be more consistent with the OES_depth_texture
+       extension and to make it easier to add support for loading texture
+       data if it is possible to support in the future.
+
+    3) Why are only 1-level depth textures supported? 
+
+       RESOLVED: The only use for multiple levels of depth textures would
+       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
+ 
+    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
+
new file mode 100644
--- /dev/null
+++ b/gfx/angle/extensions/ANGLE_program_binary.txt
@@ -0,0 +1,94 @@
+Name
+
+    ANGLE_program_binary
+
+Name Strings
+
+    GL_ANGLE_program_binary
+
+Contributors
+
+    Alastair Patrick, Google Inc.
+    Daniel Koch, TransGaming Inc.
+
+Contact
+
+    Alastair Patrick, Google Inc. (apatrick 'at' google 'dot' com)
+
+Status
+
+    Under development.
+
+Version
+
+    Last Modifed Date: June 6, 2012
+    Revision: #1
+
+Number
+
+    TBD
+
+Dependencies
+
+    OpenGL ES 2.0 is required.
+    OES_get_program_binary is required.
+    This extension is written against the OpenGL ES 2.0.25 specification.
+
+Overview
+
+    This extension makes available a program binary format,
+    PROGRAM_BINARY_ANGLE. It enables retrieving and loading of pre-linked
+    ANGLE program objects.
+
+New Procedures and Functions
+
+    None
+
+New Tokens
+
+    Accepted by the <binaryFormat> parameter of ProgramBinaryOES:
+
+        PROGRAM_BINARY_ANGLE        0x93A6
+
+Additions to Chapter 2 of the OpenGL-ES 2.0 Specification (OpenGL Operation)
+
+    Add the following paragraph to the end of section 2.15.4, Program Binaries:
+    
+    "PROGRAM_BINARY_ANGLE, returned in the list of PROGRAM_BINARY_FORMATS_OES,
+    is a format that may be loaded into a program object via ProgramBinaryOES." 
+    
+Additions to Chapter 3 of the OpenGL ES 2.0 specification (Rasterizatoin)
+
+    None.
+
+Additions to Chapter 4 of the OpenGL ES 2.0 specification (Per-Fragment
+Operations and the Framebuffer)
+
+    None.
+
+Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special
+Functions)
+
+    None.
+
+Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State
+Requests)
+
+    None.
+
+Errors
+
+    None
+
+New State
+
+    None.
+
+Issues
+
+    None
+
+Revision History
+ 
+    06/06/2012  apatrick  intial revision
+
--- a/gfx/angle/extensions/ANGLE_timer_query.txt
+++ b/gfx/angle/extensions/ANGLE_timer_query.txt
@@ -1,591 +1,591 @@
-Name
-
-    ANGLE_timer_query
-
-Name Strings
-
-    GL_ANGLE_timer_query
-
-Contributors
-
-    Contributors to ARB_occlusion_query
-    Contributors to EXT_timer_query
-    Contributors to ARB_timer_query
-    Ben Vanik, Google Inc.
-    Daniel Koch, TransGaming Inc.
-
-Contact
-
-    Ben Vanik, Google Inc. (benvanik 'at' google 'dot' com)
-
-Status
-
-    Draft
-
-Version
-
-    Last Modified Date: Apr 28, 2011
-    Author Revision: 1
-
-Number
-
-    OpenGL ES Extension #??
-
-Dependencies
-
-    OpenGL ES 2.0 is required.
-
-    The extension is written against the OpenGL ES 2.0 specification.
-
-Overview
-
-    Applications can benefit from accurate timing information in a number of
-    different ways.  During application development, timing information can
-    help identify application or driver bottlenecks.  At run time,
-    applications can use timing information to dynamically adjust the amount
-    of detail in a scene to achieve constant frame rates.  OpenGL
-    implementations have historically provided little to no useful timing
-    information.  Applications can get some idea of timing by reading timers
-    on the CPU, but these timers are not synchronized with the graphics
-    rendering pipeline.  Reading a CPU timer does not guarantee the completion
-    of a potentially large amount of graphics work accumulated before the
-    timer is read, and will thus produce wildly inaccurate results.
-    glFinish() can be used to determine when previous rendering commands have
-    been completed, but will idle the graphics pipeline and adversely affect
-    application performance.
-
-    This extension provides a query mechanism that can be used to determine
-    the amount of time it takes to fully complete a set of GL commands, and
-    without stalling the rendering pipeline.  It uses the query object
-    mechanisms first introduced in the occlusion query extension, which allow
-    time intervals to be polled asynchronously by the application.
-
-IP Status
-
-    No known IP claims.
-
-New Procedures and Functions
-
-    void GenQueriesANGLE(sizei n, uint *ids);
-    void DeleteQueriesANGLE(sizei n, const uint *ids);
-    boolean IsQueryANGLE(uint id);
-    void BeginQueryANGLE(enum target, uint id);
-    void EndQueryANGLE(enum target);
-    void QueryCounterANGLE(uint id, enum target);
-    void GetQueryivANGLE(enum target, enum pname, int *params);
-    void GetQueryObjectivANGLE(uint id, enum pname, int *params);
-    void GetQueryObjectuivANGLE(uint id, enum pname, uint *params);
-    void GetQueryObjecti64vANGLE(uint id, enum pname, int64 *params);
-    void GetQueryObjectui64vANGLE(uint id, enum pname, uint64 *params);
-
-New Tokens
-
-    Accepted by the <pname> parameter of GetQueryivANGLE:
-
-        QUERY_COUNTER_BITS_ANGLE                       0x8864
-        CURRENT_QUERY_ANGLE                            0x8865
-
-    Accepted by the <pname> parameter of GetQueryObjectivANGLE,
-    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, and
-    GetQueryObjectui64vANGLE:
-
-        QUERY_RESULT_ANGLE                             0x8866
-        QUERY_RESULT_AVAILABLE_ANGLE                   0x8867
-        
-    Accepted by the <target> parameter of BeginQueryANGLE, EndQueryANGLE, and
-    GetQueryivANGLE:
-
-        TIME_ELAPSED_ANGLE                             0x88BF
-
-    Accepted by the <target> parameter of GetQueryivANGLE and
-    QueryCounterANGLE:
-
-        TIMESTAMP_ANGLE                                0x8E28
-
-Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL ES Operation)
-
-    (Modify table 2.1, Correspondence of command suffix letters to GL argument)
-    Add two new types:
-    
-    Letter Corresponding GL Type
-    ------ ---------------------
-    i64    int64ANGLE
-    ui64   uint64ANGLE
-
-    (Modify table 2.2, GL data types) Add two new types:
-    
-    GL Type       Minimum Bit Width   Description
-    -------       -----------------   -----------------------------
-    int64ANGLE    64                  Signed 2's complement integer
-    uint64ANGLE   64                  Unsigned binary integer
-
-Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special Functions)
-
-    Add a new section 5.3 "Timer Queries":
-
-    "5.3  Timer Queries
-
-    Timer queries use query objects to track the amount of time needed to
-    fully complete a set of GL commands, or to determine the current time
-    of the GL.
-    
-    Timer queries are associated with query objects.  The command
-
-      void GenQueriesANGLE(sizei n, uint *ids);
-
-    returns <n> previously unused query object names in <ids>.  These
-    names are marked as used, but no object is associated with them until
-    the first time they are used by BeginQueryANGLE.  Query objects contain
-    one piece of state, an integer result value.  This result value is
-    initialized to zero when the object is created.  Any positive integer
-    except for zero (which is reserved for the GL) is a valid query
-    object name.
-
-    Query objects are deleted by calling
-
-      void DeleteQueriesANGLE(sizei n, const uint *ids);
-
-    <ids> contains <n> names of query objects to be deleted.  After a
-    query object is deleted, its name is again unused.  Unused names in
-    <ids> are silently ignored.
-    If an active query object is deleted its name immediately becomes unused,
-    but the underlying object is not deleted until it is no longer active.
-
-    A timer query can be started and finished by calling
-
-      void BeginQueryANGLE(enum target, uint id);
-      void EndQueryANGLE(enum target);
-
-    where <target> is TIME_ELAPSED_ANGLE.  If BeginQueryANGLE is called
-    with an unused <id>, that name is marked as used and associated with
-    a new query object.
-    
-    If BeginQueryANGLE is called with an <id> of zero, if the active query
-    object name for <target> is non-zero, if <id> is the name of an existing
-    query object whose type does not match <target>, or if <id> is the active
-    query object name for any query type, the error INVALID_OPERATION is
-    generated.  If EndQueryANGLE is called while no query with the same target
-    is in progress, an INVALID_OPERATION error is generated.
-
-    When BeginQueryANGLE and EndQueryANGLE are called with a <target> of
-    TIME_ELAPSED_ANGLE, the GL prepares to start and stop the timer used for
-    timer queries.  The timer is started or stopped when the effects from all
-    previous commands on the GL client and server state and the framebuffer
-    have been fully realized.  The BeginQueryANGLE and EndQueryANGLE commands
-    may return before the timer is actually started or stopped.  When the timer
-    query timer is finally stopped, the elapsed time (in nanoseconds) is
-    written to the corresponding query object as the query result value, and
-    the query result for that object is marked as available.
-
-    If the elapsed time overflows the number of bits, <n>, available to hold
-    elapsed time, its value becomes undefined.  It is recommended, but not
-    required, that implementations handle this overflow case by saturating at
-    2^n - 1.
-
-    The necessary state is a single bit indicating whether an timer
-    query is active, the identifier of the currently active timer
-    query, and a counter keeping track of the time that has passed.
-
-    When the command
-
-         void QueryCounterANGLE(uint id, enum target);
-
-    is called with <target> TIMESTAMP_ANGLE, the GL records the current time
-    into the corresponding query object. The time is recorded after all
-    previous commands on the GL client and server state and the framebuffer
-    have been fully realized. When the time is recorded, the query result for
-    that object is marked available. QueryCounterANGLE timer queries can be
-    used within a BeginQueryANGLE / EndQueryANGLE block where the <target> is
-    TIME_ELAPSED_ANGLE and it does not affect the result of that query object.
-    The error INVALID_OPERATION is generated if the <id> is already in use
-    within a BeginQueryANGLE/EndQueryANGLE block."
-
-Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State
-Requests)
-
-    Add a new section 6.1.9 "Timer Queries":
-
-    "The command
-
-      boolean IsQueryANGLE(uint id);
-
-    returns TRUE if <id> is the name of a query object.  If <id> is zero,
-    or if <id> is a non-zero value that is not the name of a query
-    object, IsQueryANGLE returns FALSE.
-
-    Information about a query target can be queried with the command
-
-      void GetQueryivANGLE(enum target, enum pname, int *params);
-
-    <target> identifies the query target and can be TIME_ELAPSED_ANGLE or
-    TIMESTAMP_ANGLE for timer queries.
-
-    If <pname> is CURRENT_QUERY_ANGLE, the name of the currently active query
-    for <target>, or zero if no query is active, will be placed in <params>.
-
-    If <pname> is QUERY_COUNTER_BITS_ANGLE, the implementation-dependent number
-    of bits used to hold the query result for <target> will be placed in
-    <params>.  The number of query counter bits may be zero, in which case
-    the counter contains no useful information.
-
-    For timer queries (TIME_ELAPSED_ANGLE and TIMESTAMP_ANGLE), if the number
-    of bits is non-zero, the minimum number of bits allowed is 30 which
-    will allow at least 1 second of timing.
-
-    The state of a query object can be queried with the commands
-
-      void GetQueryObjectivANGLE(uint id, enum pname, int *params);
-      void GetQueryObjectuivANGLE(uint id, enum pname, uint *params);
-      void GetQueryObjecti64vANGLE(uint id, enum pname, int64 *params);
-      void GetQueryObjectui64vANGLE(uint id, enum pname, uint64 *params);
-
-    If <id> is not the name of a query object, or if the query object
-    named by <id> is currently active, then an INVALID_OPERATION error is
-    generated.
-
-    If <pname> is QUERY_RESULT_ANGLE, then the query object's result
-    value is returned as a single integer in <params>. If the value is so
-    large in magnitude that it cannot be represented with the requested type,
-    then the nearest value representable using the requested type is
-    returned. If the number of query counter bits for target is zero, then
-    the result is returned as a single integer with the value zero.
-    
-    There may be an indeterminate delay before the above query returns. If
-    <pname> is QUERY_RESULT_AVAILABLE_ANGLE, FALSE is returned if such a delay
-    would be required; otherwise TRUE is returned. It must always be true
-    that if any query object returns a result available of TRUE, all queries
-    of the same type issued prior to that query must also return TRUE.
-
-    Querying the state for a given timer query forces that timer query to
-    complete within a finite amount of time.
-
-    If multiple queries are issued on the same target and id prior to 
-    calling GetQueryObject[u]i[64]vANGLE, the result returned will always be
-    from the last query issued.  The results from any queries before the
-    last one will be lost if the results are not retrieved before starting
-    a new query on the same <target> and <id>."
-
-Errors
-
-    The error INVALID_VALUE is generated if GenQueriesANGLE is called where
-    <n> is negative.
-
-    The error INVALID_VALUE is generated if DeleteQueriesANGLE is called
-    where <n> is negative.
-
-    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
-    when a query of the given <target> is already active.
-
-    The error INVALID_OPERATION is generated if EndQueryANGLE is called
-    when a query of the given <target> is not active.
-
-    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
-    where <id> is zero.
-
-    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
-    where <id> is the name of a query currently in progress.
-    
-    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
-    where <id> is the name of an existing query object whose type does not
-    match <target>.
-
-    The error INVALID_ENUM is generated if BeginQueryANGLE or EndQueryANGLE
-    is called where <target> is not TIME_ELAPSED_ANGLE.
-
-    The error INVALID_ENUM is generated if GetQueryivANGLE is called where
-    <target> is not TIME_ELAPSED_ANGLE or TIMESTAMP_ANGLE.
-
-    The error INVALID_ENUM is generated if GetQueryivANGLE is called where
-    <pname> is not QUERY_COUNTER_BITS_ANGLE or CURRENT_QUERY_ANGLE.
-
-    The error INVALID_ENUM is generated if QueryCounterANGLE is called where
-    <target> is not TIMESTAMP_ANGLE.
-
-    The error INVALID_OPERATION is generated if QueryCounterANGLE is called
-    on a query object that is already in use inside a
-    BeginQueryANGLE/EndQueryANGLE.
-
-    The error INVALID_OPERATION is generated if GetQueryObjectivANGLE,
-    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, or
-    GetQueryObjectui64vANGLE is called where <id> is not the name of a query
-    object.
-
-    The error INVALID_OPERATION is generated if GetQueryObjectivANGLE,
-    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, or
-    GetQueryObjectui64vANGLE is called where <id> is the name of a currently
-    active query object.
-
-    The error INVALID_ENUM is generated if GetQueryObjectivANGLE,
-    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, or
-    GetQueryObjectui64vANGLE is called where <pname> is not
-    QUERY_RESULT_ANGLE or QUERY_RESULT_AVAILABLE_ANGLE.
-
-New State
-
-    (Add a new table 6.xx, "Query Operations")
-    
-    Get Value                      Type    Get Command              Initial Value   Description              Sec
-    ---------                      ----    -----------              -------------   -----------              ------
-    -                              B       -                        FALSE           query active             5.3
-    CURRENT_QUERY_ANGLE            Z+      GetQueryivANGLE          0               active query ID          5.3
-    QUERY_RESULT_ANGLE             Z+      GetQueryObjectuivANGLE,  0               samples-passed count     5.3
-                                           GetQueryObjectui64vANGLE
-    QUERY_RESULT_AVAILABLE_ANGLE   B       GetQueryObjectivANGLE    FALSE           query result available   5.3
-
-New Implementation Dependent State
-
-    (Add the following entry to table 6.18):
-
-    Get Value                      Type    Get Command      Minimum Value      Description           Sec
-    --------------------------     ----    -----------      -------------      ----------------      ------
-    QUERY_COUNTER_BITS_ANGLE       Z+      GetQueryivANGLE  see 6.1.9          Number of bits in     6.1.9
-                                                                               query counter
-
-Examples
-
-    (1) Here is some rough sample code that demonstrates the intended usage
-        of this extension.
-
-        GLint queries[N];
-        GLint available = 0;
-        // timer queries can contain more than 32 bits of data, so always
-        // query them using the 64 bit types to avoid overflow
-        GLuint64ANGLE timeElapsed = 0;
-
-        // Create a query object.
-        glGenQueriesANGLE(N, queries);
-
-        // Start query 1
-        glBeginQueryANGLE(GL_TIME_ELAPSED_ANGLE, queries[0]);
-
-        // Draw object 1
-        ....
-
-        // End query 1
-        glEndQueryANGLE(GL_TIME_ELAPSED_ANGLE);
-
-        ...
-
-        // Start query N
-        glBeginQueryANGLE(GL_TIME_ELAPSED_ANGLE, queries[N-1]);
-
-        // Draw object N
-        ....
-
-        // End query N
-        glEndQueryANGLE(GL_TIME_ELAPSED_ANGLE);
-
-        // Wait for all results to become available
-        while (!available) {
-            glGetQueryObjectivANGLE(queries[N-1], GL_QUERY_RESULT_AVAILABLE_ANGLE, &available);
-        }
-
-        for (i = 0; i < N; i++) {
-            // See how much time the rendering of object i took in nanoseconds.
-            glGetQueryObjectui64vANGLE(queries[i], GL_QUERY_RESULT_ANGLE, &timeElapsed);
-
-            // Do something useful with the time.  Note that care should be
-            // taken to use all significant bits of the result, not just the
-            // least significant 32 bits.
-            AdjustObjectLODBasedOnDrawTime(i, timeElapsed);
-        }
-
-        This example is sub-optimal in that it stalls at the end of every
-        frame to wait for query results.  Ideally, the collection of results
-        would be delayed one frame to minimize the amount of time spent
-        waiting for the GPU to finish rendering.
-        
-    (2) This example is basically the same as the example above but uses
-        QueryCounter instead.
-    
-        GLint queries[N+1];
-        GLint available = 0;
-        // timer queries can contain more than 32 bits of data, so always
-        // query them using the 64 bit types to avoid overflow
-        GLuint64ANGLE timeStart, timeEnd, timeElapsed = 0;
-
-        // Create a query object.
-        glGenQueriesANGLE(N+1, queries);
-
-        // Query current timestamp 1
-        glQueryCounterANGLE(queries[0], GL_TIMESTAMP_ANGLE);
-
-        // Draw object 1
-        ....
-
-        // Query current timestamp N
-        glQueryCounterANGLE(queries[N-1], GL_TIMESTAMP_ANGLE);
-
-        // Draw object N
-        ....
-
-        // Query current timestamp N+1
-        glQueryCounterANGLE(queries[N], GL_TIMESTAMP_ANGLE);
-
-        // Wait for all results to become available
-        while (!available) {
-            glGetQueryObjectivANGLE(queries[N], GL_QUERY_RESULT_AVAILABLE_ANGLE, &available);
-        }
-
-        for (i = 0; i < N; i++) {
-            // See how much time the rendering of object i took in nanoseconds.
-            glGetQueryObjectui64vANGLE(queries[i], GL_QUERY_RESULT_ANGLE, &timeStart);
-            glGetQueryObjectui64vANGLE(queries[i+1], GL_QUERY_RESULT_ANGLE, &timeEnd);
-            timeElapsed = timeEnd - timeStart;
-
-            // Do something useful with the time.  Note that care should be
-            // taken to use all significant bits of the result, not just the
-            // least significant 32 bits.
-            AdjustObjectLODBasedOnDrawTime(i, timeElapsed);
-        }
-
-Issues from EXT_timer_query
-
-    (1) What time interval is being measured?
-
-    RESOLVED:  The timer starts when all commands prior to BeginQuery() have
-    been fully executed.  At that point, everything that should be drawn by
-    those commands has been written to the framebuffer.  The timer stops
-    when all commands prior to EndQuery() have been fully executed.
-
-    (2) What unit of time will time intervals be returned in?
-
-    RESOLVED:  Nanoseconds (10^-9 seconds).  This unit of measurement allows
-    for reasonably accurate timing of even small blocks of rendering
-    commands.  The granularity of the timer is implementation-dependent.  A
-    32-bit query counter can express intervals of up to approximately 4
-    seconds.
-
-    (3) What should be the minimum number of counter bits for timer queries?
-
-    RESOLVED:  30 bits, which will allow timing sections that take up to 1
-    second to render.
-
-    (4) How are counter results of more than 32 bits returned?
-
-    RESOLVED:  Via two new datatypes, int64ANGLE and uint64ANGLE, and their
-    corresponding GetQueryObject entry points.  These types hold integer
-    values and have a minimum bit width of 64.
-
-    (5) Should the extension measure total time elapsed between the full
-        completion of the BeginQuery and EndQuery commands, or just time
-        spent in the graphics library?
-
-    RESOLVED:  This extension will measure the total time elapsed between
-    the full completion of these commands.  Future extensions may implement
-    a query to determine time elapsed at different stages of the graphics
-    pipeline.
-
-    (6) If multiple query types are supported, can multiple query types be
-        active simultaneously?
-
-    RESOLVED:  Yes; an application may perform a timer query and another
-    type of query simultaneously.  An application can not perform multiple
-    timer queries or multiple queries of other types simultaneously.  An
-    application also can not use the same query object for another query
-    and a timer query simultaneously.
-
-    (7) Do query objects have a query type permanently associated with them?
-
-    RESOLVED:  No.  A single query object can be used to perform different
-    types of queries, but not at the same time.
-
-    Having a fixed type for each query object simplifies some aspects of the
-    implementation -- not having to deal with queries with different result
-    sizes, for example.  It would also mean that BeginQuery() with a query
-    object of the "wrong" type would result in an INVALID_OPERATION error.
-
-    UPDATE: This resolution was relevant for EXT_timer_query and OpenGL 2.0.
-    Since EXT_transform_feedback has since been incorporated into the core,
-    the resolution is that BeginQuery will generate error INVALID_OPERATION
-    if <id> represents a query object of a different type.
-
-    (8) How predictable/repeatable are the results returned by the timer
-        query?
-
-    RESOLVED:  In general, the amount of time needed to render the same
-    primitives should be fairly constant.  But there may be many other
-    system issues (e.g., context switching on the CPU and GPU, virtual
-    memory page faults, memory cache behavior on the CPU and GPU) that can
-    cause times to vary wildly.
-
-    Note that modern GPUs are generally highly pipelined, and may be
-    processing different primitives in different pipeline stages
-    simultaneously.  In this extension, the timers start and stop when the
-    BeginQuery/EndQuery commands reach the bottom of the rendering pipeline.
-    What that means is that by the time the timer starts, the GL driver on
-    the CPU may have started work on GL commands issued after BeginQuery,
-    and the higher pipeline stages (e.g., vertex transformation) may have
-    started as well.
-
-   (9) What should the new 64 bit integer type be called?
-
-    RESOLVED: The new types will be called GLint64ANGLE/GLuint64ANGLE.  The new
-    command suffixes will be i64 and ui64.  These names clearly convey the
-    minimum size of the types.  These types are similar to the C99 standard
-    type int_least64_t, but we use names similar to the C99 optional type
-    int64_t for simplicity.
-
-Issues from ARB_timer_query
-
-   (10) What about tile-based implementations? The effects of a command are
-        not complete until the frame is completely rendered. Timing recorded
-        before the frame is complete may not be what developers expect. Also
-        the amount of time needed to render the same primitives is not
-        consistent, which conflicts with issue (8) above. The time depends on
-        how early or late in the scene it is placed.
-
-    RESOLVED: The current language supports tile-based rendering okay as it
-    is written. Developers are warned that using timers on tile-based
-    implementation may not produce results they expect since rendering is not
-    done in a linear order. Timing results are calculated when the frame is
-    completed and may depend on how early or late in the scene it is placed.
-    
-   (11) Can the GL implementation use different clocks to implement the
-        TIME_ELAPSED and TIMESTAMP queries?
-
-   RESOLVED: Yes, the implemenation can use different internal clocks to
-   implement TIME_ELAPSED and TIMESTAMP. If different clocks are
-   used it is possible there is a slight discrepancy when comparing queries
-   made from TIME_ELAPSED and TIMESTAMP; they may have slight
-   differences when both are used to measure the same sequence. However, this
-   is unlikely to affect real applications since comparing the two queries is
-   not expected to be useful.
-
-Issues
-
-    (12) What should we call this extension?
-
-    RESOLVED: ANGLE_timer_query
-
-    (13) Why is this done as a separate extension instead of just supporting
-         ARB_timer_query?
-
-    ARB_timer_query is written against OpenGL 3.2, which includes a lot of
-    the required support for dealing with query objects. None of these
-    functions or tokens exist in OpenGL ES, and as such have to be added in
-    this specification.
-
-    (14) How does this extension differ from ARB_timer_query?
-
-    This extension contains most ARB_timer_query behavior unchanged as well
-    as a subset of the query support required to use it from the core
-    OpenGL 3.2 spec. It omits the glGetInteger(TIMESTAMP) functionality used to
-    query the current time on the GPU, but the behavior for all remaining
-    functionality taken from ARB_timer_query is the same.
-    
-    (15) Are query objects shareable between multiple contexts?
-
-    RESOLVED: No.  Query objects are lightweight and we normally share 
-    large data across contexts.  Also, being able to share query objects
-    across contexts is not particularly useful.  In order to do the async 
-    query across contexts, a query on one context would have to be finished 
-    before the other context could query it. 
-
-Revision History
-
-    Revision 1, 2011/04/28
-      - copied from revision 9 of ARB_timer_query and revision 7 of
-        ARB_occlusion_query
-      - removed language that was clearly not relevant to ES2
-      - rebased changes against the OpenGL ES 2.0 specification
+Name
+
+    ANGLE_timer_query
+
+Name Strings
+
+    GL_ANGLE_timer_query
+
+Contributors
+
+    Contributors to ARB_occlusion_query
+    Contributors to EXT_timer_query
+    Contributors to ARB_timer_query
+    Ben Vanik, Google Inc.
+    Daniel Koch, TransGaming Inc.
+
+Contact
+
+    Ben Vanik, Google Inc. (benvanik 'at' google 'dot' com)
+
+Status
+
+    Draft
+
+Version
+
+    Last Modified Date: Apr 28, 2011
+    Author Revision: 1
+
+Number
+
+    OpenGL ES Extension #??
+
+Dependencies
+
+    OpenGL ES 2.0 is required.
+
+    The extension is written against the OpenGL ES 2.0 specification.
+
+Overview
+
+    Applications can benefit from accurate timing information in a number of
+    different ways.  During application development, timing information can
+    help identify application or driver bottlenecks.  At run time,
+    applications can use timing information to dynamically adjust the amount
+    of detail in a scene to achieve constant frame rates.  OpenGL
+    implementations have historically provided little to no useful timing
+    information.  Applications can get some idea of timing by reading timers
+    on the CPU, but these timers are not synchronized with the graphics
+    rendering pipeline.  Reading a CPU timer does not guarantee the completion
+    of a potentially large amount of graphics work accumulated before the
+    timer is read, and will thus produce wildly inaccurate results.
+    glFinish() can be used to determine when previous rendering commands have
+    been completed, but will idle the graphics pipeline and adversely affect
+    application performance.
+
+    This extension provides a query mechanism that can be used to determine
+    the amount of time it takes to fully complete a set of GL commands, and
+    without stalling the rendering pipeline.  It uses the query object
+    mechanisms first introduced in the occlusion query extension, which allow
+    time intervals to be polled asynchronously by the application.
+
+IP Status
+
+    No known IP claims.
+
+New Procedures and Functions
+
+    void GenQueriesANGLE(sizei n, uint *ids);
+    void DeleteQueriesANGLE(sizei n, const uint *ids);
+    boolean IsQueryANGLE(uint id);
+    void BeginQueryANGLE(enum target, uint id);
+    void EndQueryANGLE(enum target);
+    void QueryCounterANGLE(uint id, enum target);
+    void GetQueryivANGLE(enum target, enum pname, int *params);
+    void GetQueryObjectivANGLE(uint id, enum pname, int *params);
+    void GetQueryObjectuivANGLE(uint id, enum pname, uint *params);
+    void GetQueryObjecti64vANGLE(uint id, enum pname, int64 *params);
+    void GetQueryObjectui64vANGLE(uint id, enum pname, uint64 *params);
+
+New Tokens
+
+    Accepted by the <pname> parameter of GetQueryivANGLE:
+
+        QUERY_COUNTER_BITS_ANGLE                       0x8864
+        CURRENT_QUERY_ANGLE                            0x8865
+
+    Accepted by the <pname> parameter of GetQueryObjectivANGLE,
+    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, and
+    GetQueryObjectui64vANGLE:
+
+        QUERY_RESULT_ANGLE                             0x8866
+        QUERY_RESULT_AVAILABLE_ANGLE                   0x8867
+        
+    Accepted by the <target> parameter of BeginQueryANGLE, EndQueryANGLE, and
+    GetQueryivANGLE:
+
+        TIME_ELAPSED_ANGLE                             0x88BF
+
+    Accepted by the <target> parameter of GetQueryivANGLE and
+    QueryCounterANGLE:
+
+        TIMESTAMP_ANGLE                                0x8E28
+
+Additions to Chapter 2 of the OpenGL ES 2.0 Specification (OpenGL ES Operation)
+
+    (Modify table 2.1, Correspondence of command suffix letters to GL argument)
+    Add two new types:
+    
+    Letter Corresponding GL Type
+    ------ ---------------------
+    i64    int64ANGLE
+    ui64   uint64ANGLE
+
+    (Modify table 2.2, GL data types) Add two new types:
+    
+    GL Type       Minimum Bit Width   Description
+    -------       -----------------   -----------------------------
+    int64ANGLE    64                  Signed 2's complement integer
+    uint64ANGLE   64                  Unsigned binary integer
+
+Additions to Chapter 5 of the OpenGL ES 2.0 Specification (Special Functions)
+
+    Add a new section 5.3 "Timer Queries":
+
+    "5.3  Timer Queries
+
+    Timer queries use query objects to track the amount of time needed to
+    fully complete a set of GL commands, or to determine the current time
+    of the GL.
+    
+    Timer queries are associated with query objects.  The command
+
+      void GenQueriesANGLE(sizei n, uint *ids);
+
+    returns <n> previously unused query object names in <ids>.  These
+    names are marked as used, but no object is associated with them until
+    the first time they are used by BeginQueryANGLE.  Query objects contain
+    one piece of state, an integer result value.  This result value is
+    initialized to zero when the object is created.  Any positive integer
+    except for zero (which is reserved for the GL) is a valid query
+    object name.
+
+    Query objects are deleted by calling
+
+      void DeleteQueriesANGLE(sizei n, const uint *ids);
+
+    <ids> contains <n> names of query objects to be deleted.  After a
+    query object is deleted, its name is again unused.  Unused names in
+    <ids> are silently ignored.
+    If an active query object is deleted its name immediately becomes unused,
+    but the underlying object is not deleted until it is no longer active.
+
+    A timer query can be started and finished by calling
+
+      void BeginQueryANGLE(enum target, uint id);
+      void EndQueryANGLE(enum target);
+
+    where <target> is TIME_ELAPSED_ANGLE.  If BeginQueryANGLE is called
+    with an unused <id>, that name is marked as used and associated with
+    a new query object.
+    
+    If BeginQueryANGLE is called with an <id> of zero, if the active query
+    object name for <target> is non-zero, if <id> is the name of an existing
+    query object whose type does not match <target>, or if <id> is the active
+    query object name for any query type, the error INVALID_OPERATION is
+    generated.  If EndQueryANGLE is called while no query with the same target
+    is in progress, an INVALID_OPERATION error is generated.
+
+    When BeginQueryANGLE and EndQueryANGLE are called with a <target> of
+    TIME_ELAPSED_ANGLE, the GL prepares to start and stop the timer used for
+    timer queries.  The timer is started or stopped when the effects from all
+    previous commands on the GL client and server state and the framebuffer
+    have been fully realized.  The BeginQueryANGLE and EndQueryANGLE commands
+    may return before the timer is actually started or stopped.  When the timer
+    query timer is finally stopped, the elapsed time (in nanoseconds) is
+    written to the corresponding query object as the query result value, and
+    the query result for that object is marked as available.
+
+    If the elapsed time overflows the number of bits, <n>, available to hold
+    elapsed time, its value becomes undefined.  It is recommended, but not
+    required, that implementations handle this overflow case by saturating at
+    2^n - 1.
+
+    The necessary state is a single bit indicating whether an timer
+    query is active, the identifier of the currently active timer
+    query, and a counter keeping track of the time that has passed.
+
+    When the command
+
+         void QueryCounterANGLE(uint id, enum target);
+
+    is called with <target> TIMESTAMP_ANGLE, the GL records the current time
+    into the corresponding query object. The time is recorded after all
+    previous commands on the GL client and server state and the framebuffer
+    have been fully realized. When the time is recorded, the query result for
+    that object is marked available. QueryCounterANGLE timer queries can be
+    used within a BeginQueryANGLE / EndQueryANGLE block where the <target> is
+    TIME_ELAPSED_ANGLE and it does not affect the result of that query object.
+    The error INVALID_OPERATION is generated if the <id> is already in use
+    within a BeginQueryANGLE/EndQueryANGLE block."
+
+Additions to Chapter 6 of the OpenGL ES 2.0 Specification (State and State
+Requests)
+
+    Add a new section 6.1.9 "Timer Queries":
+
+    "The command
+
+      boolean IsQueryANGLE(uint id);
+
+    returns TRUE if <id> is the name of a query object.  If <id> is zero,
+    or if <id> is a non-zero value that is not the name of a query
+    object, IsQueryANGLE returns FALSE.
+
+    Information about a query target can be queried with the command
+
+      void GetQueryivANGLE(enum target, enum pname, int *params);
+
+    <target> identifies the query target and can be TIME_ELAPSED_ANGLE or
+    TIMESTAMP_ANGLE for timer queries.
+
+    If <pname> is CURRENT_QUERY_ANGLE, the name of the currently active query
+    for <target>, or zero if no query is active, will be placed in <params>.
+
+    If <pname> is QUERY_COUNTER_BITS_ANGLE, the implementation-dependent number
+    of bits used to hold the query result for <target> will be placed in
+    <params>.  The number of query counter bits may be zero, in which case
+    the counter contains no useful information.
+
+    For timer queries (TIME_ELAPSED_ANGLE and TIMESTAMP_ANGLE), if the number
+    of bits is non-zero, the minimum number of bits allowed is 30 which
+    will allow at least 1 second of timing.
+
+    The state of a query object can be queried with the commands
+
+      void GetQueryObjectivANGLE(uint id, enum pname, int *params);
+      void GetQueryObjectuivANGLE(uint id, enum pname, uint *params);
+      void GetQueryObjecti64vANGLE(uint id, enum pname, int64 *params);
+      void GetQueryObjectui64vANGLE(uint id, enum pname, uint64 *params);
+
+    If <id> is not the name of a query object, or if the query object
+    named by <id> is currently active, then an INVALID_OPERATION error is
+    generated.
+
+    If <pname> is QUERY_RESULT_ANGLE, then the query object's result
+    value is returned as a single integer in <params>. If the value is so
+    large in magnitude that it cannot be represented with the requested type,
+    then the nearest value representable using the requested type is
+    returned. If the number of query counter bits for target is zero, then
+    the result is returned as a single integer with the value zero.
+    
+    There may be an indeterminate delay before the above query returns. If
+    <pname> is QUERY_RESULT_AVAILABLE_ANGLE, FALSE is returned if such a delay
+    would be required; otherwise TRUE is returned. It must always be true
+    that if any query object returns a result available of TRUE, all queries
+    of the same type issued prior to that query must also return TRUE.
+
+    Querying the state for a given timer query forces that timer query to
+    complete within a finite amount of time.
+
+    If multiple queries are issued on the same target and id prior to 
+    calling GetQueryObject[u]i[64]vANGLE, the result returned will always be
+    from the last query issued.  The results from any queries before the
+    last one will be lost if the results are not retrieved before starting
+    a new query on the same <target> and <id>."
+
+Errors
+
+    The error INVALID_VALUE is generated if GenQueriesANGLE is called where
+    <n> is negative.
+
+    The error INVALID_VALUE is generated if DeleteQueriesANGLE is called
+    where <n> is negative.
+
+    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
+    when a query of the given <target> is already active.
+
+    The error INVALID_OPERATION is generated if EndQueryANGLE is called
+    when a query of the given <target> is not active.
+
+    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
+    where <id> is zero.
+
+    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
+    where <id> is the name of a query currently in progress.
+    
+    The error INVALID_OPERATION is generated if BeginQueryANGLE is called
+    where <id> is the name of an existing query object whose type does not
+    match <target>.
+
+    The error INVALID_ENUM is generated if BeginQueryANGLE or EndQueryANGLE
+    is called where <target> is not TIME_ELAPSED_ANGLE.
+
+    The error INVALID_ENUM is generated if GetQueryivANGLE is called where
+    <target> is not TIME_ELAPSED_ANGLE or TIMESTAMP_ANGLE.
+
+    The error INVALID_ENUM is generated if GetQueryivANGLE is called where
+    <pname> is not QUERY_COUNTER_BITS_ANGLE or CURRENT_QUERY_ANGLE.
+
+    The error INVALID_ENUM is generated if QueryCounterANGLE is called where
+    <target> is not TIMESTAMP_ANGLE.
+
+    The error INVALID_OPERATION is generated if QueryCounterANGLE is called
+    on a query object that is already in use inside a
+    BeginQueryANGLE/EndQueryANGLE.
+
+    The error INVALID_OPERATION is generated if GetQueryObjectivANGLE,
+    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, or
+    GetQueryObjectui64vANGLE is called where <id> is not the name of a query
+    object.
+
+    The error INVALID_OPERATION is generated if GetQueryObjectivANGLE,
+    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, or
+    GetQueryObjectui64vANGLE is called where <id> is the name of a currently
+    active query object.
+
+    The error INVALID_ENUM is generated if GetQueryObjectivANGLE,
+    GetQueryObjectuivANGLE, GetQueryObjecti64vANGLE, or
+    GetQueryObjectui64vANGLE is called where <pname> is not
+    QUERY_RESULT_ANGLE or QUERY_RESULT_AVAILABLE_ANGLE.
+
+New State
+
+    (Add a new table 6.xx, "Query Operations")
+    
+    Get Value                      Type    Get Command              Initial Value   Description              Sec
+    ---------                      ----    -----------              -------------   -----------              ------
+    -                              B       -                        FALSE           query active             5.3
+    CURRENT_QUERY_ANGLE            Z+      GetQueryivANGLE          0               active query ID          5.3
+    QUERY_RESULT_ANGLE             Z+      GetQueryObjectuivANGLE,  0               samples-passed count     5.3
+                                           GetQueryObjectui64vANGLE
+    QUERY_RESULT_AVAILABLE_ANGLE   B       GetQueryObjectivANGLE    FALSE           query result available   5.3
+
+New Implementation Dependent State
+
+    (Add the following entry to table 6.18):
+
+    Get Value                      Type    Get Command      Minimum Value      Description           Sec
+    --------------------------     ----    -----------      -------------      ----------------      ------
+    QUERY_COUNTER_BITS_ANGLE       Z+      GetQueryivANGLE  see 6.1.9          Number of bits in     6.1.9
+                                                                               query counter
+
+Examples
+
+    (1) Here is some rough sample code that demonstrates the intended usage
+        of this extension.
+
+        GLint queries[N];
+        GLint available = 0;
+        // timer queries can contain more than 32 bits of data, so always
+        // query them using the 64 bit types to avoid overflow
+        GLuint64ANGLE timeElapsed = 0;
+
+        // Create a query object.
+        glGenQueriesANGLE(N, queries);
+
+        // Start query 1
+        glBeginQueryANGLE(GL_TIME_ELAPSED_ANGLE, queries[0]);
+
+        // Draw object 1
+        ....
+
+        // End query 1
+        glEndQueryANGLE(GL_TIME_ELAPSED_ANGLE);
+
+        ...
+
+        // Start query N
+        glBeginQueryANGLE(GL_TIME_ELAPSED_ANGLE, queries[N-1]);
+
+        // Draw object N
+        ....
+
+        // End query N
+        glEndQueryANGLE(GL_TIME_ELAPSED_ANGLE);
+
+        // Wait for all results to become available
+        while (!available) {
+            glGetQueryObjectivANGLE(queries[N-1], GL_QUERY_RESULT_AVAILABLE_ANGLE, &available);
+        }
+
+        for (i = 0; i < N; i++) {
+            // See how much time the rendering of object i took in nanoseconds.
+            glGetQueryObjectui64vANGLE(queries[i], GL_QUERY_RESULT_ANGLE, &timeElapsed);
+
+            // Do something useful with the time.  Note that care should be
+            // taken to use all significant bits of the result, not just the
+            // least significant 32 bits.
+            AdjustObjectLODBasedOnDrawTime(i, timeElapsed);
+        }
+
+        This example is sub-optimal in that it stalls at the end of every
+        frame to wait for query results.  Ideally, the collection of results
+        would be delayed one frame to minimize the amount of time spent
+        waiting for the GPU to finish rendering.
+        
+    (2) This example is basically the same as the example above but uses
+        QueryCounter instead.
+    
+        GLint queries[N+1];
+        GLint available = 0;
+        // timer queries can contain more than 32 bits of data, so always
+        // query them using the 64 bit types to avoid overflow
+        GLuint64ANGLE timeStart, timeEnd, timeElapsed = 0;
+
+        // Create a query object.
+        glGenQueriesANGLE(N+1, queries);
+
+        // Query current timestamp 1
+        glQueryCounterANGLE(queries[0], GL_TIMESTAMP_ANGLE);
+
+        // Draw object 1
+        ....
+
+        // Query current timestamp N
+        glQueryCounterANGLE(queries[N-1], GL_TIMESTAMP_ANGLE);
+
+        // Draw object N
+        ....
+
+        // Query current timestamp N+1
+        glQueryCounterANGLE(queries[N], GL_TIMESTAMP_ANGLE);
+
+        // Wait for all results to become available
+        while (!available) {
+            glGetQueryObjectivANGLE(queries[N], GL_QUERY_RESULT_AVAILABLE_ANGLE, &available);
+        }
+
+        for (i = 0; i < N; i++) {
+            // See how much time the rendering of object i took in nanoseconds.
+            glGetQueryObjectui64vANGLE(queries[i], GL_QUERY_RESULT_ANGLE, &timeStart);
+            glGetQueryObjectui64vANGLE(queries[i+1], GL_QUERY_RESULT_ANGLE, &timeEnd);
+            timeElapsed = timeEnd - timeStart;
+
+            // Do something useful with the time.  Note that care should be
+            // taken to use all significant bits of the result, not just the
+            // least significant 32 bits.
+            AdjustObjectLODBasedOnDrawTime(i, timeElapsed);
+        }
+
+Issues from EXT_timer_query
+
+    (1) What time interval is being measured?
+
+    RESOLVED:  The timer starts when all commands prior to BeginQuery() have
+    been fully executed.  At that point, everything that should be drawn by
+    those commands has been written to the framebuffer.  The timer stops
+    when all commands prior to EndQuery() have been fully executed.
+
+    (2) What unit of time will time intervals be returned in?
+
+    RESOLVED:  Nanoseconds (10^-9 seconds).  This unit of measurement allows
+    for reasonably accurate timing of even small blocks of rendering
+    commands.  The granularity of the timer is implementation-dependent.  A
+    32-bit query counter can express intervals of up to approximately 4
+    seconds.
+
+    (3) What should be the minimum number of counter bits for timer queries?
+
+    RESOLVED:  30 bits, which will allow timing sections that take up to 1
+    second to render.
+
+    (4) How are counter results of more than 32 bits returned?
+
+    RESOLVED:  Via two new datatypes, int64ANGLE and uint64ANGLE, and their
+    corresponding GetQueryObject entry points.  These types hold integer
+    values and have a minimum bit width of 64.
+
+    (5) Should the extension measure total time elapsed between the full
+        completion of the BeginQuery and EndQuery commands, or just time
+        spent in the graphics library?
+
+    RESOLVED:  This extension will measure the total time elapsed between
+    the full completion of these commands.  Future extensions may implement
+    a query to determine time elapsed at different stages of the graphics
+    pipeline.
+
+    (6) If multiple query types are supported, can multiple query types be
+        active simultaneously?
+
+    RESOLVED:  Yes; an application may perform a timer query and another
+    type of query simultaneously.  An application can not perform multiple
+    timer queries or multiple queries of other types simultaneously.  An
+    application also can not use the same query object for another query
+    and a timer query simultaneously.
+
+    (7) Do query objects have a query type permanently associated with them?
+
+    RESOLVED:  No.  A single query object can be used to perform different
+    types of queries, but not at the same time.
+
+    Having a fixed type for each query object simplifies some aspects of the
+    implementation -- not having to deal with queries with different result
+    sizes, for example.  It would also mean that BeginQuery() with a query
+    object of the "wrong" type would result in an INVALID_OPERATION error.
+
+    UPDATE: This resolution was relevant for EXT_timer_query and OpenGL 2.0.
+    Since EXT_transform_feedback has since been incorporated into the core,
+    the resolution is that BeginQuery will generate error INVALID_OPERATION
+    if <id> represents a query object of a different type.
+
+    (8) How predictable/repeatable are the results returned by the timer
+        query?
+
+    RESOLVED:  In general, the amount of time needed to render the same
+    primitives should be fairly constant.  But there may be many other
+    system issues (e.g., context switching on the CPU and GPU, virtual
+    memory page faults, memory cache behavior on the CPU and GPU) that can
+    cause times to vary wildly.
+
+    Note that modern GPUs are generally highly pipelined, and may be
+    processing different primitives in different pipeline stages
+    simultaneously.  In this extension, the timers start and stop when the
+    BeginQuery/EndQuery commands reach the bottom of the rendering pipeline.
+    What that means is that by the time the timer starts, the GL driver on
+    the CPU may have started work on GL commands issued after BeginQuery,
+    and the higher pipeline stages (e.g., vertex transformation) may have
+    started as well.
+
+   (9) What should the new 64 bit integer type be called?
+
+    RESOLVED: The new types will be called GLint64ANGLE/GLuint64ANGLE.  The new
+    command suffixes will be i64 and ui64.  These names clearly convey the
+    minimum size of the types.  These types are similar to the C99 standard
+    type int_least64_t, but we use names similar to the C99 optional type
+    int64_t for simplicity.
+
+Issues from ARB_timer_query
+
+   (10) What about tile-based implementations? The effects of a command are
+        not complete until the frame is completely rendered. Timing recorded
+        before the frame is complete may not be what developers expect. Also
+        the amount of time needed to render the same primitives is not
+        consistent, which conflicts with issue (8) above. The time depends on
+        how early or late in the scene it is placed.
+
+    RESOLVED: The current language supports tile-based rendering okay as it
+    is written. Developers are warned that using timers on tile-based
+    implementation may not produce results they expect since rendering is not
+    done in a linear order. Timing results are calculated when the frame is
+    completed and may depend on how early or late in the scene it is placed.
+    
+   (11) Can the GL implementation use different clocks to implement the
+        TIME_ELAPSED and TIMESTAMP queries?
+
+   RESOLVED: Yes, the implemenation can use different internal clocks to
+   implement TIME_ELAPSED and TIMESTAMP. If different clocks are
+   used it is possible there is a slight discrepancy when comparing queries
+   made from TIME_ELAPSED and TIMESTAMP; they may have slight
+   differences when both are used to measure the same sequence. However, this
+   is unlikely to affect real applications since comparing the two queries is
+   not expected to be useful.
+
+Issues
+
+    (12) What should we call this extension?
+
+    RESOLVED: ANGLE_timer_query
+
+    (13) Why is this done as a separate extension instead of just supporting
+         ARB_timer_query?
+
+    ARB_timer_query is written against OpenGL 3.2, which includes a lot of
+    the required support for dealing with query objects. None of these
+    functions or tokens exist in OpenGL ES, and as such have to be added in
+    this specification.
+
+    (14) How does this extension differ from ARB_timer_query?
+
+    This extension contains most ARB_timer_query behavior unchanged as well
+    as a subset of the query support required to use it from the core
+    OpenGL 3.2 spec. It omits the glGetInteger(TIMESTAMP) functionality used to
+    query the current time on the GPU, but the behavior for all remaining
+    functionality taken from ARB_timer_query is the same.
+    
+    (15) Are query objects shareable between multiple contexts?
+
+    RESOLVED: No.  Query objects are lightweight and we normally share 
+    large data across contexts.  Also, being able to share query objects
+    across contexts is not particularly useful.  In order to do the async 
+    query across contexts, a query on one context would have to be finished 
+    before the other context could query it. 
+
+Revision History
+
+    Revision 1, 2011/04/28
+      - copied from revision 9 of ARB_timer_query and revision 7 of
+        ARB_occlusion_query
+      - removed language that was clearly not relevant to ES2
+      - rebased changes against the OpenGL ES 2.0 specification
--- a/gfx/angle/include/GLES2/gl2ext.h
+++ b/gfx/angle/include/GLES2/gl2ext.h
@@ -233,16 +233,21 @@ typedef void* GLeglImageOES;
 #define GL_FRAMEBUFFER_ATTACHMENT_ANGLE                         0x93A3
 #endif
 
 /* GL_ANGLE_instanced_arrays */
 #ifndef GL_ANGLE_instanced_arrays
 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE                    0x88FE
 #endif
 
+/* GL_ANGLE_program_binary */
+#ifndef GL_ANGLE_program_binary
+#define GL_PROGRAM_BINARY_ANGLE                                 0x93A6
+#endif
+
 /*------------------------------------------------------------------------*
  * APPLE extension tokens
  *------------------------------------------------------------------------*/
 
 /* GL_APPLE_rgb_422 */
 #ifndef GL_APPLE_rgb_422
 #define GL_RGB_422_APPLE                                        0x8A1F
 #define GL_UNSIGNED_SHORT_8_8_APPLE                             0x85BA
@@ -1482,13 +1487,18 @@ typedef void (GL_APIENTRYP PFNGLENDTILIN
  * VIV extension tokens
  *------------------------------------------------------------------------*/
 
 /* GL_VIV_shader_binary */
 #ifndef GL_VIV_shader_binary
 #define GL_VIV_shader_binary 1
 #endif
 
+/* GL_ANGLE_program_binary */
+#ifndef GL_ANGLE_program_binary
+#define GL_ANGLE_program_binary 1
+#endif
+
 #ifdef __cplusplus
 }
 #endif
 
 #endif /* __gl2ext_h_ */
--- a/gfx/angle/include/GLSLANG/ShaderLang.h
+++ b/gfx/angle/include/GLSLANG/ShaderLang.h
@@ -29,32 +29,54 @@
 //
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 // Version number for shader translation API.
 // It is incremented everytime the API changes.
-#define SH_VERSION 105
+#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 {
   SH_FRAGMENT_SHADER = 0x8B30,
   SH_VERTEX_SHADER   = 0x8B31
 } ShShaderType;
 
 typedef enum {
   SH_GLES2_SPEC = 0x8B40,
-  SH_WEBGL_SPEC = 0x8B41
+  SH_WEBGL_SPEC = 0x8B41,
+
+  // The CSS Shaders spec is a subset of the WebGL spec.
+  //
+  // In both CSS vertex and fragment shaders, ANGLE:
+  // (1) Reserves the "css_" prefix.
+  // (2) Renames the main function to css_main.
+  // (3) Disables the gl_MaxDrawBuffers built-in.
+  //
+  // In CSS fragment shaders, ANGLE:
+  // (1) Disables the gl_FragColor built-in.
+  // (2) Disables the gl_FragData built-in.
+  // (3) Enables the css_MixColor built-in.
+  // (4) Enables the css_ColorMatrix built-in.
+  //
+  // After passing a CSS shader through ANGLE, the browser is expected to append
+  // a new main function to it.
+  // This new main function will call the css_main function.
+  // It may also perform additional operations like varying assignment, texture
+  // access, and gl_FragColor assignment in order to implement the CSS Shaders
+  // blend modes.
+  //
+  SH_CSS_SHADERS_SPEC = 0x8B42
 } ShShaderSpec;
 
 typedef enum {
   SH_ESSL_OUTPUT = 0x8B45,
   SH_GLSL_OUTPUT = 0x8B46,
   SH_HLSL_OUTPUT = 0x8B47
 } ShShaderOutput;
 
@@ -99,17 +121,33 @@ typedef enum {
   SH_OBJECT_CODE             = 0x0004,
   SH_ATTRIBUTES_UNIFORMS     = 0x0008,
   SH_LINE_DIRECTIVES         = 0x0010,
   SH_SOURCE_PATH             = 0x0020,
   SH_MAP_LONG_VARIABLE_NAMES = 0x0040,
   SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX = 0x0080,
 
   // This is needed only as a workaround for certain OpenGL driver bugs.
-  SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100
+  SH_EMULATE_BUILT_IN_FUNCTIONS = 0x0100,
+
+  // This is an experimental flag to enforce restrictions that aim to prevent 
+  // timing attacks.
+  // It generates compilation errors for shaders that could expose sensitive
+  // texture information via the timing channel.
+  // To use this flag, you must compile the shader under the WebGL spec
+  // (using the SH_WEBGL_SPEC flag).
+  SH_TIMING_RESTRICTIONS = 0x0200,
+    
+  // This flag prints the dependency graph that is used to enforce timing
+  // 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
 } 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();
--- a/gfx/angle/samples/gles2_book/Common/esUtil.vcproj
+++ b/gfx/angle/samples/gles2_book/Common/esUtil.vcproj
@@ -1,70 +1,190 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="esUtil" ProjectGUID="{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}" RootNamespace="esUtil" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="./;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLibrarianTool" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="4" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="./;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLibrarianTool" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <Filter Name="Win32">
-      <File RelativePath=".\Win32\esUtil_TGA.c">
-      </File>
-      <File RelativePath=".\esUtil_win.h">
-      </File>
-      <File RelativePath=".\Win32\esUtil_win32.c">
-      </File>
-    </Filter>
-    <Filter Name="Common">
-      <File RelativePath=".\esShader.c">
-      </File>
-      <File RelativePath=".\esShapes.c">
-      </File>
-      <File RelativePath=".\esTransform.c">
-      </File>
-      <File RelativePath=".\esUtil.c">
-      </File>
-      <File RelativePath=".\esUtil.h">
-      </File>
-    </Filter>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="esUtil"
+	ProjectGUID="{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}"
+	RootNamespace="esUtil"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="./;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="4"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="./;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLibrarianTool"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Win32"
+			>
+			<File
+				RelativePath=".\Win32\esUtil_TGA.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esUtil_win.h"
+				>
+			</File>
+			<File
+				RelativePath=".\Win32\esUtil_win32.c"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Common"
+			>
+			<File
+				RelativePath=".\esShader.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esShapes.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esTransform.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esUtil.c"
+				>
+			</File>
+			<File
+				RelativePath=".\esUtil.h"
+				>
+			</File>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/Hello_Triangle/Hello_Triangle.vcproj
+++ b/gfx/angle/samples/gles2_book/Hello_Triangle/Hello_Triangle.vcproj
@@ -1,56 +1,182 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="Hello_Triangle" ProjectGUID="{8278251F-6C1F-4D80-8499-FA7B590FAFE6}" RootNamespace="Hello_Triangle" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\Hello_Triangle.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Hello_Triangle"
+	ProjectGUID="{8278251F-6C1F-4D80-8499-FA7B590FAFE6}"
+	RootNamespace="Hello_Triangle"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\Hello_Triangle.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/MipMap2D/MipMap2D.vcproj
+++ b/gfx/angle/samples/gles2_book/MipMap2D/MipMap2D.vcproj
@@ -1,56 +1,183 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="MipMap2D" ProjectGUID="{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}" RootNamespace="MipMap2D" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\MipMap2D.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="MipMap2D"
+	ProjectGUID="{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}"
+	RootNamespace="MipMap2D"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\MipMap2D.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/MultiTexture/MultiTexture.vcproj
+++ b/gfx/angle/samples/gles2_book/MultiTexture/MultiTexture.vcproj
@@ -1,56 +1,185 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="MultiTexture" ProjectGUID="{120CFF94-ED4B-4C5B-9587-9E40889F15F7}" RootNamespace="MultiTexture" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" CommandLine="xcopy /D /Y basemap.tga $(OutDir)&#xD;&#xA;xcopy /D /Y lightmap.tga $(OutDir)" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" CommandLine="xcopy /D /Y basemap.tga $(OutDir)&#xD;&#xA;xcopy /D /Y lightmap.tga $(OutDir)" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\MultiTexture.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="MultiTexture"
+	ProjectGUID="{120CFF94-ED4B-4C5B-9587-9E40889F15F7}"
+	RootNamespace="MultiTexture"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="xcopy /D /Y basemap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;xcopy /D /Y lightmap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="xcopy /D /Y basemap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;xcopy /D /Y lightmap.tga &quot;$(OutDir)&quot;&#x0D;&#x0A;"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\MultiTexture.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/ParticleSystem/ParticleSystem.vcproj
+++ b/gfx/angle/samples/gles2_book/ParticleSystem/ParticleSystem.vcproj
@@ -1,56 +1,185 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="ParticleSystem" ProjectGUID="{B9E5BFFC-D843-4E0E-9D3E-23913A613473}" RootNamespace="ParticleSystem" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" CommandLine="xcopy /D /Y smoke.tga $(outDir)" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" CommandLine="xcopy /D /Y smoke.tga $(outDir)" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\ParticleSystem.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="ParticleSystem"
+	ProjectGUID="{B9E5BFFC-D843-4E0E-9D3E-23913A613473}"
+	RootNamespace="ParticleSystem"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="xcopy /D /Y smoke.tga &quot;$(outDir)&quot;"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+				CommandLine="xcopy /D /Y smoke.tga &quot;$(outDir)&quot;"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\ParticleSystem.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
new file mode 100644
--- /dev/null
+++ b/gfx/angle/samples/gles2_book/PostSubBuffer/PostSubBuffer.vcproj
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="PostSubBuffer"
+	ProjectGUID="{667CE95F-5DD8-4495-8C18-5CA8A175B12D}"
+	RootNamespace="Simple_VertexShader"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\PostSubBuffer.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/Simple_Texture2D/Simple_Texture2D.vcproj
+++ b/gfx/angle/samples/gles2_book/Simple_Texture2D/Simple_Texture2D.vcproj
@@ -1,56 +1,183 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="Simple_Texture2D" ProjectGUID="{2E54D748-781B-4DF2-A1DD-B9384A821810}" RootNamespace="Simple_Texture2D" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\Simple_Texture2D.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Simple_Texture2D"
+	ProjectGUID="{2E54D748-781B-4DF2-A1DD-B9384A821810}"
+	RootNamespace="Simple_Texture2D"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\Simple_Texture2D.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/Simple_TextureCubemap/Simple_TextureCubemap.vcproj
+++ b/gfx/angle/samples/gles2_book/Simple_TextureCubemap/Simple_TextureCubemap.vcproj
@@ -1,56 +1,184 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="Simple_TextureCubemap" ProjectGUID="{5EE56061-643D-406E-B42D-4299D2411056}" RootNamespace="Simple_TextureCubemap" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" UseLibraryDependencyInputs="false" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\Simple_TextureCubemap.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Simple_TextureCubemap"
+	ProjectGUID="{5EE56061-643D-406E-B42D-4299D2411056}"
+	RootNamespace="Simple_TextureCubemap"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				UseLibraryDependencyInputs="false"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\Simple_TextureCubemap.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/Simple_VertexShader/Simple_VertexShader.vcproj
+++ b/gfx/angle/samples/gles2_book/Simple_VertexShader/Simple_VertexShader.vcproj
@@ -1,56 +1,183 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="Simple_VertexShader" ProjectGUID="{667CE95F-5DD8-4395-8C18-5CA8A175B12D}" RootNamespace="Simple_VertexShader" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\Simple_VertexShader.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Simple_VertexShader"
+	ProjectGUID="{667CE95F-5DD8-4395-8C18-5CA8A175B12D}"
+	RootNamespace="Simple_VertexShader"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\Simple_VertexShader.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/Stencil_Test/Stencil_Test.vcproj
+++ b/gfx/angle/samples/gles2_book/Stencil_Test/Stencil_Test.vcproj
@@ -1,56 +1,177 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="Stencil_Test" ProjectGUID="{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}" RootNamespace="Stencil_Test" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="2">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" IgnoreAllDefaultLibraries="false" GenerateDebugInformation="true" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="2" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" AdditionalLibraryDirectories="" GenerateDebugInformation="true" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\Stencil_Test.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="Stencil_Test"
+	ProjectGUID="{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}"
+	RootNamespace="Stencil_Test"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				IgnoreAllDefaultLibraries="false"
+				GenerateDebugInformation="true"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="2"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\Stencil_Test.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/gles2_book/TextureWrap/TextureWrap.vcproj
+++ b/gfx/angle/samples/gles2_book/TextureWrap/TextureWrap.vcproj
@@ -1,56 +1,183 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="TextureWrap" ProjectGUID="{CC1DE9A2-B456-4565-9C21-932253E969B9}" RootNamespace="TextureWrap" Keyword="Win32Proj" TargetFrameworkVersion="131072">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" EmbedManifest="true" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="0" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" AdditionalIncludeDirectories="../Common;../../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX" RuntimeLibrary="0" UsePrecompiledHeader="0" WarningLevel="3" Detect64BitPortabilityProblems="false" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" AdditionalLibraryDirectories="" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" RandomizedBaseAddress="1" DataExecutionPrevention="0" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <File RelativePath=".\TextureWrap.c">
-    </File>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="TextureWrap"
+	ProjectGUID="{CC1DE9A2-B456-4565-9C21-932253E969B9}"
+	RootNamespace="TextureWrap"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="131072"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="2"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+				EmbedManifest="true"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="0"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				AdditionalIncludeDirectories="../Common;../../../include"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_DEPRECATE;NOMINMAX"
+				RuntimeLibrary="0"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				Detect64BitPortabilityProblems="false"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				LinkIncremental="1"
+				AdditionalLibraryDirectories=""
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				RandomizedBaseAddress="1"
+				DataExecutionPrevention="0"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<File
+			RelativePath=".\TextureWrap.c"
+			>
+		</File>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/samples.sln
+++ b/gfx/angle/samples/samples.sln
@@ -1,11 +1,10 @@
-
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "esUtil", "gles2_book\Common\esUtil.vcproj", "{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}"
 	ProjectSection(ProjectDependencies) = postProject
 		{B5871A7A-968C-42E3-A33B-981E6F448E78} = {B5871A7A-968C-42E3-A33B-981E6F448E78}
 		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6} = {E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Hello_Triangle", "gles2_book\Hello_Triangle\Hello_Triangle.vcproj", "{8278251F-6C1F-4D80-8499-FA7B590FAFE6}"
 	ProjectSection(ProjectDependencies) = postProject
@@ -68,90 +67,144 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C9
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "essl_to_hlsl", "translator\essl_to_hlsl.vcproj", "{E12EA115-EBC7-47C2-B651-30A0CE986025}"
 	ProjectSection(ProjectDependencies) = postProject
 		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7} = {5620F0E4-6C43-49BC-A178-B804E1A0C3A7}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translator_common", "..\src\compiler\translator_common.vcproj", "{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325} = {FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}
+	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PostSubBuffer", "gles2_book\PostSubBuffer\PostSubBuffer.vcproj", "{667CE95F-5DD8-4495-8C18-5CA8A175B12D}"
 	ProjectSection(ProjectDependencies) = postProject
 		{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F} = {47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}
 	EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preprocessor", "..\src\compiler\preprocessor\new\preprocessor.vcproj", "{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}"
+EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
+		Debug|x64 = Debug|x64
 		Release|Win32 = Release|Win32
+		Release|x64 = Release|x64
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
 		{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.ActiveCfg = Debug|Win32
 		{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|Win32.Build.0 = Debug|Win32
+		{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Debug|x64.ActiveCfg = Debug|Win32
 		{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.ActiveCfg = Release|Win32
 		{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|Win32.Build.0 = Release|Win32
+		{47C93F52-AB4E-4FF9-8D4F-B38CD60A183F}.Release|x64.ActiveCfg = Release|Win32
 		{8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.ActiveCfg = Debug|Win32
 		{8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|Win32.Build.0 = Debug|Win32
+		{8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Debug|x64.ActiveCfg = Debug|Win32
 		{8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.ActiveCfg = Release|Win32
 		{8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|Win32.Build.0 = Release|Win32
+		{8278251F-6C1F-4D80-8499-FA7B590FAFE6}.Release|x64.ActiveCfg = Release|Win32
 		{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}.Debug|Win32.ActiveCfg = Debug|Win32
 		{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}.Debug|Win32.Build.0 = Debug|Win32
+		{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}.Debug|x64.ActiveCfg = Debug|Win32
 		{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}.Release|Win32.ActiveCfg = Release|Win32
 		{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}.Release|Win32.Build.0 = Release|Win32
+		{4E69AC1F-1C7A-4D58-917C-E764FBEB489A}.Release|x64.ActiveCfg = Release|Win32
 		{120CFF94-ED4B-4C5B-9587-9E40889F15F7}.Debug|Win32.ActiveCfg = Debug|Win32
 		{120CFF94-ED4B-4C5B-9587-9E40889F15F7}.Debug|Win32.Build.0 = Debug|Win32
+		{120CFF94-ED4B-4C5B-9587-9E40889F15F7}.Debug|x64.ActiveCfg = Debug|Win32
 		{120CFF94-ED4B-4C5B-9587-9E40889F15F7}.Release|Win32.ActiveCfg = Release|Win32
 		{120CFF94-ED4B-4C5B-9587-9E40889F15F7}.Release|Win32.Build.0 = Release|Win32
+		{120CFF94-ED4B-4C5B-9587-9E40889F15F7}.Release|x64.ActiveCfg = Release|Win32
 		{B9E5BFFC-D843-4E0E-9D3E-23913A613473}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B9E5BFFC-D843-4E0E-9D3E-23913A613473}.Debug|Win32.Build.0 = Debug|Win32
+		{B9E5BFFC-D843-4E0E-9D3E-23913A613473}.Debug|x64.ActiveCfg = Debug|Win32
 		{B9E5BFFC-D843-4E0E-9D3E-23913A613473}.Release|Win32.ActiveCfg = Release|Win32
 		{B9E5BFFC-D843-4E0E-9D3E-23913A613473}.Release|Win32.Build.0 = Release|Win32
+		{B9E5BFFC-D843-4E0E-9D3E-23913A613473}.Release|x64.ActiveCfg = Release|Win32
 		{2E54D748-781B-4DF2-A1DD-B9384A821810}.Debug|Win32.ActiveCfg = Debug|Win32
 		{2E54D748-781B-4DF2-A1DD-B9384A821810}.Debug|Win32.Build.0 = Debug|Win32
+		{2E54D748-781B-4DF2-A1DD-B9384A821810}.Debug|x64.ActiveCfg = Debug|Win32
 		{2E54D748-781B-4DF2-A1DD-B9384A821810}.Release|Win32.ActiveCfg = Release|Win32
 		{2E54D748-781B-4DF2-A1DD-B9384A821810}.Release|Win32.Build.0 = Release|Win32
+		{2E54D748-781B-4DF2-A1DD-B9384A821810}.Release|x64.ActiveCfg = Release|Win32
 		{5EE56061-643D-406E-B42D-4299D2411056}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5EE56061-643D-406E-B42D-4299D2411056}.Debug|Win32.Build.0 = Debug|Win32
+		{5EE56061-643D-406E-B42D-4299D2411056}.Debug|x64.ActiveCfg = Debug|Win32
 		{5EE56061-643D-406E-B42D-4299D2411056}.Release|Win32.ActiveCfg = Release|Win32
 		{5EE56061-643D-406E-B42D-4299D2411056}.Release|Win32.Build.0 = Release|Win32
+		{5EE56061-643D-406E-B42D-4299D2411056}.Release|x64.ActiveCfg = Release|Win32
 		{667CE95F-5DD8-4395-8C18-5CA8A175B12D}.Debug|Win32.ActiveCfg = Debug|Win32
 		{667CE95F-5DD8-4395-8C18-5CA8A175B12D}.Debug|Win32.Build.0 = Debug|Win32
+		{667CE95F-5DD8-4395-8C18-5CA8A175B12D}.Debug|x64.ActiveCfg = Debug|Win32
 		{667CE95F-5DD8-4395-8C18-5CA8A175B12D}.Release|Win32.ActiveCfg = Release|Win32
 		{667CE95F-5DD8-4395-8C18-5CA8A175B12D}.Release|Win32.Build.0 = Release|Win32
+		{667CE95F-5DD8-4395-8C18-5CA8A175B12D}.Release|x64.ActiveCfg = Release|Win32
 		{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Debug|Win32.ActiveCfg = Debug|Win32
 		{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Debug|Win32.Build.0 = Debug|Win32
+		{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Debug|x64.ActiveCfg = Debug|Win32
 		{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Release|Win32.ActiveCfg = Release|Win32
 		{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Release|Win32.Build.0 = Release|Win32
+		{EEACE995-26BC-4D56-A8B3-3E7A9AB3EB26}.Release|x64.ActiveCfg = Release|Win32
 		{CC1DE9A2-B456-4565-9C21-932253E969B9}.Debug|Win32.ActiveCfg = Debug|Win32
 		{CC1DE9A2-B456-4565-9C21-932253E969B9}.Debug|Win32.Build.0 = Debug|Win32
+		{CC1DE9A2-B456-4565-9C21-932253E969B9}.Debug|x64.ActiveCfg = Debug|Win32
 		{CC1DE9A2-B456-4565-9C21-932253E969B9}.Release|Win32.ActiveCfg = Release|Win32
 		{CC1DE9A2-B456-4565-9C21-932253E969B9}.Release|Win32.Build.0 = Release|Win32
+		{CC1DE9A2-B456-4565-9C21-932253E969B9}.Release|x64.ActiveCfg = Release|Win32
 		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Debug|Win32.ActiveCfg = Debug|Win32
 		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Debug|Win32.Build.0 = Debug|Win32
+		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Debug|x64.ActiveCfg = Debug|x64
+		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Debug|x64.Build.0 = Debug|x64
 		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Release|Win32.ActiveCfg = Release|Win32
 		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Release|Win32.Build.0 = Release|Win32
+		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Release|x64.ActiveCfg = Release|x64
+		{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}.Release|x64.Build.0 = Release|x64
 		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|Win32.ActiveCfg = Debug|Win32
 		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|Win32.Build.0 = Debug|Win32
+		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|x64.ActiveCfg = Debug|x64
+		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Debug|x64.Build.0 = Debug|x64
 		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.ActiveCfg = Release|Win32
 		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|Win32.Build.0 = Release|Win32
+		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|x64.ActiveCfg = Release|x64
+		{B5871A7A-968C-42E3-A33B-981E6F448E78}.Release|x64.Build.0 = Release|x64
 		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|Win32.Build.0 = Debug|Win32
+		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|x64.ActiveCfg = Debug|x64
+		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Debug|x64.Build.0 = Debug|x64
 		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Release|Win32.ActiveCfg = Release|Win32
 		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Release|Win32.Build.0 = Release|Win32
+		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Release|x64.ActiveCfg = Release|x64
+		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}.Release|x64.Build.0 = Release|x64
 		{E12EA115-EBC7-47C2-B651-30A0CE986025}.Debug|Win32.ActiveCfg = Debug|Win32
 		{E12EA115-EBC7-47C2-B651-30A0CE986025}.Debug|Win32.Build.0 = Debug|Win32
+		{E12EA115-EBC7-47C2-B651-30A0CE986025}.Debug|x64.ActiveCfg = Debug|Win32
 		{E12EA115-EBC7-47C2-B651-30A0CE986025}.Release|Win32.ActiveCfg = Release|Win32
 		{E12EA115-EBC7-47C2-B651-30A0CE986025}.Release|Win32.Build.0 = Release|Win32
+		{E12EA115-EBC7-47C2-B651-30A0CE986025}.Release|x64.ActiveCfg = Release|Win32
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|Win32.Build.0 = Debug|Win32
+		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|x64.ActiveCfg = Debug|x64
+		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|x64.Build.0 = Debug|x64
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|Win32.ActiveCfg = Release|Win32
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|Win32.Build.0 = Release|Win32
+		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|x64.ActiveCfg = Release|x64
+		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|x64.Build.0 = Release|x64
 		{667CE95F-5DD8-4495-8C18-5CA8A175B12D}.Debug|Win32.ActiveCfg = Debug|Win32
 		{667CE95F-5DD8-4495-8C18-5CA8A175B12D}.Debug|Win32.Build.0 = Debug|Win32
+		{667CE95F-5DD8-4495-8C18-5CA8A175B12D}.Debug|x64.ActiveCfg = Debug|Win32
 		{667CE95F-5DD8-4495-8C18-5CA8A175B12D}.Release|Win32.ActiveCfg = Release|Win32
 		{667CE95F-5DD8-4495-8C18-5CA8A175B12D}.Release|Win32.Build.0 = Release|Win32
+		{667CE95F-5DD8-4495-8C18-5CA8A175B12D}.Release|x64.ActiveCfg = Release|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|Win32.Build.0 = Debug|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|x64.ActiveCfg = Debug|x64
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|x64.Build.0 = Debug|x64
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|Win32.ActiveCfg = Release|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|Win32.Build.0 = Release|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|x64.ActiveCfg = Release|x64
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 EndGlobal
-
--- a/gfx/angle/samples/translator/essl_to_hlsl.vcproj
+++ b/gfx/angle/samples/translator/essl_to_hlsl.vcproj
@@ -1,62 +1,195 @@
 <?xml version="1.0" encoding="Windows-1252"?>
-<VisualStudioProject ProjectType="Visual C++" Version="8.00" Name="essl_to_hlsl" ProjectGUID="{E12EA115-EBC7-47C2-B651-30A0CE986025}" RootNamespace="essl_to_hlsl" Keyword="Win32Proj" TargetFrameworkVersion="196613">
-  <Platforms>
-    <Platform Name="Win32" />
-  </Platforms>
-  <ToolFiles>
-  </ToolFiles>
-  <Configurations>
-    <Configuration Name="Debug|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" MinimalRebuild="true" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="4" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="2" GenerateDebugInformation="true" SubSystem="1" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-    <Configuration Name="Release|Win32" OutputDirectory="$(SolutionDir)$(ConfigurationName)" IntermediateDirectory="$(ConfigurationName)" ConfigurationType="1" CharacterSet="1" WholeProgramOptimization="1">
-      <Tool Name="VCPreBuildEventTool" />
-      <Tool Name="VCCustomBuildTool" />
-      <Tool Name="VCXMLDataGeneratorTool" />
-      <Tool Name="VCWebServiceProxyGeneratorTool" />
-      <Tool Name="VCMIDLTool" />
-      <Tool Name="VCCLCompilerTool" Optimization="2" EnableIntrinsicFunctions="true" AdditionalIncludeDirectories="../../include" PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS" RuntimeLibrary="0" EnableFunctionLevelLinking="true" UsePrecompiledHeader="0" WarningLevel="3" DebugInformationFormat="3" />
-      <Tool Name="VCManagedResourceCompilerTool" />
-      <Tool Name="VCResourceCompilerTool" />
-      <Tool Name="VCPreLinkEventTool" />
-      <Tool Name="VCLinkerTool" LinkIncremental="1" GenerateDebugInformation="true" SubSystem="1" OptimizeReferences="2" EnableCOMDATFolding="2" TargetMachine="1" />
-      <Tool Name="VCALinkTool" />
-      <Tool Name="VCManifestTool" />
-      <Tool Name="VCXDCMakeTool" />
-      <Tool Name="VCBscMakeTool" />
-      <Tool Name="VCFxCopTool" />
-      <Tool Name="VCAppVerifierTool" />
-      <Tool Name="VCPostBuildEventTool" />
-    </Configuration>
-  </Configurations>
-  <References>
-  </References>
-  <Files>
-    <Filter Name="Source Files" Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx" UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
-      <File RelativePath="..\..\src\common\debug.cpp">
-      </File>
-      <File RelativePath=".\translator.cpp">
-      </File>
-    </Filter>
-    <Filter Name="Header Files" Filter="h;hpp;hxx;hm;inl;inc;xsd" UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
-    </Filter>
-  </Files>
-  <Globals>
-  </Globals>
-</VisualStudioProject>
\ No newline at end of file
+<VisualStudioProject
+	ProjectType="Visual C++"
+	Version="9.00"
+	Name="essl_to_hlsl"
+	ProjectGUID="{E12EA115-EBC7-47C2-B651-30A0CE986025}"
+	RootNamespace="essl_to_hlsl"
+	Keyword="Win32Proj"
+	TargetFrameworkVersion="196613"
+	>
+	<Platforms>
+		<Platform
+			Name="Win32"
+		/>
+	</Platforms>
+	<ToolFiles>
+	</ToolFiles>
+	<Configurations>
+		<Configuration
+			Name="Debug|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="0"
+				AdditionalIncludeDirectories="../../include;../../src"
+				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				MinimalRebuild="true"
+				BasicRuntimeChecks="3"
+				RuntimeLibrary="1"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="4"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="d3d9.lib"
+				LinkIncremental="2"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+		<Configuration
+			Name="Release|Win32"
+			OutputDirectory="$(SolutionDir)$(ConfigurationName)"
+			IntermediateDirectory="$(ConfigurationName)"
+			ConfigurationType="1"
+			CharacterSet="1"
+			WholeProgramOptimization="1"
+			>
+			<Tool
+				Name="VCPreBuildEventTool"
+			/>
+			<Tool
+				Name="VCCustomBuildTool"
+			/>
+			<Tool
+				Name="VCXMLDataGeneratorTool"
+			/>
+			<Tool
+				Name="VCWebServiceProxyGeneratorTool"
+			/>
+			<Tool
+				Name="VCMIDLTool"
+			/>
+			<Tool
+				Name="VCCLCompilerTool"
+				Optimization="2"
+				EnableIntrinsicFunctions="true"
+				AdditionalIncludeDirectories="../../include;../../src"
+				PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;_CRT_SECURE_NO_WARNINGS"
+				RuntimeLibrary="0"
+				EnableFunctionLevelLinking="true"
+				UsePrecompiledHeader="0"
+				WarningLevel="3"
+				DebugInformationFormat="3"
+			/>
+			<Tool
+				Name="VCManagedResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCResourceCompilerTool"
+			/>
+			<Tool
+				Name="VCPreLinkEventTool"
+			/>
+			<Tool
+				Name="VCLinkerTool"
+				AdditionalDependencies="d3d9.lib"
+				LinkIncremental="1"
+				GenerateDebugInformation="true"
+				SubSystem="1"
+				OptimizeReferences="2"
+				EnableCOMDATFolding="2"
+				TargetMachine="1"
+			/>
+			<Tool
+				Name="VCALinkTool"
+			/>
+			<Tool
+				Name="VCManifestTool"
+			/>
+			<Tool
+				Name="VCXDCMakeTool"
+			/>
+			<Tool
+				Name="VCBscMakeTool"
+			/>
+			<Tool
+				Name="VCFxCopTool"
+			/>
+			<Tool
+				Name="VCAppVerifierTool"
+			/>
+			<Tool
+				Name="VCPostBuildEventTool"
+			/>
+		</Configuration>
+	</Configurations>
+	<References>
+	</References>
+	<Files>
+		<Filter
+			Name="Source Files"
+			Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+			UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+			>
+			<File
+				RelativePath="..\..\src\common\debug.cpp"
+				>
+			</File>
+			<File
+				RelativePath=".\translator.cpp"
+				>
+			</File>
+		</Filter>
+		<Filter
+			Name="Header Files"
+			Filter="h;hpp;hxx;hm;inl;inc;xsd"
+			UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
+			>
+		</Filter>
+	</Files>
+	<Globals>
+	</Globals>
+</VisualStudioProject>
--- a/gfx/angle/samples/translator/translator.cpp
+++ b/gfx/angle/samples/translator/translator.cpp
@@ -21,17 +21,17 @@ enum TFailCode {
     EFailUsage,
     EFailCompile,
     EFailCompilerCreate,
 };
 
 static void usage();
 static ShShaderType FindShaderType(const char* fileName);
 static bool CompileFile(char* fileName, ShHandle compiler, int compileOptions);
-static void LogMsg(char* msg, const char* name, const int num, const char* logName);
+static void LogMsg(const char* msg, const char* name, const int num, const char* logName);
 static void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongVariableNames);
 
 // If NUM_SOURCE_STRINGS is set to a value > 1, the input file data is
 // broken into that many chunks.
 const unsigned int NUM_SOURCE_STRINGS = 2;
 typedef std::vector<char*> ShaderSource;
 static bool ReadShaderSource(const char* fileName, ShaderSource& source);
 static void FreeShaderSource(ShaderSource& source);
@@ -62,16 +62,17 @@ int main(int argc, char* argv[])
 
     int compileOptions = 0;
     int numCompiles = 0;
     ShHandle vertexCompiler = 0;
     ShHandle fragmentCompiler = 0;
     char* buffer = 0;
     int bufferLen = 0;
     int numAttribs = 0, numUniforms = 0;
+    ShShaderSpec spec = SH_GLES2_SPEC;
     ShShaderOutput output = SH_ESSL_OUTPUT;
 
     ShInitialize();
 
     ShBuiltInResources resources;
     GenerateResources(&resources);
 
     argc--;
@@ -80,16 +81,30 @@ int main(int argc, char* argv[])
         if (argv[0][0] == '-') {
             switch (argv[0][1]) {
             case 'i': compileOptions |= SH_INTERMEDIATE_TREE; break;
             case 'm': compileOptions |= SH_MAP_LONG_VARIABLE_NAMES; break;
             case 'o': compileOptions |= SH_OBJECT_CODE; break;
             case 'u': compileOptions |= SH_ATTRIBUTES_UNIFORMS; break;
             case 'l': compileOptions |= SH_UNROLL_FOR_LOOP_WITH_INTEGER_INDEX; break;
             case 'e': compileOptions |= SH_EMULATE_BUILT_IN_FUNCTIONS; break;
+            case 'd': compileOptions |= SH_DEPENDENCY_GRAPH; break;
+            case 't': compileOptions |= SH_TIMING_RESTRICTIONS; break;
+            case 's':
+                if (argv[0][2] == '=') {
+                    switch (argv[0][3]) {
+                        case 'e': spec = SH_GLES2_SPEC; break;
+                        case 'w': spec = SH_WEBGL_SPEC; break;
+                        case 'c': spec = SH_CSS_SHADERS_SPEC; break;
+                        default: failCode = EFailUsage;
+                    }                    
+                } else {
+                    failCode = EFailUsage;
+                }
+                break;
             case 'b':
                 if (argv[0][2] == '=') {
                     switch (argv[0][3]) {
                     case 'e': output = SH_ESSL_OUTPUT; break;
                     case 'g': output = SH_GLSL_OUTPUT; break;
                     case 'h': output = SH_HLSL_OUTPUT; break;
                     default: failCode = EFailUsage;
                     }
@@ -97,37 +112,38 @@ int main(int argc, char* argv[])
                     failCode = EFailUsage;
                 }
                 break;
             case 'x':
                 if (argv[0][2] == '=') {
                     switch (argv[0][3]) {
                     case 'i': resources.OES_EGL_image_external = 1; break;
                     case 'd': resources.OES_standard_derivatives = 1; break;
+                    case 'r': resources.ARB_texture_rectangle = 1; break;
                     default: failCode = EFailUsage;
                     }
                 } else {
                     failCode = EFailUsage;
                 }
                 break;
             default: failCode = EFailUsage;
             }
         } else {
             ShHandle compiler = 0;
             switch (FindShaderType(argv[0])) {
             case SH_VERTEX_SHADER:
                 if (vertexCompiler == 0)
                     vertexCompiler = ShConstructCompiler(
-                        SH_VERTEX_SHADER, SH_GLES2_SPEC, output, &resources);
+                        SH_VERTEX_SHADER, spec, output, &resources);
                 compiler = vertexCompiler;
                 break;
             case SH_FRAGMENT_SHADER:
                 if (fragmentCompiler == 0)
                     fragmentCompiler = ShConstructCompiler(
-                        SH_FRAGMENT_SHADER, SH_GLES2_SPEC, output, &resources);
+                        SH_FRAGMENT_SHADER, spec, output, &resources);
                 compiler = fragmentCompiler;
                 break;
             default: break;
             }
             if (compiler) {
               bool compiled = CompileFile(argv[0], compiler, compileOptions);
 
               LogMsg("BEGIN", "COMPILER", numCompiles, "INFO LOG");
@@ -191,21 +207,27 @@ void usage()
     printf("Usage: translate [-i -m -o -u -l -e -b=e -b=g -b=h -x=i -x=d] file1 file2 ...\n"
         "Where: filename : filename ending in .frag or .vert\n"
         "       -i       : print intermediate tree\n"
         "       -m       : map long variable names\n"
         "       -o       : print translated code\n"
         "       -u       : print active attribs and uniforms\n"
         "       -l       : unroll for-loops with integer indices\n"
         "       -e       : emulate certain built-in functions (workaround for driver bugs)\n"
+        "       -t       : enforce experimental timing restrictions\n"
+        "       -d       : print dependency graph used to enforce timing restrictions\n"
+        "       -s=e     : use GLES2 spec (this is by default)\n"
+        "       -s=w     : use WebGL spec\n"
+        "       -s=c     : use CSS Shaders spec\n"
         "       -b=e     : output GLSL ES code (this is by default)\n"
         "       -b=g     : output GLSL code\n"
         "       -b=h     : output HLSL code\n"
         "       -x=i     : enable GL_OES_EGL_image_external\n"
-        "       -x=d     : enable GL_OES_EGL_standard_derivatives\n");
+        "       -x=d     : enable GL_OES_EGL_standard_derivatives\n"
+        "       -x=r     : enable ARB_texture_rectangle\n");
 }
 
 //
 //   Deduce the shader type from the filename.  Files must end in one of the
 //   following extensions:
 //
 //   .frag*    = fragment shader
 //   .vert*    = vertex shader
@@ -238,17 +260,17 @@ bool CompileFile(char* fileName, ShHandl
         return false;
 
     int ret = ShCompile(compiler, &source[0], source.size(), compileOptions);
 
     FreeShaderSource(source);
     return ret ? true : false;
 }
 
-void LogMsg(char* msg, const char* name, const int num, const char* logName)
+void LogMsg(const char* msg, const char* name, const int num, const char* logName)
 {
     printf("#### %s %s %d %s ####\n", msg, name, num, logName);
 }
 
 void PrintActiveVariables(ShHandle compiler, ShShaderInfo varType, bool mapLongVariableNames)
 {
     int nameSize = 0;
     switch (varType) {
@@ -267,17 +289,17 @@ void PrintActiveVariables(ShHandle compi
     if (mapLongVariableNames) {
         int mappedNameSize = 0;
         ShGetInfo(compiler, SH_MAPPED_NAME_MAX_LENGTH, &mappedNameSize);
         mappedName = new char[mappedNameSize];
     }
 
     int activeVars = 0, size = 0;
     ShDataType type = SH_NONE;
-    char* typeName = NULL;
+    const char* typeName = NULL;
     ShGetInfo(compiler, varType, &activeVars);
     for (int i = 0; i < activeVars; ++i) {
         switch (varType) {
             case SH_ACTIVE_ATTRIBUTES:
                 ShGetActiveAttrib(compiler, i, NULL, &size, &type, name, mappedName);
                 break;
             case SH_ACTIVE_UNIFORMS:
                 ShGetActiveUniform(compiler, i, NULL, &size, &type, name, mappedName);
--- a/gfx/angle/src/ANGLE.sln
+++ b/gfx/angle/src/ANGLE.sln
@@ -1,27 +1,32 @@
 
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual C++ Express 2008
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libEGL", "libEGL\libEGL.vcproj", "{E746FCA9-64C3-433E-85E8-9A5A67AB7ED6}"
 	ProjectSection(ProjectDependencies) = postProject
 		{B5871A7A-968C-42E3-A33B-981E6F448E78} = {B5871A7A-968C-42E3-A33B-981E6F448E78}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libGLESv2", "libGLESv2\libGLESv2.vcproj", "{B5871A7A-968C-42E3-A33B-981E6F448E78}"
 	ProjectSection(ProjectDependencies) = postProject
 		{5620F0E4-6C43-49BC-A178-B804E1A0C3A7} = {5620F0E4-6C43-49BC-A178-B804E1A0C3A7}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translator_hlsl", "compiler\translator_hlsl.vcproj", "{5620F0E4-6C43-49BC-A178-B804E1A0C3A7}"
 	ProjectSection(ProjectDependencies) = postProject
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD} = {5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}
 	EndProjectSection
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "translator_common", "compiler\translator_common.vcproj", "{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}"
+	ProjectSection(ProjectDependencies) = postProject
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325} = {FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}
+	EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "preprocessor", "compiler\preprocessor\new\preprocessor.vcproj", "{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
 		Debug|Win32 = Debug|Win32
 		Debug|x64 = Debug|x64
 		Release|Win32 = Release|Win32
 		Release|x64 = Release|x64
 	EndGlobalSection
@@ -53,14 +58,21 @@ Global
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|Win32.ActiveCfg = Debug|Win32
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|Win32.Build.0 = Debug|Win32
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|x64.ActiveCfg = Debug|x64
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Debug|x64.Build.0 = Debug|x64
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|Win32.ActiveCfg = Release|Win32
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|Win32.Build.0 = Release|Win32
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|x64.ActiveCfg = Release|x64
 		{5B3A6DB8-1E7E-40D7-92B9-DA8AAE619FAD}.Release|x64.Build.0 = Release|x64
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|Win32.ActiveCfg = Debug|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|Win32.Build.0 = Debug|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|x64.ActiveCfg = Debug|x64
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Debug|x64.Build.0 = Debug|x64
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|Win32.ActiveCfg = Release|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|Win32.Build.0 = Release|Win32
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|x64.ActiveCfg = Release|x64
+		{FBE32DF3-0FB0-4F2F-A424-2C21BD7BC325}.Release|x64.Build.0 = Release|x64
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
 EndGlobal
-obal
--- a/gfx/angle/src/build_angle.gyp
+++ b/gfx/angle/src/build_angle.gyp
@@ -1,35 +1,62 @@
-# Copyright (c) 2010 The ANGLE Project Authors. All rights reserved.
+# 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.
 
 {
   'target_defaults': {
     'defines': [
       'ANGLE_DISABLE_TRACE',
       'ANGLE_COMPILE_OPTIMIZATION_LEVEL=D3DCOMPILE_OPTIMIZATION_LEVEL0',
+      'ANGLE_USE_NEW_PREPROCESSOR=1',
     ],
   },
   'targets': [
     {
       'target_name': 'preprocessor',
       'type': 'static_library',
       'include_dirs': [
       ],
       'sources': [
+        'compiler/preprocessor/new/Diagnostics.cpp',
+        'compiler/preprocessor/new/Diagnostics.h',
+        'compiler/preprocessor/new/DirectiveHandler.cpp',
+        'compiler/preprocessor/new/DirectiveHandler.h',
+        'compiler/preprocessor/new/DirectiveParser.cpp',
+        'compiler/preprocessor/new/DirectiveParser.h',
+        'compiler/preprocessor/new/ExpressionParser.cpp',
+        'compiler/preprocessor/new/ExpressionParser.h',
         'compiler/preprocessor/new/Input.cpp',
         'compiler/preprocessor/new/Input.h',
         'compiler/preprocessor/new/Lexer.cpp',
         'compiler/preprocessor/new/Lexer.h',
-        'compiler/preprocessor/new/pp_lex.cpp',
+        'compiler/preprocessor/new/Macro.cpp',
+        'compiler/preprocessor/new/Macro.h',
+        'compiler/preprocessor/new/MacroExpander.cpp',
+        'compiler/preprocessor/new/MacroExpander.h',
+        'compiler/preprocessor/new/numeric_lex.h',
+        'compiler/preprocessor/new/pp_utils.h',
         'compiler/preprocessor/new/Preprocessor.cpp',
         'compiler/preprocessor/new/Preprocessor.h',
+        'compiler/preprocessor/new/SourceLocation.h',
         'compiler/preprocessor/new/Token.cpp',
         'compiler/preprocessor/new/Token.h',
+        'compiler/preprocessor/new/Tokenizer.cpp',
+        'compiler/preprocessor/new/Tokenizer.h',
+      ],
+      'conditions': [
+        ['OS=="mac"', {
+          'xcode_settings': {
+            'WARNING_CFLAGS': ['<@(gcc_or_clang_warnings)']
+          },
+        }],
+        ['OS=="linux"', {
+          'cflags': ['<@(gcc_or_clang_warnings)']
+        }],
       ],
     },
     {
       'target_name': 'translator_common',
       'type': 'static_library',
       'dependencies': ['preprocessor'],
       'include_dirs': [
         '.',
@@ -44,29 +71,35 @@
         'compiler/BuiltInFunctionEmulator.h',
         'compiler/Common.h',
         'compiler/Compiler.cpp',
         'compiler/ConstantUnion.h',
         'compiler/debug.cpp',
         'compiler/debug.h',
         'compiler/DetectRecursion.cpp',
         'compiler/DetectRecursion.h',
+        'compiler/Diagnostics.h',
+        'compiler/Diagnostics.cpp',
+        'compiler/DirectiveHandler.h',
+        'compiler/DirectiveHandler.cpp',
+        'compiler/ExtensionBehavior.h',
         'compiler/ForLoopUnroll.cpp',
         'compiler/ForLoopUnroll.h',
         'compiler/glslang.h',
         'compiler/glslang_lex.cpp',
         'compiler/glslang_tab.cpp',
         'compiler/glslang_tab.h',
         'compiler/InfoSink.cpp',
         'compiler/InfoSink.h',
         'compiler/Initialize.cpp',
         'compiler/Initialize.h',
         'compiler/InitializeDll.cpp',
         'compiler/InitializeDll.h',
         'compiler/InitializeGlobals.h',
+        'compiler/InitializeParseContext.cpp',
         'compiler/InitializeParseContext.h',
         'compiler/Intermediate.cpp',
         'compiler/intermediate.h',
         'compiler/intermOut.cpp',
         'compiler/IntermTraverse.cpp',
         'compiler/localintermediate.h',
         'compiler/MapLongVariableNames.cpp',
         'compiler/MapLongVariableNames.h',
@@ -76,16 +109,17 @@
         'compiler/ParseHelper.cpp',
         'compiler/ParseHelper.h',
         'compiler/PoolAlloc.cpp',
         'compiler/PoolAlloc.h',
         'compiler/QualifierAlive.cpp',
         'compiler/QualifierAlive.h',
         'compiler/RemoveTree.cpp',
         'compiler/RemoveTree.h',
+        'compiler/RenameFunction.h',
         'compiler/ShHandle.h',
         'compiler/SymbolTable.cpp',
         'compiler/SymbolTable.h',
         'compiler/Types.h',
         'compiler/util.cpp',
         'compiler/util.h',
         'compiler/ValidateLimitations.cpp',
         'compiler/ValidateLimitations.h',
@@ -94,36 +128,55 @@
         # Old preprocessor
         'compiler/preprocessor/atom.c',
         'compiler/preprocessor/atom.h',
         'compiler/preprocessor/compile.h',
         'compiler/preprocessor/cpp.c',
         'compiler/preprocessor/cpp.h',
         'compiler/preprocessor/cppstruct.c',
         'compiler/preprocessor/length_limits.h',
-        'compiler/preprocessor/lexer_glue.cpp',
-        'compiler/preprocessor/lexer_glue.h',
         'compiler/preprocessor/memory.c',
         'compiler/preprocessor/memory.h',
         'compiler/preprocessor/parser.h',
         'compiler/preprocessor/preprocess.h',
         'compiler/preprocessor/scanner.c',
         'compiler/preprocessor/scanner.h',
         'compiler/preprocessor/slglobals.h',
         'compiler/preprocessor/symbols.c',
         'compiler/preprocessor/symbols.h',
         'compiler/preprocessor/tokens.c',
         'compiler/preprocessor/tokens.h',
+        # Dependency graph
+        'compiler/depgraph/DependencyGraph.cpp',
+        'compiler/depgraph/DependencyGraph.h',
+        'compiler/depgraph/DependencyGraphBuilder.cpp',
+        'compiler/depgraph/DependencyGraphBuilder.h',
+        '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',
       ],
       'conditions': [
         ['OS=="win"', {
           'sources': ['compiler/ossource_win.cpp'],
         }, { # else: posix
           'sources': ['compiler/ossource_posix.cpp'],
         }],
+        ['OS=="mac"', {
+          'xcode_settings': {
+            'WARNING_CFLAGS': ['<@(gcc_or_clang_warnings)']
+          },
+        }],
+        ['OS=="linux"', {
+          'cflags': ['<@(gcc_or_clang_warnings)']
+        }],
       ],
     },
     {
       'target_name': 'translator_glsl',
       'type': '<(component)',
       'dependencies': ['translator_common'],
       'include_dirs': [
         '.',
@@ -143,16 +196,26 @@
         'compiler/ShaderLang.cpp',
         'compiler/TranslatorESSL.cpp',
         'compiler/TranslatorESSL.h',
         'compiler/TranslatorGLSL.cpp',
         'compiler/TranslatorGLSL.h',
         'compiler/VersionGLSL.cpp',
         'compiler/VersionGLSL.h',
       ],
+      'conditions': [
+        ['OS=="mac"', {
+          'xcode_settings': {
+            'WARNING_CFLAGS': ['<@(gcc_or_clang_warnings)']
+          },
+        }],
+        ['OS=="linux"', {
+          'cflags': ['<@(gcc_or_clang_warnings)']
+        }],
+      ],
     },
   ],
   'conditions': [
     ['OS=="win"', {
       'targets': [
         {
           'target_name': 'translator_hlsl',
           'type': '<(component)',
@@ -161,23 +224,25 @@
             '.',
             '../include',
           ],
           'defines': [
             'COMPILER_IMPLEMENTATION',
           ],
           'sources': [
             'compiler/ShaderLang.cpp',
+            'compiler/DetectDiscontinuity.cpp',
+            'compiler/DetectDiscontinuity.h',
             'compiler/CodeGenHLSL.cpp',
             'compiler/OutputHLSL.cpp',
             'compiler/OutputHLSL.h',
             'compiler/TranslatorHLSL.cpp',
             'compiler/TranslatorHLSL.h',
-            'compiler/UnfoldSelect.cpp',
-            'compiler/UnfoldSelect.h',
+            'compiler/UnfoldShortCircuit.cpp',
+            'compiler/UnfoldShortCircuit.h',
             'compiler/SearchSymbol.cpp',
             'compiler/SearchSymbol.h',
           ],
         },
         {
           'target_name': 'libGLESv2',
           'type': 'shared_library',
           'dependencies': ['translator_hlsl'],
@@ -193,16 +258,17 @@
             'common/RefCountObject.cpp',
             'common/RefCountObject.h',
             'common/version.h',
             'libGLESv2/IndexDataManager.cpp',
             'libGLESv2/IndexDataManager.h',
             'libGLESv2/vertexconversion.h',
             'libGLESv2/VertexDataManager.cpp',
             'libGLESv2/VertexDataManager.h',
+            'libGLESv2/BinaryStream.h',
             'libGLESv2/Blit.cpp',
             'libGLESv2/Blit.h',
             'libGLESv2/Buffer.cpp',
             'libGLESv2/Buffer.h',
             'libGLESv2/Context.cpp',
             'libGLESv2/Context.h',
             'libGLESv2/Fence.cpp',
             'libGLESv2/Fence.h',
@@ -213,16 +279,18 @@
             'libGLESv2/libGLESv2.cpp',
             'libGLESv2/libGLESv2.def',
             'libGLESv2/libGLESv2.rc',
             'libGLESv2/main.cpp',
             'libGLESv2/main.h',
             'libGLESv2/mathutil.h',
             'libGLESv2/Program.cpp',
             'libGLESv2/Program.h',
+            'libGLESv2/ProgramBinary.cpp',
+            'libGLESv2/ProgramBinary.h',
             'libGLESv2/Query.h',
             'libGLESv2/Query.cpp',
             'libGLESv2/Renderbuffer.cpp',
             'libGLESv2/Renderbuffer.h',
             'libGLESv2/ResourceManager.cpp',
             'libGLESv2/ResourceManager.h',
             'libGLESv2/Shader.cpp',
             'libGLESv2/Shader.h',
--- a/gfx/angle/src/common/angleutils.h
+++ b/gfx/angle/src/common/angleutils.h
@@ -10,9 +10,13 @@
 #define COMMON_ANGLEUTILS_H_
 
 // A macro to disallow the copy constructor and operator= functions
 // This must be used in the private: declarations for a class
 #define DISALLOW_COPY_AND_ASSIGN(TypeName) \
   TypeName(const TypeName&);               \
   void operator=(const TypeName&)
 
+#if defined(_MSC_VER)
+#define snprintf _snprintf
+#endif
+
 #endif // COMMON_ANGLEUTILS_H_
--- a/gfx/angle/src/common/version.h
+++ b/gfx/angle/src/common/version.h
@@ -1,10 +1,10 @@
 #define MAJOR_VERSION 1
 #define MINOR_VERSION 0
 #define BUILD_VERSION 0
-#define BUILD_REVISION 1041
+#define BUILD_REVISION 1242
 
 #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)
--- a/gfx/angle/src/compiler/Compiler.cpp
+++ b/gfx/angle/src/compiler/Compiler.cpp
@@ -3,20 +3,31 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 //
 
 #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/depgraph/DependencyGraph.h"
+#include "compiler/depgraph/DependencyGraphOutput.h"
+#include "compiler/timing/RestrictFragmentShaderTiming.h"
+#include "compiler/timing/RestrictVertexShaderTiming.h"
+
+bool isWebGLBasedSpec(ShShaderSpec spec)
+{
+     return spec == SH_WEBGL_SPEC || spec == SH_CSS_SHADERS_SPEC;
+}
 
 namespace {
 bool InitializeSymbolTable(
     const TBuiltInStrings& builtInStrings,
     ShShaderType type, ShShaderSpec spec, const ShBuiltInResources& resources,
     TInfoSink& infoSink, TSymbolTable& symbolTable)
 {
     TIntermediate intermediate(infoSink);
@@ -118,17 +129,17 @@ bool TCompiler::compile(const char* cons
 {
     TScopedPoolAllocator scopedAlloc(&allocator, true);
     clearResults();
 
     if (numStrings == 0)
         return true;
 
     // If compiling for WebGL, validate loop and indexing as well.
-    if (shaderSpec == SH_WEBGL_SPEC)
+    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;
     int firstSource = 0;
     if (compileOptions & SH_SOURCE_PATH)
     {
         sourcePath = shaderStrings[0];
@@ -156,16 +167,22 @@ bool TCompiler::compile(const char* cons
         success = intermediate.postProcess(root);
 
         if (success)
             success = detectRecursion(root);
 
         if (success && (compileOptions & SH_VALIDATE_LOOP_INDEXING))
             success = validateLimitations(root);
 
+        if (success && (compileOptions & SH_TIMING_RESTRICTIONS))
+            success = enforceTimingRestrictions(root, (compileOptions & SH_DEPENDENCY_GRAPH) != 0);
+
+        if (success && shaderSpec == SH_CSS_SHADERS_SPEC)
+            rewriteCSSShader(root);
+
         // 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);
 
@@ -230,22 +247,68 @@ bool TCompiler::detectRecursion(TIntermN
             infoSink.info.message(EPrefixError, "Function recursion detected");
             return false;
         default:
             UNREACHABLE();
             return false;
     }
 }
 
+void TCompiler::rewriteCSSShader(TIntermNode* root)
+{
+    RenameFunction renamer("main(", "css_main(");
+    root->traverse(&renamer);
+}
+
 bool TCompiler::validateLimitations(TIntermNode* root) {
     ValidateLimitations validate(shaderType, infoSink.info);
     root->traverse(&validate);
     return validate.numErrors() == 0;
 }
 
+bool TCompiler::enforceTimingRestrictions(TIntermNode* root, bool outputGraph)
+{
+    if (shaderSpec != SH_WEBGL_SPEC) {
+        infoSink.info << "Timing restrictions must be enforced under the WebGL spec.";
+        return false;
+    }
+
+    if (shaderType == SH_FRAGMENT_SHADER) {
+        TDependencyGraph graph(root);
+
+        // Output any errors first.
+        bool success = enforceFragmentShaderTimingRestrictions(graph);
+        
+        // Then, output the dependency graph.
+        if (outputGraph) {
+            TDependencyGraphOutput output(infoSink.info);
+            output.outputAllSpanningTrees(graph);
+        }
+        
+        return success;
+    }
+    else {
+        return enforceVertexShaderTimingRestrictions(root);
+    }
+}
+
+bool TCompiler::enforceFragmentShaderTimingRestrictions(const TDependencyGraph& graph)
+{
+    RestrictFragmentShaderTiming restrictor(infoSink.info);
+    restrictor.enforceRestrictions(graph);
+    return restrictor.numErrors() == 0;
+}
+
+bool TCompiler::enforceVertexShaderTimingRestrictions(TIntermNode* root)
+{
+    RestrictVertexShaderTiming restrictor(infoSink.info);
+    restrictor.enforceRestrictions(root);
+    return restrictor.numErrors() == 0;
+}
+
 void TCompiler::collectAttribsUniforms(TIntermNode* root)
 {
     CollectAttribsUniforms collect(attribs, uniforms);
     root->traverse(&collect);
 }
 
 void TCompiler::mapLongVariableNames(TIntermNode* root)
 {
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/DetectDiscontinuity.cpp
@@ -0,0 +1,119 @@
+//
+// 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.
+//
+// Contains analysis utilities for dealing with HLSL's lack of support for
+// the use of intrinsic functions which (implicitly or explicitly) compute
+// gradients of functions with discontinuities. 
+//
+
+#include "compiler/DetectDiscontinuity.h"
+
+#include "compiler/ParseHelper.h"
+
+namespace sh
+{
+bool DetectLoopDiscontinuity::traverse(TIntermNode *node)
+{
+    mLoopDiscontinuity = false;
+    node->traverse(this);
+    return mLoopDiscontinuity;
+}
+
+bool DetectLoopDiscontinuity::visitBranch(Visit visit, TIntermBranch *node)
+{
+    if (mLoopDiscontinuity)
+    {
+        return false;
+    }
+
+    switch (node->getFlowOp())
+    {
+      case EOpKill:
+        break;
+      case EOpBreak:
+      case EOpContinue:
+        mLoopDiscontinuity = true;
+      case EOpReturn:
+        break;
+      default: UNREACHABLE();
+    }
+
+    return !mLoopDiscontinuity;
+}
+
+bool DetectLoopDiscontinuity::visitAggregate(Visit visit, TIntermAggregate *node)
+{
+    return !mLoopDiscontinuity;
+}
+
+bool containsLoopDiscontinuity(TIntermNode *node)
+{
+    DetectLoopDiscontinuity detectLoopDiscontinuity;
+    return detectLoopDiscontinuity.traverse(node);
+}
+
+bool DetectGradientOperation::traverse(TIntermNode *node)
+{
+    mGradientOperation = false;
+    node->traverse(this);
+    return mGradientOperation;
+}
+
+bool DetectGradientOperation::visitUnary(Visit visit, TIntermUnary *node)
+{
+    if (mGradientOperation)
+    {
+        return false;
+    }
+
+    switch (node->getOp())
+    {
+      case EOpDFdx:
+      case EOpDFdy:
+        mGradientOperation = true;
+      default:
+        break;
+    }
+
+    return !mGradientOperation;
+}
+
+bool DetectGradientOperation::visitAggregate(Visit visit, TIntermAggregate *node)
+{
+    if (mGradientOperation)
+    {
+        return false;
+    }
+
+    if (node->getOp() == EOpFunctionCall)
+    {
+        if (!node->isUserDefined())
+        {
+            TString name = TFunction::unmangleName(node->getName());
+
+            if (name == "texture2D" ||
+                name == "texture2DProj" ||
+                name == "textureCube")
+            {
+                mGradientOperation = true;
+            }
+        }
+        else
+        {
+            // When a user defined function is called, we have to
+            // conservatively assume it to contain gradient operations
+            mGradientOperation = true;
+        }
+    }
+
+    return !mGradientOperation;
+}
+
+bool containsGradientOperation(TIntermNode *node)
+{
+    DetectGradientOperation detectGradientOperation;
+    return detectGradientOperation.traverse(node);
+}
+}
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/DetectDiscontinuity.h
@@ -0,0 +1,50 @@
+//
+// 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.
+//
+// Contains analysis utilities for dealing with HLSL's lack of support for
+// the use of intrinsic functions which (implicitly or explicitly) compute
+// gradients of functions with discontinuities. 
+//
+
+#ifndef COMPILER_DETECTDISCONTINUITY_H_
+#define COMPILER_DETECTDISCONTINUITY_H_
+
+#include "compiler/intermediate.h"
+
+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 visitAggregate(Visit visit, TIntermAggregate *node);
+
+    bool mLoopDiscontinuity;
+};
+
+bool containsLoopDiscontinuity(TIntermNode *node);
+
+// Checks for intrinsic functions which compute gradients
+class DetectGradientOperation : public TIntermTraverser
+{
+  public:
+    bool traverse(TIntermNode *node);
+
+  protected:
+    bool visitUnary(Visit visit, TIntermUnary *node);
+    bool visitAggregate(Visit visit, TIntermAggregate *node);
+
+    bool mGradientOperation;
+};
+
+bool containsGradientOperation(TIntermNode *node);
+
+}
+
+#endif   // COMPILER_DETECTDISCONTINUITY_H_
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/Diagnostics.cpp
@@ -0,0 +1,63 @@
+//
+// 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 "compiler/Diagnostics.h"
+
+#include "compiler/debug.h"
+#include "compiler/InfoSink.h"
+#include "compiler/preprocessor/new/SourceLocation.h"
+
+TDiagnostics::TDiagnostics(TInfoSink& infoSink) :
+    mInfoSink(infoSink),
+    mNumErrors(0),
+    mNumWarnings(0)
+{
+}
+
+TDiagnostics::~TDiagnostics()
+{
+}
+
+void TDiagnostics::writeInfo(Severity severity,
+                             const pp::SourceLocation& loc,
+                             const std::string& reason,
+                             const std::string& token,
+                             const std::string& extra)
+{
+    TPrefixType prefix = EPrefixNone;
+    switch (severity)
+    {
+      case ERROR:
+        ++mNumErrors;
+        prefix = EPrefixError;
+        break;
+      case WARNING:
+        ++mNumWarnings;
+        prefix = EPrefixWarning;
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+
+    TInfoSinkBase& sink = mInfoSink.info;
+    /* VC++ format: file(linenum) : error #: 'token' : extrainfo */
+    sink.prefix(prefix);
+    sink.location(EncodeSourceLoc(loc.file, loc.line));
+    sink << "'" << token <<  "' : " << reason << " " << extra << "\n";
+}
+
+void TDiagnostics::writeDebug(const std::string& str)
+{
+    mInfoSink.debug << str;
+}
+
+void TDiagnostics::print(ID id,
+                         const pp::SourceLocation& loc,
+                         const std::string& text)
+{
+    writeInfo(severity(id), loc, message(id), text, "");
+}
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/Diagnostics.h
@@ -0,0 +1,44 @@
+//
+// 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/new/Diagnostics.h"
+
+class TInfoSink;
+
+class TDiagnostics : public pp::Diagnostics
+{
+  public:
+    TDiagnostics(TInfoSink& infoSink);
+    virtual ~TDiagnostics();
+
+    TInfoSink& infoSink() { return mInfoSink; }
+
+    int numErrors() const { return mNumErrors; }
+    int numWarnings() const { return mNumWarnings; }
+
+    void writeInfo(Severity severity,
+                   const pp::SourceLocation& loc,
+                   const std::string& reason,
+                   const std::string& token,
+                   const std::string& extra);
+
+    void writeDebug(const std::string& str);
+
+  protected:
+    virtual void print(ID id,
+                       const pp::SourceLocation& loc,
+                       const std::string& text);
+
+  private:
+    TInfoSink& mInfoSink;
+    int mNumErrors;
+    int mNumWarnings;
+};
+
+#endif  // COMPILER_DIAGNOSTICS_H_
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/DirectiveHandler.cpp
@@ -0,0 +1,161 @@
+//
+// 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 "compiler/DirectiveHandler.h"
+
+#include <sstream>
+
+#include "compiler/debug.h"
+#include "compiler/Diagnostics.h"
+
+static TBehavior getBehavior(const std::string& str)
+{
+    static const std::string kRequire("require");
+    static const std::string kEnable("enable");
+    static const std::string kDisable("disable");
+    static const std::string kWarn("warn");
+
+    if (str == kRequire) return EBhRequire;
+    else if (str == kEnable) return EBhEnable;
+    else if (str == kDisable) return EBhDisable;
+    else if (str == kWarn) return EBhWarn;
+    return EBhUndefined;
+}
+
+TDirectiveHandler::TDirectiveHandler(TExtensionBehavior& extBehavior,
+                                     TDiagnostics& diagnostics)
+    : mExtensionBehavior(extBehavior),
+      mDiagnostics(diagnostics)
+{
+}
+
+TDirectiveHandler::~TDirectiveHandler()
+{
+}
+
+void TDirectiveHandler::handleError(const pp::SourceLocation& loc,
+                                    const std::string& msg)
+{
+    mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc, msg, "", "");
+}
+
+void TDirectiveHandler::handlePragma(const pp::SourceLocation& loc,
+                                     const std::string& name,
+                                     const std::string& value)
+{
+    static const std::string kSTDGL("STDGL");
+    static const std::string kOptimize("optimize");
+    static const std::string kDebug("debug");
+    static const std::string kOn("on");
+    static const std::string kOff("off");
+
+    bool invalidValue = false;
+    if (name == kSTDGL)
+    {
+        // The STDGL pragma is used to reserve pragmas for use by future
+        // revisions of GLSL. Ignore it.
+        return;
+    }
+    else if (name == kOptimize)
+    {
+        if (value == kOn) mPragma.optimize = true;
+        else if (value == kOff) mPragma.optimize = false;
+        else invalidValue = true;
+    }
+    else if (name == kDebug)
+    {
+        if (value == kOn) mPragma.debug = true;
+        else if (value == kOff) mPragma.debug = false;
+        else invalidValue = true;
+    }
+    else
+    {
+        mDiagnostics.report(pp::Diagnostics::UNRECOGNIZED_PRAGMA, loc, name);
+        return;
+    }
+
+    if (invalidValue)
+      mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                             "invalid pragma value", value,
+                             "'on' or 'off' expected");
+}
+
+void TDirectiveHandler::handleExtension(const pp::SourceLocation& loc,
+                                        const std::string& name,
+                                        const std::string& behavior)
+{
+    static const std::string kExtAll("all");
+
+    TBehavior behaviorVal = getBehavior(behavior);
+    if (behaviorVal == EBhUndefined)
+    {
+        mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                               "behavior", name, "invalid");
+        return;
+    }
+
+    if (name == kExtAll)
+    {
+        if (behaviorVal == EBhRequire)
+        {
+            mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                                   "extension", name,
+                                   "cannot have 'require' behavior");
+        }
+        else if (behaviorVal == EBhEnable)
+        {
+            mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                                   "extension", name,
+                                   "cannot have 'enable' behavior");
+        }
+        else
+        {
+            for (TExtensionBehavior::iterator iter = mExtensionBehavior.begin();
+                 iter != mExtensionBehavior.end(); ++iter)
+                iter->second = behaviorVal;
+        }
+        return;
+    }
+
+    TExtensionBehavior::iterator iter = mExtensionBehavior.find(name);
+    if (iter != mExtensionBehavior.end())
+    {
+        iter->second = behaviorVal;
+        return;
+    }
+
+    pp::Diagnostics::Severity severity = pp::Diagnostics::ERROR;
+    switch (behaviorVal) {
+      case EBhRequire:
+        severity = pp::Diagnostics::ERROR;
+        break;
+      case EBhEnable:
+      case EBhWarn:
+      case EBhDisable:
+        severity = pp::Diagnostics::WARNING;
+        break;
+      default:
+        UNREACHABLE();
+        break;
+    }
+    mDiagnostics.writeInfo(severity, loc,
+                           "extension", name, "is not supported");
+}
+
+void TDirectiveHandler::handleVersion(const pp::SourceLocation& loc,
+                                      int version)
+{
+    static const int kVersion = 100;
+
+    if (version != kVersion)
+    {
+        std::stringstream stream;
+        stream << version;
+        std::string str = stream.str();
+        mDiagnostics.writeInfo(pp::Diagnostics::ERROR, loc,
+                               "version number", str, "not supported");
+    }
+}
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/DirectiveHandler.h
@@ -0,0 +1,46 @@
+//
+// 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_DIRECTIVE_HANDLER_H_
+#define COMPILER_DIRECTIVE_HANDLER_H_
+
+#include "compiler/ExtensionBehavior.h"
+#include "compiler/Pragma.h"
+#include "compiler/preprocessor/new/DirectiveHandler.h"
+
+class TDiagnostics;
+
+class TDirectiveHandler : public pp::DirectiveHandler
+{
+  public:
+    TDirectiveHandler(TExtensionBehavior& extBehavior,
+                      TDiagnostics& diagnostics);
+    virtual ~TDirectiveHandler();
+
+    const TPragma& pragma() const { return mPragma; }
+    const TExtensionBehavior& extensionBehavior() const { return mExtensionBehavior; }
+
+    virtual void handleError(const pp::SourceLocation& loc,
+                             const std::string& msg);
+
+    virtual void handlePragma(const pp::SourceLocation& loc,
+                              const std::string& name,
+                              const std::string& value);
+
+    virtual void handleExtension(const pp::SourceLocation& loc,
+                                 const std::string& name,
+                                 const std::string& behavior);
+
+    virtual void handleVersion(const pp::SourceLocation& loc,
+                               int version);
+
+  private:
+    TPragma mPragma;
+    TExtensionBehavior& mExtensionBehavior;
+    TDiagnostics& mDiagnostics;
+};
+
+#endif  // COMPILER_DIRECTIVE_HANDLER_H_
--- a/gfx/angle/src/compiler/ExtensionBehavior.h
+++ b/gfx/angle/src/compiler/ExtensionBehavior.h
@@ -2,37 +2,36 @@
 // 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 _EXTENSION_BEHAVIOR_INCLUDED_
 #define _EXTENSION_BEHAVIOR_INCLUDED_
 
-#include "compiler/Common.h"
+#include <map>
+#include <string>
 
-typedef enum {
+typedef enum
+{
     EBhRequire,
     EBhEnable,
     EBhWarn,
     EBhDisable,
     EBhUndefined,
 } TBehavior;
 
 inline const char* getBehaviorString(TBehavior b)
 {
-    switch(b) {
-      case EBhRequire:
-        return "require";
-      case EBhEnable:
-        return "enable";
-      case EBhWarn:
-        return "warn";
-      case EBhDisable:
-        return "disable";
-      default:
-        return NULL;
+    switch(b)
+    {
+      case EBhRequire: return "require";
+      case EBhEnable: return "enable";
+      case EBhWarn: return "warn";
+      case EBhDisable: return "disable";
+      default: return NULL;
     }
 }
 
-typedef TMap<TString, TBehavior> TExtensionBehavior;
+// Mapping between extension name and behavior.
+typedef std::map<std::string, TBehavior> TExtensionBehavior;
 
 #endif // _EXTENSION_TABLE_INCLUDED_
--- a/gfx/angle/src/compiler/Initialize.cpp
+++ b/gfx/angle/src/compiler/Initialize.cpp
@@ -470,29 +470,31 @@ static TString DefaultPrecisionFragment(
     return s;
 }
 
 //============================================================================
 //
 // Implementation dependent built-in constants.
 //
 //============================================================================
-static TString BuiltInConstants(const ShBuiltInResources &resources)
+static TString BuiltInConstants(ShShaderSpec spec, const ShBuiltInResources &resources)
 {
     TStringStream s;
 
     s << "const int gl_MaxVertexAttribs = " << resources.MaxVertexAttribs << ";";
     s << "const int gl_MaxVertexUniformVectors = " << resources.MaxVertexUniformVectors << ";";
 
     s << "const int gl_MaxVaryingVectors = " << resources.MaxVaryingVectors << ";";
     s << "const int gl_MaxVertexTextureImageUnits = " << resources.MaxVertexTextureImageUnits << ";";
     s << "const int gl_MaxCombinedTextureImageUnits = " << resources.MaxCombinedTextureImageUnits << ";";
     s << "const int gl_MaxTextureImageUnits = " << resources.MaxTextureImageUnits << ";";
     s << "const int gl_MaxFragmentUniformVectors = " << resources.MaxFragmentUniformVectors << ";";
-    s << "const int gl_MaxDrawBuffers = " << resources.MaxDrawBuffers << ";";
+
+    if (spec != SH_CSS_SHADERS_SPEC)
+        s << "const int gl_MaxDrawBuffers = " << resources.MaxDrawBuffers << ";";
 
     return s.str();
 }
 
 void TBuiltIns::initialize(ShShaderType type, ShShaderSpec spec,
                            const ShBuiltInResources& resources)
 {
     switch (type) {
@@ -508,34 +510,45 @@ void TBuiltIns::initialize(ShShaderType 
         builtInStrings.push_back(BuiltInFunctionsCommon(resources));
         builtInStrings.push_back(BuiltInFunctionsVertex(resources));
         builtInStrings.push_back(StandardUniforms());
         break;
 
     default: assert(false && "Language not supported");
     }
 
-    builtInStrings.push_back(BuiltInConstants(resources));
+    builtInStrings.push_back(BuiltInConstants(spec, resources));
 }
 
 void IdentifyBuiltIns(ShShaderType type, ShShaderSpec spec,
                       const ShBuiltInResources& resources,
                       TSymbolTable& symbolTable)
 {
     //
     // First, insert some special built-in variables that are not in 
     // the built-in header files.
     //
     switch(type) {
     case SH_FRAGMENT_SHADER:
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragCoord"),                   TType(EbtFloat, EbpMedium, EvqFragCoord,   4)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FrontFacing"),                 TType(EbtBool,  EbpUndefined, EvqFrontFacing, 1)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"),                   TType(EbtFloat, EbpMedium, EvqFragColor,   4)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData,    4)));
-        symbolTable.insert(*new TVariable(NewPoolTString("gl_PointCoord"),                  TType(EbtFloat, EbpMedium, EvqPointCoord,  2)));
+        symbolTable.insert(*new TVariable(NewPoolTString("gl_FragCoord"),                       TType(EbtFloat, EbpMedium, EvqFragCoord,   4)));
+        symbolTable.insert(*new TVariable(NewPoolTString("gl_FrontFacing"),                     TType(EbtBool,  EbpUndefined, EvqFrontFacing, 1)));
+        symbolTable.insert(*new TVariable(NewPoolTString("gl_PointCoord"),                      TType(EbtFloat, EbpMedium, EvqPointCoord,  2)));
+
+        //
+        // In CSS Shaders, gl_FragColor, gl_FragData, and gl_MaxDrawBuffers are not available.
+        // Instead, css_MixColor and css_ColorMatrix are available.
+        //
+        if (spec != SH_CSS_SHADERS_SPEC) {
+            symbolTable.insert(*new TVariable(NewPoolTString("gl_FragColor"),                   TType(EbtFloat, EbpMedium, EvqFragColor,   4)));
+            symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData,    4)));
+        } else {
+            symbolTable.insert(*new TVariable(NewPoolTString("css_MixColor"),                   TType(EbtFloat, EbpMedium, EvqGlobal,      4)));
+            symbolTable.insert(*new TVariable(NewPoolTString("css_ColorMatrix"),                TType(EbtFloat, EbpMedium, EvqGlobal,      4, true)));
+        }
+
         break;
 
     case SH_VERTEX_SHADER:
         symbolTable.insert(*new TVariable(NewPoolTString("gl_Position"),    TType(EbtFloat, EbpHigh, EvqPosition,    4)));
         symbolTable.insert(*new TVariable(NewPoolTString("gl_PointSize"),   TType(EbtFloat, EbpMedium, EvqPointSize,   1)));
         break;
 
     default: assert(false && "Language not supported");
@@ -615,17 +628,18 @@ void IdentifyBuiltIns(ShShaderType type,
             symbolTable.relateToExtension("fwidth", "GL_OES_standard_derivatives");
         }
         break;
     default: break;
     }
 
     // Finally add resource-specific variables.
     switch(type) {
-    case SH_FRAGMENT_SHADER: {
+    case SH_FRAGMENT_SHADER:
+        if (spec != SH_CSS_SHADERS_SPEC) {
             // Set up gl_FragData.  The array size.
             TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, false, true);
             fragData.setArraySize(resources.MaxDrawBuffers);
             symbolTable.insert(*new TVariable(NewPoolTString("gl_FragData"),    fragData));
         }
         break;
     default: break;
     }
new file mode 100644
--- /dev/null
+++ b/gfx/angle/src/compiler/InitializeParseContext.cpp
@@ -0,0 +1,96 @@
+//
+// 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 "compiler/InitializeParseContext.h"
+
+#include "compiler/osinclude.h"
+
+OS_TLSIndex GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
+
+bool InitializeParseContextIndex()
+{
+    if (GlobalParseContextIndex != OS_INVALID_TLS_INDEX) {
+        assert(0 && "InitializeParseContextIndex(): Parse Context already initalized");
+        return false;
+    }
+
+    //
+    // Allocate a TLS index.
+    //
+    GlobalParseContextIndex = OS_AllocTLSIndex();
+    
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "InitializeParseContextIndex(): Parse Context already initalized");
+        return false;
+    }
+
+    return true;
+}
+
+bool FreeParseContextIndex()
+{
+    OS_TLSIndex tlsiIndex = GlobalParseContextIndex;
+
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "FreeParseContextIndex(): Parse Context index not initalized");
+        return false;
+    }
+
+    GlobalParseContextIndex = OS_INVALID_TLS_INDEX;
+
+    return OS_FreeTLSIndex(tlsiIndex);
+}
+
+bool InitializeGlobalParseContext()
+{
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "InitializeGlobalParseContext(): Parse Context index not initalized");
+        return false;
+    }
+
+    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
+    if (lpParseContext != 0) {
+        assert(0 && "InitializeParseContextIndex(): Parse Context already initalized");
+        return false;
+    }
+
+    TThreadParseContext *lpThreadData = new TThreadParseContext();
+    if (lpThreadData == 0) {
+        assert(0 && "InitializeGlobalParseContext(): Unable to create thread parse context");
+        return false;
+    }
+
+    lpThreadData->lpGlobalParseContext = 0;
+    OS_SetTLSValue(GlobalParseContextIndex, lpThreadData);
+
+    return true;
+}
+
+bool FreeParseContext()
+{
+    if (GlobalParseContextIndex == OS_INVALID_TLS_INDEX) {
+        assert(0 && "FreeParseContext(): Parse Context index not initalized");
+        return false;
+    }
+
+    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
+    if (lpParseContext)
+        delete lpParseContext;
+
+    return true;
+}
+
+TParseContextPointer& GetGlobalParseContext()
+{
+    //
+    // Minimal error checking for speed
+    //
+
+    TThreadParseContext *lpParseContext = static_cast<TThreadParseContext *>(OS_GetTLSValue(GlobalParseContextIndex));
+
+    return lpParseContext->lpGlobalParseContext;
+}
+
--- a/gfx/angle/src/compiler/InitializeParseContext.h
+++ b/gfx/angle/src/compiler/InitializeParseContext.h
@@ -8,9 +8,19 @@
 #define __INITIALIZE_PARSE_CONTEXT_INCLUDED_
 
 bool InitializeParseContextIndex();
 bool FreeParseContextIndex();
 
 bool InitializeGlobalParseContext();
 bool FreeParseContext();
 
+struct TParseContext;
+typedef TParseContext* TParseContextPointer;
+extern TParseContextPointer& GetGlobalParseContext();
+#define GlobalParseContext GetGlobalParseContext()
+
+typedef struct TThreadParseContextRec
+{
+    TParseContext *lpGlobalParseContext;
+} TThreadParseContext;
+
 #endif // __INITIALIZE_PARSE_CONTEXT_INCLUDED_
--- a/gfx/angle/src/compiler/Intermediate.cpp
+++ b/gfx/angle/src/compiler/Intermediate.cpp
@@ -1440,14 +1440,8 @@ TIntermTyped* TIntermediate::promoteCons
 
     }
 
     const TType& t = node->getType();
 
     return addConstantUnion(leftUnionArray, TType(promoteTo, t.getPrecision(), t.getQualifier(), t.getNominalSize(), t.isMatrix(), t.isArray()), node->getLine());
 }
 
-void TIntermAggregate::addToPragmaTable(const TPragmaTable& pTable)
-{
-    assert(!pragmaTable);
-    pragmaTable = new TPragmaTable();
-    *pragmaTable = pTable;
-}
--- a/gfx/angle/src/compiler/MapLongVariableNames.cpp
+++ b/gfx/angle/src/compiler/MapLongVariableNames.cpp
@@ -1,36 +1,29 @@
 //
 // 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/MapLongVariableNames.h"
-#include "spooky.h"
 
 namespace {
 
 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
-    // it's illegal anyway.
-    stream << (name[0] == '_' ? "webgl" : "webgl_")
-           << name.substr(0, 9)
-           << (name[8] == '_' ? "" : "_")
-           << std::hex
-           << hash;
-    ASSERT(stream.str().length() <= MAX_SHORTENED_IDENTIFIER_SIZE);
-    ASSERT(stream.str().length() >= MAX_SHORTENED_IDENTIFIER_SIZE - 2);
+    stream << "webgl_";
+    if (isGlobal)
+        stream << "g";
+    stream << id;
+    if (name[0] != '_')
+        stream << "_";
+    stream << name.substr(0, MAX_SHORTENED_IDENTIFIER_SIZE - stream.str().size());
     return stream.str();
 }
 
 LongNameMap* gLongNameMapInstance = NULL;
 
 }  // anonymous namespace
 
 LongNameMap::LongNameMap()
--- a/gfx/angle/src/compiler/OutputGLSLBase.cpp
+++ b/gfx/angle/src/compiler/OutputGLSLBase.cpp
@@ -1,16 +1,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/compilerdebug.h"
+#include "compiler/debug.h"
 
 namespace
 {
 TString getTypeName(const TType& type)
 {
     TInfoSinkBase out;
     if (type.isMatrix())
     {
--- a/gfx/angle/src/compiler/OutputHLSL.cpp
+++ b/gfx/angle/src/compiler/OutputHLSL.cpp
@@ -1,48 +1,56 @@
 //
 // 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 "compiler/compilerdebug.h"
+#include "common/angleutils.h"
+#include "compiler/debug.h"
 #include "compiler/InfoSink.h"
-#include "compiler/UnfoldSelect.h"
+#include "compiler/UnfoldShortCircuit.h"
 #include "compiler/SearchSymbol.h"
+#include "compiler/DetectDiscontinuity.h"
 
 #include <stdio.h>
 #include <algorithm>
 
 namespace sh
 {
 // Integer to TString conversion
 TString str(int i)
 {
     char buffer[20];
-    sprintf(buffer, "%d", i);
+    snprintf(buffer, sizeof(buffer), "%d", i);
     return buffer;
 }
 
 OutputHLSL::OutputHLSL(TParseContext &context) : TIntermTraverser(true, true, true), mContext(context)
 {
-    mUnfoldSelect = new UnfoldSelect(context, this);
+    mUnfoldShortCircuit = new UnfoldShortCircuit(context, this);
     mInsideFunction = false;
 
     mUsesTexture2D = false;
     mUsesTexture2D_bias = false;
     mUsesTexture2DProj = false;
     mUsesTexture2DProj_bias = false;
     mUsesTexture2DProjLod = false;
     mUsesTexture2DLod = false;
     mUsesTextureCube = false;
     mUsesTextureCube_bias = false;
     mUsesTextureCubeLod = false;
+    mUsesTexture2DLod0 = false;
+    mUsesTexture2DLod0_bias = false;
+    mUsesTexture2DProjLod0 = false;
+    mUsesTexture2DProjLod0_bias = false;
+    mUsesTextureCubeLod0 = false;
+    mUsesTextureCubeLod0_bias = false;
     mUsesDepthRange = false;
     mUsesFragCoord = false;
     mUsesPointCoord = false;
     mUsesFrontFacing = false;
     mUsesPointSize = false;
     mUsesXor = false;
     mUsesMod1 = false;
     mUsesMod2v = false;
@@ -70,30 +78,38 @@ OutputHLSL::OutputHLSL(TParseContext &co
     mUsesAtan2_1 = false;
     mUsesAtan2_2 = false;
     mUsesAtan2_3 = false;
     mUsesAtan2_4 = false;
 
     mScopeDepth = 0;
 
     mUniqueIndex = 0;
+
+    mContainsLoopDiscontinuity = false;
+    mOutputLod0Function = false;
+    mInsideDiscontinuousLoop = false;
+
+    mExcessiveLoopIndex = NULL;
 }
 
 OutputHLSL::~OutputHLSL()
 {
-    delete mUnfoldSelect;
+    delete mUnfoldShortCircuit;
 }
 
 void OutputHLSL::output()
 {
+    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();
+    mContext.infoSink().obj << mHeader.c_str();
+    mContext.infoSink().obj << mBody.c_str();
 }
 
 TInfoSinkBase &OutputHLSL::getBodyStream()
 {
     return mBody;
 }
 
 int OutputHLSL::vectorSize(const TType &type) const
@@ -200,90 +216,142 @@ void OutputHLSL::header()
             out << "uniform bool dx_PointsOrLines;\n"
                    "uniform bool dx_FrontCCW;\n";
         }
         
         out << "\n";
         out <<  uniforms;
         out << "\n";
 
-        // The texture fetch functions "flip" the Y coordinate in one way or another. This is because textures are stored
-        // according to the OpenGL convention, i.e. (0, 0) is "bottom left", rather than the D3D convention where (0, 0)
-        // is "top left". Since the HLSL texture fetch functions expect textures to be stored according to the D3D
-        // convention, the Y coordinate passed to these functions is adjusted to compensate.
-        //
-        // The simplest case is texture2D where the mapping is Y -> 1-Y, which maps [0, 1] -> [1, 0].
-        //
-        // The texture2DProj functions are more complicated because the projection divides by either Z or W. For the vec3
-        // case, the mapping is Y -> Z-Y or Y/Z -> 1-Y/Z, which again maps [0, 1] -> [1, 0].
-        //
-        // For cube textures the mapping is Y -> -Y, which maps [-1, 1] -> [1, -1]. This is not sufficient on its own for the
-        // +Y and -Y faces, which are now on the "wrong sides" of the cube. This is compensated for by exchanging the
-        // +Y and -Y faces everywhere else throughout the code.
-        
         if (mUsesTexture2D)
         {
             out << "float4 gl_texture2D(sampler2D s, float2 t)\n"
                    "{\n"
-                   "    return tex2D(s, float2(t.x, 1 - t.y));\n"
+                   "    return tex2D(s, t);\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTexture2D_bias)
         {
             out << "float4 gl_texture2D(sampler2D s, float2 t, float bias)\n"
                    "{\n"
-                   "    return tex2Dbias(s, float4(t.x, 1 - t.y, 0, bias));\n"
+                   "    return tex2Dbias(s, float4(t.x, t.y, 0, bias));\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTexture2DProj)
         {
             out << "float4 gl_texture2DProj(sampler2D s, float3 t)\n"
                    "{\n"
-                   "    return tex2Dproj(s, float4(t.x, t.z - t.y, 0, t.z));\n"
+                   "    return tex2Dproj(s, float4(t.x, t.y, 0, t.z));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProj(sampler2D s, float4 t)\n"
                    "{\n"
-                   "    return tex2Dproj(s, float4(t.x, t.w - t.y, t.z, t.w));\n"
+                   "    return tex2Dproj(s, t);\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTexture2DProj_bias)
         {
             out << "float4 gl_texture2DProj(sampler2D s, float3 t, float bias)\n"
                    "{\n"
-                   "    return tex2Dbias(s, float4(t.x / t.z, 1 - (t.y / t.z), 0, bias));\n"
+                   "    return tex2Dbias(s, float4(t.x / t.z, t.y / t.z, 0, bias));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProj(sampler2D s, float4 t, float bias)\n"
                    "{\n"
-                   "    return tex2Dbias(s, float4(t.x / t.w, 1 - (t.y / t.w), 0, bias));\n"
+                   "    return tex2Dbias(s, float4(t.x / t.w, t.y / t.w, 0, bias));\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTextureCube)
         {
             out << "float4 gl_textureCube(samplerCUBE s, float3 t)\n"
                    "{\n"
-                   "    return texCUBE(s, float3(t.x, -t.y, t.z));\n"
+                   "    return texCUBE(s, t);\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTextureCube_bias)
         {
             out << "float4 gl_textureCube(samplerCUBE s, float3 t, float bias)\n"
                    "{\n"
-                   "    return texCUBEbias(s, float4(t.x, -t.y, t.z, bias));\n"
+                   "    return texCUBEbias(s, float4(t.x, t.y, t.z, bias));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        // These *Lod0 intrinsics are not available in GL fragment shaders.
+        // They are used to sample using discontinuous texture coordinates.
+        if (mUsesTexture2DLod0)
+        {
+            out << "float4 gl_texture2DLod0(sampler2D s, float2 t)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTexture2DLod0_bias)
+        {
+            out << "float4 gl_texture2DLod0(sampler2D s, float2 t, float bias)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTexture2DProjLod0)
+        {
+            out << "float4 gl_texture2DProjLod0(sampler2D s, float3 t)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
+                   "}\n"
+                   "\n"
+                   "float4 gl_texture2DProjLod(sampler2D s, float4 t)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTexture2DProjLod0_bias)
+        {
+            out << "float4 gl_texture2DProjLod0_bias(sampler2D s, float3 t, float bias)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
+                   "}\n"
+                   "\n"
+                   "float4 gl_texture2DProjLod_bias(sampler2D s, float4 t, float bias)\n"
+                   "{\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTextureCubeLod0)
+        {
+            out << "float4 gl_textureCubeLod0(samplerCUBE s, float3 t)\n"
+                   "{\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
+                   "}\n"
+                   "\n";
+        }
+
+        if (mUsesTextureCubeLod0_bias)
+        {
+            out << "float4 gl_textureCubeLod0(samplerCUBE s, float3 t, float bias)\n"
+                   "{\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
                    "}\n"
                    "\n";
         }
     }
     else   // Vertex shader
     {
         TString uniforms;
         TString attributes;
@@ -349,91 +417,77 @@ void OutputHLSL::header()
         out << "\n"
                "// Varyings\n";
         out <<  varyings;
         out << "\n"
                "uniform float2 dx_HalfPixelSize;\n"
                "\n";
         out <<  uniforms;
         out << "\n";
-
-        // The texture fetch functions "flip" the Y coordinate in one way or another. This is because textures are stored
-        // according to the OpenGL convention, i.e. (0, 0) is "bottom left", rather than the D3D convention where (0, 0)
-        // is "top left". Since the HLSL texture fetch functions expect textures to be stored according to the D3D
-        // convention, the Y coordinate passed to these functions is adjusted to compensate.
-        //
-        // The simplest case is texture2D where the mapping is Y -> 1-Y, which maps [0, 1] -> [1, 0].
-        //
-        // The texture2DProj functions are more complicated because the projection divides by either Z or W. For the vec3
-        // case, the mapping is Y -> Z-Y or Y/Z -> 1-Y/Z, which again maps [0, 1] -> [1, 0].
-        //
-        // For cube textures the mapping is Y -> -Y, which maps [-1, 1] -> [1, -1]. This is not sufficient on its own for the
-        // +Y and -Y faces, which are now on the "wrong sides" of the cube. This is compensated for by exchanging the
-        // +Y and -Y faces everywhere else throughout the code.
         
         if (mUsesTexture2D)
         {
             out << "float4 gl_texture2D(sampler2D s, float2 t)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x, 1 - t.y, 0, 0));\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, 0));\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTexture2DLod)
         {
             out << "float4 gl_texture2DLod(sampler2D s, float2 t, float lod)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x, 1 - t.y, 0, lod));\n"
+                   "    return tex2Dlod(s, float4(t.x, t.y, 0, lod));\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTexture2DProj)
         {
             out << "float4 gl_texture2DProj(sampler2D s, float3 t)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.z, 1 - t.y / t.z, 0, 0));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, 0));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProj(sampler2D s, float4 t)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.w, 1 - t.y / t.w, 0, 0));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, 0));\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTexture2DProjLod)
         {
             out << "float4 gl_texture2DProjLod(sampler2D s, float3 t, float lod)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.z, 1 - t.y / t.z, 0, lod));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.z, t.y / t.z, 0, lod));\n"
                    "}\n"
                    "\n"
                    "float4 gl_texture2DProjLod(sampler2D s, float4 t, float lod)\n"
                    "{\n"
-                   "    return tex2Dlod(s, float4(t.x / t.w, 1 - t.y / t.w, 0, lod));\n"
+                   "    return tex2Dlod(s, float4(t.x / t.w, t.y / t.w, 0, lod));\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTextureCube)
         {
             out << "float4 gl_textureCube(samplerCUBE s, float3 t)\n"
                    "{\n"
-                   "    return texCUBElod(s, float4(t.x, -t.y, t.z, 0));\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, 0));\n"
                    "}\n"
                    "\n";
         }
 
         if (mUsesTextureCubeLod)
         {
             out << "float4 gl_textureCubeLod(samplerCUBE s, float3 t, float lod)\n"
                    "{\n"
-                   "    return texCUBElod(s, float4(t.x, -t.y, t.z, lod));\n"
+                   "    return texCUBElod(s, float4(t.x, t.y, t.z, lod));\n"
                    "}\n"
                    "\n";
         }
     }
 
     if (mUsesFragCoord)
     {
         out << "#define GL_USES_FRAG_COORD\n";
@@ -1049,22 +1103,26 @@ bool OutputHLSL::visitBinary(Visit visit
       case EOpGreaterThan:       outputTriplet(visit, "(", " > ", ")");   break;
       case EOpLessThanEqual:     outputTriplet(visit, "(", " <= ", ")");  break;
       case EOpGreaterThanEqual:  outputTriplet(visit, "(", " >= ", ")");  break;
       case EOpVectorTimesScalar: outputTriplet(visit, "(", " * ", ")");   break;
       case EOpMatrixTimesScalar: outputTriplet(visit, "(", " * ", ")");   break;
       case EOpVectorTimesMatrix: outputTriplet(visit, "mul(", ", transpose(", "))"); break;
       case EOpMatrixTimesVector: outputTriplet(visit, "mul(transpose(", "), ", ")"); break;
       case EOpMatrixTimesMatrix: outputTriplet(visit, "transpose(mul(transpose(", "), transpose(", ")))"); break;
-      case EOpLogicalOr:         outputTriplet(visit, "(", " || ", ")");  break;
+      case EOpLogicalOr:
+        out << "s" << mUnfoldShortCircuit->getNextTemporaryIndex();
+        return false;
       case EOpLogicalXor:
         mUsesXor = true;
         outputTriplet(visit, "xor(", ", ", ")");
         break;
-      case EOpLogicalAnd:        outputTriplet(visit, "(", " && ", ")");  break;
+      case EOpLogicalAnd:
+        out << "s" << mUnfoldShortCircuit->getNextTemporaryIndex();
+        return false;
       default: UNREACHABLE();
     }
 
     return true;
 }
 
 bool OutputHLSL::visitUnary(Visit visit, TIntermUnary *node)
 {
@@ -1126,19 +1184,46 @@ bool OutputHLSL::visitUnary(Visit visit,
       case EOpInverseSqrt:      outputTriplet(visit, "rsqrt(", "", ")");     break;
       case EOpAbs:              outputTriplet(visit, "abs(", "", ")");       break;
       case EOpSign:             outputTriplet(visit, "sign(", "", ")");      break;
       case EOpFloor:            outputTriplet(visit, "floor(", "", ")");     break;
       case EOpCeil:             outputTriplet(visit, "ceil(", "", ")");      break;
       case EOpFract:            outputTriplet(visit, "frac(", "", ")");      break;
       case EOpLength:           outputTriplet(visit, "length(", "", ")");    break;
       case EOpNormalize:        outputTriplet(visit, "normalize(", "", ")"); break;
-      case EOpDFdx:             outputTriplet(visit, "ddx(", "", ")");       break;
-      case EOpDFdy:             outputTriplet(visit, "(-ddy(", "", "))");    break;
-      case EOpFwidth:           outputTriplet(visit, "fwidth(", "", ")");    break;        
+      case EOpDFdx:
+        if(mInsideDiscontinuousLoop || mOutputLod0Function)
+        {
+            outputTriplet(visit, "(", "", ", 0.0)");
+        }
+        else
+        {
+            outputTriplet(visit, "ddx(", "", ")");
+        }
+        break;
+      case EOpDFdy:
+        if(mInsideDiscontinuousLoop || mOutputLod0Function)
+        {
+            outputTriplet(visit, "(", "", ", 0.0)");
+        }
+        else
+        {
+           outputTriplet(visit, "ddy(", "", ")");
+        }
+        break;
+      case EOpFwidth:
+        if(mInsideDiscontinuousLoop || mOutputLod0Function)
+        {
+            outputTriplet(visit, "(", "", ", 0.0)");
+        }
+        else
+        {
+            outputTriplet(visit, "fwidth(", "", ")");
+        }
+        break;
       case EOpAny:              outputTriplet(visit, "any(", "", ")");       break;
       case EOpAll:              outputTriplet(visit, "all(", "", ")");       break;
       default: UNREACHABLE();
     }
 
     return true;
 }
 
@@ -1166,22 +1251,17 @@ bool OutputHLSL::visitAggregate(Visit vi
                     mScopeBracket[mScopeDepth - 1]++;   // New scope at existing level
                 }
             }
 
             for (TIntermSequence::iterator sit = node->getSequence().begin(); sit != node->getSequence().end(); sit++)
             {
                 outputLineDirective((*sit)->getLine());
 
-                if (isSingleStatement(*sit))
-                {
-                    mUnfoldSelect->traverse(*sit);
-                }
-
-                (*sit)->traverse(this);
+                traverseStatements(*sit);
 
                 out << ";\n";
             }
 
             if (mInsideFunction)
             {
                 outputLineDirective(node->getEndLine());
                 out << "}\n";
@@ -1285,124 +1365,181 @@ bool OutputHLSL::visitAggregate(Visit vi
             return false;
         }
         break;
       case EOpComma:            outputTriplet(visit, "(", ", ", ")");                break;
       case EOpFunction:
         {
             TString name = TFunction::unmangleName(node->getName());
 
-            if (visit == PreVisit)
-            {
-                out << typeString(node->getType()) << " ";
+            out << typeString(node->getType()) << " ";
 
-                if (name == "main")
-                {
-                    out << "gl_main(";
-                }
-                else
+            if (name == "main")
+            {
+                out << "gl_main(";
+            }
+            else
+            {
+                out << decorate(name) << (mOutputLod0Function ? "Lod0(" : "(");
+            }
+
+            TIntermSequence &sequence = node->getSequence();
+            TIntermSequence &arguments = sequence[0]->getAsAggregate()->getSequence();
+
+            for (unsigned int i = 0; i < arguments.size(); i++)
+            {
+                TIntermSymbol *symbol = arguments[i]->getAsSymbolNode();
+
+                if (symbol)
                 {
-                    out << decorate(name) << "(";
-                }
-
-                TIntermSequence &sequence = node->getSequence();
-                TIntermSequence &arguments = sequence[0]->getAsAggregate()->getSequence();
-
-                for (unsigned int i = 0; i < arguments.size(); i++)
-                {
-                    TIntermSymbol *symbol = arguments[i]->getAsSymbolNode();
-
-                    if (symbol)
+                    if (symbol->getType().getStruct())
                     {
-                        if (symbol->getType().getStruct())
-                        {
-                            addConstructor(symbol->getType(), scopedStruct(symbol->getType().getTypeName()), NULL);
-                        }
-
-                        out << argumentString(symbol);
+                        addConstructor(symbol->getType(), scopedStruct(symbol->getType().getTypeName()), NULL);
+                    }
 
-                        if (i < arguments.size() - 1)
-                        {
-                            out << ", ";
-                        }
-                    }
-                    else UNREACHABLE();
-                }
+                    out << argumentString(symbol);
 
-                sequence.erase(sequence.begin());
+                    if (i < arguments.size() - 1)
+                    {
+                        out << ", ";
+                    }
+                }
+                else UNREACHABLE();
+            }
 
-                out << ")\n";
-                
-                outputLineDirective(node->getLine());
-                out << "{\n";
-                
+            out << ")\n"
+                "{\n";
+            
+            if (sequence.size() > 1)
+            {
                 mInsideFunction = true;
-            }
-            else if (visit == PostVisit)
-            {
-                outputLineDirective(node->getEndLine());
-                out << "}\n";
-
+                sequence[1]->traverse(this);
                 mInsideFunction = false;
             }
+            
+            out << "}\n";
+
+            if (mContainsLoopDiscontinuity && !mOutputLod0Function)
+            {
+                if (name != "main")
+                {
+                    mOutputLod0Function = true;
+                    node->traverse(this);
+                    mOutputLod0Function = false;
+                }
+            }
+
+            return false;
         }
         break;
       case EOpFunctionCall:
         {
             if (visit == PreVisit)
             {
                 TString name = TFunction::unmangleName(node->getName());
+                bool lod0 = mInsideDiscontinuousLoop || mOutputLod0Function;
 
                 if (node->isUserDefined())
                 {
-                    out << decorate(name) << "(";
+                    out << decorate(name) << (lod0 ? "Lod0(" : "(");
                 }
                 else
                 {
                     if (name == "texture2D")
                     {
-                        if (node->getSequence().size() == 2)
-                        {
-                            mUsesTexture2D = true;
-                        }
-                        else if (node->getSequence().size() == 3)
+                        if (!lod0)
                         {
-                            mUsesTexture2D_bias = true;
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2D = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2D_bias = true;
+                            }
+                            else UNREACHABLE();
+
+                            out << "gl_texture2D(";
                         }
-                        else UNREACHABLE();
+                        else
+                        {
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2DLod0 = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2DLod0_bias = true;
+                            }
+                            else UNREACHABLE();
 
-                        out << "gl_texture2D(";
+                            out << "gl_texture2DLod0(";
+                        }
                     }
                     else if (name == "texture2DProj")
                     {
-                        if (node->getSequence().size() == 2)
-                        {
-                            mUsesTexture2DProj = true;
-                        }
-                        else if (node->getSequence().size() == 3)
+                        if (!lod0)
                         {
-                            mUsesTexture2DProj_bias = true;
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2DProj = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2DProj_bias = true;
+                            }
+                            else UNREACHABLE();
+
+                            out << "gl_texture2DProj(";
                         }
-                        else UNREACHABLE();
+                        else
+                        {
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTexture2DProjLod0 = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTexture2DProjLod0_bias = true;
+                            }
+                            else UNREACHABLE();
 
-                        out << "gl_texture2DProj(";
+                            out << "gl_texture2DProjLod0(";
+                        }
                     }
                     else if (name == "textureCube")
                     {
-                        if (node->getSequence().size() == 2)
-                        {
-                            mUsesTextureCube = true;
-                        }
-                        else if (node->getSequence().size() == 3)
+                        if (!lod0)
                         {
-                            mUsesTextureCube_bias = true;
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTextureCube = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTextureCube_bias = true;
+                            }
+                            else UNREACHABLE();
+
+                            out << "gl_textureCube(";
                         }
-                        else UNREACHABLE();
+                        else
+                        {
+                            if (node->getSequence().size() == 2)
+                            {
+                                mUsesTextureCubeLod0 = true;
+                            }
+                            else if (node->getSequence().size() == 3)
+                            {
+                                mUsesTextureCubeLod0_bias = true;
+                            }
+                            else UNREACHABLE();
 
-                        out << "gl_textureCube(";
+                            out << "gl_textureCubeLod0(";
+                        }
                     }
                     else if (name == "texture2DLod")
                     {
                         if (node->getSequence().size() == 3)
                         {
                             mUsesTexture2DLod = true;
                         }
                         else UNREACHABLE();
@@ -1578,64 +1715,71 @@ bool OutputHLSL::visitAggregate(Visit vi
 }
 
 bool OutputHLSL::visitSelection(Visit visit, TIntermSelection *node)
 {
     TInfoSinkBase &out = mBody;
 
     if (node->usesTernaryOperator())
     {
-        out << "s" << mUnfoldSelect->getNextTemporaryIndex();
+        out << "s" << mUnfoldShortCircuit->getNextTemporaryIndex();
     }
     else  // if/else statement
     {
-        mUnfoldSelect->traverse(node->getCondition());
+        mUnfoldShortCircuit->traverse(node->getCondition());
 
         out << "if(";
 
         node->getCondition()->traverse(this);
 
         out << ")\n";
         
         outputLineDirective(node->getLine());
         out << "{\n";
 
         if (node->getTrueBlock())
         {
-            node->getTrueBlock()->traverse(this);
+            traverseStatements(node->getTrueBlock());
         }
 
         outputLineDirective(node->getLine());
-        out << ";}\n";
+        out << ";\n}\n";
 
         if (node->getFalseBlock())
         {
             out << "else\n";
 
             outputLineDirective(node->getFalseBlock()->getLine());
             out << "{\n";
 
             outputLineDirective(node->getFalseBlock()->getLine());
-            node->getFalseBlock()->traverse(this);
+            traverseStatements(node->getFalseBlock());
 
             outputLineDirective(node->getFalseBlock()->getLine());
-            out << ";}\n";
+            out << ";\n}\n";
         }
     }
 
     return false;
 }
 
 void OutputHLSL::visitConstantUnion(TIntermConstantUnion *node)
 {
     writeConstantUnion(node->getType(), node->getUnionArrayPointer());
 }
 
 bool OutputHLSL::visitLoop(Visit visit, TIntermLoop *node)
 {
+    bool wasDiscontinuous = mInsideDiscontinuousLoop;
+
+    if (!mInsideDiscontinuousLoop)
+    {
+        mInsideDiscontinuousLoop = containsLoopDiscontinuity(node);
+    }
+
     if (handleExcessiveLoop(node))
     {
         return false;
     }
 
     TInfoSinkBase &out = mBody;
 
     if (node->getType() == ELoopDoWhile)
@@ -1671,17 +1815,17 @@ bool OutputHLSL::visitLoop(Visit visit, 
         out << ")\n";
         
         outputLineDirective(node->getLine());
         out << "{\n";
     }
 
     if (node->getBody())
     {
-        node->getBody()->traverse(this);
+        traverseStatements(node->getBody());
     }
 
     outputLineDirective(node->getLine());
     out << ";}\n";
 
     if (node->getType() == ELoopDoWhile)
     {
         outputLineDirective(node->getCondition()->getLine());
@@ -1689,27 +1833,43 @@ bool OutputHLSL::visitLoop(Visit visit, 
 
         node->getCondition()->traverse(this);
 
         out << ");";
     }
 
     out << "}\n";
 
+    mInsideDiscontinuousLoop = wasDiscontinuous;
+
     return false;
 }
 
 bool OutputHLSL::visitBranch(Visit visit, TIntermBranch *node)
 {
     TInfoSinkBase &out = mBody;
 
     switch (node->getFlowOp())
     {
       case EOpKill:     outputTriplet(visit, "discard;\n", "", "");  break;
-      case EOpBreak:    outputTriplet(visit, "break;\n", "", "");    break;
+      case EOpBreak:
+        if (visit == PreVisit)
+        {
+            if (mExcessiveLoopIndex)
+            {
+                out << "{Break";
+                mExcessiveLoopIndex->traverse(this);
+                out << " = true; break;}\n";
+            }
+            else
+            {
+                out << "break;\n";
+            }
+        }
+        break;
       case EOpContinue: outputTriplet(visit, "continue;\n", "", ""); break;
       case EOpReturn:
         if (visit == PreVisit)
         {
             if (node->getExpression())
             {
                 out << "return ";
             }
@@ -1727,16 +1887,26 @@ bool OutputHLSL::visitBranch(Visit visit
         }
         break;
       default: UNREACHABLE();
     }
 
     return true;
 }
 
+void OutputHLSL::traverseStatements(TIntermNode *node)
+{
+    if (isSingleStatement(node))
+    {
+        mUnfoldShortCircuit->traverse(node);
+    }
+
+    node->traverse(this);
+}
+
 bool OutputHLSL::isSingleStatement(TIntermNode *node)
 {
     TIntermAggregate *aggregate = node->getAsAggregate();
 
     if (aggregate)
     {
         if (aggregate->getOp() == EOpSequence)
         {
@@ -1754,19 +1924,21 @@ bool OutputHLSL::isSingleStatement(TInte
 
             return true;
         }
     }
 
     return true;
 }
 
-// Handle loops with more than 255 iterations (unsupported by D3D9) by splitting them
+// Handle loops with more than 254 iterations (unsupported by D3D9) by splitting them
+// (The D3D documentation says 255 iterations, but the compiler complains at anything more than 254).
 bool OutputHLSL::handleExcessiveLoop(TIntermLoop *node)
 {
+    const int MAX_LOOP_ITERATIONS = 254;
     TInfoSinkBase &out = mBody;
 
     // Parse loops of the form:
     // for(int index = initial; index [comparator] limit; index += increment)
     TIntermSymbol *index = NULL;
     TOperator comparator = EOpNull;
     int initial = 0;
     int limit = 0;
@@ -1872,28 +2044,52 @@ bool OutputHLSL::handleExcessiveLoop(TIn
             comparator = EOpLessThan;
             limit += 1;
         }
 
         if (comparator == EOpLessThan)
         {
             int iterations = (limit - initial) / increment;
 
-            if (iterations <= 255)
+            if (iterations <= MAX_LOOP_ITERATIONS)
             {
                 return false;   // Not an excessive loop
             }
 
+            TIntermSymbol *restoreIndex = mExcessiveLoopIndex;
+            mExcessiveLoopIndex = index;
+
+            out << "{int ";
+            index->traverse(this);
+            out << ";\n"
+                   "bool Break";
+            index->traverse(this);
+            out << " = false;\n";
+
+            bool firstLoopFragment = true;
+
             while (iterations > 0)
             {
-                int clampedLimit = initial + increment * std::min(255, iterations);
+                int clampedLimit = initial + increment * std::min(MAX_LOOP_ITERATIONS, iterations);
 
+                if (!firstLoopFragment)
+                {
+                    out << "if(!Break";
+                    index->traverse(this);
+                    out << ") {\n";
+                }
+
+                if (iterations <= MAX_LOOP_ITERATIONS)   // Last loop fragment
+                {
+                    mExcessiveLoopIndex = NULL;   // Stops setting the Break flag
+                }
+                
                 // for(int index = initial; index < clampedLimit; index += increment)
 
-                out << "for(int ";
+                out << "for(";
                 index->traverse(this);
                 out << " = ";
                 out << initial;
 
                 out << "; ";
                 index->traverse(this);
                 out << " < ";
                 out << clampedLimit;
@@ -1910,19 +2106,30 @@ bool OutputHLSL::handleExcessiveLoop(TIn
                 if (node->getBody())
                 {
                     node->getBody()->traverse(this);
                 }
 
                 outputLineDirective(node->getLine());
                 out << ";}\n";
 
-                initial += 255 * increment;
-                iterations -= 255;
+                if (!firstLoopFragment)
+                {
+                    out << "}\n";
+                }
+
+                firstLoopFragment = false;
+
+                initial += MAX_LOOP_ITERATIONS * increment;
+                iterations -= MAX_LOOP_ITERATIONS;
             }
+            
+            out << "}";
+
+            mExcessiveLoopIndex = restoreIndex;
 
             return true;
         }
         else UNIMPLEMENTED();
     }
 
     return false;   // Not handled as an excessive loop
 }
@@ -2060,16 +2267,18 @@ TString OutputHLSL::typeString(const TTy
           case EbtVoid:
             return "void";
           case EbtSampler2D:
             return "sampler2D";
           case EbtSamplerCube:
             return "samplerCUBE";
           case EbtSamplerExternalOES:
             return "sampler2D";
+          default:
+            break;
         }
     }
 
     UNIMPLEMENTED();   // FIXME
     return "<unknown type>";
 }
 
 TString OutputHLSL::arrayString(const TType &type)
--- a/gfx/angle/src/compiler/OutputHLSL.h
+++ b/gfx/angle/src/compiler/OutputHLSL.h
@@ -10,17 +10,17 @@
 #include <list>
 #include <set>
 
 #include "compiler/intermediate.h"
 #include "compiler/ParseHelper.h"
 
 namespace sh
 {
-class UnfoldSelect;
+class UnfoldShortCircuit;
 
 class OutputHLSL : public TIntermTraverser
 {
   public:
     explicit OutputHLSL(TParseContext &context);
     ~OutputHLSL();
 
     void output();
@@ -43,32 +43,33 @@ class OutputHLSL : public TIntermTravers
     void visitConstantUnion(TIntermConstantUnion*);
     bool visitBinary(Visit visit, TIntermBinary*);
     bool visitUnary(Visit visit, TIntermUnary*);
     bool visitSelection(Visit visit, TIntermSelection*);
     bool visitAggregate(Visit visit, TIntermAggregate*);
     bool visitLoop(Visit visit, TIntermLoop*);
     bool visitBranch(Visit visit, TIntermBranch*);
 
+    void traverseStatements(TIntermNode *node);
     bool isSingleStatement(TIntermNode *node);
     bool handleExcessiveLoop(TIntermLoop *node);
     void outputTriplet(Visit visit, const TString &preString, const TString &inString, const TString &postString);
     void outputLineDirective(int line);
     TString argumentString(const TIntermSymbol *symbol);
     int vectorSize(const TType &type) const;
 
     void addConstructor(const TType &type, const TString &name, const TIntermSequence *parameters);
     const ConstantUnion *writeConstantUnion(const TType &type, const ConstantUnion *constUnion);
 
     TString scopeString(unsigned int depthLimit);
     TString scopedStruct(const TString &typeName);
     TString structLookup(const TString &typeName);
 
     TParseContext &mContext;
-    UnfoldSelect *mUnfoldSelect;
+    UnfoldShortCircuit *mUnfoldShortCircuit;
     bool mInsideFunction;
 
     // Output streams
     TInfoSinkBase mHeader;
     TInfoSinkBase mBody;
     TInfoSinkBase mFooter;
 
     std::set<std::string> mReferencedUniforms;
@@ -80,16 +81,22 @@ class OutputHLSL : public TIntermTravers
     bool mUsesTexture2D_bias;
     bool mUsesTexture2DLod;
     bool mUsesTexture2DProj;
     bool mUsesTexture2DProj_bias;
     bool mUsesTexture2DProjLod;
     bool mUsesTextureCube;
     bool mUsesTextureCube_bias;
     bool mUsesTextureCubeLod;
+    bool mUsesTexture2DLod0;
+    bool mUsesTexture2DLod0_bias;
+    bool mUsesTexture2DProjLod0;
+    bool mUsesTexture2DProjLod0_bias;
+    bool mUsesTextureCubeLod0;
+    bool mUsesTextureCubeLod0_bias;
     bool mUsesDepthRange;
     bool mUsesFragCoord;
     bool mUsesPointCoord;
     bool mUsesFrontFacing;
     bool mUsesPointSize;
     bool mUsesXor;
     bool mUsesMod1;
     bool mUsesMod2v;
@@ -128,12 +135,18 @@ class OutputHLSL : public TIntermTravers
     typedef std::list<TString> StructDeclarations;
     StructDeclarations mStructDeclarations;
 
     typedef std::vector<int> ScopeBracket;
     ScopeBracket mScopeBracket;
     unsigned int mScopeDepth;
 
     int mUniqueIndex;   // For creating unique names
+
+    bool mContainsLoopDiscontinuity;
+    bool mOutputLod0Function;
+    bool mInsideDiscontinuousLoop;
+
+    TIntermSymbol *mExcessiveLoopIndex;
 };
 }
 
 #endif   // COMPILER_OUTPUTHLSL_H_
--- a/gfx/angle/src/compiler/ParseHelper.cpp
+++ b/gfx/angle/src/compiler/ParseHelper.cpp
@@ -5,59 +5,33 @@
 //
 
 #include "compiler/ParseHelper.h"
 
 #include <stdarg.h>
 #include <stdio.h>
 
 #include "compiler/glslang.h"
-#include "compiler/osinclude.h"
-#include "compiler/InitializeParseContext.h"
-
-extern "C" {
-extern int InitPreprocessor();
-extern int FinalizePreprocessor();
-extern void PredefineIntMacro(const char *name, int value);
-}
-
-static void ReportInfo(TInfoSinkBase& sink,
-                       TPrefixType type, TSourceLoc loc,
-                       const char* reason, const char* token, 
-                       const char* extraInfo)
-{
-    /* VC++ format: file(linenum) : error #: 'token' : extrainfo */
-    sink.prefix(type);
-    sink.location(loc);
-    sink << "'" << token <<  "' : " << reason << " " << extraInfo << "\n";
-}
-
-static void DefineExtensionMacros(const TExtensionBehavior& extBehavior)
-{
-    for (TExtensionBehavior::const_iterator iter = extBehavior.begin();
-         iter != extBehavior.end(); ++iter) {
-        PredefineIntMacro(iter->first.c_str(), 1);
-    }
-}
+#include "compiler/preprocessor/new/SourceLocation.h"
 
 ///////////////////////////////////////////////////////////////////////
 //
 // Sub- vector and matrix fields
 //
 ////////////////////////////////////////////////////////////////////////
 
 //
 // Look at a '.' field selector string and change it into offsets
 // for a vector.
 //
 bool TParseContext::parseVectorFields(const TString& compString, int vecSize, TVectorFields& fields, int line)
 {
     fields.num = (int) compString.size();
     if (fields.num > 4) {
-        error(line, "illegal vector field selection", compString.c_str(), "");
+        error(line, "illegal vector field selection", compString.c_str());
         return false;
     }
 
     enum {
         exyzw,
         ergba,
         estpq,
     } fieldSet[4];
@@ -109,30 +83,30 @@ bool TParseContext::parseVectorFields(co
             fields.offsets[i] = 3;
             fieldSet[i] = ergba;
             break;
         case 'q':
             fields.offsets[i] = 3;
             fieldSet[i] = estpq;
             break;
         default:
-            error(line, "illegal vector field selection", compString.c_str(), "");
+            error(line, "illegal vector field selection", compString.c_str());
             return false;
         }
     }
 
     for (int i = 0; i < fields.num; ++i) {
         if (fields.offsets[i] >= vecSize) {
-            error(line, "vector field selection out of range",  compString.c_str(), "");
+            error(line, "vector field selection out of range",  compString.c_str());
             return false;
         }
 
         if (i > 0) {
             if (fieldSet[i] != fieldSet[i-1]) {
-                error(line, "illegal - vector component fields not from the same set", compString.c_str(), "");
+                error(line, "illegal - vector component fields not from the same set", compString.c_str());
                 return false;
             }
         }
     }
 
     return true;
 }
 
@@ -144,46 +118,46 @@ bool TParseContext::parseVectorFields(co
 bool TParseContext::parseMatrixFields(const TString& compString, int matSize, TMatrixFields& fields, int line)
 {
     fields.wholeRow = false;
     fields.wholeCol = false;
     fields.row = -1;
     fields.col = -1;
 
     if (compString.size() != 2) {
-        error(line, "illegal length of matrix field selection", compString.c_str(), "");
+        error(line, "illegal length of matrix field selection", compString.c_str());
         return false;
     }
 
     if (compString[0] == '_') {
         if (compString[1] < '0' || compString[1] > '3') {
-            error(line, "illegal matrix field selection", compString.c_str(), "");
+            error(line, "illegal matrix field selection", compString.c_str());
             return false;
         }
         fields.wholeCol = true;
         fields.col = compString[1] - '0';
     } else if (compString[1] == '_') {
         if (compString[0] < '0' || compString[0] > '3') {
-            error(line, "illegal matrix field selection", compString.c_str(), "");
+            error(line, "illegal matrix field selection", compString.c_str());
             return false;
         }
         fields.wholeRow = true;
         fields.row = compString[0] - '0';
     } else {
         if (compString[0] < '0' || compString[0] > '3' ||
             compString[1] < '0' || compString[1] > '3') {
-            error(line, "illegal matrix field selection", compString.c_str(), "");
+            error(line, "illegal matrix field selection", compString.c_str());
             return false;
         }
         fields.row = compString[0] - '0';
         fields.col = compString[1] - '0';
     }
 
     if (fields.row >= matSize || fields.col >= matSize) {
-        error(line, "matrix field selection out of range", compString.c_str(), "");
+        error(line, "matrix field selection out of range", compString.c_str());
         return false;
     }
 
     return true;
 }
 
 ///////////////////////////////////////////////////////////////////////
 //
@@ -198,85 +172,87 @@ void TParseContext::recover()
 {
 }
 
 //
 // Used by flex/bison to output all syntax and parsing errors.
 //
 void TParseContext::error(TSourceLoc loc,
                           const char* reason, const char* token, 
-                          const char* extraInfoFormat, ...)
+                          const char* extraInfo)
 {
-    char extraInfo[512];
-    va_list marker;
-    va_start(marker, extraInfoFormat);
-    vsnprintf(extraInfo, sizeof(extraInfo), extraInfoFormat, marker);
+    pp::SourceLocation srcLoc;
+    DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line);
+    diagnostics.writeInfo(pp::Diagnostics::ERROR,
+                          srcLoc, reason, token, extraInfo);
 
-    ReportInfo(infoSink.info, EPrefixError, loc, reason, token, extraInfo);
-
-    va_end(marker);
-    ++numErrors;
 }
 
 void TParseContext::warning(TSourceLoc loc,
                             const char* reason, const char* token,
-                            const char* extraInfoFormat, ...) {
-    char extraInfo[512];
-    va_list marker;
-    va_start(marker, extraInfoFormat);
-    vsnprintf(extraInfo, sizeof(extraInfo), extraInfoFormat, marker);
+                            const char* extraInfo) {
+    pp::SourceLocation srcLoc;
+    DecodeSourceLoc(loc, &srcLoc.file, &srcLoc.line);
+    diagnostics.writeInfo(pp::Diagnostics::WARNING,
+                          srcLoc, reason, token, extraInfo);
+}
 
-    ReportInfo(infoSink.info, EPrefixWarning, loc, reason, token, extraInfo);
-
-    va_end(marker);
+void TParseContext::trace(const char* str)
+{
+    diagnostics.writeDebug(str);
 }
 
 //
 // Same error message for all places assignments don't work.
 //
 void TParseContext::assignError(int line, const char* op, TString left, TString right)
 {
-    error(line, "", op, "cannot convert from '%s' to '%s'",
-          right.c_str(), left.c_str());
+    std::stringstream extraInfoStream;
+    extraInfoStream << "cannot convert from '" << right << "' to '" << left << "'";
+    std::string extraInfo = extraInfoStream.str();
+    error(line, "", op, extraInfo.c_str());
 }
 
 //
 // Same error message for all places unary operations don't work.
 //
 void TParseContext::unaryOpError(int line, const char* op, TString operand)
 {
-   error(line, " wrong operand type", op, 
-          "no operation '%s' exists that takes an operand of type %s (or there is no acceptable conversion)",
-          op, operand.c_str());
+    std::stringstream extraInfoStream;
+    extraInfoStream << "no operation '" << op << "' exists that takes an operand of type " << operand 
+                    << " (or there is no acceptable conversion)";
+    std::string extraInfo = extraInfoStream.str();
+    error(line, " wrong operand type", op, extraInfo.c_str());
 }
 
 //
 // Same error message for all binary operations don't work.
 //
 void TParseContext::binaryOpError(int line, const char* op, TString left, TString right)
 {
-    error(line, " wrong operand types ", op, 
-            "no operation '%s' exists that takes a left-hand operand of type '%s' and "
-            "a right operand of type '%s' (or there is no acceptable conversion)", 
-            op, left.c_str(), right.c_str());
+    std::stringstream extraInfoStream;
+    extraInfoStream << "no operation '" << op << "' exists that takes a left-hand operand of type '" << left 
+                    << "' and a right operand of type '" << right << "' (or there is no acceptable conversion)";
+    std::string extraInfo = extraInfoStream.str();
+    error(line, " wrong operand types ", op, extraInfo.c_str()); 
 }
 
 bool TParseContext::precisionErrorCheck(int line, TPrecision precision, TBasicType type){
     if (!checksPrecisionErrors)
         return false;
     switch( type ){
     case EbtFloat:
         if( precision == EbpUndefined ){
-            error( line, "No precision specified for (float)", "", "" );
+            error( line, "No precision specified for (float)", "" );
             return true;
         }
         break;
     case EbtInt:
         if( precision == EbpUndefined ){
-            error( line, "No precision specified (int)", "", "" );
+            error( line, "No precision specified (int)", "" );
             return true;
         }
         break;
     default:
         return false;
     }
     return false;
 }
@@ -308,28 +284,28 @@ bool TParseContext::lValueErrorCheck(int
                 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()->getUnionArrayPointer()->getIConst();
                     offset[value]++;     
                     if (offset[value] > 1) {
-                        error(line, " l-value of swizzle cannot have duplicate components", op, "", "");
+                        error(line, " l-value of swizzle cannot have duplicate components", op);
 
                         return true;
                     }
                 }
             } 
 
             return errorReturn;
         default: 
             break;
         }
-        error(line, " l-value required", op, "", "");
+        error(line, " l-value required", op);
 
         return true;
     }
 
 
     const char* symbol = 0;
     if (symNode != 0)
         symbol = symNode->getSymbol().c_str();
@@ -359,83 +335,91 @@ bool TParseContext::lValueErrorCheck(int
             message = "can't modify void";
             break;
         default: