summaryrefslogtreecommitdiff
path: root/chromium/third_party/angle
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-12 14:07:37 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-07-17 10:29:26 +0000
commitec02ee4181c49b61fce1c8fb99292dbb8139cc90 (patch)
tree25cde714b2b71eb639d1cd53f5a22e9ba76e14ef /chromium/third_party/angle
parentbb09965444b5bb20b096a291445170876225268d (diff)
downloadqtwebengine-chromium-ec02ee4181c49b61fce1c8fb99292dbb8139cc90.tar.gz
BASELINE: Update Chromium to 59.0.3071.134
Change-Id: Id02ef6fb2204c5fd21668a1c3e6911c83b17585a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/third_party/angle')
-rw-r--r--chromium/third_party/angle/AUTHORS1
-rw-r--r--chromium/third_party/angle/BUILD.gn17
-rw-r--r--chromium/third_party/angle/CONTRIBUTORS1
-rw-r--r--chromium/third_party/angle/DEPS4
-rw-r--r--chromium/third_party/angle/DEPS.chromium16
-rw-r--r--chromium/third_party/angle/doc/ContributingCode.md23
-rw-r--r--chromium/third_party/angle/doc/DevSetup.md9
-rw-r--r--chromium/third_party/angle/extensions/ANGLE_robust_client_memory.txt13
-rw-r--r--chromium/third_party/angle/extensions/ANGLE_robust_resource_initialization.txt13
-rw-r--r--chromium/third_party/angle/extensions/CHROMIUM_bind_uniform_location.txt10
-rw-r--r--chromium/third_party/angle/extensions/CHROMIUM_copy_texture.txt227
-rw-r--r--chromium/third_party/angle/extensions/EGL_ANGLE_create_context_robust_resource_initialization.txt (renamed from chromium/third_party/angle/extensions/EGL_ANGLE_robust_resource_initialization.txt)11
-rw-r--r--chromium/third_party/angle/extensions/EGL_CHROMIUM_get_sync_values.txt131
-rw-r--r--chromium/third_party/angle/gyp/common.gypi2
-rw-r--r--chromium/third_party/angle/include/EGL/eglext.h4
-rw-r--r--chromium/third_party/angle/include/GLES2/gl2ext.h33
-rw-r--r--chromium/third_party/angle/include/GLSLANG/ShaderLang.h6
-rw-r--r--chromium/third_party/angle/include/GLSLANG/ShaderVars.h35
-rw-r--r--chromium/third_party/angle/samples/shader_translator/shader_translator.cpp7
-rw-r--r--chromium/third_party/angle/src/angle.gyp46
-rw-r--r--chromium/third_party/angle/src/common/MemoryBuffer.cpp67
-rw-r--r--chromium/third_party/angle/src/common/MemoryBuffer.h29
-rw-r--r--chromium/third_party/angle/src/common/bitset_utils.h (renamed from chromium/third_party/angle/src/common/BitSetIterator.h)10
-rw-r--r--chromium/third_party/angle/src/common/bitset_utils_unittest.cpp (renamed from chromium/third_party/angle/src/common/BitSetIterator_unittest.cpp)6
-rw-r--r--chromium/third_party/angle/src/common/utilities.cpp2
-rw-r--r--chromium/third_party/angle/src/common/utilities.h7
-rw-r--r--chromium/third_party/angle/src/common/utilities_unittest.cpp24
-rw-r--r--chromium/third_party/angle/src/compiler.gypi4
-rw-r--r--chromium/third_party/angle/src/compiler/fuzz/translator_fuzzer.cpp1
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ASTMetadataHLSL.cpp5
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp9
-rw-r--r--chromium/third_party/angle/src/compiler/translator/BaseTypes.h59
-rw-r--r--chromium/third_party/angle/src/compiler/translator/CallDAG.cpp28
-rw-r--r--chromium/third_party/angle/src/compiler/translator/CallDAG.h2
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Compiler.cpp26
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Compiler.h3
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ConstantUnion.cpp12
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ConstantUnion.h10
-rw-r--r--chromium/third_party/angle/src/compiler/translator/DeferGlobalInitializers.cpp49
-rw-r--r--chromium/third_party/angle/src/compiler/translator/EmulatePrecision.cpp5
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Initialize.cpp57
-rw-r--r--chromium/third_party/angle/src/compiler/translator/InitializeDll.cpp8
-rw-r--r--chromium/third_party/angle/src/compiler/translator/InitializeParseContext.cpp46
-rw-r--r--chromium/third_party/angle/src/compiler/translator/InitializeParseContext.h21
-rw-r--r--chromium/third_party/angle/src/compiler/translator/IntermNode.cpp162
-rw-r--r--chromium/third_party/angle/src/compiler/translator/IntermNode.h89
-rw-r--r--chromium/third_party/angle/src/compiler/translator/IntermTraverse.cpp14
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputGLSL.cpp2
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputGLSL.h2
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp43
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h6
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp10
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ParseContext.cpp114
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ParseContext.h7
-rw-r--r--chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.cpp91
-rw-r--r--chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.h18
-rw-r--r--chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp4
-rw-r--r--chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp119
-rw-r--r--chromium/third_party/angle/src/compiler/translator/RewriteTexelFetchOffset.cpp32
-rw-r--r--chromium/third_party/angle/src/compiler/translator/SeparateExpressionsReturningArrays.cpp12
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp3
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp34
-rw-r--r--chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp46
-rw-r--r--chromium/third_party/angle/src/compiler/translator/SymbolTable.h30
-rw-r--r--chromium/third_party/angle/src/compiler/translator/TextureFunctionHLSL.cpp5
-rw-r--r--chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp5
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Types.cpp62
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Types.h8
-rw-r--r--chromium/third_party/angle/src/compiler/translator/UtilsHLSL.cpp12
-rw-r--r--chromium/third_party/angle/src/compiler/translator/UtilsHLSL.h2
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ValidateLimitations.cpp189
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ValidateLimitations.h49
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ValidateMultiviewWebGL.cpp5
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp30
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ValidateOutputs.h2
-rw-r--r--chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp1
-rw-r--r--chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.cpp20
-rw-r--r--chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.h9
-rw-r--r--chromium/third_party/angle/src/compiler/translator/glslang.l39
-rw-r--r--chromium/third_party/angle/src/compiler/translator/glslang.y22
-rw-r--r--chromium/third_party/angle/src/compiler/translator/glslang_lex.cpp1329
-rw-r--r--chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp2120
-rw-r--r--chromium/third_party/angle/src/compiler/translator/glslang_tab.h295
-rw-r--r--chromium/third_party/angle/src/compiler/translator/intermOut.cpp9
-rw-r--r--chromium/third_party/angle/src/compiler/translator/util.cpp2
-rw-r--r--chromium/third_party/angle/src/gpu_info_util/SystemInfo.cpp14
-rw-r--r--chromium/third_party/angle/src/gpu_info_util/SystemInfo_internal.h1
-rw-r--r--chromium/third_party/angle/src/gpu_info_util/SystemInfo_unittest.cpp28
-rw-r--r--chromium/third_party/angle/src/gpu_info_util/SystemInfo_win.cpp204
-rw-r--r--chromium/third_party/angle/src/image_util/loadimage.h40
-rw-r--r--chromium/third_party/angle/src/image_util/loadimage_etc.cpp170
-rw-r--r--chromium/third_party/angle/src/libANGLE/Buffer.cpp46
-rw-r--r--chromium/third_party/angle/src/libANGLE/Caps.cpp12
-rw-r--r--chromium/third_party/angle/src/libANGLE/Caps.h11
-rw-r--r--chromium/third_party/angle/src/libANGLE/Compiler.cpp3
-rw-r--r--chromium/third_party/angle/src/libANGLE/Context.cpp249
-rw-r--r--chromium/third_party/angle/src/libANGLE/Context.h61
-rw-r--r--chromium/third_party/angle/src/libANGLE/ContextState.cpp40
-rw-r--r--chromium/third_party/angle/src/libANGLE/ContextState.h8
-rw-r--r--chromium/third_party/angle/src/libANGLE/Fence.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/Framebuffer.cpp93
-rw-r--r--chromium/third_party/angle/src/libANGLE/Framebuffer.h35
-rw-r--r--chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/Program.cpp826
-rw-r--r--chromium/third_party/angle/src/libANGLE/Program.h102
-rw-r--r--chromium/third_party/angle/src/libANGLE/ResourceManager.cpp22
-rw-r--r--chromium/third_party/angle/src/libANGLE/ResourceManager.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/Shader.cpp13
-rw-r--r--chromium/third_party/angle/src/libANGLE/State.cpp153
-rw-r--r--chromium/third_party/angle/src/libANGLE/State.h39
-rw-r--r--chromium/third_party/angle/src/libANGLE/Surface.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/Surface.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/Surface_unittest.cpp1
-rw-r--r--chromium/third_party/angle/src/libANGLE/Texture.cpp86
-rw-r--r--chromium/third_party/angle/src/libANGLE/Texture.h18
-rw-r--r--chromium/third_party/angle/src/libANGLE/Uniform.cpp4
-rw-r--r--chromium/third_party/angle/src/libANGLE/Uniform.h11
-rw-r--r--chromium/third_party/angle/src/libANGLE/UniformLinker.cpp491
-rw-r--r--chromium/third_party/angle/src/libANGLE/UniformLinker.h91
-rw-r--r--chromium/third_party/angle/src/libANGLE/VaryingPacking.cpp24
-rw-r--r--chromium/third_party/angle/src/libANGLE/VaryingPacking.h20
-rw-r--r--chromium/third_party/angle/src/libANGLE/VertexArray.cpp13
-rw-r--r--chromium/third_party/angle/src/libANGLE/VertexArray.h29
-rw-r--r--chromium/third_party/angle/src/libANGLE/VertexArray_unittest.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/angletypes.h23
-rw-r--r--chromium/third_party/angle/src/libANGLE/formatutils.cpp7
-rw-r--r--chromium/third_party/angle/src/libANGLE/queryutils.cpp135
-rw-r--r--chromium/third_party/angle/src/libANGLE/queryutils.h21
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl.h3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl_mock.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/SurfaceImpl.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.cpp6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/TextureImpl_mock.h32
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/VertexArrayImpl.h3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp55
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp19
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp24
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp24
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp29
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h10
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp479
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.h31
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.cpp12
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp26
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h12
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp172
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h39
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp235
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h24
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp73
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.h10
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp55
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp61
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h12
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp34
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h9
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp52
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp22
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.cpp6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp8
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/BufferGL.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp68
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h7
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp7
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp15
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp17
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp41
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h15
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp52
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/WorkaroundsGL.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp26
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.h8
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp282
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h13
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp22
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/load_functions_data.json20
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/load_functions_table_autogen.cpp92
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.cpp3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.cpp6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp109
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h10
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp39
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp8
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp48
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.h27
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp40
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp11
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.cpp8
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.h35
-rw-r--r--chromium/third_party/angle/src/libANGLE/signal_utils.cpp103
-rw-r--r--chromium/third_party/angle/src/libANGLE/signal_utils.h133
-rw-r--r--chromium/third_party/angle/src/libANGLE/signal_utils_unittest.cpp8
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationEGL.cpp63
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationEGL.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES.cpp316
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES.h23
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES2.cpp169
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES2.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES3.cpp225
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES3.h14
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES31.cpp322
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES31.h35
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp5
-rw-r--r--chromium/third_party/angle/src/libEGL/libEGL.cpp9
-rw-r--r--chromium/third_party/angle/src/libEGL/libEGL.def3
-rw-r--r--chromium/third_party/angle/src/libGLESv2.gypi9
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp3
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.cpp33
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.h7
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0.cpp29
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp66
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.h10
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.cpp88
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_1.cpp63
-rw-r--r--chromium/third_party/angle/src/tests/angle_end2end_tests.gypi4
-rw-r--r--chromium/third_party/angle/src/tests/angle_unittests.gypi5
-rw-r--r--chromium/third_party/angle/src/vulkan_support/BUILD.gn293
-rw-r--r--chromium/third_party/angle/src/vulkan_support/vulkan.gypi317
-rw-r--r--chromium/third_party/angle/util/EGLWindow.cpp116
-rw-r--r--chromium/third_party/angle/util/EGLWindow.h12
271 files changed, 9726 insertions, 4854 deletions
diff --git a/chromium/third_party/angle/AUTHORS b/chromium/third_party/angle/AUTHORS
index 125b7deb2fe..9830cced418 100644
--- a/chromium/third_party/angle/AUTHORS
+++ b/chromium/third_party/angle/AUTHORS
@@ -47,3 +47,4 @@ Sebastian Bergstein
James Ross-Gowan
Nickolay Artamonov
Ihsan Akmal
+Andrei Volykhin
diff --git a/chromium/third_party/angle/BUILD.gn b/chromium/third_party/angle/BUILD.gn
index 8ec517aa159..50d58d00912 100644
--- a/chromium/third_party/angle/BUILD.gn
+++ b/chromium/third_party/angle/BUILD.gn
@@ -10,6 +10,12 @@ import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/angle/gni/angle.gni")
import("//ui/ozone/ozone.gni")
+declare_args() {
+ # Use the PCI lib to collect GPU information on Linux.
+ use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) &&
+ (use_x11 || use_ozone)
+}
+
if (ozone_platform_gbm) {
pkg_config("libdrm") {
packages = [ "libdrm" ]
@@ -208,6 +214,13 @@ static_library("angle_gpu_info_util") {
libs = []
defines = []
+ if (is_win) {
+ sources +=
+ rebase_path(gles_gypi.libangle_gpu_info_util_win_sources, ".", "src")
+ libs += [ "setupapi.lib" ]
+ defines += [ "GPU_INFO_USE_SETUPAPI" ]
+ }
+
if (is_linux) {
sources +=
rebase_path(gles_gypi.libangle_gpu_info_util_linux_sources, ".", "src")
@@ -225,10 +238,6 @@ static_library("angle_gpu_info_util") {
}
}
- # Taken from gpu/config/BUILD.gn
- # TODO(cwallez): this should be in a shared location
- use_libpci = is_linux && (!is_chromecast || is_cast_desktop_build) &&
- (use_x11 || use_ozone)
if (use_libpci) {
sources +=
rebase_path(gles_gypi.libangle_gpu_info_util_libpci_sources, ".", "src")
diff --git a/chromium/third_party/angle/CONTRIBUTORS b/chromium/third_party/angle/CONTRIBUTORS
index 53e2154d239..3692682a956 100644
--- a/chromium/third_party/angle/CONTRIBUTORS
+++ b/chromium/third_party/angle/CONTRIBUTORS
@@ -95,6 +95,7 @@ Tibor den Ouden
Régis Fénéon
Sebastian Bergstein
James Ross-Gowan
+Andrei Volykhin
Microsoft Corporation
Cooper Partin
diff --git a/chromium/third_party/angle/DEPS b/chromium/third_party/angle/DEPS
index 4e477fc344c..42e340edd3c 100644
--- a/chromium/third_party/angle/DEPS
+++ b/chromium/third_party/angle/DEPS
@@ -25,7 +25,7 @@ deps = {
Var('android_git') + '/platform/external/shaderc/glslang' + '@' + '1e275c8486325aaab34734ad9a650c0121c5efdb',
'third_party/gyp':
- Var('chromium_git') + '/external/gyp' + '@' + '81c2e5ff92af29bab61c982808076ddce3d200a2',
+ Var('chromium_git') + '/external/gyp' + '@' + 'aae1e3efb50786df20e9572621fb746865f0df53',
'third_party/libpng':
Var('android_git') + '/platform/external/libpng' + '@' + '094e181e79a3d6c23fd005679025058b7df1ad6c',
@@ -37,7 +37,7 @@ deps = {
Var('android_git') + '/platform/external/shaderc/spirv-tools' + '@' + '68c5f0436f1d4f1f137e608780190865d0b193ca',
'third_party/vulkan-validation-layers/src':
- Var('android_git') + '/platform/external/vulkan-validation-layers' + '@' + 'bcb80d06bbdc0910792549c7399d4ac43a94ea09',
+ Var('android_git') + '/platform/external/vulkan-validation-layers' + '@' + 'f47c534fee2f26f6b783209d56e0ade48e30eb8d',
'third_party/zlib':
Var('chromium_git') + '/chromium/src/third_party/zlib' + '@' + 'afd8c4593c010c045902f6c0501718f1823064a3',
diff --git a/chromium/third_party/angle/DEPS.chromium b/chromium/third_party/angle/DEPS.chromium
index dfb35981d33..5678485433f 100644
--- a/chromium/third_party/angle/DEPS.chromium
+++ b/chromium/third_party/angle/DEPS.chromium
@@ -25,7 +25,7 @@ vars = {
'spirv_tools_revision': '68c5f0436f1d4f1f137e608780190865d0b193ca',
# Current revision of the Vulkan Validation Layers SDK.
- 'vulkan_revision': 'bcb80d06bbdc0910792549c7399d4ac43a94ea09',
+ 'vulkan_revision': 'f47c534fee2f26f6b783209d56e0ade48e30eb8d',
}
deps_os = {
@@ -48,5 +48,17 @@ deps_os = {
'unix': {
'src/third_party/deqp/src':
Var('android_git') + '/platform/external/deqp@' + Var('deqp_revision'),
- }
+
+ 'src/third_party/glslang-angle/src':
+ Var('android_git') + '/platform/external/shaderc/glslang@' + Var('glslang_revision'),
+
+ 'src/third_party/spirv-headers/src':
+ Var('android_git') + '/platform/external/shaderc/spirv-headers@' + Var('spirv_headers_revision'),
+
+ 'src/third_party/spirv-tools-angle/src':
+ Var('android_git') + '/platform/external/shaderc/spirv-tools@' + Var('spirv_tools_revision'),
+
+ 'src/third_party/vulkan-validation-layers/src':
+ Var('android_git') + '/platform/external/vulkan-validation-layers@' + Var('vulkan_revision'),
+ },
}
diff --git a/chromium/third_party/angle/doc/ContributingCode.md b/chromium/third_party/angle/doc/ContributingCode.md
index 58ea4d498c0..ff111439a51 100644
--- a/chromium/third_party/angle/doc/ContributingCode.md
+++ b/chromium/third_party/angle/doc/ContributingCode.md
@@ -4,7 +4,7 @@
* Whether you're writing a new feature or fixing an existing bug, it pays to get a second opinion before you get too far. If it's a new feature idea, post to the discussion group ([angleproject](https://groups.google.com/forum/?fromgroups#!forum/angleproject)) and propose it or talk with the ANGLE team on IRC in the #ANGLEproject channel on FreeNode.
* Not all bugs in our [bug system](https://code.google.com/p/angleproject/issues/list) are assigned, but if the one you're interested in fixing is, send a note to the person it's assigned to and ask if they would like a patch.
- * Behavior changes and anything nontrivial (i.e. anything other than simple cleanups and style fixes) should generally be tracked in the bug system. Please [file a bug](https://code.google.com/p/angleproject/issues/entry) and describe what you're doing if there isn't one already.
+ * Behavior changes and anything nontrivial (i.e. anything other than simple cleanups and style fixes) should generally be tracked in the bug system. Please [file a bug](http://anglebug.com/new) and describe what you're doing if there isn't one already.
## Get your code ready
### Code
@@ -22,19 +22,20 @@
* If you modified `ExpressionParser.y` or `Tokenizer.l`, follow the same process by running `src/compiler/preprocessor/generate_parser.sh`.
### Testing
- * ANGLE uses trybots to test on a variety of platforms. Please run your changes against our trybots and check the results before requesting a review.
- * Upload your change (see [Making changes](ContributingCode.md#Making-changes)).
- * Run `git try`. If you are not part of the `angle-committers` group, you will need to either ask to be added or ask a member of the group to submit the tryjob for you.
- * Wait for the bots to report the result on the code review page, this can take up to two hours for some of the debug bots.
- * Sometimes the bots report failures that are not due to the patch being tested. If a failure is unexpected, ask an ANGLE project member for advice.
- * The `-b` flag can be used with `git try` to target individual bots. Ex: `git try -b win_angle_rel_ng`.
+ * ANGLE uses trybots to test on a variety of platforms. Please run your changes against our bots and check the results before landing changes or requesting reviews.
+ * Upload your change (see [Making changes](ContributingCode.md#making-changes)).
+ * To kick of a try job, use the 'CQ Dry Run' button, or set the Commit-Queue +1 label to trigger a dry run of the CQ (will not land the change).
+ * If you are not part of the `angle-committers` group, you will need to either ask to be added or ask a member of the group to submit the tryjob for you. Add jmadill or geofflang as a reviewer for assistance.
+ * Wait for the bots to report the result on the code review page. The bot results should be visible in Gerrit as yellow (in-progress), green (passed), or red (failed). This can take up to two hours for some of the debug bots. Click on the colored rectangle to open the bot log to triage failed tests.
+ * If a failure is unexpected, or seems likely unrelated to your change, ask an ANGLE project member for advice.
+ * We do not currently have the capability to run individual bots or tests in a run.
* Tests can also be run locally, ANGLE's main testing methods are:
- * `angle_unittests` and `angle_end2end_tests` targets.
+ * `angle_unittests`, `angle_end2end_tests` and `angle_white_box_tests` targets.
* The [Top-of-Tree WebGL Conformance tests](https://www.khronos.org/registry/webgl/sdk/tests/webgl-conformance-tests.html).
* If you are a Chromium developer, see [Building ANGLE for Chromium Development](BuildingAngleForChromiumDevelopment.md) for instructions on building ANGLE within Chromium.
* If you aren't a browser developer, you should be able to drop your compiled DLLs into a Chrome installation, in place of those distributed with Chrome, to check WebGL conformance. [Chrome Canary](https://www.google.com/chrome/browser/canary.html) is well-suited for this.
- * Your failures must be a subset of the expected WebGL failures located in [`src/tests/WebGL-CTS-known-failures.txt`](../src/tests/WebGL-CTS-known-failures.txt). If you believe there are failing tests missing from the known failures file, please notify project members.
- * If your code isn't covered by an existing test, you are *strongly encouraged* to add new test coverage. This both ensures that your code is correct and that new contributors won't break it in the future.
+ * If your code isn't covered by an existing test, you are *strongly encouraged* to add new test coverage. This both ensures that your code is correct and that new contributors won't break it in the future.
+ * Add new tests to `angle_end2end_tests` for OpenGL-based API tests, `angle_unittests` for cross-platform internal tests, and `angle_white_box_tests` for rendering tests which also need visibility into internal ANGLE classes.
* If you are submitting a performance fix, test your code with `angle_perftests` and add a new performance test if it is not covered by the existing benchmarks.
* The [Chromium GPU FYI bot waterfall](http://build.chromium.org/p/chromium.gpu.fyi/console) provides continuous integration for ANGLE patches that have been committed. There may be hardware configurations that are not tested by the ANGLE trybots, if you notice breakage on this waterfall after landing a patch, please notify a project member.
* ANGLE also includes the [drawElements Quality Program (dEQP)](dEQP.md) for additional testing. If you're working on a new feature, there may be some extensive tests for it already written.
@@ -62,7 +63,7 @@
* Download the hook from [https://chromium-review.googlesource.com/tools/hooks/commit-msg](https://chromium-review.googlesource.com/tools/hooks/commit-msg) and copy this file to `.git/hooks/commit-msg` within your local repository. On non-Windows, platforms, ensure that permissions are set to allow execution.
* *BE AWARE:* Some patch management tools, such as StGit, currently bypass git hooks. They should not currently be used with changes intended for review.
-### Making changes
+### Making changes {#making-changes}
1. Commit your changes locally:
* `git add src/../FileName.cpp`
* `git commit`
diff --git a/chromium/third_party/angle/doc/DevSetup.md b/chromium/third_party/angle/doc/DevSetup.md
index a4b3eb044af..05533018792 100644
--- a/chromium/third_party/angle/doc/DevSetup.md
+++ b/chromium/third_party/angle/doc/DevSetup.md
@@ -15,10 +15,12 @@ On all platforms:
On Windows:
- * [Visual Studio Community 2015 Update 2](http://www.visualstudio.com/downloads/download-visual-studio-vs)
- Required to build ANGLE on Windows and for the packaged Windows 8.1 SDK.
+ * [Visual Studio Community 2015 Update 3](https://www.visualstudio.com/en-us/news/releasenotes/vs2015-update3-vs)
+ * Required to build ANGLE on Windows and for the packaged Windows 10 SDK. Note: Chrome is in the process of upgrading to Visual Studio 2017. ANGLE will switch over once Chrome does.
+ * [Windows 10 Standalone SDK](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk) (recommended)
+ * Not required to build, but comes with additional features that aid ANGLE development, such as the Debug runtime for D3D11.
* [Cygwin's Bison, flex, and patch](https://cygwin.com/setup-x86_64.exe) (optional)
- This is only required if you need to modify GLSL ES grammar files (`glslang.l` and `glslang.y` under `src/compiler/translator`, or `ExpressionParser.y` and `Tokenizer.l` in `src/compiler/preprocessor`).
+ * This is only required if you need to modify GLSL ES grammar files (`glslang.l` and `glslang.y` under `src/compiler/translator`, or `ExpressionParser.y` and `Tokenizer.l` in `src/compiler/preprocessor`).
Use the latest versions of bison, flex and patch from the 64-bit cygwin distribution.
On Linux:
@@ -38,7 +40,6 @@ Set the following environment variables as needed:
On Windows:
* `GYP_GENERATORS` to `msvs` (other options include `ninja` and `make`)
- * `GYP_DEFINES` to `windows_sdk_path=YOUR_WIN_SDK_INSTALL_DIR` if you did not install the Windows 8.1 SDK in the default location.
* `GYP_MSVS_VERSION` to `2015`
On Linux and MacOS:
diff --git a/chromium/third_party/angle/extensions/ANGLE_robust_client_memory.txt b/chromium/third_party/angle/extensions/ANGLE_robust_client_memory.txt
index 23b9dca68e3..25439fecfcc 100644
--- a/chromium/third_party/angle/extensions/ANGLE_robust_client_memory.txt
+++ b/chromium/third_party/angle/extensions/ANGLE_robust_client_memory.txt
@@ -20,7 +20,7 @@ Status
Version
- Version 3, October 7, 2016
+ Version 4, March 30, 2017
Number
@@ -65,7 +65,7 @@ New Procedures and Functions
void GetVertexAttribfvRobustANGLE(uint index, enum pname, sizei bufSize, sizei *length, float *params)
void GetVertexAttribivRobustANGLE(uint index, enum pname, sizei bufSize, sizei *length, int *params)
void GetVertexAttribPointervRobustANGLE(uint index, enum pname, sizei bufSize, sizei *length, void **pointer)
- void ReadPixelsRobustANGLE(int x, int y, sizei width, sizei height, enum format, enum type, sizei bufSize, sizei *length, void *pixels)
+ void ReadPixelsRobustANGLE(int x, int y, sizei width, sizei height, enum format, enum type, sizei bufSize, sizei *length, sizei *columns, sizei *rows, void *pixels)
void TexImage2DRobustANGLE(enum target, int level, int internalformat, sizei width, sizei height, int border, enum format, enum type, sizei bufSize, const void *pixels)
void TexParameterfvRobustANGLE(enum target, enum pname, sizei bufSize, const GLfloat *params)
void TexParameterivRobustANGLE(enum target, enum pname, sizei bufSize, const GLint *params)
@@ -98,7 +98,7 @@ New Procedures and Functions
void GetTexLevelParameterfvRobustANGLE(enum target, int level, enum pname, sizei bufSize, sizei *length, float *params)
void GetPointervRobustANGLERobustANGLE(enum pname, sizei bufSize, sizei *length, void **params)
- void ReadnPixelsRobustANGLE(int x, int y, sizei width, sizei height, enum format, enum type, sizei bufSize, sizei *length, void *data)
+ void ReadnPixelsRobustANGLE(int x, int y, sizei width, sizei height, enum format, enum type, sizei bufSize, sizei *length, sizei *columns, sizei *rows, void *data)
void GetnUniformfvRobustANGLE(uint program, int location, sizei bufSize, sizei *length, float *params)
void GetnUniformivRobustANGLE(uint program, int location, sizei bufSize, sizei *length, int *params)
void GetnUniformuivRobustANGLE(uint program, int location, sizei bufSize, sizei *length, uint *params)
@@ -128,6 +128,12 @@ Additions to the OpenGL ES Specification:
recieve the number of values written to the buffer. When an error is
generated nothing will be written to <length>.
+ The <columns> and <rows> parameters of ReadPixelsRobustANGLE and
+ ReadnPixelsRobustANGLE specify addresses of variables to recieve the number
+ of columns and rows of pixels written to the buffer which may be less than
+ the <width> and <height> parameters if they would have read outside of the
+ framebuffer.
+
Calls to "xRobustANGLE" will generate errors under the same conditions as
"x". Any instances of undefined behaviour in "x" will also be undefined in
"xRobustANGLE". For example, it is invalid to call
@@ -167,3 +173,4 @@ Revision History
2 Sept 28, 2016 geofflang Changed name from ANGLE_robust_queries to
ANGLE_robust_client_memory, added issue 3.
3 Oct 7, 2016 geofflang Added and resolved issue 4.
+ 4 Mar 30, 2017 geofflang Added columns and rows to ReadPixels.
diff --git a/chromium/third_party/angle/extensions/ANGLE_robust_resource_initialization.txt b/chromium/third_party/angle/extensions/ANGLE_robust_resource_initialization.txt
index b4092bd533d..dbe28280668 100644
--- a/chromium/third_party/angle/extensions/ANGLE_robust_resource_initialization.txt
+++ b/chromium/third_party/angle/extensions/ANGLE_robust_resource_initialization.txt
@@ -34,8 +34,8 @@ Dependencies
This extension is written against the wording of the OpenGL ES
3.1 specification.
- EGL_EXT_create_context_robust_initialization is used to request a
- context supporting this extension to perform resource initialization.
+ EGL_ANGLE_create_context_robust_initialization is required to request a
+ context that supports this extension, and resource initialization.
Overview
@@ -55,11 +55,10 @@ New Procedures and Functions
New Tokens
Accepted by the <value> parameter of GetBooleanv, GetIntegerv,
- GetFloatv, GetDoublev, and GetInteger54v:
+ GetFloatv, GetDoublev, GetInteger64v, and IsEnabled:
CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE 0x93A7
-
Additions to Chapter 6 of the OpenGL ES 3.1 Specification (Buffer
Objects)
@@ -121,17 +120,18 @@ and Framebuffer Objects)
channel of each sample; otherwise, the contents of the data store
are undefined.
-Interactions with EGL_ANGLE_create_context_robust_resource
+Interactions with EGL_ANGLE_create_context_robust_resource_initialization
If the EGL window-system binding API is used to create a context,
the EGL_ANGLE_create_context_robust_initialization extension is
supported, and the attribute
- EGL_CONTEXT_OPENGL_ROBUST_INITIALIZATION_ANGLE is set to
+ EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE is set to
EGL_TRUE when eglCreateContext is called, the resulting context
will perform robust resource initialization as described above in
section <section>, and the
CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE
query will return GL_TRUE as described above in section 2.6.1.1.
+ Otherwise queries will return GL_FALSE.
Issues
@@ -140,3 +140,4 @@ Issues
Revision History
Version 1, 2015/01/07 - first draft.
+ Version 2, 2017/03/07 - fixed EGL naming and added IsEnabled.
diff --git a/chromium/third_party/angle/extensions/CHROMIUM_bind_uniform_location.txt b/chromium/third_party/angle/extensions/CHROMIUM_bind_uniform_location.txt
index adcae6fa6d2..b08c4c61e91 100644
--- a/chromium/third_party/angle/extensions/CHROMIUM_bind_uniform_location.txt
+++ b/chromium/third_party/angle/extensions/CHROMIUM_bind_uniform_location.txt
@@ -70,6 +70,14 @@ Issues
If you need to set individual elements of a uniform array you must query the
location of the each element you wish to set.
+ If a uniform has its location explicitly set within the shader text and a
+ different location set via the API, the assignment in the shader text is
+ used.
+
+ If the location of a statically used uniform set via the API conflicts with
+ the location of a different uniform set in the shader text, linking must
+ fail.
+
New Tokens
None
@@ -129,3 +137,5 @@ Revision History
are bound to the same location.
11/6/2015 Require inactive and non-existing, bound uniform locations
to behave like location -1.
+ 3/9/2017 Locations set in the shader override ones set by the binding
+ API.
diff --git a/chromium/third_party/angle/extensions/CHROMIUM_copy_texture.txt b/chromium/third_party/angle/extensions/CHROMIUM_copy_texture.txt
index fcd9221e387..5e7fad8c993 100644
--- a/chromium/third_party/angle/extensions/CHROMIUM_copy_texture.txt
+++ b/chromium/third_party/angle/extensions/CHROMIUM_copy_texture.txt
@@ -8,11 +8,11 @@ Name Strings
Version
- Last Modifed Date: July 16, 2014
+ Last Modifed Date: March 24, 2017
Dependencies
- OpenGL ES 2.0 is required.
+ OpenGL ES 2.0 or OpenGL ES 3.0 is required.
EXT_texture_format_BGRA8888 affects the definition of this extension.
ARB_texture_rg affects the definition of this extension.
@@ -31,86 +31,120 @@ Overview
New Procedures and Functions
+ void CopyTextureCHROMIUM(uint sourceId,
+ int sourceLevel,
+ enum destTarget,
+ uint destId,
+ int destLevel,
+ int internalFormat,
+ enum destType,
+ boolean unpackFlipY,
+ boolean unpackPremultiplyAlpha,
+ boolean unpackUnmultiplyAlpha)
+
+
+ void CopySubTextureCHROMIUM(uint sourceId,
+ int sourceLevel,
+ enum destTarget,
+ uint destId,
+ int destLevel,
+ int xoffset,
+ int yoffset,
+ int x,
+ int y,
+ sizei width,
+ sizei height,
+ boolean unpackFlipY,
+ boolean unpackPremultiplyAlpha,
+ boolean unpackUnmultiplyAlpha)
+
+Additions to the OpenGL ES 2.0 Specification
+
The command
- void glCopyTextureCHROMIUM (GLuint source_id,
- GLuint dest_id,
- GLint internal_format, GLenum dest_type,
- GLboolean unpack_flip_y,
- GLboolean unpack_premultiply_alpha,
- GLboolean unpack_unmultiply_alpha)
+ CopyTextureCHROMIUM
- Copies the contents of <source_id> texture to <dest_id> texture.
+ Copies the contents of <sourceLevel> level of <sourceId> texture to
+ <destLevel> level and <destTarget> target of <destId> texture.
- Texture level 0 is copied from the source image to level 0 of the
- destination texture.
+ <destTarget> must be TEXTURE_2D,
+ TEXTURE_CUBE_MAP_POSITIVE_X, TEXTURE_CUBE_MAP_NEGATIVE_X,
+ TEXTURE_CUBE_MAP_POSITIVE_Y, TEXTURE_CUBE_MAP_NEGATIVE_Y,
+ TEXTURE_CUBE_MAP_POSITIVE_Z, TEXTURE_CUBE_MAP_NEGATIVE_Z,
+ TEXTURE_RECTANGLE_ARB.
The internal format of the destination texture is converted to that
- specified by <internal_format>. Must be one of the following symbolic
- constants: GL_RGB, GL_RGBA
- The internal format of <source_id> texture must be one of the following
- symbolic constants: GL_R8, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
- GL_RGB, GL_RGBA, GL_BGRA_EXT, GL_RGB_YCBCR_422_CHROMIUM
- When <source_id> texture doens't contain a superset of the component
- required by <internal_format>, fill the components by following rules.
-
- source format color components
- =====================================================
- GL_ALPHA (0, 0, 0, A)
- GL_R8 (R, 0, 0, 1)
- GL_LUMINANCE (L, L, L, 1)
- GL_LUMINANCE_ALPHA (L, L, L, A)
- GL_RGB (R, G, B, 1)
- GL_RGBA (R, G, B, A)
- GL_BGRA_EXT (R, G, B, A)
- GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1)
+ specified by <internalFormat>.
+
+ When source texture doens't contain a superset of the component
+ required by <internalFormat>, fill the components by following rules.
+
+ source format color components
+ ----------------------------------------
+ ALPHA (0, 0, 0, A)
+ RED (R, 0, 0, 1)
+ LUMINANCE (L, L, L, 1)
+ LUMINANCE_ALPHA (L, L, L, A)
+ RGB (R, G, B, 1)
+ RGB8 (R, G, B, 1)
+ RGBA (R, G, B, A)
+ RGBA8 (R, G, B, A)
+ BGRA_EXT (R, G, B, A)
+ BGRA8_EXT (R, G, B, A)
+ RGB_YCBCR_420V_CHROMIUM (R, G, B, 1)
+ RGB_YCBCR_422_CHROMIUM (R, G, B, 1)
The format type of the destination texture is converted to that specified
- by <dest_type>.
+ by <destType>.
- If <flip_y> is true, vertically flip texture image data.
+ If <flipY> is true, vertically flip texture image data.
- If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true,
+ If <unpackPremultiplyAlpha> and <unpackUnmultiplyAlpha> are true,
no alpha processing occurs. This is the equivalent of having neither flag
set.
- When <source_id> refers to a stream texture, the texture matrix will be
+ When <sourceId> refers to a stream texture, the texture matrix will be
applied as part of the copy operation.
- INVALID_OPERATION is generated if <internal_format> is not one of the valid formats
- described above.
+ INVALID_OPERATION is generated if <internalFormat> is not one of the
+ formats in Table 1.0.
- INVALID_OPERATION is generated if the internal format of <source_id> is not one of
- formats from the table above.
+ INVALID_OPERATION is generated if the internal format of <sourceId> is not
+ one of formats in Table 1.1.
- INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture
+ INVALID_VALUE is generated if <sourceId> or <destId> are not valid texture
objects.
- INVALID_VALUE is generated if textures corresponding to <dest_id> have not
- been bound as GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB objects.
+ INVALID_ENUM is generated if <destTarget> is not one of the valid targets
+ described above.
+
+ INVALID_OPERATION is generated if the bound target of destination texture
+ does not match <target>.
+
+ INVALID_VALUE is generated if textures corresponding to <destId> have not
+ been bound as TEXTURE_2D, TEXTURE_CUBE_MAP, or
+ TEXTURE_RECTANGLE_ARB objects.
- INVALID_VALUE is generated if textures corresponding to <source_id> have not
- been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or
- GL_TEXTURE_EXTERNAL_OES objects.
+ INVALID_VALUE is generated if textures corresponding to <sourceId> have not
+ been bound as TEXTURE_2D, TEXTURE_RECTANGLE_ARB or
+ TEXTURE_EXTERNAL_OES objects.
- INVALID_VALUE is generated if level 0 of the source texture is not defined.
+ INVALID_VALUE is generated if <sourceLevel> is not 0 for ES 2.0, or if
+ <sourceLevel> or <destLevel> is less than 0 for ES 3.0.
+
+ INVALID_VALUE is generated if <sourceLevel> of the source texture is not
+ defined.
The command
- void glCopySubTextureCHROMIUM (GLuint source_id,
- GLuint dest_id,
- GLint xoffset, GLint yoffset,
- GLint x, GLint y,
- GLsizei width, GLsizei height,
- GLboolean unpack_flip_y,
- GLboolean unpack_premultiply_alpha,
- GLboolean unpack_unmultiply_alpha)
+ CopySubTextureCHROMIUM
- Copies the sub contents of texture referred to by <source_id> to <dest_id>
- texture without redefining <dest_id> texture.
+ Copies the sub contents of texture referred to by <sourceId> to <destId>
+ texture without redefining <destId> texture.
- See CopyTextureCHROMIUM for the interpretation of the <flip_y>,
- <premultiply_alpha>, and <unmultiply_alpha> arguments.
+ See CopyTextureCHROMIUM for the interpretation of the <destTarget>,
+ <sourceLevel>, <destLevel>, <flipY>, <premultiplyAlpha>, and
+ <unmultiplyAlpha> arguments.
<xoffset> and <yoffset> specify a texel offset in the x and y direction
respectively within the destination texture.
@@ -122,25 +156,76 @@ New Procedures and Functions
<height> specifies the width of the texture subimage.
- INVALID_VALUE is generated if either <source_id> texture or <dest_id>
+ INVALID_VALUE is generated if either <sourceId> texture or <destId>
texture is not defined.
- INVALID_OPERATION is generated if source internal_format and destination
- internal_format are not one of the valid formats described above.
+ INVALID_OPERATION is generated if the internal format of <sourceId> or
+ <destId> is not one of formats in Table 1.1.
- INVALID_OPERATION is generated if the destination texture has not been
- defined.
+ INVALID_OPERATION is generated if the destination texture array has not
+ been defined.
- INVALID_VALUE is generated if <dest_id> texture is not bound as
- GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB.
+ INVALID_VALUE is generated if <destId> texture is not bound as
+ TEXTURE_2D or TEXTURE_RECTANGLE_ARB.
INVALID_VALUE is generated if level 0 of the source texture or
the destination texture is not defined.
- INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0.
-
- INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width,
- or (<yoffset> + <height>) > dest_height.
+ INVALID_VALUE is generated if (<xoffset> + <width>) > destWidth,
+ or (<yoffset> + <height>) > destHeight.
+
+ Table 1.0 Valid internal formats for CopyTextureCHROMIUM:
+
+ <internalFormat>
+ ---------------
+ RGB
+ RGBA
+ RGB8
+ RGBA8
+ BGRA_EXT
+ BGRA8_EXT,
+ SRGB_EXT
+ SRGB_ALPHA_EXT
+ R8
+ R8UI
+ RG8
+ RG8UI
+ SRGB8
+ RGB565
+ RGB8UI
+ SRGB8_ALPHA8
+ RGB5_A1
+ RGBA4
+ RGBA4
+ RGBA8UI
+ RGB9_E5
+ R16F
+ R32F
+ RG16F
+ RG32F
+ RGB16F
+ RGB32F
+ RGBA16F
+ RGBA32F
+ R11F_G11F_B10F
+
+ Table 1.1 Valid source texture internal formats for CopyTextureCHROMIUM and
+ source and destination formats for CopySubTextureCHROMIUM:
+
+ internal format
+ ---------------
+ RED
+ ALPHA
+ LUMINANCE
+ LUMINANCE_ALPHA
+ RGB
+ RGBA
+ RGB8
+ RGBA8
+ BGRA_EXT
+ BGRA8_EXT
+ RGB_YCBCR_420V_CHROMIUM
+ RGB_YCBCR_422_CHROMIUM.
Dependencies on ARB_texture_rg
@@ -168,8 +253,12 @@ Revision History
8/1/2011 Documented the extension
7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM()
- 16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target
+ 16/7/2014 Add TEXTURE_RECTANGLE_ARB as valid source_id target
19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and
unpack_unmultiply_alpha to both commands.
4/1/2016 Removed the argument target.
- 4/1/2016 Added GL_TEXTURE_RECTANGLE_ARB as valid dest_id target
+ 4/1/2016 Added TEXTURE_RECTANGLE_ARB as valid dest_id target.
+ 19/12/2016 Supported more ES 3.0 formats.
+ 18/1/2017 Supported source_level and dest_level.
+ 19/1/2017 Added TEXTURE_CUBE_MAP as valid dest_id target.
+ 24/3/2017 Clean up naming and move formats into tables.
diff --git a/chromium/third_party/angle/extensions/EGL_ANGLE_robust_resource_initialization.txt b/chromium/third_party/angle/extensions/EGL_ANGLE_create_context_robust_resource_initialization.txt
index 6a00e1d1e6f..7714774e8b4 100644
--- a/chromium/third_party/angle/extensions/EGL_ANGLE_robust_resource_initialization.txt
+++ b/chromium/third_party/angle/extensions/EGL_ANGLE_create_context_robust_resource_initialization.txt
@@ -1,10 +1,10 @@
Name
- EGL_ANGLE_robust_resource_initialization.txt
+ EGL_ANGLE_create_context_robust_resource_initialization.txt
Name Strings
- EGL_ANGLE_robust_resource_intialization
+ EGL_ANGLE_create_context_robust_resource_initialization
Contributors
@@ -53,14 +53,14 @@ New Tokens
Accepted as an attribute name in the <*attrib_list> argument to
eglCreateContext:
- EGL_CONTEXT_OPENGL_ROBUST_RESOURCE_INITIALIZATION_ANGLE 0x320F
+ EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE 0x320F
Additions to the EGL 1.5 Specification
Add a new section entitled "OpenGL ES Robust Resource Initialization"
to section 3.7.1:
- "If the attribute EGL_CONTEXT_OPENGL_ROBUST_RESOURCE_INITIALIZATION_ANGLE
+ "If the attribute EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE
is set to EGL_TRUE, a context supporting <robust resource initialization>
will be created. OpenGL ES contexts must support the
ANGLE_robust_resource_initialization extension, or equivalent core API
@@ -68,7 +68,7 @@ Additions to the EGL 1.5 Specification
This attribute is supported only for OpenGL ES contexts. If the
implementation does not support robust resource initialization,
context creation will fail.
- The default value of EGL_CONTEXT_OPENGL_ROBUST_RESOURCE_INITIALIZATION_ANGLE
+ The default value of EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE
is EGL_FALSE."
Issues
@@ -78,3 +78,4 @@ Issues
Revision History
Version 1, 2015/01/07 - first draft.
+ Version 2, 2017/03/01 - renamed extension and enum.
diff --git a/chromium/third_party/angle/extensions/EGL_CHROMIUM_get_sync_values.txt b/chromium/third_party/angle/extensions/EGL_CHROMIUM_get_sync_values.txt
new file mode 100644
index 00000000000..d95b348c845
--- /dev/null
+++ b/chromium/third_party/angle/extensions/EGL_CHROMIUM_get_sync_values.txt
@@ -0,0 +1,131 @@
+Name
+
+ CHROMIUM_get_sync_values
+
+Name Strings
+
+ EGL_CHROMIUM_get_sync_values
+
+Contact
+
+ Stéphane Marchesin, Google (marcheu 'at' google.com)
+
+Status
+
+ Draft.
+
+Version
+
+ Last Modified Date: N/A Revision: 1.0
+
+ Based on GLX_OML_sync_control Revision 6.0
+
+Number
+
+ ???
+
+Dependencies
+
+ The extension is written against the EGL 1.2 Specification, although it
+ should work on other versions of these specifications. This extension
+ also requires an operating system which supports CLOCK_MONOTONIC.
+
+Overview
+
+ This extension provides counters which let applications know about the
+ timing of the last vertical retrace. By looking at the system clock, as
+ well as the refresh rate of the monitor, this should enable applications
+ to predict the position of future retraces so as to schedule an optimal
+ workload.
+
+ This extension incorporates the use of three counters that provide
+ the necessary synchronization. The Unadjusted System Time (or UST)
+ is the 64-bit CLOCK_MONOTONIC clock; in particular this lets the
+ application schedule future vertical retraces by querying this clock.
+ The graphics Media Stream Counter (or graphics MSC) is a counter
+ that is unique to the graphics subsystem and increments for each
+ vertical retrace that occurs. The Swap Buffer Counter (SBC) is an
+ attribute of an EGLSurface and is incremented each time a swap
+ buffer action is performed on the associated surface.
+
+ The use of these three counters allows the application to
+ synchronize graphics rendering to vertical retraces and/or swap
+ buffer actions. For example, by querying the synchronization values for
+ a given surface, the application can accurately predict the timing for
+ the next vertical retraces and schedule rendering accordingly.
+
+Issues
+
+ None.
+
+IP Status
+
+ No known issues.
+
+New Procedures and Functions
+
+ Bool eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
+ EGLSurface surface,
+ int64_t* ust,
+ int64_t* msc,
+ int64_t* sbc)
+
+
+New Tokens
+
+ None
+
+Additions to the EGL 1.3 Specification
+
+ eglGetSyncValuesCHROMIUM returns the current UST/MSC/SBC triple. A UST
+ timestamp is obtained each time the graphics MSC is incremented.
+ If this value does not reflect the value of the UST at the time the
+ first scan line of the display begins passing through the video
+ output port, it will be adjusted by the graphics driver to do so
+ prior to being returned by any of the functions defined by this
+ extension.
+
+ This UST timestamp, together with the current graphics MSC and the
+ current SBC, comprise the current UST/MSC/SBC triple. The UST,
+ graphics MSC, and SBC values are not part of the render context
+ state. These values cannot be pushed or popped. The graphics MSC
+ value is initialized to 0 when the graphics device is initialized.
+ The SBC is per-surface state and is initialized to 0 when the
+ EGLSurface data structure is initialized.
+
+ The SBC value is incremented by the graphics driver at the completion
+ of each buffer swap (e.g., the pixel copy has been completed or the
+ hardware register that swaps memory banks has been written). For pixel
+ formats that do not contain a back buffer, the SBC will always be
+ returned as 0.
+
+ The graphics MSC value is incremented once for each screen refresh.
+ For a non-interlaced display, this means that the graphics MSC value
+ is incremented for each frame. For an interlaced display, it means
+ that it will be incremented for each field. For a multi-monitor
+ system, the monitor used to determine MSC is the one where the surface
+ is located. If the surface spans multiple monitors, the monitor used
+ to determine MSC is the one with the biggest coverage in pixels.
+
+ The function eglGetSyncValuesCHROMIUM will return TRUE if the function
+ completed successfully, FALSE otherwise.
+
+ Each time eglSwapBuffer succeeds, the SBC will be increased within a
+ finite time period.
+
+Errors
+
+ eglGetSyncValuesCHROMIUM will return FALSE if there is no current
+ EGLContext.
+
+New State
+
+ Get Value Get Command Type Initial Value
+ --------- ----------- ---- -------------
+ [UST] eglGetSyncValuesCHROMIUM Z unspecified
+ [MSC] eglGetSyncValuesCHROMIUM Z 0
+ [SBC] eglGetSyncValuesCHROMIUM Z 0
+
+New Implementation Dependent State
+
+ None
diff --git a/chromium/third_party/angle/gyp/common.gypi b/chromium/third_party/angle/gyp/common.gypi
index 5fcba593519..d84c54eaea3 100644
--- a/chromium/third_party/angle/gyp/common.gypi
+++ b/chromium/third_party/angle/gyp/common.gypi
@@ -80,6 +80,8 @@
'Common_Base':
{
'abstract': 1,
+ # Require the version of the Windows 10 SDK installed on the local machine.
+ 'msvs_windows_sdk_version': 'v10.0',
'msvs_configuration_attributes':
{
'OutputDirectory': '$(SolutionDir)$(ConfigurationName)_$(Platform)',
diff --git a/chromium/third_party/angle/include/EGL/eglext.h b/chromium/third_party/angle/include/EGL/eglext.h
index d75e8afbc56..bfd42137356 100644
--- a/chromium/third_party/angle/include/EGL/eglext.h
+++ b/chromium/third_party/angle/include/EGL/eglext.h
@@ -517,6 +517,10 @@ EGLAPI EGLBoolean EGLAPIENTRY eglPresentationTimeANDROID (EGLDisplay dpy, EGLSur
#define EGL_RECORDABLE_ANDROID 0x3142
#endif /* EGL_ANDROID_recordable */
+#ifndef EGL_ANGLE_create_context_robust_resource_initialization
+#define EGL_ANGLE_create_context_robust_resource_initialization 1
+#define EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE 0x320F
+#endif /* EGL_ANGLE_create_context_robust_resource_initialization */
#ifndef EGL_ANGLE_d3d_share_handle_client_buffer
#define EGL_ANGLE_d3d_share_handle_client_buffer 1
diff --git a/chromium/third_party/angle/include/GLES2/gl2ext.h b/chromium/third_party/angle/include/GLES2/gl2ext.h
index 25d2d9268cd..f33ec19af2b 100644
--- a/chromium/third_party/angle/include/GLES2/gl2ext.h
+++ b/chromium/third_party/angle/include/GLES2/gl2ext.h
@@ -841,6 +841,11 @@ GL_APICALL void GL_APIENTRY glGetPerfMonitorCounterDataAMD (GLuint monitor, GLen
#define GL_ANDROID_extension_pack_es31a 1
#endif /* GL_ANDROID_extension_pack_es31a */
+#ifndef GL_ANGLE_client_arrays
+#define GL_ANGLE_client_arrays 1
+#define GL_CLIENT_ARRAYS_ANGLE 0x93AA
+#endif /* GL_ANGLE_client_arrays */
+
#ifndef GL_ANGLE_depth_texture
#define GL_ANGLE_depth_texture 1
#endif /* GL_ANGLE_depth_texture */
@@ -867,10 +872,10 @@ GL_APICALL GLboolean GL_APIENTRY glRequestExtensionANGLE (const GLchar *name);
#endif
#endif /* GL_ANGLE_webgl_compatibility */
-#ifndef GL_ANGLE_client_arrays
-#define GL_ANGLE_client_arrays 1
-#define GL_CLIENT_ARRAYS_ANGLE 0x93AA
-#endif /* GL_ANGLE_client_arrays */
+#ifndef GL_ANGLE_robust_resource_initialization
+#define GL_ANGLE_robust_resource_initialization 1
+#define GL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE 0x93A7
+#endif /* GL_ANGLE_robust_resource_initialization */
#ifndef GL_CHROMIUM_framebuffer_mixed_samples
#define GL_CHROMIUM_frambuffer_mixed_samples 1
@@ -1320,14 +1325,20 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#ifndef GL_CHROMIUM_copy_texture
#define GL_CHROMIUM_copy_texture 1
typedef void(GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUMPROC)(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
typedef void(GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMPROC)(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
@@ -1339,14 +1350,20 @@ typedef void(GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMPROC)(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
@@ -3605,7 +3622,7 @@ typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVROBUSTANGLE) (GLuint program, GLint
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVROBUSTANGLE) (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, void **pointer);
-typedef void (GL_APIENTRYP PFNGLREADPIXELSROBUSTANGLE) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *pixels);
+typedef void (GL_APIENTRYP PFNGLREADPIXELSROBUSTANGLE) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, GLsizei *columns, GLsizei *rows, void *pixels);
typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DROBUSTANGLE) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, const GLfloat *params);
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVROBUSTANGLE) (GLenum target, GLenum pname, GLsizei bufSize, const GLint *params);
@@ -3635,7 +3652,7 @@ typedef void (GL_APIENTRYP PFNGLGETMULTISAMPLEFVROBUSTANGLE) (GLenum pname, GLui
typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERIVROBUSTANGLE) (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETTEXLEVELPARAMETERFVROBUSTANGLE) (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
typedef void (GL_APIENTRYP PFNGLGETPOINTERVROBUSTANGLEROBUSTANGLE) (GLenum pname, GLsizei bufSize, GLsizei *length, void **params);
-typedef void (GL_APIENTRYP PFNGLREADNPIXELSROBUSTANGLE) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *data);
+typedef void (GL_APIENTRYP PFNGLREADNPIXELSROBUSTANGLE) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, GLsizei *columns, GLsizei *rows, void *data);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLfloat *params);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLint *params);
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMUIVROBUSTANGLE) (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLuint *params);
@@ -3666,7 +3683,7 @@ GL_APICALL void GL_APIENTRY glGetUniformivRobustANGLE (GLuint program, GLint loc
GL_APICALL void GL_APIENTRY glGetVertexAttribfvRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetVertexAttribivRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
GL_APICALL void GL_APIENTRY glGetVertexAttribPointervRobustANGLE (GLuint index, GLenum pname, GLsizei bufSize, GLsizei *length, void **pointer);
-GL_APICALL void GL_APIENTRY glReadPixelsRobustANGLE (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *pixels);
+GL_APICALL void GL_APIENTRY glReadPixelsRobustANGLE (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, GLsizei *columns, GLsizei *rows, void *pixels);
GL_APICALL void GL_APIENTRY glTexImage2DRobustANGLE (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei bufSize, const void *pixels);
GL_APICALL void GL_APIENTRY glTexParameterfvRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, const GLfloat *params);
GL_APICALL void GL_APIENTRY glTexParameterivRobustANGLE (GLenum target, GLenum pname, GLsizei bufSize, const GLint *params);
@@ -3696,7 +3713,7 @@ GL_APICALL void GL_APIENTRY glGetMultisamplefvRobustANGLE (GLenum pname, GLuint
GL_APICALL void GL_APIENTRY glGetTexLevelParameterivRobustANGLE (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *params);
GL_APICALL void GL_APIENTRY glGetTexLevelParameterfvRobustANGLE (GLenum target, GLint level, GLenum pname, GLsizei bufSize, GLsizei *length, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetPointervRobustANGLERobustANGLE (GLenum pname, GLsizei bufSize, GLsizei *length, void **params);
-GL_APICALL void GL_APIENTRY glReadnPixelsRobustANGLE (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, void *data);
+GL_APICALL void GL_APIENTRY glReadnPixelsRobustANGLE (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, GLsizei *length, GLsizei *columns, GLsizei *rows, void *data);
GL_APICALL void GL_APIENTRY glGetnUniformfvRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLfloat *params);
GL_APICALL void GL_APIENTRY glGetnUniformivRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLint *params);
GL_APICALL void GL_APIENTRY glGetnUniformuivRobustANGLE (GLuint program, GLint location, GLsizei bufSize, GLsizei *length, GLuint *params);
diff --git a/chromium/third_party/angle/include/GLSLANG/ShaderLang.h b/chromium/third_party/angle/include/GLSLANG/ShaderLang.h
index 75330cc23a9..5e01557100f 100644
--- a/chromium/third_party/angle/include/GLSLANG/ShaderLang.h
+++ b/chromium/third_party/angle/include/GLSLANG/ShaderLang.h
@@ -25,7 +25,7 @@
// Version number for shader translation API.
// It is incremented every time the API changes.
-#define ANGLE_SH_VERSION 172
+#define ANGLE_SH_VERSION 174
enum ShShaderSpec
{
@@ -264,6 +264,7 @@ struct ShBuiltInResources
int NV_shader_framebuffer_fetch;
int ARM_shader_framebuffer_fetch;
int OVR_multiview;
+ int EXT_YUV_target;
// 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
@@ -329,6 +330,9 @@ struct ShBuiltInResources
// maximum total number of image uniforms in a program
int MaxCombinedImageUniforms;
+ // maximum number of uniform locations
+ int MaxUniformLocations;
+
// maximum number of ssbos and images in a shader
int MaxCombinedShaderOutputResources;
diff --git a/chromium/third_party/angle/include/GLSLANG/ShaderVars.h b/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
index da8b30e9cdf..f72b8c6faba 100644
--- a/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
+++ b/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
@@ -94,7 +94,21 @@ struct ShaderVariable
}
};
-struct Uniform : public ShaderVariable
+// A variable with an integer location to pass back to the GL API: either uniform (can have location
+// in GLES3.1+), vertex shader input or fragment shader output.
+struct VariableWithLocation : public ShaderVariable
+{
+ VariableWithLocation();
+ ~VariableWithLocation();
+ VariableWithLocation(const VariableWithLocation &other);
+ VariableWithLocation &operator=(const VariableWithLocation &other);
+ bool operator==(const VariableWithLocation &other) const;
+ bool operator!=(const VariableWithLocation &other) const { return !operator==(other); }
+
+ int location;
+};
+
+struct Uniform : public VariableWithLocation
{
Uniform();
~Uniform();
@@ -115,22 +129,7 @@ struct Uniform : public ShaderVariable
bool isSameUniformAtLinkTime(const Uniform &other) const;
};
-// An interface variable is a variable which passes data between the GL data structures and the
-// shader execution: either vertex shader inputs or fragment shader outputs. These variables can
-// have integer locations to pass back to the GL API.
-struct InterfaceVariable : public ShaderVariable
-{
- InterfaceVariable();
- ~InterfaceVariable();
- InterfaceVariable(const InterfaceVariable &other);
- InterfaceVariable &operator=(const InterfaceVariable &other);
- bool operator==(const InterfaceVariable &other) const;
- bool operator!=(const InterfaceVariable &other) const { return !operator==(other); }
-
- int location;
-};
-
-struct Attribute : public InterfaceVariable
+struct Attribute : public VariableWithLocation
{
Attribute();
~Attribute();
@@ -140,7 +139,7 @@ struct Attribute : public InterfaceVariable
bool operator!=(const Attribute &other) const { return !operator==(other); }
};
-struct OutputVariable : public InterfaceVariable
+struct OutputVariable : public VariableWithLocation
{
OutputVariable();
~OutputVariable();
diff --git a/chromium/third_party/angle/samples/shader_translator/shader_translator.cpp b/chromium/third_party/angle/samples/shader_translator/shader_translator.cpp
index 1db9194249e..573a3180154 100644
--- a/chromium/third_party/angle/samples/shader_translator/shader_translator.cpp
+++ b/chromium/third_party/angle/samples/shader_translator/shader_translator.cpp
@@ -209,6 +209,7 @@ int main(int argc, char *argv[])
resources.OVR_multiview = 1;
compileOptions |= SH_TRANSLATE_VIEWID_OVR_TO_UNIFORM;
break;
+ case 'y': resources.EXT_YUV_target = 1; break;
default: failCode = EFailUsage;
}
// clang-format on
@@ -346,7 +347,8 @@ void usage()
" -x=f : enable EXT_shader_framebuffer_fetch\n"
" -x=n : enable NV_shader_framebuffer_fetch\n"
" -x=a : enable ARM_shader_framebuffer_fetch\n"
- " -x=m : enable OVR_multiview\n");
+ " -x=m : enable OVR_multiview\n"
+ " -x=y : enable YUV_target\n");
// clang-format on
}
@@ -526,6 +528,9 @@ void PrintVariable(const std::string &prefix, size_t index, const sh::ShaderVari
break;
case GL_SAMPLER_EXTERNAL_OES: typeName = "GL_SAMPLER_EXTERNAL_OES"; break;
+ case GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT:
+ typeName = "GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT";
+ break;
default: typeName = "UNKNOWN"; break;
}
diff --git a/chromium/third_party/angle/src/angle.gyp b/chromium/third_party/angle/src/angle.gyp
index 9b397f72fbe..e55ae920c14 100644
--- a/chromium/third_party/angle/src/angle.gyp
+++ b/chromium/third_party/angle/src/angle.gyp
@@ -224,6 +224,52 @@
},
'conditions':
[
+ ['OS=="win"',
+ {
+ 'sources':
+ [
+ '<@(libangle_gpu_info_util_win_sources)',
+ ],
+ }],
+ ['OS=="win" and angle_build_winrt==0',
+ {
+ 'link_settings':
+ {
+ 'msvs_settings':
+ {
+ 'VCLinkerTool':
+ {
+ 'AdditionalDependencies':
+ [
+ 'setupapi.lib'
+ ]
+ }
+ }
+ },
+ 'defines':
+ [
+ 'GPU_INFO_USE_SETUPAPI',
+ ],
+ },
+ {
+ 'link_settings':
+ {
+ 'msvs_settings':
+ {
+ 'VCLinkerTool':
+ {
+ 'AdditionalDependencies':
+ [
+ 'dxgi.lib'
+ ]
+ }
+ }
+ },
+ 'defines':
+ [
+ 'GPU_INFO_USE_DXGI',
+ ],
+ }],
['OS=="linux"',
{
'sources':
diff --git a/chromium/third_party/angle/src/common/MemoryBuffer.cpp b/chromium/third_party/angle/src/common/MemoryBuffer.cpp
index e7a3fb4a2b7..e720edcabe8 100644
--- a/chromium/third_party/angle/src/common/MemoryBuffer.cpp
+++ b/chromium/third_party/angle/src/common/MemoryBuffer.cpp
@@ -11,19 +11,18 @@
#include "common/debug.h"
-namespace rx
+namespace angle
{
-MemoryBuffer::MemoryBuffer()
- : mSize(0),
- mData(NULL)
+// MemoryBuffer implementation.
+MemoryBuffer::MemoryBuffer() : mSize(0), mData(nullptr)
{
}
MemoryBuffer::~MemoryBuffer()
{
free(mData);
- mData = NULL;
+ mData = nullptr;
}
bool MemoryBuffer::resize(size_t size)
@@ -31,7 +30,7 @@ bool MemoryBuffer::resize(size_t size)
if (size == 0)
{
free(mData);
- mData = NULL;
+ mData = nullptr;
mSize = 0;
return true;
}
@@ -43,7 +42,7 @@ bool MemoryBuffer::resize(size_t size)
// Only reallocate if the size has changed.
uint8_t *newMemory = reinterpret_cast<uint8_t*>(malloc(sizeof(uint8_t) * size));
- if (newMemory == NULL)
+ if (newMemory == nullptr)
{
return false;
}
@@ -77,4 +76,58 @@ uint8_t *MemoryBuffer::data()
return mData;
}
+// ScratchBuffer implementation.
+
+ScratchBuffer::ScratchBuffer(uint32_t lifetime) : mLifetime(lifetime), mResetCounter(lifetime)
+{
+}
+
+ScratchBuffer::~ScratchBuffer()
+{
}
+
+bool ScratchBuffer::get(size_t requestedSize, MemoryBuffer **memoryBufferOut)
+{
+ if (mScratchMemory.size() == requestedSize)
+ {
+ mResetCounter = mLifetime;
+ *memoryBufferOut = &mScratchMemory;
+ return true;
+ }
+
+ if (mScratchMemory.size() > requestedSize)
+ {
+ tick();
+ }
+
+ if (mResetCounter == 0 || mScratchMemory.size() < requestedSize)
+ {
+ mScratchMemory.resize(0);
+ if (!mScratchMemory.resize(requestedSize))
+ {
+ return false;
+ }
+ mResetCounter = mLifetime;
+ }
+
+ ASSERT(mScratchMemory.size() >= requestedSize);
+
+ *memoryBufferOut = &mScratchMemory;
+ return true;
+}
+
+void ScratchBuffer::tick()
+{
+ if (mResetCounter > 0)
+ {
+ --mResetCounter;
+ }
+}
+
+void ScratchBuffer::clear()
+{
+ mResetCounter = mLifetime;
+ mScratchMemory.resize(0);
+}
+
+} // namespace angle
diff --git a/chromium/third_party/angle/src/common/MemoryBuffer.h b/chromium/third_party/angle/src/common/MemoryBuffer.h
index ec621cbca7e..b30f737b107 100644
--- a/chromium/third_party/angle/src/common/MemoryBuffer.h
+++ b/chromium/third_party/angle/src/common/MemoryBuffer.h
@@ -12,10 +12,10 @@
#include <cstddef>
#include <stdint.h>
-namespace rx
+namespace angle
{
-class MemoryBuffer : angle::NonCopyable
+class MemoryBuffer final : NonCopyable
{
public:
MemoryBuffer();
@@ -33,6 +33,29 @@ class MemoryBuffer : angle::NonCopyable
uint8_t *mData;
};
-}
+class ScratchBuffer final : NonCopyable
+{
+ public:
+ // If we request a scratch buffer requesting a smaller size this many times, release and
+ // recreate the scratch buffer. This ensures we don't have a degenerate case where we are stuck
+ // hogging memory.
+ ScratchBuffer(uint32_t lifetime);
+ ~ScratchBuffer();
+
+ // Returns true with a memory buffer of the requested size, or false on failure.
+ bool get(size_t requestedSize, MemoryBuffer **memoryBufferOut);
+
+ // Ticks the release counter for the scratch buffer. Also done implicitly in get().
+ void tick();
+
+ void clear();
+
+ private:
+ const uint32_t mLifetime;
+ uint32_t mResetCounter;
+ MemoryBuffer mScratchMemory;
+};
+
+} // namespace angle
#endif // COMMON_MEMORYBUFFER_H_
diff --git a/chromium/third_party/angle/src/common/BitSetIterator.h b/chromium/third_party/angle/src/common/bitset_utils.h
index 874f50f3ce8..6bddedd5519 100644
--- a/chromium/third_party/angle/src/common/BitSetIterator.h
+++ b/chromium/third_party/angle/src/common/bitset_utils.h
@@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// BitSetIterator:
-// A helper class to quickly bitscan bitsets for set bits.
+// bitset_utils:
+// Bitset-related helper classes, such as a fast iterator to scan for set bits.
//
#ifndef COMMON_BITSETITERATOR_H_
@@ -56,14 +56,12 @@ class BitSetIterator final
};
template <size_t N>
-BitSetIterator<N>::BitSetIterator(const std::bitset<N> &bitset)
- : mBits(bitset)
+BitSetIterator<N>::BitSetIterator(const std::bitset<N> &bitset) : mBits(bitset)
{
}
template <size_t N>
-BitSetIterator<N>::BitSetIterator(const BitSetIterator &other)
- : mBits(other.mBits)
+BitSetIterator<N>::BitSetIterator(const BitSetIterator &other) : mBits(other.mBits)
{
}
diff --git a/chromium/third_party/angle/src/common/BitSetIterator_unittest.cpp b/chromium/third_party/angle/src/common/bitset_utils_unittest.cpp
index e965f2c567e..61eff56b33c 100644
--- a/chromium/third_party/angle/src/common/BitSetIterator_unittest.cpp
+++ b/chromium/third_party/angle/src/common/bitset_utils_unittest.cpp
@@ -3,13 +3,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// BitSetIteratorTest:
-// Test the IterableBitSet class.
+// bitset_utils_unittest:
+// Tests bitset helpers and custom classes.
//
#include <gtest/gtest.h>
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
using namespace angle;
diff --git a/chromium/third_party/angle/src/common/utilities.cpp b/chromium/third_party/angle/src/common/utilities.cpp
index e3dec3e8fed..b03aada495e 100644
--- a/chromium/third_party/angle/src/common/utilities.cpp
+++ b/chromium/third_party/angle/src/common/utilities.cpp
@@ -697,7 +697,7 @@ int VariableSortOrder(GLenum type)
}
}
-std::string ParseUniformName(const std::string &name, size_t *outSubscript)
+std::string ParseResourceName(const std::string &name, size_t *outSubscript)
{
// Strip any trailing array operator and retrieve the subscript
size_t open = name.find_last_of('[');
diff --git a/chromium/third_party/angle/src/common/utilities.h b/chromium/third_party/angle/src/common/utilities.h
index 5831281d69c..68cc9ece166 100644
--- a/chromium/third_party/angle/src/common/utilities.h
+++ b/chromium/third_party/angle/src/common/utilities.h
@@ -48,9 +48,10 @@ bool IsCubeMapTextureTarget(GLenum target);
size_t CubeMapTextureTargetToLayerIndex(GLenum target);
GLenum LayerIndexToCubeMapTextureTarget(size_t index);
-// Parse the base uniform name and array index. Returns the base name of the uniform. outSubscript is
-// set to GL_INVALID_INDEX if the provided name is not an array or the array index is invalid.
-std::string ParseUniformName(const std::string &name, size_t *outSubscript);
+// Parse the base resource name and array index. Returns the base name of the resource.
+// outSubscript is set to GL_INVALID_INDEX if the provided name is not an array or the array index
+// is invalid.
+std::string ParseResourceName(const std::string &name, size_t *outSubscript);
// Find the range of index values in the provided indices pointer. Primitive restart indices are
// only counted in the range if primitive restart is disabled.
diff --git a/chromium/third_party/angle/src/common/utilities_unittest.cpp b/chromium/third_party/angle/src/common/utilities_unittest.cpp
index 447bfc6ebae..92b8d2d363a 100644
--- a/chromium/third_party/angle/src/common/utilities_unittest.cpp
+++ b/chromium/third_party/angle/src/common/utilities_unittest.cpp
@@ -13,42 +13,42 @@
namespace
{
-TEST(ParseUniformName, ArrayIndex)
+TEST(ParseResourceName, ArrayIndex)
{
size_t index;
- EXPECT_EQ("foo", gl::ParseUniformName("foo[123]", &index));
+ EXPECT_EQ("foo", gl::ParseResourceName("foo[123]", &index));
EXPECT_EQ(123u, index);
- EXPECT_EQ("bar", gl::ParseUniformName("bar[0]", &index));
+ EXPECT_EQ("bar", gl::ParseResourceName("bar[0]", &index));
EXPECT_EQ(0u, index);
}
-TEST(ParseUniformName, NegativeArrayIndex)
+TEST(ParseResourceName, NegativeArrayIndex)
{
size_t index;
- EXPECT_EQ("foo", gl::ParseUniformName("foo[-1]", &index));
+ EXPECT_EQ("foo", gl::ParseResourceName("foo[-1]", &index));
EXPECT_EQ(GL_INVALID_INDEX, index);
}
-TEST(ParseUniformName, NoArrayIndex)
+TEST(ParseResourceName, NoArrayIndex)
{
size_t index;
- EXPECT_EQ("foo", gl::ParseUniformName("foo", &index));
+ EXPECT_EQ("foo", gl::ParseResourceName("foo", &index));
EXPECT_EQ(GL_INVALID_INDEX, index);
}
-TEST(ParseUniformName, NULLArrayIndex)
+TEST(ParseResourceName, NULLArrayIndex)
{
- EXPECT_EQ("foo", gl::ParseUniformName("foo[10]", nullptr));
+ EXPECT_EQ("foo", gl::ParseResourceName("foo[10]", nullptr));
}
-TEST(ParseUniformName, TrailingWhitespace)
+TEST(ParseResourceName, TrailingWhitespace)
{
size_t index;
- EXPECT_EQ("foo ", gl::ParseUniformName("foo ", &index));
+ EXPECT_EQ("foo ", gl::ParseResourceName("foo ", &index));
EXPECT_EQ(GL_INVALID_INDEX, index);
- EXPECT_EQ("foo[10] ", gl::ParseUniformName("foo[10] ", &index));
+ EXPECT_EQ("foo[10] ", gl::ParseResourceName("foo[10] ", &index));
EXPECT_EQ(GL_INVALID_INDEX, index);
}
diff --git a/chromium/third_party/angle/src/compiler.gypi b/chromium/third_party/angle/src/compiler.gypi
index 4332fca0da0..82bd1493328 100644
--- a/chromium/third_party/angle/src/compiler.gypi
+++ b/chromium/third_party/angle/src/compiler.gypi
@@ -64,8 +64,6 @@
'compiler/translator/InitializeDll.cpp',
'compiler/translator/InitializeDll.h',
'compiler/translator/InitializeGlobals.h',
- 'compiler/translator/InitializeParseContext.cpp',
- 'compiler/translator/InitializeParseContext.h',
'compiler/translator/InitializeVariables.cpp',
'compiler/translator/InitializeVariables.h',
'compiler/translator/IntermNode.h',
@@ -83,6 +81,8 @@
'compiler/translator/Pragma.h',
'compiler/translator/PruneEmptyDeclarations.cpp',
'compiler/translator/PruneEmptyDeclarations.h',
+ 'compiler/translator/PrunePureLiteralStatements.cpp',
+ 'compiler/translator/PrunePureLiteralStatements.h',
'compiler/translator/QualifierTypes.h',
'compiler/translator/QualifierTypes.cpp',
'compiler/translator/RecordConstantPrecision.cpp',
diff --git a/chromium/third_party/angle/src/compiler/fuzz/translator_fuzzer.cpp b/chromium/third_party/angle/src/compiler/fuzz/translator_fuzzer.cpp
index 6a89c251ab4..dcc056235c9 100644
--- a/chromium/third_party/angle/src/compiler/fuzz/translator_fuzzer.cpp
+++ b/chromium/third_party/angle/src/compiler/fuzz/translator_fuzzer.cpp
@@ -150,6 +150,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
resources.EXT_shader_framebuffer_fetch = 1;
resources.NV_shader_framebuffer_fetch = 1;
resources.ARM_shader_framebuffer_fetch = 1;
+ resources.EXT_YUV_target = 1;
resources.MaxDualSourceDrawBuffers = 1;
if (!translator->Init(resources))
diff --git a/chromium/third_party/angle/src/compiler/translator/ASTMetadataHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/ASTMetadataHLSL.cpp
index e0de596ac61..80a8ab612aa 100644
--- a/chromium/third_party/angle/src/compiler/translator/ASTMetadataHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ASTMetadataHLSL.cpp
@@ -128,9 +128,8 @@ class PullGradient : public TIntermTraverser
}
else if (node->getOp() == EOpCallBuiltInFunction)
{
- TString name = TFunction::unmangleName(node->getFunctionSymbolInfo()->getName());
-
- if (mGradientBuiltinFunctions.find(name) != mGradientBuiltinFunctions.end())
+ if (mGradientBuiltinFunctions.find(node->getFunctionSymbolInfo()->getName()) !=
+ mGradientBuiltinFunctions.end())
{
onGradient();
}
diff --git a/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp b/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
index 1c7e604c8b4..552abc564ad 100644
--- a/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
@@ -50,9 +50,9 @@ TIntermAggregate *CreateReplacementCall(TIntermAggregate *originalCall,
replacementArguments->push_back(arg);
}
replacementArguments->push_back(returnValueTarget);
- TIntermAggregate *replacementCall =
- new TIntermAggregate(TType(EbtVoid), EOpCallFunctionInAST, replacementArguments);
- *replacementCall->getFunctionSymbolInfo() = *originalCall->getFunctionSymbolInfo();
+ TIntermAggregate *replacementCall = TIntermAggregate::CreateFunctionCall(
+ TType(EbtVoid), originalCall->getFunctionSymbolInfo()->getId(),
+ originalCall->getFunctionSymbolInfo()->getNameObj(), replacementArguments);
replacementCall->setLine(originalCall->getLine());
return replacementCall;
}
@@ -110,7 +110,8 @@ bool ArrayReturnValueToOutParameterTraverser::visitFunctionPrototype(Visit visit
{
// Replace the whole prototype node with another node that has the out parameter
// added. Also set the function to return void.
- TIntermFunctionPrototype *replacement = new TIntermFunctionPrototype(TType(EbtVoid));
+ TIntermFunctionPrototype *replacement =
+ new TIntermFunctionPrototype(TType(EbtVoid), node->getFunctionSymbolInfo()->getId());
CopyAggregateChildren(node, replacement);
replacement->getSequence()->push_back(CreateReturnValueOutSymbol(node->getType()));
*replacement->getFunctionSymbolInfo() = *node->getFunctionSymbolInfo();
diff --git a/chromium/third_party/angle/src/compiler/translator/BaseTypes.h b/chromium/third_party/angle/src/compiler/translator/BaseTypes.h
index 2425714cb2c..905b59f02b1 100644
--- a/chromium/third_party/angle/src/compiler/translator/BaseTypes.h
+++ b/chromium/third_party/angle/src/compiler/translator/BaseTypes.h
@@ -65,13 +65,15 @@ enum TBasicType
EbtIVec, // non type: represents ivec2, ivec3, and ivec4
EbtUVec, // non type: represents uvec2, uvec3, and uvec4
EbtBVec, // non type: represents bvec2, bvec3, and bvec4
+ EbtYuvCscStandardEXT, // Only valid if EXT_YUV_target exists.
EbtGuardSamplerBegin, // non type: see implementation of IsSampler()
EbtSampler2D,
EbtSampler3D,
EbtSamplerCube,
EbtSampler2DArray,
- EbtSamplerExternalOES, // Only valid if OES_EGL_image_external exists.
- EbtSampler2DRect, // Only valid if GL_ARB_texture_rectangle exists.
+ 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,
EbtISampler2D,
EbtISampler3D,
@@ -221,6 +223,7 @@ inline bool IsIntegerSampler(TBasicType type)
case EbtSampler3D:
case EbtSamplerCube:
case EbtSamplerExternalOES:
+ case EbtSamplerExternal2DY2YEXT:
case EbtSampler2DRect:
case EbtSampler2DArray:
case EbtSampler2DShadow:
@@ -310,6 +313,7 @@ inline bool IsSampler2D(TBasicType type)
case EbtUSampler2DArray:
case EbtSampler2DRect:
case EbtSamplerExternalOES:
+ case EbtSamplerExternal2DY2YEXT:
case EbtSampler2DShadow:
case EbtSampler2DArrayShadow:
case EbtSampler2DMS:
@@ -343,6 +347,7 @@ inline bool IsSamplerCube(TBasicType type)
case EbtSampler2D:
case EbtSampler3D:
case EbtSamplerExternalOES:
+ case EbtSamplerExternal2DY2YEXT:
case EbtSampler2DRect:
case EbtSampler2DArray:
case EbtSampler2DMS:
@@ -375,6 +380,7 @@ inline bool IsSampler3D(TBasicType type)
case EbtSampler2D:
case EbtSamplerCube:
case EbtSamplerExternalOES:
+ case EbtSamplerExternal2DY2YEXT:
case EbtSampler2DRect:
case EbtSampler2DArray:
case EbtSampler2DMS:
@@ -411,6 +417,7 @@ inline bool IsSamplerArray(TBasicType type)
case EbtUSampler2D:
case EbtSampler2DRect:
case EbtSamplerExternalOES:
+ case EbtSamplerExternal2DY2YEXT:
case EbtSampler3D:
case EbtISampler3D:
case EbtUSampler3D:
@@ -452,6 +459,7 @@ inline bool IsShadowSampler(TBasicType type)
case EbtSampler3D:
case EbtSamplerCube:
case EbtSamplerExternalOES:
+ case EbtSamplerExternal2DY2YEXT:
case EbtSampler2DRect:
case EbtSampler2DArray:
case EbtSampler2DMS:
@@ -599,6 +607,14 @@ enum TLayoutBlockStorage
EbsStd140
};
+enum TYuvCscStandardEXT
+{
+ EycsUndefined,
+ EycsItu601,
+ EycsItu601FullRange,
+ EycsItu709
+};
+
struct TLayoutQualifier
{
int location;
@@ -617,6 +633,9 @@ struct TLayoutQualifier
// OVR_multiview num_views.
int numViews;
+ // EXT_YUV_target yuv layout qualifier.
+ bool yuv;
+
static TLayoutQualifier create()
{
TLayoutQualifier layoutQualifier;
@@ -629,6 +648,7 @@ struct TLayoutQualifier
layoutQualifier.localSize.fill(-1);
layoutQualifier.binding = -1;
layoutQualifier.numViews = -1;
+ layoutQualifier.yuv = false;
layoutQualifier.imageInternalFormat = EiifUnspecified;
return layoutQualifier;
@@ -636,7 +656,7 @@ struct TLayoutQualifier
bool isEmpty() const
{
- return location == -1 && binding == -1 && numViews == -1 &&
+ return location == -1 && binding == -1 && numViews == -1 && yuv == false &&
matrixPacking == EmpUnspecified && blockStorage == EbsUnspecified &&
!localSize.isAnyValueSet() && imageInternalFormat == EiifUnspecified;
}
@@ -649,9 +669,9 @@ struct TLayoutQualifier
(location != -1 || binding != -1 || matrixPacking != EmpUnspecified ||
blockStorage != EbsUnspecified || imageInternalFormat != EiifUnspecified);
- // we can have either the work group size specified, or number of views, or the other layout
- // qualifiers.
- return (workSizeSpecified ? 1 : 0) + (numViewsSet ? 1 : 0) +
+ // we can have either the work group size specified, or number of views,
+ // or yuv layout qualifier, or the other layout qualifiers.
+ return (workSizeSpecified ? 1 : 0) + (numViewsSet ? 1 : 0) + (yuv ? 1 : 0) +
(otherLayoutQualifiersSpecified ? 1 : 0) <=
1;
}
@@ -842,6 +862,33 @@ inline const char *getImageInternalFormatString(TLayoutImageInternalFormat iifq)
}
}
+inline TYuvCscStandardEXT getYuvCscStandardEXT(const std::string &str)
+{
+ if (str == "itu_601")
+ return EycsItu601;
+ else if (str == "itu_601_full_range")
+ return EycsItu601FullRange;
+ else if (str == "itu_709")
+ return EycsItu709;
+ return EycsUndefined;
+}
+
+inline const char *getYuvCscStandardEXTString(TYuvCscStandardEXT ycsq)
+{
+ switch (ycsq)
+ {
+ case EycsItu601:
+ return "itu_601";
+ case EycsItu601FullRange:
+ return "itu_601_full_range";
+ case EycsItu709:
+ return "itu_709";
+ default:
+ UNREACHABLE();
+ return "unknown color space conversion standard";
+ }
+}
+
} // namespace sh
#endif // COMPILER_TRANSLATOR_BASETYPES_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/CallDAG.cpp b/chromium/third_party/angle/src/compiler/translator/CallDAG.cpp
index 6daa778a7a6..8557fdf6c8e 100644
--- a/chromium/third_party/angle/src/compiler/translator/CallDAG.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/CallDAG.cpp
@@ -9,7 +9,9 @@
// order.
#include "compiler/translator/CallDAG.h"
+
#include "compiler/translator/Diagnostics.h"
+#include "compiler/translator/SymbolTable.h"
namespace sh
{
@@ -78,7 +80,7 @@ class CallDAG::CallDAGCreator : public TIntermTraverser
record.callees.push_back(static_cast<int>(callee->index));
}
- (*idToIndex)[data.node->getFunctionSymbolInfo()->getId()] =
+ (*idToIndex)[data.node->getFunctionSymbolInfo()->getId().get()] =
static_cast<int>(data.index);
}
}
@@ -101,19 +103,20 @@ class CallDAG::CallDAGCreator : public TIntermTraverser
// Create the record if need be and remember the node.
if (visit == PreVisit)
{
- auto it = mFunctions.find(node->getFunctionSymbolInfo()->getName());
+ auto it = mFunctions.find(node->getFunctionSymbolInfo()->getId().get());
if (it == mFunctions.end())
{
- mCurrentFunction = &mFunctions[node->getFunctionSymbolInfo()->getName()];
+ mCurrentFunction = &mFunctions[node->getFunctionSymbolInfo()->getId().get()];
+ mCurrentFunction->name = node->getFunctionSymbolInfo()->getName();
}
else
{
mCurrentFunction = &it->second;
+ ASSERT(mCurrentFunction->name == node->getFunctionSymbolInfo()->getName());
}
mCurrentFunction->node = node;
- mCurrentFunction->name = node->getFunctionSymbolInfo()->getName();
}
else if (visit == PostVisit)
{
@@ -125,8 +128,13 @@ class CallDAG::CallDAGCreator : public TIntermTraverser
bool visitFunctionPrototype(Visit visit, TIntermFunctionPrototype *node) override
{
ASSERT(visit == PreVisit);
+ if (mCurrentFunction != nullptr)
+ {
+ return false;
+ }
+
// Function declaration, create an empty record.
- auto &record = mFunctions[node->getFunctionSymbolInfo()->getName()];
+ auto &record = mFunctions[node->getFunctionSymbolInfo()->getId().get()];
record.name = node->getFunctionSymbolInfo()->getName();
// No need to traverse the parameters.
@@ -139,10 +147,12 @@ class CallDAG::CallDAGCreator : public TIntermTraverser
if (visit == PreVisit && node->getOp() == EOpCallFunctionInAST)
{
// Function call, add the callees
- auto it = mFunctions.find(node->getFunctionSymbolInfo()->getName());
+ auto it = mFunctions.find(node->getFunctionSymbolInfo()->getId().get());
ASSERT(it != mFunctions.end());
- // We might be in a top-level function call to set a global variable
+ // We might be traversing the initializer of a global variable. Even though function
+ // calls in global scope are forbidden by the parser, some subsequent AST
+ // transformations can add them to emulate particular features.
if (mCurrentFunction)
{
mCurrentFunction->callees.insert(&it->second);
@@ -259,7 +269,7 @@ class CallDAG::CallDAGCreator : public TIntermTraverser
TDiagnostics *mDiagnostics;
- std::map<TString, CreatorFunctionData> mFunctions;
+ std::map<int, CreatorFunctionData> mFunctions;
CreatorFunctionData *mCurrentFunction;
size_t mCurrentIndex;
};
@@ -278,7 +288,7 @@ const size_t CallDAG::InvalidIndex = std::numeric_limits<size_t>::max();
size_t CallDAG::findIndex(const TFunctionSymbolInfo *functionInfo) const
{
- auto it = mFunctionIdToIndex.find(functionInfo->getId());
+ auto it = mFunctionIdToIndex.find(functionInfo->getId().get());
if (it == mFunctionIdToIndex.end())
{
diff --git a/chromium/third_party/angle/src/compiler/translator/CallDAG.h b/chromium/third_party/angle/src/compiler/translator/CallDAG.h
index 102a3ddf6e0..d29f9326e4e 100644
--- a/chromium/third_party/angle/src/compiler/translator/CallDAG.h
+++ b/chromium/third_party/angle/src/compiler/translator/CallDAG.h
@@ -26,7 +26,7 @@ namespace sh
// can be reused by multiple analyses.
//
// It stores a vector of function records, with one record per function.
-// Records are accessed by index but a mangled function name can be converted
+// Records are accessed by index but a function symbol id can be converted
// to the index of the corresponding record. The records mostly contain the
// AST node of the function and the indices of the function's callees.
//
diff --git a/chromium/third_party/angle/src/compiler/translator/Compiler.cpp b/chromium/third_party/angle/src/compiler/translator/Compiler.cpp
index 3c2a97548e3..a09c5058fe1 100644
--- a/chromium/third_party/angle/src/compiler/translator/Compiler.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/Compiler.cpp
@@ -17,7 +17,6 @@
#include "compiler/translator/EmulateGLFragColorBroadcast.h"
#include "compiler/translator/EmulatePrecision.h"
#include "compiler/translator/Initialize.h"
-#include "compiler/translator/InitializeParseContext.h"
#include "compiler/translator/InitializeVariables.h"
#include "compiler/translator/ParseContext.h"
#include "compiler/translator/PruneEmptyDeclarations.h"
@@ -293,7 +292,6 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
compileOptions, true, &mDiagnostics, getResources());
parseContext.setFragmentPrecisionHighOnESSL1(fragmentPrecisionHigh);
- SetGlobalParseContext(&parseContext);
// We preserve symbols at the built-in level from compile-to-compile.
// Start pushing the user-defined symbols at global level.
@@ -368,7 +366,8 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
success = validateOutputs(root);
if (success && shouldRunLoopAndIndexingValidation(compileOptions))
- success = validateLimitations(root);
+ success =
+ ValidateLimitations(root, shaderType, symbolTable, shaderVersion, &mDiagnostics);
bool multiview2 = IsExtensionEnabled(extensionBehavior, "GL_OVR_multiview2");
if (success && compileResources.OVR_multiview && IsWebGLBasedSpec(shaderSpec) &&
@@ -407,9 +406,6 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
(outputType == SH_GLSL_COMPATIBILITY_OUTPUT)))
initializeGLPosition(root);
- if (success && RemoveInvariant(shaderType, shaderVersion, outputType, compileOptions))
- sh::RemoveInvariantDeclaration(root);
-
// This pass might emit short circuits so keep it before the short circuit unfolding
if (success && (compileOptions & SH_REWRITE_DO_WHILE_LOOPS))
RewriteDoWhile(root, getTemporaryIndex());
@@ -450,6 +446,11 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
}
}
+ // Removing invariant declarations must be done after collecting variables.
+ // Otherwise, built-in invariant declarations don't apply.
+ if (success && RemoveInvariant(shaderType, shaderVersion, outputType, compileOptions))
+ sh::RemoveInvariantDeclaration(root);
+
if (success && (compileOptions & SH_SCALARIZE_VEC_AND_MAT_CONSTRUCTOR_ARGS))
{
ScalarizeVecAndMatConstructorArgs(root, shaderType, fragmentPrecisionHigh,
@@ -475,7 +476,6 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
}
}
- SetGlobalParseContext(NULL);
if (success)
return root;
@@ -569,6 +569,8 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources &resources)
initSamplerDefaultPrecision(EbtSamplerCube);
// SamplerExternalOES is specified in the extension to have default precision.
initSamplerDefaultPrecision(EbtSamplerExternalOES);
+ // SamplerExternal2DY2YEXT is specified in the extension to have default precision.
+ initSamplerDefaultPrecision(EbtSamplerExternal2DY2YEXT);
// It isn't specified whether Sampler2DRect has default precision.
initSamplerDefaultPrecision(EbtSampler2DRect);
@@ -616,6 +618,7 @@ void TCompiler::setResourceString()
<< ":EXT_shader_framebuffer_fetch:" << compileResources.EXT_shader_framebuffer_fetch
<< ":NV_shader_framebuffer_fetch:" << compileResources.NV_shader_framebuffer_fetch
<< ":ARM_shader_framebuffer_fetch:" << compileResources.ARM_shader_framebuffer_fetch
+ << ":EXT_YUV_target:" << compileResources.EXT_YUV_target
<< ":MaxVertexOutputVectors:" << compileResources.MaxVertexOutputVectors
<< ":MaxFragmentInputVectors:" << compileResources.MaxFragmentInputVectors
<< ":MinProgramTexelOffset:" << compileResources.MinProgramTexelOffset
@@ -755,7 +758,7 @@ bool TCompiler::tagUsedFunctions()
// Search from main, starting from the end of the DAG as it usually is the root.
for (size_t i = mCallDag.size(); i-- > 0;)
{
- if (mCallDag.getRecordFromIndex(i).name == "main(")
+ if (mCallDag.getRecordFromIndex(i).name == "main")
{
internalTagUsedFunction(i);
return true;
@@ -849,13 +852,6 @@ bool TCompiler::validateOutputs(TIntermNode *root)
return (mDiagnostics.numErrors() == 0);
}
-bool TCompiler::validateLimitations(TIntermNode *root)
-{
- ValidateLimitations validate(shaderType, &mDiagnostics);
- root->traverse(&validate);
- return mDiagnostics.numErrors() == 0;
-}
-
bool TCompiler::limitExpressionComplexity(TIntermNode *root)
{
TMaxDepthTraverser traverser(maxExpressionComplexity + 1);
diff --git a/chromium/third_party/angle/src/compiler/translator/Compiler.h b/chromium/third_party/angle/src/compiler/translator/Compiler.h
index cb484df2972..ffc063f7aaa 100644
--- a/chromium/third_party/angle/src/compiler/translator/Compiler.h
+++ b/chromium/third_party/angle/src/compiler/translator/Compiler.h
@@ -135,9 +135,6 @@ class TCompiler : public TShHandleBase
bool checkCallDepth();
// Returns true if a program has no conflicting or missing fragment outputs
bool validateOutputs(TIntermNode *root);
- // Returns true if the given shader does not exceed the minimum
- // functionality mandated in GLSL 1.0 spec Appendix A.
- bool validateLimitations(TIntermNode *root);
// Add emulated functions to the built-in function emulator.
virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
ShCompileOptions compileOptions){};
diff --git a/chromium/third_party/angle/src/compiler/translator/ConstantUnion.cpp b/chromium/third_party/angle/src/compiler/translator/ConstantUnion.cpp
index 464c30cab78..b960e428f24 100644
--- a/chromium/third_party/angle/src/compiler/translator/ConstantUnion.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ConstantUnion.cpp
@@ -198,6 +198,11 @@ bool TConstantUnion::operator==(const bool b) const
return b == bConst;
}
+bool TConstantUnion::operator==(const TYuvCscStandardEXT s) const
+{
+ return s == yuvCscStandardEXTConst;
+}
+
bool TConstantUnion::operator==(const TConstantUnion &constant) const
{
if (constant.type != type)
@@ -213,6 +218,8 @@ bool TConstantUnion::operator==(const TConstantUnion &constant) const
return constant.fConst == fConst;
case EbtBool:
return constant.bConst == bConst;
+ case EbtYuvCscStandardEXT:
+ return constant.yuvCscStandardEXTConst == yuvCscStandardEXTConst;
default:
return false;
}
@@ -238,6 +245,11 @@ bool TConstantUnion::operator!=(const bool b) const
return !operator==(b);
}
+bool TConstantUnion::operator!=(const TYuvCscStandardEXT s) const
+{
+ return !operator==(s);
+}
+
bool TConstantUnion::operator!=(const TConstantUnion &constant) const
{
return !operator==(constant);
diff --git a/chromium/third_party/angle/src/compiler/translator/ConstantUnion.h b/chromium/third_party/angle/src/compiler/translator/ConstantUnion.h
index dbec67ea67c..870acb6f903 100644
--- a/chromium/third_party/angle/src/compiler/translator/ConstantUnion.h
+++ b/chromium/third_party/angle/src/compiler/translator/ConstantUnion.h
@@ -46,20 +46,29 @@ class TConstantUnion
type = EbtBool;
}
+ void setYuvCscStandardEXTConst(TYuvCscStandardEXT s)
+ {
+ yuvCscStandardEXTConst = s;
+ type = EbtYuvCscStandardEXT;
+ }
+
int getIConst() const { return iConst; }
unsigned int getUConst() const { return uConst; }
float getFConst() const { return fConst; }
bool getBConst() const { return bConst; }
+ TYuvCscStandardEXT getYuvCscStandardEXTConst() const { return yuvCscStandardEXTConst; }
bool operator==(const int i) const;
bool operator==(const unsigned int u) const;
bool operator==(const float f) const;
bool operator==(const bool b) const;
+ bool operator==(const TYuvCscStandardEXT s) const;
bool operator==(const TConstantUnion &constant) const;
bool operator!=(const int i) const;
bool operator!=(const unsigned int u) const;
bool operator!=(const float f) const;
bool operator!=(const bool b) const;
+ bool operator!=(const TYuvCscStandardEXT s) const;
bool operator!=(const TConstantUnion &constant) const;
bool operator>(const TConstantUnion &constant) const;
bool operator<(const TConstantUnion &constant) const;
@@ -97,6 +106,7 @@ class TConstantUnion
unsigned int uConst; // used for uvec, scalar uints
bool bConst; // used for bvec, scalar bools
float fConst; // used for vec, mat, scalar floats
+ TYuvCscStandardEXT yuvCscStandardEXTConst;
};
TBasicType type;
diff --git a/chromium/third_party/angle/src/compiler/translator/DeferGlobalInitializers.cpp b/chromium/third_party/angle/src/compiler/translator/DeferGlobalInitializers.cpp
index 735350675c4..cf7ebb5e884 100644
--- a/chromium/third_party/angle/src/compiler/translator/DeferGlobalInitializers.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/DeferGlobalInitializers.cpp
@@ -21,43 +21,6 @@ namespace sh
namespace
{
-void SetInternalFunctionName(TFunctionSymbolInfo *functionInfo, const char *name)
-{
- TString nameStr(name);
- nameStr = TFunction::mangleName(nameStr);
- TName nameObj(nameStr);
- nameObj.setInternal(true);
- functionInfo->setNameObj(nameObj);
-}
-
-TIntermFunctionPrototype *CreateFunctionPrototypeNode(const char *name, const int functionId)
-{
- TType returnType(EbtVoid);
- TIntermFunctionPrototype *functionNode = new TIntermFunctionPrototype(returnType);
-
- SetInternalFunctionName(functionNode->getFunctionSymbolInfo(), name);
- functionNode->getFunctionSymbolInfo()->setId(functionId);
- return functionNode;
-}
-
-TIntermFunctionDefinition *CreateFunctionDefinitionNode(const char *name,
- TIntermBlock *functionBody,
- const int functionId)
-{
- TIntermFunctionPrototype *prototypeNode = CreateFunctionPrototypeNode(name, functionId);
- return new TIntermFunctionDefinition(prototypeNode, functionBody);
-}
-
-TIntermAggregate *CreateFunctionCallNode(const char *name, const int functionId)
-{
- TType returnType(EbtVoid);
- TIntermAggregate *functionNode =
- new TIntermAggregate(returnType, EOpCallFunctionInAST, nullptr);
- SetInternalFunctionName(functionNode->getFunctionSymbolInfo(), name);
- functionNode->getFunctionSymbolInfo()->setId(functionId);
- return functionNode;
-}
-
class DeferGlobalInitializersTraverser : public TIntermTraverser
{
public:
@@ -132,13 +95,13 @@ void DeferGlobalInitializersTraverser::insertInitFunction(TIntermBlock *root)
{
return;
}
- const int initFunctionId = TSymbolTable::nextUniqueId();
+ TSymbolUniqueId initFunctionId;
const char *functionName = "initializeDeferredGlobals";
// Add function prototype to the beginning of the shader
TIntermFunctionPrototype *functionPrototypeNode =
- CreateFunctionPrototypeNode(functionName, initFunctionId);
+ CreateInternalFunctionPrototypeNode(TType(EbtVoid), functionName, initFunctionId);
root->getSequence()->insert(root->getSequence()->begin(), functionPrototypeNode);
// Add function definition to the end of the shader
@@ -148,8 +111,8 @@ void DeferGlobalInitializersTraverser::insertInitFunction(TIntermBlock *root)
{
functionBody->push_back(deferredInit);
}
- TIntermFunctionDefinition *functionDefinition =
- CreateFunctionDefinitionNode(functionName, functionBodyNode, initFunctionId);
+ TIntermFunctionDefinition *functionDefinition = CreateInternalFunctionDefinitionNode(
+ TType(EbtVoid), functionName, functionBodyNode, initFunctionId);
root->getSequence()->push_back(functionDefinition);
// Insert call into main function
@@ -158,8 +121,8 @@ void DeferGlobalInitializersTraverser::insertInitFunction(TIntermBlock *root)
TIntermFunctionDefinition *nodeFunction = node->getAsFunctionDefinition();
if (nodeFunction != nullptr && nodeFunction->getFunctionSymbolInfo()->isMain())
{
- TIntermAggregate *functionCallNode =
- CreateFunctionCallNode(functionName, initFunctionId);
+ TIntermAggregate *functionCallNode = CreateInternalFunctionCallNode(
+ TType(EbtVoid), functionName, initFunctionId, nullptr);
TIntermBlock *mainBody = nodeFunction->getBody();
ASSERT(mainBody != nullptr);
diff --git a/chromium/third_party/angle/src/compiler/translator/EmulatePrecision.cpp b/chromium/third_party/angle/src/compiler/translator/EmulatePrecision.cpp
index b8a5c9a6563..80d5c1ed33e 100644
--- a/chromium/third_party/angle/src/compiler/translator/EmulatePrecision.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/EmulatePrecision.cpp
@@ -431,9 +431,10 @@ TIntermAggregate *createInternalFunctionCallNode(const TType &type,
TString name,
TIntermSequence *arguments)
{
- TName nameObj(TFunction::GetMangledNameFromCall(name, *arguments));
+ TName nameObj(name);
nameObj.setInternal(true);
- TIntermAggregate *callNode = new TIntermAggregate(type, EOpCallInternalRawFunction, arguments);
+ TIntermAggregate *callNode =
+ TIntermAggregate::Create(type, EOpCallInternalRawFunction, arguments);
callNode->getFunctionSymbolInfo()->setNameObj(nameObj);
return callNode;
}
diff --git a/chromium/third_party/angle/src/compiler/translator/Initialize.cpp b/chromium/third_party/angle/src/compiler/translator/Initialize.cpp
index 1bad3208e69..edc50b899c5 100644
--- a/chromium/third_party/angle/src/compiler/translator/Initialize.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/Initialize.cpp
@@ -391,6 +391,25 @@ void InsertBuiltInFunctions(sh::GLenum type,
float4);
}
+ if (resources.EXT_YUV_target)
+ {
+ const TType *samplerExternal2DY2YEXT = TCache::getType(EbtSamplerExternal2DY2YEXT);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float4, "texture",
+ samplerExternal2DY2YEXT, float2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float4, "textureProj",
+ samplerExternal2DY2YEXT, float3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float4, "textureProj",
+ samplerExternal2DY2YEXT, float4);
+
+ const TType *yuvCscStandardEXT = TCache::getType(EbtYuvCscStandardEXT);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float3, "rgb_2_yuv", float3,
+ yuvCscStandardEXT);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float3, "yuv_2_rgb", float3,
+ yuvCscStandardEXT);
+ }
+
if (type == GL_FRAGMENT_SHADER)
{
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "texture", gsampler2D, float2, float1);
@@ -413,6 +432,18 @@ void InsertBuiltInFunctions(sh::GLenum type,
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "textureProj", samplerExternalOES,
float4, float1);
}
+
+ if (resources.EXT_YUV_target)
+ {
+ const TType *samplerExternal2DY2YEXT = TCache::getType(EbtSamplerExternal2DY2YEXT);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float4, "texture",
+ samplerExternal2DY2YEXT, float2, float1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float4, "textureProj",
+ samplerExternal2DY2YEXT, float3, float1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float4, "textureProj",
+ samplerExternal2DY2YEXT, float4, float1);
+ }
}
const TType *sampler2DShadow = TCache::getType(EbtSampler2DShadow);
@@ -452,6 +483,14 @@ void InsertBuiltInFunctions(sh::GLenum type,
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", samplerExternalOES, int1);
}
+ if (resources.EXT_YUV_target)
+ {
+ const TType *samplerExternal2DY2YEXT = TCache::getType(EbtSamplerExternal2DY2YEXT);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", int2, "textureSize",
+ samplerExternal2DY2YEXT, int1);
+ }
+
if (type == GL_FRAGMENT_SHADER)
{
symbolTable.insertBuiltInOp(ESSL3_BUILTINS, EOpDFdx, genType, genType);
@@ -532,6 +571,14 @@ void InsertBuiltInFunctions(sh::GLenum type,
int1);
}
+ if (resources.EXT_YUV_target)
+ {
+ const TType *samplerExternal2DY2YEXT = TCache::getType(EbtSamplerExternal2DY2YEXT);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, "GL_EXT_YUV_target", float4, "texelFetch",
+ samplerExternal2DY2YEXT, int2, int1);
+ }
+
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "texelFetchOffset", gsampler2D, int2, int1,
int2);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "texelFetchOffset", gsampler3D, int3, int1,
@@ -643,9 +690,9 @@ void InsertBuiltInFunctions(sh::GLenum type,
symbolTable.insert(COMMON_BUILTINS, depthRangeParameters);
TVariable *depthRange = new TVariable(NewPoolTString("gl_DepthRange"), TType(depthRangeStruct));
depthRange->setQualifier(EvqUniform);
- // Ensure we evaluate the mangled name for depth range, so we allocate to the current scope.
- depthRangeParameters->getType().getMangledName();
- depthRange->getType().getMangledName();
+ // Do lazy initialization for depth range, so we allocate to the current scope.
+ depthRangeParameters->getType().realize();
+ depthRange->getType().realize();
symbolTable.insert(COMMON_BUILTINS, depthRange);
//
@@ -906,6 +953,10 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
extBehavior["GL_OVR_multiview"] = EBhUndefined;
extBehavior["GL_OVR_multiview2"] = EBhUndefined;
}
+ if (resources.EXT_YUV_target)
+ {
+ extBehavior["GL_EXT_YUV_target"] = EBhUndefined;
+ }
}
void ResetExtensionBehavior(TExtensionBehavior &extBehavior)
diff --git a/chromium/third_party/angle/src/compiler/translator/InitializeDll.cpp b/chromium/third_party/angle/src/compiler/translator/InitializeDll.cpp
index c6e16f55c67..43c215f52b5 100644
--- a/chromium/third_party/angle/src/compiler/translator/InitializeDll.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/InitializeDll.cpp
@@ -7,7 +7,6 @@
#include "compiler/translator/Cache.h"
#include "compiler/translator/InitializeDll.h"
#include "compiler/translator/InitializeGlobals.h"
-#include "compiler/translator/InitializeParseContext.h"
#include "common/platform.h"
@@ -24,12 +23,6 @@ bool InitProcess()
return false;
}
- if (!InitializeParseContextIndex())
- {
- assert(0 && "InitProcess(): Failed to initalize parse context");
- return false;
- }
-
TCache::initialize();
return true;
@@ -37,7 +30,6 @@ bool InitProcess()
void DetachProcess()
{
- FreeParseContextIndex();
FreePoolIndex();
TCache::destroy();
}
diff --git a/chromium/third_party/angle/src/compiler/translator/InitializeParseContext.cpp b/chromium/third_party/angle/src/compiler/translator/InitializeParseContext.cpp
deleted file mode 100644
index 751ee3677c6..00000000000
--- a/chromium/third_party/angle/src/compiler/translator/InitializeParseContext.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-//
-// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-#include "compiler/translator/InitializeParseContext.h"
-
-#include "common/tls.h"
-
-#include <assert.h>
-
-namespace sh
-{
-
-TLSIndex GlobalParseContextIndex = TLS_INVALID_INDEX;
-
-bool InitializeParseContextIndex()
-{
- assert(GlobalParseContextIndex == TLS_INVALID_INDEX);
-
- GlobalParseContextIndex = CreateTLSIndex();
- return GlobalParseContextIndex != TLS_INVALID_INDEX;
-}
-
-void FreeParseContextIndex()
-{
- assert(GlobalParseContextIndex != TLS_INVALID_INDEX);
-
- DestroyTLSIndex(GlobalParseContextIndex);
- GlobalParseContextIndex = TLS_INVALID_INDEX;
-}
-
-void SetGlobalParseContext(TParseContext *context)
-{
- assert(GlobalParseContextIndex != TLS_INVALID_INDEX);
- SetTLSValue(GlobalParseContextIndex, context);
-}
-
-TParseContext *GetGlobalParseContext()
-{
- assert(GlobalParseContextIndex != TLS_INVALID_INDEX);
- return static_cast<TParseContext *>(GetTLSValue(GlobalParseContextIndex));
-}
-
-} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/InitializeParseContext.h b/chromium/third_party/angle/src/compiler/translator/InitializeParseContext.h
deleted file mode 100644
index ad93c03c8d4..00000000000
--- a/chromium/third_party/angle/src/compiler/translator/InitializeParseContext.h
+++ /dev/null
@@ -1,21 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-#ifndef COMPILER_TRANSLATOR_INITIALIZEPARSECONTEXT_H_
-#define COMPILER_TRANSLATOR_INITIALIZEPARSECONTEXT_H_
-
-namespace sh
-{
-
-bool InitializeParseContextIndex();
-void FreeParseContextIndex();
-
-class TParseContext;
-extern void SetGlobalParseContext(TParseContext *context);
-extern TParseContext *GetGlobalParseContext();
-} // namespace sh
-
-#endif // COMPILER_TRANSLATOR_INITIALIZEPARSECONTEXT_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp b/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp
index 1401af789c1..e63848a4670 100644
--- a/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp
@@ -272,6 +272,57 @@ bool TIntermAggregateBase::insertChildNodes(TIntermSequence::size_type position,
return true;
}
+TIntermAggregate *TIntermAggregate::CreateFunctionCall(const TFunction &func,
+ TIntermSequence *arguments)
+{
+ TIntermAggregate *callNode =
+ new TIntermAggregate(func.getReturnType(), EOpCallFunctionInAST, arguments);
+ callNode->getFunctionSymbolInfo()->setFromFunction(func);
+ return callNode;
+}
+
+TIntermAggregate *TIntermAggregate::CreateFunctionCall(const TType &type,
+ const TSymbolUniqueId &id,
+ const TName &name,
+ TIntermSequence *arguments)
+{
+ TIntermAggregate *callNode = new TIntermAggregate(type, EOpCallFunctionInAST, arguments);
+ callNode->getFunctionSymbolInfo()->setId(id);
+ callNode->getFunctionSymbolInfo()->setNameObj(name);
+ return callNode;
+}
+
+TIntermAggregate *TIntermAggregate::CreateBuiltInFunctionCall(const TFunction &func,
+ TIntermSequence *arguments)
+{
+ TIntermAggregate *callNode =
+ new TIntermAggregate(func.getReturnType(), EOpCallBuiltInFunction, arguments);
+ callNode->getFunctionSymbolInfo()->setFromFunction(func);
+ // Note that name needs to be set before texture function type is determined.
+ callNode->setBuiltInFunctionPrecision();
+ return callNode;
+}
+
+TIntermAggregate *TIntermAggregate::CreateConstructor(const TType &type,
+ TOperator op,
+ TIntermSequence *arguments)
+{
+ TIntermAggregate *constructorNode = new TIntermAggregate(type, op, arguments);
+ ASSERT(constructorNode->isConstructor());
+ return constructorNode;
+}
+
+TIntermAggregate *TIntermAggregate::Create(const TType &type,
+ TOperator op,
+ TIntermSequence *arguments)
+{
+ TIntermAggregate *node = new TIntermAggregate(type, op, arguments);
+ ASSERT(op != EOpCallFunctionInAST); // Should use CreateFunctionCall
+ ASSERT(op != EOpCallBuiltInFunction); // Should use CreateBuiltInFunctionCall
+ ASSERT(!node->isConstructor()); // Should use CreateConstructor
+ return node;
+}
+
TIntermAggregate::TIntermAggregate(const TType &type, TOperator op, TIntermSequence *arguments)
: TIntermOperator(op), mUseEmulatedFunction(false), mGotPrecisionFromChildren(false)
{
@@ -399,6 +450,21 @@ void TIntermAggregate::setBuiltInFunctionPrecision()
mType.setPrecision(precision);
}
+TString TIntermAggregate::getSymbolTableMangledName() const
+{
+ ASSERT(!isConstructor());
+ switch (mOp)
+ {
+ case EOpCallInternalRawFunction:
+ case EOpCallBuiltInFunction:
+ case EOpCallFunctionInAST:
+ return TFunction::GetMangledNameFromCall(mFunctionInfo.getName(), mArguments);
+ default:
+ TString opString = GetOperatorString(mOp);
+ return TFunction::GetMangledNameFromCall(opString, mArguments);
+ }
+}
+
void TIntermBlock::appendStatement(TIntermNode *statement)
{
// Declaration nodes with no children can appear if all the declarators just added constants to
@@ -557,7 +623,8 @@ TIntermTyped *TIntermTyped::CreateZero(const TType &type)
}
}
- return new TIntermAggregate(constType, sh::TypeToConstructorOperator(type), arguments);
+ return TIntermAggregate::CreateConstructor(constType, sh::TypeToConstructorOperator(type),
+ arguments);
}
// static
@@ -578,8 +645,46 @@ TIntermConstantUnion::TIntermConstantUnion(const TIntermConstantUnion &node) : T
void TFunctionSymbolInfo::setFromFunction(const TFunction &function)
{
- setName(function.getMangledName());
- setId(function.getUniqueId());
+ setName(function.getName());
+ setId(TSymbolUniqueId(function));
+}
+
+TFunctionSymbolInfo::TFunctionSymbolInfo(const TSymbolUniqueId &id) : mId(new TSymbolUniqueId(id))
+{
+}
+
+TFunctionSymbolInfo::TFunctionSymbolInfo(const TFunctionSymbolInfo &info)
+ : mName(info.mName), mId(nullptr)
+{
+ if (info.mId)
+ {
+ mId = new TSymbolUniqueId(*info.mId);
+ }
+}
+
+TFunctionSymbolInfo &TFunctionSymbolInfo::operator=(const TFunctionSymbolInfo &info)
+{
+ mName = info.mName;
+ if (info.mId)
+ {
+ mId = new TSymbolUniqueId(*info.mId);
+ }
+ else
+ {
+ mId = nullptr;
+ }
+ return *this;
+}
+
+void TFunctionSymbolInfo::setId(const TSymbolUniqueId &id)
+{
+ mId = new TSymbolUniqueId(id);
+}
+
+const TSymbolUniqueId &TFunctionSymbolInfo::getId() const
+{
+ ASSERT(mId);
+ return *mId;
}
TIntermAggregate::TIntermAggregate(const TIntermAggregate &node)
@@ -597,11 +702,22 @@ TIntermAggregate::TIntermAggregate(const TIntermAggregate &node)
}
}
+TIntermAggregate *TIntermAggregate::shallowCopy() const
+{
+ TIntermSequence *copySeq = new TIntermSequence();
+ copySeq->insert(copySeq->begin(), getSequence()->begin(), getSequence()->end());
+ TIntermAggregate *copyNode = new TIntermAggregate(mType, mOp, copySeq);
+ *copyNode->getFunctionSymbolInfo() = mFunctionInfo;
+ copyNode->setLine(mLine);
+ return copyNode;
+}
+
TIntermSwizzle::TIntermSwizzle(const TIntermSwizzle &node) : TIntermTyped(node)
{
TIntermTyped *operandCopy = node.mOperand->deepCopy();
ASSERT(operandCopy != nullptr);
mOperand = operandCopy;
+ mSwizzleOffsets = node.mSwizzleOffsets;
}
TIntermBinary::TIntermBinary(const TIntermBinary &node)
@@ -3275,4 +3391,44 @@ void TIntermTraverser::queueReplacementWithParent(TIntermNode *parent,
mReplacements.push_back(NodeUpdateEntry(parent, original, replacement, originalBecomesChild));
}
+TName TIntermTraverser::GetInternalFunctionName(const char *name)
+{
+ TString nameStr(name);
+ TName nameObj(nameStr);
+ nameObj.setInternal(true);
+ return nameObj;
+}
+
+TIntermFunctionPrototype *TIntermTraverser::CreateInternalFunctionPrototypeNode(
+ const TType &returnType,
+ const char *name,
+ const TSymbolUniqueId &functionId)
+{
+ TIntermFunctionPrototype *functionNode = new TIntermFunctionPrototype(returnType, functionId);
+ functionNode->getFunctionSymbolInfo()->setNameObj(GetInternalFunctionName(name));
+ return functionNode;
+}
+
+TIntermFunctionDefinition *TIntermTraverser::CreateInternalFunctionDefinitionNode(
+ const TType &returnType,
+ const char *name,
+ TIntermBlock *functionBody,
+ const TSymbolUniqueId &functionId)
+{
+ TIntermFunctionPrototype *prototypeNode =
+ CreateInternalFunctionPrototypeNode(returnType, name, functionId);
+ return new TIntermFunctionDefinition(prototypeNode, functionBody);
+}
+
+TIntermAggregate *TIntermTraverser::CreateInternalFunctionCallNode(
+ const TType &returnType,
+ const char *name,
+ const TSymbolUniqueId &functionId,
+ TIntermSequence *arguments)
+{
+ TIntermAggregate *functionNode = TIntermAggregate::CreateFunctionCall(
+ returnType, functionId, GetInternalFunctionName(name), arguments);
+ return functionNode;
+}
+
} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/IntermNode.h b/chromium/third_party/angle/src/compiler/translator/IntermNode.h
index 608aa05893e..bef27a572e4 100644
--- a/chromium/third_party/angle/src/compiler/translator/IntermNode.h
+++ b/chromium/third_party/angle/src/compiler/translator/IntermNode.h
@@ -56,6 +56,7 @@ class TIntermRaw;
class TIntermBranch;
class TSymbolTable;
+class TSymbolUniqueId;
class TFunction;
// Encapsulate an identifier string and track whether it is coming from the original shader code
@@ -414,7 +415,7 @@ class TIntermOperator : public TIntermTyped
TIntermOperator(const TIntermOperator &) = default;
- TOperator mOp;
+ const TOperator mOp;
};
// Node for vector swizzles.
@@ -535,26 +536,27 @@ class TFunctionSymbolInfo
{
public:
POOL_ALLOCATOR_NEW_DELETE();
- TFunctionSymbolInfo() : mId(0) {}
+ TFunctionSymbolInfo(const TSymbolUniqueId &id);
+ TFunctionSymbolInfo() : mId(nullptr) {}
- TFunctionSymbolInfo(const TFunctionSymbolInfo &) = default;
- TFunctionSymbolInfo &operator=(const TFunctionSymbolInfo &) = default;
+ TFunctionSymbolInfo(const TFunctionSymbolInfo &info);
+ TFunctionSymbolInfo &operator=(const TFunctionSymbolInfo &info);
void setFromFunction(const TFunction &function);
- // The name stored here should always be mangled.
void setNameObj(const TName &name) { mName = name; }
const TName &getNameObj() const { return mName; }
const TString &getName() const { return mName.getString(); }
void setName(const TString &name) { mName.setString(name); }
- bool isMain() const { return mName.getString() == "main("; }
+ bool isMain() const { return mName.getString() == "main"; }
+
+ void setId(const TSymbolUniqueId &functionId);
+ const TSymbolUniqueId &getId() const;
- void setId(int functionId) { mId = functionId; }
- int getId() const { return mId; }
private:
TName mName;
- int mId;
+ TSymbolUniqueId *mId;
};
typedef TVector<TIntermNode *> TIntermSequence;
@@ -593,12 +595,28 @@ class TIntermAggregateBase
class TIntermAggregate : public TIntermOperator, public TIntermAggregateBase
{
public:
- TIntermAggregate(const TType &type, TOperator op, TIntermSequence *arguments);
+ static TIntermAggregate *CreateFunctionCall(const TFunction &func, TIntermSequence *arguments);
+
+ // If using this, ensure that there's a consistent function definition with the same symbol id
+ // added to the AST.
+ static TIntermAggregate *CreateFunctionCall(const TType &type,
+ const TSymbolUniqueId &id,
+ const TName &name,
+ TIntermSequence *arguments);
+
+ static TIntermAggregate *CreateBuiltInFunctionCall(const TFunction &func,
+ TIntermSequence *arguments);
+ static TIntermAggregate *CreateConstructor(const TType &type,
+ TOperator op,
+ TIntermSequence *arguments);
+ static TIntermAggregate *Create(const TType &type, TOperator op, TIntermSequence *arguments);
~TIntermAggregate() {}
// Note: only supported for nodes that can be a part of an expression.
TIntermTyped *deepCopy() const override { return new TIntermAggregate(*this); }
+ TIntermAggregate *shallowCopy() const;
+
TIntermAggregate *getAsAggregate() override { return this; }
void traverse(TIntermTraverser *it) override;
bool replaceChildNode(TIntermNode *original, TIntermNode *replacement) override;
@@ -610,6 +628,8 @@ class TIntermAggregate : public TIntermOperator, public TIntermAggregateBase
TIntermSequence *getSequence() override { return &mArguments; }
const TIntermSequence *getSequence() const override { return &mArguments; }
+ TString getSymbolTableMangledName() const;
+
void setUseEmulatedFunction() { mUseEmulatedFunction = true; }
bool getUseEmulatedFunction() { return mUseEmulatedFunction; }
@@ -619,10 +639,6 @@ class TIntermAggregate : public TIntermOperator, public TIntermAggregateBase
TFunctionSymbolInfo *getFunctionSymbolInfo() { return &mFunctionInfo; }
const TFunctionSymbolInfo *getFunctionSymbolInfo() const { return &mFunctionInfo; }
- // Used for built-in functions under EOpCallBuiltInFunction. The function name in the symbol
- // info needs to be set before calling this.
- void setBuiltInFunctionPrecision();
-
protected:
TIntermSequence mArguments;
@@ -635,6 +651,8 @@ class TIntermAggregate : public TIntermOperator, public TIntermAggregateBase
TFunctionSymbolInfo mFunctionInfo;
private:
+ TIntermAggregate(const TType &type, TOperator op, TIntermSequence *arguments);
+
TIntermAggregate(const TIntermAggregate &node); // note: not deleted, just private!
void setTypePrecisionAndQualifier(const TType &type);
@@ -647,6 +665,10 @@ class TIntermAggregate : public TIntermOperator, public TIntermAggregateBase
// Returns true if precision was set according to special rules for this built-in.
bool setPrecisionForSpecialBuiltInOp();
+
+ // Used for built-in functions under EOpCallBuiltInFunction. The function name in the symbol
+ // info needs to be set before calling this.
+ void setBuiltInFunctionPrecision();
};
// A list of statements. Either the root node which contains declarations and function definitions,
@@ -678,7 +700,10 @@ class TIntermFunctionPrototype : public TIntermTyped, public TIntermAggregateBas
public:
// TODO(oetuaho@nvidia.com): See if TFunctionSymbolInfo could be added to constructor
// parameters.
- TIntermFunctionPrototype(const TType &type) : TIntermTyped(type) {}
+ TIntermFunctionPrototype(const TType &type, const TSymbolUniqueId &id)
+ : TIntermTyped(type), mFunctionInfo(id)
+ {
+ }
~TIntermFunctionPrototype() {}
TIntermFunctionPrototype *getAsFunctionPrototypeNode() override { return this; }
@@ -967,6 +992,20 @@ class TIntermTraverser : angle::NonCopyable
// Start creating temporary symbols from the given temporary symbol index + 1.
void useTemporaryIndex(unsigned int *temporaryIndex);
+ static TIntermFunctionPrototype *CreateInternalFunctionPrototypeNode(
+ const TType &returnType,
+ const char *name,
+ const TSymbolUniqueId &functionId);
+ static TIntermFunctionDefinition *CreateInternalFunctionDefinitionNode(
+ const TType &returnType,
+ const char *name,
+ TIntermBlock *functionBody,
+ const TSymbolUniqueId &functionId);
+ static TIntermAggregate *CreateInternalFunctionCallNode(const TType &returnType,
+ const char *name,
+ const TSymbolUniqueId &functionId,
+ TIntermSequence *arguments);
+
protected:
// Should only be called from traverse*() functions
void incrementDepth(TIntermNode *current)
@@ -1112,6 +1151,8 @@ class TIntermTraverser : angle::NonCopyable
std::vector<NodeInsertMultipleEntry> mInsertions;
private:
+ static TName GetInternalFunctionName(const char *name);
+
// To replace a single node with another on the parent node
struct NodeUpdateEntry
{
@@ -1195,7 +1236,7 @@ class TLValueTrackingTraverser : public TIntermTraverser
bool operatorRequiresLValue() const { return mOperatorRequiresLValue; }
// Add a function encountered during traversal to the function map.
- void addToFunctionMap(const TName &name, TIntermSequence *paramSequence);
+ void addToFunctionMap(const TSymbolUniqueId &id, TIntermSequence *paramSequence);
// Return true if the prototype or definition of the function being called has been encountered
// during traversal.
@@ -1211,20 +1252,8 @@ class TLValueTrackingTraverser : public TIntermTraverser
bool mOperatorRequiresLValue;
bool mInFunctionCallOutParameter;
- struct TNameComparator
- {
- bool operator()(const TName &a, const TName &b) const
- {
- int compareResult = a.getString().compare(b.getString());
- if (compareResult != 0)
- return compareResult < 0;
- // Internal functions may have same names as non-internal functions.
- return !a.isInternal() && b.isInternal();
- }
- };
-
- // Map from mangled function names to their parameter sequences
- TMap<TName, TIntermSequence *, TNameComparator> mFunctionMap;
+ // Map from function symbol id values to their parameter sequences
+ TMap<int, TIntermSequence *> mFunctionMap;
const TSymbolTable &mSymbolTable;
const int mShaderVersion;
diff --git a/chromium/third_party/angle/src/compiler/translator/IntermTraverse.cpp b/chromium/third_party/angle/src/compiler/translator/IntermTraverse.cpp
index 8980e691f83..1819ab8e5f2 100644
--- a/chromium/third_party/angle/src/compiler/translator/IntermTraverse.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/IntermTraverse.cpp
@@ -228,22 +228,23 @@ void TIntermTraverser::nextTemporaryIndex()
++(*mTemporaryIndex);
}
-void TLValueTrackingTraverser::addToFunctionMap(const TName &name, TIntermSequence *paramSequence)
+void TLValueTrackingTraverser::addToFunctionMap(const TSymbolUniqueId &id,
+ TIntermSequence *paramSequence)
{
- mFunctionMap[name] = paramSequence;
+ mFunctionMap[id.get()] = paramSequence;
}
bool TLValueTrackingTraverser::isInFunctionMap(const TIntermAggregate *callNode) const
{
ASSERT(callNode->getOp() == EOpCallFunctionInAST);
- return (mFunctionMap.find(callNode->getFunctionSymbolInfo()->getNameObj()) !=
+ return (mFunctionMap.find(callNode->getFunctionSymbolInfo()->getId().get()) !=
mFunctionMap.end());
}
TIntermSequence *TLValueTrackingTraverser::getFunctionParameters(const TIntermAggregate *callNode)
{
ASSERT(isInFunctionMap(callNode));
- return mFunctionMap[callNode->getFunctionSymbolInfo()->getNameObj()];
+ return mFunctionMap[callNode->getFunctionSymbolInfo()->getId().get()];
}
void TLValueTrackingTraverser::setInFunctionCallOutParameter(bool inOutParameter)
@@ -623,7 +624,7 @@ void TIntermTraverser::traverseAggregate(TIntermAggregate *node)
void TLValueTrackingTraverser::traverseFunctionPrototype(TIntermFunctionPrototype *node)
{
TIntermSequence *sequence = node->getSequence();
- addToFunctionMap(node->getFunctionSymbolInfo()->getNameObj(), sequence);
+ addToFunctionMap(node->getFunctionSymbolInfo()->getId(), sequence);
TIntermTraverser::traverseFunctionPrototype(node);
}
@@ -689,7 +690,8 @@ void TLValueTrackingTraverser::traverseAggregate(TIntermAggregate *node)
TFunction *builtInFunc = nullptr;
if (!node->isFunctionCall() && !node->isConstructor())
{
- builtInFunc = mSymbolTable.findBuiltInOp(node, mShaderVersion);
+ builtInFunc = static_cast<TFunction *>(
+ mSymbolTable.findBuiltIn(node->getSymbolTableMangledName(), mShaderVersion));
}
size_t paramIndex = 0;
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputGLSL.cpp b/chromium/third_party/angle/src/compiler/translator/OutputGLSL.cpp
index 70848729a0b..af1b77c54d8 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputGLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/OutputGLSL.cpp
@@ -66,7 +66,7 @@ void TOutputGLSL::visitSymbol(TIntermSymbol *node)
}
}
-TString TOutputGLSL::translateTextureFunction(TString &name)
+TString TOutputGLSL::translateTextureFunction(const TString &name)
{
static const char *simpleRename[] = {"texture2DLodEXT",
"texture2DLod",
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputGLSL.h b/chromium/third_party/angle/src/compiler/translator/OutputGLSL.h
index d910c000478..17682ff31ea 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputGLSL.h
+++ b/chromium/third_party/angle/src/compiler/translator/OutputGLSL.h
@@ -28,7 +28,7 @@ class TOutputGLSL : public TOutputGLSLBase
protected:
bool writeVariablePrecision(TPrecision) override;
void visitSymbol(TIntermSymbol *node) override;
- TString translateTextureFunction(TString &name) override;
+ TString translateTextureFunction(const TString &name) override;
};
} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp
index 65575018f01..fee3836316c 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp
@@ -73,6 +73,11 @@ bool NeedsToWriteLayoutQualifier(const TType &type)
return true;
}
+ if (type.getQualifier() == EvqFragmentOut && layoutQualifier.yuv == true)
+ {
+ return true;
+ }
+
if (IsOpaqueType(type.getBasicType()) && layoutQualifier.binding != -1)
{
return true;
@@ -214,6 +219,14 @@ void TOutputGLSLBase::writeLayoutQualifier(const TType &type)
}
}
+ if (type.getQualifier() == EvqFragmentOut)
+ {
+ if (layoutQualifier.yuv == true)
+ {
+ out << listItemPrefix << "yuv";
+ }
+ }
+
if (IsOpaqueType(type.getBasicType()))
{
if (layoutQualifier.binding >= 0)
@@ -414,6 +427,9 @@ const TConstantUnion *TOutputGLSLBase::writeConstantUnion(const TType &type,
case EbtBool:
out << pConstUnion->getBConst();
break;
+ case EbtYuvCscStandardEXT:
+ out << getYuvCscStandardEXTString(pConstUnion->getYuvCscStandardEXTConst());
+ break;
default:
UNREACHABLE();
}
@@ -910,7 +926,7 @@ bool TOutputGLSLBase::visitFunctionPrototype(Visit visit, TIntermFunctionPrototy
if (type.isArray())
out << arrayBrackets(type);
- out << " " << hashFunctionNameIfNeeded(node->getFunctionSymbolInfo()->getNameObj());
+ out << " " << hashFunctionNameIfNeeded(*node->getFunctionSymbolInfo());
out << "(";
writeFunctionParameters(*(node->getSequence()));
@@ -930,7 +946,17 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate *node)
case EOpCallBuiltInFunction:
// Function call.
if (visit == PreVisit)
- out << hashFunctionNameIfNeeded(node->getFunctionSymbolInfo()->getNameObj()) << "(";
+ {
+ if (node->getOp() == EOpCallBuiltInFunction)
+ {
+ out << translateTextureFunction(node->getFunctionSymbolInfo()->getName());
+ }
+ else
+ {
+ out << hashFunctionNameIfNeeded(*node->getFunctionSymbolInfo());
+ }
+ out << "(";
+ }
else if (visit == InVisit)
out << ", ";
else
@@ -1180,22 +1206,17 @@ TString TOutputGLSLBase::hashVariableName(const TName &name)
return hashName(name);
}
-TString TOutputGLSLBase::hashFunctionNameIfNeeded(const TName &mangledName)
+TString TOutputGLSLBase::hashFunctionNameIfNeeded(const TFunctionSymbolInfo &info)
{
- TString mangledStr = mangledName.getString();
- TString name = TFunction::unmangleName(mangledStr);
- if (mSymbolTable.findBuiltIn(mangledStr, mShaderVersion) != nullptr || name == "main")
- return translateTextureFunction(name);
- if (mangledName.isInternal())
+ if (info.isMain() || info.getNameObj().isInternal())
{
// Internal function names are outputted as-is - they may refer to functions manually added
// to the output shader source that are not included in the AST at all.
- return name;
+ return info.getName();
}
else
{
- TName nameObj(name);
- return hashName(nameObj);
+ return hashName(info.getNameObj());
}
}
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h
index 4c26c73c728..af3019c5da0 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h
+++ b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h
@@ -70,10 +70,10 @@ class TOutputGLSLBase : public TIntermTraverser
// Same as hashName(), but without hashing built-in variables.
TString hashVariableName(const TName &name);
- // Same as hashName(), but without hashing built-in functions and with unmangling.
- TString hashFunctionNameIfNeeded(const TName &mangledName);
+ // Same as hashName(), but without hashing internal functions or "main".
+ TString hashFunctionNameIfNeeded(const TFunctionSymbolInfo &info);
// Used to translate function names for differences between ESSL and GLSL
- virtual TString translateTextureFunction(TString &name) { return name; }
+ virtual TString translateTextureFunction(const TString &name) { return name; }
private:
bool structDeclared(const TStructure *structure) const;
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp
index 87a77675b5b..c0129dade4f 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp
@@ -1590,7 +1590,7 @@ bool OutputHLSL::visitFunctionDefinition(Visit visit, TIntermFunctionDefinition
}
else
{
- out << DecorateFunctionIfNeeded(node->getFunctionSymbolInfo()->getNameObj())
+ out << DecorateIfNeeded(node->getFunctionSymbolInfo()->getNameObj())
<< DisambiguateFunctionName(parameters) << (mOutputLod0Function ? "Lod0(" : "(");
}
@@ -1722,7 +1722,7 @@ bool OutputHLSL::visitFunctionPrototype(Visit visit, TIntermFunctionPrototype *n
TIntermSequence *arguments = node->getSequence();
- TString name = DecorateFunctionIfNeeded(node->getFunctionSymbolInfo()->getNameObj());
+ TString name = DecorateIfNeeded(node->getFunctionSymbolInfo()->getNameObj());
out << TypeString(node->getType()) << " " << name << DisambiguateFunctionName(arguments)
<< (mOutputLod0Function ? "Lod0(" : "(");
@@ -1776,7 +1776,7 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
ASSERT(index != CallDAG::InvalidIndex);
lod0 &= mASTMetadataList[index].mNeedsLod0;
- out << DecorateFunctionIfNeeded(node->getFunctionSymbolInfo()->getNameObj());
+ out << DecorateIfNeeded(node->getFunctionSymbolInfo()->getNameObj());
out << DisambiguateFunctionName(node->getSequence());
out << (lod0 ? "Lod0(" : "(");
}
@@ -1784,11 +1784,11 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
{
// This path is used for internal functions that don't have their definitions in the
// AST, such as precision emulation functions.
- out << DecorateFunctionIfNeeded(node->getFunctionSymbolInfo()->getNameObj()) << "(";
+ out << DecorateIfNeeded(node->getFunctionSymbolInfo()->getNameObj()) << "(";
}
else
{
- TString name = TFunction::unmangleName(node->getFunctionSymbolInfo()->getName());
+ const TString &name = node->getFunctionSymbolInfo()->getName();
TBasicType samplerType = (*arguments)[0]->getAsTyped()->getType().getBasicType();
int coords = 0; // textureSize(gsampler2DMS) doesn't have a second argument.
if (arguments->size() > 1)
diff --git a/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp b/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp
index 258af09cd46..f4697464cae 100644
--- a/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp
@@ -130,6 +130,7 @@ TParseContext::TParseContext(TSymbolTable &symt,
mMaxNumViews(resources.MaxViewsOVR),
mMaxImageUnits(resources.MaxImageUnits),
mMaxCombinedTextureImageUnits(resources.MaxCombinedTextureImageUnits),
+ mMaxUniformLocations(resources.MaxUniformLocations),
mDeclaringFunction(false)
{
mComputeShaderLocalSize.fill(-1);
@@ -845,8 +846,13 @@ void TParseContext::checkLocationIsNotSpecified(const TSourceLoc &location,
{
if (layoutQualifier.location != -1)
{
- error(location, "invalid layout qualifier: only valid on program inputs and outputs",
- "location");
+ const char *errorMsg = "invalid layout qualifier: only valid on program inputs and outputs";
+ if (mShaderVersion >= 310)
+ {
+ errorMsg =
+ "invalid layout qualifier: only valid on program inputs, outputs, and uniforms";
+ }
+ error(location, errorMsg, "location");
}
}
@@ -1182,6 +1188,15 @@ void TParseContext::singleDeclarationErrorCheck(const TPublicType &publicType,
return;
}
+ if ((publicType.qualifier != EvqTemporary && publicType.qualifier != EvqGlobal &&
+ publicType.qualifier != EvqConst) &&
+ publicType.getBasicType() == EbtYuvCscStandardEXT)
+ {
+ error(identifierLocation, "cannot be used with a yuvCscStandardEXT",
+ getQualifierString(publicType.qualifier));
+ return;
+ }
+
// check for layout qualifier issues
const TLayoutQualifier layoutQualifier = publicType.layoutQualifier;
@@ -1199,11 +1214,40 @@ void TParseContext::singleDeclarationErrorCheck(const TPublicType &publicType,
return;
}
- if (publicType.qualifier != EvqVertexIn && publicType.qualifier != EvqFragmentOut)
+ bool canHaveLocation =
+ publicType.qualifier == EvqVertexIn || publicType.qualifier == EvqFragmentOut;
+
+ if (mShaderVersion >= 310 && publicType.qualifier == EvqUniform)
+ {
+ canHaveLocation = true;
+
+ // Valid uniform declarations can't be unsized arrays since uniforms can't be initialized.
+ // But invalid shaders may still reach here with an unsized array declaration.
+ if (!publicType.isUnsizedArray())
+ {
+ TType type(publicType);
+ checkUniformLocationInRange(identifierLocation, type.getLocationCount(),
+ publicType.layoutQualifier);
+ }
+ }
+ if (!canHaveLocation)
{
checkLocationIsNotSpecified(identifierLocation, publicType.layoutQualifier);
}
+ if (publicType.qualifier == EvqFragmentOut)
+ {
+ if (layoutQualifier.location != -1 && layoutQualifier.yuv == true)
+ {
+ error(identifierLocation, "invalid layout qualifier combination", "yuv");
+ return;
+ }
+ }
+ else
+ {
+ checkYuvIsNotSpecified(identifierLocation, layoutQualifier.yuv);
+ }
+
if (IsImage(publicType.getBasicType()))
{
@@ -1369,6 +1413,25 @@ void TParseContext::checkSamplerBindingIsValid(const TSourceLoc &location,
}
}
+void TParseContext::checkUniformLocationInRange(const TSourceLoc &location,
+ int objectLocationCount,
+ const TLayoutQualifier &layoutQualifier)
+{
+ int loc = layoutQualifier.location;
+ if (loc >= 0 && loc + objectLocationCount > mMaxUniformLocations)
+ {
+ error(location, "Uniform location out of range", "location");
+ }
+}
+
+void TParseContext::checkYuvIsNotSpecified(const TSourceLoc &location, bool yuv)
+{
+ if (yuv != false)
+ {
+ error(location, "invalid layout qualifier: only valid on program outputs", "yuv");
+ }
+}
+
void TParseContext::functionCallLValueErrorCheck(const TFunction *fnCandidate,
TIntermAggregate *fnCall)
{
@@ -1380,11 +1443,9 @@ void TParseContext::functionCallLValueErrorCheck(const TFunction *fnCandidate,
TIntermTyped *argument = (*(fnCall->getSequence()))[i]->getAsTyped();
if (!checkCanBeLValue(argument->getLine(), "assign", argument))
{
- TString unmangledName =
- TFunction::unmangleName(fnCall->getFunctionSymbolInfo()->getName());
error(argument->getLine(),
"Constant value cannot be passed for 'out' or 'inout' parameters.",
- unmangledName.c_str());
+ fnCall->getFunctionSymbolInfo()->getName().c_str());
return;
}
}
@@ -2307,6 +2368,8 @@ void TParseContext::parseGlobalLayoutQualifier(const TTypeQualifierBuilder &type
checkInternalFormatIsNotSpecified(typeQualifier.line, layoutQualifier.imageInternalFormat);
+ checkYuvIsNotSpecified(typeQualifier.line, layoutQualifier.yuv);
+
if (typeQualifier.qualifier == EvqComputeIn)
{
if (mComputeShaderLocalSizeDeclared &&
@@ -2425,7 +2488,8 @@ TIntermFunctionPrototype *TParseContext::createPrototypeNodeFromFunction(
const TSourceLoc &location,
bool insertParametersToSymbolTable)
{
- TIntermFunctionPrototype *prototype = new TIntermFunctionPrototype(function.getReturnType());
+ TIntermFunctionPrototype *prototype =
+ new TIntermFunctionPrototype(function.getReturnType(), TSymbolUniqueId(function));
// TODO(oetuaho@nvidia.com): Instead of converting the function information here, the node could
// point to the data that already exists in the symbol table.
prototype->getFunctionSymbolInfo()->setFromFunction(function);
@@ -2738,9 +2802,8 @@ TIntermTyped *TParseContext::addConstructor(TIntermSequence *arguments,
return TIntermTyped::CreateZero(type);
}
- TIntermAggregate *constructorNode = new TIntermAggregate(type, op, arguments);
+ TIntermAggregate *constructorNode = TIntermAggregate::CreateConstructor(type, op, arguments);
constructorNode->setLine(line);
- ASSERT(constructorNode->isConstructor());
TIntermTyped *constConstructor =
intermediate.foldAggregateBuiltIn(constructorNode, mDiagnostics);
@@ -2785,6 +2848,8 @@ TIntermDeclaration *TParseContext::addInterfaceBlock(
// TODO(oetuaho): Remove this and support binding for blocks.
checkBindingIsNotSpecified(typeQualifier.line, typeQualifier.layoutQualifier.binding);
+ checkYuvIsNotSpecified(typeQualifier.line, typeQualifier.layoutQualifier.yuv);
+
TLayoutQualifier blockLayoutQualifier = typeQualifier.layoutQualifier;
checkLocationIsNotSpecified(typeQualifier.line, blockLayoutQualifier);
@@ -3271,6 +3336,11 @@ TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierTyp
error(qualifierTypeLine, "invalid layout qualifier: location requires an argument",
qualifierType.c_str());
}
+ else if (qualifierType == "yuv" && isExtensionEnabled("GL_EXT_YUV_target") &&
+ mShaderType == GL_FRAGMENT_SHADER)
+ {
+ qualifier.yuv = true;
+ }
else if (qualifierType == "rgba32f")
{
checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
@@ -4205,16 +4275,13 @@ void TParseContext::checkTextureOffsetConst(TIntermAggregate *functionCall)
const TString &name = functionCall->getFunctionSymbolInfo()->getName();
TIntermNode *offset = nullptr;
TIntermSequence *arguments = functionCall->getSequence();
- if (name.compare(0, 16, "texelFetchOffset") == 0 ||
- name.compare(0, 16, "textureLodOffset") == 0 ||
- name.compare(0, 20, "textureProjLodOffset") == 0 ||
- name.compare(0, 17, "textureGradOffset") == 0 ||
- name.compare(0, 21, "textureProjGradOffset") == 0)
+ if (name == "texelFetchOffset" || name == "textureLodOffset" ||
+ name == "textureProjLodOffset" || name == "textureGradOffset" ||
+ name == "textureProjGradOffset")
{
offset = arguments->back();
}
- else if (name.compare(0, 13, "textureOffset") == 0 ||
- name.compare(0, 17, "textureProjOffset") == 0)
+ else if (name == "textureOffset" || name == "textureProjOffset")
{
// A bias parameter might follow the offset parameter.
ASSERT(arguments->size() >= 3);
@@ -4225,9 +4292,8 @@ void TParseContext::checkTextureOffsetConst(TIntermAggregate *functionCall)
TIntermConstantUnion *offsetConstantUnion = offset->getAsConstantUnion();
if (offset->getAsTyped()->getQualifier() != EvqConst || !offsetConstantUnion)
{
- TString unmangledName = TFunction::unmangleName(name);
error(functionCall->getLine(), "Texture offset must be a constant expression",
- unmangledName.c_str());
+ name.c_str());
}
else
{
@@ -4461,7 +4527,7 @@ TIntermTyped *TParseContext::addNonConstructorFunctionCall(TFunction *fnCall,
else
{
TIntermAggregate *callNode =
- new TIntermAggregate(fnCandidate->getReturnType(), op, arguments);
+ TIntermAggregate::Create(fnCandidate->getReturnType(), op, arguments);
callNode->setLine(loc);
// Some built-in functions have out parameters too.
@@ -4489,19 +4555,13 @@ TIntermTyped *TParseContext::addNonConstructorFunctionCall(TFunction *fnCall,
// This needs to happen after the function info including name is set.
if (builtIn)
{
- callNode = new TIntermAggregate(fnCandidate->getReturnType(),
- EOpCallBuiltInFunction, arguments);
- // Note that name needs to be set before texture function type is determined.
- callNode->getFunctionSymbolInfo()->setFromFunction(*fnCandidate);
- callNode->setBuiltInFunctionPrecision();
+ callNode = TIntermAggregate::CreateBuiltInFunctionCall(*fnCandidate, arguments);
checkTextureOffsetConst(callNode);
checkImageMemoryAccessForBuiltinFunctions(callNode);
}
else
{
- callNode = new TIntermAggregate(fnCandidate->getReturnType(),
- EOpCallFunctionInAST, arguments);
- callNode->getFunctionSymbolInfo()->setFromFunction(*fnCandidate);
+ callNode = TIntermAggregate::CreateFunctionCall(*fnCandidate, arguments);
checkImageMemoryAccessForUserDefinedFunctions(fnCandidate, callNode);
}
diff --git a/chromium/third_party/angle/src/compiler/translator/ParseContext.h b/chromium/third_party/angle/src/compiler/translator/ParseContext.h
index 3a70e86a263..66dda7fe7c2 100644
--- a/chromium/third_party/angle/src/compiler/translator/ParseContext.h
+++ b/chromium/third_party/angle/src/compiler/translator/ParseContext.h
@@ -395,6 +395,12 @@ class TParseContext : angle::NonCopyable
void checkImageBindingIsValid(const TSourceLoc &location, int binding, int arraySize);
void checkSamplerBindingIsValid(const TSourceLoc &location, int binding, int arraySize);
+ void checkUniformLocationInRange(const TSourceLoc &location,
+ int objectLocationCount,
+ const TLayoutQualifier &layoutQualifier);
+
+ void checkYuvIsNotSpecified(const TSourceLoc &location, bool yuv);
+
TIntermTyped *addBinaryMathInternal(TOperator op,
TIntermTyped *left,
TIntermTyped *right,
@@ -469,6 +475,7 @@ class TParseContext : angle::NonCopyable
int mMaxNumViews;
int mMaxImageUnits;
int mMaxCombinedTextureImageUnits;
+ int mMaxUniformLocations;
// keeps track whether we are declaring / defining a function
bool mDeclaringFunction;
};
diff --git a/chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.cpp b/chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.cpp
new file mode 100644
index 00000000000..5def5a0fb22
--- /dev/null
+++ b/chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.cpp
@@ -0,0 +1,91 @@
+//
+// 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.
+//
+// PrunePureLiteralStatements.cpp: Removes statements that are literals and nothing else.
+
+#include "compiler/translator/PrunePureLiteralStatements.h"
+
+#include "compiler/translator/IntermNode.h"
+
+namespace sh
+{
+
+namespace
+{
+
+class PrunePureLiteralStatementsTraverser : public TIntermTraverser
+{
+ public:
+ PrunePureLiteralStatementsTraverser() : TIntermTraverser(true, false, false) {}
+
+ bool visitBlock(Visit visit, TIntermBlock *node) override
+ {
+ TIntermSequence *statements = node->getSequence();
+ if (statements == nullptr)
+ {
+ return false;
+ }
+
+ // Empty case statements at the end of a switch are invalid: if the last statements
+ // of a block was a pure literal, also delete all the case statements directly preceding it.
+ bool deleteCaseStatements = false;
+ for (int i = static_cast<int>(statements->size()); i-- > 0;)
+ {
+ TIntermNode *statement = (*statements)[i];
+
+ if (statement->getAsConstantUnion() != nullptr)
+ {
+ TIntermSequence emptyReplacement;
+ mMultiReplacements.push_back(
+ NodeReplaceWithMultipleEntry(node, statement, emptyReplacement));
+
+ if (i == static_cast<int>(statements->size()) - 1)
+ {
+ deleteCaseStatements = true;
+ }
+
+ continue;
+ }
+
+ if (deleteCaseStatements)
+ {
+ if (statement->getAsCaseNode() != nullptr)
+ {
+ TIntermSequence emptyReplacement;
+ mMultiReplacements.push_back(
+ NodeReplaceWithMultipleEntry(node, statement, emptyReplacement));
+ }
+ else
+ {
+ deleteCaseStatements = false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+ bool visitLoop(Visit visit, TIntermLoop *loop) override
+ {
+ TIntermTyped *expr = loop->getExpression();
+ if (expr != nullptr && expr->getAsConstantUnion() != nullptr)
+ {
+ loop->setExpression(nullptr);
+ }
+
+ return true;
+ }
+};
+
+} // namespace
+
+void PrunePureLiteralStatements(TIntermNode *root)
+{
+ PrunePureLiteralStatementsTraverser prune;
+ root->traverse(&prune);
+ prune.updateTree();
+}
+
+} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.h b/chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.h
new file mode 100644
index 00000000000..ef956c069f6
--- /dev/null
+++ b/chromium/third_party/angle/src/compiler/translator/PrunePureLiteralStatements.h
@@ -0,0 +1,18 @@
+//
+// 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.
+//
+// PrunePureLiteralStatements.h: Removes statements that are literals and nothing else.
+
+#ifndef COMPILER_TRANSLATOR_PRUNEPURELITERALSTATEMENTS_H_
+#define COMPILER_TRANSLATOR_PRUNEPURELITERALSTATEMENTS_H_
+
+namespace sh
+{
+class TIntermNode;
+
+void PrunePureLiteralStatements(TIntermNode *root);
+}
+
+#endif // COMPILER_TRANSLATOR_PRUNEPURELITERALSTATEMENTS_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp b/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp
index 51c563adf15..a70ff97d2a2 100644
--- a/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp
@@ -560,6 +560,10 @@ TLayoutQualifier JoinLayoutQualifiers(TLayoutQualifier leftQualifier,
joinedQualifier.location = rightQualifier.location;
++joinedQualifier.locationsSpecified;
}
+ if (rightQualifier.yuv != false)
+ {
+ joinedQualifier.yuv = rightQualifier.yuv;
+ }
if (rightQualifier.binding != -1)
{
joinedQualifier.binding = rightQualifier.binding;
diff --git a/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp b/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp
index 7424f393407..a8f6b51c540 100644
--- a/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp
@@ -20,7 +20,7 @@ namespace sh
namespace
{
-TName GetIndexFunctionName(const TType &type, bool write)
+std::string GetIndexFunctionName(const TType &type, bool write)
{
TInfoSinkBase nameSink;
nameSink << "dyn_index_";
@@ -53,12 +53,7 @@ TName GetIndexFunctionName(const TType &type, bool write)
}
nameSink << type.getNominalSize();
}
- TString nameString = TFunction::mangleName(nameSink.c_str());
- TName name(nameString);
- // TODO(oetuaho@nvidia.com): would be better to have the parameter types in the mangled name as
- // well.
- name.setInternal(true);
- return name;
+ return nameSink.str();
}
TIntermSymbol *CreateBaseSymbol(const TType &type, TQualifier qualifier)
@@ -115,7 +110,7 @@ TIntermTyped *EnsureSignedInt(TIntermTyped *node)
TIntermSequence *arguments = new TIntermSequence();
arguments->push_back(node);
- return new TIntermAggregate(TType(EbtInt), EOpConstructInt, arguments);
+ return TIntermAggregate::CreateConstructor(TType(EbtInt), EOpConstructInt, arguments);
}
TType GetFieldType(const TType &indexedType)
@@ -175,7 +170,9 @@ TType GetFieldType(const TType &indexedType)
// base[1] = value;
// }
// Note that else is not used in above functions to avoid the RewriteElseBlocks transformation.
-TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type, bool write)
+TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type,
+ bool write,
+ const TSymbolUniqueId &functionId)
{
ASSERT(!type.isArray());
// Conservatively use highp here, even if the indexed type is not highp. That way the code can't
@@ -195,16 +192,15 @@ TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type, bool write)
numCases = type.getNominalSize();
}
- TIntermFunctionPrototype *prototypeNode = nullptr;
- if (write)
- {
- prototypeNode = new TIntermFunctionPrototype(TType(EbtVoid));
- }
- else
+ TType returnType(EbtVoid);
+ if (!write)
{
- prototypeNode = new TIntermFunctionPrototype(fieldType);
+ returnType = fieldType;
}
- prototypeNode->getFunctionSymbolInfo()->setNameObj(GetIndexFunctionName(type, write));
+
+ std::string functionName = GetIndexFunctionName(type, write);
+ TIntermFunctionPrototype *prototypeNode = TIntermTraverser::CreateInternalFunctionPrototypeNode(
+ returnType, functionName.c_str(), functionId);
TQualifier baseQualifier = EvqInOut;
if (!write)
@@ -305,10 +301,11 @@ class RemoveDynamicIndexingTraverser : public TLValueTrackingTraverser
bool usedTreeInsertion() const { return mUsedTreeInsertion; }
protected:
- // Sets of types that are indexed. Note that these can not store multiple variants
- // of the same type with different precisions - only one precision gets stored.
- std::set<TType> mIndexedVecAndMatrixTypes;
- std::set<TType> mWrittenVecAndMatrixTypes;
+ // Maps of types that are indexed to the indexing function ids used for them. Note that these
+ // can not store multiple variants of the same type with different precisions - only one
+ // precision gets stored.
+ std::map<TType, TSymbolUniqueId> mIndexedVecAndMatrixTypes;
+ std::map<TType, TSymbolUniqueId> mWrittenVecAndMatrixTypes;
bool mUsedTreeInsertion;
@@ -332,49 +329,51 @@ void RemoveDynamicIndexingTraverser::insertHelperDefinitions(TIntermNode *root)
TIntermBlock *rootBlock = root->getAsBlock();
ASSERT(rootBlock != nullptr);
TIntermSequence insertions;
- for (TType type : mIndexedVecAndMatrixTypes)
+ for (auto &type : mIndexedVecAndMatrixTypes)
{
- insertions.push_back(GetIndexFunctionDefinition(type, false));
+ insertions.push_back(GetIndexFunctionDefinition(type.first, false, type.second));
}
- for (TType type : mWrittenVecAndMatrixTypes)
+ for (auto &type : mWrittenVecAndMatrixTypes)
{
- insertions.push_back(GetIndexFunctionDefinition(type, true));
+ insertions.push_back(GetIndexFunctionDefinition(type.first, true, type.second));
}
mInsertions.push_back(NodeInsertMultipleEntry(rootBlock, 0, insertions, TIntermSequence()));
}
// Create a call to dyn_index_*() based on an indirect indexing op node
TIntermAggregate *CreateIndexFunctionCall(TIntermBinary *node,
- TIntermTyped *indexedNode,
- TIntermTyped *index)
+ TIntermTyped *index,
+ const TSymbolUniqueId &functionId)
{
ASSERT(node->getOp() == EOpIndexIndirect);
TIntermSequence *arguments = new TIntermSequence();
- arguments->push_back(indexedNode);
+ arguments->push_back(node->getLeft());
arguments->push_back(index);
- TType fieldType = GetFieldType(indexedNode->getType());
- TIntermAggregate *indexingCall =
- new TIntermAggregate(fieldType, EOpCallFunctionInAST, arguments);
+ TType fieldType = GetFieldType(node->getLeft()->getType());
+ std::string functionName = GetIndexFunctionName(node->getLeft()->getType(), false);
+ TIntermAggregate *indexingCall = TIntermTraverser::CreateInternalFunctionCallNode(
+ fieldType, functionName.c_str(), functionId, arguments);
indexingCall->setLine(node->getLine());
- indexingCall->getFunctionSymbolInfo()->setNameObj(
- GetIndexFunctionName(indexedNode->getType(), false));
return indexingCall;
}
TIntermAggregate *CreateIndexedWriteFunctionCall(TIntermBinary *node,
TIntermTyped *index,
- TIntermTyped *writtenValue)
+ TIntermTyped *writtenValue,
+ const TSymbolUniqueId &functionId)
{
- // Deep copy the left node so that two pointers to the same node don't end up in the tree.
- TIntermNode *leftCopy = node->getLeft()->deepCopy();
- ASSERT(leftCopy != nullptr && leftCopy->getAsTyped() != nullptr);
- TIntermAggregate *indexedWriteCall =
- CreateIndexFunctionCall(node, leftCopy->getAsTyped(), index);
- indexedWriteCall->getFunctionSymbolInfo()->setNameObj(
- GetIndexFunctionName(node->getLeft()->getType(), true));
- indexedWriteCall->setType(TType(EbtVoid));
- indexedWriteCall->getSequence()->push_back(writtenValue);
+ ASSERT(node->getOp() == EOpIndexIndirect);
+ TIntermSequence *arguments = new TIntermSequence();
+ // Deep copy the child nodes so that two pointers to the same node don't end up in the tree.
+ arguments->push_back(node->getLeft()->deepCopy());
+ arguments->push_back(index->deepCopy());
+ arguments->push_back(writtenValue);
+
+ std::string functionName = GetIndexFunctionName(node->getLeft()->getType(), true);
+ TIntermAggregate *indexedWriteCall = TIntermTraverser::CreateInternalFunctionCallNode(
+ TType(EbtVoid), functionName.c_str(), functionId, arguments);
+ indexedWriteCall->setLine(node->getLine());
return indexedWriteCall;
}
@@ -415,8 +414,16 @@ bool RemoveDynamicIndexingTraverser::visitBinary(Visit visit, TIntermBinary *nod
ASSERT(matcher.match(node, getParentNode(), isLValueRequiredHere()) == write);
#endif
- TType type = node->getLeft()->getType();
- mIndexedVecAndMatrixTypes.insert(type);
+ const TType &type = node->getLeft()->getType();
+ TSymbolUniqueId indexingFunctionId;
+ if (mIndexedVecAndMatrixTypes.find(type) == mIndexedVecAndMatrixTypes.end())
+ {
+ mIndexedVecAndMatrixTypes[type] = indexingFunctionId;
+ }
+ else
+ {
+ indexingFunctionId = mIndexedVecAndMatrixTypes[type];
+ }
if (write)
{
@@ -450,7 +457,15 @@ bool RemoveDynamicIndexingTraverser::visitBinary(Visit visit, TIntermBinary *nod
// TODO(oetuaho@nvidia.com): This is not optimal if the expression using the value
// only writes it and doesn't need the previous value. http://anglebug.com/1116
- mWrittenVecAndMatrixTypes.insert(type);
+ TSymbolUniqueId indexedWriteFunctionId;
+ if (mWrittenVecAndMatrixTypes.find(type) == mWrittenVecAndMatrixTypes.end())
+ {
+ mWrittenVecAndMatrixTypes[type] = indexedWriteFunctionId;
+ }
+ else
+ {
+ indexedWriteFunctionId = mWrittenVecAndMatrixTypes[type];
+ }
TType fieldType = GetFieldType(type);
TIntermSequence insertionsBefore;
@@ -462,19 +477,19 @@ bool RemoveDynamicIndexingTraverser::visitBinary(Visit visit, TIntermBinary *nod
initIndex->setLine(node->getLine());
insertionsBefore.push_back(initIndex);
- TIntermAggregate *indexingCall = CreateIndexFunctionCall(
- node, node->getLeft(), createTempSymbol(indexInitializer->getType()));
-
// Create a node for referring to the index after the nextTemporaryIndex() call
// below.
TIntermSymbol *tempIndex = createTempSymbol(indexInitializer->getType());
+ TIntermAggregate *indexingCall =
+ CreateIndexFunctionCall(node, tempIndex, indexingFunctionId);
+
nextTemporaryIndex(); // From now on, creating temporary symbols that refer to the
// field value.
insertionsBefore.push_back(createTempInitDeclaration(indexingCall));
- TIntermAggregate *indexedWriteCall =
- CreateIndexedWriteFunctionCall(node, tempIndex, createTempSymbol(fieldType));
+ TIntermAggregate *indexedWriteCall = CreateIndexedWriteFunctionCall(
+ node, tempIndex, createTempSymbol(fieldType), indexedWriteFunctionId);
insertionsAfter.push_back(indexedWriteCall);
insertStatementsInParentBlock(insertionsBefore, insertionsAfter);
queueReplacement(node, createTempSymbol(fieldType), OriginalNode::IS_DROPPED);
@@ -489,7 +504,7 @@ bool RemoveDynamicIndexingTraverser::visitBinary(Visit visit, TIntermBinary *nod
// If the index_expr is unsigned, we'll convert it to signed.
ASSERT(!mRemoveIndexSideEffectsInSubtree);
TIntermAggregate *indexingCall = CreateIndexFunctionCall(
- node, node->getLeft(), EnsureSignedInt(node->getRight()));
+ node, EnsureSignedInt(node->getRight()), indexingFunctionId);
queueReplacement(node, indexingCall, OriginalNode::IS_DROPPED);
}
}
diff --git a/chromium/third_party/angle/src/compiler/translator/RewriteTexelFetchOffset.cpp b/chromium/third_party/angle/src/compiler/translator/RewriteTexelFetchOffset.cpp
index b1ccf0caa2b..554b044ecf7 100644
--- a/chromium/third_party/angle/src/compiler/translator/RewriteTexelFetchOffset.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/RewriteTexelFetchOffset.cpp
@@ -71,7 +71,7 @@ bool Traverser::visitAggregate(Visit visit, TIntermAggregate *node)
return true;
}
- if (node->getFunctionSymbolInfo()->getName().compare(0, 16, "texelFetchOffset") != 0)
+ if (node->getFunctionSymbolInfo()->getName() != "texelFetchOffset")
{
return true;
}
@@ -80,17 +80,10 @@ bool Traverser::visitAggregate(Visit visit, TIntermAggregate *node)
const TIntermSequence *sequence = node->getSequence();
ASSERT(sequence->size() == 4u);
- // Decide if there is a 2DArray sampler.
- bool is2DArray = node->getFunctionSymbolInfo()->getName().find("s2a1") != TString::npos;
-
- // Create new argument list from node->getName().
- // e.g. Get "(is2a1;vi3;i1;" from "texelFetchOffset(is2a1;vi3;i1;vi2;"
- TString newArgs = node->getFunctionSymbolInfo()->getName().substr(
- 16, node->getFunctionSymbolInfo()->getName().length() - 20);
- TString newName = "texelFetch" + newArgs;
- TSymbol *texelFetchSymbol = symbolTable->findBuiltIn(newName, shaderVersion);
- ASSERT(texelFetchSymbol);
- int uniqueId = texelFetchSymbol->getUniqueId();
+ // Decide if the sampler is a 2DArray sampler. In that case position is ivec3 and offset is
+ // ivec2.
+ bool is2DArray = sequence->at(1)->getAsTyped()->getNominalSize() == 3 &&
+ sequence->at(3)->getAsTyped()->getNominalSize() == 2;
// Create new node that represents the call of function texelFetch.
// Its argument list will be: texelFetch(sampler, Position+offset, lod).
@@ -117,8 +110,8 @@ bool Traverser::visitAggregate(Visit visit, TIntermAggregate *node)
TIntermTyped *zeroNode = TIntermTyped::CreateZero(TType(EbtInt));
constructOffsetIvecArguments->push_back(zeroNode);
- offsetNode = new TIntermAggregate(texCoordNode->getType(), EOpConstructIVec3,
- constructOffsetIvecArguments);
+ offsetNode = TIntermAggregate::CreateConstructor(texCoordNode->getType(), EOpConstructIVec3,
+ constructOffsetIvecArguments);
offsetNode->setLine(texCoordNode->getLine());
}
else
@@ -136,10 +129,13 @@ bool Traverser::visitAggregate(Visit visit, TIntermAggregate *node)
ASSERT(texelFetchArguments->size() == 3u);
- TIntermAggregate *texelFetchNode =
- new TIntermAggregate(node->getType(), EOpCallBuiltInFunction, texelFetchArguments);
- texelFetchNode->getFunctionSymbolInfo()->setName(newName);
- texelFetchNode->getFunctionSymbolInfo()->setId(uniqueId);
+ // Get the symbol of the texel fetch function to use.
+ TString mangledName = TFunction::GetMangledNameFromCall("texelFetch", *texelFetchArguments);
+ TSymbol *texelFetchSymbol = symbolTable->findBuiltIn(mangledName, shaderVersion);
+ ASSERT(texelFetchSymbol && texelFetchSymbol->isFunction());
+
+ TIntermAggregate *texelFetchNode = TIntermAggregate::CreateBuiltInFunctionCall(
+ *static_cast<const TFunction *>(texelFetchSymbol), texelFetchArguments);
texelFetchNode->setLine(node->getLine());
// Replace the old node by this new node.
diff --git a/chromium/third_party/angle/src/compiler/translator/SeparateExpressionsReturningArrays.cpp b/chromium/third_party/angle/src/compiler/translator/SeparateExpressionsReturningArrays.cpp
index 6489a91020f..1e7000b4cdf 100644
--- a/chromium/third_party/angle/src/compiler/translator/SeparateExpressionsReturningArrays.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/SeparateExpressionsReturningArrays.cpp
@@ -55,16 +55,6 @@ TIntermBinary *CopyAssignmentNode(TIntermBinary *node)
return new TIntermBinary(node->getOp(), node->getLeft(), node->getRight());
}
-// Performs a shallow copy of a constructor/function call node.
-TIntermAggregate *CopyAggregateNode(TIntermAggregate *node)
-{
- TIntermSequence *copySeq = new TIntermSequence();
- copySeq->insert(copySeq->begin(), node->getSequence()->begin(), node->getSequence()->end());
- TIntermAggregate *copyNode = new TIntermAggregate(node->getType(), node->getOp(), copySeq);
- *copyNode->getFunctionSymbolInfo() = *node->getFunctionSymbolInfo();
- return copyNode;
-}
-
bool SeparateExpressionsTraverser::visitBinary(Visit visit, TIntermBinary *node)
{
if (mFoundArrayExpression)
@@ -104,7 +94,7 @@ bool SeparateExpressionsTraverser::visitAggregate(Visit visit, TIntermAggregate
mFoundArrayExpression = true;
TIntermSequence insertions;
- insertions.push_back(createTempInitDeclaration(CopyAggregateNode(node)));
+ insertions.push_back(createTempInitDeclaration(node->shallowCopy()));
insertStatementsInParentBlock(insertions);
queueReplacement(node, createTempSymbol(node->getType()), OriginalNode::IS_DROPPED);
diff --git a/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp b/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp
index 415369e6dd1..11b83f3015f 100644
--- a/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp
@@ -163,6 +163,7 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->NV_shader_framebuffer_fetch = 0;
resources->ARM_shader_framebuffer_fetch = 0;
resources->OVR_multiview = 0;
+ resources->EXT_YUV_target = 0;
resources->NV_draw_buffers = 0;
@@ -196,6 +197,8 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->MaxComputeImageUniforms = 4;
resources->MaxCombinedImageUniforms = 4;
+ resources->MaxUniformLocations = 1024;
+
resources->MaxCombinedShaderOutputResources = 4;
resources->MaxComputeWorkGroupCount[0] = 65535;
diff --git a/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp b/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp
index a6c885d9948..84a4e3d536e 100644
--- a/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp
@@ -189,20 +189,20 @@ Uniform::~Uniform()
{
}
-Uniform::Uniform(const Uniform &other) : ShaderVariable(other), binding(other.binding)
+Uniform::Uniform(const Uniform &other) : VariableWithLocation(other), binding(other.binding)
{
}
Uniform &Uniform::operator=(const Uniform &other)
{
- ShaderVariable::operator=(other);
+ VariableWithLocation::operator=(other);
binding = other.binding;
return *this;
}
bool Uniform::operator==(const Uniform &other) const
{
- return ShaderVariable::operator==(other) && binding == other.binding;
+ return VariableWithLocation::operator==(other) && binding == other.binding;
}
bool Uniform::isSameUniformAtLinkTime(const Uniform &other) const
@@ -211,30 +211,34 @@ bool Uniform::isSameUniformAtLinkTime(const Uniform &other) const
{
return false;
}
- return ShaderVariable::isSameVariableAtLinkTime(other, true);
+ if (location != -1 && other.location != -1 && location != other.location)
+ {
+ return false;
+ }
+ return VariableWithLocation::isSameVariableAtLinkTime(other, true);
}
-InterfaceVariable::InterfaceVariable() : location(-1)
+VariableWithLocation::VariableWithLocation() : location(-1)
{
}
-InterfaceVariable::~InterfaceVariable()
+VariableWithLocation::~VariableWithLocation()
{
}
-InterfaceVariable::InterfaceVariable(const InterfaceVariable &other)
+VariableWithLocation::VariableWithLocation(const VariableWithLocation &other)
: ShaderVariable(other), location(other.location)
{
}
-InterfaceVariable &InterfaceVariable::operator=(const InterfaceVariable &other)
+VariableWithLocation &VariableWithLocation::operator=(const VariableWithLocation &other)
{
ShaderVariable::operator=(other);
location = other.location;
return *this;
}
-bool InterfaceVariable::operator==(const InterfaceVariable &other) const
+bool VariableWithLocation::operator==(const VariableWithLocation &other) const
{
return (ShaderVariable::operator==(other) && location == other.location);
}
@@ -247,19 +251,19 @@ Attribute::~Attribute()
{
}
-Attribute::Attribute(const Attribute &other) : InterfaceVariable(other)
+Attribute::Attribute(const Attribute &other) : VariableWithLocation(other)
{
}
Attribute &Attribute::operator=(const Attribute &other)
{
- InterfaceVariable::operator=(other);
+ VariableWithLocation::operator=(other);
return *this;
}
bool Attribute::operator==(const Attribute &other) const
{
- return InterfaceVariable::operator==(other);
+ return VariableWithLocation::operator==(other);
}
OutputVariable::OutputVariable()
@@ -270,19 +274,19 @@ OutputVariable::~OutputVariable()
{
}
-OutputVariable::OutputVariable(const OutputVariable &other) : InterfaceVariable(other)
+OutputVariable::OutputVariable(const OutputVariable &other) : VariableWithLocation(other)
{
}
OutputVariable &OutputVariable::operator=(const OutputVariable &other)
{
- InterfaceVariable::operator=(other);
+ VariableWithLocation::operator=(other);
return *this;
}
bool OutputVariable::operator==(const OutputVariable &other) const
{
- return InterfaceVariable::operator==(other);
+ return VariableWithLocation::operator==(other);
}
InterfaceBlockField::InterfaceBlockField() : isRowMajorLayout(false)
diff --git a/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp b/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp
index b246a0f692d..a7f7e8f5415 100644
--- a/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp
@@ -24,8 +24,28 @@
namespace sh
{
+namespace
+{
+
+static const char kFunctionMangledNameSeparator = '(';
+
+} // anonymous namespace
+
int TSymbolTable::uniqueIdCounter = 0;
+TSymbolUniqueId::TSymbolUniqueId() : mId(TSymbolTable::nextUniqueId())
+{
+}
+
+TSymbolUniqueId::TSymbolUniqueId(const TSymbol &symbol) : mId(symbol.getUniqueId())
+{
+}
+
+int TSymbolUniqueId::get() const
+{
+ return mId;
+}
+
TSymbol::TSymbol(const TString *n) : uniqueId(TSymbolTable::nextUniqueId()), name(n)
{
}
@@ -57,20 +77,22 @@ void TFunction::swapParameters(const TFunction &parametersSource)
const TString *TFunction::buildMangledName() const
{
- std::string newName = mangleName(getName()).c_str();
+ std::string newName = getName().c_str();
+ newName += kFunctionMangledNameSeparator;
for (const auto &p : parameters)
{
newName += p.type->getMangledName().c_str();
}
-
return NewPoolTString(newName.c_str());
}
-const TString &TFunction::GetMangledNameFromCall(const TString &unmangledFunctionName,
- TIntermSequence &arguments)
+const TString &TFunction::GetMangledNameFromCall(const TString &functionName,
+ const TIntermSequence &arguments)
{
- std::string newName = mangleName(unmangledFunctionName).c_str();
+ std::string newName = functionName.c_str();
+ newName += kFunctionMangledNameSeparator;
+
for (TIntermNode *argument : arguments)
{
newName += argument->getAsTyped()->getType().getMangledName().c_str();
@@ -166,20 +188,6 @@ TSymbol *TSymbolTable::findBuiltIn(const TString &name, int shaderVersion) const
return 0;
}
-TFunction *TSymbolTable::findBuiltInOp(TIntermAggregate *callNode, int shaderVersion) const
-{
- ASSERT(!callNode->isConstructor());
- ASSERT(!callNode->isFunctionCall());
- TString opString = GetOperatorString(callNode->getOp());
- TSymbol *sym = findBuiltIn(
- TFunction::GetMangledNameFromCall(opString, *callNode->getSequence()), shaderVersion);
- ASSERT(sym != nullptr && sym->isFunction());
-
- TFunction *builtInFunc = static_cast<TFunction *>(sym);
- ASSERT(builtInFunc->getParamCount() == callNode->getSequence()->size());
- return builtInFunc;
-}
-
TSymbolTable::~TSymbolTable()
{
while (table.size() > 0)
diff --git a/chromium/third_party/angle/src/compiler/translator/SymbolTable.h b/chromium/third_party/angle/src/compiler/translator/SymbolTable.h
index 671b183d110..c34894314b6 100644
--- a/chromium/third_party/angle/src/compiler/translator/SymbolTable.h
+++ b/chromium/third_party/angle/src/compiler/translator/SymbolTable.h
@@ -41,6 +41,22 @@
namespace sh
{
+// Encapsulates a unique id for a symbol.
+class TSymbolUniqueId
+{
+ public:
+ POOL_ALLOCATOR_NEW_DELETE();
+ TSymbolUniqueId();
+ TSymbolUniqueId(const TSymbol &symbol);
+ TSymbolUniqueId(const TSymbolUniqueId &) = default;
+ TSymbolUniqueId &operator=(const TSymbolUniqueId &) = default;
+
+ int get() const;
+
+ private:
+ int mId;
+};
+
// Symbol base class. (Can build functions or variables out of these...)
class TSymbol : angle::NonCopyable
{
@@ -158,12 +174,6 @@ class TFunction : public TSymbol
~TFunction() override;
bool isFunction() const override { return true; }
- static TString mangleName(const TString &name) { return name + '('; }
- static TString unmangleName(const TString &mangledName)
- {
- return TString(mangledName.c_str(), mangledName.find_first_of('('));
- }
-
void addParameter(const TConstParameter &p)
{
parameters.push_back(p);
@@ -181,8 +191,8 @@ class TFunction : public TSymbol
return *mangledName;
}
- static const TString &GetMangledNameFromCall(const TString &unmangledFunctionName,
- TIntermSequence &arguments);
+ static const TString &GetMangledNameFromCall(const TString &functionName,
+ const TIntermSequence &arguments);
const TType &getReturnType() const { return *returnType; }
@@ -428,10 +438,6 @@ class TSymbolTable : angle::NonCopyable
TSymbol *findBuiltIn(const TString &name, int shaderVersion) const;
- // Helper front-end for regular findBuiltIn that constructs the mangled function name from
- // callNode.
- TFunction *findBuiltInOp(TIntermAggregate *callNode, int shaderVersion) const;
-
TSymbolTableLevel *getOuterLevel()
{
assert(currentLevel() >= 1);
diff --git a/chromium/third_party/angle/src/compiler/translator/TextureFunctionHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/TextureFunctionHLSL.cpp
index 1f3de5f9763..bc534732448 100644
--- a/chromium/third_party/angle/src/compiler/translator/TextureFunctionHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/TextureFunctionHLSL.cpp
@@ -296,7 +296,10 @@ void OutputTextureFunctionArgumentList(TInfoSinkBase &out,
else
{
ASSERT(outputType == SH_HLSL_4_1_OUTPUT);
- out << "const uint samplerIndex";
+ // A bug in the D3D compiler causes some nested sampling operations to fail.
+ // See http://anglebug.com/1923
+ // TODO(jmadill): Reinstate the const keyword when possible.
+ out << /*"const"*/ "uint samplerIndex";
}
}
diff --git a/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp b/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp
index 1e95638264c..efd60314124 100644
--- a/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp
@@ -8,6 +8,7 @@
#include "compiler/translator/BuiltInFunctionEmulatorGLSL.h"
#include "compiler/translator/EmulatePrecision.h"
+#include "compiler/translator/PrunePureLiteralStatements.h"
#include "compiler/translator/RecordConstantPrecision.h"
#include "compiler/translator/OutputESSL.h"
#include "angle_gl.h"
@@ -31,6 +32,10 @@ void TranslatorESSL::initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
void TranslatorESSL::translate(TIntermNode *root, ShCompileOptions compileOptions)
{
+ // The ESSL output doesn't define a default precision for float, so float literal statements
+ // end up with no precision which is invalid ESSL.
+ PrunePureLiteralStatements(root);
+
TInfoSinkBase &sink = getInfoSink().obj;
int shaderVer = getShaderVersion();
diff --git a/chromium/third_party/angle/src/compiler/translator/Types.cpp b/chromium/third_party/angle/src/compiler/translator/Types.cpp
index 48818fbace4..9664623e3c8 100644
--- a/chromium/third_party/angle/src/compiler/translator/Types.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/Types.cpp
@@ -33,6 +33,8 @@ const char *getBasicString(TBasicType t)
return "uint";
case EbtBool:
return "bool";
+ case EbtYuvCscStandardEXT:
+ return "yuvCscStandardEXT";
case EbtSampler2D:
return "sampler2D";
case EbtSampler3D:
@@ -41,6 +43,8 @@ const char *getBasicString(TBasicType t)
return "samplerCube";
case EbtSamplerExternalOES:
return "samplerExternalOES";
+ case EbtSamplerExternal2DY2YEXT:
+ return "__samplerExternal2DY2YEXT";
case EbtSampler2DRect:
return "sampler2DRect";
case EbtSampler2DArray:
@@ -292,6 +296,9 @@ TString TType::buildMangledName() const
case EbtBool:
mangledName += 'b';
break;
+ case EbtYuvCscStandardEXT:
+ mangledName += "ycs";
+ break;
case EbtSampler2D:
mangledName += "s2";
break;
@@ -307,6 +314,9 @@ TString TType::buildMangledName() const
case EbtSamplerExternalOES:
mangledName += "sext";
break;
+ case EbtSamplerExternal2DY2YEXT:
+ mangledName += "sext2y2y";
+ break;
case EbtSampler2DRect:
mangledName += "s2r";
break;
@@ -445,6 +455,36 @@ size_t TType::getObjectSize() const
return totalSize;
}
+int TType::getLocationCount() const
+{
+ int count = 1;
+
+ if (getBasicType() == EbtStruct)
+ {
+ count = structure->getLocationCount();
+ }
+
+ if (isArray())
+ {
+ if (count == 0)
+ {
+ return 0;
+ }
+
+ unsigned int currentArraySize = getArraySize();
+ if (currentArraySize > static_cast<unsigned int>(std::numeric_limits<int>::max() / count))
+ {
+ count = std::numeric_limits<int>::max();
+ }
+ else
+ {
+ count *= static_cast<int>(currentArraySize);
+ }
+ }
+
+ return count;
+}
+
TStructure::TStructure(const TString *name, TFieldList *fields)
: TFieldListCollection(name, fields),
mDeepestNesting(0),
@@ -583,9 +623,9 @@ TString TFieldListCollection::buildMangledName(const TString &mangledNamePrefix)
size_t TFieldListCollection::calculateObjectSize() const
{
size_t size = 0;
- for (size_t i = 0; i < mFields->size(); ++i)
+ for (const TField *field : *mFields)
{
- size_t fieldSize = (*mFields)[i]->type()->getObjectSize();
+ size_t fieldSize = field->type()->getObjectSize();
if (fieldSize > INT_MAX - size)
size = INT_MAX;
else
@@ -594,6 +634,24 @@ size_t TFieldListCollection::calculateObjectSize() const
return size;
}
+int TFieldListCollection::getLocationCount() const
+{
+ int count = 0;
+ for (const TField *field : *mFields)
+ {
+ int fieldCount = field->type()->getLocationCount();
+ if (fieldCount > std::numeric_limits<int>::max() - count)
+ {
+ count = std::numeric_limits<int>::max();
+ }
+ else
+ {
+ count += fieldCount;
+ }
+ }
+ return count;
+}
+
int TStructure::calculateDeepestNesting() const
{
int maxNesting = 0;
diff --git a/chromium/third_party/angle/src/compiler/translator/Types.h b/chromium/third_party/angle/src/compiler/translator/Types.h
index 676036cab30..530c840e905 100644
--- a/chromium/third_party/angle/src/compiler/translator/Types.h
+++ b/chromium/third_party/angle/src/compiler/translator/Types.h
@@ -62,7 +62,10 @@ class TFieldListCollection : angle::NonCopyable
if (mObjectSize == 0)
mObjectSize = calculateObjectSize();
return mObjectSize;
- };
+ }
+
+ // How many locations the field list consumes as a uniform.
+ int getLocationCount() const;
protected:
TFieldListCollection(const TString *name, TFieldList *fields)
@@ -332,6 +335,9 @@ class TType
// Full size of single instance of type
size_t getObjectSize() const;
+ // Get how many locations this type consumes as a uniform.
+ int getLocationCount() const;
+
bool isMatrix() const { return primarySize > 1 && secondarySize > 1; }
bool isNonSquareMatrix() const { return isMatrix() && primarySize != secondarySize; }
bool isArray() const { return array; }
diff --git a/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.cpp
index e3be7249a9e..accb3b5ba79 100644
--- a/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.cpp
@@ -241,18 +241,6 @@ TString DecorateIfNeeded(const TName &name)
}
}
-TString DecorateFunctionIfNeeded(const TName &name)
-{
- if (name.isInternal())
- {
- return TFunction::unmangleName(name.getString());
- }
- else
- {
- return Decorate(TFunction::unmangleName(name.getString()));
- }
-}
-
TString TypeString(const TType &type)
{
const TStructure *structure = type.getStruct();
diff --git a/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.h b/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.h
index 61fd1ef1c1a..37edce40eda 100644
--- a/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.h
+++ b/chromium/third_party/angle/src/compiler/translator/UtilsHLSL.h
@@ -65,8 +65,6 @@ TString SamplerString(HLSLTextureSamplerGroup type);
// Prepends an underscore to avoid naming clashes
TString Decorate(const TString &string);
TString DecorateIfNeeded(const TName &name);
-// Decorates and also unmangles the function name
-TString DecorateFunctionIfNeeded(const TName &name);
TString DecorateUniform(const TName &name, const TType &type);
TString DecorateField(const TString &string, const TStructure &structure);
TString DecoratePrivate(const TString &privateText);
diff --git a/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.cpp b/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.cpp
index 0369eaac550..3a17614fa02 100644
--- a/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.cpp
@@ -6,10 +6,9 @@
#include "compiler/translator/ValidateLimitations.h"
+#include "angle_gl.h"
#include "compiler/translator/Diagnostics.h"
-#include "compiler/translator/InitializeParseContext.h"
#include "compiler/translator/ParseContext.h"
-#include "angle_gl.h"
namespace sh
{
@@ -65,52 +64,73 @@ class ValidateConstIndexExpr : public TIntermTraverser
const std::vector<int> mLoopSymbolIds;
};
-} // namespace anonymous
+// Traverses intermediate tree to ensure that the shader does not exceed the
+// minimum functionality mandated in GLSL 1.0 spec, Appendix A.
+class ValidateLimitationsTraverser : public TLValueTrackingTraverser
+{
+ public:
+ ValidateLimitationsTraverser(sh::GLenum shaderType,
+ const TSymbolTable &symbolTable,
+ int shaderVersion,
+ TDiagnostics *diagnostics);
+
+ void visitSymbol(TIntermSymbol *node) override;
+ bool visitBinary(Visit, TIntermBinary *) override;
+ bool visitLoop(Visit, TIntermLoop *) override;
+
+ private:
+ void error(TSourceLoc loc, const char *reason, const char *token);
+
+ bool withinLoopBody() const;
+ bool isLoopIndex(TIntermSymbol *symbol);
+ bool validateLoopType(TIntermLoop *node);
+
+ bool validateForLoopHeader(TIntermLoop *node);
+ // If valid, return the index symbol id; Otherwise, return -1.
+ int validateForLoopInit(TIntermLoop *node);
+ bool validateForLoopCond(TIntermLoop *node, int indexSymbolId);
+ bool validateForLoopExpr(TIntermLoop *node, int indexSymbolId);
+
+ // Returns true if indexing does not exceed the minimum functionality
+ // mandated in GLSL 1.0 spec, Appendix A, Section 5.
+ bool isConstExpr(TIntermNode *node);
+ bool isConstIndexExpr(TIntermNode *node);
+ bool validateIndexing(TIntermBinary *node);
+
+ sh::GLenum mShaderType;
+ TDiagnostics *mDiagnostics;
+ std::vector<int> mLoopSymbolIds;
+};
-ValidateLimitations::ValidateLimitations(sh::GLenum shaderType, TDiagnostics *diagnostics)
- : TIntermTraverser(true, false, false),
+ValidateLimitationsTraverser::ValidateLimitationsTraverser(sh::GLenum shaderType,
+ const TSymbolTable &symbolTable,
+ int shaderVersion,
+ TDiagnostics *diagnostics)
+ : TLValueTrackingTraverser(true, false, false, symbolTable, shaderVersion),
mShaderType(shaderType),
- mDiagnostics(diagnostics),
- mValidateIndexing(true),
- mValidateInnerLoops(true)
+ mDiagnostics(diagnostics)
{
ASSERT(diagnostics);
}
-bool ValidateLimitations::visitBinary(Visit, TIntermBinary *node)
+void ValidateLimitationsTraverser::visitSymbol(TIntermSymbol *node)
{
- // Check if loop index is modified in the loop body.
- validateOperation(node, node->getLeft());
-
- // Check indexing.
- switch (node->getOp())
+ if (isLoopIndex(node) && isLValueRequiredHere())
{
- case EOpIndexDirect:
- case EOpIndexIndirect:
- if (mValidateIndexing)
- validateIndexing(node);
- break;
- default:
- break;
+ error(node->getLine(),
+ "Loop index cannot be statically assigned to within the body of the loop",
+ node->getSymbol().c_str());
}
- return true;
}
-bool ValidateLimitations::visitUnary(Visit, TIntermUnary *node)
-{
- // Check if loop index is modified in the loop body.
- validateOperation(node, node->getOperand());
-
- return true;
-}
-
-bool ValidateLimitations::visitAggregate(Visit, TIntermAggregate *node)
+bool ValidateLimitationsTraverser::visitBinary(Visit, TIntermBinary *node)
{
+ // Check indexing.
switch (node->getOp())
{
- case EOpCallFunctionInAST:
- case EOpCallBuiltInFunction:
- validateFunctionCall(node);
+ case EOpIndexDirect:
+ case EOpIndexIndirect:
+ validateIndexing(node);
break;
default:
break;
@@ -118,11 +138,8 @@ bool ValidateLimitations::visitAggregate(Visit, TIntermAggregate *node)
return true;
}
-bool ValidateLimitations::visitLoop(Visit, TIntermLoop *node)
+bool ValidateLimitationsTraverser::visitLoop(Visit, TIntermLoop *node)
{
- if (!mValidateInnerLoops)
- return true;
-
if (!validateLoopType(node))
return false;
@@ -141,23 +158,23 @@ bool ValidateLimitations::visitLoop(Visit, TIntermLoop *node)
return false;
}
-void ValidateLimitations::error(TSourceLoc loc, const char *reason, const char *token)
+void ValidateLimitationsTraverser::error(TSourceLoc loc, const char *reason, const char *token)
{
mDiagnostics->error(loc, reason, token);
}
-bool ValidateLimitations::withinLoopBody() const
+bool ValidateLimitationsTraverser::withinLoopBody() const
{
return !mLoopSymbolIds.empty();
}
-bool ValidateLimitations::isLoopIndex(TIntermSymbol *symbol)
+bool ValidateLimitationsTraverser::isLoopIndex(TIntermSymbol *symbol)
{
return std::find(mLoopSymbolIds.begin(), mLoopSymbolIds.end(), symbol->getId()) !=
mLoopSymbolIds.end();
}
-bool ValidateLimitations::validateLoopType(TIntermLoop *node)
+bool ValidateLimitationsTraverser::validateLoopType(TIntermLoop *node)
{
TLoopType type = node->getType();
if (type == ELoopFor)
@@ -168,7 +185,7 @@ bool ValidateLimitations::validateLoopType(TIntermLoop *node)
return false;
}
-bool ValidateLimitations::validateForLoopHeader(TIntermLoop *node)
+bool ValidateLimitationsTraverser::validateForLoopHeader(TIntermLoop *node)
{
ASSERT(node->getType() == ELoopFor);
@@ -187,7 +204,7 @@ bool ValidateLimitations::validateForLoopHeader(TIntermLoop *node)
return true;
}
-int ValidateLimitations::validateForLoopInit(TIntermLoop *node)
+int ValidateLimitationsTraverser::validateForLoopInit(TIntermLoop *node)
{
TIntermNode *init = node->getInit();
if (init == NULL)
@@ -243,7 +260,7 @@ int ValidateLimitations::validateForLoopInit(TIntermLoop *node)
return symbol->getId();
}
-bool ValidateLimitations::validateForLoopCond(TIntermLoop *node, int indexSymbolId)
+bool ValidateLimitationsTraverser::validateForLoopCond(TIntermLoop *node, int indexSymbolId)
{
TIntermNode *cond = node->getCondition();
if (cond == NULL)
@@ -299,7 +316,7 @@ bool ValidateLimitations::validateForLoopCond(TIntermLoop *node, int indexSymbol
return true;
}
-bool ValidateLimitations::validateForLoopExpr(TIntermLoop *node, int indexSymbolId)
+bool ValidateLimitationsTraverser::validateForLoopExpr(TIntermLoop *node, int indexSymbolId)
{
TIntermNode *expr = node->getExpression();
if (expr == NULL)
@@ -377,74 +394,13 @@ bool ValidateLimitations::validateForLoopExpr(TIntermLoop *node, int indexSymbol
return true;
}
-bool ValidateLimitations::validateFunctionCall(TIntermAggregate *node)
-{
- ASSERT(node->getOp() == EOpCallFunctionInAST || node->getOp() == EOpCallBuiltInFunction);
-
- // If not within loop body, there is nothing to check.
- if (!withinLoopBody())
- return true;
-
- // List of param indices for which loop indices are used as argument.
- typedef std::vector<size_t> ParamIndex;
- ParamIndex pIndex;
- TIntermSequence *params = node->getSequence();
- for (TIntermSequence::size_type i = 0; i < params->size(); ++i)
- {
- TIntermSymbol *symbol = (*params)[i]->getAsSymbolNode();
- if (symbol && isLoopIndex(symbol))
- pIndex.push_back(i);
- }
- // If none of the loop indices are used as arguments,
- // there is nothing to check.
- if (pIndex.empty())
- return true;
-
- bool valid = true;
- TSymbolTable &symbolTable = GetGlobalParseContext()->symbolTable;
- TSymbol *symbol = symbolTable.find(node->getFunctionSymbolInfo()->getName(),
- GetGlobalParseContext()->getShaderVersion());
- ASSERT(symbol && symbol->isFunction());
- TFunction *function = static_cast<TFunction *>(symbol);
- for (ParamIndex::const_iterator i = pIndex.begin(); i != pIndex.end(); ++i)
- {
- const TConstParameter &param = function->getParam(*i);
- TQualifier qual = param.type->getQualifier();
- if ((qual == EvqOut) || (qual == EvqInOut))
- {
- error((*params)[*i]->getLine(),
- "Loop index cannot be used as argument to a function out or inout parameter",
- (*params)[*i]->getAsSymbolNode()->getSymbol().c_str());
- valid = false;
- }
- }
-
- return valid;
-}
-
-bool ValidateLimitations::validateOperation(TIntermOperator *node, TIntermNode *operand)
-{
- // Check if loop index is modified in the loop body.
- if (!withinLoopBody() || !node->isAssignment())
- return true;
-
- TIntermSymbol *symbol = operand->getAsSymbolNode();
- if (symbol && isLoopIndex(symbol))
- {
- error(node->getLine(),
- "Loop index cannot be statically assigned to within the body of the loop",
- symbol->getSymbol().c_str());
- }
- return true;
-}
-
-bool ValidateLimitations::isConstExpr(TIntermNode *node)
+bool ValidateLimitationsTraverser::isConstExpr(TIntermNode *node)
{
ASSERT(node != nullptr);
return node->getAsConstantUnion() != nullptr && node->getAsTyped()->getQualifier() == EvqConst;
}
-bool ValidateLimitations::isConstIndexExpr(TIntermNode *node)
+bool ValidateLimitationsTraverser::isConstIndexExpr(TIntermNode *node)
{
ASSERT(node != NULL);
@@ -453,7 +409,7 @@ bool ValidateLimitations::isConstIndexExpr(TIntermNode *node)
return validate.isValid();
}
-bool ValidateLimitations::validateIndexing(TIntermBinary *node)
+bool ValidateLimitationsTraverser::validateIndexing(TIntermBinary *node)
{
ASSERT((node->getOp() == EOpIndexDirect) || (node->getOp() == EOpIndexIndirect));
@@ -471,4 +427,17 @@ bool ValidateLimitations::validateIndexing(TIntermBinary *node)
return valid;
}
+} // namespace anonymous
+
+bool ValidateLimitations(TIntermNode *root,
+ GLenum shaderType,
+ const TSymbolTable &symbolTable,
+ int shaderVersion,
+ TDiagnostics *diagnostics)
+{
+ ValidateLimitationsTraverser validate(shaderType, symbolTable, shaderVersion, diagnostics);
+ root->traverse(&validate);
+ return diagnostics->numErrors() == 0;
+}
+
} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.h b/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.h
index 3bc79d5f318..6947fdef2bf 100644
--- a/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.h
+++ b/chromium/third_party/angle/src/compiler/translator/ValidateLimitations.h
@@ -14,48 +14,13 @@ namespace sh
class TDiagnostics;
-// Traverses intermediate tree to ensure that the shader does not exceed the
-// minimum functionality mandated in GLSL 1.0 spec, Appendix A.
-class ValidateLimitations : public TIntermTraverser
-{
- public:
- ValidateLimitations(sh::GLenum shaderType, TDiagnostics *diagnostics);
-
- bool visitBinary(Visit, TIntermBinary *) override;
- bool visitUnary(Visit, TIntermUnary *) override;
- bool visitAggregate(Visit, TIntermAggregate *) override;
- bool visitLoop(Visit, TIntermLoop *) override;
-
- private:
- void error(TSourceLoc loc, const char *reason, const char *token);
-
- bool withinLoopBody() const;
- bool isLoopIndex(TIntermSymbol *symbol);
- bool validateLoopType(TIntermLoop *node);
-
- bool validateForLoopHeader(TIntermLoop *node);
- // If valid, return the index symbol id; Otherwise, return -1.
- int validateForLoopInit(TIntermLoop *node);
- bool validateForLoopCond(TIntermLoop *node, int indexSymbolId);
- bool validateForLoopExpr(TIntermLoop *node, int indexSymbolId);
-
- // Returns true if none of the loop indices is used as the argument to
- // the given function out or inout parameter.
- bool validateFunctionCall(TIntermAggregate *node);
- bool validateOperation(TIntermOperator *node, TIntermNode *operand);
-
- // Returns true if indexing does not exceed the minimum functionality
- // mandated in GLSL 1.0 spec, Appendix A, Section 5.
- bool isConstExpr(TIntermNode *node);
- bool isConstIndexExpr(TIntermNode *node);
- bool validateIndexing(TIntermBinary *node);
-
- sh::GLenum mShaderType;
- TDiagnostics *mDiagnostics;
- std::vector<int> mLoopSymbolIds;
- bool mValidateIndexing;
- bool mValidateInnerLoops;
-};
+// Returns true if the given shader does not exceed the minimum functionality mandated in GLSL ES
+// 1.00 spec Appendix A.
+bool ValidateLimitations(TIntermNode *root,
+ GLenum shaderType,
+ const TSymbolTable &symbolTable,
+ int shaderVersion,
+ TDiagnostics *diagnostics);
} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/ValidateMultiviewWebGL.cpp b/chromium/third_party/angle/src/compiler/translator/ValidateMultiviewWebGL.cpp
index fa6cf02596f..169a32e9160 100644
--- a/chromium/third_party/angle/src/compiler/translator/ValidateMultiviewWebGL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ValidateMultiviewWebGL.cpp
@@ -363,7 +363,7 @@ bool ValidateMultiviewTraverser::visitAggregate(Visit visit, TIntermAggregate *n
mValid = false;
}
else if (node->getOp() == EOpCallBuiltInFunction &&
- TFunction::unmangleName(node->getFunctionSymbolInfo()->getName()) == "imageStore")
+ node->getFunctionSymbolInfo()->getName() == "imageStore")
{
// TODO(oetuaho@nvidia.com): Record which built-in functions have side effects in
// the symbol info instead.
@@ -375,7 +375,8 @@ bool ValidateMultiviewTraverser::visitAggregate(Visit visit, TIntermAggregate *n
}
else if (!node->isConstructor())
{
- TFunction *builtInFunc = mSymbolTable.findBuiltInOp(node, mShaderVersion);
+ TFunction *builtInFunc = static_cast<TFunction *>(
+ mSymbolTable.findBuiltIn(node->getSymbolTableMangledName(), mShaderVersion));
for (size_t paramIndex = 0u; paramIndex < builtInFunc->getParamCount(); ++paramIndex)
{
TQualifier qualifier = builtInFunc->getParam(paramIndex).type->getQualifier();
diff --git a/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp b/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp
index 2e0303cb3d4..27ab81469be 100644
--- a/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp
@@ -6,7 +6,6 @@
#include "compiler/translator/ValidateOutputs.h"
#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/InitializeParseContext.h"
#include "compiler/translator/ParseContext.h"
namespace sh
@@ -25,7 +24,8 @@ ValidateOutputs::ValidateOutputs(const TExtensionBehavior &extBehavior, int maxD
: TIntermTraverser(true, false, false),
mMaxDrawBuffers(maxDrawBuffers),
mAllowUnspecifiedOutputLocationResolution(
- IsExtensionEnabled(extBehavior, "GL_EXT_blend_func_extended"))
+ IsExtensionEnabled(extBehavior, "GL_EXT_blend_func_extended")),
+ mUsesFragDepth(false)
{
}
@@ -41,15 +41,23 @@ void ValidateOutputs::visitSymbol(TIntermSymbol *symbol)
if (qualifier == EvqFragmentOut)
{
- if (symbol->getType().getLayoutQualifier().location == -1)
+ if (symbol->getType().getLayoutQualifier().location != -1)
{
- mUnspecifiedLocationOutputs.push_back(symbol);
+ mOutputs.push_back(symbol);
+ }
+ else if (symbol->getType().getLayoutQualifier().yuv == true)
+ {
+ mYuvOutputs.push_back(symbol);
}
else
{
- mOutputs.push_back(symbol);
+ mUnspecifiedLocationOutputs.push_back(symbol);
}
}
+ else if (qualifier == EvqFragDepth || qualifier == EvqFragDepthEXT)
+ {
+ mUsesFragDepth = true;
+ }
}
void ValidateOutputs::validate(TDiagnostics *diagnostics) const
@@ -106,6 +114,18 @@ void ValidateOutputs::validate(TDiagnostics *diagnostics) const
diagnostics);
}
}
+
+ if (!mYuvOutputs.empty() && (mYuvOutputs.size() > 1 || mUsesFragDepth || !mOutputs.empty() ||
+ !mUnspecifiedLocationOutputs.empty()))
+ {
+ for (const auto &symbol : mYuvOutputs)
+ {
+ error(*symbol,
+ "not allowed to specify yuv qualifier when using depth or multiple color "
+ "fragment outputs",
+ diagnostics);
+ }
+ }
}
} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.h b/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.h
index 152d47527e1..c9282d2bd9c 100644
--- a/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.h
+++ b/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.h
@@ -29,10 +29,12 @@ class ValidateOutputs : public TIntermTraverser
private:
int mMaxDrawBuffers;
bool mAllowUnspecifiedOutputLocationResolution;
+ bool mUsesFragDepth;
typedef std::vector<TIntermSymbol *> OutputVector;
OutputVector mOutputs;
OutputVector mUnspecifiedLocationOutputs;
+ OutputVector mYuvOutputs;
std::set<std::string> mVisitedSymbols;
};
diff --git a/chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp b/chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp
index b4f2eaa542d..a201b4c6df3 100644
--- a/chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp
@@ -570,6 +570,7 @@ Uniform CollectVariables::recordUniform(const TIntermSymbol &variable) const
Uniform uniform;
setCommonVariableProperties(variable.getType(), variable.getSymbol(), &uniform);
uniform.binding = variable.getType().getLayoutQualifier().binding;
+ uniform.location = variable.getType().getLayoutQualifier().location;
return uniform;
}
diff --git a/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.cpp
index f5c08759f6f..39b1a5bd363 100644
--- a/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.cpp
@@ -15,8 +15,8 @@
namespace sh
{
-HLSLBlockEncoder::HLSLBlockEncoder(HLSLBlockEncoderStrategy strategy)
- : mEncoderStrategy(strategy), mTransposeMatrices(false)
+HLSLBlockEncoder::HLSLBlockEncoder(HLSLBlockEncoderStrategy strategy, bool transposeMatrices)
+ : mEncoderStrategy(strategy), mTransposeMatrices(transposeMatrices)
{
}
@@ -154,25 +154,13 @@ void HLSLVariableRegisterCount(const ShaderVarType &variable, HLSLBlockEncoder *
}
}
-unsigned int HLSLVariableRegisterCount(const Varying &variable, bool transposeMatrices)
-{
- HLSLBlockEncoder encoder(HLSLBlockEncoder::ENCODE_PACKED);
- encoder.setTransposeMatrices(transposeMatrices);
- HLSLVariableRegisterCount(variable, &encoder);
-
- const size_t registerBytes = (encoder.BytesPerComponent * encoder.ComponentsPerRegister);
- return static_cast<unsigned int>(rx::roundUp<size_t>(encoder.getBlockSize(), registerBytes) /
- registerBytes);
-}
-
unsigned int HLSLVariableRegisterCount(const Uniform &variable, ShShaderOutput outputType)
{
- HLSLBlockEncoder encoder(HLSLBlockEncoder::GetStrategyFor(outputType));
- encoder.setTransposeMatrices(true);
+ HLSLBlockEncoder encoder(HLSLBlockEncoder::GetStrategyFor(outputType), true);
HLSLVariableRegisterCount(variable, &encoder);
const size_t registerBytes = (encoder.BytesPerComponent * encoder.ComponentsPerRegister);
return static_cast<unsigned int>(rx::roundUp<size_t>(encoder.getBlockSize(), registerBytes) /
registerBytes);
}
-}
+} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.h b/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.h
index 3da689eba77..a0220dccb70 100644
--- a/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.h
+++ b/chromium/third_party/angle/src/compiler/translator/blocklayoutHLSL.h
@@ -33,14 +33,13 @@ class HLSLBlockEncoder : public BlockLayoutEncoder
ENCODE_LOOSE
};
- HLSLBlockEncoder(HLSLBlockEncoderStrategy strategy);
+ HLSLBlockEncoder(HLSLBlockEncoderStrategy strategy, bool transposeMatrices);
virtual void enterAggregateType();
virtual void exitAggregateType();
void skipRegisters(unsigned int numRegisters);
bool isPacked() const { return mEncoderStrategy == ENCODE_PACKED; }
- void setTransposeMatrices(bool enabled) { mTransposeMatrices = enabled; }
static HLSLBlockEncoderStrategy GetStrategyFor(ShShaderOutput outputType);
@@ -61,10 +60,8 @@ class HLSLBlockEncoder : public BlockLayoutEncoder
};
// This method returns the number of used registers for a ShaderVariable. It is dependent on the
-// HLSLBlockEncoder
-// class to count the number of used registers in a struct (which are individually packed according
-// to the same rules).
-unsigned int HLSLVariableRegisterCount(const Varying &variable, bool transposeMatrices);
+// HLSLBlockEncoder class to count the number of used registers in a struct (which are individually
+// packed according to the same rules).
unsigned int HLSLVariableRegisterCount(const Uniform &variable, ShShaderOutput outputType);
}
diff --git a/chromium/third_party/angle/src/compiler/translator/glslang.l b/chromium/third_party/angle/src/compiler/translator/glslang.l
index 91f6ad59da6..c123bc654d1 100644
--- a/chromium/third_party/angle/src/compiler/translator/glslang.l
+++ b/chromium/third_party/angle/src/compiler/translator/glslang.l
@@ -79,10 +79,12 @@ static int ES2_ident_ES3_keyword(TParseContext *context, int token);
static int ES2_ident_ES3_reserved_ES3_1_keyword(TParseContext *context, int token);
static int ES2_and_ES3_reserved_ES3_1_keyword(TParseContext *context, int token);
static int ES2_and_ES3_ident_ES3_1_keyword(TParseContext *context, int token);
+static int ES3_extension_keyword_else_ident(TParseContext *context, const char *extension, int token);
static int uint_constant(TParseContext *context);
static int int_constant(TParseContext *context);
static int float_constant(yyscan_t yyscanner);
static int floatsuffix_check(TParseContext* context);
+static int yuvcscstandardext_constant(TParseContext *context);
%}
%option noyywrap nounput never-interactive
@@ -194,11 +196,17 @@ O [0-7]
"sampler2DShadow" { return ES2_reserved_ES3_keyword(context, SAMPLER2DSHADOW); }
"samplerCubeShadow" { return ES2_ident_ES3_keyword(context, SAMPLERCUBESHADOW); }
"sampler2DArrayShadow" { return ES2_ident_ES3_keyword(context, SAMPLER2DARRAYSHADOW); }
+"__samplerExternal2DY2YEXT" { return ES3_extension_keyword_else_ident(context, "GL_EXT_YUV_target", SAMPLEREXTERNAL2DY2YEXT); }
"struct" { return STRUCT; }
"layout" { return ES2_ident_ES3_keyword(context, LAYOUT); }
+"yuvCscStandardEXT" { return ES3_extension_keyword_else_ident(context, "GL_EXT_YUV_target", YUVCSCSTANDARDEXT); }
+"itu_601" { return yuvcscstandardext_constant(context); }
+"itu_601_full_range" { return yuvcscstandardext_constant(context); }
+"itu_709" { return yuvcscstandardext_constant(context); }
+
"image2D" { return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE2D); }
"iimage2D" { return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE2D); }
"uimage2D" { return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE2D); }
@@ -533,6 +541,21 @@ int ES2_and_ES3_ident_ES3_1_keyword(TParseContext *context, int token)
return token;
}
+int ES3_extension_keyword_else_ident(TParseContext *context, const char* extension, int token)
+{
+ struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
+ yyscan_t yyscanner = (yyscan_t) context->getScanner();
+
+ // a reserved word in GLSL ES 3.00 with enabled extension, otherwise could be used as an identifier/type name
+ if (context->getShaderVersion() >= 300 && context->isExtensionEnabled(extension))
+ {
+ return token;
+ }
+
+ yylval->lex.string = NewPoolTString(yytext);
+ return check_type(yyscanner);
+}
+
int uint_constant(TParseContext *context)
{
struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
@@ -594,6 +617,22 @@ int float_constant(yyscan_t yyscanner) {
return FLOATCONSTANT;
}
+int yuvcscstandardext_constant(TParseContext *context)
+{
+ struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
+ yyscan_t yyscanner = (yyscan_t) context->getScanner();
+
+ // a reserved word in GLSL ES 3.00 with enabled extension, otherwise could be used as an identifier/type name
+ if (context->getShaderVersion() >= 300 && context->isExtensionEnabled("GL_EXT_YUV_target"))
+ {
+ yylval->lex.string = NewPoolTString(yytext);
+ return YUVCSCSTANDARDEXTCONSTANT;
+ }
+
+ yylval->lex.string = NewPoolTString(yytext);
+ return check_type(yyscanner);
+}
+
int glslang_initialize(TParseContext* context) {
yyscan_t scanner = NULL;
if (yylex_init_extra(context, &scanner))
diff --git a/chromium/third_party/angle/src/compiler/translator/glslang.y b/chromium/third_party/angle/src/compiler/translator/glslang.y
index 86740877973..d67752c03ef 100644
--- a/chromium/third_party/angle/src/compiler/translator/glslang.y
+++ b/chromium/third_party/angle/src/compiler/translator/glslang.y
@@ -178,9 +178,11 @@ extern void yyerror(YYLTYPE* yylloc, TParseContext* context, void *scanner, cons
%token <lex> USAMPLER2D USAMPLER3D USAMPLERCUBE USAMPLER2DARRAY
%token <lex> SAMPLER2DMS ISAMPLER2DMS USAMPLER2DMS
%token <lex> SAMPLER3D SAMPLER3DRECT SAMPLER2DSHADOW SAMPLERCUBESHADOW SAMPLER2DARRAYSHADOW
+%token <lex> SAMPLEREXTERNAL2DY2YEXT
%token <lex> IMAGE2D IIMAGE2D UIMAGE2D IMAGE3D IIMAGE3D UIMAGE3D IMAGE2DARRAY IIMAGE2DARRAY UIMAGE2DARRAY
%token <lex> IMAGECUBE IIMAGECUBE UIMAGECUBE
%token <lex> LAYOUT
+%token <lex> YUVCSCSTANDARDEXT YUVCSCSTANDARDEXTCONSTANT
%token <lex> IDENTIFIER TYPE_NAME FLOATCONSTANT INTCONSTANT UINTCONSTANT BOOLCONSTANT
%token <lex> FIELD_SELECTION
@@ -280,6 +282,14 @@ primary_expression
unionArray->setBConst($1.b);
$$ = context->intermediate.addConstantUnion(unionArray, TType(EbtBool, EbpUndefined, EvqConst), @1);
}
+ | YUVCSCSTANDARDEXTCONSTANT {
+ if (!context->isExtensionEnabled("GL_EXT_YUV_target")) {
+ context->error(@1, "unsupported value", $1.string->c_str());
+ }
+ TConstantUnion *unionArray = new TConstantUnion[1];
+ unionArray->setYuvCscStandardEXTConst(getYuvCscStandardEXT($1.string->c_str()));
+ $$ = context->intermediate.addConstantUnion(unionArray, TType(EbtYuvCscStandardEXT, EbpUndefined, EvqConst), @1);
+ }
| LEFT_PAREN expression RIGHT_PAREN {
$$ = $2;
}
@@ -1130,6 +1140,12 @@ type_specifier_nonarray
$$.initialize(EbtFloat, @1);
$$.setMatrix(4, 3);
}
+ | YUVCSCSTANDARDEXT {
+ if (!context->isExtensionEnabled("GL_EXT_YUV_target")) {
+ context->error(@1, "unsupported type", "yuvCscStandardEXT");
+ }
+ $$.initialize(EbtYuvCscStandardEXT, @1);
+ }
| SAMPLER2D {
$$.initialize(EbtSampler2D, @1);
}
@@ -1191,6 +1207,12 @@ type_specifier_nonarray
}
$$.initialize(EbtSamplerExternalOES, @1);
}
+ | SAMPLEREXTERNAL2DY2YEXT {
+ if (!context->isExtensionEnabled("GL_EXT_YUV_target")) {
+ context->error(@1, "unsupported type", "__samplerExternal2DY2YEXT");
+ }
+ $$.initialize(EbtSamplerExternal2DY2YEXT, @1);
+ }
| SAMPLER2DRECT {
if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
context->error(@1, "unsupported type", "sampler2DRect");
diff --git a/chromium/third_party/angle/src/compiler/translator/glslang_lex.cpp b/chromium/third_party/angle/src/compiler/translator/glslang_lex.cpp
index d7c9e9bdbe5..6d00711d192 100644
--- a/chromium/third_party/angle/src/compiler/translator/glslang_lex.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/glslang_lex.cpp
@@ -402,8 +402,8 @@ static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
*yy_cp = '\0'; \
yyg->yy_c_buf_p = yy_cp;
-#define YY_NUM_RULES 241
-#define YY_END_OF_BUFFER 242
+#define YY_NUM_RULES 246
+#define YY_END_OF_BUFFER 247
/* This struct is not used in this scanner,
but its presence is necessary. */
struct yy_trans_info
@@ -411,99 +411,105 @@ struct yy_trans_info
flex_int32_t yy_verify;
flex_int32_t yy_nxt;
};
-static yyconst flex_int16_t yy_accept[824] =
+static yyconst flex_int16_t yy_accept[886] =
{ 0,
- 0, 0, 0, 0, 242, 240, 239, 239, 223, 229,
- 234, 218, 219, 227, 226, 215, 224, 222, 228, 181,
- 181, 216, 212, 230, 217, 231, 235, 178, 220, 221,
- 233, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 213, 232, 214, 225, 238, 237, 241, 236, 209,
- 195, 214, 203, 198, 193, 201, 191, 202, 192, 187,
- 194, 186, 180, 181, 0, 184, 0, 221, 213, 220,
- 210, 206, 208, 207, 211, 178, 199, 205, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
-
- 12, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 15, 178, 178, 23, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 200, 204, 236, 0, 190, 186, 0, 189, 183,
- 0, 185, 179, 196, 197, 178, 138, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 13, 178, 178, 178, 178, 178, 178, 178, 178, 178,
-
- 178, 28, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 24, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 0,
- 187, 0, 186, 188, 182, 178, 178, 178, 31, 178,
- 178, 18, 175, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 16, 141, 178, 178, 178, 178, 21,
- 178, 178, 145, 156, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 153, 4, 36, 37,
-
- 38, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 144, 32, 178, 178,
- 29, 178, 178, 178, 178, 178, 178, 178, 48, 49,
- 50, 30, 178, 178, 178, 178, 178, 178, 10, 54,
- 55, 56, 178, 139, 178, 178, 7, 178, 178, 178,
- 178, 165, 166, 167, 178, 33, 178, 157, 27, 168,
- 169, 170, 2, 162, 163, 164, 178, 178, 178, 25,
- 160, 178, 178, 178, 51, 52, 53, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 103, 178,
-
- 178, 178, 178, 178, 178, 178, 178, 154, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 140,
- 178, 178, 177, 57, 58, 59, 178, 178, 14, 178,
- 108, 178, 178, 178, 178, 106, 178, 178, 178, 155,
- 150, 109, 178, 178, 178, 178, 178, 178, 146, 178,
- 178, 178, 82, 39, 42, 44, 43, 40, 46, 45,
- 47, 41, 178, 178, 178, 178, 161, 137, 178, 178,
- 148, 178, 178, 178, 35, 104, 26, 174, 22, 149,
- 81, 178, 159, 17, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 19, 34,
-
- 178, 178, 178, 178, 178, 178, 110, 83, 89, 178,
- 178, 178, 178, 178, 3, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 142, 178, 178, 178,
- 178, 178, 8, 178, 178, 9, 178, 178, 178, 178,
- 20, 97, 11, 151, 111, 84, 91, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 147,
- 178, 178, 178, 95, 100, 98, 178, 178, 178, 178,
- 178, 178, 178, 143, 112, 85, 90, 178, 178, 158,
- 178, 99, 178, 178, 6, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 94, 152, 1, 178, 178, 178,
-
- 178, 178, 176, 178, 107, 5, 171, 60, 63, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 178, 96, 178, 178, 178, 178, 92, 178, 178,
- 178, 178, 178, 125, 68, 69, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 105,
- 178, 178, 178, 93, 127, 73, 74, 178, 178, 101,
- 178, 178, 178, 178, 178, 178, 178, 120, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 67, 178,
- 178, 178, 178, 61, 178, 178, 178, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 121, 113, 178, 86,
-
- 178, 178, 178, 72, 178, 178, 70, 178, 178, 178,
- 178, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 122, 178, 178, 77, 178, 178, 75, 114, 87, 178,
- 116, 178, 117, 178, 178, 178, 178, 178, 102, 178,
- 178, 178, 178, 65, 178, 64, 131, 178, 178, 115,
- 88, 178, 178, 178, 178, 178, 178, 178, 178, 178,
- 178, 129, 132, 123, 178, 66, 178, 178, 178, 178,
- 178, 178, 178, 178, 130, 133, 178, 178, 126, 71,
- 178, 178, 172, 178, 178, 178, 78, 178, 178, 128,
- 76, 178, 178, 178, 178, 178, 178, 134, 178, 178,
-
- 178, 178, 178, 178, 135, 178, 178, 178, 79, 178,
- 136, 118, 119, 178, 178, 178, 62, 178, 178, 173,
- 124, 80, 0
+ 0, 0, 0, 0, 247, 245, 244, 244, 228, 234,
+ 239, 223, 224, 232, 231, 220, 229, 227, 233, 186,
+ 186, 221, 217, 235, 222, 236, 240, 183, 225, 226,
+ 238, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 218, 237, 219, 230, 243, 242, 246,
+ 241, 214, 200, 219, 208, 203, 198, 206, 196, 207,
+ 197, 192, 199, 191, 185, 186, 0, 189, 0, 226,
+ 218, 225, 215, 211, 213, 212, 216, 183, 204, 210,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+
+ 183, 183, 183, 12, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 15, 183, 183,
+ 23, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 205, 209, 241, 0,
+ 195, 191, 0, 194, 188, 0, 190, 184, 201, 202,
+ 183, 183, 143, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 13, 183, 183, 183,
+
+ 183, 183, 183, 183, 183, 183, 183, 28, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 24, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 0, 192, 0,
+ 191, 193, 187, 183, 183, 183, 183, 31, 183, 183,
+ 18, 180, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 16, 146, 183, 183, 183, 183, 21, 183,
+ 183, 150, 161, 183, 183, 183, 183, 183, 183, 183,
+
+ 183, 183, 183, 183, 183, 183, 158, 4, 36, 37,
+ 38, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 149, 32, 183, 183,
+ 29, 183, 183, 183, 183, 183, 183, 183, 48, 49,
+ 50, 30, 183, 183, 183, 183, 183, 183, 183, 183,
+ 10, 54, 55, 56, 183, 144, 183, 183, 7, 183,
+ 183, 183, 183, 170, 171, 172, 183, 33, 183, 162,
+ 27, 173, 174, 175, 2, 167, 168, 169, 183, 183,
+ 183, 25, 165, 183, 183, 183, 183, 183, 51, 52,
+
+ 53, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 108, 183, 183, 183, 183, 183, 183, 183,
+ 183, 159, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 145, 183, 183, 182, 57, 58, 59,
+ 183, 183, 14, 183, 183, 183, 113, 183, 183, 183,
+ 183, 111, 183, 183, 183, 160, 155, 114, 183, 183,
+ 183, 183, 183, 183, 151, 183, 183, 183, 183, 183,
+ 83, 39, 42, 44, 43, 40, 46, 45, 47, 41,
+ 183, 183, 183, 183, 166, 142, 183, 183, 153, 183,
+ 183, 183, 35, 109, 26, 179, 22, 154, 82, 183,
+
+ 164, 17, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 19, 34,
+ 183, 183, 183, 183, 183, 183, 115, 88, 94, 183,
+ 183, 183, 183, 183, 85, 87, 3, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 147, 183,
+ 183, 183, 183, 183, 8, 183, 183, 9, 183, 183,
+ 183, 183, 183, 183, 20, 102, 11, 156, 116, 89,
+ 96, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 152, 183, 183, 183, 100, 105,
+ 103, 183, 183, 183, 183, 183, 183, 183, 148, 117,
+
+ 90, 95, 183, 183, 163, 183, 104, 183, 183, 183,
+ 183, 6, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 99, 157, 1, 183, 183, 183, 183, 183, 183,
+ 181, 183, 112, 5, 176, 60, 63, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 101, 183, 183, 183, 183, 183, 183, 97, 183, 183,
+ 183, 183, 183, 130, 68, 69, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 110, 183, 183, 183, 98, 132, 73, 74, 183, 183,
+ 183, 183, 106, 183, 183, 183, 183, 183, 183, 183,
+
+ 125, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 67, 183, 183, 183, 183, 61, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 126, 118, 183, 91, 183, 183, 183, 72,
+ 183, 183, 70, 183, 183, 183, 183, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 183, 127, 183, 183,
+ 77, 183, 183, 75, 183, 183, 119, 92, 183, 121,
+ 183, 122, 183, 183, 183, 183, 183, 183, 107, 183,
+ 183, 183, 183, 65, 183, 64, 136, 183, 183, 120,
+ 93, 183, 183, 183, 183, 183, 183, 183, 183, 183,
+
+ 183, 183, 183, 134, 137, 183, 128, 183, 66, 183,
+ 183, 183, 183, 183, 183, 183, 183, 135, 138, 183,
+ 183, 183, 183, 131, 71, 183, 183, 183, 177, 183,
+ 183, 183, 78, 183, 183, 133, 76, 183, 183, 183,
+ 183, 183, 183, 183, 183, 183, 139, 183, 183, 183,
+ 183, 183, 183, 183, 183, 140, 183, 183, 183, 183,
+ 79, 183, 141, 84, 183, 123, 124, 86, 183, 183,
+ 183, 62, 183, 183, 183, 178, 183, 129, 80, 183,
+ 183, 183, 183, 81, 0
} ;
static yyconst flex_int32_t yy_ec[256] =
@@ -513,15 +519,15 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 2, 4, 1, 1, 1, 5, 6, 1, 7,
8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 20, 20, 21, 21, 22, 23, 24,
- 25, 26, 27, 1, 28, 29, 30, 31, 32, 33,
- 34, 34, 34, 34, 34, 34, 35, 34, 36, 34,
- 34, 37, 38, 34, 39, 34, 34, 40, 34, 34,
- 41, 1, 42, 43, 44, 1, 45, 46, 47, 48,
-
- 49, 50, 51, 52, 53, 34, 54, 55, 56, 57,
- 58, 59, 34, 60, 61, 62, 63, 64, 65, 66,
- 67, 68, 69, 70, 71, 72, 1, 1, 1, 1,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 1, 31, 32, 33, 34, 35, 36,
+ 37, 37, 37, 37, 37, 37, 38, 37, 39, 37,
+ 37, 40, 41, 42, 43, 37, 37, 44, 45, 37,
+ 46, 1, 47, 48, 49, 1, 50, 51, 52, 53,
+
+ 54, 55, 56, 57, 58, 37, 59, 60, 61, 62,
+ 63, 64, 37, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -538,334 +544,357 @@ static yyconst flex_int32_t yy_ec[256] =
1, 1, 1, 1, 1
} ;
-static yyconst flex_int32_t yy_meta[73] =
+static yyconst flex_int32_t yy_meta[78] =
{ 0,
- 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 2, 2, 2, 2, 2, 2,
- 2, 1, 1, 1, 1, 1, 1, 3, 3, 3,
- 3, 2, 2, 4, 4, 4, 4, 4, 4, 4,
- 1, 1, 1, 4, 3, 3, 3, 3, 2, 2,
- 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
- 4, 4, 4, 4, 4, 4, 4, 4, 1, 1,
- 1, 1
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 2,
+ 1, 2, 3, 1, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 1, 1, 1, 1, 1, 1,
+ 5, 5, 5, 5, 6, 7, 8, 8, 8, 8,
+ 8, 8, 9, 8, 8, 1, 1, 1, 8, 5,
+ 5, 5, 5, 6, 7, 8, 8, 8, 8, 8,
+ 8, 8, 8, 8, 8, 8, 8, 9, 8, 8,
+ 8, 8, 8, 1, 1, 1, 1
} ;
-static yyconst flex_int16_t yy_base[829] =
+static yyconst flex_int16_t yy_base[895] =
{ 0,
- 0, 0, 72, 0, 1020, 1021, 1021, 1021, 994, 120,
- 141, 1021, 1021, 993, 138, 1021, 137, 135, 992, 154,
- 208, 990, 1021, 154, 990, 132, 1021, 0, 1021, 1021,
- 139, 130, 123, 140, 147, 133, 177, 956, 186, 151,
- 139, 116, 161, 950, 173, 963, 193, 199, 208, 215,
- 108, 1021, 184, 1021, 1021, 1021, 1021, 1021, 0, 1021,
- 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 230,
- 1021, 235, 235, 0, 271, 1021, 0, 1021, 1021, 1021,
- 986, 1021, 1021, 1021, 985, 0, 1021, 1021, 947, 952,
- 152, 949, 957, 956, 943, 946, 957, 243, 951, 939,
-
- 936, 949, 936, 933, 933, 939, 147, 248, 933, 943,
- 929, 935, 938, 939, 0, 931, 941, 249, 940, 935,
- 916, 177, 920, 933, 924, 184, 917, 250, 929, 931,
- 257, 920, 251, 907, 916, 260, 257, 920, 916, 918,
- 907, 910, 196, 217, 269, 919, 907, 919, 262, 912,
- 911, 1021, 1021, 0, 311, 1021, 292, 328, 1021, 1021,
- 335, 342, 325, 1021, 1021, 910, 0, 906, 901, 905,
- 914, 911, 316, 895, 895, 906, 898, 215, 908, 905,
- 905, 903, 900, 892, 898, 885, 883, 895, 881, 897,
- 0, 894, 882, 889, 886, 890, 891, 884, 881, 870,
-
- 869, 882, 885, 873, 881, 869, 875, 866, 316, 871,
- 874, 865, 872, 861, 865, 856, 870, 869, 860, 866,
- 308, 850, 853, 851, 850, 860, 850, 845, 843, 845,
- 855, 841, 843, 840, 851, 850, 853, 835, 318, 843,
- 839, 837, 846, 825, 354, 843, 845, 834, 826, 364,
- 378, 385, 397, 1021, 1021, 823, 833, 832, 0, 830,
- 372, 0, 0, 823, 821, 821, 822, 817, 825, 814,
- 831, 820, 390, 0, 0, 814, 824, 823, 823, 0,
- 808, 402, 0, 0, 810, 405, 817, 818, 809, 803,
- 802, 803, 802, 802, 408, 797, 0, 0, 793, 792,
-
- 791, 793, 794, 799, 793, 789, 802, 797, 797, 795,
- 794, 788, 782, 784, 783, 787, 792, 778, 781, 776,
- 784, 789, 777, 774, 786, 777, 0, 0, 783, 779,
- 0, 771, 771, 776, 767, 774, 414, 771, 0, 0,
- 0, 0, 761, 773, 772, 771, 772, 772, 0, 0,
- 0, 0, 759, 0, 767, 758, 0, 757, 758, 752,
- 762, 0, 0, 0, 753, 0, 749, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 759, 419, 758, 0,
- 0, 756, 752, 749, 0, 0, 0, 741, 421, 424,
- 427, 746, 742, 747, 738, 736, 749, 734, 0, 734,
-
- 747, 736, 732, 738, 733, 740, 740, 0, 737, 734,
- 738, 722, 720, 723, 729, 735, 730, 729, 717, 0,
- 719, 720, 0, 0, 0, 0, 717, 720, 0, 714,
- 0, 727, 707, 716, 711, 0, 704, 704, 717, 0,
- 719, 0, 434, 732, 731, 730, 697, 696, 0, 713,
- 712, 707, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 696, 709, 696, 693, 0, 0, 698, 697,
- 0, 694, 701, 700, 0, 686, 0, 0, 0, 0,
- 0, 683, 0, 0, 682, 693, 437, 686, 692, 691,
- 688, 683, 680, 673, 673, 686, 671, 683, 0, 0,
-
- 676, 699, 698, 697, 664, 663, 339, 430, 0, 675,
- 678, 676, 665, 661, 0, 673, 670, 669, 659, 658,
- 648, 665, 651, 443, 659, 662, 0, 679, 678, 677,
- 644, 643, 0, 657, 644, 0, 654, 647, 648, 651,
- 0, 0, 0, 0, 671, 670, 0, 647, 650, 635,
- 642, 633, 640, 641, 641, 640, 626, 453, 638, 0,
- 639, 628, 627, 0, 0, 0, 652, 651, 650, 617,
- 616, 612, 620, 0, 648, 647, 0, 624, 627, 0,
- 460, 0, 605, 614, 0, 610, 609, 618, 618, 606,
- 620, 604, 618, 613, 0, 0, 0, 630, 629, 628,
-
- 595, 594, 0, 594, 0, 0, 446, 457, 618, 604,
- 607, 590, 602, 590, 589, 598, 598, 615, 614, 613,
- 580, 579, 0, 579, 580, 579, 589, 0, 592, 588,
- 590, 586, 573, 604, 451, 0, 581, 584, 576, 568,
- 575, 566, 587, 575, 571, 573, 571, 571, 570, 0,
- 558, 557, 567, 0, 587, 463, 0, 564, 567, 0,
- 567, 566, 550, 542, 550, 540, 548, 0, 545, 544,
- 565, 553, 551, 551, 535, 538, 552, 536, 567, 547,
- 548, 545, 542, 552, 529, 543, 542, 526, 525, 524,
- 545, 533, 531, 531, 512, 511, 0, 539, 511, 537,
-
- 509, 513, 512, 543, 523, 520, 0, 519, 522, 518,
- 520, 504, 501, 514, 499, 500, 507, 501, 490, 489,
- 0, 495, 494, 525, 505, 502, 0, 0, 0, 498,
- 0, 497, 0, 503, 502, 486, 483, 484, 0, 476,
- 484, 474, 480, 501, 480, 0, 0, 492, 491, 0,
- 0, 490, 489, 473, 470, 471, 485, 484, 461, 460,
- 466, 0, 0, 487, 459, 485, 477, 128, 151, 196,
- 227, 227, 269, 277, 0, 0, 291, 321, 0, 0,
- 329, 334, 0, 335, 343, 384, 0, 376, 420, 0,
- 0, 412, 404, 407, 413, 436, 442, 0, 445, 431,
-
- 465, 432, 436, 437, 0, 455, 456, 447, 0, 468,
- 0, 0, 0, 449, 450, 444, 0, 445, 446, 0,
- 0, 0, 1021, 510, 513, 516, 517, 518
+ 0, 0, 77, 0, 1089, 1090, 1090, 1090, 1060, 127,
+ 151, 1090, 1090, 1059, 148, 1090, 147, 145, 1058, 167,
+ 158, 1056, 1090, 167, 1056, 145, 1090, 0, 1090, 1090,
+ 149, 1034, 147, 135, 155, 162, 146, 174, 1019, 172,
+ 178, 179, 153, 196, 1013, 198, 1026, 200, 197, 213,
+ 202, 113, 1011, 1090, 153, 1090, 1090, 1090, 1090, 1090,
+ 0, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090,
+ 1090, 237, 1090, 241, 237, 271, 243, 1090, 0, 1090,
+ 1090, 1090, 1050, 1090, 1090, 1090, 1049, 0, 1090, 1090,
+ 1010, 1008, 1013, 156, 1010, 1018, 1017, 1004, 1007, 1018,
+
+ 226, 1012, 1000, 997, 1010, 997, 994, 994, 1000, 189,
+ 235, 994, 1004, 990, 996, 999, 1000, 0, 992, 1002,
+ 230, 1001, 982, 995, 976, 216, 980, 993, 984, 243,
+ 977, 237, 989, 991, 250, 980, 259, 967, 976, 253,
+ 259, 980, 976, 978, 967, 970, 250, 255, 269, 979,
+ 967, 979, 266, 972, 971, 959, 1090, 1090, 0, 318,
+ 1090, 296, 323, 1090, 1090, 325, 324, 286, 1090, 1090,
+ 977, 968, 0, 964, 959, 963, 972, 969, 298, 953,
+ 953, 964, 956, 271, 966, 963, 963, 961, 958, 950,
+ 956, 943, 941, 953, 939, 955, 0, 952, 940, 947,
+
+ 944, 948, 949, 942, 939, 928, 927, 940, 943, 931,
+ 942, 938, 926, 932, 923, 338, 928, 931, 922, 929,
+ 918, 922, 913, 927, 926, 917, 923, 295, 907, 910,
+ 908, 907, 917, 907, 902, 900, 902, 912, 898, 900,
+ 897, 908, 907, 910, 892, 298, 900, 896, 894, 903,
+ 882, 349, 900, 902, 891, 883, 916, 354, 370, 368,
+ 383, 1090, 1090, 887, 878, 888, 887, 0, 885, 379,
+ 0, 0, 878, 876, 876, 877, 872, 880, 869, 886,
+ 875, 382, 0, 0, 869, 879, 878, 878, 0, 863,
+ 385, 0, 0, 865, 390, 872, 873, 864, 858, 857,
+
+ 858, 857, 857, 342, 393, 852, 0, 0, 848, 847,
+ 846, 848, 849, 854, 848, 844, 857, 852, 852, 850,
+ 849, 843, 837, 839, 838, 842, 847, 833, 836, 831,
+ 839, 844, 832, 829, 841, 832, 0, 0, 838, 834,
+ 0, 826, 826, 831, 822, 829, 396, 826, 0, 0,
+ 0, 0, 816, 828, 827, 814, 815, 824, 825, 825,
+ 0, 0, 0, 0, 812, 0, 820, 811, 0, 810,
+ 811, 805, 815, 0, 0, 0, 806, 0, 802, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 812, 400,
+ 811, 0, 0, 809, 805, 802, 846, 845, 0, 0,
+
+ 0, 792, 403, 409, 412, 797, 793, 798, 789, 787,
+ 800, 785, 0, 785, 798, 787, 783, 789, 784, 791,
+ 791, 0, 788, 785, 789, 773, 771, 774, 780, 786,
+ 781, 780, 768, 0, 770, 771, 0, 0, 0, 0,
+ 768, 771, 0, 765, 775, 766, 0, 776, 756, 765,
+ 760, 0, 753, 753, 766, 0, 768, 0, 418, 783,
+ 782, 781, 746, 745, 0, 762, 761, 756, 793, 784,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 743, 756, 743, 740, 0, 0, 745, 744, 0, 741,
+ 748, 747, 0, 733, 0, 0, 0, 0, 0, 730,
+
+ 0, 0, 729, 740, 423, 733, 739, 738, 735, 730,
+ 727, 747, 733, 718, 718, 731, 716, 728, 0, 0,
+ 721, 746, 745, 744, 709, 708, 233, 406, 0, 720,
+ 723, 721, 710, 706, 721, 0, 0, 717, 714, 713,
+ 703, 702, 692, 709, 695, 426, 703, 706, 0, 725,
+ 724, 723, 688, 687, 0, 701, 688, 0, 698, 691,
+ 683, 684, 690, 693, 0, 0, 0, 0, 715, 714,
+ 0, 689, 692, 677, 684, 675, 682, 683, 683, 682,
+ 668, 436, 679, 679, 0, 680, 669, 668, 0, 0,
+ 0, 695, 694, 693, 658, 657, 653, 661, 0, 691,
+
+ 690, 0, 665, 668, 0, 446, 0, 646, 667, 681,
+ 653, 0, 649, 648, 657, 657, 645, 659, 643, 657,
+ 652, 0, 0, 0, 671, 670, 669, 634, 633, 632,
+ 0, 632, 0, 0, 426, 434, 658, 642, 645, 628,
+ 640, 628, 627, 636, 636, 655, 654, 653, 618, 617,
+ 0, 622, 612, 615, 616, 615, 625, 0, 628, 624,
+ 626, 622, 609, 642, 442, 0, 617, 620, 610, 611,
+ 603, 610, 601, 624, 610, 606, 608, 606, 606, 605,
+ 0, 593, 592, 602, 0, 624, 445, 0, 599, 602,
+ 599, 584, 0, 600, 599, 583, 575, 583, 573, 581,
+
+ 0, 578, 577, 600, 586, 584, 584, 577, 567, 570,
+ 584, 568, 601, 579, 580, 577, 574, 586, 561, 575,
+ 574, 558, 557, 556, 579, 565, 563, 563, 566, 561,
+ 542, 541, 0, 571, 541, 569, 539, 543, 542, 575,
+ 553, 550, 0, 554, 548, 551, 547, 549, 532, 527,
+ 534, 516, 514, 507, 501, 489, 124, 0, 162, 250,
+ 289, 307, 327, 0, 329, 340, 0, 0, 366, 0,
+ 367, 0, 395, 396, 383, 382, 395, 401, 0, 398,
+ 408, 405, 416, 443, 423, 0, 0, 437, 438, 0,
+ 0, 439, 440, 426, 425, 428, 441, 433, 446, 447,
+
+ 426, 427, 435, 0, 0, 451, 461, 433, 463, 455,
+ 449, 437, 455, 449, 438, 439, 447, 0, 0, 478,
+ 464, 462, 463, 0, 0, 467, 456, 462, 0, 463,
+ 449, 472, 0, 460, 485, 0, 0, 475, 482, 467,
+ 465, 466, 458, 475, 482, 483, 0, 481, 465, 501,
+ 465, 496, 522, 470, 471, 0, 488, 490, 491, 482,
+ 0, 505, 0, 0, 513, 0, 0, 0, 485, 486,
+ 480, 0, 506, 482, 483, 0, 537, 0, 0, 510,
+ 521, 513, 516, 0, 1090, 556, 562, 568, 574, 578,
+ 584, 585, 591, 594
+
} ;
-static yyconst flex_int16_t yy_def[829] =
+static yyconst flex_int16_t yy_def[895] =
{ 0,
- 823, 1, 823, 3, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 824, 823, 823,
- 823, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 823, 823, 823, 823, 823, 823, 823, 825, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 826,
- 823, 827, 20, 21, 823, 823, 828, 823, 823, 823,
- 823, 823, 823, 823, 823, 824, 823, 823, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 823, 823, 825, 823, 823, 827, 823, 823, 823,
- 823, 823, 828, 823, 823, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 823,
- 823, 823, 823, 823, 823, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
-
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 824, 824, 824, 824, 824, 824, 824, 824,
- 824, 824, 0, 823, 823, 823, 823, 823
+ 885, 1, 885, 3, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 886, 885, 885, 885, 885, 885, 885, 887, 885, 885,
+ 885, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 885, 885, 885, 885, 885, 885, 885,
+ 888, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 889, 885, 890, 20, 886, 891, 885, 892, 885,
+ 885, 885, 885, 885, 885, 885, 885, 887, 885, 885,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 885, 885, 888, 893,
+ 885, 890, 894, 885, 885, 885, 891, 892, 885, 885,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 885, 893, 885,
+ 894, 885, 885, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 887, 887, 887, 887, 887, 887,
+ 887, 887, 887, 887, 0, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885
+
} ;
-static yyconst flex_int16_t yy_nxt[1094] =
+static yyconst flex_int16_t yy_nxt[1168] =
{ 0,
6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 21, 21, 21, 21,
- 21, 22, 23, 24, 25, 26, 27, 28, 28, 28,
+ 21, 21, 21, 21, 22, 23, 24, 25, 26, 27,
28, 28, 28, 28, 28, 28, 28, 28, 28, 28,
- 29, 30, 31, 28, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 28, 41, 42, 43, 44, 45, 46,
- 47, 48, 49, 50, 51, 28, 28, 28, 52, 53,
- 54, 55, 56, 57, 58, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 56,
- 56, 56, 56, 56, 56, 56, 56, 56, 56, 59,
-
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 59, 59, 56, 56, 56, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
- 56, 56, 56, 56, 61, 62, 63, 66, 68, 70,
- 70, 70, 70, 70, 70, 70, 84, 85, 79, 150,
- 123, 69, 67, 87, 124, 64, 72, 151, 73, 73,
- 73, 73, 73, 73, 74, 80, 89, 81, 82, 786,
- 92, 88, 93, 121, 95, 75, 94, 103, 96, 104,
- 90, 91, 76, 77, 97, 99, 122, 98, 105, 100,
-
- 115, 187, 75, 116, 101, 125, 117, 118, 152, 168,
- 102, 119, 188, 169, 120, 787, 76, 128, 126, 77,
- 72, 106, 74, 74, 74, 74, 74, 74, 74, 107,
- 112, 108, 129, 207, 109, 130, 212, 132, 113, 75,
- 110, 208, 213, 788, 133, 134, 76, 139, 135, 114,
- 140, 237, 238, 153, 136, 137, 75, 138, 141, 147,
- 143, 155, 156, 148, 144, 142, 158, 159, 145, 239,
- 76, 146, 149, 160, 823, 268, 269, 240, 155, 156,
- 161, 789, 161, 158, 159, 162, 162, 162, 162, 162,
- 162, 162, 189, 790, 176, 224, 215, 160, 177, 178,
-
- 823, 220, 230, 199, 228, 190, 200, 201, 225, 216,
- 202, 217, 203, 241, 246, 231, 247, 221, 222, 229,
- 250, 242, 250, 158, 159, 251, 251, 251, 251, 251,
- 251, 251, 299, 300, 301, 791, 792, 252, 793, 252,
- 158, 159, 253, 253, 253, 253, 253, 253, 253, 162,
- 162, 162, 162, 162, 162, 162, 162, 162, 162, 162,
- 162, 162, 162, 255, 262, 313, 550, 332, 794, 314,
- 339, 340, 341, 795, 254, 333, 551, 263, 251, 251,
- 251, 251, 251, 251, 251, 796, 797, 255, 350, 351,
- 352, 254, 251, 251, 251, 251, 251, 251, 251, 253,
-
- 253, 253, 253, 253, 253, 253, 362, 363, 364, 798,
- 156, 253, 253, 253, 253, 253, 253, 253, 370, 371,
- 372, 374, 375, 376, 385, 386, 387, 156, 799, 159,
- 424, 425, 426, 800, 444, 445, 446, 454, 455, 456,
- 457, 458, 459, 460, 461, 462, 159, 447, 448, 502,
- 503, 504, 528, 529, 530, 801, 802, 552, 567, 568,
- 569, 803, 505, 506, 804, 531, 532, 553, 598, 599,
- 600, 570, 571, 640, 572, 618, 619, 620, 670, 805,
- 806, 601, 602, 641, 642, 671, 807, 672, 621, 622,
- 690, 643, 808, 644, 645, 809, 810, 691, 811, 692,
-
- 812, 813, 814, 815, 816, 817, 818, 819, 820, 821,
- 822, 86, 86, 86, 154, 154, 154, 70, 157, 163,
- 163, 785, 784, 783, 782, 781, 780, 779, 778, 777,
- 776, 775, 774, 773, 772, 771, 770, 769, 768, 767,
- 766, 765, 764, 763, 762, 761, 760, 759, 758, 757,
- 756, 755, 754, 753, 752, 751, 750, 749, 748, 747,
- 746, 745, 744, 743, 742, 741, 740, 739, 738, 737,
- 736, 735, 734, 733, 732, 731, 730, 729, 728, 727,
- 726, 725, 724, 723, 722, 721, 720, 719, 718, 717,
- 716, 715, 714, 713, 712, 711, 710, 709, 708, 707,
-
- 706, 705, 704, 703, 702, 701, 700, 699, 698, 697,
- 696, 695, 694, 693, 689, 688, 687, 686, 685, 684,
- 683, 682, 681, 680, 679, 678, 677, 676, 675, 674,
- 673, 669, 668, 667, 666, 665, 664, 663, 662, 661,
- 660, 659, 658, 657, 656, 655, 654, 653, 652, 651,
- 650, 649, 648, 647, 646, 639, 638, 637, 636, 635,
- 634, 633, 632, 631, 630, 629, 628, 627, 626, 625,
- 624, 623, 617, 616, 615, 614, 613, 612, 611, 610,
- 609, 608, 607, 606, 605, 604, 603, 597, 596, 595,
- 594, 593, 592, 591, 590, 589, 588, 587, 586, 585,
-
- 584, 583, 582, 581, 580, 579, 578, 577, 576, 575,
- 574, 573, 566, 565, 564, 563, 562, 561, 560, 559,
- 558, 557, 556, 555, 554, 549, 548, 547, 546, 545,
- 544, 543, 542, 541, 540, 539, 538, 537, 536, 535,
- 534, 533, 527, 526, 525, 524, 523, 522, 521, 520,
- 519, 518, 517, 516, 515, 514, 513, 512, 511, 510,
- 509, 508, 507, 501, 500, 499, 498, 497, 496, 495,
- 494, 493, 492, 491, 490, 489, 488, 487, 486, 485,
- 484, 483, 482, 481, 480, 479, 478, 477, 476, 475,
- 474, 473, 472, 471, 470, 469, 468, 467, 466, 465,
-
- 464, 463, 453, 452, 451, 450, 449, 443, 442, 441,
- 440, 439, 438, 437, 436, 435, 434, 433, 432, 431,
- 430, 429, 428, 427, 423, 422, 421, 420, 419, 418,
- 417, 416, 415, 414, 413, 412, 411, 410, 409, 408,
- 407, 406, 405, 404, 403, 402, 401, 400, 399, 398,
- 397, 396, 395, 394, 393, 392, 391, 390, 389, 388,
- 384, 383, 382, 381, 380, 379, 378, 377, 373, 369,
- 368, 367, 366, 365, 361, 360, 359, 358, 357, 356,
- 355, 354, 353, 349, 348, 347, 346, 345, 344, 343,
- 342, 338, 337, 336, 335, 334, 331, 330, 329, 328,
-
- 327, 326, 325, 324, 323, 322, 321, 320, 319, 318,
- 317, 316, 315, 312, 311, 310, 309, 308, 307, 306,
- 305, 304, 303, 302, 298, 297, 296, 295, 294, 293,
- 292, 291, 290, 289, 288, 287, 286, 285, 284, 283,
- 282, 281, 280, 279, 278, 277, 276, 275, 274, 273,
- 272, 271, 270, 267, 266, 265, 264, 261, 260, 259,
- 258, 257, 256, 249, 248, 245, 244, 243, 236, 235,
- 234, 233, 232, 227, 226, 223, 219, 218, 214, 211,
- 210, 209, 206, 205, 204, 198, 197, 196, 195, 194,
- 193, 192, 191, 186, 185, 184, 183, 182, 181, 180,
-
- 179, 175, 174, 173, 172, 171, 170, 167, 166, 165,
- 164, 131, 127, 111, 83, 78, 71, 65, 60, 823,
- 5, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823
-
+ 28, 28, 28, 28, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 28, 42,
+ 43, 44, 45, 46, 47, 48, 49, 50, 51, 52,
+ 28, 53, 28, 54, 55, 56, 57, 58, 59, 60,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+ 58, 58, 58, 58, 58, 58, 58, 58, 58, 58,
+
+ 58, 58, 58, 58, 58, 58, 58, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 58, 58, 58, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 61, 61, 61, 61, 61, 61, 61, 61, 61, 61,
+ 58, 58, 58, 58, 63, 64, 65, 68, 70, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72, 72, 154,
+ 74, 81, 86, 87, 71, 69, 89, 155, 66, 74,
+ 157, 75, 75, 75, 75, 75, 75, 75, 75, 76,
+ 76, 82, 77, 83, 84, 791, 90, 95, 92, 96,
+
+ 78, 77, 127, 97, 98, 106, 128, 107, 99, 78,
+ 79, 77, 93, 94, 100, 102, 108, 101, 174, 103,
+ 77, 115, 175, 109, 104, 78, 792, 158, 125, 116,
+ 105, 110, 118, 111, 78, 119, 112, 79, 120, 121,
+ 117, 126, 113, 122, 123, 129, 124, 132, 193, 136,
+ 143, 151, 166, 144, 166, 152, 137, 138, 130, 194,
+ 139, 145, 133, 574, 153, 134, 140, 141, 146, 142,
+ 147, 160, 161, 575, 148, 163, 164, 214, 149, 165,
+ 885, 150, 182, 74, 195, 215, 183, 184, 222, 205,
+ 160, 161, 206, 207, 163, 164, 208, 196, 209, 227,
+
+ 219, 223, 235, 224, 165, 77, 220, 885, 231, 237,
+ 244, 245, 246, 78, 793, 228, 229, 236, 248, 794,
+ 247, 232, 238, 253, 77, 254, 249, 258, 263, 258,
+ 163, 164, 260, 885, 260, 885, 277, 278, 78, 167,
+ 167, 167, 167, 167, 167, 167, 167, 167, 167, 163,
+ 164, 271, 342, 263, 309, 310, 311, 323, 795, 262,
+ 343, 324, 397, 398, 272, 349, 350, 351, 259, 259,
+ 259, 259, 259, 259, 259, 259, 259, 259, 262, 885,
+ 796, 885, 261, 261, 261, 261, 261, 261, 261, 261,
+ 261, 261, 885, 797, 885, 362, 363, 364, 374, 375,
+
+ 376, 382, 383, 384, 798, 161, 386, 387, 388, 399,
+ 400, 401, 438, 439, 440, 460, 461, 462, 164, 472,
+ 473, 474, 799, 800, 161, 475, 476, 477, 478, 479,
+ 480, 463, 464, 522, 523, 524, 576, 164, 550, 551,
+ 552, 592, 593, 594, 801, 802, 577, 803, 804, 525,
+ 526, 625, 626, 627, 553, 554, 671, 595, 596, 805,
+ 597, 646, 647, 648, 673, 806, 672, 628, 629, 807,
+ 808, 674, 703, 675, 676, 724, 809, 649, 650, 704,
+ 810, 705, 725, 811, 726, 812, 813, 814, 815, 816,
+ 817, 818, 819, 820, 821, 822, 823, 824, 825, 826,
+
+ 827, 828, 829, 830, 831, 832, 833, 834, 835, 836,
+ 837, 838, 839, 840, 841, 842, 843, 844, 845, 846,
+ 847, 848, 849, 850, 851, 852, 853, 854, 855, 856,
+ 857, 858, 859, 860, 861, 862, 863, 864, 865, 866,
+ 867, 868, 869, 870, 871, 872, 873, 874, 875, 876,
+ 877, 878, 879, 880, 881, 882, 883, 884, 76, 76,
+ 790, 76, 789, 788, 76, 88, 88, 88, 88, 88,
+ 88, 159, 159, 159, 159, 159, 159, 72, 787, 72,
+ 72, 162, 786, 162, 162, 167, 785, 167, 168, 168,
+ 168, 168, 259, 784, 259, 261, 783, 261, 782, 781,
+
+ 780, 779, 778, 777, 776, 775, 774, 773, 772, 771,
+ 770, 769, 768, 767, 766, 765, 764, 763, 762, 761,
+ 760, 759, 758, 757, 756, 755, 754, 753, 752, 751,
+ 750, 749, 748, 747, 746, 745, 744, 743, 742, 741,
+ 740, 739, 738, 737, 736, 735, 734, 733, 732, 731,
+ 730, 729, 728, 727, 723, 722, 721, 720, 719, 718,
+ 717, 716, 715, 714, 713, 712, 711, 710, 709, 708,
+ 707, 706, 702, 701, 700, 699, 698, 697, 696, 695,
+ 694, 693, 692, 691, 690, 689, 688, 687, 686, 685,
+ 684, 683, 682, 681, 680, 679, 678, 677, 670, 669,
+
+ 668, 667, 666, 665, 664, 663, 662, 661, 660, 659,
+ 658, 657, 656, 655, 654, 653, 652, 651, 645, 644,
+ 643, 642, 641, 640, 639, 638, 637, 636, 635, 634,
+ 633, 632, 631, 630, 624, 623, 622, 621, 620, 619,
+ 618, 617, 616, 615, 614, 613, 612, 611, 610, 609,
+ 608, 607, 606, 605, 604, 603, 602, 601, 600, 599,
+ 598, 591, 590, 589, 588, 587, 586, 585, 584, 583,
+ 582, 581, 580, 579, 578, 573, 572, 571, 570, 569,
+ 568, 567, 566, 565, 564, 563, 562, 561, 560, 559,
+ 558, 557, 556, 555, 549, 548, 547, 546, 545, 544,
+
+ 543, 542, 541, 540, 539, 538, 537, 536, 535, 534,
+ 533, 532, 531, 530, 529, 528, 527, 521, 520, 519,
+ 518, 517, 516, 515, 514, 513, 512, 511, 510, 509,
+ 508, 507, 506, 505, 504, 503, 502, 501, 500, 499,
+ 498, 497, 496, 495, 494, 493, 492, 491, 490, 489,
+ 488, 487, 486, 485, 484, 483, 482, 481, 471, 470,
+ 469, 468, 467, 466, 465, 459, 458, 457, 456, 455,
+ 454, 453, 452, 451, 450, 449, 448, 447, 446, 445,
+ 444, 443, 442, 441, 437, 436, 435, 434, 433, 432,
+ 431, 430, 429, 428, 427, 426, 425, 424, 423, 422,
+
+ 421, 420, 419, 418, 417, 416, 415, 414, 413, 412,
+ 411, 410, 409, 408, 407, 406, 405, 404, 403, 402,
+ 396, 395, 394, 393, 392, 391, 390, 389, 385, 381,
+ 380, 379, 378, 377, 373, 372, 371, 370, 369, 368,
+ 367, 366, 365, 361, 360, 359, 358, 357, 356, 355,
+ 354, 353, 352, 348, 347, 346, 345, 344, 341, 340,
+ 339, 338, 337, 336, 335, 334, 333, 332, 331, 330,
+ 329, 328, 327, 326, 325, 322, 321, 320, 319, 318,
+ 317, 316, 315, 314, 313, 312, 308, 307, 306, 305,
+ 304, 303, 302, 301, 300, 299, 298, 297, 296, 295,
+
+ 294, 293, 292, 291, 290, 289, 288, 287, 286, 285,
+ 284, 283, 282, 281, 280, 279, 276, 275, 274, 273,
+ 270, 269, 268, 267, 266, 265, 264, 257, 256, 255,
+ 252, 251, 250, 243, 242, 241, 240, 239, 234, 233,
+ 230, 226, 225, 221, 218, 217, 216, 213, 212, 211,
+ 210, 204, 203, 202, 201, 200, 199, 198, 197, 192,
+ 191, 190, 189, 188, 187, 186, 185, 181, 180, 179,
+ 178, 177, 176, 173, 172, 171, 170, 169, 156, 135,
+ 131, 114, 91, 85, 80, 73, 67, 62, 885, 5,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885
} ;
-static yyconst flex_int16_t yy_chk[1094] =
+static yyconst flex_int16_t yy_chk[1168] =
{ 0,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@@ -874,7 +903,7 @@ static yyconst flex_int16_t yy_chk[1094] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 3, 3, 3, 3, 3, 3, 3, 3,
+ 1, 1, 1, 1, 1, 1, 1, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
@@ -882,116 +911,123 @@ static yyconst flex_int16_t yy_chk[1094] =
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 10, 10, 11, 15, 17, 18,
- 18, 18, 18, 18, 18, 18, 26, 26, 24, 51,
- 42, 17, 15, 31, 42, 11, 20, 51, 20, 20,
- 20, 20, 20, 20, 20, 24, 32, 24, 24, 768,
- 33, 31, 33, 41, 34, 20, 33, 36, 34, 36,
- 32, 32, 20, 20, 34, 35, 41, 34, 36, 35,
-
- 40, 107, 20, 40, 35, 43, 40, 40, 53, 91,
- 35, 40, 107, 91, 40, 769, 20, 45, 43, 20,
- 21, 37, 21, 21, 21, 21, 21, 21, 21, 37,
- 39, 37, 45, 122, 37, 45, 126, 47, 39, 21,
- 37, 122, 126, 770, 47, 47, 21, 48, 47, 39,
- 48, 143, 143, 53, 47, 47, 21, 47, 48, 50,
- 49, 70, 70, 50, 49, 48, 72, 72, 49, 144,
- 21, 49, 50, 73, 73, 178, 178, 144, 70, 70,
- 75, 771, 75, 72, 72, 75, 75, 75, 75, 75,
- 75, 75, 108, 772, 98, 133, 128, 73, 98, 98,
-
- 73, 131, 137, 118, 136, 108, 118, 118, 133, 128,
- 118, 128, 118, 145, 149, 137, 149, 131, 131, 136,
- 155, 145, 155, 157, 157, 155, 155, 155, 155, 155,
- 155, 155, 209, 209, 209, 773, 774, 158, 777, 158,
- 157, 157, 158, 158, 158, 158, 158, 158, 158, 161,
- 161, 161, 161, 161, 161, 161, 162, 162, 162, 162,
- 162, 162, 162, 163, 173, 221, 507, 239, 778, 221,
- 245, 245, 245, 781, 162, 239, 507, 173, 250, 250,
- 250, 250, 250, 250, 250, 782, 784, 163, 261, 261,
- 261, 162, 251, 251, 251, 251, 251, 251, 251, 252,
-
- 252, 252, 252, 252, 252, 252, 273, 273, 273, 785,
- 251, 253, 253, 253, 253, 253, 253, 253, 282, 282,
- 282, 286, 286, 286, 295, 295, 295, 251, 786, 253,
- 337, 337, 337, 788, 378, 378, 378, 389, 389, 389,
- 390, 390, 390, 391, 391, 391, 253, 378, 378, 443,
- 443, 443, 487, 487, 487, 789, 792, 508, 524, 524,
- 524, 793, 443, 443, 794, 487, 487, 508, 558, 558,
- 558, 524, 524, 607, 524, 581, 581, 581, 635, 795,
- 796, 558, 558, 607, 608, 635, 797, 635, 581, 581,
- 656, 608, 799, 608, 608, 800, 801, 656, 802, 656,
-
- 803, 804, 806, 807, 808, 810, 814, 815, 816, 818,
- 819, 824, 824, 824, 825, 825, 825, 826, 827, 828,
- 828, 767, 766, 765, 764, 761, 760, 759, 758, 757,
- 756, 755, 754, 753, 752, 749, 748, 745, 744, 743,
- 742, 741, 740, 738, 737, 736, 735, 734, 732, 730,
- 726, 725, 724, 723, 722, 720, 719, 718, 717, 716,
- 715, 714, 713, 712, 711, 710, 709, 708, 706, 705,
- 704, 703, 702, 701, 700, 699, 698, 696, 695, 694,
- 693, 692, 691, 690, 689, 688, 687, 686, 685, 684,
- 683, 682, 681, 680, 679, 678, 677, 676, 675, 674,
-
- 673, 672, 671, 670, 669, 667, 666, 665, 664, 663,
- 662, 661, 659, 658, 655, 653, 652, 651, 649, 648,
- 647, 646, 645, 644, 643, 642, 641, 640, 639, 638,
- 637, 634, 633, 632, 631, 630, 629, 627, 626, 625,
- 624, 622, 621, 620, 619, 618, 617, 616, 615, 614,
- 613, 612, 611, 610, 609, 604, 602, 601, 600, 599,
- 598, 594, 593, 592, 591, 590, 589, 588, 587, 586,
- 584, 583, 579, 578, 576, 575, 573, 572, 571, 570,
- 569, 568, 567, 563, 562, 561, 559, 557, 556, 555,
- 554, 553, 552, 551, 550, 549, 548, 546, 545, 540,
-
- 539, 538, 537, 535, 534, 532, 531, 530, 529, 528,
- 526, 525, 523, 522, 521, 520, 519, 518, 517, 516,
- 514, 513, 512, 511, 510, 506, 505, 504, 503, 502,
- 501, 498, 497, 496, 495, 494, 493, 492, 491, 490,
- 489, 488, 486, 485, 482, 476, 474, 473, 472, 470,
- 469, 466, 465, 464, 463, 452, 451, 450, 448, 447,
- 446, 445, 444, 441, 439, 438, 437, 435, 434, 433,
- 432, 430, 428, 427, 422, 421, 419, 418, 417, 416,
- 415, 414, 413, 412, 411, 410, 409, 407, 406, 405,
- 404, 403, 402, 401, 400, 398, 397, 396, 395, 394,
-
- 393, 392, 388, 384, 383, 382, 379, 377, 367, 365,
- 361, 360, 359, 358, 356, 355, 353, 348, 347, 346,
- 345, 344, 343, 338, 336, 335, 334, 333, 332, 330,
- 329, 326, 325, 324, 323, 322, 321, 320, 319, 318,
- 317, 316, 315, 314, 313, 312, 311, 310, 309, 308,
- 307, 306, 305, 304, 303, 302, 301, 300, 299, 296,
- 294, 293, 292, 291, 290, 289, 288, 287, 285, 281,
- 279, 278, 277, 276, 272, 271, 270, 269, 268, 267,
- 266, 265, 264, 260, 258, 257, 256, 249, 248, 247,
- 246, 244, 243, 242, 241, 240, 238, 237, 236, 235,
-
- 234, 233, 232, 231, 230, 229, 228, 227, 226, 225,
- 224, 223, 222, 220, 219, 218, 217, 216, 215, 214,
- 213, 212, 211, 210, 208, 207, 206, 205, 204, 203,
- 202, 201, 200, 199, 198, 197, 196, 195, 194, 193,
- 192, 190, 189, 188, 187, 186, 185, 184, 183, 182,
- 181, 180, 179, 177, 176, 175, 174, 172, 171, 170,
- 169, 168, 166, 151, 150, 148, 147, 146, 142, 141,
- 140, 139, 138, 135, 134, 132, 130, 129, 127, 125,
- 124, 123, 121, 120, 119, 117, 116, 114, 113, 112,
- 111, 110, 109, 106, 105, 104, 103, 102, 101, 100,
-
- 99, 97, 96, 95, 94, 93, 92, 90, 89, 85,
- 81, 46, 44, 38, 25, 22, 19, 14, 9, 5,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823, 823, 823, 823, 823, 823, 823, 823,
- 823, 823, 823
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 52,
+ 21, 24, 26, 26, 17, 15, 31, 52, 11, 20,
+ 55, 20, 20, 20, 20, 20, 20, 20, 20, 20,
+ 20, 24, 21, 24, 24, 757, 31, 34, 33, 34,
+
+ 21, 20, 43, 34, 35, 37, 43, 37, 35, 20,
+ 20, 21, 33, 33, 35, 36, 37, 35, 94, 36,
+ 20, 40, 94, 38, 36, 21, 759, 55, 42, 40,
+ 36, 38, 41, 38, 20, 41, 38, 20, 41, 41,
+ 40, 42, 38, 41, 41, 44, 41, 46, 110, 48,
+ 49, 51, 77, 49, 77, 51, 48, 48, 44, 110,
+ 48, 49, 46, 527, 51, 46, 48, 48, 49, 48,
+ 50, 72, 72, 527, 50, 74, 74, 126, 50, 75,
+ 75, 50, 101, 76, 111, 126, 101, 101, 132, 121,
+ 72, 72, 121, 121, 74, 74, 121, 111, 121, 135,
+
+ 130, 132, 140, 132, 75, 76, 130, 75, 137, 141,
+ 147, 147, 148, 76, 760, 135, 135, 140, 149, 761,
+ 148, 137, 141, 153, 76, 153, 149, 160, 168, 160,
+ 162, 162, 163, 167, 163, 167, 184, 184, 76, 166,
+ 166, 166, 166, 166, 166, 166, 166, 166, 166, 162,
+ 162, 179, 246, 168, 216, 216, 216, 228, 762, 167,
+ 246, 228, 304, 304, 179, 252, 252, 252, 258, 258,
+ 258, 258, 258, 258, 258, 258, 258, 258, 167, 259,
+ 763, 259, 260, 260, 260, 260, 260, 260, 260, 260,
+ 260, 260, 261, 765, 261, 270, 270, 270, 282, 282,
+
+ 282, 291, 291, 291, 766, 259, 295, 295, 295, 305,
+ 305, 305, 347, 347, 347, 390, 390, 390, 261, 403,
+ 403, 403, 769, 771, 259, 404, 404, 404, 405, 405,
+ 405, 390, 390, 459, 459, 459, 528, 261, 505, 505,
+ 505, 546, 546, 546, 773, 774, 528, 775, 776, 459,
+ 459, 582, 582, 582, 505, 505, 635, 546, 546, 777,
+ 546, 606, 606, 606, 636, 778, 635, 582, 582, 780,
+ 781, 636, 665, 636, 636, 687, 782, 606, 606, 665,
+ 783, 665, 687, 784, 687, 785, 788, 789, 792, 793,
+ 794, 795, 796, 797, 798, 799, 800, 801, 802, 803,
+
+ 806, 807, 808, 809, 810, 811, 812, 813, 814, 815,
+ 816, 817, 820, 821, 822, 823, 826, 827, 828, 830,
+ 831, 832, 834, 835, 838, 839, 840, 841, 842, 843,
+ 844, 845, 846, 848, 849, 850, 851, 852, 853, 854,
+ 855, 857, 858, 859, 860, 862, 865, 869, 870, 871,
+ 873, 874, 875, 877, 880, 881, 882, 883, 886, 886,
+ 756, 886, 755, 754, 886, 887, 887, 887, 887, 887,
+ 887, 888, 888, 888, 888, 888, 888, 889, 753, 889,
+ 889, 890, 752, 890, 890, 891, 751, 891, 892, 892,
+ 892, 892, 893, 750, 893, 894, 749, 894, 748, 747,
+
+ 746, 745, 744, 742, 741, 740, 739, 738, 737, 736,
+ 735, 734, 732, 731, 730, 729, 728, 727, 726, 725,
+ 724, 723, 722, 721, 720, 719, 718, 717, 716, 715,
+ 714, 713, 712, 711, 710, 709, 708, 707, 706, 705,
+ 704, 703, 702, 700, 699, 698, 697, 696, 695, 694,
+ 692, 691, 690, 689, 686, 684, 683, 682, 680, 679,
+ 678, 677, 676, 675, 674, 673, 672, 671, 670, 669,
+ 668, 667, 664, 663, 662, 661, 660, 659, 657, 656,
+ 655, 654, 653, 652, 650, 649, 648, 647, 646, 645,
+ 644, 643, 642, 641, 640, 639, 638, 637, 632, 630,
+
+ 629, 628, 627, 626, 625, 621, 620, 619, 618, 617,
+ 616, 615, 614, 613, 611, 610, 609, 608, 604, 603,
+ 601, 600, 598, 597, 596, 595, 594, 593, 592, 588,
+ 587, 586, 584, 583, 581, 580, 579, 578, 577, 576,
+ 575, 574, 573, 572, 570, 569, 564, 563, 562, 561,
+ 560, 559, 557, 556, 554, 553, 552, 551, 550, 548,
+ 547, 545, 544, 543, 542, 541, 540, 539, 538, 535,
+ 534, 533, 532, 531, 530, 526, 525, 524, 523, 522,
+ 521, 518, 517, 516, 515, 514, 513, 512, 511, 510,
+ 509, 508, 507, 506, 504, 503, 500, 494, 492, 491,
+
+ 490, 488, 487, 484, 483, 482, 481, 470, 469, 468,
+ 467, 466, 464, 463, 462, 461, 460, 457, 455, 454,
+ 453, 451, 450, 449, 448, 446, 445, 444, 442, 441,
+ 436, 435, 433, 432, 431, 430, 429, 428, 427, 426,
+ 425, 424, 423, 421, 420, 419, 418, 417, 416, 415,
+ 414, 412, 411, 410, 409, 408, 407, 406, 402, 398,
+ 397, 396, 395, 394, 391, 389, 379, 377, 373, 372,
+ 371, 370, 368, 367, 365, 360, 359, 358, 357, 356,
+ 355, 354, 353, 348, 346, 345, 344, 343, 342, 340,
+ 339, 336, 335, 334, 333, 332, 331, 330, 329, 328,
+ 327, 326, 325, 324, 323, 322, 321, 320, 319, 318,
+ 317, 316, 315, 314, 313, 312, 311, 310, 309, 306,
+ 303, 302, 301, 300, 299, 298, 297, 296, 294, 290,
+ 288, 287, 286, 285, 281, 280, 279, 278, 277, 276,
+ 275, 274, 273, 269, 267, 266, 265, 264, 257, 256,
+ 255, 254, 253, 251, 250, 249, 248, 247, 245, 244,
+ 243, 242, 241, 240, 239, 238, 237, 236, 235, 234,
+ 233, 232, 231, 230, 229, 227, 226, 225, 224, 223,
+ 222, 221, 220, 219, 218, 217, 215, 214, 213, 212,
+ 211, 210, 209, 208, 207, 206, 205, 204, 203, 202,
+
+ 201, 200, 199, 198, 196, 195, 194, 193, 192, 191,
+ 190, 189, 188, 187, 186, 185, 183, 182, 181, 180,
+ 178, 177, 176, 175, 174, 172, 171, 156, 155, 154,
+ 152, 151, 150, 146, 145, 144, 143, 142, 139, 138,
+ 136, 134, 133, 131, 129, 128, 127, 125, 124, 123,
+ 122, 120, 119, 117, 116, 115, 114, 113, 112, 109,
+ 108, 107, 106, 105, 104, 103, 102, 100, 99, 98,
+ 97, 96, 95, 93, 92, 91, 87, 83, 53, 47,
+ 45, 39, 32, 25, 22, 19, 14, 9, 5, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885, 885, 885, 885,
+ 885, 885, 885, 885, 885, 885, 885
} ;
/* Table of booleans, true if rule could match eol. */
-static yyconst flex_int32_t yy_rule_can_match_eol[242] =
+static yyconst flex_int32_t yy_rule_can_match_eol[247] =
{ 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -1004,8 +1040,8 @@ static yyconst flex_int32_t yy_rule_can_match_eol[242] =
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 0, 0, };
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 0, 0, };
/* The intent behind this definition is that it'll catch
* any uses of REJECT which flex missed.
@@ -1067,10 +1103,12 @@ static int ES2_ident_ES3_keyword(TParseContext *context, int token);
static int ES2_ident_ES3_reserved_ES3_1_keyword(TParseContext *context, int token);
static int ES2_and_ES3_reserved_ES3_1_keyword(TParseContext *context, int token);
static int ES2_and_ES3_ident_ES3_1_keyword(TParseContext *context, int token);
+static int ES3_extension_keyword_else_ident(TParseContext *context, const char *extension, int token);
static int uint_constant(TParseContext *context);
static int int_constant(TParseContext *context);
static int float_constant(yyscan_t yyscanner);
static int floatsuffix_check(TParseContext* context);
+static int yuvcscstandardext_constant(TParseContext *context);
#define INITIAL 0
#define FIELDS 1
@@ -1363,13 +1401,13 @@ yy_match:
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 824 )
+ if ( yy_current_state >= 886 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
++yy_cp;
}
- while ( yy_current_state != 823 );
+ while ( yy_current_state != 885 );
yy_cp = yyg->yy_last_accepting_cpos;
yy_current_state = yyg->yy_last_accepting_state;
@@ -1723,86 +1761,101 @@ YY_RULE_SETUP
YY_BREAK
case 81:
YY_RULE_SETUP
-{ return STRUCT; }
+{ return ES3_extension_keyword_else_ident(context, "GL_EXT_YUV_target", SAMPLEREXTERNAL2DY2YEXT); }
YY_BREAK
case 82:
YY_RULE_SETUP
-{ return ES2_ident_ES3_keyword(context, LAYOUT); }
+{ return STRUCT; }
YY_BREAK
case 83:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE2D); }
+{ return ES2_ident_ES3_keyword(context, LAYOUT); }
YY_BREAK
case 84:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE2D); }
+{ return ES3_extension_keyword_else_ident(context, "GL_EXT_YUV_target", YUVCSCSTANDARDEXT); }
YY_BREAK
case 85:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE2D); }
+{ return yuvcscstandardext_constant(context); }
YY_BREAK
case 86:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE2DARRAY); }
+{ return yuvcscstandardext_constant(context); }
YY_BREAK
case 87:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE2DARRAY); }
+{ return yuvcscstandardext_constant(context); }
YY_BREAK
case 88:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE2DARRAY); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE2D); }
YY_BREAK
case 89:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE3D); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE2D); }
YY_BREAK
case 90:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE3D); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE2D); }
YY_BREAK
case 91:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE3D); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE2DARRAY); }
YY_BREAK
case 92:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGECUBE); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE2DARRAY); }
YY_BREAK
case 93:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGECUBE); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE2DARRAY); }
YY_BREAK
case 94:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGECUBE); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGE3D); }
YY_BREAK
case 95:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, READONLY); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGE3D); }
YY_BREAK
case 96:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, WRITEONLY); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGE3D); }
YY_BREAK
case 97:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, COHERENT); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IIMAGECUBE); }
YY_BREAK
case 98:
YY_RULE_SETUP
-{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, RESTRICT); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, UIMAGECUBE); }
YY_BREAK
case 99:
YY_RULE_SETUP
-{ return ES2_and_ES3_reserved_ES3_1_keyword(context, VOLATILE); }
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, IMAGECUBE); }
YY_BREAK
-/* Reserved keywords for GLSL ES 3.00 that are not reserved for GLSL ES 1.00 */
case 100:
+YY_RULE_SETUP
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, READONLY); }
+ YY_BREAK
case 101:
+YY_RULE_SETUP
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, WRITEONLY); }
+ YY_BREAK
case 102:
+YY_RULE_SETUP
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, COHERENT); }
+ YY_BREAK
case 103:
+YY_RULE_SETUP
+{ return ES2_ident_ES3_reserved_ES3_1_keyword(context, RESTRICT); }
+ YY_BREAK
case 104:
+YY_RULE_SETUP
+{ return ES2_and_ES3_reserved_ES3_1_keyword(context, VOLATILE); }
+ YY_BREAK
+/* Reserved keywords for GLSL ES 3.00 that are not reserved for GLSL ES 1.00 */
case 105:
case 106:
case 107:
@@ -1835,6 +1888,11 @@ case 133:
case 134:
case 135:
case 136:
+case 137:
+case 138:
+case 139:
+case 140:
+case 141:
YY_RULE_SETUP
{
if (context->getShaderVersion() < 300) {
@@ -1845,7 +1903,7 @@ YY_RULE_SETUP
}
YY_BREAK
/* Reserved keywords in GLSL ES 1.00 that are not reserved in GLSL ES 3.00 */
-case 137:
+case 142:
YY_RULE_SETUP
{
if (context->getShaderVersion() >= 300)
@@ -1858,11 +1916,6 @@ YY_RULE_SETUP
}
YY_BREAK
/* Reserved keywords */
-case 138:
-case 139:
-case 140:
-case 141:
-case 142:
case 143:
case 144:
case 145:
@@ -1898,245 +1951,250 @@ case 174:
case 175:
case 176:
case 177:
+case 178:
+case 179:
+case 180:
+case 181:
+case 182:
YY_RULE_SETUP
{ return reserved_word(yyscanner); }
YY_BREAK
-case 178:
+case 183:
YY_RULE_SETUP
{
yylval->lex.string = NewPoolTString(yytext);
return check_type(yyscanner);
}
YY_BREAK
-case 179:
+case 184:
YY_RULE_SETUP
{ return int_constant(context); }
YY_BREAK
-case 180:
+case 185:
YY_RULE_SETUP
{ return int_constant(context); }
YY_BREAK
-case 181:
+case 186:
YY_RULE_SETUP
{ return int_constant(context); }
YY_BREAK
-case 182:
+case 187:
YY_RULE_SETUP
{ return uint_constant(context); }
YY_BREAK
-case 183:
+case 188:
YY_RULE_SETUP
{ return uint_constant(context); }
YY_BREAK
-case 184:
+case 189:
YY_RULE_SETUP
{ return uint_constant(context); }
YY_BREAK
-case 185:
+case 190:
YY_RULE_SETUP
{ return float_constant(yyscanner); }
YY_BREAK
-case 186:
+case 191:
YY_RULE_SETUP
{ return float_constant(yyscanner); }
YY_BREAK
-case 187:
+case 192:
YY_RULE_SETUP
{ return float_constant(yyscanner); }
YY_BREAK
-case 188:
+case 193:
YY_RULE_SETUP
{ return floatsuffix_check(context); }
YY_BREAK
-case 189:
+case 194:
YY_RULE_SETUP
{ return floatsuffix_check(context); }
YY_BREAK
-case 190:
+case 195:
YY_RULE_SETUP
{ return floatsuffix_check(context); }
YY_BREAK
-case 191:
+case 196:
YY_RULE_SETUP
{ return ADD_ASSIGN; }
YY_BREAK
-case 192:
+case 197:
YY_RULE_SETUP
{ return SUB_ASSIGN; }
YY_BREAK
-case 193:
+case 198:
YY_RULE_SETUP
{ return MUL_ASSIGN; }
YY_BREAK
-case 194:
+case 199:
YY_RULE_SETUP
{ return DIV_ASSIGN; }
YY_BREAK
-case 195:
+case 200:
YY_RULE_SETUP
{ return MOD_ASSIGN; }
YY_BREAK
-case 196:
+case 201:
YY_RULE_SETUP
{ return LEFT_ASSIGN; }
YY_BREAK
-case 197:
+case 202:
YY_RULE_SETUP
{ return RIGHT_ASSIGN; }
YY_BREAK
-case 198:
+case 203:
YY_RULE_SETUP
{ return AND_ASSIGN; }
YY_BREAK
-case 199:
+case 204:
YY_RULE_SETUP
{ return XOR_ASSIGN; }
YY_BREAK
-case 200:
+case 205:
YY_RULE_SETUP
{ return OR_ASSIGN; }
YY_BREAK
-case 201:
+case 206:
YY_RULE_SETUP
{ return INC_OP; }
YY_BREAK
-case 202:
+case 207:
YY_RULE_SETUP
{ return DEC_OP; }
YY_BREAK
-case 203:
+case 208:
YY_RULE_SETUP
{ return AND_OP; }
YY_BREAK
-case 204:
+case 209:
YY_RULE_SETUP
{ return OR_OP; }
YY_BREAK
-case 205:
+case 210:
YY_RULE_SETUP
{ return XOR_OP; }
YY_BREAK
-case 206:
+case 211:
YY_RULE_SETUP
{ return LE_OP; }
YY_BREAK
-case 207:
+case 212:
YY_RULE_SETUP
{ return GE_OP; }
YY_BREAK
-case 208:
+case 213:
YY_RULE_SETUP
{ return EQ_OP; }
YY_BREAK
-case 209:
+case 214:
YY_RULE_SETUP
{ return NE_OP; }
YY_BREAK
-case 210:
+case 215:
YY_RULE_SETUP
{ return LEFT_OP; }
YY_BREAK
-case 211:
+case 216:
YY_RULE_SETUP
{ return RIGHT_OP; }
YY_BREAK
-case 212:
+case 217:
YY_RULE_SETUP
{ return SEMICOLON; }
YY_BREAK
-case 213:
+case 218:
YY_RULE_SETUP
{ return LEFT_BRACE; }
YY_BREAK
-case 214:
+case 219:
YY_RULE_SETUP
{ return RIGHT_BRACE; }
YY_BREAK
-case 215:
+case 220:
YY_RULE_SETUP
{ return COMMA; }
YY_BREAK
-case 216:
+case 221:
YY_RULE_SETUP
{ return COLON; }
YY_BREAK
-case 217:
+case 222:
YY_RULE_SETUP
{ return EQUAL; }
YY_BREAK
-case 218:
+case 223:
YY_RULE_SETUP
{ return LEFT_PAREN; }
YY_BREAK
-case 219:
+case 224:
YY_RULE_SETUP
{ return RIGHT_PAREN; }
YY_BREAK
-case 220:
+case 225:
YY_RULE_SETUP
{ return LEFT_BRACKET; }
YY_BREAK
-case 221:
+case 226:
YY_RULE_SETUP
{ return RIGHT_BRACKET; }
YY_BREAK
-case 222:
+case 227:
YY_RULE_SETUP
{ BEGIN(FIELDS); return DOT; }
YY_BREAK
-case 223:
+case 228:
YY_RULE_SETUP
{ return BANG; }
YY_BREAK
-case 224:
+case 229:
YY_RULE_SETUP
{ return DASH; }
YY_BREAK
-case 225:
+case 230:
YY_RULE_SETUP
{ return TILDE; }
YY_BREAK
-case 226:
+case 231:
YY_RULE_SETUP
{ return PLUS; }
YY_BREAK
-case 227:
+case 232:
YY_RULE_SETUP
{ return STAR; }
YY_BREAK
-case 228:
+case 233:
YY_RULE_SETUP
{ return SLASH; }
YY_BREAK
-case 229:
+case 234:
YY_RULE_SETUP
{ return PERCENT; }
YY_BREAK
-case 230:
+case 235:
YY_RULE_SETUP
{ return LEFT_ANGLE; }
YY_BREAK
-case 231:
+case 236:
YY_RULE_SETUP
{ return RIGHT_ANGLE; }
YY_BREAK
-case 232:
+case 237:
YY_RULE_SETUP
{ return VERTICAL_BAR; }
YY_BREAK
-case 233:
+case 238:
YY_RULE_SETUP
{ return CARET; }
YY_BREAK
-case 234:
+case 239:
YY_RULE_SETUP
{ return AMPERSAND; }
YY_BREAK
-case 235:
+case 240:
YY_RULE_SETUP
{ return QUESTION; }
YY_BREAK
-case 236:
+case 241:
YY_RULE_SETUP
{
BEGIN(INITIAL);
@@ -2144,19 +2202,19 @@ YY_RULE_SETUP
return FIELD_SELECTION;
}
YY_BREAK
-case 237:
+case 242:
YY_RULE_SETUP
{}
YY_BREAK
-case 238:
+case 243:
YY_RULE_SETUP
{
yyextra->error(*yylloc, "Illegal character at fieldname start", yytext);
return 0;
}
YY_BREAK
-case 239:
-/* rule 239 can match eol */
+case 244:
+/* rule 244 can match eol */
YY_RULE_SETUP
{ }
YY_BREAK
@@ -2164,11 +2222,11 @@ case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(FIELDS):
{ yyterminate(); }
YY_BREAK
-case 240:
+case 245:
YY_RULE_SETUP
{ assert(false); return 0; }
YY_BREAK
-case 241:
+case 246:
YY_RULE_SETUP
ECHO;
YY_BREAK
@@ -2467,7 +2525,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 824 )
+ if ( yy_current_state >= 886 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
@@ -2496,11 +2554,11 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
{
yy_current_state = (int) yy_def[yy_current_state];
- if ( yy_current_state >= 824 )
+ if ( yy_current_state >= 886 )
yy_c = yy_meta[(unsigned int) yy_c];
}
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
- yy_is_jam = (yy_current_state == 823);
+ yy_is_jam = (yy_current_state == 885);
(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
@@ -3440,6 +3498,21 @@ int ES2_and_ES3_ident_ES3_1_keyword(TParseContext *context, int token)
return token;
}
+int ES3_extension_keyword_else_ident(TParseContext *context, const char* extension, int token)
+{
+ struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
+ yyscan_t yyscanner = (yyscan_t) context->getScanner();
+
+ // a reserved word in GLSL ES 3.00 with enabled extension, otherwise could be used as an identifier/type name
+ if (context->getShaderVersion() >= 300 && context->isExtensionEnabled(extension))
+ {
+ return token;
+ }
+
+ yylval->lex.string = NewPoolTString(yytext);
+ return check_type(yyscanner);
+}
+
int uint_constant(TParseContext *context)
{
struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
@@ -3501,6 +3574,22 @@ int float_constant(yyscan_t yyscanner) {
return FLOATCONSTANT;
}
+int yuvcscstandardext_constant(TParseContext *context)
+{
+ struct yyguts_t* yyg = (struct yyguts_t*) context->getScanner();
+ yyscan_t yyscanner = (yyscan_t) context->getScanner();
+
+ // a reserved word in GLSL ES 3.00 with enabled extension, otherwise could be used as an identifier/type name
+ if (context->getShaderVersion() >= 300 && context->isExtensionEnabled("GL_EXT_YUV_target"))
+ {
+ yylval->lex.string = NewPoolTString(yytext);
+ return YUVCSCSTANDARDEXTCONSTANT;
+ }
+
+ yylval->lex.string = NewPoolTString(yytext);
+ return check_type(yyscanner);
+}
+
int glslang_initialize(TParseContext* context) {
yyscan_t scanner = NULL;
if (yylex_init_extra(context,&scanner))
diff --git a/chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp b/chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp
index b6f1a04c12f..41f7cdf9695 100644
--- a/chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp
@@ -218,71 +218,74 @@ extern int yydebug;
SAMPLER2DSHADOW = 336,
SAMPLERCUBESHADOW = 337,
SAMPLER2DARRAYSHADOW = 338,
- IMAGE2D = 339,
- IIMAGE2D = 340,
- UIMAGE2D = 341,
- IMAGE3D = 342,
- IIMAGE3D = 343,
- UIMAGE3D = 344,
- IMAGE2DARRAY = 345,
- IIMAGE2DARRAY = 346,
- UIMAGE2DARRAY = 347,
- IMAGECUBE = 348,
- IIMAGECUBE = 349,
- UIMAGECUBE = 350,
- LAYOUT = 351,
- IDENTIFIER = 352,
- TYPE_NAME = 353,
- FLOATCONSTANT = 354,
- INTCONSTANT = 355,
- UINTCONSTANT = 356,
- BOOLCONSTANT = 357,
- FIELD_SELECTION = 358,
- LEFT_OP = 359,
- RIGHT_OP = 360,
- INC_OP = 361,
- DEC_OP = 362,
- LE_OP = 363,
- GE_OP = 364,
- EQ_OP = 365,
- NE_OP = 366,
- AND_OP = 367,
- OR_OP = 368,
- XOR_OP = 369,
- MUL_ASSIGN = 370,
- DIV_ASSIGN = 371,
- ADD_ASSIGN = 372,
- MOD_ASSIGN = 373,
- LEFT_ASSIGN = 374,
- RIGHT_ASSIGN = 375,
- AND_ASSIGN = 376,
- XOR_ASSIGN = 377,
- OR_ASSIGN = 378,
- SUB_ASSIGN = 379,
- LEFT_PAREN = 380,
- RIGHT_PAREN = 381,
- LEFT_BRACKET = 382,
- RIGHT_BRACKET = 383,
- LEFT_BRACE = 384,
- RIGHT_BRACE = 385,
- DOT = 386,
- COMMA = 387,
- COLON = 388,
- EQUAL = 389,
- SEMICOLON = 390,
- BANG = 391,
- DASH = 392,
- TILDE = 393,
- PLUS = 394,
- STAR = 395,
- SLASH = 396,
- PERCENT = 397,
- LEFT_ANGLE = 398,
- RIGHT_ANGLE = 399,
- VERTICAL_BAR = 400,
- CARET = 401,
- AMPERSAND = 402,
- QUESTION = 403
+ SAMPLEREXTERNAL2DY2YEXT = 339,
+ IMAGE2D = 340,
+ IIMAGE2D = 341,
+ UIMAGE2D = 342,
+ IMAGE3D = 343,
+ IIMAGE3D = 344,
+ UIMAGE3D = 345,
+ IMAGE2DARRAY = 346,
+ IIMAGE2DARRAY = 347,
+ UIMAGE2DARRAY = 348,
+ IMAGECUBE = 349,
+ IIMAGECUBE = 350,
+ UIMAGECUBE = 351,
+ LAYOUT = 352,
+ YUVCSCSTANDARDEXT = 353,
+ YUVCSCSTANDARDEXTCONSTANT = 354,
+ IDENTIFIER = 355,
+ TYPE_NAME = 356,
+ FLOATCONSTANT = 357,
+ INTCONSTANT = 358,
+ UINTCONSTANT = 359,
+ BOOLCONSTANT = 360,
+ FIELD_SELECTION = 361,
+ LEFT_OP = 362,
+ RIGHT_OP = 363,
+ INC_OP = 364,
+ DEC_OP = 365,
+ LE_OP = 366,
+ GE_OP = 367,
+ EQ_OP = 368,
+ NE_OP = 369,
+ AND_OP = 370,
+ OR_OP = 371,
+ XOR_OP = 372,
+ MUL_ASSIGN = 373,
+ DIV_ASSIGN = 374,
+ ADD_ASSIGN = 375,
+ MOD_ASSIGN = 376,
+ LEFT_ASSIGN = 377,
+ RIGHT_ASSIGN = 378,
+ AND_ASSIGN = 379,
+ XOR_ASSIGN = 380,
+ OR_ASSIGN = 381,
+ SUB_ASSIGN = 382,
+ LEFT_PAREN = 383,
+ RIGHT_PAREN = 384,
+ LEFT_BRACKET = 385,
+ RIGHT_BRACKET = 386,
+ LEFT_BRACE = 387,
+ RIGHT_BRACE = 388,
+ DOT = 389,
+ COMMA = 390,
+ COLON = 391,
+ EQUAL = 392,
+ SEMICOLON = 393,
+ BANG = 394,
+ DASH = 395,
+ TILDE = 396,
+ PLUS = 397,
+ STAR = 398,
+ SLASH = 399,
+ PERCENT = 400,
+ LEFT_ANGLE = 401,
+ RIGHT_ANGLE = 402,
+ VERTICAL_BAR = 403,
+ CARET = 404,
+ AMPERSAND = 405,
+ QUESTION = 406
};
#endif
@@ -666,23 +669,23 @@ union yyalloc
#endif /* !YYCOPY_NEEDED */
/* YYFINAL -- State number of the termination state. */
-#define YYFINAL 130
+#define YYFINAL 132
/* YYLAST -- Last index in YYTABLE. */
-#define YYLAST 2916
+#define YYLAST 2993
/* YYNTOKENS -- Number of terminals. */
-#define YYNTOKENS 149
+#define YYNTOKENS 152
/* YYNNTS -- Number of nonterminals. */
#define YYNNTS 94
/* YYNRULES -- Number of rules. */
-#define YYNRULES 291
+#define YYNRULES 294
/* YYNSTATES -- Number of states. */
-#define YYNSTATES 427
+#define YYNSTATES 430
/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
by yylex, with out-of-bounds checking. */
#define YYUNDEFTOK 2
-#define YYMAXUTOK 403
+#define YYMAXUTOK 406
#define YYTRANSLATE(YYX) \
((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
@@ -731,43 +734,43 @@ static const yytype_uint8 yytranslate[] =
115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
125, 126, 127, 128, 129, 130, 131, 132, 133, 134,
135, 136, 137, 138, 139, 140, 141, 142, 143, 144,
- 145, 146, 147, 148
+ 145, 146, 147, 148, 149, 150, 151
};
#if YYDEBUG
/* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
static const yytype_uint16 yyrline[] =
{
- 0, 246, 246, 247, 250, 260, 263, 268, 273, 278,
- 283, 289, 292, 295, 298, 301, 304, 310, 317, 323,
- 327, 335, 338, 344, 348, 355, 360, 367, 375, 381,
- 387, 396, 399, 402, 405, 415, 416, 417, 418, 426,
- 427, 430, 433, 440, 441, 444, 450, 451, 455, 462,
- 463, 466, 469, 472, 478, 479, 482, 488, 489, 496,
- 497, 504, 505, 512, 513, 519, 520, 526, 527, 533,
- 534, 540, 541, 548, 549, 550, 551, 555, 556, 557,
- 561, 565, 569, 573, 580, 583, 589, 596, 603, 606,
- 609, 618, 622, 626, 630, 634, 641, 648, 651, 658,
- 666, 686, 696, 704, 729, 733, 737, 741, 748, 755,
- 758, 762, 766, 771, 776, 783, 787, 791, 795, 800,
- 805, 812, 816, 822, 825, 831, 835, 842, 848, 852,
- 856, 859, 862, 871, 877, 885, 888, 908, 927, 934,
- 938, 942, 945, 948, 951, 954, 957, 965, 972, 975,
- 978, 984, 991, 994, 1000, 1003, 1006, 1009, 1015, 1018,
- 1023, 1034, 1037, 1040, 1043, 1046, 1049, 1053, 1057, 1061,
- 1065, 1069, 1073, 1077, 1081, 1085, 1089, 1093, 1097, 1101,
- 1105, 1109, 1113, 1117, 1121, 1125, 1129, 1133, 1136, 1139,
- 1142, 1145, 1148, 1151, 1154, 1157, 1160, 1163, 1166, 1169,
- 1172, 1175, 1178, 1181, 1184, 1187, 1194, 1200, 1203, 1206,
- 1209, 1212, 1215, 1218, 1221, 1224, 1227, 1230, 1233, 1236,
- 1239, 1251, 1251, 1254, 1254, 1260, 1263, 1269, 1272, 1279,
- 1283, 1289, 1295, 1307, 1311, 1315, 1316, 1322, 1323, 1324,
- 1325, 1326, 1327, 1328, 1332, 1333, 1333, 1333, 1342, 1343,
- 1347, 1347, 1348, 1348, 1353, 1356, 1365, 1370, 1377, 1378,
- 1382, 1389, 1393, 1400, 1400, 1407, 1410, 1417, 1421, 1434,
- 1434, 1439, 1439, 1445, 1445, 1453, 1456, 1462, 1465, 1471,
- 1475, 1482, 1485, 1488, 1491, 1494, 1503, 1509, 1515, 1518,
- 1524, 1524
+ 0, 248, 248, 249, 252, 262, 265, 270, 275, 280,
+ 285, 293, 299, 302, 305, 308, 311, 314, 320, 327,
+ 333, 337, 345, 348, 354, 358, 365, 370, 377, 385,
+ 391, 397, 406, 409, 412, 415, 425, 426, 427, 428,
+ 436, 437, 440, 443, 450, 451, 454, 460, 461, 465,
+ 472, 473, 476, 479, 482, 488, 489, 492, 498, 499,
+ 506, 507, 514, 515, 522, 523, 529, 530, 536, 537,
+ 543, 544, 550, 551, 558, 559, 560, 561, 565, 566,
+ 567, 571, 575, 579, 583, 590, 593, 599, 606, 613,
+ 616, 619, 628, 632, 636, 640, 644, 651, 658, 661,
+ 668, 676, 696, 706, 714, 739, 743, 747, 751, 758,
+ 765, 768, 772, 776, 781, 786, 793, 797, 801, 805,
+ 810, 815, 822, 826, 832, 835, 841, 845, 852, 858,
+ 862, 866, 869, 872, 881, 887, 895, 898, 918, 937,
+ 944, 948, 952, 955, 958, 961, 964, 967, 975, 982,
+ 985, 988, 994, 1001, 1004, 1010, 1013, 1016, 1019, 1025,
+ 1028, 1033, 1044, 1047, 1050, 1053, 1056, 1059, 1063, 1067,
+ 1071, 1075, 1079, 1083, 1087, 1091, 1095, 1099, 1103, 1107,
+ 1111, 1115, 1119, 1123, 1127, 1131, 1135, 1139, 1143, 1149,
+ 1152, 1155, 1158, 1161, 1164, 1167, 1170, 1173, 1176, 1179,
+ 1182, 1185, 1188, 1191, 1194, 1197, 1200, 1203, 1210, 1216,
+ 1222, 1225, 1228, 1231, 1234, 1237, 1240, 1243, 1246, 1249,
+ 1252, 1255, 1258, 1261, 1273, 1273, 1276, 1276, 1282, 1285,
+ 1291, 1294, 1301, 1305, 1311, 1317, 1329, 1333, 1337, 1338,
+ 1344, 1345, 1346, 1347, 1348, 1349, 1350, 1354, 1355, 1355,
+ 1355, 1364, 1365, 1369, 1369, 1370, 1370, 1375, 1378, 1387,
+ 1392, 1399, 1400, 1404, 1411, 1415, 1422, 1422, 1429, 1432,
+ 1439, 1443, 1456, 1456, 1461, 1461, 1467, 1467, 1475, 1478,
+ 1484, 1487, 1493, 1497, 1504, 1507, 1510, 1513, 1516, 1525,
+ 1531, 1537, 1540, 1546, 1546
};
#endif
@@ -791,10 +794,11 @@ static const char *const yytname[] =
"ISAMPLERCUBE", "ISAMPLER2DARRAY", "USAMPLER2D", "USAMPLER3D",
"USAMPLERCUBE", "USAMPLER2DARRAY", "SAMPLER2DMS", "ISAMPLER2DMS",
"USAMPLER2DMS", "SAMPLER3D", "SAMPLER3DRECT", "SAMPLER2DSHADOW",
- "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "IMAGE2D", "IIMAGE2D",
- "UIMAGE2D", "IMAGE3D", "IIMAGE3D", "UIMAGE3D", "IMAGE2DARRAY",
- "IIMAGE2DARRAY", "UIMAGE2DARRAY", "IMAGECUBE", "IIMAGECUBE",
- "UIMAGECUBE", "LAYOUT", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
+ "SAMPLERCUBESHADOW", "SAMPLER2DARRAYSHADOW", "SAMPLEREXTERNAL2DY2YEXT",
+ "IMAGE2D", "IIMAGE2D", "UIMAGE2D", "IMAGE3D", "IIMAGE3D", "UIMAGE3D",
+ "IMAGE2DARRAY", "IIMAGE2DARRAY", "UIMAGE2DARRAY", "IMAGECUBE",
+ "IIMAGECUBE", "UIMAGECUBE", "LAYOUT", "YUVCSCSTANDARDEXT",
+ "YUVCSCSTANDARDEXTCONSTANT", "IDENTIFIER", "TYPE_NAME", "FLOATCONSTANT",
"INTCONSTANT", "UINTCONSTANT", "BOOLCONSTANT", "FIELD_SELECTION",
"LEFT_OP", "RIGHT_OP", "INC_OP", "DEC_OP", "LE_OP", "GE_OP", "EQ_OP",
"NE_OP", "AND_OP", "OR_OP", "XOR_OP", "MUL_ASSIGN", "DIV_ASSIGN",
@@ -858,16 +862,17 @@ static const yytype_uint16 yytoknum[] =
365, 366, 367, 368, 369, 370, 371, 372, 373, 374,
375, 376, 377, 378, 379, 380, 381, 382, 383, 384,
385, 386, 387, 388, 389, 390, 391, 392, 393, 394,
- 395, 396, 397, 398, 399, 400, 401, 402, 403
+ 395, 396, 397, 398, 399, 400, 401, 402, 403, 404,
+ 405, 406
};
# endif
-#define YYPACT_NINF -375
+#define YYPACT_NINF -368
#define yypact_value_is_default(Yystate) \
- (!!((Yystate) == (-375)))
+ (!!((Yystate) == (-368)))
-#define YYTABLE_NINF -251
+#define YYTABLE_NINF -254
#define yytable_value_is_error(Yytable_value) \
0
@@ -876,49 +881,49 @@ static const yytype_uint16 yytoknum[] =
STATE-NUM. */
static const yytype_int16 yypact[] =
{
- 2544, -375, -375, -375, -375, 102, -375, -375, -375, -375,
- -375, -375, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, -375, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, -375, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, -375, -375, -375, -375, -375, -375, -76, -375, -375,
- -375, -375, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, -375, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, -375, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, -101, -375, -375, -92, -75, -52, 2640, -97, -375,
- -12, -375, 1332, -375, -375, -375, -375, -375, -375, -375,
- -79, -375, 2448, -375, -375, 2818, -375, -375, -375, -59,
- -41, -375, -38, -375, 2640, -375, -375, -375, 2640, 43,
- 43, -375, -5, -102, -109, -375, 2640, -375, -375, 1423,
- -375, -375, 8, 2640, -375, -375, 1, -72, -375, 411,
- -375, -375, -375, -375, 3, -98, -375, 1542, 1896, -375,
- -375, 2640, 43, 2130, -375, 27, -375, -375, -375, -375,
- -375, 1896, 1896, 1896, -375, -375, -375, -375, -375, -375,
- -375, -43, -375, -375, -375, 45, -49, 2012, 55, -375,
- 1896, 26, -71, -11, -62, 38, 39, 42, 40, 75,
- 77, -86, -375, 61, -375, -375, 2236, 2640, 54, -375,
- -41, 57, 58, -375, 70, 78, 65, 1661, 79, 1896,
- 69, 80, 76, -375, -375, 41, -375, -375, -57, -375,
- -92, 82, -375, -375, -375, -375, 548, -375, -375, -375,
- -375, -375, -375, 1896, 1777, 1896, 74, 81, -375, -375,
- 43, 83, -4, -375, -78, -375, -375, -375, -37, -375,
- -375, 1896, 2729, -375, -375, 1896, 85, -375, -375, -375,
- 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
- 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896, 1896,
- -375, -375, 2342, -375, -375, -375, -375, -375, 86, -375,
- 1896, -375, -375, -3, 1896, 84, -375, -375, -375, 685,
- -375, -375, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, 1896, 1896, -375, -375, -375, 88, 87, 90, -375,
- 1896, 89, 2, 1896, 43, -375, -104, -375, -375, 91,
- 92, -375, 95, -375, -375, -375, -375, -375, 26, 26,
- -71, -71, -11, -11, -11, -11, -62, -62, 38, 39,
- 42, 40, 75, 77, 37, -375, 160, -38, 959, 1096,
- -36, -375, -23, -375, 1214, 685, -375, -375, -375, 1896,
- 93, -375, 1896, -375, 97, -375, 1896, -375, -375, 1896,
- 103, -375, -375, -375, -375, 1214, 86, -375, 92, 43,
- 2640, 104, 99, -375, 1896, -375, -375, 108, -375, 1896,
- -375, 105, 111, 221, -375, 110, 112, 822, -375, -375,
- 107, -22, 1896, 822, 86, -375, 1896, -375, -375, -375,
- -375, 109, 92, -375, -375, -375, -375
+ 2609, -368, -368, -368, -368, 142, -368, -368, -368, -368,
+ -368, -368, -368, -368, -368, -368, -368, -368, -368, -368,
+ -368, -368, -368, -368, -368, -368, -368, -368, -368, -368,
+ -368, -368, -368, -368, -368, -368, -368, -368, -368, -368,
+ -368, -368, -368, -368, -368, -368, -368, -80, -368, -368,
+ -368, -368, -368, -368, -368, -368, -368, -368, -368, -368,
+ -368, -368, -368, -368, -368, -368, -368, -368, -368, -368,
+ -368, -368, -368, -368, -368, -368, -368, -368, -368, -368,
+ -368, -368, -68, -368, -368, -368, -69, -56, -50, 2708,
+ -95, -368, -75, -368, 1364, -368, -368, -368, -368, -368,
+ -368, -368, -37, -368, 2510, -368, -368, 2892, -368, -368,
+ -368, -22, -43, -368, -17, -368, 2708, -368, -368, -368,
+ 2708, 29, 29, -368, -20, -103, -96, -368, 2708, -368,
+ -368, 1458, -368, -368, -32, 2708, -368, -368, -15, -65,
+ -368, 422, -368, -368, -368, -368, 9, -99, -368, 1580,
+ 1943, -368, -368, 2708, 29, 2183, -368, -368, 24, -368,
+ -368, -368, -368, -368, 1943, 1943, 1943, -368, -368, -368,
+ -368, -368, -368, -368, -38, -368, -368, -368, 35, -48,
+ 2062, 26, -368, 1943, 6, -89, 49, -67, 23, 18,
+ 22, 27, 57, 60, -93, -368, 47, -368, -368, 2292,
+ 2708, 55, -368, -43, 41, 42, -368, 53, 56, 48,
+ 1702, 61, 1943, 52, 62, 50, -368, -368, 98, -368,
+ -368, -73, -368, -69, 64, -368, -368, -368, -368, 562,
+ -368, -368, -368, -368, -368, -368, 1943, 1821, 1943, 58,
+ 54, -368, -368, 29, 63, -52, -368, -82, -368, -368,
+ -368, -47, -368, -368, 1943, 2800, -368, -368, 1943, 67,
+ -368, -368, -368, 1943, 1943, 1943, 1943, 1943, 1943, 1943,
+ 1943, 1943, 1943, 1943, 1943, 1943, 1943, 1943, 1943, 1943,
+ 1943, 1943, 1943, -368, -368, 2401, -368, -368, -368, -368,
+ -368, 65, -368, 1943, -368, -368, -40, 1943, 66, -368,
+ -368, -368, 702, -368, -368, -368, -368, -368, -368, -368,
+ -368, -368, -368, -368, 1943, 1943, -368, -368, -368, 70,
+ 68, 72, -368, 1943, 69, -12, 1943, 29, -368, -106,
+ -368, -368, 76, 73, -368, 83, -368, -368, -368, -368,
+ -368, 6, 6, -89, -89, 49, 49, 49, 49, -67,
+ -67, 23, 18, 22, 27, 57, 60, 25, -368, 151,
+ -17, 982, 1122, -45, -368, -26, -368, 1243, 702, -368,
+ -368, -368, 1943, 78, -368, 1943, -368, 95, -368, 1943,
+ -368, -368, 1943, 99, -368, -368, -368, -368, 1243, 65,
+ -368, 73, 29, 2708, 101, 103, -368, 1943, -368, -368,
+ 106, -368, 1943, -368, 94, 109, 222, -368, 108, 105,
+ 842, -368, -368, 107, -24, 1943, 842, 65, -368, 1943,
+ -368, -368, -368, -368, 110, 73, -368, -368, -368, -368
};
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
@@ -926,79 +931,79 @@ static const yytype_int16 yypact[] =
means the default is an error. */
static const yytype_uint16 yydefact[] =
{
- 0, 127, 148, 149, 150, 0, 133, 135, 165, 162,
- 163, 164, 169, 170, 171, 172, 173, 174, 166, 167,
- 168, 175, 176, 177, 178, 179, 180, 136, 137, 138,
- 140, 134, 181, 182, 183, 184, 185, 186, 139, 124,
- 123, 141, 142, 143, 144, 145, 146, 0, 161, 187,
- 189, 205, 206, 190, 192, 193, 194, 195, 197, 198,
- 199, 200, 191, 196, 201, 188, 202, 203, 204, 208,
- 209, 210, 211, 212, 213, 214, 215, 216, 217, 218,
- 219, 0, 220, 289, 290, 0, 98, 97, 0, 109,
- 115, 131, 0, 132, 125, 128, 121, 130, 129, 147,
- 158, 207, 0, 286, 288, 0, 2, 3, 223, 0,
- 0, 88, 0, 96, 0, 105, 99, 107, 0, 108,
- 0, 89, 2, 116, 0, 94, 0, 126, 122, 0,
- 1, 287, 0, 0, 221, 157, 154, 0, 152, 0,
- 291, 100, 104, 106, 102, 110, 101, 0, 0, 87,
- 95, 0, 0, 0, 225, 4, 8, 6, 7, 9,
- 30, 0, 0, 0, 159, 37, 36, 38, 35, 5,
- 11, 31, 13, 18, 19, 0, 0, 24, 0, 39,
- 0, 43, 46, 49, 54, 57, 59, 61, 63, 65,
- 67, 69, 86, 0, 28, 90, 0, 0, 0, 151,
- 0, 0, 0, 271, 0, 0, 0, 0, 0, 0,
- 0, 0, 245, 254, 258, 39, 71, 84, 0, 234,
- 0, 147, 237, 256, 236, 235, 0, 238, 239, 240,
- 241, 242, 243, 0, 0, 0, 0, 0, 233, 120,
- 0, 231, 0, 229, 0, 226, 32, 33, 0, 15,
- 16, 0, 0, 22, 21, 0, 161, 25, 27, 34,
+ 0, 128, 149, 150, 151, 0, 134, 136, 166, 163,
+ 164, 165, 170, 171, 172, 173, 174, 175, 167, 168,
+ 169, 176, 177, 178, 179, 180, 181, 137, 138, 139,
+ 141, 135, 182, 183, 184, 185, 186, 187, 140, 125,
+ 124, 142, 143, 144, 145, 146, 147, 0, 162, 189,
+ 191, 207, 209, 192, 194, 195, 196, 197, 199, 200,
+ 201, 202, 193, 198, 203, 190, 204, 205, 206, 208,
+ 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,
+ 221, 222, 0, 188, 223, 292, 293, 0, 99, 98,
+ 0, 110, 116, 132, 0, 133, 126, 129, 122, 131,
+ 130, 148, 159, 210, 0, 289, 291, 0, 2, 3,
+ 226, 0, 0, 89, 0, 97, 0, 106, 100, 108,
+ 0, 109, 0, 90, 2, 117, 0, 95, 0, 127,
+ 123, 0, 1, 290, 0, 0, 224, 158, 155, 0,
+ 153, 0, 294, 101, 105, 107, 103, 111, 102, 0,
+ 0, 88, 96, 0, 0, 0, 228, 10, 4, 8,
+ 6, 7, 9, 31, 0, 0, 0, 160, 38, 37,
+ 39, 36, 5, 12, 32, 14, 19, 20, 0, 0,
+ 25, 0, 40, 0, 44, 47, 50, 55, 58, 60,
+ 62, 64, 66, 68, 70, 87, 0, 29, 91, 0,
+ 0, 0, 152, 0, 0, 0, 274, 0, 0, 0,
+ 0, 0, 0, 0, 0, 248, 257, 261, 40, 72,
+ 85, 0, 237, 0, 148, 240, 259, 239, 238, 0,
+ 241, 242, 243, 244, 245, 246, 0, 0, 0, 0,
+ 0, 236, 121, 0, 234, 0, 232, 0, 229, 33,
+ 34, 0, 16, 17, 0, 0, 23, 22, 0, 162,
+ 26, 28, 35, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 160, 224, 0, 155, 156, 153, 282, 281, 252, 273,
- 0, 285, 283, 0, 0, 0, 266, 269, 244, 0,
- 74, 75, 77, 76, 79, 80, 81, 82, 83, 78,
- 73, 0, 0, 259, 255, 257, 0, 0, 0, 114,
- 0, 117, 0, 0, 0, 227, 0, 91, 10, 0,
- 17, 29, 14, 20, 26, 40, 41, 42, 45, 44,
- 47, 48, 52, 53, 50, 51, 55, 56, 58, 60,
- 62, 64, 66, 68, 0, 222, 0, 0, 0, 0,
- 0, 284, 0, 265, 0, 246, 72, 85, 103, 0,
- 111, 118, 0, 228, 0, 230, 0, 92, 12, 0,
- 0, 251, 253, 276, 275, 278, 252, 263, 267, 0,
- 0, 0, 0, 112, 0, 119, 232, 0, 70, 0,
- 277, 0, 0, 262, 260, 0, 0, 0, 247, 113,
- 0, 0, 279, 0, 252, 264, 0, 249, 270, 248,
- 93, 0, 280, 274, 261, 268, 272
+ 0, 0, 0, 161, 227, 0, 156, 157, 154, 285,
+ 284, 255, 276, 0, 288, 286, 0, 0, 0, 269,
+ 272, 247, 0, 75, 76, 78, 77, 80, 81, 82,
+ 83, 84, 79, 74, 0, 0, 262, 258, 260, 0,
+ 0, 0, 115, 0, 118, 0, 0, 0, 230, 0,
+ 92, 11, 0, 18, 30, 15, 21, 27, 41, 42,
+ 43, 46, 45, 48, 49, 53, 54, 51, 52, 56,
+ 57, 59, 61, 63, 65, 67, 69, 0, 225, 0,
+ 0, 0, 0, 0, 287, 0, 268, 0, 249, 73,
+ 86, 104, 0, 112, 119, 0, 231, 0, 233, 0,
+ 93, 13, 0, 0, 254, 256, 279, 278, 281, 255,
+ 266, 270, 0, 0, 0, 0, 113, 0, 120, 235,
+ 0, 71, 0, 280, 0, 0, 265, 263, 0, 0,
+ 0, 250, 114, 0, 0, 282, 0, 255, 267, 0,
+ 252, 273, 251, 94, 0, 283, 277, 264, 271, 275
};
/* YYPGOTO[NTERM-NUM]. */
static const yytype_int16 yypgoto[] =
{
- -375, -46, -375, -375, -375, -375, -375, -375, -7, -375,
- -375, -375, -375, 52, -375, -87, -82, -145, -93, -25,
- -24, -21, -19, -26, -20, -375, -88, -138, -375, -152,
- -133, -375, 9, 17, -375, -375, -375, 134, 139, 137,
- -375, -375, -327, -375, -81, -375, -90, -375, -84, 254,
- -375, -375, 62, 0, -375, -375, -375, -375, -118, -146,
- 23, -60, -222, -94, -221, -342, -139, -375, -375, -144,
- -374, -375, -375, -108, -32, -91, -375, -375, -375, -375,
- -375, -115, -375, -375, -375, -375, -375, -375, -375, -375,
- -375, 169, -375, -375
+ -368, -46, -368, -368, -368, -368, -368, -368, -9, -368,
+ -368, -368, -368, 45, -368, -104, -102, -139, -105, -33,
+ -27, -25, -28, -21, -29, -368, -112, -141, -368, -155,
+ -135, -368, 10, 17, -368, -368, -368, 134, 139, 138,
+ -368, -368, -339, -368, -81, -368, -90, -368, -87, 256,
+ -368, -368, 59, 0, -368, -368, -368, -368, -122, -140,
+ 20, -63, -232, -97, -224, -349, -142, -368, -368, -148,
+ -367, -368, -368, -111, -31, -92, -368, -368, -368, -368,
+ -368, -119, -368, -368, -368, -368, -368, -368, -368, -368,
+ -368, 168, -368, -368
};
/* YYDEFGOTO[NTERM-NUM]. */
static const yytype_int16 yydefgoto[] =
{
- -1, 241, 169, 170, 171, 329, 172, 173, 174, 175,
- 176, 177, 178, 215, 180, 181, 182, 183, 184, 185,
- 186, 187, 188, 189, 190, 191, 216, 217, 311, 218,
- 193, 126, 219, 220, 85, 86, 87, 115, 116, 117,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 137, 138, 194, 100, 101, 197, 133, 153, 154,
- 242, 243, 239, 222, 223, 224, 225, 299, 392, 418,
- 356, 357, 358, 419, 226, 227, 228, 404, 229, 405,
- 230, 391, 231, 364, 288, 359, 385, 401, 402, 232,
- 102, 103, 104, 112
+ -1, 244, 172, 173, 174, 332, 175, 176, 177, 178,
+ 179, 180, 181, 218, 183, 184, 185, 186, 187, 188,
+ 189, 190, 191, 192, 193, 194, 219, 220, 314, 221,
+ 196, 128, 222, 223, 87, 88, 89, 117, 118, 119,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, 99,
+ 100, 139, 140, 197, 102, 103, 200, 135, 155, 156,
+ 245, 246, 242, 225, 226, 227, 228, 302, 395, 421,
+ 359, 360, 361, 422, 229, 230, 231, 407, 232, 408,
+ 233, 394, 234, 367, 291, 362, 388, 404, 405, 235,
+ 104, 105, 106, 114
};
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
@@ -1006,385 +1011,353 @@ static const yytype_int16 yydefgoto[] =
number is the opposite. If YYTABLE_NINF, syntax error. */
static const yytype_int16 yytable[] =
{
- 99, 109, 127, 119, 140, 315, 118, 245, 128, 83,
- 238, 248, 403, 319, 237, 196, 382, 84, 135, 326,
- 149, 106, 107, 376, 110, 147, 150, 278, 127, 234,
- 119, 377, 148, 118, 119, 120, 235, 389, 121, 257,
- 424, 192, 152, 111, 123, 151, 267, 268, 129, 152,
- 245, 113, 151, 108, 199, 293, 136, 327, 389, 192,
- 200, 127, 279, 249, 250, 417, 263, 240, 264, 152,
- 134, 417, 151, 144, 145, 312, 295, 254, 313, 282,
- 114, 269, 270, 255, 251, 122, 107, 99, 252, 328,
- 386, 139, 99, 265, 266, 312, 312, 238, 371, 330,
- 316, 318, 99, 387, 421, 132, 2, 3, 4, 312,
- 312, 83, 152, 152, 99, 151, 151, 334, 99, 84,
- 146, 192, 342, 343, 344, 345, 99, 354, 324, 312,
- 233, 325, 361, 99, 324, 198, 245, 373, 360, 221,
- 106, 107, 362, 195, 315, 192, 192, 393, 271, 272,
- 395, 99, -29, 99, 283, 284, 300, 301, 302, 303,
- 304, 305, 306, 307, 308, 309, 260, 261, 262, 312,
- 379, 253, 409, 366, 367, 310, 338, 339, 346, 347,
- 258, 179, 238, 340, 341, 275, 273, 276, 274, 280,
- 374, 277, 286, 287, 425, 289, 99, 99, 152, 179,
- 291, 151, 296, 290, 294, 297, 298, -28, 320, 321,
- 323, -23, 388, 246, 247, -250, 368, 363, 370, 378,
- -30, 369, 380, 372, 312, 396, 221, 394, 399, 408,
- 407, 238, 259, 388, 238, 192, 410, 413, 414, 212,
- 412, 398, 420, 397, 426, 333, 416, 411, 348, 381,
- 349, 352, 142, 141, 350, 143, 238, 351, 353, 105,
- 422, 179, 285, 322, 375, 383, 415, 365, 384, 423,
- 400, 131, 0, 0, 0, 0, 0, 0, 238, 0,
- 0, 0, 99, 390, 0, 179, 179, 0, 192, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 221,
- 127, 0, 0, 0, 390, 0, 128, 0, 0, 0,
- 0, 0, 335, 336, 337, 179, 179, 179, 179, 179,
- 179, 179, 179, 179, 179, 179, 179, 179, 179, 179,
- 179, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 406, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 221, 221,
- 0, 0, 0, 0, 221, 221, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 179, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 221, 0, 0, 0, 0,
- 99, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 221, 0, 0,
- 0, 0, 0, 221, 1, 2, 3, 4, 5, 6,
- 7, 8, 9, 10, 11, 201, 202, 203, 179, 204,
- 205, 206, 207, 208, 209, 210, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 211, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 81, 155, 82,
- 156, 157, 158, 159, 160, 0, 0, 161, 162, 0,
+ 101, 111, 121, 142, 129, 318, 322, 130, 120, 241,
+ 85, 251, 385, 199, 240, 248, 137, 86, 329, 195,
+ 108, 109, 406, 281, 379, 124, 109, 149, 392, 121,
+ 129, 237, 380, 121, 150, 120, 151, 195, 238, 260,
+ 122, 154, 152, 123, 270, 271, 125, 153, 154, 392,
+ 427, 266, 110, 267, 153, 296, 330, 138, 282, 248,
+ 112, 420, 315, 129, 202, 316, 243, 420, 154, 113,
+ 203, 252, 253, 115, 153, 146, 147, 298, 285, 272,
+ 273, 257, 331, 327, 389, 116, 328, 258, 315, 101,
+ 315, 374, 254, 131, 101, 315, 255, 241, 364, 333,
+ 195, 319, 321, 390, 101, 424, 198, 134, 148, 315,
+ 136, 315, 154, 154, 85, 141, 101, 337, 153, 153,
+ 101, 86, 201, 327, 195, 195, 376, 357, 101, 108,
+ 109, 345, 346, 347, 348, 101, 274, 275, 363, 236,
+ 396, 224, 365, 398, 318, 248, 2, 3, 4, 263,
+ 264, 265, -30, 101, 261, 101, 268, 269, 286, 287,
+ 315, 382, 341, 342, 256, 412, 343, 344, 276, 349,
+ 350, 277, 279, 369, 370, 278, 182, 280, 283, 289,
+ 290, 292, 241, 301, 293, 324, 294, 428, 299, 297,
+ 300, 377, -29, 326, 182, 323, -24, -253, 154, 101,
+ 101, 371, 366, 373, 153, 372, 375, 381, 315, 249,
+ 250, -31, 391, 383, 195, 397, 303, 304, 305, 306,
+ 307, 308, 309, 310, 311, 312, 399, 402, 262, 224,
+ 410, 241, 415, 391, 241, 313, 411, 413, 416, 417,
+ 215, 401, 419, 351, 400, 423, 336, 414, 429, 384,
+ 352, 354, 356, 353, 144, 143, 241, 182, 145, 355,
+ 425, 107, 288, 325, 378, 386, 418, 195, 426, 403,
+ 387, 368, 133, 0, 0, 0, 0, 0, 241, 0,
+ 0, 182, 182, 0, 0, 101, 393, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 163, 0, 0, 0,
- 212, 213, 0, 0, 0, 0, 214, 165, 166, 167,
- 168, 1, 2, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 201, 202, 203, 0, 204, 205, 206, 207,
- 208, 209, 210, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 211, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 0, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 155, 82, 156, 157, 158,
- 159, 160, 0, 0, 161, 162, 0, 0, 0, 0,
+ 0, 0, 224, 129, 0, 0, 130, 393, 338, 339,
+ 340, 182, 182, 182, 182, 182, 182, 182, 182, 182,
+ 182, 182, 182, 182, 182, 182, 182, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 163, 0, 0, 0, 212, 314, 0,
- 0, 0, 0, 214, 165, 166, 167, 168, 1, 2,
- 3, 4, 5, 6, 7, 8, 9, 10, 11, 201,
- 202, 203, 0, 204, 205, 206, 207, 208, 209, 210,
- 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 211, 49, 50,
- 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 0, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- 80, 81, 155, 82, 156, 157, 158, 159, 160, 0,
- 0, 161, 162, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 409, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 163, 0, 0, 0, 212, 0, 0, 0, 0, 0,
- 214, 165, 166, 167, 168, 1, 2, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 201, 202, 203, 0,
- 204, 205, 206, 207, 208, 209, 210, 12, 13, 14,
+ 0, 224, 224, 0, 0, 0, 0, 224, 224, 0,
+ 0, 182, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 224, 0,
+ 0, 0, 0, 101, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 224, 0, 0, 0, 0, 0, 224, 0, 0, 0,
+ 0, 0, 0, 0, 182, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 204, 205, 206, 0,
+ 207, 208, 209, 210, 211, 212, 213, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 211, 49, 50, 51, 52, 53,
+ 45, 46, 47, 48, 214, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 155,
- 82, 156, 157, 158, 159, 160, 0, 0, 161, 162,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 163, 0, 0,
- 0, 139, 0, 0, 0, 0, 0, 214, 165, 166,
- 167, 168, 1, 2, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 201, 202, 203, 0, 204, 205, 206,
- 207, 208, 209, 210, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
- 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
- 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 211, 49, 50, 51, 52, 53, 54, 55, 56,
- 57, 58, 59, 60, 61, 62, 63, 64, 65, 0,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 81, 155, 82, 156, 157,
- 158, 159, 160, 0, 0, 161, 162, 0, 0, 0,
+ 166, 0, 0, 0, 215, 216, 0, 0, 0, 0,
+ 217, 168, 169, 170, 171, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 204, 205, 206, 0,
+ 207, 208, 209, 210, 211, 212, 213, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 214, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 163, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 214, 165, 166, 167, 168, 1,
- 2, 3, 4, 5, 6, 7, 8, 9, 10, 11,
+ 166, 0, 0, 0, 215, 317, 0, 0, 0, 0,
+ 217, 168, 169, 170, 171, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 204, 205, 206, 0,
+ 207, 208, 209, 210, 211, 212, 213, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 214, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 0, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 0, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, 80, 81, 155, 82, 156, 157, 158, 159, 160,
- 0, 0, 161, 162, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 1, 2, 3,
- 4, 163, 6, 7, 8, 9, 10, 11, 0, 0,
- 0, 214, 165, 166, 167, 168, 0, 0, 0, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 0, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 0, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
- 81, 155, 82, 156, 157, 158, 159, 160, 0, 0,
- 161, 162, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 1, 2, 3, 4, 163,
+ 166, 0, 0, 0, 215, 0, 0, 0, 0, 0,
+ 217, 168, 169, 170, 171, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 204, 205, 206, 0,
+ 207, 208, 209, 210, 211, 212, 213, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 214, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 166, 0, 0, 0, 141, 0, 0, 0, 0, 0,
+ 217, 168, 169, 170, 171, 1, 2, 3, 4, 5,
+ 6, 7, 8, 9, 10, 11, 204, 205, 206, 0,
+ 207, 208, 209, 210, 211, 212, 213, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 214, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 166, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 217, 168, 169, 170, 171, 1, 2, 3, 4, 5,
6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
- 165, 166, 167, 168, 0, 0, 0, 12, 13, 14,
+ 0, 0, 0, 0, 0, 0, 0, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 0, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 124,
- 82, 0, 0, 8, 9, 10, 11, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 12, 13,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 2, 3, 4,
+ 166, 6, 7, 8, 9, 10, 11, 0, 0, 0,
+ 217, 168, 169, 170, 171, 0, 0, 0, 12, 13,
14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 0, 0, 0, 0, 125, 32, 33,
- 34, 35, 36, 37, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 47, 48, 0, 49, 50, 51, 52,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 0, 49, 50, 51, 52,
53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
63, 64, 65, 0, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, 80, 0,
- 155, 82, 156, 157, 158, 159, 160, 0, 0, 161,
- 162, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 163, 0,
- 0, 164, 8, 9, 10, 11, 0, 0, 0, 165,
- 166, 167, 168, 0, 0, 0, 0, 12, 13, 14,
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
+ 82, 83, 157, 158, 84, 159, 160, 161, 162, 163,
+ 0, 0, 164, 165, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 1, 2, 3,
+ 4, 166, 6, 7, 8, 9, 10, 11, 0, 0,
+ 0, 0, 168, 169, 170, 171, 0, 0, 0, 12,
+ 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
+ 43, 44, 45, 46, 47, 48, 0, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 65, 0, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
+ 81, 82, 83, 0, 126, 84, 0, 0, 8, 9,
+ 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
+ 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
+ 0, 0, 127, 32, 33, 34, 35, 36, 37, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 47, 48,
+ 0, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 0, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, 80, 81, 0, 83, 157, 158, 84,
+ 159, 160, 161, 162, 163, 0, 0, 164, 165, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 166, 0, 0, 167,
+ 8, 9, 10, 11, 0, 0, 0, 168, 169, 170,
+ 171, 0, 0, 0, 0, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 0, 0, 0, 0, 0, 32, 33, 34, 35, 36,
+ 37, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 48, 0, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 0, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 0, 83, 157,
+ 158, 84, 159, 160, 161, 162, 163, 0, 0, 164,
+ 165, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 166, 0,
+ 0, 239, 8, 9, 10, 11, 0, 0, 0, 168,
+ 169, 170, 171, 0, 0, 0, 0, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 0, 0, 0, 0, 0, 32, 33, 34,
35, 36, 37, 0, 0, 0, 0, 0, 0, 0,
0, 0, 47, 48, 0, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 0, 155,
- 82, 156, 157, 158, 159, 160, 0, 0, 161, 162,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 0,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 163, 0, 0,
- 236, 8, 9, 10, 11, 0, 0, 0, 165, 166,
- 167, 168, 0, 0, 0, 0, 12, 13, 14, 15,
+ 166, 8, 9, 10, 11, 0, 0, 0, 0, 0,
+ 295, 168, 169, 170, 171, 0, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
26, 0, 0, 0, 0, 0, 32, 33, 34, 35,
36, 37, 0, 0, 0, 0, 0, 0, 0, 0,
0, 47, 48, 0, 49, 50, 51, 52, 53, 54,
55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, 80, 0, 155, 82,
- 156, 157, 158, 159, 160, 0, 0, 161, 162, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 163, 8, 9, 10,
- 11, 0, 0, 0, 0, 0, 292, 165, 166, 167,
- 168, 0, 12, 13, 14, 15, 16, 17, 18, 19,
- 20, 21, 22, 23, 24, 25, 26, 0, 0, 0,
- 0, 0, 32, 33, 34, 35, 36, 37, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 47, 48, 0,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 0, 66, 67,
- 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
- 78, 79, 80, 0, 155, 82, 156, 157, 158, 159,
- 160, 0, 0, 161, 162, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 163, 0, 0, 317, 8, 9, 10, 11,
- 0, 0, 0, 165, 166, 167, 168, 0, 0, 0,
- 0, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 0, 0, 0, 0,
- 0, 32, 33, 34, 35, 36, 37, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 47, 48, 0, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 0, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, 80, 0, 155, 82, 156, 157, 158, 159, 160,
- 0, 0, 161, 162, 0, 0, 0, 0, 0, 0,
+ 74, 75, 76, 77, 78, 79, 80, 81, 0, 83,
+ 157, 158, 84, 159, 160, 161, 162, 163, 0, 0,
+ 164, 165, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 166,
+ 0, 0, 320, 8, 9, 10, 11, 0, 0, 0,
+ 168, 169, 170, 171, 0, 0, 0, 0, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 0, 0, 0, 0, 0, 32, 33,
+ 34, 35, 36, 37, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 47, 48, 0, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 63, 64, 65, 0, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
+ 0, 83, 157, 158, 84, 159, 160, 161, 162, 163,
+ 0, 0, 164, 165, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 163, 8, 9, 10, 11, 0, 0, 0, 0,
- 0, 0, 165, 166, 167, 168, 0, 12, 13, 14,
+ 0, 166, 8, 9, 10, 11, 0, 0, 0, 0,
+ 0, 0, 168, 169, 170, 171, 0, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 0, 0, 0, 0, 0, 32, 33, 34,
35, 36, 37, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 47, 256, 0, 49, 50, 51, 52, 53,
+ 0, 0, 47, 259, 0, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 0, 155,
- 82, 156, 157, 158, 159, 160, 0, 0, 161, 162,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 1, 2, 3, 4, 163, 6, 7,
- 8, 9, 10, 11, 0, 0, 0, 0, 165, 166,
- 167, 168, 0, 0, 0, 12, 13, 14, 15, 16,
- 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
- 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
- 47, 48, 0, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
- 0, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 0, 82, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
- 2, 3, 4, 0, 6, 7, 8, 9, 10, 11,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 244, 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 0, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, 62, 63, 64, 65, 0, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, 80, 81, 0, 82, 0, 0, 0, 0, 0,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 0,
+ 83, 157, 158, 84, 159, 160, 161, 162, 163, 0,
+ 0, 164, 165, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 1, 2, 3, 4,
+ 166, 6, 7, 8, 9, 10, 11, 0, 0, 0,
+ 0, 168, 169, 170, 171, 0, 0, 0, 12, 13,
+ 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,
+ 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
+ 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
+ 44, 45, 46, 47, 48, 0, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
+ 63, 64, 65, 0, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
+ 82, 83, 0, 0, 84, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 2, 3, 4, 0,
6, 7, 8, 9, 10, 11, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 281, 12, 13, 14,
+ 0, 0, 0, 0, 0, 0, 247, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
45, 46, 47, 48, 0, 49, 50, 51, 52, 53,
54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, 80, 81, 0,
- 82, 0, 0, 0, 0, 0, 0, 0, 130, 0,
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
- 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 355, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 0, 49, 50, 51, 52, 53, 54, 55, 56, 57,
- 58, 59, 60, 61, 62, 63, 64, 65, 0, 66,
- 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 81, 0, 82, 1, 2, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 12,
- 13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
- 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, 40, 41, 42,
- 43, 44, 45, 46, 47, 48, 0, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 0, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 76, 77, 78, 79, 80,
- 81, 0, 82, 1, 2, 3, 4, 0, 6, 7,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 82,
+ 83, 0, 0, 84, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 1, 2, 3, 4, 0, 6,
+ 7, 8, 9, 10, 11, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 284, 12, 13, 14, 15,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 0, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 0, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 77, 78, 79, 80, 81, 82, 83,
+ 0, 0, 84, 0, 0, 0, 0, 0, 0, 0,
+ 132, 0, 0, 1, 2, 3, 4, 5, 6, 7,
8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 12, 13, 14, 15, 16,
+ 0, 0, 0, 0, 358, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
47, 48, 0, 49, 50, 51, 52, 53, 54, 55,
56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
0, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, 80, 81, 0, 82, 8,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 0,
+ 0, 84, 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 12, 13, 14, 15, 16, 17,
- 18, 19, 20, 21, 22, 23, 24, 25, 26, 0,
- 0, 0, 0, 0, 32, 33, 34, 35, 36, 37,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 47,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 0, 49, 50, 51, 52, 53, 54, 55, 56,
57, 58, 59, 60, 61, 62, 63, 64, 65, 0,
66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, 80, 0, 331, 82, 8, 9,
- 10, 11, 332, 0, 0, 0, 0, 0, 0, 0,
+ 76, 77, 78, 79, 80, 81, 82, 83, 0, 0,
+ 84, 1, 2, 3, 4, 0, 6, 7, 8, 9,
+ 10, 11, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 12, 13, 14, 15, 16, 17, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 0, 0,
- 0, 0, 0, 32, 33, 34, 35, 36, 37, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 47, 48,
+ 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
0, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 0, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
- 77, 78, 79, 80, 0, 0, 82
+ 77, 78, 79, 80, 81, 82, 83, 0, 0, 84,
+ 8, 9, 10, 11, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 0, 0, 0, 0, 0, 32, 33, 34, 35, 36,
+ 37, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 47, 48, 0, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
+ 0, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 0, 83, 0,
+ 334, 84, 8, 9, 10, 11, 335, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 0, 0, 0, 0, 0, 32, 33, 34,
+ 35, 36, 37, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 47, 48, 0, 49, 50, 51, 52, 53,
+ 54, 55, 56, 57, 58, 59, 60, 61, 62, 63,
+ 64, 65, 0, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 81, 0,
+ 83, 0, 0, 84
};
static const yytype_int16 yycheck[] =
{
- 0, 47, 92, 87, 112, 226, 87, 153, 92, 0,
- 148, 163, 386, 235, 147, 133, 358, 0, 59, 97,
- 129, 97, 98, 127, 125, 127, 135, 113, 118, 127,
- 114, 135, 134, 114, 118, 132, 134, 364, 135, 177,
- 414, 129, 126, 135, 90, 126, 108, 109, 127, 133,
- 196, 126, 133, 129, 126, 207, 97, 135, 385, 147,
- 132, 151, 148, 106, 107, 407, 137, 151, 139, 153,
- 129, 413, 153, 119, 120, 132, 209, 126, 135, 197,
- 132, 143, 144, 132, 127, 97, 98, 87, 131, 126,
- 126, 129, 92, 104, 105, 132, 132, 235, 320, 251,
- 233, 234, 102, 126, 126, 105, 4, 5, 6, 132,
- 132, 102, 196, 197, 114, 196, 197, 255, 118, 102,
- 125, 209, 267, 268, 269, 270, 126, 279, 132, 132,
- 127, 135, 135, 133, 132, 134, 282, 135, 290, 139,
- 97, 98, 294, 135, 365, 233, 234, 369, 110, 111,
- 372, 151, 125, 153, 100, 101, 115, 116, 117, 118,
- 119, 120, 121, 122, 123, 124, 140, 141, 142, 132,
- 133, 126, 394, 311, 312, 134, 263, 264, 271, 272,
- 125, 129, 320, 265, 266, 145, 147, 112, 146, 128,
- 323, 114, 135, 135, 416, 125, 196, 197, 282, 147,
- 135, 282, 133, 125, 125, 125, 130, 125, 134, 128,
- 127, 126, 364, 161, 162, 129, 128, 133, 128, 128,
- 125, 134, 62, 134, 132, 128, 226, 134, 125, 130,
- 126, 369, 180, 385, 372, 323, 128, 126, 17, 129,
- 135, 379, 135, 376, 135, 252, 134, 399, 273, 357,
- 274, 277, 118, 114, 275, 118, 394, 276, 278, 5,
- 412, 209, 200, 240, 324, 359, 405, 299, 359, 413,
- 385, 102, -1, -1, -1, -1, -1, -1, 416, -1,
- -1, -1, 282, 364, -1, 233, 234, -1, 376, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 299,
- 390, -1, -1, -1, 385, -1, 390, -1, -1, -1,
- -1, -1, 260, 261, 262, 263, 264, 265, 266, 267,
- 268, 269, 270, 271, 272, 273, 274, 275, 276, 277,
- 278, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 389, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 358, 359,
- -1, -1, -1, -1, 364, 365, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 323, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 385, -1, -1, -1, -1,
- 390, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 407, -1, -1,
- -1, -1, -1, 413, 3, 4, 5, 6, 7, 8,
- 9, 10, 11, 12, 13, 14, 15, 16, 376, 18,
- 19, 20, 21, 22, 23, 24, 25, 26, 27, 28,
- 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
- 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
- 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
- 59, 60, 61, 62, 63, 64, 65, 66, 67, 68,
- 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
- 79, -1, 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
- 99, 100, 101, 102, 103, -1, -1, 106, 107, -1,
+ 0, 47, 89, 114, 94, 229, 238, 94, 89, 150,
+ 0, 166, 361, 135, 149, 155, 59, 0, 100, 131,
+ 100, 101, 389, 116, 130, 100, 101, 130, 367, 116,
+ 120, 130, 138, 120, 137, 116, 132, 149, 137, 180,
+ 135, 128, 138, 138, 111, 112, 92, 128, 135, 388,
+ 417, 140, 132, 142, 135, 210, 138, 100, 151, 199,
+ 128, 410, 135, 153, 129, 138, 153, 416, 155, 138,
+ 135, 109, 110, 129, 155, 121, 122, 212, 200, 146,
+ 147, 129, 129, 135, 129, 135, 138, 135, 135, 89,
+ 135, 323, 130, 130, 94, 135, 134, 238, 138, 254,
+ 212, 236, 237, 129, 104, 129, 138, 107, 128, 135,
+ 132, 135, 199, 200, 104, 132, 116, 258, 199, 200,
+ 120, 104, 137, 135, 236, 237, 138, 282, 128, 100,
+ 101, 270, 271, 272, 273, 135, 113, 114, 293, 130,
+ 372, 141, 297, 375, 368, 285, 4, 5, 6, 143,
+ 144, 145, 128, 153, 128, 155, 107, 108, 103, 104,
+ 135, 136, 266, 267, 129, 397, 268, 269, 150, 274,
+ 275, 149, 115, 314, 315, 148, 131, 117, 131, 138,
+ 138, 128, 323, 133, 128, 131, 138, 419, 136, 128,
+ 128, 326, 128, 130, 149, 137, 129, 132, 285, 199,
+ 200, 131, 136, 131, 285, 137, 137, 131, 135, 164,
+ 165, 128, 367, 62, 326, 137, 118, 119, 120, 121,
+ 122, 123, 124, 125, 126, 127, 131, 128, 183, 229,
+ 129, 372, 138, 388, 375, 137, 133, 131, 129, 17,
+ 132, 382, 137, 276, 379, 138, 255, 402, 138, 360,
+ 277, 279, 281, 278, 120, 116, 397, 212, 120, 280,
+ 415, 5, 203, 243, 327, 362, 408, 379, 416, 388,
+ 362, 302, 104, -1, -1, -1, -1, -1, 419, -1,
+ -1, 236, 237, -1, -1, 285, 367, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 125, -1, -1, -1,
- 129, 130, -1, -1, -1, -1, 135, 136, 137, 138,
- 139, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, 14, 15, 16, -1, 18, 19, 20, 21,
- 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- 62, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, -1, 81,
- 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, 97, 98, 99, 100, 101,
- 102, 103, -1, -1, 106, 107, -1, -1, -1, -1,
+ -1, -1, 302, 393, -1, -1, 393, 388, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 125, -1, -1, -1, 129, 130, -1,
- -1, -1, -1, 135, 136, 137, 138, 139, 3, 4,
- 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
- 15, 16, -1, 18, 19, 20, 21, 22, 23, 24,
- 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
- 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
- 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
- 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
- 75, 76, 77, 78, 79, -1, 81, 82, 83, 84,
- 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 97, 98, 99, 100, 101, 102, 103, -1,
- -1, 106, 107, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 392, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 361, 362, -1, -1, -1, -1, 367, 368, -1,
+ -1, 326, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 388, -1,
+ -1, -1, -1, 393, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 125, -1, -1, -1, 129, -1, -1, -1, -1, -1,
- 135, 136, 137, 138, 139, 3, 4, 5, 6, 7,
+ 410, -1, -1, -1, -1, -1, 416, -1, -1, -1,
+ -1, -1, -1, -1, 379, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
@@ -1394,50 +1367,69 @@ static const yytype_int16 yycheck[] =
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, 99, 100, 101, 102, 103, -1, -1, 106, 107,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 125, -1, -1,
- -1, 129, -1, -1, -1, -1, -1, 135, 136, 137,
- 138, 139, 3, 4, 5, 6, 7, 8, 9, 10,
- 11, 12, 13, 14, 15, 16, -1, 18, 19, 20,
- 21, 22, 23, 24, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
- 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
- 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
- 61, 62, 63, 64, 65, 66, 67, 68, 69, 70,
- 71, 72, 73, 74, 75, 76, 77, 78, 79, -1,
- 81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
- 91, 92, 93, 94, 95, 96, 97, 98, 99, 100,
- 101, 102, 103, -1, -1, 106, 107, -1, -1, -1,
+ 128, -1, -1, -1, 132, 133, -1, -1, -1, -1,
+ 138, 139, 140, 141, 142, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 125, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, 135, 136, 137, 138, 139, 3,
- 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 128, -1, -1, -1, 132, 133, -1, -1, -1, -1,
+ 138, 139, 140, 141, 142, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, -1, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, -1, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,
- -1, -1, 106, 107, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
- 6, 125, 8, 9, 10, 11, 12, 13, -1, -1,
- -1, 135, 136, 137, 138, 139, -1, -1, -1, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, -1, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, -1, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, 97, 98, 99, 100, 101, 102, 103, -1, -1,
- 106, 107, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 3, 4, 5, 6, 125,
+ 128, -1, -1, -1, 132, -1, -1, -1, -1, -1,
+ 138, 139, 140, 141, 142, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 128, -1, -1, -1, 132, -1, -1, -1, -1, -1,
+ 138, 139, 140, 141, 142, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15, 16, -1,
+ 18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
+ 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
+ 58, 59, 60, 61, 62, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 128, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 138, 139, 140, 141, 142, 3, 4, 5, 6, 7,
8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
- 136, 137, 138, 139, -1, -1, -1, 25, 26, 27,
+ -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
@@ -1445,155 +1437,184 @@ static const yytype_int16 yycheck[] =
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
- 98, -1, -1, 10, 11, 12, 13, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 25, 26,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
+ 128, 8, 9, 10, 11, 12, 13, -1, -1, -1,
+ 138, 139, 140, 141, 142, -1, -1, -1, 25, 26,
27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
- 37, 38, 39, -1, -1, -1, -1, 135, 45, 46,
- 47, 48, 49, 50, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 60, 61, -1, 63, 64, 65, 66,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, -1, 63, 64, 65, 66,
67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
77, 78, 79, -1, 81, 82, 83, 84, 85, 86,
- 87, 88, 89, 90, 91, 92, 93, 94, 95, -1,
- 97, 98, 99, 100, 101, 102, 103, -1, -1, 106,
- 107, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 125, -1,
- -1, 128, 10, 11, 12, 13, -1, -1, -1, 136,
- 137, 138, 139, -1, -1, -1, -1, 25, 26, 27,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ -1, -1, 109, 110, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 3, 4, 5,
+ 6, 128, 8, 9, 10, 11, 12, 13, -1, -1,
+ -1, -1, 139, 140, 141, 142, -1, -1, -1, 25,
+ 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
+ 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
+ 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
+ 56, 57, 58, 59, 60, 61, -1, 63, 64, 65,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 77, 78, 79, -1, 81, 82, 83, 84, 85,
+ 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
+ 96, 97, 98, -1, 100, 101, -1, -1, 10, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
+ -1, -1, 138, 45, 46, 47, 48, 49, 50, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 60, 61,
+ -1, 63, 64, 65, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 77, 78, 79, -1, 81,
+ 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
+ 92, 93, 94, 95, 96, -1, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, -1, -1, 109, 110, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 128, -1, -1, 131,
+ 10, 11, 12, 13, -1, -1, -1, 139, 140, 141,
+ 142, -1, -1, -1, -1, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
+ 50, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 60, 61, -1, 63, 64, 65, 66, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ -1, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, -1, 98, 99,
+ 100, 101, 102, 103, 104, 105, 106, -1, -1, 109,
+ 110, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 128, -1,
+ -1, 131, 10, 11, 12, 13, -1, -1, -1, 139,
+ 140, 141, 142, -1, -1, -1, -1, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
48, 49, 50, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 60, 61, -1, 63, 64, 65, 66, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, -1, 97,
- 98, 99, 100, 101, 102, 103, -1, -1, 106, 107,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, -1,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 125, -1, -1,
- 128, 10, 11, 12, 13, -1, -1, -1, 136, 137,
- 138, 139, -1, -1, -1, -1, 25, 26, 27, 28,
+ 128, 10, 11, 12, 13, -1, -1, -1, -1, -1,
+ 138, 139, 140, 141, 142, -1, 25, 26, 27, 28,
29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
39, -1, -1, -1, -1, -1, 45, 46, 47, 48,
49, 50, -1, -1, -1, -1, -1, -1, -1, -1,
-1, 60, 61, -1, 63, 64, 65, 66, 67, 68,
69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
79, -1, 81, 82, 83, 84, 85, 86, 87, 88,
- 89, 90, 91, 92, 93, 94, 95, -1, 97, 98,
- 99, 100, 101, 102, 103, -1, -1, 106, 107, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 125, 10, 11, 12,
- 13, -1, -1, -1, -1, -1, 135, 136, 137, 138,
- 139, -1, 25, 26, 27, 28, 29, 30, 31, 32,
- 33, 34, 35, 36, 37, 38, 39, -1, -1, -1,
- -1, -1, 45, 46, 47, 48, 49, 50, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, 60, 61, -1,
- 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
- 73, 74, 75, 76, 77, 78, 79, -1, 81, 82,
- 83, 84, 85, 86, 87, 88, 89, 90, 91, 92,
- 93, 94, 95, -1, 97, 98, 99, 100, 101, 102,
- 103, -1, -1, 106, 107, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 125, -1, -1, 128, 10, 11, 12, 13,
- -1, -1, -1, 136, 137, 138, 139, -1, -1, -1,
- -1, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 35, 36, 37, 38, 39, -1, -1, -1, -1,
- -1, 45, 46, 47, 48, 49, 50, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 60, 61, -1, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, -1, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, -1, 97, 98, 99, 100, 101, 102, 103,
- -1, -1, 106, 107, -1, -1, -1, -1, -1, -1,
+ 89, 90, 91, 92, 93, 94, 95, 96, -1, 98,
+ 99, 100, 101, 102, 103, 104, 105, 106, -1, -1,
+ 109, 110, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 128,
+ -1, -1, 131, 10, 11, 12, 13, -1, -1, -1,
+ 139, 140, 141, 142, -1, -1, -1, -1, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, -1, -1, -1, -1, -1, 45, 46,
+ 47, 48, 49, 50, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 60, 61, -1, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, -1, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ -1, 98, 99, 100, 101, 102, 103, 104, 105, 106,
+ -1, -1, 109, 110, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, 125, 10, 11, 12, 13, -1, -1, -1, -1,
- -1, -1, 136, 137, 138, 139, -1, 25, 26, 27,
+ -1, 128, 10, 11, 12, 13, -1, -1, -1, -1,
+ -1, -1, 139, 140, 141, 142, -1, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
48, 49, 50, -1, -1, -1, -1, -1, -1, -1,
-1, -1, 60, 61, -1, 63, 64, 65, 66, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, -1, 97,
- 98, 99, 100, 101, 102, 103, -1, -1, 106, 107,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, 3, 4, 5, 6, 125, 8, 9,
- 10, 11, 12, 13, -1, -1, -1, -1, 136, 137,
- 138, 139, -1, -1, -1, 25, 26, 27, 28, 29,
- 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
- 50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
- 60, 61, -1, 63, 64, 65, 66, 67, 68, 69,
- 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
- -1, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, -1, 98, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 3,
- 4, 5, 6, -1, 8, 9, 10, 11, 12, 13,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
- 130, 25, 26, 27, 28, 29, 30, 31, 32, 33,
- 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,
- 44, 45, 46, 47, 48, 49, 50, 51, 52, 53,
- 54, 55, 56, 57, 58, 59, 60, 61, -1, 63,
- 64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
- 74, 75, 76, 77, 78, 79, -1, 81, 82, 83,
- 84, 85, 86, 87, 88, 89, 90, 91, 92, 93,
- 94, 95, 96, -1, 98, -1, -1, -1, -1, -1,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, -1,
+ 98, 99, 100, 101, 102, 103, 104, 105, 106, -1,
+ -1, 109, 110, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 3, 4, 5, 6,
+ 128, 8, 9, 10, 11, 12, 13, -1, -1, -1,
+ -1, 139, 140, 141, 142, -1, -1, -1, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 47, 48, 49, 50, 51, 52, 53, 54, 55, 56,
+ 57, 58, 59, 60, 61, -1, 63, 64, 65, 66,
+ 67, 68, 69, 70, 71, 72, 73, 74, 75, 76,
+ 77, 78, 79, -1, 81, 82, 83, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, -1, -1, 101, -1, -1, -1, -1, -1,
-1, -1, -1, -1, -1, 3, 4, 5, 6, -1,
8, 9, 10, 11, 12, 13, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, -1, 130, 25, 26, 27,
+ -1, -1, -1, -1, -1, -1, 133, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
38, 39, 40, 41, 42, 43, 44, 45, 46, 47,
48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
58, 59, 60, 61, -1, 63, 64, 65, 66, 67,
68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
- 88, 89, 90, 91, 92, 93, 94, 95, 96, -1,
- 98, -1, -1, -1, -1, -1, -1, -1, 0, -1,
- -1, 3, 4, 5, 6, 7, 8, 9, 10, 11,
- 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
- -1, -1, 130, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
- 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
- 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
- -1, 63, 64, 65, 66, 67, 68, 69, 70, 71,
- 72, 73, 74, 75, 76, 77, 78, 79, -1, 81,
- 82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, 96, -1, 98, 3, 4, 5,
- 6, 7, 8, 9, 10, 11, 12, 13, -1, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 25,
- 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
- 36, 37, 38, 39, 40, 41, 42, 43, 44, 45,
- 46, 47, 48, 49, 50, 51, 52, 53, 54, 55,
- 56, 57, 58, 59, 60, 61, -1, 63, 64, 65,
- 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
- 76, 77, 78, 79, -1, 81, 82, 83, 84, 85,
- 86, 87, 88, 89, 90, 91, 92, 93, 94, 95,
- 96, -1, 98, 3, 4, 5, 6, -1, 8, 9,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
+ 98, -1, -1, 101, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 3, 4, 5, 6, -1, 8,
+ 9, 10, 11, 12, 13, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 133, 25, 26, 27, 28,
+ 29, 30, 31, 32, 33, 34, 35, 36, 37, 38,
+ 39, 40, 41, 42, 43, 44, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 61, -1, 63, 64, 65, 66, 67, 68,
+ 69, 70, 71, 72, 73, 74, 75, 76, 77, 78,
+ 79, -1, 81, 82, 83, 84, 85, 86, 87, 88,
+ 89, 90, 91, 92, 93, 94, 95, 96, 97, 98,
+ -1, -1, 101, -1, -1, -1, -1, -1, -1, -1,
+ 0, -1, -1, 3, 4, 5, 6, 7, 8, 9,
10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
- -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
+ -1, -1, -1, -1, 133, 25, 26, 27, 28, 29,
30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
50, 51, 52, 53, 54, 55, 56, 57, 58, 59,
60, 61, -1, 63, 64, 65, 66, 67, 68, 69,
70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
-1, 81, 82, 83, 84, 85, 86, 87, 88, 89,
- 90, 91, 92, 93, 94, 95, 96, -1, 98, 10,
+ 90, 91, 92, 93, 94, 95, 96, 97, 98, -1,
+ -1, 101, 3, 4, 5, 6, 7, 8, 9, 10,
11, 12, 13, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, -1, 25, 26, 27, 28, 29, 30,
- 31, 32, 33, 34, 35, 36, 37, 38, 39, -1,
- -1, -1, -1, -1, 45, 46, 47, 48, 49, 50,
- -1, -1, -1, -1, -1, -1, -1, -1, -1, 60,
+ 31, 32, 33, 34, 35, 36, 37, 38, 39, 40,
+ 41, 42, 43, 44, 45, 46, 47, 48, 49, 50,
+ 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, -1, 63, 64, 65, 66, 67, 68, 69, 70,
71, 72, 73, 74, 75, 76, 77, 78, 79, -1,
81, 82, 83, 84, 85, 86, 87, 88, 89, 90,
- 91, 92, 93, 94, 95, -1, 97, 98, 10, 11,
- 12, 13, 103, -1, -1, -1, -1, -1, -1, -1,
+ 91, 92, 93, 94, 95, 96, 97, 98, -1, -1,
+ 101, 3, 4, 5, 6, -1, 8, 9, 10, 11,
+ 12, 13, -1, -1, -1, -1, -1, -1, -1, -1,
-1, -1, -1, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39, -1, -1,
- -1, -1, -1, 45, 46, 47, 48, 49, 50, -1,
- -1, -1, -1, -1, -1, -1, -1, -1, 60, 61,
+ 32, 33, 34, 35, 36, 37, 38, 39, 40, 41,
+ 42, 43, 44, 45, 46, 47, 48, 49, 50, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
-1, 63, 64, 65, 66, 67, 68, 69, 70, 71,
72, 73, 74, 75, 76, 77, 78, 79, -1, 81,
82, 83, 84, 85, 86, 87, 88, 89, 90, 91,
- 92, 93, 94, 95, -1, -1, 98
+ 92, 93, 94, 95, 96, 97, 98, -1, -1, 101,
+ 10, 11, 12, 13, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ -1, -1, -1, -1, -1, 45, 46, 47, 48, 49,
+ 50, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ 60, 61, -1, 63, 64, 65, 66, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 77, 78, 79,
+ -1, 81, 82, 83, 84, 85, 86, 87, 88, 89,
+ 90, 91, 92, 93, 94, 95, 96, -1, 98, -1,
+ 100, 101, 10, 11, 12, 13, 106, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 25, 26, 27,
+ 28, 29, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, -1, -1, -1, -1, -1, 45, 46, 47,
+ 48, 49, 50, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 60, 61, -1, 63, 64, 65, 66, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 77,
+ 78, 79, -1, 81, 82, 83, 84, 85, 86, 87,
+ 88, 89, 90, 91, 92, 93, 94, 95, 96, -1,
+ 98, -1, -1, 101
};
/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -1608,111 +1629,111 @@ static const yytype_uint8 yystos[] =
64, 65, 66, 67, 68, 69, 70, 71, 72, 73,
74, 75, 76, 77, 78, 79, 81, 82, 83, 84,
85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
- 95, 96, 98, 181, 182, 183, 184, 185, 189, 190,
- 191, 192, 193, 194, 195, 196, 197, 198, 199, 202,
- 203, 204, 239, 240, 241, 198, 97, 98, 129, 150,
- 125, 135, 242, 126, 132, 186, 187, 188, 193, 197,
- 132, 135, 97, 150, 97, 135, 180, 195, 197, 127,
- 0, 240, 202, 206, 129, 59, 97, 200, 201, 129,
- 222, 187, 186, 188, 150, 150, 125, 127, 134, 129,
- 135, 193, 197, 207, 208, 97, 99, 100, 101, 102,
- 103, 106, 107, 125, 128, 136, 137, 138, 139, 151,
- 152, 153, 155, 156, 157, 158, 159, 160, 161, 162,
+ 95, 96, 97, 98, 101, 184, 185, 186, 187, 188,
+ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
+ 202, 205, 206, 207, 242, 243, 244, 201, 100, 101,
+ 132, 153, 128, 138, 245, 129, 135, 189, 190, 191,
+ 196, 200, 135, 138, 100, 153, 100, 138, 183, 198,
+ 200, 130, 0, 243, 205, 209, 132, 59, 100, 203,
+ 204, 132, 225, 190, 189, 191, 153, 153, 128, 130,
+ 137, 132, 138, 196, 200, 210, 211, 99, 100, 102,
+ 103, 104, 105, 106, 109, 110, 128, 131, 139, 140,
+ 141, 142, 154, 155, 156, 158, 159, 160, 161, 162,
163, 164, 165, 166, 167, 168, 169, 170, 171, 172,
- 173, 174, 175, 179, 202, 135, 207, 205, 134, 126,
- 132, 14, 15, 16, 18, 19, 20, 21, 22, 23,
- 24, 62, 129, 130, 135, 162, 175, 176, 178, 181,
- 182, 202, 212, 213, 214, 215, 223, 224, 225, 227,
- 229, 231, 238, 127, 127, 134, 128, 179, 176, 211,
- 197, 150, 209, 210, 130, 208, 162, 162, 178, 106,
- 107, 127, 131, 126, 126, 132, 61, 176, 125, 162,
- 140, 141, 142, 137, 139, 104, 105, 108, 109, 143,
- 144, 110, 111, 147, 146, 145, 112, 114, 113, 148,
- 128, 130, 207, 100, 101, 201, 135, 135, 233, 125,
- 125, 135, 135, 178, 125, 179, 133, 125, 130, 216,
- 115, 116, 117, 118, 119, 120, 121, 122, 123, 124,
- 134, 177, 132, 135, 130, 213, 179, 128, 179, 211,
- 134, 128, 209, 127, 132, 135, 97, 135, 126, 154,
- 178, 97, 103, 157, 176, 162, 162, 162, 164, 164,
- 165, 165, 166, 166, 166, 166, 167, 167, 168, 169,
- 170, 171, 172, 173, 178, 130, 219, 220, 221, 234,
- 178, 135, 178, 133, 232, 223, 176, 176, 128, 134,
- 128, 211, 134, 135, 179, 210, 127, 135, 128, 133,
- 62, 222, 214, 212, 224, 235, 126, 126, 178, 191,
- 193, 230, 217, 211, 134, 211, 128, 179, 176, 125,
- 230, 236, 237, 219, 226, 228, 150, 126, 130, 211,
- 128, 178, 135, 126, 17, 215, 134, 214, 218, 222,
- 135, 126, 178, 218, 219, 211, 135
+ 173, 174, 175, 176, 177, 178, 182, 205, 138, 210,
+ 208, 137, 129, 135, 14, 15, 16, 18, 19, 20,
+ 21, 22, 23, 24, 62, 132, 133, 138, 165, 178,
+ 179, 181, 184, 185, 205, 215, 216, 217, 218, 226,
+ 227, 228, 230, 232, 234, 241, 130, 130, 137, 131,
+ 182, 179, 214, 200, 153, 212, 213, 133, 211, 165,
+ 165, 181, 109, 110, 130, 134, 129, 129, 135, 61,
+ 179, 128, 165, 143, 144, 145, 140, 142, 107, 108,
+ 111, 112, 146, 147, 113, 114, 150, 149, 148, 115,
+ 117, 116, 151, 131, 133, 210, 103, 104, 204, 138,
+ 138, 236, 128, 128, 138, 138, 181, 128, 182, 136,
+ 128, 133, 219, 118, 119, 120, 121, 122, 123, 124,
+ 125, 126, 127, 137, 180, 135, 138, 133, 216, 182,
+ 131, 182, 214, 137, 131, 212, 130, 135, 138, 100,
+ 138, 129, 157, 181, 100, 106, 160, 179, 165, 165,
+ 165, 167, 167, 168, 168, 169, 169, 169, 169, 170,
+ 170, 171, 172, 173, 174, 175, 176, 181, 133, 222,
+ 223, 224, 237, 181, 138, 181, 136, 235, 226, 179,
+ 179, 131, 137, 131, 214, 137, 138, 182, 213, 130,
+ 138, 131, 136, 62, 225, 217, 215, 227, 238, 129,
+ 129, 181, 194, 196, 233, 220, 214, 137, 214, 131,
+ 182, 179, 128, 233, 239, 240, 222, 229, 231, 153,
+ 129, 133, 214, 131, 181, 138, 129, 17, 218, 137,
+ 217, 221, 225, 138, 129, 181, 221, 222, 214, 138
};
/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
static const yytype_uint8 yyr1[] =
{
- 0, 149, 150, 150, 151, 152, 152, 152, 152, 152,
- 152, 153, 153, 153, 153, 153, 153, 154, 155, 156,
- 156, 157, 157, 158, 158, 159, 159, 160, 161, 161,
- 161, 162, 162, 162, 162, 163, 163, 163, 163, 164,
- 164, 164, 164, 165, 165, 165, 166, 166, 166, 167,
- 167, 167, 167, 167, 168, 168, 168, 169, 169, 170,
- 170, 171, 171, 172, 172, 173, 173, 174, 174, 175,
- 175, 176, 176, 177, 177, 177, 177, 177, 177, 177,
- 177, 177, 177, 177, 178, 178, 179, 180, 181, 181,
- 181, 181, 181, 181, 181, 181, 182, 183, 183, 184,
- 184, 185, 186, 186, 187, 187, 187, 187, 188, 189,
- 189, 189, 189, 189, 189, 190, 190, 190, 190, 190,
- 190, 191, 191, 192, 192, 193, 193, 194, 195, 195,
- 195, 195, 195, 196, 196, 196, 196, 196, 196, 196,
- 196, 196, 196, 196, 196, 196, 196, 197, 198, 198,
- 198, 199, 200, 200, 201, 201, 201, 201, 202, 202,
- 202, 203, 203, 203, 203, 203, 203, 203, 203, 203,
- 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
- 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
- 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
- 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
- 203, 203, 203, 203, 203, 203, 203, 203, 203, 203,
- 203, 205, 204, 206, 204, 207, 207, 208, 208, 209,
- 209, 210, 210, 211, 212, 213, 213, 214, 214, 214,
- 214, 214, 214, 214, 215, 216, 217, 215, 218, 218,
- 220, 219, 221, 219, 222, 222, 223, 223, 224, 224,
- 225, 226, 226, 228, 227, 229, 229, 230, 230, 232,
- 231, 233, 231, 234, 231, 235, 235, 236, 236, 237,
- 237, 238, 238, 238, 238, 238, 239, 239, 240, 240,
- 242, 241
+ 0, 152, 153, 153, 154, 155, 155, 155, 155, 155,
+ 155, 155, 156, 156, 156, 156, 156, 156, 157, 158,
+ 159, 159, 160, 160, 161, 161, 162, 162, 163, 164,
+ 164, 164, 165, 165, 165, 165, 166, 166, 166, 166,
+ 167, 167, 167, 167, 168, 168, 168, 169, 169, 169,
+ 170, 170, 170, 170, 170, 171, 171, 171, 172, 172,
+ 173, 173, 174, 174, 175, 175, 176, 176, 177, 177,
+ 178, 178, 179, 179, 180, 180, 180, 180, 180, 180,
+ 180, 180, 180, 180, 180, 181, 181, 182, 183, 184,
+ 184, 184, 184, 184, 184, 184, 184, 185, 186, 186,
+ 187, 187, 188, 189, 189, 190, 190, 190, 190, 191,
+ 192, 192, 192, 192, 192, 192, 193, 193, 193, 193,
+ 193, 193, 194, 194, 195, 195, 196, 196, 197, 198,
+ 198, 198, 198, 198, 199, 199, 199, 199, 199, 199,
+ 199, 199, 199, 199, 199, 199, 199, 199, 200, 201,
+ 201, 201, 202, 203, 203, 204, 204, 204, 204, 205,
+ 205, 205, 206, 206, 206, 206, 206, 206, 206, 206,
+ 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
+ 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
+ 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
+ 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
+ 206, 206, 206, 206, 206, 206, 206, 206, 206, 206,
+ 206, 206, 206, 206, 208, 207, 209, 207, 210, 210,
+ 211, 211, 212, 212, 213, 213, 214, 215, 216, 216,
+ 217, 217, 217, 217, 217, 217, 217, 218, 219, 220,
+ 218, 221, 221, 223, 222, 224, 222, 225, 225, 226,
+ 226, 227, 227, 228, 229, 229, 231, 230, 232, 232,
+ 233, 233, 235, 234, 236, 234, 237, 234, 238, 238,
+ 239, 239, 240, 240, 241, 241, 241, 241, 241, 242,
+ 242, 243, 243, 245, 244
};
/* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
static const yytype_uint8 yyr2[] =
{
0, 2, 1, 1, 1, 1, 1, 1, 1, 1,
- 3, 1, 4, 1, 3, 2, 2, 1, 1, 1,
- 3, 2, 2, 2, 1, 2, 3, 2, 1, 1,
- 1, 1, 2, 2, 2, 1, 1, 1, 1, 1,
- 3, 3, 3, 1, 3, 3, 1, 3, 3, 1,
- 3, 3, 3, 3, 1, 3, 3, 1, 3, 1,
- 3, 1, 3, 1, 3, 1, 3, 1, 3, 1,
- 5, 1, 3, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 3, 1, 2, 2, 2,
- 4, 5, 6, 9, 2, 3, 2, 1, 1, 2,
- 3, 3, 2, 5, 2, 1, 2, 1, 1, 1,
- 3, 6, 7, 8, 5, 1, 2, 5, 6, 7,
- 4, 1, 2, 1, 1, 1, 2, 1, 1, 1,
+ 1, 3, 1, 4, 1, 3, 2, 2, 1, 1,
+ 1, 3, 2, 2, 2, 1, 2, 3, 2, 1,
+ 1, 1, 1, 2, 2, 2, 1, 1, 1, 1,
+ 1, 3, 3, 3, 1, 3, 3, 1, 3, 3,
+ 1, 3, 3, 3, 3, 1, 3, 3, 1, 3,
+ 1, 3, 1, 3, 1, 3, 1, 3, 1, 3,
+ 1, 5, 1, 3, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 3, 1, 2, 2,
+ 2, 4, 5, 6, 9, 2, 3, 2, 1, 1,
+ 2, 3, 3, 2, 5, 2, 1, 2, 1, 1,
+ 1, 3, 6, 7, 8, 5, 1, 2, 5, 6,
+ 7, 4, 1, 2, 1, 1, 1, 2, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 4, 1, 3, 1, 3, 3, 1, 1, 3,
- 4, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 4, 1, 3, 1, 3, 3, 1, 1,
+ 3, 4, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 0, 6, 0, 5, 1, 2, 3, 4, 1,
- 3, 1, 4, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 2, 0, 0, 5, 1, 1,
- 0, 2, 0, 2, 2, 3, 1, 2, 1, 2,
- 5, 3, 1, 0, 6, 3, 2, 1, 4, 0,
- 6, 0, 8, 0, 7, 1, 1, 1, 0, 2,
- 3, 2, 2, 2, 3, 2, 1, 2, 1, 1,
- 0, 3
+ 1, 1, 1, 1, 0, 6, 0, 5, 1, 2,
+ 3, 4, 1, 3, 1, 4, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 2, 0, 0,
+ 5, 1, 1, 0, 2, 0, 2, 2, 3, 1,
+ 2, 1, 2, 5, 3, 1, 0, 6, 3, 2,
+ 1, 4, 0, 6, 0, 8, 0, 7, 1, 1,
+ 1, 0, 2, 3, 2, 2, 2, 3, 2, 1,
+ 2, 1, 1, 0, 3
};
@@ -2554,7 +2575,12 @@ yyreduce:
case 10:
{
- (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode);
+ if (!context->isExtensionEnabled("GL_EXT_YUV_target")) {
+ context->error((yylsp[0]), "unsupported value", (yyvsp[0].lex).string->c_str());
+ }
+ TConstantUnion *unionArray = new TConstantUnion[1];
+ unionArray->setYuvCscStandardEXTConst(getYuvCscStandardEXT((yyvsp[0].lex).string->c_str()));
+ (yyval.interm.intermTypedNode) = context->intermediate.addConstantUnion(unionArray, TType(EbtYuvCscStandardEXT, EbpUndefined, EvqConst), (yylsp[0]));
}
break;
@@ -2562,7 +2588,7 @@ yyreduce:
case 11:
{
- (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
+ (yyval.interm.intermTypedNode) = (yyvsp[-1].interm.intermTypedNode);
}
break;
@@ -2570,7 +2596,7 @@ yyreduce:
case 12:
{
- (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[-3].interm.intermTypedNode), (yylsp[-2]), (yyvsp[-1].interm.intermTypedNode));
+ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
break;
@@ -2578,7 +2604,7 @@ yyreduce:
case 13:
{
- (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
+ (yyval.interm.intermTypedNode) = context->addIndexExpression((yyvsp[-3].interm.intermTypedNode), (yylsp[-2]), (yyvsp[-1].interm.intermTypedNode));
}
break;
@@ -2586,7 +2612,7 @@ yyreduce:
case 14:
{
- (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[-2].interm.intermTypedNode), (yylsp[-1]), *(yyvsp[0].lex).string, (yylsp[0]));
+ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
break;
@@ -2594,7 +2620,7 @@ yyreduce:
case 15:
{
- (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode), (yylsp[0]));
+ (yyval.interm.intermTypedNode) = context->addFieldSelectionExpression((yyvsp[-2].interm.intermTypedNode), (yylsp[-1]), *(yyvsp[0].lex).string, (yylsp[0]));
}
break;
@@ -2602,7 +2628,7 @@ yyreduce:
case 16:
{
- (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode), (yylsp[0]));
+ (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostIncrement, (yyvsp[-1].interm.intermTypedNode), (yylsp[0]));
}
break;
@@ -2610,13 +2636,21 @@ yyreduce:
case 17:
{
+ (yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPostDecrement, (yyvsp[-1].interm.intermTypedNode), (yylsp[0]));
+ }
+
+ break;
+
+ case 18:
+
+ {
context->checkIsScalarInteger((yyvsp[0].interm.intermTypedNode), "[]");
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
}
break;
- case 18:
+ case 19:
{
(yyval.interm.intermTypedNode) = context->addFunctionCallOrMethod((yyvsp[0].interm).function, (yyvsp[0].interm).callOrMethodPair.arguments, (yyvsp[0].interm).callOrMethodPair.thisNode, (yylsp[0]));
@@ -2624,7 +2658,7 @@ yyreduce:
break;
- case 19:
+ case 20:
{
(yyval.interm) = (yyvsp[0].interm);
@@ -2633,7 +2667,7 @@ yyreduce:
break;
- case 20:
+ case 21:
{
ES3_OR_NEWER("", (yylsp[0]), "methods");
@@ -2643,7 +2677,7 @@ yyreduce:
break;
- case 21:
+ case 22:
{
(yyval.interm) = (yyvsp[-1].interm);
@@ -2651,7 +2685,7 @@ yyreduce:
break;
- case 22:
+ case 23:
{
(yyval.interm) = (yyvsp[-1].interm);
@@ -2659,7 +2693,7 @@ yyreduce:
break;
- case 23:
+ case 24:
{
(yyval.interm).function = (yyvsp[-1].interm.function);
@@ -2668,7 +2702,7 @@ yyreduce:
break;
- case 24:
+ case 25:
{
(yyval.interm).function = (yyvsp[0].interm.function);
@@ -2677,7 +2711,7 @@ yyreduce:
break;
- case 25:
+ case 26:
{
(yyval.interm).callOrMethodPair.arguments = context->createEmptyArgumentsList();
@@ -2687,7 +2721,7 @@ yyreduce:
break;
- case 26:
+ case 27:
{
(yyval.interm).function = (yyvsp[-2].interm).function;
@@ -2696,7 +2730,7 @@ yyreduce:
break;
- case 27:
+ case 28:
{
(yyval.interm.function) = (yyvsp[-1].interm.function);
@@ -2704,7 +2738,7 @@ yyreduce:
break;
- case 28:
+ case 29:
{
if ((yyvsp[0].interm.type).array) {
@@ -2715,7 +2749,7 @@ yyreduce:
break;
- case 29:
+ case 30:
{
context->checkIsNotReserved((yylsp[0]), *(yyvsp[0].lex).string);
@@ -2726,7 +2760,7 @@ yyreduce:
break;
- case 30:
+ case 31:
{
context->checkIsNotReserved((yylsp[0]), *(yyvsp[0].lex).string);
@@ -2737,7 +2771,7 @@ yyreduce:
break;
- case 31:
+ case 32:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
@@ -2745,7 +2779,7 @@ yyreduce:
break;
- case 32:
+ case 33:
{
(yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPreIncrement, (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2753,7 +2787,7 @@ yyreduce:
break;
- case 33:
+ case 34:
{
(yyval.interm.intermTypedNode) = context->addUnaryMathLValue(EOpPreDecrement, (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2761,7 +2795,7 @@ yyreduce:
break;
- case 34:
+ case 35:
{
if ((yyvsp[-1].interm).op != EOpNull) {
@@ -2772,25 +2806,25 @@ yyreduce:
break;
- case 35:
+ case 36:
{ (yyval.interm).op = EOpPositive; }
break;
- case 36:
+ case 37:
{ (yyval.interm).op = EOpNegative; }
break;
- case 37:
+ case 38:
{ (yyval.interm).op = EOpLogicalNot; }
break;
- case 38:
+ case 39:
{
ES3_OR_NEWER("~", (yyloc), "bit-wise operator");
@@ -2799,13 +2833,13 @@ yyreduce:
break;
- case 39:
+ case 40:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 40:
+ case 41:
{
(yyval.interm.intermTypedNode) = context->addBinaryMath(EOpMul, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2813,7 +2847,7 @@ yyreduce:
break;
- case 41:
+ case 42:
{
(yyval.interm.intermTypedNode) = context->addBinaryMath(EOpDiv, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2821,7 +2855,7 @@ yyreduce:
break;
- case 42:
+ case 43:
{
ES3_OR_NEWER("%", (yylsp[-1]), "integer modulus operator");
@@ -2830,13 +2864,13 @@ yyreduce:
break;
- case 43:
+ case 44:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 44:
+ case 45:
{
(yyval.interm.intermTypedNode) = context->addBinaryMath(EOpAdd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2844,7 +2878,7 @@ yyreduce:
break;
- case 45:
+ case 46:
{
(yyval.interm.intermTypedNode) = context->addBinaryMath(EOpSub, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2852,13 +2886,13 @@ yyreduce:
break;
- case 46:
+ case 47:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 47:
+ case 48:
{
ES3_OR_NEWER("<<", (yylsp[-1]), "bit-wise operator");
@@ -2867,7 +2901,7 @@ yyreduce:
break;
- case 48:
+ case 49:
{
ES3_OR_NEWER(">>", (yylsp[-1]), "bit-wise operator");
@@ -2876,13 +2910,13 @@ yyreduce:
break;
- case 49:
+ case 50:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 50:
+ case 51:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLessThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2890,7 +2924,7 @@ yyreduce:
break;
- case 51:
+ case 52:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpGreaterThan, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2898,7 +2932,7 @@ yyreduce:
break;
- case 52:
+ case 53:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLessThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2906,7 +2940,7 @@ yyreduce:
break;
- case 53:
+ case 54:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpGreaterThanEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2914,13 +2948,13 @@ yyreduce:
break;
- case 54:
+ case 55:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 55:
+ case 56:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2928,7 +2962,7 @@ yyreduce:
break;
- case 56:
+ case 57:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpNotEqual, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2936,13 +2970,13 @@ yyreduce:
break;
- case 57:
+ case 58:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 58:
+ case 59:
{
ES3_OR_NEWER("&", (yylsp[-1]), "bit-wise operator");
@@ -2951,13 +2985,13 @@ yyreduce:
break;
- case 59:
+ case 60:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 60:
+ case 61:
{
ES3_OR_NEWER("^", (yylsp[-1]), "bit-wise operator");
@@ -2966,13 +3000,13 @@ yyreduce:
break;
- case 61:
+ case 62:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 62:
+ case 63:
{
ES3_OR_NEWER("|", (yylsp[-1]), "bit-wise operator");
@@ -2981,13 +3015,13 @@ yyreduce:
break;
- case 63:
+ case 64:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 64:
+ case 65:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalAnd, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -2995,13 +3029,13 @@ yyreduce:
break;
- case 65:
+ case 66:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 66:
+ case 67:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalXor, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -3009,13 +3043,13 @@ yyreduce:
break;
- case 67:
+ case 68:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 68:
+ case 69:
{
(yyval.interm.intermTypedNode) = context->addBinaryMathBooleanResult(EOpLogicalOr, (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -3023,13 +3057,13 @@ yyreduce:
break;
- case 69:
+ case 70:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 70:
+ case 71:
{
(yyval.interm.intermTypedNode) = context->addTernarySelection((yyvsp[-4].interm.intermTypedNode), (yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-3]));
@@ -3037,13 +3071,13 @@ yyreduce:
break;
- case 71:
+ case 72:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 72:
+ case 73:
{
context->checkCanBeLValue((yylsp[-1]), "assign", (yyvsp[-2].interm.intermTypedNode));
@@ -3052,25 +3086,25 @@ yyreduce:
break;
- case 73:
+ case 74:
{ (yyval.interm).op = EOpAssign; }
break;
- case 74:
+ case 75:
{ (yyval.interm).op = EOpMulAssign; }
break;
- case 75:
+ case 76:
{ (yyval.interm).op = EOpDivAssign; }
break;
- case 76:
+ case 77:
{
ES3_OR_NEWER("%=", (yyloc), "integer modulus operator");
@@ -3079,19 +3113,19 @@ yyreduce:
break;
- case 77:
+ case 78:
{ (yyval.interm).op = EOpAddAssign; }
break;
- case 78:
+ case 79:
{ (yyval.interm).op = EOpSubAssign; }
break;
- case 79:
+ case 80:
{
ES3_OR_NEWER("<<=", (yyloc), "bit-wise operator");
@@ -3100,7 +3134,7 @@ yyreduce:
break;
- case 80:
+ case 81:
{
ES3_OR_NEWER(">>=", (yyloc), "bit-wise operator");
@@ -3109,7 +3143,7 @@ yyreduce:
break;
- case 81:
+ case 82:
{
ES3_OR_NEWER("&=", (yyloc), "bit-wise operator");
@@ -3118,7 +3152,7 @@ yyreduce:
break;
- case 82:
+ case 83:
{
ES3_OR_NEWER("^=", (yyloc), "bit-wise operator");
@@ -3127,7 +3161,7 @@ yyreduce:
break;
- case 83:
+ case 84:
{
ES3_OR_NEWER("|=", (yyloc), "bit-wise operator");
@@ -3136,7 +3170,7 @@ yyreduce:
break;
- case 84:
+ case 85:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
@@ -3144,7 +3178,7 @@ yyreduce:
break;
- case 85:
+ case 86:
{
(yyval.interm.intermTypedNode) = context->addComma((yyvsp[-2].interm.intermTypedNode), (yyvsp[0].interm.intermTypedNode), (yylsp[-1]));
@@ -3152,7 +3186,7 @@ yyreduce:
break;
- case 86:
+ case 87:
{
context->checkIsConst((yyvsp[0].interm.intermTypedNode));
@@ -3161,7 +3195,7 @@ yyreduce:
break;
- case 87:
+ case 88:
{
context->enterStructDeclaration((yylsp[-1]), *(yyvsp[-1].lex).string);
@@ -3170,7 +3204,7 @@ yyreduce:
break;
- case 88:
+ case 89:
{
(yyval.interm.intermNode) = context->addFunctionPrototypeDeclaration(*((yyvsp[-1].interm).function), (yylsp[-1]));
@@ -3178,7 +3212,7 @@ yyreduce:
break;
- case 89:
+ case 90:
{
(yyval.interm.intermNode) = (yyvsp[-1].interm).intermDeclaration;
@@ -3186,7 +3220,7 @@ yyreduce:
break;
- case 90:
+ case 91:
{
if (((yyvsp[-2].interm.precision) == EbpHigh) && (context->getShaderType() == GL_FRAGMENT_SHADER) && !context->getFragmentPrecisionHigh()) {
@@ -3200,7 +3234,7 @@ yyreduce:
break;
- case 91:
+ case 92:
{
ES3_OR_NEWER((yyvsp[-3].lex).string->c_str(), (yylsp[-4]), "interface blocks");
@@ -3209,7 +3243,7 @@ yyreduce:
break;
- case 92:
+ case 93:
{
ES3_OR_NEWER((yyvsp[-4].lex).string->c_str(), (yylsp[-5]), "interface blocks");
@@ -3218,7 +3252,7 @@ yyreduce:
break;
- case 93:
+ case 94:
{
ES3_OR_NEWER((yyvsp[-7].lex).string->c_str(), (yylsp[-8]), "interface blocks");
@@ -3227,7 +3261,7 @@ yyreduce:
break;
- case 94:
+ case 95:
{
context->parseGlobalLayoutQualifier(*(yyvsp[-1].interm.typeQualifierBuilder));
@@ -3236,7 +3270,7 @@ yyreduce:
break;
- case 95:
+ case 96:
{
(yyval.interm.intermNode) = context->parseInvariantDeclaration(*(yyvsp[-2].interm.typeQualifierBuilder), (yylsp[-1]), (yyvsp[-1].lex).string, (yyvsp[-1].lex).symbol);
@@ -3244,7 +3278,7 @@ yyreduce:
break;
- case 96:
+ case 97:
{
(yyval.interm).function = context->parseFunctionDeclarator((yylsp[0]), (yyvsp[-1].interm.function));
@@ -3253,7 +3287,7 @@ yyreduce:
break;
- case 97:
+ case 98:
{
(yyval.interm.function) = (yyvsp[0].interm.function);
@@ -3261,7 +3295,7 @@ yyreduce:
break;
- case 98:
+ case 99:
{
(yyval.interm.function) = (yyvsp[0].interm.function);
@@ -3269,7 +3303,7 @@ yyreduce:
break;
- case 99:
+ case 100:
{
// Add the parameter
@@ -3282,7 +3316,7 @@ yyreduce:
break;
- case 100:
+ case 101:
{
//
@@ -3304,7 +3338,7 @@ yyreduce:
break;
- case 101:
+ case 102:
{
(yyval.interm.function) = context->parseFunctionHeader((yyvsp[-2].interm.type), (yyvsp[-1].lex).string, (yylsp[-1]));
@@ -3315,7 +3349,7 @@ yyreduce:
break;
- case 102:
+ case 103:
{
if ((yyvsp[-1].interm.type).getBasicType() == EbtVoid) {
@@ -3328,7 +3362,7 @@ yyreduce:
break;
- case 103:
+ case 104:
{
// Check that we can make an array out of this type
@@ -3347,7 +3381,7 @@ yyreduce:
break;
- case 104:
+ case 105:
{
(yyval.interm) = (yyvsp[0].interm);
@@ -3356,7 +3390,7 @@ yyreduce:
break;
- case 105:
+ case 106:
{
(yyval.interm) = (yyvsp[0].interm);
@@ -3365,7 +3399,7 @@ yyreduce:
break;
- case 106:
+ case 107:
{
(yyval.interm) = (yyvsp[0].interm);
@@ -3374,7 +3408,7 @@ yyreduce:
break;
- case 107:
+ case 108:
{
(yyval.interm) = (yyvsp[0].interm);
@@ -3383,7 +3417,7 @@ yyreduce:
break;
- case 108:
+ case 109:
{
TParameter param = { 0, new TType((yyvsp[0].interm.type)) };
@@ -3392,7 +3426,7 @@ yyreduce:
break;
- case 109:
+ case 110:
{
(yyval.interm) = (yyvsp[0].interm);
@@ -3400,7 +3434,7 @@ yyreduce:
break;
- case 110:
+ case 111:
{
(yyval.interm) = (yyvsp[-2].interm);
@@ -3409,7 +3443,7 @@ yyreduce:
break;
- case 111:
+ case 112:
{
(yyval.interm) = (yyvsp[-5].interm);
@@ -3418,7 +3452,7 @@ yyreduce:
break;
- case 112:
+ case 113:
{
ES3_OR_NEWER("[]", (yylsp[-4]), "implicitly sized array");
@@ -3428,7 +3462,7 @@ yyreduce:
break;
- case 113:
+ case 114:
{
ES3_OR_NEWER("=", (yylsp[-1]), "first-class arrays (array initializer)");
@@ -3438,7 +3472,7 @@ yyreduce:
break;
- case 114:
+ case 115:
{
(yyval.interm) = (yyvsp[-4].interm);
@@ -3447,7 +3481,7 @@ yyreduce:
break;
- case 115:
+ case 116:
{
(yyval.interm).type = (yyvsp[0].interm.type);
@@ -3456,7 +3490,7 @@ yyreduce:
break;
- case 116:
+ case 117:
{
(yyval.interm).type = (yyvsp[-1].interm.type);
@@ -3465,7 +3499,7 @@ yyreduce:
break;
- case 117:
+ case 118:
{
(yyval.interm).type = (yyvsp[-4].interm.type);
@@ -3474,7 +3508,7 @@ yyreduce:
break;
- case 118:
+ case 119:
{
ES3_OR_NEWER("[]", (yylsp[-3]), "implicitly sized array");
@@ -3484,7 +3518,7 @@ yyreduce:
break;
- case 119:
+ case 120:
{
ES3_OR_NEWER("=", (yylsp[-1]), "first-class arrays (array initializer)");
@@ -3494,7 +3528,7 @@ yyreduce:
break;
- case 120:
+ case 121:
{
(yyval.interm).type = (yyvsp[-3].interm.type);
@@ -3503,7 +3537,7 @@ yyreduce:
break;
- case 121:
+ case 122:
{
context->addFullySpecifiedType(&(yyvsp[0].interm.type));
@@ -3512,7 +3546,7 @@ yyreduce:
break;
- case 122:
+ case 123:
{
(yyval.interm.type) = context->addFullySpecifiedType(*(yyvsp[-1].interm.typeQualifierBuilder), (yyvsp[0].interm.type));
@@ -3520,7 +3554,7 @@ yyreduce:
break;
- case 123:
+ case 124:
{
(yyval.interm.qualifier) = EvqSmooth;
@@ -3528,7 +3562,7 @@ yyreduce:
break;
- case 124:
+ case 125:
{
(yyval.interm.qualifier) = EvqFlat;
@@ -3536,7 +3570,7 @@ yyreduce:
break;
- case 125:
+ case 126:
{
(yyval.interm.typeQualifierBuilder) = context->createTypeQualifierBuilder((yylsp[0]));
@@ -3545,7 +3579,7 @@ yyreduce:
break;
- case 126:
+ case 127:
{
(yyval.interm.typeQualifierBuilder) = (yyvsp[-1].interm.typeQualifierBuilder);
@@ -3554,7 +3588,7 @@ yyreduce:
break;
- case 127:
+ case 128:
{
// empty
@@ -3562,7 +3596,7 @@ yyreduce:
break;
- case 128:
+ case 129:
{
context->checkLocalVariableConstStorageQualifier(*(yyvsp[0].interm.qualifierWrapper));
@@ -3571,7 +3605,7 @@ yyreduce:
break;
- case 129:
+ case 130:
{
context->checkIsAtGlobalLevel((yylsp[0]), "layout");
@@ -3580,7 +3614,7 @@ yyreduce:
break;
- case 130:
+ case 131:
{
(yyval.interm.qualifierWrapper) = new TPrecisionQualifierWrapper((yyvsp[0].interm.precision), (yylsp[0]));
@@ -3588,7 +3622,7 @@ yyreduce:
break;
- case 131:
+ case 132:
{
(yyval.interm.qualifierWrapper) = new TInterpolationQualifierWrapper((yyvsp[0].interm.qualifier), (yylsp[0]));
@@ -3596,7 +3630,7 @@ yyreduce:
break;
- case 132:
+ case 133:
{
context->checkIsAtGlobalLevel((yylsp[0]), "invariant");
@@ -3605,7 +3639,7 @@ yyreduce:
break;
- case 133:
+ case 134:
{
VERTEX_ONLY("attribute", (yylsp[0]));
@@ -3616,7 +3650,7 @@ yyreduce:
break;
- case 134:
+ case 135:
{
ES2_ONLY("varying", (yylsp[0]));
@@ -3629,7 +3663,7 @@ yyreduce:
break;
- case 135:
+ case 136:
{
(yyval.interm.qualifierWrapper) = new TStorageQualifierWrapper(EvqConst, (yylsp[0]));
@@ -3637,7 +3671,7 @@ yyreduce:
break;
- case 136:
+ case 137:
{
if (context->declaringFunction())
@@ -3662,7 +3696,7 @@ yyreduce:
break;
- case 137:
+ case 138:
{
if (context->declaringFunction())
@@ -3686,7 +3720,7 @@ yyreduce:
break;
- case 138:
+ case 139:
{
if (!context->declaringFunction())
@@ -3698,7 +3732,7 @@ yyreduce:
break;
- case 139:
+ case 140:
{
ES3_OR_NEWER("centroid", (yylsp[0]), "storage qualifier");
@@ -3707,7 +3741,7 @@ yyreduce:
break;
- case 140:
+ case 141:
{
context->checkIsAtGlobalLevel((yylsp[0]), "uniform");
@@ -3716,7 +3750,7 @@ yyreduce:
break;
- case 141:
+ case 142:
{
(yyval.interm.qualifierWrapper) = new TMemoryQualifierWrapper(EvqReadOnly, (yylsp[0]));
@@ -3724,7 +3758,7 @@ yyreduce:
break;
- case 142:
+ case 143:
{
(yyval.interm.qualifierWrapper) = new TMemoryQualifierWrapper(EvqWriteOnly, (yylsp[0]));
@@ -3732,7 +3766,7 @@ yyreduce:
break;
- case 143:
+ case 144:
{
(yyval.interm.qualifierWrapper) = new TMemoryQualifierWrapper(EvqCoherent, (yylsp[0]));
@@ -3740,7 +3774,7 @@ yyreduce:
break;
- case 144:
+ case 145:
{
(yyval.interm.qualifierWrapper) = new TMemoryQualifierWrapper(EvqRestrict, (yylsp[0]));
@@ -3748,7 +3782,7 @@ yyreduce:
break;
- case 145:
+ case 146:
{
(yyval.interm.qualifierWrapper) = new TMemoryQualifierWrapper(EvqVolatile, (yylsp[0]));
@@ -3756,7 +3790,7 @@ yyreduce:
break;
- case 146:
+ case 147:
{
context->checkIsAtGlobalLevel((yylsp[0]), "shared");
@@ -3766,7 +3800,7 @@ yyreduce:
break;
- case 147:
+ case 148:
{
(yyval.interm.type) = (yyvsp[0].interm.type);
@@ -3775,7 +3809,7 @@ yyreduce:
break;
- case 148:
+ case 149:
{
(yyval.interm.precision) = EbpHigh;
@@ -3783,7 +3817,7 @@ yyreduce:
break;
- case 149:
+ case 150:
{
(yyval.interm.precision) = EbpMedium;
@@ -3791,7 +3825,7 @@ yyreduce:
break;
- case 150:
+ case 151:
{
(yyval.interm.precision) = EbpLow;
@@ -3799,7 +3833,7 @@ yyreduce:
break;
- case 151:
+ case 152:
{
ES3_OR_NEWER("layout", (yylsp[-3]), "qualifier");
@@ -3808,7 +3842,7 @@ yyreduce:
break;
- case 152:
+ case 153:
{
(yyval.interm.layoutQualifier) = (yyvsp[0].interm.layoutQualifier);
@@ -3816,7 +3850,7 @@ yyreduce:
break;
- case 153:
+ case 154:
{
(yyval.interm.layoutQualifier) = context->joinLayoutQualifiers((yyvsp[-2].interm.layoutQualifier), (yyvsp[0].interm.layoutQualifier), (yylsp[0]));
@@ -3824,7 +3858,7 @@ yyreduce:
break;
- case 154:
+ case 155:
{
(yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[0].lex).string, (yylsp[0]));
@@ -3832,7 +3866,7 @@ yyreduce:
break;
- case 155:
+ case 156:
{
(yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[-2].lex).string, (yylsp[-2]), (yyvsp[0].lex).i, (yylsp[0]));
@@ -3840,7 +3874,7 @@ yyreduce:
break;
- case 156:
+ case 157:
{
(yyval.interm.layoutQualifier) = context->parseLayoutQualifier(*(yyvsp[-2].lex).string, (yylsp[-2]), (yyvsp[0].lex).i, (yylsp[0]));
@@ -3848,7 +3882,7 @@ yyreduce:
break;
- case 157:
+ case 158:
{
(yyval.interm.layoutQualifier) = context->parseLayoutQualifier("shared", (yylsp[0]));
@@ -3856,7 +3890,7 @@ yyreduce:
break;
- case 158:
+ case 159:
{
(yyval.interm.type).initialize((yyvsp[0].interm.typeSpecifierNonArray), (context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary));
@@ -3864,7 +3898,7 @@ yyreduce:
break;
- case 159:
+ case 160:
{
ES3_OR_NEWER("[]", (yylsp[-1]), "implicitly sized array");
@@ -3874,7 +3908,7 @@ yyreduce:
break;
- case 160:
+ case 161:
{
(yyval.interm.type).initialize((yyvsp[-3].interm.typeSpecifierNonArray), (context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary));
@@ -3887,7 +3921,7 @@ yyreduce:
break;
- case 161:
+ case 162:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtVoid, (yylsp[0]));
@@ -3895,7 +3929,7 @@ yyreduce:
break;
- case 162:
+ case 163:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -3903,7 +3937,7 @@ yyreduce:
break;
- case 163:
+ case 164:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtInt, (yylsp[0]));
@@ -3911,7 +3945,7 @@ yyreduce:
break;
- case 164:
+ case 165:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUInt, (yylsp[0]));
@@ -3919,7 +3953,7 @@ yyreduce:
break;
- case 165:
+ case 166:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtBool, (yylsp[0]));
@@ -3927,7 +3961,7 @@ yyreduce:
break;
- case 166:
+ case 167:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -3936,7 +3970,7 @@ yyreduce:
break;
- case 167:
+ case 168:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -3945,7 +3979,7 @@ yyreduce:
break;
- case 168:
+ case 169:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -3954,7 +3988,7 @@ yyreduce:
break;
- case 169:
+ case 170:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtBool, (yylsp[0]));
@@ -3963,7 +3997,7 @@ yyreduce:
break;
- case 170:
+ case 171:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtBool, (yylsp[0]));
@@ -3972,7 +4006,7 @@ yyreduce:
break;
- case 171:
+ case 172:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtBool, (yylsp[0]));
@@ -3981,7 +4015,7 @@ yyreduce:
break;
- case 172:
+ case 173:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtInt, (yylsp[0]));
@@ -3990,7 +4024,7 @@ yyreduce:
break;
- case 173:
+ case 174:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtInt, (yylsp[0]));
@@ -3999,7 +4033,7 @@ yyreduce:
break;
- case 174:
+ case 175:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtInt, (yylsp[0]));
@@ -4008,7 +4042,7 @@ yyreduce:
break;
- case 175:
+ case 176:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUInt, (yylsp[0]));
@@ -4017,7 +4051,7 @@ yyreduce:
break;
- case 176:
+ case 177:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUInt, (yylsp[0]));
@@ -4026,7 +4060,7 @@ yyreduce:
break;
- case 177:
+ case 178:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUInt, (yylsp[0]));
@@ -4035,7 +4069,7 @@ yyreduce:
break;
- case 178:
+ case 179:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4044,7 +4078,7 @@ yyreduce:
break;
- case 179:
+ case 180:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4053,7 +4087,7 @@ yyreduce:
break;
- case 180:
+ case 181:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4062,7 +4096,7 @@ yyreduce:
break;
- case 181:
+ case 182:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4071,7 +4105,7 @@ yyreduce:
break;
- case 182:
+ case 183:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4080,7 +4114,7 @@ yyreduce:
break;
- case 183:
+ case 184:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4089,7 +4123,7 @@ yyreduce:
break;
- case 184:
+ case 185:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4098,7 +4132,7 @@ yyreduce:
break;
- case 185:
+ case 186:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4107,7 +4141,7 @@ yyreduce:
break;
- case 186:
+ case 187:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtFloat, (yylsp[0]));
@@ -4116,7 +4150,18 @@ yyreduce:
break;
- case 187:
+ case 188:
+
+ {
+ if (!context->isExtensionEnabled("GL_EXT_YUV_target")) {
+ context->error((yylsp[0]), "unsupported type", "yuvCscStandardEXT");
+ }
+ (yyval.interm.typeSpecifierNonArray).initialize(EbtYuvCscStandardEXT, (yylsp[0]));
+ }
+
+ break;
+
+ case 189:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSampler2D, (yylsp[0]));
@@ -4124,7 +4169,7 @@ yyreduce:
break;
- case 188:
+ case 190:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSampler3D, (yylsp[0]));
@@ -4132,7 +4177,7 @@ yyreduce:
break;
- case 189:
+ case 191:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSamplerCube, (yylsp[0]));
@@ -4140,7 +4185,7 @@ yyreduce:
break;
- case 190:
+ case 192:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSampler2DArray, (yylsp[0]));
@@ -4148,7 +4193,7 @@ yyreduce:
break;
- case 191:
+ case 193:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSampler2DMS, (yylsp[0]));
@@ -4156,7 +4201,7 @@ yyreduce:
break;
- case 192:
+ case 194:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtISampler2D, (yylsp[0]));
@@ -4164,7 +4209,7 @@ yyreduce:
break;
- case 193:
+ case 195:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtISampler3D, (yylsp[0]));
@@ -4172,7 +4217,7 @@ yyreduce:
break;
- case 194:
+ case 196:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtISamplerCube, (yylsp[0]));
@@ -4180,7 +4225,7 @@ yyreduce:
break;
- case 195:
+ case 197:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtISampler2DArray, (yylsp[0]));
@@ -4188,7 +4233,7 @@ yyreduce:
break;
- case 196:
+ case 198:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtISampler2DMS, (yylsp[0]));
@@ -4196,7 +4241,7 @@ yyreduce:
break;
- case 197:
+ case 199:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUSampler2D, (yylsp[0]));
@@ -4204,7 +4249,7 @@ yyreduce:
break;
- case 198:
+ case 200:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUSampler3D, (yylsp[0]));
@@ -4212,7 +4257,7 @@ yyreduce:
break;
- case 199:
+ case 201:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUSamplerCube, (yylsp[0]));
@@ -4220,7 +4265,7 @@ yyreduce:
break;
- case 200:
+ case 202:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUSampler2DArray, (yylsp[0]));
@@ -4228,7 +4273,7 @@ yyreduce:
break;
- case 201:
+ case 203:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUSampler2DMS, (yylsp[0]));
@@ -4236,7 +4281,7 @@ yyreduce:
break;
- case 202:
+ case 204:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSampler2DShadow, (yylsp[0]));
@@ -4244,7 +4289,7 @@ yyreduce:
break;
- case 203:
+ case 205:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSamplerCubeShadow, (yylsp[0]));
@@ -4252,7 +4297,7 @@ yyreduce:
break;
- case 204:
+ case 206:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtSampler2DArrayShadow, (yylsp[0]));
@@ -4260,7 +4305,7 @@ yyreduce:
break;
- case 205:
+ case 207:
{
if (!context->supportsExtension("GL_OES_EGL_image_external") &&
@@ -4272,7 +4317,18 @@ yyreduce:
break;
- case 206:
+ case 208:
+
+ {
+ if (!context->isExtensionEnabled("GL_EXT_YUV_target")) {
+ context->error((yylsp[0]), "unsupported type", "__samplerExternal2DY2YEXT");
+ }
+ (yyval.interm.typeSpecifierNonArray).initialize(EbtSamplerExternal2DY2YEXT, (yylsp[0]));
+ }
+
+ break;
+
+ case 209:
{
if (!context->supportsExtension("GL_ARB_texture_rectangle")) {
@@ -4283,7 +4339,7 @@ yyreduce:
break;
- case 207:
+ case 210:
{
(yyval.interm.typeSpecifierNonArray) = (yyvsp[0].interm.typeSpecifierNonArray);
@@ -4291,7 +4347,7 @@ yyreduce:
break;
- case 208:
+ case 211:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtImage2D, (yylsp[0]));
@@ -4299,7 +4355,7 @@ yyreduce:
break;
- case 209:
+ case 212:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtIImage2D, (yylsp[0]));
@@ -4307,7 +4363,7 @@ yyreduce:
break;
- case 210:
+ case 213:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUImage2D, (yylsp[0]));
@@ -4315,7 +4371,7 @@ yyreduce:
break;
- case 211:
+ case 214:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtImage3D, (yylsp[0]));
@@ -4323,7 +4379,7 @@ yyreduce:
break;
- case 212:
+ case 215:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtIImage3D, (yylsp[0]));
@@ -4331,7 +4387,7 @@ yyreduce:
break;
- case 213:
+ case 216:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUImage3D, (yylsp[0]));
@@ -4339,7 +4395,7 @@ yyreduce:
break;
- case 214:
+ case 217:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtImage2DArray, (yylsp[0]));
@@ -4347,7 +4403,7 @@ yyreduce:
break;
- case 215:
+ case 218:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtIImage2DArray, (yylsp[0]));
@@ -4355,7 +4411,7 @@ yyreduce:
break;
- case 216:
+ case 219:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUImage2DArray, (yylsp[0]));
@@ -4363,7 +4419,7 @@ yyreduce:
break;
- case 217:
+ case 220:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtImageCube, (yylsp[0]));
@@ -4371,7 +4427,7 @@ yyreduce:
break;
- case 218:
+ case 221:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtIImageCube, (yylsp[0]));
@@ -4379,7 +4435,7 @@ yyreduce:
break;
- case 219:
+ case 222:
{
(yyval.interm.typeSpecifierNonArray).initialize(EbtUImageCube, (yylsp[0]));
@@ -4387,7 +4443,7 @@ yyreduce:
break;
- case 220:
+ case 223:
{
//
@@ -4401,13 +4457,13 @@ yyreduce:
break;
- case 221:
+ case 224:
{ context->enterStructDeclaration((yylsp[-1]), *(yyvsp[-1].lex).string); }
break;
- case 222:
+ case 225:
{
(yyval.interm.typeSpecifierNonArray) = context->addStructure((yylsp[-5]), (yylsp[-4]), (yyvsp[-4].lex).string, (yyvsp[-1].interm.fieldList));
@@ -4415,13 +4471,13 @@ yyreduce:
break;
- case 223:
+ case 226:
{ context->enterStructDeclaration((yylsp[0]), *(yyvsp[0].lex).string); }
break;
- case 224:
+ case 227:
{
(yyval.interm.typeSpecifierNonArray) = context->addStructure((yylsp[-4]), (yyloc), NewPoolTString(""), (yyvsp[-1].interm.fieldList));
@@ -4429,7 +4485,7 @@ yyreduce:
break;
- case 225:
+ case 228:
{
(yyval.interm.fieldList) = (yyvsp[0].interm.fieldList);
@@ -4437,7 +4493,7 @@ yyreduce:
break;
- case 226:
+ case 229:
{
(yyval.interm.fieldList) = context->combineStructFieldLists((yyvsp[-1].interm.fieldList), (yyvsp[0].interm.fieldList), (yylsp[0]));
@@ -4445,7 +4501,7 @@ yyreduce:
break;
- case 227:
+ case 230:
{
(yyval.interm.fieldList) = context->addStructDeclaratorList((yyvsp[-2].interm.type), (yyvsp[-1].interm.fieldList));
@@ -4453,7 +4509,7 @@ yyreduce:
break;
- case 228:
+ case 231:
{
// ES3 Only, but errors should be handled elsewhere
@@ -4462,7 +4518,7 @@ yyreduce:
break;
- case 229:
+ case 232:
{
(yyval.interm.fieldList) = NewPoolTFieldList();
@@ -4471,7 +4527,7 @@ yyreduce:
break;
- case 230:
+ case 233:
{
(yyval.interm.fieldList)->push_back((yyvsp[0].interm.field));
@@ -4479,7 +4535,7 @@ yyreduce:
break;
- case 231:
+ case 234:
{
context->checkIsNotReserved((yylsp[0]), *(yyvsp[0].lex).string);
@@ -4490,7 +4546,7 @@ yyreduce:
break;
- case 232:
+ case 235:
{
context->checkIsNotReserved((yylsp[-3]), *(yyvsp[-3].lex).string);
@@ -4504,91 +4560,91 @@ yyreduce:
break;
- case 233:
+ case 236:
{ (yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode); }
break;
- case 234:
+ case 237:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 235:
+ case 238:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermBlock); }
break;
- case 236:
+ case 239:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 237:
+ case 240:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 238:
+ case 241:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 239:
+ case 242:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 240:
+ case 243:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermSwitch); }
break;
- case 241:
+ case 244:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermCase); }
break;
- case 242:
+ case 245:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 243:
+ case 246:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 244:
+ case 247:
{ (yyval.interm.intermBlock) = 0; }
break;
- case 245:
+ case 248:
{ context->symbolTable.push(); }
break;
- case 246:
+ case 249:
{ context->symbolTable.pop(); }
break;
- case 247:
+ case 250:
{
if ((yyvsp[-2].interm.intermBlock) != 0) {
@@ -4599,43 +4655,43 @@ yyreduce:
break;
- case 248:
+ case 251:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermBlock); }
break;
- case 249:
+ case 252:
{ (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 250:
+ case 253:
{ context->symbolTable.push(); }
break;
- case 251:
+ case 254:
{ context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[0].interm.intermBlock); }
break;
- case 252:
+ case 255:
{ context->symbolTable.push(); }
break;
- case 253:
+ case 256:
{ context->symbolTable.pop(); (yyval.interm.intermNode) = (yyvsp[0].interm.intermNode); }
break;
- case 254:
+ case 257:
{
(yyval.interm.intermBlock) = 0;
@@ -4643,7 +4699,7 @@ yyreduce:
break;
- case 255:
+ case 258:
{
if ((yyvsp[-1].interm.intermBlock)) {
@@ -4654,7 +4710,7 @@ yyreduce:
break;
- case 256:
+ case 259:
{
(yyval.interm.intermBlock) = new TIntermBlock();
@@ -4664,7 +4720,7 @@ yyreduce:
break;
- case 257:
+ case 260:
{
(yyval.interm.intermBlock) = (yyvsp[-1].interm.intermBlock);
@@ -4673,19 +4729,19 @@ yyreduce:
break;
- case 258:
+ case 261:
{ (yyval.interm.intermNode) = 0; }
break;
- case 259:
+ case 262:
{ (yyval.interm.intermNode) = static_cast<TIntermNode*>((yyvsp[-1].interm.intermTypedNode)); }
break;
- case 260:
+ case 263:
{
context->checkIsScalarBool((yylsp[-4]), (yyvsp[-2].interm.intermTypedNode));
@@ -4694,7 +4750,7 @@ yyreduce:
break;
- case 261:
+ case 264:
{
(yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermNode);
@@ -4703,7 +4759,7 @@ yyreduce:
break;
- case 262:
+ case 265:
{
(yyval.interm.nodePair).node1 = (yyvsp[0].interm.intermNode);
@@ -4712,13 +4768,13 @@ yyreduce:
break;
- case 263:
+ case 266:
{ context->incrSwitchNestingLevel(); }
break;
- case 264:
+ case 267:
{
(yyval.interm.intermSwitch) = context->addSwitch((yyvsp[-3].interm.intermTypedNode), (yyvsp[0].interm.intermBlock), (yylsp[-5]));
@@ -4727,7 +4783,7 @@ yyreduce:
break;
- case 265:
+ case 268:
{
(yyval.interm.intermCase) = context->addCase((yyvsp[-1].interm.intermTypedNode), (yylsp[-2]));
@@ -4735,7 +4791,7 @@ yyreduce:
break;
- case 266:
+ case 269:
{
(yyval.interm.intermCase) = context->addDefault((yylsp[-1]));
@@ -4743,7 +4799,7 @@ yyreduce:
break;
- case 267:
+ case 270:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
@@ -4752,7 +4808,7 @@ yyreduce:
break;
- case 268:
+ case 271:
{
TIntermBinary *initNode = nullptr;
@@ -4767,13 +4823,13 @@ yyreduce:
break;
- case 269:
+ case 272:
{ context->symbolTable.push(); context->incrLoopNestingLevel(); }
break;
- case 270:
+ case 273:
{
context->symbolTable.pop();
@@ -4783,13 +4839,13 @@ yyreduce:
break;
- case 271:
+ case 274:
{ context->incrLoopNestingLevel(); }
break;
- case 272:
+ case 275:
{
context->checkIsScalarBool((yylsp[0]), (yyvsp[-2].interm.intermTypedNode));
@@ -4800,13 +4856,13 @@ yyreduce:
break;
- case 273:
+ case 276:
{ context->symbolTable.push(); context->incrLoopNestingLevel(); }
break;
- case 274:
+ case 277:
{
context->symbolTable.pop();
@@ -4816,7 +4872,7 @@ yyreduce:
break;
- case 275:
+ case 278:
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -4824,7 +4880,7 @@ yyreduce:
break;
- case 276:
+ case 279:
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -4832,7 +4888,7 @@ yyreduce:
break;
- case 277:
+ case 280:
{
(yyval.interm.intermTypedNode) = (yyvsp[0].interm.intermTypedNode);
@@ -4840,7 +4896,7 @@ yyreduce:
break;
- case 278:
+ case 281:
{
(yyval.interm.intermTypedNode) = 0;
@@ -4848,7 +4904,7 @@ yyreduce:
break;
- case 279:
+ case 282:
{
(yyval.interm.nodePair).node1 = (yyvsp[-1].interm.intermTypedNode);
@@ -4857,7 +4913,7 @@ yyreduce:
break;
- case 280:
+ case 283:
{
(yyval.interm.nodePair).node1 = (yyvsp[-2].interm.intermTypedNode);
@@ -4866,7 +4922,7 @@ yyreduce:
break;
- case 281:
+ case 284:
{
(yyval.interm.intermNode) = context->addBranch(EOpContinue, (yylsp[-1]));
@@ -4874,7 +4930,7 @@ yyreduce:
break;
- case 282:
+ case 285:
{
(yyval.interm.intermNode) = context->addBranch(EOpBreak, (yylsp[-1]));
@@ -4882,7 +4938,7 @@ yyreduce:
break;
- case 283:
+ case 286:
{
(yyval.interm.intermNode) = context->addBranch(EOpReturn, (yylsp[-1]));
@@ -4890,7 +4946,7 @@ yyreduce:
break;
- case 284:
+ case 287:
{
(yyval.interm.intermNode) = context->addBranch(EOpReturn, (yyvsp[-1].interm.intermTypedNode), (yylsp[-2]));
@@ -4898,7 +4954,7 @@ yyreduce:
break;
- case 285:
+ case 288:
{
FRAG_ONLY("discard", (yylsp[-1]));
@@ -4907,7 +4963,7 @@ yyreduce:
break;
- case 286:
+ case 289:
{
(yyval.interm.intermBlock) = new TIntermBlock();
@@ -4918,7 +4974,7 @@ yyreduce:
break;
- case 287:
+ case 290:
{
(yyval.interm.intermBlock)->appendStatement((yyvsp[0].interm.intermNode));
@@ -4926,7 +4982,7 @@ yyreduce:
break;
- case 288:
+ case 291:
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -4934,7 +4990,7 @@ yyreduce:
break;
- case 289:
+ case 292:
{
(yyval.interm.intermNode) = (yyvsp[0].interm.intermNode);
@@ -4942,7 +4998,7 @@ yyreduce:
break;
- case 290:
+ case 293:
{
context->parseFunctionDefinitionHeader((yylsp[0]), &((yyvsp[0].interm).function), &((yyvsp[0].interm).intermFunctionPrototype));
@@ -4950,7 +5006,7 @@ yyreduce:
break;
- case 291:
+ case 294:
{
(yyval.interm.intermNode) = context->addFunctionDefinition((yyvsp[-2].interm).intermFunctionPrototype, (yyvsp[0].interm.intermBlock), (yylsp[-2]));
diff --git a/chromium/third_party/angle/src/compiler/translator/glslang_tab.h b/chromium/third_party/angle/src/compiler/translator/glslang_tab.h
index fb7399c8386..49aae95fcc2 100644
--- a/chromium/third_party/angle/src/compiler/translator/glslang_tab.h
+++ b/chromium/third_party/angle/src/compiler/translator/glslang_tab.h
@@ -49,152 +49,155 @@ extern int yydebug;
#define YYTOKENTYPE
enum yytokentype
{
- INVARIANT = 258,
- HIGH_PRECISION = 259,
- MEDIUM_PRECISION = 260,
- LOW_PRECISION = 261,
- PRECISION = 262,
- ATTRIBUTE = 263,
- CONST_QUAL = 264,
- BOOL_TYPE = 265,
- FLOAT_TYPE = 266,
- INT_TYPE = 267,
- UINT_TYPE = 268,
- BREAK = 269,
- CONTINUE = 270,
- DO = 271,
- ELSE = 272,
- FOR = 273,
- IF = 274,
- DISCARD = 275,
- RETURN = 276,
- SWITCH = 277,
- CASE = 278,
- DEFAULT = 279,
- BVEC2 = 280,
- BVEC3 = 281,
- BVEC4 = 282,
- IVEC2 = 283,
- IVEC3 = 284,
- IVEC4 = 285,
- VEC2 = 286,
- VEC3 = 287,
- VEC4 = 288,
- UVEC2 = 289,
- UVEC3 = 290,
- UVEC4 = 291,
- MATRIX2 = 292,
- MATRIX3 = 293,
- MATRIX4 = 294,
- IN_QUAL = 295,
- OUT_QUAL = 296,
- INOUT_QUAL = 297,
- UNIFORM = 298,
- VARYING = 299,
- MATRIX2x3 = 300,
- MATRIX3x2 = 301,
- MATRIX2x4 = 302,
- MATRIX4x2 = 303,
- MATRIX3x4 = 304,
- MATRIX4x3 = 305,
- CENTROID = 306,
- FLAT = 307,
- SMOOTH = 308,
- READONLY = 309,
- WRITEONLY = 310,
- COHERENT = 311,
- RESTRICT = 312,
- VOLATILE = 313,
- SHARED = 314,
- STRUCT = 315,
- VOID_TYPE = 316,
- WHILE = 317,
- SAMPLER2D = 318,
- SAMPLERCUBE = 319,
- SAMPLER_EXTERNAL_OES = 320,
- SAMPLER2DRECT = 321,
- SAMPLER2DARRAY = 322,
- ISAMPLER2D = 323,
- ISAMPLER3D = 324,
- ISAMPLERCUBE = 325,
- ISAMPLER2DARRAY = 326,
- USAMPLER2D = 327,
- USAMPLER3D = 328,
- USAMPLERCUBE = 329,
- USAMPLER2DARRAY = 330,
- SAMPLER2DMS = 331,
- ISAMPLER2DMS = 332,
- USAMPLER2DMS = 333,
- SAMPLER3D = 334,
- SAMPLER3DRECT = 335,
- SAMPLER2DSHADOW = 336,
- SAMPLERCUBESHADOW = 337,
- SAMPLER2DARRAYSHADOW = 338,
- IMAGE2D = 339,
- IIMAGE2D = 340,
- UIMAGE2D = 341,
- IMAGE3D = 342,
- IIMAGE3D = 343,
- UIMAGE3D = 344,
- IMAGE2DARRAY = 345,
- IIMAGE2DARRAY = 346,
- UIMAGE2DARRAY = 347,
- IMAGECUBE = 348,
- IIMAGECUBE = 349,
- UIMAGECUBE = 350,
- LAYOUT = 351,
- IDENTIFIER = 352,
- TYPE_NAME = 353,
- FLOATCONSTANT = 354,
- INTCONSTANT = 355,
- UINTCONSTANT = 356,
- BOOLCONSTANT = 357,
- FIELD_SELECTION = 358,
- LEFT_OP = 359,
- RIGHT_OP = 360,
- INC_OP = 361,
- DEC_OP = 362,
- LE_OP = 363,
- GE_OP = 364,
- EQ_OP = 365,
- NE_OP = 366,
- AND_OP = 367,
- OR_OP = 368,
- XOR_OP = 369,
- MUL_ASSIGN = 370,
- DIV_ASSIGN = 371,
- ADD_ASSIGN = 372,
- MOD_ASSIGN = 373,
- LEFT_ASSIGN = 374,
- RIGHT_ASSIGN = 375,
- AND_ASSIGN = 376,
- XOR_ASSIGN = 377,
- OR_ASSIGN = 378,
- SUB_ASSIGN = 379,
- LEFT_PAREN = 380,
- RIGHT_PAREN = 381,
- LEFT_BRACKET = 382,
- RIGHT_BRACKET = 383,
- LEFT_BRACE = 384,
- RIGHT_BRACE = 385,
- DOT = 386,
- COMMA = 387,
- COLON = 388,
- EQUAL = 389,
- SEMICOLON = 390,
- BANG = 391,
- DASH = 392,
- TILDE = 393,
- PLUS = 394,
- STAR = 395,
- SLASH = 396,
- PERCENT = 397,
- LEFT_ANGLE = 398,
- RIGHT_ANGLE = 399,
- VERTICAL_BAR = 400,
- CARET = 401,
- AMPERSAND = 402,
- QUESTION = 403
+ INVARIANT = 258,
+ HIGH_PRECISION = 259,
+ MEDIUM_PRECISION = 260,
+ LOW_PRECISION = 261,
+ PRECISION = 262,
+ ATTRIBUTE = 263,
+ CONST_QUAL = 264,
+ BOOL_TYPE = 265,
+ FLOAT_TYPE = 266,
+ INT_TYPE = 267,
+ UINT_TYPE = 268,
+ BREAK = 269,
+ CONTINUE = 270,
+ DO = 271,
+ ELSE = 272,
+ FOR = 273,
+ IF = 274,
+ DISCARD = 275,
+ RETURN = 276,
+ SWITCH = 277,
+ CASE = 278,
+ DEFAULT = 279,
+ BVEC2 = 280,
+ BVEC3 = 281,
+ BVEC4 = 282,
+ IVEC2 = 283,
+ IVEC3 = 284,
+ IVEC4 = 285,
+ VEC2 = 286,
+ VEC3 = 287,
+ VEC4 = 288,
+ UVEC2 = 289,
+ UVEC3 = 290,
+ UVEC4 = 291,
+ MATRIX2 = 292,
+ MATRIX3 = 293,
+ MATRIX4 = 294,
+ IN_QUAL = 295,
+ OUT_QUAL = 296,
+ INOUT_QUAL = 297,
+ UNIFORM = 298,
+ VARYING = 299,
+ MATRIX2x3 = 300,
+ MATRIX3x2 = 301,
+ MATRIX2x4 = 302,
+ MATRIX4x2 = 303,
+ MATRIX3x4 = 304,
+ MATRIX4x3 = 305,
+ CENTROID = 306,
+ FLAT = 307,
+ SMOOTH = 308,
+ READONLY = 309,
+ WRITEONLY = 310,
+ COHERENT = 311,
+ RESTRICT = 312,
+ VOLATILE = 313,
+ SHARED = 314,
+ STRUCT = 315,
+ VOID_TYPE = 316,
+ WHILE = 317,
+ SAMPLER2D = 318,
+ SAMPLERCUBE = 319,
+ SAMPLER_EXTERNAL_OES = 320,
+ SAMPLER2DRECT = 321,
+ SAMPLER2DARRAY = 322,
+ ISAMPLER2D = 323,
+ ISAMPLER3D = 324,
+ ISAMPLERCUBE = 325,
+ ISAMPLER2DARRAY = 326,
+ USAMPLER2D = 327,
+ USAMPLER3D = 328,
+ USAMPLERCUBE = 329,
+ USAMPLER2DARRAY = 330,
+ SAMPLER2DMS = 331,
+ ISAMPLER2DMS = 332,
+ USAMPLER2DMS = 333,
+ SAMPLER3D = 334,
+ SAMPLER3DRECT = 335,
+ SAMPLER2DSHADOW = 336,
+ SAMPLERCUBESHADOW = 337,
+ SAMPLER2DARRAYSHADOW = 338,
+ SAMPLEREXTERNAL2DY2YEXT = 339,
+ IMAGE2D = 340,
+ IIMAGE2D = 341,
+ UIMAGE2D = 342,
+ IMAGE3D = 343,
+ IIMAGE3D = 344,
+ UIMAGE3D = 345,
+ IMAGE2DARRAY = 346,
+ IIMAGE2DARRAY = 347,
+ UIMAGE2DARRAY = 348,
+ IMAGECUBE = 349,
+ IIMAGECUBE = 350,
+ UIMAGECUBE = 351,
+ LAYOUT = 352,
+ YUVCSCSTANDARDEXT = 353,
+ YUVCSCSTANDARDEXTCONSTANT = 354,
+ IDENTIFIER = 355,
+ TYPE_NAME = 356,
+ FLOATCONSTANT = 357,
+ INTCONSTANT = 358,
+ UINTCONSTANT = 359,
+ BOOLCONSTANT = 360,
+ FIELD_SELECTION = 361,
+ LEFT_OP = 362,
+ RIGHT_OP = 363,
+ INC_OP = 364,
+ DEC_OP = 365,
+ LE_OP = 366,
+ GE_OP = 367,
+ EQ_OP = 368,
+ NE_OP = 369,
+ AND_OP = 370,
+ OR_OP = 371,
+ XOR_OP = 372,
+ MUL_ASSIGN = 373,
+ DIV_ASSIGN = 374,
+ ADD_ASSIGN = 375,
+ MOD_ASSIGN = 376,
+ LEFT_ASSIGN = 377,
+ RIGHT_ASSIGN = 378,
+ AND_ASSIGN = 379,
+ XOR_ASSIGN = 380,
+ OR_ASSIGN = 381,
+ SUB_ASSIGN = 382,
+ LEFT_PAREN = 383,
+ RIGHT_PAREN = 384,
+ LEFT_BRACKET = 385,
+ RIGHT_BRACKET = 386,
+ LEFT_BRACE = 387,
+ RIGHT_BRACE = 388,
+ DOT = 389,
+ COMMA = 390,
+ COLON = 391,
+ EQUAL = 392,
+ SEMICOLON = 393,
+ BANG = 394,
+ DASH = 395,
+ TILDE = 396,
+ PLUS = 397,
+ STAR = 398,
+ SLASH = 399,
+ PERCENT = 400,
+ LEFT_ANGLE = 401,
+ RIGHT_ANGLE = 402,
+ VERTICAL_BAR = 403,
+ CARET = 404,
+ AMPERSAND = 405,
+ QUESTION = 406
};
#endif
diff --git a/chromium/third_party/angle/src/compiler/translator/intermOut.cpp b/chromium/third_party/angle/src/compiler/translator/intermOut.cpp
index 6312ef79c1d..2b71efa0eaa 100644
--- a/chromium/third_party/angle/src/compiler/translator/intermOut.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/intermOut.cpp
@@ -17,7 +17,7 @@ void OutputFunction(TInfoSinkBase &out, const char *str, TFunctionSymbolInfo *in
{
const char *internal = info->getNameObj().isInternal() ? " (internal function)" : "";
out << str << internal << ": " << info->getNameObj().getString() << " (symbol id "
- << info->getId() << ")";
+ << info->getId().get() << ")";
}
//
@@ -609,9 +609,14 @@ void TOutputTraverser::visitConstantUnion(TIntermConstantUnion *node)
out << node->getUnionArrayPointer()[i].getUConst();
out << " (const uint)\n";
break;
+ case EbtYuvCscStandardEXT:
+ out << getYuvCscStandardEXTString(
+ node->getUnionArrayPointer()[i].getYuvCscStandardEXTConst());
+ out << " (const yuvCscStandardEXT)\n";
+ break;
default:
out.prefix(SH_ERROR);
- out << "Unknown constant";
+ out << "Unknown constant\n";
break;
}
}
diff --git a/chromium/third_party/angle/src/compiler/translator/util.cpp b/chromium/third_party/angle/src/compiler/translator/util.cpp
index 87a3dda1007..6a2f9faa890 100644
--- a/chromium/third_party/angle/src/compiler/translator/util.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/util.cpp
@@ -334,6 +334,8 @@ GLenum GLVariableType(const TType &type)
return GL_SAMPLER_CUBE;
case EbtSamplerExternalOES:
return GL_SAMPLER_EXTERNAL_OES;
+ case EbtSamplerExternal2DY2YEXT:
+ return GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT;
case EbtSampler2DRect:
return GL_SAMPLER_2D_RECT_ARB;
case EbtSampler2DArray:
diff --git a/chromium/third_party/angle/src/gpu_info_util/SystemInfo.cpp b/chromium/third_party/angle/src/gpu_info_util/SystemInfo.cpp
index 807f27d2a7a..dd384c66d74 100644
--- a/chromium/third_party/angle/src/gpu_info_util/SystemInfo.cpp
+++ b/chromium/third_party/angle/src/gpu_info_util/SystemInfo.cpp
@@ -12,6 +12,7 @@
#include <sstream>
#include "common/debug.h"
+#include "common/string_utils.h"
namespace angle
{
@@ -117,6 +118,19 @@ bool ParseMacMachineModel(const std::string &identifier,
return true;
}
+bool CMDeviceIDToDeviceAndVendorID(const std::string &id, uint32_t *vendorId, uint32_t *deviceId)
+{
+ unsigned int vendor = 0;
+ unsigned int device = 0;
+
+ bool success = id.length() >= 21 && HexStringToUInt(id.substr(8, 4), &vendor) &&
+ HexStringToUInt(id.substr(17, 4), &device);
+
+ *vendorId = vendor;
+ *deviceId = device;
+ return success;
+}
+
void FindPrimaryGPU(SystemInfo *info)
{
ASSERT(!info->gpus.empty());
diff --git a/chromium/third_party/angle/src/gpu_info_util/SystemInfo_internal.h b/chromium/third_party/angle/src/gpu_info_util/SystemInfo_internal.h
index d636a4482a2..d2f61246621 100644
--- a/chromium/third_party/angle/src/gpu_info_util/SystemInfo_internal.h
+++ b/chromium/third_party/angle/src/gpu_info_util/SystemInfo_internal.h
@@ -27,6 +27,7 @@ bool ParseMacMachineModel(const std::string &identifier,
std::string *type,
int32_t *major,
int32_t *minor);
+bool CMDeviceIDToDeviceAndVendorID(const std::string &id, uint32_t *vendorId, uint32_t *deviceId);
// In the case there are multiple GPUs, this finds the primary one and sets Optimus or AMD
// Switchable
diff --git a/chromium/third_party/angle/src/gpu_info_util/SystemInfo_unittest.cpp b/chromium/third_party/angle/src/gpu_info_util/SystemInfo_unittest.cpp
index 104d712e241..37d13845db4 100644
--- a/chromium/third_party/angle/src/gpu_info_util/SystemInfo_unittest.cpp
+++ b/chromium/third_party/angle/src/gpu_info_util/SystemInfo_unittest.cpp
@@ -100,4 +100,32 @@ TEST(SystemInfoTest, MacMachineModelParsing)
EXPECT_EQ(2, minor);
}
+// Test Windows CM Device ID parsing
+TEST(SystemInfoTest, CMDeviceIDToDeviceAndVendorID)
+{
+ uint32_t vendor = 0;
+ uint32_t device = 0;
+
+ // Test on a real-life CM Device ID
+ EXPECT_TRUE(CMDeviceIDToDeviceAndVendorID(
+ "PCI\\VEN_10DE&DEV_0FFA&SUBSYS_094B10DE&REV_A1\\4&95673C&0&0018", &vendor, &device));
+ EXPECT_EQ(0x10deu, vendor);
+ EXPECT_EQ(0x0ffau, device);
+
+ // Test on a stripped-down but valid CM Device ID string
+ EXPECT_TRUE(CMDeviceIDToDeviceAndVendorID("PCI\\VEN_10DE&DEV_0FFA", &vendor, &device));
+ EXPECT_EQ(0x10deu, vendor);
+ EXPECT_EQ(0x0ffau, device);
+
+ // Test on a string that is too small
+ EXPECT_FALSE(CMDeviceIDToDeviceAndVendorID("\\VEN_10DE&DEV_0FFA", &vendor, &device));
+ EXPECT_EQ(0u, vendor);
+ EXPECT_EQ(0u, device);
+
+ // Test with invalid number
+ EXPECT_FALSE(CMDeviceIDToDeviceAndVendorID("PCI\\VEN_XXXX&DEV_XXXX", &vendor, &device));
+ EXPECT_EQ(0u, vendor);
+ EXPECT_EQ(0u, device);
+}
+
} // anonymous namespace
diff --git a/chromium/third_party/angle/src/gpu_info_util/SystemInfo_win.cpp b/chromium/third_party/angle/src/gpu_info_util/SystemInfo_win.cpp
new file mode 100644
index 00000000000..30738224bf2
--- /dev/null
+++ b/chromium/third_party/angle/src/gpu_info_util/SystemInfo_win.cpp
@@ -0,0 +1,204 @@
+//
+// Copyright (c) 2013-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.
+//
+
+// SystemInfo_win.cpp: implementation of the Windows-specific parts of SystemInfo.h
+
+#include "gpu_info_util/SystemInfo_internal.h"
+
+// Windows.h needs to be included first
+#include <windows.h>
+
+#if defined(GPU_INFO_USE_SETUPAPI)
+#include <cfgmgr32.h>
+#include <setupapi.h>
+#elif defined(GPU_INFO_USE_DXGI)
+#include <dxgi.h>
+#include <d3d10.h>
+#else
+#error "SystemInfo_win needs at least GPU_INFO_USE_SETUPAPI or GPU_INFO_USE_DXGI defined"
+#endif
+
+#include <array>
+#include <sstream>
+
+namespace angle
+{
+
+namespace
+{
+
+#if defined(GPU_INFO_USE_SETUPAPI)
+
+std::string GetRegistryStringValue(HKEY key, const char *valueName)
+{
+ std::array<char, 255> value;
+ DWORD valueSize = sizeof(value);
+ if (RegQueryValueExA(key, valueName, nullptr, nullptr, reinterpret_cast<LPBYTE>(value.data()),
+ &valueSize) == ERROR_SUCCESS)
+ {
+ return value.data();
+ }
+ return "";
+}
+
+// Gathers information about the devices from the registry. The reason why we aren't using
+// a dedicated API such as DXGI is that we need information like the driver vendor and date.
+// DXGI doesn't provide a way to know the device registry key from an IDXGIAdapter.
+bool GetDevicesFromRegistry(std::vector<GPUDeviceInfo> *devices)
+{
+ // Display adapter class GUID from
+ // https://msdn.microsoft.com/en-us/library/windows/hardware/ff553426%28v=vs.85%29.aspx
+ GUID displayClass = {
+ 0x4d36e968, 0xe325, 0x11ce, {0xbf, 0xc1, 0x08, 0x00, 0x2b, 0xe1, 0x03, 0x18}};
+
+ HDEVINFO deviceInfo = SetupDiGetClassDevsW(&displayClass, nullptr, nullptr, DIGCF_PRESENT);
+
+ if (deviceInfo == INVALID_HANDLE_VALUE)
+ {
+ return false;
+ }
+
+ // This iterates over the devices of the "Display adapter" class
+ DWORD deviceIndex = 0;
+ SP_DEVINFO_DATA deviceData;
+ deviceData.cbSize = sizeof(deviceData);
+ while (SetupDiEnumDeviceInfo(deviceInfo, deviceIndex++, &deviceData))
+ {
+ // The device and vendor IDs can be gathered directly, but information about the driver
+ // requires some registry digging
+ char fullDeviceID[MAX_DEVICE_ID_LEN];
+ if (CM_Get_Device_IDA(deviceData.DevInst, fullDeviceID, MAX_DEVICE_ID_LEN, 0) != CR_SUCCESS)
+ {
+ continue;
+ }
+
+ GPUDeviceInfo device;
+
+ if (!CMDeviceIDToDeviceAndVendorID(fullDeviceID, &device.vendorId, &device.deviceId))
+ {
+ continue;
+ }
+
+ // The driver key will end with something like {<displayClass>}/<4 digit number>.
+ std::array<WCHAR, 255> value;
+ if (!SetupDiGetDeviceRegistryPropertyW(deviceInfo, &deviceData, SPDRP_DRIVER, nullptr,
+ reinterpret_cast<PBYTE>(value.data()), sizeof(value),
+ nullptr))
+ {
+ continue;
+ }
+
+ std::wstring driverKey = L"System\\CurrentControlSet\\Control\\Class\\";
+ driverKey += value.data();
+
+ HKEY key;
+ if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, driverKey.c_str(), 0, KEY_QUERY_VALUE, &key) !=
+ ERROR_SUCCESS)
+ {
+ continue;
+ }
+
+ device.driverVersion = GetRegistryStringValue(key, "DriverVersion");
+ device.driverDate = GetRegistryStringValue(key, "DriverDate");
+ device.driverVendor = GetRegistryStringValue(key, "ProviderName");
+
+ RegCloseKey(key);
+
+ devices->push_back(device);
+ }
+
+ SetupDiDestroyDeviceInfoList(deviceInfo);
+
+ return true;
+}
+
+#elif defined(GPU_INFO_USE_DXGI)
+
+bool GetDevicesFromDXGI(std::vector<GPUDeviceInfo> *devices)
+{
+ IDXGIFactory *factory;
+ if (!SUCCEEDED(CreateDXGIFactory(__uuidof(IDXGIFactory), reinterpret_cast<void **>(&factory))))
+ {
+ return false;
+ }
+
+ UINT i = 0;
+ IDXGIAdapter *adapter = nullptr;
+ while (factory->EnumAdapters(i++, &adapter) != DXGI_ERROR_NOT_FOUND)
+ {
+ DXGI_ADAPTER_DESC desc;
+ adapter->GetDesc(&desc);
+
+ LARGE_INTEGER umdVersion;
+ if (adapter->CheckInterfaceSupport(__uuidof(ID3D10Device), &umdVersion) ==
+ DXGI_ERROR_UNSUPPORTED)
+ {
+ adapter->Release();
+ continue;
+ }
+
+ // The UMD driver version here is the same as in the registry except for the last number.
+ uint64_t intVersion = umdVersion.QuadPart;
+ std::ostringstream o;
+
+ const uint64_t kMask = 0xFF;
+ o << ((intVersion >> 48) & kMask) << ".";
+ o << ((intVersion >> 32) & kMask) << ".";
+ o << ((intVersion >> 16) & kMask) << ".";
+ o << (intVersion & kMask);
+
+ GPUDeviceInfo device;
+ device.vendorId = desc.VendorId;
+ device.deviceId = desc.DeviceId;
+ device.driverVersion = o.str();
+
+ devices->push_back(device);
+
+ adapter->Release();
+ }
+
+ factory->Release();
+
+ return true;
+}
+
+#else
+#error
+#endif
+
+} // anonymous namespace
+
+bool GetSystemInfo(SystemInfo *info)
+{
+#if defined(GPU_INFO_USE_SETUPAPI)
+ if (!GetDevicesFromRegistry(&info->gpus))
+ {
+ return false;
+ }
+#elif defined(GPU_INFO_USE_DXGI)
+ if (!GetDevicesFromDXGI(&info->gpus))
+ {
+ return false;
+ }
+#else
+#error
+#endif
+
+ if (info->gpus.size() == 0)
+ {
+ return false;
+ }
+
+ FindPrimaryGPU(info);
+
+ // nvd3d9wrap.dll is loaded into all processes when Optimus is enabled.
+ HMODULE nvd3d9wrap = GetModuleHandleW(L"nvd3d9wrap.dll");
+ info->isOptimus = nvd3d9wrap != nullptr;
+
+ return true;
+}
+
+} // namespace angle
diff --git a/chromium/third_party/angle/src/image_util/loadimage.h b/chromium/third_party/angle/src/image_util/loadimage.h
index 598e852f185..3e8aac79c23 100644
--- a/chromium/third_party/angle/src/image_util/loadimage.h
+++ b/chromium/third_party/angle/src/image_util/loadimage.h
@@ -561,6 +561,16 @@ void LoadETC2RGB8ToRGBA8(size_t width,
size_t outputRowPitch,
size_t outputDepthPitch);
+void LoadETC2RGB8ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch);
+
void LoadETC2SRGB8ToRGBA8(size_t width,
size_t height,
size_t depth,
@@ -571,6 +581,16 @@ void LoadETC2SRGB8ToRGBA8(size_t width,
size_t outputRowPitch,
size_t outputDepthPitch);
+void LoadETC2SRGB8ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch);
+
void LoadETC2RGB8A1ToRGBA8(size_t width,
size_t height,
size_t depth,
@@ -581,6 +601,16 @@ void LoadETC2RGB8A1ToRGBA8(size_t width,
size_t outputRowPitch,
size_t outputDepthPitch);
+void LoadETC2RGB8A1ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch);
+
void LoadETC2SRGB8A1ToRGBA8(size_t width,
size_t height,
size_t depth,
@@ -591,6 +621,16 @@ void LoadETC2SRGB8A1ToRGBA8(size_t width,
size_t outputRowPitch,
size_t outputDepthPitch);
+void LoadETC2SRGB8A1ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch);
+
void LoadETC2RGBA8ToRGBA8(size_t width,
size_t height,
size_t depth,
diff --git a/chromium/third_party/angle/src/image_util/loadimage_etc.cpp b/chromium/third_party/angle/src/image_util/loadimage_etc.cpp
index b0881f72878..7c7e8dd5e7a 100644
--- a/chromium/third_party/angle/src/image_util/loadimage_etc.cpp
+++ b/chromium/third_party/angle/src/image_util/loadimage_etc.cpp
@@ -528,8 +528,9 @@ struct ETC2Block
int b2 = extend_4to8bits(block.HB2);
static const int distance[8] = {3, 6, 11, 16, 23, 32, 41, 64};
- const int d = distance[(block.Hda << 2) | (block.Hdb << 1) |
- ((r1 << 16 | g1 << 8 | b1) >= (r2 << 16 | g2 << 8 | b2) ? 1 : 0)];
+ const int orderingTrickBit =
+ ((r1 << 16 | g1 << 8 | b1) >= (r2 << 16 | g2 << 8 | b2) ? 1 : 0);
+ const int d = distance[(block.Hda << 2) | (block.Hdb << 1) | orderingTrickBit];
const R8G8B8A8 paintColors[4] = {
createRGBA(r1 + d, g1 + d, b1 + d), createRGBA(r1 - d, g1 - d, b1 - d),
@@ -1129,8 +1130,48 @@ struct ETC2Block
const uint8_t alphaValues[4][4],
bool nonOpaquePunchThroughAlpha) const
{
- // TODO (mgong): Will be implemented soon
- UNIMPLEMENTED();
+ static const size_t kNumColors = 4;
+
+ // Table C.8, distance index for T and H modes
+ const auto &block = u.idht.mode.tm;
+
+ int r1 = extend_4to8bits(block.TR1a << 2 | block.TR1b);
+ int g1 = extend_4to8bits(block.TG1);
+ int b1 = extend_4to8bits(block.TB1);
+ int r2 = extend_4to8bits(block.TR2);
+ int g2 = extend_4to8bits(block.TG2);
+ int b2 = extend_4to8bits(block.TB2);
+
+ static int distance[8] = {3, 6, 11, 16, 23, 32, 41, 64};
+ const int d = distance[block.Tda << 1 | block.Tdb];
+
+ // In ETC opaque punch through formats, index == 2 means transparent pixel.
+ // Thus we don't need to compute its color, just assign it as black.
+ const R8G8B8A8 paintColors[kNumColors] = {
+ createRGBA(r1, g1, b1), createRGBA(r2 + d, g2 + d, b2 + d),
+ nonOpaquePunchThroughAlpha ? createRGBA(0, 0, 0, 0) : createRGBA(r2, g2, b2),
+ createRGBA(r2 - d, g2 - d, b2 - d),
+ };
+
+ int pixelIndices[kNumPixelsInBlock];
+ int pixelIndexCounts[kNumColors] = {0};
+ for (size_t j = 0; j < 4; j++)
+ {
+ int *row = &pixelIndices[j * 4];
+ for (size_t i = 0; i < 4; i++)
+ {
+ const size_t pixelIndex = getIndex(i, j);
+ row[i] = static_cast<int>(pixelIndex);
+ pixelIndexCounts[pixelIndex]++;
+ }
+ }
+
+ int minColorIndex, maxColorIndex;
+ selectEndPointPCA(pixelIndexCounts, paintColors, kNumColors, &minColorIndex,
+ &maxColorIndex);
+
+ packBC1(dest, pixelIndices, pixelIndexCounts, paintColors, kNumColors, minColorIndex,
+ maxColorIndex, nonOpaquePunchThroughAlpha);
}
void transcodeHBlockToBC1(uint8_t *dest,
@@ -1141,8 +1182,51 @@ struct ETC2Block
const uint8_t alphaValues[4][4],
bool nonOpaquePunchThroughAlpha) const
{
- // TODO (mgong): Will be implemented soon
- UNIMPLEMENTED();
+ static const size_t kNumColors = 4;
+
+ // Table C.8, distance index for T and H modes
+ const auto &block = u.idht.mode.hm;
+
+ int r1 = extend_4to8bits(block.HR1);
+ int g1 = extend_4to8bits(block.HG1a << 1 | block.HG1b);
+ int b1 = extend_4to8bits(block.HB1a << 3 | block.HB1b << 1 | block.HB1c);
+ int r2 = extend_4to8bits(block.HR2);
+ int g2 = extend_4to8bits(block.HG2a << 1 | block.HG2b);
+ int b2 = extend_4to8bits(block.HB2);
+
+ static const int distance[8] = {3, 6, 11, 16, 23, 32, 41, 64};
+ const int orderingTrickBit =
+ ((r1 << 16 | g1 << 8 | b1) >= (r2 << 16 | g2 << 8 | b2) ? 1 : 0);
+ const int d = distance[(block.Hda << 2) | (block.Hdb << 1) | orderingTrickBit];
+
+ // In ETC opaque punch through formats, index == 2 means transparent pixel.
+ // Thus we don't need to compute its color, just assign it as black.
+ const R8G8B8A8 paintColors[kNumColors] = {
+ createRGBA(r1 + d, g1 + d, b1 + d), createRGBA(r1 - d, g1 - d, b1 - d),
+ nonOpaquePunchThroughAlpha ? createRGBA(0, 0, 0, 0)
+ : createRGBA(r2 + d, g2 + d, b2 + d),
+ createRGBA(r2 - d, g2 - d, b2 - d),
+ };
+
+ int pixelIndices[kNumPixelsInBlock];
+ int pixelIndexCounts[kNumColors] = {0};
+ for (size_t j = 0; j < 4; j++)
+ {
+ int *row = &pixelIndices[j * 4];
+ for (size_t i = 0; i < 4; i++)
+ {
+ const size_t pixelIndex = getIndex(i, j);
+ row[i] = static_cast<int>(pixelIndex);
+ pixelIndexCounts[pixelIndex]++;
+ }
+ }
+
+ int minColorIndex, maxColorIndex;
+ selectEndPointPCA(pixelIndexCounts, paintColors, kNumColors, &minColorIndex,
+ &maxColorIndex);
+
+ packBC1(dest, pixelIndices, pixelIndexCounts, paintColors, kNumColors, minColorIndex,
+ maxColorIndex, nonOpaquePunchThroughAlpha);
}
void transcodePlanarBlockToBC1(uint8_t *dest,
@@ -1152,8 +1236,22 @@ struct ETC2Block
size_t h,
const uint8_t alphaValues[4][4]) const
{
- // TODO (mgong): Will be implemented soon
- UNIMPLEMENTED();
+ static const size_t kNumColors = kNumPixelsInBlock;
+
+ R8G8B8A8 rgbaBlock[kNumColors];
+ decodePlanarBlock(reinterpret_cast<uint8_t *>(rgbaBlock), x, y, w, h, sizeof(R8G8B8A8) * 4,
+ alphaValues);
+
+ // Planar block doesn't have a color table, fill indices as full
+ int pixelIndices[kNumPixelsInBlock] = {0, 1, 2, 3, 4, 5, 6, 7,
+ 8, 9, 10, 11, 12, 13, 14, 15};
+ int pixelIndexCounts[kNumColors] = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1};
+
+ int minColorIndex, maxColorIndex;
+ selectEndPointPCA(pixelIndexCounts, rgbaBlock, kNumColors, &minColorIndex, &maxColorIndex);
+
+ packBC1(dest, pixelIndices, pixelIndexCounts, rgbaBlock, kNumColors, minColorIndex,
+ maxColorIndex, false);
}
// Single channel utility functions
@@ -1499,6 +1597,20 @@ void LoadETC2RGB8ToRGBA8(size_t width,
outputRowPitch, outputDepthPitch, false);
}
+void LoadETC2RGB8ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch)
+{
+ LoadETC2RGB8ToBC1(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
+ outputRowPitch, outputDepthPitch, false);
+}
+
void LoadETC2SRGB8ToRGBA8(size_t width,
size_t height,
size_t depth,
@@ -1513,6 +1625,20 @@ void LoadETC2SRGB8ToRGBA8(size_t width,
outputRowPitch, outputDepthPitch, false);
}
+void LoadETC2SRGB8ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch)
+{
+ LoadETC2RGB8ToBC1(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
+ outputRowPitch, outputDepthPitch, false);
+}
+
void LoadETC2RGB8A1ToRGBA8(size_t width,
size_t height,
size_t depth,
@@ -1527,6 +1653,20 @@ void LoadETC2RGB8A1ToRGBA8(size_t width,
outputRowPitch, outputDepthPitch, true);
}
+void LoadETC2RGB8A1ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch)
+{
+ LoadETC2RGB8ToBC1(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
+ outputRowPitch, outputDepthPitch, true);
+}
+
void LoadETC2SRGB8A1ToRGBA8(size_t width,
size_t height,
size_t depth,
@@ -1541,6 +1681,20 @@ void LoadETC2SRGB8A1ToRGBA8(size_t width,
outputRowPitch, outputDepthPitch, true);
}
+void LoadETC2SRGB8A1ToBC1(size_t width,
+ size_t height,
+ size_t depth,
+ const uint8_t *input,
+ size_t inputRowPitch,
+ size_t inputDepthPitch,
+ uint8_t *output,
+ size_t outputRowPitch,
+ size_t outputDepthPitch)
+{
+ LoadETC2RGB8ToBC1(width, height, depth, input, inputRowPitch, inputDepthPitch, output,
+ outputRowPitch, outputDepthPitch, true);
+}
+
void LoadETC2RGBA8ToRGBA8(size_t width,
size_t height,
size_t depth,
diff --git a/chromium/third_party/angle/src/libANGLE/Buffer.cpp b/chromium/third_party/angle/src/libANGLE/Buffer.cpp
index d49a4604f88..bb2f9fdaedc 100644
--- a/chromium/third_party/angle/src/libANGLE/Buffer.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Buffer.cpp
@@ -67,7 +67,19 @@ Error Buffer::bufferData(const Context *context,
GLsizeiptr size,
GLenum usage)
{
- ANGLE_TRY(mImpl->setData(rx::SafeGetImpl(context), target, data, size, usage));
+ const void *dataForImpl = data;
+
+ // If we are using robust resource init, make sure the buffer starts cleared.
+ // TODO(jmadill): Investigate lazier clearing.
+ if (context && context->getGLState().isRobustResourceInitEnabled() && data == nullptr)
+ {
+ angle::MemoryBuffer *scratchBuffer = nullptr;
+ ANGLE_TRY(context->getScratchBuffer(static_cast<size_t>(size), &scratchBuffer));
+ std::fill(scratchBuffer->data(), scratchBuffer->data() + size, static_cast<uint8_t>(0));
+ dataForImpl = scratchBuffer->data();
+ }
+
+ ANGLE_TRY(mImpl->setData(rx::SafeGetImpl(context), target, dataForImpl, size, usage));
mIndexRangeCache.clear();
mState.mUsage = usage;
@@ -107,12 +119,8 @@ Error Buffer::map(const Context *context, GLenum access)
{
ASSERT(!mState.mMapped);
- Error error = mImpl->map(rx::SafeGetImpl(context), access, &mState.mMapPointer);
- if (error.isError())
- {
- mState.mMapPointer = nullptr;
- return error;
- }
+ mState.mMapPointer = nullptr;
+ ANGLE_TRY(mImpl->map(rx::SafeGetImpl(context), access, &mState.mMapPointer));
ASSERT(access == GL_WRITE_ONLY_OES);
@@ -123,7 +131,7 @@ Error Buffer::map(const Context *context, GLenum access)
mState.mAccessFlags = GL_MAP_WRITE_BIT;
mIndexRangeCache.clear();
- return error;
+ return NoError();
}
Error Buffer::mapRange(const Context *context,
@@ -134,13 +142,9 @@ Error Buffer::mapRange(const Context *context,
ASSERT(!mState.mMapped);
ASSERT(offset + length <= mState.mSize);
- Error error =
- mImpl->mapRange(rx::SafeGetImpl(context), offset, length, access, &mState.mMapPointer);
- if (error.isError())
- {
- mState.mMapPointer = nullptr;
- return error;
- }
+ mState.mMapPointer = nullptr;
+ ANGLE_TRY(
+ mImpl->mapRange(rx::SafeGetImpl(context), offset, length, access, &mState.mMapPointer));
mState.mMapped = GL_TRUE;
mState.mMapOffset = static_cast<GLint64>(offset);
@@ -158,19 +162,15 @@ Error Buffer::mapRange(const Context *context,
mIndexRangeCache.invalidateRange(static_cast<unsigned int>(offset), static_cast<unsigned int>(length));
}
- return error;
+ return NoError();
}
Error Buffer::unmap(const Context *context, GLboolean *result)
{
ASSERT(mState.mMapped);
- Error error = mImpl->unmap(rx::SafeGetImpl(context), result);
- if (error.isError())
- {
- *result = GL_FALSE;
- return error;
- }
+ *result = GL_FALSE;
+ ANGLE_TRY(mImpl->unmap(rx::SafeGetImpl(context), result));
mState.mMapped = GL_FALSE;
mState.mMapPointer = nullptr;
@@ -179,7 +179,7 @@ Error Buffer::unmap(const Context *context, GLboolean *result)
mState.mAccess = GL_WRITE_ONLY_OES;
mState.mAccessFlags = 0;
- return error;
+ return NoError();
}
void Buffer::onTransformFeedback()
diff --git a/chromium/third_party/angle/src/libANGLE/Caps.cpp b/chromium/third_party/angle/src/libANGLE/Caps.cpp
index 3bfdd9724f0..431c61007ae 100644
--- a/chromium/third_party/angle/src/libANGLE/Caps.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Caps.cpp
@@ -214,7 +214,8 @@ Extensions::Extensions()
textureNorm16(false),
pathRendering(false),
surfacelessContext(false),
- clientArrays(false)
+ clientArrays(false),
+ robustResourceInitialization(false)
{
}
@@ -598,7 +599,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_EXT_texture_storage"] = esOnlyExtension(&Extensions::textureStorage);
map["GL_OES_texture_npot"] = enableableExtension(&Extensions::textureNPOT);
map["GL_EXT_draw_buffers"] = enableableExtension(&Extensions::drawBuffers);
- map["GL_EXT_texture_filter_anisotropic"] = esOnlyExtension(&Extensions::textureFilterAnisotropic);
+ map["GL_EXT_texture_filter_anisotropic"] = enableableExtension(&Extensions::textureFilterAnisotropic);
map["GL_EXT_occlusion_query_boolean"] = esOnlyExtension(&Extensions::occlusionQueryBoolean);
map["GL_NV_fence"] = esOnlyExtension(&Extensions::fence);
map["GL_ANGLE_timer_query"] = esOnlyExtension(&Extensions::timerQuery);
@@ -648,6 +649,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_CHROMIUM_path_rendering"] = esOnlyExtension(&Extensions::pathRendering);
map["GL_OES_surfaceless_context"] = esOnlyExtension(&Extensions::surfacelessContext);
map["GL_ANGLE_client_arrays"] = esOnlyExtension(&Extensions::clientArrays);
+ map["GL_ANGLE_robust_resource_initialization"] = esOnlyExtension(&Extensions::robustResourceInitialization);
// clang-format on
return map;
@@ -1033,11 +1035,13 @@ DisplayExtensions::DisplayExtensions()
streamProducerD3DTextureNV12(false),
createContextWebGLCompatibility(false),
createContextBindGeneratesResource(false),
+ getSyncValues(false),
swapBuffersWithDamage(false),
pixelFormatFloat(false),
surfacelessContext(false),
displayTextureShareGroup(false),
- createContextClientArrays(false)
+ createContextClientArrays(false),
+ createContextRobustResourceInitialization(false)
{
}
@@ -1074,11 +1078,13 @@ std::vector<std::string> DisplayExtensions::getStrings() const
InsertExtensionString("EGL_ANGLE_stream_producer_d3d_texture_nv12", streamProducerD3DTextureNV12, &extensionStrings);
InsertExtensionString("EGL_ANGLE_create_context_webgl_compatibility", createContextWebGLCompatibility, &extensionStrings);
InsertExtensionString("EGL_CHROMIUM_create_context_bind_generates_resource", createContextBindGeneratesResource, &extensionStrings);
+ InsertExtensionString("EGL_CHROMIUM_sync_control", getSyncValues, &extensionStrings);
InsertExtensionString("EGL_EXT_swap_buffers_with_damage", swapBuffersWithDamage, &extensionStrings);
InsertExtensionString("EGL_EXT_pixel_format_float", pixelFormatFloat, &extensionStrings);
InsertExtensionString("EGL_KHR_surfaceless_context", surfacelessContext, &extensionStrings);
InsertExtensionString("EGL_ANGLE_display_texture_share_group", displayTextureShareGroup, &extensionStrings);
InsertExtensionString("EGL_ANGLE_create_context_client_arrays", createContextClientArrays, &extensionStrings);
+ InsertExtensionString("EGL_ANGLE_create_context_robust_resource_initialization", createContextRobustResourceInitialization, &extensionStrings);
// TODO(jmadill): Enable this when complete.
//InsertExtensionString("KHR_create_context_no_error", createContextNoError, &extensionStrings);
// clang-format on
diff --git a/chromium/third_party/angle/src/libANGLE/Caps.h b/chromium/third_party/angle/src/libANGLE/Caps.h
index 76ccaad55f0..87cddfcda0b 100644
--- a/chromium/third_party/angle/src/libANGLE/Caps.h
+++ b/chromium/third_party/angle/src/libANGLE/Caps.h
@@ -354,6 +354,9 @@ struct Extensions
// GL_ANGLE_client_arrays
bool clientArrays;
+
+ // GL_ANGLE_robust_resource_initialization
+ bool robustResourceInitialization;
};
struct ExtensionInfo
@@ -440,7 +443,7 @@ struct Caps
GLuint64 maxServerWaitTimeout;
// ES 3.1 (April 29, 2015) Table 20.41: Implementation dependent values (cont.)
- GLuint maxVertexAttribRelativeOffset;
+ GLint maxVertexAttribRelativeOffset;
GLuint maxVertexAttribBindings;
GLint maxVertexAttribStride;
GLuint maxElementsIndices;
@@ -641,6 +644,9 @@ struct DisplayExtensions
// EGL_CHROMIUM_create_context_bind_generates_resource
bool createContextBindGeneratesResource;
+ // EGL_CHROMIUM_get_sync_values
+ bool getSyncValues;
+
// EGL_EXT_swap_buffers_with_damage
bool swapBuffersWithDamage;
@@ -655,6 +661,9 @@ struct DisplayExtensions
// EGL_ANGLE_create_context_client_arrays
bool createContextClientArrays;
+
+ // EGL_ANGLE_create_context_robust_resource_initialization
+ bool createContextRobustResourceInitialization;
};
struct DeviceExtensions
diff --git a/chromium/third_party/angle/src/libANGLE/Compiler.cpp b/chromium/third_party/angle/src/libANGLE/Compiler.cpp
index 61db4166493..23854d2e480 100644
--- a/chromium/third_party/angle/src/libANGLE/Compiler.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Compiler.cpp
@@ -82,13 +82,14 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const ContextState &state)
mResources.MinProgramTexelOffset = caps.minProgramTexelOffset;
mResources.MaxProgramTexelOffset = caps.maxProgramTexelOffset;
- // GLSL ES 3.1 compute shader constants
+ // GLSL ES 3.1 constants
mResources.MaxImageUnits = caps.maxImageUnits;
mResources.MaxVertexImageUniforms = caps.maxVertexImageUniforms;
mResources.MaxFragmentImageUniforms = caps.maxFragmentImageUniforms;
mResources.MaxComputeImageUniforms = caps.maxComputeImageUniforms;
mResources.MaxCombinedImageUniforms = caps.maxCombinedImageUniforms;
mResources.MaxCombinedShaderOutputResources = caps.maxCombinedShaderOutputResources;
+ mResources.MaxUniformLocations = caps.maxUniformLocations;
for (size_t index = 0u; index < 3u; ++index)
{
diff --git a/chromium/third_party/angle/src/libANGLE/Context.cpp b/chromium/third_party/angle/src/libANGLE/Context.cpp
index 89e0b04c4ca..3c748dc6474 100644
--- a/chromium/third_party/angle/src/libANGLE/Context.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Context.cpp
@@ -204,6 +204,11 @@ bool GetClientArraysEnabled(const egl::AttributeMap &attribs)
return (attribs.get(EGL_CONTEXT_CLIENT_ARRAYS_ENABLED_ANGLE, EGL_TRUE) == EGL_TRUE);
}
+bool GetRobustResourceInit(const egl::AttributeMap &attribs)
+{
+ return (attribs.get(EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE, EGL_FALSE) == EGL_TRUE);
+}
+
std::string GetObjectLabelFromPointer(GLsizei length, const GLchar *label)
{
std::string labelName;
@@ -267,7 +272,8 @@ Context::Context(rx::EGLImplFactory *implFactory,
mRobustAccess(GetRobustAccess(attribs)),
mCurrentSurface(nullptr),
mSurfacelessFramebuffer(nullptr),
- mWebGLContext(GetWebGLContext(attribs))
+ mWebGLContext(GetWebGLContext(attribs)),
+ mScratchBuffer(1000u)
{
if (mRobustAccess)
{
@@ -278,7 +284,8 @@ Context::Context(rx::EGLImplFactory *implFactory,
initWorkarounds();
mGLState.initialize(mCaps, mExtensions, getClientVersion(), GetDebug(attribs),
- GetBindGeneratesResource(attribs), GetClientArraysEnabled(attribs));
+ GetBindGeneratesResource(attribs), GetClientArraysEnabled(attribs),
+ GetRobustResourceInit(attribs));
mFenceNVHandleAllocator.setBaseHandle(0);
@@ -314,6 +321,12 @@ Context::Context(rx::EGLImplFactory *implFactory,
{
bindIndexedAtomicCounterBuffer(0, i, 0, 0);
}
+
+ bindGenericShaderStorageBuffer(0);
+ for (unsigned int i = 0; i < mCaps.maxShaderStorageBufferBindings; i++)
+ {
+ bindIndexedShaderStorageBuffer(0, i, 0, 0);
+ }
}
if (mExtensions.eglImageExternal || mExtensions.eglStreamConsumerExternal)
@@ -800,6 +813,11 @@ void Context::deleteSampler(GLuint sampler)
void Context::deleteTransformFeedback(GLuint transformFeedback)
{
+ if (transformFeedback == 0)
+ {
+ return;
+ }
+
auto iter = mTransformFeedbackMap.find(transformFeedback);
if (iter != mTransformFeedbackMap.end())
{
@@ -987,7 +1005,7 @@ void Context::bindDrawIndirectBuffer(GLuint bufferHandle)
void Context::bindElementArrayBuffer(GLuint bufferHandle)
{
Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
- mGLState.getVertexArray()->setElementArrayBuffer(buffer);
+ mGLState.setElementArrayBuffer(buffer);
}
void Context::bindTexture(GLenum target, GLuint handle)
@@ -1027,6 +1045,15 @@ void Context::bindVertexArray(GLuint vertexArrayHandle)
mGLState.setVertexArrayBinding(vertexArray);
}
+void Context::bindVertexBuffer(GLuint bindingIndex,
+ GLuint bufferHandle,
+ GLintptr offset,
+ GLsizei stride)
+{
+ Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
+ mGLState.bindVertexBuffer(bindingIndex, buffer, offset, stride);
+}
+
void Context::bindSampler(GLuint textureUnit, GLuint samplerHandle)
{
ASSERT(textureUnit < mCaps.maxCombinedTextureImageUnits);
@@ -1080,6 +1107,21 @@ void Context::bindIndexedAtomicCounterBuffer(GLuint bufferHandle,
mGLState.setIndexedAtomicCounterBufferBinding(index, buffer, offset, size);
}
+void Context::bindGenericShaderStorageBuffer(GLuint bufferHandle)
+{
+ Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
+ mGLState.setGenericShaderStorageBufferBinding(buffer);
+}
+
+void Context::bindIndexedShaderStorageBuffer(GLuint bufferHandle,
+ GLuint index,
+ GLintptr offset,
+ GLsizeiptr size)
+{
+ Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
+ mGLState.setIndexedShaderStorageBufferBinding(index, buffer, offset, size);
+}
+
void Context::bindCopyReadBuffer(GLuint bufferHandle)
{
Buffer *buffer = mState.mBuffers->checkBufferAllocation(mImplementation.get(), bufferHandle);
@@ -1534,7 +1576,7 @@ void Context::getIntegerv(GLenum pname, GLint *params)
*params = mCaps.shaderStorageBufferOffsetAlignment;
break;
default:
- mGLState.getIntegerv(mState, pname, params);
+ mGLState.getIntegerv(this, pname, params);
break;
}
}
@@ -1652,6 +1694,62 @@ void Context::getBooleani_v(GLenum target, GLuint index, GLboolean *data)
}
}
+void Context::getBufferParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ Buffer *buffer = mGLState.getTargetBuffer(target);
+ QueryBufferParameteriv(buffer, pname, params);
+}
+
+void Context::getFramebufferAttachmentParameteriv(GLenum target,
+ GLenum attachment,
+ GLenum pname,
+ GLint *params)
+{
+ const Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
+ QueryFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params);
+}
+
+void Context::getRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ Renderbuffer *renderbuffer = mGLState.getCurrentRenderbuffer();
+ QueryRenderbufferiv(this, renderbuffer, pname, params);
+}
+
+void Context::getTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
+{
+ Texture *texture = getTargetTexture(target);
+ QueryTexParameterfv(texture, pname, params);
+}
+
+void Context::getTexParameteriv(GLenum target, GLenum pname, GLint *params)
+{
+ Texture *texture = getTargetTexture(target);
+ QueryTexParameteriv(texture, pname, params);
+}
+void Context::texParameterf(GLenum target, GLenum pname, GLfloat param)
+{
+ Texture *texture = getTargetTexture(target);
+ SetTexParameterf(texture, pname, param);
+}
+
+void Context::texParameterfv(GLenum target, GLenum pname, const GLfloat *params)
+{
+ Texture *texture = getTargetTexture(target);
+ SetTexParameterfv(texture, pname, params);
+}
+
+void Context::texParameteri(GLenum target, GLenum pname, GLint param)
+{
+ Texture *texture = getTargetTexture(target);
+ SetTexParameteri(texture, pname, param);
+}
+
+void Context::texParameteriv(GLenum target, GLenum pname, const GLint *params)
+{
+ Texture *texture = getTargetTexture(target);
+ SetTexParameteriv(texture, pname, params);
+}
+
void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
{
syncRendererState();
@@ -1975,6 +2073,23 @@ void Context::programPathFragmentInputGen(GLuint program,
programObject->pathFragmentInputGen(location, genMode, components, coeffs);
}
+GLuint Context::getProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar *name)
+{
+ const auto *programObject = getProgram(program);
+ return QueryProgramResourceIndex(programObject, programInterface, name);
+}
+
+void Context::getProgramResourceName(GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name)
+{
+ const auto *programObject = getProgram(program);
+ QueryProgramResourceName(programObject, programInterface, index, bufSize, length, name);
+}
+
void Context::handleError(const Error &error)
{
if (error.isError())
@@ -2271,10 +2386,7 @@ void Context::getSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *param
void Context::programParameteri(GLuint program, GLenum pname, GLint value)
{
gl::Program *programObject = getProgram(program);
- ASSERT(programObject != nullptr);
-
- ASSERT(pname == GL_PROGRAM_BINARY_RETRIEVABLE_HINT);
- programObject->setBinaryRetrievableHint(value != GL_FALSE);
+ SetProgramParameteri(programObject, pname, value);
}
void Context::initRendererString()
@@ -2404,6 +2516,16 @@ void Context::requestExtension(const char *name)
// Re-create the compiler with the requested extensions enabled.
SafeDelete(mCompiler);
mCompiler = new Compiler(mImplementation.get(), mState);
+
+ // Invalidate all cached completenesses for textures and framebuffer. Some extensions make new
+ // formats renderable or sampleable.
+ mState.mTextures->invalidateTextureComplenessCache();
+ for (auto &zeroTexture : mZeroTextures)
+ {
+ zeroTexture.second->invalidateCompletenessCache();
+ }
+
+ mState.mFramebuffers->invalidateFramebufferComplenessCache();
}
size_t Context::getRequestableExtensionStringCount() const
@@ -2477,6 +2599,10 @@ void Context::initCaps(const egl::DisplayExtensions &displayExtensions)
// Explicitly enable GL_ANGLE_robust_client_memory
mExtensions.robustClientMemory = true;
+ // Determine robust resource init availability from EGL.
+ mExtensions.robustResourceInitialization =
+ displayExtensions.createContextRobustResourceInitialization;
+
// Apply implementation limits
mCaps.maxVertexAttributes = std::min<GLuint>(mCaps.maxVertexAttributes, MAX_VERTEX_ATTRIBS);
mCaps.maxVertexAttribBindings =
@@ -2556,7 +2682,7 @@ void Context::syncRendererState()
const State::DirtyBits &dirtyBits = mGLState.getDirtyBits();
mImplementation->syncState(dirtyBits);
mGLState.clearDirtyBits();
- mGLState.syncDirtyObjects();
+ mGLState.syncDirtyObjects(this);
}
void Context::syncRendererState(const State::DirtyBits &bitMask,
@@ -2565,8 +2691,7 @@ void Context::syncRendererState(const State::DirtyBits &bitMask,
const State::DirtyBits &dirtyBits = (mGLState.getDirtyBits() & bitMask);
mImplementation->syncState(dirtyBits);
mGLState.clearDirtyBits(dirtyBits);
-
- mGLState.syncDirtyObjects(objectMask);
+ mGLState.syncDirtyObjects(this, objectMask);
}
void Context::blitFramebuffer(GLint srcX0,
@@ -2667,7 +2792,7 @@ void Context::copyTexImage2D(GLenum target,
GLint border)
{
// Only sync the read FBO
- mGLState.syncDirtyObject(GL_READ_FRAMEBUFFER);
+ mGLState.syncDirtyObject(this, GL_READ_FRAMEBUFFER);
Rectangle sourceArea(x, y, width, height);
@@ -2692,7 +2817,7 @@ void Context::copyTexSubImage2D(GLenum target,
}
// Only sync the read FBO
- mGLState.syncDirtyObject(GL_READ_FRAMEBUFFER);
+ mGLState.syncDirtyObject(this, GL_READ_FRAMEBUFFER);
Offset destOffset(xoffset, yoffset, 0);
Rectangle sourceArea(x, y, width, height);
@@ -2719,7 +2844,7 @@ void Context::copyTexSubImage3D(GLenum target,
}
// Only sync the read FBO
- mGLState.syncDirtyObject(GL_READ_FRAMEBUFFER);
+ mGLState.syncDirtyObject(this, GL_READ_FRAMEBUFFER);
Offset destOffset(xoffset, yoffset, zoffset);
Rectangle sourceArea(x, y, width, height);
@@ -2845,7 +2970,7 @@ void Context::readBuffer(GLenum mode)
void Context::discardFramebuffer(GLenum target, GLsizei numAttachments, const GLenum *attachments)
{
// Only sync the FBO
- mGLState.syncDirtyObject(target);
+ mGLState.syncDirtyObject(this, target);
Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
ASSERT(framebuffer);
@@ -2860,12 +2985,12 @@ void Context::invalidateFramebuffer(GLenum target,
const GLenum *attachments)
{
// Only sync the FBO
- mGLState.syncDirtyObject(target);
+ mGLState.syncDirtyObject(this, target);
Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
ASSERT(framebuffer);
- if (framebuffer->checkStatus(mState) != GL_FRAMEBUFFER_COMPLETE)
+ if (framebuffer->checkStatus(this) != GL_FRAMEBUFFER_COMPLETE)
{
return;
}
@@ -2882,12 +3007,12 @@ void Context::invalidateSubFramebuffer(GLenum target,
GLsizei height)
{
// Only sync the FBO
- mGLState.syncDirtyObject(target);
+ mGLState.syncDirtyObject(this, target);
Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
ASSERT(framebuffer);
- if (framebuffer->checkStatus(mState) != GL_FRAMEBUFFER_COMPLETE)
+ if (framebuffer->checkStatus(this) != GL_FRAMEBUFFER_COMPLETE)
{
return;
}
@@ -3077,7 +3202,10 @@ void Context::generateMipmap(GLenum target)
}
void Context::copyTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
@@ -3088,13 +3216,16 @@ void Context::copyTextureCHROMIUM(GLuint sourceId,
gl::Texture *sourceTexture = getTexture(sourceId);
gl::Texture *destTexture = getTexture(destId);
- handleError(destTexture->copyTexture(this, internalFormat, destType, unpackFlipY == GL_TRUE,
- unpackPremultiplyAlpha == GL_TRUE,
- unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
+ handleError(destTexture->copyTexture(
+ this, destTarget, destLevel, internalFormat, destType, sourceLevel, unpackFlipY == GL_TRUE,
+ unpackPremultiplyAlpha == GL_TRUE, unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
}
void Context::copySubTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
@@ -3117,9 +3248,9 @@ void Context::copySubTextureCHROMIUM(GLuint sourceId,
gl::Texture *destTexture = getTexture(destId);
Offset offset(xoffset, yoffset, 0);
Rectangle area(x, y, width, height);
- handleError(destTexture->copySubTexture(this, offset, area, unpackFlipY == GL_TRUE,
- unpackPremultiplyAlpha == GL_TRUE,
- unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
+ handleError(destTexture->copySubTexture(
+ this, destTarget, destLevel, offset, sourceLevel, area, unpackFlipY == GL_TRUE,
+ unpackPremultiplyAlpha == GL_TRUE, unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
}
void Context::compressedCopyTextureCHROMIUM(GLuint sourceId, GLuint destId)
@@ -3505,6 +3636,34 @@ void Context::vertexAttribPointer(GLuint index,
normalized == GL_TRUE, false, stride, ptr);
}
+void Context::vertexAttribFormat(GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLuint relativeOffset)
+{
+ mGLState.setVertexAttribFormat(attribIndex, size, type, normalized == GL_TRUE, false,
+ relativeOffset);
+}
+
+void Context::vertexAttribIFormat(GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ GLuint relativeOffset)
+{
+ mGLState.setVertexAttribFormat(attribIndex, size, type, false, true, relativeOffset);
+}
+
+void Context::vertexAttribBinding(GLuint attribIndex, GLuint bindingIndex)
+{
+ mGLState.setVertexAttribBinding(attribIndex, bindingIndex);
+}
+
+void Context::setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor)
+{
+ mGLState.setVertexBindingDivisor(bindingIndex, divisor);
+}
+
void Context::viewport(GLint x, GLint y, GLsizei width, GLsizei height)
{
mGLState.setViewportParams(x, y, width, height);
@@ -3727,11 +3886,7 @@ void Context::bindBuffer(GLenum target, GLuint buffer)
bindGenericAtomicCounterBuffer(buffer);
break;
case GL_SHADER_STORAGE_BUFFER:
- if (buffer != 0)
- {
- // Binding buffers to this binding point is not implemented yet.
- UNIMPLEMENTED();
- }
+ bindGenericShaderStorageBuffer(buffer);
break;
case GL_DRAW_INDIRECT_BUFFER:
bindDrawIndirectBuffer(buffer);
@@ -3776,11 +3931,8 @@ void Context::bindBufferRange(GLenum target,
bindGenericAtomicCounterBuffer(buffer);
break;
case GL_SHADER_STORAGE_BUFFER:
- if (buffer != 0)
- {
- // Binding buffers to this binding point is not implemented yet.
- UNIMPLEMENTED();
- }
+ bindIndexedShaderStorageBuffer(buffer, index, offset, size);
+ bindGenericShaderStorageBuffer(buffer);
break;
default:
UNREACHABLE();
@@ -3824,7 +3976,7 @@ void Context::texStorage2DMultisample(GLenum target,
void Context::getMultisamplefv(GLenum pname, GLuint index, GLfloat *val)
{
- mGLState.syncDirtyObject(GL_READ_FRAMEBUFFER);
+ mGLState.syncDirtyObject(this, GL_READ_FRAMEBUFFER);
const Framebuffer *framebuffer = mGLState.getReadFramebuffer();
switch (pname)
@@ -3863,6 +4015,12 @@ void Context::renderbufferStorageMultisample(GLenum target,
renderbuffer->setStorageMultisample(samples, convertedInternalFormat, width, height));
}
+void Context::getSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
+{
+ const FenceSync *syncObject = getFenceSync(sync);
+ handleError(QuerySynciv(syncObject, pname, bufSize, length, values));
+}
+
void Context::getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params)
{
Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
@@ -3875,4 +4033,23 @@ void Context::setFramebufferParameteri(GLenum target, GLenum pname, GLint param)
SetFramebufferParameteri(framebuffer, pname, param);
}
+Error Context::getScratchBuffer(size_t requestedSize, angle::MemoryBuffer **scratchBufferOut) const
+{
+ if (!mScratchBuffer.get(requestedSize, scratchBufferOut))
+ {
+ return gl::OutOfMemory() << "Failed to allocate internal buffer.";
+ }
+ return gl::NoError();
+}
+
+void Context::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
+{
+ if (numGroupsX == 0u || numGroupsY == 0u || numGroupsZ == 0u)
+ {
+ return;
+ }
+
+ mImplementation->dispatchCompute(numGroupsX, numGroupsY, numGroupsZ);
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/Context.h b/chromium/third_party/angle/src/libANGLE/Context.h
index c96e27a3add..42d792b4f9d 100644
--- a/chromium/third_party/angle/src/libANGLE/Context.h
+++ b/chromium/third_party/angle/src/libANGLE/Context.h
@@ -14,13 +14,14 @@
#include <string>
#include "angle_gl.h"
+#include "common/MemoryBuffer.h"
#include "common/angleutils.h"
-#include "libANGLE/RefCountObject.h"
#include "libANGLE/Caps.h"
#include "libANGLE/Constants.h"
#include "libANGLE/ContextState.h"
#include "libANGLE/Error.h"
#include "libANGLE/HandleAllocator.h"
+#include "libANGLE/RefCountObject.h"
#include "libANGLE/VertexAttribute.h"
#include "libANGLE/Workarounds.h"
#include "libANGLE/angletypes.h"
@@ -128,6 +129,10 @@ class Context final : public ValidationContext
void bindReadFramebuffer(GLuint framebufferHandle);
void bindDrawFramebuffer(GLuint framebufferHandle);
void bindVertexArray(GLuint vertexArrayHandle);
+ void bindVertexBuffer(GLuint bindingIndex,
+ GLuint bufferHandle,
+ GLintptr offset,
+ GLsizei stride);
void bindSampler(GLuint textureUnit, GLuint samplerHandle);
void bindGenericUniformBuffer(GLuint bufferHandle);
void bindIndexedUniformBuffer(GLuint bufferHandle,
@@ -144,6 +149,11 @@ class Context final : public ValidationContext
GLuint index,
GLintptr offset,
GLsizeiptr size);
+ void bindGenericShaderStorageBuffer(GLuint bufferHandle);
+ void bindIndexedShaderStorageBuffer(GLuint bufferHandle,
+ GLuint index,
+ GLintptr offset,
+ GLsizeiptr size);
void bindCopyReadBuffer(GLuint bufferHandle);
void bindCopyWriteBuffer(GLuint bufferHandle);
void bindPixelPackBuffer(GLuint bufferHandle);
@@ -162,6 +172,21 @@ class Context final : public ValidationContext
void getQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
void setVertexAttribDivisor(GLuint index, GLuint divisor);
+ void setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor);
+
+ void getBufferParameteriv(GLenum target, GLenum pname, GLint *params);
+ void getFramebufferAttachmentParameteriv(GLenum target,
+ GLenum attachment,
+ GLenum pname,
+ GLint *params);
+ void getRenderbufferParameteriv(GLenum target, GLenum pname, GLint *params);
+
+ void getTexParameterfv(GLenum target, GLenum pname, GLfloat *params);
+ void getTexParameteriv(GLenum target, GLenum pname, GLint *params);
+ void texParameterf(GLenum target, GLenum pname, GLfloat param);
+ void texParameterfv(GLenum target, GLenum pname, const GLfloat *params);
+ void texParameteri(GLenum target, GLenum pname, GLint param);
+ void texParameteriv(GLenum target, GLenum pname, const GLint *params);
void samplerParameteri(GLuint sampler, GLenum pname, GLint param);
void samplerParameteriv(GLuint sampler, GLenum pname, const GLint *param);
@@ -173,6 +198,14 @@ class Context final : public ValidationContext
void programParameteri(GLuint program, GLenum pname, GLint value);
+ GLuint getProgramResourceIndex(GLuint program, GLenum programInterface, const GLchar *name);
+ void getProgramResourceName(GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name);
+
Buffer *getBuffer(GLuint handle) const;
FenceNV *getFenceNV(GLuint handle);
FenceSync *getFenceSync(GLsync handle) const;
@@ -248,19 +281,26 @@ class Context final : public ValidationContext
void vertexAttrib3fv(GLuint index, const GLfloat *values);
void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
void vertexAttrib4fv(GLuint index, const GLfloat *values);
+ void vertexAttribFormat(GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ GLboolean normalized,
+ GLuint relativeOffset);
+ void vertexAttribIFormat(GLuint attribIndex, GLint size, GLenum type, GLuint relativeOffset);
+ void vertexAttribBinding(GLuint attribIndex, GLuint bindingIndex);
void vertexAttribPointer(GLuint index,
GLint size,
GLenum type,
GLboolean normalized,
GLsizei stride,
const GLvoid *ptr);
- void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
-
void vertexAttribIPointer(GLuint index,
GLint size,
GLenum type,
GLsizei stride,
const GLvoid *pointer);
+ void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
+
void vertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w);
void vertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w);
void vertexAttribI4iv(GLuint index, const GLint *v);
@@ -479,14 +519,20 @@ class Context final : public ValidationContext
GLsizei imageSize,
const GLvoid *data);
void copyTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
void copySubTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
@@ -525,6 +571,8 @@ class Context final : public ValidationContext
GLsizei width,
GLsizei height);
+ void getSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
+
// CHROMIUM_framebuffer_mixed_samples
void setCoverageModulation(GLenum components);
@@ -647,6 +695,10 @@ class Context final : public ValidationContext
void getFramebufferParameteriv(GLenum target, GLenum pname, GLint *params);
void setFramebufferParameteri(GLenum target, GLenum pname, GLint param);
+ Error getScratchBuffer(size_t requestedSize, angle::MemoryBuffer **scratchBufferOut) const;
+
+ void dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ);
+
private:
void syncRendererState();
void syncRendererState(const State::DirtyBits &bitMask, const State::DirtyObjects &objectMask);
@@ -739,6 +791,9 @@ class Context final : public ValidationContext
State::DirtyObjects mBlitDirtyObjects;
Workarounds mWorkarounds;
+
+ // Not really a property of context state. The size and contexts change per-api-call.
+ mutable angle::ScratchBuffer mScratchBuffer;
};
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/ContextState.cpp b/chromium/third_party/angle/src/libANGLE/ContextState.cpp
index 4694929dc4c..450e0ef7264 100644
--- a/chromium/third_party/angle/src/libANGLE/ContextState.cpp
+++ b/chromium/third_party/angle/src/libANGLE/ContextState.cpp
@@ -61,7 +61,7 @@ TextureManager *AllocateOrGetSharedTextureManager(const ContextState *shareConte
} // anonymous namespace
-ContextState::ContextState(uintptr_t contextIn,
+ContextState::ContextState(ContextID contextIn,
const ContextState *shareContextState,
TextureManager *shareTextures,
const Version &clientVersion,
@@ -117,7 +117,7 @@ ValidationContext::ValidationContext(const ValidationContext *shareContext,
const Extensions &extensions,
const Limitations &limitations,
bool skipValidation)
- : mState(reinterpret_cast<uintptr_t>(this),
+ : mState(reinterpret_cast<ContextID>(this),
shareContext ? &shareContext->mState : nullptr,
shareTextures,
clientVersion,
@@ -133,13 +133,6 @@ ValidationContext::ValidationContext(const ValidationContext *shareContext,
bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsigned int *numParams)
{
- if (pname >= GL_DRAW_BUFFER0_EXT && pname <= GL_DRAW_BUFFER15_EXT)
- {
- *type = GL_INT;
- *numParams = 1;
- return true;
- }
-
// Please note: the query type returned for DEPTH_CLEAR_VALUE in this implementation
// is FLOAT rather than INT, as would be suggested by the GL ES 2.0 spec. This is due
// to the fact that it is stored internally as a float, and so would require conversion
@@ -312,7 +305,7 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign
return true;
}
case GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT:
- if (!getExtensions().maxTextureAnisotropy)
+ if (!getExtensions().textureFilterAnisotropic)
{
return false;
}
@@ -433,6 +426,14 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign
}
}
+ if (getExtensions().robustResourceInitialization &&
+ pname == GL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE)
+ {
+ *type = GL_BOOL;
+ *numParams = 1;
+ return true;
+ }
+
// Check for ES3.0+ parameter names which are also exposed as ES2 extensions
switch (pname)
{
@@ -487,6 +488,17 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign
}
}
+ if (pname >= GL_DRAW_BUFFER0_EXT && pname <= GL_DRAW_BUFFER15_EXT)
+ {
+ if ((getClientVersion() < Version(3, 0)) && !getExtensions().drawBuffers)
+ {
+ return false;
+ }
+ *type = GL_INT;
+ *numParams = 1;
+ return true;
+ }
+
if (getClientVersion() < Version(3, 0))
{
return false;
@@ -623,6 +635,7 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign
case GL_MAX_COMBINED_IMAGE_UNIFORMS:
case GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS:
case GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS:
+ case GL_SHADER_STORAGE_BUFFER_BINDING:
case GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT:
*type = GL_INT;
*numParams = 1;
@@ -675,6 +688,11 @@ bool ValidationContext::getIndexedQueryParameterInfo(GLenum target,
case GL_MAX_COMPUTE_WORK_GROUP_COUNT:
case GL_MAX_COMPUTE_WORK_GROUP_SIZE:
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
+ case GL_SHADER_STORAGE_BUFFER_BINDING:
+ case GL_VERTEX_BINDING_BUFFER:
+ case GL_VERTEX_BINDING_DIVISOR:
+ case GL_VERTEX_BINDING_OFFSET:
+ case GL_VERTEX_BINDING_STRIDE:
{
*type = GL_INT;
*numParams = 1;
@@ -682,6 +700,8 @@ bool ValidationContext::getIndexedQueryParameterInfo(GLenum target,
}
case GL_ATOMIC_COUNTER_BUFFER_START:
case GL_ATOMIC_COUNTER_BUFFER_SIZE:
+ case GL_SHADER_STORAGE_BUFFER_START:
+ case GL_SHADER_STORAGE_BUFFER_SIZE:
{
*type = GL_INT_64_ANGLEX;
*numParams = 1;
diff --git a/chromium/third_party/angle/src/libANGLE/ContextState.h b/chromium/third_party/angle/src/libANGLE/ContextState.h
index 85428dec961..4c50b59678d 100644
--- a/chromium/third_party/angle/src/libANGLE/ContextState.h
+++ b/chromium/third_party/angle/src/libANGLE/ContextState.h
@@ -30,10 +30,12 @@ static constexpr Version ES_2_0 = Version(2, 0);
static constexpr Version ES_3_0 = Version(3, 0);
static constexpr Version ES_3_1 = Version(3, 1);
+using ContextID = uintptr_t;
+
class ContextState final : public angle::NonCopyable
{
public:
- ContextState(uintptr_t context,
+ ContextState(ContextID context,
const ContextState *shareContextState,
TextureManager *shareTextures,
const Version &clientVersion,
@@ -44,7 +46,7 @@ class ContextState final : public angle::NonCopyable
const Limitations &limitations);
~ContextState();
- uintptr_t getContext() const { return mContext; }
+ ContextID getContextID() const { return mContext; }
GLint getClientMajorVersion() const { return mClientVersion.major; }
GLint getClientMinorVersion() const { return mClientVersion.minor; }
const Version &getClientVersion() const { return mClientVersion; }
@@ -65,7 +67,7 @@ class ContextState final : public angle::NonCopyable
friend class ValidationContext;
Version mClientVersion;
- uintptr_t mContext;
+ ContextID mContext;
State *mState;
const Caps &mCaps;
const TextureCapsMap &mTextureCaps;
diff --git a/chromium/third_party/angle/src/libANGLE/Fence.cpp b/chromium/third_party/angle/src/libANGLE/Fence.cpp
index a5dd2e140fa..2e1c5903dc6 100644
--- a/chromium/third_party/angle/src/libANGLE/Fence.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Fence.cpp
@@ -75,7 +75,7 @@ Error FenceNV::finish()
}
FenceSync::FenceSync(rx::FenceSyncImpl *impl, GLuint id)
- : RefCountObject(id), mFence(impl), mLabel(), mCondition(GL_NONE), mFlags(0)
+ : RefCountObject(id), mFence(impl), mLabel(), mCondition(GL_SYNC_GPU_COMMANDS_COMPLETE), mFlags(0)
{
}
diff --git a/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp b/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp
index 8f322e4c35b..c12fd7be0e2 100644
--- a/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp
@@ -9,7 +9,7 @@
#include "libANGLE/Framebuffer.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/Optional.h"
#include "common/utilities.h"
#include "libANGLE/Config.h"
@@ -34,7 +34,7 @@ namespace gl
namespace
{
-void BindResourceChannel(ChannelBinding *binding, FramebufferAttachmentObject *resource)
+void BindResourceChannel(OnAttachmentDirtyBinding *binding, FramebufferAttachmentObject *resource)
{
binding->bind(resource ? resource->getDirtyChannel() : nullptr);
}
@@ -45,7 +45,7 @@ void BindResourceChannel(ChannelBinding *binding, FramebufferAttachmentObject *r
FramebufferState::FramebufferState()
: mLabel(),
mColorAttachments(1),
- mDrawBufferStates(1, GL_BACK),
+ mDrawBufferStates(IMPLEMENTATION_MAX_DRAW_BUFFERS, GL_NONE),
mReadBufferState(GL_BACK),
mDefaultWidth(0),
mDefaultHeight(0),
@@ -53,6 +53,8 @@ FramebufferState::FramebufferState()
mDefaultFixedSampleLocations(GL_FALSE),
mWebGLDepthStencilConsistent(true)
{
+ ASSERT(mDrawBufferStates.size() > 0);
+ mDrawBufferStates[0] = GL_BACK;
mEnabledDrawBuffers.set(0);
}
@@ -296,10 +298,10 @@ Framebuffer::Framebuffer(const Caps &caps, rx::GLImplFactory *factory, GLuint id
ASSERT(mImpl != nullptr);
ASSERT(mState.mColorAttachments.size() == static_cast<size_t>(caps.maxColorAttachments));
- for (size_t colorIndex = 0; colorIndex < mState.mColorAttachments.size(); ++colorIndex)
+ for (uint32_t colorIndex = 0;
+ colorIndex < static_cast<uint32_t>(mState.mColorAttachments.size()); ++colorIndex)
{
- mDirtyColorAttachmentBindings.push_back(ChannelBinding(
- this, static_cast<SignalToken>(DIRTY_BIT_COLOR_ATTACHMENT_0 + colorIndex)));
+ mDirtyColorAttachmentBindings.emplace_back(this, DIRTY_BIT_COLOR_ATTACHMENT_0 + colorIndex);
}
}
@@ -312,8 +314,7 @@ Framebuffer::Framebuffer(egl::Surface *surface)
mDirtyStencilAttachmentBinding(this, DIRTY_BIT_STENCIL_ATTACHMENT)
{
ASSERT(mImpl != nullptr);
- mDirtyColorAttachmentBindings.push_back(
- ChannelBinding(this, static_cast<SignalToken>(DIRTY_BIT_COLOR_ATTACHMENT_0)));
+ mDirtyColorAttachmentBindings.emplace_back(this, DIRTY_BIT_COLOR_ATTACHMENT_0);
setAttachmentImpl(GL_FRAMEBUFFER_DEFAULT, GL_BACK, gl::ImageIndex::MakeInvalid(), surface);
@@ -337,8 +338,7 @@ Framebuffer::Framebuffer(rx::GLImplFactory *factory)
mDirtyDepthAttachmentBinding(this, DIRTY_BIT_DEPTH_ATTACHMENT),
mDirtyStencilAttachmentBinding(this, DIRTY_BIT_STENCIL_ATTACHMENT)
{
- mDirtyColorAttachmentBindings.push_back(
- ChannelBinding(this, static_cast<SignalToken>(DIRTY_BIT_COLOR_ATTACHMENT_0)));
+ mDirtyColorAttachmentBindings.emplace_back(this, DIRTY_BIT_COLOR_ATTACHMENT_0);
}
Framebuffer::~Framebuffer()
@@ -566,7 +566,15 @@ bool Framebuffer::usingExtendedDrawBuffers() const
return false;
}
-GLenum Framebuffer::checkStatus(const ContextState &state)
+void Framebuffer::invalidateCompletenessCache()
+{
+ if (mId != 0)
+ {
+ mCachedStatus.reset();
+ }
+}
+
+GLenum Framebuffer::checkStatus(const Context *context)
{
// The default framebuffer is always complete except when it is surfaceless in which
// case it is always unsupported. We return early because the default framebuffer may
@@ -581,14 +589,16 @@ GLenum Framebuffer::checkStatus(const ContextState &state)
if (hasAnyDirtyBit() || !mCachedStatus.valid())
{
- mCachedStatus = checkStatusImpl(state);
+ mCachedStatus = checkStatusImpl(context);
}
return mCachedStatus.value();
}
-GLenum Framebuffer::checkStatusImpl(const ContextState &state)
+GLenum Framebuffer::checkStatusImpl(const Context *context)
{
+ const ContextState &state = context->getContextState();
+
ASSERT(mId != 0);
unsigned int colorbufferSize = 0;
@@ -853,7 +863,7 @@ GLenum Framebuffer::checkStatusImpl(const ContextState &state)
return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
}
- syncState();
+ syncState(context);
if (!mImpl->checkStatus())
{
return GL_FRAMEBUFFER_UNSUPPORTED;
@@ -1000,9 +1010,9 @@ Error Framebuffer::blit(rx::ContextImpl *context,
return mImpl->blit(context, sourceArea, destArea, blitMask, filter);
}
-int Framebuffer::getSamples(const ContextState &state)
+int Framebuffer::getSamples(const Context *context)
{
- if (complete(state))
+ if (complete(context))
{
// For a complete framebuffer, all attachments must have the same sample count.
// In this case return the first nonzero sample size.
@@ -1085,26 +1095,39 @@ void Framebuffer::commitWebGL1DepthStencilIfConsistent()
return;
}
+ auto getImageIndexIfTextureAttachment = [](const FramebufferAttachment &attachment) {
+ if (attachment.type() == GL_TEXTURE)
+ {
+ return attachment.getTextureImageIndex();
+ }
+ else
+ {
+ return ImageIndex::MakeInvalid();
+ }
+ };
+
if (mState.mWebGLDepthAttachment.isAttached())
{
const auto &depth = mState.mWebGLDepthAttachment;
- setAttachmentImpl(depth.type(), GL_DEPTH_ATTACHMENT, ImageIndex::MakeInvalid(),
- depth.getResource());
+ setAttachmentImpl(depth.type(), GL_DEPTH_ATTACHMENT,
+ getImageIndexIfTextureAttachment(depth), depth.getResource());
setAttachmentImpl(GL_NONE, GL_STENCIL_ATTACHMENT, ImageIndex::MakeInvalid(), nullptr);
}
else if (mState.mWebGLStencilAttachment.isAttached())
{
const auto &stencil = mState.mWebGLStencilAttachment;
setAttachmentImpl(GL_NONE, GL_DEPTH_ATTACHMENT, ImageIndex::MakeInvalid(), nullptr);
- setAttachmentImpl(stencil.type(), GL_STENCIL_ATTACHMENT, ImageIndex::MakeInvalid(),
- stencil.getResource());
+ setAttachmentImpl(stencil.type(), GL_STENCIL_ATTACHMENT,
+ getImageIndexIfTextureAttachment(stencil), stencil.getResource());
}
else if (mState.mWebGLDepthStencilAttachment.isAttached())
{
const auto &depthStencil = mState.mWebGLDepthStencilAttachment;
- setAttachmentImpl(depthStencil.type(), GL_DEPTH_ATTACHMENT, ImageIndex::MakeInvalid(),
+ setAttachmentImpl(depthStencil.type(), GL_DEPTH_ATTACHMENT,
+ getImageIndexIfTextureAttachment(depthStencil),
depthStencil.getResource());
- setAttachmentImpl(depthStencil.type(), GL_STENCIL_ATTACHMENT, ImageIndex::MakeInvalid(),
+ setAttachmentImpl(depthStencil.type(), GL_STENCIL_ATTACHMENT,
+ getImageIndexIfTextureAttachment(depthStencil),
depthStencil.getResource());
}
else
@@ -1182,11 +1205,11 @@ void Framebuffer::resetAttachment(const Context *context, GLenum binding)
setAttachment(context, GL_NONE, binding, ImageIndex::MakeInvalid(), nullptr);
}
-void Framebuffer::syncState()
+void Framebuffer::syncState(const Context *context)
{
if (mDirtyBits.any())
{
- mImpl->syncState(mDirtyBits);
+ mImpl->syncState(rx::SafeGetImpl(context), mDirtyBits);
mDirtyBits.reset();
if (mId != 0)
{
@@ -1195,15 +1218,20 @@ void Framebuffer::syncState()
}
}
-void Framebuffer::signal(SignalToken token)
+void Framebuffer::signal(uint32_t token)
{
// TOOD(jmadill): Make this only update individual attachments to do less work.
mCachedStatus.reset();
}
-bool Framebuffer::complete(const ContextState &state)
+bool Framebuffer::complete(const Context *context)
+{
+ return (checkStatus(context) == GL_FRAMEBUFFER_COMPLETE);
+}
+
+bool Framebuffer::cachedComplete() const
{
- return (checkStatus(state) == GL_FRAMEBUFFER_COMPLETE);
+ return (mCachedStatus.valid() && mCachedStatus == GL_FRAMEBUFFER_COMPLETE);
}
bool Framebuffer::formsRenderingFeedbackLoopWith(const State &state) const
@@ -1333,4 +1361,15 @@ void Framebuffer::setDefaultFixedSampleLocations(GLboolean defaultFixedSampleLoc
mDirtyBits.set(DIRTY_BIT_DEFAULT_FIXED_SAMPLE_LOCATIONS);
}
+// TODO(jmadill): Remove this kludge.
+GLenum Framebuffer::checkStatus(const ValidationContext *context)
+{
+ return checkStatus(static_cast<const Context *>(context));
+}
+
+int Framebuffer::getSamples(const ValidationContext *context)
+{
+ return getSamples(static_cast<const Context *>(context));
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/Framebuffer.h b/chromium/third_party/angle/src/libANGLE/Framebuffer.h
index ea891f9ca0c..c4cacf999fb 100644
--- a/chromium/third_party/angle/src/libANGLE/Framebuffer.h
+++ b/chromium/third_party/angle/src/libANGLE/Framebuffer.h
@@ -39,13 +39,14 @@ class Surface;
namespace gl
{
class Context;
+class ContextState;
class Framebuffer;
class Renderbuffer;
class State;
class Texture;
class TextureCapsMap;
+class ValidationContext;
struct Caps;
-class ContextState;
struct Extensions;
struct ImageIndex;
struct Rectangle;
@@ -114,7 +115,10 @@ class FramebufferState final : angle::NonCopyable
bool mWebGLDepthStencilConsistent;
};
-class Framebuffer final : public LabeledObject, public angle::SignalReceiver
+using OnAttachmentDirtyReceiver = angle::SignalReceiver<>;
+using OnAttachmentDirtyBinding = angle::ChannelBinding<>;
+
+class Framebuffer final : public LabeledObject, public OnAttachmentDirtyReceiver
{
public:
// Constructor to build application-defined framebuffers
@@ -174,7 +178,7 @@ class Framebuffer final : public LabeledObject, public angle::SignalReceiver
bool usingExtendedDrawBuffers() const;
// This method calls checkStatus.
- int getSamples(const ContextState &state);
+ int getSamples(const Context *context);
Error getSamplePosition(size_t index, GLfloat *xy) const;
@@ -187,10 +191,17 @@ class Framebuffer final : public LabeledObject, public angle::SignalReceiver
void setDefaultSamples(GLint defaultSamples);
void setDefaultFixedSampleLocations(GLboolean defaultFixedSampleLocations);
- GLenum checkStatus(const ContextState &state);
+ void invalidateCompletenessCache();
+
+ GLenum checkStatus(const Context *context);
+
+ // TODO(jmadill): Remove this kludge.
+ GLenum checkStatus(const ValidationContext *context);
+ int getSamples(const ValidationContext *context);
// Helper for checkStatus == GL_FRAMEBUFFER_COMPLETE.
- bool complete(const ContextState &state);
+ bool complete(const Context *context);
+ bool cachedComplete() const;
bool hasValidDepthStencil() const;
@@ -231,7 +242,7 @@ class Framebuffer final : public LabeledObject, public angle::SignalReceiver
GLbitfield mask,
GLenum filter);
- enum DirtyBitType
+ enum DirtyBitType : uint32_t
{
DIRTY_BIT_COLOR_ATTACHMENT_0,
DIRTY_BIT_COLOR_ATTACHMENT_MAX =
@@ -251,10 +262,10 @@ class Framebuffer final : public LabeledObject, public angle::SignalReceiver
typedef std::bitset<DIRTY_BIT_MAX> DirtyBits;
bool hasAnyDirtyBit() const { return mDirtyBits.any(); }
- void syncState();
+ void syncState(const Context *context);
// angle::SignalReceiver implementation
- void signal(angle::SignalToken token) override;
+ void signal(uint32_t token) override;
bool formsRenderingFeedbackLoopWith(const State &state) const;
bool formsCopyingFeedbackLoopWith(GLuint copyTextureID,
@@ -267,7 +278,7 @@ class Framebuffer final : public LabeledObject, public angle::SignalReceiver
GLenum matchType,
GLuint matchId,
size_t dirtyBit);
- GLenum checkStatusImpl(const ContextState &state);
+ GLenum checkStatusImpl(const Context *context);
void commitWebGL1DepthStencilIfConsistent();
void setAttachmentImpl(GLenum type,
@@ -280,9 +291,9 @@ class Framebuffer final : public LabeledObject, public angle::SignalReceiver
GLuint mId;
Optional<GLenum> mCachedStatus;
- std::vector<angle::ChannelBinding> mDirtyColorAttachmentBindings;
- angle::ChannelBinding mDirtyDepthAttachmentBinding;
- angle::ChannelBinding mDirtyStencilAttachmentBinding;
+ std::vector<OnAttachmentDirtyBinding> mDirtyColorAttachmentBindings;
+ OnAttachmentDirtyBinding mDirtyDepthAttachmentBinding;
+ OnAttachmentDirtyBinding mDirtyStencilAttachmentBinding;
DirtyBits mDirtyBits;
};
diff --git a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp
index e7e784a7402..d8eee5564bc 100644
--- a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp
+++ b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp
@@ -242,7 +242,7 @@ Error FramebufferAttachmentObject::getAttachmentRenderTarget(
return getAttachmentImpl()->getAttachmentRenderTarget(target, rtOut);
}
-angle::BroadcastChannel *FramebufferAttachmentObject::getDirtyChannel()
+angle::BroadcastChannel<> *FramebufferAttachmentObject::getDirtyChannel()
{
return &mDirtyChannel;
}
diff --git a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h
index 213f65e5ae3..5e28fb99cb1 100644
--- a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h
+++ b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h
@@ -168,12 +168,12 @@ class FramebufferAttachmentObject
Error getAttachmentRenderTarget(const FramebufferAttachment::Target &target,
rx::FramebufferAttachmentRenderTarget **rtOut) const;
- angle::BroadcastChannel *getDirtyChannel();
+ angle::BroadcastChannel<> *getDirtyChannel();
protected:
virtual rx::FramebufferAttachmentObjectImpl *getAttachmentImpl() const = 0;
- angle::BroadcastChannel mDirtyChannel;
+ angle::BroadcastChannel<> mDirtyChannel;
};
inline Extents FramebufferAttachment::getSize() const
diff --git a/chromium/third_party/angle/src/libANGLE/Program.cpp b/chromium/third_party/angle/src/libANGLE/Program.cpp
index 2cf43079b2a..037283bc180 100644
--- a/chromium/third_party/angle/src/libANGLE/Program.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Program.cpp
@@ -11,7 +11,7 @@
#include <algorithm>
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/platform.h"
#include "common/utilities.h"
@@ -25,6 +25,7 @@
#include "libANGLE/VaryingPacking.h"
#include "libANGLE/queryconversions.h"
#include "libANGLE/Uniform.h"
+#include "libANGLE/UniformLinker.h"
namespace gl
{
@@ -125,21 +126,92 @@ void UniformStateQueryCastLoop(DestT *dataOut, const uint8_t *srcPointer, int co
}
}
-bool UniformInList(const std::vector<LinkedUniform> &list, const std::string &name)
+// true if varying x has a higher priority in packing than y
+bool ComparePackedVarying(const PackedVarying &x, const PackedVarying &y)
{
- for (const LinkedUniform &uniform : list)
+ // If the PackedVarying 'x' or 'y' to be compared is an array element, this clones an equivalent
+ // non-array shader variable 'vx' or 'vy' for actual comparison instead.
+ sh::ShaderVariable vx, vy;
+ const sh::ShaderVariable *px, *py;
+ if (x.isArrayElement())
{
- if (uniform.name == name)
- return true;
+ vx = *x.varying;
+ vx.arraySize = 0;
+ px = &vx;
+ }
+ else
+ {
+ px = x.varying;
}
- return false;
+ if (y.isArrayElement())
+ {
+ vy = *y.varying;
+ vy.arraySize = 0;
+ py = &vy;
+ }
+ else
+ {
+ py = y.varying;
+ }
+
+ return gl::CompareShaderVar(*px, *py);
}
-// true if varying x has a higher priority in packing than y
-bool ComparePackedVarying(const PackedVarying &x, const PackedVarying &y)
+template <typename VarT>
+GLuint GetResourceIndexFromName(const std::vector<VarT> &list, const std::string &name)
{
- return gl::CompareShaderVar(*x.varying, *y.varying);
+ size_t subscript = GL_INVALID_INDEX;
+ std::string baseName = ParseResourceName(name, &subscript);
+
+ // The app is not allowed to specify array indices other than 0 for arrays of basic types
+ if (subscript != 0 && subscript != GL_INVALID_INDEX)
+ {
+ return GL_INVALID_INDEX;
+ }
+
+ for (size_t index = 0; index < list.size(); index++)
+ {
+ const VarT &resource = list[index];
+ if (resource.name == baseName)
+ {
+ if (resource.isArray() || subscript == GL_INVALID_INDEX)
+ {
+ return static_cast<GLuint>(index);
+ }
+ }
+ }
+
+ return GL_INVALID_INDEX;
+}
+
+void CopyStringToBuffer(GLchar *buffer, const std::string &string, GLsizei bufSize, GLsizei *length)
+{
+ ASSERT(bufSize > 0);
+ strncpy(buffer, string.c_str(), bufSize);
+ buffer[bufSize - 1] = '\0';
+
+ if (length)
+ {
+ *length = static_cast<GLsizei>(strlen(buffer));
+ }
+}
+
+bool IncludeSameArrayElement(const std::set<std::string> &nameSet, const std::string &name)
+{
+ size_t subscript = GL_INVALID_INDEX;
+ std::string baseName = ParseResourceName(name, &subscript);
+ for (auto it = nameSet.begin(); it != nameSet.end(); ++it)
+ {
+ size_t arrayIndex = GL_INVALID_INDEX;
+ std::string arrayName = ParseResourceName(*it, &arrayIndex);
+ if (baseName == arrayName && (subscript == GL_INVALID_INDEX ||
+ arrayIndex == GL_INVALID_INDEX || subscript == arrayIndex))
+ {
+ return true;
+ }
+ }
+ return false;
}
} // anonymous namespace
@@ -262,23 +334,10 @@ const std::string &ProgramState::getLabel()
return mLabel;
}
-const LinkedUniform *ProgramState::getUniformByName(const std::string &name) const
-{
- for (const LinkedUniform &linkedUniform : mUniforms)
- {
- if (linkedUniform.name == name)
- {
- return &linkedUniform;
- }
- }
-
- return nullptr;
-}
-
GLint ProgramState::getUniformLocation(const std::string &name) const
{
size_t subscript = GL_INVALID_INDEX;
- std::string baseName = ParseUniformName(name, &subscript);
+ std::string baseName = ParseResourceName(name, &subscript);
for (size_t location = 0; location < mUniformLocations.size(); ++location)
{
@@ -315,28 +374,7 @@ GLint ProgramState::getUniformLocation(const std::string &name) const
GLuint ProgramState::getUniformIndexFromName(const std::string &name) const
{
- size_t subscript = GL_INVALID_INDEX;
- std::string baseName = ParseUniformName(name, &subscript);
-
- // The app is not allowed to specify array indices other than 0 for arrays of basic types
- if (subscript != 0 && subscript != GL_INVALID_INDEX)
- {
- return GL_INVALID_INDEX;
- }
-
- for (size_t index = 0; index < mUniforms.size(); index++)
- {
- const LinkedUniform &uniform = mUniforms[index];
- if (uniform.name == baseName)
- {
- if (uniform.isArray() || subscript == GL_INVALID_INDEX)
- {
- return static_cast<GLuint>(index);
- }
- }
- }
-
- return GL_INVALID_INDEX;
+ return GetResourceIndexFromName(mUniforms, name);
}
GLuint ProgramState::getUniformIndexFromLocation(GLint location) const
@@ -510,7 +548,7 @@ void Program::bindAttributeLocation(GLuint index, const char *name)
void Program::bindUniformLocation(GLuint index, const char *name)
{
// Bind the base uniform name only since array indices other than 0 cannot be bound
- mUniformLocationBindings.bindLocation(index, ParseUniformName(name, nullptr));
+ mUniformLocationBindings.bindLocation(index, ParseResourceName(name, nullptr));
}
void Program::bindFragmentInputLocation(GLint index, const char *name)
@@ -697,7 +735,7 @@ Error Program::link(const gl::Context *context)
const auto &mergedVaryings = getMergedVaryings();
- if (!linkValidateTransformFeedback(mInfoLog, mergedVaryings, caps))
+ if (!linkValidateTransformFeedback(context, mInfoLog, mergedVaryings, caps))
{
return NoError();
}
@@ -728,6 +766,8 @@ Error Program::link(const gl::Context *context)
gatherTransformFeedbackVaryings(mergedVaryings);
}
+ setUniformValuesFromBindingQualifiers();
+
gatherInterfaceBlockInfo();
return NoError();
@@ -738,11 +778,12 @@ void Program::unlink()
{
mState.mAttributes.clear();
mState.mActiveAttribLocationsMask.reset();
- mState.mTransformFeedbackVaryingVars.clear();
+ mState.mLinkedTransformFeedbackVaryings.clear();
mState.mUniforms.clear();
mState.mUniformLocations.clear();
mState.mUniformBlocks.clear();
mState.mOutputVariables.clear();
+ mState.mOutputLocations.clear();
mState.mComputeShaderLocalSize.fill(1);
mState.mSamplerBindings.clear();
@@ -873,7 +914,7 @@ Error Program::loadBinary(const Context *context,
}
unsigned int transformFeedbackVaryingCount = stream.readInt<unsigned int>();
- ASSERT(mState.mTransformFeedbackVaryingVars.empty());
+ ASSERT(mState.mLinkedTransformFeedbackVaryings.empty());
for (unsigned int transformFeedbackVaryingIndex = 0;
transformFeedbackVaryingIndex < transformFeedbackVaryingCount;
++transformFeedbackVaryingIndex)
@@ -883,11 +924,23 @@ Error Program::loadBinary(const Context *context,
stream.readInt(&varying.type);
stream.readString(&varying.name);
- mState.mTransformFeedbackVaryingVars.push_back(varying);
+ GLuint arrayIndex = stream.readInt<GLuint>();
+
+ mState.mLinkedTransformFeedbackVaryings.emplace_back(varying, arrayIndex);
}
stream.readInt(&mState.mTransformFeedbackBufferMode);
+ unsigned int outputCount = stream.readInt<unsigned int>();
+ ASSERT(mState.mOutputVariables.empty());
+ for (unsigned int outputIndex = 0; outputIndex < outputCount; ++outputIndex)
+ {
+ sh::OutputVariable output;
+ LoadShaderVar(&stream, &output);
+ output.location = stream.readInt<int>();
+ mState.mOutputVariables.push_back(output);
+ }
+
unsigned int outputVarCount = stream.readInt<unsigned int>();
for (unsigned int outputIndex = 0; outputIndex < outputVarCount; ++outputIndex)
{
@@ -896,7 +949,7 @@ Error Program::loadBinary(const Context *context,
stream.readInt(&locationData.element);
stream.readInt(&locationData.index);
stream.readString(&locationData.name);
- mState.mOutputVariables[locationIndex] = locationData;
+ mState.mOutputLocations[locationIndex] = locationData;
}
stream.readInt(&mState.mSamplerUniformRange.start);
@@ -1003,18 +1056,27 @@ Error Program::saveBinary(const Context *context,
stream.writeInt(binding);
}
- stream.writeInt(mState.mTransformFeedbackVaryingVars.size());
- for (const sh::Varying &varying : mState.mTransformFeedbackVaryingVars)
+ stream.writeInt(mState.mLinkedTransformFeedbackVaryings.size());
+ for (const auto &var : mState.mLinkedTransformFeedbackVaryings)
{
- stream.writeInt(varying.arraySize);
- stream.writeInt(varying.type);
- stream.writeString(varying.name);
+ stream.writeInt(var.arraySize);
+ stream.writeInt(var.type);
+ stream.writeString(var.name);
+
+ stream.writeIntOrNegOne(var.arrayIndex);
}
stream.writeInt(mState.mTransformFeedbackBufferMode);
stream.writeInt(mState.mOutputVariables.size());
- for (const auto &outputPair : mState.mOutputVariables)
+ for (const sh::OutputVariable &output : mState.mOutputVariables)
+ {
+ WriteShaderVar(&stream, output);
+ stream.writeInt(output.location);
+ }
+
+ stream.writeInt(mState.mOutputLocations.size());
+ for (const auto &outputPair : mState.mOutputLocations)
{
stream.writeInt(outputPair.first);
stream.writeIntOrNegOne(outputPair.second.element);
@@ -1092,6 +1154,21 @@ bool Program::getBinaryRetrievableHint() const
return mState.mBinaryRetrieveableHint;
}
+void Program::setSeparable(bool separable)
+{
+ // TODO(yunchao) : replace with dirty bits
+ if (mState.mSeparable != separable)
+ {
+ mProgram->setSeparable(separable);
+ mState.mSeparable = separable;
+ }
+}
+
+bool Program::isSeparable() const
+{
+ return mState.mSeparable;
+}
+
void Program::release(const Context *context)
{
mRefCount--;
@@ -1163,7 +1240,7 @@ GLuint Program::getAttributeLocation(const std::string &name) const
{
for (const sh::Attribute &attribute : mState.mAttributes)
{
- if (attribute.name == name && attribute.staticUse)
+ if (attribute.name == name)
{
return attribute.location;
}
@@ -1178,7 +1255,12 @@ bool Program::isAttribLocationActive(size_t attribLocation) const
return mState.mActiveAttribLocationsMask[attribLocation];
}
-void Program::getActiveAttribute(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name)
+void Program::getActiveAttribute(GLuint index,
+ GLsizei bufsize,
+ GLsizei *length,
+ GLint *size,
+ GLenum *type,
+ GLchar *name) const
{
if (!mLinked)
{
@@ -1197,35 +1279,12 @@ void Program::getActiveAttribute(GLuint index, GLsizei bufsize, GLsizei *length,
return;
}
- size_t attributeIndex = 0;
-
- for (const sh::Attribute &attribute : mState.mAttributes)
- {
- // Skip over inactive attributes
- if (attribute.staticUse)
- {
- if (static_cast<size_t>(index) == attributeIndex)
- {
- break;
- }
- attributeIndex++;
- }
- }
-
- ASSERT(index == attributeIndex && attributeIndex < mState.mAttributes.size());
- const sh::Attribute &attrib = mState.mAttributes[attributeIndex];
+ ASSERT(index < mState.mAttributes.size());
+ const sh::Attribute &attrib = mState.mAttributes[index];
if (bufsize > 0)
{
- const char *string = attrib.name.c_str();
-
- strncpy(name, string, bufsize);
- name[bufsize - 1] = '\0';
-
- if (length)
- {
- *length = static_cast<GLsizei>(strlen(name));
- }
+ CopyStringToBuffer(name, attrib.name, bufsize, length);
}
// Always a single 'type' instance
@@ -1240,14 +1299,7 @@ GLint Program::getActiveAttributeCount() const
return 0;
}
- GLint count = 0;
-
- for (const sh::Attribute &attrib : mState.mAttributes)
- {
- count += (attrib.staticUse ? 1 : 0);
- }
-
- return count;
+ return static_cast<GLint>(mState.mAttributes.size());
}
GLint Program::getActiveAttributeMaxLength() const
@@ -1261,20 +1313,79 @@ GLint Program::getActiveAttributeMaxLength() const
for (const sh::Attribute &attrib : mState.mAttributes)
{
- if (attrib.staticUse)
+ maxLength = std::max(attrib.name.length() + 1, maxLength);
+ }
+
+ return static_cast<GLint>(maxLength);
+}
+
+GLuint Program::getInputResourceIndex(const GLchar *name) const
+{
+ for (GLuint attributeIndex = 0; attributeIndex < mState.mAttributes.size(); ++attributeIndex)
+ {
+ const sh::Attribute &attribute = mState.mAttributes[attributeIndex];
+ if (attribute.name == name)
{
- maxLength = std::max(attrib.name.length() + 1, maxLength);
+ return attributeIndex;
}
}
+ return GL_INVALID_INDEX;
+}
- return static_cast<GLint>(maxLength);
+GLuint Program::getOutputResourceIndex(const GLchar *name) const
+{
+ return GetResourceIndexFromName(mState.mOutputVariables, std::string(name));
+}
+
+size_t Program::getOutputResourceCount() const
+{
+ return (mLinked ? mState.mOutputVariables.size() : 0);
+}
+
+void Program::getInputResourceName(GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name) const
+{
+ GLint size;
+ GLenum type;
+ getActiveAttribute(index, bufSize, length, &size, &type, name);
+}
+
+void Program::getOutputResourceName(GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name) const
+{
+ if (length)
+ {
+ *length = 0;
+ }
+
+ if (!mLinked)
+ {
+ if (bufSize > 0)
+ {
+ name[0] = '\0';
+ }
+ return;
+ }
+ ASSERT(index < mState.mOutputVariables.size());
+ const auto &output = mState.mOutputVariables[index];
+
+ if (bufSize > 0)
+ {
+ std::string nameWithArray = (output.isArray() ? output.name + "[0]" : output.name);
+
+ CopyStringToBuffer(name, nameWithArray, bufSize, length);
+ }
}
GLint Program::getFragDataLocation(const std::string &name) const
{
std::string baseName(name);
unsigned int arrayIndex = ParseAndStripArrayIndex(&baseName);
- for (auto outputPair : mState.mOutputVariables)
+ for (auto outputPair : mState.mOutputLocations)
{
const VariableLocation &outputVariable = outputPair.second;
if (outputVariable.name == baseName && (arrayIndex == GL_INVALID_INDEX || arrayIndex == outputVariable.element))
@@ -1305,14 +1416,7 @@ void Program::getActiveUniform(GLuint index,
{
string += "[0]";
}
-
- strncpy(name, string.c_str(), bufsize);
- name[bufsize - 1] = '\0';
-
- if (length)
- {
- *length = static_cast<GLsizei>(strlen(name));
- }
+ CopyStringToBuffer(name, string, bufsize, length);
}
*size = uniform.elementCount();
@@ -1688,14 +1792,7 @@ void Program::getActiveUniformBlockName(GLuint uniformBlockIndex, GLsizei bufSiz
{
string += ArrayString(uniformBlock.arrayElement);
}
-
- strncpy(uniformBlockName, string.c_str(), bufSize);
- uniformBlockName[bufSize - 1] = '\0';
-
- if (length)
- {
- *length = static_cast<GLsizei>(strlen(uniformBlockName));
- }
+ CopyStringToBuffer(uniformBlockName, string, bufSize, length);
}
}
@@ -1727,7 +1824,7 @@ GLint Program::getActiveUniformBlockMaxLength() const
GLuint Program::getUniformBlockIndex(const std::string &name) const
{
size_t subscript = GL_INVALID_INDEX;
- std::string baseName = ParseUniformName(name, &subscript);
+ std::string baseName = ParseResourceName(name, &subscript);
unsigned int numUniformBlocks = static_cast<unsigned int>(mState.mUniformBlocks.size());
for (unsigned int blockIndex = 0; blockIndex < numUniformBlocks; blockIndex++)
@@ -1790,24 +1887,25 @@ void Program::getTransformFeedbackVarying(GLuint index, GLsizei bufSize, GLsizei
{
if (mLinked)
{
- ASSERT(index < mState.mTransformFeedbackVaryingVars.size());
- const sh::Varying &varying = mState.mTransformFeedbackVaryingVars[index];
- GLsizei lastNameIdx = std::min(bufSize - 1, static_cast<GLsizei>(varying.name.length()));
+ ASSERT(index < mState.mLinkedTransformFeedbackVaryings.size());
+ const auto &var = mState.mLinkedTransformFeedbackVaryings[index];
+ std::string varName = var.nameWithArrayIndex();
+ GLsizei lastNameIdx = std::min(bufSize - 1, static_cast<GLsizei>(varName.length()));
if (length)
{
*length = lastNameIdx;
}
if (size)
{
- *size = varying.elementCount();
+ *size = var.size();
}
if (type)
{
- *type = varying.type;
+ *type = var.type;
}
if (name)
{
- memcpy(name, varying.name.c_str(), lastNameIdx);
+ memcpy(name, varName.c_str(), lastNameIdx);
name[lastNameIdx] = '\0';
}
}
@@ -1817,7 +1915,7 @@ GLsizei Program::getTransformFeedbackVaryingCount() const
{
if (mLinked)
{
- return static_cast<GLsizei>(mState.mTransformFeedbackVaryingVars.size());
+ return static_cast<GLsizei>(mState.mLinkedTransformFeedbackVaryings.size());
}
else
{
@@ -1830,9 +1928,10 @@ GLsizei Program::getTransformFeedbackVaryingMaxLength() const
if (mLinked)
{
GLsizei maxSize = 0;
- for (const sh::Varying &varying : mState.mTransformFeedbackVaryingVars)
+ for (const auto &var : mState.mLinkedTransformFeedbackVaryings)
{
- maxSize = std::max(maxSize, static_cast<GLsizei>(varying.name.length() + 1));
+ maxSize =
+ std::max(maxSize, static_cast<GLsizei>(var.nameWithArrayIndex().length() + 1));
}
return maxSize;
@@ -1917,37 +2016,13 @@ bool Program::linkVaryings(InfoLog &infoLog) const
}
}
- // TODO(jmadill): verify no unmatched vertex varyings?
-
- return true;
-}
-
-bool Program::validateVertexAndFragmentUniforms(InfoLog &infoLog) const
-{
- // Check that uniforms defined in the vertex and fragment shaders are identical
- std::map<std::string, LinkedUniform> linkedUniforms;
- const std::vector<sh::Uniform> &vertexUniforms = mState.mAttachedVertexShader->getUniforms();
- const std::vector<sh::Uniform> &fragmentUniforms =
- mState.mAttachedFragmentShader->getUniforms();
-
- for (const sh::Uniform &vertexUniform : vertexUniforms)
+ if (!linkValidateBuiltInVaryings(infoLog))
{
- linkedUniforms[vertexUniform.name] = LinkedUniform(vertexUniform);
+ return false;
}
- for (const sh::Uniform &fragmentUniform : fragmentUniforms)
- {
- auto entry = linkedUniforms.find(fragmentUniform.name);
- if (entry != linkedUniforms.end())
- {
- LinkedUniform *vertexUniform = &entry->second;
- const std::string &uniformName = "uniform '" + vertexUniform->name + "'";
- if (!linkValidateUniforms(infoLog, uniformName, *vertexUniform, fragmentUniform))
- {
- return false;
- }
- }
- }
+ // TODO(jmadill): verify no unmatched vertex varyings?
+
return true;
}
@@ -1955,121 +2030,38 @@ bool Program::linkUniforms(InfoLog &infoLog,
const Caps &caps,
const Bindings &uniformLocationBindings)
{
- if (mState.mAttachedVertexShader && mState.mAttachedFragmentShader)
- {
- ASSERT(mState.mAttachedComputeShader == nullptr);
- if (!validateVertexAndFragmentUniforms(infoLog))
- {
- return false;
- }
- }
-
- // Flatten the uniforms list (nested fields) into a simple list (no nesting).
- // Also check the maximum uniform vector and sampler counts.
- if (!flattenUniformsAndCheckCaps(caps, infoLog))
+ UniformLinker linker(mState);
+ if (!linker.link(infoLog, caps, uniformLocationBindings))
{
return false;
}
- if (!indexUniforms(infoLog, caps, uniformLocationBindings))
- {
- return false;
- }
+ linker.getResults(&mState.mUniforms, &mState.mUniformLocations);
+
+ linkSamplerBindings();
return true;
}
-bool Program::indexUniforms(InfoLog &infoLog,
- const Caps &caps,
- const Bindings &uniformLocationBindings)
+void Program::linkSamplerBindings()
{
- std::vector<VariableLocation> unlocatedUniforms;
- std::map<GLuint, VariableLocation> preLocatedUniforms;
- int maxUniformLocation = -1;
-
- // Gather uniforms that have their location pre-set and uniforms that don't yet have a location.
- for (size_t uniformIndex = 0; uniformIndex < mState.mUniforms.size(); uniformIndex++)
- {
- const LinkedUniform &uniform = mState.mUniforms[uniformIndex];
-
- if (uniform.isBuiltIn())
- {
- continue;
- }
-
- int preSetLocation = uniformLocationBindings.getBinding(uniform.name);
-
- // Verify that this location isn't used twice
- if (preSetLocation != -1 &&
- preLocatedUniforms.find(preSetLocation) != preLocatedUniforms.end())
- {
- infoLog << "Multiple uniforms bound to location " << preSetLocation << ".";
- return false;
- }
-
- for (unsigned int arrayIndex = 0; arrayIndex < uniform.elementCount(); arrayIndex++)
- {
- VariableLocation location(uniform.name, arrayIndex,
- static_cast<unsigned int>(uniformIndex));
-
- if (arrayIndex == 0 && preSetLocation != -1)
- {
- preLocatedUniforms[preSetLocation] = location;
- maxUniformLocation = std::max(maxUniformLocation, preSetLocation);
- }
- else
- {
- unlocatedUniforms.push_back(location);
- }
- }
- }
-
- // Gather the reserved locations, ones that are bound but not referenced. Other uniforms should
- // not be assigned to those locations.
- std::set<GLuint> reservedLocations;
- for (const auto &locationBinding : uniformLocationBindings)
+ mState.mSamplerUniformRange.end = static_cast<unsigned int>(mState.mUniforms.size());
+ mState.mSamplerUniformRange.start = mState.mSamplerUniformRange.end;
+ auto samplerIter = mState.mUniforms.rbegin();
+ while (samplerIter != mState.mUniforms.rend() && samplerIter->isSampler())
{
- GLuint location = locationBinding.second;
- if (preLocatedUniforms.find(location) == preLocatedUniforms.end())
- {
- reservedLocations.insert(location);
- maxUniformLocation = std::max(maxUniformLocation, static_cast<int>(location));
- }
+ --mState.mSamplerUniformRange.start;
+ ++samplerIter;
}
-
- // Make enough space for all uniforms, with pre-set locations or not.
- mState.mUniformLocations.resize(
- std::max(unlocatedUniforms.size() + preLocatedUniforms.size() + reservedLocations.size(),
- static_cast<size_t>(maxUniformLocation + 1)));
-
- // Assign uniforms with pre-set locations
- for (const auto &uniform : preLocatedUniforms)
- {
- mState.mUniformLocations[uniform.first] = uniform.second;
- }
-
- // Assign reserved uniforms
- for (const auto &reservedLocation : reservedLocations)
- {
- mState.mUniformLocations[reservedLocation].ignored = true;
- }
-
- // Automatically assign locations for the rest of the uniforms
- size_t nextUniformLocation = 0;
- for (const auto &unlocatedUniform : unlocatedUniforms)
+ // If uniform is a sampler type, insert it into the mSamplerBindings array.
+ for (unsigned int samplerIndex = mState.mSamplerUniformRange.start;
+ samplerIndex < mState.mUniforms.size(); ++samplerIndex)
{
- while (mState.mUniformLocations[nextUniformLocation].used ||
- mState.mUniformLocations[nextUniformLocation].ignored)
- {
- nextUniformLocation++;
- }
-
- ASSERT(nextUniformLocation < mState.mUniformLocations.size());
- mState.mUniformLocations[nextUniformLocation] = unlocatedUniform;
- nextUniformLocation++;
+ const auto &samplerUniform = mState.mUniforms[samplerIndex];
+ GLenum textureType = SamplerTypeToTextureType(samplerUniform.type);
+ mState.mSamplerBindings.emplace_back(
+ SamplerBinding(textureType, samplerUniform.elementCount()));
}
-
- return true;
}
bool Program::linkValidateInterfaceBlockFields(InfoLog &infoLog,
@@ -2113,9 +2105,6 @@ bool Program::linkAttributes(const ContextState &data, InfoLog &infoLog)
// Link attributes that have a binding location
for (sh::Attribute &attribute : mState.mAttributes)
{
- // TODO(jmadill): do staticUse filtering step here, or not at all
- ASSERT(attribute.staticUse);
-
int bindingLocation = mAttributeBindings.getBinding(attribute.name);
if (attribute.location == -1 && bindingLocation != -1)
{
@@ -2165,8 +2154,6 @@ bool Program::linkAttributes(const ContextState &data, InfoLog &infoLog)
// Link attributes that don't have a binding location
for (sh::Attribute &attribute : mState.mAttributes)
{
- ASSERT(attribute.staticUse);
-
// Not set by glBindAttribLocation or by location layout qualifier
if (attribute.location == -1)
{
@@ -2185,7 +2172,6 @@ bool Program::linkAttributes(const ContextState &data, InfoLog &infoLog)
for (const sh::Attribute &attribute : mState.mAttributes)
{
- ASSERT(attribute.staticUse);
ASSERT(attribute.location != -1);
int regs = VariableRegisterCount(attribute.type);
@@ -2391,32 +2377,6 @@ bool Program::linkValidateVariablesBase(InfoLog &infoLog, const std::string &var
return true;
}
-// GLSL ES Spec 3.00.3, section 4.3.5.
-// GLSL ES Spec 3.10.4, section 4.4.5.
-bool Program::linkValidateUniforms(InfoLog &infoLog, const std::string &uniformName, const sh::Uniform &vertexUniform, const sh::Uniform &fragmentUniform)
-{
-#if ANGLE_PROGRAM_LINK_VALIDATE_UNIFORM_PRECISION == ANGLE_ENABLED
- const bool validatePrecision = true;
-#else
- const bool validatePrecision = false;
-#endif
-
- if (!linkValidateVariablesBase(infoLog, uniformName, vertexUniform, fragmentUniform, validatePrecision))
- {
- return false;
- }
-
- if (vertexUniform.binding != -1 && fragmentUniform.binding != -1 &&
- vertexUniform.binding != fragmentUniform.binding)
- {
- infoLog << "Binding layout qualifiers for " << uniformName
- << " differ between vertex and fragment shaders.";
- return false;
- }
-
- return true;
-}
-
bool Program::linkValidateVaryings(InfoLog &infoLog,
const std::string &varyingName,
const sh::Varying &vertexVarying,
@@ -2445,7 +2405,79 @@ bool Program::linkValidateVaryings(InfoLog &infoLog,
return true;
}
-bool Program::linkValidateTransformFeedback(InfoLog &infoLog,
+bool Program::linkValidateBuiltInVaryings(InfoLog &infoLog) const
+{
+ const Shader *vertexShader = mState.mAttachedVertexShader;
+ const Shader *fragmentShader = mState.mAttachedFragmentShader;
+ const std::vector<sh::Varying> &vertexVaryings = vertexShader->getVaryings();
+ const std::vector<sh::Varying> &fragmentVaryings = fragmentShader->getVaryings();
+ int shaderVersion = vertexShader->getShaderVersion();
+
+ if (shaderVersion != 100)
+ {
+ // Only ESSL 1.0 has restrictions on matching input and output invariance
+ return true;
+ }
+
+ bool glPositionIsInvariant = false;
+ bool glPointSizeIsInvariant = false;
+ bool glFragCoordIsInvariant = false;
+ bool glPointCoordIsInvariant = false;
+
+ for (const sh::Varying &varying : vertexVaryings)
+ {
+ if (!varying.isBuiltIn())
+ {
+ continue;
+ }
+ if (varying.name.compare("gl_Position") == 0)
+ {
+ glPositionIsInvariant = varying.isInvariant;
+ }
+ else if (varying.name.compare("gl_PointSize") == 0)
+ {
+ glPointSizeIsInvariant = varying.isInvariant;
+ }
+ }
+
+ for (const sh::Varying &varying : fragmentVaryings)
+ {
+ if (!varying.isBuiltIn())
+ {
+ continue;
+ }
+ if (varying.name.compare("gl_FragCoord") == 0)
+ {
+ glFragCoordIsInvariant = varying.isInvariant;
+ }
+ else if (varying.name.compare("gl_PointCoord") == 0)
+ {
+ glPointCoordIsInvariant = varying.isInvariant;
+ }
+ }
+
+ // There is some ambiguity in ESSL 1.00.17 paragraph 4.6.4 interpretation,
+ // for example, https://cvs.khronos.org/bugzilla/show_bug.cgi?id=13842.
+ // Not requiring invariance to match is supported by:
+ // dEQP, WebGL CTS, Nexus 5X GLES
+ if (glFragCoordIsInvariant && !glPositionIsInvariant)
+ {
+ infoLog << "gl_FragCoord can only be declared invariant if and only if gl_Position is "
+ "declared invariant.";
+ return false;
+ }
+ if (glPointCoordIsInvariant && !glPointSizeIsInvariant)
+ {
+ infoLog << "gl_PointCoord can only be declared invariant if and only if gl_PointSize is "
+ "declared invariant.";
+ return false;
+ }
+
+ return true;
+}
+
+bool Program::linkValidateTransformFeedback(const gl::Context *context,
+ InfoLog &infoLog,
const Program::MergedVaryings &varyings,
const Caps &caps) const
{
@@ -2456,11 +2488,14 @@ bool Program::linkValidateTransformFeedback(InfoLog &infoLog,
for (const std::string &tfVaryingName : mState.mTransformFeedbackVaryingNames)
{
bool found = false;
+ size_t subscript = GL_INVALID_INDEX;
+ std::string baseName = ParseResourceName(tfVaryingName, &subscript);
+
for (const auto &ref : varyings)
{
const sh::Varying *varying = ref.second.get();
- if (tfVaryingName == varying->name)
+ if (baseName == varying->name)
{
if (uniqueNames.count(tfVaryingName) > 0)
{
@@ -2468,16 +2503,29 @@ bool Program::linkValidateTransformFeedback(InfoLog &infoLog,
<< tfVaryingName << ").";
return false;
}
- uniqueNames.insert(tfVaryingName);
-
- if (varying->isArray())
+ if (context->getClientVersion() >= Version(3, 1))
+ {
+ if (IncludeSameArrayElement(uniqueNames, tfVaryingName))
+ {
+ infoLog
+ << "Two transform feedback varyings include the same array element ("
+ << tfVaryingName << ").";
+ return false;
+ }
+ }
+ else if (varying->isArray())
{
infoLog << "Capture of arrays is undefined and not supported.";
return false;
}
+ uniqueNames.insert(tfVaryingName);
+
// TODO(jmadill): Investigate implementation limits on D3D11
- size_t componentCount = VariableComponentCount(varying->type);
+ size_t elementCount =
+ ((varying->isArray() && subscript == GL_INVALID_INDEX) ? varying->elementCount()
+ : 1);
+ size_t componentCount = VariableComponentCount(varying->type) * elementCount;
if (mState.mTransformFeedbackBufferMode == GL_SEPARATE_ATTRIBS &&
componentCount > caps.maxTransformFeedbackSeparateComponents)
{
@@ -2492,13 +2540,12 @@ bool Program::linkValidateTransformFeedback(InfoLog &infoLog,
break;
}
}
-
- if (tfVaryingName.find('[') != std::string::npos)
+ if (context->getClientVersion() < Version(3, 1) &&
+ tfVaryingName.find('[') != std::string::npos)
{
infoLog << "Capture of array elements is undefined and not supported.";
return false;
}
-
// All transform feedback varyings are expected to exist since packVaryings checks for them.
ASSERT(found);
}
@@ -2518,15 +2565,18 @@ bool Program::linkValidateTransformFeedback(InfoLog &infoLog,
void Program::gatherTransformFeedbackVaryings(const Program::MergedVaryings &varyings)
{
// Gather the linked varyings that are used for transform feedback, they should all exist.
- mState.mTransformFeedbackVaryingVars.clear();
+ mState.mLinkedTransformFeedbackVaryings.clear();
for (const std::string &tfVaryingName : mState.mTransformFeedbackVaryingNames)
{
+ size_t subscript = GL_INVALID_INDEX;
+ std::string baseName = ParseResourceName(tfVaryingName, &subscript);
for (const auto &ref : varyings)
{
const sh::Varying *varying = ref.second.get();
- if (tfVaryingName == varying->name)
+ if (baseName == varying->name)
{
- mState.mTransformFeedbackVaryingVars.push_back(*varying);
+ mState.mLinkedTransformFeedbackVaryings.emplace_back(
+ *varying, static_cast<GLuint>(subscript));
break;
}
}
@@ -2555,6 +2605,7 @@ std::vector<PackedVarying> Program::getPackedVaryings(
{
const std::vector<std::string> &tfVaryings = mState.getTransformFeedbackVaryingNames();
std::vector<PackedVarying> packedVaryings;
+ std::set<std::string> uniqueFullNames;
for (const auto &ref : mergedVaryings)
{
@@ -2592,7 +2643,13 @@ std::vector<PackedVarying> Program::getPackedVaryings(
for (const std::string &tfVarying : tfVaryings)
{
- if (tfVarying == input->name)
+ size_t subscript = GL_INVALID_INDEX;
+ std::string baseName = ParseResourceName(tfVarying, &subscript);
+ if (uniqueFullNames.count(tfVarying) > 0)
+ {
+ continue;
+ }
+ if (baseName == input->name)
{
// Transform feedback for varying structs is underspecified.
// See Khronos bug 9856.
@@ -2601,8 +2658,13 @@ std::vector<PackedVarying> Program::getPackedVaryings(
{
packedVaryings.push_back(PackedVarying(*input, input->interpolation));
packedVaryings.back().vertexOnly = true;
+ packedVaryings.back().arrayIndex = static_cast<GLuint>(subscript);
+ uniqueFullNames.insert(tfVarying);
+ }
+ if (subscript == GL_INVALID_INDEX)
+ {
+ break;
}
- break;
}
}
}
@@ -2621,14 +2683,13 @@ void Program::linkOutputVariables()
if (fragmentShader->getShaderVersion() == 100)
return;
- const auto &shaderOutputVars = fragmentShader->getActiveOutputVariables();
-
+ mState.mOutputVariables = fragmentShader->getActiveOutputVariables();
// TODO(jmadill): any caps validation here?
- for (unsigned int outputVariableIndex = 0; outputVariableIndex < shaderOutputVars.size();
+ for (unsigned int outputVariableIndex = 0; outputVariableIndex < mState.mOutputVariables.size();
outputVariableIndex++)
{
- const sh::OutputVariable &outputVariable = shaderOutputVars[outputVariableIndex];
+ const sh::OutputVariable &outputVariable = mState.mOutputVariables[outputVariableIndex];
// Don't store outputs for gl_FragDepth, gl_FragColor, etc.
if (outputVariable.isBuiltIn())
@@ -2637,165 +2698,38 @@ void Program::linkOutputVariables()
// Since multiple output locations must be specified, use 0 for non-specified locations.
int baseLocation = (outputVariable.location == -1 ? 0 : outputVariable.location);
- ASSERT(outputVariable.staticUse);
-
for (unsigned int elementIndex = 0; elementIndex < outputVariable.elementCount();
elementIndex++)
{
const int location = baseLocation + elementIndex;
- ASSERT(mState.mOutputVariables.count(location) == 0);
+ ASSERT(mState.mOutputLocations.count(location) == 0);
unsigned int element = outputVariable.isArray() ? elementIndex : GL_INVALID_INDEX;
- mState.mOutputVariables[location] =
+ mState.mOutputLocations[location] =
VariableLocation(outputVariable.name, element, outputVariableIndex);
}
}
}
-bool Program::flattenUniformsAndCheckCapsForShader(const Shader &shader,
- GLuint maxUniformComponents,
- GLuint maxTextureImageUnits,
- const std::string &componentsErrorMessage,
- const std::string &samplerErrorMessage,
- std::vector<LinkedUniform> &samplerUniforms,
- InfoLog &infoLog)
+void Program::setUniformValuesFromBindingQualifiers()
{
- VectorAndSamplerCount vasCount;
- for (const sh::Uniform &uniform : shader.getUniforms())
- {
- if (uniform.staticUse)
- {
- vasCount += flattenUniform(uniform, uniform.name, &samplerUniforms);
- }
- }
-
- if (vasCount.vectorCount > maxUniformComponents)
- {
- infoLog << componentsErrorMessage << maxUniformComponents << ").";
- return false;
- }
-
- if (vasCount.samplerCount > maxTextureImageUnits)
+ for (unsigned int samplerIndex = mState.mSamplerUniformRange.start;
+ samplerIndex < mState.mSamplerUniformRange.end; ++samplerIndex)
{
- infoLog << samplerErrorMessage << maxTextureImageUnits << ").";
- return false;
- }
-
- return true;
-}
-
-bool Program::flattenUniformsAndCheckCaps(const Caps &caps, InfoLog &infoLog)
-{
- std::vector<LinkedUniform> samplerUniforms;
-
- if (mState.mAttachedComputeShader)
- {
- const Shader *computeShader = mState.getAttachedComputeShader();
-
- // TODO (mradev): check whether we need finer-grained component counting
- if (!flattenUniformsAndCheckCapsForShader(
- *computeShader, caps.maxComputeUniformComponents / 4,
- caps.maxComputeTextureImageUnits,
- "Compute shader active uniforms exceed MAX_COMPUTE_UNIFORM_COMPONENTS (",
- "Compute shader sampler count exceeds MAX_COMPUTE_TEXTURE_IMAGE_UNITS (",
- samplerUniforms, infoLog))
+ const auto &samplerUniform = mState.mUniforms[samplerIndex];
+ if (samplerUniform.binding != -1)
{
- return false;
- }
- }
- else
- {
- const Shader *vertexShader = mState.getAttachedVertexShader();
-
- if (!flattenUniformsAndCheckCapsForShader(
- *vertexShader, caps.maxVertexUniformVectors, caps.maxVertexTextureImageUnits,
- "Vertex shader active uniforms exceed MAX_VERTEX_UNIFORM_VECTORS (",
- "Vertex shader sampler count exceeds MAX_VERTEX_TEXTURE_IMAGE_UNITS (",
- samplerUniforms, infoLog))
- {
- return false;
- }
- const Shader *fragmentShader = mState.getAttachedFragmentShader();
-
- if (!flattenUniformsAndCheckCapsForShader(
- *fragmentShader, caps.maxFragmentUniformVectors, caps.maxTextureImageUnits,
- "Fragment shader active uniforms exceed MAX_FRAGMENT_UNIFORM_VECTORS (",
- "Fragment shader sampler count exceeds MAX_TEXTURE_IMAGE_UNITS (", samplerUniforms,
- infoLog))
- {
- return false;
- }
- }
-
- mState.mSamplerUniformRange.start = static_cast<unsigned int>(mState.mUniforms.size());
- mState.mSamplerUniformRange.end =
- mState.mSamplerUniformRange.start + static_cast<unsigned int>(samplerUniforms.size());
-
- mState.mUniforms.insert(mState.mUniforms.end(), samplerUniforms.begin(), samplerUniforms.end());
-
- // If uniform is a sampler type, insert it into the mSamplerBindings array.
- for (const auto &samplerUniform : samplerUniforms)
- {
- GLenum textureType = SamplerTypeToTextureType(samplerUniform.type);
- mState.mSamplerBindings.emplace_back(
- SamplerBinding(textureType, samplerUniform.elementCount()));
- }
-
- return true;
-}
-
-Program::VectorAndSamplerCount Program::flattenUniform(const sh::ShaderVariable &uniform,
- const std::string &fullName,
- std::vector<LinkedUniform> *samplerUniforms)
-{
- VectorAndSamplerCount vectorAndSamplerCount;
-
- if (uniform.isStruct())
- {
- for (unsigned int elementIndex = 0; elementIndex < uniform.elementCount(); elementIndex++)
- {
- const std::string &elementString = (uniform.isArray() ? ArrayString(elementIndex) : "");
-
- for (size_t fieldIndex = 0; fieldIndex < uniform.fields.size(); fieldIndex++)
+ GLint location = mState.getUniformLocation(samplerUniform.name);
+ ASSERT(location != -1);
+ std::vector<GLint> boundTextureUnits;
+ for (unsigned int elementIndex = 0; elementIndex < samplerUniform.elementCount();
+ ++elementIndex)
{
- const sh::ShaderVariable &field = uniform.fields[fieldIndex];
- const std::string &fieldFullName = (fullName + elementString + "." + field.name);
-
- vectorAndSamplerCount += flattenUniform(field, fieldFullName, samplerUniforms);
+ boundTextureUnits.push_back(samplerUniform.binding + elementIndex);
}
+ setUniform1iv(location, static_cast<GLsizei>(boundTextureUnits.size()),
+ boundTextureUnits.data());
}
-
- return vectorAndSamplerCount;
}
-
- // Not a struct
- bool isSampler = IsSamplerType(uniform.type);
- if (!UniformInList(mState.getUniforms(), fullName) &&
- !UniformInList(*samplerUniforms, fullName))
- {
- LinkedUniform linkedUniform(uniform.type, uniform.precision, fullName, uniform.arraySize,
- -1, sh::BlockMemberInfo::getDefaultBlockInfo());
- linkedUniform.staticUse = true;
-
- // Store sampler uniforms separately, so we'll append them to the end of the list.
- if (isSampler)
- {
- samplerUniforms->push_back(linkedUniform);
- }
- else
- {
- mState.mUniforms.push_back(linkedUniform);
- }
- }
-
- unsigned int elementCount = uniform.elementCount();
-
- // Samplers aren't "real" uniforms, so they don't count towards register usage.
- // Likewise, don't count "real" uniforms towards sampler count.
- vectorAndSamplerCount.vectorCount =
- (isSampler ? 0 : (VariableRegisterCount(uniform.type) * elementCount));
- vectorAndSamplerCount.samplerCount = (isSampler ? elementCount : 0);
-
- return vectorAndSamplerCount;
}
void Program::gatherInterfaceBlockInfo()
@@ -2896,7 +2830,7 @@ void Program::defineUniformBlockMembers(const std::vector<VarT> &fields,
continue;
}
- LinkedUniform newUniform(field.type, field.precision, fullName, field.arraySize,
+ LinkedUniform newUniform(field.type, field.precision, fullName, field.arraySize, -1, -1,
blockIndex, memberInfo);
// Since block uniforms have no location, we don't need to store them in the uniform
diff --git a/chromium/third_party/angle/src/libANGLE/Program.h b/chromium/third_party/angle/src/libANGLE/Program.h
index 46e749bbd6a..a4c0bf05809 100644
--- a/chromium/third_party/angle/src/libANGLE/Program.h
+++ b/chromium/third_party/angle/src/libANGLE/Program.h
@@ -175,6 +175,29 @@ struct SamplerBinding
std::vector<GLuint> boundTextureUnits;
};
+// A varying with tranform feedback enabled. If it's an array, either the whole array or one of its
+// elements specified by 'arrayIndex' can set to be enabled.
+struct TransformFeedbackVarying : public sh::Varying
+{
+ TransformFeedbackVarying(const sh::Varying &varyingIn, GLuint index)
+ : sh::Varying(varyingIn), arrayIndex(index)
+ {
+ }
+ std::string nameWithArrayIndex() const
+ {
+ std::stringstream fullNameStr;
+ fullNameStr << name;
+ if (arrayIndex != GL_INVALID_INDEX)
+ {
+ fullNameStr << "[" << arrayIndex << "]";
+ }
+ return fullNameStr.str();
+ }
+ GLsizei size() const { return (arrayIndex == GL_INVALID_INDEX ? elementCount() : 1); }
+
+ GLuint arrayIndex;
+};
+
class ProgramState final : angle::NonCopyable
{
public:
@@ -205,13 +228,12 @@ class ProgramState final : angle::NonCopyable
{
return mActiveAttribLocationsMask;
}
- const std::map<int, VariableLocation> &getOutputVariables() const { return mOutputVariables; }
+ const std::map<int, VariableLocation> &getOutputLocations() const { return mOutputLocations; }
const std::vector<LinkedUniform> &getUniforms() const { return mUniforms; }
const std::vector<VariableLocation> &getUniformLocations() const { return mUniformLocations; }
const std::vector<UniformBlock> &getUniformBlocks() const { return mUniformBlocks; }
const std::vector<SamplerBinding> &getSamplerBindings() const { return mSamplerBindings; }
- const LinkedUniform *getUniformByName(const std::string &name) const;
GLint getUniformLocation(const std::string &name) const;
GLuint getUniformIndexFromName(const std::string &name) const;
GLuint getUniformIndexFromLocation(GLint location) const;
@@ -231,7 +253,7 @@ class ProgramState final : angle::NonCopyable
Shader *mAttachedComputeShader;
std::vector<std::string> mTransformFeedbackVaryingNames;
- std::vector<sh::Varying> mTransformFeedbackVaryingVars;
+ std::vector<TransformFeedbackVarying> mLinkedTransformFeedbackVaryings;
GLenum mTransformFeedbackBufferMode;
std::array<GLuint, IMPLEMENTATION_MAX_COMBINED_SHADER_UNIFORM_BUFFERS> mUniformBlockBindings;
@@ -253,10 +275,12 @@ class ProgramState final : angle::NonCopyable
// An array of the samplers that are used by the program
std::vector<gl::SamplerBinding> mSamplerBindings;
+ std::vector<sh::OutputVariable> mOutputVariables;
// TODO(jmadill): use unordered/hash map when available
- std::map<int, VariableLocation> mOutputVariables;
+ std::map<int, VariableLocation> mOutputLocations;
bool mBinaryRetrieveableHint;
+ bool mSeparable;
};
class Program final : angle::NonCopyable, public LabeledObject
@@ -308,6 +332,9 @@ class Program final : angle::NonCopyable, public LabeledObject
void setBinaryRetrievableHint(bool retrievable);
bool getBinaryRetrievableHint() const;
+ void setSeparable(bool separable);
+ bool isSeparable() const;
+
int getInfoLogLength() const;
void getInfoLog(GLsizei bufSize, GLsizei *length, char *infoLog) const;
void getAttachedShaders(GLsizei maxCount, GLsizei *count, GLuint *shaders) const;
@@ -315,12 +342,18 @@ class Program final : angle::NonCopyable, public LabeledObject
GLuint getAttributeLocation(const std::string &name) const;
bool isAttribLocationActive(size_t attribLocation) const;
- void getActiveAttribute(GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
+ void getActiveAttribute(GLuint index,
+ GLsizei bufsize,
+ GLsizei *length,
+ GLint *size,
+ GLenum *type,
+ GLchar *name) const;
GLint getActiveAttributeCount() const;
GLint getActiveAttributeMaxLength() const;
const std::vector<sh::Attribute> &getAttributes() const { return mState.mAttributes; }
GLint getFragDataLocation(const std::string &name) const;
+ size_t getOutputResourceCount() const;
void getActiveUniform(GLuint index,
GLsizei bufsize,
@@ -382,7 +415,6 @@ class Program final : angle::NonCopyable, public LabeledObject
GLsizei getTransformFeedbackVaryingMaxLength() const;
GLenum getTransformFeedbackBufferMode() const;
- static bool linkValidateUniforms(InfoLog &infoLog, const std::string &uniformName, const sh::Uniform &vertexUniform, const sh::Uniform &fragmentUniform);
static bool linkValidateInterfaceBlockFields(InfoLog &infoLog, const std::string &uniformName, const sh::InterfaceBlockField &vertexUniform, const sh::InterfaceBlockField &fragmentUniform);
void addRef();
@@ -407,7 +439,17 @@ class Program final : angle::NonCopyable, public LabeledObject
}
const ProgramState &getState() const { return mState; }
- private:
+ static bool linkValidateVariablesBase(InfoLog &infoLog,
+ const std::string &variableName,
+ const sh::ShaderVariable &vertexVariable,
+ const sh::ShaderVariable &fragmentVariable,
+ bool validatePrecision);
+
+ GLuint getInputResourceIndex(const GLchar *name) const;
+ GLuint getOutputResourceIndex(const GLchar *name) const;
+ void getInputResourceName(GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name) const;
+ void getOutputResourceName(GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name) const;
+
class Bindings final : angle::NonCopyable
{
public:
@@ -422,6 +464,7 @@ class Program final : angle::NonCopyable, public LabeledObject
std::unordered_map<std::string, GLuint> mBindings;
};
+ private:
struct VaryingRef
{
const sh::Varying *get() const { return vertex ? vertex : fragment; }
@@ -446,25 +489,22 @@ class Program final : angle::NonCopyable, public LabeledObject
InfoLog &infoLog) const;
bool linkUniformBlocks(InfoLog &infoLog, const Caps &caps);
bool linkVaryings(InfoLog &infoLog) const;
- bool validateVertexAndFragmentUniforms(InfoLog &infoLog) const;
+
bool linkUniforms(InfoLog &infoLog, const Caps &caps, const Bindings &uniformLocationBindings);
- bool indexUniforms(InfoLog &infoLog, const Caps &caps, const Bindings &uniformLocationBindings);
+ void linkSamplerBindings();
+
bool areMatchingInterfaceBlocks(InfoLog &infoLog,
const sh::InterfaceBlock &vertexInterfaceBlock,
const sh::InterfaceBlock &fragmentInterfaceBlock) const;
- static bool linkValidateVariablesBase(InfoLog &infoLog,
- const std::string &variableName,
- const sh::ShaderVariable &vertexVariable,
- const sh::ShaderVariable &fragmentVariable,
- bool validatePrecision);
-
static bool linkValidateVaryings(InfoLog &infoLog,
const std::string &varyingName,
const sh::Varying &vertexVarying,
const sh::Varying &fragmentVarying,
int shaderVersion);
- bool linkValidateTransformFeedback(InfoLog &infoLog,
+ bool linkValidateBuiltInVaryings(InfoLog &infoLog) const;
+ bool linkValidateTransformFeedback(const gl::Context *context,
+ InfoLog &infoLog,
const MergedVaryings &linkedVaryings,
const Caps &caps) const;
@@ -474,35 +514,7 @@ class Program final : angle::NonCopyable, public LabeledObject
std::vector<PackedVarying> getPackedVaryings(const MergedVaryings &mergedVaryings) const;
void linkOutputVariables();
- bool flattenUniformsAndCheckCapsForShader(const Shader &shader,
- GLuint maxUniformComponents,
- GLuint maxTextureImageUnits,
- const std::string &componentsErrorMessage,
- const std::string &samplerErrorMessage,
- std::vector<LinkedUniform> &samplerUniforms,
- InfoLog &infoLog);
- bool flattenUniformsAndCheckCaps(const Caps &caps, InfoLog &infoLog);
-
- struct VectorAndSamplerCount
- {
- VectorAndSamplerCount() : vectorCount(0), samplerCount(0) {}
- VectorAndSamplerCount(const VectorAndSamplerCount &other) = default;
- VectorAndSamplerCount &operator=(const VectorAndSamplerCount &other) = default;
-
- VectorAndSamplerCount &operator+=(const VectorAndSamplerCount &other)
- {
- vectorCount += other.vectorCount;
- samplerCount += other.samplerCount;
- return *this;
- }
-
- unsigned int vectorCount;
- unsigned int samplerCount;
- };
-
- VectorAndSamplerCount flattenUniform(const sh::ShaderVariable &uniform,
- const std::string &fullName,
- std::vector<LinkedUniform> *samplerUniforms);
+ void setUniformValuesFromBindingQualifiers();
void gatherInterfaceBlockInfo();
template <typename VarT>
diff --git a/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp b/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp
index c60db2ccb20..f51bed218c3 100644
--- a/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp
+++ b/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp
@@ -304,6 +304,17 @@ bool TextureManager::isTextureGenerated(GLuint texture) const
return texture == 0 || mObjectMap.find(texture) != mObjectMap.end();
}
+void TextureManager::invalidateTextureComplenessCache()
+{
+ for (auto &texture : mObjectMap)
+ {
+ if (texture.second)
+ {
+ texture.second->invalidateCompletenessCache();
+ }
+ }
+}
+
// RenderbufferManager Implementation.
// static
@@ -497,4 +508,15 @@ bool FramebufferManager::isFramebufferGenerated(GLuint framebuffer)
return mObjectMap.find(framebuffer) != mObjectMap.end();
}
+void FramebufferManager::invalidateFramebufferComplenessCache()
+{
+ for (auto &framebuffer : mObjectMap)
+ {
+ if (framebuffer.second)
+ {
+ framebuffer.second->invalidateCompletenessCache();
+ }
+ }
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/ResourceManager.h b/chromium/third_party/angle/src/libANGLE/ResourceManager.h
index 0051e32971b..82d230792f8 100644
--- a/chromium/third_party/angle/src/libANGLE/ResourceManager.h
+++ b/chromium/third_party/angle/src/libANGLE/ResourceManager.h
@@ -150,6 +150,8 @@ class TextureManager : public TypedResourceManager<Texture, HandleAllocator, Tex
Texture *getTexture(GLuint handle) const;
bool isTextureGenerated(GLuint texture) const;
+ void invalidateTextureComplenessCache();
+
Texture *checkTextureAllocation(rx::GLImplFactory *factory, GLuint handle, GLenum target)
{
return checkObjectAllocation(factory, handle, target);
@@ -238,6 +240,8 @@ class FramebufferManager
void setDefaultFramebuffer(Framebuffer *framebuffer);
bool isFramebufferGenerated(GLuint framebuffer);
+ void invalidateFramebufferComplenessCache();
+
Framebuffer *checkFramebufferAllocation(rx::GLImplFactory *factory,
const Caps &caps,
GLuint handle)
diff --git a/chromium/third_party/angle/src/libANGLE/Shader.cpp b/chromium/third_party/angle/src/libANGLE/Shader.cpp
index 4dd86eeb7d3..6bd07a28672 100644
--- a/chromium/third_party/angle/src/libANGLE/Shader.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Shader.cpp
@@ -296,15 +296,14 @@ void Shader::compile(const Context *context)
shaderStream << "// GLSL\n";
shaderStream << "//\n";
- size_t curPos = 0;
- while (curPos != std::string::npos)
+ std::istringstream inputSourceStream(mState.mSource);
+ std::string line;
+ while (std::getline(inputSourceStream, line))
{
- size_t nextLine = mState.mSource.find("\n", curPos);
- size_t len = (nextLine == std::string::npos) ? std::string::npos : (nextLine - curPos + 1);
+ // Remove null characters from the source line
+ line.erase(std::remove(line.begin(), line.end(), '\0'), line.end());
- shaderStream << "// " << mState.mSource.substr(curPos, len);
-
- curPos = (nextLine == std::string::npos) ? std::string::npos : (nextLine + 1);
+ shaderStream << "// " << line;
}
shaderStream << "\n\n";
shaderStream << mState.mTranslatedSource;
diff --git a/chromium/third_party/angle/src/libANGLE/State.cpp b/chromium/third_party/angle/src/libANGLE/State.cpp
index 5ec2090d6bd..408aa26b8b7 100644
--- a/chromium/third_party/angle/src/libANGLE/State.cpp
+++ b/chromium/third_party/angle/src/libANGLE/State.cpp
@@ -11,7 +11,7 @@
#include <limits>
#include <string.h>
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/matrix_utils.h"
#include "common/mathutil.h"
#include "libANGLE/Context.h"
@@ -62,7 +62,8 @@ State::State()
mPrimitiveRestart(false),
mMultiSampling(false),
mSampleAlphaToOne(false),
- mFramebufferSRGB(true)
+ mFramebufferSRGB(true),
+ mRobustResourceInit(false)
{
}
@@ -75,7 +76,8 @@ void State::initialize(const Caps &caps,
const Version &clientVersion,
bool debug,
bool bindGeneratesResource,
- bool clientArraysEnabled)
+ bool clientArraysEnabled,
+ bool robustResourceInit)
{
mMaxDrawBuffers = caps.maxDrawBuffers;
mMaxCombinedTextureImageUnits = caps.maxCombinedTextureImageUnits;
@@ -177,6 +179,7 @@ void State::initialize(const Caps &caps,
mSamplerTextures[GL_TEXTURE_2D_MULTISAMPLE].resize(caps.maxCombinedTextureImageUnits);
mAtomicCounterBuffers.resize(caps.maxAtomicCounterBufferBindings);
+ mShaderStorageBuffers.resize(caps.maxShaderStorageBufferBindings);
}
if (extensions.eglImageExternal || extensions.eglStreamConsumerExternal)
{
@@ -214,6 +217,8 @@ void State::initialize(const Caps &caps,
mPathStencilFunc = GL_ALWAYS;
mPathStencilRef = 0;
mPathStencilMask = std::numeric_limits<GLuint>::max();
+
+ mRobustResourceInit = robustResourceInit;
}
void State::reset(const Context *context)
@@ -266,6 +271,12 @@ void State::reset(const Context *context)
buf.set(nullptr);
}
+ mGenericShaderStorageBuffer.set(nullptr);
+ for (auto &buf : mShaderStorageBuffers)
+ {
+ buf.set(nullptr);
+ }
+
mProgram = NULL;
angle::Matrix<GLfloat>::setToIdentity(mPathMatrixProj);
@@ -697,6 +708,8 @@ bool State::getEnableFeature(GLenum feature) const
return areClientArraysEnabled();
case GL_FRAMEBUFFER_SRGB_EXT:
return getFramebufferSRGB();
+ case GL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE:
+ return mRobustResourceInit;
default: UNREACHABLE(); return false;
}
}
@@ -1035,6 +1048,45 @@ bool State::removeVertexArrayBinding(GLuint vertexArray)
return false;
}
+void State::setElementArrayBuffer(Buffer *buffer)
+{
+ getVertexArray()->setElementArrayBuffer(buffer);
+ mDirtyObjects.set(DIRTY_OBJECT_VERTEX_ARRAY);
+}
+
+void State::bindVertexBuffer(GLuint bindingIndex,
+ Buffer *boundBuffer,
+ GLintptr offset,
+ GLsizei stride)
+{
+ getVertexArray()->bindVertexBuffer(bindingIndex, boundBuffer, offset, stride);
+ mDirtyObjects.set(DIRTY_OBJECT_VERTEX_ARRAY);
+}
+
+void State::setVertexAttribBinding(GLuint attribIndex, GLuint bindingIndex)
+{
+ getVertexArray()->setVertexAttribBinding(attribIndex, bindingIndex);
+ mDirtyObjects.set(DIRTY_OBJECT_VERTEX_ARRAY);
+}
+
+void State::setVertexAttribFormat(GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ bool normalized,
+ bool pureInteger,
+ GLuint relativeOffset)
+{
+ getVertexArray()->setVertexAttribFormat(attribIndex, size, type, normalized, pureInteger,
+ relativeOffset);
+ mDirtyObjects.set(DIRTY_OBJECT_VERTEX_ARRAY);
+}
+
+void State::setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor)
+{
+ getVertexArray()->setVertexBindingDivisor(bindingIndex, divisor);
+ mDirtyObjects.set(DIRTY_OBJECT_VERTEX_ARRAY);
+}
+
void State::setProgram(const Context *context, Program *newProgram)
{
if (mProgram != newProgram)
@@ -1185,6 +1237,26 @@ const OffsetBindingPointer<Buffer> &State::getIndexedAtomicCounterBuffer(size_t
return mAtomicCounterBuffers[index];
}
+void State::setGenericShaderStorageBufferBinding(Buffer *buffer)
+{
+ mGenericShaderStorageBuffer.set(buffer);
+}
+
+void State::setIndexedShaderStorageBufferBinding(GLuint index,
+ Buffer *buffer,
+ GLintptr offset,
+ GLsizeiptr size)
+{
+ ASSERT(static_cast<size_t>(index) < mShaderStorageBuffers.size());
+ mShaderStorageBuffers[index].set(buffer, offset, size);
+}
+
+const OffsetBindingPointer<Buffer> &State::getIndexedShaderStorageBuffer(size_t index) const
+{
+ ASSERT(static_cast<size_t>(index) < mShaderStorageBuffers.size());
+ return mShaderStorageBuffers[index];
+}
+
void State::setCopyReadBufferBinding(Buffer *buffer)
{
mCopyReadBuffer.set(buffer);
@@ -1222,8 +1294,7 @@ Buffer *State::getTargetBuffer(GLenum target) const
case GL_ATOMIC_COUNTER_BUFFER:
return mGenericAtomicCounterBuffer.get();
case GL_SHADER_STORAGE_BUFFER:
- UNIMPLEMENTED();
- return nullptr;
+ return mGenericShaderStorageBuffer.get();
case GL_DRAW_INDIRECT_BUFFER:
return mDrawIndirectBuffer.get();
default: UNREACHABLE(); return NULL;
@@ -1232,10 +1303,10 @@ Buffer *State::getTargetBuffer(GLenum target) const
void State::detachBuffer(GLuint bufferName)
{
- BindingPointer<Buffer> *buffers[] = {&mArrayBuffer, &mGenericAtomicCounterBuffer,
- &mCopyReadBuffer, &mCopyWriteBuffer,
- &mDrawIndirectBuffer, &mPack.pixelBuffer,
- &mUnpack.pixelBuffer, &mGenericUniformBuffer};
+ BindingPointer<Buffer> *buffers[] = {
+ &mArrayBuffer, &mGenericAtomicCounterBuffer, &mCopyReadBuffer,
+ &mCopyWriteBuffer, &mDrawIndirectBuffer, &mPack.pixelBuffer,
+ &mUnpack.pixelBuffer, &mGenericUniformBuffer, &mGenericShaderStorageBuffer};
for (auto buffer : buffers)
{
if (buffer->id() == bufferName)
@@ -1589,6 +1660,9 @@ void State::getBooleanv(GLenum pname, GLboolean *params)
case GL_FRAMEBUFFER_SRGB_EXT:
*params = getFramebufferSRGB() ? GL_TRUE : GL_FALSE;
break;
+ case GL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE:
+ *params = mRobustResourceInit ? GL_TRUE : GL_FALSE;
+ break;
default:
UNREACHABLE();
break;
@@ -1638,7 +1712,7 @@ void State::getFloatv(GLenum pname, GLfloat *params)
}
}
-void State::getIntegerv(const ContextState &data, GLenum pname, GLint *params)
+void State::getIntegerv(const Context *context, GLenum pname, GLint *params)
{
if (pname >= GL_DRAW_BUFFER0_EXT && pname <= GL_DRAW_BUFFER15_EXT)
{
@@ -1725,14 +1799,14 @@ void State::getIntegerv(const ContextState &data, GLenum pname, GLint *params)
case GL_SAMPLES:
{
gl::Framebuffer *framebuffer = mDrawFramebuffer;
- if (framebuffer->checkStatus(data) == GL_FRAMEBUFFER_COMPLETE)
+ if (framebuffer->checkStatus(context) == GL_FRAMEBUFFER_COMPLETE)
{
switch (pname)
{
case GL_SAMPLE_BUFFERS:
- if (framebuffer->getSamples(data) != 0)
- {
- *params = 1;
+ if (framebuffer->getSamples(context) != 0)
+ {
+ *params = 1;
}
else
{
@@ -1740,8 +1814,8 @@ void State::getIntegerv(const ContextState &data, GLenum pname, GLint *params)
}
break;
case GL_SAMPLES:
- *params = framebuffer->getSamples(data);
- break;
+ *params = framebuffer->getSamples(context);
+ break;
}
}
else
@@ -1889,6 +1963,9 @@ void State::getIntegerv(const ContextState &data, GLenum pname, GLint *params)
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
*params = mGenericAtomicCounterBuffer.id();
break;
+ case GL_SHADER_STORAGE_BUFFER_BINDING:
+ *params = mGenericShaderStorageBuffer.id();
+ break;
default:
UNREACHABLE();
break;
@@ -1927,6 +2004,26 @@ void State::getIntegeri_v(GLenum target, GLuint index, GLint *data)
ASSERT(static_cast<size_t>(index) < mAtomicCounterBuffers.size());
*data = mAtomicCounterBuffers[index].id();
break;
+ case GL_SHADER_STORAGE_BUFFER_BINDING:
+ ASSERT(static_cast<size_t>(index) < mShaderStorageBuffers.size());
+ *data = mShaderStorageBuffers[index].id();
+ break;
+ case GL_VERTEX_BINDING_BUFFER:
+ ASSERT(static_cast<size_t>(index) < mVertexArray->getMaxBindings());
+ *data = mVertexArray->getVertexBinding(index).buffer.id();
+ break;
+ case GL_VERTEX_BINDING_DIVISOR:
+ ASSERT(static_cast<size_t>(index) < mVertexArray->getMaxBindings());
+ *data = mVertexArray->getVertexBinding(index).divisor;
+ break;
+ case GL_VERTEX_BINDING_OFFSET:
+ ASSERT(static_cast<size_t>(index) < mVertexArray->getMaxBindings());
+ *data = static_cast<GLuint>(mVertexArray->getVertexBinding(index).offset);
+ break;
+ case GL_VERTEX_BINDING_STRIDE:
+ ASSERT(static_cast<size_t>(index) < mVertexArray->getMaxBindings());
+ *data = mVertexArray->getVertexBinding(index).stride;
+ break;
default:
UNREACHABLE();
break;
@@ -1961,6 +2058,14 @@ void State::getInteger64i_v(GLenum target, GLuint index, GLint64 *data)
ASSERT(static_cast<size_t>(index) < mAtomicCounterBuffers.size());
*data = mAtomicCounterBuffers[index].getSize();
break;
+ case GL_SHADER_STORAGE_BUFFER_START:
+ ASSERT(static_cast<size_t>(index) < mShaderStorageBuffers.size());
+ *data = mShaderStorageBuffers[index].getOffset();
+ break;
+ case GL_SHADER_STORAGE_BUFFER_SIZE:
+ ASSERT(static_cast<size_t>(index) < mShaderStorageBuffers.size());
+ *data = mShaderStorageBuffers[index].getSize();
+ break;
default:
UNREACHABLE();
break;
@@ -1999,15 +2104,15 @@ bool State::hasMappedBuffer(GLenum target) const
}
}
-void State::syncDirtyObjects()
+void State::syncDirtyObjects(const Context *context)
{
if (!mDirtyObjects.any())
return;
- syncDirtyObjects(mDirtyObjects);
+ syncDirtyObjects(context, mDirtyObjects);
}
-void State::syncDirtyObjects(const DirtyObjects &bitset)
+void State::syncDirtyObjects(const Context *context, const DirtyObjects &bitset)
{
for (auto dirtyObject : angle::IterateBitSet(bitset))
{
@@ -2015,15 +2120,15 @@ void State::syncDirtyObjects(const DirtyObjects &bitset)
{
case DIRTY_OBJECT_READ_FRAMEBUFFER:
ASSERT(mReadFramebuffer);
- mReadFramebuffer->syncState();
+ mReadFramebuffer->syncState(context);
break;
case DIRTY_OBJECT_DRAW_FRAMEBUFFER:
ASSERT(mDrawFramebuffer);
- mDrawFramebuffer->syncState();
+ mDrawFramebuffer->syncState(context);
break;
case DIRTY_OBJECT_VERTEX_ARRAY:
ASSERT(mVertexArray);
- mVertexArray->syncImplState();
+ mVertexArray->syncImplState(context);
break;
case DIRTY_OBJECT_PROGRAM:
// TODO(jmadill): implement this
@@ -2037,7 +2142,7 @@ void State::syncDirtyObjects(const DirtyObjects &bitset)
mDirtyObjects &= ~bitset;
}
-void State::syncDirtyObject(GLenum target)
+void State::syncDirtyObject(const Context *context, GLenum target)
{
DirtyObjects localSet;
@@ -2061,7 +2166,7 @@ void State::syncDirtyObject(GLenum target)
break;
}
- syncDirtyObjects(localSet);
+ syncDirtyObjects(context, localSet);
}
void State::setObjectDirty(GLenum target)
diff --git a/chromium/third_party/angle/src/libANGLE/State.h b/chromium/third_party/angle/src/libANGLE/State.h
index 1f13b871c1e..c7e694ba0fe 100644
--- a/chromium/third_party/angle/src/libANGLE/State.h
+++ b/chromium/third_party/angle/src/libANGLE/State.h
@@ -45,7 +45,8 @@ class State : angle::NonCopyable
const Version &clientVersion,
bool debug,
bool bindGeneratesResource,
- bool clientArraysEnabled);
+ bool clientArraysEnabled,
+ bool robustResourceInit);
void reset(const Context *context);
// State chunk getters
@@ -235,6 +236,14 @@ class State : angle::NonCopyable
GLsizeiptr size);
const OffsetBindingPointer<Buffer> &getIndexedAtomicCounterBuffer(size_t index) const;
+ // GL_SHADER_STORAGE_BUFFER - Both indexed and generic targets
+ void setGenericShaderStorageBufferBinding(Buffer *buffer);
+ void setIndexedShaderStorageBufferBinding(GLuint index,
+ Buffer *buffer,
+ GLintptr offset,
+ GLsizeiptr size);
+ const OffsetBindingPointer<Buffer> &getIndexedShaderStorageBuffer(size_t index) const;
+
// GL_COPY_[READ/WRITE]_BUFFER
void setCopyReadBufferBinding(Buffer *buffer);
void setCopyWriteBufferBinding(Buffer *buffer);
@@ -250,6 +259,7 @@ class State : angle::NonCopyable
// Vertex attrib manipulation
void setEnableVertexAttribArray(unsigned int attribNum, bool enabled);
+ void setElementArrayBuffer(Buffer *buffer);
void setVertexAttribf(GLuint index, const GLfloat values[4]);
void setVertexAttribu(GLuint index, const GLuint values[4]);
void setVertexAttribi(GLuint index, const GLint values[4]);
@@ -258,6 +268,18 @@ class State : angle::NonCopyable
void setVertexAttribDivisor(GLuint index, GLuint divisor);
const VertexAttribCurrentValueData &getVertexAttribCurrentValue(unsigned int attribNum) const;
const void *getVertexAttribPointer(unsigned int attribNum) const;
+ void bindVertexBuffer(GLuint bindingIndex,
+ Buffer *boundBuffer,
+ GLintptr offset,
+ GLsizei stride);
+ void setVertexAttribFormat(GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ bool normalized,
+ bool pureInteger,
+ GLuint relativeOffset);
+ void setVertexAttribBinding(GLuint attribIndex, GLuint bindingIndex);
+ void setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor);
// Pixel pack state manipulation
void setPackAlignment(GLint alignment);
@@ -313,13 +335,14 @@ class State : angle::NonCopyable
// State query functions
void getBooleanv(GLenum pname, GLboolean *params);
void getFloatv(GLenum pname, GLfloat *params);
- void getIntegerv(const ContextState &data, GLenum pname, GLint *params);
+ void getIntegerv(const Context *context, GLenum pname, GLint *params);
void getPointerv(GLenum pname, void **params) const;
void getIntegeri_v(GLenum target, GLuint index, GLint *data);
void getInteger64i_v(GLenum target, GLuint index, GLint64 *data);
void getBooleani_v(GLenum target, GLuint index, GLboolean *data);
bool hasMappedBuffer(GLenum target) const;
+ bool isRobustResourceInitEnabled() const { return mRobustResourceInit; }
enum DirtyBitType
{
@@ -411,9 +434,9 @@ class State : angle::NonCopyable
typedef std::bitset<DIRTY_OBJECT_MAX> DirtyObjects;
void clearDirtyObjects() { mDirtyObjects.reset(); }
void setAllDirtyObjects() { mDirtyObjects.set(); }
- void syncDirtyObjects();
- void syncDirtyObjects(const DirtyObjects &bitset);
- void syncDirtyObject(GLenum target);
+ void syncDirtyObjects(const Context *context);
+ void syncDirtyObjects(const Context *context, const DirtyObjects &bitset);
+ void syncDirtyObject(const Context *context, GLenum target);
void setObjectDirty(GLenum target);
private:
@@ -484,6 +507,9 @@ class State : angle::NonCopyable
BindingPointer<Buffer> mGenericAtomicCounterBuffer;
BufferVector mAtomicCounterBuffers;
+ BindingPointer<Buffer> mGenericShaderStorageBuffer;
+ BufferVector mShaderStorageBuffers;
+
BindingPointer<Buffer> mCopyReadBuffer;
BindingPointer<Buffer> mCopyWriteBuffer;
@@ -509,6 +535,9 @@ class State : angle::NonCopyable
// GL_EXT_sRGB_write_control
bool mFramebufferSRGB;
+ // GL_ANGLE_robust_resource_intialization
+ bool mRobustResourceInit;
+
DirtyBits mDirtyBits;
DirtyObjects mDirtyObjects;
};
diff --git a/chromium/third_party/angle/src/libANGLE/Surface.cpp b/chromium/third_party/angle/src/libANGLE/Surface.cpp
index 422b3e632a1..e6a949c413f 100644
--- a/chromium/third_party/angle/src/libANGLE/Surface.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Surface.cpp
@@ -244,6 +244,11 @@ Error Surface::releaseTexImage(EGLint buffer)
return Error(EGL_SUCCESS);
}
+Error Surface::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
+{
+ return mImplementation->getSyncValues(ust, msc, sbc);
+}
+
void Surface::releaseTexImageFromTexture()
{
ASSERT(mTexture.get());
diff --git a/chromium/third_party/angle/src/libANGLE/Surface.h b/chromium/third_party/angle/src/libANGLE/Surface.h
index e44339d608c..88b4d0f1f47 100644
--- a/chromium/third_party/angle/src/libANGLE/Surface.h
+++ b/chromium/third_party/angle/src/libANGLE/Surface.h
@@ -62,6 +62,8 @@ class Surface : public gl::FramebufferAttachmentObject
Error bindTexImage(gl::Texture *texture, EGLint buffer);
Error releaseTexImage(EGLint buffer);
+ Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc);
+
EGLint isPostSubBufferSupported() const;
void setSwapInterval(EGLint interval);
diff --git a/chromium/third_party/angle/src/libANGLE/Surface_unittest.cpp b/chromium/third_party/angle/src/libANGLE/Surface_unittest.cpp
index 6a8ba4eba48..7eaff599161 100644
--- a/chromium/third_party/angle/src/libANGLE/Surface_unittest.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Surface_unittest.cpp
@@ -37,6 +37,7 @@ class MockSurfaceImpl : public rx::SurfaceImpl
MOCK_METHOD2(querySurfacePointerANGLE, egl::Error(EGLint, void**));
MOCK_METHOD2(bindTexImage, egl::Error(gl::Texture*, EGLint));
MOCK_METHOD1(releaseTexImage, egl::Error(EGLint));
+ MOCK_METHOD3(getSyncValues, egl::Error(EGLuint64KHR *, EGLuint64KHR *, EGLuint64KHR *));
MOCK_METHOD1(setSwapInterval, void(EGLint));
MOCK_CONST_METHOD0(getWidth, EGLint());
MOCK_CONST_METHOD0(getHeight, EGLint());
diff --git a/chromium/third_party/angle/src/libANGLE/Texture.cpp b/chromium/third_party/angle/src/libANGLE/Texture.cpp
index cdaadd2c72a..f6daba220ad 100644
--- a/chromium/third_party/angle/src/libANGLE/Texture.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Texture.cpp
@@ -156,8 +156,8 @@ bool TextureState::setBaseLevel(GLuint baseLevel)
{
if (mBaseLevel != baseLevel)
{
- mBaseLevel = baseLevel;
- mCompletenessCache.cacheValid = false;
+ mBaseLevel = baseLevel;
+ invalidateCompletenessCache();
return true;
}
return false;
@@ -167,8 +167,8 @@ void TextureState::setMaxLevel(GLuint maxLevel)
{
if (mMaxLevel != maxLevel)
{
- mMaxLevel = maxLevel;
- mCompletenessCache.cacheValid = false;
+ mMaxLevel = maxLevel;
+ invalidateCompletenessCache();
}
}
@@ -200,21 +200,30 @@ bool TextureState::isCubeComplete() const
bool TextureState::isSamplerComplete(const SamplerState &samplerState,
const ContextState &data) const
{
- const ImageDesc &baseImageDesc = getImageDesc(getBaseImageTarget(), getEffectiveBaseLevel());
- const TextureCaps &textureCaps = data.getTextureCap(baseImageDesc.format.asSized());
- if (!mCompletenessCache.cacheValid || mCompletenessCache.samplerState != samplerState ||
- mCompletenessCache.filterable != textureCaps.filterable ||
- mCompletenessCache.clientVersion != data.getClientMajorVersion() ||
- mCompletenessCache.supportsNPOT != data.getExtensions().textureNPOT)
+ bool newEntry = false;
+ auto cacheIter = mCompletenessCache.find(data.getContextID());
+ if (cacheIter == mCompletenessCache.end())
+ {
+ // Add a new cache entry
+ cacheIter = mCompletenessCache
+ .insert(std::make_pair(data.getContextID(), SamplerCompletenessCache()))
+ .first;
+ newEntry = true;
+ }
+
+ SamplerCompletenessCache *cacheEntry = &cacheIter->second;
+ if (newEntry || cacheEntry->samplerState != samplerState)
{
- mCompletenessCache.cacheValid = true;
- mCompletenessCache.samplerState = samplerState;
- mCompletenessCache.filterable = textureCaps.filterable;
- mCompletenessCache.clientVersion = data.getClientMajorVersion();
- mCompletenessCache.supportsNPOT = data.getExtensions().textureNPOT;
- mCompletenessCache.samplerComplete = computeSamplerCompleteness(samplerState, data);
+ cacheEntry->samplerState = samplerState;
+ cacheEntry->samplerComplete = computeSamplerCompleteness(samplerState, data);
}
- return mCompletenessCache.samplerComplete;
+
+ return cacheEntry->samplerComplete;
+}
+
+void TextureState::invalidateCompletenessCache()
+{
+ mCompletenessCache.clear();
}
bool TextureState::computeSamplerCompleteness(const SamplerState &samplerState,
@@ -442,8 +451,8 @@ void TextureState::setImageDesc(GLenum target, size_t level, const ImageDesc &de
{
size_t descIndex = GetImageDescIndex(target, level);
ASSERT(descIndex < mImageDescs.size());
- mImageDescs[descIndex] = desc;
- mCompletenessCache.cacheValid = false;
+ mImageDescs[descIndex] = desc;
+ invalidateCompletenessCache();
}
void TextureState::setImageDescChain(GLuint baseLevel,
@@ -496,16 +505,11 @@ void TextureState::clearImageDescs()
{
mImageDescs[descIndex] = ImageDesc();
}
- mCompletenessCache.cacheValid = false;
+ invalidateCompletenessCache();
}
TextureState::SamplerCompletenessCache::SamplerCompletenessCache()
- : cacheValid(false),
- samplerState(),
- filterable(false),
- clientVersion(0),
- supportsNPOT(false),
- samplerComplete(false)
+ : samplerState(), samplerComplete(false)
{
}
@@ -845,6 +849,12 @@ egl::Stream *Texture::getBoundStream() const
return mBoundStream;
}
+void Texture::invalidateCompletenessCache()
+{
+ mState.invalidateCompletenessCache();
+ mDirtyChannel.signal();
+}
+
Error Texture::setImage(const Context *context,
const PixelUnpackState &unpackState,
GLenum target,
@@ -967,38 +977,52 @@ Error Texture::copySubImage(const Context *context,
}
Error Texture::copyTexture(const Context *context,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source)
{
+ ASSERT(target == mState.mTarget ||
+ (mState.mTarget == GL_TEXTURE_CUBE_MAP && IsCubeMapTextureTarget(target)));
+
// Release from previous calls to eglBindTexImage, to avoid calling the Impl after
releaseTexImageInternal();
orphanImages();
- ANGLE_TRY(mTexture->copyTexture(rx::SafeGetImpl(context), internalFormat, type, unpackFlipY,
- unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source));
+ ANGLE_TRY(mTexture->copyTexture(rx::SafeGetImpl(context), target, level, internalFormat, type,
+ sourceLevel, unpackFlipY, unpackPremultiplyAlpha,
+ unpackUnmultiplyAlpha, source));
const auto &sourceDesc = source->mState.getImageDesc(source->getTarget(), 0);
const GLenum sizedFormat = GetSizedInternalFormat(internalFormat, type);
- mState.setImageDesc(getTarget(), 0, ImageDesc(sourceDesc.size, Format(sizedFormat)));
+ mState.setImageDesc(target, level, ImageDesc(sourceDesc.size, Format(sizedFormat)));
mDirtyChannel.signal();
return NoError();
}
Error Texture::copySubTexture(const Context *context,
+ GLenum target,
+ size_t level,
const Offset &destOffset,
+ size_t sourceLevel,
const Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source)
{
- return mTexture->copySubTexture(rx::SafeGetImpl(context), destOffset, sourceArea, unpackFlipY,
- unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
+ ASSERT(target == mState.mTarget ||
+ (mState.mTarget == GL_TEXTURE_CUBE_MAP && IsCubeMapTextureTarget(target)));
+
+ return mTexture->copySubTexture(rx::SafeGetImpl(context), target, level, destOffset,
+ sourceLevel, sourceArea, unpackFlipY, unpackPremultiplyAlpha,
+ unpackUnmultiplyAlpha, source);
}
Error Texture::copyCompressedTexture(const Context *context, const Texture *source)
diff --git a/chromium/third_party/angle/src/libANGLE/Texture.h b/chromium/third_party/angle/src/libANGLE/Texture.h
index c251916dcad..7addde78f68 100644
--- a/chromium/third_party/angle/src/libANGLE/Texture.h
+++ b/chromium/third_party/angle/src/libANGLE/Texture.h
@@ -100,6 +100,8 @@ struct TextureState final : public angle::NonCopyable
bool isCubeComplete() const;
bool isSamplerComplete(const SamplerState &samplerState, const ContextState &data) const;
+ void invalidateCompletenessCache();
+
const ImageDesc &getImageDesc(GLenum target, size_t level) const;
GLenum getTarget() const { return mTarget; }
@@ -157,19 +159,15 @@ struct TextureState final : public angle::NonCopyable
{
SamplerCompletenessCache();
- bool cacheValid;
-
// All values that affect sampler completeness that are not stored within
// the texture itself
SamplerState samplerState;
- bool filterable;
- GLint clientVersion;
- bool supportsNPOT;
// Result of the sampler completeness with the above parameters
bool samplerComplete;
};
- mutable SamplerCompletenessCache mCompletenessCache;
+
+ mutable std::unordered_map<ContextID, SamplerCompletenessCache> mCompletenessCache;
};
bool operator==(const TextureState &a, const TextureState &b);
@@ -313,14 +311,20 @@ class Texture final : public egl::ImageSibling,
const Framebuffer *source);
Error copyTexture(const Context *context,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source);
Error copySubTexture(const Context *context,
+ GLenum target,
+ size_t level,
const Offset &destOffset,
+ size_t sourceLevel,
const Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
@@ -348,6 +352,8 @@ class Texture final : public egl::ImageSibling,
egl::Surface *getBoundSurface() const;
egl::Stream *getBoundStream() const;
+ void invalidateCompletenessCache();
+
rx::TextureImpl *getImplementation() const { return mTexture; }
// FramebufferAttachmentObject implementation
diff --git a/chromium/third_party/angle/src/libANGLE/Uniform.cpp b/chromium/third_party/angle/src/libANGLE/Uniform.cpp
index 5a8509efa4c..a53115903b1 100644
--- a/chromium/third_party/angle/src/libANGLE/Uniform.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Uniform.cpp
@@ -22,6 +22,8 @@ LinkedUniform::LinkedUniform(GLenum typeIn,
GLenum precisionIn,
const std::string &nameIn,
unsigned int arraySizeIn,
+ const int bindingIn,
+ const int locationIn,
const int blockIndexIn,
const sh::BlockMemberInfo &blockInfoIn)
: blockIndex(blockIndexIn), blockInfo(blockInfoIn)
@@ -30,6 +32,8 @@ LinkedUniform::LinkedUniform(GLenum typeIn,
precision = precisionIn;
name = nameIn;
arraySize = arraySizeIn;
+ binding = bindingIn;
+ location = locationIn;
}
LinkedUniform::LinkedUniform(const sh::Uniform &uniform)
diff --git a/chromium/third_party/angle/src/libANGLE/Uniform.h b/chromium/third_party/angle/src/libANGLE/Uniform.h
index 42edb89154e..cfba68eaec6 100644
--- a/chromium/third_party/angle/src/libANGLE/Uniform.h
+++ b/chromium/third_party/angle/src/libANGLE/Uniform.h
@@ -23,7 +23,14 @@ namespace gl
struct LinkedUniform : public sh::Uniform
{
LinkedUniform();
- LinkedUniform(GLenum type, GLenum precision, const std::string &name, unsigned int arraySize, const int blockIndex, const sh::BlockMemberInfo &blockInfo);
+ LinkedUniform(GLenum type,
+ GLenum precision,
+ const std::string &name,
+ unsigned int arraySize,
+ const int binding,
+ const int location,
+ const int blockIndex,
+ const sh::BlockMemberInfo &blockInfo);
LinkedUniform(const sh::Uniform &uniform);
LinkedUniform(const LinkedUniform &uniform);
LinkedUniform &operator=(const LinkedUniform &uniform);
@@ -45,7 +52,7 @@ struct LinkedUniform : public sh::Uniform
sh::BlockMemberInfo blockInfo;
private:
- mutable rx::MemoryBuffer mLazyData;
+ mutable angle::MemoryBuffer mLazyData;
};
// Helper struct representing a single shader uniform block
diff --git a/chromium/third_party/angle/src/libANGLE/UniformLinker.cpp b/chromium/third_party/angle/src/libANGLE/UniformLinker.cpp
new file mode 100644
index 00000000000..8b735c4c003
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/UniformLinker.cpp
@@ -0,0 +1,491 @@
+//
+// 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.
+//
+
+// UniformLinker.cpp: implements link-time checks for default block uniforms, and generates uniform
+// locations. Populates data structures related to uniforms so that they can be stored in program
+// state.
+
+#include "libANGLE/UniformLinker.h"
+
+#include "common/utilities.h"
+#include "libANGLE/Caps.h"
+#include "libANGLE/Shader.h"
+#include "libANGLE/features.h"
+
+namespace gl
+{
+
+namespace
+{
+
+LinkedUniform *FindUniform(std::vector<LinkedUniform> &list, const std::string &name)
+{
+ for (LinkedUniform &uniform : list)
+ {
+ if (uniform.name == name)
+ return &uniform;
+ }
+
+ return nullptr;
+}
+
+} // anonymouse namespace
+
+UniformLinker::UniformLinker(const ProgramState &state) : mState(state)
+{
+}
+
+void UniformLinker::getResults(std::vector<LinkedUniform> *uniforms,
+ std::vector<VariableLocation> *uniformLocations)
+{
+ uniforms->swap(mUniforms);
+ uniformLocations->swap(mUniformLocations);
+}
+
+bool UniformLinker::link(InfoLog &infoLog,
+ const Caps &caps,
+ const Program::Bindings &uniformLocationBindings)
+{
+ if (mState.getAttachedVertexShader() && mState.getAttachedFragmentShader())
+ {
+ ASSERT(mState.getAttachedComputeShader() == nullptr);
+ if (!validateVertexAndFragmentUniforms(infoLog))
+ {
+ return false;
+ }
+ }
+
+ // Flatten the uniforms list (nested fields) into a simple list (no nesting).
+ // Also check the maximum uniform vector and sampler counts.
+ if (!flattenUniformsAndCheckCaps(caps, infoLog))
+ {
+ return false;
+ }
+
+ if (!indexUniforms(infoLog, uniformLocationBindings))
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool UniformLinker::validateVertexAndFragmentUniforms(InfoLog &infoLog) const
+{
+ // Check that uniforms defined in the vertex and fragment shaders are identical
+ std::map<std::string, LinkedUniform> linkedUniforms;
+ const std::vector<sh::Uniform> &vertexUniforms =
+ mState.getAttachedVertexShader()->getUniforms();
+ const std::vector<sh::Uniform> &fragmentUniforms =
+ mState.getAttachedFragmentShader()->getUniforms();
+
+ for (const sh::Uniform &vertexUniform : vertexUniforms)
+ {
+ linkedUniforms[vertexUniform.name] = LinkedUniform(vertexUniform);
+ }
+
+ for (const sh::Uniform &fragmentUniform : fragmentUniforms)
+ {
+ auto entry = linkedUniforms.find(fragmentUniform.name);
+ if (entry != linkedUniforms.end())
+ {
+ LinkedUniform *linkedUniform = &entry->second;
+ const std::string &uniformName = "uniform '" + linkedUniform->name + "'";
+ if (!linkValidateUniforms(infoLog, uniformName, *linkedUniform, fragmentUniform))
+ {
+ return false;
+ }
+ }
+ }
+ return true;
+}
+
+// GLSL ES Spec 3.00.3, section 4.3.5.
+bool UniformLinker::linkValidateUniforms(InfoLog &infoLog,
+ const std::string &uniformName,
+ const sh::Uniform &vertexUniform,
+ const sh::Uniform &fragmentUniform)
+{
+#if ANGLE_PROGRAM_LINK_VALIDATE_UNIFORM_PRECISION == ANGLE_ENABLED
+ const bool validatePrecision = true;
+#else
+ const bool validatePrecision = false;
+#endif
+
+ if (!Program::linkValidateVariablesBase(infoLog, uniformName, vertexUniform, fragmentUniform,
+ validatePrecision))
+ {
+ return false;
+ }
+
+ // GLSL ES Spec 3.10.4, section 4.4.5.
+ if (vertexUniform.binding != -1 && fragmentUniform.binding != -1 &&
+ vertexUniform.binding != fragmentUniform.binding)
+ {
+ infoLog << "Binding layout qualifiers for " << uniformName
+ << " differ between vertex and fragment shaders.";
+ return false;
+ }
+
+ // GLSL ES Spec 3.10.4, section 9.2.1.
+ if (vertexUniform.location != -1 && fragmentUniform.location != -1 &&
+ vertexUniform.location != fragmentUniform.location)
+ {
+ infoLog << "Location layout qualifiers for " << uniformName
+ << " differ between vertex and fragment shaders.";
+ return false;
+ }
+
+ return true;
+}
+
+bool UniformLinker::indexUniforms(InfoLog &infoLog,
+ const Program::Bindings &uniformLocationBindings)
+{
+ // All the locations where another uniform can't be located.
+ std::set<GLuint> reservedLocations;
+ // Locations which have been allocated for an unused uniform.
+ std::set<GLuint> ignoredLocations;
+
+ int maxUniformLocation = -1;
+
+ // Gather uniform locations that have been set either using the bindUniformLocation API or by
+ // using a location layout qualifier and check conflicts between them.
+ if (!gatherUniformLocationsAndCheckConflicts(infoLog, uniformLocationBindings,
+ &reservedLocations, &ignoredLocations,
+ &maxUniformLocation))
+ {
+ return false;
+ }
+
+ // Conflicts have been checked, now we can prune non-statically used uniforms. Code further down
+ // the line relies on only having statically used uniforms in mUniforms.
+ pruneUnusedUniforms();
+
+ // Gather uniforms that have their location pre-set and uniforms that don't yet have a location.
+ std::vector<VariableLocation> unlocatedUniforms;
+ std::map<GLuint, VariableLocation> preLocatedUniforms;
+
+ for (size_t uniformIndex = 0; uniformIndex < mUniforms.size(); uniformIndex++)
+ {
+ const LinkedUniform &uniform = mUniforms[uniformIndex];
+
+ if (uniform.isBuiltIn())
+ {
+ continue;
+ }
+
+ int preSetLocation = uniformLocationBindings.getBinding(uniform.name);
+ int shaderLocation = uniform.location;
+
+ if (shaderLocation != -1)
+ {
+ preSetLocation = shaderLocation;
+ }
+
+ for (unsigned int arrayIndex = 0; arrayIndex < uniform.elementCount(); arrayIndex++)
+ {
+ VariableLocation location(uniform.name, arrayIndex,
+ static_cast<unsigned int>(uniformIndex));
+
+ if ((arrayIndex == 0 && preSetLocation != -1) || shaderLocation != -1)
+ {
+ int elementLocation = preSetLocation + arrayIndex;
+ preLocatedUniforms[elementLocation] = location;
+ }
+ else
+ {
+ unlocatedUniforms.push_back(location);
+ }
+ }
+ }
+
+ // Make enough space for all uniforms, with pre-set locations or not.
+ mUniformLocations.resize(
+ std::max(unlocatedUniforms.size() + preLocatedUniforms.size() + ignoredLocations.size(),
+ static_cast<size_t>(maxUniformLocation + 1)));
+
+ // Assign uniforms with pre-set locations
+ for (const auto &uniform : preLocatedUniforms)
+ {
+ mUniformLocations[uniform.first] = uniform.second;
+ }
+
+ // Assign ignored uniforms
+ for (const auto &ignoredLocation : ignoredLocations)
+ {
+ mUniformLocations[ignoredLocation].ignored = true;
+ }
+
+ // Automatically assign locations for the rest of the uniforms
+ size_t nextUniformLocation = 0;
+ for (const auto &unlocatedUniform : unlocatedUniforms)
+ {
+ while (mUniformLocations[nextUniformLocation].used ||
+ mUniformLocations[nextUniformLocation].ignored)
+ {
+ nextUniformLocation++;
+ }
+
+ ASSERT(nextUniformLocation < mUniformLocations.size());
+ mUniformLocations[nextUniformLocation] = unlocatedUniform;
+ nextUniformLocation++;
+ }
+
+ return true;
+}
+
+bool UniformLinker::gatherUniformLocationsAndCheckConflicts(
+ InfoLog &infoLog,
+ const Program::Bindings &uniformLocationBindings,
+ std::set<GLuint> *reservedLocations,
+ std::set<GLuint> *ignoredLocations,
+ int *maxUniformLocation)
+{
+ for (const LinkedUniform &uniform : mUniforms)
+ {
+ if (uniform.isBuiltIn())
+ {
+ continue;
+ }
+
+ int apiBoundLocation = uniformLocationBindings.getBinding(uniform.name);
+ int shaderLocation = uniform.location;
+
+ if (shaderLocation != -1)
+ {
+ for (unsigned int arrayIndex = 0; arrayIndex < uniform.elementCount(); arrayIndex++)
+ {
+ // GLSL ES 3.10 section 4.4.3
+ int elementLocation = shaderLocation + arrayIndex;
+ *maxUniformLocation = std::max(*maxUniformLocation, elementLocation);
+ if (reservedLocations->find(elementLocation) != reservedLocations->end())
+ {
+ infoLog << "Multiple uniforms bound to location " << elementLocation << ".";
+ return false;
+ }
+ reservedLocations->insert(elementLocation);
+ if (!uniform.staticUse)
+ {
+ ignoredLocations->insert(elementLocation);
+ }
+ }
+ }
+ else if (apiBoundLocation != -1 && uniform.staticUse)
+ {
+ // Only the first location is reserved even if the uniform is an array.
+ *maxUniformLocation = std::max(*maxUniformLocation, apiBoundLocation);
+ if (reservedLocations->find(apiBoundLocation) != reservedLocations->end())
+ {
+ infoLog << "Multiple uniforms bound to location " << apiBoundLocation << ".";
+ return false;
+ }
+ reservedLocations->insert(apiBoundLocation);
+ }
+ }
+
+ // Record the uniform locations that were bound using the API for uniforms that were not found
+ // from the shader. Other uniforms should not be assigned to those locations.
+ for (const auto &locationBinding : uniformLocationBindings)
+ {
+ GLuint location = locationBinding.second;
+ if (reservedLocations->find(location) == reservedLocations->end())
+ {
+ ignoredLocations->insert(location);
+ *maxUniformLocation = std::max(*maxUniformLocation, static_cast<int>(location));
+ }
+ }
+
+ return true;
+}
+
+void UniformLinker::pruneUnusedUniforms()
+{
+ auto uniformIter = mUniforms.begin();
+ while (uniformIter != mUniforms.end())
+ {
+ if (uniformIter->staticUse)
+ {
+ ++uniformIter;
+ }
+ else
+ {
+ uniformIter = mUniforms.erase(uniformIter);
+ }
+ }
+}
+
+bool UniformLinker::flattenUniformsAndCheckCapsForShader(
+ const Shader &shader,
+ GLuint maxUniformComponents,
+ GLuint maxTextureImageUnits,
+ const std::string &componentsErrorMessage,
+ const std::string &samplerErrorMessage,
+ std::vector<LinkedUniform> &samplerUniforms,
+ InfoLog &infoLog)
+{
+ VectorAndSamplerCount vasCount;
+ for (const sh::Uniform &uniform : shader.getUniforms())
+ {
+ vasCount += flattenUniform(uniform, &samplerUniforms);
+ }
+
+ if (vasCount.vectorCount > maxUniformComponents)
+ {
+ infoLog << componentsErrorMessage << maxUniformComponents << ").";
+ return false;
+ }
+
+ if (vasCount.samplerCount > maxTextureImageUnits)
+ {
+ infoLog << samplerErrorMessage << maxTextureImageUnits << ").";
+ return false;
+ }
+
+ return true;
+}
+
+bool UniformLinker::flattenUniformsAndCheckCaps(const Caps &caps, InfoLog &infoLog)
+{
+ std::vector<LinkedUniform> samplerUniforms;
+
+ if (mState.getAttachedComputeShader())
+ {
+ const Shader *computeShader = mState.getAttachedComputeShader();
+
+ // TODO (mradev): check whether we need finer-grained component counting
+ if (!flattenUniformsAndCheckCapsForShader(
+ *computeShader, caps.maxComputeUniformComponents / 4,
+ caps.maxComputeTextureImageUnits,
+ "Compute shader active uniforms exceed MAX_COMPUTE_UNIFORM_COMPONENTS (",
+ "Compute shader sampler count exceeds MAX_COMPUTE_TEXTURE_IMAGE_UNITS (",
+ samplerUniforms, infoLog))
+ {
+ return false;
+ }
+ }
+ else
+ {
+ const Shader *vertexShader = mState.getAttachedVertexShader();
+
+ if (!flattenUniformsAndCheckCapsForShader(
+ *vertexShader, caps.maxVertexUniformVectors, caps.maxVertexTextureImageUnits,
+ "Vertex shader active uniforms exceed MAX_VERTEX_UNIFORM_VECTORS (",
+ "Vertex shader sampler count exceeds MAX_VERTEX_TEXTURE_IMAGE_UNITS (",
+ samplerUniforms, infoLog))
+ {
+ return false;
+ }
+ const Shader *fragmentShader = mState.getAttachedFragmentShader();
+
+ if (!flattenUniformsAndCheckCapsForShader(
+ *fragmentShader, caps.maxFragmentUniformVectors, caps.maxTextureImageUnits,
+ "Fragment shader active uniforms exceed MAX_FRAGMENT_UNIFORM_VECTORS (",
+ "Fragment shader sampler count exceeds MAX_TEXTURE_IMAGE_UNITS (", samplerUniforms,
+ infoLog))
+ {
+ return false;
+ }
+ }
+
+ mUniforms.insert(mUniforms.end(), samplerUniforms.begin(), samplerUniforms.end());
+ return true;
+}
+
+UniformLinker::VectorAndSamplerCount UniformLinker::flattenUniform(
+ const sh::Uniform &uniform,
+ std::vector<LinkedUniform> *samplerUniforms)
+{
+ int location = uniform.location;
+ VectorAndSamplerCount uniformVasCount = flattenUniformImpl(
+ uniform, uniform.name, samplerUniforms, uniform.staticUse, uniform.binding, &location);
+ if (uniform.staticUse)
+ {
+ return uniformVasCount;
+ }
+ return VectorAndSamplerCount();
+}
+
+UniformLinker::VectorAndSamplerCount UniformLinker::flattenUniformImpl(
+ const sh::ShaderVariable &uniform,
+ const std::string &fullName,
+ std::vector<LinkedUniform> *samplerUniforms,
+ bool markStaticUse,
+ int binding,
+ int *location)
+{
+ ASSERT(location);
+ VectorAndSamplerCount vectorAndSamplerCount;
+
+ if (uniform.isStruct())
+ {
+ for (unsigned int elementIndex = 0; elementIndex < uniform.elementCount(); elementIndex++)
+ {
+ const std::string &elementString = (uniform.isArray() ? ArrayString(elementIndex) : "");
+
+ for (size_t fieldIndex = 0; fieldIndex < uniform.fields.size(); fieldIndex++)
+ {
+ const sh::ShaderVariable &field = uniform.fields[fieldIndex];
+ const std::string &fieldFullName = (fullName + elementString + "." + field.name);
+
+ vectorAndSamplerCount += flattenUniformImpl(field, fieldFullName, samplerUniforms,
+ markStaticUse, -1, location);
+ }
+ }
+
+ return vectorAndSamplerCount;
+ }
+
+ // Not a struct
+ bool isSampler = IsSamplerType(uniform.type);
+ std::vector<gl::LinkedUniform> *uniformList = &mUniforms;
+ if (isSampler)
+ {
+ // Store sampler uniforms separately, so we'll append them to the end of the list.
+ uniformList = samplerUniforms;
+ }
+ LinkedUniform *existingUniform = FindUniform(*uniformList, fullName);
+ if (existingUniform)
+ {
+ if (binding != -1)
+ {
+ existingUniform->binding = binding;
+ }
+ if (*location != -1)
+ {
+ existingUniform->location = *location;
+ }
+ if (markStaticUse)
+ {
+ existingUniform->staticUse = true;
+ }
+ }
+ else
+ {
+ LinkedUniform linkedUniform(uniform.type, uniform.precision, fullName, uniform.arraySize,
+ binding, *location, -1,
+ sh::BlockMemberInfo::getDefaultBlockInfo());
+ linkedUniform.staticUse = markStaticUse;
+ uniformList->push_back(linkedUniform);
+ }
+
+ unsigned int elementCount = uniform.elementCount();
+
+ // Samplers aren't "real" uniforms, so they don't count towards register usage.
+ // Likewise, don't count "real" uniforms towards sampler count.
+ vectorAndSamplerCount.vectorCount =
+ (isSampler ? 0 : (VariableRegisterCount(uniform.type) * elementCount));
+ vectorAndSamplerCount.samplerCount = (isSampler ? elementCount : 0);
+
+ if (*location != -1)
+ {
+ *location += elementCount;
+ }
+
+ return vectorAndSamplerCount;
+}
+
+} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/UniformLinker.h b/chromium/third_party/angle/src/libANGLE/UniformLinker.h
new file mode 100644
index 00000000000..869da52ce42
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/UniformLinker.h
@@ -0,0 +1,91 @@
+//
+// 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.
+//
+
+// UniformLinker.h: implements link-time checks for default block uniforms, and generates uniform
+// locations. Populates data structures related to uniforms so that they can be stored in program
+// state.
+
+#ifndef LIBANGLE_UNIFORMLINKER_H_
+#define LIBANGLE_UNIFORMLINKER_H_
+
+#include "libANGLE/Program.h"
+#include "libANGLE/Uniform.h"
+
+namespace gl
+{
+
+class UniformLinker
+{
+ public:
+ UniformLinker(const ProgramState &state);
+
+ bool link(InfoLog &infoLog, const Caps &caps, const Program::Bindings &uniformLocationBindings);
+
+ void getResults(std::vector<LinkedUniform> *uniforms,
+ std::vector<VariableLocation> *uniformLocations);
+
+ private:
+ struct VectorAndSamplerCount
+ {
+ VectorAndSamplerCount() : vectorCount(0), samplerCount(0) {}
+ VectorAndSamplerCount(const VectorAndSamplerCount &other) = default;
+ VectorAndSamplerCount &operator=(const VectorAndSamplerCount &other) = default;
+
+ VectorAndSamplerCount &operator+=(const VectorAndSamplerCount &other)
+ {
+ vectorCount += other.vectorCount;
+ samplerCount += other.samplerCount;
+ return *this;
+ }
+
+ unsigned int vectorCount;
+ unsigned int samplerCount;
+ };
+
+ bool validateVertexAndFragmentUniforms(InfoLog &infoLog) const;
+
+ static bool linkValidateUniforms(InfoLog &infoLog,
+ const std::string &uniformName,
+ const sh::Uniform &vertexUniform,
+ const sh::Uniform &fragmentUniform);
+
+ bool flattenUniformsAndCheckCapsForShader(const Shader &shader,
+ GLuint maxUniformComponents,
+ GLuint maxTextureImageUnits,
+ const std::string &componentsErrorMessage,
+ const std::string &samplerErrorMessage,
+ std::vector<LinkedUniform> &samplerUniforms,
+ InfoLog &infoLog);
+ bool flattenUniformsAndCheckCaps(const Caps &caps, InfoLog &infoLog);
+
+ VectorAndSamplerCount flattenUniform(const sh::Uniform &uniform,
+ std::vector<LinkedUniform> *samplerUniforms);
+
+ // markStaticUse is given as a separate parameter because it is tracked here at struct
+ // granularity.
+ VectorAndSamplerCount flattenUniformImpl(const sh::ShaderVariable &uniform,
+ const std::string &fullName,
+ std::vector<LinkedUniform> *samplerUniforms,
+ bool markStaticUse,
+ int binding,
+ int *location);
+
+ bool indexUniforms(InfoLog &infoLog, const Program::Bindings &uniformLocationBindings);
+ bool gatherUniformLocationsAndCheckConflicts(InfoLog &infoLog,
+ const Program::Bindings &uniformLocationBindings,
+ std::set<GLuint> *reservedLocations,
+ std::set<GLuint> *ignoredLocations,
+ int *maxUniformLocation);
+ void pruneUnusedUniforms();
+
+ const ProgramState &mState;
+ std::vector<LinkedUniform> mUniforms;
+ std::vector<VariableLocation> mUniformLocations;
+};
+
+} // namespace gl
+
+#endif // LIBANGLE_UNIFORMLINKER_H_
diff --git a/chromium/third_party/angle/src/libANGLE/VaryingPacking.cpp b/chromium/third_party/angle/src/libANGLE/VaryingPacking.cpp
index 973a902b899..28afb221458 100644
--- a/chromium/third_party/angle/src/libANGLE/VaryingPacking.cpp
+++ b/chromium/third_party/angle/src/libANGLE/VaryingPacking.cpp
@@ -48,7 +48,7 @@ bool VaryingPacking::packVarying(const PackedVarying &packedVarying)
}
// "Arrays of size N are assumed to take N times the size of the base type"
- varyingRows *= varying.elementCount();
+ varyingRows *= (packedVarying.isArrayElement() ? 1 : varying.elementCount());
unsigned int maxVaryingVectors = static_cast<unsigned int>(mRegisterMap.size());
@@ -142,7 +142,8 @@ bool VaryingPacking::packVarying(const PackedVarying &packedVarying)
registerInfo.packedVarying = &packedVarying;
registerInfo.registerRow = row + arrayIndex;
registerInfo.registerColumn = bestColumn;
- registerInfo.varyingArrayIndex = arrayIndex;
+ registerInfo.varyingArrayIndex =
+ (packedVarying.isArrayElement() ? packedVarying.arrayIndex : arrayIndex);
registerInfo.varyingRowIndex = 0;
// Do not record register info for builtins.
// TODO(jmadill): Clean this up.
@@ -201,6 +202,10 @@ void VaryingPacking::insert(unsigned int registerRow,
for (unsigned int arrayElement = 0; arrayElement < varying.elementCount(); ++arrayElement)
{
+ if (packedVarying.isArrayElement() && arrayElement != packedVarying.arrayIndex)
+ {
+ continue;
+ }
for (unsigned int varyingRow = 0; varyingRow < varyingRows; ++varyingRow)
{
registerInfo.registerRow = registerRow + (arrayElement * varyingRows) + varyingRow;
@@ -241,15 +246,15 @@ bool VaryingPacking::packUserVaryings(gl::InfoLog &infoLog,
}
ASSERT(!varying.isStruct());
- ASSERT(uniqueVaryingNames.count(varying.name) == 0);
+ ASSERT(uniqueVaryingNames.count(packedVarying.nameWithArrayIndex()) == 0);
if (packVarying(packedVarying))
{
- uniqueVaryingNames.insert(varying.name);
+ uniqueVaryingNames.insert(packedVarying.nameWithArrayIndex());
}
else
{
- infoLog << "Could not pack varying " << varying.name;
+ infoLog << "Could not pack varying " << packedVarying.nameWithArrayIndex();
return false;
}
}
@@ -266,22 +271,25 @@ bool VaryingPacking::packUserVaryings(gl::InfoLog &infoLog,
for (const PackedVarying &packedVarying : packedVaryings)
{
const auto &varying = *packedVarying.varying;
+ size_t subscript = GL_INVALID_INDEX;
+ std::string baseName = ParseResourceName(transformFeedbackVaryingName, &subscript);
// Make sure transform feedback varyings aren't optimized out.
- if (uniqueVaryingNames.count(transformFeedbackVaryingName) > 0)
+ if (uniqueVaryingNames.count(transformFeedbackVaryingName) > 0 ||
+ uniqueVaryingNames.count(baseName) > 0)
{
found = true;
break;
}
- if (transformFeedbackVaryingName == varying.name)
+ if (baseName == varying.name)
{
if (!packVarying(packedVarying))
{
infoLog << "Could not pack varying " << varying.name;
return false;
}
-
+ uniqueVaryingNames.insert(packedVarying.nameWithArrayIndex());
found = true;
break;
}
diff --git a/chromium/third_party/angle/src/libANGLE/VaryingPacking.h b/chromium/third_party/angle/src/libANGLE/VaryingPacking.h
index f6e0bb5be74..6b2f0435583 100644
--- a/chromium/third_party/angle/src/libANGLE/VaryingPacking.h
+++ b/chromium/third_party/angle/src/libANGLE/VaryingPacking.h
@@ -24,7 +24,7 @@ class InfoLog;
struct PackedVarying
{
PackedVarying(const sh::ShaderVariable &varyingIn, sh::InterpolationType interpolationIn)
- : varying(&varyingIn), vertexOnly(false), interpolation(interpolationIn)
+ : PackedVarying(varyingIn, interpolationIn, "")
{
}
PackedVarying(const sh::ShaderVariable &varyingIn,
@@ -33,12 +33,26 @@ struct PackedVarying
: varying(&varyingIn),
vertexOnly(false),
interpolation(interpolationIn),
- parentStructName(parentStructNameIn)
+ parentStructName(parentStructNameIn),
+ arrayIndex(GL_INVALID_INDEX)
{
}
bool isStructField() const { return !parentStructName.empty(); }
+ bool isArrayElement() const { return arrayIndex != GL_INVALID_INDEX; }
+
+ std::string nameWithArrayIndex() const
+ {
+ std::stringstream fullNameStr;
+ fullNameStr << varying->name;
+ if (arrayIndex != GL_INVALID_INDEX)
+ {
+ fullNameStr << "[" << arrayIndex << "]";
+ }
+ return fullNameStr.str();
+ }
+
const sh::ShaderVariable *varying;
// Transform feedback varyings can be only referenced in the VS.
@@ -49,6 +63,8 @@ struct PackedVarying
// Struct name
std::string parentStructName;
+
+ GLuint arrayIndex;
};
struct PackedVaryingRegister final
diff --git a/chromium/third_party/angle/src/libANGLE/VertexArray.cpp b/chromium/third_party/angle/src/libANGLE/VertexArray.cpp
index cea141ddfda..6abe88e547e 100644
--- a/chromium/third_party/angle/src/libANGLE/VertexArray.cpp
+++ b/chromium/third_party/angle/src/libANGLE/VertexArray.cpp
@@ -8,6 +8,7 @@
#include "libANGLE/VertexArray.h"
#include "libANGLE/Buffer.h"
+#include "libANGLE/Context.h"
#include "libANGLE/renderer/GLImplFactory.h"
#include "libANGLE/renderer/VertexArrayImpl.h"
@@ -96,8 +97,8 @@ size_t VertexArray::GetAttribIndex(unsigned long dirtyBit)
{
static_assert(gl::MAX_VERTEX_ATTRIBS == gl::MAX_VERTEX_ATTRIB_BINDINGS,
"The stride of vertex attributes should equal to that of vertex bindings.");
- ASSERT(dirtyBit > gl::VertexArray::DIRTY_BIT_ELEMENT_ARRAY_BUFFER);
- return (dirtyBit - gl::VertexArray::DIRTY_BIT_ATTRIB_0_ENABLED) % gl::MAX_VERTEX_ATTRIBS;
+ ASSERT(dirtyBit > DIRTY_BIT_ELEMENT_ARRAY_BUFFER);
+ return (dirtyBit - DIRTY_BIT_ATTRIB_0_ENABLED) % gl::MAX_VERTEX_ATTRIBS;
}
void VertexArray::bindVertexBuffer(size_t bindingIndex,
@@ -119,8 +120,7 @@ void VertexArray::setVertexAttribBinding(size_t attribIndex, size_t bindingIndex
{
ASSERT(attribIndex < getMaxAttribs() && bindingIndex < getMaxBindings());
- // TODO(jiawei.shao@intel.com): Vertex Attrib Bindings
- ASSERT(attribIndex == bindingIndex);
+ mState.mVertexAttributes[attribIndex].bindingIndex = static_cast<GLuint>(bindingIndex);
mDirtyBits.set(DIRTY_BIT_ATTRIB_0_BINDING + attribIndex);
}
@@ -162,6 +162,7 @@ void VertexArray::setVertexAttribDivisor(size_t index, GLuint divisor)
void VertexArray::enableAttribute(size_t attribIndex, bool enabledState)
{
ASSERT(attribIndex < getMaxAttribs());
+
mState.mVertexAttributes[attribIndex].enabled = enabledState;
mDirtyBits.set(DIRTY_BIT_ATTRIB_0_ENABLED + attribIndex);
@@ -213,11 +214,11 @@ void VertexArray::setElementArrayBuffer(Buffer *buffer)
mDirtyBits.set(DIRTY_BIT_ELEMENT_ARRAY_BUFFER);
}
-void VertexArray::syncImplState()
+void VertexArray::syncImplState(const Context *context)
{
if (mDirtyBits.any())
{
- mVertexArray->syncState(mDirtyBits);
+ mVertexArray->syncState(rx::SafeGetImpl(context), mDirtyBits);
mDirtyBits.reset();
}
}
diff --git a/chromium/third_party/angle/src/libANGLE/VertexArray.h b/chromium/third_party/angle/src/libANGLE/VertexArray.h
index 2e255806556..489c180f974 100644
--- a/chromium/third_party/angle/src/libANGLE/VertexArray.h
+++ b/chromium/third_party/angle/src/libANGLE/VertexArray.h
@@ -100,6 +100,18 @@ class VertexArray final : public LabeledObject
bool pureInteger,
GLsizei stride,
const void *pointer);
+ void setVertexAttribFormat(size_t attribIndex,
+ GLint size,
+ GLenum type,
+ bool normalized,
+ bool pureInteger,
+ GLintptr relativeOffset);
+ void bindVertexBuffer(size_t bindingIndex,
+ Buffer *boundBuffer,
+ GLintptr offset,
+ GLsizei stride);
+ void setVertexAttribBinding(size_t attribIndex, size_t bindingIndex);
+ void setVertexBindingDivisor(size_t bindingIndex, GLuint divisor);
void setElementArrayBuffer(Buffer *buffer);
@@ -160,25 +172,10 @@ class VertexArray final : public LabeledObject
static size_t GetAttribIndex(unsigned long dirtyBit);
- void syncImplState();
+ void syncImplState(const Context *context);
bool hasAnyDirtyBit() const { return mDirtyBits.any(); }
private:
- // TODO(jiawei.shao@intel.com): make these functions public when Vertex Attrib Binding entries
- // are ready.
- void setVertexAttribFormat(size_t attribIndex,
- GLint size,
- GLenum type,
- bool normalized,
- bool pureInteger,
- GLintptr relativeOffset);
- void bindVertexBuffer(size_t bindingIndex,
- Buffer *boundBuffer,
- GLintptr offset,
- GLsizei stride);
- void setVertexAttribBinding(size_t attribIndex, size_t bindingIndex);
- void setVertexBindingDivisor(size_t bindingIndex, GLuint divisor);
-
GLuint mId;
VertexArrayState mState;
diff --git a/chromium/third_party/angle/src/libANGLE/VertexArray_unittest.cpp b/chromium/third_party/angle/src/libANGLE/VertexArray_unittest.cpp
index 04eac7ee95f..6d9a09bb272 100644
--- a/chromium/third_party/angle/src/libANGLE/VertexArray_unittest.cpp
+++ b/chromium/third_party/angle/src/libANGLE/VertexArray_unittest.cpp
@@ -9,7 +9,7 @@
#include "gmock/gmock.h"
#include "gtest/gtest.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/utilities.h"
#include "libANGLE/VertexArray.h"
diff --git a/chromium/third_party/angle/src/libANGLE/angletypes.h b/chromium/third_party/angle/src/libANGLE/angletypes.h
index d28d0041957..54dd91276f2 100644
--- a/chromium/third_party/angle/src/libANGLE/angletypes.h
+++ b/chromium/third_party/angle/src/libANGLE/angletypes.h
@@ -168,6 +168,27 @@ struct DepthStencilState
GLuint stencilBackWritemask;
};
+struct DrawArraysIndirectCommand
+{
+ GLuint count;
+ GLuint instanceCount;
+ GLuint first;
+ GLuint baseInstance;
+};
+static_assert(sizeof(DrawArraysIndirectCommand) == 16,
+ "Unexpected size of DrawArraysIndirectCommand");
+
+struct DrawElementsIndirectCommand
+{
+ GLuint count;
+ GLuint primCount;
+ GLuint firstIndex;
+ GLint baseVertex;
+ GLuint baseInstance;
+};
+static_assert(sizeof(DrawElementsIndirectCommand) == 20,
+ "Unexpected size of DrawElementsIndirectCommand");
+
// State from Table 6.10 (state per sampler object)
struct SamplerState
{
@@ -241,6 +262,8 @@ typedef std::bitset<IMPLEMENTATION_MAX_COMBINED_SHADER_UNIFORM_BUFFERS> UniformB
// Client code should treat it as a std::map.
template <class ResourceT>
using ResourceMap = std::unordered_map<GLuint, ResourceT *>;
+
+using ContextID = uintptr_t;
}
namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/formatutils.cpp b/chromium/third_party/angle/src/libANGLE/formatutils.cpp
index 928d0557f30..dba69992322 100644
--- a/chromium/third_party/angle/src/libANGLE/formatutils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/formatutils.cpp
@@ -618,7 +618,12 @@ static InternalFormatInfoMap BuildInternalFormatInfoMap()
AddDepthStencilFormat(&map, GL_STENCIL_INDEX8, 0, 8, 0, GL_STENCIL, GL_UNSIGNED_BYTE, GL_UNSIGNED_NORMALIZED, RequireES<2, 0>, RequireES<2, 0>, NeverSupported);
// From GL_ANGLE_lossy_etc_decode
- map.insert(InternalFormatInfoPair(GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, CompressedFormat(4, 4, 64, 3, GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::lossyETCDecode>, NeverSupported, AlwaysSupported)));
+ // | Internal format | |W |H |BS |CC| Format | Type | SRGB | Supported | Renderable | Filterable |
+ map.insert(InternalFormatInfoPair(GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, CompressedFormat(4, 4, 64, 3, GL_ETC1_RGB8_LOSSY_DECODE_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::lossyETCDecode>, NeverSupported, AlwaysSupported)));
+ map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE, CompressedFormat(4, 4, 64, 3, GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::lossyETCDecode>, NeverSupported, AlwaysSupported)));
+ map.insert(InternalFormatInfoPair(GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE, CompressedFormat(4, 4, 64, 3, GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE, GL_UNSIGNED_BYTE, true, RequireExt<&Extensions::lossyETCDecode>, NeverSupported, AlwaysSupported)));
+ map.insert(InternalFormatInfoPair(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, CompressedFormat(4, 4, 64, 3, GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, GL_UNSIGNED_BYTE, false, RequireExt<&Extensions::lossyETCDecode>, NeverSupported, AlwaysSupported)));
+ map.insert(InternalFormatInfoPair(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, CompressedFormat(4, 4, 64, 3, GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE, GL_UNSIGNED_BYTE, true, RequireExt<&Extensions::lossyETCDecode>, NeverSupported, AlwaysSupported)));
// From GL_EXT_texture_norm16
// | Internal format | R | G | B | A |S | Format | Type | Component type | SRGB | Texture supported | Renderable | Filterable |
diff --git a/chromium/third_party/angle/src/libANGLE/queryutils.cpp b/chromium/third_party/angle/src/libANGLE/queryutils.cpp
index 6e87b5397f9..5d14f57d0a2 100644
--- a/chromium/third_party/angle/src/libANGLE/queryutils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/queryutils.cpp
@@ -13,6 +13,7 @@
#include "libANGLE/Buffer.h"
#include "libANGLE/Config.h"
#include "libANGLE/Context.h"
+#include "libANGLE/Fence.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/Program.h"
#include "libANGLE/Renderbuffer.h"
@@ -390,6 +391,15 @@ void QueryVertexAttribBase(const VertexAttribute &attrib,
case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
*params = ConvertFromGLboolean<ParamType>(attrib.pureInteger);
break;
+ case GL_VERTEX_ATTRIB_BINDING:
+ *params = ConvertFromGLuint<ParamType>(attrib.bindingIndex);
+ break;
+ case GL_VERTEX_ATTRIB_RELATIVE_OFFSET:
+ // attrib.relativeOffset should not be negative or greater than max GLint
+ ASSERT(attrib.relativeOffset >= 0 &&
+ attrib.relativeOffset <= std::numeric_limits<GLint>::max());
+ *params = ConvertFromGLint<ParamType>(static_cast<GLint>(attrib.relativeOffset));
+ break;
default:
UNREACHABLE();
break;
@@ -605,6 +615,9 @@ void QueryProgramiv(const Program *program, GLenum pname, GLint *params)
case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
*params = program->getBinaryRetrievableHint();
break;
+ case GL_PROGRAM_SEPARABLE:
+ *params = program->isSeparable();
+ break;
default:
UNREACHABLE();
break;
@@ -875,6 +888,52 @@ void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, G
}
}
+Error QuerySynciv(const FenceSync *sync,
+ GLenum pname,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *values)
+{
+ ASSERT(sync);
+
+ // All queries return one value, exit early if the buffer can't fit anything.
+ if (bufSize < 1)
+ {
+ if (length != nullptr)
+ {
+ *length = 0;
+ }
+ return NoError();
+ }
+
+ switch (pname)
+ {
+ case GL_OBJECT_TYPE:
+ *values = ConvertToGLint(GL_SYNC_FENCE);
+ break;
+ case GL_SYNC_CONDITION:
+ *values = ConvertToGLint(sync->getCondition());
+ break;
+ case GL_SYNC_FLAGS:
+ *values = ConvertToGLint(sync->getFlags());
+ break;
+ case GL_SYNC_STATUS:
+ ANGLE_TRY(sync->getStatus(values));
+ break;
+
+ default:
+ UNREACHABLE();
+ break;
+ }
+
+ if (length != nullptr)
+ {
+ *length = 1;
+ }
+
+ return NoError();
+}
+
void SetTexParameterf(Texture *texture, GLenum pname, GLfloat param)
{
SetTexParameterBase(texture, pname, &param);
@@ -939,6 +998,82 @@ void SetFramebufferParameteri(Framebuffer *framebuffer, GLenum pname, GLint para
}
}
+void SetProgramParameteri(Program *program, GLenum pname, GLint value)
+{
+ ASSERT(program);
+
+ switch (pname)
+ {
+ case GL_PROGRAM_BINARY_RETRIEVABLE_HINT:
+ program->setBinaryRetrievableHint(value != GL_FALSE);
+ break;
+ case GL_PROGRAM_SEPARABLE:
+ program->setSeparable(value != GL_FALSE);
+ break;
+ default:
+ UNREACHABLE();
+ break;
+ }
+}
+
+GLuint QueryProgramResourceIndex(const Program *program,
+ GLenum programInterface,
+ const GLchar *name)
+{
+ switch (programInterface)
+ {
+ case GL_PROGRAM_INPUT:
+ return program->getInputResourceIndex(name);
+
+ case GL_PROGRAM_OUTPUT:
+ return program->getOutputResourceIndex(name);
+
+ // TODO(Jie): more interfaces.
+ case GL_UNIFORM:
+ case GL_UNIFORM_BLOCK:
+ case GL_TRANSFORM_FEEDBACK_VARYING:
+ case GL_BUFFER_VARIABLE:
+ case GL_SHADER_STORAGE_BLOCK:
+ UNIMPLEMENTED();
+ return GL_INVALID_INDEX;
+
+ default:
+ UNREACHABLE();
+ return GL_INVALID_INDEX;
+ }
+}
+
+void QueryProgramResourceName(const Program *program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name)
+{
+ switch (programInterface)
+ {
+ case GL_PROGRAM_INPUT:
+ program->getInputResourceName(index, bufSize, length, name);
+ break;
+
+ case GL_PROGRAM_OUTPUT:
+ program->getOutputResourceName(index, bufSize, length, name);
+ break;
+
+ // TODO(Jie): more interfaces.
+ case GL_UNIFORM:
+ case GL_UNIFORM_BLOCK:
+ case GL_TRANSFORM_FEEDBACK_VARYING:
+ case GL_BUFFER_VARIABLE:
+ case GL_SHADER_STORAGE_BLOCK:
+ UNIMPLEMENTED();
+ break;
+
+ default:
+ UNREACHABLE();
+ }
+}
+
} // namespace gl
namespace egl
diff --git a/chromium/third_party/angle/src/libANGLE/queryutils.h b/chromium/third_party/angle/src/libANGLE/queryutils.h
index 149c35810ed..40c7d82c6a5 100644
--- a/chromium/third_party/angle/src/libANGLE/queryutils.h
+++ b/chromium/third_party/angle/src/libANGLE/queryutils.h
@@ -18,6 +18,8 @@ namespace gl
{
class Buffer;
class Context;
+class Error;
+class FenceSync;
class Framebuffer;
class Program;
class Renderbuffer;
@@ -95,6 +97,12 @@ void QueryInternalFormativ(const TextureCaps &format, GLenum pname, GLsizei bufS
void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, GLint *params);
+Error QuerySynciv(const FenceSync *sync,
+ GLenum pname,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *values);
+
void SetTexParameterf(Texture *texture, GLenum pname, GLfloat param);
void SetTexParameterfv(Texture *texture, GLenum pname, const GLfloat *params);
void SetTexParameteri(Texture *texture, GLenum pname, GLint param);
@@ -107,6 +115,19 @@ void SetSamplerParameteriv(Sampler *sampler, GLenum pname, const GLint *params);
void SetFramebufferParameteri(Framebuffer *framebuffer, GLenum pname, GLint param);
+void SetProgramParameteri(Program *program, GLenum pname, GLint value);
+
+GLuint QueryProgramResourceIndex(const Program *program,
+ GLenum programInterface,
+ const GLchar *name);
+
+void QueryProgramResourceName(const Program *program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name);
+
} // namespace gl
namespace egl
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h
index 1fd48c62c1f..b01d903ab68 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h
@@ -138,6 +138,8 @@ class ContextImpl : public GLImplFactory
virtual const gl::Extensions &getNativeExtensions() const = 0;
virtual const gl::Limitations &getNativeLimitations() const = 0;
+ virtual gl::Error dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ) = 0;
+
const gl::ContextState &getContextState() { return mState; }
int getClientMajorVersion() const { return mState.getClientMajorVersion(); }
int getClientMinorVersion() const { return mState.getClientMinorVersion(); }
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl.h
index dceef5fbf58..67b2d95ac6b 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl.h
@@ -73,7 +73,8 @@ class FramebufferImpl : angle::NonCopyable
virtual bool checkStatus() const = 0;
- virtual void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) = 0;
+ virtual void syncState(ContextImpl *contextImpl,
+ const gl::Framebuffer::DirtyBits &dirtyBits) = 0;
virtual gl::Error getSamplePosition(size_t index, GLfloat *xy) const = 0;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl_mock.h b/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl_mock.h
index 7fc62e47963..7ca775450e9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl_mock.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/FramebufferImpl_mock.h
@@ -46,7 +46,7 @@ class MockFramebufferImpl : public rx::FramebufferImpl
MOCK_CONST_METHOD0(checkStatus, bool());
- MOCK_METHOD1(syncState, void(const gl::Framebuffer::DirtyBits &));
+ MOCK_METHOD2(syncState, void(ContextImpl *, const gl::Framebuffer::DirtyBits &));
MOCK_METHOD0(destructor, void());
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h
index 5733e79625a..30a6a26180b 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h
@@ -45,6 +45,7 @@ class ProgramImpl : angle::NonCopyable
gl::BinaryInputStream *stream) = 0;
virtual gl::Error save(gl::BinaryOutputStream *stream) = 0;
virtual void setBinaryRetrievableHint(bool retrievable) = 0;
+ virtual void setSeparable(bool separable) = 0;
virtual LinkResult link(ContextImpl *contextImpl,
const gl::VaryingPacking &packing,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h b/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h
index 93482c68d5a..9b830c05792 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h
@@ -26,6 +26,7 @@ class MockProgramImpl : public rx::ProgramImpl
MOCK_METHOD3(load, LinkResult(const ContextImpl *, gl::InfoLog &, gl::BinaryInputStream *));
MOCK_METHOD1(save, gl::Error(gl::BinaryOutputStream *));
MOCK_METHOD1(setBinaryRetrievableHint, void(bool));
+ MOCK_METHOD1(setSeparable, void(bool));
MOCK_METHOD3(link, LinkResult(ContextImpl *, const gl::VaryingPacking &, gl::InfoLog &));
MOCK_METHOD2(validate, GLboolean(const gl::Caps &, gl::InfoLog *));
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/SurfaceImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/SurfaceImpl.h
index 4ecc69b9013..0e4f177d69e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/SurfaceImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/SurfaceImpl.h
@@ -9,6 +9,9 @@
#ifndef LIBANGLE_RENDERER_SURFACEIMPL_H_
#define LIBANGLE_RENDERER_SURFACEIMPL_H_
+#include <EGL/egl.h>
+#include <EGL/eglext.h>
+
#include "common/angleutils.h"
#include "libANGLE/Error.h"
#include "libANGLE/FramebufferAttachment.h"
@@ -46,6 +49,7 @@ class SurfaceImpl : public FramebufferAttachmentObjectImpl
virtual egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) = 0;
virtual egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) = 0;
virtual egl::Error releaseTexImage(EGLint buffer) = 0;
+ virtual egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) = 0;
virtual void setSwapInterval(EGLint interval) = 0;
// width and height can change with client window resizing
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.cpp b/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.cpp
index c5e68cfcf6c..47a73902f0c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.cpp
@@ -20,8 +20,11 @@ TextureImpl::~TextureImpl()
}
gl::Error TextureImpl::copyTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
@@ -32,7 +35,10 @@ gl::Error TextureImpl::copyTexture(ContextImpl *contextImpl,
}
gl::Error TextureImpl::copySubTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.h
index b443ac21f80..077485c3472 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl.h
@@ -95,14 +95,20 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
const gl::Framebuffer *source) = 0;
virtual gl::Error copyTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source);
virtual gl::Error copySubTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl_mock.h b/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl_mock.h
index 8427462bbbc..148ccabc1eb 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl_mock.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/TextureImpl_mock.h
@@ -72,16 +72,28 @@ class MockTextureImpl : public TextureImpl
const gl::Offset &,
const gl::Rectangle &,
const gl::Framebuffer *));
- MOCK_METHOD7(copyTexture,
- gl::Error(ContextImpl *, GLenum, GLenum, bool, bool, bool, const gl::Texture *));
- MOCK_METHOD7(copySubTexture,
- gl::Error(ContextImpl *,
- const gl::Offset &,
- const gl::Rectangle &,
- bool,
- bool,
- bool,
- const gl::Texture *));
+ MOCK_METHOD10(copyTexture,
+ gl::Error(ContextImpl *,
+ GLenum,
+ size_t,
+ GLenum,
+ GLenum,
+ size_t,
+ bool,
+ bool,
+ bool,
+ const gl::Texture *));
+ MOCK_METHOD10(copySubTexture,
+ gl::Error(ContextImpl *,
+ GLenum,
+ size_t,
+ const gl::Offset &,
+ size_t,
+ const gl::Rectangle &,
+ bool,
+ bool,
+ bool,
+ const gl::Texture *));
MOCK_METHOD2(copyCompressedTexture, gl::Error(ContextImpl *, const gl::Texture *source));
MOCK_METHOD5(setStorage, gl::Error(ContextImpl *, GLenum, size_t, GLenum, const gl::Extents &));
MOCK_METHOD3(setImageExternal,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/VertexArrayImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/VertexArrayImpl.h
index b1be3691ade..a933ba2f5b5 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/VertexArrayImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/VertexArrayImpl.h
@@ -15,13 +15,14 @@
namespace rx
{
+class ContextImpl;
class VertexArrayImpl : angle::NonCopyable
{
public:
VertexArrayImpl(const gl::VertexArrayState &data) : mData(data) {}
virtual ~VertexArrayImpl() { }
- virtual void syncState(const gl::VertexArray::DirtyBits &dirtyBits) {}
+ virtual void syncState(ContextImpl *contextImpl, const gl::VertexArray::DirtyBits &dirtyBits) {}
protected:
const gl::VertexArrayState &mData;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
index e81fde16b71..b4366e7d621 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
@@ -1130,7 +1130,7 @@ void DynamicHLSL::getPixelShaderOutputKey(const gl::ContextState &data,
const auto &shaderOutputVars =
metadata.getFragmentShader()->getData().getActiveOutputVariables();
- for (auto outputPair : programData.getOutputVariables())
+ for (auto outputPair : programData.getOutputLocations())
{
const VariableLocation &outputLocation = outputPair.second;
const sh::ShaderVariable &outputVariable = shaderOutputVars[outputLocation.index];
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
index 3b4d0800241..68b29173ae1 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp
@@ -8,7 +8,7 @@
#include "libANGLE/renderer/d3d/FramebufferD3D.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h"
@@ -296,7 +296,8 @@ bool FramebufferD3D::checkStatus() const
return true;
}
-void FramebufferD3D::syncState(const gl::Framebuffer::DirtyBits &dirtyBits)
+void FramebufferD3D::syncState(ContextImpl *contextImpl,
+ const gl::Framebuffer::DirtyBits &dirtyBits)
{
bool invalidateColorAttachmentCache = false;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.h
index 16d4971030f..c6eab5675f0 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/FramebufferD3D.h
@@ -95,7 +95,7 @@ class FramebufferD3D : public FramebufferImpl
bool checkStatus() const override;
- void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override;
+ void syncState(ContextImpl *contextImpl, const gl::Framebuffer::DirtyBits &dirtyBits) override;
const gl::AttachmentList &getColorAttachmentsForRender() const;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp
index 1e2fc69daf4..7ac9174ca7e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp
@@ -137,6 +137,52 @@ IndexDataManager::~IndexDataManager()
SafeDelete(mStreamingBufferInt);
}
+bool IndexDataManager::usePrimitiveRestartWorkaround(bool primitiveRestartFixedIndexEnabled,
+ GLenum type)
+{
+ // We should never have to deal with primitive restart workaround issue with GL_UNSIGNED_INT
+ // indices, since we restrict it via MAX_ELEMENT_INDEX.
+ return (!primitiveRestartFixedIndexEnabled && type == GL_UNSIGNED_SHORT &&
+ mRendererClass == RENDERER_D3D11);
+}
+
+bool IndexDataManager::isStreamingIndexData(bool primitiveRestartWorkaround,
+ GLenum srcType,
+ gl::Buffer *glBuffer)
+{
+ BufferD3D *buffer = glBuffer ? GetImplAs<BufferD3D>(glBuffer) : nullptr;
+
+ // Case 1: the indices are passed by pointer, which forces the streaming of index data
+ if (glBuffer == nullptr)
+ {
+ return true;
+ }
+
+ const GLenum dstType = (srcType == GL_UNSIGNED_INT || primitiveRestartWorkaround)
+ ? GL_UNSIGNED_INT
+ : GL_UNSIGNED_SHORT;
+
+ // Case 2a: the buffer can be used directly
+ if (buffer->supportsDirectBinding() && dstType == srcType)
+ {
+ return false;
+ }
+
+ // Case 2b: use a static translated copy or fall back to streaming
+ StaticIndexBufferInterface *staticBuffer = buffer->getStaticIndexBuffer();
+ if (staticBuffer == nullptr)
+ {
+ return true;
+ }
+
+ if ((staticBuffer->getBufferSize() != 0) && (staticBuffer->getIndexType() != dstType))
+ {
+ return true;
+ }
+
+ return false;
+}
+
// This function translates a GL-style indices into DX-style indices, with their description
// returned in translated.
// GL can specify vertex data in immediate mode (pointer to CPU array of indices), which is not
@@ -157,9 +203,9 @@ gl::Error IndexDataManager::prepareIndexData(GLenum srcType,
bool hasPrimitiveRestartIndex =
translated->indexRange.vertexIndexCount < static_cast<size_t>(count) ||
translated->indexRange.end == gl::GetPrimitiveRestartIndex(srcType);
- bool primitiveRestartWorkaround = mRendererClass == RENDERER_D3D11 &&
- !primitiveRestartFixedIndexEnabled &&
- hasPrimitiveRestartIndex && srcType == GL_UNSIGNED_SHORT;
+ bool primitiveRestartWorkaround =
+ usePrimitiveRestartWorkaround(primitiveRestartFixedIndexEnabled, srcType) &&
+ hasPrimitiveRestartIndex;
// We should never have to deal with MAX_UINT indices, since we restrict it via
// MAX_ELEMENT_INDEX.
@@ -202,8 +248,7 @@ gl::Error IndexDataManager::prepareIndexData(GLenum srcType,
}
// Case 2a: the buffer can be used directly
- if (offsetAligned && buffer->supportsDirectBinding() &&
- dstType == srcType && !primitiveRestartWorkaround)
+ if (offsetAligned && buffer->supportsDirectBinding() && dstType == srcType)
{
translated->storage = buffer;
translated->indexBuffer = nullptr;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h
index 44eb68c0716..3206c52ec7e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h
@@ -65,6 +65,10 @@ class IndexDataManager : angle::NonCopyable
explicit IndexDataManager(BufferFactoryD3D *factory, RendererClass rendererClass);
virtual ~IndexDataManager();
+ bool usePrimitiveRestartWorkaround(bool primitiveRestartFixedIndexEnabled, GLenum type);
+ bool isStreamingIndexData(bool primitiveRestartWorkaround,
+ GLenum srcType,
+ gl::Buffer *glBuffer);
gl::Error prepareIndexData(GLenum srcType,
GLsizei count,
gl::Buffer *glBuffer,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp
index 5875733f381..0b2a1c93c40 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -8,7 +8,7 @@
#include "libANGLE/renderer/d3d/ProgramD3D.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/utilities.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/FramebufferAttachment.h"
@@ -260,7 +260,7 @@ D3DUniform::D3DUniform(GLenum typeIn,
data = new uint8_t[bytes];
memset(data, 0, bytes);
- // TODO(jmadill): is this correct with non-square matrices?
+ // Use the row count as register count, will work for non-square matrices.
registerCount = gl::VariableRowCount(type) * elementCount();
}
}
@@ -1128,6 +1128,10 @@ void ProgramD3D::setBinaryRetrievableHint(bool /* retrievable */)
{
}
+void ProgramD3D::setSeparable(bool /* separable */)
+{
+}
+
gl::Error ProgramD3D::getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo,
ShaderExecutableD3D **outExecutable)
{
@@ -1902,7 +1906,6 @@ void ProgramD3D::defineUniformsAndAssignRegisters()
if (computeShader)
{
for (const sh::Uniform &computeUniform : computeShader->getUniforms())
-
{
if (computeUniform.staticUse)
{
@@ -1914,7 +1917,6 @@ void ProgramD3D::defineUniformsAndAssignRegisters()
{
const gl::Shader *vertexShader = mState.getAttachedVertexShader();
for (const sh::Uniform &vertexUniform : vertexShader->getUniforms())
-
{
if (vertexUniform.staticUse)
{
@@ -1962,7 +1964,7 @@ void ProgramD3D::defineUniformBase(const gl::Shader *shader,
unsigned int startRegister = shaderD3D->getUniformRegister(uniform.name);
ShShaderOutput outputType = shaderD3D->getCompilerOutputType();
- sh::HLSLBlockEncoder encoder(sh::HLSLBlockEncoder::GetStrategyFor(outputType));
+ sh::HLSLBlockEncoder encoder(sh::HLSLBlockEncoder::GetStrategyFor(outputType), true);
encoder.skipRegisters(startRegister);
defineUniform(shader->getType(), uniform, uniform.name, &encoder, uniformMap);
@@ -2192,7 +2194,7 @@ size_t ProgramD3D::getUniformBlockInfo(const sh::InterfaceBlock &interfaceBlock)
// define member uniforms
sh::Std140BlockEncoder std140Encoder;
- sh::HLSLBlockEncoder hlslEncoder(sh::HLSLBlockEncoder::ENCODE_PACKED);
+ sh::HLSLBlockEncoder hlslEncoder(sh::HLSLBlockEncoder::ENCODE_PACKED, false);
sh::BlockLayoutEncoder *encoder = nullptr;
if (interfaceBlock.layout == sh::BLOCKLAYOUT_STANDARD)
@@ -2413,6 +2415,8 @@ void ProgramD3D::gatherTransformFeedbackVaryings(const gl::VaryingPacking &varyi
}
else
{
+ size_t subscript = GL_INVALID_INDEX;
+ std::string baseName = gl::ParseResourceName(tfVaryingName, &subscript);
for (const auto &registerInfo : varyingPacking.getRegisterList())
{
const auto &varying = *registerInfo.packedVarying->varying;
@@ -2428,7 +2432,8 @@ void ProgramD3D::gatherTransformFeedbackVaryings(const gl::VaryingPacking &varyi
// There can be more than one register assigned to a particular varying, and each
// register needs its own stream out entry.
- if (tfVaryingName == varying.name)
+ if (baseName == registerInfo.packedVarying->varying->name &&
+ (subscript == GL_INVALID_INDEX || subscript == registerInfo.varyingArrayIndex))
{
mStreamOutVaryings.push_back(D3DVarying(
varyingSemantic, registerInfo.semanticIndex, componentCount, outputSlot));
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
index 4707977f364..849fbd00c03 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
@@ -163,6 +163,7 @@ class ProgramD3D : public ProgramImpl
gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override;
+ void setSeparable(bool separable) override;
gl::Error getPixelExecutableForFramebuffer(const gl::Framebuffer *fbo,
ShaderExecutableD3D **outExectuable);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h
index 4ed82dc310d..dba545308b3 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h
@@ -178,6 +178,7 @@ class RendererD3D : public BufferFactoryD3D
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
+ GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
index 629308da5cb..690e86c247c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp
@@ -61,7 +61,6 @@ SurfaceD3D::SurfaceD3D(const egl::SurfaceState &state,
ASSERT(mD3DTexture != nullptr);
mD3DTexture->AddRef();
mRenderer->getD3DTextureInfo(mD3DTexture, &mWidth, &mHeight, &mRenderTargetFormat);
- mDepthStencilFormat = GL_NONE;
break;
default:
@@ -115,6 +114,11 @@ egl::Error SurfaceD3D::releaseTexImage(EGLint)
return egl::Error(EGL_SUCCESS);
}
+egl::Error SurfaceD3D::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
+{
+ return mSwapChain->getSyncValues(ust, msc, sbc);
+}
+
egl::Error SurfaceD3D::resetSwapChain()
{
ASSERT(!mSwapChain);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h
index 901f8a40072..58b2ce1f9b9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h
@@ -36,6 +36,7 @@ class SurfaceD3D : public SurfaceImpl
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
egl::Error releaseTexImage(EGLint buffer) override;
+ egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
void setSwapInterval(EGLint interval) override;
EGLint getWidth() const override;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h
index f492045276a..5472864ef55 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h
@@ -12,9 +12,11 @@
#include <GLES2/gl2.h>
#include <EGL/egl.h>
+#include <EGL/eglext.h>
#include "common/angleutils.h"
#include "common/platform.h"
+#include "libANGLE/Error.h"
#if !defined(ANGLE_FORCE_VSYNC_OFF)
#define ANGLE_FORCE_VSYNC_OFF 0
@@ -47,6 +49,8 @@ class SwapChainD3D : angle::NonCopyable
HANDLE getShareHandle() { return mShareHandle; }
virtual void *getKeyedMutex() = 0;
+ virtual egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) = 0;
+
protected:
const GLenum mOffscreenRenderTargetFormat;
const GLenum mDepthBufferFormat;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
index f353099933f..1d6d740a62c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
@@ -1030,17 +1030,21 @@ gl::Error TextureD3D_2D::copySubImage(ContextImpl *contextImpl,
}
gl::Error TextureD3D_2D::copyTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
+ ASSERT(target == GL_TEXTURE_2D);
+
GLenum sourceTarget = source->getTarget();
- GLint sourceLevel = 0;
- GLint destLevel = 0;
+ GLint destLevel = static_cast<GLint>(level);
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, type);
gl::Extents size(static_cast<int>(source->getWidth(sourceTarget, sourceLevel)),
@@ -1055,24 +1059,28 @@ gl::Error TextureD3D_2D::copyTexture(ContextImpl *contextImpl,
gl::Rectangle sourceRect(0, 0, size.width, size.height);
gl::Offset destOffset(0, 0, 0);
- ANGLE_TRY(mRenderer->copyTexture(source, sourceLevel, sourceRect,
+ ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceRect,
gl::GetInternalFormatInfo(sizedInternalFormat).format,
- destOffset, mTexStorage, destLevel, unpackFlipY,
+ destOffset, mTexStorage, target, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
return gl::NoError();
}
gl::Error TextureD3D_2D::copySubTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
- GLint sourceLevel = 0;
- GLint destLevel = 0;
+ ASSERT(target == GL_TEXTURE_2D);
+
+ GLint destLevel = static_cast<GLint>(level);
ASSERT(canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)));
@@ -1080,9 +1088,9 @@ gl::Error TextureD3D_2D::copySubTexture(ContextImpl *contextImpl,
ASSERT(isValidLevel(destLevel));
ANGLE_TRY(updateStorageLevel(destLevel));
- ANGLE_TRY(mRenderer->copyTexture(source, sourceLevel, sourceArea,
+ ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceArea,
gl::GetInternalFormatInfo(getBaseLevelInternalFormat()).format,
- destOffset, mTexStorage, destLevel, unpackFlipY,
+ destOffset, mTexStorage, target, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
return gl::NoError();
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h
index b905b472394..3da59e3c4b0 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h
@@ -201,14 +201,20 @@ class TextureD3D_2D : public TextureD3D
const gl::Framebuffer *source) override;
gl::Error copyTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
index c631349b4cf..35b2405f077 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
@@ -9,7 +9,7 @@
#include "libANGLE/renderer/d3d/VertexDataManager.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "libANGLE/Buffer.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/Program.h"
@@ -80,13 +80,19 @@ bool DirectStoragePossible(const gl::VertexAttribute &attrib, const gl::VertexBi
// 4-byte boundary, whichever is smaller. (Undocumented, and experimentally confirmed)
size_t alignment = 4;
- if (attrib.type != GL_FLOAT)
- {
- gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib);
+ // TODO(jmadill): add VertexFormatCaps
+ BufferFactoryD3D *factory = bufferD3D->getFactory();
+
+ gl::VertexFormatType vertexFormatType = gl::GetVertexFormatType(attrib);
- // TODO(jmadill): add VertexFormatCaps
- BufferFactoryD3D *factory = bufferD3D->getFactory();
+ // CPU-converted vertex data must be converted (naturally).
+ if ((factory->getVertexConversionType(vertexFormatType) & VERTEX_CONVERT_CPU) != 0)
+ {
+ return false;
+ }
+ if (attrib.type != GL_FLOAT)
+ {
auto errorOrElementSize = factory->getVertexSpaceRequired(attrib, binding, 1, 0);
if (errorOrElementSize.isError())
{
@@ -95,12 +101,6 @@ bool DirectStoragePossible(const gl::VertexAttribute &attrib, const gl::VertexBi
}
alignment = std::min<size_t>(errorOrElementSize.getResult(), 4);
-
- // CPU-converted vertex data must be converted (naturally).
- if ((factory->getVertexConversionType(vertexFormatType) & VERTEX_CONVERT_CPU) != 0)
- {
- return false;
- }
}
GLintptr offset = ComputeVertexAttributeOffset(attrib, binding);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
index eab6c35f0ba..fe14ddeecd2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp
@@ -143,7 +143,7 @@ class Buffer11::NativeStorage : public Buffer11::BufferStorage
public:
NativeStorage(Renderer11 *renderer,
BufferUsage usage,
- const angle::BroadcastChannel *onStorageChanged);
+ const angle::BroadcastChannel<> *onStorageChanged);
~NativeStorage() override;
bool isMappable(GLbitfield access) const override;
@@ -171,7 +171,7 @@ class Buffer11::NativeStorage : public Buffer11::BufferStorage
void clearSRVs();
ID3D11Buffer *mNativeStorage;
- const angle::BroadcastChannel *mOnStorageChanged;
+ const angle::BroadcastChannel<> *mOnStorageChanged;
std::map<DXGI_FORMAT, ID3D11ShaderResourceView *> mBufferResourceViews;
};
@@ -205,8 +205,8 @@ class Buffer11::EmulatedIndexedStorage : public Buffer11::BufferStorage
private:
ID3D11Buffer *mNativeStorage; // contains expanded data for use by D3D
- MemoryBuffer mMemoryBuffer; // original data (not expanded)
- MemoryBuffer mIndicesMemoryBuffer; // indices data
+ angle::MemoryBuffer mMemoryBuffer; // original data (not expanded)
+ angle::MemoryBuffer mIndicesMemoryBuffer; // indices data
};
// Pack storage represents internal storage for pack buffers. We implement pack buffers
@@ -237,7 +237,7 @@ class Buffer11::PackStorage : public Buffer11::BufferStorage
gl::Error flushQueuedPackCommand();
TextureHelper11 mStagingTexture;
- MemoryBuffer mMemoryBuffer;
+ angle::MemoryBuffer mMemoryBuffer;
std::unique_ptr<PackPixelsParams> mQueuedPackCommand;
PackPixelsParams mPackParams;
bool mDataModified;
@@ -265,10 +265,10 @@ class Buffer11::SystemMemoryStorage : public Buffer11::BufferStorage
uint8_t **mapPointerOut) override;
void unmap() override;
- MemoryBuffer *getSystemCopy() { return &mSystemCopy; }
+ angle::MemoryBuffer *getSystemCopy() { return &mSystemCopy; }
protected:
- MemoryBuffer mSystemCopy;
+ angle::MemoryBuffer mSystemCopy;
};
Buffer11::Buffer11(const gl::BufferState &state, Renderer11 *renderer)
@@ -902,12 +902,12 @@ void Buffer11::invalidateStaticData()
mStaticBroadcastChannel.signal();
}
-angle::BroadcastChannel *Buffer11::getStaticBroadcastChannel()
+angle::BroadcastChannel<> *Buffer11::getStaticBroadcastChannel()
{
return &mStaticBroadcastChannel;
}
-angle::BroadcastChannel *Buffer11::getDirectBroadcastChannel()
+angle::BroadcastChannel<> *Buffer11::getDirectBroadcastChannel()
{
return &mDirectBroadcastChannel;
}
@@ -941,7 +941,7 @@ gl::Error Buffer11::BufferStorage::setData(const uint8_t *data, size_t offset, s
Buffer11::NativeStorage::NativeStorage(Renderer11 *renderer,
BufferUsage usage,
- const angle::BroadcastChannel *onStorageChanged)
+ const angle::BroadcastChannel<> *onStorageChanged)
: BufferStorage(renderer, usage), mNativeStorage(nullptr), mOnStorageChanged(onStorageChanged)
{
}
@@ -1110,6 +1110,13 @@ void Buffer11::NativeStorage::FillBufferDesc(D3D11_BUFFER_DESC *bufferDesc,
bufferDesc->CPUAccessFlags = 0;
break;
+ case BUFFER_USAGE_INDIRECT:
+ bufferDesc->MiscFlags = D3D11_RESOURCE_MISC_DRAWINDIRECT_ARGS;
+ bufferDesc->Usage = D3D11_USAGE_DEFAULT;
+ bufferDesc->BindFlags = 0;
+ bufferDesc->CPUAccessFlags = 0;
+ break;
+
case BUFFER_USAGE_PIXEL_UNPACK:
bufferDesc->Usage = D3D11_USAGE_DEFAULT;
bufferDesc->BindFlags = D3D11_BIND_SHADER_RESOURCE;
@@ -1274,7 +1281,7 @@ gl::ErrorOrResult<ID3D11Buffer *> Buffer11::EmulatedIndexedStorage::getNativeSto
// Expand the memory storage upon request and cache the results.
unsigned int expandedDataSize =
static_cast<unsigned int>((indexInfo->srcCount * attribute.stride) + offset);
- MemoryBuffer expandedData;
+ angle::MemoryBuffer expandedData;
if (!expandedData.resize(expandedDataSize))
{
return gl::Error(
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
index 6d86dccbc8d..a1866373b0b 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h
@@ -35,6 +35,8 @@ enum BufferUsage
BUFFER_USAGE_STAGING,
BUFFER_USAGE_VERTEX_OR_TRANSFORM_FEEDBACK,
BUFFER_USAGE_INDEX,
+ // TODO: possibly share this buffer type with shader storage buffers.
+ BUFFER_USAGE_INDIRECT,
BUFFER_USAGE_PIXEL_UNPACK,
BUFFER_USAGE_PIXEL_PACK,
BUFFER_USAGE_UNIFORM,
@@ -101,8 +103,8 @@ class Buffer11 : public BufferD3D
// We use two set of dirty events. Static buffers are marked dirty whenever
// data changes, because they must be re-translated. Direct buffers only need to be
// updated when the underlying ID3D11Buffer pointer changes - hopefully far less often.
- angle::BroadcastChannel *getStaticBroadcastChannel();
- angle::BroadcastChannel *getDirectBroadcastChannel();
+ angle::BroadcastChannel<> *getStaticBroadcastChannel();
+ angle::BroadcastChannel<> *getDirectBroadcastChannel();
private:
class BufferStorage;
@@ -160,8 +162,8 @@ class Buffer11 : public BufferD3D
size_t mConstantBufferStorageAdditionalSize;
unsigned int mMaxConstantBufferLruCount;
- angle::BroadcastChannel mStaticBroadcastChannel;
- angle::BroadcastChannel mDirectBroadcastChannel;
+ angle::BroadcastChannel<> mStaticBroadcastChannel;
+ angle::BroadcastChannel<> mDirectBroadcastChannel;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
index 67ac491d42d..969355e0d26 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp
@@ -33,41 +33,24 @@
namespace rx
{
+static constexpr uint32_t g_VertexSize = sizeof(d3d11::PositionDepthColorVertex<float>);
+
template <typename T>
-static void ApplyVertices(const gl::Extents &framebufferSize,
- const gl::Rectangle *scissor,
- const gl::Color<T> &color,
- float depth,
- void *buffer)
+static void ApplyVertices(const gl::Color<T> &color, const float depth, void *buffer)
{
d3d11::PositionDepthColorVertex<T> *vertices =
reinterpret_cast<d3d11::PositionDepthColorVertex<T> *>(buffer);
- float depthClear = gl::clamp01(depth);
- float left = -1.0f;
- float right = 1.0f;
- float top = -1.0f;
- float bottom = 1.0f;
-
- // Clip the quad coordinates to the scissor if needed
- if (scissor != nullptr)
- {
- left = std::max(left, (scissor->x / float(framebufferSize.width)) * 2.0f - 1.0f);
- right = std::min(
- right, ((scissor->x + scissor->width) / float(framebufferSize.width)) * 2.0f - 1.0f);
- top = std::max(top, ((framebufferSize.height - scissor->y - scissor->height) /
- float(framebufferSize.height)) *
- 2.0f -
- 1.0f);
- bottom = std::min(
- bottom,
- ((framebufferSize.height - scissor->y) / float(framebufferSize.height)) * 2.0f - 1.0f);
- }
+ const float z = gl::clamp01(depth);
+ const float left = -1.0f;
+ const float right = 1.0f;
+ const float top = -1.0f;
+ const float bottom = 1.0f;
- d3d11::SetPositionDepthColorVertex<T>(vertices + 0, left, bottom, depthClear, color);
- d3d11::SetPositionDepthColorVertex<T>(vertices + 1, left, top, depthClear, color);
- d3d11::SetPositionDepthColorVertex<T>(vertices + 2, right, bottom, depthClear, color);
- d3d11::SetPositionDepthColorVertex<T>(vertices + 3, right, top, depthClear, color);
+ d3d11::SetPositionDepthColorVertex<T>(vertices + 0, left, bottom, z, color);
+ d3d11::SetPositionDepthColorVertex<T>(vertices + 1, left, top, z, color);
+ d3d11::SetPositionDepthColorVertex<T>(vertices + 2, right, bottom, z, color);
+ d3d11::SetPositionDepthColorVertex<T>(vertices + 3, right, top, z, color);
}
Clear11::ClearShader::ClearShader(DXGI_FORMAT colorType,
@@ -99,13 +82,9 @@ Clear11::ClearShader::~ClearShader()
Clear11::Clear11(Renderer11 *renderer)
: mRenderer(renderer),
- mClearBlendStates(StructLessThan<ClearBlendInfo>),
mFloatClearShader(nullptr),
mUintClearShader(nullptr),
- mIntClearShader(nullptr),
- mClearDepthStencilStates(StructLessThan<ClearDepthStencilInfo>),
- mVertexBuffer(nullptr),
- mRasterizerState(nullptr)
+ mIntClearShader(nullptr)
{
TRACE_EVENT0("gpu.angle", "Clear11::Clear11");
@@ -113,14 +92,14 @@ Clear11::Clear11(Renderer11 *renderer)
ID3D11Device *device = renderer->getDevice();
D3D11_BUFFER_DESC vbDesc;
- vbDesc.ByteWidth = sizeof(d3d11::PositionDepthColorVertex<float>) * 4;
+ vbDesc.ByteWidth = g_VertexSize * 4;
vbDesc.Usage = D3D11_USAGE_DYNAMIC;
vbDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER;
vbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
vbDesc.MiscFlags = 0;
vbDesc.StructureByteStride = 0;
- result = device->CreateBuffer(&vbDesc, nullptr, &mVertexBuffer);
+ result = device->CreateBuffer(&vbDesc, nullptr, mVertexBuffer.GetAddressOf());
ASSERT(SUCCEEDED(result));
d3d11::SetDebugName(mVertexBuffer, "Clear11 masked clear vertex buffer");
@@ -136,9 +115,16 @@ Clear11::Clear11(Renderer11 *renderer)
rsDesc.MultisampleEnable = FALSE;
rsDesc.AntialiasedLineEnable = FALSE;
- result = device->CreateRasterizerState(&rsDesc, &mRasterizerState);
+ result = device->CreateRasterizerState(&rsDesc, mScissorDisabledRasterizerState.GetAddressOf());
ASSERT(SUCCEEDED(result));
- d3d11::SetDebugName(mRasterizerState, "Clear11 masked clear rasterizer state");
+ d3d11::SetDebugName(mScissorDisabledRasterizerState,
+ "Clear11 Rasterizer State with scissor disabled");
+
+ rsDesc.ScissorEnable = TRUE;
+ result = device->CreateRasterizerState(&rsDesc, mScissorEnabledRasterizerState.GetAddressOf());
+ ASSERT(SUCCEEDED(result));
+ d3d11::SetDebugName(mScissorEnabledRasterizerState,
+ "Clear11 Rasterizer State with scissor enabled");
if (mRenderer->getRenderer11DeviceCaps().featureLevel <= D3D_FEATURE_LEVEL_9_3)
{
@@ -166,30 +152,44 @@ Clear11::Clear11(Renderer11 *renderer)
ArraySize(g_VS_ClearSint), "Clear11 SINT VS", g_PS_ClearSint,
ArraySize(g_PS_ClearSint), "Clear11 SINT PS");
}
+
+ // Initialize DepthstencilStateKey with defaults
+ mDepthStencilStateKey.depthTest = false;
+ mDepthStencilStateKey.depthMask = false;
+ mDepthStencilStateKey.depthFunc = GL_ALWAYS;
+ mDepthStencilStateKey.stencilWritemask = static_cast<GLuint>(-1);
+ mDepthStencilStateKey.stencilBackWritemask = static_cast<GLuint>(-1);
+ mDepthStencilStateKey.stencilBackMask = static_cast<GLuint>(-1);
+ mDepthStencilStateKey.stencilTest = false;
+ mDepthStencilStateKey.stencilMask = static_cast<GLuint>(-1);
+ mDepthStencilStateKey.stencilFail = GL_REPLACE;
+ mDepthStencilStateKey.stencilPassDepthFail = GL_REPLACE;
+ mDepthStencilStateKey.stencilPassDepthPass = GL_REPLACE;
+ mDepthStencilStateKey.stencilFunc = GL_ALWAYS;
+ mDepthStencilStateKey.stencilBackFail = GL_REPLACE;
+ mDepthStencilStateKey.stencilBackPassDepthFail = GL_REPLACE;
+ mDepthStencilStateKey.stencilBackPassDepthPass = GL_REPLACE;
+ mDepthStencilStateKey.stencilBackFunc = GL_ALWAYS;
+
+ // Initialize BlendStateKey with defaults
+ mBlendStateKey.blendState.blend = false;
+ mBlendStateKey.blendState.sourceBlendRGB = GL_ONE;
+ mBlendStateKey.blendState.sourceBlendAlpha = GL_ONE;
+ mBlendStateKey.blendState.destBlendRGB = GL_ZERO;
+ mBlendStateKey.blendState.destBlendAlpha = GL_ZERO;
+ mBlendStateKey.blendState.blendEquationRGB = GL_FUNC_ADD;
+ mBlendStateKey.blendState.blendEquationAlpha = GL_FUNC_ADD;
+ mBlendStateKey.blendState.sampleAlphaToCoverage = false;
+ mBlendStateKey.blendState.dither = true;
+ mBlendStateKey.mrt = false;
+ memset(mBlendStateKey.rtvMasks, 0, sizeof(mBlendStateKey.rtvMasks));
}
Clear11::~Clear11()
{
- for (ClearBlendStateMap::iterator i = mClearBlendStates.begin(); i != mClearBlendStates.end();
- i++)
- {
- SafeRelease(i->second);
- }
- mClearBlendStates.clear();
-
SafeDelete(mFloatClearShader);
SafeDelete(mUintClearShader);
SafeDelete(mIntClearShader);
-
- for (ClearDepthStencilStateMap::iterator i = mClearDepthStencilStates.begin();
- i != mClearDepthStencilStates.end(); i++)
- {
- SafeRelease(i->second);
- }
- mClearDepthStencilStates.clear();
-
- SafeRelease(mVertexBuffer);
- SafeRelease(mRasterizerState);
}
gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
@@ -197,17 +197,22 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
{
const auto &colorAttachments = fboData.getColorAttachments();
const auto &drawBufferStates = fboData.getDrawBufferStates();
- const auto *depthAttachment = fboData.getDepthAttachment();
- const auto *stencilAttachment = fboData.getStencilAttachment();
+ const gl::FramebufferAttachment *depthStencilAttachment = fboData.getDepthOrStencilAttachment();
+ RenderTarget11 *depthStencilRenderTarget = nullptr;
- ASSERT(colorAttachments.size() == drawBufferStates.size());
+ ASSERT(colorAttachments.size() <= drawBufferStates.size());
+
+ if (clearParams.clearDepth || clearParams.clearStencil)
+ {
+ ASSERT(depthStencilAttachment != nullptr);
+ ANGLE_TRY(depthStencilAttachment->getRenderTarget(&depthStencilRenderTarget));
+ }
// Iterate over the color buffers which require clearing and determine if they can be
// cleared with ID3D11DeviceContext::ClearRenderTargetView or ID3D11DeviceContext1::ClearView.
// This requires:
// 1) The render target is being cleared to a float value (will be cast to integer when clearing
- // integer
- // render targets as expected but does not work the other way around)
+ // integer render targets as expected but does not work the other way around)
// 2) The format of the render target has no color channels that are currently masked out.
// Clear the easy-to-clear buffers on the spot and accumulate the ones that require special
// work.
@@ -227,46 +232,53 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
gl::Extents framebufferSize;
- const gl::FramebufferAttachment *colorAttachment = fboData.getFirstColorAttachment();
- if (colorAttachment != nullptr)
+ if (depthStencilRenderTarget != nullptr)
{
- framebufferSize = colorAttachment->getSize();
- }
- else if (depthAttachment != nullptr)
- {
- framebufferSize = depthAttachment->getSize();
- }
- else if (stencilAttachment != nullptr)
- {
- framebufferSize = stencilAttachment->getSize();
+ framebufferSize = depthStencilRenderTarget->getExtents();
}
else
{
- UNREACHABLE();
- return gl::Error(GL_INVALID_OPERATION);
- }
+ const auto colorAttachment = fboData.getFirstColorAttachment();
- if (clearParams.scissorEnabled && (clearParams.scissor.x >= framebufferSize.width ||
- clearParams.scissor.y >= framebufferSize.height ||
- clearParams.scissor.x + clearParams.scissor.width <= 0 ||
- clearParams.scissor.y + clearParams.scissor.height <= 0))
- {
- // Scissor is enabled and the scissor rectangle is outside the renderbuffer
- return gl::NoError();
+ if (!colorAttachment)
+ {
+ UNREACHABLE();
+ return gl::InternalError();
+ }
+
+ framebufferSize = colorAttachment->getSize();
}
- bool needScissoredClear =
- clearParams.scissorEnabled &&
- (clearParams.scissor.x > 0 || clearParams.scissor.y > 0 ||
- clearParams.scissor.x + clearParams.scissor.width < framebufferSize.width ||
- clearParams.scissor.y + clearParams.scissor.height < framebufferSize.height);
+ bool needScissoredClear = false;
- std::vector<MaskedRenderTarget> maskedClearRenderTargets;
- RenderTarget11 *maskedClearDepthStencil = nullptr;
+ if (clearParams.scissorEnabled)
+ {
+ if (clearParams.scissor.x >= framebufferSize.width ||
+ clearParams.scissor.y >= framebufferSize.height ||
+ clearParams.scissor.x + clearParams.scissor.width <= 0 ||
+ clearParams.scissor.y + clearParams.scissor.height <= 0 ||
+ clearParams.scissor.width == 0 || clearParams.scissor.height == 0)
+ {
+ // Scissor rect is outside the renderbuffer or is an empty rect
+ return gl::NoError();
+ }
+
+ needScissoredClear =
+ clearParams.scissor.x > 0 || clearParams.scissor.y > 0 ||
+ clearParams.scissor.x + clearParams.scissor.width < framebufferSize.width ||
+ clearParams.scissor.y + clearParams.scissor.height < framebufferSize.height;
+ }
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
ID3D11DeviceContext1 *deviceContext1 = mRenderer->getDeviceContext1IfSupported();
- ID3D11Device *device = mRenderer->getDevice();
+
+ std::array<ID3D11RenderTargetView *, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT> rtvs;
+ std::array<uint8_t, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT> rtvMasks;
+ ID3D11DepthStencilView *dsv = nullptr;
+ uint32_t numRtvs = 0;
+ const uint8_t colorMask =
+ gl_d3d11::ConvertColorMask(clearParams.colorMaskRed, clearParams.colorMaskGreen,
+ clearParams.colorMaskBlue, clearParams.colorMaskAlpha);
for (size_t colorAttachmentIndex = 0; colorAttachmentIndex < colorAttachments.size();
colorAttachmentIndex++)
@@ -301,37 +313,30 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
// Every channel either does not exist in the render target or is masked out
continue;
}
- else if ((!(mRenderer->getRenderer11DeviceCaps().supportsClearView) &&
- needScissoredClear) ||
- clearParams.colorClearType != GL_FLOAT ||
- (formatInfo.redBits > 0 && !clearParams.colorMaskRed) ||
- (formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) ||
- (formatInfo.blueBits > 0 && !clearParams.colorMaskBlue) ||
- (formatInfo.alphaBits > 0 && !clearParams.colorMaskAlpha))
+
+ ID3D11RenderTargetView *framebufferRTV = renderTarget->getRenderTargetView();
+ if (!framebufferRTV)
{
- // A masked clear is required, or a scissored clear is required and
- // ID3D11DeviceContext1::ClearView is unavailable
- MaskedRenderTarget maskAndRt;
- bool clearColor = clearParams.clearColor[colorAttachmentIndex];
- maskAndRt.colorMask[0] = (clearColor && clearParams.colorMaskRed);
- maskAndRt.colorMask[1] = (clearColor && clearParams.colorMaskGreen);
- maskAndRt.colorMask[2] = (clearColor && clearParams.colorMaskBlue);
- maskAndRt.colorMask[3] = (clearColor && clearParams.colorMaskAlpha);
- maskAndRt.renderTarget = renderTarget;
- maskedClearRenderTargets.push_back(maskAndRt);
+ return gl::OutOfMemory()
+ << "Clear11: Render target view pointer unexpectedly null.";
+ }
+
+ if ((!(mRenderer->getRenderer11DeviceCaps().supportsClearView) && needScissoredClear) ||
+ clearParams.colorClearType != GL_FLOAT ||
+ (formatInfo.redBits > 0 && !clearParams.colorMaskRed) ||
+ (formatInfo.greenBits > 0 && !clearParams.colorMaskGreen) ||
+ (formatInfo.blueBits > 0 && !clearParams.colorMaskBlue) ||
+ (formatInfo.alphaBits > 0 && !clearParams.colorMaskAlpha))
+ {
+ rtvs[numRtvs] = framebufferRTV;
+ rtvMasks[numRtvs] = gl_d3d11::GetColorMask(&formatInfo) & colorMask;
+ numRtvs++;
}
else
{
// ID3D11DeviceContext::ClearRenderTargetView or ID3D11DeviceContext1::ClearView is
// possible
- ID3D11RenderTargetView *framebufferRTV = renderTarget->getRenderTargetView();
- if (!framebufferRTV)
- {
- return gl::Error(GL_OUT_OF_MEMORY,
- "Internal render target view pointer unexpectedly null.");
- }
-
const auto &nativeFormat = renderTarget->getFormatSet().format();
// Check if the actual format has a channel that the internal format does not and
@@ -394,47 +399,38 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
}
}
- if (clearParams.clearDepth || clearParams.clearStencil)
+ if (depthStencilRenderTarget)
{
- const gl::FramebufferAttachment *attachment =
- (depthAttachment != nullptr) ? depthAttachment : stencilAttachment;
- ASSERT(attachment != nullptr);
+ dsv = depthStencilRenderTarget->getDepthStencilView();
- RenderTarget11 *renderTarget = nullptr;
- ANGLE_TRY(attachment->getRenderTarget(&renderTarget));
+ if (!dsv)
+ {
+ return gl::OutOfMemory() << "Clear11: Depth stencil view pointer unexpectedly null.";
+ }
- const auto &nativeFormat = renderTarget->getFormatSet().format();
+ const auto &nativeFormat = depthStencilRenderTarget->getFormatSet().format();
+ const gl::FramebufferAttachment *stencilAttachment = fboData.getStencilAttachment();
- unsigned int stencilUnmasked =
+ uint32_t stencilUnmasked =
(stencilAttachment != nullptr) ? (1 << nativeFormat.stencilBits) - 1 : 0;
bool needMaskedStencilClear =
clearParams.clearStencil &&
(clearParams.stencilWriteMask & stencilUnmasked) != stencilUnmasked;
- if (needScissoredClear || needMaskedStencilClear)
- {
- maskedClearDepthStencil = renderTarget;
- }
- else
+ if (!needScissoredClear && !needMaskedStencilClear)
{
- ID3D11DepthStencilView *framebufferDSV = renderTarget->getDepthStencilView();
- if (!framebufferDSV)
- {
- return gl::Error(GL_OUT_OF_MEMORY,
- "Internal depth stencil view pointer unexpectedly null.");
- }
+ const UINT clearFlags = (clearParams.clearDepth ? D3D11_CLEAR_DEPTH : 0) |
+ (clearParams.clearStencil ? D3D11_CLEAR_STENCIL : 0);
+ const FLOAT depthClear = gl::clamp01(clearParams.depthClearValue);
+ const UINT8 stencilClear = clearParams.stencilClearValue & 0xFF;
- UINT clearFlags = (clearParams.clearDepth ? D3D11_CLEAR_DEPTH : 0) |
- (clearParams.clearStencil ? D3D11_CLEAR_STENCIL : 0);
- FLOAT depthClear = gl::clamp01(clearParams.depthClearValue);
- UINT8 stencilClear = clearParams.stencilClearValue & 0xFF;
+ deviceContext->ClearDepthStencilView(dsv, clearFlags, depthClear, stencilClear);
- deviceContext->ClearDepthStencilView(framebufferDSV, clearFlags, depthClear,
- stencilClear);
+ dsv = nullptr;
}
}
- if (maskedClearRenderTargets.empty() && !maskedClearDepthStencil)
+ if (numRtvs == 0 && !dsv)
{
return gl::NoError();
}
@@ -462,66 +458,69 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
// glClearBuffer* calls only clear a single renderbuffer at a time which is verified to
// be a compatible clear type.
- // Bind all the render targets which need clearing
- ASSERT(maskedClearRenderTargets.size() <= mRenderer->getNativeCaps().maxDrawBuffers);
- std::vector<ID3D11RenderTargetView *> rtvs(maskedClearRenderTargets.size());
- for (unsigned int i = 0; i < maskedClearRenderTargets.size(); i++)
- {
- RenderTarget11 *renderTarget = maskedClearRenderTargets[i].renderTarget;
- ID3D11RenderTargetView *rtv = renderTarget->getRenderTargetView();
- if (!rtv)
- {
- return gl::Error(GL_OUT_OF_MEMORY,
- "Internal render target view pointer unexpectedly null.");
- }
+ ASSERT(numRtvs <= mRenderer->getNativeCaps().maxDrawBuffers);
- rtvs[i] = rtv;
+ const UINT sampleMask = 0xFFFFFFFF;
+ ID3D11BlendState *blendState = nullptr;
+
+ if (numRtvs > 0)
+ {
+ // Setup BlendStateKey parameters
+ mBlendStateKey.blendState.colorMaskRed = clearParams.colorMaskRed;
+ mBlendStateKey.blendState.colorMaskGreen = clearParams.colorMaskGreen;
+ mBlendStateKey.blendState.colorMaskBlue = clearParams.colorMaskBlue;
+ mBlendStateKey.blendState.colorMaskAlpha = clearParams.colorMaskAlpha;
+ mBlendStateKey.mrt = numRtvs > 1;
+ memcpy(mBlendStateKey.rtvMasks, &rtvMasks[0], sizeof(mBlendStateKey.rtvMasks));
+
+ // Get BlendState
+ ANGLE_TRY(mRenderer->getStateCache().getBlendState(mBlendStateKey, &blendState));
}
- ID3D11DepthStencilView *dsv =
- maskedClearDepthStencil ? maskedClearDepthStencil->getDepthStencilView() : nullptr;
- ID3D11BlendState *blendState = getBlendState(maskedClearRenderTargets);
- const FLOAT blendFactors[4] = {1.0f, 1.0f, 1.0f, 1.0f};
- const UINT sampleMask = 0xFFFFFFFF;
+ const UINT stencilValue = clearParams.stencilClearValue & 0xFF;
+ ID3D11DepthStencilState *dsState = nullptr;
+ const float *zValue = nullptr;
- ID3D11DepthStencilState *dsState = getDepthStencilState(clearParams);
- const UINT stencilClear = clearParams.stencilClearValue & 0xFF;
+ if (dsv)
+ {
+ // Setup DepthStencilStateKey
+ mDepthStencilStateKey.depthTest = clearParams.clearDepth;
+ mDepthStencilStateKey.depthMask = clearParams.clearDepth;
+ mDepthStencilStateKey.stencilWritemask = clearParams.stencilWriteMask;
+ mDepthStencilStateKey.stencilTest = clearParams.clearStencil;
+
+ // Get DepthStencilState
+ ANGLE_TRY(mRenderer->getStateCache().getDepthStencilState(mDepthStencilStateKey, &dsState));
+ zValue = clearParams.clearDepth ? &clearParams.depthClearValue : nullptr;
+ }
// Set the vertices
- UINT vertexStride = 0;
- const UINT startIdx = 0;
ClearShader *shader = nullptr;
D3D11_MAPPED_SUBRESOURCE mappedResource;
HRESULT result =
- deviceContext->Map(mVertexBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
+ deviceContext->Map(mVertexBuffer.Get(), 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource);
if (FAILED(result))
{
- return gl::Error(GL_OUT_OF_MEMORY,
- "Failed to map internal masked clear vertex buffer, HRESULT: 0x%X.",
- result);
+ return gl::OutOfMemory() << "Clear11: Failed to map internal VB, " << result;
}
- const gl::Rectangle *scissorPtr = clearParams.scissorEnabled ? &clearParams.scissor : nullptr;
switch (clearParams.colorClearType)
{
case GL_FLOAT:
- ApplyVertices(framebufferSize, scissorPtr, clearParams.colorFClearValue,
- clearParams.depthClearValue, mappedResource.pData);
- vertexStride = sizeof(d3d11::PositionDepthColorVertex<float>);
+ ApplyVertices(clearParams.colorFClearValue, clearParams.depthClearValue,
+ mappedResource.pData);
shader = mFloatClearShader;
break;
case GL_UNSIGNED_INT:
- ApplyVertices(framebufferSize, scissorPtr, clearParams.colorUIClearValue,
- clearParams.depthClearValue, mappedResource.pData);
- vertexStride = sizeof(d3d11::PositionDepthColorVertex<unsigned int>);
+ ApplyVertices(clearParams.colorUIClearValue, clearParams.depthClearValue,
+ mappedResource.pData);
shader = mUintClearShader;
break;
case GL_INT:
- ApplyVertices(framebufferSize, scissorPtr, clearParams.colorIClearValue,
- clearParams.depthClearValue, mappedResource.pData);
- vertexStride = sizeof(d3d11::PositionDepthColorVertex<int>);
+ ApplyVertices(clearParams.colorIClearValue, clearParams.depthClearValue,
+ mappedResource.pData);
shader = mIntClearShader;
break;
@@ -530,7 +529,7 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
break;
}
- deviceContext->Unmap(mVertexBuffer, 0);
+ deviceContext->Unmap(mVertexBuffer.Get(), 0);
// Set the viewport to be the same size as the framebuffer
D3D11_VIEWPORT viewport;
@@ -543,22 +542,35 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
deviceContext->RSSetViewports(1, &viewport);
// Apply state
- deviceContext->OMSetBlendState(blendState, blendFactors, sampleMask);
- deviceContext->OMSetDepthStencilState(dsState, stencilClear);
- deviceContext->RSSetState(mRasterizerState);
+ deviceContext->OMSetBlendState(blendState, nullptr, sampleMask);
+ deviceContext->OMSetDepthStencilState(dsState, stencilValue);
+
+ if (needScissoredClear)
+ {
+ const D3D11_RECT scissorRect = {clearParams.scissor.x, clearParams.scissor.y,
+ clearParams.scissor.x1(), clearParams.scissor.y1()};
+ deviceContext->RSSetScissorRects(1, &scissorRect);
+ deviceContext->RSSetState(mScissorEnabledRasterizerState.Get());
+ }
+ else
+ {
+ deviceContext->RSSetState(mScissorDisabledRasterizerState.Get());
+ }
// Apply shaders
+ ID3D11Device *device = mRenderer->getDevice();
deviceContext->IASetInputLayout(shader->inputLayout->resolve(device));
deviceContext->VSSetShader(shader->vertexShader.resolve(device), nullptr, 0);
deviceContext->PSSetShader(shader->pixelShader.resolve(device), nullptr, 0);
deviceContext->GSSetShader(nullptr, nullptr, 0);
// Apply vertex buffer
- deviceContext->IASetVertexBuffers(0, 1, &mVertexBuffer, &vertexStride, &startIdx);
+ const UINT offset = 0;
+ deviceContext->IASetVertexBuffers(0, 1, mVertexBuffer.GetAddressOf(), &g_VertexSize, &offset);
deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
// Apply render targets
- mRenderer->getStateManager()->setOneTimeRenderTargets(rtvs, dsv);
+ mRenderer->getStateManager()->setOneTimeRenderTargets(&rtvs[0], numRtvs, dsv);
// Draw the clear quad
deviceContext->Draw(4, 0);
@@ -568,109 +580,4 @@ gl::Error Clear11::clearFramebuffer(const ClearParameters &clearParams,
return gl::NoError();
}
-
-ID3D11BlendState *Clear11::getBlendState(const std::vector<MaskedRenderTarget> &rts)
-{
- ClearBlendInfo blendKey = {};
- for (unsigned int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
- {
- if (i < rts.size())
- {
- RenderTarget11 *rt = rts[i].renderTarget;
- const gl::InternalFormat &formatInfo =
- gl::GetInternalFormatInfo(rt->getInternalFormat());
-
- blendKey.maskChannels[i][0] = (rts[i].colorMask[0] && formatInfo.redBits > 0);
- blendKey.maskChannels[i][1] = (rts[i].colorMask[1] && formatInfo.greenBits > 0);
- blendKey.maskChannels[i][2] = (rts[i].colorMask[2] && formatInfo.blueBits > 0);
- blendKey.maskChannels[i][3] = (rts[i].colorMask[3] && formatInfo.alphaBits > 0);
- }
- else
- {
- blendKey.maskChannels[i][0] = false;
- blendKey.maskChannels[i][1] = false;
- blendKey.maskChannels[i][2] = false;
- blendKey.maskChannels[i][3] = false;
- }
- }
-
- ClearBlendStateMap::const_iterator i = mClearBlendStates.find(blendKey);
- if (i != mClearBlendStates.end())
- {
- return i->second;
- }
- else
- {
- D3D11_BLEND_DESC blendDesc = {0};
- blendDesc.AlphaToCoverageEnable = FALSE;
- blendDesc.IndependentBlendEnable = (rts.size() > 1) ? TRUE : FALSE;
-
- for (unsigned int j = 0; j < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; j++)
- {
- blendDesc.RenderTarget[j].BlendEnable = FALSE;
- blendDesc.RenderTarget[j].RenderTargetWriteMask = gl_d3d11::ConvertColorMask(
- blendKey.maskChannels[j][0], blendKey.maskChannels[j][1],
- blendKey.maskChannels[j][2], blendKey.maskChannels[j][3]);
- }
-
- ID3D11Device *device = mRenderer->getDevice();
- ID3D11BlendState *blendState = nullptr;
- HRESULT result = device->CreateBlendState(&blendDesc, &blendState);
- if (FAILED(result) || !blendState)
- {
- ERR() << "Unable to create a ID3D11BlendState, " << gl::FmtHR(result) << ".";
- return nullptr;
- }
-
- mClearBlendStates[blendKey] = blendState;
-
- return blendState;
- }
-}
-
-ID3D11DepthStencilState *Clear11::getDepthStencilState(const ClearParameters &clearParams)
-{
- ClearDepthStencilInfo dsKey = {0};
- dsKey.clearDepth = clearParams.clearDepth;
- dsKey.clearStencil = clearParams.clearStencil;
- dsKey.stencilWriteMask = clearParams.stencilWriteMask & 0xFF;
-
- ClearDepthStencilStateMap::const_iterator i = mClearDepthStencilStates.find(dsKey);
- if (i != mClearDepthStencilStates.end())
- {
- return i->second;
- }
- else
- {
- D3D11_DEPTH_STENCIL_DESC dsDesc = {0};
- dsDesc.DepthEnable = dsKey.clearDepth ? TRUE : FALSE;
- dsDesc.DepthWriteMask =
- dsKey.clearDepth ? D3D11_DEPTH_WRITE_MASK_ALL : D3D11_DEPTH_WRITE_MASK_ZERO;
- dsDesc.DepthFunc = D3D11_COMPARISON_ALWAYS;
- dsDesc.StencilEnable = dsKey.clearStencil ? TRUE : FALSE;
- dsDesc.StencilReadMask = 0;
- dsDesc.StencilWriteMask = dsKey.stencilWriteMask;
- dsDesc.FrontFace.StencilFailOp = D3D11_STENCIL_OP_REPLACE;
- dsDesc.FrontFace.StencilDepthFailOp = D3D11_STENCIL_OP_REPLACE;
- dsDesc.FrontFace.StencilPassOp = D3D11_STENCIL_OP_REPLACE;
- dsDesc.FrontFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
- dsDesc.BackFace.StencilFailOp = D3D11_STENCIL_OP_REPLACE;
- dsDesc.BackFace.StencilDepthFailOp = D3D11_STENCIL_OP_REPLACE;
- dsDesc.BackFace.StencilPassOp = D3D11_STENCIL_OP_REPLACE;
- dsDesc.BackFace.StencilFunc = D3D11_COMPARISON_ALWAYS;
-
- ID3D11Device *device = mRenderer->getDevice();
- ID3D11DepthStencilState *dsState = nullptr;
- HRESULT result = device->CreateDepthStencilState(&dsDesc, &dsState);
- if (FAILED(result) || !dsState)
- {
- ERR() << "Unable to create a ID3D11DepthStencilState, " << gl::FmtHR(result) << ".";
- return nullptr;
- }
-
- mClearDepthStencilStates[dsKey] = dsState;
-
- return dsState;
- }
-}
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.h
index 1594027ec6f..48b26cb045a 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.h
@@ -60,37 +60,20 @@ class Clear11 : angle::NonCopyable
d3d11::LazyShader<ID3D11PixelShader> pixelShader;
};
- template <unsigned int vsSize, unsigned int psSize>
- static ClearShader CreateClearShader(ID3D11Device *device, DXGI_FORMAT colorType, const BYTE(&vsByteCode)[vsSize], const BYTE(&psByteCode)[psSize]);
-
- struct ClearBlendInfo
- {
- bool maskChannels[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT][4];
- };
- typedef bool(*ClearBlendInfoComparisonFunction)(const ClearBlendInfo&, const ClearBlendInfo &);
- typedef std::map<ClearBlendInfo, ID3D11BlendState*, ClearBlendInfoComparisonFunction> ClearBlendStateMap;
-
- struct ClearDepthStencilInfo
- {
- bool clearDepth;
- bool clearStencil;
- UINT8 stencilWriteMask;
- };
- typedef bool(*ClearDepthStencilInfoComparisonFunction)(const ClearDepthStencilInfo&, const ClearDepthStencilInfo &);
- typedef std::map<ClearDepthStencilInfo, ID3D11DepthStencilState*, ClearDepthStencilInfoComparisonFunction> ClearDepthStencilStateMap;
Renderer11 *mRenderer;
- ClearBlendStateMap mClearBlendStates;
+ // States
+ angle::ComPtr<ID3D11RasterizerState> mScissorEnabledRasterizerState;
+ angle::ComPtr<ID3D11RasterizerState> mScissorDisabledRasterizerState;
+ gl::DepthStencilState mDepthStencilStateKey;
+ d3d11::BlendStateKey mBlendStateKey;
+ // Shaders and Shader Resources
ClearShader *mFloatClearShader;
ClearShader *mUintClearShader;
ClearShader *mIntClearShader;
-
- ClearDepthStencilStateMap mClearDepthStencilStates;
-
- ID3D11Buffer *mVertexBuffer;
- ID3D11RasterizerState *mRasterizerState;
+ angle::ComPtr<ID3D11Buffer> mVertexBuffer;
};
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
index 310189e1266..22945c9a091 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.cpp
@@ -194,14 +194,12 @@ gl::Error Context11::drawRangeElements(GLenum mode,
gl::Error Context11::drawArraysIndirect(GLenum mode, const GLvoid *indirect)
{
- UNIMPLEMENTED();
- return gl::InternalError() << "DrawArraysIndirect hasn't been implemented for D3D11 backend.";
+ return mRenderer->genericDrawIndirect(this, mode, GL_NONE, indirect);
}
gl::Error Context11::drawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
{
- UNIMPLEMENTED();
- return gl::InternalError() << "DrawElementsIndirect hasn't been implemented for D3D11 backend.";
+ return mRenderer->genericDrawIndirect(this, mode, type, indirect);
}
GLenum Context11::getResetStatus()
@@ -282,4 +280,10 @@ const gl::Limitations &Context11::getNativeLimitations() const
return mRenderer->getNativeLimitations();
}
+gl::Error Context11::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
+{
+ UNIMPLEMENTED();
+ return gl::NoError();
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.h
index dd301197342..9b4a65512f6 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.h
@@ -121,6 +121,8 @@ class Context11 : public ContextImpl
Renderer11 *getRenderer() const { return mRenderer; }
+ gl::Error dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ) override;
+
private:
Renderer11 *mRenderer;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
index eeda40ad82a..cc0558f032a 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp
@@ -9,7 +9,7 @@
#include "libANGLE/renderer/d3d/d3d11/Framebuffer11.h"
#include "common/debug.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "libANGLE/renderer/d3d/d3d11/Buffer11.h"
#include "libANGLE/renderer/d3d/d3d11/Clear11.h"
#include "libANGLE/renderer/d3d/d3d11/TextureStorage11.h"
@@ -54,7 +54,7 @@ gl::Error MarkAttachmentsDirty(const gl::FramebufferAttachment *attachment)
void UpdateCachedRenderTarget(const gl::FramebufferAttachment *attachment,
RenderTarget11 *&cachedRenderTarget,
- ChannelBinding *channelBinding)
+ gl::OnAttachmentDirtyBinding *channelBinding)
{
RenderTarget11 *newRenderTarget = nullptr;
if (attachment)
@@ -78,10 +78,10 @@ Framebuffer11::Framebuffer11(const gl::FramebufferState &data, Renderer11 *rende
{
ASSERT(mRenderer != nullptr);
mCachedColorRenderTargets.fill(nullptr);
- for (size_t colorIndex = 0; colorIndex < data.getColorAttachments().size(); ++colorIndex)
+ for (uint32_t colorIndex = 0;
+ colorIndex < static_cast<uint32_t>(data.getColorAttachments().size()); ++colorIndex)
{
- mColorRenderTargetsDirty.push_back(
- ChannelBinding(this, static_cast<SignalToken>(colorIndex)));
+ mColorRenderTargetsDirty.emplace_back(this, colorIndex);
}
}
@@ -377,7 +377,7 @@ void Framebuffer11::updateDepthStencilRenderTarget()
&mDepthStencilRenderTargetDirty);
}
-void Framebuffer11::syncState(const gl::Framebuffer::DirtyBits &dirtyBits)
+void Framebuffer11::syncState(ContextImpl *contextImpl, const gl::Framebuffer::DirtyBits &dirtyBits)
{
mRenderer->getStateManager()->invalidateRenderTarget();
@@ -410,12 +410,12 @@ void Framebuffer11::syncState(const gl::Framebuffer::DirtyBits &dirtyBits)
// We should not have dirtied any additional state during our sync.
ASSERT(!mInternalDirtyBits.any());
- FramebufferD3D::syncState(dirtyBits);
+ FramebufferD3D::syncState(contextImpl, dirtyBits);
}
-void Framebuffer11::signal(SignalToken token)
+void Framebuffer11::signal(uint32_t channelID)
{
- if (token == gl::IMPLEMENTATION_MAX_FRAMEBUFFER_ATTACHMENTS)
+ if (channelID == gl::IMPLEMENTATION_MAX_FRAMEBUFFER_ATTACHMENTS)
{
// Stencil is redundant in this case.
mInternalDirtyBits.set(gl::Framebuffer::DIRTY_BIT_DEPTH_ATTACHMENT);
@@ -423,8 +423,8 @@ void Framebuffer11::signal(SignalToken token)
}
else
{
- mInternalDirtyBits.set(gl::Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_0 + token);
- mCachedColorRenderTargets[token] = nullptr;
+ mInternalDirtyBits.set(gl::Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_0 + channelID);
+ mCachedColorRenderTargets[channelID] = nullptr;
}
}
@@ -439,9 +439,9 @@ bool Framebuffer11::hasAnyInternalDirtyBit() const
return mInternalDirtyBits.any();
}
-void Framebuffer11::syncInternalState()
+void Framebuffer11::syncInternalState(ContextImpl *contextImpl)
{
- syncState(gl::Framebuffer::DirtyBits());
+ syncState(contextImpl, gl::Framebuffer::DirtyBits());
}
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h
index e75fc29f9b4..c83d0b34542 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h
@@ -17,7 +17,7 @@ namespace rx
{
class Renderer11;
-class Framebuffer11 : public FramebufferD3D, public angle::SignalReceiver
+class Framebuffer11 : public FramebufferD3D, public angle::SignalReceiver<>
{
public:
Framebuffer11(const gl::FramebufferState &data, Renderer11 *renderer);
@@ -30,7 +30,7 @@ class Framebuffer11 : public FramebufferD3D, public angle::SignalReceiver
// Invalidate the cached swizzles of all bound texture attachments.
gl::Error markAttachmentsDirty() const;
- void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override;
+ void syncState(ContextImpl *contextImpl, const gl::Framebuffer::DirtyBits &dirtyBits) override;
const RenderTargetArray &getCachedColorRenderTargets() const
{
@@ -42,9 +42,9 @@ class Framebuffer11 : public FramebufferD3D, public angle::SignalReceiver
}
bool hasAnyInternalDirtyBit() const;
- void syncInternalState();
+ void syncInternalState(ContextImpl *contextImpl);
- void signal(angle::SignalToken token) override;
+ void signal(uint32_t channelID) override;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
@@ -79,8 +79,8 @@ class Framebuffer11 : public FramebufferD3D, public angle::SignalReceiver
RenderTargetArray mCachedColorRenderTargets;
RenderTarget11 *mCachedDepthStencilRenderTarget;
- std::vector<angle::ChannelBinding> mColorRenderTargetsDirty;
- angle::ChannelBinding mDepthStencilRenderTargetDirty;
+ std::vector<gl::OnAttachmentDirtyBinding> mColorRenderTargetsDirty;
+ gl::OnAttachmentDirtyBinding mDepthStencilRenderTargetDirty;
gl::Framebuffer::DirtyBits mInternalDirtyBits;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
index 1e58ef0a2b2..2657b1e5297 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp
@@ -370,7 +370,7 @@ gl::Error Image11::copyFromFramebuffer(const gl::Offset &destOffset,
if (loadFunction.requiresConversion)
{
size_t bufferSize = destFormatInfo.pixelBytes * sourceArea.width * sourceArea.height;
- MemoryBuffer *memoryBuffer = nullptr;
+ angle::MemoryBuffer *memoryBuffer = nullptr;
mRenderer->getScratchMemoryBuffer(bufferSize, &memoryBuffer);
GLuint memoryBufferRowPitch = destFormatInfo.pixelBytes * sourceArea.width;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
index 06ac347b9ce..efa685eff02 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp
@@ -9,7 +9,7 @@
#include "libANGLE/renderer/d3d/d3d11/InputLayoutCache.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/utilities.h"
#include "libANGLE/Program.h"
#include "libANGLE/VertexAttribute.h"
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
index 1d664b72b28..ffd8aa24b62 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp
@@ -36,18 +36,20 @@ static void ClearStateMap(mapType &map)
// MSDN's documentation of ID3D11Device::CreateBlendState, ID3D11Device::CreateRasterizerState,
// ID3D11Device::CreateDepthStencilState and ID3D11Device::CreateSamplerState claims the maximum
// number of unique states of each type an application can create is 4096
-const unsigned int RenderStateCache::kMaxBlendStates = 4096;
-const unsigned int RenderStateCache::kMaxRasterizerStates = 4096;
-const unsigned int RenderStateCache::kMaxDepthStencilStates = 4096;
-const unsigned int RenderStateCache::kMaxSamplerStates = 4096;
+// TODO(ShahmeerEsmail): Revisit the cache sizes to make sure they are appropriate for most
+// scenarios.
+const unsigned int RenderStateCache::kMaxBlendStates = 2048;
+const unsigned int RenderStateCache::kMaxRasterizerStates = 2048;
+const unsigned int RenderStateCache::kMaxDepthStencilStates = 2048;
+const unsigned int RenderStateCache::kMaxSamplerStates = 2048;
RenderStateCache::RenderStateCache(Renderer11 *renderer)
: mRenderer(renderer),
mCounter(0),
- mBlendStateCache(kMaxBlendStates, hashBlendState, compareBlendStates),
- mRasterizerStateCache(kMaxRasterizerStates, hashRasterizerState, compareRasterizerStates),
- mDepthStencilStateCache(kMaxDepthStencilStates, hashDepthStencilState, compareDepthStencilStates),
- mSamplerStateCache(kMaxSamplerStates, hashSamplerState, compareSamplerStates),
+ mBlendStateCache(kMaxBlendStates, HashBlendState, CompareBlendStates),
+ mRasterizerStateCache(kMaxRasterizerStates, HashRasterizerState, CompareRasterizerStates),
+ mDepthStencilStateCache(kMaxDepthStencilStates, HashDepthStencilState, CompareDepthStencilStates),
+ mSamplerStateCache(kMaxSamplerStates, HashSamplerState, CompareSamplerStates),
mDevice(NULL)
{
}
@@ -71,53 +73,71 @@ void RenderStateCache::clear()
ClearStateMap(mSamplerStateCache);
}
-std::size_t RenderStateCache::hashBlendState(const BlendStateKey &blendState)
+// static
+std::size_t RenderStateCache::HashBlendState(const d3d11::BlendStateKey &blendState)
{
static const unsigned int seed = 0xABCDEF98;
std::size_t hash = 0;
- MurmurHash3_x86_32(&blendState, sizeof(gl::BlendState), seed, &hash);
+ MurmurHash3_x86_32(&blendState, sizeof(d3d11::BlendStateKey), seed, &hash);
return hash;
}
-bool RenderStateCache::compareBlendStates(const BlendStateKey &a, const BlendStateKey &b)
+// static
+bool RenderStateCache::CompareBlendStates(const d3d11::BlendStateKey &a,
+ const d3d11::BlendStateKey &b)
{
- return memcmp(&a, &b, sizeof(BlendStateKey)) == 0;
+ return memcmp(&a, &b, sizeof(d3d11::BlendStateKey)) == 0;
}
-gl::Error RenderStateCache::getBlendState(const gl::Framebuffer *framebuffer, const gl::BlendState &blendState,
- ID3D11BlendState **outBlendState)
+// static
+d3d11::BlendStateKey RenderStateCache::GetBlendStateKey(const gl::Framebuffer *framebuffer,
+ const gl::BlendState &blendState)
{
- if (!mDevice)
- {
- return gl::Error(GL_OUT_OF_MEMORY, "Internal error, RenderStateCache is not initialized.");
- }
-
- bool mrt = false;
-
- const FramebufferD3D *framebufferD3D = GetImplAs<FramebufferD3D>(framebuffer);
+ d3d11::BlendStateKey key;
+ const FramebufferD3D *framebufferD3D = GetImplAs<FramebufferD3D>(framebuffer);
const gl::AttachmentList &colorbuffers = framebufferD3D->getColorAttachmentsForRender();
+ const UINT8 blendStateMask =
+ gl_d3d11::ConvertColorMask(blendState.colorMaskRed, blendState.colorMaskGreen,
+ blendState.colorMaskBlue, blendState.colorMaskAlpha);
- BlendStateKey key = {};
key.blendState = blendState;
- for (size_t colorAttachment = 0; colorAttachment < colorbuffers.size(); ++colorAttachment)
- {
- const gl::FramebufferAttachment *attachment = colorbuffers[colorAttachment];
+ key.mrt = false;
- auto rtChannels = key.rtChannels[colorAttachment];
+ for (size_t i = 0; i < colorbuffers.size(); i++)
+ {
+ const gl::FramebufferAttachment *attachment = colorbuffers[i];
if (attachment)
{
- if (colorAttachment > 0)
+ if (i > 0)
{
- mrt = true;
+ key.mrt = true;
}
- rtChannels[0] = attachment->getRedSize() > 0;
- rtChannels[1] = attachment->getGreenSize() > 0;
- rtChannels[2] = attachment->getBlueSize() > 0;
- rtChannels[3] = attachment->getAlphaSize() > 0;
+ key.rtvMasks[i] =
+ (gl_d3d11::GetColorMask(attachment->getFormat().info)) & blendStateMask;
}
+ else
+ {
+ key.rtvMasks[i] = 0;
+ }
+ }
+
+ for (size_t i = colorbuffers.size(); i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
+ {
+ key.rtvMasks[i] = 0;
+ }
+
+ return key;
+}
+
+gl::Error RenderStateCache::getBlendState(const d3d11::BlendStateKey &key,
+ ID3D11BlendState **outBlendState)
+{
+ if (!mDevice)
+ {
+ return gl::Error(GL_OUT_OF_MEMORY, "Internal error, RenderStateCache is not initialized.");
}
BlendStateMap::iterator keyIter = mBlendStateCache.find(key);
@@ -148,47 +168,48 @@ gl::Error RenderStateCache::getBlendState(const gl::Framebuffer *framebuffer, co
}
// Create a new blend state and insert it into the cache
- D3D11_BLEND_DESC blendDesc = { 0 };
- blendDesc.AlphaToCoverageEnable = blendState.sampleAlphaToCoverage;
- blendDesc.IndependentBlendEnable = mrt ? TRUE : FALSE;
+ D3D11_BLEND_DESC blendDesc;
+ D3D11_RENDER_TARGET_BLEND_DESC &rtDesc0 = blendDesc.RenderTarget[0];
+ const gl::BlendState &blendState = key.blendState;
- for (unsigned int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
- {
- D3D11_RENDER_TARGET_BLEND_DESC &rtBlend = blendDesc.RenderTarget[i];
+ blendDesc.AlphaToCoverageEnable = blendState.sampleAlphaToCoverage;
+ blendDesc.IndependentBlendEnable = key.mrt ? TRUE : FALSE;
- rtBlend.BlendEnable = blendState.blend;
- if (blendState.blend)
- {
- rtBlend.SrcBlend = gl_d3d11::ConvertBlendFunc(blendState.sourceBlendRGB, false);
- rtBlend.DestBlend = gl_d3d11::ConvertBlendFunc(blendState.destBlendRGB, false);
- rtBlend.BlendOp = gl_d3d11::ConvertBlendOp(blendState.blendEquationRGB);
+ rtDesc0 = {};
- rtBlend.SrcBlendAlpha = gl_d3d11::ConvertBlendFunc(blendState.sourceBlendAlpha, true);
- rtBlend.DestBlendAlpha = gl_d3d11::ConvertBlendFunc(blendState.destBlendAlpha, true);
- rtBlend.BlendOpAlpha = gl_d3d11::ConvertBlendOp(blendState.blendEquationAlpha);
- }
+ if (blendState.blend)
+ {
+ rtDesc0.BlendEnable = true;
+ rtDesc0.SrcBlend = gl_d3d11::ConvertBlendFunc(blendState.sourceBlendRGB, false);
+ rtDesc0.DestBlend = gl_d3d11::ConvertBlendFunc(blendState.destBlendRGB, false);
+ rtDesc0.BlendOp = gl_d3d11::ConvertBlendOp(blendState.blendEquationRGB);
+ rtDesc0.SrcBlendAlpha = gl_d3d11::ConvertBlendFunc(blendState.sourceBlendAlpha, true);
+ rtDesc0.DestBlendAlpha = gl_d3d11::ConvertBlendFunc(blendState.destBlendAlpha, true);
+ rtDesc0.BlendOpAlpha = gl_d3d11::ConvertBlendOp(blendState.blendEquationAlpha);
+ }
+
+ rtDesc0.RenderTargetWriteMask = key.rtvMasks[0];
- rtBlend.RenderTargetWriteMask = gl_d3d11::ConvertColorMask(key.rtChannels[i][0] && blendState.colorMaskRed,
- key.rtChannels[i][1] && blendState.colorMaskGreen,
- key.rtChannels[i][2] && blendState.colorMaskBlue,
- key.rtChannels[i][3] && blendState.colorMaskAlpha);
+ for (unsigned int i = 1; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
+ {
+ blendDesc.RenderTarget[i] = rtDesc0;
+ blendDesc.RenderTarget[i].RenderTargetWriteMask = key.rtvMasks[i];
}
- ID3D11BlendState *dx11BlendState = NULL;
- HRESULT result = mDevice->CreateBlendState(&blendDesc, &dx11BlendState);
- if (FAILED(result) || !dx11BlendState)
+ HRESULT result = mDevice->CreateBlendState(&blendDesc, outBlendState);
+ if (FAILED(result) || !(*outBlendState))
{
return gl::Error(GL_OUT_OF_MEMORY, "Unable to create a ID3D11BlendState, HRESULT: 0x%X.", result);
}
- mBlendStateCache.insert(std::make_pair(key, std::make_pair(dx11BlendState, mCounter++)));
+ mBlendStateCache.insert(std::make_pair(key, std::make_pair(*outBlendState, mCounter++)));
- *outBlendState = dx11BlendState;
return gl::NoError();
}
}
-std::size_t RenderStateCache::hashRasterizerState(const RasterizerStateKey &rasterState)
+// static
+std::size_t RenderStateCache::HashRasterizerState(const RasterizerStateKey &rasterState)
{
static const unsigned int seed = 0xABCDEF98;
@@ -197,7 +218,8 @@ std::size_t RenderStateCache::hashRasterizerState(const RasterizerStateKey &rast
return hash;
}
-bool RenderStateCache::compareRasterizerStates(const RasterizerStateKey &a, const RasterizerStateKey &b)
+// static
+bool RenderStateCache::CompareRasterizerStates(const RasterizerStateKey &a, const RasterizerStateKey &b)
{
return memcmp(&a, &b, sizeof(RasterizerStateKey)) == 0;
}
@@ -284,7 +306,8 @@ gl::Error RenderStateCache::getRasterizerState(const gl::RasterizerState &raster
}
}
-std::size_t RenderStateCache::hashDepthStencilState(const gl::DepthStencilState &dsState)
+// static
+std::size_t RenderStateCache::HashDepthStencilState(const gl::DepthStencilState &dsState)
{
static const unsigned int seed = 0xABCDEF98;
@@ -293,14 +316,13 @@ std::size_t RenderStateCache::hashDepthStencilState(const gl::DepthStencilState
return hash;
}
-bool RenderStateCache::compareDepthStencilStates(const gl::DepthStencilState &a, const gl::DepthStencilState &b)
+// static
+bool RenderStateCache::CompareDepthStencilStates(const gl::DepthStencilState &a, const gl::DepthStencilState &b)
{
return memcmp(&a, &b, sizeof(gl::DepthStencilState)) == 0;
}
-gl::Error RenderStateCache::getDepthStencilState(const gl::DepthStencilState &originalState,
- bool disableDepth,
- bool disableStencil,
+gl::Error RenderStateCache::getDepthStencilState(const gl::DepthStencilState &glState,
ID3D11DepthStencilState **outDSState)
{
if (!mDevice)
@@ -308,20 +330,6 @@ gl::Error RenderStateCache::getDepthStencilState(const gl::DepthStencilState &or
return gl::Error(GL_OUT_OF_MEMORY, "Internal error, RenderStateCache is not initialized.");
}
- gl::DepthStencilState glState = originalState;
- if (disableDepth)
- {
- glState.depthTest = false;
- glState.depthMask = false;
- }
-
- if (disableStencil)
- {
- glState.stencilWritemask = 0;
- glState.stencilBackWritemask = 0;
- glState.stencilTest = false;
- }
-
auto keyIter = mDepthStencilStateCache.find(glState);
if (keyIter != mDepthStencilStateCache.end())
{
@@ -379,7 +387,8 @@ gl::Error RenderStateCache::getDepthStencilState(const gl::DepthStencilState &or
return gl::NoError();
}
-std::size_t RenderStateCache::hashSamplerState(const gl::SamplerState &samplerState)
+// static
+std::size_t RenderStateCache::HashSamplerState(const gl::SamplerState &samplerState)
{
static const unsigned int seed = 0xABCDEF98;
@@ -388,7 +397,8 @@ std::size_t RenderStateCache::hashSamplerState(const gl::SamplerState &samplerSt
return hash;
}
-bool RenderStateCache::compareSamplerStates(const gl::SamplerState &a, const gl::SamplerState &b)
+// static
+bool RenderStateCache::CompareSamplerStates(const gl::SamplerState &a, const gl::SamplerState &b)
{
return memcmp(&a, &b, sizeof(gl::SamplerState)) == 0;
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h
index 82cb13903cf..b9981052654 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h
@@ -13,6 +13,7 @@
#include "libANGLE/angletypes.h"
#include "libANGLE/Error.h"
#include "common/angleutils.h"
+#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include <unordered_map>
@@ -34,11 +35,11 @@ class RenderStateCache : angle::NonCopyable
void initialize(ID3D11Device *device);
void clear();
- gl::Error getBlendState(const gl::Framebuffer *framebuffer, const gl::BlendState &blendState, ID3D11BlendState **outBlendState);
+ static d3d11::BlendStateKey GetBlendStateKey(const gl::Framebuffer *framebuffer,
+ const gl::BlendState &blendState);
+ gl::Error getBlendState(const d3d11::BlendStateKey &key, ID3D11BlendState **outBlendState);
gl::Error getRasterizerState(const gl::RasterizerState &rasterState, bool scissorEnabled, ID3D11RasterizerState **outRasterizerState);
gl::Error getDepthStencilState(const gl::DepthStencilState &dsState,
- bool disableDepth,
- bool disableStencil,
ID3D11DepthStencilState **outDSState);
gl::Error getSamplerState(const gl::SamplerState &samplerState, ID3D11SamplerState **outSamplerState);
@@ -47,19 +48,19 @@ class RenderStateCache : angle::NonCopyable
unsigned long long mCounter;
// Blend state cache
- struct BlendStateKey
- {
- gl::BlendState blendState;
- bool rtChannels[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT][4];
- };
- static std::size_t hashBlendState(const BlendStateKey &blendState);
- static bool compareBlendStates(const BlendStateKey &a, const BlendStateKey &b);
+ static std::size_t HashBlendState(const d3d11::BlendStateKey &blendState);
+ static bool CompareBlendStates(const d3d11::BlendStateKey &a, const d3d11::BlendStateKey &b);
static const unsigned int kMaxBlendStates;
- typedef std::size_t (*BlendStateHashFunction)(const BlendStateKey &);
- typedef bool (*BlendStateEqualityFunction)(const BlendStateKey &, const BlendStateKey &);
+ typedef std::size_t (*BlendStateHashFunction)(const d3d11::BlendStateKey &);
+ typedef bool (*BlendStateEqualityFunction)(const d3d11::BlendStateKey &,
+ const d3d11::BlendStateKey &);
typedef std::pair<ID3D11BlendState*, unsigned long long> BlendStateCounterPair;
- typedef std::unordered_map<BlendStateKey, BlendStateCounterPair, BlendStateHashFunction, BlendStateEqualityFunction> BlendStateMap;
+ typedef std::unordered_map<d3d11::BlendStateKey,
+ BlendStateCounterPair,
+ BlendStateHashFunction,
+ BlendStateEqualityFunction>
+ BlendStateMap;
BlendStateMap mBlendStateCache;
// Rasterizer state cache
@@ -68,8 +69,8 @@ class RenderStateCache : angle::NonCopyable
gl::RasterizerState rasterizerState;
bool scissorEnabled;
};
- static std::size_t hashRasterizerState(const RasterizerStateKey &rasterState);
- static bool compareRasterizerStates(const RasterizerStateKey &a, const RasterizerStateKey &b);
+ static std::size_t HashRasterizerState(const RasterizerStateKey &rasterState);
+ static bool CompareRasterizerStates(const RasterizerStateKey &a, const RasterizerStateKey &b);
static const unsigned int kMaxRasterizerStates;
typedef std::size_t (*RasterizerStateHashFunction)(const RasterizerStateKey &);
@@ -79,8 +80,8 @@ class RenderStateCache : angle::NonCopyable
RasterizerStateMap mRasterizerStateCache;
// Depth stencil state cache
- static std::size_t hashDepthStencilState(const gl::DepthStencilState &dsState);
- static bool compareDepthStencilStates(const gl::DepthStencilState &a, const gl::DepthStencilState &b);
+ static std::size_t HashDepthStencilState(const gl::DepthStencilState &dsState);
+ static bool CompareDepthStencilStates(const gl::DepthStencilState &a, const gl::DepthStencilState &b);
static const unsigned int kMaxDepthStencilStates;
typedef std::size_t (*DepthStencilStateHashFunction)(const gl::DepthStencilState &);
@@ -93,8 +94,8 @@ class RenderStateCache : angle::NonCopyable
DepthStencilStateMap mDepthStencilStateCache;
// Sample state cache
- static std::size_t hashSamplerState(const gl::SamplerState &samplerState);
- static bool compareSamplerStates(const gl::SamplerState &a, const gl::SamplerState &b);
+ static std::size_t HashSamplerState(const gl::SamplerState &samplerState);
+ static bool CompareSamplerStates(const gl::SamplerState &a, const gl::SamplerState &b);
static const unsigned int kMaxSamplerStates;
typedef std::size_t (*SamplerStateHashFunction)(const gl::SamplerState &);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h
index 4ee0de29203..47744bea505 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h
@@ -35,12 +35,12 @@ class RenderTarget11 : public RenderTargetD3D
virtual unsigned int getSubresourceIndex() const = 0;
void signalDirty() override;
- angle::BroadcastChannel *getBroadcastChannel() { return &mBroadcastChannel; }
+ angle::BroadcastChannel<> *getBroadcastChannel() { return &mBroadcastChannel; }
const d3d11::Format &getFormatSet() const { return mFormatSet; }
protected:
- angle::BroadcastChannel mBroadcastChannel;
+ angle::BroadcastChannel<> mBroadcastChannel;
const d3d11::Format &mFormatSet;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
index d6e7b440e47..82a1199b7a2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp
@@ -376,10 +376,7 @@ int GetWrapBits(GLenum wrap)
}
}
-// If we request a scratch buffer requesting a smaller size this many times,
-// release and recreate the scratch buffer. This ensures we don't have a
-// degenerate case where we are stuck hogging memory.
-const int ScratchMemoryBufferLifetime = 1000;
+const uint32_t ScratchMemoryBufferLifetime = 1000;
} // anonymous namespace
@@ -390,7 +387,7 @@ Renderer11::Renderer11(egl::Display *display)
mLastHistogramUpdateTime(
ANGLEPlatformCurrent()->monotonicallyIncreasingTime(ANGLEPlatformCurrent())),
mDebug(nullptr),
- mScratchMemoryBufferResetCounter(0),
+ mScratchMemoryBuffer(ScratchMemoryBufferLifetime),
mAnnotator(nullptr)
{
mVertexDataManager = NULL;
@@ -1106,6 +1103,11 @@ void Renderer11::generateDisplayExtensions(egl::DisplayExtensions *outExtensions
// Contexts are virtualized so textures can be shared globally
outExtensions->displayTextureShareGroup = true;
+
+ outExtensions->createContextRobustResourceInitialization = true;
+
+ // getSyncValues requires direct composition.
+ outExtensions->getSyncValues = outExtensions->directComposition;
}
gl::Error Renderer11::flush()
@@ -1590,15 +1592,16 @@ gl::Error Renderer11::setUniformBuffers(const gl::ContextState &data,
return gl::NoError();
}
-gl::Error Renderer11::updateState(const gl::ContextState &data, GLenum drawMode)
+gl::Error Renderer11::updateState(ContextImpl *contextImpl, GLenum drawMode)
{
+ const auto &data = contextImpl->getContextState();
const auto &glState = data.getState();
// Applies the render target surface, depth stencil surface, viewport rectangle and
// scissor rectangle to the renderer
gl::Framebuffer *framebuffer = glState.getDrawFramebuffer();
- ASSERT(framebuffer && !framebuffer->hasAnyDirtyBit() && framebuffer->complete(data));
- ANGLE_TRY(applyRenderTarget(framebuffer));
+ ASSERT(framebuffer && !framebuffer->hasAnyDirtyBit() && framebuffer->cachedComplete());
+ ANGLE_TRY(mStateManager.syncFramebuffer(contextImpl, framebuffer));
// Set the present path state
auto firstColorAttachment = framebuffer->getFirstColorbuffer();
@@ -1701,11 +1704,6 @@ bool Renderer11::applyPrimitiveType(GLenum mode, GLsizei count, bool usesPointSi
return count >= minCount;
}
-gl::Error Renderer11::applyRenderTarget(gl::Framebuffer *framebuffer)
-{
- return mStateManager.syncFramebuffer(framebuffer);
-}
-
gl::Error Renderer11::applyVertexBuffer(const gl::State &state,
GLenum mode,
GLint first,
@@ -2014,6 +2012,150 @@ gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data,
return gl::NoError();
}
+bool Renderer11::supportsFastIndirectDraw(const gl::State &state, GLenum mode, GLenum type)
+{
+ const auto &vertexArray = state.getVertexArray();
+ auto *vertexArray11 = GetImplAs<VertexArray11>(vertexArray);
+ // Indirect drawing doesn't support dynamic attribute storage since it needs the first and count
+ // to translate when applyVertexBuffer. GL_LINE_LOOP and GL_TRIANGLE_FAN are not supported
+ // either since we need to simulate them in D3D.
+ if (vertexArray11->hasDynamicAttrib(state) || mode == GL_LINE_LOOP || mode == GL_TRIANGLE_FAN)
+ {
+ return false;
+ }
+
+ if (type != GL_NONE)
+ {
+ gl::Buffer *elementArrayBuffer = vertexArray->getElementArrayBuffer().get();
+ ASSERT(elementArrayBuffer);
+ // Only non-streaming index data can be directly used to do indirect draw since they don't
+ // need the indices and count informations. Here we don't check whether it really has
+ // primitive restart index in it since it also needs to know the index range and count.
+ // So, for all other situations, we fall back to normal draw instead of indirect draw.
+ bool primitiveRestartWorkaround = mIndexDataManager->usePrimitiveRestartWorkaround(
+ state.isPrimitiveRestartEnabled(), type);
+ return !mIndexDataManager->isStreamingIndexData(primitiveRestartWorkaround, type,
+ elementArrayBuffer);
+ }
+ return true;
+}
+
+gl::Error Renderer11::drawArraysIndirectImpl(const gl::ContextState &data,
+ GLenum mode,
+ const GLvoid *indirect)
+{
+ if (skipDraw(data, mode))
+ {
+ return gl::NoError();
+ }
+
+ const auto &glState = data.getState();
+ gl::Buffer *drawIndirectBuffer = glState.getDrawIndirectBuffer();
+ ASSERT(drawIndirectBuffer);
+ Buffer11 *storage = GetImplAs<Buffer11>(drawIndirectBuffer);
+ uintptr_t offset = reinterpret_cast<uintptr_t>(indirect);
+
+ if (supportsFastIndirectDraw(glState, mode, GL_NONE))
+ {
+ applyVertexBuffer(glState, mode, 0, 0, 0, nullptr);
+ ID3D11Buffer *buffer = nullptr;
+ ANGLE_TRY_RESULT(storage->getBuffer(BUFFER_USAGE_INDIRECT), buffer);
+ mDeviceContext->DrawInstancedIndirect(buffer, static_cast<unsigned int>(offset));
+ return gl::NoError();
+ }
+
+ const uint8_t *bufferData = nullptr;
+ ANGLE_TRY(storage->getData(&bufferData));
+ ASSERT(bufferData);
+ const gl::DrawArraysIndirectCommand *args =
+ reinterpret_cast<const gl::DrawArraysIndirectCommand *>(bufferData + offset);
+ GLuint count = args->count;
+ GLuint instances = args->instanceCount;
+ GLuint first = args->first;
+
+ ANGLE_TRY(applyVertexBuffer(glState, mode, first, count, instances, nullptr));
+
+ if (mode == GL_LINE_LOOP)
+ {
+ return drawLineLoop(data, count, GL_NONE, nullptr, 0, instances);
+ }
+ if (mode == GL_TRIANGLE_FAN)
+ {
+ return drawTriangleFan(data, count, GL_NONE, nullptr, 0, instances);
+ }
+
+ mDeviceContext->DrawInstanced(count, instances, 0, 0);
+ return gl::NoError();
+}
+
+gl::Error Renderer11::drawElementsIndirectImpl(const gl::ContextState &data,
+ GLenum mode,
+ GLenum type,
+ const GLvoid *indirect)
+{
+ if (skipDraw(data, mode))
+ {
+ return gl::NoError();
+ }
+
+ const auto &glState = data.getState();
+ gl::Buffer *drawIndirectBuffer = glState.getDrawIndirectBuffer();
+ ASSERT(drawIndirectBuffer);
+ Buffer11 *storage = GetImplAs<Buffer11>(drawIndirectBuffer);
+ uintptr_t offset = reinterpret_cast<uintptr_t>(indirect);
+
+ TranslatedIndexData indexInfo;
+ if (supportsFastIndirectDraw(glState, mode, type))
+ {
+ ANGLE_TRY(applyIndexBuffer(data, nullptr, 0, mode, type, &indexInfo));
+ ANGLE_TRY(applyVertexBuffer(glState, mode, 0, 0, 0, &indexInfo));
+ ID3D11Buffer *buffer = nullptr;
+ ANGLE_TRY_RESULT(storage->getBuffer(BUFFER_USAGE_INDIRECT), buffer);
+ mDeviceContext->DrawIndexedInstancedIndirect(buffer, static_cast<unsigned int>(offset));
+ return gl::NoError();
+ }
+
+ const uint8_t *bufferData = nullptr;
+ ANGLE_TRY(storage->getData(&bufferData));
+ ASSERT(bufferData);
+
+ const gl::DrawElementsIndirectCommand *cmd =
+ reinterpret_cast<const gl::DrawElementsIndirectCommand *>(bufferData + offset);
+ GLuint count = cmd->count;
+ GLuint instances = cmd->primCount;
+ GLuint firstIndex = cmd->firstIndex;
+ GLint baseVertex = cmd->baseVertex;
+
+ const gl::Type &typeInfo = gl::GetTypeInfo(type);
+ uint8_t *indices = static_cast<uint8_t *>(0) + firstIndex * typeInfo.bytes;
+
+ gl::Buffer *elementArrayBuffer = glState.getVertexArray()->getElementArrayBuffer().get();
+ ASSERT(elementArrayBuffer);
+ gl::IndexRange indexRange;
+ ANGLE_TRY(elementArrayBuffer->getIndexRange(type, reinterpret_cast<size_t>(indices), count,
+ glState.isPrimitiveRestartEnabled(), &indexRange));
+
+ indexInfo.indexRange = indexRange;
+ ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
+ size_t vertexCount = indexRange.vertexCount();
+ ANGLE_TRY(applyVertexBuffer(glState, mode, static_cast<GLsizei>(indexRange.start) + baseVertex,
+ static_cast<GLsizei>(vertexCount), instances, &indexInfo));
+
+ int baseVertexLocation = -static_cast<int>(indexRange.start);
+ if (mode == GL_LINE_LOOP)
+ {
+ return drawLineLoop(data, count, type, indices, baseVertexLocation, instances);
+ }
+
+ if (mode == GL_TRIANGLE_FAN)
+ {
+ return drawTriangleFan(data, count, type, indices, baseVertexLocation, instances);
+ }
+
+ mDeviceContext->DrawIndexedInstanced(count, instances, 0, baseVertexLocation, 0);
+ return gl::NoError();
+}
+
gl::Error Renderer11::drawLineLoop(const gl::ContextState &data,
GLsizei count,
GLenum type,
@@ -2717,7 +2859,7 @@ void Renderer11::release()
{
RendererD3D::cleanup();
- mScratchMemoryBuffer.resize(0);
+ mScratchMemoryBuffer.clear();
if (mAnnotator != nullptr)
{
@@ -3143,6 +3285,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
+ GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
@@ -3153,6 +3296,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
TextureStorage *sourceStorage = nullptr;
ANGLE_TRY(const_cast<TextureD3D *>(sourceD3D)->getNativeTexture(&sourceStorage));
+ ASSERT(destTarget == GL_TEXTURE_2D);
TextureStorage11_2D *sourceStorage11 = GetAs<TextureStorage11_2D>(sourceStorage);
ASSERT(sourceStorage11);
@@ -4516,7 +4660,7 @@ gl::Error Renderer11::genericDrawElements(Context11 *context,
return gl::NoError();
}
- ANGLE_TRY(updateState(data, mode));
+ ANGLE_TRY(updateState(context, mode));
TranslatedIndexData indexInfo;
indexInfo.indexRange = indexRange;
@@ -4564,7 +4708,7 @@ gl::Error Renderer11::genericDrawArrays(Context11 *context,
return gl::NoError();
}
- ANGLE_TRY(updateState(data, mode));
+ ANGLE_TRY(updateState(context, mode));
ANGLE_TRY(applyTransformFeedbackBuffers(data));
ANGLE_TRY(applyVertexBuffer(glState, mode, first, count, instances, nullptr));
ANGLE_TRY(applyTextures(context, data));
@@ -4584,38 +4728,51 @@ gl::Error Renderer11::genericDrawArrays(Context11 *context,
return gl::NoError();
}
-FramebufferImpl *Renderer11::createDefaultFramebuffer(const gl::FramebufferState &state)
+gl::Error Renderer11::genericDrawIndirect(Context11 *context,
+ GLenum mode,
+ GLenum type,
+ const GLvoid *indirect)
{
- return new Framebuffer11(state, this);
-}
+ const auto &data = context->getContextState();
+ const auto &glState = data.getState();
+ gl::Program *program = glState.getProgram();
+ ASSERT(program != nullptr);
+ ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program);
+ bool usesPointSize = programD3D->usesPointSize();
+ programD3D->updateSamplerMapping();
-gl::Error Renderer11::getScratchMemoryBuffer(size_t requestedSize, MemoryBuffer **bufferOut)
-{
- if (mScratchMemoryBuffer.size() == requestedSize)
- {
- mScratchMemoryBufferResetCounter = ScratchMemoryBufferLifetime;
- *bufferOut = &mScratchMemoryBuffer;
- return gl::NoError();
- }
+ ANGLE_TRY(generateSwizzles(data));
+ applyPrimitiveType(mode, 0, usesPointSize);
+ ANGLE_TRY(updateState(context, mode));
+ ANGLE_TRY(applyTransformFeedbackBuffers(data));
+ ASSERT(!glState.isTransformFeedbackActiveUnpaused());
+ ANGLE_TRY(applyTextures(context, data));
+ ANGLE_TRY(applyShaders(data, mode));
+ ANGLE_TRY(programD3D->applyUniformBuffers(data));
- if (mScratchMemoryBuffer.size() > requestedSize)
+ if (type == GL_NONE)
{
- mScratchMemoryBufferResetCounter--;
+ ANGLE_TRY(drawArraysIndirectImpl(data, mode, indirect));
}
-
- if (mScratchMemoryBufferResetCounter <= 0 || mScratchMemoryBuffer.size() < requestedSize)
+ else
{
- mScratchMemoryBuffer.resize(0);
- if (!mScratchMemoryBuffer.resize(requestedSize))
- {
- return gl::Error(GL_OUT_OF_MEMORY, "Failed to allocate internal buffer.");
- }
- mScratchMemoryBufferResetCounter = ScratchMemoryBufferLifetime;
+ ANGLE_TRY(drawElementsIndirectImpl(data, mode, type, indirect));
}
- ASSERT(mScratchMemoryBuffer.size() >= requestedSize);
+ return gl::NoError();
+}
- *bufferOut = &mScratchMemoryBuffer;
+FramebufferImpl *Renderer11::createDefaultFramebuffer(const gl::FramebufferState &state)
+{
+ return new Framebuffer11(state, this);
+}
+
+gl::Error Renderer11::getScratchMemoryBuffer(size_t requestedSize, angle::MemoryBuffer **bufferOut)
+{
+ if (!mScratchMemoryBuffer.get(requestedSize, bufferOut))
+ {
+ return gl::OutOfMemory() << "Failed to allocate internal buffer.";
+ }
return gl::NoError();
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
index 6d9fe0ffdd3..5a22348d913 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h
@@ -145,10 +145,9 @@ class Renderer11 : public RendererD3D
const std::vector<GLint> &vertexUniformBuffers,
const std::vector<GLint> &fragmentUniformBuffers) override;
- gl::Error updateState(const gl::ContextState &data, GLenum drawMode);
+ gl::Error updateState(ContextImpl *contextImpl, GLenum drawMode);
bool applyPrimitiveType(GLenum mode, GLsizei count, bool usesPointSize);
- gl::Error applyRenderTarget(gl::Framebuffer *frameBuffer);
gl::Error applyUniforms(const ProgramD3D &programD3D,
GLenum drawMode,
const std::vector<D3DUniform *> &uniformArray) override;
@@ -219,6 +218,7 @@ class Renderer11 : public RendererD3D
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
+ GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
@@ -374,10 +374,15 @@ class Renderer11 : public RendererD3D
GLsizei instances,
const gl::IndexRange &indexRange);
+ gl::Error genericDrawIndirect(Context11 *context,
+ GLenum mode,
+ GLenum type,
+ const GLvoid *indirect);
+
// Necessary hack for default framebuffers in D3D.
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override;
- gl::Error getScratchMemoryBuffer(size_t requestedSize, MemoryBuffer **bufferOut);
+ gl::Error getScratchMemoryBuffer(size_t requestedSize, angle::MemoryBuffer **bufferOut);
gl::Version getMaxSupportedESVersion() const override;
@@ -397,6 +402,16 @@ class Renderer11 : public RendererD3D
GLenum type,
const GLvoid *indices,
GLsizei instances);
+ gl::Error drawArraysIndirectImpl(const gl::ContextState &data,
+ GLenum mode,
+ const GLvoid *indirect);
+ gl::Error drawElementsIndirectImpl(const gl::ContextState &data,
+ GLenum mode,
+ GLenum type,
+ const GLvoid *indirect);
+
+ // Support directly using indirect draw buffer.
+ bool supportsFastIndirectDraw(const gl::State &state, GLenum mode, GLenum type);
void generateCaps(gl::Caps *outCaps,
gl::TextureCapsMap *outTextureCaps,
@@ -574,8 +589,7 @@ class Renderer11 : public RendererD3D
std::vector<GLuint> mScratchIndexDataBuffer;
- MemoryBuffer mScratchMemoryBuffer;
- unsigned int mScratchMemoryBufferResetCounter;
+ angle::ScratchBuffer mScratchMemoryBuffer;
gl::DebugAnnotator *mAnnotator;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
index 4032fbbe630..b427e6fb481 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp
@@ -8,7 +8,7 @@
#include "libANGLE/renderer/d3d/d3d11/StateManager11.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/utilities.h"
#include "libANGLE/Query.h"
#include "libANGLE/VertexArray.h"
@@ -496,7 +496,9 @@ gl::Error StateManager11::setBlendState(const gl::Framebuffer *framebuffer,
}
ID3D11BlendState *dxBlendState = nullptr;
- ANGLE_TRY(mRenderer->getStateCache().getBlendState(framebuffer, blendState, &dxBlendState));
+ const d3d11::BlendStateKey &key = RenderStateCache::GetBlendStateKey(framebuffer, blendState);
+
+ ANGLE_TRY(mRenderer->getStateCache().getBlendState(key, &dxBlendState));
ASSERT(dxBlendState != nullptr);
@@ -550,25 +552,41 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState)
return gl::NoError();
}
- const auto &depthStencilState = glState.getDepthStencilState();
- int stencilRef = glState.getStencilRef();
- int stencilBackRef = glState.getStencilBackRef();
+ mCurDepthStencilState = glState.getDepthStencilState();
+ mCurStencilRef = glState.getStencilRef();
+ mCurStencilBackRef = glState.getStencilBackRef();
+ mCurDisableDepth = disableDepth;
+ mCurDisableStencil = disableStencil;
// get the maximum size of the stencil ref
unsigned int maxStencil = 0;
- if (depthStencilState.stencilTest && mCurStencilSize > 0)
+ if (mCurDepthStencilState.stencilTest && mCurStencilSize > 0)
{
maxStencil = (1 << mCurStencilSize) - 1;
}
- ASSERT((depthStencilState.stencilWritemask & maxStencil) ==
- (depthStencilState.stencilBackWritemask & maxStencil));
- ASSERT(stencilRef == stencilBackRef);
- ASSERT((depthStencilState.stencilMask & maxStencil) ==
- (depthStencilState.stencilBackMask & maxStencil));
+ ASSERT((mCurDepthStencilState.stencilWritemask & maxStencil) ==
+ (mCurDepthStencilState.stencilBackWritemask & maxStencil));
+ ASSERT(mCurStencilRef == mCurStencilBackRef);
+ ASSERT((mCurDepthStencilState.stencilMask & maxStencil) ==
+ (mCurDepthStencilState.stencilBackMask & maxStencil));
ID3D11DepthStencilState *dxDepthStencilState = NULL;
- ANGLE_TRY(mRenderer->getStateCache().getDepthStencilState(
- depthStencilState, disableDepth, disableStencil, &dxDepthStencilState));
+ gl::DepthStencilState dsStateKey = glState.getDepthStencilState();
+
+ if (disableDepth)
+ {
+ dsStateKey.depthTest = false;
+ dsStateKey.depthMask = false;
+ }
+
+ if (disableStencil)
+ {
+ dsStateKey.stencilWritemask = 0;
+ dsStateKey.stencilBackWritemask = 0;
+ dsStateKey.stencilTest = false;
+ }
+
+ ANGLE_TRY(mRenderer->getStateCache().getDepthStencilState(dsStateKey, &dxDepthStencilState));
ASSERT(dxDepthStencilState);
@@ -580,16 +598,10 @@ gl::Error StateManager11::setDepthStencilState(const gl::State &glState)
"Unexpected value of D3D11_DEFAULT_STENCIL_READ_MASK");
static_assert(D3D11_DEFAULT_STENCIL_WRITE_MASK == 0xFF,
"Unexpected value of D3D11_DEFAULT_STENCIL_WRITE_MASK");
- UINT dxStencilRef = std::min<UINT>(stencilRef, 0xFFu);
+ UINT dxStencilRef = std::min<UINT>(mCurStencilRef, 0xFFu);
mRenderer->getDeviceContext()->OMSetDepthStencilState(dxDepthStencilState, dxStencilRef);
- mCurDepthStencilState = depthStencilState;
- mCurStencilRef = stencilRef;
- mCurStencilBackRef = stencilBackRef;
- mCurDisableDepth = disableDepth;
- mCurDisableStencil = disableStencil;
-
mDepthStencilStateIsDirty = false;
return gl::NoError();
@@ -803,21 +815,18 @@ void StateManager11::invalidateEverything()
invalidateBoundViews();
}
-void StateManager11::setOneTimeRenderTarget(ID3D11RenderTargetView *renderTarget,
- ID3D11DepthStencilView *depthStencil)
+void StateManager11::setOneTimeRenderTarget(ID3D11RenderTargetView *rtv,
+ ID3D11DepthStencilView *dsv)
{
- mRenderer->getDeviceContext()->OMSetRenderTargets(1, &renderTarget, depthStencil);
+ mRenderer->getDeviceContext()->OMSetRenderTargets(1, &rtv, dsv);
mRenderTargetIsDirty = true;
}
-void StateManager11::setOneTimeRenderTargets(
- const std::vector<ID3D11RenderTargetView *> &renderTargets,
- ID3D11DepthStencilView *depthStencil)
+void StateManager11::setOneTimeRenderTargets(ID3D11RenderTargetView **rtvs,
+ UINT numRtvs,
+ ID3D11DepthStencilView *dsv)
{
- UINT count = static_cast<UINT>(renderTargets.size());
- auto renderTargetPointer = (!renderTargets.empty() ? renderTargets.data() : nullptr);
-
- mRenderer->getDeviceContext()->OMSetRenderTargets(count, renderTargetPointer, depthStencil);
+ mRenderer->getDeviceContext()->OMSetRenderTargets(numRtvs, (numRtvs > 0) ? rtvs : nullptr, dsv);
mRenderTargetIsDirty = true;
}
@@ -971,7 +980,7 @@ void StateManager11::deinitialize()
mCurrentValueAttribs.clear();
}
-gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer)
+gl::Error StateManager11::syncFramebuffer(ContextImpl *contextImpl, gl::Framebuffer *framebuffer)
{
Framebuffer11 *framebuffer11 = GetImplAs<Framebuffer11>(framebuffer);
ANGLE_TRY(framebuffer11->markAttachmentsDirty());
@@ -979,7 +988,7 @@ gl::Error StateManager11::syncFramebuffer(gl::Framebuffer *framebuffer)
if (framebuffer11->hasAnyInternalDirtyBit())
{
ASSERT(framebuffer->id() != 0);
- framebuffer11->syncInternalState();
+ framebuffer11->syncInternalState(contextImpl);
}
if (!mRenderTargetIsDirty)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.h
index 771eb439fd1..8de838b33be 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.h
@@ -77,16 +77,16 @@ class StateManager11 final : angle::NonCopyable
ID3D11ShaderResourceView *srv);
gl::Error clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd);
- gl::Error syncFramebuffer(gl::Framebuffer *framebuffer);
+ gl::Error syncFramebuffer(ContextImpl *contextImpl, gl::Framebuffer *framebuffer);
void invalidateRenderTarget();
void invalidateBoundViews();
void invalidateEverything();
- void setOneTimeRenderTarget(ID3D11RenderTargetView *renderTarget,
- ID3D11DepthStencilView *depthStencil);
- void setOneTimeRenderTargets(const std::vector<ID3D11RenderTargetView *> &renderTargets,
- ID3D11DepthStencilView *depthStencil);
+ void setOneTimeRenderTarget(ID3D11RenderTargetView *rtv, ID3D11DepthStencilView *dsv);
+ void setOneTimeRenderTargets(ID3D11RenderTargetView **rtvs,
+ UINT numRtvs,
+ ID3D11DepthStencilView *dsv);
void onBeginQuery(Query11 *query);
void onDeleteQueryObject(Query11 *query);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
index 3b54fa3613b..56ee920297e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp
@@ -33,6 +33,12 @@ namespace rx
namespace
{
+// To avoid overflow in QPC to Microseconds calculations, since we multiply
+// by kMicrosecondsPerSecond, then the QPC value should not exceed
+// (2^63 - 1) / 1E6. If it exceeds that threshold, we divide then multiply.
+static constexpr int64_t kQPCOverflowThreshold = 0x8637BD05AF7;
+static constexpr int64_t kMicrosecondsPerSecond = 1000000;
+
bool NeedsOffscreenTexture(Renderer11 *renderer, NativeWindow11 *nativeWindow, EGLint orientation)
{
// We don't need an offscreen texture if either orientation = INVERT_Y,
@@ -83,6 +89,13 @@ SwapChain11::SwapChain11(Renderer11 *renderer,
{
// Sanity check that if present path fast is active then we're using the default orientation
ASSERT(!mRenderer->presentPathFastEnabled() || orientation == 0);
+
+ // Get the performance counter
+ LARGE_INTEGER counterFreqency = {};
+ BOOL success = QueryPerformanceFrequency(&counterFreqency);
+ ASSERT(success);
+
+ mQPCFrequency = counterFreqency.QuadPart;
}
SwapChain11::~SwapChain11()
@@ -892,4 +905,46 @@ void SwapChain11::recreate()
// possibly should use this method instead of reset
}
+egl::Error SwapChain11::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
+{
+ if (!mSwapChain)
+ {
+ return egl::Error(EGL_NOT_INITIALIZED, "Swap chain uninitialized");
+ }
+
+ DXGI_FRAME_STATISTICS stats = {};
+ HRESULT result = mSwapChain->GetFrameStatistics(&stats);
+
+ if (FAILED(result))
+ {
+ return egl::Error(EGL_BAD_ALLOC, "Failed to get frame statistics, result: 0x%X", result);
+ }
+
+ // Conversion from DXGI_FRAME_STATISTICS to the output values:
+ // stats.SyncRefreshCount -> msc
+ // stats.PresentCount -> sbc
+ // stats.SyncQPCTime -> ust with conversion to microseconds via QueryPerformanceFrequency
+ *msc = stats.SyncRefreshCount;
+ *sbc = stats.PresentCount;
+
+ LONGLONG syncQPCValue = stats.SyncQPCTime.QuadPart;
+ // If the QPC Value is below the overflow threshold, we proceed with
+ // simple multiply and divide.
+ if (syncQPCValue < kQPCOverflowThreshold)
+ {
+ *ust = syncQPCValue * kMicrosecondsPerSecond / mQPCFrequency;
+ }
+ else
+ {
+ // Otherwise, calculate microseconds in a round about manner to avoid
+ // overflow and precision issues.
+ int64_t wholeSeconds = syncQPCValue / mQPCFrequency;
+ int64_t leftoverTicks = syncQPCValue - (wholeSeconds * mQPCFrequency);
+ *ust = wholeSeconds * kMicrosecondsPerSecond +
+ leftoverTicks * kMicrosecondsPerSecond / mQPCFrequency;
+ }
+
+ return egl::Error(EGL_SUCCESS);
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h
index 1d7e57b7cb2..6eb721f5404 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h
@@ -50,6 +50,8 @@ class SwapChain11 final : public SwapChainD3D
EGLint getHeight() const { return mHeight; }
void *getKeyedMutex() override { return mKeyedMutex; }
+ egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
+
private:
void release();
void initPassThroughResources();
@@ -102,6 +104,8 @@ class SwapChain11 final : public SwapChainD3D
SurfaceRenderTarget11 mColorRenderTarget;
SurfaceRenderTarget11 mDepthStencilRenderTarget;
+
+ LONGLONG mQPCFrequency;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
index 3afa02edb11..2a4906d8ef2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp
@@ -654,7 +654,7 @@ gl::Error TextureStorage11::setData(const gl::ImageIndex &index,
UINT bufferDepthPitch = bufferRowPitch * height;
const size_t neededSize = bufferDepthPitch * depth;
- MemoryBuffer *conversionBuffer = nullptr;
+ angle::MemoryBuffer *conversionBuffer = nullptr;
const uint8_t *data = nullptr;
LoadImageFunctionInfo loadFunctionInfo = d3d11Format.getLoadFunctions()(type);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp
index 4bfb1857044..7a7f2a0cf13 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp
@@ -9,7 +9,7 @@
#include "libANGLE/renderer/d3d/d3d11/VertexArray11.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "libANGLE/renderer/d3d/d3d11/Buffer11.h"
using namespace angle;
@@ -25,7 +25,7 @@ VertexArray11::VertexArray11(const gl::VertexArrayState &data)
{
for (size_t attribIndex = 0; attribIndex < mCurrentBuffers.size(); ++attribIndex)
{
- mOnBufferDataDirty.emplace_back(this, static_cast<SignalToken>(attribIndex));
+ mOnBufferDataDirty.emplace_back(this, static_cast<uint32_t>(attribIndex));
}
}
@@ -40,7 +40,7 @@ VertexArray11::~VertexArray11()
}
}
-void VertexArray11::syncState(const gl::VertexArray::DirtyBits &dirtyBits)
+void VertexArray11::syncState(ContextImpl *contextImpl, const gl::VertexArray::DirtyBits &dirtyBits)
{
for (auto dirtyBit : angle::IterateBitSet(dirtyBits))
{
@@ -54,6 +54,24 @@ void VertexArray11::syncState(const gl::VertexArray::DirtyBits &dirtyBits)
}
}
+void VertexArray11::flushAttribUpdates(const gl::State &state)
+{
+ const gl::Program *program = state.getProgram();
+ const auto &activeLocations = program->getActiveAttribLocationsMask();
+
+ if (mAttribsToUpdate.any())
+ {
+ // Skip attrib locations the program doesn't use.
+ const auto &activeToUpdate = (mAttribsToUpdate & activeLocations);
+
+ for (auto toUpdateIndex : angle::IterateBitSet(activeToUpdate))
+ {
+ mAttribsToUpdate.reset(toUpdateIndex);
+ updateVertexAttribStorage(toUpdateIndex);
+ }
+ }
+}
+
void VertexArray11::updateVertexAttribStorage(size_t attribIndex)
{
const auto &attrib = mData.getVertexAttribute(attribIndex);
@@ -94,7 +112,7 @@ void VertexArray11::updateVertexAttribStorage(size_t attribIndex)
{
// Note that for static callbacks, promotion to a static buffer from a dynamic buffer means
// we need to tag dynamic buffers with static callbacks.
- BroadcastChannel *newChannel = nullptr;
+ BroadcastChannel<> *newChannel = nullptr;
if (newBuffer11 != nullptr)
{
switch (newStorageType)
@@ -115,29 +133,24 @@ void VertexArray11::updateVertexAttribStorage(size_t attribIndex)
}
}
+bool VertexArray11::hasDynamicAttrib(const gl::State &state)
+{
+ flushAttribUpdates(state);
+ return mDynamicAttribsMask.any();
+}
+
gl::Error VertexArray11::updateDirtyAndDynamicAttribs(VertexDataManager *vertexDataManager,
const gl::State &state,
GLint start,
GLsizei count,
GLsizei instances)
{
+ flushAttribUpdates(state);
+
const gl::Program *program = state.getProgram();
const auto &activeLocations = program->getActiveAttribLocationsMask();
-
- if (mAttribsToUpdate.any())
- {
- // Skip attrib locations the program doesn't use.
- const auto &activeToUpdate = (mAttribsToUpdate & activeLocations);
-
- for (auto toUpdateIndex : angle::IterateBitSet(activeToUpdate))
- {
- mAttribsToUpdate.reset(toUpdateIndex);
- updateVertexAttribStorage(toUpdateIndex);
- }
- }
-
- const auto &attribs = mData.getVertexAttributes();
- const auto &bindings = mData.getVertexBindings();
+ const auto &attribs = mData.getVertexAttributes();
+ const auto &bindings = mData.getVertexBindings();
if (mAttribsToTranslate.any())
{
@@ -153,8 +166,8 @@ gl::Error VertexArray11::updateDirtyAndDynamicAttribs(VertexDataManager *vertexD
state.getVertexAttribCurrentValue(static_cast<unsigned int>(dirtyAttribIndex));
// Record basic attrib info
- translatedAttrib->attribute = &attribs[dirtyAttribIndex];
- translatedAttrib->binding = &bindings[translatedAttrib->attribute->bindingIndex];
+ translatedAttrib->attribute = &attribs[dirtyAttribIndex];
+ translatedAttrib->binding = &bindings[translatedAttrib->attribute->bindingIndex];
translatedAttrib->currentValueType = currentValue.Type;
translatedAttrib->divisor = translatedAttrib->binding->divisor;
@@ -207,12 +220,12 @@ const std::vector<TranslatedAttribute> &VertexArray11::getTranslatedAttribs() co
return mTranslatedAttribs;
}
-void VertexArray11::signal(SignalToken token)
+void VertexArray11::signal(uint32_t channelID)
{
- ASSERT(mAttributeStorageTypes[token] != VertexStorageType::CURRENT_VALUE);
+ ASSERT(mAttributeStorageTypes[channelID] != VertexStorageType::CURRENT_VALUE);
// This can change a buffer's storage, we'll need to re-check.
- mAttribsToUpdate.set(token);
+ mAttribsToUpdate.set(channelID);
}
void VertexArray11::clearDirtyAndPromoteDynamicAttribs(const gl::State &state, GLsizei count)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h
index eb0e0595d5f..0f73853ce5c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h
@@ -9,6 +9,7 @@
#ifndef LIBANGLE_RENDERER_D3D_D3D11_VERTEXARRAY11_H_
#define LIBANGLE_RENDERER_D3D_D3D11_VERTEXARRAY11_H_
+#include "libANGLE/Framebuffer.h"
#include "libANGLE/renderer/VertexArrayImpl.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/signal_utils.h"
@@ -17,13 +18,15 @@ namespace rx
{
class Renderer11;
-class VertexArray11 : public VertexArrayImpl, public angle::SignalReceiver
+class VertexArray11 : public VertexArrayImpl, public angle::SignalReceiver<>
{
public:
VertexArray11(const gl::VertexArrayState &data);
~VertexArray11() override;
- void syncState(const gl::VertexArray::DirtyBits &dirtyBits) override;
+ void syncState(ContextImpl *contextImpl, const gl::VertexArray::DirtyBits &dirtyBits) override;
+ // This will flush any pending attrib updates and then check the dynamic attribs mask.
+ bool hasDynamicAttrib(const gl::State &state);
gl::Error updateDirtyAndDynamicAttribs(VertexDataManager *vertexDataManager,
const gl::State &state,
GLint start,
@@ -34,10 +37,11 @@ class VertexArray11 : public VertexArrayImpl, public angle::SignalReceiver
const std::vector<TranslatedAttribute> &getTranslatedAttribs() const;
// SignalReceiver implementation
- void signal(angle::SignalToken token) override;
+ void signal(uint32_t channelID) override;
private:
void updateVertexAttribStorage(size_t attribIndex);
+ void flushAttribUpdates(const gl::State &state);
std::vector<VertexStorageType> mAttributeStorageTypes;
std::vector<TranslatedAttribute> mTranslatedAttribs;
@@ -54,7 +58,7 @@ class VertexArray11 : public VertexArrayImpl, public angle::SignalReceiver
// We need to keep a safe pointer to the Buffer so we can attach the correct dirty callbacks.
std::vector<BindingPointer<gl::Buffer>> mCurrentBuffers;
- std::vector<angle::ChannelBinding> mOnBufferDataDirty;
+ std::vector<gl::OnAttachmentDirtyBinding> mOnBufferDataDirty;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
index ab04dfd3092..0be470333a2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp
@@ -1224,8 +1224,14 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
static_cast<GLuint>(GetMaximumVertexOutputVectors(featureLevel)) * 4;
caps->maxVertexTextureImageUnits =
static_cast<GLuint>(GetMaximumVertexTextureUnits(featureLevel));
- // Vertex Attrib Bindings not supported.
+
+ // Vertex Attribute Bindings are emulated on D3D11.
caps->maxVertexAttribBindings = caps->maxVertexAttributes;
+ // Experimental testing confirmed there is no explicit limit on maximum buffer offset in D3D11.
+ caps->maxVertexAttribRelativeOffset = std::numeric_limits<GLint>::max();
+ // Experimental testing confirmed 2048 is the maximum stride that D3D11 can support on all
+ // platforms.
+ caps->maxVertexAttribStride = 2048;
// Fragment shader limits
caps->maxFragmentUniformComponents =
@@ -1256,6 +1262,9 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
caps->maxUniformBufferBindings = caps->maxVertexUniformBlocks + caps->maxFragmentUniformBlocks;
caps->maxUniformBlockSize = GetMaximumConstantBufferSize(featureLevel);
+ // TODO(oetuaho): Get a more accurate limit. For now using the minimum requirement for GLES 3.1.
+ caps->maxUniformLocations = 1024;
+
// With DirectX 11.1, constant buffer offset and size must be a multiple of 16 constants of 16 bytes each.
// https://msdn.microsoft.com/en-us/library/windows/desktop/hh404649%28v=vs.85%29.aspx
// With DirectX 11.0, we emulate UBO offsets using copies of ranges of the UBO however
@@ -1690,6 +1699,29 @@ D3D11_QUERY ConvertQueryType(GLenum queryType)
}
}
+// Get the D3D11 write mask covering all color channels of a given format
+UINT8 GetColorMask(const gl::InternalFormat *formatInfo)
+{
+ UINT8 mask = 0;
+ if (formatInfo->redBits > 0)
+ {
+ mask |= D3D11_COLOR_WRITE_ENABLE_RED;
+ }
+ if (formatInfo->greenBits > 0)
+ {
+ mask |= D3D11_COLOR_WRITE_ENABLE_GREEN;
+ }
+ if (formatInfo->blueBits > 0)
+ {
+ mask |= D3D11_COLOR_WRITE_ENABLE_BLUE;
+ }
+ if (formatInfo->alphaBits > 0)
+ {
+ mask |= D3D11_COLOR_WRITE_ENABLE_ALPHA;
+ }
+ return mask;
+}
+
} // namespace gl_d3d11
namespace d3d11
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
index 95ebdee3546..f05d5ef8196 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h
@@ -55,6 +55,8 @@ UINT ConvertMaxAnisotropy(float maxAnisotropy, D3D_FEATURE_LEVEL featureLevel);
D3D11_QUERY ConvertQueryType(GLenum queryType);
+UINT8 GetColorMask(const gl::InternalFormat *formatInfo);
+
} // namespace gl_d3d11
namespace d3d11_gl
@@ -132,6 +134,13 @@ void SetPositionDepthColorVertex(PositionDepthColorVertex<T>* vertex, float x, f
vertex->a = color.alpha;
}
+struct BlendStateKey
+{
+ gl::BlendState blendState;
+ bool mrt;
+ uint8_t rtvMasks[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT];
+};
+
HRESULT SetDebugName(ID3D11DeviceChild *resource, const char *name);
template <typename T>
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json
index 278217dcdf9..932214e9d32 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_map.json
@@ -45,6 +45,10 @@
"GL_DEPTH_COMPONENT32_OES": "D24_UNORM_S8_UINT",
"GL_ETC1_RGB8_OES": "R8G8B8A8_UNORM",
"GL_ETC1_RGB8_LOSSY_DECODE_ANGLE": "BC1_RGB_UNORM_BLOCK",
+ "GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE": "BC1_RGB_UNORM_BLOCK",
+ "GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE": "BC1_RGB_UNORM_SRGB_BLOCK",
+ "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE": "BC1_RGBA_UNORM_BLOCK",
+ "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE": "BC1_RGBA_UNORM_SRGB_BLOCK",
"GL_LUMINANCE16F_EXT": "R16G16B16A16_FLOAT",
"GL_LUMINANCE32F_EXT": "R32G32B32A32_FLOAT",
"GL_LUMINANCE8_ALPHA8_EXT": "R8G8B8A8_UNORM",
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp
index f7034ecfe90..3ab33376010 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/texture_format_table_autogen.cpp
@@ -195,6 +195,19 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>);
return info;
}
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ static constexpr Format info(GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE,
+ angle::Format::ID::BC1_RGB_UNORM_BLOCK,
+ DXGI_FORMAT_BC1_UNORM,
+ DXGI_FORMAT_BC1_UNORM,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_BC1_UNORM,
+ GL_RGBA8,
+ nullptr);
+ return info;
+ }
case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
{
static constexpr Format info(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,
@@ -208,6 +221,19 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>);
return info;
}
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ static constexpr Format info(GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE,
+ angle::Format::ID::BC1_RGBA_UNORM_BLOCK,
+ DXGI_FORMAT_BC1_UNORM,
+ DXGI_FORMAT_BC1_UNORM,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_BC1_UNORM,
+ GL_RGBA8,
+ nullptr);
+ return info;
+ }
case GL_COMPRESSED_RGBA8_ETC2_EAC:
{
static constexpr Format info(GL_COMPRESSED_RGBA8_ETC2_EAC,
@@ -689,6 +715,19 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
Initialize4ComponentData<GLubyte, 0x00, 0x00, 0x00, 0xFF>);
return info;
}
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ static constexpr Format info(GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE,
+ angle::Format::ID::BC1_RGB_UNORM_SRGB_BLOCK,
+ DXGI_FORMAT_BC1_UNORM_SRGB,
+ DXGI_FORMAT_BC1_UNORM_SRGB,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_BC1_UNORM_SRGB,
+ GL_RGBA8,
+ nullptr);
+ return info;
+ }
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
{
static constexpr Format info(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,
@@ -702,6 +741,19 @@ const Format &Format::Get(GLenum internalFormat, const Renderer11DeviceCaps &dev
nullptr);
return info;
}
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ static constexpr Format info(GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE,
+ angle::Format::ID::BC1_RGBA_UNORM_SRGB_BLOCK,
+ DXGI_FORMAT_BC1_UNORM_SRGB,
+ DXGI_FORMAT_BC1_UNORM_SRGB,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_UNKNOWN,
+ DXGI_FORMAT_BC1_UNORM_SRGB,
+ GL_RGBA8,
+ nullptr);
+ return info;
+ }
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
{
static constexpr Format info(GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
index 08f00a65e23..43c81c3ac3e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp
@@ -220,8 +220,8 @@ gl::Error Blit9::boxFilter(IDirect3DSurface9 *source, IDirect3DSurface9 *dest)
device->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
device->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
- setViewportAndShaderConstants(getSurfaceRect(dest), getSurfaceSize(source), gl::Offset(0, 0, 0),
- false);
+ setViewportAndShaderConstants(getSurfaceRect(source), getSurfaceSize(source),
+ getSurfaceRect(dest), false);
render();
@@ -442,7 +442,13 @@ gl::Error Blit9::formatConvert(IDirect3DBaseTexture9 *source,
device->SetTexture(0, source);
device->SetRenderTarget(0, dest);
- setViewportAndShaderConstants(sourceRect, sourceSize, destOffset, flipY);
+ RECT destRect;
+ destRect.left = destOffset.x;
+ destRect.right = destOffset.x + (sourceRect.right - sourceRect.left);
+ destRect.top = destOffset.y;
+ destRect.bottom = destOffset.y + (sourceRect.bottom - sourceRect.top);
+
+ setViewportAndShaderConstants(sourceRect, sourceSize, destRect, flipY);
setCommonBlitState();
@@ -653,16 +659,16 @@ gl::Error Blit9::copySurfaceToTexture(IDirect3DSurface9 *surface,
void Blit9::setViewportAndShaderConstants(const RECT &sourceRect,
const gl::Extents &sourceSize,
- const gl::Offset &offset,
+ const RECT &destRect,
bool flipY)
{
IDirect3DDevice9 *device = mRenderer->getDevice();
D3DVIEWPORT9 vp;
- vp.X = offset.x;
- vp.Y = offset.y;
- vp.Width = sourceRect.right - sourceRect.left;
- vp.Height = sourceRect.bottom - sourceRect.top;
+ vp.X = destRect.left;
+ vp.Y = destRect.top;
+ vp.Width = destRect.right - destRect.left;
+ vp.Height = destRect.bottom - destRect.top;
vp.MinZ = 0.0f;
vp.MaxZ = 1.0f;
device->SetViewport(&vp);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.h
index b8e07c32a4e..65fbcf4b38b 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.h
@@ -99,7 +99,7 @@ class Blit9 : angle::NonCopyable
IDirect3DBaseTexture9 **outTexture);
void setViewportAndShaderConstants(const RECT &sourceRect,
const gl::Extents &sourceSize,
- const gl::Offset &offset,
+ const RECT &destRect,
bool flipY);
void setCommonBlitState();
RECT getSurfaceRect(IDirect3DSurface9 *surface) const;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
index ddb0d7b5bc8..a8c0cb24308 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.h
@@ -54,7 +54,7 @@ class Buffer9 : public BufferD3D
gl::Error markTransformFeedbackUsage() override;
private:
- MemoryBuffer mMemory;
+ angle::MemoryBuffer mMemory;
size_t mSize;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
index 3933aac8b8a..77700c0e1f2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.cpp
@@ -267,4 +267,10 @@ const gl::Limitations &Context9::getNativeLimitations() const
return mRenderer->getNativeLimitations();
}
+gl::Error Context9::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
+{
+ UNREACHABLE();
+ return gl::InternalError() << "D3D9 doesn't support ES 3.1 DispatchCompute API";
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.h
index 9670cf31da8..d55b2c117ac 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.h
@@ -119,6 +119,8 @@ class Context9 : public ContextImpl
const gl::Extensions &getNativeExtensions() const override;
const gl::Limitations &getNativeLimitations() const override;
+ gl::Error dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ) override;
+
private:
Renderer9 *mRenderer;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
index a7597079969..54d43e7930c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp
@@ -1000,7 +1000,7 @@ gl::Error Renderer9::updateState(Context9 *context, GLenum drawMode)
// Applies the render target surface, depth stencil surface, viewport rectangle and
// scissor rectangle to the renderer
gl::Framebuffer *framebuffer = glState.getDrawFramebuffer();
- ASSERT(framebuffer && !framebuffer->hasAnyDirtyBit() && framebuffer->complete(data));
+ ASSERT(framebuffer && !framebuffer->hasAnyDirtyBit() && framebuffer->cachedComplete());
ANGLE_TRY(applyRenderTarget(context, framebuffer));
@@ -2463,11 +2463,14 @@ gl::Error Renderer9::copyTexture(const gl::Texture *source,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
+ GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha)
{
+ ASSERT(destTarget == GL_TEXTURE_2D);
+
RECT rect;
rect.left = sourceRect.x;
rect.top = sourceRect.y;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h
index db6bd2228f5..9fc01d801c4 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h
@@ -216,6 +216,7 @@ class Renderer9 : public RendererD3D
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
+ GLenum destTarget,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp
index 17ece725d2f..1291899dd3f 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/StateManager9.cpp
@@ -7,7 +7,7 @@
// StateManager9.cpp: Defines a class for caching D3D9 state
#include "libANGLE/renderer/d3d/d3d9/StateManager9.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/utilities.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/d3d9/renderer9_utils.h"
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
index abf4846fde1..093070838dd 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp
@@ -410,6 +410,12 @@ void *SwapChain9::getKeyedMutex()
return nullptr;
}
+egl::Error SwapChain9::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
+{
+ UNREACHABLE();
+ return egl::Error(EGL_BAD_SURFACE);
+}
+
void SwapChain9::recreate()
{
if (!mSwapChain)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h
index 2e5cce1dbb8..11fde1a5403 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h
@@ -47,6 +47,8 @@ class SwapChain9 : public SwapChainD3D
void *getKeyedMutex() override;
+ egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
+
private:
void release();
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp
index 413fa1ea0f6..8bd4a3cbed0 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp
@@ -428,7 +428,10 @@ gl::Error BlitGL::blitColorBufferWithShader(const gl::Framebuffer *source,
}
gl::Error BlitGL::copySubTexture(TextureGL *source,
+ size_t sourceLevel,
TextureGL *dest,
+ GLenum destTarget,
+ size_t destLevel,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
@@ -464,6 +467,7 @@ gl::Error BlitGL::copySubTexture(TextureGL *source,
}
source->setMinFilter(GL_NEAREST);
source->setMagFilter(GL_NEAREST);
+ source->setBaseLevel(static_cast<GLuint>(sourceLevel));
// Render to the destination texture, sampling from the source texture
ScopedGLState scopedState(
@@ -500,8 +504,8 @@ gl::Error BlitGL::copySubTexture(TextureGL *source,
}
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mScratchFBO);
- mFunctions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, dest->getTarget(),
- dest->getTextureID(), 0);
+ mFunctions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, destTarget,
+ dest->getTextureID(), static_cast<GLint>(destLevel));
mStateManager->bindVertexArray(mVAO, 0);
mFunctions->drawArrays(GL_TRIANGLES, 0, 3);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h
index ea5c9fe1690..3d3a8dee3a8 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h
@@ -61,7 +61,10 @@ class BlitGL : public angle::NonCopyable
GLenum filter);
gl::Error copySubTexture(TextureGL *source,
+ size_t sourceLevel,
TextureGL *dest,
+ GLenum destTarget,
+ size_t destLevel,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/BufferGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/BufferGL.h
index 2651ff10943..5bc62bc55cb 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/BufferGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/BufferGL.h
@@ -63,7 +63,7 @@ class BufferGL : public BufferImpl
size_t mMapSize;
bool mShadowBufferData;
- MemoryBuffer mShadowCopy;
+ angle::MemoryBuffer mShadowCopy;
size_t mBufferSize;
@@ -73,6 +73,6 @@ class BufferGL : public BufferImpl
GLuint mBufferID;
};
-}
+} // namespace rx
#endif // LIBANGLE_RENDERER_GL_BUFFERGL_H_
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp
index ffa4ba8b37b..0e5c14c6296 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp
@@ -384,4 +384,9 @@ const WorkaroundsGL &ContextGL::getWorkaroundsGL() const
return mRenderer->getWorkarounds();
}
+gl::Error ContextGL::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
+{
+ return mRenderer->dispatchCompute(mState, numGroupsX, numGroupsY, numGroupsZ);
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h
index 16e5a6d365f..d95780b884b 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h
@@ -176,6 +176,8 @@ class ContextGL : public ContextImpl
StateManagerGL *getStateManager();
const WorkaroundsGL &getWorkaroundsGL() const;
+ gl::Error dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ) override;
+
private:
RendererGL *mRenderer;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp
index a4b4ccd3081..e586082e5d6 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp
@@ -8,7 +8,7 @@
#include "libANGLE/renderer/gl/FramebufferGL.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/debug.h"
#include "libANGLE/ContextState.h"
#include "libANGLE/State.h"
@@ -135,16 +135,26 @@ Error FramebufferGL::discard(size_t count, const GLenum *attachments)
Error FramebufferGL::invalidate(size_t count, const GLenum *attachments)
{
+ const GLenum *finalAttachmentsPtr = attachments;
+
+ std::vector<GLenum> modifiedAttachments;
+ if (modifyInvalidateAttachmentsForEmulatedDefaultFBO(count, attachments, &modifiedAttachments))
+ {
+ finalAttachmentsPtr = modifiedAttachments.data();
+ }
+
// Since this function is just a hint, only call a native function if it exists.
if (mFunctions->invalidateFramebuffer)
{
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count), attachments);
+ mFunctions->invalidateFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count),
+ finalAttachmentsPtr);
}
else if (mFunctions->discardFramebuffer)
{
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctions->discardFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count), attachments);
+ mFunctions->discardFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count),
+ finalAttachmentsPtr);
}
return gl::NoError();
@@ -154,12 +164,22 @@ Error FramebufferGL::invalidateSub(size_t count,
const GLenum *attachments,
const gl::Rectangle &area)
{
+
+ const GLenum *finalAttachmentsPtr = attachments;
+
+ std::vector<GLenum> modifiedAttachments;
+ if (modifyInvalidateAttachmentsForEmulatedDefaultFBO(count, attachments, &modifiedAttachments))
+ {
+ finalAttachmentsPtr = modifiedAttachments.data();
+ }
+
// Since this function is just a hint and not available until OpenGL 4.3, only call it if it is available.
if (mFunctions->invalidateSubFramebuffer)
{
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctions->invalidateSubFramebuffer(GL_FRAMEBUFFER, static_cast<GLsizei>(count),
- attachments, area.x, area.y, area.width, area.height);
+ finalAttachmentsPtr, area.x, area.y, area.width,
+ area.height);
}
return NoError();
@@ -387,7 +407,7 @@ bool FramebufferGL::checkStatus() const
return (status == GL_FRAMEBUFFER_COMPLETE);
}
-void FramebufferGL::syncState(const Framebuffer::DirtyBits &dirtyBits)
+void FramebufferGL::syncState(ContextImpl *contextImpl, const Framebuffer::DirtyBits &dirtyBits)
{
// Don't need to sync state for the default FBO.
if (mIsDefault)
@@ -520,6 +540,44 @@ void FramebufferGL::syncClearBufferState(ContextImpl *context, GLenum buffer, GL
}
}
}
+
+bool FramebufferGL::modifyInvalidateAttachmentsForEmulatedDefaultFBO(
+ size_t count,
+ const GLenum *attachments,
+ std::vector<GLenum> *modifiedAttachments) const
+{
+ bool needsModification = mIsDefault && mFramebufferID != 0;
+ if (!needsModification)
+ {
+ return false;
+ }
+
+ modifiedAttachments->resize(count);
+ for (size_t i = 0; i < count; i++)
+ {
+ switch (attachments[i])
+ {
+ case GL_COLOR:
+ (*modifiedAttachments)[i] = GL_COLOR_ATTACHMENT0;
+ break;
+
+ case GL_DEPTH:
+ (*modifiedAttachments)[i] = GL_DEPTH_ATTACHMENT;
+ break;
+
+ case GL_STENCIL:
+ (*modifiedAttachments)[i] = GL_STENCIL_ATTACHMENT;
+ break;
+
+ default:
+ UNREACHABLE();
+ break;
+ }
+ }
+
+ return true;
+}
+
gl::Error FramebufferGL::readPixelsRowByRowWorkaround(const gl::Rectangle &area,
GLenum format,
GLenum type,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h
index 6fc8554b09a..31d13d680c5 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h
@@ -80,7 +80,7 @@ class FramebufferGL : public FramebufferImpl
bool checkStatus() const override;
- void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override;
+ void syncState(ContextImpl *contextImpl, const gl::Framebuffer::DirtyBits &dirtyBits) override;
GLuint getFramebufferID() const;
bool isDefault() const;
@@ -89,6 +89,11 @@ class FramebufferGL : public FramebufferImpl
void syncClearState(ContextImpl *context, GLbitfield mask);
void syncClearBufferState(ContextImpl *context, GLenum buffer, GLint drawBuffer);
+ bool modifyInvalidateAttachmentsForEmulatedDefaultFBO(
+ size_t count,
+ const GLenum *attachments,
+ std::vector<GLenum> *modifiedAttachments) const;
+
gl::Error readPixelsRowByRowWorkaround(const gl::Rectangle &area,
GLenum format,
GLenum type,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp
index acbed580d59..124c0e55be2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp
@@ -8,7 +8,7 @@
#include "libANGLE/renderer/gl/ProgramGL.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/angleutils.h"
#include "common/debug.h"
#include "common/string_utils.h"
@@ -111,6 +111,11 @@ void ProgramGL::setBinaryRetrievableHint(bool retrievable)
}
}
+void ProgramGL::setSeparable(bool separable)
+{
+ mFunctions->programParameteri(mProgramID, GL_PROGRAM_SEPARABLE, separable ? GL_TRUE : GL_FALSE);
+}
+
LinkResult ProgramGL::link(ContextImpl *contextImpl,
const gl::VaryingPacking &packing,
gl::InfoLog &infoLog)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h
index 0658c3cf7ca..fa5a7c4ce1e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h
@@ -36,6 +36,7 @@ class ProgramGL : public ProgramImpl
gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override;
+ void setSeparable(bool separable) override;
LinkResult link(ContextImpl *contextImpl,
const gl::VaryingPacking &packing,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp
index b367968829d..87457f4cddd 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp
@@ -128,8 +128,8 @@ RendererGL::RendererGL(const FunctionsGL *functions, const egl::AttributeMap &at
mCapsInitialized(false)
{
ASSERT(mFunctions);
- mStateManager = new StateManagerGL(mFunctions, getNativeCaps());
nativegl_gl::GenerateWorkarounds(mFunctions, &mWorkarounds);
+ mStateManager = new StateManagerGL(mFunctions, getNativeCaps());
mBlitter = new BlitGL(functions, mWorkarounds, mStateManager);
mHasDebugOutput = mFunctions->isAtLeastGL(gl::Version(4, 3)) ||
@@ -553,7 +553,8 @@ void RendererGL::generateCaps(gl::Caps *outCaps, gl::TextureCapsMap* outTextureC
gl::Extensions *outExtensions,
gl::Limitations * /* outLimitations */) const
{
- nativegl_gl::GenerateCaps(mFunctions, outCaps, outTextureCaps, outExtensions, &mMaxSupportedESVersion);
+ nativegl_gl::GenerateCaps(mFunctions, mWorkarounds, outCaps, outTextureCaps, outExtensions,
+ &mMaxSupportedESVersion);
}
GLint RendererGL::getGPUDisjoint()
@@ -602,4 +603,14 @@ const gl::Limitations &RendererGL::getNativeLimitations() const
return mNativeLimitations;
}
+gl::Error RendererGL::dispatchCompute(const gl::ContextState &data,
+ GLuint numGroupsX,
+ GLuint numGroupsY,
+ GLuint numGroupsZ)
+{
+ ANGLE_TRY(mStateManager->setDispatchComputeState(data));
+ mFunctions->dispatchCompute(numGroupsX, numGroupsY, numGroupsZ);
+ return gl::NoError();
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h
index 42c995de43f..a636c14b6a9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h
@@ -166,6 +166,11 @@ class RendererGL : angle::NonCopyable
const gl::Extensions &getNativeExtensions() const;
const gl::Limitations &getNativeLimitations() const;
+ gl::Error dispatchCompute(const gl::ContextState &data,
+ GLuint numGroupsX,
+ GLuint numGroupsY,
+ GLuint numGroupsZ);
+
private:
void ensureCapsInitialized() const;
void generateCaps(gl::Caps *outCaps,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp
index 8a8739168e5..1c6fe97a73f 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp
@@ -11,7 +11,7 @@
#include <limits>
#include <string.h>
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/mathutil.h"
#include "common/matrix_utils.h"
#include "libANGLE/ContextState.h"
@@ -683,6 +683,12 @@ gl::Error StateManagerGL::setDrawIndirectState(const gl::ContextState &data, GLe
return setGenericDrawState(data);
}
+gl::Error StateManagerGL::setDispatchComputeState(const gl::ContextState &data)
+{
+ setGenericShaderState(data);
+ return gl::NoError();
+}
+
void StateManagerGL::pauseTransformFeedback()
{
if (mPrevDrawTransformFeedback != nullptr)
@@ -734,13 +740,13 @@ gl::Error StateManagerGL::onMakeCurrent(const gl::ContextState &data)
const gl::State &state = data.getState();
// If the context has changed, pause the previous context's queries
- if (data.getContext() != mPrevDrawContext)
+ if (data.getContextID() != mPrevDrawContext)
{
pauseAllQueries();
}
mCurrentQueries.clear();
mPrevDrawTransformFeedback = nullptr;
- mPrevDrawContext = data.getContext();
+ mPrevDrawContext = data.getContextID();
// Set the current query state
for (GLenum queryType : QueryTypes)
@@ -1805,9 +1811,4 @@ void StateManagerGL::setTextureCubemapSeamlessEnabled(bool enabled)
}
}
-GLuint StateManagerGL::getBoundBuffer(GLenum type)
-{
- ASSERT(mBuffers.find(type) != mBuffers.end());
- return mBuffers[type];
-}
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h
index 2e9effb9d2d..220d94e4e9c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h
@@ -153,6 +153,8 @@ class StateManagerGL final : angle::NonCopyable
const GLvoid **outIndices);
gl::Error setDrawIndirectState(const gl::ContextState &data, GLenum type);
+ gl::Error setDispatchComputeState(const gl::ContextState &data);
+
void pauseTransformFeedback();
void pauseAllQueries();
void pauseQuery(GLenum type);
@@ -162,8 +164,6 @@ class StateManagerGL final : angle::NonCopyable
void syncState(const gl::ContextState &data, const gl::State::DirtyBits &glDirtyBits);
- GLuint getBoundBuffer(GLenum type);
-
private:
// Set state that's common among draw commands and compute invocations.
void setGenericShaderState(const gl::ContextState &data);
@@ -202,7 +202,7 @@ class StateManagerGL final : angle::NonCopyable
TransformFeedbackGL *mPrevDrawTransformFeedback;
std::set<QueryGL *> mCurrentQueries;
- uintptr_t mPrevDrawContext;
+ gl::ContextID mPrevDrawContext;
GLint mUnpackAlignment;
GLint mUnpackRowLength;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp
index a1f0abba762..bba938bba0d 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp
@@ -29,6 +29,12 @@ FramebufferImpl *SurfaceGL::createDefaultFramebuffer(const gl::FramebufferState
mRenderer->getWorkarounds(), mRenderer->getBlitter(), true);
}
+egl::Error SurfaceGL::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
+{
+ UNREACHABLE();
+ return egl::Error(EGL_BAD_SURFACE);
+}
+
egl::Error SurfaceGL::unMakeCurrent()
{
return egl::Error(EGL_SUCCESS);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.h
index 681c365d2eb..7b805dd57ef 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.h
@@ -23,6 +23,7 @@ class SurfaceGL : public SurfaceImpl
~SurfaceGL() override;
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &data) override;
+ egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
virtual egl::Error makeCurrent() = 0;
virtual egl::Error unMakeCurrent();
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp
index e23b919006d..7817a0ec427 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp
@@ -8,7 +8,7 @@
#include "libANGLE/renderer/gl/TextureGL.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/utilities.h"
#include "libANGLE/State.h"
@@ -632,8 +632,11 @@ gl::Error TextureGL::copySubImage(ContextImpl *contextImpl,
}
gl::Error TextureGL::copyTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
@@ -647,12 +650,16 @@ gl::Error TextureGL::copyTexture(ContextImpl *contextImpl,
reserveTexImageToBeFilled(getTarget(), 0, sizedInternalFormat, sourceImageDesc.size,
internalFormat, type);
- return copySubTextureHelper(gl::Offset(0, 0, 0), sourceArea, internalFormat, unpackFlipY,
- unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
+ return copySubTextureHelper(target, level, gl::Offset(0, 0, 0), sourceLevel, sourceArea,
+ internalFormat, unpackFlipY, unpackPremultiplyAlpha,
+ unpackUnmultiplyAlpha, source);
}
gl::Error TextureGL::copySubTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
@@ -660,11 +667,14 @@ gl::Error TextureGL::copySubTexture(ContextImpl *contextImpl,
const gl::Texture *source)
{
GLenum destFormat = mState.getImageDesc(mState.mTarget, 0).format.format;
- return copySubTextureHelper(destOffset, sourceArea, destFormat, unpackFlipY,
- unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
+ return copySubTextureHelper(target, level, destOffset, sourceLevel, sourceArea, destFormat,
+ unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
}
-gl::Error TextureGL::copySubTextureHelper(const gl::Offset &destOffset,
+gl::Error TextureGL::copySubTextureHelper(GLenum target,
+ size_t level,
+ const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
GLenum destFormat,
bool unpackFlipY,
@@ -691,9 +701,10 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Offset &destOffset,
}
// We can't use copyTexSubImage, do a manual copy
- return mBlitter->copySubTexture(sourceGL, this, sourceImageDesc.size, sourceArea, destOffset,
- needsLumaWorkaround, sourceGL->mLevelInfo[0].sourceFormat,
- unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
+ return mBlitter->copySubTexture(
+ sourceGL, sourceLevel, this, target, level, sourceImageDesc.size, sourceArea, destOffset,
+ needsLumaWorkaround, sourceGL->mLevelInfo[sourceLevel].sourceFormat, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
gl::Error TextureGL::setStorage(ContextImpl *contextImpl,
@@ -1031,6 +1042,18 @@ bool TextureGL::hasAnyDirtyBit() const
return mLocalDirtyBits.any();
}
+void TextureGL::setBaseLevel(GLuint baseLevel)
+{
+ if (baseLevel != mAppliedBaseLevel)
+ {
+ mAppliedBaseLevel = baseLevel;
+ mLocalDirtyBits.set(gl::Texture::DIRTY_BIT_BASE_LEVEL);
+
+ mStateManager->bindTexture(getTarget(), mTextureID);
+ mFunctions->texParameteri(getTarget(), GL_TEXTURE_BASE_LEVEL, baseLevel);
+ }
+}
+
void TextureGL::setMinFilter(GLenum filter)
{
if (filter != mAppliedSampler.minFilter)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h
index a1980246b04..e302f935029 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h
@@ -108,20 +108,29 @@ class TextureGL : public TextureImpl
const gl::Framebuffer *source) override;
gl::Error copyTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
GLenum internalFormat,
GLenum type,
+ size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTexture(ContextImpl *contextImpl,
+ GLenum target,
+ size_t level,
const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
- gl::Error copySubTextureHelper(const gl::Offset &destOffset,
+ gl::Error copySubTextureHelper(GLenum target,
+ size_t level,
+ const gl::Offset &destOffset,
+ size_t sourceLevel,
const gl::Rectangle &sourceArea,
GLenum destFormat,
bool unpackFlipY,
@@ -156,11 +165,11 @@ class TextureGL : public TextureImpl
GLuint getTextureID() const;
GLenum getTarget() const;
- void setBaseLevel(GLuint) override {}
-
void syncState(const gl::Texture::DirtyBits &dirtyBits) override;
bool hasAnyDirtyBit() const;
+ void setBaseLevel(GLuint baseLevel) override;
+
void setMinFilter(GLenum filter);
void setMagFilter(GLenum filter);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
index c03647f0593..183baa4cb75 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
@@ -8,7 +8,7 @@
#include "libANGLE/renderer/gl/VertexArrayGL.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/debug.h"
#include "common/mathutil.h"
#include "common/utilities.h"
@@ -66,11 +66,11 @@ VertexArrayGL::~VertexArrayGL()
mStateManager->deleteBuffer(mStreamingElementArrayBuffer);
mStreamingElementArrayBufferSize = 0;
- mStreamingElementArrayBuffer = 0;
+ mStreamingElementArrayBuffer = 0;
mStateManager->deleteBuffer(mStreamingArrayBuffer);
mStreamingArrayBufferSize = 0;
- mStreamingArrayBuffer = 0;
+ mStreamingArrayBuffer = 0;
mAppliedElementArrayBuffer.set(nullptr);
for (auto &binding : mAppliedBindings)
@@ -125,10 +125,12 @@ gl::Error VertexArrayGL::syncDrawState(const gl::AttributesMask &activeAttribute
{
mStateManager->bindVertexArray(mVertexArrayID, getAppliedElementArrayBufferID());
- // Check if any attributes need to be streamed, determines if the index range needs to be computed
+ // Check if any attributes need to be streamed, determines if the index range needs to be
+ // computed
bool attributesNeedStreaming = mAttributesNeedStreaming.any();
- // Determine if an index buffer needs to be streamed and the range of vertices that need to be copied
+ // Determine if an index buffer needs to be streamed and the range of vertices that need to be
+ // copied
IndexRange indexRange;
if (type != GL_NONE)
{
@@ -143,7 +145,7 @@ gl::Error VertexArrayGL::syncDrawState(const gl::AttributesMask &activeAttribute
{
// Not an indexed call, set the range to [first, first + count - 1]
indexRange.start = first;
- indexRange.end = first + count - 1;
+ indexRange.end = first + count - 1;
}
if (attributesNeedStreaming)
@@ -184,7 +186,7 @@ gl::Error VertexArrayGL::syncIndexData(GLsizei count,
if (attributesNeedStreaming)
{
ptrdiff_t elementArrayBufferOffset = reinterpret_cast<ptrdiff_t>(indices);
- Error error = mData.getElementArrayBuffer()->getIndexRange(
+ Error error = mData.getElementArrayBuffer()->getIndexRange(
type, elementArrayBufferOffset, count, primitiveRestartEnabled, outIndexRange);
if (error.isError())
{
@@ -192,7 +194,8 @@ gl::Error VertexArrayGL::syncIndexData(GLsizei count,
}
}
- // Indices serves as an offset into the index buffer in this case, use the same value for the draw call
+ // Indices serves as an offset into the index buffer in this case, use the same value for
+ // the draw call
*outIndices = indices;
}
else
@@ -222,16 +225,19 @@ gl::Error VertexArrayGL::syncIndexData(GLsizei count,
if (requiredStreamingBufferSize > mStreamingElementArrayBufferSize)
{
// Copy the indices in while resizing the buffer
- mFunctions->bufferData(GL_ELEMENT_ARRAY_BUFFER, requiredStreamingBufferSize, indices, GL_DYNAMIC_DRAW);
+ mFunctions->bufferData(GL_ELEMENT_ARRAY_BUFFER, requiredStreamingBufferSize, indices,
+ GL_DYNAMIC_DRAW);
mStreamingElementArrayBufferSize = requiredStreamingBufferSize;
}
else
{
// Put the indices at the beginning of the buffer
- mFunctions->bufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, requiredStreamingBufferSize, indices);
+ mFunctions->bufferSubData(GL_ELEMENT_ARRAY_BUFFER, 0, requiredStreamingBufferSize,
+ indices);
}
- // Set the index offset for the draw call to zero since the supplied index pointer is to client data
+ // Set the index offset for the draw call to zero since the supplied index pointer is to
+ // client data
*outIndices = nullptr;
}
@@ -249,11 +255,11 @@ void VertexArrayGL::computeStreamingAttributeSizes(const gl::AttributesMask &act
ASSERT(mAttributesNeedStreaming.any());
- const auto &attribs = mData.getVertexAttributes();
+ const auto &attribs = mData.getVertexAttributes();
const auto &bindings = mData.getVertexBindings();
for (auto idx : angle::IterateBitSet(mAttributesNeedStreaming & activeAttributesMask))
{
- const auto &attrib = attribs[idx];
+ const auto &attrib = attribs[idx];
const auto &binding = bindings[attrib.bindingIndex];
ASSERT(AttributeNeedsStreaming(attrib, binding));
@@ -289,9 +295,9 @@ gl::Error VertexArrayGL::streamAttributes(const gl::AttributesMask &activeAttrib
mStreamingArrayBufferSize = 0;
}
- // If first is greater than zero, a slack space needs to be left at the beginning of the buffer so that
- // the same 'first' argument can be passed into the draw call.
- const size_t bufferEmptySpace = maxAttributeDataSize * indexRange.start;
+ // If first is greater than zero, a slack space needs to be left at the beginning of the buffer
+ // so that the same 'first' argument can be passed into the draw call.
+ const size_t bufferEmptySpace = maxAttributeDataSize * indexRange.start;
const size_t requiredBufferSize = streamingDataSize + bufferEmptySpace;
mStateManager->bindBuffer(GL_ARRAY_BUFFER, mStreamingArrayBuffer);
@@ -302,9 +308,9 @@ gl::Error VertexArrayGL::streamAttributes(const gl::AttributesMask &activeAttrib
}
// Unmapping a buffer can return GL_FALSE to indicate that the system has corrupted the data
- // somehow (such as by a screen change), retry writing the data a few times and return OUT_OF_MEMORY
- // if that fails.
- GLboolean unmapResult = GL_FALSE;
+ // somehow (such as by a screen change), retry writing the data a few times and return
+ // OUT_OF_MEMORY if that fails.
+ GLboolean unmapResult = GL_FALSE;
size_t unmapRetryAttempts = 5;
while (unmapResult != GL_TRUE && --unmapRetryAttempts > 0)
{
@@ -312,11 +318,11 @@ gl::Error VertexArrayGL::streamAttributes(const gl::AttributesMask &activeAttrib
requiredBufferSize, GL_MAP_WRITE_BIT);
size_t curBufferOffset = bufferEmptySpace;
- const auto &attribs = mData.getVertexAttributes();
+ const auto &attribs = mData.getVertexAttributes();
const auto &bindings = mData.getVertexBindings();
for (auto idx : angle::IterateBitSet(mAttributesNeedStreaming & activeAttributesMask))
{
- const auto &attrib = attribs[idx];
+ const auto &attrib = attribs[idx];
const auto &binding = bindings[attrib.bindingIndex];
ASSERT(AttributeNeedsStreaming(attrib, binding));
@@ -347,7 +353,7 @@ gl::Error VertexArrayGL::streamAttributes(const gl::AttributesMask &activeAttrib
// Copy each vertex individually
for (size_t vertexIdx = 0; vertexIdx < streamedVertexCount; vertexIdx++)
{
- uint8_t *out = bufferPointer + curBufferOffset + (destStride * vertexIdx);
+ uint8_t *out = bufferPointer + curBufferOffset + (destStride * vertexIdx);
const uint8_t *in = inputPointer + sourceStride * (vertexIdx + firstIndex);
memcpy(out, in, destStride);
}
@@ -518,7 +524,7 @@ void VertexArrayGL::updateAttribDivisor(size_t attribIndex)
}
}
-void VertexArrayGL::syncState(const VertexArray::DirtyBits &dirtyBits)
+void VertexArrayGL::syncState(ContextImpl *contextImpl, const VertexArray::DirtyBits &dirtyBits)
{
for (unsigned long dirtyBit : angle::IterateBitSet(dirtyBits))
{
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h
index 282f27c7cf5..a114bd11364 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h
@@ -41,7 +41,7 @@ class VertexArrayGL : public VertexArrayImpl
GLuint getVertexArrayID() const;
GLuint getAppliedElementArrayBufferID() const;
- void syncState(const gl::VertexArray::DirtyBits &dirtyBits) override;
+ void syncState(ContextImpl *contextImpl, const gl::VertexArray::DirtyBits &dirtyBits) override;
private:
gl::Error syncDrawState(const gl::AttributesMask &activeAttributesMask,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/WorkaroundsGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/WorkaroundsGL.h
index cb5901ef62d..ec59c045242 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/WorkaroundsGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/WorkaroundsGL.h
@@ -118,6 +118,12 @@ struct WorkaroundsGL
// This only seems to affect AMD OpenGL drivers, and some Android devices.
// http://anglebug.com/1637
bool reapplyUBOBindingsAfterLoadingBinaryProgram = false;
+
+ // Some OpenGL drivers return 0 when we query MAX_VERTEX_ATTRIB_STRIDE in an OpenGL 4.4 or
+ // higher context.
+ // This only seems to affect AMD OpenGL drivers.
+ // Tracking bug: http://anglebug.com/1936
+ bool emulateMaxVertexAttribStride = false;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp
index 0bb256e188d..31174ba8c51 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp
@@ -183,8 +183,12 @@ static void LimitVersion(gl::Version *curVersion, const gl::Version &maxVersion)
}
}
-void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap,
- gl::Extensions *extensions, gl::Version *maxSupportedESVersion)
+void GenerateCaps(const FunctionsGL *functions,
+ const WorkaroundsGL &workarounds,
+ gl::Caps *caps,
+ gl::TextureCapsMap *textureCapsMap,
+ gl::Extensions *extensions,
+ gl::Version *maxSupportedESVersion)
{
// Texture format support checks
const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats();
@@ -631,7 +635,18 @@ void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsM
caps->maxVertexAttribRelativeOffset =
QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET);
caps->maxVertexAttribBindings = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_BINDINGS);
- caps->maxVertexAttribStride = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_STRIDE);
+
+ // OpenGL 4.3 has no limit on maximum value of stride.
+ // [OpenGL 4.3 (Core Profile) - February 14, 2013] Chapter 10.3.1 Page 298
+ if (workarounds.emulateMaxVertexAttribStride ||
+ (functions->standard == STANDARD_GL_DESKTOP && functions->version == gl::Version(4, 3)))
+ {
+ caps->maxVertexAttribStride = 2048;
+ }
+ else
+ {
+ caps->maxVertexAttribStride = QuerySingleGLInt(functions, GL_MAX_VERTEX_ATTRIB_STRIDE);
+ }
}
else
{
@@ -934,6 +949,11 @@ void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workaround
workarounds->doesSRGBClearsOnLinearFramebufferAttachments =
functions->standard == STANDARD_GL_DESKTOP && (IsIntel(vendor) || IsAMD(vendor));
+#if defined(ANGLE_PLATFORM_LINUX)
+ workarounds->emulateMaxVertexAttribStride =
+ functions->standard == STANDARD_GL_DESKTOP && IsAMD(vendor);
+#endif
+
#if defined(ANGLE_PLATFORM_APPLE)
workarounds->doWhileGLSLCausesGPUHang = true;
workarounds->useUnusedBlocksWithStandardOrSharedLayout = true;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.h
index 133f0e8bf89..98716db9805 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.h
@@ -37,8 +37,12 @@ std::string GetDriverVersion(const FunctionsGL *functions);
namespace nativegl_gl
{
-void GenerateCaps(const FunctionsGL *functions, gl::Caps *caps, gl::TextureCapsMap *textureCapsMap,
- gl::Extensions *extensions, gl::Version *maxSupportedESVersion);
+void GenerateCaps(const FunctionsGL *functions,
+ const WorkaroundsGL &workarounds,
+ gl::Caps *caps,
+ gl::TextureCapsMap *textureCapsMap,
+ gl::Extensions *extensions,
+ gl::Version *maxSupportedESVersion);
void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workarounds);
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp
index 3ce344f4f3d..b60f9818273 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp
@@ -8,6 +8,7 @@
#include "libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h"
+#include "libANGLE/Surface.h"
#include "libANGLE/renderer/gl/FramebufferGL.h"
#include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/RendererGL.h"
@@ -21,21 +22,18 @@ namespace rx
namespace
{
-egl::Error GetD3DTextureInfo(EGLClientBuffer clientBuffer,
- size_t *width,
- size_t *height,
- IUnknown **object,
- IUnknown **device)
+egl::Error GetD3D11TextureInfo(EGLenum buftype,
+ ID3D11Texture2D *texture11,
+ size_t *width,
+ size_t *height,
+ IUnknown **object,
+ IUnknown **device)
{
- IUnknown *buffer = static_cast<IUnknown *>(clientBuffer);
+ D3D11_TEXTURE2D_DESC textureDesc;
+ texture11->GetDesc(&textureDesc);
- IDirect3DTexture9 *texture9 = nullptr;
- ID3D11Texture2D *texture11 = nullptr;
- if (SUCCEEDED(buffer->QueryInterface<ID3D11Texture2D>(&texture11)))
+ if (buftype == EGL_D3D_TEXTURE_ANGLE)
{
- D3D11_TEXTURE2D_DESC textureDesc;
- texture11->GetDesc(&textureDesc);
-
// From table egl.restrictions in EGL_ANGLE_d3d_texture_client_buffer.
switch (textureDesc.Format)
{
@@ -52,55 +50,63 @@ egl::Error GetD3DTextureInfo(EGLClientBuffer clientBuffer,
return egl::Error(EGL_BAD_PARAMETER, "Unknown client buffer texture format: %u.",
textureDesc.Format);
}
+ }
- ID3D11Device *d3d11Device = nullptr;
- texture11->GetDevice(&d3d11Device);
- if (d3d11Device == nullptr)
- {
- SafeRelease(texture11);
- return egl::Error(EGL_BAD_PARAMETER,
- "Could not query the D3D11 device from the client buffer.");
- }
-
- if (width)
- {
- *width = textureDesc.Width;
- }
- if (height)
- {
- *height = textureDesc.Height;
- }
+ ID3D11Device *d3d11Device = nullptr;
+ texture11->GetDevice(&d3d11Device);
+ if (d3d11Device == nullptr)
+ {
+ SafeRelease(texture11);
+ return egl::Error(EGL_BAD_PARAMETER,
+ "Could not query the D3D11 device from the client buffer.");
+ }
- if (device)
- {
- *device = d3d11Device;
- }
- else
- {
- SafeRelease(d3d11Device);
- }
+ if (width)
+ {
+ *width = textureDesc.Width;
+ }
+ if (height)
+ {
+ *height = textureDesc.Height;
+ }
- if (object)
- {
- *object = texture11;
- }
- else
- {
- SafeRelease(texture11);
- }
+ if (device)
+ {
+ *device = d3d11Device;
+ }
+ else
+ {
+ SafeRelease(d3d11Device);
+ }
- return egl::Error(EGL_SUCCESS);
+ if (object)
+ {
+ *object = texture11;
}
- else if (SUCCEEDED(buffer->QueryInterface<IDirect3DTexture9>(&texture9)))
+ else
{
- D3DSURFACE_DESC surfaceDesc;
- if (FAILED(texture9->GetLevelDesc(0, &surfaceDesc)))
- {
- SafeRelease(texture9);
- return egl::Error(EGL_BAD_PARAMETER,
- "Could not query description of the D3D9 surface.");
- }
+ SafeRelease(texture11);
+ }
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error GetD3D9TextureInfo(EGLenum buftype,
+ IDirect3DTexture9 *texture9,
+ size_t *width,
+ size_t *height,
+ IUnknown **object,
+ IUnknown **device)
+{
+ D3DSURFACE_DESC surfaceDesc;
+ if (FAILED(texture9->GetLevelDesc(0, &surfaceDesc)))
+ {
+ SafeRelease(texture9);
+ return egl::Error(EGL_BAD_PARAMETER, "Could not query description of the D3D9 surface.");
+ }
+
+ if (buftype == EGL_D3D_TEXTURE_ANGLE)
+ {
// From table egl.restrictions in EGL_ANGLE_d3d_texture_client_buffer.
switch (surfaceDesc.Format)
{
@@ -115,49 +121,93 @@ egl::Error GetD3DTextureInfo(EGLClientBuffer clientBuffer,
return egl::Error(EGL_BAD_PARAMETER, "Unknown client buffer texture format: %u.",
surfaceDesc.Format);
}
+ }
- if (width)
- {
- *width = surfaceDesc.Width;
- }
- if (height)
- {
- *height = surfaceDesc.Height;
- }
+ if (width)
+ {
+ *width = surfaceDesc.Width;
+ }
+ if (height)
+ {
+ *height = surfaceDesc.Height;
+ }
- IDirect3DDevice9 *d3d9Device = nullptr;
- HRESULT result = texture9->GetDevice(&d3d9Device);
- if (FAILED(result))
- {
- SafeRelease(texture9);
- return egl::Error(EGL_BAD_PARAMETER,
- "Could not query the D3D9 device from the client buffer.");
- }
+ IDirect3DDevice9 *d3d9Device = nullptr;
+ HRESULT result = texture9->GetDevice(&d3d9Device);
+ if (FAILED(result))
+ {
+ SafeRelease(texture9);
+ return egl::Error(EGL_BAD_PARAMETER,
+ "Could not query the D3D9 device from the client buffer.");
+ }
+
+ if (device)
+ {
+ *device = d3d9Device;
+ }
+ else
+ {
+ SafeRelease(d3d9Device);
+ }
+
+ if (object)
+ {
+ *object = texture9;
+ }
+ else
+ {
+ SafeRelease(texture9);
+ }
- if (device)
+ return egl::Error(EGL_SUCCESS);
+}
+
+egl::Error GetD3DTextureInfo(EGLenum buftype,
+ EGLClientBuffer clientBuffer,
+ ID3D11Device *d3d11Device,
+ size_t *width,
+ size_t *height,
+ IUnknown **object,
+ IUnknown **device)
+{
+ if (buftype == EGL_D3D_TEXTURE_ANGLE)
+ {
+ IUnknown *buffer = static_cast<IUnknown *>(clientBuffer);
+ ID3D11Texture2D *texture11 = nullptr;
+ IDirect3DTexture9 *texture9 = nullptr;
+ if (SUCCEEDED(buffer->QueryInterface<ID3D11Texture2D>(&texture11)))
{
- *device = d3d9Device;
+ return GetD3D11TextureInfo(buftype, texture11, width, height, object, device);
}
- else
+ else if (SUCCEEDED(buffer->QueryInterface<IDirect3DTexture9>(&texture9)))
{
- SafeRelease(d3d9Device);
+ return GetD3D9TextureInfo(buftype, texture9, width, height, object, device);
}
-
- if (object)
+ else
{
- *object = texture9;
+ return egl::Error(EGL_BAD_PARAMETER,
+ "Provided buffer is not a IDirect3DTexture9 or ID3D11Texture2D.");
}
- else
+ }
+ else if (buftype == EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE)
+ {
+ ASSERT(d3d11Device);
+ HANDLE shareHandle = static_cast<HANDLE>(clientBuffer);
+ ID3D11Texture2D *texture11 = nullptr;
+ HRESULT result = d3d11Device->OpenSharedResource(shareHandle, __uuidof(ID3D11Texture2D),
+ reinterpret_cast<void **>(&texture11));
+ if (FAILED(result))
{
- SafeRelease(texture9);
+ return egl::Error(EGL_BAD_PARAMETER, "Failed to open share handle, result: 0x%X.",
+ result);
}
- return egl::Error(EGL_SUCCESS);
+ return GetD3D11TextureInfo(buftype, texture11, width, height, object, device);
}
else
{
- return egl::Error(EGL_BAD_PARAMETER,
- "Provided buffer is not a IDirect3DTexture9 or ID3D11Texture2D.");
+ UNREACHABLE();
+ return egl::Error(EGL_BAD_DISPLAY, "Unknown buftype for D3DTextureSurfaceWGL.");
}
}
@@ -165,15 +215,19 @@ egl::Error GetD3DTextureInfo(EGLClientBuffer clientBuffer,
D3DTextureSurfaceWGL::D3DTextureSurfaceWGL(const egl::SurfaceState &state,
RendererGL *renderer,
+ EGLenum buftype,
EGLClientBuffer clientBuffer,
DisplayWGL *display,
HGLRC wglContext,
HDC deviceContext,
+ ID3D11Device *displayD3D11Device,
const FunctionsGL *functionsGL,
const FunctionsWGL *functionsWGL)
: SurfaceGL(state, renderer),
+ mBuftype(buftype),
mClientBuffer(clientBuffer),
mRenderer(renderer),
+ mDisplayD3D11Device(displayD3D11Device),
mDisplay(display),
mStateManager(renderer->getStateManager()),
mWorkarounds(renderer->getWorkarounds()),
@@ -185,9 +239,11 @@ D3DTextureSurfaceWGL::D3DTextureSurfaceWGL(const egl::SurfaceState &state,
mHeight(0),
mDeviceHandle(nullptr),
mObject(nullptr),
+ mKeyedMutex(nullptr),
mBoundObjectTextureHandle(nullptr),
mBoundObjectRenderbufferHandle(nullptr),
- mRenderbufferID(0),
+ mColorRenderbufferID(0),
+ mDepthStencilRenderbufferID(0),
mFramebufferID(0)
{
}
@@ -197,6 +253,7 @@ D3DTextureSurfaceWGL::~D3DTextureSurfaceWGL()
ASSERT(mBoundObjectTextureHandle == nullptr);
SafeRelease(mObject);
+ SafeRelease(mKeyedMutex);
if (mDeviceHandle)
{
@@ -205,7 +262,8 @@ D3DTextureSurfaceWGL::~D3DTextureSurfaceWGL()
mFunctionsWGL->dxUnregisterObjectNV(mDeviceHandle, mBoundObjectRenderbufferHandle);
mBoundObjectRenderbufferHandle = nullptr;
}
- mStateManager->deleteRenderbuffer(mRenderbufferID);
+ mStateManager->deleteRenderbuffer(mColorRenderbufferID);
+ mStateManager->deleteRenderbuffer(mDepthStencilRenderbufferID);
if (mBoundObjectTextureHandle)
{
@@ -221,15 +279,22 @@ D3DTextureSurfaceWGL::~D3DTextureSurfaceWGL()
}
}
-egl::Error D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(EGLClientBuffer clientBuffer)
+egl::Error D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(EGLenum buftype,
+ EGLClientBuffer clientBuffer,
+ ID3D11Device *d3d11Device)
{
- return GetD3DTextureInfo(clientBuffer, nullptr, nullptr, nullptr, nullptr);
+ return GetD3DTextureInfo(buftype, clientBuffer, d3d11Device, nullptr, nullptr, nullptr,
+ nullptr);
}
egl::Error D3DTextureSurfaceWGL::initialize(const DisplayImpl *displayImpl)
{
IUnknown *device = nullptr;
- ANGLE_TRY(GetD3DTextureInfo(mClientBuffer, &mWidth, &mHeight, &mObject, &device));
+ ANGLE_TRY(GetD3DTextureInfo(mBuftype, mClientBuffer, mDisplayD3D11Device, &mWidth, &mHeight,
+ &mObject, &device));
+
+ // Grab the keyed mutex, if one exists
+ mObject->QueryInterface(&mKeyedMutex);
ASSERT(device != nullptr);
egl::Error error = mDisplay->registerD3DDevice(device, &mDeviceHandle);
@@ -239,20 +304,40 @@ egl::Error D3DTextureSurfaceWGL::initialize(const DisplayImpl *displayImpl)
return error;
}
- mFunctionsGL->genRenderbuffers(1, &mRenderbufferID);
- mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mRenderbufferID);
+ mFunctionsGL->genRenderbuffers(1, &mColorRenderbufferID);
+ mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mColorRenderbufferID);
mBoundObjectRenderbufferHandle = mFunctionsWGL->dxRegisterObjectNV(
- mDeviceHandle, mObject, mRenderbufferID, GL_RENDERBUFFER, WGL_ACCESS_READ_WRITE_NV);
+ mDeviceHandle, mObject, mColorRenderbufferID, GL_RENDERBUFFER, WGL_ACCESS_READ_WRITE_NV);
if (mBoundObjectRenderbufferHandle == nullptr)
{
return egl::Error(EGL_BAD_ALLOC, "Failed to register D3D object, error: 0x%08x.",
HRESULT_CODE(GetLastError()));
}
+ const egl::Config *config = mState.config;
+ if (config->depthStencilFormat != GL_NONE)
+ {
+ mFunctionsGL->genRenderbuffers(1, &mDepthStencilRenderbufferID);
+ mStateManager->bindRenderbuffer(GL_RENDERBUFFER, mDepthStencilRenderbufferID);
+ mFunctionsGL->renderbufferStorage(GL_RENDERBUFFER, config->depthStencilFormat,
+ static_cast<GLsizei>(mWidth),
+ static_cast<GLsizei>(mHeight));
+ }
+
mFunctionsGL->genFramebuffers(1, &mFramebufferID);
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
mFunctionsGL->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER,
- mRenderbufferID);
+ mColorRenderbufferID);
+ if (config->depthSize > 0)
+ {
+ mFunctionsGL->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER,
+ mDepthStencilRenderbufferID);
+ }
+ if (config->stencilSize > 0)
+ {
+ mFunctionsGL->framebufferRenderbuffer(GL_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+ GL_RENDERBUFFER, mDepthStencilRenderbufferID);
+ }
return egl::Error(EGL_SUCCESS);
}
@@ -300,7 +385,20 @@ egl::Error D3DTextureSurfaceWGL::postSubBuffer(EGLint x, EGLint y, EGLint width,
egl::Error D3DTextureSurfaceWGL::querySurfacePointerANGLE(EGLint attribute, void **value)
{
- UNIMPLEMENTED();
+ switch (attribute)
+ {
+ case EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE:
+ *value = (mBuftype == EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE) ? mClientBuffer : nullptr;
+ break;
+
+ case EGL_DXGI_KEYED_MUTEX_ANGLE:
+ *value = mKeyedMutex;
+ break;
+
+ default:
+ UNREACHABLE();
+ }
+
return egl::Error(EGL_SUCCESS);
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h
index ef648d30867..2ce2b05f45b 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.h
@@ -27,15 +27,19 @@ class D3DTextureSurfaceWGL : public SurfaceGL
public:
D3DTextureSurfaceWGL(const egl::SurfaceState &state,
RendererGL *renderer,
+ EGLenum buftype,
EGLClientBuffer clientBuffer,
DisplayWGL *display,
HGLRC wglContext,
HDC deviceContext,
+ ID3D11Device *displayD3D11Device,
const FunctionsGL *functionsGL,
const FunctionsWGL *functionsWGL);
~D3DTextureSurfaceWGL() override;
- static egl::Error ValidateD3DTextureClientBuffer(EGLClientBuffer clientBuffer);
+ static egl::Error ValidateD3DTextureClientBuffer(EGLenum buftype,
+ EGLClientBuffer clientBuffer,
+ ID3D11Device *d3d11Device);
egl::Error initialize(const DisplayImpl *displayImpl) override;
egl::Error makeCurrent() override;
@@ -57,10 +61,13 @@ class D3DTextureSurfaceWGL : public SurfaceGL
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &data) override;
private:
+ EGLenum mBuftype;
EGLClientBuffer mClientBuffer;
RendererGL *mRenderer;
+ ID3D11Device *mDisplayD3D11Device;
+
DisplayWGL *mDisplay;
StateManagerGL *mStateManager;
const WorkaroundsGL &mWorkarounds;
@@ -75,10 +82,12 @@ class D3DTextureSurfaceWGL : public SurfaceGL
HANDLE mDeviceHandle;
IUnknown *mObject;
+ IDXGIKeyedMutex *mKeyedMutex;
HANDLE mBoundObjectTextureHandle;
HANDLE mBoundObjectRenderbufferHandle;
- GLuint mRenderbufferID;
+ GLuint mColorRenderbufferID;
+ GLuint mDepthStencilRenderbufferID;
GLuint mFramebufferID;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
index 2111c55eff5..2e4968408e9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp
@@ -375,7 +375,7 @@ egl::Error DisplayWGL::initialize(egl::Display *display)
mUseDXGISwapChains = false;
}
- if (mUseDXGISwapChains)
+ if (mFunctionsWGL->hasExtension("WGL_NV_DX_interop2"))
{
egl::Error error = initializeD3DDevice();
if (error.isError())
@@ -383,6 +383,11 @@ egl::Error DisplayWGL::initialize(egl::Display *display)
return error;
}
}
+ else if (mUseDXGISwapChains)
+ {
+ // Want to use DXGI swap chains but WGL_NV_DX_interop2 is not present, fail initialization
+ return egl::Error(EGL_NOT_INITIALIZED, "WGL_NV_DX_interop2 is required but not present.");
+ }
return DisplayGL::initialize(display);
}
@@ -465,9 +470,8 @@ SurfaceImpl *DisplayWGL::createPbufferFromClientBuffer(const egl::SurfaceState &
EGLClientBuffer clientBuffer,
const egl::AttributeMap &attribs)
{
- ASSERT(buftype == EGL_D3D_TEXTURE_ANGLE);
- return new D3DTextureSurfaceWGL(state, getRenderer(), clientBuffer, this, mWGLContext,
- mDeviceContext, mFunctionsGL, mFunctionsWGL);
+ return new D3DTextureSurfaceWGL(state, getRenderer(), buftype, clientBuffer, this, mWGLContext,
+ mDeviceContext, mD3D11Device, mFunctionsGL, mFunctionsWGL);
}
SurfaceImpl *DisplayWGL::createPixmapSurface(const egl::SurfaceState &state,
@@ -588,7 +592,9 @@ egl::Error DisplayWGL::validateClientBuffer(const egl::Config *configuration,
switch (buftype)
{
case EGL_D3D_TEXTURE_ANGLE:
- return D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(clientBuffer);
+ case EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE:
+ return D3DTextureSurfaceWGL::ValidateD3DTextureClientBuffer(buftype, clientBuffer,
+ mD3D11Device);
default:
return DisplayGL::validateClientBuffer(configuration, buftype, clientBuffer, attribs);
@@ -659,7 +665,11 @@ void DisplayWGL::generateExtensions(egl::DisplayExtensions *outExtensions) const
outExtensions->createContextRobustness = mHasRobustness;
- outExtensions->d3dTextureClientBuffer = mFunctionsWGL->hasExtension("WGL_NV_DX_interop2");
+ outExtensions->d3dTextureClientBuffer = mD3D11Device != nullptr;
+ outExtensions->d3dShareHandleClientBuffer = mD3D11Device != nullptr;
+ outExtensions->surfaceD3DTexture2DShareHandle = true;
+ outExtensions->querySurfacePointer = true;
+ outExtensions->keyedMutex = true;
// Contexts are virtualized so textures can be shared globally
outExtensions->displayTextureShareGroup = true;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.cpp
index 1a2cc02b776..0650e91e965 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/PbufferSurfaceWGL.cpp
@@ -134,7 +134,7 @@ egl::Error PbufferSurfaceWGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EG
egl::Error PbufferSurfaceWGL::querySurfacePointerANGLE(EGLint attribute, void **value)
{
- UNIMPLEMENTED();
+ *value = nullptr;
return egl::Error(EGL_SUCCESS);
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp
index 278f1902212..b6865477bce 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/WindowSurfaceWGL.cpp
@@ -119,7 +119,7 @@ egl::Error WindowSurfaceWGL::postSubBuffer(EGLint x, EGLint y, EGLint width, EGL
egl::Error WindowSurfaceWGL::querySurfacePointerANGLE(EGLint attribute, void **value)
{
- UNIMPLEMENTED();
+ *value = nullptr;
return egl::Error(EGL_SUCCESS);
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/load_functions_data.json b/chromium/third_party/angle/src/libANGLE/renderer/load_functions_data.json
index 19ea026d0c9..198274998cf 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/load_functions_data.json
+++ b/chromium/third_party/angle/src/libANGLE/renderer/load_functions_data.json
@@ -519,6 +519,26 @@
"GL_UNSIGNED_BYTE": "LoadETC1RGB8ToBC1"
}
},
+ "GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE": {
+ "BC1_RGB_UNORM_BLOCK": {
+ "GL_UNSIGNED_BYTE": "LoadETC2RGB8ToBC1"
+ }
+ },
+ "GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE": {
+ "BC1_RGB_UNORM_SRGB_BLOCK": {
+ "GL_UNSIGNED_BYTE": "LoadETC2SRGB8ToBC1"
+ }
+ },
+ "GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE": {
+ "BC1_RGBA_UNORM_BLOCK": {
+ "GL_UNSIGNED_BYTE": "LoadETC2RGB8A1ToBC1"
+ }
+ },
+ "GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE": {
+ "BC1_RGBA_UNORM_SRGB_BLOCK": {
+ "GL_UNSIGNED_BYTE": "LoadETC2SRGB8A1ToBC1"
+ }
+ },
"GL_R16_EXT": {
"R16_UNORM": {
"GL_UNSIGNED_SHORT": "LoadToNative<GLushort, 1>"
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/load_functions_table_autogen.cpp b/chromium/third_party/angle/src/libANGLE/renderer/load_functions_table_autogen.cpp
index d3da522c1ac..ed9fe2864c9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/load_functions_table_autogen.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/load_functions_table_autogen.cpp
@@ -250,6 +250,18 @@ LoadImageFunctionInfo COMPRESSED_RGB8_ETC2_to_R8G8B8A8_UNORM(GLenum type)
}
}
+LoadImageFunctionInfo COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_BLOCK(GLenum type)
+{
+ switch (type)
+ {
+ case GL_UNSIGNED_BYTE:
+ return LoadImageFunctionInfo(LoadETC2RGB8ToBC1, true);
+ default:
+ UNREACHABLE();
+ return LoadImageFunctionInfo(UnreachableLoadFunction, true);
+ }
+}
+
LoadImageFunctionInfo COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM(GLenum type)
{
switch (type)
@@ -262,6 +274,19 @@ LoadImageFunctionInfo COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM
}
}
+LoadImageFunctionInfo
+COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_BLOCK(GLenum type)
+{
+ switch (type)
+ {
+ case GL_UNSIGNED_BYTE:
+ return LoadImageFunctionInfo(LoadETC2RGB8A1ToBC1, true);
+ default:
+ UNREACHABLE();
+ return LoadImageFunctionInfo(UnreachableLoadFunction, true);
+ }
+}
+
LoadImageFunctionInfo COMPRESSED_RGBA8_ETC2_EAC_to_R8G8B8A8_UNORM(GLenum type)
{
switch (type)
@@ -370,6 +395,19 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_ETC2_to_R8G8B8A8_UNORM_SRGB(GLenum type)
}
}
+LoadImageFunctionInfo COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_SRGB_BLOCK(
+ GLenum type)
+{
+ switch (type)
+ {
+ case GL_UNSIGNED_BYTE:
+ return LoadImageFunctionInfo(LoadETC2SRGB8ToBC1, true);
+ default:
+ UNREACHABLE();
+ return LoadImageFunctionInfo(UnreachableLoadFunction, true);
+ }
+}
+
LoadImageFunctionInfo COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNORM_SRGB(GLenum type)
{
switch (type)
@@ -382,6 +420,20 @@ LoadImageFunctionInfo COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2_to_R8G8B8A8_UNOR
}
}
+LoadImageFunctionInfo
+COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_SRGB_BLOCK(
+ GLenum type)
+{
+ switch (type)
+ {
+ case GL_UNSIGNED_BYTE:
+ return LoadImageFunctionInfo(LoadETC2SRGB8A1ToBC1, true);
+ default:
+ UNREACHABLE();
+ return LoadImageFunctionInfo(UnreachableLoadFunction, true);
+ }
+}
+
LoadImageFunctionInfo COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default(GLenum type)
{
switch (type)
@@ -1577,6 +1629,16 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
break;
}
}
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ switch (angleFormat)
+ {
+ case Format::ID::BC1_RGB_UNORM_BLOCK:
+ return COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_BLOCK;
+ default:
+ break;
+ }
+ }
case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:
{
switch (angleFormat)
@@ -1587,6 +1649,16 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
break;
}
}
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ switch (angleFormat)
+ {
+ case Format::ID::BC1_RGBA_UNORM_BLOCK:
+ return COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_BLOCK;
+ default:
+ break;
+ }
+ }
case GL_COMPRESSED_RGBA8_ETC2_EAC:
{
switch (angleFormat)
@@ -1645,6 +1717,16 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
break;
}
}
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ switch (angleFormat)
+ {
+ case Format::ID::BC1_RGB_UNORM_SRGB_BLOCK:
+ return COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGB_UNORM_SRGB_BLOCK;
+ default:
+ break;
+ }
+ }
case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:
{
switch (angleFormat)
@@ -1655,6 +1737,16 @@ LoadFunctionMap GetLoadFunctionsMap(GLenum internalFormat, Format::ID angleForma
break;
}
}
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ {
+ switch (angleFormat)
+ {
+ case Format::ID::BC1_RGBA_UNORM_SRGB_BLOCK:
+ return COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE_to_BC1_RGBA_UNORM_SRGB_BLOCK;
+ default:
+ break;
+ }
+ }
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT:
return COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT_to_default;
case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT:
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp
index 51d3a2aa001..d6fba6fce9e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp
@@ -363,4 +363,9 @@ std::vector<PathImpl *> ContextNULL::createPaths(GLsizei range)
return result;
}
+gl::Error ContextNULL::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
+{
+ return gl::NoError();
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h b/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h
index 5f74387fef7..19ded18c324 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h
@@ -178,6 +178,8 @@ class ContextNULL : public ContextImpl
std::vector<PathImpl *> createPaths(GLsizei range) override;
+ gl::Error dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ) override;
+
private:
gl::Caps mCaps;
gl::TextureCapsMap mTextureCaps;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.cpp
index d0deef647ef..fe97b667b2f 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.cpp
@@ -128,7 +128,8 @@ bool FramebufferNULL::checkStatus() const
return true;
}
-void FramebufferNULL::syncState(const gl::Framebuffer::DirtyBits &dirtyBits)
+void FramebufferNULL::syncState(ContextImpl *contextImpl,
+ const gl::Framebuffer::DirtyBits &dirtyBits)
{
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.h b/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.h
index a97e1eab652..cd48c25cc7e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/FramebufferNULL.h
@@ -62,7 +62,7 @@ class FramebufferNULL : public FramebufferImpl
bool checkStatus() const override;
- void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override;
+ void syncState(ContextImpl *contextImpl, const gl::Framebuffer::DirtyBits &dirtyBits) override;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp
index 838665079dc..35bd46db535 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp
@@ -38,6 +38,10 @@ void ProgramNULL::setBinaryRetrievableHint(bool retrievable)
{
}
+void ProgramNULL::setSeparable(bool separable)
+{
+}
+
LinkResult ProgramNULL::link(ContextImpl *contextImpl,
const gl::VaryingPacking &packing,
gl::InfoLog &infoLog)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h b/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h
index 502862fc556..88c0598ec1e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h
@@ -26,6 +26,7 @@ class ProgramNULL : public ProgramImpl
gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override;
+ void setSeparable(bool separable) override;
LinkResult link(ContextImpl *contextImpl,
const gl::VaryingPacking &packing,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.cpp
index 7d8e2d81b70..868269b9999 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.cpp
@@ -60,6 +60,12 @@ egl::Error SurfaceNULL::releaseTexImage(EGLint buffer)
return egl::NoError();
}
+egl::Error SurfaceNULL::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_BAD_ACCESS);
+}
+
void SurfaceNULL::setSwapInterval(EGLint interval)
{
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.h b/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.h
index c9420537474..4b084a32f9e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/SurfaceNULL.h
@@ -28,6 +28,7 @@ class SurfaceNULL : public SurfaceImpl
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
egl::Error releaseTexImage(EGLint buffer) override;
+ egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
void setSwapInterval(EGLint interval) override;
// width and height can change with client window resizing
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
index 828affbfae9..4bfcc2b0854 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -9,7 +9,7 @@
#include "libANGLE/renderer/vulkan/ContextVk.h"
-#include "common/BitSetIterator.h"
+#include "common/bitset_utils.h"
#include "common/debug.h"
#include "libANGLE/Program.h"
#include "libANGLE/renderer/vulkan/BufferVk.h"
@@ -35,13 +35,13 @@ namespace rx
{
ContextVk::ContextVk(const gl::ContextState &state, RendererVk *renderer)
- : ContextImpl(state), mRenderer(renderer)
+ : ContextImpl(state), mRenderer(renderer), mCurrentDrawMode(GL_NONE)
{
}
ContextVk::~ContextVk()
{
- mCurrentPipeline.destroy(getDevice());
+ invalidateCurrentPipeline();
}
gl::Error ContextVk::initialize()
@@ -61,8 +61,10 @@ gl::Error ContextVk::finish()
return gl::Error(GL_INVALID_OPERATION);
}
-gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
+gl::Error ContextVk::initPipeline()
{
+ ASSERT(!mCurrentPipeline.valid());
+
VkDevice device = mRenderer->getDevice();
const auto &state = mState.getState();
const auto &programGL = state.getProgram();
@@ -72,7 +74,6 @@ gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
const auto &programVk = GetImplAs<ProgramVk>(programGL);
const auto *drawFBO = state.getDrawFramebuffer();
FramebufferVk *vkFBO = GetImplAs<FramebufferVk>(drawFBO);
- Serial queueSerial = mRenderer->getCurrentQueueSerial();
// { vertex, fragment }
VkPipelineShaderStageCreateInfo shaderStages[2];
@@ -97,8 +98,6 @@ gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
// TODO(jmadill): Caching with dirty bits.
std::vector<VkVertexInputBindingDescription> vertexBindings;
std::vector<VkVertexInputAttributeDescription> vertexAttribs;
- std::vector<VkBuffer> vertexHandles;
- std::vector<VkDeviceSize> vertexOffsets;
for (auto attribIndex : angle::IterateBitSet(programGL->getActiveAttribLocationsMask()))
{
@@ -123,15 +122,6 @@ gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
vertexBindings.push_back(bindingDesc);
vertexAttribs.push_back(attribDesc);
-
- // TODO(jmadill): Offset handling.
- gl::Buffer *bufferGL = binding.buffer.get();
- ASSERT(bufferGL);
- BufferVk *bufferVk = GetImplAs<BufferVk>(bufferGL);
- vertexHandles.push_back(bufferVk->getVkBuffer().getHandle());
- vertexOffsets.push_back(0);
-
- bufferVk->setQueueSerial(queueSerial);
}
else
{
@@ -153,7 +143,7 @@ gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
inputAssemblyState.sType = VK_STRUCTURE_TYPE_PIPELINE_INPUT_ASSEMBLY_STATE_CREATE_INFO;
inputAssemblyState.pNext = nullptr;
inputAssemblyState.flags = 0;
- inputAssemblyState.topology = gl_vk::GetPrimitiveTopology(mode);
+ inputAssemblyState.topology = gl_vk::GetPrimitiveTopology(mCurrentDrawMode);
inputAssemblyState.primitiveRestartEnable = VK_FALSE;
const gl::Rectangle &viewportGL = state.getViewport();
@@ -202,10 +192,10 @@ gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
multisampleState.sType = VK_STRUCTURE_TYPE_PIPELINE_MULTISAMPLE_STATE_CREATE_INFO;
multisampleState.pNext = nullptr;
multisampleState.flags = 0;
- multisampleState.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
- multisampleState.sampleShadingEnable = VK_FALSE;
- multisampleState.minSampleShading = 0.0f;
- multisampleState.pSampleMask = nullptr;
+ multisampleState.rasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
+ multisampleState.sampleShadingEnable = VK_FALSE;
+ multisampleState.minSampleShading = 0.0f;
+ multisampleState.pSampleMask = nullptr;
multisampleState.alphaToCoverageEnable = VK_FALSE;
multisampleState.alphaToOneEnable = VK_FALSE;
@@ -271,6 +261,59 @@ gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
mCurrentPipeline.retain(device, std::move(newPipeline));
+ return gl::NoError();
+}
+
+gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
+{
+ if (mode != mCurrentDrawMode)
+ {
+ invalidateCurrentPipeline();
+ mCurrentDrawMode = mode;
+ }
+
+ if (!mCurrentPipeline.valid())
+ {
+ ANGLE_TRY(initPipeline());
+ ASSERT(mCurrentPipeline.valid());
+ }
+
+ VkDevice device = mRenderer->getDevice();
+ const auto &state = mState.getState();
+ const auto &programGL = state.getProgram();
+ const auto &vao = state.getVertexArray();
+ const auto &attribs = vao->getVertexAttributes();
+ const auto &bindings = vao->getVertexBindings();
+ const auto *drawFBO = state.getDrawFramebuffer();
+ FramebufferVk *vkFBO = GetImplAs<FramebufferVk>(drawFBO);
+ Serial queueSerial = mRenderer->getCurrentQueueSerial();
+
+ // Process vertex attributes
+ // TODO(jmadill): Caching with dirty bits.
+ std::vector<VkBuffer> vertexHandles;
+ std::vector<VkDeviceSize> vertexOffsets;
+
+ for (auto attribIndex : angle::IterateBitSet(programGL->getActiveAttribLocationsMask()))
+ {
+ const auto &attrib = attribs[attribIndex];
+ const auto &binding = bindings[attrib.bindingIndex];
+ if (attrib.enabled)
+ {
+ // TODO(jmadill): Offset handling.
+ gl::Buffer *bufferGL = binding.buffer.get();
+ ASSERT(bufferGL);
+ BufferVk *bufferVk = GetImplAs<BufferVk>(bufferGL);
+ vertexHandles.push_back(bufferVk->getVkBuffer().getHandle());
+ vertexOffsets.push_back(0);
+
+ bufferVk->setQueueSerial(queueSerial);
+ }
+ else
+ {
+ UNIMPLEMENTED();
+ }
+ }
+
vk::CommandBuffer *commandBuffer = mRenderer->getCommandBuffer();
ANGLE_TRY(vkFBO->beginRenderPass(device, commandBuffer, queueSerial, state));
@@ -280,7 +323,7 @@ gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count)
commandBuffer->endRenderPass();
ANGLE_TRY(commandBuffer->end());
- ANGLE_TRY(mRenderer->submitAndFinishCommandBuffer(*commandBuffer));
+ ANGLE_TRY(submitCommands(*commandBuffer));
return gl::NoError();
}
@@ -338,8 +381,8 @@ vk::CommandBuffer *ContextVk::getCommandBuffer()
vk::Error ContextVk::submitCommands(const vk::CommandBuffer &commandBuffer)
{
- // TODO(jmadill): Command queuing.
- ANGLE_TRY(mRenderer->submitAndFinishCommandBuffer(commandBuffer));
+ setQueueSerial(mRenderer->getCurrentQueueSerial());
+ ANGLE_TRY(mRenderer->submitCommandBuffer(commandBuffer));
return vk::NoError();
}
@@ -388,9 +431,13 @@ void ContextVk::popGroupMarker()
UNIMPLEMENTED();
}
-void ContextVk::syncState(const gl::State::DirtyBits & /*dirtyBits*/)
+void ContextVk::syncState(const gl::State::DirtyBits &dirtyBits)
{
// TODO(jmadill): Vulkan dirty bits.
+ if (dirtyBits.any())
+ {
+ invalidateCurrentPipeline();
+ }
}
GLint ContextVk::getGPUDisjoint()
@@ -499,4 +546,16 @@ std::vector<PathImpl *> ContextVk::createPaths(GLsizei)
return std::vector<PathImpl *>();
}
+// TODO(jmadill): Use pipeline cache.
+void ContextVk::invalidateCurrentPipeline()
+{
+ mRenderer->enqueueGarbageOrDeleteNow(*this, mCurrentPipeline);
+}
+
+gl::Error ContextVk::dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
+{
+ UNIMPLEMENTED();
+ return gl::Error(GL_INVALID_OPERATION);
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h
index f5b56e19198..9c4fcd750b0 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h
@@ -19,7 +19,7 @@ namespace rx
{
class RendererVk;
-class ContextVk : public ContextImpl
+class ContextVk : public ContextImpl, public ResourceVk
{
public:
ContextVk(const gl::ContextState &state, RendererVk *renderer);
@@ -128,9 +128,17 @@ class ContextVk : public ContextImpl
RendererVk *getRenderer() { return mRenderer; }
+ // TODO(jmadill): Use pipeline cache.
+ void invalidateCurrentPipeline();
+
+ gl::Error dispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ) override;
+
private:
+ gl::Error initPipeline();
+
RendererVk *mRenderer;
vk::Pipeline mCurrentPipeline;
+ GLenum mCurrentDrawMode;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
index 2db9c7a4b5e..1752837f58e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp
@@ -78,22 +78,12 @@ FramebufferVk *FramebufferVk::CreateDefaultFBO(const gl::FramebufferState &state
}
FramebufferVk::FramebufferVk(const gl::FramebufferState &state)
- : FramebufferImpl(state),
- mBackbuffer(nullptr),
- mRenderPass(),
- mFramebuffer(),
- mDirtyRenderPass(true),
- mDirtyFramebuffer(true)
+ : FramebufferImpl(state), mBackbuffer(nullptr), mRenderPass(), mFramebuffer()
{
}
FramebufferVk::FramebufferVk(const gl::FramebufferState &state, WindowSurfaceVk *backbuffer)
- : FramebufferImpl(state),
- mBackbuffer(backbuffer),
- mRenderPass(),
- mFramebuffer(),
- mDirtyRenderPass(true),
- mDirtyFramebuffer(true)
+ : FramebufferImpl(state), mBackbuffer(backbuffer), mRenderPass(), mFramebuffer()
{
}
@@ -322,8 +312,10 @@ gl::Error FramebufferVk::readPixels(ContextImpl *context,
PackPixels(params, angleFormat, inputPitch, mapPointer, reinterpret_cast<uint8_t *>(pixels));
- stagingImage.getImage().destroy(renderer->getDevice());
stagingImage.getDeviceMemory().unmap(device);
+ renderer->enqueueGarbage(renderer->getCurrentQueueSerial(), std::move(stagingImage));
+
+ stagingImage.getImage().destroy(renderer->getDevice());
stagingImage.destroy(device);
@@ -346,16 +338,23 @@ bool FramebufferVk::checkStatus() const
return bool();
}
-void FramebufferVk::syncState(const gl::Framebuffer::DirtyBits &dirtyBits)
+void FramebufferVk::syncState(ContextImpl *contextImpl, const gl::Framebuffer::DirtyBits &dirtyBits)
{
+ auto contextVk = GetAs<ContextVk>(contextImpl);
+
+ ASSERT(dirtyBits.any());
+
// TODO(jmadill): Smarter update.
- mDirtyRenderPass = true;
- mDirtyFramebuffer = true;
+ mRenderPass.destroy(contextVk->getDevice());
+ mFramebuffer.destroy(contextVk->getDevice());
+
+ // TODO(jmadill): Use pipeline cache.
+ contextVk->invalidateCurrentPipeline();
}
gl::ErrorOrResult<vk::RenderPass *> FramebufferVk::getRenderPass(VkDevice device)
{
- if (mRenderPass.valid() && !mDirtyRenderPass)
+ if (mRenderPass.valid())
{
return &mRenderPass;
}
@@ -459,15 +458,13 @@ gl::ErrorOrResult<vk::RenderPass *> FramebufferVk::getRenderPass(VkDevice device
mRenderPass.retain(device, std::move(renderPass));
- mDirtyRenderPass = false;
-
return &mRenderPass;
}
gl::ErrorOrResult<vk::Framebuffer *> FramebufferVk::getFramebuffer(VkDevice device)
{
// If we've already created our cached Framebuffer, return it.
- if (mFramebuffer.valid() && !mDirtyFramebuffer)
+ if (mFramebuffer.valid())
{
return &mFramebuffer;
}
@@ -530,8 +527,6 @@ gl::ErrorOrResult<vk::Framebuffer *> FramebufferVk::getFramebuffer(VkDevice devi
mFramebuffer.retain(device, std::move(framebuffer));
- mDirtyFramebuffer = false;
-
return &mFramebuffer;
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h
index ece24e5296c..95e04c2e271 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h
@@ -75,7 +75,7 @@ class FramebufferVk : public FramebufferImpl, public ResourceVk
bool checkStatus() const override;
- void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override;
+ void syncState(ContextImpl *contextImpl, const gl::Framebuffer::DirtyBits &dirtyBits) override;
gl::Error getSamplePosition(size_t index, GLfloat *xy) const override;
@@ -96,8 +96,6 @@ class FramebufferVk : public FramebufferImpl, public ResourceVk
vk::RenderPass mRenderPass;
vk::Framebuffer mFramebuffer;
- bool mDirtyRenderPass;
- bool mDirtyFramebuffer;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp
index d9767da459f..6e53883df81 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp
@@ -53,6 +53,11 @@ void ProgramVk::setBinaryRetrievableHint(bool retrievable)
UNIMPLEMENTED();
}
+void ProgramVk::setSeparable(bool separable)
+{
+ UNIMPLEMENTED();
+}
+
LinkResult ProgramVk::link(ContextImpl *contextImpl,
const gl::VaryingPacking &packing,
gl::InfoLog &infoLog)
@@ -103,6 +108,9 @@ LinkResult ProgramVk::link(ContextImpl *contextImpl,
mLinkedVertexModule.retain(device, std::move(vertexModule));
mLinkedFragmentModule.retain(device, std::move(fragmentModule));
+ // TODO(jmadill): Use pipeline cache.
+ context->invalidateCurrentPipeline();
+
return true;
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h
index dd933c579fd..ff8efc5d2d0 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h
@@ -28,6 +28,7 @@ class ProgramVk : public ProgramImpl
gl::BinaryInputStream *stream) override;
gl::Error save(gl::BinaryOutputStream *stream) override;
void setBinaryRetrievableHint(bool retrievable) override;
+ void setSeparable(bool separable) override;
LinkResult link(ContextImpl *contextImpl,
const gl::VaryingPacking &packing,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp
index 490fad3156e..1ca624922a3 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp
@@ -576,7 +576,7 @@ vk::CommandBuffer *RendererVk::getCommandBuffer()
return &mCommandBuffer;
}
-vk::Error RendererVk::submitAndFinishCommandBuffer(const vk::CommandBuffer &commandBuffer)
+vk::Error RendererVk::submitCommandBuffer(const vk::CommandBuffer &commandBuffer)
{
VkFenceCreateInfo fenceInfo;
fenceInfo.sType = VK_STRUCTURE_TYPE_FENCE_CREATE_INFO;
@@ -599,49 +599,52 @@ vk::Error RendererVk::submitAndFinishCommandBuffer(const vk::CommandBuffer &comm
// TODO(jmadill): Investigate how to properly submit command buffers.
ANGLE_TRY(submit(submitInfo));
- // Wait indefinitely for the queue to finish.
+ return vk::NoError();
+}
+
+vk::Error RendererVk::submitAndFinishCommandBuffer(const vk::CommandBuffer &commandBuffer)
+{
+ ANGLE_TRY(submitCommandBuffer(commandBuffer));
ANGLE_TRY(finish());
return vk::NoError();
}
-vk::Error RendererVk::waitThenFinishCommandBuffer(const vk::CommandBuffer &commandBuffer,
- const vk::Semaphore &waitSemaphore)
+vk::Error RendererVk::submitCommandsWithSync(const vk::CommandBuffer &commandBuffer,
+ const vk::Semaphore &waitSemaphore,
+ const vk::Semaphore &signalSemaphore)
{
- VkCommandBuffer commandBufferHandle = commandBuffer.getHandle();
- VkSemaphore waitHandle = waitSemaphore.getHandle();
VkPipelineStageFlags waitStageMask = VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT;
VkSubmitInfo submitInfo;
submitInfo.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO;
submitInfo.pNext = nullptr;
submitInfo.waitSemaphoreCount = 1;
- submitInfo.pWaitSemaphores = &waitHandle;
+ submitInfo.pWaitSemaphores = waitSemaphore.ptr();
submitInfo.pWaitDstStageMask = &waitStageMask;
submitInfo.commandBufferCount = 1;
- submitInfo.pCommandBuffers = &commandBufferHandle;
- submitInfo.signalSemaphoreCount = 0;
- submitInfo.pSignalSemaphores = nullptr;
+ submitInfo.pCommandBuffers = commandBuffer.ptr();
+ submitInfo.signalSemaphoreCount = 1;
+ submitInfo.pSignalSemaphores = signalSemaphore.ptr();
// TODO(jmadill): Investigate how to properly queue command buffer work.
ANGLE_TRY(submit(submitInfo));
- // Wait indefinitely for the queue to finish.
- ANGLE_TRY(finish());
-
return vk::NoError();
}
vk::Error RendererVk::finish()
{
ASSERT(mQueue != VK_NULL_HANDLE);
- checkInFlightCommands();
ANGLE_VK_TRY(vkQueueWaitIdle(mQueue));
+ checkInFlightCommands();
return vk::NoError();
}
vk::Error RendererVk::checkInFlightCommands()
{
+ bool anyFinished = false;
+
// Check if any in-flight command buffers are finished.
for (size_t index = 0; index < mInFlightCommands.size();)
{
@@ -655,6 +658,7 @@ vk::Error RendererVk::checkInFlightCommands()
mLastCompletedQueueSerial = inFlightCommand->queueSerial();
inFlightCommand->destroy(mDevice);
mInFlightCommands.erase(mInFlightCommands.begin() + index);
+ anyFinished = true;
}
else
{
@@ -662,6 +666,22 @@ vk::Error RendererVk::checkInFlightCommands()
}
}
+ if (anyFinished)
+ {
+ size_t freeIndex = 0;
+ for (; freeIndex < mGarbage.size(); ++freeIndex)
+ {
+ if (!mGarbage[freeIndex]->destroyIfComplete(mDevice, mLastCompletedQueueSerial))
+ break;
+ }
+
+ // Remove the entries from the garbage list - they should be ready to go.
+ if (freeIndex > 0)
+ {
+ mGarbage.erase(mGarbage.begin(), mGarbage.begin() + freeIndex);
+ }
+ }
+
return vk::NoError();
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.h
index 5ff84548ed2..f0405caef16 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/RendererVk.h
@@ -51,9 +51,11 @@ class RendererVk : angle::NonCopyable
// TODO(jmadill): Use ContextImpl for command buffers to enable threaded contexts.
vk::CommandBuffer *getCommandBuffer();
+ vk::Error submitCommandBuffer(const vk::CommandBuffer &commandBuffer);
vk::Error submitAndFinishCommandBuffer(const vk::CommandBuffer &commandBuffer);
- vk::Error waitThenFinishCommandBuffer(const vk::CommandBuffer &commandBuffer,
- const vk::Semaphore &waitSemaphore);
+ vk::Error submitCommandsWithSync(const vk::CommandBuffer &commandBuffer,
+ const vk::Semaphore &waitSemaphore,
+ const vk::Semaphore &signalSemaphore);
vk::Error finish();
const gl::Caps &getNativeCaps() const;
@@ -70,6 +72,26 @@ class RendererVk : angle::NonCopyable
Serial getCurrentQueueSerial() const;
+ template <typename T>
+ void enqueueGarbage(Serial serial, T &&object)
+ {
+ mGarbage.emplace_back(std::unique_ptr<vk::GarbageObject<T>>(
+ new vk::GarbageObject<T>(serial, std::move(object))));
+ }
+
+ template <typename T>
+ void enqueueGarbageOrDeleteNow(const ResourceVk &resouce, T &&object)
+ {
+ if (resouce.getDeleteSchedule(mLastCompletedQueueSerial) == DeleteSchedule::NOW)
+ {
+ object.destroy(mDevice);
+ }
+ else
+ {
+ enqueueGarbage(resouce.getStoredQueueSerial(), std::move(object));
+ }
+ }
+
private:
void ensureCapsInitialized() const;
void generateCaps(gl::Caps *outCaps,
@@ -103,6 +125,7 @@ class RendererVk : angle::NonCopyable
Serial mCurrentQueueSerial;
Serial mLastCompletedQueueSerial;
std::vector<vk::FenceAndCommandBuffer> mInFlightCommands;
+ std::vector<std::unique_ptr<vk::IGarbageObject>> mGarbage;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp
index 355c036d1da..04fcffee30e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp
@@ -104,6 +104,14 @@ egl::Error OffscreenSurfaceVk::releaseTexImage(EGLint /*buffer*/)
return egl::Error(EGL_SUCCESS);
}
+egl::Error OffscreenSurfaceVk::getSyncValues(EGLuint64KHR * /*ust*/,
+ EGLuint64KHR * /*msc*/,
+ EGLuint64KHR * /*sbc*/)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_BAD_ACCESS);
+}
+
void OffscreenSurfaceVk::setSwapInterval(EGLint /*interval*/)
{
}
@@ -166,7 +174,10 @@ void WindowSurfaceVk::destroy(const DisplayImpl *displayImpl)
VkDevice device = rendererVk->getDevice();
VkInstance instance = rendererVk->getInstance();
- mPresentCompleteSemaphore.destroy(device);
+ rendererVk->finish();
+
+ mImageAvailableSemaphore.destroy(device);
+ mRenderingCompleteSemaphore.destroy(device);
for (auto &imageView : mSwapchainImageViews)
{
@@ -396,7 +407,10 @@ vk::Error WindowSurfaceVk::initializeImpl(RendererVk *renderer)
ANGLE_TRY(commandBuffer->end());
ANGLE_TRY(renderer->submitAndFinishCommandBuffer(*commandBuffer));
- // Start by getting the next available swapchain image.
+ ANGLE_TRY(mImageAvailableSemaphore.init(device));
+ ANGLE_TRY(mRenderingCompleteSemaphore.init(device));
+
+ // Get the first available swapchain iamge.
ANGLE_TRY(nextSwapchainImage(renderer));
return vk::NoError();
@@ -425,13 +439,14 @@ vk::Error WindowSurfaceVk::swapImpl(RendererVk *renderer)
VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, currentCB);
currentCB->end();
- ANGLE_TRY(renderer->waitThenFinishCommandBuffer(*currentCB, mPresentCompleteSemaphore));
+ ANGLE_TRY(renderer->submitCommandsWithSync(*currentCB, mImageAvailableSemaphore,
+ mRenderingCompleteSemaphore));
VkPresentInfoKHR presentInfo;
presentInfo.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR;
presentInfo.pNext = nullptr;
- presentInfo.waitSemaphoreCount = 0;
- presentInfo.pWaitSemaphores = nullptr;
+ presentInfo.waitSemaphoreCount = 1;
+ presentInfo.pWaitSemaphores = mRenderingCompleteSemaphore.ptr();
presentInfo.swapchainCount = 1;
presentInfo.pSwapchains = &mSwapchain;
presentInfo.pImageIndices = &mCurrentSwapchainImageIndex;
@@ -449,15 +464,10 @@ vk::Error WindowSurfaceVk::nextSwapchainImage(RendererVk *renderer)
{
VkDevice device = renderer->getDevice();
- vk::Semaphore presentComplete;
- ANGLE_TRY(presentComplete.init(device));
-
ANGLE_VK_TRY(vkAcquireNextImageKHR(device, mSwapchain, std::numeric_limits<uint64_t>::max(),
- presentComplete.getHandle(), VK_NULL_HANDLE,
+ mImageAvailableSemaphore.getHandle(), VK_NULL_HANDLE,
&mCurrentSwapchainImageIndex));
- mPresentCompleteSemaphore.retain(device, std::move(presentComplete));
-
// Update RenderTarget pointers.
mRenderTarget.image = &mSwapchainImages[mCurrentSwapchainImageIndex];
mRenderTarget.imageView = &mSwapchainImageViews[mCurrentSwapchainImageIndex];
@@ -487,6 +497,14 @@ egl::Error WindowSurfaceVk::releaseTexImage(EGLint buffer)
return egl::Error(EGL_SUCCESS);
}
+egl::Error WindowSurfaceVk::getSyncValues(EGLuint64KHR * /*ust*/,
+ EGLuint64KHR * /*msc*/,
+ EGLuint64KHR * /*sbc*/)
+{
+ UNIMPLEMENTED();
+ return egl::Error(EGL_BAD_ACCESS);
+}
+
void WindowSurfaceVk::setSwapInterval(EGLint interval)
{
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h
index 55d0029bccb..fc10461c090 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h
@@ -33,6 +33,7 @@ class OffscreenSurfaceVk : public SurfaceImpl
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
egl::Error releaseTexImage(EGLint buffer) override;
+ egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
void setSwapInterval(EGLint interval) override;
// width and height can change with client window resizing
@@ -68,6 +69,7 @@ class WindowSurfaceVk : public SurfaceImpl, public ResourceVk
egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override;
egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override;
egl::Error releaseTexImage(EGLint buffer) override;
+ egl::Error getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc) override;
void setSwapInterval(EGLint interval) override;
// width and height can change with client window resizing
@@ -94,7 +96,8 @@ class WindowSurfaceVk : public SurfaceImpl, public ResourceVk
VkSwapchainKHR mSwapchain;
RenderTargetVk mRenderTarget;
- vk::Semaphore mPresentCompleteSemaphore;
+ vk::Semaphore mImageAvailableSemaphore;
+ vk::Semaphore mRenderingCompleteSemaphore;
uint32_t mCurrentSwapchainImageIndex;
std::vector<vk::Image> mSwapchainImages;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
index 9f639b95148..e835be7faad 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp
@@ -11,6 +11,8 @@
#include "common/debug.h"
+#include "libANGLE/renderer/vulkan/ContextVk.h"
+
namespace rx
{
@@ -22,4 +24,13 @@ VertexArrayVk::~VertexArrayVk()
{
}
+void VertexArrayVk::syncState(ContextImpl *contextImpl, const gl::VertexArray::DirtyBits &dirtyBits)
+{
+ ASSERT(dirtyBits.any());
+
+ // TODO(jmadill): Use pipeline cache.
+ auto contextVk = GetAs<ContextVk>(contextImpl);
+ contextVk->invalidateCurrentPipeline();
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h
index 9340d2757a4..7592bc0dff3 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h
@@ -20,6 +20,8 @@ class VertexArrayVk : public VertexArrayImpl
public:
VertexArrayVk(const gl::VertexArrayState &data);
~VertexArrayVk() override;
+
+ void syncState(ContextImpl *contextImpl, const gl::VertexArray::DirtyBits &dirtyBits) override;
};
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.cpp
index ac85f63284f..8ad3f2198b1 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.cpp
@@ -664,6 +664,14 @@ StagingImage::StagingImage() : mSize(0)
{
}
+StagingImage::StagingImage(StagingImage &&other)
+ : mImage(std::move(other.mImage)),
+ mDeviceMemory(std::move(other.mDeviceMemory)),
+ mSize(other.mSize)
+{
+ other.mSize = 0;
+}
+
void StagingImage::destroy(VkDevice device)
{
mImage.destroy(device);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.h
index a28bda0819d..b310699babd 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/renderervk_utils.h
@@ -88,7 +88,7 @@ class ResourceVk
mStoredQueueSerial = queueSerial;
}
- DeleteSchedule getDeleteSchedule(Serial lastCompletedQueueSerial)
+ DeleteSchedule getDeleteSchedule(Serial lastCompletedQueueSerial) const
{
if (lastCompletedQueueSerial >= mStoredQueueSerial)
{
@@ -100,6 +100,8 @@ class ResourceVk
}
}
+ Serial getStoredQueueSerial() const { return mStoredQueueSerial; }
+
private:
Serial mStoredQueueSerial;
};
@@ -159,6 +161,8 @@ class WrappedObject : angle::NonCopyable
HandleT getHandle() const { return mHandle; }
bool valid() const { return (mHandle != VK_NULL_HANDLE); }
+ const HandleT *ptr() const { return &mHandle; }
+
protected:
WrappedObject() : mHandle(VK_NULL_HANDLE) {}
WrappedObject(HandleT handle) : mHandle(handle) {}
@@ -342,6 +346,7 @@ class StagingImage final : angle::NonCopyable
{
public:
StagingImage();
+ StagingImage(StagingImage &&other);
void destroy(VkDevice device);
void retain(VkDevice device, StagingImage &&other);
@@ -441,6 +446,34 @@ class FenceAndCommandBuffer final : angle::NonCopyable
CommandBuffer mCommandBuffer;
};
+class IGarbageObject : angle::NonCopyable
+{
+ public:
+ virtual bool destroyIfComplete(VkDevice device, Serial completedSerial) = 0;
+};
+
+template <typename T>
+class GarbageObject final : public IGarbageObject
+{
+ public:
+ GarbageObject(Serial serial, T &&object) : mSerial(serial), mObject(std::move(object)) {}
+
+ bool destroyIfComplete(VkDevice device, Serial completedSerial) override
+ {
+ if (completedSerial >= mSerial)
+ {
+ mObject.destroy(device);
+ return true;
+ }
+
+ return false;
+ }
+
+ private:
+ Serial mSerial;
+ T mObject;
+};
+
} // namespace vk
Optional<uint32_t> FindMemoryType(const VkPhysicalDeviceMemoryProperties &memoryProps,
diff --git a/chromium/third_party/angle/src/libANGLE/signal_utils.cpp b/chromium/third_party/angle/src/libANGLE/signal_utils.cpp
deleted file mode 100644
index 62d45b953fc..00000000000
--- a/chromium/third_party/angle/src/libANGLE/signal_utils.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-//
-// Copyright 2016 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.
-//
-// signal_utils:
-// Helper classes for tracking dependent state changes between objects.
-// These changes are signaled to the dependent class via channels.
-
-#include "libANGLE/signal_utils.h"
-
-#include <algorithm>
-
-#include "common/debug.h"
-
-namespace angle
-{
-
-BroadcastChannel::BroadcastChannel()
-{
-}
-
-BroadcastChannel::~BroadcastChannel()
-{
- reset();
-}
-
-void BroadcastChannel::addReceiver(ChannelBinding *receiver)
-{
- ASSERT(std::find(mReceivers.begin(), mReceivers.end(), receiver) == mReceivers.end());
- mReceivers.push_back(receiver);
-}
-
-void BroadcastChannel::removeReceiver(ChannelBinding *receiver)
-{
- auto iter = std::find(mReceivers.begin(), mReceivers.end(), receiver);
- ASSERT(iter != mReceivers.end());
- mReceivers.erase(iter);
-}
-
-void BroadcastChannel::signal() const
-{
- if (mReceivers.empty())
- return;
-
- for (const auto *receiver : mReceivers)
- {
- receiver->signal();
- }
-}
-
-void BroadcastChannel::reset()
-{
- for (auto receiver : mReceivers)
- {
- receiver->onChannelClosed();
- }
- mReceivers.clear();
-}
-
-ChannelBinding::ChannelBinding(SignalReceiver *receiver, SignalToken token)
- : mChannel(nullptr), mReceiver(receiver), mToken(token)
-{
- ASSERT(receiver);
-}
-
-ChannelBinding::~ChannelBinding()
-{
- reset();
-}
-
-void ChannelBinding::bind(BroadcastChannel *channel)
-{
- ASSERT(mReceiver);
- if (mChannel)
- {
- mChannel->removeReceiver(this);
- }
-
- mChannel = channel;
-
- if (mChannel)
- {
- mChannel->addReceiver(this);
- }
-}
-
-void ChannelBinding::reset()
-{
- bind(nullptr);
-}
-
-void ChannelBinding::signal() const
-{
- mReceiver->signal(mToken);
-}
-
-void ChannelBinding::onChannelClosed()
-{
- mChannel = nullptr;
-}
-
-} // namespace angle
diff --git a/chromium/third_party/angle/src/libANGLE/signal_utils.h b/chromium/third_party/angle/src/libANGLE/signal_utils.h
index 835f2c602d2..84d74787629 100644
--- a/chromium/third_party/angle/src/libANGLE/signal_utils.h
+++ b/chromium/third_party/angle/src/libANGLE/signal_utils.h
@@ -13,62 +13,165 @@
#include <set>
#include "common/angleutils.h"
+#include "common/debug.h"
namespace angle
{
-// Message token passed to the receiver;
-using SignalToken = uint32_t;
-
// Interface that the depending class inherits from.
+template <typename ChannelID = uint32_t, typename... MessageT>
class SignalReceiver
{
public:
virtual ~SignalReceiver() = default;
- virtual void signal(SignalToken token) = 0;
+ virtual void signal(ChannelID channelID, MessageT... message) = 0;
};
+template <typename ChannelID, typename... MessageT>
class ChannelBinding;
// The host class owns the channel. It uses the channel to fire signals to the receiver.
+template <typename ChannelID = uint32_t, typename... MessageT>
class BroadcastChannel final : NonCopyable
{
public:
BroadcastChannel();
~BroadcastChannel();
- void signal() const;
+ void signal(MessageT... message) const;
+
void reset();
private:
// Only the ChannelBinding class should add or remove receivers.
- friend class ChannelBinding;
- void addReceiver(ChannelBinding *receiver);
- void removeReceiver(ChannelBinding *receiver);
+ friend class ChannelBinding<ChannelID, MessageT...>;
+ void addReceiver(ChannelBinding<ChannelID, MessageT...> *receiver);
+ void removeReceiver(ChannelBinding<ChannelID, MessageT...> *receiver);
- std::vector<ChannelBinding *> mReceivers;
+ std::vector<ChannelBinding<ChannelID, MessageT...> *> mReceivers;
};
+template <typename ChannelID, typename... MessageT>
+BroadcastChannel<ChannelID, MessageT...>::BroadcastChannel()
+{
+}
+
+template <typename ChannelID, typename... MessageT>
+BroadcastChannel<ChannelID, MessageT...>::~BroadcastChannel()
+{
+ reset();
+}
+
+template <typename ChannelID, typename... MessageT>
+void BroadcastChannel<ChannelID, MessageT...>::addReceiver(
+ ChannelBinding<ChannelID, MessageT...> *receiver)
+{
+ ASSERT(std::find(mReceivers.begin(), mReceivers.end(), receiver) == mReceivers.end());
+ mReceivers.push_back(receiver);
+}
+
+template <typename ChannelID, typename... MessageT>
+void BroadcastChannel<ChannelID, MessageT...>::removeReceiver(
+ ChannelBinding<ChannelID, MessageT...> *receiver)
+{
+ auto iter = std::find(mReceivers.begin(), mReceivers.end(), receiver);
+ ASSERT(iter != mReceivers.end());
+ mReceivers.erase(iter);
+}
+
+template <typename ChannelID, typename... MessageT>
+void BroadcastChannel<ChannelID, MessageT...>::signal(MessageT... message) const
+{
+ if (mReceivers.empty())
+ return;
+
+ for (const auto *receiver : mReceivers)
+ {
+ receiver->signal(message...);
+ }
+}
+
+template <typename ChannelID, typename... MessageT>
+void BroadcastChannel<ChannelID, MessageT...>::reset()
+{
+ for (auto receiver : mReceivers)
+ {
+ receiver->onChannelClosed();
+ }
+ mReceivers.clear();
+}
+
// The dependent class keeps bindings to the host's BroadcastChannel.
+template <typename ChannelID = uint32_t, typename... MessageT>
class ChannelBinding final
{
public:
- ChannelBinding(SignalReceiver *receiver, SignalToken token);
+ ChannelBinding(SignalReceiver<ChannelID, MessageT...> *receiver, ChannelID channelID);
~ChannelBinding();
ChannelBinding(const ChannelBinding &other) = default;
ChannelBinding &operator=(const ChannelBinding &other) = default;
- void bind(BroadcastChannel *channel);
+ void bind(BroadcastChannel<ChannelID, MessageT...> *channel);
void reset();
- void signal() const;
+ void signal(MessageT... message) const;
void onChannelClosed();
private:
- BroadcastChannel *mChannel;
- SignalReceiver *mReceiver;
- SignalToken mToken;
+ BroadcastChannel<ChannelID, MessageT...> *mChannel;
+ SignalReceiver<ChannelID, MessageT...> *mReceiver;
+ ChannelID mChannelID;
};
+template <typename ChannelID, typename... MessageT>
+ChannelBinding<ChannelID, MessageT...>::ChannelBinding(
+ SignalReceiver<ChannelID, MessageT...> *receiver,
+ ChannelID channelID)
+ : mChannel(nullptr), mReceiver(receiver), mChannelID(channelID)
+{
+ ASSERT(receiver);
+}
+
+template <typename ChannelID, typename... MessageT>
+ChannelBinding<ChannelID, MessageT...>::~ChannelBinding()
+{
+ reset();
+}
+
+template <typename ChannelID, typename... MessageT>
+void ChannelBinding<ChannelID, MessageT...>::bind(BroadcastChannel<ChannelID, MessageT...> *channel)
+{
+ ASSERT(mReceiver);
+ if (mChannel)
+ {
+ mChannel->removeReceiver(this);
+ }
+
+ mChannel = channel;
+
+ if (mChannel)
+ {
+ mChannel->addReceiver(this);
+ }
+}
+
+template <typename ChannelID, typename... MessageT>
+void ChannelBinding<ChannelID, MessageT...>::reset()
+{
+ bind(nullptr);
+}
+
+template <typename ChannelID, typename... MessageT>
+void ChannelBinding<ChannelID, MessageT...>::signal(MessageT... message) const
+{
+ mReceiver->signal(mChannelID, message...);
+}
+
+template <typename ChannelID, typename... MessageT>
+void ChannelBinding<ChannelID, MessageT...>::onChannelClosed()
+{
+ mChannel = nullptr;
+}
+
} // namespace angle
#endif // LIBANGLE_SIGNAL_UTILS_H_
diff --git a/chromium/third_party/angle/src/libANGLE/signal_utils_unittest.cpp b/chromium/third_party/angle/src/libANGLE/signal_utils_unittest.cpp
index fac9b67df43..06cb3922916 100644
--- a/chromium/third_party/angle/src/libANGLE/signal_utils_unittest.cpp
+++ b/chromium/third_party/angle/src/libANGLE/signal_utils_unittest.cpp
@@ -16,18 +16,18 @@ using namespace testing;
namespace
{
-struct SignalThing : public SignalReceiver
+struct SignalThing : public SignalReceiver<>
{
- void signal(SignalToken token) override { wasSignaled = true; }
+ void signal(uint32_t channelID) override { wasSignaled = true; }
bool wasSignaled = false;
};
// Test that broadcast signals work.
TEST(SignalTest, BroadcastSignals)
{
- BroadcastChannel channel;
+ BroadcastChannel<> channel;
SignalThing thing;
- ChannelBinding binding(&thing, 0u);
+ ChannelBinding<> binding(&thing, 0u);
binding.bind(&channel);
ASSERT_FALSE(thing.wasSignaled);
diff --git a/chromium/third_party/angle/src/libANGLE/validationEGL.cpp b/chromium/third_party/angle/src/libANGLE/validationEGL.cpp
index 621928d1a6a..2619a3a0ed5 100644
--- a/chromium/third_party/angle/src/libANGLE/validationEGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationEGL.cpp
@@ -464,6 +464,21 @@ Error ValidateCreateContext(Display *display, Config *configuration, gl::Context
}
break;
+ case EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE:
+ if (!display->getExtensions().createContextRobustResourceInitialization)
+ {
+ return Error(EGL_BAD_ATTRIBUTE,
+ "Attribute EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE "
+ "requires EGL_ANGLE_create_context_robust_resource_initialization.");
+ }
+ if (value != EGL_TRUE && value != EGL_FALSE)
+ {
+ return Error(EGL_BAD_ATTRIBUTE,
+ "EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE must be "
+ "either EGL_TRUE or EGL_FALSE.");
+ }
+ break;
+
default:
return Error(EGL_BAD_ATTRIBUTE, "Unknown attribute.");
}
@@ -1780,6 +1795,54 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display,
return stream->validateD3D11NV12Texture(texture);
}
+Error ValidateGetSyncValuesCHROMIUM(const Display *display,
+ const Surface *surface,
+ const EGLuint64KHR *ust,
+ const EGLuint64KHR *msc,
+ const EGLuint64KHR *sbc)
+{
+ ANGLE_TRY(ValidateDisplay(display));
+
+ const DisplayExtensions &displayExtensions = display->getExtensions();
+ if (!displayExtensions.getSyncValues)
+ {
+ return Error(EGL_BAD_ACCESS, "getSyncValues extension not active");
+ }
+
+ if (display->isDeviceLost())
+ {
+ return Error(EGL_CONTEXT_LOST, "Context is lost.");
+ }
+
+ if (surface == EGL_NO_SURFACE)
+ {
+ return Error(EGL_BAD_SURFACE, "getSyncValues surface cannot be EGL_NO_SURFACE");
+ }
+
+ if (!surface->directComposition())
+ {
+ return Error(EGL_BAD_SURFACE,
+ "getSyncValues surface requires Direct Composition to be enabled");
+ }
+
+ if (ust == nullptr)
+ {
+ return egl::Error(EGL_BAD_PARAMETER, "ust is null");
+ }
+
+ if (msc == nullptr)
+ {
+ return egl::Error(EGL_BAD_PARAMETER, "msc is null");
+ }
+
+ if (sbc == nullptr)
+ {
+ return egl::Error(EGL_BAD_PARAMETER, "sbc is null");
+ }
+
+ return Error(EGL_SUCCESS);
+}
+
Error ValidateSwapBuffersWithDamageEXT(const Display *display,
const Surface *surface,
EGLint *rects,
diff --git a/chromium/third_party/angle/src/libANGLE/validationEGL.h b/chromium/third_party/angle/src/libANGLE/validationEGL.h
index 3ed8497f5b6..7c5dbe640a1 100644
--- a/chromium/third_party/angle/src/libANGLE/validationEGL.h
+++ b/chromium/third_party/angle/src/libANGLE/validationEGL.h
@@ -98,6 +98,12 @@ Error ValidateStreamPostD3DTextureNV12ANGLE(const Display *display,
void *texture,
const AttributeMap &attribs);
+Error ValidateGetSyncValuesCHROMIUM(const Display *display,
+ const Surface *surface,
+ const EGLuint64KHR *ust,
+ const EGLuint64KHR *msc,
+ const EGLuint64KHR *sbc);
+
Error ValidateSwapBuffersWithDamageEXT(const Display *display,
const Surface *surface,
EGLint *rects,
diff --git a/chromium/third_party/angle/src/libANGLE/validationES.cpp b/chromium/third_party/angle/src/libANGLE/validationES.cpp
index 2a911a7eea0..a72c409a04e 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES.cpp
@@ -216,6 +216,9 @@ bool ValidCap(const Context *context, GLenum cap, bool queryOnly)
case GL_SAMPLE_MASK:
return context->getClientVersion() >= Version(3, 1);
+ case GL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE:
+ return queryOnly && context->getExtensions().robustResourceInitialization;
+
default:
return false;
}
@@ -230,12 +233,22 @@ bool ValidateReadPixelsBase(ValidationContext *context,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
GLvoid *pixels)
{
if (length != nullptr)
{
*length = 0;
}
+ if (rows != nullptr)
+ {
+ *rows = 0;
+ }
+ if (columns != nullptr)
+ {
+ *columns = 0;
+ }
if (width < 0 || height < 0)
{
@@ -245,13 +258,13 @@ bool ValidateReadPixelsBase(ValidationContext *context,
auto readFramebuffer = context->getGLState().getReadFramebuffer();
- if (readFramebuffer->checkStatus(context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
}
- if (readFramebuffer->id() != 0 && readFramebuffer->getSamples(context->getContextState()) != 0)
+ if (readFramebuffer->id() != 0 && readFramebuffer->getSamples(context) != 0)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
@@ -317,8 +330,7 @@ bool ValidateReadPixelsBase(ValidationContext *context,
size_t endByte = endByteOrErr.getResult();
if (bufSize >= 0)
{
-
- if (static_cast<size_t>(bufSize) < endByte)
+ if (pixelPackBuffer == nullptr && static_cast<size_t>(bufSize) < endByte)
{
context->handleError(
Error(GL_INVALID_OPERATION, "bufSize must be at least %u bytes.", endByte));
@@ -341,7 +353,7 @@ bool ValidateReadPixelsBase(ValidationContext *context,
}
}
- if (length != nullptr)
+ if (pixelPackBuffer == nullptr && length != nullptr)
{
if (endByte > static_cast<size_t>(std::numeric_limits<GLsizei>::max()))
{
@@ -353,6 +365,39 @@ bool ValidateReadPixelsBase(ValidationContext *context,
*length = static_cast<GLsizei>(endByte);
}
+ auto getClippedExtent = [](GLint start, GLsizei length, int bufferSize) {
+ angle::CheckedNumeric<int> clippedExtent(length);
+ if (start < 0)
+ {
+ // "subtract" the area that is less than 0
+ clippedExtent += start;
+ }
+
+ const int readExtent = start + length;
+ if (readExtent > bufferSize)
+ {
+ // Subtract the region to the right of the read buffer
+ clippedExtent -= (readExtent - bufferSize);
+ }
+
+ if (!clippedExtent.IsValid())
+ {
+ return 0;
+ }
+
+ return std::max(clippedExtent.ValueOrDie(), 0);
+ };
+
+ if (columns != nullptr)
+ {
+ *columns = getClippedExtent(x, width, readBuffer->getSize().width);
+ }
+
+ if (rows != nullptr)
+ {
+ *rows = getClippedExtent(y, height, readBuffer->getSize().height);
+ }
+
return true;
}
@@ -1108,7 +1153,18 @@ bool ValidateGetVertexAttribBase(Context *context,
case GL_VERTEX_ATTRIB_ARRAY_INTEGER:
if (context->getClientMajorVersion() < 3)
{
- context->handleError(Error(GL_INVALID_ENUM, "pname requires OpenGL ES 3.0."));
+ context->handleError(Error(
+ GL_INVALID_ENUM, "GL_VERTEX_ATTRIB_ARRAY_INTEGER requires OpenGL ES 3.0."));
+ return false;
+ }
+ break;
+
+ case GL_VERTEX_ATTRIB_BINDING:
+ case GL_VERTEX_ATTRIB_RELATIVE_OFFSET:
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM, "Vertex Attrib Bindings require OpenGL ES 3.1."));
return false;
}
break;
@@ -1714,6 +1770,12 @@ bool CompressedTextureFormatRequiresExactSize(GLenum internalFormat)
case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE:
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_RGBA8_LOSSY_DECODE_ETC2_EAC_ANGLE:
+ case GL_COMPRESSED_SRGB8_ALPHA8_LOSSY_DECODE_ETC2_EAC_ANGLE:
return true;
default:
@@ -1847,6 +1909,53 @@ bool ValidQueryType(const Context *context, GLenum queryType)
}
}
+bool ValidateWebGLVertexAttribPointer(ValidationContext *context,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ const GLvoid *ptr,
+ bool pureInteger)
+{
+ ASSERT(context->getExtensions().webglCompatibility);
+
+ // WebGL 1.0 [Section 6.11] Vertex Attribute Data Stride
+ // The WebGL API supports vertex attribute data strides up to 255 bytes. A call to
+ // vertexAttribPointer will generate an INVALID_VALUE error if the value for the stride
+ // parameter exceeds 255.
+ constexpr GLsizei kMaxWebGLStride = 255;
+ if (stride > kMaxWebGLStride)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "Stride is over the maximum stride allowed by WebGL."));
+ return false;
+ }
+
+ // WebGL 1.0 [Section 6.4] Buffer Offset and Stride Requirements
+ // The offset arguments to drawElements and vertexAttribPointer, and the stride argument to
+ // vertexAttribPointer, must be a multiple of the size of the data type passed to the call,
+ // or an INVALID_OPERATION error is generated.
+ VertexFormatType internalType = GetVertexFormatType(type, normalized, 1, pureInteger);
+ size_t typeSize = GetVertexFormatTypeSize(internalType);
+
+ ASSERT(isPow2(typeSize) && typeSize > 0);
+ size_t sizeMask = (typeSize - 1);
+ if ((reinterpret_cast<intptr_t>(ptr) & sizeMask) != 0)
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION, "Offset is not a multiple of the type size."));
+ return false;
+ }
+
+ if ((stride & sizeMask) != 0)
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION, "Stride is not a multiple of the type size."));
+ return false;
+ }
+
+ return true;
+}
+
Program *GetValidProgram(ValidationContext *context, GLuint id)
{
// ES3 spec (section 2.11.1) -- "Commands that accept shader or program object names will
@@ -2093,19 +2202,19 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context,
return false;
}
- if (readFramebuffer->checkStatus(context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
}
- if (drawFramebuffer->checkStatus(context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (drawFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
}
- if (drawFramebuffer->getSamples(context->getContextState()) != 0)
+ if (drawFramebuffer->getSamples(context) != 0)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
@@ -2259,7 +2368,8 @@ bool ValidateReadPixels(ValidationContext *context,
GLenum type,
GLvoid *pixels)
{
- return ValidateReadPixelsBase(context, x, y, width, height, format, type, -1, nullptr, pixels);
+ return ValidateReadPixelsBase(context, x, y, width, height, format, type, -1, nullptr, nullptr,
+ nullptr, pixels);
}
bool ValidateReadPixelsRobustANGLE(ValidationContext *context,
@@ -2271,6 +2381,8 @@ bool ValidateReadPixelsRobustANGLE(ValidationContext *context,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
GLvoid *pixels)
{
if (!ValidateRobustEntryPoint(context, bufSize))
@@ -2279,7 +2391,7 @@ bool ValidateReadPixelsRobustANGLE(ValidationContext *context,
}
if (!ValidateReadPixelsBase(context, x, y, width, height, format, type, bufSize, length,
- pixels))
+ columns, rows, pixels))
{
return false;
}
@@ -2309,7 +2421,7 @@ bool ValidateReadnPixelsEXT(Context *context,
}
return ValidateReadPixelsBase(context, x, y, width, height, format, type, bufSize, nullptr,
- pixels);
+ nullptr, nullptr, pixels);
}
bool ValidateReadnPixelsRobustANGLE(ValidationContext *context,
@@ -2321,6 +2433,8 @@ bool ValidateReadnPixelsRobustANGLE(ValidationContext *context,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
GLvoid *data)
{
if (!ValidateRobustEntryPoint(context, bufSize))
@@ -2328,7 +2442,8 @@ bool ValidateReadnPixelsRobustANGLE(ValidationContext *context,
return false;
}
- if (!ValidateReadPixelsBase(context, x, y, width, height, format, type, bufSize, length, data))
+ if (!ValidateReadPixelsBase(context, x, y, width, height, format, type, bufSize, length,
+ columns, rows, data))
{
return false;
}
@@ -2934,8 +3049,8 @@ bool ValidateStateQuery(ValidationContext *context,
case GL_IMPLEMENTATION_COLOR_READ_TYPE:
case GL_IMPLEMENTATION_COLOR_READ_FORMAT:
{
- if (context->getGLState().getReadFramebuffer()->checkStatus(
- context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (context->getGLState().getReadFramebuffer()->checkStatus(context) !=
+ GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
@@ -3038,13 +3153,13 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
const auto &state = context->getGLState();
auto readFramebuffer = state.getReadFramebuffer();
- if (readFramebuffer->checkStatus(context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (readFramebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
}
- if (readFramebuffer->id() != 0 && readFramebuffer->getSamples(context->getContextState()) != 0)
+ if (readFramebuffer->id() != 0 && readFramebuffer->getSamples(context) != 0)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
@@ -3242,7 +3357,7 @@ bool ValidateDrawBase(ValidationContext *context, GLenum mode, GLsizei count)
}
}
- if (framebuffer->checkStatus(context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (framebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
@@ -3494,6 +3609,15 @@ bool ValidateDrawElements(ValidationContext *context,
"indices must be a multiple of the element type size."));
return false;
}
+
+ // [WebGL 1.0] Section 6.4 Buffer Offset and Stride Requirements
+ // In addition the offset argument to drawElements must be non-negative or an INVALID_VALUE
+ // error is generated.
+ if (reinterpret_cast<intptr_t>(indices) < 0)
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "Offset < 0."));
+ return false;
+ }
}
if (context->getExtensions().webglCompatibility ||
@@ -3514,20 +3638,31 @@ bool ValidateDrawElements(ValidationContext *context,
{
if (elementArrayBuffer)
{
- GLint64 offset = reinterpret_cast<GLint64>(indices);
- GLint64 byteCount =
- static_cast<GLint64>(typeBytes) * static_cast<GLint64>(count) + offset;
-
- // check for integer overflows
- if (static_cast<GLuint>(count) > (std::numeric_limits<GLuint>::max() / typeBytes) ||
- byteCount > static_cast<GLint64>(std::numeric_limits<GLuint>::max()))
+ // The max possible type size is 8 and count is on 32 bits so doing the multiplication
+ // in a 64 bit integer is safe. Also we are guaranteed that here count > 0.
+ static_assert(std::is_same<int, GLsizei>::value, "GLsizei isn't the expected type");
+ constexpr uint64_t kMaxTypeSize = 8;
+ constexpr uint64_t kIntMax = std::numeric_limits<int>::max();
+ constexpr uint64_t kUint64Max = std::numeric_limits<uint64_t>::max();
+ static_assert(kIntMax < kUint64Max / kMaxTypeSize, "");
+
+ uint64_t typeSize = typeBytes;
+ uint64_t elementCount = static_cast<uint64_t>(count);
+ ASSERT(elementCount > 0 && typeSize <= kMaxTypeSize);
+
+ // Doing the multiplication here is overflow-safe
+ uint64_t elementDataSizeNoOffset = typeSize * elementCount;
+
+ // The offset can be any value, check for overflows
+ uint64_t offset = static_cast<uint64_t>(reinterpret_cast<uintptr_t>(indices));
+ if (elementDataSizeNoOffset > kUint64Max - offset)
{
- context->handleError(Error(GL_OUT_OF_MEMORY, "Integer overflow."));
+ context->handleError(Error(GL_INVALID_OPERATION, "Integer overflow."));
return false;
}
- // Check for reading past the end of the bound buffer object
- if (byteCount > elementArrayBuffer->getSize())
+ uint64_t elementDataSizeWithOffset = elementDataSizeNoOffset + offset;
+ if (elementDataSizeWithOffset > static_cast<uint64_t>(elementArrayBuffer->getSize()))
{
context->handleError(
Error(GL_INVALID_OPERATION, "Index buffer is not big enough for the draw."));
@@ -5162,6 +5297,14 @@ bool ValidateGetProgramiv(Context *context, GLuint program, GLenum pname, GLsize
}
break;
+ case GL_PROGRAM_SEPARABLE:
+ if (context->getClientVersion() < Version(3, 1))
+ {
+ context->handleError(Error(GL_INVALID_ENUM, "Querying requires at least ES 3.1."));
+ return false;
+ }
+ break;
+
default:
context->handleError(Error(GL_INVALID_ENUM, "Unknown parameter name."));
return false;
@@ -5698,4 +5841,121 @@ bool ValidateGetInternalFormativRobustANGLE(Context *context,
return true;
}
+bool ValidateVertexFormatBase(ValidationContext *context,
+ GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ GLboolean pureInteger)
+{
+ const Caps &caps = context->getCaps();
+ if (attribIndex >= caps.maxVertexAttributes)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "attribindex must be smaller than MAX_VERTEX_ATTRIBS."));
+ return false;
+ }
+
+ if (size < 1 || size > 4)
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "size must be between one and four."));
+ }
+
+ switch (type)
+ {
+ case GL_BYTE:
+ case GL_UNSIGNED_BYTE:
+ case GL_SHORT:
+ case GL_UNSIGNED_SHORT:
+ break;
+
+ case GL_INT:
+ case GL_UNSIGNED_INT:
+ if (context->getClientMajorVersion() < 3)
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM, "Vertex type not supported before OpenGL ES 3.0."));
+ return false;
+ }
+ break;
+
+ case GL_FIXED:
+ case GL_FLOAT:
+ if (pureInteger)
+ {
+ context->handleError(Error(GL_INVALID_ENUM, "Type is not integer."));
+ return false;
+ }
+ break;
+
+ case GL_HALF_FLOAT:
+ if (context->getClientMajorVersion() < 3)
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM, "Vertex type not supported before OpenGL ES 3.0."));
+ return false;
+ }
+ if (pureInteger)
+ {
+ context->handleError(Error(GL_INVALID_ENUM, "Type is not integer."));
+ return false;
+ }
+ break;
+
+ case GL_INT_2_10_10_10_REV:
+ case GL_UNSIGNED_INT_2_10_10_10_REV:
+ if (context->getClientMajorVersion() < 3)
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM, "Vertex type not supported before OpenGL ES 3.0."));
+ return false;
+ }
+ if (pureInteger)
+ {
+ context->handleError(Error(GL_INVALID_ENUM, "Type is not integer."));
+ return false;
+ }
+ if (size != 4)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION,
+ "Type is INT_2_10_10_10_REV or "
+ "UNSIGNED_INT_2_10_10_10_REV and size is not 4."));
+ return false;
+ }
+ break;
+
+ default:
+ context->handleError(Error(GL_INVALID_ENUM, "Invalid vertex type."));
+ return false;
+ }
+
+ return true;
+}
+
+// Perform validation from WebGL 2 section 5.10 "Invalid Clears":
+// In the WebGL 2 API, trying to perform a clear when there is a mismatch between the type of the
+// specified clear value and the type of a buffer that is being cleared generates an
+// INVALID_OPERATION error instead of producing undefined results
+bool ValidateWebGLFramebufferAttachmentClearType(ValidationContext *context,
+ GLint drawbuffer,
+ const GLenum *validComponentTypes,
+ size_t validComponentTypeCount)
+{
+ const FramebufferAttachment *attachment =
+ context->getGLState().getDrawFramebuffer()->getDrawBuffer(drawbuffer);
+ if (attachment)
+ {
+ GLenum componentType = attachment->getFormat().info->componentType;
+ const GLenum *end = validComponentTypes + validComponentTypeCount;
+ if (std::find(validComponentTypes, end, componentType) == end)
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION,
+ "No defined conversion between clear value and attachment format."));
+ return false;
+ }
+ }
+
+ return true;
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/validationES.h b/chromium/third_party/angle/src/libANGLE/validationES.h
index 170e8eb2cd9..a14a4421088 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES.h
@@ -65,6 +65,13 @@ bool ValidImageDataSize(ValidationContext *context,
bool ValidQueryType(const Context *context, GLenum queryType);
+bool ValidateWebGLVertexAttribPointer(ValidationContext *context,
+ GLenum type,
+ GLboolean normalized,
+ GLsizei stride,
+ const GLvoid *ptr,
+ bool pureInteger);
+
// Returns valid program if id is a valid program name
// Errors INVALID_OPERATION if valid shader is given and returns NULL
// Errors INVALID_VALUE otherwise and returns NULL
@@ -117,6 +124,8 @@ bool ValidateReadPixelsRobustANGLE(ValidationContext *context,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
GLvoid *pixels);
bool ValidateReadnPixelsEXT(Context *context,
GLint x,
@@ -136,6 +145,8 @@ bool ValidateReadnPixelsRobustANGLE(ValidationContext *context,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
GLvoid *data);
bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n);
@@ -602,6 +613,7 @@ bool ValidateGetInternalFormativ(Context *context,
GLenum pname,
GLsizei bufSize,
GLint *params);
+
bool ValidateGetInternalFormativRobustANGLE(Context *context,
GLenum target,
GLenum internalformat,
@@ -610,6 +622,17 @@ bool ValidateGetInternalFormativRobustANGLE(Context *context,
GLsizei *length,
GLint *params);
+bool ValidateVertexFormatBase(ValidationContext *context,
+ GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ GLboolean pureInteger);
+
+bool ValidateWebGLFramebufferAttachmentClearType(ValidationContext *context,
+ GLint drawbuffer,
+ const GLenum *validComponentTypes,
+ size_t validComponentTypeCount);
+
// Error messages shared here for use in testing.
extern const char *g_ExceedsMaxElementErrorMessage;
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/validationES2.cpp b/chromium/third_party/angle/src/libANGLE/validationES2.cpp
index 7b80eb9783d..94671a96a03 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES2.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES2.cpp
@@ -454,6 +454,10 @@ bool ValidateES2TexImageParameters(Context *context,
}
break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
if (!context->getExtensions().lossyETCDecode)
{
context->handleError(Error(
@@ -668,11 +672,15 @@ bool ValidateES2TexImageParameters(Context *context,
}
break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
if (context->getExtensions().lossyETCDecode)
{
context->handleError(
Error(GL_INVALID_OPERATION,
- "ETC1_RGB8_LOSSY_DECODE_ANGLE can't work with this type."));
+ "ETC lossy decode formats can't work with this type."));
return false;
}
else
@@ -841,6 +849,10 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE:
case GL_ETC1_RGB8_OES:
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
context->handleError(Error(GL_INVALID_OPERATION));
return false;
case GL_DEPTH_COMPONENT:
@@ -973,10 +985,14 @@ bool ValidateES2CopyTexImageParameters(ValidationContext *context,
}
break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
if (context->getExtensions().lossyETCDecode)
{
context->handleError(Error(GL_INVALID_OPERATION,
- "ETC1_RGB8_LOSSY_DECODE_ANGLE can't be copied to."));
+ "ETC lossy decode formats can't be copied to."));
return false;
}
else
@@ -1115,6 +1131,10 @@ bool ValidateES2TexStorageParameters(Context *context,
}
break;
case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE:
+ case GL_COMPRESSED_RGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_LOSSY_DECODE_ETC2_ANGLE:
if (!context->getExtensions().lossyETCDecode)
{
context->handleError(
@@ -1884,7 +1904,7 @@ bool ValidateBlitFramebufferANGLE(Context *context,
}
}
- if (readFramebuffer->getSamples(context->getContextState()) != 0 &&
+ if (readFramebuffer->getSamples(context) != 0 &&
IsPartialBlit(context, readColorAttachment, drawColorAttachment, srcX0, srcY0,
srcX1, srcY1, dstX0, dstY0, dstX1, dstY1))
{
@@ -1933,7 +1953,7 @@ bool ValidateBlitFramebufferANGLE(Context *context,
bool ValidateClear(ValidationContext *context, GLbitfield mask)
{
auto fbo = context->getGLState().getDrawFramebuffer();
- if (fbo->checkStatus(context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (fbo->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
@@ -1945,6 +1965,22 @@ bool ValidateClear(ValidationContext *context, GLbitfield mask)
return false;
}
+ if (context->getExtensions().webglCompatibility && (mask & GL_COLOR_BUFFER_BIT) != 0)
+ {
+ constexpr GLenum validComponentTypes[] = {GL_FLOAT, GL_UNSIGNED_NORMALIZED,
+ GL_SIGNED_NORMALIZED};
+
+ for (GLuint drawBufferIdx = 0; drawBufferIdx < context->getCaps().maxDrawBuffers;
+ drawBufferIdx++)
+ {
+ if (!ValidateWebGLFramebufferAttachmentClearType(
+ context, drawBufferIdx, validComponentTypes, ArraySize(validComponentTypes)))
+ {
+ return false;
+ }
+ }
+ }
+
return true;
}
@@ -3151,7 +3187,10 @@ bool ValidateProgramPathFragmentInputGen(Context *context,
bool ValidateCopyTextureCHROMIUM(Context *context,
GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
@@ -3229,7 +3268,10 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
bool ValidateCopySubTextureCHROMIUM(Context *context,
GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
@@ -3312,7 +3354,6 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
return false;
}
- GLenum destTarget = dest->getTarget();
ASSERT(destTarget != GL_TEXTURE_CUBE_MAP);
if (dest->getWidth(sourceTarget, 0) == 0 || dest->getHeight(sourceTarget, 0) == 0)
{
@@ -3828,7 +3869,8 @@ bool ValidateBlendFuncSeparate(ValidationContext *context,
return false;
}
- if (context->getLimitations().noSimultaneousConstantColorAndAlphaBlendFunc)
+ if (context->getLimitations().noSimultaneousConstantColorAndAlphaBlendFunc ||
+ context->getExtensions().webglCompatibility)
{
bool constantColorUsed =
(srcRGB == GL_CONSTANT_COLOR || srcRGB == GL_ONE_MINUS_CONSTANT_COLOR ||
@@ -3840,14 +3882,22 @@ bool ValidateBlendFuncSeparate(ValidationContext *context,
if (constantColorUsed && constantAlphaUsed)
{
- ERR() << "Simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA and "
- "GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR not supported by this "
- "implementation.";
- context->handleError(Error(GL_INVALID_OPERATION,
- "Simultaneous use of "
- "GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA and "
- "GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR not "
- "supported by this implementation."));
+ const char *msg;
+ if (context->getExtensions().webglCompatibility)
+ {
+ msg =
+ "Invalid simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA and "
+ "GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR.";
+ }
+ else
+ {
+ msg =
+ "Simultaneous use of GL_CONSTANT_ALPHA/GL_ONE_MINUS_CONSTANT_ALPHA and "
+ "GL_CONSTANT_COLOR/GL_ONE_MINUS_CONSTANT_COLOR not supported by this "
+ "implementation.";
+ ERR() << msg;
+ }
+ context->handleError(Error(GL_INVALID_OPERATION, msg));
return false;
}
}
@@ -3901,56 +3951,33 @@ bool ValidateVertexAttribPointer(ValidationContext *context,
GLsizei stride,
const GLvoid *ptr)
{
- if (index >= MAX_VERTEX_ATTRIBS)
+ if (!ValidateVertexFormatBase(context, index, size, type, false))
{
- context->handleError(Error(GL_INVALID_VALUE, "Invalid index value."));
return false;
}
- if (size < 1 || size > 4)
+ if (stride < 0)
{
- context->handleError(Error(GL_INVALID_VALUE, "Invalide size value."));
+ context->handleError(Error(GL_INVALID_VALUE, "stride cannot be negative."));
return false;
}
- switch (type)
+ const Caps &caps = context->getCaps();
+ if (context->getClientVersion() >= ES_3_1)
{
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_FIXED:
- case GL_FLOAT:
- break;
-
- case GL_HALF_FLOAT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- case GL_INT_2_10_10_10_REV:
- case GL_UNSIGNED_INT_2_10_10_10_REV:
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(
- Error(GL_INVALID_ENUM, "Vertex type not supported before OpenGL ES 3.0."));
- return false;
- }
- break;
-
- default:
- context->handleError(Error(GL_INVALID_ENUM, "Invalid vertex type."));
+ if (stride > caps.maxVertexAttribStride)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "stride cannot be greater than MAX_VERTEX_ATTRIB_STRIDE."));
return false;
- }
-
- if (stride < 0)
- {
- context->handleError(Error(GL_INVALID_VALUE, "Invalid stride."));
- return false;
- }
+ }
- if ((type == GL_INT_2_10_10_10_REV || type == GL_UNSIGNED_INT_2_10_10_10_REV) && size != 4)
- {
- context->handleError(Error(GL_INVALID_OPERATION, "Invalid size for a sized vertex type."));
- return false;
+ if (index >= caps.maxVertexAttribBindings)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "index must be smaller than MAX_VERTEX_ATTRIB_BINDINGS."));
+ return false;
+ }
}
// [OpenGL ES 3.0.2] Section 2.8 page 24:
@@ -3959,11 +3986,11 @@ bool ValidateVertexAttribPointer(ValidationContext *context,
// and the pointer argument is not NULL.
bool nullBufferAllowed = context->getGLState().areClientArraysEnabled() &&
context->getGLState().getVertexArray()->id() == 0;
- if (!nullBufferAllowed && context->getGLState().getArrayBufferId() == 0 && ptr != NULL)
+ if (!nullBufferAllowed && context->getGLState().getArrayBufferId() == 0 && ptr != nullptr)
{
context->handleError(
Error(GL_INVALID_OPERATION,
- "Pointer is null with a non-zero VAO bound and zero bound to GL_ARRAY_BUFFER."));
+ "Client data cannot be used with a non-default vertex array object."));
return false;
}
@@ -3977,38 +4004,8 @@ bool ValidateVertexAttribPointer(ValidationContext *context,
return false;
}
- // WebGL 1.0 [Section 6.11] Vertex Attribute Data Stride
- // The WebGL API supports vertex attribute data strides up to 255 bytes. A call to
- // vertexAttribPointer will generate an INVALID_VALUE error if the value for the stride
- // parameter exceeds 255.
- constexpr GLsizei kMaxWebGLStride = 255;
- if (stride > kMaxWebGLStride)
+ if (!ValidateWebGLVertexAttribPointer(context, type, normalized, stride, ptr, false))
{
- context->handleError(
- Error(GL_INVALID_VALUE, "Stride is over the maximum stride allowed by WebGL."));
- return false;
- }
-
- // WebGL 1.0 [Section 6.4] Buffer Offset and Stride Requirements
- // The offset arguments to drawElements and vertexAttribPointer, and the stride argument to
- // vertexAttribPointer, must be a multiple of the size of the data type passed to the call,
- // or an INVALID_OPERATION error is generated.
- VertexFormatType internalType = GetVertexFormatType(type, normalized, 1, false);
- size_t typeSize = GetVertexFormatTypeSize(internalType);
-
- ASSERT(isPow2(typeSize) && typeSize > 0);
- size_t sizeMask = (typeSize - 1);
- if ((reinterpret_cast<intptr_t>(ptr) & sizeMask) != 0)
- {
- context->handleError(
- Error(GL_INVALID_OPERATION, "Offset is not a multiple of the type size."));
- return false;
- }
-
- if ((stride & sizeMask) != 0)
- {
- context->handleError(
- Error(GL_INVALID_OPERATION, "Stride is not a multiple of the type size."));
return false;
}
}
diff --git a/chromium/third_party/angle/src/libANGLE/validationES2.h b/chromium/third_party/angle/src/libANGLE/validationES2.h
index ad0f0fbf46e..66239631339 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES2.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES2.h
@@ -318,7 +318,10 @@ bool ValidateProgramPathFragmentInputGen(Context *context,
bool ValidateCopyTextureCHROMIUM(Context *context,
GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
@@ -326,7 +329,10 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
GLboolean unpackUnmultiplyAlpha);
bool ValidateCopySubTextureCHROMIUM(Context *context,
GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
diff --git a/chromium/third_party/angle/src/libANGLE/validationES3.cpp b/chromium/third_party/angle/src/libANGLE/validationES3.cpp
index 80ff967d26d..7288ddedf91 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES3.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES3.cpp
@@ -626,13 +626,13 @@ bool ValidateES3CopyTexImageParametersBase(ValidationContext *context,
gl::Framebuffer *framebuffer = state.getReadFramebuffer();
GLuint readFramebufferID = framebuffer->id();
- if (framebuffer->checkStatus(context->getContextState()) != GL_FRAMEBUFFER_COMPLETE)
+ if (framebuffer->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
}
- if (readFramebufferID != 0 && framebuffer->getSamples(context->getContextState()) != 0)
+ if (readFramebufferID != 0 && framebuffer->getSamples(context) != 0)
{
context->handleError(Error(GL_INVALID_OPERATION));
return false;
@@ -1030,8 +1030,7 @@ bool ValidateClearBuffer(ValidationContext *context)
return false;
}
- if (context->getGLState().getDrawFramebuffer()->checkStatus(context->getContextState()) !=
- GL_FRAMEBUFFER_COMPLETE)
+ if (context->getGLState().getDrawFramebuffer()->checkStatus(context) != GL_FRAMEBUFFER_COMPLETE)
{
context->handleError(Error(GL_INVALID_FRAMEBUFFER_OPERATION));
return false;
@@ -1309,8 +1308,8 @@ static bool ValidateBindBufferCommon(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(
- Error(GL_INVALID_ENUM, "ATOMIC_COUNTER_BUFFER is not supported in GLES3."));
+ context->handleError(Error(
+ GL_INVALID_ENUM, "ATOMIC_COUNTER_BUFFER is not supported before GLES 3.1"));
return false;
}
if (index >= caps.maxAtomicCounterBufferBindings)
@@ -1332,7 +1331,21 @@ static bool ValidateBindBufferCommon(Context *context,
if (context->getClientVersion() < ES_3_1)
{
context->handleError(
- Error(GL_INVALID_ENUM, "ATOMIC_COUNTER_BUFFER is not supported in GLES3."));
+ Error(GL_INVALID_ENUM, "SHADER_STORAGE_BUFFER is not supported in GLES3."));
+ return false;
+ }
+ if (index >= caps.maxShaderStorageBufferBindings)
+ {
+ context->handleError(Error(GL_INVALID_VALUE,
+ "index is greater than or equal to the number of "
+ "SHADER_STORAGE_BUFFER indexed binding points."));
+ return false;
+ }
+ if (buffer != 0 && (offset % caps.shaderStorageBufferOffsetAlignment) != 0)
+ {
+ context->handleError(Error(
+ GL_INVALID_VALUE,
+ "offset must be multiple of value of SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT."));
return false;
}
break;
@@ -1421,6 +1434,22 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G
}
break;
+ case GL_PROGRAM_SEPARABLE:
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM, "PROGRAM_SEPARABLE is not supported before GLES 3.1"));
+ return false;
+ }
+
+ if (value != GL_FALSE && value != GL_TRUE)
+ {
+ context->handleError(Error(
+ GL_INVALID_VALUE, "Invalid value, expected GL_FALSE or GL_TRUE: %i", value));
+ return false;
+ }
+ break;
+
default:
context->handleError(Error(GL_INVALID_ENUM, "Invalid pname: 0x%X", pname));
return false;
@@ -1465,6 +1494,15 @@ bool ValidateClearBufferiv(ValidationContext *context,
context->handleError(Error(GL_INVALID_VALUE));
return false;
}
+ if (context->getExtensions().webglCompatibility)
+ {
+ constexpr GLenum validComponentTypes[] = {GL_INT};
+ if (ValidateWebGLFramebufferAttachmentClearType(
+ context, drawbuffer, validComponentTypes, ArraySize(validComponentTypes)))
+ {
+ return false;
+ }
+ }
break;
case GL_STENCIL:
@@ -1497,6 +1535,15 @@ bool ValidateClearBufferuiv(ValidationContext *context,
context->handleError(Error(GL_INVALID_VALUE));
return false;
}
+ if (context->getExtensions().webglCompatibility)
+ {
+ constexpr GLenum validComponentTypes[] = {GL_UNSIGNED_INT};
+ if (ValidateWebGLFramebufferAttachmentClearType(
+ context, drawbuffer, validComponentTypes, ArraySize(validComponentTypes)))
+ {
+ return false;
+ }
+ }
break;
default:
@@ -1521,6 +1568,16 @@ bool ValidateClearBufferfv(ValidationContext *context,
context->handleError(Error(GL_INVALID_VALUE));
return false;
}
+ if (context->getExtensions().webglCompatibility)
+ {
+ constexpr GLenum validComponentTypes[] = {GL_FLOAT, GL_UNSIGNED_NORMALIZED,
+ GL_SIGNED_NORMALIZED};
+ if (ValidateWebGLFramebufferAttachmentClearType(
+ context, drawbuffer, validComponentTypes, ArraySize(validComponentTypes)))
+ {
+ return false;
+ }
+ }
break;
case GL_DEPTH:
@@ -1970,6 +2027,7 @@ bool ValidateIndexedStateQuery(ValidationContext *context,
return false;
}
break;
+
case GL_MAX_COMPUTE_WORK_GROUP_SIZE:
case GL_MAX_COMPUTE_WORK_GROUP_COUNT:
if (index >= 3u)
@@ -1978,6 +2036,7 @@ bool ValidateIndexedStateQuery(ValidationContext *context,
return false;
}
break;
+
case GL_ATOMIC_COUNTER_BUFFER_START:
case GL_ATOMIC_COUNTER_BUFFER_SIZE:
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
@@ -1996,6 +2055,45 @@ bool ValidateIndexedStateQuery(ValidationContext *context,
return false;
}
break;
+
+ case GL_SHADER_STORAGE_BUFFER_START:
+ case GL_SHADER_STORAGE_BUFFER_SIZE:
+ case GL_SHADER_STORAGE_BUFFER_BINDING:
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM,
+ "Shader storage buffers are not supported in this version of GL"));
+ return false;
+ }
+ if (index >= caps.maxShaderStorageBufferBindings)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE,
+ "index is outside the valid range for GL_SHADER_STORAGE_BUFFER_BINDING"));
+ return false;
+ }
+ break;
+
+ case GL_VERTEX_BINDING_BUFFER:
+ case GL_VERTEX_BINDING_DIVISOR:
+ case GL_VERTEX_BINDING_OFFSET:
+ case GL_VERTEX_BINDING_STRIDE:
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM,
+ "Vertex Attrib Bindings are not supported in this version of GL"));
+ return false;
+ }
+ if (index >= caps.maxVertexAttribBindings)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE,
+ "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS."));
+ return false;
+ }
+ break;
default:
context->handleError(Error(GL_INVALID_ENUM));
return false;
@@ -2266,4 +2364,117 @@ bool ValidateRenderbufferStorageMultisample(ValidationContext *context,
return true;
}
+bool ValidateVertexAttribIPointer(ValidationContext *context,
+ GLuint index,
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ const GLvoid *pointer)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION, "VertexAttribIPointer requires OpenGL ES 3.0 or higher."));
+ return false;
+ }
+
+ if (!ValidateVertexFormatBase(context, index, size, type, true))
+ {
+ return false;
+ }
+
+ if (stride < 0)
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "stride cannot be negative."));
+ return false;
+ }
+
+ const Caps &caps = context->getCaps();
+ if (context->getClientVersion() >= ES_3_1)
+ {
+ if (stride > caps.maxVertexAttribStride)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "stride cannot be greater than MAX_VERTEX_ATTRIB_STRIDE."));
+ return false;
+ }
+
+ // [OpenGL ES 3.1] Section 10.3.1 page 245:
+ // glVertexAttribBinding is part of the equivalent code of VertexAttribIPointer, so its
+ // validation should be inherited.
+ if (index >= caps.maxVertexAttribBindings)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "index must be smaller than MAX_VERTEX_ATTRIB_BINDINGS."));
+ return false;
+ }
+ }
+
+ // [OpenGL ES 3.0.2] Section 2.8 page 24:
+ // An INVALID_OPERATION error is generated when a non-zero vertex array object
+ // is bound, zero is bound to the ARRAY_BUFFER buffer object binding point,
+ // and the pointer argument is not NULL.
+ if (context->getGLState().getVertexArrayId() != 0 &&
+ context->getGLState().getArrayBufferId() == 0 && pointer != nullptr)
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION,
+ "Client data cannot be used with a non-default vertex array object."));
+ return false;
+ }
+
+ if (context->getExtensions().webglCompatibility)
+ {
+ if (!ValidateWebGLVertexAttribPointer(context, type, false, stride, pointer, true))
+ {
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool ValidateGetSynciv(Context *context,
+ GLsync sync,
+ GLenum pname,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *values)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION, "GetSynciv requires OpenGL ES 3.0 or higher."));
+ return false;
+ }
+
+ if (bufSize < 0)
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "bufSize cannot be negative."));
+ return false;
+ }
+
+ FenceSync *fenceSync = context->getFenceSync(sync);
+ if (!fenceSync)
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "Invalid sync object."));
+ return false;
+ }
+
+ switch (pname)
+ {
+ case GL_OBJECT_TYPE:
+ case GL_SYNC_CONDITION:
+ case GL_SYNC_FLAGS:
+ case GL_SYNC_STATUS:
+ break;
+
+ default:
+ context->handleError(Error(GL_INVALID_ENUM, "Invalid pname."));
+ return false;
+ }
+
+ return true;
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/validationES3.h b/chromium/third_party/angle/src/libANGLE/validationES3.h
index 2cc3368c20b..2fe551a1182 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES3.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES3.h
@@ -377,6 +377,20 @@ bool ValidateRenderbufferStorageMultisample(ValidationContext *context,
GLsizei width,
GLsizei height);
+bool ValidateVertexAttribIPointer(ValidationContext *context,
+ GLuint index,
+ GLint size,
+ GLenum type,
+ GLsizei stride,
+ const GLvoid *pointer);
+
+bool ValidateGetSynciv(Context *context,
+ GLsync sync,
+ GLenum pname,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *values);
+
} // namespace gl
#endif // LIBANGLE_VALIDATION_ES3_H_
diff --git a/chromium/third_party/angle/src/libANGLE/validationES31.cpp b/chromium/third_party/angle/src/libANGLE/validationES31.cpp
index dd91577bb6d..b128f3a3a4d 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES31.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES31.cpp
@@ -21,6 +21,55 @@ using namespace angle;
namespace gl
{
+namespace
+{
+
+bool ValidateNamedProgramInterface(GLenum programInterface)
+{
+ switch (programInterface)
+ {
+ case GL_UNIFORM:
+ case GL_UNIFORM_BLOCK:
+ case GL_PROGRAM_INPUT:
+ case GL_PROGRAM_OUTPUT:
+ case GL_TRANSFORM_FEEDBACK_VARYING:
+ case GL_BUFFER_VARIABLE:
+ case GL_SHADER_STORAGE_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool ValidateProgramResourceIndex(const Program *programObject,
+ GLenum programInterface,
+ GLuint index)
+{
+ switch (programInterface)
+ {
+ case GL_PROGRAM_INPUT:
+ return (index < static_cast<GLuint>(programObject->getActiveAttributeCount()));
+
+ case GL_PROGRAM_OUTPUT:
+ return (index < static_cast<GLuint>(programObject->getOutputResourceCount()));
+
+ // TODO(Jie): more interfaces.
+ case GL_UNIFORM:
+ case GL_UNIFORM_BLOCK:
+ case GL_TRANSFORM_FEEDBACK_VARYING:
+ case GL_BUFFER_VARIABLE:
+ case GL_SHADER_STORAGE_BLOCK:
+ UNIMPLEMENTED();
+ return false;
+
+ default:
+ UNREACHABLE();
+ return false;
+ }
+}
+
+} // anonymous namespace
+
bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLboolean *data)
{
if (context->getClientVersion() < ES_3_1)
@@ -505,4 +554,277 @@ bool ValidationGetFramebufferParameteri(Context *context,
return true;
}
+bool ValidateGetProgramResourceIndex(Context *context,
+ GLuint program,
+ GLenum programInterface,
+ const GLchar *name)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES 3.1."));
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (programObject == nullptr)
+ {
+ return false;
+ }
+
+ if (!ValidateNamedProgramInterface(programInterface))
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM, "Invalid program interface: 0x%X", programInterface));
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateBindVertexBuffer(ValidationContext *context,
+ GLuint bindingIndex,
+ GLuint buffer,
+ GLintptr offset,
+ GLsizei stride)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.1."));
+ return false;
+ }
+
+ if (!context->isBufferGenerated(buffer))
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Buffer is not generated."));
+ return false;
+ }
+
+ const Caps &caps = context->getCaps();
+ if (bindingIndex >= caps.maxVertexAttribBindings)
+ {
+ context->handleError(Error(
+ GL_INVALID_VALUE, "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS."));
+ return false;
+ }
+
+ if (offset < 0)
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "offset cannot be negative."));
+ return false;
+ }
+
+ if (stride < 0 || stride > caps.maxVertexAttribStride)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "stride must be between 0 and MAX_VERTEX_ATTRIB_STRIDE."));
+ return false;
+ }
+
+ // [OpenGL ES 3.1] Section 10.3.1 page 244:
+ // An INVALID_OPERATION error is generated if the default vertex array object is bound.
+ if (context->getGLState().getVertexArrayId() == 0)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Default vertex array buffer is bound."));
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateVertexBindingDivisor(ValidationContext *context, GLuint bindingIndex, GLuint divisor)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.1."));
+ return false;
+ }
+
+ const Caps &caps = context->getCaps();
+ if (bindingIndex >= caps.maxVertexAttribBindings)
+ {
+ context->handleError(Error(
+ GL_INVALID_VALUE, "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS."));
+ return false;
+ }
+
+ // [OpenGL ES 3.1] Section 10.3.1 page 243:
+ // An INVALID_OPERATION error is generated if the default vertex array object is bound.
+ if (context->getGLState().getVertexArrayId() == 0)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Default vertex array object is bound."));
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateVertexAttribFormat(ValidationContext *context,
+ GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ GLuint relativeOffset,
+ GLboolean pureInteger)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.1."));
+ return false;
+ }
+
+ const Caps &caps = context->getCaps();
+ if (relativeOffset > static_cast<GLuint>(caps.maxVertexAttribRelativeOffset))
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE,
+ "relativeOffset cannot be greater than MAX_VERTEX_ATTRIB_RELATIVE_OFFSET."));
+ return false;
+ }
+
+ // [OpenGL ES 3.1] Section 10.3.1 page 243:
+ // An INVALID_OPERATION error is generated if the default vertex array object is bound.
+ if (context->getGLState().getVertexArrayId() == 0)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Default vertex array object is bound."));
+ return false;
+ }
+
+ return ValidateVertexFormatBase(context, attribIndex, size, type, pureInteger);
+}
+
+bool ValidateVertexAttribBinding(ValidationContext *context,
+ GLuint attribIndex,
+ GLuint bindingIndex)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.1."));
+ return false;
+ }
+
+ // [OpenGL ES 3.1] Section 10.3.1 page 243:
+ // An INVALID_OPERATION error is generated if the default vertex array object is bound.
+ if (context->getGLState().getVertexArrayId() == 0)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Default vertex array object is bound."));
+ return false;
+ }
+
+ const Caps &caps = context->getCaps();
+ if (attribIndex >= caps.maxVertexAttributes)
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE, "attribindex must be smaller than MAX_VERTEX_ATTRIBS."));
+ return false;
+ }
+
+ if (bindingIndex >= caps.maxVertexAttribBindings)
+ {
+ context->handleError(Error(GL_INVALID_VALUE,
+ "bindingindex must be smaller than MAX_VERTEX_ATTRIB_BINDINGS"));
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetProgramResourceName(Context *context,
+ GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.1."));
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (programObject == nullptr)
+ {
+ return false;
+ }
+
+ if (!ValidateNamedProgramInterface(programInterface))
+ {
+ context->handleError(
+ Error(GL_INVALID_ENUM, "Invalid program interface: 0x%X", programInterface));
+ return false;
+ }
+
+ if (!ValidateProgramResourceIndex(programObject, programInterface, index))
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "Invalid index: %d", index));
+ return false;
+ }
+
+ if (bufSize < 0)
+ {
+ context->handleError(Error(GL_INVALID_VALUE, "Invalid bufSize: %d", bufSize));
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateDispatchCompute(Context *context,
+ GLuint numGroupsX,
+ GLuint numGroupsY,
+ GLuint numGroupsZ)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(Error(GL_INVALID_OPERATION, "Context does not support GLES3.1."));
+ return false;
+ }
+
+ const State &state = context->getGLState();
+ Program *program = state.getProgram();
+
+ if (program == nullptr)
+ {
+ context->handleError(
+ Error(GL_INVALID_OPERATION, "No active program object for the compute shader stage."));
+ return false;
+ }
+
+ if (program->isLinked() == false || program->getAttachedComputeShader() == nullptr)
+ {
+ context->handleError(Error(
+ GL_INVALID_OPERATION,
+ "Program has not been successfully linked, or program contains no compute shaders."));
+ return false;
+ }
+
+ const Caps &caps = context->getCaps();
+ if (numGroupsX > caps.maxComputeWorkGroupCount[0])
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE,
+ "num_groups_x cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[0](%u).",
+ caps.maxComputeWorkGroupCount[0]));
+ return false;
+ }
+ if (numGroupsY > caps.maxComputeWorkGroupCount[1])
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE,
+ "num_groups_y cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[1](%u).",
+ caps.maxComputeWorkGroupCount[1]));
+ return false;
+ }
+ if (numGroupsZ > caps.maxComputeWorkGroupCount[2])
+ {
+ context->handleError(
+ Error(GL_INVALID_VALUE,
+ "num_groups_z cannot be greater than MAX_COMPUTE_WORK_GROUP_COUNT[2](%u).",
+ caps.maxComputeWorkGroupCount[2]));
+ return false;
+ }
+
+ return true;
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/validationES31.h b/chromium/third_party/angle/src/libANGLE/validationES31.h
index 88802163474..a8ae49ea066 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES31.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES31.h
@@ -14,6 +14,7 @@
namespace gl
{
class Context;
+class ValidationContext;
bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLboolean *data);
bool ValidateGetBooleani_vRobustANGLE(Context *context,
@@ -55,6 +56,40 @@ bool ValidationGetFramebufferParameteri(Context *context,
GLenum target,
GLenum pname,
GLint *params);
+
+bool ValidateGetProgramResourceIndex(Context *context,
+ GLuint program,
+ GLenum programInterface,
+ const GLchar *name);
+bool ValidateGetProgramResourceName(Context *context,
+ GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *name);
+
+bool ValidateBindVertexBuffer(ValidationContext *context,
+ GLuint bindingIndex,
+ GLuint buffer,
+ GLintptr offset,
+ GLsizei stride);
+bool ValidateVertexAttribFormat(ValidationContext *context,
+ GLuint attribIndex,
+ GLint size,
+ GLenum type,
+ GLuint relativeOffset,
+ GLboolean pureInteger);
+bool ValidateVertexAttribBinding(ValidationContext *context,
+ GLuint attribIndex,
+ GLuint bindingIndex);
+bool ValidateVertexBindingDivisor(ValidationContext *context, GLuint bindingIndex, GLuint divisor);
+
+bool ValidateDispatchCompute(Context *context,
+ GLuint numGroupsX,
+ GLuint numGroupsY,
+ GLuint numGroupsZ);
+
} // namespace gl
#endif // LIBANGLE_VALIDATION_ES31_H_
diff --git a/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp b/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp
index f1171a8fecb..c51b8b3f6ed 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp
@@ -57,7 +57,8 @@ class MockValidationContext : public ValidationContext
// Test that ANGLE generates an INVALID_OPERATION when validating index data that uses a value
// larger than MAX_ELEMENT_INDEX. Not specified in the GLES 3 spec, it's undefined behaviour,
// but we want a test to ensure we maintain this behaviour.
-TEST(ValidationESTest, DrawElementsWithMaxIndexGivesError)
+// TODO(jmadill): Re-enable when framebuffer sync state doesn't happen in validation.
+TEST(ValidationESTest, DISABLED_DrawElementsWithMaxIndexGivesError)
{
auto framebufferImpl = MakeFramebufferMock();
auto programImpl = MakeProgramMock();
@@ -78,7 +79,7 @@ TEST(ValidationESTest, DrawElementsWithMaxIndexGivesError)
caps.maxElementIndex = 100;
caps.maxDrawBuffers = 1;
caps.maxColorAttachments = 1;
- state.initialize(caps, extensions, Version(3, 0), false, true, true);
+ state.initialize(caps, extensions, Version(3, 0), false, true, true, false);
NiceMock<MockTextureImpl> *textureImpl = new NiceMock<MockTextureImpl>();
EXPECT_CALL(mockFactory, createTexture(_)).WillOnce(Return(textureImpl));
diff --git a/chromium/third_party/angle/src/libEGL/libEGL.cpp b/chromium/third_party/angle/src/libEGL/libEGL.cpp
index 4501ccf955e..30ce0815256 100644
--- a/chromium/third_party/angle/src/libEGL/libEGL.cpp
+++ b/chromium/third_party/angle/src/libEGL/libEGL.cpp
@@ -359,6 +359,15 @@ EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
return egl::StreamPostD3DTextureNV12ANGLE(dpy, stream, texture, attrib_list);
}
+EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLuint64KHR *ust,
+ EGLuint64KHR *msc,
+ EGLuint64KHR *sbc)
+{
+ return egl::GetSyncValuesCHROMIUM(dpy, surface, ust, msc, sbc);
+}
+
EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT(EGLDisplay dpy,
EGLSurface surface,
EGLint *rects,
diff --git a/chromium/third_party/angle/src/libEGL/libEGL.def b/chromium/third_party/angle/src/libEGL/libEGL.def
index 4888d465e3e..1fe33713334 100644
--- a/chromium/third_party/angle/src/libEGL/libEGL.def
+++ b/chromium/third_party/angle/src/libEGL/libEGL.def
@@ -57,7 +57,8 @@ EXPORTS
eglStreamConsumerGLTextureExternalAttribsNV @63
eglCreateStreamProducerD3DTextureNV12ANGLE @64
eglStreamPostD3DTextureNV12ANGLE @65
- eglSwapBuffersWithDamageEXT @66
+ eglGetSyncValuesCHROMIUM @66
+ eglSwapBuffersWithDamageEXT @67
; 1.5 entry points
eglCreateSync @38
diff --git a/chromium/third_party/angle/src/libGLESv2.gypi b/chromium/third_party/angle/src/libGLESv2.gypi
index f6ef682e410..712c5e692f1 100644
--- a/chromium/third_party/angle/src/libGLESv2.gypi
+++ b/chromium/third_party/angle/src/libGLESv2.gypi
@@ -8,7 +8,6 @@
# These file lists are shared with the GN build.
'libangle_common_sources':
[
- 'common/BitSetIterator.h',
'common/Color.h',
'common/Color.inl',
'common/Float16ToFloat32.cpp',
@@ -17,6 +16,7 @@
'common/Optional.h',
'common/angleutils.cpp',
'common/angleutils.h',
+ 'common/bitset_utils.h',
'common/debug.cpp',
'common/debug.h',
'common/mathutil.cpp',
@@ -69,6 +69,10 @@
'gpu_info_util/SystemInfo.h',
'gpu_info_util/SystemInfo_internal.h',
],
+ 'libangle_gpu_info_util_win_sources':
+ [
+ 'gpu_info_util/SystemInfo_win.cpp',
+ ],
'libangle_gpu_info_util_linux_sources':
[
'gpu_info_util/SystemInfo_linux.cpp',
@@ -182,6 +186,8 @@
'libANGLE/TransformFeedback.h',
'libANGLE/Uniform.cpp',
'libANGLE/Uniform.h',
+ 'libANGLE/UniformLinker.cpp',
+ 'libANGLE/UniformLinker.h',
'libANGLE/VaryingPacking.cpp',
'libANGLE/VaryingPacking.h',
'libANGLE/Version.h',
@@ -242,7 +248,6 @@
'libANGLE/renderer/load_functions_table_autogen.cpp',
'libANGLE/renderer/renderer_utils.cpp',
'libANGLE/renderer/renderer_utils.h',
- 'libANGLE/signal_utils.cpp',
'libANGLE/signal_utils.h',
'libANGLE/validationEGL.cpp',
'libANGLE/validationEGL.h',
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp b/chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp
index 0a058fc2ecb..c663710a59a 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp
@@ -1769,6 +1769,9 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
INSERT_PROC_ADDRESS(egl, CreateStreamProducerD3DTextureNV12ANGLE);
INSERT_PROC_ADDRESS(egl, StreamPostD3DTextureNV12ANGLE);
+ // EGL_CHROMIUM_get_sync_values
+ INSERT_PROC_ADDRESS(egl, GetSyncValuesCHROMIUM);
+
// EGL_EXT_swap_buffers_with_damage
INSERT_PROC_ADDRESS(egl, SwapBuffersWithDamageEXT);
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.cpp b/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.cpp
index e5b8b3f89b7..09a4a682824 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.cpp
@@ -932,6 +932,39 @@ EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy,
return EGL_TRUE;
}
+EGLBoolean EGLAPIENTRY GetSyncValuesCHROMIUM(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLuint64KHR *ust,
+ EGLuint64KHR *msc,
+ EGLuint64KHR *sbc)
+{
+ EVENT(
+ "(EGLDisplay dpy = 0x%0.8p, EGLSurface surface = 0x%0.8p, EGLuint64KHR* ust = 0x%0.8p, "
+ "EGLuint64KHR* msc = 0x%0.8p, EGLuint64KHR* sbc = 0x%0.8p",
+ dpy, surface, ust, msc, sbc);
+ Thread *thread = GetCurrentThread();
+
+ Display *display = static_cast<Display *>(dpy);
+ Surface *eglSurface = static_cast<Surface *>(surface);
+
+ Error error = ValidateGetSyncValuesCHROMIUM(display, eglSurface, ust, msc, sbc);
+ if (error.isError())
+ {
+ thread->setError(error);
+ return EGL_FALSE;
+ }
+
+ error = eglSurface->getSyncValues(ust, msc, sbc);
+ if (error.isError())
+ {
+ thread->setError(error);
+ return EGL_FALSE;
+ }
+
+ thread->setError(error);
+ return EGL_TRUE;
+}
+
ANGLE_EXPORT EGLBoolean SwapBuffersWithDamageEXT(EGLDisplay dpy,
EGLSurface surface,
EGLint *rects,
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.h b/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.h
index eb57ad05e59..d05b12adc54 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.h
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_egl_ext.h
@@ -80,6 +80,13 @@ ANGLE_EXPORT EGLBoolean EGLAPIENTRY StreamPostD3DTextureNV12ANGLE(EGLDisplay dpy
void *texture,
const EGLAttrib *attrib_list);
+// EGL_CHROMIUM_get_sync_values
+ANGLE_EXPORT EGLBoolean EGLAPIENTRY GetSyncValuesCHROMIUM(EGLDisplay dpy,
+ EGLSurface surface,
+ EGLuint64KHR *ust,
+ EGLuint64KHR *msc,
+ EGLuint64KHR *sbc);
+
// EGL_EXT_swap_buffers_with_damage
ANGLE_EXPORT EGLBoolean SwapBuffersWithDamageEXT(EGLDisplay dpy,
EGLSurface surface,
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0.cpp b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0.cpp
index c4bc80cab31..005a123ad9a 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0.cpp
@@ -278,7 +278,7 @@ GLenum GL_APIENTRY CheckFramebufferStatus(GLenum target)
Framebuffer *framebuffer = context->getGLState().getTargetFramebuffer(target);
ASSERT(framebuffer);
- return framebuffer->checkStatus(context->getContextState());
+ return framebuffer->checkStatus(context);
}
return 0;
@@ -1149,8 +1149,7 @@ void GL_APIENTRY GetBufferParameteriv(GLenum target, GLenum pname, GLint* params
return;
}
- Buffer *buffer = context->getGLState().getTargetBuffer(target);
- QueryBufferParameteriv(buffer, pname, params);
+ context->getBufferParameteriv(target, pname, params);
}
}
@@ -1209,8 +1208,7 @@ void GL_APIENTRY GetFramebufferAttachmentParameteriv(GLenum target, GLenum attac
return;
}
- const Framebuffer *framebuffer = context->getGLState().getTargetFramebuffer(target);
- QueryFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params);
+ context->getFramebufferAttachmentParameteriv(target, attachment, pname, params);
}
}
@@ -1296,8 +1294,7 @@ void GL_APIENTRY GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint*
return;
}
- Renderbuffer *renderbuffer = context->getGLState().getCurrentRenderbuffer();
- QueryRenderbufferiv(context, renderbuffer, pname, params);
+ context->getRenderbufferParameteriv(target, pname, params);
}
}
@@ -1472,8 +1469,7 @@ void GL_APIENTRY GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
return;
}
- Texture *texture = context->getTargetTexture(target);
- QueryTexParameterfv(texture, pname, params);
+ context->getTexParameterfv(target, pname, params);
}
}
@@ -1490,8 +1486,7 @@ void GL_APIENTRY GetTexParameteriv(GLenum target, GLenum pname, GLint* params)
return;
}
- Texture *texture = context->getTargetTexture(target);
- QueryTexParameteriv(texture, pname, params);
+ context->getTexParameteriv(target, pname, params);
}
}
@@ -2226,8 +2221,7 @@ void GL_APIENTRY TexParameterf(GLenum target, GLenum pname, GLfloat param)
return;
}
- Texture *texture = context->getTargetTexture(target);
- SetTexParameterf(texture, pname, param);
+ context->texParameterf(target, pname, param);
}
}
@@ -2244,8 +2238,7 @@ void GL_APIENTRY TexParameterfv(GLenum target, GLenum pname, const GLfloat *para
return;
}
- Texture *texture = context->getTargetTexture(target);
- SetTexParameterfv(texture, pname, params);
+ context->texParameterfv(target, pname, params);
}
}
@@ -2261,8 +2254,7 @@ void GL_APIENTRY TexParameteri(GLenum target, GLenum pname, GLint param)
return;
}
- Texture *texture = context->getTargetTexture(target);
- SetTexParameteri(texture, pname, param);
+ context->texParameteri(target, pname, param);
}
}
@@ -2279,8 +2271,7 @@ void GL_APIENTRY TexParameteriv(GLenum target, GLenum pname, const GLint *params
return;
}
- Texture *texture = context->getTargetTexture(target);
- SetTexParameteriv(texture, pname, params);
+ context->texParameteriv(target, pname, params);
}
}
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
index 02736e93835..b0e2703c641 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp
@@ -1854,7 +1854,10 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
}
ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
@@ -1862,30 +1865,35 @@ ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha)
{
EVENT(
- "(GLuint sourceId = %u, GLuint destId = %u, GLint internalFormat = 0x%X, GLenum destType = "
+ "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
+ "%u, GLint destLevel = %d, GLint internalFormat = 0x%X, GLenum destType = "
"0x%X, GLboolean unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean "
"unpackUnmultiplyAlpha = %u)",
- sourceId, destId, internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
- unpackUnmultiplyAlpha);
+ sourceId, sourceLevel, destTarget, destId, destLevel, internalFormat, destType, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
- !ValidateCopyTextureCHROMIUM(context, sourceId, destId, internalFormat, destType,
- unpackFlipY, unpackPremultiplyAlpha,
- unpackUnmultiplyAlpha))
+ !ValidateCopyTextureCHROMIUM(context, sourceId, sourceLevel, destTarget, destId,
+ destLevel, internalFormat, destType, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha))
{
return;
}
- context->copyTextureCHROMIUM(sourceId, destId, internalFormat, destType, unpackFlipY,
- unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
+ context->copyTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel,
+ internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
+ unpackUnmultiplyAlpha);
}
}
ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
@@ -1897,25 +1905,27 @@ ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha)
{
EVENT(
- "(GLuint sourceId = %u, GLuint destId = %u, , GLboolean unpackFlipY = %u, GLint xoffset = "
+ "(GLuint sourceId = %u, GLint sourceLevel = %d, GLenum destTarget = 0x%X, GLuint destId = "
+ "%u, GLint destLevel = %d, GLint xoffset = "
"%d, GLint yoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = "
"%d, GLboolean unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha = %u)",
- sourceId, destId, xoffset, yoffset, x, y, width, height, unpackFlipY,
- unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
+ sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, x, y, width, height,
+ unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
- !ValidateCopySubTextureCHROMIUM(context, sourceId, destId, xoffset, yoffset, x, y,
- width, height, unpackFlipY, unpackPremultiplyAlpha,
- unpackUnmultiplyAlpha))
+ !ValidateCopySubTextureCHROMIUM(
+ context, sourceId, sourceLevel, destTarget, destId, destLevel, xoffset, yoffset, x,
+ y, width, height, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha))
{
return;
}
- context->copySubTextureCHROMIUM(sourceId, destId, xoffset, yoffset, x, y, width, height,
- unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
+ context->copySubTextureCHROMIUM(sourceId, sourceLevel, destTarget, destId, destLevel,
+ xoffset, yoffset, x, y, width, height, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
}
@@ -2377,20 +2387,24 @@ ANGLE_EXPORT void GL_APIENTRY ReadPixelsRobustANGLE(GLint x,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
void *pixels)
{
EVENT(
"(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, "
"GLenum format = 0x%X, GLenum type = 0x%X, GLsizei bufsize = %d, GLsizei* length = "
- "0x%0.8p, GLvoid* pixels = 0x%0.8p)",
- x, y, width, height, format, type, bufSize, length, pixels);
+ "0x%0.8p, GLsizei* columns = 0x%0.8p, GLsizei* rows = 0x%0.8p, GLvoid* pixels = 0x%0.8p)",
+ x, y, width, height, format, type, bufSize, length, columns, rows, pixels);
Context *context = GetValidGlobalContext();
if (context)
{
GLsizei writeLength = 0;
+ GLsizei writeColumns = 0;
+ GLsizei writeRows = 0;
if (!ValidateReadPixelsRobustANGLE(context, x, y, width, height, format, type, bufSize,
- &writeLength, pixels))
+ &writeLength, &writeColumns, &writeRows, pixels))
{
return;
}
@@ -2398,6 +2412,8 @@ ANGLE_EXPORT void GL_APIENTRY ReadPixelsRobustANGLE(GLint x,
context->readPixels(x, y, width, height, format, type, pixels);
SetRobustLengthParam(length, writeLength);
+ SetRobustLengthParam(columns, writeColumns);
+ SetRobustLengthParam(rows, writeRows);
}
}
@@ -3098,20 +3114,24 @@ ANGLE_EXPORT void GL_APIENTRY ReadnPixelsRobustANGLE(GLint x,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
void *data)
{
EVENT(
"(GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = %d, "
"GLenum format = 0x%X, GLenum type = 0x%X, GLsizei bufsize = %d, GLsizei* length = "
- "0x%0.8p, GLvoid *data = 0x%0.8p)",
- x, y, width, height, format, type, bufSize, length, data);
+ "0x%0.8p, GLsizei* columns = 0x%0.8p, GLsizei* rows = 0x%0.8p, GLvoid *data = 0x%0.8p)",
+ x, y, width, height, format, type, bufSize, length, columns, rows, data);
Context *context = GetValidGlobalContext();
if (context)
{
GLsizei writeLength = 0;
+ GLsizei writeColumns = 0;
+ GLsizei writeRows = 0;
if (!ValidateReadnPixelsRobustANGLE(context, x, y, width, height, format, type, bufSize,
- &writeLength, data))
+ &writeLength, &writeColumns, &writeRows, data))
{
return;
}
@@ -3119,6 +3139,8 @@ ANGLE_EXPORT void GL_APIENTRY ReadnPixelsRobustANGLE(GLint x,
context->readPixels(x, y, width, height, format, type, data);
SetRobustLengthParam(length, writeLength);
+ SetRobustLengthParam(columns, writeColumns);
+ SetRobustLengthParam(rows, writeRows);
}
}
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.h b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.h
index c398f20c3ad..7725b975002 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.h
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.h
@@ -240,7 +240,10 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
// GL_CHROMIUM_copy_texture
ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
@@ -248,7 +251,10 @@ ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLboolean unpackUnmultiplyAlpha);
ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
+ GLint sourceLevel,
+ GLenum destTarget,
GLuint destId,
+ GLint destLevel,
GLint xoffset,
GLint yoffset,
GLint x,
@@ -347,6 +353,8 @@ ANGLE_EXPORT void GL_APIENTRY ReadPixelsRobustANGLE(GLint x,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
void *pixels);
ANGLE_EXPORT void GL_APIENTRY TexImage2DRobustANGLE(GLenum target,
GLint level,
@@ -523,6 +531,8 @@ ANGLE_EXPORT void GL_APIENTRY ReadnPixelsRobustANGLE(GLint x,
GLenum type,
GLsizei bufSize,
GLsizei *length,
+ GLsizei *columns,
+ GLsizei *rows,
void *data);
ANGLE_EXPORT void GL_APIENTRY GetnUniformfvRobustANGLE(GLuint program,
GLint location,
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.cpp b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.cpp
index b0e3935ebf7..16c66677599 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.cpp
@@ -821,53 +821,9 @@ void GL_APIENTRY VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLs
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(Error(GL_INVALID_OPERATION));
- return;
- }
-
- if (index >= MAX_VERTEX_ATTRIBS)
- {
- context->handleError(Error(GL_INVALID_VALUE));
- return;
- }
-
- if (size < 1 || size > 4)
- {
- context->handleError(Error(GL_INVALID_VALUE));
- return;
- }
-
- switch (type)
- {
- case GL_BYTE:
- case GL_UNSIGNED_BYTE:
- case GL_SHORT:
- case GL_UNSIGNED_SHORT:
- case GL_INT:
- case GL_UNSIGNED_INT:
- break;
-
- default:
- context->handleError(Error(GL_INVALID_ENUM));
- return;
- }
-
- if (stride < 0)
- {
- context->handleError(Error(GL_INVALID_VALUE));
- return;
- }
-
- // [OpenGL ES 3.0.2] Section 2.8 page 24:
- // An INVALID_OPERATION error is generated when a non-zero vertex array object
- // is bound, zero is bound to the ARRAY_BUFFER buffer object binding point,
- // and the pointer argument is not NULL.
- if (context->getGLState().getVertexArray()->id() != 0 &&
- context->getGLState().getArrayBufferId() == 0 && pointer != NULL)
+ if (!context->skipValidation() &&
+ !ValidateVertexAttribIPointer(context, index, size, type, stride, pointer))
{
- context->handleError(Error(GL_INVALID_OPERATION));
return;
}
@@ -1744,47 +1700,13 @@ void GL_APIENTRY GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei*
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(Error(GL_INVALID_OPERATION));
- return;
- }
-
- if (bufSize < 0)
- {
- context->handleError(Error(GL_INVALID_VALUE));
- return;
- }
-
- FenceSync *fenceSync = context->getFenceSync(sync);
-
- if (!fenceSync)
+ if (!context->skipValidation() &&
+ !ValidateGetSynciv(context, sync, pname, bufSize, length, values))
{
- context->handleError(Error(GL_INVALID_VALUE));
return;
}
- switch (pname)
- {
- case GL_OBJECT_TYPE: values[0] = static_cast<GLint>(GL_SYNC_FENCE); break;
- case GL_SYNC_CONDITION: values[0] = static_cast<GLint>(fenceSync->getCondition()); break;
- case GL_SYNC_FLAGS: values[0] = static_cast<GLint>(fenceSync->getFlags()); break;
-
- case GL_SYNC_STATUS:
- {
- Error error = fenceSync->getStatus(values);
- if (error.isError())
- {
- context->handleError(error);
- return;
- }
- break;
- }
-
- default:
- context->handleError(Error(GL_INVALID_ENUM));
- return;
- }
+ context->getSynciv(sync, pname, bufSize, length, values);
}
}
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_1.cpp b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_1.cpp
index fa682c94371..1e4100b0a3a 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_1.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_1.cpp
@@ -30,11 +30,13 @@ void GL_APIENTRY DispatchCompute(GLuint numGroupsX, GLuint numGroupsY, GLuint nu
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateDispatchCompute(context, numGroupsX, numGroupsY, numGroupsZ))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return;
}
- UNIMPLEMENTED();
+
+ context->dispatchCompute(numGroupsX, numGroupsY, numGroupsZ);
}
}
@@ -145,11 +147,12 @@ GLuint GL_APIENTRY GetProgramResourceIndex(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateGetProgramResourceIndex(context, program, programInterface, name))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return GL_INVALID_INDEX;
}
- UNIMPLEMENTED();
+ return context->getProgramResourceIndex(program, programInterface, name);
}
return 0u;
}
@@ -168,11 +171,13 @@ void GL_APIENTRY GetProgramResourceName(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateGetProgramResourceName(context, program, programInterface, index, bufSize,
+ length, name))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return;
}
- UNIMPLEMENTED();
+ context->getProgramResourceName(program, programInterface, index, bufSize, length, name);
}
}
@@ -1118,11 +1123,13 @@ void GL_APIENTRY BindVertexBuffer(GLuint bindingindex,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateBindVertexBuffer(context, bindingindex, buffer, offset, stride))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return;
}
- UNIMPLEMENTED();
+
+ context->bindVertexBuffer(bindingindex, buffer, offset, stride);
}
}
@@ -1139,11 +1146,13 @@ void GL_APIENTRY VertexAttribFormat(GLuint attribindex,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateVertexAttribFormat(context, attribindex, size, type, relativeoffset, false))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return;
}
- UNIMPLEMENTED();
+
+ context->vertexAttribFormat(attribindex, size, type, normalized, relativeoffset);
}
}
@@ -1159,11 +1168,13 @@ void GL_APIENTRY VertexAttribIFormat(GLuint attribindex,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateVertexAttribFormat(context, attribindex, size, type, relativeoffset, true))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return;
}
- UNIMPLEMENTED();
+
+ context->vertexAttribIFormat(attribindex, size, type, relativeoffset);
}
}
@@ -1173,11 +1184,13 @@ void GL_APIENTRY VertexAttribBinding(GLuint attribindex, GLuint bindingindex)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateVertexAttribBinding(context, attribindex, bindingindex))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return;
}
- UNIMPLEMENTED();
+
+ context->vertexAttribBinding(attribindex, bindingindex);
}
}
@@ -1187,11 +1200,13 @@ void GL_APIENTRY VertexBindingDivisor(GLuint bindingindex, GLuint divisor)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateVertexBindingDivisor(context, bindingindex, divisor))
{
- context->handleError(Error(GL_INVALID_OPERATION, "Entry point not implemented"));
+ return;
}
- UNIMPLEMENTED();
+
+ context->setVertexBindingDivisor(bindingindex, divisor);
}
}
} // namespace gl
diff --git a/chromium/third_party/angle/src/tests/angle_end2end_tests.gypi b/chromium/third_party/angle/src/tests/angle_end2end_tests.gypi
index cb532293215..fe0a604f430 100644
--- a/chromium/third_party/angle/src/tests/angle_end2end_tests.gypi
+++ b/chromium/third_party/angle/src/tests/angle_end2end_tests.gypi
@@ -64,9 +64,12 @@
'<(angle_path)/src/tests/gl_tests/ObjectAllocationTest.cpp',
'<(angle_path)/src/tests/gl_tests/OcclusionQueriesTest.cpp',
'<(angle_path)/src/tests/gl_tests/ProgramBinaryTest.cpp',
+ '<(angle_path)/src/tests/gl_tests/ProgramInterfaceTest.cpp',
+ '<(angle_path)/src/tests/gl_tests/ProgramParameterTest.cpp',
'<(angle_path)/src/tests/gl_tests/ReadPixelsTest.cpp',
'<(angle_path)/src/tests/gl_tests/RendererTest.cpp',
'<(angle_path)/src/tests/gl_tests/RobustClientMemoryTest.cpp',
+ '<(angle_path)/src/tests/gl_tests/RobustResourceInitTest.cpp',
'<(angle_path)/src/tests/gl_tests/SimpleOperationTest.cpp',
'<(angle_path)/src/tests/gl_tests/SixteenBppTextureTest.cpp',
'<(angle_path)/src/tests/gl_tests/SRGBFramebufferTest.cpp',
@@ -108,6 +111,7 @@
'<(angle_path)/src/tests/egl_tests/EGLDeviceTest.cpp',
'<(angle_path)/src/tests/egl_tests/EGLPresentPathD3D11Test.cpp',
'<(angle_path)/src/tests/egl_tests/EGLStreamTest.cpp',
+ '<(angle_path)/src/tests/egl_tests/EGLSyncControlTest.cpp',
# TODO(cwallez) for Linux, requires a portable implementation of threads
'<(angle_path)/src/tests/egl_tests/EGLThreadTest.cpp',
'<(angle_path)/src/tests/egl_tests/media/yuvtest.inl',
diff --git a/chromium/third_party/angle/src/tests/angle_unittests.gypi b/chromium/third_party/angle/src/tests/angle_unittests.gypi
index d263aa0d394..0c0199c8f1d 100644
--- a/chromium/third_party/angle/src/tests/angle_unittests.gypi
+++ b/chromium/third_party/angle/src/tests/angle_unittests.gypi
@@ -14,8 +14,8 @@
{
'angle_unittests_sources':
[
- '<(angle_path)/src/common/BitSetIterator_unittest.cpp',
'<(angle_path)/src/common/Optional_unittest.cpp',
+ '<(angle_path)/src/common/bitset_utils_unittest.cpp',
'<(angle_path)/src/common/mathutil_unittest.cpp',
'<(angle_path)/src/common/matrix_utils_unittest.cpp',
'<(angle_path)/src/common/string_utils_unittest.cpp',
@@ -47,6 +47,7 @@
'<(angle_path)/src/libANGLE/validationES_unittest.cpp',
'<(angle_path)/src/tests/angle_unittests_utils.h',
'<(angle_path)/src/tests/compiler_tests/API_test.cpp',
+ '<(angle_path)/src/tests/compiler_tests/AppendixALimitations_test.cpp',
'<(angle_path)/src/tests/compiler_tests/CollectVariables_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ConstantFolding_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ConstantFoldingNaN_test.cpp',
@@ -55,6 +56,7 @@
'<(angle_path)/src/tests/compiler_tests/DebugShaderPrecision_test.cpp',
'<(angle_path)/src/tests/compiler_tests/EmulateGLFragColorBroadcast_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ExpressionLimit_test.cpp',
+ '<(angle_path)/src/tests/compiler_tests/EXT_YUV_target_test.cpp',
'<(angle_path)/src/tests/compiler_tests/EXT_blend_func_extended_test.cpp',
'<(angle_path)/src/tests/compiler_tests/FloatLex_test.cpp',
'<(angle_path)/src/tests/compiler_tests/FragDepth_test.cpp',
@@ -63,6 +65,7 @@
'<(angle_path)/src/tests/compiler_tests/NV_draw_buffers_test.cpp',
'<(angle_path)/src/tests/compiler_tests/Pack_Unpack_test.cpp',
'<(angle_path)/src/tests/compiler_tests/PruneEmptyDeclarations_test.cpp',
+ '<(angle_path)/src/tests/compiler_tests/PrunePureLiteralStatements_test.cpp',
'<(angle_path)/src/tests/compiler_tests/PruneUnusedFunctions_test.cpp',
'<(angle_path)/src/tests/compiler_tests/QualificationOrderESSL31_test.cpp',
'<(angle_path)/src/tests/compiler_tests/QualificationOrder_test.cpp',
diff --git a/chromium/third_party/angle/src/vulkan_support/BUILD.gn b/chromium/third_party/angle/src/vulkan_support/BUILD.gn
index 90c056d4425..66342d3c986 100644
--- a/chromium/third_party/angle/src/vulkan_support/BUILD.gn
+++ b/chromium/third_party/angle/src/vulkan_support/BUILD.gn
@@ -29,7 +29,6 @@ data_dir = "angledata"
vulkan_gen_json_files_outputs = [
"$root_out_dir/$data_dir/VkLayer_core_validation.json",
- "$root_out_dir/$data_dir/VkLayer_image.json",
"$root_out_dir/$data_dir/VkLayer_object_tracker.json",
"$root_out_dir/$data_dir/VkLayer_parameter_validation.json",
"$root_out_dir/$data_dir/VkLayer_swapchain.json",
@@ -37,30 +36,6 @@ vulkan_gen_json_files_outputs = [
"$root_out_dir/$data_dir/VkLayer_unique_objects.json",
]
-# Vulkan loader
-# -------------
-
-vulkan_gen_dir = "$target_gen_dir/angle/vulkan"
-raw_vulkan_gen_dir = rebase_path(vulkan_gen_dir)
-
-config("vulkan_loader_config") {
- include_dirs = rebase_path(vulkan_gypi.vulkan_loader_include_dirs, ".", "src")
- defines = [
- "LAYERS_SOURCE_PATH=\"$data_dir\"",
- "DEFAULT_VK_LAYERS_PATH=\".\"",
- "API_NAME=\"Vulkan\"",
- ]
- if (is_win) {
- defines += [ "VK_USE_PLATFORM_WIN32_KHR" ]
- }
-}
-
-config("vulkan_loader_internal_config") {
- if (is_clang || !is_win) {
- cflags = [ "-Wno-unused-function" ]
- }
-}
-
vulkan_undefine_configs = []
if (is_win) {
vulkan_undefine_configs += [
@@ -69,36 +44,17 @@ if (is_win) {
]
}
-static_library("vulkan_loader") {
- sources = rebase_path(vulkan_gypi.vulkan_loader_sources, ".", "src")
- if (is_win) {
- sources += rebase_path(vulkan_gypi.vulkan_loader_win_sources, ".", "src")
- if (!is_clang) {
- cflags = vulkan_gypi.vulkan_loader_cflags_win
- }
- }
- configs += [ ":vulkan_loader_internal_config" ]
- public_configs = [ ":vulkan_loader_config" ]
- configs -= vulkan_undefine_configs
-}
-
-# Vulkan layer helpers
-# --------------------
+vulkan_gen_dir = "$target_gen_dir/angle/vulkan"
+raw_vulkan_gen_dir = rebase_path(vulkan_gen_dir)
-source_set("vulkan_layer_utils") {
- sources = rebase_path(vulkan_gypi.vulkan_layer_utils_sources, ".", "src")
- public_configs = [
- ":vulkan_loader_config",
- ":vulkan_loader_internal_config",
- ]
- configs -= vulkan_undefine_configs
-}
+# Vulkan helper scripts
+# ---------------------
helper_script_and_deps = [
[
- "vulkan_gen_dispatch_table_helper",
+ "vulkan_gen_dispatch_table_helper_h",
"vk_dispatch_table_helper.h",
- "dispatch_table_generator.py",
+ "dispatch_table_helper_generator.py",
],
[
"vulkan_gen_enum_string_helper",
@@ -106,6 +62,21 @@ helper_script_and_deps = [
"helper_file_generator.py",
],
[
+ "vulkan_gen_layer_dispatch_table_h",
+ "vk_layer_dispatch_table.h",
+ "loader_extension_generator.py",
+ ],
+ [
+ "vulkan_gen_loader_extensions_c",
+ "vk_loader_extensions.c",
+ "loader_extension_generator.py",
+ ],
+ [
+ "vulkan_gen_loader_extensions_h",
+ "vk_loader_extensions.h",
+ "loader_extension_generator.py",
+ ],
+ [
"vulkan_gen_safe_struct_cpp",
"vk_safe_struct.cpp",
"helper_file_generator.py",
@@ -168,53 +139,76 @@ foreach(script_and_dep, helper_script_and_deps) {
}
}
-config("vulkan_layer_config") {
+config("vulkan_generate_helper_files_config") {
include_dirs = [
vulkan_gen_dir,
- "$vulkan_layers_dir/layers",
+ "$vulkan_layers_dir/include",
]
}
-source_set("vulkan_layer_table") {
- configs -= vulkan_undefine_configs
- public_deps = [
- ":vulkan_layer_utils",
- ]
+group("vulkan_generate_helper_files") {
+ public_deps = []
+ public_configs = [ ":vulkan_generate_helper_files_config" ]
foreach(script_and_dep, helper_script_and_deps) {
target_name = script_and_dep[0]
public_deps += [ ":$target_name" ]
}
- public_configs = [ ":vulkan_layer_config" ]
- sources = [
- "$target_gen_dir/angle/vulkan/vk_dispatch_table_helper.h",
- "$target_gen_dir/angle/vulkan/vk_enum_string_helper.h",
- "$vulkan_layers_dir/layers/vk_layer_table.cpp",
- "$vulkan_layers_dir/layers/vk_layer_table.h",
- ]
}
-layer_names = [
- "core_validation",
- "image",
- "object_tracker",
- "swapchain",
- "threading",
- "unique_objects",
- "parameter_validation",
-]
+config("vulkan_config") {
+ if (is_win) {
+ defines = [
+ "VK_USE_PLATFORM_WIN32_KHR",
+ "VK_USE_PLATFORM_WIN32_KHX",
+ ]
+ }
+}
-action("vulkan_gen_json_files") {
- script = "$third_party_dir/angle/scripts/generate_vulkan_layers_json.py"
- sources =
- rebase_path(vulkan_gypi.vulkan_gen_json_files_sources_win, ".", "src")
+config("vulkan_internal_config") {
+ defines = [ "VULKAN_NON_CMAKE_BUILD" ]
+ if (is_clang || !is_win) {
+ cflags = [ "-Wno-unused-function" ]
- # The layer JSON files are part of the necessary data deps.
- outputs = vulkan_gen_json_files_outputs
- data = vulkan_gen_json_files_outputs
- args = [
- "$raw_vulkan_layers_dir/layers/windows",
- rebase_path("$root_out_dir/$data_dir"),
+ # See https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/1649
+ # TODO(jmadill): Lift this once github issue is fixed.
+ cflags += [ "-Wno-ignored-attributes" ]
+ }
+}
+
+# Vulkan loader
+# -------------
+
+config("vulkan_loader_config") {
+ include_dirs = rebase_path(vulkan_gypi.vulkan_loader_include_dirs, ".", "src")
+ include_dirs += [ vulkan_gen_dir ]
+ defines = [
+ "LAYERS_SOURCE_PATH=\"$data_dir\"",
+ "DEFAULT_VK_LAYERS_PATH=\".\"",
+ "API_NAME=\"Vulkan\"",
]
+
+ if (is_win) {
+ cflags = [ "/wd4201" ]
+ }
+}
+
+static_library("vulkan_loader") {
+ sources = rebase_path(vulkan_gypi.vulkan_loader_sources, ".", "src")
+ if (is_win) {
+ sources += rebase_path(vulkan_gypi.vulkan_loader_win_sources, ".", "src")
+ if (!is_clang) {
+ cflags = vulkan_gypi.vulkan_loader_cflags_win
+ }
+ }
+ deps = [
+ ":vulkan_generate_helper_files",
+ ]
+ configs += [ ":vulkan_internal_config" ]
+ public_configs = [
+ ":vulkan_config",
+ ":vulkan_loader_config",
+ ]
+ configs -= vulkan_undefine_configs
}
# SPIRV-tools
@@ -350,6 +344,88 @@ static_library("glslang") {
# The validation layers
# ---------------------
+config("vulkan_layer_config") {
+ include_dirs = [ "$vulkan_layers_dir/layers" ]
+}
+
+source_set("vulkan_layer_table") {
+ configs -= vulkan_undefine_configs
+ public_deps = [
+ ":vulkan_generate_helper_files",
+ ]
+ public_configs = [
+ ":vulkan_config",
+ ":vulkan_layer_config",
+ ":vulkan_internal_config",
+ ]
+ sources = [
+ "$target_gen_dir/angle/vulkan/vk_dispatch_table_helper.h",
+ "$target_gen_dir/angle/vulkan/vk_enum_string_helper.h",
+ "$vulkan_layers_dir/layers/vk_layer_table.cpp",
+ "$vulkan_layers_dir/layers/vk_layer_table.h",
+ ]
+}
+
+layers = [
+ [
+ "core_validation",
+ vulkan_gypi.VkLayer_core_validation_sources,
+ ":vulkan_core_validation_glslang",
+ ],
+ [
+ "object_tracker",
+ vulkan_gypi.VkLayer_object_tracker_sources,
+ "",
+ ],
+ [
+ "unique_objects",
+ vulkan_gypi.VkLayer_unique_objects_sources,
+ ":vulkan_gen_unique_objects_wrappers_helper",
+ ],
+ [
+ "parameter_validation",
+ vulkan_gypi.VkLayer_parameter_validation_sources,
+ ":vulkan_gen_parameter_validation_helper",
+ ],
+ [
+ "swapchain",
+ vulkan_gypi.VkLayer_swapchain_sources,
+ "",
+ ],
+ [
+ "threading",
+ vulkan_gypi.VkLayer_threading_sources,
+ ":vulkan_gen_thread_check_helper",
+ ],
+]
+
+action("vulkan_gen_json_files") {
+ script = "$third_party_dir/angle/scripts/generate_vulkan_layers_json.py"
+ sources =
+ rebase_path(vulkan_gypi.vulkan_gen_json_files_sources_win, ".", "src")
+
+ # The layer JSON files are part of the necessary data deps.
+ outputs = vulkan_gen_json_files_outputs
+ data = vulkan_gen_json_files_outputs
+ args = [
+ "$raw_vulkan_layers_dir/layers/windows",
+ rebase_path("$root_out_dir/$data_dir"),
+ ]
+}
+
+source_set("vulkan_layer_utils") {
+ sources = rebase_path(vulkan_gypi.vulkan_layer_utils_sources, ".", "src")
+ public_configs = [
+ ":vulkan_config",
+ ":vulkan_loader_config",
+ ":vulkan_internal_config",
+ ]
+ public_deps = [
+ ":vulkan_generate_helper_files",
+ ]
+ configs -= vulkan_undefine_configs
+}
+
config("vulkan_core_validation_config") {
include_dirs = [ glslang_dir ]
}
@@ -361,47 +437,20 @@ source_set("vulkan_core_validation_glslang") {
public_configs = [ ":vulkan_core_validation_config" ]
}
-layer_indexes = [
- 0,
- 1,
- 2,
- 3,
- 4,
- 5,
- 6,
-]
-
-layer_sources = [
- vulkan_gypi.VkLayer_core_validation_sources,
- vulkan_gypi.VkLayer_image_sources,
- vulkan_gypi.VkLayer_swapchain_sources,
- vulkan_gypi.VkLayer_object_tracker_sources,
- vulkan_gypi.VkLayer_unique_objects_sources,
- vulkan_gypi.VkLayer_threading_sources,
- vulkan_gypi.VkLayer_parameter_validation_sources,
-]
-
-layer_additional_deps = [
- [ ":vulkan_core_validation_glslang" ],
- [],
- [],
- [],
- [ ":vulkan_gen_unique_objects_wrappers_helper" ],
- [ ":vulkan_gen_thread_check_helper" ],
- [ ":vulkan_gen_parameter_validation_helper" ],
-]
-
-foreach(index, layer_indexes) {
- layer = layer_names[index]
- shared_library("VkLayer_$layer") {
+foreach(layer_info, layers) {
+ name = layer_info[0]
+ shared_library("VkLayer_$name") {
configs -= vulkan_undefine_configs
deps = [
":vulkan_layer_table",
+ ":vulkan_layer_utils",
]
- deps += layer_additional_deps[index]
- sources = rebase_path(layer_sources[index], ".", "src")
+ if (layer_info[2] != "") {
+ deps += [ layer_info[2] ]
+ }
+ sources = rebase_path(layer_info[1], ".", "src")
if (is_win) {
- sources += [ "$vulkan_layers_dir/layers/VKLayer_$layer.def" ]
+ sources += [ "$vulkan_layers_dir/layers/VKLayer_$name.def" ]
}
}
}
@@ -415,10 +464,12 @@ group("angle_vulkan") {
data_deps = [
":vulkan_gen_json_files",
]
- foreach(layer, layer_names) {
- data_deps += [ ":VkLayer_$layer" ]
+ foreach(layer_info, layers) {
+ name = layer_info[0]
+ data_deps += [ ":VkLayer_$name" ]
}
public_configs = [
+ ":vulkan_config",
":vulkan_loader_config",
":glslang_config",
]
diff --git a/chromium/third_party/angle/src/vulkan_support/vulkan.gypi b/chromium/third_party/angle/src/vulkan_support/vulkan.gypi
index c8d70cedab3..82155f78ebf 100644
--- a/chromium/third_party/angle/src/vulkan_support/vulkan.gypi
+++ b/chromium/third_party/angle/src/vulkan_support/vulkan.gypi
@@ -16,14 +16,14 @@
'<(vulkan_layers_path)/loader/debug_report.c',
'<(vulkan_layers_path)/loader/debug_report.h',
'<(vulkan_layers_path)/loader/dev_ext_trampoline.c',
- '<(vulkan_layers_path)/loader/extensions.c',
- '<(vulkan_layers_path)/loader/extensions.h',
+ '<(vulkan_layers_path)/loader/extension_manual.c',
+ '<(vulkan_layers_path)/loader/extension_manual.h',
'<(vulkan_layers_path)/loader/gpa_helper.h',
'<(vulkan_layers_path)/loader/loader.c',
'<(vulkan_layers_path)/loader/loader.h',
'<(vulkan_layers_path)/loader/murmurhash.c',
'<(vulkan_layers_path)/loader/murmurhash.h',
- '<(vulkan_layers_path)/loader/table_ops.h',
+ '<(vulkan_layers_path)/loader/phys_dev_ext.c',
'<(vulkan_layers_path)/loader/trampoline.c',
'<(vulkan_layers_path)/loader/vk_loader_platform.h',
'<(vulkan_layers_path)/loader/wsi.c',
@@ -48,6 +48,7 @@
'/wd4201', # Nonstandard extension used: nameless struct/union
'/wd4214', # Nonstandard extension used: bit field types other than int
'/wd4232', # Nonstandard extension used: address of dllimport is not static
+ '/wd4305', # Type cast truncation
'/wd4706', # Assignment within conditional expression
'/wd4996', # Unsafe stdlib function
],
@@ -247,16 +248,13 @@
# This file is manually included in the layer
# '<(angle_gen_path)/vulkan/vk_safe_struct.cpp',
'<(angle_gen_path)/vulkan/vk_safe_struct.h',
+ '<(vulkan_layers_path)/layers/buffer_validation.cpp',
+ '<(vulkan_layers_path)/layers/buffer_validation.h',
'<(vulkan_layers_path)/layers/core_validation.cpp',
'<(vulkan_layers_path)/layers/core_validation.h',
'<(vulkan_layers_path)/layers/descriptor_sets.cpp',
'<(vulkan_layers_path)/layers/descriptor_sets.h',
],
- 'VkLayer_image_sources':
- [
- '<(vulkan_layers_path)/layers/image.cpp',
- '<(vulkan_layers_path)/layers/image.h',
- ],
'VkLayer_swapchain_sources':
[
'<(vulkan_layers_path)/layers/swapchain.cpp',
@@ -290,7 +288,6 @@
'vulkan_gen_json_files_sources_win':
[
'<(vulkan_layers_path)/layers/windows/VkLayer_core_validation.json',
- '<(vulkan_layers_path)/layers/windows/VkLayer_image.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_object_tracker.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_parameter_validation.json',
'<(vulkan_layers_path)/layers/windows/VkLayer_swapchain.json',
@@ -300,7 +297,6 @@
'vulkan_gen_json_files_outputs':
[
'<(angle_gen_path)/vulkan/json/VkLayer_core_validation.json',
- '<(angle_gen_path)/vulkan/json/VkLayer_image.json',
'<(angle_gen_path)/vulkan/json/VkLayer_object_tracker.json',
'<(angle_gen_path)/vulkan/json/VkLayer_parameter_validation.json',
'<(angle_gen_path)/vulkan/json/VkLayer_swapchain.json',
@@ -315,110 +311,6 @@
'targets':
[
{
- 'target_name': 'vulkan_loader',
- 'type': 'static_library',
- 'sources':
- [
- '<@(vulkan_loader_sources)',
- ],
- 'include_dirs':
- [
- '<@(vulkan_loader_include_dirs)',
- '<(angle_gen_path)',
- ],
- 'defines':
- [
- 'API_NAME="Vulkan"',
- ],
- 'msvs_settings':
- {
- 'VCCLCompilerTool':
- {
- 'AdditionalOptions':
- [
- # TODO(jmadill): Force include header on other platforms.
- '<@(vulkan_loader_cflags_win)',
- '/FIvulkan/angle_loader.h'
- ],
- },
- 'VCLinkerTool':
- {
- 'AdditionalDependencies':
- [
- 'shlwapi.lib',
- ],
- },
- },
- 'direct_dependent_settings':
- {
- 'include_dirs':
- [
- '<@(vulkan_loader_include_dirs)',
- ],
- 'msvs_settings':
- {
- 'VCLinkerTool':
- {
- 'AdditionalDependencies':
- [
- 'shlwapi.lib',
- ],
- },
- },
- 'conditions':
- [
- ['OS=="win"',
- {
- 'defines':
- [
- 'VK_USE_PLATFORM_WIN32_KHR',
- ],
- }],
- ],
- },
- 'conditions':
- [
- ['OS=="win"',
- {
- 'sources':
- [
- '<(angle_gen_path)/vulkan/angle_loader.h',
- '<@(vulkan_loader_win_sources)',
- ],
- 'defines':
- [
- 'VK_USE_PLATFORM_WIN32_KHR',
- ],
- }],
- ],
- 'actions':
- [
- {
- # The loader header is force included into the loader and layers. Because
- # of issues with GYP, we can't use a normal header file, we hav to force
- # inclue this using compiler-specific flags.
- 'action_name': 'vulkan_loader_gen_angle_header',
- 'message': 'generating Vulkan loader ANGLE header',
- 'msvs_cygwin_shell': 0,
- 'inputs':
- [
- '<(angle_path)/scripts/generate_vulkan_header.py',
- ],
- 'outputs':
- [
- '<(angle_gen_path)/vulkan/angle_loader.h',
- ],
- 'action':
- [
- # TODO(jmadill): Use correct platform path
- 'python', '<(angle_path)/scripts/generate_vulkan_header.py', '<(angle_gen_path)/vulkan/json',
- '<(angle_gen_path)/vulkan/angle_loader.h', '<(PRODUCT_DIR)',
- ],
- },
- ],
- },
-
- {
'target_name': 'glslang',
'type': 'static_library',
'sources':
@@ -589,12 +481,14 @@
{
'target_name': 'vulkan_layer_utils_static',
'type': 'static_library',
+ 'msvs_cygwin_shell': 0,
'sources':
[
'<@(vulkan_layer_utils_sources)',
],
'include_dirs':
[
+ '<(angle_gen_path)/vulkan',
'<@(vulkan_loader_include_dirs)',
],
'msvs_settings':
@@ -623,6 +517,7 @@
'WIN32',
'WIN32_LEAN_AND_MEAN',
'VK_USE_PLATFORM_WIN32_KHR',
+ 'VK_USE_PLATFORM_WIN32_KHX',
],
}],
],
@@ -652,6 +547,7 @@
'AdditionalOptions':
[
'/wd4100', # Unreferenced local parameter
+ '/wd4201', # Nonstandard extension used: nameless struct/union
'/wd4456', # declaration hides previous local declaration
'/wd4505', # Unreferenced local function has been removed
'/wd4996', # Unsafe stdlib function
@@ -666,6 +562,7 @@
[
'WIN32_LEAN_AND_MEAN',
'VK_USE_PLATFORM_WIN32_KHR',
+ 'VK_USE_PLATFORM_WIN32_KHX',
],
'configurations':
{
@@ -686,11 +583,6 @@
}],
],
},
- },
- {
- 'target_name': 'vulkan_generate_layer_helpers',
- 'type': 'none',
- 'msvs_cygwin_shell': 0,
'actions':
[
@@ -816,11 +708,33 @@
},
{
- 'action_name': 'vulkan_generate_dispatch_table_helper',
+ 'action_name': 'vulkan_run_vk_xml_generate_vk_layer_dispatch_table_h',
+ 'message': 'generating vk_layer_dispatch_table.h',
+ 'inputs':
+ [
+ '<(vulkan_layers_path)/scripts/loader_extension_generator.py',
+ '<(vulkan_layers_path)/scripts/generator.py',
+ '<(vulkan_layers_path)/scripts/lvl_genvk.py',
+ '<(vulkan_layers_path)/scripts/reg.py',
+ '<(vulkan_layers_path)/scripts/vk.xml',
+ ],
+ 'outputs':
+ [
+ '<(angle_gen_path)/vulkan/vk_layer_dispatch_table.h',
+ ],
+ 'action':
+ [
+ 'python', '<(vulkan_layers_path)/scripts/lvl_genvk.py', '-o', '<(angle_gen_path)/vulkan',
+ '-registry', '<(vulkan_layers_path)/scripts/vk.xml', 'vk_layer_dispatch_table.h', '-quiet',
+ ],
+ },
+
+ {
+ 'action_name': 'vulkan_run_vk_xml_generate_vk_dispatch_table_helper_h',
'message': 'generating vk_dispatch_table_helper.h',
'inputs':
[
- '<(vulkan_layers_path)/scripts/dispatch_table_generator.py',
+ '<(vulkan_layers_path)/scripts/dispatch_table_helper_generator.py',
'<(vulkan_layers_path)/scripts/generator.py',
'<(vulkan_layers_path)/scripts/lvl_genvk.py',
'<(vulkan_layers_path)/scripts/reg.py',
@@ -838,6 +752,50 @@
},
{
+ 'action_name': 'vulkan_run_vk_xml_generate_vk_loader_extensions_h',
+ 'message': 'generating vk_loader_extensions.h',
+ 'inputs':
+ [
+ '<(vulkan_layers_path)/scripts/loader_extension_generator.py',
+ '<(vulkan_layers_path)/scripts/generator.py',
+ '<(vulkan_layers_path)/scripts/lvl_genvk.py',
+ '<(vulkan_layers_path)/scripts/reg.py',
+ '<(vulkan_layers_path)/scripts/vk.xml',
+ ],
+ 'outputs':
+ [
+ '<(angle_gen_path)/vulkan/vk_loader_extensions.h',
+ ],
+ 'action':
+ [
+ 'python', '<(vulkan_layers_path)/scripts/lvl_genvk.py', '-o', '<(angle_gen_path)/vulkan',
+ '-registry', '<(vulkan_layers_path)/scripts/vk.xml', 'vk_loader_extensions.h', '-quiet',
+ ],
+ },
+
+ {
+ 'action_name': 'vulkan_run_vk_xml_generate_vk_loader_extensions_c',
+ 'message': 'generating vk_loader_extensions.c',
+ 'inputs':
+ [
+ '<(vulkan_layers_path)/scripts/loader_extension_generator.py',
+ '<(vulkan_layers_path)/scripts/generator.py',
+ '<(vulkan_layers_path)/scripts/lvl_genvk.py',
+ '<(vulkan_layers_path)/scripts/reg.py',
+ '<(vulkan_layers_path)/scripts/vk.xml',
+ ],
+ 'outputs':
+ [
+ '<(angle_gen_path)/vulkan/vk_loader_extensions.c',
+ ],
+ 'action':
+ [
+ 'python', '<(vulkan_layers_path)/scripts/lvl_genvk.py', '-o', '<(angle_gen_path)/vulkan',
+ '-registry', '<(vulkan_layers_path)/scripts/vk.xml', 'vk_loader_extensions.c', '-quiet',
+ ],
+ },
+
+ {
'action_name': 'vulkan_generate_json_files',
'message': 'generating Vulkan json files',
'inputs':
@@ -868,41 +826,124 @@
},
{
- 'target_name': 'VkLayer_core_validation',
- 'type': 'shared_library',
- 'dependencies':
+ 'target_name': 'vulkan_loader',
+ 'type': 'static_library',
+ 'deps': 'vulkan_layer_utils_static',
+ 'sources':
[
- 'spirv_tools',
- 'vulkan_generate_layer_helpers',
- 'vulkan_layer_utils_static',
+ '<@(vulkan_loader_sources)',
],
- 'sources':
+ 'include_dirs':
[
- '<@(VkLayer_core_validation_sources)',
+ '<@(vulkan_loader_include_dirs)',
+ '<(angle_gen_path)/vulkan',
+ ],
+ 'defines':
+ [
+ 'API_NAME="Vulkan"',
+ 'VULKAN_NON_CMAKE_BUILD',
],
+ 'msvs_settings':
+ {
+ 'VCCLCompilerTool':
+ {
+ 'AdditionalOptions':
+ [
+ # TODO(jmadill): Force include header on other platforms.
+ '<@(vulkan_loader_cflags_win)',
+ '/FIangle_loader.h'
+ ],
+ },
+ 'VCLinkerTool':
+ {
+ 'AdditionalDependencies':
+ [
+ 'shlwapi.lib',
+ ],
+ },
+ },
+ 'direct_dependent_settings':
+ {
+ 'include_dirs':
+ [
+ '<@(vulkan_loader_include_dirs)',
+ ],
+ 'msvs_settings':
+ {
+ 'VCLinkerTool':
+ {
+ 'AdditionalDependencies':
+ [
+ 'shlwapi.lib',
+ ],
+ },
+ },
+ 'conditions':
+ [
+ ['OS=="win"',
+ {
+ 'defines':
+ [
+ 'VK_USE_PLATFORM_WIN32_KHR',
+ 'VK_USE_PLATFORM_WIN32_KHX',
+ ],
+ }],
+ ],
+ },
'conditions':
[
['OS=="win"',
{
'sources':
[
- '<(vulkan_layers_path)/layers/VkLayer_core_validation.def',
- ]
+ '<(angle_gen_path)/vulkan/angle_loader.h',
+ '<@(vulkan_loader_win_sources)',
+ ],
+ 'defines':
+ [
+ 'VK_USE_PLATFORM_WIN32_KHR',
+ 'VK_USE_PLATFORM_WIN32_KHX',
+ ],
}],
],
+ 'actions':
+ [
+ {
+ # The loader header is force included into the loader and layers. Because
+ # of issues with GYP, we can't use a normal header file, we hav to force
+ # inclue this using compiler-specific flags.
+ 'action_name': 'vulkan_loader_gen_angle_header',
+ 'message': 'generating Vulkan loader ANGLE header',
+ 'msvs_cygwin_shell': 0,
+ 'inputs':
+ [
+ '<(angle_path)/scripts/generate_vulkan_header.py',
+ ],
+ 'outputs':
+ [
+ '<(angle_gen_path)/vulkan/angle_loader.h',
+ ],
+ 'action':
+ [
+ # TODO(jmadill): Use correct platform path
+ 'python', '<(angle_path)/scripts/generate_vulkan_header.py', '<(angle_gen_path)/vulkan/json',
+ '<(angle_gen_path)/vulkan/angle_loader.h', '<(PRODUCT_DIR)',
+ ],
+ },
+ ],
},
{
- 'target_name': 'VkLayer_image',
+ 'target_name': 'VkLayer_core_validation',
'type': 'shared_library',
'dependencies':
[
- 'vulkan_generate_layer_helpers',
+ 'spirv_tools',
'vulkan_layer_utils_static',
],
'sources':
[
- '<@(VkLayer_image_sources)',
+ '<@(VkLayer_core_validation_sources)',
],
'conditions':
[
@@ -910,7 +951,7 @@
{
'sources':
[
- '<(vulkan_layers_path)/layers/VkLayer_image.def',
+ '<(vulkan_layers_path)/layers/VkLayer_core_validation.def',
]
}],
],
@@ -921,7 +962,6 @@
'type': 'shared_library',
'dependencies':
[
- 'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
@@ -945,7 +985,6 @@
'type': 'shared_library',
'dependencies':
[
- 'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
@@ -969,7 +1008,6 @@
'type': 'shared_library',
'dependencies':
[
- 'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
@@ -1017,7 +1055,6 @@
'type': 'shared_library',
'dependencies':
[
- 'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
@@ -1065,7 +1102,6 @@
'type': 'shared_library',
'dependencies':
[
- 'vulkan_generate_layer_helpers',
'vulkan_layer_utils_static',
],
'sources':
@@ -1116,7 +1152,6 @@
# Need to disable these to prevent multiply defined symbols with ninja.
# TODO(jmadill): Figure out how to implement data_deps in gyp.
# 'VkLayer_core_validation',
- # 'VkLayer_image',
# 'VkLayer_object_tracker',
# 'VkLayer_parameter_validation',
# 'VkLayer_swapchain',
diff --git a/chromium/third_party/angle/util/EGLWindow.cpp b/chromium/third_party/angle/util/EGLWindow.cpp
index 35b2907c723..a360f4846fc 100644
--- a/chromium/third_party/angle/util/EGLWindow.cpp
+++ b/chromium/third_party/angle/util/EGLWindow.cpp
@@ -100,6 +100,8 @@ EGLWindow::EGLWindow(EGLint glesMajorVersion,
mContext(EGL_NO_CONTEXT),
mClientMajorVersion(glesMajorVersion),
mClientMinorVersion(glesMinorVersion),
+ mEGLMajorVersion(0),
+ mEGLMinorVersion(0),
mPlatform(platform),
mRedBits(-1),
mGreenBits(-1),
@@ -114,6 +116,7 @@ EGLWindow::EGLWindow(EGLint glesMajorVersion,
mWebGLCompatibility(false),
mBindGeneratesResource(true),
mClientArraysEnabled(true),
+ mRobustResourceInit(false),
mSwapInterval(-1)
{
}
@@ -150,6 +153,13 @@ EGLContext EGLWindow::getContext() const
bool EGLWindow::initializeGL(OSWindow *osWindow)
{
+ if (!initializeDisplayAndSurface(osWindow))
+ return false;
+ return initializeContext();
+}
+
+bool EGLWindow::initializeDisplayAndSurface(OSWindow *osWindow)
+{
PFNEGLGETPLATFORMDISPLAYEXTPROC eglGetPlatformDisplayEXT = reinterpret_cast<PFNEGLGETPLATFORMDISPLAYEXTPROC>(eglGetProcAddress("eglGetPlatformDisplayEXT"));
if (!eglGetPlatformDisplayEXT)
{
@@ -202,8 +212,7 @@ bool EGLWindow::initializeGL(OSWindow *osWindow)
return false;
}
- EGLint majorVersion, minorVersion;
- if (eglInitialize(mDisplay, &majorVersion, &minorVersion) == EGL_FALSE)
+ if (eglInitialize(mDisplay, &mEGLMajorVersion, &mEGLMinorVersion) == EGL_FALSE)
{
destroyGL();
return false;
@@ -211,46 +220,6 @@ bool EGLWindow::initializeGL(OSWindow *osWindow)
const char *displayExtensions = eglQueryString(mDisplay, EGL_EXTENSIONS);
- // EGL_KHR_create_context is required to request a non-ES2 context.
- bool hasKHRCreateContext = strstr(displayExtensions, "EGL_KHR_create_context") != nullptr;
- if (majorVersion != 2 && minorVersion != 0 && !hasKHRCreateContext)
- {
- destroyGL();
- return false;
- }
-
- bool hasWebGLCompatibility =
- strstr(displayExtensions, "EGL_ANGLE_create_context_webgl_compatibility") != nullptr;
- if (mWebGLCompatibility && !hasWebGLCompatibility)
- {
- destroyGL();
- return false;
- }
-
- bool hasBindGeneratesResource =
- strstr(displayExtensions, "EGL_CHROMIUM_create_context_bind_generates_resource") != nullptr;
- if (!mBindGeneratesResource && !hasBindGeneratesResource)
- {
- destroyGL();
- return false;
- }
-
- bool hasClientArraysExtension =
- strstr(displayExtensions, "EGL_ANGLE_create_context_client_arrays") != nullptr;
- if (!mClientArraysEnabled && !hasClientArraysExtension)
- {
- // Non-default state requested without the extension present
- destroyGL();
- return false;
- }
-
- eglBindAPI(EGL_OPENGL_ES_API);
- if (eglGetError() != EGL_SUCCESS)
- {
- destroyGL();
- return false;
- }
-
std::vector<EGLint> configAttributes = {
EGL_RED_SIZE, (mRedBits >= 0) ? mRedBits : EGL_DONT_CARE,
EGL_GREEN_SIZE, (mGreenBits >= 0) ? mGreenBits : EGL_DONT_CARE,
@@ -306,6 +275,63 @@ bool EGLWindow::initializeGL(OSWindow *osWindow)
return false;
}
ASSERT(mSurface != EGL_NO_SURFACE);
+ return true;
+}
+
+bool EGLWindow::initializeContext()
+{
+ const char *displayExtensions = eglQueryString(mDisplay, EGL_EXTENSIONS);
+
+ // EGL_KHR_create_context is required to request a ES3+ context.
+ bool hasKHRCreateContext = strstr(displayExtensions, "EGL_KHR_create_context") != nullptr;
+ if (mClientMajorVersion > 2 && !(mEGLMajorVersion > 1 || mEGLMinorVersion >= 5) &&
+ !hasKHRCreateContext)
+ {
+ destroyGL();
+ return false;
+ }
+
+ bool hasWebGLCompatibility =
+ strstr(displayExtensions, "EGL_ANGLE_create_context_webgl_compatibility") != nullptr;
+ if (mWebGLCompatibility && !hasWebGLCompatibility)
+ {
+ destroyGL();
+ return false;
+ }
+
+ bool hasBindGeneratesResource =
+ strstr(displayExtensions, "EGL_CHROMIUM_create_context_bind_generates_resource") != nullptr;
+ if (!mBindGeneratesResource && !hasBindGeneratesResource)
+ {
+ destroyGL();
+ return false;
+ }
+
+ bool hasClientArraysExtension =
+ strstr(displayExtensions, "EGL_ANGLE_create_context_client_arrays") != nullptr;
+ if (!mClientArraysEnabled && !hasClientArraysExtension)
+ {
+ // Non-default state requested without the extension present
+ destroyGL();
+ return false;
+ }
+
+ bool hasRobustResourceInit =
+ strstr(displayExtensions, "EGL_ANGLE_create_context_robust_resource_initialization") !=
+ nullptr;
+ if (mRobustResourceInit && !hasRobustResourceInit)
+ {
+ // Non-default state requested without the extension present
+ destroyGL();
+ return false;
+ }
+
+ eglBindAPI(EGL_OPENGL_ES_API);
+ if (eglGetError() != EGL_SUCCESS)
+ {
+ destroyGL();
+ return false;
+ }
std::vector<EGLint> contextAttributes;
if (hasKHRCreateContext)
@@ -343,6 +369,12 @@ bool EGLWindow::initializeGL(OSWindow *osWindow)
contextAttributes.push_back(EGL_CONTEXT_CLIENT_ARRAYS_ENABLED_ANGLE);
contextAttributes.push_back(mClientArraysEnabled ? EGL_TRUE : EGL_FALSE);
}
+
+ if (hasRobustResourceInit)
+ {
+ contextAttributes.push_back(EGL_CONTEXT_ROBUST_RESOURCE_INITIALIZATION_ANGLE);
+ contextAttributes.push_back(mRobustResourceInit ? EGL_TRUE : EGL_FALSE);
+ }
}
contextAttributes.push_back(EGL_NONE);
diff --git a/chromium/third_party/angle/util/EGLWindow.h b/chromium/third_party/angle/util/EGLWindow.h
index 976af3ec486..cfe3b760208 100644
--- a/chromium/third_party/angle/util/EGLWindow.h
+++ b/chromium/third_party/angle/util/EGLWindow.h
@@ -80,6 +80,7 @@ class ANGLE_EXPORT EGLWindow : angle::NonCopyable
}
void setVulkanLayersEnabled(bool enabled) { mVulkanLayersEnabled = enabled; }
void setClientArraysEnabled(bool enabled) { mClientArraysEnabled = enabled; }
+ void setRobustResourceInit(bool enabled) { mRobustResourceInit = enabled; }
void setSwapInterval(EGLint swapInterval) { mSwapInterval = swapInterval; }
static EGLBoolean FindEGLConfig(EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *config);
@@ -103,7 +104,15 @@ class ANGLE_EXPORT EGLWindow : angle::NonCopyable
bool isDebugEnabled() const { return mDebug; }
EGLint getSwapInterval() const { return mSwapInterval; }
+ // Internally initializes the Display, Surface and Context.
bool initializeGL(OSWindow *osWindow);
+
+ // Only initializes the Display and Surface.
+ bool initializeDisplayAndSurface(OSWindow *osWindow);
+
+ // Only initializes the Context.
+ bool initializeContext();
+
void destroyGL();
bool isGLInitialized() const;
@@ -115,6 +124,8 @@ class ANGLE_EXPORT EGLWindow : angle::NonCopyable
EGLint mClientMajorVersion;
EGLint mClientMinorVersion;
+ EGLint mEGLMajorVersion;
+ EGLint mEGLMinorVersion;
EGLPlatformParameters mPlatform;
int mRedBits;
int mGreenBits;
@@ -129,6 +140,7 @@ class ANGLE_EXPORT EGLWindow : angle::NonCopyable
bool mWebGLCompatibility;
bool mBindGeneratesResource;
bool mClientArraysEnabled;
+ bool mRobustResourceInit;
EGLint mSwapInterval;
Optional<bool> mVulkanLayersEnabled;
};