Bug 1489279 - Update ANGLE to mozilla/angle/firefox-64, chromium/3538. - r=upstream
authorJeff Gilbert <jgilbert@mozilla.com>
Tue, 18 Sep 2018 17:10:14 -0700
changeset 437368 7aff94b0bba6bbc8abeb98c8d8a20173ba496003
parent 437367 b37e4fe538bf2b32f598029f23aa131cd312be57
child 437369 1970ddae66cc98adaf473c09751197a4705ea3a4
push id34679
push userbtara@mozilla.com
push dateThu, 20 Sep 2018 04:13:35 +0000
treeherdermozilla-central@08a77a40e658 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersupstream
bugs1489279
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1489279 - Update ANGLE to mozilla/angle/firefox-64, chromium/3538. - r=upstream
gfx/angle/checkout/include/EGL/eglext_angle.h
gfx/angle/checkout/include/GLES/glext_explicit_context_autogen.inc
gfx/angle/checkout/include/GLES2/gl2ext.h
gfx/angle/checkout/include/GLES2/gl2ext_angle.h
gfx/angle/checkout/include/GLES2/gl2ext_explicit_context_autogen.inc
gfx/angle/checkout/include/GLSLANG/ShaderLang.h
gfx/angle/checkout/include/platform/Platform.h
gfx/angle/checkout/out/gen/angle/id/commit.h
gfx/angle/checkout/src/common/Color.h
gfx/angle/checkout/src/common/MemoryBuffer.cpp
gfx/angle/checkout/src/common/PackedEGLEnums_autogen.cpp
gfx/angle/checkout/src/common/PackedEGLEnums_autogen.h
gfx/angle/checkout/src/common/PackedEnums.cpp
gfx/angle/checkout/src/common/PackedEnums.h
gfx/angle/checkout/src/common/PackedGLEnums_autogen.cpp
gfx/angle/checkout/src/common/PackedGLEnums_autogen.h
gfx/angle/checkout/src/common/angleutils.h
gfx/angle/checkout/src/common/bitset_utils.h
gfx/angle/checkout/src/common/debug.h
gfx/angle/checkout/src/common/event_tracer.cpp
gfx/angle/checkout/src/common/mathutil.h
gfx/angle/checkout/src/common/platform.h
gfx/angle/checkout/src/common/system_utils.h
gfx/angle/checkout/src/common/system_utils_linux.cpp
gfx/angle/checkout/src/common/system_utils_mac.cpp
gfx/angle/checkout/src/common/system_utils_win.cpp
gfx/angle/checkout/src/common/uniform_type_info_autogen.cpp
gfx/angle/checkout/src/common/utilities.cpp
gfx/angle/checkout/src/common/utilities.h
gfx/angle/checkout/src/common/vector_utils.h
gfx/angle/checkout/src/compiler/preprocessor/Token.cpp
gfx/angle/checkout/src/compiler/preprocessor/Token.h
gfx/angle/checkout/src/compiler/preprocessor/numeric_lex.h
gfx/angle/checkout/src/compiler/translator/BaseTypes.h
gfx/angle/checkout/src/compiler/translator/Common.h
gfx/angle/checkout/src/compiler/translator/ExtensionBehavior.cpp
gfx/angle/checkout/src/compiler/translator/ExtensionBehavior.h
gfx/angle/checkout/src/compiler/translator/HashNames.cpp
gfx/angle/checkout/src/compiler/translator/ImageFunctionHLSL.cpp
gfx/angle/checkout/src/compiler/translator/ImageFunctionHLSL.h
gfx/angle/checkout/src/compiler/translator/ImmutableString.h
gfx/angle/checkout/src/compiler/translator/ImmutableStringBuilder.cpp
gfx/angle/checkout/src/compiler/translator/ImmutableStringBuilder.h
gfx/angle/checkout/src/compiler/translator/InfoSink.cpp
gfx/angle/checkout/src/compiler/translator/InfoSink.h
gfx/angle/checkout/src/compiler/translator/Initialize.cpp
gfx/angle/checkout/src/compiler/translator/IntermNode.cpp
gfx/angle/checkout/src/compiler/translator/IntermNode.h
gfx/angle/checkout/src/compiler/translator/Operator.cpp
gfx/angle/checkout/src/compiler/translator/Operator.h
gfx/angle/checkout/src/compiler/translator/OutputGLSLBase.cpp
gfx/angle/checkout/src/compiler/translator/OutputGLSLBase.h
gfx/angle/checkout/src/compiler/translator/OutputHLSL.cpp
gfx/angle/checkout/src/compiler/translator/OutputHLSL.h
gfx/angle/checkout/src/compiler/translator/OutputTree.cpp
gfx/angle/checkout/src/compiler/translator/ParseContext.cpp
gfx/angle/checkout/src/compiler/translator/ParseContext.h
gfx/angle/checkout/src/compiler/translator/ParseContext_autogen.h
gfx/angle/checkout/src/compiler/translator/PoolAlloc.h
gfx/angle/checkout/src/compiler/translator/QualifierTypes.cpp
gfx/angle/checkout/src/compiler/translator/QualifierTypes.h
gfx/angle/checkout/src/compiler/translator/ResourcesHLSL.cpp
gfx/angle/checkout/src/compiler/translator/ResourcesHLSL.h
gfx/angle/checkout/src/compiler/translator/ShaderLang.cpp
gfx/angle/checkout/src/compiler/translator/StructureHLSL.cpp
gfx/angle/checkout/src/compiler/translator/Symbol.cpp
gfx/angle/checkout/src/compiler/translator/Symbol.h
gfx/angle/checkout/src/compiler/translator/SymbolTable.cpp
gfx/angle/checkout/src/compiler/translator/SymbolTable.h
gfx/angle/checkout/src/compiler/translator/SymbolTable_autogen.cpp
gfx/angle/checkout/src/compiler/translator/SymbolUniqueId.h
gfx/angle/checkout/src/compiler/translator/TranslatorHLSL.cpp
gfx/angle/checkout/src/compiler/translator/Types.cpp
gfx/angle/checkout/src/compiler/translator/Types.h
gfx/angle/checkout/src/compiler/translator/UniformHLSL.cpp
gfx/angle/checkout/src/compiler/translator/UniformHLSL.h
gfx/angle/checkout/src/compiler/translator/glslang.l
gfx/angle/checkout/src/compiler/translator/glslang.y
gfx/angle/checkout/src/compiler/translator/glslang_lex.cpp
gfx/angle/checkout/src/compiler/translator/glslang_tab.cpp
gfx/angle/checkout/src/compiler/translator/glslang_tab.h
gfx/angle/checkout/src/compiler/translator/tree_ops/DeclareAndInitBuiltinsForInstancedMultiview.cpp
gfx/angle/checkout/src/compiler/translator/tree_ops/NameEmbeddedUniformStructs.cpp
gfx/angle/checkout/src/compiler/translator/tree_ops/NameEmbeddedUniformStructs.h
gfx/angle/checkout/src/compiler/translator/tree_ops/PruneNoOps.cpp
gfx/angle/checkout/src/compiler/translator/tree_ops/RemoveUnreferencedVariables.cpp
gfx/angle/checkout/src/compiler/translator/tree_ops/RewriteAtomicFunctionExpressions.cpp
gfx/angle/checkout/src/compiler/translator/tree_ops/RewriteAtomicFunctionExpressions.h
gfx/angle/checkout/src/compiler/translator/tree_ops/RewriteStructSamplers.cpp
gfx/angle/checkout/src/compiler/translator/tree_ops/RewriteStructSamplers.h
gfx/angle/checkout/src/compiler/translator/tree_util/BuiltIn_autogen.h
gfx/angle/checkout/src/compiler/translator/tree_util/FindMain.cpp
gfx/angle/checkout/src/compiler/translator/tree_util/FindMain.h
gfx/angle/checkout/src/compiler/translator/tree_util/IntermNode_util.cpp
gfx/angle/checkout/src/compiler/translator/tree_util/IntermTraverse.cpp
gfx/angle/checkout/src/compiler/translator/tree_util/IntermTraverse.h
gfx/angle/checkout/src/compiler/translator/tree_util/ReplaceVariable.cpp
gfx/angle/checkout/src/compiler/translator/tree_util/ReplaceVariable.h
gfx/angle/checkout/src/compiler/translator/tree_util/RunAtTheEndOfShader.cpp
gfx/angle/checkout/src/compiler/translator/tree_util/Visit.h
gfx/angle/checkout/src/compiler/translator/util.cpp
gfx/angle/checkout/src/compiler/translator/util.h
gfx/angle/checkout/src/gpu_info_util/SystemInfo.cpp
gfx/angle/checkout/src/gpu_info_util/SystemInfo.h
gfx/angle/checkout/src/image_util/copyimage.h
gfx/angle/checkout/src/image_util/copyimage.inl
gfx/angle/checkout/src/image_util/imageformats.cpp
gfx/angle/checkout/src/image_util/imageformats.h
gfx/angle/checkout/src/libANGLE/AttributeMap.h
gfx/angle/checkout/src/libANGLE/Buffer.cpp
gfx/angle/checkout/src/libANGLE/Buffer.h
gfx/angle/checkout/src/libANGLE/Caps.cpp
gfx/angle/checkout/src/libANGLE/Caps.h
gfx/angle/checkout/src/libANGLE/Compiler.cpp
gfx/angle/checkout/src/libANGLE/Compiler.h
gfx/angle/checkout/src/libANGLE/Constants.h
gfx/angle/checkout/src/libANGLE/Context.cpp
gfx/angle/checkout/src/libANGLE/Context.h
gfx/angle/checkout/src/libANGLE/ContextState.h
gfx/angle/checkout/src/libANGLE/Context_gles_1_0.cpp
gfx/angle/checkout/src/libANGLE/Context_gles_1_0_autogen.h
gfx/angle/checkout/src/libANGLE/Debug.cpp
gfx/angle/checkout/src/libANGLE/Debug.h
gfx/angle/checkout/src/libANGLE/Device.cpp
gfx/angle/checkout/src/libANGLE/Device.h
gfx/angle/checkout/src/libANGLE/Display.cpp
gfx/angle/checkout/src/libANGLE/Display.h
gfx/angle/checkout/src/libANGLE/Error.cpp
gfx/angle/checkout/src/libANGLE/Error.h
gfx/angle/checkout/src/libANGLE/Error.inl
gfx/angle/checkout/src/libANGLE/ErrorStrings.h
gfx/angle/checkout/src/libANGLE/Fence.cpp
gfx/angle/checkout/src/libANGLE/Fence.h
gfx/angle/checkout/src/libANGLE/Framebuffer.cpp
gfx/angle/checkout/src/libANGLE/Framebuffer.h
gfx/angle/checkout/src/libANGLE/FramebufferAttachment.cpp
gfx/angle/checkout/src/libANGLE/FramebufferAttachment.h
gfx/angle/checkout/src/libANGLE/GLES1Renderer.cpp
gfx/angle/checkout/src/libANGLE/GLES1Renderer.h
gfx/angle/checkout/src/libANGLE/GLES1Shaders.inc
gfx/angle/checkout/src/libANGLE/GLES1State.cpp
gfx/angle/checkout/src/libANGLE/GLES1State.h
gfx/angle/checkout/src/libANGLE/Image.cpp
gfx/angle/checkout/src/libANGLE/Image.h
gfx/angle/checkout/src/libANGLE/ImageIndex.cpp
gfx/angle/checkout/src/libANGLE/ImageIndex.h
gfx/angle/checkout/src/libANGLE/MemoryProgramCache.cpp
gfx/angle/checkout/src/libANGLE/Observer.h
gfx/angle/checkout/src/libANGLE/PackedEGLEnums_autogen.cpp
gfx/angle/checkout/src/libANGLE/PackedEGLEnums_autogen.h
gfx/angle/checkout/src/libANGLE/PackedEnums.cpp
gfx/angle/checkout/src/libANGLE/PackedEnums.h
gfx/angle/checkout/src/libANGLE/PackedGLEnums_autogen.cpp
gfx/angle/checkout/src/libANGLE/PackedGLEnums_autogen.h
gfx/angle/checkout/src/libANGLE/Platform.cpp
gfx/angle/checkout/src/libANGLE/Program.cpp
gfx/angle/checkout/src/libANGLE/Program.h
gfx/angle/checkout/src/libANGLE/ProgramLinkedResources.cpp
gfx/angle/checkout/src/libANGLE/ProgramLinkedResources.h
gfx/angle/checkout/src/libANGLE/Query.cpp
gfx/angle/checkout/src/libANGLE/Query.h
gfx/angle/checkout/src/libANGLE/RefCountObject.h
gfx/angle/checkout/src/libANGLE/Renderbuffer.cpp
gfx/angle/checkout/src/libANGLE/Renderbuffer.h
gfx/angle/checkout/src/libANGLE/ResourceManager.cpp
gfx/angle/checkout/src/libANGLE/ResourceManager.h
gfx/angle/checkout/src/libANGLE/Shader.cpp
gfx/angle/checkout/src/libANGLE/Shader.h
gfx/angle/checkout/src/libANGLE/State.cpp
gfx/angle/checkout/src/libANGLE/State.h
gfx/angle/checkout/src/libANGLE/Stream.cpp
gfx/angle/checkout/src/libANGLE/Stream.h
gfx/angle/checkout/src/libANGLE/Surface.cpp
gfx/angle/checkout/src/libANGLE/Surface.h
gfx/angle/checkout/src/libANGLE/Texture.cpp
gfx/angle/checkout/src/libANGLE/Texture.h
gfx/angle/checkout/src/libANGLE/Thread.cpp
gfx/angle/checkout/src/libANGLE/Thread.h
gfx/angle/checkout/src/libANGLE/TransformFeedback.cpp
gfx/angle/checkout/src/libANGLE/TransformFeedback.h
gfx/angle/checkout/src/libANGLE/Uniform.cpp
gfx/angle/checkout/src/libANGLE/VaryingPacking.cpp
gfx/angle/checkout/src/libANGLE/VaryingPacking.h
gfx/angle/checkout/src/libANGLE/VertexArray.cpp
gfx/angle/checkout/src/libANGLE/VertexArray.h
gfx/angle/checkout/src/libANGLE/VertexAttribute.cpp
gfx/angle/checkout/src/libANGLE/VertexAttribute.h
gfx/angle/checkout/src/libANGLE/WorkerThread.cpp
gfx/angle/checkout/src/libANGLE/WorkerThread.h
gfx/angle/checkout/src/libANGLE/angletypes.cpp
gfx/angle/checkout/src/libANGLE/angletypes.h
gfx/angle/checkout/src/libANGLE/entry_points_enum_autogen.h
gfx/angle/checkout/src/libANGLE/formatutils.cpp
gfx/angle/checkout/src/libANGLE/formatutils.h
gfx/angle/checkout/src/libANGLE/params.cpp
gfx/angle/checkout/src/libANGLE/params.h
gfx/angle/checkout/src/libANGLE/queryconversions.cpp
gfx/angle/checkout/src/libANGLE/queryconversions.h
gfx/angle/checkout/src/libANGLE/queryutils.cpp
gfx/angle/checkout/src/libANGLE/queryutils.h
gfx/angle/checkout/src/libANGLE/renderer/BufferImpl.h
gfx/angle/checkout/src/libANGLE/renderer/ContextImpl.cpp
gfx/angle/checkout/src/libANGLE/renderer/ContextImpl.h
gfx/angle/checkout/src/libANGLE/renderer/DisplayImpl.h
gfx/angle/checkout/src/libANGLE/renderer/EGLImplFactory.h
gfx/angle/checkout/src/libANGLE/renderer/FenceNVImpl.h
gfx/angle/checkout/src/libANGLE/renderer/Format.h
gfx/angle/checkout/src/libANGLE/renderer/FormatID_autogen.inc
gfx/angle/checkout/src/libANGLE/renderer/Format_ID_autogen.inl
gfx/angle/checkout/src/libANGLE/renderer/Format_table_autogen.cpp
gfx/angle/checkout/src/libANGLE/renderer/ImageImpl.h
gfx/angle/checkout/src/libANGLE/renderer/ProgramImpl.h
gfx/angle/checkout/src/libANGLE/renderer/QueryImpl.h
gfx/angle/checkout/src/libANGLE/renderer/ShaderImpl.h
gfx/angle/checkout/src/libANGLE/renderer/SurfaceImpl.cpp
gfx/angle/checkout/src/libANGLE/renderer/SurfaceImpl.h
gfx/angle/checkout/src/libANGLE/renderer/SyncImpl.h
gfx/angle/checkout/src/libANGLE/renderer/TextureImpl.h
gfx/angle/checkout/src/libANGLE/renderer/TransformFeedbackImpl.h
gfx/angle/checkout/src/libANGLE/renderer/VertexArrayImpl.h
gfx/angle/checkout/src/libANGLE/renderer/copyvertex.h
gfx/angle/checkout/src/libANGLE/renderer/copyvertex.inc
gfx/angle/checkout/src/libANGLE/renderer/d3d/BufferD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/ContextD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/DeviceD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/DisplayD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/DisplayD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/DynamicHLSL.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/EGLImageD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/EGLImageD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/FramebufferD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/HLSLCompiler.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/ImageD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/ImageD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/IndexBuffer.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/IndexBuffer.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/IndexDataManager.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/IndexDataManager.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/ProgramD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/ProgramD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/RenderbufferD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/RendererD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/RendererD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/ShaderD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/ShaderD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/SurfaceD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/SwapChainD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/TextureD3D.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/TextureD3D.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/TextureStorage.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexBuffer.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexBuffer.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexDataManager.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/VertexDataManager.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Blit11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Clear11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Context11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Fence11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Image11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Program11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Program11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Query11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Query11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ResourceManager11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ResourceManager11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/StateManager11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TransformFeedback11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/TransformFeedback11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/copyvertex.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/copyvertex.inl
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/dxgi_format_map_autogen.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/formatutils11.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/texture_format_table.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d11/texture_format_table_utils.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Blit9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Context9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Fence9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Fence9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Image9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Image9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Query9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Query9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/Renderer9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/ShaderCache.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/StateManager9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/formatutils9.h
gfx/angle/checkout/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp
gfx/angle/checkout/src/libANGLE/renderer/d3d/formatutilsD3D.h
gfx/angle/checkout/src/libANGLE/renderer/load_functions_table.h
gfx/angle/checkout/src/libANGLE/renderer/load_functions_table_autogen.cpp
gfx/angle/checkout/src/libANGLE/renderer/renderer_utils.cpp
gfx/angle/checkout/src/libANGLE/renderer/renderer_utils.h
gfx/angle/checkout/src/libANGLE/validationEGL.cpp
gfx/angle/checkout/src/libANGLE/validationEGL.h
gfx/angle/checkout/src/libANGLE/validationES.cpp
gfx/angle/checkout/src/libANGLE/validationES.h
gfx/angle/checkout/src/libANGLE/validationES1.cpp
gfx/angle/checkout/src/libANGLE/validationES1.h
gfx/angle/checkout/src/libANGLE/validationES2.cpp
gfx/angle/checkout/src/libANGLE/validationES2.h
gfx/angle/checkout/src/libANGLE/validationES3.cpp
gfx/angle/checkout/src/libANGLE/validationES3.h
gfx/angle/checkout/src/libANGLE/validationES31.cpp
gfx/angle/checkout/src/libANGLE/validationES31.h
gfx/angle/checkout/src/libEGL/libEGL.cpp
gfx/angle/checkout/src/libEGL/libEGL.def
gfx/angle/checkout/src/libGLESv2/entry_points_egl.cpp
gfx/angle/checkout/src/libGLESv2/entry_points_egl.h
gfx/angle/checkout/src/libGLESv2/entry_points_egl_ext.cpp
gfx/angle/checkout/src/libGLESv2/entry_points_egl_ext.h
gfx/angle/checkout/src/libGLESv2/entry_points_gles_1_0_autogen.cpp
gfx/angle/checkout/src/libGLESv2/entry_points_gles_2_0_autogen.cpp
gfx/angle/checkout/src/libGLESv2/entry_points_gles_3_0_autogen.cpp
gfx/angle/checkout/src/libGLESv2/entry_points_gles_3_1_autogen.cpp
gfx/angle/checkout/src/libGLESv2/entry_points_gles_ext_autogen.cpp
gfx/angle/checkout/src/libGLESv2/entry_points_gles_ext_autogen.h
gfx/angle/checkout/src/libGLESv2/global_state.cpp
gfx/angle/checkout/src/libGLESv2/global_state.h
gfx/angle/checkout/src/libGLESv2/libGLESv2_autogen.cpp
gfx/angle/checkout/src/libGLESv2/libGLESv2_autogen.def
gfx/angle/checkout/src/libGLESv2/proc_table_autogen.cpp
gfx/angle/cherry_picks.txt
gfx/angle/targets/angle_common/moz.build
gfx/angle/targets/libANGLE/moz.build
gfx/angle/targets/translator/moz.build
--- a/gfx/angle/checkout/include/EGL/eglext_angle.h
+++ b/gfx/angle/checkout/include/EGL/eglext_angle.h
@@ -77,16 +77,21 @@
 #define EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE 0x33AE
 #endif /* EGL_ANGLE_platform_angle_null */
 
 #ifndef EGL_ANGLE_platform_angle_vulkan
 #define EGL_ANGLE_platform_angle_vulkan 1
 #define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
 #endif /* EGL_ANGLE_platform_angle_vulkan */
 
+#ifndef EGL_ANGLE_platform_angle_context_virtualization
+#define EGL_ANGLE_platform_angle_context_virtualization 1
+#define EGL_PLATFORM_ANGLE_CONTEXT_VIRTUALIZATION_ANGLE 0x3481
+#endif /* EGL_ANGLE_platform_angle_context_virtualization */
+
 #ifndef EGL_ANGLE_x11_visual
 #define EGL_ANGLE_x11_visual
 #define EGL_X11_VISUAL_ID_ANGLE 0x33A3
 #endif /* EGL_ANGLE_x11_visual */
 
 #ifndef EGL_ANGLE_flexible_surface_compatibility
 #define EGL_ANGLE_flexible_surface_compatibility 1
 #define EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE 0x33A6
--- a/gfx/angle/checkout/include/GLES/glext_explicit_context_autogen.inc
+++ b/gfx/angle/checkout/include/GLES/glext_explicit_context_autogen.inc
@@ -252,9 +252,9 @@ GL_API GLbitfield GL_APIENTRY glQueryMat
 GL_API void GL_APIENTRY glRenderbufferStorageOESContextANGLE(GLeglContext ctx, GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
 GL_API void GL_APIENTRY glTexGenfOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfloat param);
 GL_API void GL_APIENTRY glTexGenfvOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, const GLfloat *params);
 GL_API void GL_APIENTRY glTexGeniOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLint param);
 GL_API void GL_APIENTRY glTexGenivOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, const GLint *params);
 GL_API void GL_APIENTRY glTexGenxOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, GLfixed param);
 GL_API void GL_APIENTRY glTexGenxvOESContextANGLE(GLeglContext ctx, GLenum coord, GLenum pname, const GLfixed *params);
 GL_API void GL_APIENTRY glWeightPointerOESContextANGLE(GLeglContext ctx, GLint size, GLenum type, GLsizei stride, const void *pointer);
-#endif
\ No newline at end of file
+#endif
--- a/gfx/angle/checkout/include/GLES2/gl2ext.h
+++ b/gfx/angle/checkout/include/GLES2/gl2ext.h
@@ -1,17 +1,17 @@
-#ifndef __gl2ext_h_
-#define __gl2ext_h_ 1
+#ifndef __gles2_gl2ext_h_
+#define __gles2_gl2ext_h_ 1
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 /*
-** Copyright (c) 2013-2017 The Khronos Group Inc.
+** Copyright (c) 2013-2018 The Khronos Group Inc.
 **
 ** Permission is hereby granted, free of charge, to any person obtaining a
 ** copy of this software and/or associated documentation files (the
 ** "Materials"), to deal in the Materials without restriction, including
 ** without limitation the rights to use, copy, modify, merge, publish,
 ** distribute, sublicense, and/or sell copies of the Materials, and to
 ** permit persons to whom the Materials are furnished to do so, subject to
 ** the following conditions:
@@ -33,17 +33,17 @@ extern "C" {
 ** used to make the header, and the header can be found at
 **   https://github.com/KhronosGroup/OpenGL-Registry
 */
 
 #ifndef GL_APIENTRYP
 #define GL_APIENTRYP GL_APIENTRY*
 #endif
 
-/* Generated on date 20170613 */
+/* Generated on date 20180525 */
 
 /* Generated C header for:
  * API: gles2
  * Profile: common
  * Versions considered: 2\.[0-9]
  * Versions emitted: _nomatch_^
  * Default extensions included: gles2
  * Additional extensions included: _nomatch_^
@@ -154,16 +154,26 @@ GL_APICALL void GL_APIENTRY glGetPointer
 #endif
 #endif /* GL_KHR_debug */
 
 #ifndef GL_KHR_no_error
 #define GL_KHR_no_error 1
 #define GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR  0x00000008
 #endif /* GL_KHR_no_error */
 
+#ifndef GL_KHR_parallel_shader_compile
+#define GL_KHR_parallel_shader_compile 1
+#define GL_MAX_SHADER_COMPILER_THREADS_KHR 0x91B0
+#define GL_COMPLETION_STATUS_KHR          0x91B1
+typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRPROC) (GLuint count);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHR (GLuint count);
+#endif
+#endif /* GL_KHR_parallel_shader_compile */
+
 #ifndef GL_KHR_robust_buffer_access_behavior
 #define GL_KHR_robust_buffer_access_behavior 1
 #endif /* GL_KHR_robust_buffer_access_behavior */
 
 #ifndef GL_KHR_robustness
 #define GL_KHR_robustness 1
 #define GL_CONTEXT_ROBUST_ACCESS_KHR      0x90F3
 #define GL_LOSE_CONTEXT_ON_RESET_KHR      0x8252
@@ -319,22 +329,22 @@ GL_APICALL GLboolean GL_APIENTRY glIsEna
 #endif
 #endif /* GL_OES_draw_buffers_indexed */
 
 #ifndef GL_OES_draw_elements_base_vertex
 #define GL_OES_draw_elements_base_vertex 1
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXOESPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXOESPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXOESPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
+typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexOES (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexOES (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexOES (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
+GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
 #endif
 #endif /* GL_OES_draw_elements_base_vertex */
 
 #ifndef GL_OES_element_index_uint
 #define GL_OES_element_index_uint 1
 #endif /* GL_OES_element_index_uint */
 
 #ifndef GL_OES_fbo_render_mipmap
@@ -1050,16 +1060,26 @@ GL_APICALL void GL_APIENTRY glGetSyncivA
 #define GL_DMP_shader_binary 1
 #define GL_SHADER_BINARY_DMP              0x9250
 #endif /* GL_DMP_shader_binary */
 
 #ifndef GL_EXT_EGL_image_array
 #define GL_EXT_EGL_image_array 1
 #endif /* GL_EXT_EGL_image_array */
 
+#ifndef GL_EXT_EGL_image_storage
+#define GL_EXT_EGL_image_storage 1
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXSTORAGEEXTPROC) (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURESTORAGEEXTPROC) (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glEGLImageTargetTexStorageEXT (GLenum target, GLeglImageOES image, const GLint* attrib_list);
+GL_APICALL void GL_APIENTRY glEGLImageTargetTextureStorageEXT (GLuint texture, GLeglImageOES image, const GLint* attrib_list);
+#endif
+#endif /* GL_EXT_EGL_image_storage */
+
 #ifndef GL_EXT_YUV_target
 #define GL_EXT_YUV_target 1
 #define GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT    0x8BE7
 #endif /* GL_EXT_YUV_target */
 
 #ifndef GL_EXT_base_instance
 #define GL_EXT_base_instance 1
 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEEXTPROC) (GLenum mode, GLint first, GLsizei count, GLsizei instancecount, GLuint baseinstance);
@@ -1121,16 +1141,30 @@ GL_APICALL void GL_APIENTRY glBufferStor
 typedef void (GL_APIENTRYP PFNGLCLEARTEXIMAGEEXTPROC) (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
 typedef void (GL_APIENTRYP PFNGLCLEARTEXSUBIMAGEEXTPROC) (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glClearTexImageEXT (GLuint texture, GLint level, GLenum format, GLenum type, const void *data);
 GL_APICALL void GL_APIENTRY glClearTexSubImageEXT (GLuint texture, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
 #endif
 #endif /* GL_EXT_clear_texture */
 
+#ifndef GL_EXT_clip_control
+#define GL_EXT_clip_control 1
+#define GL_LOWER_LEFT_EXT                 0x8CA1
+#define GL_UPPER_LEFT_EXT                 0x8CA2
+#define GL_NEGATIVE_ONE_TO_ONE_EXT        0x935E
+#define GL_ZERO_TO_ONE_EXT                0x935F
+#define GL_CLIP_ORIGIN_EXT                0x935C
+#define GL_CLIP_DEPTH_MODE_EXT            0x935D
+typedef void (GL_APIENTRYP PFNGLCLIPCONTROLEXTPROC) (GLenum origin, GLenum depth);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glClipControlEXT (GLenum origin, GLenum depth);
+#endif
+#endif /* GL_EXT_clip_control */
+
 #ifndef GL_EXT_clip_cull_distance
 #define GL_EXT_clip_cull_distance 1
 #define GL_MAX_CLIP_DISTANCES_EXT         0x0D32
 #define GL_MAX_CULL_DISTANCES_EXT         0x82F9
 #define GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES_EXT 0x82FA
 #define GL_CLIP_DISTANCE0_EXT             0x3000
 #define GL_CLIP_DISTANCE1_EXT             0x3001
 #define GL_CLIP_DISTANCE2_EXT             0x3002
@@ -1306,22 +1340,20 @@ GL_APICALL GLboolean GL_APIENTRY glIsEna
 #endif
 #endif /* GL_EXT_draw_buffers_indexed */
 
 #ifndef GL_EXT_draw_elements_base_vertex
 #define GL_EXT_draw_elements_base_vertex 1
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 typedef void (GL_APIENTRYP PFNGLDRAWRANGEELEMENTSBASEVERTEXEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSBASEVERTEXEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glDrawElementsBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 GL_APICALL void GL_APIENTRY glDrawRangeElementsBaseVertexEXT (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex);
 GL_APICALL void GL_APIENTRY glDrawElementsInstancedBaseVertexEXT (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex);
-GL_APICALL void GL_APIENTRY glMultiDrawElementsBaseVertexEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount, const GLint *basevertex);
 #endif
 #endif /* GL_EXT_draw_elements_base_vertex */
 
 #ifndef GL_EXT_draw_instanced
 #define GL_EXT_draw_instanced 1
 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount);
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
 #ifdef GL_GLEXT_PROTOTYPES
@@ -1677,16 +1709,18 @@ GL_APICALL void GL_APIENTRY glGetnUnifor
 #define GL_EXT_semaphore 1
 #define GL_LAYOUT_GENERAL_EXT             0x958D
 #define GL_LAYOUT_COLOR_ATTACHMENT_EXT    0x958E
 #define GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT 0x958F
 #define GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT 0x9590
 #define GL_LAYOUT_SHADER_READ_ONLY_EXT    0x9591
 #define GL_LAYOUT_TRANSFER_SRC_EXT        0x9592
 #define GL_LAYOUT_TRANSFER_DST_EXT        0x9593
+#define GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT 0x9530
+#define GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT 0x9531
 typedef void (GL_APIENTRYP PFNGLGENSEMAPHORESEXTPROC) (GLsizei n, GLuint *semaphores);
 typedef void (GL_APIENTRYP PFNGLDELETESEMAPHORESEXTPROC) (GLsizei n, const GLuint *semaphores);
 typedef GLboolean (GL_APIENTRYP PFNGLISSEMAPHOREEXTPROC) (GLuint semaphore);
 typedef void (GL_APIENTRYP PFNGLSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, const GLuint64 *params);
 typedef void (GL_APIENTRYP PFNGLGETSEMAPHOREPARAMETERUI64VEXTPROC) (GLuint semaphore, GLenum pname, GLuint64 *params);
 typedef void (GL_APIENTRYP PFNGLWAITSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *srcLayouts);
 typedef void (GL_APIENTRYP PFNGLSIGNALSEMAPHOREEXTPROC) (GLuint semaphore, GLuint numBufferBarriers, const GLuint *buffers, GLuint numTextureBarriers, const GLuint *textures, const GLenum *dstLayouts);
 #ifdef GL_GLEXT_PROTOTYPES
@@ -1820,16 +1854,24 @@ GL_APICALL void GL_APIENTRY glProgramUni
 #endif
 #endif /* GL_EXT_separate_shader_objects */
 
 #ifndef GL_EXT_shader_framebuffer_fetch
 #define GL_EXT_shader_framebuffer_fetch 1
 #define GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT 0x8A52
 #endif /* GL_EXT_shader_framebuffer_fetch */
 
+#ifndef GL_EXT_shader_framebuffer_fetch_non_coherent
+#define GL_EXT_shader_framebuffer_fetch_non_coherent 1
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIEREXTPROC) (void);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierEXT (void);
+#endif
+#endif /* GL_EXT_shader_framebuffer_fetch_non_coherent */
+
 #ifndef GL_EXT_shader_group_vote
 #define GL_EXT_shader_group_vote 1
 #endif /* GL_EXT_shader_group_vote */
 
 #ifndef GL_EXT_shader_implicit_conversions
 #define GL_EXT_shader_implicit_conversions 1
 #endif /* GL_EXT_shader_implicit_conversions */
 
@@ -2007,28 +2049,52 @@ GL_APICALL void GL_APIENTRY glTexBufferR
 #endif
 #endif /* GL_EXT_texture_buffer */
 
 #ifndef GL_EXT_texture_compression_astc_decode_mode
 #define GL_EXT_texture_compression_astc_decode_mode 1
 #define GL_TEXTURE_ASTC_DECODE_PRECISION_EXT 0x8F69
 #endif /* GL_EXT_texture_compression_astc_decode_mode */
 
+#ifndef GL_EXT_texture_compression_bptc
+#define GL_EXT_texture_compression_bptc 1
+#define GL_COMPRESSED_RGBA_BPTC_UNORM_EXT 0x8E8C
+#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT 0x8E8D
+#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT 0x8E8E
+#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT 0x8E8F
+#endif /* GL_EXT_texture_compression_bptc */
+
 #ifndef GL_EXT_texture_compression_dxt1
 #define GL_EXT_texture_compression_dxt1 1
 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
 #endif /* GL_EXT_texture_compression_dxt1 */
 
+#ifndef GL_EXT_texture_compression_rgtc
+#define GL_EXT_texture_compression_rgtc 1
+#define GL_COMPRESSED_RED_RGTC1_EXT       0x8DBB
+#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC
+#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD
+#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE
+#endif /* GL_EXT_texture_compression_rgtc */
+
 #ifndef GL_EXT_texture_compression_s3tc
 #define GL_EXT_texture_compression_s3tc 1
 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
 #endif /* GL_EXT_texture_compression_s3tc */
 
+#ifndef GL_EXT_texture_compression_s3tc_srgb
+#define GL_EXT_texture_compression_s3tc_srgb 1
+#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT  0x8C4C
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E
+#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F
+#endif /* GL_EXT_texture_compression_s3tc_srgb */
+
 #ifndef GL_EXT_texture_cube_map_array
 #define GL_EXT_texture_cube_map_array 1
 #define GL_TEXTURE_CUBE_MAP_ARRAY_EXT     0x9009
 #define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_EXT 0x900A
 #define GL_SAMPLER_CUBE_MAP_ARRAY_EXT     0x900C
 #define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_EXT 0x900D
 #define GL_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900E
 #define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_EXT 0x900F
@@ -2040,22 +2106,34 @@ GL_APICALL void GL_APIENTRY glTexBufferR
 #ifndef GL_EXT_texture_filter_anisotropic
 #define GL_EXT_texture_filter_anisotropic 1
 #define GL_TEXTURE_MAX_ANISOTROPY_EXT     0x84FE
 #define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
 #endif /* GL_EXT_texture_filter_anisotropic */
 
 #ifndef GL_EXT_texture_filter_minmax
 #define GL_EXT_texture_filter_minmax 1
+#define GL_TEXTURE_REDUCTION_MODE_EXT     0x9366
+#define GL_WEIGHTED_AVERAGE_EXT           0x9367
 #endif /* GL_EXT_texture_filter_minmax */
 
 #ifndef GL_EXT_texture_format_BGRA8888
 #define GL_EXT_texture_format_BGRA8888 1
 #endif /* GL_EXT_texture_format_BGRA8888 */
 
+#ifndef GL_EXT_texture_format_sRGB_override
+#define GL_EXT_texture_format_sRGB_override 1
+#define GL_TEXTURE_FORMAT_SRGB_OVERRIDE_EXT 0x8FBF
+#endif /* GL_EXT_texture_format_sRGB_override */
+
+#ifndef GL_EXT_texture_mirror_clamp_to_edge
+#define GL_EXT_texture_mirror_clamp_to_edge 1
+#define GL_MIRROR_CLAMP_TO_EDGE_EXT       0x8743
+#endif /* GL_EXT_texture_mirror_clamp_to_edge */
+
 #ifndef GL_EXT_texture_norm16
 #define GL_EXT_texture_norm16 1
 #define GL_R16_EXT                        0x822A
 #define GL_RG16_EXT                       0x822C
 #define GL_RGBA16_EXT                     0x805B
 #define GL_RGB16_EXT                      0x8054
 #define GL_RGB16_SNORM_EXT                0x8F9A
 #endif /* GL_EXT_texture_norm16 */
@@ -2248,16 +2326,21 @@ GL_APICALL void GL_APIENTRY glFramebuffe
 
 #ifndef GL_IMG_texture_filter_cubic
 #define GL_IMG_texture_filter_cubic 1
 #define GL_CUBIC_IMG                      0x9139
 #define GL_CUBIC_MIPMAP_NEAREST_IMG       0x913A
 #define GL_CUBIC_MIPMAP_LINEAR_IMG        0x913B
 #endif /* GL_IMG_texture_filter_cubic */
 
+#ifndef GL_INTEL_blackhole_render
+#define GL_INTEL_blackhole_render 1
+#define GL_BLACKHOLE_RENDER_INTEL         0x83FC
+#endif /* GL_INTEL_blackhole_render */
+
 #ifndef GL_INTEL_conservative_rasterization
 #define GL_INTEL_conservative_rasterization 1
 #define GL_CONSERVATIVE_RASTERIZATION_INTEL 0x83FE
 #endif /* GL_INTEL_conservative_rasterization */
 
 #ifndef GL_INTEL_framebuffer_CMAA
 #define GL_INTEL_framebuffer_CMAA 1
 typedef void (GL_APIENTRYP PFNGLAPPLYFRAMEBUFFERATTACHMENTCMAAINTELPROC) (void);
@@ -2290,33 +2373,38 @@ GL_APICALL void GL_APIENTRY glApplyFrame
 #define GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL 0x9500
 typedef void (GL_APIENTRYP PFNGLBEGINPERFQUERYINTELPROC) (GLuint queryHandle);
 typedef void (GL_APIENTRYP PFNGLCREATEPERFQUERYINTELPROC) (GLuint queryId, GLuint *queryHandle);
 typedef void (GL_APIENTRYP PFNGLDELETEPERFQUERYINTELPROC) (GLuint queryHandle);
 typedef void (GL_APIENTRYP PFNGLENDPERFQUERYINTELPROC) (GLuint queryHandle);
 typedef void (GL_APIENTRYP PFNGLGETFIRSTPERFQUERYIDINTELPROC) (GLuint *queryId);
 typedef void (GL_APIENTRYP PFNGLGETNEXTPERFQUERYIDINTELPROC) (GLuint queryId, GLuint *nextQueryId);
 typedef void (GL_APIENTRYP PFNGLGETPERFCOUNTERINFOINTELPROC) (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+typedef void (GL_APIENTRYP PFNGLGETPERFQUERYDATAINTELPROC) (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
 typedef void (GL_APIENTRYP PFNGLGETPERFQUERYIDBYNAMEINTELPROC) (GLchar *queryName, GLuint *queryId);
 typedef void (GL_APIENTRYP PFNGLGETPERFQUERYINFOINTELPROC) (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glBeginPerfQueryINTEL (GLuint queryHandle);
 GL_APICALL void GL_APIENTRY glCreatePerfQueryINTEL (GLuint queryId, GLuint *queryHandle);
 GL_APICALL void GL_APIENTRY glDeletePerfQueryINTEL (GLuint queryHandle);
 GL_APICALL void GL_APIENTRY glEndPerfQueryINTEL (GLuint queryHandle);
 GL_APICALL void GL_APIENTRY glGetFirstPerfQueryIdINTEL (GLuint *queryId);
 GL_APICALL void GL_APIENTRY glGetNextPerfQueryIdINTEL (GLuint queryId, GLuint *nextQueryId);
 GL_APICALL void GL_APIENTRY glGetPerfCounterInfoINTEL (GLuint queryId, GLuint counterId, GLuint counterNameLength, GLchar *counterName, GLuint counterDescLength, GLchar *counterDesc, GLuint *counterOffset, GLuint *counterDataSize, GLuint *counterTypeEnum, GLuint *counterDataTypeEnum, GLuint64 *rawCounterMaxValue);
-GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, GLvoid *data, GLuint *bytesWritten);
+GL_APICALL void GL_APIENTRY glGetPerfQueryDataINTEL (GLuint queryHandle, GLuint flags, GLsizei dataSize, void *data, GLuint *bytesWritten);
 GL_APICALL void GL_APIENTRY glGetPerfQueryIdByNameINTEL (GLchar *queryName, GLuint *queryId);
 GL_APICALL void GL_APIENTRY glGetPerfQueryInfoINTEL (GLuint queryId, GLuint queryNameLength, GLchar *queryName, GLuint *dataSize, GLuint *noCounters, GLuint *noInstances, GLuint *capsMask);
 #endif
 #endif /* GL_INTEL_performance_query */
 
+#ifndef GL_MESA_program_binary_formats
+#define GL_MESA_program_binary_formats 1
+#define GL_PROGRAM_BINARY_FORMAT_MESA     0x875F
+#endif /* GL_MESA_program_binary_formats */
+
 #ifndef GL_MESA_shader_integer_functions
 #define GL_MESA_shader_integer_functions 1
 #endif /* GL_MESA_shader_integer_functions */
 
 #ifndef GL_NVX_blend_equation_advanced_multi_draw_buffers
 #define GL_NVX_blend_equation_advanced_multi_draw_buffers 1
 #endif /* GL_NVX_blend_equation_advanced_multi_draw_buffers */
 
@@ -2411,16 +2499,33 @@ GL_APICALL void GL_APIENTRY glBlendBarri
 #endif
 #endif /* GL_NV_blend_equation_advanced */
 
 #ifndef GL_NV_blend_equation_advanced_coherent
 #define GL_NV_blend_equation_advanced_coherent 1
 #define GL_BLEND_ADVANCED_COHERENT_NV     0x9285
 #endif /* GL_NV_blend_equation_advanced_coherent */
 
+#ifndef GL_NV_blend_minmax_factor
+#define GL_NV_blend_minmax_factor 1
+#define GL_FACTOR_MIN_AMD                 0x901C
+#define GL_FACTOR_MAX_AMD                 0x901D
+#endif /* GL_NV_blend_minmax_factor */
+
+#ifndef GL_NV_clip_space_w_scaling
+#define GL_NV_clip_space_w_scaling 1
+#define GL_VIEWPORT_POSITION_W_SCALE_NV   0x937C
+#define GL_VIEWPORT_POSITION_W_SCALE_X_COEFF_NV 0x937D
+#define GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF_NV 0x937E
+typedef void (GL_APIENTRYP PFNGLVIEWPORTPOSITIONWSCALENVPROC) (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glViewportPositionWScaleNV (GLuint index, GLfloat xcoeff, GLfloat ycoeff);
+#endif
+#endif /* GL_NV_clip_space_w_scaling */
+
 #ifndef GL_NV_conditional_render
 #define GL_NV_conditional_render 1
 #define GL_QUERY_WAIT_NV                  0x8E13
 #define GL_QUERY_NO_WAIT_NV               0x8E14
 #define GL_QUERY_BY_REGION_WAIT_NV        0x8E15
 #define GL_QUERY_BY_REGION_NO_WAIT_NV     0x8E16
 typedef void (GL_APIENTRYP PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode);
 typedef void (GL_APIENTRYP PFNGLENDCONDITIONALRENDERNVPROC) (void);
@@ -2437,16 +2542,21 @@ GL_APICALL void GL_APIENTRY glEndConditi
 #define GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV 0x9348
 #define GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV 0x9349
 typedef void (GL_APIENTRYP PFNGLSUBPIXELPRECISIONBIASNVPROC) (GLuint xbits, GLuint ybits);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glSubpixelPrecisionBiasNV (GLuint xbits, GLuint ybits);
 #endif
 #endif /* GL_NV_conservative_raster */
 
+#ifndef GL_NV_conservative_raster_pre_snap
+#define GL_NV_conservative_raster_pre_snap 1
+#define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV 0x9550
+#endif /* GL_NV_conservative_raster_pre_snap */
+
 #ifndef GL_NV_conservative_raster_pre_snap_triangles
 #define GL_NV_conservative_raster_pre_snap_triangles 1
 #define GL_CONSERVATIVE_RASTER_MODE_NV    0x954D
 #define GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV 0x954E
 #define GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV 0x954F
 typedef void (GL_APIENTRYP PFNGLCONSERVATIVERASTERPARAMETERINVPROC) (GLenum pname, GLint param);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glConservativeRasterParameteriNV (GLenum pname, GLint param);
@@ -2808,16 +2918,17 @@ GL_APICALL void GL_APIENTRY glUniformMat
 GL_APICALL void GL_APIENTRY glUniformMatrix4x2fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
 GL_APICALL void GL_APIENTRY glUniformMatrix3x4fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
 GL_APICALL void GL_APIENTRY glUniformMatrix4x3fvNV (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
 #endif
 #endif /* GL_NV_non_square_matrices */
 
 #ifndef GL_NV_path_rendering
 #define GL_NV_path_rendering 1
+typedef double GLdouble;
 #define GL_PATH_FORMAT_SVG_NV             0x9070
 #define GL_PATH_FORMAT_PS_NV              0x9071
 #define GL_STANDARD_FONT_NAME_NV          0x9072
 #define GL_SYSTEM_FONT_NAME_NV            0x9073
 #define GL_FILE_NAME_NV                   0x9074
 #define GL_PATH_STROKE_WIDTH_NV           0x9075
 #define GL_PATH_END_CAPS_NV               0x9076
 #define GL_PATH_INITIAL_END_CAP_NV        0x9077
@@ -3018,16 +3129,35 @@ typedef void (GL_APIENTRYP PFNGLSTENCILT
 typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHNVPROC) (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
 typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERFILLPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
 typedef void (GL_APIENTRYP PFNGLSTENCILTHENCOVERSTROKEPATHINSTANCEDNVPROC) (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
 typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXRANGENVPROC) (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
 typedef GLenum (GL_APIENTRYP PFNGLPATHGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
 typedef GLenum (GL_APIENTRYP PFNGLPATHMEMORYGLYPHINDEXARRAYNVPROC) (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
 typedef void (GL_APIENTRYP PFNGLPROGRAMPATHFRAGMENTINPUTGENNVPROC) (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
 typedef void (GL_APIENTRYP PFNGLGETPROGRAMRESOURCEFVNVPROC) (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
+typedef void (GL_APIENTRYP PFNGLMATRIXFRUSTUMEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXLOADDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTFEXTPROC) (GLenum mode, const GLfloat *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXMULTDEXTPROC) (GLenum mode, const GLdouble *m);
+typedef void (GL_APIENTRYP PFNGLMATRIXORTHOEXTPROC) (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+typedef void (GL_APIENTRYP PFNGLMATRIXPOPEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXPUSHEXTPROC) (GLenum mode);
+typedef void (GL_APIENTRYP PFNGLMATRIXROTATEFEXTPROC) (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXROTATEDEXTPROC) (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GL_APIENTRYP PFNGLMATRIXSCALEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXSCALEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+typedef void (GL_APIENTRYP PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL GLuint GL_APIENTRY glGenPathsNV (GLsizei range);
 GL_APICALL void GL_APIENTRY glDeletePathsNV (GLuint path, GLsizei range);
 GL_APICALL GLboolean GL_APIENTRY glIsPathNV (GLuint path);
 GL_APICALL void GL_APIENTRY glPathCommandsNV (GLuint path, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
 GL_APICALL void GL_APIENTRY glPathCoordsNV (GLuint path, GLsizei numCoords, GLenum coordType, const void *coords);
 GL_APICALL void GL_APIENTRY glPathSubCommandsNV (GLuint path, GLsizei commandStart, GLsizei commandsToDelete, GLsizei numCommands, const GLubyte *commands, GLsizei numCoords, GLenum coordType, const void *coords);
 GL_APICALL void GL_APIENTRY glPathSubCoordsNV (GLuint path, GLsizei coordStart, GLsizei numCoords, GLenum coordType, const void *coords);
@@ -3076,24 +3206,51 @@ GL_APICALL void GL_APIENTRY glStencilThe
 GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathNV (GLuint path, GLint reference, GLuint mask, GLenum coverMode);
 GL_APICALL void GL_APIENTRY glStencilThenCoverFillPathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLenum fillMode, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
 GL_APICALL void GL_APIENTRY glStencilThenCoverStrokePathInstancedNV (GLsizei numPaths, GLenum pathNameType, const void *paths, GLuint pathBase, GLint reference, GLuint mask, GLenum coverMode, GLenum transformType, const GLfloat *transformValues);
 GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexRangeNV (GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint pathParameterTemplate, GLfloat emScale, GLuint baseAndCount[2]);
 GL_APICALL GLenum GL_APIENTRY glPathGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, const void *fontName, GLbitfield fontStyle, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
 GL_APICALL GLenum GL_APIENTRY glPathMemoryGlyphIndexArrayNV (GLuint firstPathName, GLenum fontTarget, GLsizeiptr fontSize, const void *fontData, GLsizei faceIndex, GLuint firstGlyphIndex, GLsizei numGlyphs, GLuint pathParameterTemplate, GLfloat emScale);
 GL_APICALL void GL_APIENTRY glProgramPathFragmentInputGenNV (GLuint program, GLint location, GLenum genMode, GLint components, const GLfloat *coeffs);
 GL_APICALL void GL_APIENTRY glGetProgramResourcefvNV (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLfloat *params);
+GL_APICALL void GL_APIENTRY glMatrixFrustumEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GL_APICALL void GL_APIENTRY glMatrixLoadIdentityEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixLoadTransposefEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoadTransposedEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixLoadfEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixLoaddEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixMultTransposefEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMultTransposedEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixMultfEXT (GLenum mode, const GLfloat *m);
+GL_APICALL void GL_APIENTRY glMatrixMultdEXT (GLenum mode, const GLdouble *m);
+GL_APICALL void GL_APIENTRY glMatrixOrthoEXT (GLenum mode, GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar);
+GL_APICALL void GL_APIENTRY glMatrixPopEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixPushEXT (GLenum mode);
+GL_APICALL void GL_APIENTRY glMatrixRotatefEXT (GLenum mode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixRotatedEXT (GLenum mode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z);
+GL_APICALL void GL_APIENTRY glMatrixScalefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixScaledEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
+GL_APICALL void GL_APIENTRY glMatrixTranslatefEXT (GLenum mode, GLfloat x, GLfloat y, GLfloat z);
+GL_APICALL void GL_APIENTRY glMatrixTranslatedEXT (GLenum mode, GLdouble x, GLdouble y, GLdouble z);
 #endif
 #endif /* GL_NV_path_rendering */
 
 #ifndef GL_NV_path_rendering_shared_edge
 #define GL_NV_path_rendering_shared_edge 1
 #define GL_SHARED_EDGE_NV                 0xC0
 #endif /* GL_NV_path_rendering_shared_edge */
 
+#ifndef GL_NV_pixel_buffer_object
+#define GL_NV_pixel_buffer_object 1
+#define GL_PIXEL_PACK_BUFFER_NV           0x88EB
+#define GL_PIXEL_UNPACK_BUFFER_NV         0x88EC
+#define GL_PIXEL_PACK_BUFFER_BINDING_NV   0x88ED
+#define GL_PIXEL_UNPACK_BUFFER_BINDING_NV 0x88EF
+#endif /* GL_NV_pixel_buffer_object */
+
 #ifndef GL_NV_polygon_mode
 #define GL_NV_polygon_mode 1
 #define GL_POLYGON_MODE_NV                0x0B40
 #define GL_POLYGON_OFFSET_POINT_NV        0x2A01
 #define GL_POLYGON_OFFSET_LINE_NV         0x2A02
 #define GL_POINT_NV                       0x1B00
 #define GL_LINE_NV                        0x1B01
 #define GL_FILL_NV                        0x1B02
@@ -3179,16 +3336,20 @@ GL_APICALL void GL_APIENTRY glResolveDep
 #define GL_SAMPLER_2D_ARRAY_SHADOW_NV     0x8DC4
 #endif /* GL_NV_shadow_samplers_array */
 
 #ifndef GL_NV_shadow_samplers_cube
 #define GL_NV_shadow_samplers_cube 1
 #define GL_SAMPLER_CUBE_SHADOW_NV         0x8DC5
 #endif /* GL_NV_shadow_samplers_cube */
 
+#ifndef GL_NV_stereo_view_rendering
+#define GL_NV_stereo_view_rendering 1
+#endif /* GL_NV_stereo_view_rendering */
+
 #ifndef GL_NV_texture_border_clamp
 #define GL_NV_texture_border_clamp 1
 #define GL_TEXTURE_BORDER_COLOR_NV        0x1004
 #define GL_CLAMP_TO_BORDER_NV             0x812D
 #endif /* GL_NV_texture_border_clamp */
 
 #ifndef GL_NV_texture_compression_s3tc_update
 #define GL_NV_texture_compression_s3tc_update 1
@@ -3381,16 +3542,29 @@ GL_APICALL void GL_APIENTRY glFramebuffe
 #define GL_QCOM_shader_framebuffer_fetch_noncoherent 1
 #define GL_FRAMEBUFFER_FETCH_NONCOHERENT_QCOM 0x96A2
 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERFETCHBARRIERQCOMPROC) (void);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glFramebufferFetchBarrierQCOM (void);
 #endif
 #endif /* GL_QCOM_shader_framebuffer_fetch_noncoherent */
 
+#ifndef GL_QCOM_texture_foveated
+#define GL_QCOM_texture_foveated 1
+#define GL_TEXTURE_FOVEATED_FEATURE_BITS_QCOM 0x8BFB
+#define GL_TEXTURE_FOVEATED_MIN_PIXEL_DENSITY_QCOM 0x8BFC
+#define GL_TEXTURE_FOVEATED_FEATURE_QUERY_QCOM 0x8BFD
+#define GL_TEXTURE_FOVEATED_NUM_FOCAL_POINTS_QUERY_QCOM 0x8BFE
+#define GL_FRAMEBUFFER_INCOMPLETE_FOVEATION_QCOM 0x8BFF
+typedef void (GL_APIENTRYP PFNGLTEXTUREFOVEATIONPARAMETERSQCOMPROC) (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTextureFoveationParametersQCOM (GLuint texture, GLuint layer, GLuint focalPoint, GLfloat focalX, GLfloat focalY, GLfloat gainX, GLfloat gainY, GLfloat foveaArea);
+#endif
+#endif /* GL_QCOM_texture_foveated */
+
 #ifndef GL_QCOM_tiled_rendering
 #define GL_QCOM_tiled_rendering 1
 #define GL_COLOR_BUFFER_BIT0_QCOM         0x00000001
 #define GL_COLOR_BUFFER_BIT1_QCOM         0x00000002
 #define GL_COLOR_BUFFER_BIT2_QCOM         0x00000004
 #define GL_COLOR_BUFFER_BIT3_QCOM         0x00000008
 #define GL_COLOR_BUFFER_BIT4_QCOM         0x00000010
 #define GL_COLOR_BUFFER_BIT5_QCOM         0x00000020
--- a/gfx/angle/checkout/include/GLES2/gl2ext_angle.h
+++ b/gfx/angle/checkout/include/GLES2/gl2ext_angle.h
@@ -549,11 +549,25 @@ GL_APICALL void GL_APIENTRY glFramebuffe
 #ifndef GL_ANGLE_explicit_context
 #define GL_ANGLE_explicit_context
 typedef void *GLeglContext;
 #include "gl2ext_explicit_context_autogen.inc"
 #include "../GLES3/gl3ext_explicit_context_autogen.inc"
 #include "../GLES3/gl31ext_explicit_context_autogen.inc"
 #endif /* GL_ANGLE_explicit_context */
 
+#ifndef GL_ANGLE_texture_multisample_array
+#define GL_ANGLE_texture_multisample_array 1
+// The enums coincide with the enums from GLES 3.2.
+#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE 0x9102
+#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY_ANGLE 0x9105
+#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY_ANGLE 0x910B
+#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_ANGLE 0x910C
+#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY_ANGLE 0x910D
+typedef void(GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEANGLE)(GLenum target, GLsizei samples, GLint sizedinternalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#ifdef GL_GLEXT_PROTOTYPES
+GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleANGLE(GLenum target, GLsizei samples, GLint sizedinternalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
+#endif
+#endif /* GL_ANGLE_texture_multisample_array */
+
 // clang-format on
 
 #endif  // INCLUDE_GLES2_GL2EXT_ANGLE_H_
--- a/gfx/angle/checkout/include/GLES2/gl2ext_explicit_context_autogen.inc
+++ b/gfx/angle/checkout/include/GLES2/gl2ext_explicit_context_autogen.inc
@@ -163,16 +163,17 @@ typedef void (GL_APIENTRYP PFNGLDISCARDF
 typedef void (GL_APIENTRYP PFNGLDRAWARRAYSINSTANCEDANGLECONTEXTANGLE)(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
 typedef void (GL_APIENTRYP PFNGLDRAWBUFFERSEXTCONTEXTANGLE)(GLeglContext ctx, GLsizei n, const GLenum *bufs);
 typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSINSTANCEDANGLECONTEXTANGLE)(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLeglImageOES image);
 typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLeglImageOES image);
 typedef void (GL_APIENTRYP PFNGLENDQUERYEXTCONTEXTANGLE)(GLeglContext ctx, GLenum target);
 typedef void (GL_APIENTRYP PFNGLFINISHFENCENVCONTEXTANGLE)(GLeglContext ctx, GLuint fence);
 typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length);
+typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREEXTCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level);
 typedef void (GL_APIENTRYP PFNGLGENFENCESNVCONTEXTANGLE)(GLeglContext ctx, GLsizei n, GLuint *fences);
 typedef void (GL_APIENTRYP PFNGLGENQUERIESEXTCONTEXTANGLE)(GLeglContext ctx, GLsizei n, GLuint *ids);
 typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESCONTEXTANGLE)(GLeglContext ctx, GLsizei n, GLuint *arrays);
 typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLenum pname, void **params);
 typedef GLuint (GL_APIENTRYP PFNGLGETDEBUGMESSAGELOGKHRCONTEXTANGLE)(GLeglContext ctx, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
 typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVCONTEXTANGLE)(GLeglContext ctx, GLuint fence, GLenum pname, GLint *params);
 typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTCONTEXTANGLE)(GLeglContext ctx);
 typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRCONTEXTANGLE)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
@@ -188,16 +189,17 @@ typedef void (GL_APIENTRYP PFNGLGETTRANS
 typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTCONTEXTANGLE)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
 typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTCONTEXTANGLE)(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLint *params);
 typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTCONTEXTANGLE)(GLeglContext ctx, GLsizei length, const GLchar *marker);
 typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVCONTEXTANGLE)(GLeglContext ctx, GLuint fence);
 typedef GLboolean (GL_APIENTRYP PFNGLISQUERYEXTCONTEXTANGLE)(GLeglContext ctx, GLuint id);
 typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESCONTEXTANGLE)(GLeglContext ctx, GLuint array);
 typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLenum access);
 typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTCONTEXTANGLE)(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+typedef void (GL_APIENTRYP PFNGLMAXSHADERCOMPILERTHREADSKHRCONTEXTANGLE)(GLeglContext ctx, GLuint count);
 typedef void (GL_APIENTRYP PFNGLOBJECTLABELKHRCONTEXTANGLE)(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
 typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRCONTEXTANGLE)(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label);
 typedef void (GL_APIENTRYP PFNGLPOPDEBUGGROUPKHRCONTEXTANGLE)(GLeglContext ctx);
 typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTCONTEXTANGLE)(GLeglContext ctx);
 typedef void (GL_APIENTRYP PFNGLPROGRAMBINARYOESCONTEXTANGLE)(GLeglContext ctx, GLuint program, GLenum binaryFormat, const void *binary, GLint length);
 typedef void (GL_APIENTRYP PFNGLPUSHDEBUGGROUPKHRCONTEXTANGLE)(GLeglContext ctx, GLenum source, GLuint id, GLsizei length, const GLchar *message);
 typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTCONTEXTANGLE)(GLeglContext ctx, GLsizei length, const GLchar *marker);
 typedef void (GL_APIENTRYP PFNGLQUERYCOUNTEREXTCONTEXTANGLE)(GLeglContext ctx, GLuint id, GLenum target);
@@ -302,16 +304,17 @@ typedef void (GL_APIENTRYP PFNGLSAMPLERP
 typedef void (GL_APIENTRYP PFNGLSAMPLERPARAMETERIUIVROBUSTANGLECONTEXTANGLE)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLuint * param);
 typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIIVROBUSTANGLECONTEXTANGLE)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params);
 typedef void (GL_APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVROBUSTANGLECONTEXTANGLE)(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params);
 typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTIVROBUSTANGLECONTEXTANGLE)(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params);
 typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTI64VROBUSTANGLECONTEXTANGLE)(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * params);
 typedef void (GL_APIENTRYP PFNGLGETQUERYOBJECTUI64VROBUSTANGLECONTEXTANGLE)(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint64 * params);
 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWLAYEREDANGLECONTEXTANGLE)(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
 typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTUREMULTIVIEWSIDEBYSIDEANGLECONTEXTANGLE)(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei numViews, const GLint * viewportOffsets);
+typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DMULTISAMPLEANGLECONTEXTANGLE)(GLeglContext ctx, GLenum target, GLsizei samples, GLint sizedinternalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
 #ifdef GL_GLEXT_PROTOTYPES
 GL_APICALL void GL_APIENTRY glActiveTextureContextANGLE(GLeglContext ctx, GLenum texture);
 GL_APICALL void GL_APIENTRY glAttachShaderContextANGLE(GLeglContext ctx, GLuint program, GLuint shader);
 GL_APICALL void GL_APIENTRY glBindAttribLocationContextANGLE(GLeglContext ctx, GLuint program, GLuint index, const GLchar *name);
 GL_APICALL void GL_APIENTRY glBindBufferContextANGLE(GLeglContext ctx, GLenum target, GLuint buffer);
 GL_APICALL void GL_APIENTRY glBindFramebufferContextANGLE(GLeglContext ctx, GLenum target, GLuint framebuffer);
 GL_APICALL void GL_APIENTRY glBindRenderbufferContextANGLE(GLeglContext ctx, GLenum target, GLuint renderbuffer);
 GL_APICALL void GL_APIENTRY glBindTextureContextANGLE(GLeglContext ctx, GLenum target, GLuint texture);
@@ -463,16 +466,17 @@ GL_APICALL void GL_APIENTRY glDiscardFra
 GL_APICALL void GL_APIENTRY glDrawArraysInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLint first, GLsizei count, GLsizei primcount);
 GL_APICALL void GL_APIENTRY glDrawBuffersEXTContextANGLE(GLeglContext ctx, GLsizei n, const GLenum *bufs);
 GL_APICALL void GL_APIENTRY glDrawElementsInstancedANGLEContextANGLE(GLeglContext ctx, GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount);
 GL_APICALL void GL_APIENTRY glEGLImageTargetRenderbufferStorageOESContextANGLE(GLeglContext ctx, GLenum target, GLeglImageOES image);
 GL_APICALL void GL_APIENTRY glEGLImageTargetTexture2DOESContextANGLE(GLeglContext ctx, GLenum target, GLeglImageOES image);
 GL_APICALL void GL_APIENTRY glEndQueryEXTContextANGLE(GLeglContext ctx, GLenum target);
 GL_APICALL void GL_APIENTRY glFinishFenceNVContextANGLE(GLeglContext ctx, GLuint fence);
 GL_APICALL void GL_APIENTRY glFlushMappedBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length);
+GL_APICALL void GL_APIENTRY glFramebufferTextureEXTContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level);
 GL_APICALL void GL_APIENTRY glGenFencesNVContextANGLE(GLeglContext ctx, GLsizei n, GLuint *fences);
 GL_APICALL void GL_APIENTRY glGenQueriesEXTContextANGLE(GLeglContext ctx, GLsizei n, GLuint *ids);
 GL_APICALL void GL_APIENTRY glGenVertexArraysOESContextANGLE(GLeglContext ctx, GLsizei n, GLuint *arrays);
 GL_APICALL void GL_APIENTRY glGetBufferPointervOESContextANGLE(GLeglContext ctx, GLenum target, GLenum pname, void **params);
 GL_APICALL GLuint GL_APIENTRY glGetDebugMessageLogKHRContextANGLE(GLeglContext ctx, GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog);
 GL_APICALL void GL_APIENTRY glGetFenceivNVContextANGLE(GLeglContext ctx, GLuint fence, GLenum pname, GLint *params);
 GL_APICALL GLenum GL_APIENTRY glGetGraphicsResetStatusEXTContextANGLE(GLeglContext ctx);
 GL_APICALL void GL_APIENTRY glGetObjectLabelKHRContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label);
@@ -488,16 +492,17 @@ GL_APICALL void GL_APIENTRY glGetTransla
 GL_APICALL void GL_APIENTRY glGetnUniformfvEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
 GL_APICALL void GL_APIENTRY glGetnUniformivEXTContextANGLE(GLeglContext ctx, GLuint program, GLint location, GLsizei bufSize, GLint *params);
 GL_APICALL void GL_APIENTRY glInsertEventMarkerEXTContextANGLE(GLeglContext ctx, GLsizei length, const GLchar *marker);
 GL_APICALL GLboolean GL_APIENTRY glIsFenceNVContextANGLE(GLeglContext ctx, GLuint fence);
 GL_APICALL GLboolean GL_APIENTRY glIsQueryEXTContextANGLE(GLeglContext ctx, GLuint id);
 GL_APICALL GLboolean GL_APIENTRY glIsVertexArrayOESContextANGLE(GLeglContext ctx, GLuint array);
 GL_APICALL void *GL_APIENTRY glMapBufferOESContextANGLE(GLeglContext ctx, GLenum target, GLenum access);
 GL_APICALL void *GL_APIENTRY glMapBufferRangeEXTContextANGLE(GLeglContext ctx, GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+GL_APICALL void GL_APIENTRY glMaxShaderCompilerThreadsKHRContextANGLE(GLeglContext ctx, GLuint count);
 GL_APICALL void GL_APIENTRY glObjectLabelKHRContextANGLE(GLeglContext ctx, GLenum identifier, GLuint name, GLsizei length, const GLchar *label);
 GL_APICALL void GL_APIENTRY glObjectPtrLabelKHRContextANGLE(GLeglContext ctx, const void *ptr, GLsizei length, const GLchar *label);
 GL_APICALL void GL_APIENTRY glPopDebugGroupKHRContextANGLE(GLeglContext ctx);
 GL_APICALL void GL_APIENTRY glPopGroupMarkerEXTContextANGLE(GLeglContext ctx);
 GL_APICALL void GL_APIENTRY glProgramBinaryOESContextANGLE(GLeglContext ctx, GLuint program, GLenum binaryFormat, const void *binary, GLint length);
 GL_APICALL void GL_APIENTRY glPushDebugGroupKHRContextANGLE(GLeglContext ctx, GLenum source, GLuint id, GLsizei length, const GLchar *message);
 GL_APICALL void GL_APIENTRY glPushGroupMarkerEXTContextANGLE(GLeglContext ctx, GLsizei length, const GLchar *marker);
 GL_APICALL void GL_APIENTRY glQueryCounterEXTContextANGLE(GLeglContext ctx, GLuint id, GLenum target);
@@ -602,9 +607,10 @@ GL_APICALL void GL_APIENTRY glSamplerPar
 GL_APICALL void GL_APIENTRY glSamplerParameterIuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, const GLuint * param);
 GL_APICALL void GL_APIENTRY glGetSamplerParameterIivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params);
 GL_APICALL void GL_APIENTRY glGetSamplerParameterIuivRobustANGLEContextANGLE(GLeglContext ctx, GLuint sampler, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint * params);
 GL_APICALL void GL_APIENTRY glGetQueryObjectivRobustANGLEContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint * params);
 GL_APICALL void GL_APIENTRY glGetQueryObjecti64vRobustANGLEContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLint64 * params);
 GL_APICALL void GL_APIENTRY glGetQueryObjectui64vRobustANGLEContextANGLE(GLeglContext ctx, GLuint id, GLenum pname, GLsizei bufSize, GLsizei * length, GLuint64 * params);
 GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewLayeredANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews);
 GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewSideBySideANGLEContextANGLE(GLeglContext ctx, GLenum target, GLenum attachment, GLuint texture, GLint level, GLsizei numViews, const GLint * viewportOffsets);
+GL_APICALL void GL_APIENTRY glTexStorage3DMultisampleANGLEContextANGLE(GLeglContext ctx, GLenum target, GLsizei samples, GLint sizedinternalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations);
 #endif
--- a/gfx/angle/checkout/include/GLSLANG/ShaderLang.h
+++ b/gfx/angle/checkout/include/GLSLANG/ShaderLang.h
@@ -20,17 +20,17 @@
 // and the shading language compiler.
 //
 
 // Note: make sure to increment ANGLE_SH_VERSION when changing ShaderVars.h
 #include "ShaderVars.h"
 
 // Version number for shader translation API.
 // It is incremented every time the API changes.
-#define ANGLE_SH_VERSION 197
+#define ANGLE_SH_VERSION 198
 
 enum ShShaderSpec
 {
     SH_GLES2_SPEC,
     SH_WEBGL_SPEC,
 
     SH_GLES3_SPEC,
     SH_WEBGL2_SPEC,
@@ -66,23 +66,23 @@ enum ShShaderOutput
     // Output specialized GLSL to be fed to glslang for Vulkan SPIR.
     SH_GLSL_VULKAN_OUTPUT = 0x8B4B,
 };
 
 // Compile options.
 // The Compile options type is defined in ShaderVars.h, to allow ANGLE to import the ShaderVars
 // header without needing the ShaderLang header. This avoids some conflicts with glslang.
 
-const ShCompileOptions SH_VALIDATE                           = 0;
-const ShCompileOptions SH_VALIDATE_LOOP_INDEXING             = UINT64_C(1) << 0;
-const ShCompileOptions SH_INTERMEDIATE_TREE                  = UINT64_C(1) << 1;
-const ShCompileOptions SH_OBJECT_CODE                        = UINT64_C(1) << 2;
-const ShCompileOptions SH_VARIABLES                          = UINT64_C(1) << 3;
-const ShCompileOptions SH_LINE_DIRECTIVES                    = UINT64_C(1) << 4;
-const ShCompileOptions SH_SOURCE_PATH                        = UINT64_C(1) << 5;
+const ShCompileOptions SH_VALIDATE               = 0;
+const ShCompileOptions SH_VALIDATE_LOOP_INDEXING = UINT64_C(1) << 0;
+const ShCompileOptions SH_INTERMEDIATE_TREE      = UINT64_C(1) << 1;
+const ShCompileOptions SH_OBJECT_CODE            = UINT64_C(1) << 2;
+const ShCompileOptions SH_VARIABLES              = UINT64_C(1) << 3;
+const ShCompileOptions SH_LINE_DIRECTIVES        = UINT64_C(1) << 4;
+const ShCompileOptions SH_SOURCE_PATH            = UINT64_C(1) << 5;
 
 // This flag will keep invariant declaration for input in fragment shader for GLSL >=4.20 on AMD.
 // From GLSL >= 4.20, it's optional to add invariant for fragment input, but GPU vendors have
 // different implementations about this. Some drivers forbid invariant in fragment for GLSL>= 4.20,
 // e.g. Linux Mesa, some drivers treat that as optional, e.g. NVIDIA, some drivers require invariant
 // must match between vertex and fragment shader, e.g. AMD. The behavior on AMD is obviously wrong.
 // Remove invariant for input in fragment shader to workaround the restriction on Intel Mesa.
 // But don't remove on AMD Linux to avoid triggering the bug on AMD.
@@ -308,16 +308,17 @@ struct ShBuiltInResources
     int EXT_shader_texture_lod;
     int WEBGL_debug_shader_precision;
     int EXT_shader_framebuffer_fetch;
     int NV_shader_framebuffer_fetch;
     int ARM_shader_framebuffer_fetch;
     int OVR_multiview;
     int EXT_YUV_target;
     int EXT_geometry_shader;
+    int OES_texture_storage_multisample_2d_array;
 
     // Set to 1 to enable replacing GL_EXT_draw_buffers #extension directives
     // with GL_NV_draw_buffers in ESSL output. This flag can be used to emulate
     // EXT_draw_buffers by using it in combination with GLES3.0 glDrawBuffers
     // function. This applies to Tegra K1 devices.
     int NV_draw_buffers;
 
     // Set to 1 if highp precision is supported in the ESSL 1.00 version of the
@@ -611,9 +612,9 @@ bool HasValidGeometryShaderOutputPrimiti
 bool HasValidGeometryShaderMaxVertices(const ShHandle handle);
 GLenum GetGeometryShaderInputPrimitiveType(const ShHandle handle);
 GLenum GetGeometryShaderOutputPrimitiveType(const ShHandle handle);
 int GetGeometryShaderInvocations(const ShHandle handle);
 int GetGeometryShaderMaxVertices(const ShHandle handle);
 
 }  // namespace sh
 
-#endif // GLSLANG_SHADERLANG_H_
+#endif  // GLSLANG_SHADERLANG_H_
--- a/gfx/angle/checkout/include/platform/Platform.h
+++ b/gfx/angle/checkout/include/platform/Platform.h
@@ -261,17 +261,17 @@ inline void DefaultCacheProgram(Platform
     OP(histogramBoolean, HistogramBoolean)                       \
     OP(overrideWorkaroundsD3D, OverrideWorkaroundsD3D)           \
     OP(cacheProgram, CacheProgram)
 
 #define ANGLE_PLATFORM_METHOD_DEF(Name, CapsName) CapsName##Func Name = Default##CapsName;
 
 struct ANGLE_PLATFORM_EXPORT PlatformMethods
 {
-    PlatformMethods();
+    PlatformMethods() {}
 
     // User data pointer for any implementation specific members. Put it at the start of the
     // platform structure so it doesn't become overwritten if one version of the platform
     // adds or removes new members.
     void *context = 0;
 
     ANGLE_PLATFORM_OP(ANGLE_PLATFORM_METHOD_DEF);
 };
--- a/gfx/angle/checkout/out/gen/angle/id/commit.h
+++ b/gfx/angle/checkout/out/gen/angle/id/commit.h
@@ -1,3 +1,3 @@
-#define ANGLE_COMMIT_HASH "ae3b5a6552ee"
+#define ANGLE_COMMIT_HASH "b46b71ba277b"
 #define ANGLE_COMMIT_HASH_SIZE 12
-#define ANGLE_COMMIT_DATE "2018-07-24 15:21:15 -0700"
+#define ANGLE_COMMIT_DATE "2018-09-18 17:05:34 -0700"
--- a/gfx/angle/checkout/src/common/Color.h
+++ b/gfx/angle/checkout/src/common/Color.h
@@ -4,44 +4,63 @@
 // found in the LICENSE file.
 //
 
 // Color.h : Defines the Color type used throughout the ANGLE libraries
 
 #ifndef COMMON_COLOR_H_
 #define COMMON_COLOR_H_
 
+#include <cstdint>
+
 namespace angle
 {
 
 template <typename T>
 struct Color
 {
     Color();
     Color(T r, T g, T b, T a);
 
     const T *data() const { return &red; }
     T *ptr() { return &red; }
 
+    static Color fromData(const T *data) { return Color(data[0], data[1], data[2], data[3]); }
+    void writeData(T *data) const
+    {
+        data[0] = red;
+        data[1] = green;
+        data[2] = blue;
+        data[3] = alpha;
+    }
+
     T red;
     T green;
     T blue;
     T alpha;
 };
 
 template <typename T>
 bool operator==(const Color<T> &a, const Color<T> &b);
 
 template <typename T>
 bool operator!=(const Color<T> &a, const Color<T> &b);
 
 typedef Color<float> ColorF;
 typedef Color<int> ColorI;
 typedef Color<unsigned int> ColorUI;
 
+struct DepthStencil
+{
+    DepthStencil() : depth(0), stencil(0) {}
+
+    // Double is needed to represent the 32-bit integer range of GL_DEPTH_COMPONENT32.
+    double depth;
+    uint32_t stencil;
+};
 }  // namespace angle
 
 // TODO: Move this fully into the angle namespace
 namespace gl
 {
 
 template <typename T>
 using Color   = angle::Color<T>;
--- a/gfx/angle/checkout/src/common/MemoryBuffer.cpp
+++ b/gfx/angle/checkout/src/common/MemoryBuffer.cpp
@@ -36,17 +36,17 @@ bool MemoryBuffer::resize(size_t size)
     }
 
     if (size == mSize)
     {
         return true;
     }
 
     // Only reallocate if the size has changed.
-    uint8_t *newMemory = reinterpret_cast<uint8_t *>(malloc(sizeof(uint8_t) * size));
+    uint8_t *newMemory = static_cast<uint8_t *>(malloc(sizeof(uint8_t) * size));
     if (newMemory == nullptr)
     {
         return false;
     }
 
     if (mData)
     {
         // Copy the intersection of the old data and the new data
new file mode 100644
--- /dev/null
+++ b/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.cpp
@@ -0,0 +1,134 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json.
+//
+// Copyright 2018 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.
+//
+// PackedEGLEnums_autogen.cpp:
+//   Implements ANGLE-specific enums classes for EGLenums and functions operating
+//   on them.
+
+#include "common/PackedEGLEnums_autogen.h"
+#include "common/debug.h"
+
+namespace egl
+{
+
+template <>
+MessageType FromEGLenum<MessageType>(EGLenum from)
+{
+    switch (from)
+    {
+        case EGL_DEBUG_MSG_CRITICAL_KHR:
+            return MessageType::Critical;
+        case EGL_DEBUG_MSG_ERROR_KHR:
+            return MessageType::Error;
+        case EGL_DEBUG_MSG_WARN_KHR:
+            return MessageType::Warn;
+        case EGL_DEBUG_MSG_INFO_KHR:
+            return MessageType::Info;
+        default:
+            return MessageType::InvalidEnum;
+    }
+}
+
+EGLenum ToEGLenum(MessageType from)
+{
+    switch (from)
+    {
+        case MessageType::Critical:
+            return EGL_DEBUG_MSG_CRITICAL_KHR;
+        case MessageType::Error:
+            return EGL_DEBUG_MSG_ERROR_KHR;
+        case MessageType::Warn:
+            return EGL_DEBUG_MSG_WARN_KHR;
+        case MessageType::Info:
+            return EGL_DEBUG_MSG_INFO_KHR;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+ObjectType FromEGLenum<ObjectType>(EGLenum from)
+{
+    switch (from)
+    {
+        case EGL_OBJECT_THREAD_KHR:
+            return ObjectType::Thread;
+        case EGL_OBJECT_DISPLAY_KHR:
+            return ObjectType::Display;
+        case EGL_OBJECT_CONTEXT_KHR:
+            return ObjectType::Context;
+        case EGL_OBJECT_SURFACE_KHR:
+            return ObjectType::Surface;
+        case EGL_OBJECT_IMAGE_KHR:
+            return ObjectType::Image;
+        case EGL_OBJECT_SYNC_KHR:
+            return ObjectType::Sync;
+        case EGL_OBJECT_STREAM_KHR:
+            return ObjectType::Stream;
+        default:
+            return ObjectType::InvalidEnum;
+    }
+}
+
+EGLenum ToEGLenum(ObjectType from)
+{
+    switch (from)
+    {
+        case ObjectType::Thread:
+            return EGL_OBJECT_THREAD_KHR;
+        case ObjectType::Display:
+            return EGL_OBJECT_DISPLAY_KHR;
+        case ObjectType::Context:
+            return EGL_OBJECT_CONTEXT_KHR;
+        case ObjectType::Surface:
+            return EGL_OBJECT_SURFACE_KHR;
+        case ObjectType::Image:
+            return EGL_OBJECT_IMAGE_KHR;
+        case ObjectType::Sync:
+            return EGL_OBJECT_SYNC_KHR;
+        case ObjectType::Stream:
+            return EGL_OBJECT_STREAM_KHR;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureFormat FromEGLenum<TextureFormat>(EGLenum from)
+{
+    switch (from)
+    {
+        case EGL_NO_TEXTURE:
+            return TextureFormat::NoTexture;
+        case EGL_TEXTURE_RGB:
+            return TextureFormat::RGB;
+        case EGL_TEXTURE_RGBA:
+            return TextureFormat::RGBA;
+        default:
+            return TextureFormat::InvalidEnum;
+    }
+}
+
+EGLenum ToEGLenum(TextureFormat from)
+{
+    switch (from)
+    {
+        case TextureFormat::NoTexture:
+            return EGL_NO_TEXTURE;
+        case TextureFormat::RGB:
+            return EGL_TEXTURE_RGB;
+        case TextureFormat::RGBA:
+            return EGL_TEXTURE_RGBA;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+}  // namespace egl
new file mode 100644
--- /dev/null
+++ b/gfx/angle/checkout/src/common/PackedEGLEnums_autogen.h
@@ -0,0 +1,76 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by gen_packed_gl_enums.py using data from packed_egl_enums.json.
+//
+// Copyright 2018 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.
+//
+// PackedEGLEnums_autogen.h:
+//   Declares ANGLE-specific enums classes for EGLenums and functions operating
+//   on them.
+
+#ifndef COMMON_PACKEDEGLENUMS_AUTOGEN_H_
+#define COMMON_PACKEDEGLENUMS_AUTOGEN_H_
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <angle_gl.h>
+
+#include <cstdint>
+
+namespace egl
+{
+
+template <typename Enum>
+Enum FromEGLenum(EGLenum from);
+
+enum class MessageType : uint8_t
+{
+    Critical = 0,
+    Error    = 1,
+    Warn     = 2,
+    Info     = 3,
+
+    InvalidEnum = 4,
+    EnumCount   = 4,
+};
+
+template <>
+MessageType FromEGLenum<MessageType>(EGLenum from);
+EGLenum ToEGLenum(MessageType from);
+
+enum class ObjectType : uint8_t
+{
+    Thread  = 0,
+    Display = 1,
+    Context = 2,
+    Surface = 3,
+    Image   = 4,
+    Sync    = 5,
+    Stream  = 6,
+
+    InvalidEnum = 7,
+    EnumCount   = 7,
+};
+
+template <>
+ObjectType FromEGLenum<ObjectType>(EGLenum from);
+EGLenum ToEGLenum(ObjectType from);
+
+enum class TextureFormat : uint8_t
+{
+    NoTexture = 0,
+    RGB       = 1,
+    RGBA      = 2,
+
+    InvalidEnum = 3,
+    EnumCount   = 3,
+};
+
+template <>
+TextureFormat FromEGLenum<TextureFormat>(EGLenum from);
+EGLenum ToEGLenum(TextureFormat from);
+
+}  // namespace egl
+
+#endif  // COMMON_PACKEDEGLENUMS_AUTOGEN_H_
new file mode 100644
--- /dev/null
+++ b/gfx/angle/checkout/src/common/PackedEnums.cpp
@@ -0,0 +1,240 @@
+// Copyright 2018 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.
+//
+// PackedGLEnums.cpp:
+//   Declares ANGLE-specific enums classes for GLEnum and functions operating
+//   on them.
+
+#include "common/PackedEnums.h"
+
+#include "common/utilities.h"
+
+namespace gl
+{
+
+TextureType TextureTargetToType(TextureTarget target)
+{
+    switch (target)
+    {
+        case TextureTarget::CubeMapNegativeX:
+        case TextureTarget::CubeMapNegativeY:
+        case TextureTarget::CubeMapNegativeZ:
+        case TextureTarget::CubeMapPositiveX:
+        case TextureTarget::CubeMapPositiveY:
+        case TextureTarget::CubeMapPositiveZ:
+            return TextureType::CubeMap;
+        case TextureTarget::External:
+            return TextureType::External;
+        case TextureTarget::Rectangle:
+            return TextureType::Rectangle;
+        case TextureTarget::_2D:
+            return TextureType::_2D;
+        case TextureTarget::_2DArray:
+            return TextureType::_2DArray;
+        case TextureTarget::_2DMultisample:
+            return TextureType::_2DMultisample;
+        case TextureTarget::_2DMultisampleArray:
+            return TextureType::_2DMultisampleArray;
+        case TextureTarget::_3D:
+            return TextureType::_3D;
+        default:
+            UNREACHABLE();
+            return TextureType::InvalidEnum;
+    }
+}
+
+bool IsCubeMapFaceTarget(TextureTarget target)
+{
+    return TextureTargetToType(target) == TextureType::CubeMap;
+}
+
+TextureTarget NonCubeTextureTypeToTarget(TextureType type)
+{
+    switch (type)
+    {
+        case TextureType::External:
+            return TextureTarget::External;
+        case TextureType::Rectangle:
+            return TextureTarget::Rectangle;
+        case TextureType::_2D:
+            return TextureTarget::_2D;
+        case TextureType::_2DArray:
+            return TextureTarget::_2DArray;
+        case TextureType::_2DMultisample:
+            return TextureTarget::_2DMultisample;
+        case TextureType::_2DMultisampleArray:
+            return TextureTarget::_2DMultisampleArray;
+        case TextureType::_3D:
+            return TextureTarget::_3D;
+        default:
+            UNREACHABLE();
+            return TextureTarget::InvalidEnum;
+    }
+}
+
+// Check that we can do arithmetic on TextureTarget to convert from / to cube map faces
+static_assert(static_cast<uint8_t>(TextureTarget::CubeMapNegativeX) -
+                      static_cast<uint8_t>(TextureTarget::CubeMapPositiveX) ==
+                  1u,
+              "");
+static_assert(static_cast<uint8_t>(TextureTarget::CubeMapPositiveY) -
+                      static_cast<uint8_t>(TextureTarget::CubeMapPositiveX) ==
+                  2u,
+              "");
+static_assert(static_cast<uint8_t>(TextureTarget::CubeMapNegativeY) -
+                      static_cast<uint8_t>(TextureTarget::CubeMapPositiveX) ==
+                  3u,
+              "");
+static_assert(static_cast<uint8_t>(TextureTarget::CubeMapPositiveZ) -
+                      static_cast<uint8_t>(TextureTarget::CubeMapPositiveX) ==
+                  4u,
+              "");
+static_assert(static_cast<uint8_t>(TextureTarget::CubeMapNegativeZ) -
+                      static_cast<uint8_t>(TextureTarget::CubeMapPositiveX) ==
+                  5u,
+              "");
+
+TextureTarget CubeFaceIndexToTextureTarget(size_t face)
+{
+    ASSERT(face < 6u);
+    return static_cast<TextureTarget>(static_cast<uint8_t>(TextureTarget::CubeMapPositiveX) + face);
+}
+
+size_t CubeMapTextureTargetToFaceIndex(TextureTarget target)
+{
+    ASSERT(IsCubeMapFaceTarget(target));
+    return static_cast<uint8_t>(target) - static_cast<uint8_t>(TextureTarget::CubeMapPositiveX);
+}
+
+TextureType SamplerTypeToTextureType(GLenum samplerType)
+{
+    switch (samplerType)
+    {
+        case GL_SAMPLER_2D:
+        case GL_INT_SAMPLER_2D:
+        case GL_UNSIGNED_INT_SAMPLER_2D:
+        case GL_SAMPLER_2D_SHADOW:
+            return TextureType::_2D;
+
+        case GL_SAMPLER_EXTERNAL_OES:
+            return TextureType::External;
+
+        case GL_SAMPLER_CUBE:
+        case GL_INT_SAMPLER_CUBE:
+        case GL_UNSIGNED_INT_SAMPLER_CUBE:
+        case GL_SAMPLER_CUBE_SHADOW:
+            return TextureType::CubeMap;
+
+        case GL_SAMPLER_2D_ARRAY:
+        case GL_INT_SAMPLER_2D_ARRAY:
+        case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+        case GL_SAMPLER_2D_ARRAY_SHADOW:
+            return TextureType::_2DArray;
+
+        case GL_SAMPLER_3D:
+        case GL_INT_SAMPLER_3D:
+        case GL_UNSIGNED_INT_SAMPLER_3D:
+            return TextureType::_3D;
+
+        case GL_SAMPLER_2D_MULTISAMPLE:
+        case GL_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+            return TextureType::_2DMultisample;
+
+        case GL_SAMPLER_2D_RECT_ANGLE:
+            return TextureType::Rectangle;
+
+        default:
+            UNREACHABLE();
+            return TextureType::InvalidEnum;
+    }
+}
+
+}  // namespace gl
+
+namespace egl
+{
+MessageType ErrorCodeToMessageType(EGLint errorCode)
+{
+    switch (errorCode)
+    {
+        case EGL_BAD_ALLOC:
+        case EGL_CONTEXT_LOST:
+        case EGL_NOT_INITIALIZED:
+            return MessageType::Critical;
+
+        case EGL_BAD_ACCESS:
+        case EGL_BAD_ATTRIBUTE:
+        case EGL_BAD_CONFIG:
+        case EGL_BAD_CONTEXT:
+        case EGL_BAD_CURRENT_SURFACE:
+        case EGL_BAD_DISPLAY:
+        case EGL_BAD_MATCH:
+        case EGL_BAD_NATIVE_PIXMAP:
+        case EGL_BAD_NATIVE_WINDOW:
+        case EGL_BAD_PARAMETER:
+        case EGL_BAD_SURFACE:
+        case EGL_BAD_STREAM_KHR:
+        case EGL_BAD_STATE_KHR:
+        case EGL_BAD_DEVICE_EXT:
+            return MessageType::Error;
+
+        case EGL_SUCCESS:
+        default:
+            UNREACHABLE();
+            return MessageType::InvalidEnum;
+    }
+}
+}  // namespace egl
+
+namespace egl_gl
+{
+
+gl::TextureTarget EGLCubeMapTargetToCubeMapTarget(EGLenum eglTarget)
+{
+    ASSERT(egl::IsCubeMapTextureTarget(eglTarget));
+    return gl::CubeFaceIndexToTextureTarget(egl::CubeMapTextureTargetToLayerIndex(eglTarget));
+}
+
+gl::TextureTarget EGLImageTargetToTextureTarget(EGLenum eglTarget)
+{
+    switch (eglTarget)
+    {
+        case EGL_GL_TEXTURE_2D_KHR:
+            return gl::TextureTarget::_2D;
+
+        case EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR:
+        case EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR:
+        case EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR:
+        case EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR:
+        case EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR:
+        case EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR:
+            return EGLCubeMapTargetToCubeMapTarget(eglTarget);
+
+        case EGL_GL_TEXTURE_3D_KHR:
+            return gl::TextureTarget::_3D;
+
+        default:
+            UNREACHABLE();
+            return gl::TextureTarget::InvalidEnum;
+    }
+}
+
+gl::TextureType EGLTextureTargetToTextureType(EGLenum eglTarget)
+{
+    switch (eglTarget)
+    {
+        case EGL_TEXTURE_2D:
+            return gl::TextureType::_2D;
+
+        case EGL_TEXTURE_RECTANGLE_ANGLE:
+            return gl::TextureType::Rectangle;
+
+        default:
+            UNREACHABLE();
+            return gl::TextureType::InvalidEnum;
+    }
+}
+
+}  // namespace egl_gl
new file mode 100644
--- /dev/null
+++ b/gfx/angle/checkout/src/common/PackedEnums.h
@@ -0,0 +1,204 @@
+// Copyright 2017 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.
+//
+// PackedGLEnums_autogen.h:
+//   Declares ANGLE-specific enums classes for GLEnum and functions operating
+//   on them.
+
+#ifndef COMMON_PACKEDGLENUMS_H_
+#define COMMON_PACKEDGLENUMS_H_
+
+#include "common/PackedEGLEnums_autogen.h"
+#include "common/PackedGLEnums_autogen.h"
+
+#include <array>
+#include <bitset>
+#include <cstddef>
+
+#include <EGL/egl.h>
+
+#include "common/bitset_utils.h"
+
+namespace angle
+{
+
+// Return the number of elements of a packed enum, including the InvalidEnum element.
+template <typename E>
+constexpr size_t EnumSize()
+{
+    using UnderlyingType = typename std::underlying_type<E>::type;
+    return static_cast<UnderlyingType>(E::EnumCount);
+}
+
+// Implementation of AllEnums which allows iterating over all the possible values for a packed enums
+// like so:
+//     for (auto value : AllEnums<MyPackedEnum>()) {
+//         // Do something with the enum.
+//     }
+
+template <typename E>
+class EnumIterator final
+{
+  private:
+    using UnderlyingType = typename std::underlying_type<E>::type;
+
+  public:
+    EnumIterator(E value) : mValue(static_cast<UnderlyingType>(value)) {}
+    EnumIterator &operator++()
+    {
+        mValue++;
+        return *this;
+    }
+    bool operator==(const EnumIterator &other) const { return mValue == other.mValue; }
+    bool operator!=(const EnumIterator &other) const { return mValue != other.mValue; }
+    E operator*() const { return static_cast<E>(mValue); }
+
+  private:
+    UnderlyingType mValue;
+};
+
+template <typename E>
+struct AllEnums
+{
+    EnumIterator<E> begin() const { return {static_cast<E>(0)}; }
+    EnumIterator<E> end() const { return {E::InvalidEnum}; }
+};
+
+// PackedEnumMap<E, T> is like an std::array<T, E::EnumCount> but is indexed with enum values. It
+// implements all of the std::array interface except with enum values instead of indices.
+template <typename E, typename T>
+class PackedEnumMap
+{
+    using UnderlyingType = typename std::underlying_type<E>::type;
+    using Storage        = std::array<T, EnumSize<E>()>;
+
+  public:
+    // types:
+    using value_type      = T;
+    using pointer         = T *;
+    using const_pointer   = const T *;
+    using reference       = T &;
+    using const_reference = const T &;
+
+    using size_type       = size_t;
+    using difference_type = ptrdiff_t;
+
+    using iterator               = typename Storage::iterator;
+    using const_iterator         = typename Storage::const_iterator;
+    using reverse_iterator       = std::reverse_iterator<iterator>;
+    using const_reverse_iterator = std::reverse_iterator<const_iterator>;
+
+    // No explicit construct/copy/destroy for aggregate type
+    void fill(const T &u) { mPrivateData.fill(u); }
+    void swap(PackedEnumMap<E, T> &a) noexcept { mPrivateData.swap(a.mPrivateData); }
+
+    // iterators:
+    iterator begin() noexcept { return mPrivateData.begin(); }
+    const_iterator begin() const noexcept { return mPrivateData.begin(); }
+    iterator end() noexcept { return mPrivateData.end(); }
+    const_iterator end() const noexcept { return mPrivateData.end(); }
+
+    reverse_iterator rbegin() noexcept { return mPrivateData.rbegin(); }
+    const_reverse_iterator rbegin() const noexcept { return mPrivateData.rbegin(); }
+    reverse_iterator rend() noexcept { return mPrivateData.rend(); }
+    const_reverse_iterator rend() const noexcept { return mPrivateData.rend(); }
+
+    // capacity:
+    constexpr size_type size() const noexcept { return mPrivateData.size(); }
+    constexpr size_type max_size() const noexcept { return mPrivateData.max_size(); }
+    constexpr bool empty() const noexcept { return mPrivateData.empty(); }
+
+    // element access:
+    reference operator[](E n) { return mPrivateData[static_cast<UnderlyingType>(n)]; }
+    const_reference operator[](E n) const { return mPrivateData[static_cast<UnderlyingType>(n)]; }
+    const_reference at(E n) const { return mPrivateData.at(static_cast<UnderlyingType>(n)); }
+    reference at(E n) { return mPrivateData.at(static_cast<UnderlyingType>(n)); }
+
+    reference front() { return mPrivateData.front(); }
+    const_reference front() const { return mPrivateData.front(); }
+    reference back() { return mPrivateData.back(); }
+    const_reference back() const { return mPrivateData.back(); }
+
+    T *data() noexcept { return mPrivateData.data(); }
+    const T *data() const noexcept { return mPrivateData.data(); }
+
+    // Do not access this variable directly. It unfortunately must be public to use aggregate init.
+    /* private: */ Storage mPrivateData;
+};
+
+// PackedEnumBitSetE> is like an std::bitset<E::EnumCount> but is indexed with enum values. It
+// implements the std::bitset interface except with enum values instead of indices.
+template <typename E, typename DataT = uint32_t>
+using PackedEnumBitSet = BitSetT<EnumSize<E>(), DataT, E>;
+
+}  // namespace angle
+
+namespace gl
+{
+
+TextureType TextureTargetToType(TextureTarget target);
+TextureTarget NonCubeTextureTypeToTarget(TextureType type);
+
+TextureTarget CubeFaceIndexToTextureTarget(size_t face);
+size_t CubeMapTextureTargetToFaceIndex(TextureTarget target);
+bool IsCubeMapFaceTarget(TextureTarget target);
+
+constexpr TextureTarget kCubeMapTextureTargetMin = TextureTarget::CubeMapPositiveX;
+constexpr TextureTarget kCubeMapTextureTargetMax = TextureTarget::CubeMapNegativeZ;
+constexpr TextureTarget kAfterCubeMapTextureTargetMax =
+    static_cast<TextureTarget>(static_cast<uint8_t>(kCubeMapTextureTargetMax) + 1);
+struct AllCubeFaceTextureTargets
+{
+    angle::EnumIterator<TextureTarget> begin() const { return kCubeMapTextureTargetMin; }
+    angle::EnumIterator<TextureTarget> end() const { return kAfterCubeMapTextureTargetMax; }
+};
+
+constexpr ShaderType kGLES2ShaderTypeMin = ShaderType::Vertex;
+constexpr ShaderType kGLES2ShaderTypeMax = ShaderType::Fragment;
+constexpr ShaderType kAfterGLES2ShaderTypeMax =
+    static_cast<ShaderType>(static_cast<uint8_t>(kGLES2ShaderTypeMax) + 1);
+struct AllGLES2ShaderTypes
+{
+    angle::EnumIterator<ShaderType> begin() const { return kGLES2ShaderTypeMin; }
+    angle::EnumIterator<ShaderType> end() const { return kAfterGLES2ShaderTypeMax; }
+};
+
+constexpr ShaderType kShaderTypeMin = ShaderType::Vertex;
+constexpr ShaderType kShaderTypeMax = ShaderType::Compute;
+constexpr ShaderType kAfterShaderTypeMax =
+    static_cast<ShaderType>(static_cast<uint8_t>(kShaderTypeMax) + 1);
+struct AllShaderTypes
+{
+    angle::EnumIterator<ShaderType> begin() const { return kShaderTypeMin; }
+    angle::EnumIterator<ShaderType> end() const { return kAfterShaderTypeMax; }
+};
+
+constexpr size_t kGraphicsShaderCount = static_cast<size_t>(ShaderType::EnumCount) - 1u;
+// Arrange the shader types in the order of rendering pipeline
+constexpr std::array<ShaderType, kGraphicsShaderCount> kAllGraphicsShaderTypes = {
+    ShaderType::Vertex, ShaderType::Geometry, ShaderType::Fragment};
+
+using ShaderBitSet = angle::PackedEnumBitSet<ShaderType, uint8_t>;
+static_assert(sizeof(ShaderBitSet) == sizeof(uint8_t), "Unexpected size");
+
+template <typename T>
+using ShaderMap = angle::PackedEnumMap<ShaderType, T>;
+
+TextureType SamplerTypeToTextureType(GLenum samplerType);
+
+}  // namespace gl
+
+namespace egl
+{
+MessageType ErrorCodeToMessageType(EGLint errorCode);
+}  // namespace egl
+
+namespace egl_gl
+{
+gl::TextureTarget EGLCubeMapTargetToCubeMapTarget(EGLenum eglTarget);
+gl::TextureTarget EGLImageTargetToTextureTarget(EGLenum eglTarget);
+gl::TextureType EGLTextureTargetToTextureType(EGLenum eglTarget);
+}  // namespace egl_gl
+
+#endif  // COMMON_PACKEDGLENUMS_H_
new file mode 100644
--- /dev/null
+++ b/gfx/angle/checkout/src/common/PackedGLEnums_autogen.cpp
@@ -0,0 +1,1222 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
+//
+// Copyright 2018 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.
+//
+// PackedGLEnums_autogen.cpp:
+//   Implements ANGLE-specific enums classes for GLenums and functions operating
+//   on them.
+
+#include "common/PackedGLEnums_autogen.h"
+#include "common/debug.h"
+
+namespace gl
+{
+
+template <>
+AlphaTestFunc FromGLenum<AlphaTestFunc>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_ALWAYS:
+            return AlphaTestFunc::AlwaysPass;
+        case GL_EQUAL:
+            return AlphaTestFunc::Equal;
+        case GL_GEQUAL:
+            return AlphaTestFunc::Gequal;
+        case GL_GREATER:
+            return AlphaTestFunc::Greater;
+        case GL_LEQUAL:
+            return AlphaTestFunc::Lequal;
+        case GL_LESS:
+            return AlphaTestFunc::Less;
+        case GL_NEVER:
+            return AlphaTestFunc::Never;
+        case GL_NOTEQUAL:
+            return AlphaTestFunc::NotEqual;
+        default:
+            return AlphaTestFunc::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(AlphaTestFunc from)
+{
+    switch (from)
+    {
+        case AlphaTestFunc::AlwaysPass:
+            return GL_ALWAYS;
+        case AlphaTestFunc::Equal:
+            return GL_EQUAL;
+        case AlphaTestFunc::Gequal:
+            return GL_GEQUAL;
+        case AlphaTestFunc::Greater:
+            return GL_GREATER;
+        case AlphaTestFunc::Lequal:
+            return GL_LEQUAL;
+        case AlphaTestFunc::Less:
+            return GL_LESS;
+        case AlphaTestFunc::Never:
+            return GL_NEVER;
+        case AlphaTestFunc::NotEqual:
+            return GL_NOTEQUAL;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+BufferBinding FromGLenum<BufferBinding>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_ARRAY_BUFFER:
+            return BufferBinding::Array;
+        case GL_ATOMIC_COUNTER_BUFFER:
+            return BufferBinding::AtomicCounter;
+        case GL_COPY_READ_BUFFER:
+            return BufferBinding::CopyRead;
+        case GL_COPY_WRITE_BUFFER:
+            return BufferBinding::CopyWrite;
+        case GL_DISPATCH_INDIRECT_BUFFER:
+            return BufferBinding::DispatchIndirect;
+        case GL_DRAW_INDIRECT_BUFFER:
+            return BufferBinding::DrawIndirect;
+        case GL_ELEMENT_ARRAY_BUFFER:
+            return BufferBinding::ElementArray;
+        case GL_PIXEL_PACK_BUFFER:
+            return BufferBinding::PixelPack;
+        case GL_PIXEL_UNPACK_BUFFER:
+            return BufferBinding::PixelUnpack;
+        case GL_SHADER_STORAGE_BUFFER:
+            return BufferBinding::ShaderStorage;
+        case GL_TRANSFORM_FEEDBACK_BUFFER:
+            return BufferBinding::TransformFeedback;
+        case GL_UNIFORM_BUFFER:
+            return BufferBinding::Uniform;
+        default:
+            return BufferBinding::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(BufferBinding from)
+{
+    switch (from)
+    {
+        case BufferBinding::Array:
+            return GL_ARRAY_BUFFER;
+        case BufferBinding::AtomicCounter:
+            return GL_ATOMIC_COUNTER_BUFFER;
+        case BufferBinding::CopyRead:
+            return GL_COPY_READ_BUFFER;
+        case BufferBinding::CopyWrite:
+            return GL_COPY_WRITE_BUFFER;
+        case BufferBinding::DispatchIndirect:
+            return GL_DISPATCH_INDIRECT_BUFFER;
+        case BufferBinding::DrawIndirect:
+            return GL_DRAW_INDIRECT_BUFFER;
+        case BufferBinding::ElementArray:
+            return GL_ELEMENT_ARRAY_BUFFER;
+        case BufferBinding::PixelPack:
+            return GL_PIXEL_PACK_BUFFER;
+        case BufferBinding::PixelUnpack:
+            return GL_PIXEL_UNPACK_BUFFER;
+        case BufferBinding::ShaderStorage:
+            return GL_SHADER_STORAGE_BUFFER;
+        case BufferBinding::TransformFeedback:
+            return GL_TRANSFORM_FEEDBACK_BUFFER;
+        case BufferBinding::Uniform:
+            return GL_UNIFORM_BUFFER;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+BufferUsage FromGLenum<BufferUsage>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_DYNAMIC_COPY:
+            return BufferUsage::DynamicCopy;
+        case GL_DYNAMIC_DRAW:
+            return BufferUsage::DynamicDraw;
+        case GL_DYNAMIC_READ:
+            return BufferUsage::DynamicRead;
+        case GL_STATIC_COPY:
+            return BufferUsage::StaticCopy;
+        case GL_STATIC_DRAW:
+            return BufferUsage::StaticDraw;
+        case GL_STATIC_READ:
+            return BufferUsage::StaticRead;
+        case GL_STREAM_COPY:
+            return BufferUsage::StreamCopy;
+        case GL_STREAM_DRAW:
+            return BufferUsage::StreamDraw;
+        case GL_STREAM_READ:
+            return BufferUsage::StreamRead;
+        default:
+            return BufferUsage::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(BufferUsage from)
+{
+    switch (from)
+    {
+        case BufferUsage::DynamicCopy:
+            return GL_DYNAMIC_COPY;
+        case BufferUsage::DynamicDraw:
+            return GL_DYNAMIC_DRAW;
+        case BufferUsage::DynamicRead:
+            return GL_DYNAMIC_READ;
+        case BufferUsage::StaticCopy:
+            return GL_STATIC_COPY;
+        case BufferUsage::StaticDraw:
+            return GL_STATIC_DRAW;
+        case BufferUsage::StaticRead:
+            return GL_STATIC_READ;
+        case BufferUsage::StreamCopy:
+            return GL_STREAM_COPY;
+        case BufferUsage::StreamDraw:
+            return GL_STREAM_DRAW;
+        case BufferUsage::StreamRead:
+            return GL_STREAM_READ;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+ClientVertexArrayType FromGLenum<ClientVertexArrayType>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_COLOR_ARRAY:
+            return ClientVertexArrayType::Color;
+        case GL_NORMAL_ARRAY:
+            return ClientVertexArrayType::Normal;
+        case GL_POINT_SIZE_ARRAY_OES:
+            return ClientVertexArrayType::PointSize;
+        case GL_TEXTURE_COORD_ARRAY:
+            return ClientVertexArrayType::TextureCoord;
+        case GL_VERTEX_ARRAY:
+            return ClientVertexArrayType::Vertex;
+        default:
+            return ClientVertexArrayType::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(ClientVertexArrayType from)
+{
+    switch (from)
+    {
+        case ClientVertexArrayType::Color:
+            return GL_COLOR_ARRAY;
+        case ClientVertexArrayType::Normal:
+            return GL_NORMAL_ARRAY;
+        case ClientVertexArrayType::PointSize:
+            return GL_POINT_SIZE_ARRAY_OES;
+        case ClientVertexArrayType::TextureCoord:
+            return GL_TEXTURE_COORD_ARRAY;
+        case ClientVertexArrayType::Vertex:
+            return GL_VERTEX_ARRAY;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+CullFaceMode FromGLenum<CullFaceMode>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_BACK:
+            return CullFaceMode::Back;
+        case GL_FRONT:
+            return CullFaceMode::Front;
+        case GL_FRONT_AND_BACK:
+            return CullFaceMode::FrontAndBack;
+        default:
+            return CullFaceMode::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(CullFaceMode from)
+{
+    switch (from)
+    {
+        case CullFaceMode::Back:
+            return GL_BACK;
+        case CullFaceMode::Front:
+            return GL_FRONT;
+        case CullFaceMode::FrontAndBack:
+            return GL_FRONT_AND_BACK;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+FogMode FromGLenum<FogMode>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_EXP:
+            return FogMode::Exp;
+        case GL_EXP2:
+            return FogMode::Exp2;
+        case GL_LINEAR:
+            return FogMode::Linear;
+        default:
+            return FogMode::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(FogMode from)
+{
+    switch (from)
+    {
+        case FogMode::Exp:
+            return GL_EXP;
+        case FogMode::Exp2:
+            return GL_EXP2;
+        case FogMode::Linear:
+            return GL_LINEAR;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+HintSetting FromGLenum<HintSetting>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_DONT_CARE:
+            return HintSetting::DontCare;
+        case GL_FASTEST:
+            return HintSetting::Fastest;
+        case GL_NICEST:
+            return HintSetting::Nicest;
+        default:
+            return HintSetting::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(HintSetting from)
+{
+    switch (from)
+    {
+        case HintSetting::DontCare:
+            return GL_DONT_CARE;
+        case HintSetting::Fastest:
+            return GL_FASTEST;
+        case HintSetting::Nicest:
+            return GL_NICEST;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+LightParameter FromGLenum<LightParameter>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_AMBIENT:
+            return LightParameter::Ambient;
+        case GL_AMBIENT_AND_DIFFUSE:
+            return LightParameter::AmbientAndDiffuse;
+        case GL_CONSTANT_ATTENUATION:
+            return LightParameter::ConstantAttenuation;
+        case GL_DIFFUSE:
+            return LightParameter::Diffuse;
+        case GL_LINEAR_ATTENUATION:
+            return LightParameter::LinearAttenuation;
+        case GL_POSITION:
+            return LightParameter::Position;
+        case GL_QUADRATIC_ATTENUATION:
+            return LightParameter::QuadraticAttenuation;
+        case GL_SPECULAR:
+            return LightParameter::Specular;
+        case GL_SPOT_CUTOFF:
+            return LightParameter::SpotCutoff;
+        case GL_SPOT_DIRECTION:
+            return LightParameter::SpotDirection;
+        case GL_SPOT_EXPONENT:
+            return LightParameter::SpotExponent;
+        default:
+            return LightParameter::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(LightParameter from)
+{
+    switch (from)
+    {
+        case LightParameter::Ambient:
+            return GL_AMBIENT;
+        case LightParameter::AmbientAndDiffuse:
+            return GL_AMBIENT_AND_DIFFUSE;
+        case LightParameter::ConstantAttenuation:
+            return GL_CONSTANT_ATTENUATION;
+        case LightParameter::Diffuse:
+            return GL_DIFFUSE;
+        case LightParameter::LinearAttenuation:
+            return GL_LINEAR_ATTENUATION;
+        case LightParameter::Position:
+            return GL_POSITION;
+        case LightParameter::QuadraticAttenuation:
+            return GL_QUADRATIC_ATTENUATION;
+        case LightParameter::Specular:
+            return GL_SPECULAR;
+        case LightParameter::SpotCutoff:
+            return GL_SPOT_CUTOFF;
+        case LightParameter::SpotDirection:
+            return GL_SPOT_DIRECTION;
+        case LightParameter::SpotExponent:
+            return GL_SPOT_EXPONENT;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+LogicalOperation FromGLenum<LogicalOperation>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_AND:
+            return LogicalOperation::And;
+        case GL_AND_INVERTED:
+            return LogicalOperation::AndInverted;
+        case GL_AND_REVERSE:
+            return LogicalOperation::AndReverse;
+        case GL_CLEAR:
+            return LogicalOperation::Clear;
+        case GL_COPY:
+            return LogicalOperation::Copy;
+        case GL_COPY_INVERTED:
+            return LogicalOperation::CopyInverted;
+        case GL_EQUIV:
+            return LogicalOperation::Equiv;
+        case GL_INVERT:
+            return LogicalOperation::Invert;
+        case GL_NAND:
+            return LogicalOperation::Nand;
+        case GL_NOOP:
+            return LogicalOperation::Noop;
+        case GL_NOR:
+            return LogicalOperation::Nor;
+        case GL_OR:
+            return LogicalOperation::Or;
+        case GL_OR_INVERTED:
+            return LogicalOperation::OrInverted;
+        case GL_OR_REVERSE:
+            return LogicalOperation::OrReverse;
+        case GL_SET:
+            return LogicalOperation::Set;
+        case GL_XOR:
+            return LogicalOperation::Xor;
+        default:
+            return LogicalOperation::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(LogicalOperation from)
+{
+    switch (from)
+    {
+        case LogicalOperation::And:
+            return GL_AND;
+        case LogicalOperation::AndInverted:
+            return GL_AND_INVERTED;
+        case LogicalOperation::AndReverse:
+            return GL_AND_REVERSE;
+        case LogicalOperation::Clear:
+            return GL_CLEAR;
+        case LogicalOperation::Copy:
+            return GL_COPY;
+        case LogicalOperation::CopyInverted:
+            return GL_COPY_INVERTED;
+        case LogicalOperation::Equiv:
+            return GL_EQUIV;
+        case LogicalOperation::Invert:
+            return GL_INVERT;
+        case LogicalOperation::Nand:
+            return GL_NAND;
+        case LogicalOperation::Noop:
+            return GL_NOOP;
+        case LogicalOperation::Nor:
+            return GL_NOR;
+        case LogicalOperation::Or:
+            return GL_OR;
+        case LogicalOperation::OrInverted:
+            return GL_OR_INVERTED;
+        case LogicalOperation::OrReverse:
+            return GL_OR_REVERSE;
+        case LogicalOperation::Set:
+            return GL_SET;
+        case LogicalOperation::Xor:
+            return GL_XOR;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+MaterialParameter FromGLenum<MaterialParameter>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_AMBIENT:
+            return MaterialParameter::Ambient;
+        case GL_AMBIENT_AND_DIFFUSE:
+            return MaterialParameter::AmbientAndDiffuse;
+        case GL_DIFFUSE:
+            return MaterialParameter::Diffuse;
+        case GL_EMISSION:
+            return MaterialParameter::Emission;
+        case GL_SHININESS:
+            return MaterialParameter::Shininess;
+        case GL_SPECULAR:
+            return MaterialParameter::Specular;
+        default:
+            return MaterialParameter::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(MaterialParameter from)
+{
+    switch (from)
+    {
+        case MaterialParameter::Ambient:
+            return GL_AMBIENT;
+        case MaterialParameter::AmbientAndDiffuse:
+            return GL_AMBIENT_AND_DIFFUSE;
+        case MaterialParameter::Diffuse:
+            return GL_DIFFUSE;
+        case MaterialParameter::Emission:
+            return GL_EMISSION;
+        case MaterialParameter::Shininess:
+            return GL_SHININESS;
+        case MaterialParameter::Specular:
+            return GL_SPECULAR;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+MatrixType FromGLenum<MatrixType>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_MODELVIEW:
+            return MatrixType::Modelview;
+        case GL_PROJECTION:
+            return MatrixType::Projection;
+        case GL_TEXTURE:
+            return MatrixType::Texture;
+        default:
+            return MatrixType::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(MatrixType from)
+{
+    switch (from)
+    {
+        case MatrixType::Modelview:
+            return GL_MODELVIEW;
+        case MatrixType::Projection:
+            return GL_PROJECTION;
+        case MatrixType::Texture:
+            return GL_TEXTURE;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+PointParameter FromGLenum<PointParameter>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_POINT_SIZE_MIN:
+            return PointParameter::PointSizeMin;
+        case GL_POINT_SIZE_MAX:
+            return PointParameter::PointSizeMax;
+        case GL_POINT_FADE_THRESHOLD_SIZE:
+            return PointParameter::PointFadeThresholdSize;
+        case GL_POINT_DISTANCE_ATTENUATION:
+            return PointParameter::PointDistanceAttenuation;
+        default:
+            return PointParameter::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(PointParameter from)
+{
+    switch (from)
+    {
+        case PointParameter::PointSizeMin:
+            return GL_POINT_SIZE_MIN;
+        case PointParameter::PointSizeMax:
+            return GL_POINT_SIZE_MAX;
+        case PointParameter::PointFadeThresholdSize:
+            return GL_POINT_FADE_THRESHOLD_SIZE;
+        case PointParameter::PointDistanceAttenuation:
+            return GL_POINT_DISTANCE_ATTENUATION;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+PrimitiveMode FromGLenum<PrimitiveMode>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_POINTS:
+            return PrimitiveMode::Points;
+        case GL_LINES:
+            return PrimitiveMode::Lines;
+        case GL_LINE_LOOP:
+            return PrimitiveMode::LineLoop;
+        case GL_LINE_STRIP:
+            return PrimitiveMode::LineStrip;
+        case GL_TRIANGLES:
+            return PrimitiveMode::Triangles;
+        case GL_TRIANGLE_STRIP:
+            return PrimitiveMode::TriangleStrip;
+        case GL_TRIANGLE_FAN:
+            return PrimitiveMode::TriangleFan;
+        case GL_LINES_ADJACENCY_EXT:
+            return PrimitiveMode::LinesAdjacency;
+        case GL_LINE_STRIP_ADJACENCY_EXT:
+            return PrimitiveMode::LineStripAdjacency;
+        case GL_TRIANGLES_ADJACENCY_EXT:
+            return PrimitiveMode::TrianglesAdjacency;
+        case GL_TRIANGLE_STRIP_ADJACENCY_EXT:
+            return PrimitiveMode::TriangleStripAdjacency;
+        default:
+            return PrimitiveMode::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(PrimitiveMode from)
+{
+    switch (from)
+    {
+        case PrimitiveMode::Points:
+            return GL_POINTS;
+        case PrimitiveMode::Lines:
+            return GL_LINES;
+        case PrimitiveMode::LineLoop:
+            return GL_LINE_LOOP;
+        case PrimitiveMode::LineStrip:
+            return GL_LINE_STRIP;
+        case PrimitiveMode::Triangles:
+            return GL_TRIANGLES;
+        case PrimitiveMode::TriangleStrip:
+            return GL_TRIANGLE_STRIP;
+        case PrimitiveMode::TriangleFan:
+            return GL_TRIANGLE_FAN;
+        case PrimitiveMode::LinesAdjacency:
+            return GL_LINES_ADJACENCY_EXT;
+        case PrimitiveMode::LineStripAdjacency:
+            return GL_LINE_STRIP_ADJACENCY_EXT;
+        case PrimitiveMode::TrianglesAdjacency:
+            return GL_TRIANGLES_ADJACENCY_EXT;
+        case PrimitiveMode::TriangleStripAdjacency:
+            return GL_TRIANGLE_STRIP_ADJACENCY_EXT;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+QueryType FromGLenum<QueryType>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_ANY_SAMPLES_PASSED:
+            return QueryType::AnySamples;
+        case GL_ANY_SAMPLES_PASSED_CONSERVATIVE:
+            return QueryType::AnySamplesConservative;
+        case GL_COMMANDS_COMPLETED_CHROMIUM:
+            return QueryType::CommandsCompleted;
+        case GL_PRIMITIVES_GENERATED_EXT:
+            return QueryType::PrimitivesGenerated;
+        case GL_TIME_ELAPSED_EXT:
+            return QueryType::TimeElapsed;
+        case GL_TIMESTAMP_EXT:
+            return QueryType::Timestamp;
+        case GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN:
+            return QueryType::TransformFeedbackPrimitivesWritten;
+        default:
+            return QueryType::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(QueryType from)
+{
+    switch (from)
+    {
+        case QueryType::AnySamples:
+            return GL_ANY_SAMPLES_PASSED;
+        case QueryType::AnySamplesConservative:
+            return GL_ANY_SAMPLES_PASSED_CONSERVATIVE;
+        case QueryType::CommandsCompleted:
+            return GL_COMMANDS_COMPLETED_CHROMIUM;
+        case QueryType::PrimitivesGenerated:
+            return GL_PRIMITIVES_GENERATED_EXT;
+        case QueryType::TimeElapsed:
+            return GL_TIME_ELAPSED_EXT;
+        case QueryType::Timestamp:
+            return GL_TIMESTAMP_EXT;
+        case QueryType::TransformFeedbackPrimitivesWritten:
+            return GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+ShaderType FromGLenum<ShaderType>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_VERTEX_SHADER:
+            return ShaderType::Vertex;
+        case GL_FRAGMENT_SHADER:
+            return ShaderType::Fragment;
+        case GL_GEOMETRY_SHADER_EXT:
+            return ShaderType::Geometry;
+        case GL_COMPUTE_SHADER:
+            return ShaderType::Compute;
+        default:
+            return ShaderType::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(ShaderType from)
+{
+    switch (from)
+    {
+        case ShaderType::Vertex:
+            return GL_VERTEX_SHADER;
+        case ShaderType::Fragment:
+            return GL_FRAGMENT_SHADER;
+        case ShaderType::Geometry:
+            return GL_GEOMETRY_SHADER_EXT;
+        case ShaderType::Compute:
+            return GL_COMPUTE_SHADER;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+ShadingModel FromGLenum<ShadingModel>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_FLAT:
+            return ShadingModel::Flat;
+        case GL_SMOOTH:
+            return ShadingModel::Smooth;
+        default:
+            return ShadingModel::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(ShadingModel from)
+{
+    switch (from)
+    {
+        case ShadingModel::Flat:
+            return GL_FLAT;
+        case ShadingModel::Smooth:
+            return GL_SMOOTH;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureCombine FromGLenum<TextureCombine>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_ADD:
+            return TextureCombine::Add;
+        case GL_ADD_SIGNED:
+            return TextureCombine::AddSigned;
+        case GL_DOT3_RGB:
+            return TextureCombine::Dot3Rgb;
+        case GL_DOT3_RGBA:
+            return TextureCombine::Dot3Rgba;
+        case GL_INTERPOLATE:
+            return TextureCombine::Interpolate;
+        case GL_MODULATE:
+            return TextureCombine::Modulate;
+        case GL_REPLACE:
+            return TextureCombine::Replace;
+        case GL_SUBTRACT:
+            return TextureCombine::Subtract;
+        default:
+            return TextureCombine::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureCombine from)
+{
+    switch (from)
+    {
+        case TextureCombine::Add:
+            return GL_ADD;
+        case TextureCombine::AddSigned:
+            return GL_ADD_SIGNED;
+        case TextureCombine::Dot3Rgb:
+            return GL_DOT3_RGB;
+        case TextureCombine::Dot3Rgba:
+            return GL_DOT3_RGBA;
+        case TextureCombine::Interpolate:
+            return GL_INTERPOLATE;
+        case TextureCombine::Modulate:
+            return GL_MODULATE;
+        case TextureCombine::Replace:
+            return GL_REPLACE;
+        case TextureCombine::Subtract:
+            return GL_SUBTRACT;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureEnvMode FromGLenum<TextureEnvMode>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_ADD:
+            return TextureEnvMode::Add;
+        case GL_BLEND:
+            return TextureEnvMode::Blend;
+        case GL_COMBINE:
+            return TextureEnvMode::Combine;
+        case GL_DECAL:
+            return TextureEnvMode::Decal;
+        case GL_MODULATE:
+            return TextureEnvMode::Modulate;
+        case GL_REPLACE:
+            return TextureEnvMode::Replace;
+        default:
+            return TextureEnvMode::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureEnvMode from)
+{
+    switch (from)
+    {
+        case TextureEnvMode::Add:
+            return GL_ADD;
+        case TextureEnvMode::Blend:
+            return GL_BLEND;
+        case TextureEnvMode::Combine:
+            return GL_COMBINE;
+        case TextureEnvMode::Decal:
+            return GL_DECAL;
+        case TextureEnvMode::Modulate:
+            return GL_MODULATE;
+        case TextureEnvMode::Replace:
+            return GL_REPLACE;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureEnvParameter FromGLenum<TextureEnvParameter>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_TEXTURE_ENV_MODE:
+            return TextureEnvParameter::Mode;
+        case GL_TEXTURE_ENV_COLOR:
+            return TextureEnvParameter::Color;
+        case GL_COMBINE_RGB:
+            return TextureEnvParameter::CombineRgb;
+        case GL_COMBINE_ALPHA:
+            return TextureEnvParameter::CombineAlpha;
+        case GL_RGB_SCALE:
+            return TextureEnvParameter::RgbScale;
+        case GL_ALPHA_SCALE:
+            return TextureEnvParameter::AlphaScale;
+        case GL_SRC0_RGB:
+            return TextureEnvParameter::Src0Rgb;
+        case GL_SRC1_RGB:
+            return TextureEnvParameter::Src1Rgb;
+        case GL_SRC2_RGB:
+            return TextureEnvParameter::Src2Rgb;
+        case GL_SRC0_ALPHA:
+            return TextureEnvParameter::Src0Alpha;
+        case GL_SRC1_ALPHA:
+            return TextureEnvParameter::Src1Alpha;
+        case GL_SRC2_ALPHA:
+            return TextureEnvParameter::Src2Alpha;
+        case GL_OPERAND0_RGB:
+            return TextureEnvParameter::Op0Rgb;
+        case GL_OPERAND1_RGB:
+            return TextureEnvParameter::Op1Rgb;
+        case GL_OPERAND2_RGB:
+            return TextureEnvParameter::Op2Rgb;
+        case GL_OPERAND0_ALPHA:
+            return TextureEnvParameter::Op0Alpha;
+        case GL_OPERAND1_ALPHA:
+            return TextureEnvParameter::Op1Alpha;
+        case GL_OPERAND2_ALPHA:
+            return TextureEnvParameter::Op2Alpha;
+        case GL_COORD_REPLACE_OES:
+            return TextureEnvParameter::PointCoordReplace;
+        default:
+            return TextureEnvParameter::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureEnvParameter from)
+{
+    switch (from)
+    {
+        case TextureEnvParameter::Mode:
+            return GL_TEXTURE_ENV_MODE;
+        case TextureEnvParameter::Color:
+            return GL_TEXTURE_ENV_COLOR;
+        case TextureEnvParameter::CombineRgb:
+            return GL_COMBINE_RGB;
+        case TextureEnvParameter::CombineAlpha:
+            return GL_COMBINE_ALPHA;
+        case TextureEnvParameter::RgbScale:
+            return GL_RGB_SCALE;
+        case TextureEnvParameter::AlphaScale:
+            return GL_ALPHA_SCALE;
+        case TextureEnvParameter::Src0Rgb:
+            return GL_SRC0_RGB;
+        case TextureEnvParameter::Src1Rgb:
+            return GL_SRC1_RGB;
+        case TextureEnvParameter::Src2Rgb:
+            return GL_SRC2_RGB;
+        case TextureEnvParameter::Src0Alpha:
+            return GL_SRC0_ALPHA;
+        case TextureEnvParameter::Src1Alpha:
+            return GL_SRC1_ALPHA;
+        case TextureEnvParameter::Src2Alpha:
+            return GL_SRC2_ALPHA;
+        case TextureEnvParameter::Op0Rgb:
+            return GL_OPERAND0_RGB;
+        case TextureEnvParameter::Op1Rgb:
+            return GL_OPERAND1_RGB;
+        case TextureEnvParameter::Op2Rgb:
+            return GL_OPERAND2_RGB;
+        case TextureEnvParameter::Op0Alpha:
+            return GL_OPERAND0_ALPHA;
+        case TextureEnvParameter::Op1Alpha:
+            return GL_OPERAND1_ALPHA;
+        case TextureEnvParameter::Op2Alpha:
+            return GL_OPERAND2_ALPHA;
+        case TextureEnvParameter::PointCoordReplace:
+            return GL_COORD_REPLACE_OES;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureEnvTarget FromGLenum<TextureEnvTarget>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_TEXTURE_ENV:
+            return TextureEnvTarget::Env;
+        case GL_POINT_SPRITE_OES:
+            return TextureEnvTarget::PointSprite;
+        default:
+            return TextureEnvTarget::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureEnvTarget from)
+{
+    switch (from)
+    {
+        case TextureEnvTarget::Env:
+            return GL_TEXTURE_ENV;
+        case TextureEnvTarget::PointSprite:
+            return GL_POINT_SPRITE_OES;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureOp FromGLenum<TextureOp>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_ONE_MINUS_SRC_ALPHA:
+            return TextureOp::OneMinusSrcAlpha;
+        case GL_ONE_MINUS_SRC_COLOR:
+            return TextureOp::OneMinusSrcColor;
+        case GL_SRC_ALPHA:
+            return TextureOp::SrcAlpha;
+        case GL_SRC_COLOR:
+            return TextureOp::SrcColor;
+        default:
+            return TextureOp::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureOp from)
+{
+    switch (from)
+    {
+        case TextureOp::OneMinusSrcAlpha:
+            return GL_ONE_MINUS_SRC_ALPHA;
+        case TextureOp::OneMinusSrcColor:
+            return GL_ONE_MINUS_SRC_COLOR;
+        case TextureOp::SrcAlpha:
+            return GL_SRC_ALPHA;
+        case TextureOp::SrcColor:
+            return GL_SRC_COLOR;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureSrc FromGLenum<TextureSrc>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_CONSTANT:
+            return TextureSrc::Constant;
+        case GL_PREVIOUS:
+            return TextureSrc::Previous;
+        case GL_PRIMARY_COLOR:
+            return TextureSrc::PrimaryColor;
+        case GL_TEXTURE:
+            return TextureSrc::Texture;
+        default:
+            return TextureSrc::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureSrc from)
+{
+    switch (from)
+    {
+        case TextureSrc::Constant:
+            return GL_CONSTANT;
+        case TextureSrc::Previous:
+            return GL_PREVIOUS;
+        case TextureSrc::PrimaryColor:
+            return GL_PRIMARY_COLOR;
+        case TextureSrc::Texture:
+            return GL_TEXTURE;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureTarget FromGLenum<TextureTarget>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_TEXTURE_2D:
+            return TextureTarget::_2D;
+        case GL_TEXTURE_2D_ARRAY:
+            return TextureTarget::_2DArray;
+        case GL_TEXTURE_2D_MULTISAMPLE:
+            return TextureTarget::_2DMultisample;
+        case GL_TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE:
+            return TextureTarget::_2DMultisampleArray;
+        case GL_TEXTURE_3D:
+            return TextureTarget::_3D;
+        case GL_TEXTURE_EXTERNAL_OES:
+            return TextureTarget::External;
+        case GL_TEXTURE_RECTANGLE_ANGLE:
+            return TextureTarget::Rectangle;
+        case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
+            return TextureTarget::CubeMapPositiveX;
+        case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
+            return TextureTarget::CubeMapNegativeX;
+        case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
+            return TextureTarget::CubeMapPositiveY;
+        case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
+            return TextureTarget::CubeMapNegativeY;
+        case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
+            return TextureTarget::CubeMapPositiveZ;
+        case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
+            return TextureTarget::CubeMapNegativeZ;
+        default:
+            return TextureTarget::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureTarget from)
+{
+    switch (from)
+    {
+        case TextureTarget::_2D:
+            return GL_TEXTURE_2D;
+        case TextureTarget::_2DArray:
+            return GL_TEXTURE_2D_ARRAY;
+        case TextureTarget::_2DMultisample:
+            return GL_TEXTURE_2D_MULTISAMPLE;
+        case TextureTarget::_2DMultisampleArray:
+            return GL_TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE;
+        case TextureTarget::_3D:
+            return GL_TEXTURE_3D;
+        case TextureTarget::External:
+            return GL_TEXTURE_EXTERNAL_OES;
+        case TextureTarget::Rectangle:
+            return GL_TEXTURE_RECTANGLE_ANGLE;
+        case TextureTarget::CubeMapPositiveX:
+            return GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+        case TextureTarget::CubeMapNegativeX:
+            return GL_TEXTURE_CUBE_MAP_NEGATIVE_X;
+        case TextureTarget::CubeMapPositiveY:
+            return GL_TEXTURE_CUBE_MAP_POSITIVE_Y;
+        case TextureTarget::CubeMapNegativeY:
+            return GL_TEXTURE_CUBE_MAP_NEGATIVE_Y;
+        case TextureTarget::CubeMapPositiveZ:
+            return GL_TEXTURE_CUBE_MAP_POSITIVE_Z;
+        case TextureTarget::CubeMapNegativeZ:
+            return GL_TEXTURE_CUBE_MAP_NEGATIVE_Z;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+TextureType FromGLenum<TextureType>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_TEXTURE_2D:
+            return TextureType::_2D;
+        case GL_TEXTURE_2D_ARRAY:
+            return TextureType::_2DArray;
+        case GL_TEXTURE_2D_MULTISAMPLE:
+            return TextureType::_2DMultisample;
+        case GL_TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE:
+            return TextureType::_2DMultisampleArray;
+        case GL_TEXTURE_3D:
+            return TextureType::_3D;
+        case GL_TEXTURE_EXTERNAL_OES:
+            return TextureType::External;
+        case GL_TEXTURE_RECTANGLE_ANGLE:
+            return TextureType::Rectangle;
+        case GL_TEXTURE_CUBE_MAP:
+            return TextureType::CubeMap;
+        default:
+            return TextureType::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(TextureType from)
+{
+    switch (from)
+    {
+        case TextureType::_2D:
+            return GL_TEXTURE_2D;
+        case TextureType::_2DArray:
+            return GL_TEXTURE_2D_ARRAY;
+        case TextureType::_2DMultisample:
+            return GL_TEXTURE_2D_MULTISAMPLE;
+        case TextureType::_2DMultisampleArray:
+            return GL_TEXTURE_2D_MULTISAMPLE_ARRAY_ANGLE;
+        case TextureType::_3D:
+            return GL_TEXTURE_3D;
+        case TextureType::External:
+            return GL_TEXTURE_EXTERNAL_OES;
+        case TextureType::Rectangle:
+            return GL_TEXTURE_RECTANGLE_ANGLE;
+        case TextureType::CubeMap:
+            return GL_TEXTURE_CUBE_MAP;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+template <>
+VertexArrayType FromGLenum<VertexArrayType>(GLenum from)
+{
+    switch (from)
+    {
+        case GL_COLOR_ARRAY:
+            return VertexArrayType::Color;
+        case GL_NORMAL_ARRAY:
+            return VertexArrayType::Normal;
+        case GL_POINT_SIZE_ARRAY_OES:
+            return VertexArrayType::PointSize;
+        case GL_TEXTURE_COORD_ARRAY:
+            return VertexArrayType::TextureCoord;
+        case GL_VERTEX_ARRAY:
+            return VertexArrayType::Vertex;
+        default:
+            return VertexArrayType::InvalidEnum;
+    }
+}
+
+GLenum ToGLenum(VertexArrayType from)
+{
+    switch (from)
+    {
+        case VertexArrayType::Color:
+            return GL_COLOR_ARRAY;
+        case VertexArrayType::Normal:
+            return GL_NORMAL_ARRAY;
+        case VertexArrayType::PointSize:
+            return GL_POINT_SIZE_ARRAY_OES;
+        case VertexArrayType::TextureCoord:
+            return GL_TEXTURE_COORD_ARRAY;
+        case VertexArrayType::Vertex:
+            return GL_VERTEX_ARRAY;
+        default:
+            UNREACHABLE();
+            return 0;
+    }
+}
+
+}  // namespace gl
new file mode 100644
--- /dev/null
+++ b/gfx/angle/checkout/src/common/PackedGLEnums_autogen.h
@@ -0,0 +1,480 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by gen_packed_gl_enums.py using data from packed_gl_enums.json.
+//
+// Copyright 2018 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.
+//
+// PackedGLEnums_autogen.h:
+//   Declares ANGLE-specific enums classes for GLenums and functions operating
+//   on them.
+
+#ifndef COMMON_PACKEDGLENUMS_AUTOGEN_H_
+#define COMMON_PACKEDGLENUMS_AUTOGEN_H_
+
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+#include <angle_gl.h>
+
+#include <cstdint>
+
+namespace gl
+{
+
+template <typename Enum>
+Enum FromGLenum(GLenum from);
+
+enum class AlphaTestFunc : uint8_t
+{
+    AlwaysPass = 0,
+    Equal      = 1,
+    Gequal     = 2,
+    Greater    = 3,
+    Lequal     = 4,
+    Less       = 5,
+    Never      = 6,
+    NotEqual   = 7,
+
+    InvalidEnum = 8,
+    EnumCount   = 8,
+};
+
+template <>
+AlphaTestFunc FromGLenum<AlphaTestFunc>(GLenum from);
+GLenum ToGLenum(AlphaTestFunc from);
+
+enum class BufferBinding : uint8_t
+{
+    Array             = 0,
+    AtomicCounter     = 1,
+    CopyRead          = 2,
+    CopyWrite         = 3,
+    DispatchIndirect  = 4,
+    DrawIndirect      = 5,
+    ElementArray      = 6,
+    PixelPack         = 7,
+    PixelUnpack       = 8,
+    ShaderStorage     = 9,
+    TransformFeedback = 10,
+    Uniform           = 11,
+
+    InvalidEnum = 12,
+    EnumCount   = 12,
+};
+
+template <>
+BufferBinding FromGLenum<BufferBinding>(GLenum from);
+GLenum ToGLenum(BufferBinding from);
+
+enum class BufferUsage : uint8_t
+{
+    DynamicCopy = 0,
+    DynamicDraw = 1,
+    DynamicRead = 2,
+    StaticCopy  = 3,
+    StaticDraw  = 4,
+    StaticRead  = 5,
+    StreamCopy  = 6,
+    StreamDraw  = 7,
+    StreamRead  = 8,
+
+    InvalidEnum = 9,
+    EnumCount   = 9,
+};
+
+template <>
+BufferUsage FromGLenum<BufferUsage>(GLenum from);
+GLenum ToGLenum(BufferUsage from);
+
+enum class ClientVertexArrayType : uint8_t
+{
+    Color        = 0,
+    Normal       = 1,
+    PointSize    = 2,
+    TextureCoord = 3,
+    Vertex       = 4,
+
+    InvalidEnum = 5,
+    EnumCount   = 5,
+};
+
+template <>
+ClientVertexArrayType FromGLenum<ClientVertexArrayType>(GLenum from);
+GLenum ToGLenum(ClientVertexArrayType from);
+
+enum class CullFaceMode : uint8_t
+{
+    Back         = 0,
+    Front        = 1,
+    FrontAndBack = 2,
+
+    InvalidEnum = 3,
+    EnumCount   = 3,
+};
+
+template <>
+CullFaceMode FromGLenum<CullFaceMode>(GLenum from);
+GLenum ToGLenum(CullFaceMode from);
+
+enum class FogMode : uint8_t
+{
+    Exp    = 0,
+    Exp2   = 1,
+    Linear = 2,
+
+    InvalidEnum = 3,
+    EnumCount   = 3,
+};
+
+template <>
+FogMode FromGLenum<FogMode>(GLenum from);
+GLenum ToGLenum(FogMode from);
+
+enum class HintSetting : uint8_t
+{
+    DontCare = 0,
+    Fastest  = 1,
+    Nicest   = 2,
+
+    InvalidEnum = 3,
+    EnumCount   = 3,
+};
+
+template <>
+HintSetting FromGLenum<HintSetting>(GLenum from);
+GLenum ToGLenum(HintSetting from);
+
+enum class LightParameter : uint8_t
+{
+    Ambient              = 0,
+    AmbientAndDiffuse    = 1,
+    ConstantAttenuation  = 2,
+    Diffuse              = 3,
+    LinearAttenuation    = 4,
+    Position             = 5,
+    QuadraticAttenuation = 6,
+    Specular             = 7,
+    SpotCutoff           = 8,
+    SpotDirection        = 9,
+    SpotExponent         = 10,
+
+    InvalidEnum = 11,
+    EnumCount   = 11,
+};
+
+template <>
+LightParameter FromGLenum<LightParameter>(GLenum from);
+GLenum ToGLenum(LightParameter from);
+
+enum class LogicalOperation : uint8_t
+{
+    And          = 0,
+    AndInverted  = 1,
+    AndReverse   = 2,
+    Clear        = 3,
+    Copy         = 4,
+    CopyInverted = 5,
+    Equiv        = 6,
+    Invert       = 7,
+    Nand         = 8,
+    Noop         = 9,
+    Nor          = 10,
+    Or           = 11,
+    OrInverted   = 12,
+    OrReverse    = 13,
+    Set          = 14,
+    Xor          = 15,
+
+    InvalidEnum = 16,
+    EnumCount   = 16,
+};
+
+template <>
+LogicalOperation FromGLenum<LogicalOperation>(GLenum from);
+GLenum ToGLenum(LogicalOperation from);
+
+enum class MaterialParameter : uint8_t
+{
+    Ambient           = 0,
+    AmbientAndDiffuse = 1,
+    Diffuse           = 2,
+    Emission          = 3,
+    Shininess         = 4,
+    Specular          = 5,
+
+    InvalidEnum = 6,
+    EnumCount   = 6,
+};
+
+template <>
+MaterialParameter FromGLenum<MaterialParameter>(GLenum from);
+GLenum ToGLenum(MaterialParameter from);
+
+enum class MatrixType : uint8_t
+{
+    Modelview  = 0,
+    Projection = 1,
+    Texture    = 2,
+
+    InvalidEnum = 3,
+    EnumCount   = 3,
+};
+
+template <>
+MatrixType FromGLenum<MatrixType>(GLenum from);
+GLenum ToGLenum(MatrixType from);
+
+enum class PointParameter : uint8_t
+{
+    PointSizeMin             = 0,
+    PointSizeMax             = 1,
+    PointFadeThresholdSize   = 2,
+    PointDistanceAttenuation = 3,
+
+    InvalidEnum = 4,
+    EnumCount   = 4,
+};
+
+template <>
+PointParameter FromGLenum<PointParameter>(GLenum from);
+GLenum ToGLenum(PointParameter from);
+
+enum class PrimitiveMode : uint8_t
+{
+    Points                 = 0,
+    Lines                  = 1,
+    LineLoop               = 2,
+    LineStrip              = 3,
+    Triangles              = 4,
+    TriangleStrip          = 5,
+    TriangleFan            = 6,
+    LinesAdjacency         = 7,
+    LineStripAdjacency     = 8,
+    TrianglesAdjacency     = 9,
+    TriangleStripAdjacency = 10,
+
+    InvalidEnum = 11,
+    EnumCount   = 11,
+};
+
+template <>
+PrimitiveMode FromGLenum<PrimitiveMode>(GLenum from);
+GLenum ToGLenum(PrimitiveMode from);
+
+enum class QueryType : uint8_t
+{
+    AnySamples                         = 0,
+    AnySamplesConservative             = 1,
+    CommandsCompleted                  = 2,
+    PrimitivesGenerated                = 3,
+    TimeElapsed                        = 4,
+    Timestamp                          = 5,
+    TransformFeedbackPrimitivesWritten = 6,
+
+    InvalidEnum = 7,
+    EnumCount   = 7,
+};
+
+template <>
+QueryType FromGLenum<QueryType>(GLenum from);
+GLenum ToGLenum(QueryType from);
+
+enum class ShaderType : uint8_t
+{
+    Vertex   = 0,
+    Fragment = 1,
+    Geometry = 2,
+    Compute  = 3,
+
+    InvalidEnum = 4,
+    EnumCount   = 4,
+};
+
+template <>
+ShaderType FromGLenum<ShaderType>(GLenum from);
+GLenum ToGLenum(ShaderType from);
+
+enum class ShadingModel : uint8_t
+{
+    Flat   = 0,
+    Smooth = 1,
+
+    InvalidEnum = 2,
+    EnumCount   = 2,
+};
+
+template <>
+ShadingModel FromGLenum<ShadingModel>(GLenum from);
+GLenum ToGLenum(ShadingModel from);
+
+enum class TextureCombine : uint8_t
+{
+    Add         = 0,
+    AddSigned   = 1,
+    Dot3Rgb     = 2,
+    Dot3Rgba    = 3,
+    Interpolate = 4,
+    Modulate    = 5,
+    Replace     = 6,
+    Subtract    = 7,
+
+    InvalidEnum = 8,
+    EnumCount   = 8,
+};
+
+template <>
+TextureCombine FromGLenum<TextureCombine>(GLenum from);
+GLenum ToGLenum(TextureCombine from);
+
+enum class TextureEnvMode : uint8_t
+{
+    Add      = 0,
+    Blend    = 1,
+    Combine  = 2,
+    Decal    = 3,
+    Modulate = 4,
+    Replace  = 5,
+
+    InvalidEnum = 6,
+    EnumCount   = 6,
+};
+
+template <>
+TextureEnvMode FromGLenum<TextureEnvMode>(GLenum from);
+GLenum ToGLenum(TextureEnvMode from);
+
+enum class TextureEnvParameter : uint8_t
+{
+    Mode              = 0,
+    Color             = 1,
+    CombineRgb        = 2,
+    CombineAlpha      = 3,
+    RgbScale          = 4,
+    AlphaScale        = 5,
+    Src0Rgb           = 6,
+    Src1Rgb           = 7,
+    Src2Rgb           = 8,
+    Src0Alpha         = 9,
+    Src1Alpha         = 10,
+    Src2Alpha         = 11,
+    Op0Rgb            = 12,
+    Op1Rgb            = 13,
+    Op2Rgb            = 14,
+    Op0Alpha          = 15,
+    Op1Alpha          = 16,
+    Op2Alpha          = 17,
+    PointCoordReplace = 18,
+
+    InvalidEnum = 19,
+    EnumCount   = 19,
+};
+
+template <>
+TextureEnvParameter FromGLenum<TextureEnvParameter>(GLenum from);
+GLenum ToGLenum(TextureEnvParameter from);
+
+enum class TextureEnvTarget : uint8_t
+{
+    Env         = 0,
+    PointSprite = 1,
+
+    InvalidEnum = 2,
+    EnumCount   = 2,
+};
+
+template <>
+TextureEnvTarget FromGLenum<TextureEnvTarget>(GLenum from);
+GLenum ToGLenum(TextureEnvTarget from);
+
+enum class TextureOp : uint8_t
+{
+    OneMinusSrcAlpha = 0,
+    OneMinusSrcColor = 1,
+    SrcAlpha         = 2,
+    SrcColor         = 3,
+
+    InvalidEnum = 4,
+    EnumCount   = 4,
+};
+
+template <>
+TextureOp FromGLenum<TextureOp>(GLenum from);
+GLenum ToGLenum(TextureOp from);
+
+enum class TextureSrc : uint8_t
+{
+    Constant     = 0,
+    Previous     = 1,
+    PrimaryColor = 2,
+    Texture      = 3,
+
+    InvalidEnum = 4,
+    EnumCount   = 4,
+};
+
+template <>
+TextureSrc FromGLenum<TextureSrc>(GLenum from);
+GLenum ToGLenum(TextureSrc from);
+
+enum class TextureTarget : uint8_t
+{
+    _2D                 = 0,
+    _2DArray            = 1,
+    _2DMultisample      = 2,
+    _2DMultisampleArray = 3,
+    _3D                 = 4,
+    External            = 5,
+    Rectangle           = 6,
+    CubeMapPositiveX    = 7,
+    CubeMapNegativeX    = 8,
+    CubeMapPositiveY    = 9,
+    CubeMapNegativeY    = 10,
+    CubeMapPositiveZ    = 11,
+    CubeMapNegativeZ    = 12,
+
+    InvalidEnum = 13,
+    EnumCount   = 13,
+};
+
+template <>
+TextureTarget FromGLenum<TextureTarget>(GLenum from);
+GLenum ToGLenum(TextureTarget from);
+
+enum class TextureType : uint8_t
+{
+    _2D                 = 0,
+    _2DArray            = 1,
+    _2DMultisample      = 2,
+    _2DMultisampleArray = 3,
+    _3D                 = 4,
+    External            = 5,
+    Rectangle           = 6,
+    CubeMap             = 7,
+
+    InvalidEnum = 8,
+    EnumCount   = 8,
+};
+
+template <>
+TextureType FromGLenum<TextureType>(GLenum from);
+GLenum ToGLenum(TextureType from);
+
+enum class VertexArrayType : uint8_t
+{
+    Color        = 0,
+    Normal       = 1,
+    PointSize    = 2,
+    TextureCoord = 3,
+    Vertex       = 4,
+
+    InvalidEnum = 5,
+    EnumCount   = 5,
+};
+
+template <>
+VertexArrayType FromGLenum<VertexArrayType>(GLenum from);
+GLenum ToGLenum(VertexArrayType from);
+
+}  // namespace gl
+
+#endif  // COMMON_PACKEDGLENUMS_AUTOGEN_H_
--- a/gfx/angle/checkout/src/common/angleutils.h
+++ b/gfx/angle/checkout/src/common/angleutils.h
@@ -9,38 +9,38 @@
 #ifndef COMMON_ANGLEUTILS_H_
 #define COMMON_ANGLEUTILS_H_
 
 #include "common/platform.h"
 
 #include <climits>
 #include <cstdarg>
 #include <cstddef>
-#include <string>
 #include <set>
 #include <sstream>
+#include <string>
 #include <vector>
 
 // A helper class to disallow copy and assignment operators
 namespace angle
 {
 
 #if defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11)
 using Microsoft::WRL::ComPtr;
 #endif  // defined(ANGLE_ENABLE_D3D9) || defined(ANGLE_ENABLE_D3D11)
 
 class NonCopyable
 {
   protected:
     constexpr NonCopyable() = default;
-    ~NonCopyable() = default;
+    ~NonCopyable()          = default;
 
   private:
-    NonCopyable(const NonCopyable&) = delete;
-    void operator=(const NonCopyable&) = delete;
+    NonCopyable(const NonCopyable &) = delete;
+    void operator=(const NonCopyable &) = delete;
 };
 
 extern const uintptr_t DirtyPointer;
 
 }  // namespace angle
 
 template <typename T, size_t N>
 constexpr inline size_t ArraySize(T (&)[N])
@@ -81,44 +81,44 @@ void SafeRelease(T (&resourceBlock)[N])
 {
     for (unsigned int i = 0; i < N; i++)
     {
         SafeRelease(resourceBlock[i]);
     }
 }
 
 template <typename T>
-void SafeRelease(T& resource)
+void SafeRelease(T &resource)
 {
     if (resource)
     {
         resource->Release();
         resource = nullptr;
     }
 }
 
 template <typename T>
 void SafeDelete(T *&resource)
 {
     delete resource;
     resource = nullptr;
 }
 
 template <typename T>
-void SafeDeleteContainer(T& resource)
+void SafeDeleteContainer(T &resource)
 {
     for (auto &element : resource)
     {
         SafeDelete(element);
     }
     resource.clear();
 }
 
 template <typename T>
-void SafeDeleteArray(T*& resource)
+void SafeDeleteArray(T *&resource)
 {
     delete[] resource;
     resource = nullptr;
 }
 
 // Provide a less-than function for comparing structs
 // Note: struct memory must be initialized to zero, because of packing gaps
 template <typename T>
@@ -143,17 +143,17 @@ inline void StructZero(T *obj)
 
 template <typename T>
 inline bool IsMaskFlagSet(T mask, T flag)
 {
     // Handles multibit flags as well
     return (mask & flag) == flag;
 }
 
-inline const char* MakeStaticString(const std::string &str)
+inline const char *MakeStaticString(const std::string &str)
 {
     static std::set<std::string> strings;
     std::set<std::string>::iterator it = strings.find(str);
     if (it != strings.end())
     {
         return it->c_str();
     }
 
@@ -168,20 +168,17 @@ std::string ArrayIndexString(const std::
 
 inline std::string Str(int i)
 {
     std::stringstream strstr;
     strstr << i;
     return strstr.str();
 }
 
-size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char>& buffer);
-
-std::string FormatString(const char *fmt, va_list vararg);
-std::string FormatString(const char *fmt, ...);
+size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char> &buffer);
 
 template <typename T>
 std::string ToString(const T &value)
 {
     std::ostringstream o;
     o << value;
     return o.str();
 }
@@ -202,25 +199,81 @@ std::string ToString(const T &value)
 
 // These are dummy formats used to fit typeless D3D textures that can be bound to EGL pbuffers into
 // the format system (for extension EGL_ANGLE_d3d_texture_client_buffer):
 #define GL_RGBA8_TYPELESS_ANGLEX 0x6AC1
 #define GL_RGBA8_TYPELESS_SRGB_ANGLEX 0x6AC2
 #define GL_BGRA8_TYPELESS_ANGLEX 0x6AC3
 #define GL_BGRA8_TYPELESS_SRGB_ANGLEX 0x6AC4
 
+#define GL_R8_SSCALED_ANGLEX 0x6AC6
+#define GL_RG8_SSCALED_ANGLEX 0x6AC7
+#define GL_RGB8_SSCALED_ANGLEX 0x6AC8
+#define GL_RGBA8_SSCALED_ANGLEX 0x6AC9
+#define GL_R8_USCALED_ANGLEX 0x6ACA
+#define GL_RG8_USCALED_ANGLEX 0x6ACB
+#define GL_RGB8_USCALED_ANGLEX 0x6ACC
+#define GL_RGBA8_USCALED_ANGLEX 0x6ACD
+
+#define GL_R16_SSCALED_ANGLEX 0x6ACE
+#define GL_RG16_SSCALED_ANGLEX 0x6ACF
+#define GL_RGB16_SSCALED_ANGLEX 0x6AD0
+#define GL_RGBA16_SSCALED_ANGLEX 0x6AD1
+#define GL_R16_USCALED_ANGLEX 0x6AD2
+#define GL_RG16_USCALED_ANGLEX 0x6AD3
+#define GL_RGB16_USCALED_ANGLEX 0x6AD4
+#define GL_RGBA16_USCALED_ANGLEX 0x6AD5
+
+#define GL_R32_SSCALED_ANGLEX 0x6AD6
+#define GL_RG32_SSCALED_ANGLEX 0x6AD7
+#define GL_RGB32_SSCALED_ANGLEX 0x6AD8
+#define GL_RGBA32_SSCALED_ANGLEX 0x6AD9
+#define GL_R32_USCALED_ANGLEX 0x6ADA
+#define GL_RG32_USCALED_ANGLEX 0x6ADB
+#define GL_RGB32_USCALED_ANGLEX 0x6ADC
+#define GL_RGBA32_USCALED_ANGLEX 0x6ADD
+
+#define GL_R32_SNORM_ANGLEX 0x6ADE
+#define GL_RG32_SNORM_ANGLEX 0x6ADF
+#define GL_RGB32_SNORM_ANGLEX 0x6AE0
+#define GL_RGBA32_SNORM_ANGLEX 0x6AE1
+#define GL_R32_UNORM_ANGLEX 0x6AE2
+#define GL_RG32_UNORM_ANGLEX 0x6AE3
+#define GL_RGB32_UNORM_ANGLEX 0x6AE4
+#define GL_RGBA32_UNORM_ANGLEX 0x6AE5
+
+#define GL_R32_FIXED_ANGLEX 0x6AE6
+#define GL_RG32_FIXED_ANGLEX 0x6AE7
+#define GL_RGB32_FIXED_ANGLEX 0x6AE8
+#define GL_RGBA32_FIXED_ANGLEX 0x6AE9
+
+#define GL_RGB10_A2_SINT_ANGLEX 0x6AEA
+#define GL_RGB10_A2_SNORM_ANGLEX 0x6AEB
+#define GL_RGB10_A2_SSCALED_ANGLEX 0x6AEC
+#define GL_RGB10_A2_USCALED_ANGLEX 0x6AED
+
 // TODO(jmadill): Clean this up at some point.
 #define EGL_PLATFORM_ANGLE_PLATFORM_METHODS_ANGLEX 0x9999
 
+// This internal enum is used to filter internal errors that are already handled.
+// TODO(jmadill): Remove this when refactor is done. http://anglebug.com/2491
+#define GL_INTERNAL_ERROR_ANGLEX 0x6AEE
+
 #define ANGLE_TRY_CHECKED_MATH(result)                     \
-    if (!result.IsValid())                                 \
+    if (!result)                                           \
     {                                                      \
         return gl::InternalError() << "Integer overflow."; \
     }
 
+#define ANGLE_TRY_ALLOCATION(result)                                       \
+    if (!result)                                                           \
+    {                                                                      \
+        return gl::OutOfMemory() << "Failed to allocate internal buffer."; \
+    }
+
 // The below inlining code lifted from V8.
 #if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute))
 #define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
 #define ANGLE_HAS___FORCEINLINE 0
 #elif defined(_MSC_VER)
 #define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE 0
 #define ANGLE_HAS___FORCEINLINE 1
 #else
@@ -231,16 +284,28 @@ std::string ToString(const T &value)
 #if defined(NDEBUG) && ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE
 #define ANGLE_INLINE inline __attribute__((always_inline))
 #elif defined(NDEBUG) && ANGLE_HAS___FORCEINLINE
 #define ANGLE_INLINE __forceinline
 #else
 #define ANGLE_INLINE inline
 #endif
 
+#if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute))
+#if __has_attribute(noinline)
+#define ANGLE_NOINLINE __attribute__((noinline))
+#else
+#define ANGLE_NOINLINE
+#endif
+#elif defined(_MSC_VER)
+#define ANGLE_NOINLINE __declspec(noinline)
+#else
+#define ANGLE_NOINLINE
+#endif
+
 #ifndef ANGLE_STRINGIFY
 #define ANGLE_STRINGIFY(x) #x
 #endif
 
 #ifndef ANGLE_MACRO_STRINGIFY
 #define ANGLE_MACRO_STRINGIFY(x) ANGLE_STRINGIFY(x)
 #endif
 
@@ -250,9 +315,9 @@ std::string ToString(const T &value)
 #endif  // !defined(__has_cpp_attribute)
 
 #if __has_cpp_attribute(nodiscard)
 #define ANGLE_NO_DISCARD [[nodiscard]]
 #else
 #define ANGLE_NO_DISCARD
 #endif  // __has_cpp_attribute(nodiscard)
 
-#endif // COMMON_ANGLEUTILS_H_
+#endif  // COMMON_ANGLEUTILS_H_
--- a/gfx/angle/checkout/src/common/bitset_utils.h
+++ b/gfx/angle/checkout/src/common/bitset_utils.h
@@ -49,17 +49,17 @@ class BitSetT final
     class Iterator final
     {
       public:
         Iterator(const BitSetT &bits);
         Iterator &operator++();
 
         bool operator==(const Iterator &other) const;
         bool operator!=(const Iterator &other) const;
-        std::size_t operator*() const;
+        ParamT operator*() const;
 
       private:
         std::size_t getNextBit();
 
         BitSetT mBitsCopy;
         std::size_t mCurrentBit;
     };
 
@@ -418,17 +418,17 @@ BitSetT<N, BitsT, ParamT>::Iterator::Ite
         mCurrentBit = getNextBit();
     }
 }
 
 template <size_t N, typename BitsT, typename ParamT>
 typename BitSetT<N, BitsT, ParamT>::Iterator &BitSetT<N, BitsT, ParamT>::Iterator::operator++()
 {
     ASSERT(mBitsCopy.any());
-    mBitsCopy.reset(mCurrentBit);
+    mBitsCopy.reset(static_cast<ParamT>(mCurrentBit));
     mCurrentBit = getNextBit();
     return *this;
 }
 
 template <size_t N, typename BitsT, typename ParamT>
 bool BitSetT<N, BitsT, ParamT>::Iterator::operator==(const Iterator &other) const
 {
     return mBitsCopy == other.mBitsCopy;
@@ -436,19 +436,19 @@ bool BitSetT<N, BitsT, ParamT>::Iterator
 
 template <size_t N, typename BitsT, typename ParamT>
 bool BitSetT<N, BitsT, ParamT>::Iterator::operator!=(const Iterator &other) const
 {
     return !(*this == other);
 }
 
 template <size_t N, typename BitsT, typename ParamT>
-std::size_t BitSetT<N, BitsT, ParamT>::Iterator::operator*() const
+ParamT BitSetT<N, BitsT, ParamT>::Iterator::operator*() const
 {
-    return mCurrentBit;
+    return static_cast<ParamT>(mCurrentBit);
 }
 
 template <size_t N, typename BitsT, typename ParamT>
 std::size_t BitSetT<N, BitsT, ParamT>::Iterator::getNextBit()
 {
     if (mBitsCopy.none())
     {
         return 0;
--- a/gfx/angle/checkout/src/common/debug.h
+++ b/gfx/angle/checkout/src/common/debug.h
@@ -306,9 +306,15 @@ std::ostream &FmtHex(std::ostream &os, T
 // A macro for code which is not expected to be reached under valid assumptions
 #define UNREACHABLE()  \
     {                  \
         ASSERT(false); \
     }                  \
     ANGLE_EMPTY_STATEMENT
 #endif  // defined(ANGLE_TRACE_ENABLED) || defined(ANGLE_ENABLE_ASSERTS)
 
+#if defined(ANGLE_PLATFORM_WINDOWS)
+#define ANGLE_FUNCTION __FUNCTION__
+#else
+#define ANGLE_FUNCTION __func__
+#endif
+
 #endif   // COMMON_DEBUG_H_
--- a/gfx/angle/checkout/src/common/event_tracer.cpp
+++ b/gfx/angle/checkout/src/common/event_tracer.cpp
@@ -40,16 +40,15 @@ angle::TraceEventHandle AddTraceEvent(ch
 
     double timestamp = platform->monotonicallyIncreasingTime(platform);
 
     if (timestamp != 0)
     {
         angle::TraceEventHandle handle =
             platform->addTraceEvent(platform, phase, categoryGroupEnabled, name, id, timestamp,
                                     numArgs, argNames, argTypes, argValues, flags);
-        ASSERT(handle != 0);
         return handle;
     }
 
     return static_cast<angle::TraceEventHandle>(0);
 }
 
 }  // namespace angle
--- a/gfx/angle/checkout/src/common/mathutil.h
+++ b/gfx/angle/checkout/src/common/mathutil.h
@@ -147,29 +147,29 @@ inline bool supportsSSE2()
     static bool checked  = false;
     static bool supports = false;
 
     if (checked)
     {
         return supports;
     }
 
-#if defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM)
+#if defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM) && !defined(_M_ARM64)
     {
         int info[4];
         __cpuid(info, 0);
 
         if (info[0] >= 1)
         {
             __cpuid(info, 1);
 
             supports = (info[3] >> 26) & 1;
         }
     }
-#endif  // defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM)
+#endif  // defined(ANGLE_PLATFORM_WINDOWS) && !defined(_M_ARM) && !defined(_M_ARM64)
     checked = true;
     return supports;
 #else  // defined(ANGLE_USE_SSE)
     return false;
 #endif
 }
 
 template <typename destType, typename sourceType>
@@ -951,16 +951,26 @@ inline int BitCount(uint32_t bits)
 #if defined(ANGLE_IS_64_BIT_CPU)
 inline int BitCount(uint64_t bits)
 {
     return __builtin_popcountll(bits);
 }
 #endif  // defined(ANGLE_IS_64_BIT_CPU)
 #endif  // defined(ANGLE_PLATFORM_POSIX)
 
+inline int BitCount(uint8_t bits)
+{
+    return BitCount(static_cast<uint32_t>(bits));
+}
+
+inline int BitCount(uint16_t bits)
+{
+    return BitCount(static_cast<uint32_t>(bits));
+}
+
 #if defined(ANGLE_PLATFORM_WINDOWS)
 // Return the index of the least significant bit set. Indexing is such that bit 0 is the least
 // significant bit. Implemented for different bit widths on different platforms.
 inline unsigned long ScanForward(uint32_t bits)
 {
     ASSERT(bits != 0u);
     unsigned long firstBitIndex = 0ul;
     unsigned char ret           = _BitScanForward(&firstBitIndex, bits);
@@ -991,16 +1001,26 @@ inline unsigned long ScanForward(uint32_
 inline unsigned long ScanForward(uint64_t bits)
 {
     ASSERT(bits != 0u);
     return static_cast<unsigned long>(__builtin_ctzll(bits));
 }
 #endif  // defined(ANGLE_IS_64_BIT_CPU)
 #endif  // defined(ANGLE_PLATFORM_POSIX)
 
+inline unsigned long ScanForward(uint8_t bits)
+{
+    return ScanForward(static_cast<uint32_t>(bits));
+}
+
+inline unsigned long ScanForward(uint16_t bits)
+{
+    return ScanForward(static_cast<uint32_t>(bits));
+}
+
 // Return the index of the most significant bit set. Indexing is such that bit 0 is the least
 // significant bit.
 inline unsigned long ScanReverse(unsigned long bits)
 {
     ASSERT(bits != 0u);
 #if defined(ANGLE_PLATFORM_WINDOWS)
     unsigned long lastBitIndex = 0ul;
     unsigned char ret          = _BitScanReverse(&lastBitIndex, bits);
@@ -1128,16 +1148,27 @@ inline int32_t WrappingMul(int32_t lhs, 
     int64_t resultWide = lhsWide * rhsWide;
     // Implement the desired wrapping behavior by masking out the high-order 32 bits.
     resultWide = resultWide & 0xffffffffll;
     // Casting to a narrower signed type is fine since the casted value is representable in the
     // narrower type.
     return static_cast<int32_t>(resultWide);
 }
 
+inline float scaleScreenDimensionToNdc(float dimensionScreen, float viewportDimension)
+{
+    return 2.0f * dimensionScreen / viewportDimension;
+}
+
+inline float scaleScreenCoordinateToNdc(float coordinateScreen, float viewportDimension)
+{
+    float halfShifted = coordinateScreen / viewportDimension;
+    return 2.0f * (halfShifted - 0.5f);
+}
+
 }  // namespace gl
 
 namespace rx
 {
 
 template <typename T>
 T roundUp(const T value, const T alignment)
 {
--- a/gfx/angle/checkout/src/common/platform.h
+++ b/gfx/angle/checkout/src/common/platform.h
@@ -79,17 +79,17 @@
 #           include <dxgidebug.h>
 #       endif
 #   endif
 
 #   undef near
 #   undef far
 #endif
 
-#if defined(_MSC_VER) && !defined(_M_ARM)
+#if defined(_MSC_VER) && !defined(_M_ARM) && !defined(_M_ARM64)
 #include <intrin.h>
 #define ANGLE_USE_SSE
 #elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
 #include <x86intrin.h>
 #define ANGLE_USE_SSE
 #endif
 
 // Mips and arm devices need to include stddef for size_t.
--- a/gfx/angle/checkout/src/common/system_utils.h
+++ b/gfx/angle/checkout/src/common/system_utils.h
@@ -16,15 +16,16 @@ namespace angle
 {
 
 const char *GetExecutablePath();
 const char *GetExecutableDirectory();
 const char *GetSharedLibraryExtension();
 Optional<std::string> GetCWD();
 bool SetCWD(const char *dirName);
 bool SetEnvironmentVar(const char *variableName, const char *value);
+bool UnsetEnvironmentVar(const char *variableName);
 std::string GetEnvironmentVar(const char *variableName);
 const char *GetPathSeparator();
 bool PrependPathToEnvironmentVar(const char *variableName, const char *path);
 
 }  // namespace angle
 
 #endif  // COMMON_SYSTEM_UTILS_H_
--- a/gfx/angle/checkout/src/common/system_utils_linux.cpp
+++ b/gfx/angle/checkout/src/common/system_utils_linux.cpp
@@ -76,16 +76,21 @@ Optional<std::string> GetCWD()
     return std::string(pathBuf.data());
 }
 
 bool SetCWD(const char *dirName)
 {
     return (chdir(dirName) == 0);
 }
 
+bool UnsetEnvironmentVar(const char *variableName)
+{
+    return (unsetenv(variableName) == 0);
+}
+
 bool SetEnvironmentVar(const char *variableName, const char *value)
 {
     return (setenv(variableName, value, 1) == 0);
 }
 
 std::string GetEnvironmentVar(const char *variableName)
 {
     const char *value = getenv(variableName);
--- a/gfx/angle/checkout/src/common/system_utils_mac.cpp
+++ b/gfx/angle/checkout/src/common/system_utils_mac.cpp
@@ -81,16 +81,21 @@ Optional<std::string> GetCWD()
     return std::string(pathBuf.data());
 }
 
 bool SetCWD(const char *dirName)
 {
     return (chdir(dirName) == 0);
 }
 
+bool UnsetEnvironmentVar(const char *variableName)
+{
+    return (unsetenv(variableName) == 0);
+}
+
 bool SetEnvironmentVar(const char *variableName, const char *value)
 {
     return (setenv(variableName, value, 1) == 0);
 }
 
 std::string GetEnvironmentVar(const char *variableName)
 {
     const char *value = getenv(variableName);
--- a/gfx/angle/checkout/src/common/system_utils_win.cpp
+++ b/gfx/angle/checkout/src/common/system_utils_win.cpp
@@ -66,16 +66,21 @@ Optional<std::string> GetCWD()
     return std::string(pathBuf.data());
 }
 
 bool SetCWD(const char *dirName)
 {
     return (SetCurrentDirectoryA(dirName) == TRUE);
 }
 
+bool UnsetEnvironmentVar(const char *variableName)
+{
+    return (SetEnvironmentVariableA(variableName, nullptr) == TRUE);
+}
+
 bool SetEnvironmentVar(const char *variableName, const char *value)
 {
     return (SetEnvironmentVariableA(variableName, value) == TRUE);
 }
 
 std::string GetEnvironmentVar(const char *variableName)
 {
     std::array<char, MAX_PATH> oldValue;
--- a/gfx/angle/checkout/src/common/uniform_type_info_autogen.cpp
+++ b/gfx/angle/checkout/src/common/uniform_type_info_autogen.cpp
@@ -1,12 +1,12 @@
 // GENERATED FILE - DO NOT EDIT.
 // Generated by gen_uniform_type_table.py.
 //
-// Copyright 2017 The ANGLE Project Authors. All rights reserved.
+// Copyright 2018 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.
 //
 // Uniform type info table:
 //   Metadata about a particular uniform format, indexed by GL type.
 
 #include <array>
 #include "common/utilities.h"
--- a/gfx/angle/checkout/src/common/utilities.cpp
+++ b/gfx/angle/checkout/src/common/utilities.cpp
@@ -9,20 +9,20 @@
 #include "common/utilities.h"
 #include <GLSLANG/ShaderVars.h>
 #include "common/mathutil.h"
 #include "common/platform.h"
 
 #include <set>
 
 #if defined(ANGLE_ENABLE_WINDOWS_STORE)
-#  include <wrl.h>
-#  include <wrl/wrappers/corewrappers.h>
-#  include <windows.applicationmodel.core.h>
-#  include <windows.graphics.display.h>
+#include <windows.applicationmodel.core.h>
+#include <windows.graphics.display.h>
+#include <wrl.h>
+#include <wrl/wrappers/corewrappers.h>
 #endif
 
 namespace
 {
 
 template <class IndexType>
 gl::IndexRange ComputeTypedIndexRange(const IndexType *indices,
                                       size_t count,
@@ -97,96 +97,101 @@ namespace gl
 
 int VariableComponentCount(GLenum type)
 {
     return VariableRowCount(type) * VariableColumnCount(type);
 }
 
 GLenum VariableComponentType(GLenum type)
 {
-    switch(type)
+    switch (type)
     {
-      case GL_BOOL:
-      case GL_BOOL_VEC2:
-      case GL_BOOL_VEC3:
-      case GL_BOOL_VEC4:
-        return GL_BOOL;
-      case GL_FLOAT:
-      case GL_FLOAT_VEC2:
-      case GL_FLOAT_VEC3:
-      case GL_FLOAT_VEC4:
-      case GL_FLOAT_MAT2:
-      case GL_FLOAT_MAT3:
-      case GL_FLOAT_MAT4:
-      case GL_FLOAT_MAT2x3:
-      case GL_FLOAT_MAT3x2:
-      case GL_FLOAT_MAT2x4:
-      case GL_FLOAT_MAT4x2:
-      case GL_FLOAT_MAT3x4:
-      case GL_FLOAT_MAT4x3:
-        return GL_FLOAT;
-      case GL_INT:
-      case GL_SAMPLER_2D:
-      case GL_SAMPLER_2D_RECT_ANGLE:
-      case GL_SAMPLER_3D:
-      case GL_SAMPLER_CUBE:
-      case GL_SAMPLER_2D_ARRAY:
-      case GL_SAMPLER_EXTERNAL_OES:
-      case GL_SAMPLER_2D_MULTISAMPLE:
-      case GL_INT_SAMPLER_2D:
-      case GL_INT_SAMPLER_3D:
-      case GL_INT_SAMPLER_CUBE:
-      case GL_INT_SAMPLER_2D_ARRAY:
-      case GL_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_UNSIGNED_INT_SAMPLER_2D:
-      case GL_UNSIGNED_INT_SAMPLER_3D:
-      case GL_UNSIGNED_INT_SAMPLER_CUBE:
-      case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
-      case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_2D_SHADOW:
-      case GL_SAMPLER_CUBE_SHADOW:
-      case GL_SAMPLER_2D_ARRAY_SHADOW:
-      case GL_INT_VEC2:
-      case GL_INT_VEC3:
-      case GL_INT_VEC4:
-      case GL_IMAGE_2D:
-      case GL_INT_IMAGE_2D:
-      case GL_UNSIGNED_INT_IMAGE_2D:
-      case GL_IMAGE_3D:
-      case GL_INT_IMAGE_3D:
-      case GL_UNSIGNED_INT_IMAGE_3D:
-      case GL_IMAGE_2D_ARRAY:
-      case GL_INT_IMAGE_2D_ARRAY:
-      case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
-      case GL_IMAGE_CUBE:
-      case GL_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_ATOMIC_COUNTER:
-          return GL_INT;
-      case GL_UNSIGNED_INT:
-      case GL_UNSIGNED_INT_VEC2:
-      case GL_UNSIGNED_INT_VEC3:
-      case GL_UNSIGNED_INT_VEC4:
-        return GL_UNSIGNED_INT;
-      default:
-        UNREACHABLE();
+        case GL_BOOL:
+        case GL_BOOL_VEC2:
+        case GL_BOOL_VEC3:
+        case GL_BOOL_VEC4:
+            return GL_BOOL;
+        case GL_FLOAT:
+        case GL_FLOAT_VEC2:
+        case GL_FLOAT_VEC3:
+        case GL_FLOAT_VEC4:
+        case GL_FLOAT_MAT2:
+        case GL_FLOAT_MAT3:
+        case GL_FLOAT_MAT4:
+        case GL_FLOAT_MAT2x3:
+        case GL_FLOAT_MAT3x2:
+        case GL_FLOAT_MAT2x4:
+        case GL_FLOAT_MAT4x2:
+        case GL_FLOAT_MAT3x4:
+        case GL_FLOAT_MAT4x3:
+            return GL_FLOAT;
+        case GL_INT:
+        case GL_SAMPLER_2D:
+        case GL_SAMPLER_2D_RECT_ANGLE:
+        case GL_SAMPLER_3D:
+        case GL_SAMPLER_CUBE:
+        case GL_SAMPLER_2D_ARRAY:
+        case GL_SAMPLER_EXTERNAL_OES:
+        case GL_SAMPLER_2D_MULTISAMPLE:
+        case GL_INT_SAMPLER_2D:
+        case GL_INT_SAMPLER_3D:
+        case GL_INT_SAMPLER_CUBE:
+        case GL_INT_SAMPLER_2D_ARRAY:
+        case GL_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_UNSIGNED_INT_SAMPLER_2D:
+        case GL_UNSIGNED_INT_SAMPLER_3D:
+        case GL_UNSIGNED_INT_SAMPLER_CUBE:
+        case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+        case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_2D_SHADOW:
+        case GL_SAMPLER_CUBE_SHADOW:
+        case GL_SAMPLER_2D_ARRAY_SHADOW:
+        case GL_INT_VEC2:
+        case GL_INT_VEC3:
+        case GL_INT_VEC4:
+        case GL_IMAGE_2D:
+        case GL_INT_IMAGE_2D:
+        case GL_UNSIGNED_INT_IMAGE_2D:
+        case GL_IMAGE_3D:
+        case GL_INT_IMAGE_3D:
+        case GL_UNSIGNED_INT_IMAGE_3D:
+        case GL_IMAGE_2D_ARRAY:
+        case GL_INT_IMAGE_2D_ARRAY:
+        case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+        case GL_IMAGE_CUBE:
+        case GL_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+            return GL_INT;
+        case GL_UNSIGNED_INT:
+        case GL_UNSIGNED_INT_VEC2:
+        case GL_UNSIGNED_INT_VEC3:
+        case GL_UNSIGNED_INT_VEC4:
+            return GL_UNSIGNED_INT;
+        default:
+            UNREACHABLE();
     }
 
     return GL_NONE;
 }
 
 size_t VariableComponentSize(GLenum type)
 {
-    switch(type)
+    switch (type)
     {
-      case GL_BOOL:         return sizeof(GLint);
-      case GL_FLOAT:        return sizeof(GLfloat);
-      case GL_INT:          return sizeof(GLint);
-      case GL_UNSIGNED_INT: return sizeof(GLuint);
-      default:       UNREACHABLE();
+        case GL_BOOL:
+            return sizeof(GLint);
+        case GL_FLOAT:
+            return sizeof(GLfloat);
+        case GL_INT:
+            return sizeof(GLint);
+        case GL_UNSIGNED_INT:
+            return sizeof(GLuint);
+        default:
+            UNREACHABLE();
     }
 
     return 0;
 }
 
 size_t VariableInternalSize(GLenum type)
 {
     // Expanded to 4-element vectors
@@ -197,214 +202,214 @@ size_t VariableExternalSize(GLenum type)
 {
     return VariableComponentSize(VariableComponentType(type)) * VariableComponentCount(type);
 }
 
 GLenum VariableBoolVectorType(GLenum type)
 {
     switch (type)
     {
-      case GL_FLOAT:
-      case GL_INT:
-      case GL_UNSIGNED_INT:
-        return GL_BOOL;
-      case GL_FLOAT_VEC2:
-      case GL_INT_VEC2:
-      case GL_UNSIGNED_INT_VEC2:
-        return GL_BOOL_VEC2;
-      case GL_FLOAT_VEC3:
-      case GL_INT_VEC3:
-      case GL_UNSIGNED_INT_VEC3:
-        return GL_BOOL_VEC3;
-      case GL_FLOAT_VEC4:
-      case GL_INT_VEC4:
-      case GL_UNSIGNED_INT_VEC4:
-        return GL_BOOL_VEC4;
+        case GL_FLOAT:
+        case GL_INT:
+        case GL_UNSIGNED_INT:
+            return GL_BOOL;
+        case GL_FLOAT_VEC2:
+        case GL_INT_VEC2:
+        case GL_UNSIGNED_INT_VEC2:
+            return GL_BOOL_VEC2;
+        case GL_FLOAT_VEC3:
+        case GL_INT_VEC3:
+        case GL_UNSIGNED_INT_VEC3:
+            return GL_BOOL_VEC3;
+        case GL_FLOAT_VEC4:
+        case GL_INT_VEC4:
+        case GL_UNSIGNED_INT_VEC4:
+            return GL_BOOL_VEC4;
 
-      default:
-        UNREACHABLE();
-        return GL_NONE;
+        default:
+            UNREACHABLE();
+            return GL_NONE;
     }
 }
 
 int VariableRowCount(GLenum type)
 {
     switch (type)
     {
-      case GL_NONE:
-        return 0;
-      case GL_BOOL:
-      case GL_FLOAT:
-      case GL_INT:
-      case GL_UNSIGNED_INT:
-      case GL_BOOL_VEC2:
-      case GL_FLOAT_VEC2:
-      case GL_INT_VEC2:
-      case GL_UNSIGNED_INT_VEC2:
-      case GL_BOOL_VEC3:
-      case GL_FLOAT_VEC3:
-      case GL_INT_VEC3:
-      case GL_UNSIGNED_INT_VEC3:
-      case GL_BOOL_VEC4:
-      case GL_FLOAT_VEC4:
-      case GL_INT_VEC4:
-      case GL_UNSIGNED_INT_VEC4:
-      case GL_SAMPLER_2D:
-      case GL_SAMPLER_3D:
-      case GL_SAMPLER_CUBE:
-      case GL_SAMPLER_2D_ARRAY:
-      case GL_SAMPLER_EXTERNAL_OES:
-      case GL_SAMPLER_2D_RECT_ANGLE:
-      case GL_SAMPLER_2D_MULTISAMPLE:
-      case GL_INT_SAMPLER_2D:
-      case GL_INT_SAMPLER_3D:
-      case GL_INT_SAMPLER_CUBE:
-      case GL_INT_SAMPLER_2D_ARRAY:
-      case GL_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_UNSIGNED_INT_SAMPLER_2D:
-      case GL_UNSIGNED_INT_SAMPLER_3D:
-      case GL_UNSIGNED_INT_SAMPLER_CUBE:
-      case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
-      case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_2D_SHADOW:
-      case GL_SAMPLER_CUBE_SHADOW:
-      case GL_SAMPLER_2D_ARRAY_SHADOW:
-      case GL_IMAGE_2D:
-      case GL_INT_IMAGE_2D:
-      case GL_UNSIGNED_INT_IMAGE_2D:
-      case GL_IMAGE_2D_ARRAY:
-      case GL_INT_IMAGE_2D_ARRAY:
-      case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
-      case GL_IMAGE_3D:
-      case GL_INT_IMAGE_3D:
-      case GL_UNSIGNED_INT_IMAGE_3D:
-      case GL_IMAGE_CUBE:
-      case GL_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_ATOMIC_COUNTER:
-          return 1;
-      case GL_FLOAT_MAT2:
-      case GL_FLOAT_MAT3x2:
-      case GL_FLOAT_MAT4x2:
-        return 2;
-      case GL_FLOAT_MAT3:
-      case GL_FLOAT_MAT2x3:
-      case GL_FLOAT_MAT4x3:
-        return 3;
-      case GL_FLOAT_MAT4:
-      case GL_FLOAT_MAT2x4:
-      case GL_FLOAT_MAT3x4:
-        return 4;
-      default:
-        UNREACHABLE();
+        case GL_NONE:
+            return 0;
+        case GL_BOOL:
+        case GL_FLOAT:
+        case GL_INT:
+        case GL_UNSIGNED_INT:
+        case GL_BOOL_VEC2:
+        case GL_FLOAT_VEC2:
+        case GL_INT_VEC2:
+        case GL_UNSIGNED_INT_VEC2:
+        case GL_BOOL_VEC3:
+        case GL_FLOAT_VEC3:
+        case GL_INT_VEC3:
+        case GL_UNSIGNED_INT_VEC3:
+        case GL_BOOL_VEC4:
+        case GL_FLOAT_VEC4:
+        case GL_INT_VEC4:
+        case GL_UNSIGNED_INT_VEC4:
+        case GL_SAMPLER_2D:
+        case GL_SAMPLER_3D:
+        case GL_SAMPLER_CUBE:
+        case GL_SAMPLER_2D_ARRAY:
+        case GL_SAMPLER_EXTERNAL_OES:
+        case GL_SAMPLER_2D_RECT_ANGLE:
+        case GL_SAMPLER_2D_MULTISAMPLE:
+        case GL_INT_SAMPLER_2D:
+        case GL_INT_SAMPLER_3D:
+        case GL_INT_SAMPLER_CUBE:
+        case GL_INT_SAMPLER_2D_ARRAY:
+        case GL_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_UNSIGNED_INT_SAMPLER_2D:
+        case GL_UNSIGNED_INT_SAMPLER_3D:
+        case GL_UNSIGNED_INT_SAMPLER_CUBE:
+        case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+        case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_2D_SHADOW:
+        case GL_SAMPLER_CUBE_SHADOW:
+        case GL_SAMPLER_2D_ARRAY_SHADOW:
+        case GL_IMAGE_2D:
+        case GL_INT_IMAGE_2D:
+        case GL_UNSIGNED_INT_IMAGE_2D:
+        case GL_IMAGE_2D_ARRAY:
+        case GL_INT_IMAGE_2D_ARRAY:
+        case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+        case GL_IMAGE_3D:
+        case GL_INT_IMAGE_3D:
+        case GL_UNSIGNED_INT_IMAGE_3D:
+        case GL_IMAGE_CUBE:
+        case GL_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+            return 1;
+        case GL_FLOAT_MAT2:
+        case GL_FLOAT_MAT3x2:
+        case GL_FLOAT_MAT4x2:
+            return 2;
+        case GL_FLOAT_MAT3:
+        case GL_FLOAT_MAT2x3:
+        case GL_FLOAT_MAT4x3:
+            return 3;
+        case GL_FLOAT_MAT4:
+        case GL_FLOAT_MAT2x4:
+        case GL_FLOAT_MAT3x4:
+            return 4;
+        default:
+            UNREACHABLE();
     }
 
     return 0;
 }
 
 int VariableColumnCount(GLenum type)
 {
     switch (type)
     {
-      case GL_NONE:
-        return 0;
-      case GL_BOOL:
-      case GL_FLOAT:
-      case GL_INT:
-      case GL_UNSIGNED_INT:
-      case GL_SAMPLER_2D:
-      case GL_SAMPLER_3D:
-      case GL_SAMPLER_CUBE:
-      case GL_SAMPLER_2D_ARRAY:
-      case GL_SAMPLER_2D_MULTISAMPLE:
-      case GL_INT_SAMPLER_2D:
-      case GL_INT_SAMPLER_3D:
-      case GL_INT_SAMPLER_CUBE:
-      case GL_INT_SAMPLER_2D_ARRAY:
-      case GL_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_EXTERNAL_OES:
-      case GL_SAMPLER_2D_RECT_ANGLE:
-      case GL_UNSIGNED_INT_SAMPLER_2D:
-      case GL_UNSIGNED_INT_SAMPLER_3D:
-      case GL_UNSIGNED_INT_SAMPLER_CUBE:
-      case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
-      case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_2D_SHADOW:
-      case GL_SAMPLER_CUBE_SHADOW:
-      case GL_SAMPLER_2D_ARRAY_SHADOW:
-      case GL_IMAGE_2D:
-      case GL_INT_IMAGE_2D:
-      case GL_UNSIGNED_INT_IMAGE_2D:
-      case GL_IMAGE_3D:
-      case GL_INT_IMAGE_3D:
-      case GL_UNSIGNED_INT_IMAGE_3D:
-      case GL_IMAGE_2D_ARRAY:
-      case GL_INT_IMAGE_2D_ARRAY:
-      case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
-      case GL_IMAGE_CUBE:
-      case GL_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_ATOMIC_COUNTER:
-          return 1;
-      case GL_BOOL_VEC2:
-      case GL_FLOAT_VEC2:
-      case GL_INT_VEC2:
-      case GL_UNSIGNED_INT_VEC2:
-      case GL_FLOAT_MAT2:
-      case GL_FLOAT_MAT2x3:
-      case GL_FLOAT_MAT2x4:
-        return 2;
-      case GL_BOOL_VEC3:
-      case GL_FLOAT_VEC3:
-      case GL_INT_VEC3:
-      case GL_UNSIGNED_INT_VEC3:
-      case GL_FLOAT_MAT3:
-      case GL_FLOAT_MAT3x2:
-      case GL_FLOAT_MAT3x4:
-        return 3;
-      case GL_BOOL_VEC4:
-      case GL_FLOAT_VEC4:
-      case GL_INT_VEC4:
-      case GL_UNSIGNED_INT_VEC4:
-      case GL_FLOAT_MAT4:
-      case GL_FLOAT_MAT4x2:
-      case GL_FLOAT_MAT4x3:
-        return 4;
-      default:
-        UNREACHABLE();
+        case GL_NONE:
+            return 0;
+        case GL_BOOL:
+        case GL_FLOAT:
+        case GL_INT:
+        case GL_UNSIGNED_INT:
+        case GL_SAMPLER_2D:
+        case GL_SAMPLER_3D:
+        case GL_SAMPLER_CUBE:
+        case GL_SAMPLER_2D_ARRAY:
+        case GL_SAMPLER_2D_MULTISAMPLE:
+        case GL_INT_SAMPLER_2D:
+        case GL_INT_SAMPLER_3D:
+        case GL_INT_SAMPLER_CUBE:
+        case GL_INT_SAMPLER_2D_ARRAY:
+        case GL_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_EXTERNAL_OES:
+        case GL_SAMPLER_2D_RECT_ANGLE:
+        case GL_UNSIGNED_INT_SAMPLER_2D:
+        case GL_UNSIGNED_INT_SAMPLER_3D:
+        case GL_UNSIGNED_INT_SAMPLER_CUBE:
+        case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+        case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_2D_SHADOW:
+        case GL_SAMPLER_CUBE_SHADOW:
+        case GL_SAMPLER_2D_ARRAY_SHADOW:
+        case GL_IMAGE_2D:
+        case GL_INT_IMAGE_2D:
+        case GL_UNSIGNED_INT_IMAGE_2D:
+        case GL_IMAGE_3D:
+        case GL_INT_IMAGE_3D:
+        case GL_UNSIGNED_INT_IMAGE_3D:
+        case GL_IMAGE_2D_ARRAY:
+        case GL_INT_IMAGE_2D_ARRAY:
+        case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+        case GL_IMAGE_CUBE:
+        case GL_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+            return 1;
+        case GL_BOOL_VEC2:
+        case GL_FLOAT_VEC2:
+        case GL_INT_VEC2:
+        case GL_UNSIGNED_INT_VEC2:
+        case GL_FLOAT_MAT2:
+        case GL_FLOAT_MAT2x3:
+        case GL_FLOAT_MAT2x4:
+            return 2;
+        case GL_BOOL_VEC3:
+        case GL_FLOAT_VEC3:
+        case GL_INT_VEC3:
+        case GL_UNSIGNED_INT_VEC3:
+        case GL_FLOAT_MAT3:
+        case GL_FLOAT_MAT3x2:
+        case GL_FLOAT_MAT3x4:
+            return 3;
+        case GL_BOOL_VEC4:
+        case GL_FLOAT_VEC4:
+        case GL_INT_VEC4:
+        case GL_UNSIGNED_INT_VEC4:
+        case GL_FLOAT_MAT4:
+        case GL_FLOAT_MAT4x2:
+        case GL_FLOAT_MAT4x3:
+            return 4;
+        default:
+            UNREACHABLE();
     }
 
     return 0;
 }
 
 bool IsSamplerType(GLenum type)
 {
     switch (type)
     {
-      case GL_SAMPLER_2D:
-      case GL_SAMPLER_3D:
-      case GL_SAMPLER_CUBE:
-      case GL_SAMPLER_2D_ARRAY:
-      case GL_SAMPLER_EXTERNAL_OES:
-      case GL_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_2D_RECT_ANGLE:
-      case GL_INT_SAMPLER_2D:
-      case GL_INT_SAMPLER_3D:
-      case GL_INT_SAMPLER_CUBE:
-      case GL_INT_SAMPLER_2D_ARRAY:
-      case GL_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_UNSIGNED_INT_SAMPLER_2D:
-      case GL_UNSIGNED_INT_SAMPLER_3D:
-      case GL_UNSIGNED_INT_SAMPLER_CUBE:
-      case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
-      case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_2D_SHADOW:
-      case GL_SAMPLER_CUBE_SHADOW:
-      case GL_SAMPLER_2D_ARRAY_SHADOW:
-        return true;
+        case GL_SAMPLER_2D:
+        case GL_SAMPLER_3D:
+        case GL_SAMPLER_CUBE:
+        case GL_SAMPLER_2D_ARRAY:
+        case GL_SAMPLER_EXTERNAL_OES:
+        case GL_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_2D_RECT_ANGLE:
+        case GL_INT_SAMPLER_2D:
+        case GL_INT_SAMPLER_3D:
+        case GL_INT_SAMPLER_CUBE:
+        case GL_INT_SAMPLER_2D_ARRAY:
+        case GL_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_UNSIGNED_INT_SAMPLER_2D:
+        case GL_UNSIGNED_INT_SAMPLER_3D:
+        case GL_UNSIGNED_INT_SAMPLER_CUBE:
+        case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+        case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_2D_SHADOW:
+        case GL_SAMPLER_CUBE_SHADOW:
+        case GL_SAMPLER_2D_ARRAY_SHADOW:
+            return true;
     }
 
     return false;
 }
 
 bool IsImageType(GLenum type)
 {
     switch (type)
@@ -446,26 +451,37 @@ GLenum TransposeMatrixType(GLenum type)
 {
     if (!IsMatrixType(type))
     {
         return type;
     }
 
     switch (type)
     {
-      case GL_FLOAT_MAT2:   return GL_FLOAT_MAT2;
-      case GL_FLOAT_MAT3:   return GL_FLOAT_MAT3;
-      case GL_FLOAT_MAT4:   return GL_FLOAT_MAT4;
-      case GL_FLOAT_MAT2x3: return GL_FLOAT_MAT3x2;
-      case GL_FLOAT_MAT3x2: return GL_FLOAT_MAT2x3;
-      case GL_FLOAT_MAT2x4: return GL_FLOAT_MAT4x2;
-      case GL_FLOAT_MAT4x2: return GL_FLOAT_MAT2x4;
-      case GL_FLOAT_MAT3x4: return GL_FLOAT_MAT4x3;
-      case GL_FLOAT_MAT4x3: return GL_FLOAT_MAT3x4;
-      default: UNREACHABLE(); return GL_NONE;
+        case GL_FLOAT_MAT2:
+            return GL_FLOAT_MAT2;
+        case GL_FLOAT_MAT3:
+            return GL_FLOAT_MAT3;
+        case GL_FLOAT_MAT4:
+            return GL_FLOAT_MAT4;
+        case GL_FLOAT_MAT2x3:
+            return GL_FLOAT_MAT3x2;
+        case GL_FLOAT_MAT3x2:
+            return GL_FLOAT_MAT2x3;
+        case GL_FLOAT_MAT2x4:
+            return GL_FLOAT_MAT4x2;
+        case GL_FLOAT_MAT4x2:
+            return GL_FLOAT_MAT2x4;
+        case GL_FLOAT_MAT3x4:
+            return GL_FLOAT_MAT4x3;
+        case GL_FLOAT_MAT4x3:
+            return GL_FLOAT_MAT3x4;
+        default:
+            UNREACHABLE();
+            return GL_NONE;
     }
 }
 
 int MatrixRegisterCount(GLenum type, bool isRowMajorMatrix)
 {
     ASSERT(IsMatrixType(type));
     return isRowMajorMatrix ? VariableRowCount(type) : VariableColumnCount(type);
 }
@@ -480,17 +496,18 @@ int VariableRegisterCount(GLenum type)
 {
     return IsMatrixType(type) ? VariableColumnCount(type) : 1;
 }
 
 int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize)
 {
     ASSERT(allocationSize <= bitsSize);
 
-    unsigned int mask = std::numeric_limits<unsigned int>::max() >> (std::numeric_limits<unsigned int>::digits - allocationSize);
+    unsigned int mask = std::numeric_limits<unsigned int>::max() >>
+                        (std::numeric_limits<unsigned int>::digits - allocationSize);
 
     for (unsigned int i = 0; i < bitsSize - allocationSize + 1; i++)
     {
         if ((*bits & mask) == 0)
         {
             *bits |= mask;
             return i;
         }
@@ -537,30 +554,31 @@ GLuint GetPrimitiveRestartIndex(GLenum i
         case GL_UNSIGNED_INT:
             return 0xFFFFFFFF;
         default:
             UNREACHABLE();
             return 0;
     }
 }
 
-bool IsTriangleMode(GLenum drawMode)
+bool IsTriangleMode(PrimitiveMode drawMode)
 {
     switch (drawMode)
     {
-      case GL_TRIANGLES:
-      case GL_TRIANGLE_FAN:
-      case GL_TRIANGLE_STRIP:
-        return true;
-      case GL_POINTS:
-      case GL_LINES:
-      case GL_LINE_LOOP:
-      case GL_LINE_STRIP:
-        return false;
-      default: UNREACHABLE();
+        case PrimitiveMode::Triangles:
+        case PrimitiveMode::TriangleFan:
+        case PrimitiveMode::TriangleStrip:
+            return true;
+        case PrimitiveMode::Points:
+        case PrimitiveMode::Lines:
+        case PrimitiveMode::LineLoop:
+        case PrimitiveMode::LineStrip:
+            return false;
+        default:
+            UNREACHABLE();
     }
 
     return false;
 }
 
 bool IsIntegerFormat(GLenum unsizedFormat)
 {
     switch (unsizedFormat)
@@ -577,100 +595,100 @@ bool IsIntegerFormat(GLenum unsizedForma
 }
 
 // [OpenGL ES SL 3.00.4] Section 11 p. 120
 // Vertex Outs/Fragment Ins packing priorities
 int VariableSortOrder(GLenum type)
 {
     switch (type)
     {
-      // 1. Arrays of mat4 and mat4
-      // Non-square matrices of type matCxR consume the same space as a square
-      // matrix of type matN where N is the greater of C and R
-      case GL_FLOAT_MAT4:
-      case GL_FLOAT_MAT2x4:
-      case GL_FLOAT_MAT3x4:
-      case GL_FLOAT_MAT4x2:
-      case GL_FLOAT_MAT4x3:
-        return 0;
+        // 1. Arrays of mat4 and mat4
+        // Non-square matrices of type matCxR consume the same space as a square
+        // matrix of type matN where N is the greater of C and R
+        case GL_FLOAT_MAT4:
+        case GL_FLOAT_MAT2x4:
+        case GL_FLOAT_MAT3x4:
+        case GL_FLOAT_MAT4x2:
+        case GL_FLOAT_MAT4x3:
+            return 0;
 
-      // 2. Arrays of mat2 and mat2 (since they occupy full rows)
-      case GL_FLOAT_MAT2:
-        return 1;
+        // 2. Arrays of mat2 and mat2 (since they occupy full rows)
+        case GL_FLOAT_MAT2:
+            return 1;
 
-      // 3. Arrays of vec4 and vec4
-      case GL_FLOAT_VEC4:
-      case GL_INT_VEC4:
-      case GL_BOOL_VEC4:
-      case GL_UNSIGNED_INT_VEC4:
-        return 2;
+        // 3. Arrays of vec4 and vec4
+        case GL_FLOAT_VEC4:
+        case GL_INT_VEC4:
+        case GL_BOOL_VEC4:
+        case GL_UNSIGNED_INT_VEC4:
+            return 2;
 
-      // 4. Arrays of mat3 and mat3
-      case GL_FLOAT_MAT3:
-      case GL_FLOAT_MAT2x3:
-      case GL_FLOAT_MAT3x2:
-        return 3;
+        // 4. Arrays of mat3 and mat3
+        case GL_FLOAT_MAT3:
+        case GL_FLOAT_MAT2x3:
+        case GL_FLOAT_MAT3x2:
+            return 3;
 
-      // 5. Arrays of vec3 and vec3
-      case GL_FLOAT_VEC3:
-      case GL_INT_VEC3:
-      case GL_BOOL_VEC3:
-      case GL_UNSIGNED_INT_VEC3:
-        return 4;
+        // 5. Arrays of vec3 and vec3
+        case GL_FLOAT_VEC3:
+        case GL_INT_VEC3:
+        case GL_BOOL_VEC3:
+        case GL_UNSIGNED_INT_VEC3:
+            return 4;
 
-      // 6. Arrays of vec2 and vec2
-      case GL_FLOAT_VEC2:
-      case GL_INT_VEC2:
-      case GL_BOOL_VEC2:
-      case GL_UNSIGNED_INT_VEC2:
-        return 5;
+        // 6. Arrays of vec2 and vec2
+        case GL_FLOAT_VEC2:
+        case GL_INT_VEC2:
+        case GL_BOOL_VEC2:
+        case GL_UNSIGNED_INT_VEC2:
+            return 5;
 
-      // 7. Single component types
-      case GL_FLOAT:
-      case GL_INT:
-      case GL_BOOL:
-      case GL_UNSIGNED_INT:
-      case GL_SAMPLER_2D:
-      case GL_SAMPLER_CUBE:
-      case GL_SAMPLER_EXTERNAL_OES:
-      case GL_SAMPLER_2D_RECT_ANGLE:
-      case GL_SAMPLER_2D_ARRAY:
-      case GL_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_3D:
-      case GL_INT_SAMPLER_2D:
-      case GL_INT_SAMPLER_3D:
-      case GL_INT_SAMPLER_CUBE:
-      case GL_INT_SAMPLER_2D_ARRAY:
-      case GL_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_UNSIGNED_INT_SAMPLER_2D:
-      case GL_UNSIGNED_INT_SAMPLER_3D:
-      case GL_UNSIGNED_INT_SAMPLER_CUBE:
-      case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
-      case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
-      case GL_SAMPLER_2D_SHADOW:
-      case GL_SAMPLER_2D_ARRAY_SHADOW:
-      case GL_SAMPLER_CUBE_SHADOW:
-      case GL_IMAGE_2D:
-      case GL_INT_IMAGE_2D:
-      case GL_UNSIGNED_INT_IMAGE_2D:
-      case GL_IMAGE_3D:
-      case GL_INT_IMAGE_3D:
-      case GL_UNSIGNED_INT_IMAGE_3D:
-      case GL_IMAGE_2D_ARRAY:
-      case GL_INT_IMAGE_2D_ARRAY:
-      case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
-      case GL_IMAGE_CUBE:
-      case GL_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_IMAGE_CUBE:
-      case GL_UNSIGNED_INT_ATOMIC_COUNTER:
-          return 6;
+        // 7. Single component types
+        case GL_FLOAT:
+        case GL_INT:
+        case GL_BOOL:
+        case GL_UNSIGNED_INT:
+        case GL_SAMPLER_2D:
+        case GL_SAMPLER_CUBE:
+        case GL_SAMPLER_EXTERNAL_OES:
+        case GL_SAMPLER_2D_RECT_ANGLE:
+        case GL_SAMPLER_2D_ARRAY:
+        case GL_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_3D:
+        case GL_INT_SAMPLER_2D:
+        case GL_INT_SAMPLER_3D:
+        case GL_INT_SAMPLER_CUBE:
+        case GL_INT_SAMPLER_2D_ARRAY:
+        case GL_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_UNSIGNED_INT_SAMPLER_2D:
+        case GL_UNSIGNED_INT_SAMPLER_3D:
+        case GL_UNSIGNED_INT_SAMPLER_CUBE:
+        case GL_UNSIGNED_INT_SAMPLER_2D_ARRAY:
+        case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
+        case GL_SAMPLER_2D_SHADOW:
+        case GL_SAMPLER_2D_ARRAY_SHADOW:
+        case GL_SAMPLER_CUBE_SHADOW:
+        case GL_IMAGE_2D:
+        case GL_INT_IMAGE_2D:
+        case GL_UNSIGNED_INT_IMAGE_2D:
+        case GL_IMAGE_3D:
+        case GL_INT_IMAGE_3D:
+        case GL_UNSIGNED_INT_IMAGE_3D:
+        case GL_IMAGE_2D_ARRAY:
+        case GL_INT_IMAGE_2D_ARRAY:
+        case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+        case GL_IMAGE_CUBE:
+        case GL_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_IMAGE_CUBE:
+        case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+            return 6;
 
-      default:
-        UNREACHABLE();
-        return 0;
+        default:
+            UNREACHABLE();
+            return 0;
     }
 }
 
 std::string ParseResourceName(const std::string &name, std::vector<unsigned int> *outSubscripts)
 {
     if (outSubscripts)
     {
         outSubscripts->clear();
@@ -947,16 +965,22 @@ EGLenum GLComponentTypeToEGLColorCompone
         case GL_UNSIGNED_NORMALIZED:
             return EGL_COLOR_COMPONENT_TYPE_FIXED_EXT;
 
         default:
             UNREACHABLE();
             return EGL_NONE;
     }
 }
+
+EGLClientBuffer GLObjectHandleToEGLClientBuffer(GLuint handle)
+{
+    return reinterpret_cast<EGLClientBuffer>(static_cast<uintptr_t>(handle));
+}
+
 }  // namespace gl_egl
 
 #if !defined(ANGLE_ENABLE_WINDOWS_STORE)
 std::string getTempPath()
 {
 #ifdef ANGLE_PLATFORM_WINDOWS
     char path[MAX_PATH];
     DWORD pathLen = GetTempPathA(sizeof(path) / sizeof(path[0]), path);
@@ -975,31 +999,31 @@ std::string getTempPath()
 
     return path;
 #else
     UNIMPLEMENTED();
     return "";
 #endif
 }
 
-void writeFile(const char* path, const void* content, size_t size)
+void writeFile(const char *path, const void *content, size_t size)
 {
-    FILE* file = fopen(path, "w");
+    FILE *file = fopen(path, "w");
     if (!file)
     {
         UNREACHABLE();
         return;
     }
 
     fwrite(content, sizeof(char), size, file);
     fclose(file);
 }
-#endif // !ANGLE_ENABLE_WINDOWS_STORE
+#endif  // !ANGLE_ENABLE_WINDOWS_STORE
 
-#if defined (ANGLE_PLATFORM_WINDOWS)
+#if defined(ANGLE_PLATFORM_WINDOWS)
 
 // Causes the thread to relinquish the remainder of its time slice to any
 // other thread that is ready to run.If there are no other threads ready
 // to run, the function returns immediately, and the thread continues execution.
 void ScheduleYield()
 {
     Sleep(0);
 }
--- a/gfx/angle/checkout/src/common/utilities.h
+++ b/gfx/angle/checkout/src/common/utilities.h
@@ -12,16 +12,17 @@
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
 
 #include <math.h>
 #include <string>
 #include <vector>
 #include "angle_gl.h"
 
+#include "common/PackedEnums.h"
 #include "common/mathutil.h"
 
 namespace sh
 {
 struct ShaderVariable;
 }
 
 namespace gl
@@ -65,17 +66,17 @@ const sh::ShaderVariable *FindShaderVarF
 IndexRange ComputeIndexRange(GLenum indexType,
                              const GLvoid *indices,
                              size_t count,
                              bool primitiveRestartEnabled);
 
 // Get the primitive restart index value for the given index type.
 GLuint GetPrimitiveRestartIndex(GLenum indexType);
 
-bool IsTriangleMode(GLenum drawMode);
+bool IsTriangleMode(PrimitiveMode drawMode);
 bool IsIntegerFormat(GLenum unsizedFormat);
 
 // Returns the product of the sizes in the vector, or 1 if the vector is empty. Doesn't currently
 // perform overflow checks.
 unsigned int ArraySizeProduct(const std::vector<unsigned int> &arraySizes);
 
 // Return the array index at the end of name, and write the length of name before the final array
 // index into nameLengthWithoutArrayIndexOut. In case name doesn't include an array index, return
@@ -137,17 +138,17 @@ const char *GetGenericErrorMessage(GLenu
 
 unsigned int ElementTypeSize(GLenum elementType);
 
 }  // namespace gl
 
 namespace egl
 {
 static const EGLenum FirstCubeMapTextureTarget = EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR;
-static const EGLenum LastCubeMapTextureTarget = EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR;
+static const EGLenum LastCubeMapTextureTarget  = EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR;
 bool IsCubeMapTextureTarget(EGLenum target);
 size_t CubeMapTextureTargetToLayerIndex(EGLenum target);
 EGLenum LayerIndexToCubeMapTextureTarget(size_t index);
 bool IsTextureTarget(EGLenum target);
 bool IsRenderbufferTarget(EGLenum target);
 
 const char *GetGenericErrorMessage(EGLint error);
 }  // namespace egl
@@ -155,20 +156,21 @@ const char *GetGenericErrorMessage(EGLin
 namespace egl_gl
 {
 GLuint EGLClientBufferToGLObjectHandle(EGLClientBuffer buffer);
 }
 
 namespace gl_egl
 {
 EGLenum GLComponentTypeToEGLColorComponentType(GLenum glComponentType);
+EGLClientBuffer GLObjectHandleToEGLClientBuffer(GLuint handle);
 }  // namespace gl_egl
 
 #if !defined(ANGLE_ENABLE_WINDOWS_STORE)
 std::string getTempPath();
-void writeFile(const char* path, const void* data, size_t size);
+void writeFile(const char *path, const void *data, size_t size);
 #endif
 
-#if defined (ANGLE_PLATFORM_WINDOWS)
+#if defined(ANGLE_PLATFORM_WINDOWS)
 void ScheduleYield();
 #endif
 
 #endif  // COMMON_UTILITIES_H_
--- a/gfx/angle/checkout/src/common/vector_utils.h
+++ b/gfx/angle/checkout/src/common/vector_utils.h
@@ -362,70 +362,70 @@ Vector<Dimension, Type> VectorBase<Dimen
 template <size_t Dimension, typename Type>
 Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator+=(
     const Vector<Dimension, Type> &other)
 {
     for (size_t i = 0; i < Dimension; ++i)
     {
         mData[i] += other.mData[i];
     }
-    return *reinterpret_cast<Vector<Dimension, Type> *>(this);
+    return *static_cast<Vector<Dimension, Type> *>(this);
 }
 
 template <size_t Dimension, typename Type>
 Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator-=(
     const Vector<Dimension, Type> &other)
 {
     for (size_t i = 0; i < Dimension; ++i)
     {
         mData[i] -= other.mData[i];
     }
-    return *reinterpret_cast<Vector<Dimension, Type> *>(this);
+    return *static_cast<Vector<Dimension, Type> *>(this);
 }
 
 template <size_t Dimension, typename Type>
 Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator*=(
     const Vector<Dimension, Type> &other)
 {
     for (size_t i = 0; i < Dimension; ++i)
     {
         mData[i] *= other.mData[i];
     }
-    return *reinterpret_cast<Vector<Dimension, Type> *>(this);
+    return *static_cast<Vector<Dimension, Type> *>(this);
 }
 
 template <size_t Dimension, typename Type>
 Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator/=(
     const Vector<Dimension, Type> &other)
 {
     for (size_t i = 0; i < Dimension; ++i)
     {
         mData[i] /= other.mData[i];
     }
-    return *reinterpret_cast<Vector<Dimension, Type> *>(this);
+    return *static_cast<Vector<Dimension, Type> *>(this);
 }
 
 template <size_t Dimension, typename Type>
 Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator*=(Type other)
 {
     for (size_t i = 0; i < Dimension; ++i)
     {
         mData[i] *= other;
     }
-    return *reinterpret_cast<Vector<Dimension, Type> *>(this);
+    return *static_cast<Vector<Dimension, Type> *>(this);
 }
 
 template <size_t Dimension, typename Type>
 Vector<Dimension, Type> &VectorBase<Dimension, Type>::operator/=(Type other)
 {
     for (size_t i = 0; i < Dimension; ++i)
     {
         mData[i] /= other;
     }
-    return *reinterpret_cast<Vector<Dimension, Type> *>(this);
+    return *static_cast<Vector<Dimension, Type> *>(this);
 }
 
 // Implementation of comparison operators
 template <size_t Dimension, typename Type>
 bool VectorBase<Dimension, Type>::operator==(const Vector<Dimension, Type> &other) const
 {
     for (size_t i = 0; i < Dimension; ++i)
     {
--- a/gfx/angle/checkout/src/compiler/preprocessor/Token.cpp
+++ b/gfx/angle/checkout/src/compiler/preprocessor/Token.cpp
@@ -60,22 +60,16 @@ bool Token::iValue(int *value) const
 }
 
 bool Token::uValue(unsigned int *value) const
 {
     ASSERT(type == CONST_INT);
     return numeric_lex_int(text, value);
 }
 
-bool Token::fValue(float *value) const
-{
-    ASSERT(type == CONST_FLOAT);
-    return numeric_lex_float(text, value);
-}
-
 std::ostream &operator<<(std::ostream &out, const Token &token)
 {
     if (token.hasLeadingSpace())
         out << " ";
 
     out << token.text;
     return out;
 }
--- a/gfx/angle/checkout/src/compiler/preprocessor/Token.h
+++ b/gfx/angle/checkout/src/compiler/preprocessor/Token.h
@@ -82,17 +82,16 @@ struct Token
 
     bool expansionDisabled() const { return (flags & EXPANSION_DISABLED) != 0; }
     void setExpansionDisabled(bool disable);
 
     // Converts text into numeric value for CONST_INT and CONST_FLOAT token.
     // Returns false if the parsed value cannot fit into an int or float.
     bool iValue(int *value) const;
     bool uValue(unsigned int *value) const;
-    bool fValue(float *value) const;
 
     int type;
     unsigned int flags;
     SourceLocation location;
     std::string text;
 };
 
 inline bool operator==(const Token &lhs, const Token &rhs)
--- a/gfx/angle/checkout/src/compiler/preprocessor/numeric_lex.h
+++ b/gfx/angle/checkout/src/compiler/preprocessor/numeric_lex.h
@@ -4,17 +4,16 @@
 // found in the LICENSE file.
 //
 
 // numeric_lex.h: Functions to extract numeric values from string.
 
 #ifndef COMPILER_PREPROCESSOR_NUMERICLEX_H_
 #define COMPILER_PREPROCESSOR_NUMERICLEX_H_
 
-#include <cmath>
 #include <sstream>
 
 namespace angle
 {
 
 namespace pp
 {
 
@@ -43,29 +42,13 @@ bool numeric_lex_int(const std::string &
     // This should not be necessary, but MSVS has a buggy implementation.
     // It returns incorrect results if the base is not specified.
     stream.setf(numeric_base_int(str), std::ios::basefield);
 
     stream >> (*value);
     return !stream.fail();
 }
 
-template <typename FloatType>
-bool numeric_lex_float(const std::string &str, FloatType *value)
-{
-    std::istringstream stream(str);
-
-// Android NDK forbids access to locales by always throwing instead of only accepting the C locale.
-#if !defined(ANGLE_PLATFORM_ANDROID)
-    // Force "C" locale so that decimal character is always '.', and not dependent on the current
-    // locale.
-    stream.imbue(std::locale::classic());
-#endif
-
-    stream >> (*value);
-    return !stream.fail() && std::isfinite(*value);
-}
-
 }  // namespace pp
 
 }  // namespace angle
 
 #endif  // COMPILER_PREPROCESSOR_NUMERICLEX_H_
--- a/gfx/angle/checkout/src/compiler/translator/BaseTypes.h
+++ b/gfx/angle/checkout/src/compiler/translator/BaseTypes.h
@@ -65,26 +65,29 @@ enum TBasicType
     EbtSampler2D = EbtGuardSamplerBegin,
     EbtSampler3D,
     EbtSamplerCube,
     EbtSampler2DArray,
     EbtSamplerExternalOES,       // Only valid if OES_EGL_image_external exists.
     EbtSamplerExternal2DY2YEXT,  // Only valid if GL_EXT_YUV_target exists.
     EbtSampler2DRect,            // Only valid if GL_ARB_texture_rectangle exists.
     EbtSampler2DMS,
+    EbtSampler2DMSArray,
     EbtISampler2D,
     EbtISampler3D,
     EbtISamplerCube,
     EbtISampler2DArray,
     EbtISampler2DMS,
+    EbtISampler2DMSArray,
     EbtUSampler2D,
     EbtUSampler3D,
     EbtUSamplerCube,
     EbtUSampler2DArray,
     EbtUSampler2DMS,
+    EbtUSampler2DMSArray,
     EbtSampler2DShadow,
     EbtSamplerCubeShadow,
     EbtSampler2DArrayShadow,
     EbtGuardSamplerEnd = EbtSampler2DArrayShadow,  // non type: see implementation of IsSampler()
 
     // images
     EbtGuardImageBegin,
     EbtImage2D = EbtGuardImageBegin,
--- a/gfx/angle/checkout/src/compiler/translator/Common.h
+++ b/gfx/angle/checkout/src/compiler/translator/Common.h
@@ -116,17 +116,17 @@ inline TString str(T i)
     return buffer;
 }
 
 // Allocate a char array in the global memory pool. str must be a null terminated string. strLength
 // is the length without the null terminator.
 inline const char *AllocatePoolCharArray(const char *str, size_t strLength)
 {
     size_t requiredSize = strLength + 1;
-    char *buffer = reinterpret_cast<char *>(GetGlobalPoolAllocator()->allocate(requiredSize));
+    char *buffer        = static_cast<char *>(GetGlobalPoolAllocator()->allocate(requiredSize));
     memcpy(buffer, str, requiredSize);
     ASSERT(buffer[strLength] == '\0');
     return buffer;
 }
 
 }  // namespace sh
 
 namespace std
--- a/gfx/angle/checkout/src/compiler/translator/ExtensionBehavior.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/ExtensionBehavior.cpp
@@ -7,31 +7,32 @@
 // behavior.
 
 #include "compiler/translator/ExtensionBehavior.h"
 
 #include "common/debug.h"
 
 #include <string.h>
 
-#define LIST_EXTENSIONS(OP)             \
-    OP(ARB_texture_rectangle)           \
-    OP(ARM_shader_framebuffer_fetch)    \
-    OP(EXT_blend_func_extended)         \
-    OP(EXT_draw_buffers)                \
-    OP(EXT_frag_depth)                  \
-    OP(EXT_geometry_shader)             \
-    OP(EXT_shader_framebuffer_fetch)    \
-    OP(EXT_shader_texture_lod)          \
-    OP(EXT_YUV_target)                  \
-    OP(NV_EGL_stream_consumer_external) \
-    OP(NV_shader_framebuffer_fetch)     \
-    OP(OES_EGL_image_external)          \
-    OP(OES_EGL_image_external_essl3)    \
-    OP(OES_standard_derivatives)        \
+#define LIST_EXTENSIONS(OP)                      \
+    OP(ARB_texture_rectangle)                    \
+    OP(ARM_shader_framebuffer_fetch)             \
+    OP(EXT_blend_func_extended)                  \
+    OP(EXT_draw_buffers)                         \
+    OP(EXT_frag_depth)                           \
+    OP(EXT_geometry_shader)                      \
+    OP(EXT_shader_framebuffer_fetch)             \
+    OP(EXT_shader_texture_lod)                   \
+    OP(EXT_YUV_target)                           \
+    OP(NV_EGL_stream_consumer_external)          \
+    OP(NV_shader_framebuffer_fetch)              \
+    OP(OES_EGL_image_external)                   \
+    OP(OES_EGL_image_external_essl3)             \
+    OP(OES_standard_derivatives)                 \
+    OP(OES_texture_storage_multisample_2d_array) \
     OP(OVR_multiview)
 
 namespace sh
 {
 
 #define RETURN_EXTENSION_NAME_CASE(ext) \
     case TExtension::ext:               \
         return "GL_" #ext;
--- a/gfx/angle/checkout/src/compiler/translator/ExtensionBehavior.h
+++ b/gfx/angle/checkout/src/compiler/translator/ExtensionBehavior.h
@@ -27,16 +27,17 @@ enum class TExtension
     EXT_shader_framebuffer_fetch,
     EXT_shader_texture_lod,
     EXT_YUV_target,
     NV_EGL_stream_consumer_external,
     NV_shader_framebuffer_fetch,
     OES_EGL_image_external,
     OES_EGL_image_external_essl3,
     OES_standard_derivatives,
+    OES_texture_storage_multisample_2d_array,
     OVR_multiview
 };
 
 enum TBehavior
 {
     EBhRequire,
     EBhEnable,
     EBhWarn,
--- a/gfx/angle/checkout/src/compiler/translator/HashNames.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/HashNames.cpp
@@ -11,20 +11,16 @@
 #include "compiler/translator/IntermNode.h"
 #include "compiler/translator/Symbol.h"
 
 namespace sh
 {
 
 namespace
 {
-
-// GLSL ES 3.00.6 section 3.9: the maximum length of an identifier is 1024 characters.
-static const unsigned int kESSLMaxIdentifierLength = 1024u;
-
 constexpr const ImmutableString kHashedNamePrefix("webgl_");
 
 // Can't prefix with just _ because then we might introduce a double underscore, which is not safe
 // in GLSL (ESSL 3.00.6 section 3.8: All identifiers containing a double underscore are reserved for
 // use by the underlying implementation). u is short for user-defined.
 constexpr const ImmutableString kUnhashedNamePrefix("_u");
 
 ImmutableString HashName(const ImmutableString &name, ShHashFunction64 hashFunction)
@@ -80,17 +76,17 @@ ImmutableString HashName(const Immutable
     }
     return hashedName;
 }
 
 ImmutableString HashName(const TSymbol *symbol, ShHashFunction64 hashFunction, NameMap *nameMap)
 {
     if (symbol->symbolType() == SymbolType::Empty)
     {
-        return ImmutableString("");
+        return kEmptyImmutableString;
     }
     if (symbol->symbolType() == SymbolType::AngleInternal ||
         symbol->symbolType() == SymbolType::BuiltIn)
     {
         return symbol->name();
     }
     return HashName(symbol->name(), hashFunction, nameMap);
 }
--- a/gfx/angle/checkout/src/compiler/translator/ImageFunctionHLSL.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/ImageFunctionHLSL.cpp
@@ -2,34 +2,58 @@
 // Copyright (c) 2017 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.
 //
 // ImageFunctionHLSL: Class for writing implementations of ESSL image functions into HLSL output.
 //
 
 #include "compiler/translator/ImageFunctionHLSL.h"
+#include "compiler/translator/ImmutableStringBuilder.h"
 #include "compiler/translator/UtilsHLSL.h"
 
 namespace sh
 {
 
 // static
+ImmutableString ImageFunctionHLSL::GetImageReference(
+    TInfoSinkBase &out,
+    const ImageFunctionHLSL::ImageFunction &imageFunction)
+{
+    static const ImmutableString kImageIndexStr("[index]");
+    if (imageFunction.readonly)
+    {
+        static const ImmutableString kReadonlyImagesStr("readonlyImages");
+        ImmutableString suffix(
+            TextureGroupSuffix(imageFunction.image, imageFunction.imageInternalFormat));
+        out << "    const uint index = imageIndex - readonlyImageIndexOffset" << suffix.data()
+            << ";\n";
+        ImmutableStringBuilder imageRefBuilder(kReadonlyImagesStr.length() + suffix.length() +
+                                               kImageIndexStr.length());
+        imageRefBuilder << kReadonlyImagesStr << suffix << kImageIndexStr;
+        return imageRefBuilder;
+    }
+    else
+    {
+        static const ImmutableString kImagesStr("images");
+        ImmutableString suffix(
+            RWTextureGroupSuffix(imageFunction.image, imageFunction.imageInternalFormat));
+        out << "    const uint index = imageIndex - imageIndexOffset" << suffix.data() << ";\n";
+        ImmutableStringBuilder imageRefBuilder(kImagesStr.length() + suffix.length() +
+                                               kImageIndexStr.length());
+        imageRefBuilder << kImagesStr << suffix << kImageIndexStr;
+        return imageRefBuilder;
+    }
+}
+
 void ImageFunctionHLSL::OutputImageFunctionArgumentList(
     TInfoSinkBase &out,
     const ImageFunctionHLSL::ImageFunction &imageFunction)
 {
-    if (imageFunction.readonly)
-    {
-        out << TextureString(imageFunction.image, imageFunction.imageInternalFormat) << " tex";
-    }
-    else
-    {
-        out << RWTextureString(imageFunction.image, imageFunction.imageInternalFormat) << " tex";
-    }
+    out << "uint imageIndex";
 
     if (imageFunction.method == ImageFunctionHLSL::ImageFunction::Method::LOAD ||
         imageFunction.method == ImageFunctionHLSL::ImageFunction::Method::STORE)
     {
         switch (imageFunction.image)
         {
             case EbtImage2D:
             case EbtIImage2D:
@@ -79,17 +103,17 @@ void ImageFunctionHLSL::OutputImageFunct
         }
     }
 }
 
 // static
 void ImageFunctionHLSL::OutputImageSizeFunctionBody(
     TInfoSinkBase &out,
     const ImageFunctionHLSL::ImageFunction &imageFunction,
-    const TString &imageReference)
+    const ImmutableString &imageReference)
 {
     if (IsImage3D(imageFunction.image) || IsImage2DArray(imageFunction.image) ||
         IsImageCube(imageFunction.image))
     {
         // "depth" stores either the number of layers in an array texture or 3D depth
         out << "    uint width; uint height; uint depth;\n"
             << "    " << imageReference << ".GetDimensions(width, height, depth);\n";
     }
@@ -110,17 +134,17 @@ void ImageFunctionHLSL::OutputImageSizeF
         out << "    return int2(width, height);\n";
     }
 }
 
 // static
 void ImageFunctionHLSL::OutputImageLoadFunctionBody(
     TInfoSinkBase &out,
     const ImageFunctionHLSL::ImageFunction &imageFunction,
-    const TString &imageReference)
+    const ImmutableString &imageReference)
 {
     if (IsImage3D(imageFunction.image) || IsImage2DArray(imageFunction.image) ||
         IsImageCube(imageFunction.image))
     {
         out << "    return " << imageReference << "[uint3(p.x, p.y, p.z)];\n";
     }
     else if (IsImage2D(imageFunction.image))
     {
@@ -129,57 +153,93 @@ void ImageFunctionHLSL::OutputImageLoadF
     else
         UNREACHABLE();
 }
 
 // static
 void ImageFunctionHLSL::OutputImageStoreFunctionBody(
     TInfoSinkBase &out,
     const ImageFunctionHLSL::ImageFunction &imageFunction,
-    const TString &imageReference)
+    const ImmutableString &imageReference)
 {
     if (IsImage3D(imageFunction.image) || IsImage2DArray(imageFunction.image) ||
         IsImage2D(imageFunction.image) || IsImageCube(imageFunction.image))
     {
         out << "    " << imageReference << "[p] = data;\n";
     }
     else
         UNREACHABLE();
 }
 
-TString ImageFunctionHLSL::ImageFunction::name() const
+ImmutableString ImageFunctionHLSL::ImageFunction::name() const
 {
-    TString name = "gl_image";
+    static const ImmutableString kGlImageName("gl_image");
+
+    ImmutableString suffix(nullptr);
     if (readonly)
     {
-        name += TextureTypeSuffix(image, imageInternalFormat);
+        suffix = ImmutableString(TextureTypeSuffix(image, imageInternalFormat));
     }
     else
     {
-        name += RWTextureTypeSuffix(image, imageInternalFormat);
+        suffix = ImmutableString(RWTextureTypeSuffix(image, imageInternalFormat));
     }
 
+    ImmutableStringBuilder name(kGlImageName.length() + suffix.length() + 5u);
+
+    name << kGlImageName << suffix;
+
     switch (method)
     {
         case Method::SIZE:
-            name += "Size";
+            name << "Size";
             break;
         case Method::LOAD:
-            name += "Load";
+            name << "Load";
             break;
         case Method::STORE:
-            name += "Store";
+            name << "Store";
             break;
         default:
             UNREACHABLE();
     }
 
     return name;
 }
 
+ImageFunctionHLSL::ImageFunction::DataType ImageFunctionHLSL::ImageFunction::getDataType(
+    TLayoutImageInternalFormat format) const
+{
+    switch (format)
+    {
+        case EiifRGBA32F:
+        case EiifRGBA16F:
+        case EiifR32F:
+            return ImageFunction::DataType::FLOAT4;
+        case EiifRGBA32UI:
+        case EiifRGBA16UI:
+        case EiifRGBA8UI:
+        case EiifR32UI:
+            return ImageFunction::DataType::UINT4;
+        case EiifRGBA32I:
+        case EiifRGBA16I:
+        case EiifRGBA8I:
+        case EiifR32I:
+            return ImageFunction::DataType::INT4;
+        case EiifRGBA8:
+            return ImageFunction::DataType::UNORM_FLOAT4;
+        case EiifRGBA8_SNORM:
+            return ImageFunction::DataType::SNORM_FLOAT4;
+        default:
+            UNREACHABLE();
+    }
+
+    return ImageFunction::DataType::NONE;
+}
+
 const char *ImageFunctionHLSL::ImageFunction::getReturnType() const
 {
     if (method == ImageFunction::Method::SIZE)
     {
         switch (image)
         {
             case EbtImage2D:
             case EbtIImage2D:
@@ -230,30 +290,31 @@ const char *ImageFunctionHLSL::ImageFunc
     {
         UNREACHABLE();
     }
     return "";
 }
 
 bool ImageFunctionHLSL::ImageFunction::operator<(const ImageFunction &rhs) const
 {
-    return std::tie(image, imageInternalFormat, readonly, method) <
-           std::tie(rhs.image, rhs.imageInternalFormat, rhs.readonly, rhs.method);
+    return std::tie(image, type, method, readonly) <
+           std::tie(rhs.image, rhs.type, rhs.method, rhs.readonly);
 }
 
-TString ImageFunctionHLSL::useImageFunction(const ImmutableString &name,
-                                            const TBasicType &type,
-                                            TLayoutImageInternalFormat imageInternalFormat,
-                                            bool readonly)
+ImmutableString ImageFunctionHLSL::useImageFunction(const ImmutableString &name,
+                                                    const TBasicType &type,
+                                                    TLayoutImageInternalFormat imageInternalFormat,
+                                                    bool readonly)
 {
     ASSERT(IsImage(type));
     ImageFunction imageFunction;
     imageFunction.image               = type;
     imageFunction.imageInternalFormat = imageInternalFormat;
     imageFunction.readonly            = readonly;
+    imageFunction.type                = imageFunction.getDataType(imageInternalFormat);
 
     if (name == "imageSize")
     {
         imageFunction.method = ImageFunction::Method::SIZE;
     }
     else if (name == "imageLoad")
     {
         imageFunction.method = ImageFunction::Method::LOAD;
@@ -276,18 +337,17 @@ void ImageFunctionHLSL::imageFunctionHea
         // Function header
         out << imageFunction.getReturnType() << " " << imageFunction.name() << "(";
 
         OutputImageFunctionArgumentList(out, imageFunction);
 
         out << ")\n"
                "{\n";
 
-        TString imageReference("tex");
-
+        ImmutableString imageReference = GetImageReference(out, imageFunction);
         if (imageFunction.method == ImageFunction::Method::SIZE)
         {
             OutputImageSizeFunctionBody(out, imageFunction, imageReference);
         }
         else if (imageFunction.method == ImageFunction::Method::LOAD)
         {
             OutputImageLoadFunctionBody(out, imageFunction, imageReference);
         }
--- a/gfx/angle/checkout/src/compiler/translator/ImageFunctionHLSL.h
+++ b/gfx/angle/checkout/src/compiler/translator/ImageFunctionHLSL.h
@@ -20,57 +20,72 @@
 namespace sh
 {
 
 class ImageFunctionHLSL final : angle::NonCopyable
 {
   public:
     // Returns the name of the image function implementation to caller.
     // The name that's passed in is the name of the GLSL image function that it should implement.
-    TString useImageFunction(const ImmutableString &name,
-                             const TBasicType &type,
-                             TLayoutImageInternalFormat imageInternalFormat,
-                             bool readonly);
+    ImmutableString useImageFunction(const ImmutableString &name,
+                                     const TBasicType &type,
+                                     TLayoutImageInternalFormat imageInternalFormat,
+                                     bool readonly);
 
     void imageFunctionHeader(TInfoSinkBase &out);
 
   private:
     struct ImageFunction
     {
         // See ESSL 3.10.4 section 8.12 for reference about what the different methods below do.
         enum class Method
         {
             SIZE,
             LOAD,
             STORE
         };
 
-        TString name() const;
+        enum class DataType
+        {
+            NONE,
+            FLOAT4,
+            UINT4,
+            INT4,
+            UNORM_FLOAT4,
+            SNORM_FLOAT4
+        };
+
+        ImmutableString name() const;
 
         bool operator<(const ImageFunction &rhs) const;
 
+        DataType getDataType(TLayoutImageInternalFormat format) const;
+
         const char *getReturnType() const;
 
         TBasicType image;
         TLayoutImageInternalFormat imageInternalFormat;
         bool readonly;
         Method method;
+        DataType type;
     };
 
+    static ImmutableString GetImageReference(TInfoSinkBase &out,
+                                             const ImageFunctionHLSL::ImageFunction &imageFunction);
     static void OutputImageFunctionArgumentList(
         TInfoSinkBase &out,
         const ImageFunctionHLSL::ImageFunction &imageFunction);
     static void OutputImageSizeFunctionBody(TInfoSinkBase &out,
                                             const ImageFunctionHLSL::ImageFunction &imageFunction,
-                                            const TString &imageReference);
+                                            const ImmutableString &imageReference);
     static void OutputImageLoadFunctionBody(TInfoSinkBase &out,
                                             const ImageFunctionHLSL::ImageFunction &imageFunction,
-                                            const TString &imageReference);
+                                            const ImmutableString &imageReference);
     static void OutputImageStoreFunctionBody(TInfoSinkBase &out,
                                              const ImageFunctionHLSL::ImageFunction &imageFunction,
-                                             const TString &imageReference);
+                                             const ImmutableString &imageReference);
     using ImageFunctionSet = std::set<ImageFunction>;
     ImageFunctionSet mUsesImage;
 };
 
 }  // namespace sh
 
 #endif  // COMPILER_TRANSLATOR_IMAGEFUNCTIONHLSL_H_
--- a/gfx/angle/checkout/src/compiler/translator/ImmutableString.h
+++ b/gfx/angle/checkout/src/compiler/translator/ImmutableString.h
@@ -133,13 +133,14 @@ class ImmutableString
     // lookups. The string passed in should be at most 63 characters.
     uint32_t mangledNameHash() const;
 
   private:
     const char *mData;
     size_t mLength;
 };
 
+constexpr ImmutableString kEmptyImmutableString("");
 }  // namespace sh
 
 std::ostream &operator<<(std::ostream &os, const sh::ImmutableString &str);
 
 #endif  // COMPILER_TRANSLATOR_IMMUTABLESTRING_H_
--- a/gfx/angle/checkout/src/compiler/translator/ImmutableStringBuilder.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/ImmutableStringBuilder.cpp
@@ -4,16 +4,18 @@
 // found in the LICENSE file.
 //
 // ImmutableStringBuilder.cpp: Stringstream-like utility for building pool allocated strings where
 // the maximum length is known in advance.
 //
 
 #include "compiler/translator/ImmutableStringBuilder.h"
 
+#include <stdio.h>
+
 namespace sh
 {
 
 ImmutableStringBuilder &ImmutableStringBuilder::operator<<(const ImmutableString &str)
 {
     ASSERT(mData != nullptr);
     ASSERT(mPos + str.length() <= mMaxLength);
     memcpy(mData + mPos, str.data(), str.length());
@@ -34,16 +36,24 @@ ImmutableStringBuilder &ImmutableStringB
 ImmutableStringBuilder &ImmutableStringBuilder::operator<<(const char &c)
 {
     ASSERT(mData != nullptr);
     ASSERT(mPos + 1 <= mMaxLength);
     mData[mPos++] = c;
     return *this;
 }
 
+void ImmutableStringBuilder::appendDecimal(const uint32_t &u)
+{
+    int numChars = snprintf(mData + mPos, mMaxLength - mPos, "%d", u);
+    ASSERT(numChars >= 0);
+    ASSERT(mPos + numChars <= mMaxLength);
+    mPos += numChars;
+}
+
 ImmutableStringBuilder::operator ImmutableString()
 {
     mData[mPos] = '\0';
     ImmutableString str(static_cast<const char *>(mData), mPos);
 #if defined(ANGLE_ENABLE_ASSERTS)
     // Make sure that nothing is added to the string after it is finalized.
     mData = nullptr;
 #endif
--- a/gfx/angle/checkout/src/compiler/translator/ImmutableStringBuilder.h
+++ b/gfx/angle/checkout/src/compiler/translator/ImmutableStringBuilder.h
@@ -27,16 +27,18 @@ class ImmutableStringBuilder
 
     ImmutableStringBuilder &operator<<(const char *str);
 
     ImmutableStringBuilder &operator<<(const char &c);
 
     // This invalidates the ImmutableStringBuilder, so it should only be called once.
     operator ImmutableString();
 
+    void appendDecimal(const uint32_t &i);
+
     template <typename T>
     void appendHex(T number)
     {
         ASSERT(mData != nullptr);
         ASSERT(mPos + sizeof(T) * 2u <= mMaxLength);
         int index = static_cast<int>(sizeof(T)) * 2 - 1;
         // Loop through leading zeroes.
         while (((number >> (index * 4)) & 0xfu) == 0 && index > 0)
@@ -46,26 +48,34 @@ class ImmutableStringBuilder
         // Write the rest of the hex digits.
         while (index >= 0)
         {
             char digit     = static_cast<char>((number >> (index * 4)) & 0xfu);
             char digitChar = (digit < 10) ? (digit + '0') : (digit + ('a' - 10));
             mData[mPos++]  = digitChar;
             --index;
         }
-        return;
+    }
+
+    template <typename T>
+    static constexpr size_t GetHexCharCount()
+    {
+        return sizeof(T) * 2;
     }
 
   private:
     inline static char *AllocateEmptyPoolCharArray(size_t strLength)
     {
         size_t requiredSize = strLength + 1u;
-        return reinterpret_cast<char *>(GetGlobalPoolAllocator()->allocate(requiredSize));
+        return static_cast<char *>(GetGlobalPoolAllocator()->allocate(requiredSize));
     }
 
     size_t mPos;
     size_t mMaxLength;
     char *mData;
 };
 
+// GLSL ES 3.00.6 section 3.9: the maximum length of an identifier is 1024 characters.
+constexpr unsigned int kESSLMaxIdentifierLength = 1024u;
+
 }  // namespace sh
 
 #endif  // COMPILER_TRANSLATOR_IMMUTABLESTRINGBUILDER_H_
--- a/gfx/angle/checkout/src/compiler/translator/InfoSink.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/InfoSink.cpp
@@ -2,16 +2,17 @@
 // 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.
 //
 
 #include "compiler/translator/InfoSink.h"
 
 #include "compiler/translator/ImmutableString.h"
+#include "compiler/translator/Types.h"
 
 namespace sh
 {
 
 void TInfoSinkBase::prefix(Severity severity)
 {
     switch (severity)
     {
@@ -28,16 +29,49 @@ void TInfoSinkBase::prefix(Severity seve
 }
 
 TInfoSinkBase &TInfoSinkBase::operator<<(const ImmutableString &str)
 {
     sink.append(str.data());
     return *this;
 }
 
+TInfoSinkBase &TInfoSinkBase::operator<<(const TType &type)
+{
+    if (type.isInvariant())
+        sink.append("invariant ");
+    if (type.getQualifier() != EvqTemporary && type.getQualifier() != EvqGlobal)
+    {
+        sink.append(type.getQualifierString());
+        sink.append(" ");
+    }
+    if (type.getPrecision() != EbpUndefined)
+    {
+        sink.append(type.getPrecisionString());
+        sink.append(" ");
+    }
+    if (type.isArray())
+    {
+        for (auto arraySizeIter = type.getArraySizes()->rbegin();
+             arraySizeIter != type.getArraySizes()->rend(); ++arraySizeIter)
+        {
+            *this << "array[" << (*arraySizeIter) << "] of ";
+        }
+    }
+    if (type.isMatrix())
+    {
+        *this << type.getCols() << "X" << type.getRows() << " matrix of ";
+    }
+    else if (type.isVector())
+        *this << type.getNominalSize() << "-component vector of ";
+
+    sink.append(type.getBasicString());
+    return *this;
+}
+
 void TInfoSinkBase::location(int file, int line)
 {
     TPersistStringStream stream;
     if (line)
         stream << file << ":" << line;
     else
         stream << file << ":? ";
     stream << ": ";
--- a/gfx/angle/checkout/src/compiler/translator/InfoSink.h
+++ b/gfx/angle/checkout/src/compiler/translator/InfoSink.h
@@ -11,16 +11,17 @@
 #include <stdlib.h>
 #include "compiler/translator/Common.h"
 #include "compiler/translator/Severity.h"
 
 namespace sh
 {
 
 class ImmutableString;
+class TType;
 
 // Returns the fractional part of the given floating-point number.
 inline float fractionalPart(float f)
 {
     float intPart = 0.0f;
     return modff(f, &intPart);
 }
 
@@ -64,16 +65,18 @@ class TInfoSinkBase
     }
     TInfoSinkBase &operator<<(const TString &str)
     {
         sink.append(str.c_str());
         return *this;
     }
     TInfoSinkBase &operator<<(const ImmutableString &str);
 
+    TInfoSinkBase &operator<<(const TType &type);
+
     // Make sure floats are written with correct precision.
     TInfoSinkBase &operator<<(float f)
     {
         // Make sure that at least one decimal point is written. If a number
         // does not have a fractional part, the default precision format does
         // not write the decimal portion which gets interpreted as integer by
         // the compiler.
         TPersistStringStream stream;
--- a/gfx/angle/checkout/src/compiler/translator/Initialize.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/Initialize.cpp
@@ -68,16 +68,20 @@ void InitExtensionBehavior(const ShBuilt
     if (resources.EXT_YUV_target)
     {
         extBehavior[TExtension::EXT_YUV_target] = EBhUndefined;
     }
     if (resources.EXT_geometry_shader)
     {
         extBehavior[TExtension::EXT_geometry_shader] = EBhUndefined;
     }
+    if (resources.OES_texture_storage_multisample_2d_array)
+    {
+        extBehavior[TExtension::OES_texture_storage_multisample_2d_array] = EBhUndefined;
+    }
 }
 
 void ResetExtensionBehavior(TExtensionBehavior &extBehavior)
 {
     for (auto &ext : extBehavior)
     {
         if (ext.first == TExtension::ARB_texture_rectangle)
         {
--- a/gfx/angle/checkout/src/compiler/translator/IntermNode.cpp
+++ b/gfx/angle/checkout/src/compiler/translator/IntermNode.cpp
@@ -197,81 +197,255 @@ void TIntermExpression::setTypePreserveP
 
 #define REPLACE_IF_IS(node, type, original, replacement) \
     if (node == original)                                \
     {                                                    \
         node = static_cast<type *>(replacement);         \
         return true;                                     \
     }
 
+size_t TIntermSymbol::getChildCount() const
+{
+    return 0;
+}
+
+TIntermNode *TIntermSymbol::getChildNode(size_t index) const
+{
+    UNREACHABLE();
+    return nullptr;
+}
+
+size_t TIntermConstantUnion::getChildCount() const
+{
+    return 0;
+}
+
+TIntermNode *TIntermConstantUnion::getChildNode(size_t index) const
+{
+    UNREACHABLE();
+    return nullptr;
+}
+
+size_t TIntermLoop::getChildCount() const
+{
+    return (mInit ? 1 : 0) + (mCond ? 1 : 0) + (mExpr ? 1 : 0) + (mBody ? 1 : 0);
+}
+
+TIntermNode *TIntermLoop::getChildNode(size_t index) const
+{
+    TIntermNode *children[4];
+    unsigned int childIndex = 0;
+    if (mInit)
+    {
+        children[childIndex] = mInit;
+        ++childIndex;
+    }
+    if (mCond)
+    {
+        children[childIndex] = mCond;
+        ++childIndex;
+    }
+    if (mExpr)
+    {
+        children[childIndex] = mExpr;
+        ++childIndex;
+    }
+    if (mBody)
+    {
+        children[childIndex] = mBody;
+        ++childIndex;
+    }
+    ASSERT(index < childIndex);
+    return children[index];
+}
+
 bool TIntermLoop::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     ASSERT(original != nullptr);  // This risks replacing multiple children.
     REPLACE_IF_IS(mInit, TIntermNode, original, replacement);
     REPLACE_IF_IS(mCond, TIntermTyped, original, replacement);
     REPLACE_IF_IS(mExpr, TIntermTyped, original, replacement);
     REPLACE_IF_IS(mBody, TIntermBlock, original, replacement);
     return false;
 }
 
+size_t TIntermBranch::getChildCount() const
+{
+    return (mExpression ? 1 : 0);
+}
+
+TIntermNode *TIntermBranch::getChildNode(size_t index) const
+{
+    ASSERT(mExpression);
+    ASSERT(index == 0);
+    return mExpression;
+}
+
 bool TIntermBranch::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mExpression, TIntermTyped, original, replacement);
     return false;
 }
 
+size_t TIntermSwizzle::getChildCount() const
+{
+    return 1;
+}
+
+TIntermNode *TIntermSwizzle::getChildNode(size_t index) const
+{
+    ASSERT(mOperand);
+    ASSERT(index == 0);
+    return mOperand;
+}
+
 bool TIntermSwizzle::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     ASSERT(original->getAsTyped()->getType() == replacement->getAsTyped()->getType());
     REPLACE_IF_IS(mOperand, TIntermTyped, original, replacement);
     return false;
 }
 
+size_t TIntermBinary::getChildCount() const
+{
+    return 2;
+}
+
+TIntermNode *TIntermBinary::getChildNode(size_t index) const
+{
+    ASSERT(index < 2);
+    if (index == 0)
+    {
+        return mLeft;
+    }
+    return mRight;
+}
+
 bool TIntermBinary::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mLeft, TIntermTyped, original, replacement);
     REPLACE_IF_IS(mRight, TIntermTyped, original, replacement);
     return false;
 }
 
+size_t TIntermUnary::getChildCount() const
+{
+    return 1;
+}
+
+TIntermNode *TIntermUnary::getChildNode(size_t index) const
+{
+    ASSERT(mOperand);
+    ASSERT(index == 0);
+    return mOperand;
+}
+
 bool TIntermUnary::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     ASSERT(original->getAsTyped()->getType() == replacement->getAsTyped()->getType());
     REPLACE_IF_IS(mOperand, TIntermTyped, original, replacement);
     return false;
 }
 
+size_t TIntermInvariantDeclaration::getChildCount() const
+{
+    return 1;
+}
+
+TIntermNode *TIntermInvariantDeclaration::getChildNode(size_t index) const
+{
+    ASSERT(mSymbol);
+    ASSERT(index == 0);
+    return mSymbol;
+}
+
 bool TIntermInvariantDeclaration::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mSymbol, TIntermSymbol, original, replacement);
     return false;
 }
 
+size_t TIntermFunctionDefinition::getChildCount() const
+{
+    return 2;
+}
+
+TIntermNode *TIntermFunctionDefinition::getChildNode(size_t index) const
+{
+    ASSERT(index < 2);
+    if (index == 0)
+    {
+        return mPrototype;
+    }
+    return mBody;
+}
+
 bool TIntermFunctionDefinition::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mPrototype, TIntermFunctionPrototype, original, replacement);
     REPLACE_IF_IS(mBody, TIntermBlock, original, replacement);
     return false;
 }
 
+size_t TIntermAggregate::getChildCount() const
+{
+    return mArguments.size();
+}
+
+TIntermNode *TIntermAggregate::getChildNode(size_t index) const
+{
+    return mArguments[index];
+}
+
 bool TIntermAggregate::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     return replaceChildNodeInternal(original, replacement);
 }
 
+size_t TIntermBlock::getChildCount() const
+{
+    return mStatements.size();
+}
+
+TIntermNode *TIntermBlock::getChildNode(size_t index) const
+{
+    return mStatements[index];
+}
+
 bool TIntermBlock::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     return replaceChildNodeInternal(original, replacement);
 }
 
+size_t TIntermFunctionPrototype::getChildCount() const
+{
+    return 0;
+}
+
+TIntermNode *TIntermFunctionPrototype::getChildNode(size_t index) const
+{
+    UNREACHABLE();
+    return nullptr;
+}
+
 bool TIntermFunctionPrototype::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     return false;
 }
 
+size_t TIntermDeclaration::getChildCount() const
+{
+    return mDeclarators.size();
+}
+
+TIntermNode *TIntermDeclaration::getChildNode(size_t index) const
+{
+    return mDeclarators[index];
+}
+
 bool TIntermDeclaration::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     return replaceChildNodeInternal(original, replacement);
 }
 
 bool TIntermAggregateBase::replaceChildNodeInternal(TIntermNode *original, TIntermNode *replacement)
 {
     for (size_t ii = 0; ii < getSequence()->size(); ++ii)
@@ -695,40 +869,104 @@ void TIntermDeclaration::appendDeclarato
     ASSERT(declarator->getAsSymbolNode() != nullptr ||
            (declarator->getAsBinaryNode() != nullptr &&
             declarator->getAsBinaryNode()->getOp() == EOpInitialize));
     ASSERT(mDeclarators.empty() ||
            declarator->getType().sameNonArrayType(mDeclarators.back()->getAsTyped()->getType()));
     mDeclarators.push_back(declarator);
 }
 
+size_t TIntermTernary::getChildCount() const
+{
+    return 3;
+}
+
+TIntermNode *TIntermTernary::getChildNode(size_t index) const
+{
+    ASSERT(index < 3);
+    if (index == 0)
+    {
+        return mCondition;
+    }
+    if (index == 1)
+    {
+        return mTrueExpression;
+    }
+    return mFalseExpression;
+}
+
 bool TIntermTernary::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mCondition, TIntermTyped, original, replacement);
     REPLACE_IF_IS(mTrueExpression, TIntermTyped, original, replacement);
     REPLACE_IF_IS(mFalseExpression, TIntermTyped, original, replacement);
     return false;
 }
 
+size_t TIntermIfElse::getChildCount() const
+{
+    return 1 + (mTrueBlock ? 1 : 0) + (mFalseBlock ? 1 : 0);
+}
+
+TIntermNode *TIntermIfElse::getChildNode(size_t index) const
+{
+    if (index == 0)
+    {
+        return mCondition;
+    }
+    if (mTrueBlock && index == 1)
+    {
+        return mTrueBlock;
+    }
+    return mFalseBlock;
+}
+
 bool TIntermIfElse::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mCondition, TIntermTyped, original, replacement);
     REPLACE_IF_IS(mTrueBlock, TIntermBlock, original, replacement);
     REPLACE_IF_IS(mFalseBlock, TIntermBlock, original, replacement);
     return false;
 }
 
+size_t TIntermSwitch::getChildCount() const
+{
+    return 2;
+}
+
+TIntermNode *TIntermSwitch::getChildNode(size_t index) const
+{
+    ASSERT(index < 2);
+    if (index == 0)
+    {
+        return mInit;
+    }
+    return mStatementList;
+}
+
 bool TIntermSwitch::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mInit, TIntermTyped, original, replacement);
     REPLACE_IF_IS(mStatementList, TIntermBlock, original, replacement);
     ASSERT(mStatementList);
     return false;
 }
 
+size_t TIntermCase::getChildCount() const
+{
+    return (mCondition ? 1 : 0);
+}
+
+TIntermNode *TIntermCase::getChildNode(size_t index) const
+{
+    ASSERT(index == 0);
+    ASSERT(mCondition);
+    return mCondition;
+}
+
 bool TIntermCase::replaceChildNode(TIntermNode *original, TIntermNode *replacement)
 {
     REPLACE_IF_IS(mCondition, TIntermTyped, original, replacement);
     return false;
 }
 
 TIntermTyped::TIntermTyped(const TIntermTyped &node) : TIntermNode()
 {
@@ -1042,29 +1280,33 @@ void TIntermUnary::promote()
 }
 
 TIntermSwizzle::TIntermSwizzle(TIntermTyped *operand, const TVector<int> &swizzleOffsets)
     : TIntermExpression(TType(EbtFloat, EbpUndefined)),
       mOperand(operand),
       mSwizzleOffsets(swizzleOffsets),
       mHasFoldedDuplicateOffsets(false)
 {
+    ASSERT(mOperand);
     ASSERT(mSwizzleOffsets.size() <= 4);
     promote();
 }
 
 TIntermUnary::TIntermUnary(TOperator op, TIntermTyped *operand, const TFunction *function)
     : TIntermOperator(op), mOperand(operand), mUseEmulatedFunction(false), mFunction(function)
 {
+    ASSERT(mOperand);
     promote();
 }
 
 TIntermBinary::TIntermBinary(TOperator op, TIntermTyped *left, TIntermTyped *right)
     : TIntermOperator(op), mLeft(left), mRight(right), mAddIndexClamp(false)
 {
+    ASSERT(mLeft);
+    ASSERT(mRight);
     promote();
 }
 
 TIntermBinary *TIntermBinary::CreateComma(TIntermTyped *left,
                                           TIntermTyped *right,
                                           int shaderVersion)
 {
     TIntermBinary *node = new TIntermBinary(EOpComma, left, right);
@@ -1082,16 +1324,19 @@ TIntermInvariantDeclaration::TIntermInva
 TIntermTernary::TIntermTernary(TIntermTyped *cond,
                                TIntermTyped *trueExpression,
                                TIntermTyped *falseExpression)
     : TIntermExpression(trueExpression->getType()),
       mCondition(cond),
       mTrueExpression(trueExpression),
       mFalseExpression(falseExpression)
 {
+    ASSERT(mCondition);
+    ASSERT(mTrueExpression);
+    ASSERT(mFalseExpression);
     getTypePointer()->setQualifier(
         TIntermTernary::DetermineQualifier(cond, trueExpression, falseExpression));
 }
 
 TIntermLoop::TIntermLoop(TLoopType type,
                          TIntermNode *init,
                          TIntermTyped *cond,
                          TIntermTyped *expr,
@@ -1105,26 +1350,28 @@ TIntermLoop::TIntermLoop(TLoopType type,
     {
         mInit = nullptr;
     }
 }
 
 TIntermIfElse::TIntermIfElse(TIntermTyped *cond, TIntermBlock *trueB, TIntermBlock *falseB)
     : TIntermNode(), mCondition(cond), mTrueBlock(trueB), mFalseBlock(falseB)
 {
+    ASSERT(mCondition);
     // Prune empty false blocks so that there won't be unnecessary operations done on it.
     if (mFalseBlock && mFalseBlock->getSequence()->empty())
     {
         mFalseBlock = nullptr;
     }
 }
 
 TIntermSwitch::TIntermSwitch(TIntermTyped *init, TIntermBlock *statementList)
     : TIntermNode(), mInit(init), mStatementList(statementList)
 {
+    ASSERT(mInit);
     ASSERT(mStatementList);
 }
 
 void TIntermSwitch::setStatementList(TIntermBlock *statementList)
 {
     ASSERT(statementList);
     mStatementList = statementList;
 }
@@ -1636,16 +1883,27 @@ const TConstantUnion *TIntermBinary::get
         {
             previousFieldsSize += fields[i]->type()->getObjectSize();
         }
         constIndexingResult = leftConstantValue + previousFieldsSize;
     }
     return constIndexingResult;
 }
 
+const ImmutableString &TIntermBinary::getIndexStructFieldName() const
+{
+    ASSERT(mOp == EOpIndexDirectStruct);
+
+    const TType &lhsType        = mLeft->getType();
+    const TStructure *structure = lhsType.getStruct();
+    const int index             = mRight->getAsConstantUnion()->getIConst(0);
+
+    return structure->fields()[index]->name();
+}
+
 TIntermTyped *TIntermUnary::fold(TDiagnostics *diagnostics)
 {
     TConstantUnion *constArray = nullptr;
 
     if (mOp == EOpArrayLength)
     {
         // The size of runtime-sized arrays may only be determined at runtime.
         if (mOperand->hasSideEffects() || mOperand->getType().isUnsizedArray())
@@ -3476,9 +3734,28 @@ TConstantUnion *TIntermConstantUnion::Fo
 
         default:
             UNREACHABLE();
             return nullptr;
     }
     return resultArray;
 }
 
+// TIntermPreprocessorDirective implementation.
+TIntermPreprocessorDirective::TIntermPreprocessorDirective(PreprocessorDirective directive,
+                                                           ImmutableString command)
+    : mDirective(directive), mCommand(std::move(command))
+{
+}
+
+TIntermPreprocessorDirective::~TIntermPreprocessorDirective() = default;
+
+size_t TIntermPreprocessorDirective::getChildCount() const
+{
+    return 0;
+}
+
+TIntermNode *TIntermPreprocessorDirective::getChildNode(size_t index) const
+{
+    UNREACHABLE();
+    return nullptr;
+}
 }  // namespace sh
--- a/gfx/angle/checkout/src/compiler/translator/IntermNode.h
+++ b/gfx/angle/checkout/src/compiler/translator/IntermNode.h
@@ -19,25 +19,25 @@
 #include "GLSLANG/ShaderLang.h"
 
 #include <algorithm>
 #include <queue>
 
 #include "common/angleutils.h"
 #include "compiler/translator/Common.h"
 #include "compiler/translator/ConstantUnion.h"
+#include "compiler/translator/ImmutableString.h"
 #include "compiler/translator/Operator.h"
 #include "compiler/translator/SymbolUniqueId.h"
 #include "compiler/translator/Types.h"
+#include "compiler/translator/tree_util/Visit.h"
 
 namespace sh
 {
 
-class ImmutableString;
-
 class TDiagnostics;
 
 class TIntermTraverser;
 class TIntermAggregate;
 class TIntermBlock;
 class TIntermInvariantDeclaration;
 class TIntermDeclaration;
 class TIntermFunctionPrototype;
@@ -50,18 +50,18 @@ class TIntermTernary;
 class TIntermIfElse;
 class TIntermSwitch;
 class TIntermCase;
 class TIntermTyped;
 class TIntermSymbol;
 class TIntermLoop;
 class TInfoSink;
 class TInfoSinkBase;
-class TIntermRaw;
 class TIntermBranch;
+class TIntermPreprocessorDirective;
 
 class TSymbolTable;
 class TFunction;
 class TVariable;
 
 //
 // Base class for the tree nodes
 //
@@ -76,37 +76,41 @@ class TIntermNode : angle::NonCopyable
         mLine.first_file = mLine.last_file = 0;
         mLine.first_line = mLine.last_line = 0;
     }
     virtual ~TIntermNode() {}
 
     const TSourceLoc &getLine() const { return mLine; }
     void setLine(const TSourceLoc &l) { mLine = l; }
 
-    virtual void traverse(TIntermTraverser *) = 0;
-    virtual TIntermTyped *getAsTyped() { return 0; }
-    virtual TIntermConstantUnion *getAsConstantUnion() { return 0; }
+    virtual void traverse(TIntermTraverser *it);
+    virtual bool visit(Visit visit, TIntermTraverser *it) = 0;
+
+    virtual TIntermTyped *getAsTyped() { return nullptr; }
+    virtual TIntermConstantUnion *getAsConstantUnion() { return nullptr; }
     virtual TIntermFunctionDefinition *getAsFunctionDefinition() { return nullptr; }
-    virtual TIntermAggregate *getAsAggregate() { return 0; }
+    virtual TIntermAggregate *getAsAggregate() { return nullptr; }
     virtual TIntermBlock *getAsBlock() { return nullptr; }
     virtual TIntermFunctionPrototype *getAsFunctionPrototypeNode() { return nullptr; }
     virtual TIntermInvariantDeclaration *getAsInvariantDeclarationNode() { return nullptr; }
     virtual TIntermDeclaration *getAsDeclarationNode() { return nullptr; }
     virtual TIntermSwizzle *getAsSwizzleNode() { return nullptr; }
-    virtual TIntermBinary *getAsBinaryNode() { return 0; }
-    virtual TIntermUnary *getAsUnaryNode() { return 0; }
+    virtual TIntermBinary *getAsBinaryNode() { return nullptr; }
+    virtual TIntermUnary *getAsUnaryNode() { return nullptr; }
     virtual TIntermTernary *getAsTernaryNode() { return nullptr; }
     virtual TIntermIfElse *getAsIfElseNode() { return nullptr; }
-    virtual TIntermSwitch *getAsSwitchNode() { return 0; }
-    virtual TIntermCase *getAsCaseNode() { return 0; }
-    virtual TIntermSymbol *getAsSymbolNode() { return 0; }
-    virtual TIntermLoop *getAsLoopNode() { return 0; }
-    virtual TIntermRaw *getAsRawNode() { return 0; }
-    virtual TIntermBranch *getAsBranchNode() { return 0; }
+    virtual TIntermSwitch *getAsSwitchNode() { return nullptr; }
+    virtual TIntermCase *getAsCaseNode() { return nullptr; }
+    virtual TIntermSymbol *getAsSymbolNode() { return nullptr; }
+    virtual TIntermLoop *getAsLoopNode() { return nullptr; }
+    virtual TIntermBranch *getAsBranchNode() { return nullptr; }
+    virtual TIntermPreprocessorDirective *getAsPreprocessorDirective() { return nullptr; }
 
+    virtual size_t getChildCount() const                  = 0;
+    virtual TIntermNode *getChildNode(size_t index) const = 0;
     // Replace a child node. Return true if |original| is a child
     // node and it is replaced; otherwise, return false.
     virtual bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) = 0;
 
   protected:
     TSourceLoc mLine;
 };
 
@@ -157,17 +161,16 @@ class TIntermTyped : public TIntermNode
 
     bool isInterfaceBlock() const { return getType().isInterfaceBlock(); }
     bool isMatrix() const { return getType().isMatrix(); }
     bool isArray() const { return getType().isArray(); }
     bool isVector() const { return getType().isVector(); }
     bool isScalar() const { return getType().isScalar(); }
     bool isScalarInt() const { return getType().isScalarInt(); }
     const char *getBasicString() const { return getType().getBasicString(); }
-    TString getCompleteString() const { return getType().getCompleteString(); }
 
     unsigned int getOutermostArraySize() const { return getType().getOutermostArraySize(); }
 
   protected:
     TIntermTyped(const TIntermTyped &node);
 };
 
 //
@@ -185,17 +188,21 @@ class TIntermLoop : public TIntermNode
   public:
     TIntermLoop(TLoopType type,
                 TIntermNode *init,
                 TIntermTyped *cond,
                 TIntermTyped *expr,
                 TIntermBlock *body);
 
     TIntermLoop *getAsLoopNode() override { return this; }
-    void traverse(TIntermTraverser *it) override;
+    void traverse(TIntermTraverser *it) final;
+    bool visit(Visit visit, TIntermTraverser *it) final;
+
+    size_t getChildCount() const final;
+    TIntermNode *getChildNode(size_t index) const final;
     bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override;
 
     TLoopType getType() const { return mType; }
     TIntermNode *getInit() { return mInit; }
     TIntermTyped *getCondition() { return mCond; }
     TIntermTyped *getExpression() { return mExpr; }
     TIntermBlock *getBody() { return mBody; }
 
@@ -215,18 +222,21 @@ class TIntermLoop : public TIntermNode
 //
 // Handle break, continue, return, and kill.
 //
 class TIntermBranch : public TIntermNode
 {
   public:
     TIntermBranch(TOperator op, TIntermTyped *e) : mFlowOp(op), mExpression(e) {}
 
-    void traverse(TIntermTraverser *it) override;
     TIntermBranch *getAsBranchNode() override { return this; }
+    bool visit(Visit visit, TIntermTraverser *it) final;
+
+    size_t getChildCount() const final;
+    TIntermNode *getChildNode(size_t index) const final;
     bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override;
 
     TOperator getFlowOp() { return mFlowOp; }
     TIntermTyped *getExpression() { return mExpression; }
 
   protected:
     TOperator mFlowOp;
     TIntermTyped *mExpression;  // non-zero except for "return exp;" statements
@@ -248,18 +258,22 @@ class TIntermSymbol : public TIntermType
     bool hasSideEffects() const override { return false; }
 
     const TType &getType() const override;
 
     const TSymbolUniqueId &uniqueId() const;
     ImmutableString getName() const;
     const TVariable &variable() const { return *mVariable; }
 
-    void traverse(TIntermTraverser *it) override;
     TIntermSymbol *getAsSymbolNode() override { return this; }
+    void traverse(TIntermTraverser *it) final;
+    bool visit(Visit visit, TIntermTraverser *it) final;
+
+    size_t getChildCount() const final;
+    TIntermNode *getChildNode(size_t index) const final;
     bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
 
   private:
     TIntermSymbol(const TIntermSymbol &) = default;  // Note: not deleted, just private!
 
     const TVariable *const mVariable;  // Guaranteed to be non-null
 };
 
@@ -276,47 +290,16 @@ class TIntermExpression : public TInterm
     void setType(const TType &t) { mType = t; }
     void setTypePreservePrecision(const TType &t);
 
     TIntermExpression(const TIntermExpression &node) = default;
 
     TType mType;
 };
 
-// A Raw node stores raw code, that the translator will insert verbatim
-// into the output stream. Useful for transformation operations that make
-// complex code that might not fit naturally into the GLSL model.
-class TIntermRaw : public TIntermExpression
-{
-  public:
-    TIntermRaw(const TType &type, const ImmutableString &rawText)
-        : TIntermExpression(type), mRawText(rawText)
-    {
-    }
-    TIntermRaw(const TIntermRaw &) = delete;
-
-    TIntermTyped *deepCopy() const override
-    {
-        UNREACHABLE();
-        return nullptr;
-    }
-
-    bool hasSideEffects() const override { return false; }
-
-    const ImmutableString &getRawText() const { return mRawText; }
-
-    void traverse(TIntermTraverser *it) override;
-
-    TIntermRaw *getAsRawNode() override { return this; }
-    bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
-
-  protected:
-    ImmutableString mRawText;
-};
-
 // Constant folded node.
 // Note that nodes may be constant folded and not be constant expressions with the EvqConst
 // qualifier. This happens for example when the following expression is processed:
 // "true ? 1.0 : non_constant"
 // Other nodes than TIntermConstantUnion may also be constant expressions.
 //
 class TIntermConstantUnion : public TIntermExpression
 {
@@ -347,17 +330,21 @@ class TIntermConstantUnion : public TInt
         return mUnionArrayPointer ? mUnionArrayPointer[index].getFConst() : 0.0f;
     }
     bool getBConst(size_t index) const
     {
         return mUnionArrayPointer ? mUnionArrayPointer[index].getBConst() : false;
     }
 
     TIntermConstantUnion *getAsConstantUnion() override { return this; }
-    void traverse(TIntermTraverser *it) override;
+    void traverse(TIntermTraverser *it) final;
+    bool visit(Visit visit, TIntermTraverser *it) final;
+
+    size_t getChildCount() const final;
+    TIntermNode *getChildNode(size_t index) const final;
     bool replaceChildNode(TIntermNode *, TIntermNode *) override { return false; }
 
     TConstantUnion *foldUnaryNonComponentWise(TOperator op);
     TConstantUnion *foldUnaryComponentWise(TOperator op, TDiagnostics *diagnostics);
 
     static const TConstantUnion *FoldBinary(TOperator op,
                                             const TConstantUnion *leftArray,
                                             const TType &leftType,
@@ -417,17 +404,20 @@ class TIntermSwizzle : public TIntermExp
 {
   public:
     // This constructor determines the type of the node based on the operand.
     TIntermSwizzle(TIntermTyped *operand, const TVector<int> &swizzleOffsets);
 
     TIntermTyped *deepCopy() const override { return new TIntermSwizzle(*this); }
 
     TIntermSwizzle *getAsSwizzleNode() override { return this; };
-    void traverse(TIntermTraverser *it) override;
+    bool visit(Visit visit, TIntermTraverser *it) final;
+
+    size_t getChildCount() const final;
+    TIntermNode *getChildNode(size_t index) const final;
     bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override;
 
     bool hasSideEffects() const override { return mOperand->hasSideEffects(); }
 
     TIntermTyped *getOperand() { return mOperand; }
     void writeOffsetsAsXYZW(TInfoSinkBase *out) const;
 
     bool hasDuplicateOffsets() const;
@@ -462,30 +452,37 @@ class TIntermBinary : public TIntermOper
 
     bool hasConstantValue() const override;
     const TConstantUnion *getConstantValue() const override;
 
     static TOperator GetMulOpBasedOnOperands(const TType &left, const TType &right);
     static TOperator GetMulAssignOpBasedOnOperands(const TType &left, const TType &right);
 
     TIntermBinary *getAsBinaryNode() override { return this; };
-    void traverse(TIntermTraverser *it) override;
+    void traverse(TIntermTraverser *it) final;
+    bool visit(Visit visit, TIntermTraverser *it) final;
+
+    size_t getChildCount() const final;
+    TIntermNode *getChildNode(size_t index) const final;
     bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override;
 
     bool hasSideEffects() const override
     {
         return isAssignment() || mLeft->hasSideEffects() || mRight->hasSideEffects();
     }
 
     TIntermTyped *getLeft() const { return mLeft; }
     TIntermTyped *getRight() const { return mRight; }
     TIntermTyped *fold(TDiagnostics *diagnostics) override;
 
     void setAddIndexClamp() { mAddIndexClamp = true; }
-    bool getAddIndexClamp() { return mAddIndexClamp; }
+    bool getAddIndexClamp() const { return mAddIndexClamp; }
+
+    // This method is only valid for EOpIndexDirectStruct. It returns the name of the field.
+    const ImmutableString &getIndexStructFieldName() const;
 
   protected:
     TIntermTyped *mLeft;
     TIntermTyped *mRight;
 
     // If set to true, wrap any EOpIndexIndirect with a clamp to bounds.
     bool mAddIndexClamp;
 
@@ -504,18 +501,22 @@ class TIntermBinary : public TIntermOper
 //
 class TIntermUnary : public TIntermOperator
 {
   public:
     TIntermUnary(TOperator op, TIntermTyped *operand, const TFunction *function);
 
     TIntermTyped *deepCopy() const override { return new TIntermUnary(*this); }