summaryrefslogtreecommitdiff
path: root/chromium/third_party/angle
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-20 10:33:36 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2017-11-22 11:45:12 +0000
commitbe59a35641616a4cf23c4a13fa0632624b021c1b (patch)
tree9da183258bdf9cc413f7562079d25ace6955467f /chromium/third_party/angle
parentd702e4b6a64574e97fc7df8fe3238cde70242080 (diff)
downloadqtwebengine-chromium-be59a35641616a4cf23c4a13fa0632624b021c1b.tar.gz
BASELINE: Update Chromium to 62.0.3202.101
Change-Id: I2d5eca8117600df6d331f6166ab24d943d9814ac Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'chromium/third_party/angle')
-rw-r--r--chromium/third_party/angle/extensions/ANGLE_multiview.txt29
-rw-r--r--chromium/third_party/angle/include/GLES2/gl2ext_angle.h8
-rw-r--r--chromium/third_party/angle/include/GLSLANG/ShaderLang.h42
-rw-r--r--chromium/third_party/angle/include/GLSLANG/ShaderVars.h14
-rw-r--r--chromium/third_party/angle/include/angle_gl.h5
-rw-r--r--chromium/third_party/angle/infra/config/cq.cfg4
-rw-r--r--chromium/third_party/angle/samples/shader_translator/shader_translator.cpp36
-rw-r--r--chromium/third_party/angle/scripts/generate_entry_points.py78
-rw-r--r--chromium/third_party/angle/scripts/perf_test_runner.py2
-rw-r--r--chromium/third_party/angle/src/common/MemoryBuffer.cpp16
-rw-r--r--chromium/third_party/angle/src/common/MemoryBuffer.h11
-rw-r--r--chromium/third_party/angle/src/common/angleutils.cpp17
-rw-r--r--chromium/third_party/angle/src/common/angleutils.h36
-rw-r--r--chromium/third_party/angle/src/common/utilities.cpp26
-rw-r--r--chromium/third_party/angle/src/common/utilities.h12
-rw-r--r--chromium/third_party/angle/src/compiler.gypi4
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp47
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.h3
-rw-r--r--chromium/third_party/angle/src/compiler/translator/BaseTypes.h66
-rw-r--r--chromium/third_party/angle/src/compiler/translator/CallDAG.h1
-rw-r--r--chromium/third_party/angle/src/compiler/translator/CollectVariables.cpp (renamed from chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp)382
-rw-r--r--chromium/third_party/angle/src/compiler/translator/CollectVariables.h (renamed from chromium/third_party/angle/src/compiler/translator/VariableInfo.h)24
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Compiler.cpp97
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Compiler.h40
-rw-r--r--chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp71
-rw-r--r--chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h10
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Initialize.cpp112
-rw-r--r--chromium/third_party/angle/src/compiler/translator/InitializeVariables.cpp8
-rw-r--r--chromium/third_party/angle/src/compiler/translator/IntermNode.cpp8
-rw-r--r--chromium/third_party/angle/src/compiler/translator/IntermNode.h2
-rw-r--r--chromium/third_party/angle/src/compiler/translator/IntermNode_util.cpp11
-rw-r--r--chromium/third_party/angle/src/compiler/translator/IntermNode_util.h3
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Operator.cpp5
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Operator.h6
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp81
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h6
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp280
-rw-r--r--chromium/third_party/angle/src/compiler/translator/OutputHLSL.h12
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ParseContext.cpp646
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ParseContext.h51
-rw-r--r--chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp36
-rw-r--r--chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp64
-rw-r--r--chromium/third_party/angle/src/compiler/translator/RewriteDoWhile.cpp9
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp101
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp8
-rw-r--r--chromium/third_party/angle/src/compiler/translator/StructureHLSL.cpp35
-rw-r--r--chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp35
-rw-r--r--chromium/third_party/angle/src/compiler/translator/SymbolTable.h26
-rw-r--r--chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp23
-rw-r--r--chromium/third_party/angle/src/compiler/translator/TranslatorGLSL.cpp13
-rw-r--r--chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.cpp12
-rw-r--r--chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.h6
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Types.cpp218
-rw-r--r--chromium/third_party/angle/src/compiler/translator/Types.h117
-rw-r--r--chromium/third_party/angle/src/compiler/translator/UniformHLSL.cpp108
-rw-r--r--chromium/third_party/angle/src/compiler/translator/UniformHLSL.h30
-rw-r--r--chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp4
-rw-r--r--chromium/third_party/angle/src/compiler/translator/VariablePacker.cpp267
-rw-r--r--chromium/third_party/angle/src/compiler/translator/VariablePacker.h45
-rw-r--r--chromium/third_party/angle/src/compiler/translator/glslang.y7
-rw-r--r--chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp35
-rw-r--r--chromium/third_party/angle/src/compiler/translator/util.cpp12
-rw-r--r--chromium/third_party/angle/src/compiler/translator/util.h3
-rw-r--r--chromium/third_party/angle/src/libANGLE/Caps.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/Caps.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/Compiler.cpp1
-rw-r--r--chromium/third_party/angle/src/libANGLE/Context.cpp708
-rw-r--r--chromium/third_party/angle/src/libANGLE/Context.h146
-rw-r--r--chromium/third_party/angle/src/libANGLE/ContextState.cpp21
-rw-r--r--chromium/third_party/angle/src/libANGLE/ContextState.h8
-rw-r--r--chromium/third_party/angle/src/libANGLE/Error.h7
-rw-r--r--chromium/third_party/angle/src/libANGLE/ErrorStrings.h60
-rw-r--r--chromium/third_party/angle/src/libANGLE/Fence.cpp28
-rw-r--r--chromium/third_party/angle/src/libANGLE/Fence.h14
-rw-r--r--chromium/third_party/angle/src/libANGLE/Fence_unittest.cpp20
-rw-r--r--chromium/third_party/angle/src/libANGLE/Framebuffer.cpp130
-rw-r--r--chromium/third_party/angle/src/libANGLE/Framebuffer.h16
-rw-r--r--chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp42
-rw-r--r--chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h7
-rw-r--r--chromium/third_party/angle/src/libANGLE/ImageIndex.cpp52
-rw-r--r--chromium/third_party/angle/src/libANGLE/ImageIndex.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/MemoryProgramCache.cpp109
-rw-r--r--chromium/third_party/angle/src/libANGLE/MemoryProgramCache.h14
-rw-r--r--chromium/third_party/angle/src/libANGLE/Program.cpp217
-rw-r--r--chromium/third_party/angle/src/libANGLE/Program.h57
-rw-r--r--chromium/third_party/angle/src/libANGLE/ResourceManager.cpp26
-rw-r--r--chromium/third_party/angle/src/libANGLE/ResourceManager.h18
-rw-r--r--chromium/third_party/angle/src/libANGLE/Shader.cpp30
-rw-r--r--chromium/third_party/angle/src/libANGLE/Shader.h17
-rw-r--r--chromium/third_party/angle/src/libANGLE/State.cpp34
-rw-r--r--chromium/third_party/angle/src/libANGLE/State.h5
-rw-r--r--chromium/third_party/angle/src/libANGLE/Surface.cpp87
-rw-r--r--chromium/third_party/angle/src/libANGLE/Surface.h23
-rw-r--r--chromium/third_party/angle/src/libANGLE/Texture.cpp4
-rw-r--r--chromium/third_party/angle/src/libANGLE/Uniform.cpp12
-rw-r--r--chromium/third_party/angle/src/libANGLE/Uniform.h12
-rw-r--r--chromium/third_party/angle/src/libANGLE/VertexAttribute.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/VertexAttribute.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/entry_points_enum_autogen.h104
-rw-r--r--chromium/third_party/angle/src/libANGLE/formatutils.cpp18
-rw-r--r--chromium/third_party/angle/src/libANGLE/formatutils.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/params.cpp9
-rw-r--r--chromium/third_party/angle/src/libANGLE/params.h46
-rw-r--r--chromium/third_party/angle/src/libANGLE/queryutils.cpp263
-rw-r--r--chromium/third_party/angle/src/libANGLE/queryutils.h20
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h22
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/Format.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/Format_table_autogen.cpp140
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/GLImplFactory.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h14
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/SyncImpl.h (renamed from chromium/third_party/angle/src/libANGLE/renderer/FenceSyncImpl.h)11
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp80
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.h7
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp83
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h20
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp253
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h47
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.cpp98
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h47
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp28
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.h17
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp61
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp42
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.h7
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp215
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.h14
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.cpp90
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Context11.h16
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp19
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.h11
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp28
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp159
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp148
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h21
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp746
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h103
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.cpp744
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/StateManager11.h136
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp44
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp33
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h29
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.cpp35
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp82
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h8
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Clear11.hlsl493
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewgs.h84
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewvs.h81
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/cleardepth11ps.h75
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h257
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps1.h86
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps2.h92
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps3.h98
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps4.h104
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps5.h110
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps6.h116
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps7.h123
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps8.h129
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h257
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps1.h86
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps2.h92
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps3.h98
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps4.h104
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps5.h110
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps6.h116
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps7.h123
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps8.h129
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h257
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps1.h86
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps2.h92
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps3.h98
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps4.h104
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps5.h110
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps6.h116
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps7.h123
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps8.h129
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_luma_ps.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_lumaalpha_ps.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_luma_ps.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_lumaalpha_ps.h6
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/generate_shaders.bat32
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.cpp20
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Context9.h13
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Fence9.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp171
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h28
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h16
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gen_angle_format_table.py21
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp447
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h47
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp240
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.h95
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp25
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h11
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp253
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp56
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h10
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp91
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h12
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp345
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h41
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/SyncGL.cpp (renamed from chromium/third_party/angle/src/libANGLE/renderer/gl/FenceSyncGL.cpp)20
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/SyncGL.h (renamed from chromium/third_party/angle/src/libANGLE/renderer/gl/FenceSyncGL.h)13
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp56
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp45
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.mm3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm2
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.cpp62
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/renderergl_utils.h1
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/D3DTextureSurfaceWGL.cpp3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp3
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DisplayWGL.cpp5
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp15
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h11
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/DisplayNULL.cpp4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/FenceSyncNULL.cpp47
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp15
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/SyncNULL.cpp47
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/null/SyncNULL.h (renamed from chromium/third_party/angle/src/libANGLE/renderer/null/FenceSyncNULL.h)12
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.cpp156
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.h16
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp15
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h11
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp15
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h4
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/SyncVk.cpp (renamed from chromium/third_party/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.cpp)18
-rw-r--r--chromium/third_party/angle/src/libANGLE/renderer/vulkan/SyncVk.h (renamed from chromium/third_party/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.h)12
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationEGL.cpp148
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationEGL.h9
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES.cpp972
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES.h72
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES2.cpp450
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES2.h7
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES3.cpp1021
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES3.h169
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES31.cpp316
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES31.h10
-rw-r--r--chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp2
-rw-r--r--chromium/third_party/angle/src/libGLESv2.gypi46
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp123
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp135
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp90
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.cpp782
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0_autogen.h (renamed from chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.h)33
-rw-r--r--chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_1.cpp9
-rw-r--r--chromium/third_party/angle/src/libGLESv2/libGLESv2.cpp4
-rw-r--r--chromium/third_party/angle/src/tests/angle_end2end_tests.gypi2
-rw-r--r--chromium/third_party/angle/src/tests/angle_perftests.gypi2
-rw-r--r--chromium/third_party/angle/src/tests/angle_unittests.gypi3
-rw-r--r--chromium/third_party/angle/src/tests/angle_white_box_tests.gypi1
-rw-r--r--chromium/third_party/angle/src/vulkan_support/BUILD.gn2
-rw-r--r--chromium/third_party/angle/util/shader_utils.cpp6
-rw-r--r--chromium/third_party/angle/util/shader_utils.h1
-rw-r--r--chromium/third_party/angle/util/windows/win32/Win32Window.cpp14
265 files changed, 15041 insertions, 5718 deletions
diff --git a/chromium/third_party/angle/extensions/ANGLE_multiview.txt b/chromium/third_party/angle/extensions/ANGLE_multiview.txt
index af12a6da912..347366ea567 100644
--- a/chromium/third_party/angle/extensions/ANGLE_multiview.txt
+++ b/chromium/third_party/angle/extensions/ANGLE_multiview.txt
@@ -101,6 +101,10 @@ Additions to Chapter 2 of the OpenGL ES 3.0 Specification (OpenGL ES Operation)
uses the multi-view extension, the number of views specified in the
program must match the number of views in the draw framebuffer. If
there is a mismatch, an INVALID_OPERATION error is generated.
+
+ If the active draw framebuffer has a side-by-side multi-view layout
+ and the scissor test is not enabled, the result of any draw command
+ is undefined, but is not followed by program termination.
"
Modify section 2.15.2 Transform Feedback Primitive Capture, p. 91
@@ -154,6 +158,10 @@ Additions to Chapter 4 of the OpenGL ES 3.0 Specification
Clearing commands are applied to each view in the current multi-view
framebuffer object and have the same constraints as described
in section 4.2.3 Clearing the Buffers.
+
+ If the active draw framebuffer has a side-by-side multi-view layout
+ and the scissor test is not enabled, the clearing command clears
+ the whole content of the specified buffers.
"
Modify section 4.3.2 (Reading pixels), p. 193
@@ -161,7 +169,7 @@ Additions to Chapter 4 of the OpenGL ES 3.0 Specification
Add to the end of the section:
" ReadPixels generates an INVALID_FRAMEBUFFER_OPERATION error if
- the multi-view layout of the current read buffer is not NONE."
+ the multi-view layout of the current read framebuffer is not NONE."
Modify section 4.3.3 (Copying pixels), p. 198
@@ -249,11 +257,12 @@ Additions to Chapter 4 of the OpenGL ES 3.0 Specification
and does not name an existing texture object of type TEXTURE_2D_ARRAY.
An INVALID_OPERATION error is generated if texture is not zero,
and names a texture with a compressed texture format.
- An INVALID_VALUE error is generated if baseViewIndex+numViews is
- greater than GL_MAX_ARRAY_TEXTURE_LAYERS.
- An INVALID_VALUE error is generated if numViews is less than 1
- or greater than MAX_VIEWS_ANGLE.
- An INVALID_VALUE error is generated if baseViewIndex is less than 0.
+ An INVALID_VALUE error is generated if texture is not zero, and
+ baseViewIndex+numViews is greater than GL_MAX_ARRAY_TEXTURE_LAYERS.
+ An INVALID_VALUE error is generated if texture is not zero, and
+ numViews is less than 1 or greater than MAX_VIEWS_ANGLE.
+ An INVALID_VALUE error is generated if texture is not zero, and
+ baseViewIndex is less than 0.
The command
@@ -323,10 +332,10 @@ Additions to Chapter 4 of the OpenGL ES 3.0 Specification
and does not name an existing texture object of type TEXTURE_2D.
An INVALID_OPERATION error is generated if texture is not zero,
and names a texture with a compressed texture format.
- An INVALID_VALUE error is generated if numViews is less than 1
- or greater than MAX_VIEWS_ANGLE.
- An INVALID_VALUE error is generated if viewportOffsets contains
- negative values.
+ An INVALID_VALUE error is generated if texture is not zero, and
+ numViews is less than 1 or greater than MAX_VIEWS_ANGLE.
+ An INVALID_VALUE error is generated if texture is not zero, and
+ any of the first numViews * 2 values in viewportOffsets is negative.
Having overlapping scissor rectangles after viewport offsets are
applied causes undefined behavior.
diff --git a/chromium/third_party/angle/include/GLES2/gl2ext_angle.h b/chromium/third_party/angle/include/GLES2/gl2ext_angle.h
index 0683c946d1a..ae6acceb1da 100644
--- a/chromium/third_party/angle/include/GLES2/gl2ext_angle.h
+++ b/chromium/third_party/angle/include/GLES2/gl2ext_angle.h
@@ -537,6 +537,14 @@ GL_APICALL void GL_APIENTRY glFramebufferTextureMultiviewSideBySideANGLE(GLenum
#endif
#endif /* GL_ANGLE_multiview */
+#ifndef GL_ANGLE_texture_rectangle
+#define GL_ANGLE_texture_rectangle 1
+#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE 0x84F8
+#define GL_TEXTURE_RECTANGLE_ANGLE 0x84F5
+#define GL_TEXTURE_BINDING_RECTANGLE_ANGLE 0x84F6
+#define GL_SAMPLER_2D_RECT_ANGLE 0x8B63
+#endif /* GL_ANGLE_texture_rectangle */
+
// clang-format on
#endif // INCLUDE_GLES2_GL2EXT_ANGLE_H_
diff --git a/chromium/third_party/angle/include/GLSLANG/ShaderLang.h b/chromium/third_party/angle/include/GLSLANG/ShaderLang.h
index 89dd2042e6a..d0e6b8ec8bc 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 178
+#define ANGLE_SH_VERSION 180
enum ShShaderSpec
{
@@ -234,8 +234,9 @@ const ShCompileOptions SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW = UINT64_C
// With the flag enabled the GLSL/ESSL vertex shader is modified to include code for viewport
// selection in the following way:
// - Code to enable the extension NV_viewport_array2 is included.
-// - Code to select the viewport index is included at the beginning of main after ViewID_OVR's
-// initialization: gl_ViewportIndex = int(ViewID_OVR)
+// - Code to select the viewport index or layer is inserted at the beginning of main after
+// ViewID_OVR's initialization.
+// - A declaration of the uniform multiviewBaseViewLayerIndex.
// Note: The SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW flag also has to be enabled to have the
// temporary variable ViewID_OVR declared and initialized.
const ShCompileOptions SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER = UINT64_C(1) << 34;
@@ -291,6 +292,7 @@ struct ShBuiltInResources
int ARM_shader_framebuffer_fetch;
int OVR_multiview;
int EXT_YUV_target;
+ int OES_geometry_shader;
// 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
@@ -411,6 +413,20 @@ struct ShBuiltInResources
// maximum point size (higher limit from ALIASED_POINT_SIZE_RANGE)
float MaxPointSize;
+
+ // OES_geometry_shader constants
+ int MaxGeometryUniformComponents;
+ int MaxGeometryUniformBlocks;
+ int MaxGeometryInputComponents;
+ int MaxGeometryOutputComponents;
+ int MaxGeometryOutputVertices;
+ int MaxGeometryTotalOutputComponents;
+ int MaxGeometryTextureImageUnits;
+ int MaxGeometryAtomicCounterBuffers;
+ int MaxGeometryAtomicCounters;
+ int MaxGeometryShaderStorageBlocks;
+ int MaxGeometryShaderInvocations;
+ int MaxGeometryImageUniforms;
};
//
@@ -529,10 +545,16 @@ const std::map<std::string, std::string> *GetNameHashingMap(const ShHandle handl
// handle: Specifies the compiler
const std::vector<sh::Uniform> *GetUniforms(const ShHandle handle);
const std::vector<sh::Varying> *GetVaryings(const ShHandle handle);
+const std::vector<sh::Varying> *GetInputVaryings(const ShHandle handle);
+const std::vector<sh::Varying> *GetOutputVaryings(const ShHandle handle);
const std::vector<sh::Attribute> *GetAttributes(const ShHandle handle);
const std::vector<sh::OutputVariable> *GetOutputVariables(const ShHandle handle);
const std::vector<sh::InterfaceBlock> *GetInterfaceBlocks(const ShHandle handle);
+const std::vector<sh::InterfaceBlock> *GetUniformBlocks(const ShHandle handle);
+const std::vector<sh::InterfaceBlock> *GetShaderStorageBlocks(const ShHandle handle);
sh::WorkGroupSize GetComputeShaderLocalGroupSize(const ShHandle handle);
+// Returns the number of views specified through the num_views layout qualifier. If num_views is
+// not set, the function returns -1.
int GetVertexShaderNumViews(const ShHandle handle);
// Returns true if the passed in variables pack in maxVectors followingthe packing rules from the
@@ -545,18 +567,18 @@ int GetVertexShaderNumViews(const ShHandle handle);
bool CheckVariablesWithinPackingLimits(int maxVectors,
const std::vector<sh::ShaderVariable> &variables);
-// Gives the compiler-assigned register for an interface block.
+// Gives the compiler-assigned register for a uniform block.
// The method writes the value to the output variable "indexOut".
-// Returns true if it found a valid interface block, false otherwise.
+// Returns true if it found a valid uniform block, false otherwise.
// Parameters:
// handle: Specifies the compiler
-// interfaceBlockName: Specifies the interface block
+// uniformBlockName: Specifies the uniform block
// indexOut: output variable that stores the assigned register
-bool GetInterfaceBlockRegister(const ShHandle handle,
- const std::string &interfaceBlockName,
- unsigned int *indexOut);
+bool GetUniformBlockRegister(const ShHandle handle,
+ const std::string &uniformBlockName,
+ unsigned int *indexOut);
-// Gives a map from uniform names to compiler-assigned registers in the default interface block.
+// Gives a map from uniform names to compiler-assigned registers in the default uniform block.
// Note that the map contains also registers of samplers that have been extracted from structs.
const std::map<std::string, unsigned int> *GetUniformRegisterMap(const ShHandle handle);
diff --git a/chromium/third_party/angle/include/GLSLANG/ShaderVars.h b/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
index 96380e06112..bc652069d6a 100644
--- a/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
+++ b/chromium/third_party/angle/include/GLSLANG/ShaderVars.h
@@ -41,6 +41,17 @@ enum BlockLayoutType
BLOCKLAYOUT_SHARED
};
+// Interface Blocks, see section 4.3.9 of the ESSL 3.10 spec
+enum class BlockType
+{
+ BLOCK_UNIFORM,
+ BLOCK_BUFFER,
+
+ // Required in OpenGL ES 3.1 extension GL_OES_shader_io_blocks.
+ // TODO(jiawei.shao@intel.com): add BLOCK_OUT.
+ BLOCK_IN
+};
+
// Base class for all variables defined in shaders, including Varyings, Uniforms, etc
// Note: we must override the copy constructor and assignment operator so we can
// work around excessive GCC binary bloating:
@@ -211,6 +222,8 @@ struct InterfaceBlock
// Decide whether two interface blocks are the same at shader link time.
bool isSameInterfaceBlockAtLinkTime(const InterfaceBlock &other) const;
+ bool isBuiltIn() const { return name.compare(0, 3, "gl_") == 0; }
+
std::string name;
std::string mappedName;
std::string instanceName;
@@ -219,6 +232,7 @@ struct InterfaceBlock
bool isRowMajorLayout;
int binding;
bool staticUse;
+ BlockType blockType;
std::vector<InterfaceBlockField> fields;
};
diff --git a/chromium/third_party/angle/include/angle_gl.h b/chromium/third_party/angle/include/angle_gl.h
index 18de80b60b1..b70a31c2738 100644
--- a/chromium/third_party/angle/include/angle_gl.h
+++ b/chromium/third_party/angle/include/angle_gl.h
@@ -16,9 +16,4 @@
#include "GLES3/gl31.h"
#include "GLES3/gl32.h"
-// The following enum is used in ANGLE, but is from desktop GL
-#ifndef GL_SAMPLER_2D_RECT_ARB
-#define GL_SAMPLER_2D_RECT_ARB 0x8B63
-#endif
-
#endif // ANGLEGL_H_
diff --git a/chromium/third_party/angle/infra/config/cq.cfg b/chromium/third_party/angle/infra/config/cq.cfg
index 6cffc9650d7..055fae867cf 100644
--- a/chromium/third_party/angle/infra/config/cq.cfg
+++ b/chromium/third_party/angle/infra/config/cq.cfg
@@ -15,15 +15,19 @@ verifiers {
buckets {
name: "master.tryserver.chromium.angle"
builders { name: "android_angle_rel_ng" }
+ builders { name: "android_angle_deqp_rel_ng" }
builders { name: "linux_angle_rel_ng" }
builders { name: "linux_angle_dbg_ng" }
builders { name: "linux_angle_chromeos_rel_ng" }
+ builders { name: "linux_angle_deqp_rel_ng" }
builders { name: "mac_angle_rel_ng" }
builders { name: "mac_angle_dbg_ng" }
builders { name: "win_angle_rel_ng" }
builders { name: "win_angle_dbg_ng" }
builders { name: "win_angle_x64_rel_ng" }
builders { name: "win_angle_x64_dbg_ng" }
+ builders { name: "win_angle_deqp_rel_ng" }
+ builders { name: "win_angle_x64_deqp_rel_ng" }
}
buckets {
name: "master.tryserver.chromium.linux"
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 87a4dd46eb3..7425cf05fbf 100644
--- a/chromium/third_party/angle/samples/shader_translator/shader_translator.cpp
+++ b/chromium/third_party/angle/samples/shader_translator/shader_translator.cpp
@@ -63,6 +63,7 @@ void GenerateResources(ShBuiltInResources *resources)
resources->OES_standard_derivatives = 0;
resources->OES_EGL_image_external = 0;
+ resources->OES_geometry_shader = 1;
}
int main(int argc, char *argv[])
@@ -74,6 +75,7 @@ int main(int argc, char *argv[])
ShHandle vertexCompiler = 0;
ShHandle fragmentCompiler = 0;
ShHandle computeCompiler = 0;
+ ShHandle geometryCompiler = 0;
ShShaderSpec spec = SH_GLES2_SPEC;
ShShaderOutput output = SH_ESSL_OUTPUT;
@@ -268,7 +270,14 @@ int main(int argc, char *argv[])
}
compiler = computeCompiler;
break;
-
+ case GL_GEOMETRY_SHADER_OES:
+ if (geometryCompiler == 0)
+ {
+ geometryCompiler =
+ sh::ConstructCompiler(GL_GEOMETRY_SHADER_OES, spec, output, &resources);
+ }
+ compiler = geometryCompiler;
+ break;
default: break;
}
if (compiler)
@@ -307,7 +316,8 @@ int main(int argc, char *argv[])
}
}
- if ((vertexCompiler == 0) && (fragmentCompiler == 0) && (computeCompiler == 0))
+ if ((vertexCompiler == 0) && (fragmentCompiler == 0) && (computeCompiler == 0) &&
+ (geometryCompiler == 0))
failCode = EFailUsage;
if (failCode == EFailUsage)
usage();
@@ -318,6 +328,8 @@ int main(int argc, char *argv[])
sh::Destruct(fragmentCompiler);
if (computeCompiler)
sh::Destruct(computeCompiler);
+ if (geometryCompiler)
+ sh::Destruct(geometryCompiler);
sh::Finalize();
@@ -389,6 +401,8 @@ sh::GLenum FindShaderType(const char *fileName)
return GL_VERTEX_SHADER;
if (strncmp(ext, ".comp", 5) == 0)
return GL_COMPUTE_SHADER;
+ if (strncmp(ext, ".geom", 5) == 0)
+ return GL_GEOMETRY_SHADER_OES;
}
return GL_FRAGMENT_SHADER;
@@ -564,10 +578,11 @@ void PrintVariable(const std::string &prefix, size_t index, const sh::ShaderVari
static void PrintActiveVariables(ShHandle compiler)
{
const std::vector<sh::Uniform> *uniforms = sh::GetUniforms(compiler);
- const std::vector<sh::Varying> *varyings = sh::GetVaryings(compiler);
+ const std::vector<sh::Varying> *inputVaryings = sh::GetInputVaryings(compiler);
+ const std::vector<sh::Varying> *outputVaryings = sh::GetOutputVaryings(compiler);
const std::vector<sh::Attribute> *attributes = sh::GetAttributes(compiler);
const std::vector<sh::OutputVariable> *outputs = sh::GetOutputVariables(compiler);
- for (size_t varCategory = 0; varCategory < 4; ++varCategory)
+ for (size_t varCategory = 0; varCategory < 5; ++varCategory)
{
size_t numVars = 0;
std::string varCategoryName;
@@ -578,11 +593,16 @@ static void PrintActiveVariables(ShHandle compiler)
}
else if (varCategory == 1)
{
- numVars = varyings->size();
- varCategoryName = "varying";
+ numVars = inputVaryings->size();
+ varCategoryName = "input varying";
}
else if (varCategory == 2)
{
+ numVars = outputVaryings->size();
+ varCategoryName = "output varying";
+ }
+ else if (varCategory == 3)
+ {
numVars = attributes->size();
varCategoryName = "attribute";
}
@@ -598,8 +618,10 @@ static void PrintActiveVariables(ShHandle compiler)
if (varCategory == 0)
var = &((*uniforms)[i]);
else if (varCategory == 1)
- var = &((*varyings)[i]);
+ var = &((*inputVaryings)[i]);
else if (varCategory == 2)
+ var = &((*outputVaryings)[i]);
+ else if (varCategory == 3)
var = &((*attributes)[i]);
else
var = &((*outputs)[i]);
diff --git a/chromium/third_party/angle/scripts/generate_entry_points.py b/chromium/third_party/angle/scripts/generate_entry_points.py
index 98df2612e80..bbc09cfa40e 100644
--- a/chromium/third_party/angle/scripts/generate_entry_points.py
+++ b/chromium/third_party/angle/scripts/generate_entry_points.py
@@ -11,15 +11,6 @@ import sys, os, pprint
import xml.etree.ElementTree as etree
from datetime import date
-def script_relative(path):
- return os.path.join(os.path.dirname(sys.argv[0]), path)
-
-tree = etree.parse(script_relative('gl.xml'))
-root = tree.getroot()
-
-gles2_xpath = ".//feature[@name='GL_ES_VERSION_2_0']//command"
-gles2_commands = [cmd.attrib['name'] for cmd in root.findall(gles2_xpath)]
-
template_entry_point_header = """// GENERATED FILE - DO NOT EDIT.
// Generated by {script_name} using data from {data_source_name}.
//
@@ -33,7 +24,7 @@ template_entry_point_header = """// GENERATED FILE - DO NOT EDIT.
#ifndef LIBGLESV2_ENTRYPOINTSGLES{major_version}{minor_version}_AUTOGEN_H_
#define LIBGLESV2_ENTRYPOINTSGLES{major_version}{minor_version}_AUTOGEN_H_
-#include <GLES2/gl{major_version}.h>
+#include <GLES{major_version}/gl{major_version}.h>
#include <export.h>
namespace gl
@@ -54,9 +45,6 @@ template_entry_point_source = """// GENERATED FILE - DO NOT EDIT.
// entry_points_gles_{major_version}_{minor_version}_autogen.cpp:
// Defines the GLES {major_version}.{minor_version} entry points.
-#include "libGLESv2/entry_points_gles_{major_version}_{minor_version}_autogen.h"
-
-#include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/validationES2.h"
#include "libGLESv2/global_state.h"
@@ -108,9 +96,23 @@ template_entry_point_def = """{return_type}GL_APIENTRY {name}({params})
{default_return_if_needed}}}
"""
+def script_relative(path):
+ return os.path.join(os.path.dirname(sys.argv[0]), path)
+
+tree = etree.parse(script_relative('gl.xml'))
+root = tree.getroot()
+
+gles2_xpath = ".//feature[@name='GL_ES_VERSION_2_0']//command"
+gles2_commands = [cmd.attrib['name'] for cmd in root.findall(gles2_xpath)]
+
+gles3_xpath = ".//feature[@name='GL_ES_VERSION_3_0']//command"
+gles3_commands = [cmd.attrib['name'] for cmd in root.findall(gles3_xpath)]
+
commands = root.find(".//commands[@namespace='GL']")
entry_point_decls_gles_2_0 = []
entry_point_defs_gles_2_0 = []
+entry_point_decls_gles_3_0 = []
+entry_point_defs_gles_3_0 = []
cmd_names = []
def format_entry_point_decl(cmd_name, proto, params):
@@ -139,26 +141,25 @@ format_dict = {
"GLintptr": "%d",
"GLsizei": "%d",
"GLsizeiptr": "%d",
- "GLuint": "%d"
+ "GLsync": "0x%0.8p",
+ "GLuint": "%u",
+ "GLuint64": "%llu"
}
def param_format_string(param):
if "*" in param:
return param + " = 0x%0.8p"
else:
- return param + " = " + format_dict[just_the_type(param)]
+ type_only = just_the_type(param)
+ if type_only not in format_dict:
+ raise Exception(type_only + " is not a known type in 'format_dict'")
+
+ return param + " = " + format_dict[type_only]
-def default_return_value(return_type):
+def default_return_value(cmd_name, return_type):
if return_type == "void":
return ""
- elif return_type == "GLenum" or return_type == "GLint" or return_type == "GLuint":
- return "0"
- elif return_type == "GLboolean":
- return "GL_FALSE"
- elif "*" in return_type:
- return "nullptr"
- else:
- print(return_type)
+ return "GetDefaultReturnValue<EntryPoint::" + cmd_name[2:] + ", " + return_type + ">()"
def get_context_getter_function(cmd_name):
if cmd_name == "glGetError":
@@ -170,7 +171,7 @@ def format_entry_point_def(cmd_name, proto, params):
pass_params = [just_the_name(param) for param in params]
format_params = [param_format_string(param) for param in params]
return_type = proto[:-len(cmd_name)]
- default_return = default_return_value(return_type.strip())
+ default_return = default_return_value(cmd_name, return_type.strip())
return template_entry_point_def.format(
name = cmd_name[2:],
name_lower = cmd_name[2:3].lower() + cmd_name[3:],
@@ -193,6 +194,15 @@ for cmd_name in gles2_commands:
entry_point_decls_gles_2_0 += [format_entry_point_decl(cmd_name, proto, params)]
entry_point_defs_gles_2_0 += [format_entry_point_def(cmd_name, proto, params)]
+for cmd_name in gles3_commands:
+ command_xpath = "command/proto[name='" + cmd_name + "']/.."
+ command = commands.find(command_xpath)
+ params = ["".join(param.itertext()) for param in command.findall("./param")]
+ proto = "".join(command.find("./proto").itertext())
+ cmd_names += [cmd_name]
+ entry_point_decls_gles_3_0 += [format_entry_point_decl(cmd_name, proto, params)]
+ entry_point_defs_gles_3_0 += [format_entry_point_def(cmd_name, proto, params)]
+
gles_2_0_header = template_entry_point_header.format(
script_name = os.path.basename(sys.argv[0]),
data_source_name = "gl.xml",
@@ -209,8 +219,16 @@ gles_2_0_source = template_entry_point_source.format(
minor_version = 0,
entry_points = "\n".join(entry_point_defs_gles_2_0))
-# TODO(jmadill): Remove manually added entry points.
-manual_cmd_names = ["Invalid"] + [cmd[2:] for cmd in cmd_names] + ["DrawElementsInstanced", "DrawRangeElements", "DrawElementsInstancedANGLE"]
+gles_3_0_header = template_entry_point_header.format(
+ script_name = os.path.basename(sys.argv[0]),
+ data_source_name = "gl.xml",
+ year = date.today().year,
+ major_version = 3,
+ minor_version = 0,
+ entry_points = "\n".join(entry_point_decls_gles_3_0))
+
+# TODO(jmadill): Remove manually added entry points once we auto-gen them.
+manual_cmd_names = ["Invalid"] + [cmd[2:] for cmd in cmd_names] + ["DrawElementsInstancedANGLE"]
entry_points_enum = template_entry_points_enum_header.format(
script_name = os.path.basename(sys.argv[0]),
data_source_name = "gl.xml",
@@ -222,6 +240,8 @@ def path_to(folder, file):
gles_2_0_header_path = path_to("libGLESv2", "entry_points_gles_2_0_autogen.h")
gles_2_0_source_path = path_to("libGLESv2", "entry_points_gles_2_0_autogen.cpp")
+gles_3_0_header_path = path_to("libGLESv2", "entry_points_gles_3_0_autogen.h")
+gles_3_0_source_path = path_to("libGLESv2", "entry_points_gles_3_0_autogen.cpp")
entry_points_enum_header_path = path_to("libANGLE", "entry_points_enum_autogen.h")
with open(gles_2_0_header_path, "w") as out:
@@ -232,6 +252,10 @@ with open(gles_2_0_source_path, "w") as out:
out.write(gles_2_0_source)
out.close()
+with open(gles_3_0_header_path, "w") as out:
+ out.write(gles_3_0_header)
+ out.close()
+
with open(entry_points_enum_header_path, "w") as out:
out.write(entry_points_enum)
out.close()
diff --git a/chromium/third_party/angle/scripts/perf_test_runner.py b/chromium/third_party/angle/scripts/perf_test_runner.py
index 3e896b3438b..f0c07f6d46a 100644
--- a/chromium/third_party/angle/scripts/perf_test_runner.py
+++ b/chromium/third_party/angle/scripts/perf_test_runner.py
@@ -100,7 +100,7 @@ print('Test name: ' + test_name)
# Infinite loop of running the tests.
while True:
- output = subprocess.check_output([perftests_path, '--gtest_filter=' + test_name])
+ output = subprocess.getoutput([perftests_path, '--gtest_filter=' + test_name])
start_index = output.find(metric + "=")
if start_index == -1:
diff --git a/chromium/third_party/angle/src/common/MemoryBuffer.cpp b/chromium/third_party/angle/src/common/MemoryBuffer.cpp
index 9ab27284f9b..6f5188c69c8 100644
--- a/chromium/third_party/angle/src/common/MemoryBuffer.cpp
+++ b/chromium/third_party/angle/src/common/MemoryBuffer.cpp
@@ -60,22 +60,6 @@ bool MemoryBuffer::resize(size_t size)
return true;
}
-size_t MemoryBuffer::size() const
-{
- return mSize;
-}
-
-const uint8_t *MemoryBuffer::data() const
-{
- return mData;
-}
-
-uint8_t *MemoryBuffer::data()
-{
- ASSERT(mData);
- return mData;
-}
-
void MemoryBuffer::fill(uint8_t datum)
{
if (!empty())
diff --git a/chromium/third_party/angle/src/common/MemoryBuffer.h b/chromium/third_party/angle/src/common/MemoryBuffer.h
index 01a8ccc5e6d..f76b9ee62e6 100644
--- a/chromium/third_party/angle/src/common/MemoryBuffer.h
+++ b/chromium/third_party/angle/src/common/MemoryBuffer.h
@@ -9,6 +9,7 @@
#include "common/Optional.h"
#include "common/angleutils.h"
+#include "common/debug.h"
#include <stdint.h>
#include <cstddef>
@@ -26,11 +27,15 @@ class MemoryBuffer final : NonCopyable
MemoryBuffer &operator=(MemoryBuffer &&other);
bool resize(size_t size);
- size_t size() const;
+ size_t size() const { return mSize; }
bool empty() const { return mSize == 0; }
- const uint8_t *data() const;
- uint8_t *data();
+ const uint8_t *data() const { return mData; }
+ uint8_t *data()
+ {
+ ASSERT(mData);
+ return mData;
+ }
void fill(uint8_t datum);
diff --git a/chromium/third_party/angle/src/common/angleutils.cpp b/chromium/third_party/angle/src/common/angleutils.cpp
index 67db1ec15b5..d3d29a32cf6 100644
--- a/chromium/third_party/angle/src/common/angleutils.cpp
+++ b/chromium/third_party/angle/src/common/angleutils.cpp
@@ -42,20 +42,3 @@ size_t FormatStringIntoVector(const char *fmt, va_list vararg, std::vector<char>
ASSERT(len >= 0);
return static_cast<size_t>(len);
}
-
-std::string FormatString(const char *fmt, va_list vararg)
-{
- static std::vector<char> buffer(512);
-
- size_t len = FormatStringIntoVector(fmt, vararg, buffer);
- return std::string(&buffer[0], len);
-}
-
-std::string FormatString(const char *fmt, ...)
-{
- va_list vararg;
- va_start(vararg, fmt);
- std::string result = FormatString(fmt, vararg);
- va_end(vararg);
- return result;
-}
diff --git a/chromium/third_party/angle/src/common/angleutils.h b/chromium/third_party/angle/src/common/angleutils.h
index 61da3df8097..c735069dbe5 100644
--- a/chromium/third_party/angle/src/common/angleutils.h
+++ b/chromium/third_party/angle/src/common/angleutils.h
@@ -99,6 +99,13 @@ class WrappedArray final : angle::NonCopyable
constexpr WrappedArray() : mArray(nullptr), mSize(0) {}
constexpr WrappedArray(const T *data, size_t size) : mArray(data), mSize(size) {}
+
+ WrappedArray(WrappedArray &&other) : WrappedArray()
+ {
+ std::swap(mArray, other.mArray);
+ std::swap(mSize, other.mSize);
+ }
+
~WrappedArray() {}
constexpr const T *get() const { return mArray; }
@@ -236,6 +243,7 @@ std::string ToString(const T &value)
#define snprintf _snprintf
#endif
+#define GL_BGRX8_ANGLEX 0x6ABA
#define GL_BGR565_ANGLEX 0x6ABB
#define GL_BGRA4_ANGLEX 0x6ABC
#define GL_BGR5_A1_ANGLEX 0x6ABD
@@ -254,4 +262,32 @@ std::string ToString(const T &value)
return gl::InternalError() << "Integer overflow."; \
}
+// The below inlining code lifted from V8.
+#if defined(__clang__) || (defined(__GNUC__) && defined(__has_attribute))
+#define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE (__has_attribute(always_inline))
+#define ANGLE_HAS___FORCEINLINE 0
+#elif defined(_MSC_VER)
+#define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE 0
+#define ANGLE_HAS___FORCEINLINE 1
+#else
+#define ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE 0
+#define ANGLE_HAS___FORCEINLINE 0
+#endif
+
+#if defined(NDEBUG) && ANGLE_HAS_ATTRIBUTE_ALWAYS_INLINE
+#define ANGLE_INLINE inline __attribute__((always_inline))
+#elif defined(NDEBUG) && ANGLE_HAS___FORCEINLINE
+#define ANGLE_INLINE __forceinline
+#else
+#define ANGLE_INLINE inline
+#endif
+
+#ifndef ANGLE_STRINGIFY
+#define ANGLE_STRINGIFY(x) #x
+#endif
+
+#ifndef ANGLE_MACRO_STRINGIFY
+#define ANGLE_MACRO_STRINGIFY(x) ANGLE_STRINGIFY(x)
+#endif
+
#endif // COMMON_ANGLEUTILS_H_
diff --git a/chromium/third_party/angle/src/common/utilities.cpp b/chromium/third_party/angle/src/common/utilities.cpp
index d0db43eb697..427e55e7edf 100644
--- a/chromium/third_party/angle/src/common/utilities.cpp
+++ b/chromium/third_party/angle/src/common/utilities.cpp
@@ -124,6 +124,7 @@ GLenum VariableComponentType(GLenum type)
return GL_FLOAT;
case GL_INT:
case GL_SAMPLER_2D:
+ case GL_SAMPLER_2D_RECT_ANGLE:
case GL_SAMPLER_3D:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_2D_ARRAY:
@@ -251,7 +252,7 @@ int VariableRowCount(GLenum type)
case GL_SAMPLER_CUBE:
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_EXTERNAL_OES:
- case GL_SAMPLER_2D_RECT_ARB:
+ case GL_SAMPLER_2D_RECT_ANGLE:
case GL_SAMPLER_2D_MULTISAMPLE:
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D:
@@ -321,7 +322,7 @@ int VariableColumnCount(GLenum type)
case GL_INT_SAMPLER_2D_ARRAY:
case GL_INT_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_EXTERNAL_OES:
- case GL_SAMPLER_2D_RECT_ARB:
+ case GL_SAMPLER_2D_RECT_ANGLE:
case GL_UNSIGNED_INT_SAMPLER_2D:
case GL_UNSIGNED_INT_SAMPLER_3D:
case GL_UNSIGNED_INT_SAMPLER_CUBE:
@@ -385,6 +386,7 @@ bool IsSamplerType(GLenum type)
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_EXTERNAL_OES:
case GL_SAMPLER_2D_MULTISAMPLE:
+ case GL_SAMPLER_2D_RECT_ANGLE:
case GL_INT_SAMPLER_2D:
case GL_INT_SAMPLER_3D:
case GL_INT_SAMPLER_CUBE:
@@ -471,6 +473,9 @@ GLenum SamplerTypeToTextureType(GLenum samplerType)
case GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE:
return GL_TEXTURE_2D_MULTISAMPLE;
+ case GL_SAMPLER_2D_RECT_ANGLE:
+ return GL_TEXTURE_RECTANGLE_ANGLE;
+
default:
UNREACHABLE();
return 0;
@@ -694,7 +699,7 @@ int VariableSortOrder(GLenum type)
case GL_SAMPLER_2D:
case GL_SAMPLER_CUBE:
case GL_SAMPLER_EXTERNAL_OES:
- case GL_SAMPLER_2D_RECT_ARB:
+ case GL_SAMPLER_2D_RECT_ANGLE:
case GL_SAMPLER_2D_ARRAY:
case GL_SAMPLER_2D_MULTISAMPLE:
case GL_SAMPLER_3D:
@@ -711,7 +716,20 @@ int VariableSortOrder(GLenum type)
case GL_SAMPLER_2D_SHADOW:
case GL_SAMPLER_2D_ARRAY_SHADOW:
case GL_SAMPLER_CUBE_SHADOW:
- return 6;
+ case GL_IMAGE_2D:
+ case GL_INT_IMAGE_2D:
+ case GL_UNSIGNED_INT_IMAGE_2D:
+ case GL_IMAGE_3D:
+ case GL_INT_IMAGE_3D:
+ case GL_UNSIGNED_INT_IMAGE_3D:
+ case GL_IMAGE_2D_ARRAY:
+ case GL_INT_IMAGE_2D_ARRAY:
+ case GL_UNSIGNED_INT_IMAGE_2D_ARRAY:
+ case GL_IMAGE_CUBE:
+ case GL_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_IMAGE_CUBE:
+ case GL_UNSIGNED_INT_ATOMIC_COUNTER:
+ return 6;
default:
UNREACHABLE();
diff --git a/chromium/third_party/angle/src/common/utilities.h b/chromium/third_party/angle/src/common/utilities.h
index 8d3e3b254f0..1710bb562d3 100644
--- a/chromium/third_party/angle/src/common/utilities.h
+++ b/chromium/third_party/angle/src/common/utilities.h
@@ -23,6 +23,7 @@ namespace gl
int VariableComponentCount(GLenum type);
GLenum VariableComponentType(GLenum type);
+bool IsVariableComponentTypeBool(GLenum type);
size_t VariableComponentSize(GLenum type);
size_t VariableInternalSize(GLenum type);
size_t VariableExternalSize(GLenum type);
@@ -41,6 +42,17 @@ int MatrixRegisterCount(GLenum type, bool isRowMajorMatrix);
int MatrixComponentCount(GLenum type, bool isRowMajorMatrix);
int VariableSortOrder(GLenum type);
+// Inlined for speed
+ANGLE_INLINE bool IsVariableComponentTypeBool(GLenum type)
+{
+ static_assert((GL_BOOL_VEC2 == GL_BOOL + 1) && (GL_BOOL_VEC3 == GL_BOOL + 2) &&
+ (GL_BOOL_VEC4 == GL_BOOL + 3),
+ "GL_BOOL and GL_BOOL_VEC2-4 are contiguous");
+ ASSERT((static_cast<uint32_t>(type - GL_BOOL) <= 3) ==
+ (VariableComponentType(type) == GL_BOOL));
+ return (static_cast<uint32_t>(type - GL_BOOL) <= 3);
+}
+
int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize);
static const GLenum FirstCubeMapTextureTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X;
diff --git a/chromium/third_party/angle/src/compiler.gypi b/chromium/third_party/angle/src/compiler.gypi
index ea9035b674b..2b95cd97a01 100644
--- a/chromium/third_party/angle/src/compiler.gypi
+++ b/chromium/third_party/angle/src/compiler.gypi
@@ -36,6 +36,8 @@
'compiler/translator/ClampPointSize.cpp',
'compiler/translator/ClampPointSize.h',
'compiler/translator/CodeGen.cpp',
+ 'compiler/translator/CollectVariables.cpp',
+ 'compiler/translator/CollectVariables.h',
'compiler/translator/Common.h',
'compiler/translator/Compiler.cpp',
'compiler/translator/Compiler.h',
@@ -149,8 +151,6 @@
'compiler/translator/ValidateOutputs.h',
'compiler/translator/ValidateSwitch.cpp',
'compiler/translator/ValidateSwitch.h',
- 'compiler/translator/VariableInfo.cpp',
- 'compiler/translator/VariableInfo.h',
'compiler/translator/VariablePacker.cpp',
'compiler/translator/VariablePacker.h',
'compiler/translator/blocklayout.cpp',
diff --git a/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp b/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
index 8d485c6b110..db9bc540f36 100644
--- a/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.cpp
@@ -4,12 +4,14 @@
// found in the LICENSE file.
//
// The ArrayReturnValueToOutParameter function changes return values of an array type to out
-// parameters in
-// function definitions, prototypes, and call sites.
+// parameters in function definitions, prototypes, and call sites.
#include "compiler/translator/ArrayReturnValueToOutParameter.h"
+#include <map>
+
#include "compiler/translator/IntermTraverse.h"
+#include "compiler/translator/SymbolTable.h"
namespace sh
{
@@ -26,20 +28,14 @@ void CopyAggregateChildren(TIntermAggregateBase *from, TIntermAggregateBase *to)
}
}
-TIntermSymbol *CreateReturnValueSymbol(const TType &type)
+TIntermSymbol *CreateReturnValueSymbol(const TSymbolUniqueId &id, const TType &type)
{
- TIntermSymbol *node = new TIntermSymbol(0, "angle_return", type);
+ TIntermSymbol *node = new TIntermSymbol(id.get(), "angle_return", type);
node->setInternal(true);
+ node->getTypePointer()->setQualifier(EvqOut);
return node;
}
-TIntermSymbol *CreateReturnValueOutSymbol(const TType &type)
-{
- TType outType(type);
- outType.setQualifier(EvqOut);
- return CreateReturnValueSymbol(outType);
-}
-
TIntermAggregate *CreateReplacementCall(TIntermAggregate *originalCall,
TIntermTyped *returnValueTarget)
{
@@ -71,7 +67,11 @@ class ArrayReturnValueToOutParameterTraverser : private TIntermTraverser
bool visitBranch(Visit visit, TIntermBranch *node) override;
bool visitBinary(Visit visit, TIntermBinary *node) override;
- bool mInFunctionWithArrayReturnValue;
+ // Set when traversal is inside a function with array return value.
+ TIntermFunctionDefinition *mFunctionWithArrayReturnValue;
+
+ // Map from function symbol ids to array return value ids.
+ std::map<int, TSymbolUniqueId *> mReturnValueIds;
};
void ArrayReturnValueToOutParameterTraverser::apply(TIntermNode *root, TSymbolTable *symbolTable)
@@ -83,7 +83,7 @@ void ArrayReturnValueToOutParameterTraverser::apply(TIntermNode *root, TSymbolTa
ArrayReturnValueToOutParameterTraverser::ArrayReturnValueToOutParameterTraverser(
TSymbolTable *symbolTable)
- : TIntermTraverser(true, false, true, symbolTable), mInFunctionWithArrayReturnValue(false)
+ : TIntermTraverser(true, false, true, symbolTable), mFunctionWithArrayReturnValue(nullptr)
{
}
@@ -94,11 +94,11 @@ bool ArrayReturnValueToOutParameterTraverser::visitFunctionDefinition(
if (node->getFunctionPrototype()->isArray() && visit == PreVisit)
{
// Replacing the function header is done on visitFunctionPrototype().
- mInFunctionWithArrayReturnValue = true;
+ mFunctionWithArrayReturnValue = node;
}
if (visit == PostVisit)
{
- mInFunctionWithArrayReturnValue = false;
+ mFunctionWithArrayReturnValue = nullptr;
}
return true;
}
@@ -113,7 +113,13 @@ bool ArrayReturnValueToOutParameterTraverser::visitFunctionPrototype(Visit visit
TIntermFunctionPrototype *replacement =
new TIntermFunctionPrototype(TType(EbtVoid), node->getFunctionSymbolInfo()->getId());
CopyAggregateChildren(node, replacement);
- replacement->getSequence()->push_back(CreateReturnValueOutSymbol(node->getType()));
+ const TSymbolUniqueId &functionId = node->getFunctionSymbolInfo()->getId();
+ if (mReturnValueIds.find(functionId.get()) == mReturnValueIds.end())
+ {
+ mReturnValueIds[functionId.get()] = new TSymbolUniqueId(mSymbolTable);
+ }
+ replacement->getSequence()->push_back(
+ CreateReturnValueSymbol(*mReturnValueIds[functionId.get()], node->getType()));
*replacement->getFunctionSymbolInfo() = *node->getFunctionSymbolInfo();
replacement->setLine(node->getLine());
@@ -154,14 +160,19 @@ bool ArrayReturnValueToOutParameterTraverser::visitAggregate(Visit visit, TInter
bool ArrayReturnValueToOutParameterTraverser::visitBranch(Visit visit, TIntermBranch *node)
{
- if (mInFunctionWithArrayReturnValue && node->getFlowOp() == EOpReturn)
+ if (mFunctionWithArrayReturnValue && node->getFlowOp() == EOpReturn)
{
// Instead of returning a value, assign to the out parameter and then return.
TIntermSequence replacements;
TIntermTyped *expression = node->getExpression();
ASSERT(expression != nullptr);
- TIntermSymbol *returnValueSymbol = CreateReturnValueSymbol(expression->getType());
+ const TSymbolUniqueId &functionId =
+ mFunctionWithArrayReturnValue->getFunctionSymbolInfo()->getId();
+ ASSERT(mReturnValueIds.find(functionId.get()) != mReturnValueIds.end());
+ const TSymbolUniqueId &returnValueId = *mReturnValueIds[functionId.get()];
+ TIntermSymbol *returnValueSymbol =
+ CreateReturnValueSymbol(returnValueId, expression->getType());
TIntermBinary *replacementAssignment =
new TIntermBinary(EOpAssign, returnValueSymbol, expression);
replacementAssignment->setLine(expression->getLine());
diff --git a/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.h b/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.h
index eca6642333c..469c7a3b149 100644
--- a/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.h
+++ b/chromium/third_party/angle/src/compiler/translator/ArrayReturnValueToOutParameter.h
@@ -4,8 +4,7 @@
// found in the LICENSE file.
//
// The ArrayReturnValueToOutParameter function changes return values of an array type to out
-// parameters in
-// function definitions, prototypes and call sites.
+// parameters in function definitions, prototypes and call sites.
#ifndef COMPILER_TRANSLATOR_ARRAYRETURNVALUETOOUTPARAMETER_H_
#define COMPILER_TRANSLATOR_ARRAYRETURNVALUETOOUTPARAMETER_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/BaseTypes.h b/chromium/third_party/angle/src/compiler/translator/BaseTypes.h
index bcd1421435b..eda024edea4 100644
--- a/chromium/third_party/angle/src/compiler/translator/BaseTypes.h
+++ b/chromium/third_party/angle/src/compiler/translator/BaseTypes.h
@@ -573,6 +573,15 @@ enum TQualifier
EvqRestrict,
EvqVolatile,
+ // GLSL ES 3.1 extension OES_geometry_shader qualifiers
+ EvqGeometryIn,
+ EvqGeometryOut,
+ EvqPerVertexIn, // gl_in
+ EvqPrimitiveIDIn, // gl_PrimitiveIDIn
+ EvqInvocationID, // gl_InvocationID
+ EvqPrimitiveID, // gl_PrimitiveID
+ EvqLayer, // gl_Layer
+
// end of list
EvqLast
};
@@ -623,6 +632,18 @@ enum TYuvCscStandardEXT
EycsItu709
};
+enum TLayoutPrimitiveType
+{
+ EptUndefined,
+ EptPoints,
+ EptLines,
+ EptLinesAdjacency,
+ EptTriangles,
+ EptTrianglesAdjacency,
+ EptLineStrip,
+ EptTriangleStrip
+};
+
struct TLayoutQualifier
{
int location;
@@ -645,6 +666,11 @@ struct TLayoutQualifier
// EXT_YUV_target yuv layout qualifier.
bool yuv;
+ // OES_geometry_shader layout qualifiers.
+ TLayoutPrimitiveType primitiveType;
+ int invocations;
+ int maxVertices;
+
static TLayoutQualifier create()
{
TLayoutQualifier layoutQualifier;
@@ -661,6 +687,11 @@ struct TLayoutQualifier
layoutQualifier.yuv = false;
layoutQualifier.imageInternalFormat = EiifUnspecified;
+
+ layoutQualifier.primitiveType = EptUndefined;
+ layoutQualifier.invocations = 0;
+ layoutQualifier.maxVertices = -1;
+
return layoutQualifier;
}
@@ -668,13 +699,16 @@ struct TLayoutQualifier
{
return location == -1 && binding == -1 && offset == -1 && numViews == -1 && yuv == false &&
matrixPacking == EmpUnspecified && blockStorage == EbsUnspecified &&
- !localSize.isAnyValueSet() && imageInternalFormat == EiifUnspecified;
+ !localSize.isAnyValueSet() && imageInternalFormat == EiifUnspecified &&
+ primitiveType == EptUndefined && invocations == 0 && maxVertices == -1;
}
bool isCombinationValid() const
{
bool workSizeSpecified = localSize.isAnyValueSet();
bool numViewsSet = (numViews != -1);
+ bool geometryShaderSpecified =
+ (primitiveType != EptUndefined) || (invocations != 0) || (maxVertices != -1);
bool otherLayoutQualifiersSpecified =
(location != -1 || binding != -1 || matrixPacking != EmpUnspecified ||
blockStorage != EbsUnspecified || imageInternalFormat != EiifUnspecified);
@@ -682,7 +716,7 @@ struct TLayoutQualifier
// 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) <=
+ (otherLayoutQualifiersSpecified ? 1 : 0) + (geometryShaderSpecified ? 1 : 0) <=
1;
}
@@ -778,6 +812,7 @@ inline const char *getQualifierString(TQualifier q)
case EvqSecondaryFragDataEXT: return "SecondaryFragDataEXT";
case EvqViewIDOVR: return "ViewIDOVR";
case EvqViewportIndex: return "ViewportIndex";
+ case EvqLayer: return "Layer";
case EvqLastFragColor: return "LastFragColor";
case EvqLastFragData: return "LastFragData";
case EvqSmoothOut: return "smooth out";
@@ -799,6 +834,9 @@ inline const char *getQualifierString(TQualifier q)
case EvqLocalInvocationIndex: return "LocalInvocationIndex";
case EvqReadOnly: return "readonly";
case EvqWriteOnly: return "writeonly";
+ case EvqGeometryIn: return "in";
+ case EvqGeometryOut: return "out";
+ case EvqPerVertexIn: return "gl_in";
default: UNREACHABLE(); return "unknown qualifier";
}
// clang-format on
@@ -901,6 +939,30 @@ inline const char *getYuvCscStandardEXTString(TYuvCscStandardEXT ycsq)
}
}
+inline const char *getGeometryShaderPrimitiveTypeString(TLayoutPrimitiveType primitiveType)
+{
+ switch (primitiveType)
+ {
+ case EptPoints:
+ return "points";
+ case EptLines:
+ return "lines";
+ case EptTriangles:
+ return "triangles";
+ case EptLinesAdjacency:
+ return "lines_adjacency";
+ case EptTrianglesAdjacency:
+ return "triangles_adjacency";
+ case EptLineStrip:
+ return "line_strip";
+ case EptTriangleStrip:
+ return "triangle_strip";
+ default:
+ UNREACHABLE();
+ return "unknown geometry shader primitive type";
+ }
+}
+
} // namespace sh
#endif // COMPILER_TRANSLATOR_BASETYPES_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/CallDAG.h b/chromium/third_party/angle/src/compiler/translator/CallDAG.h
index d29f9326e4e..155081c9a29 100644
--- a/chromium/third_party/angle/src/compiler/translator/CallDAG.h
+++ b/chromium/third_party/angle/src/compiler/translator/CallDAG.h
@@ -14,7 +14,6 @@
#include <map>
#include "compiler/translator/IntermNode.h"
-#include "compiler/translator/VariableInfo.h"
namespace sh
{
diff --git a/chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp b/chromium/third_party/angle/src/compiler/translator/CollectVariables.cpp
index 18178d79989..04860486864 100644
--- a/chromium/third_party/angle/src/compiler/translator/VariableInfo.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/CollectVariables.cpp
@@ -3,8 +3,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
+// CollectVariables.cpp: Collect lists of shader interface variables based on the AST.
-#include "compiler/translator/VariableInfo.h"
+#include "compiler/translator/CollectVariables.h"
#include "angle_gl.h"
#include "common/utilities.h"
@@ -35,21 +36,20 @@ BlockLayoutType GetBlockLayoutType(TLayoutBlockStorage blockStorage)
}
}
-void ExpandUserDefinedVariable(const ShaderVariable &variable,
- const std::string &name,
- const std::string &mappedName,
- bool markStaticUse,
- std::vector<ShaderVariable> *expanded)
+// TODO(jiawei.shao@intel.com): implement GL_OES_shader_io_blocks.
+BlockType GetBlockType(TQualifier qualifier)
{
- ASSERT(variable.isStruct());
-
- const std::vector<ShaderVariable> &fields = variable.fields;
-
- for (size_t fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++)
+ switch (qualifier)
{
- const ShaderVariable &field = fields[fieldIndex];
- ExpandVariable(field, name + "." + field.name, mappedName + "." + field.mappedName,
- markStaticUse, expanded);
+ case EvqUniform:
+ return BlockType::BLOCK_UNIFORM;
+ case EvqBuffer:
+ return BlockType::BLOCK_BUFFER;
+ case EvqPerVertexIn:
+ return BlockType::BLOCK_IN;
+ default:
+ UNREACHABLE();
+ return BlockType::BLOCK_UNIFORM;
}
}
@@ -92,11 +92,15 @@ class CollectVariablesTraverser : public TIntermTraverser
CollectVariablesTraverser(std::vector<Attribute> *attribs,
std::vector<OutputVariable> *outputVariables,
std::vector<Uniform> *uniforms,
- std::vector<Varying> *varyings,
- std::vector<InterfaceBlock> *interfaceBlocks,
+ std::vector<Varying> *inputVaryings,
+ std::vector<Varying> *outputVaryings,
+ std::vector<InterfaceBlock> *uniformBlocks,
+ std::vector<InterfaceBlock> *shaderStorageBlocks,
+ std::vector<InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
int shaderVersion,
+ GLenum shaderType,
const TExtensionBehavior &extensionBehavior);
void visitSymbol(TIntermSymbol *symbol) override;
@@ -111,32 +115,46 @@ class CollectVariablesTraverser : public TIntermTraverser
Attribute recordAttribute(const TIntermSymbol &variable) const;
OutputVariable recordOutputVariable(const TIntermSymbol &variable) const;
Varying recordVarying(const TIntermSymbol &variable) const;
- InterfaceBlock recordInterfaceBlock(const TIntermSymbol &variable) const;
+ void recordInterfaceBlock(const TType &interfaceBlockType,
+ InterfaceBlock *interfaceBlock) const;
Uniform recordUniform(const TIntermSymbol &variable) const;
void setBuiltInInfoFromSymbolTable(const char *name, ShaderVariable *info);
- void recordBuiltInVaryingUsed(const char *name, bool *addedFlag);
+ void recordBuiltInVaryingUsed(const char *name,
+ bool *addedFlag,
+ std::vector<Varying> *varyings);
void recordBuiltInFragmentOutputUsed(const char *name, bool *addedFlag);
void recordBuiltInAttributeUsed(const char *name, bool *addedFlag);
+ InterfaceBlock *recordGLInUsed(const TType &glInType);
+ InterfaceBlock *findNamedInterfaceBlock(const TString &name) const;
std::vector<Attribute> *mAttribs;
std::vector<OutputVariable> *mOutputVariables;
std::vector<Uniform> *mUniforms;
- std::vector<Varying> *mVaryings;
- std::vector<InterfaceBlock> *mInterfaceBlocks;
+ std::vector<Varying> *mInputVaryings;
+ std::vector<Varying> *mOutputVaryings;
+ std::vector<InterfaceBlock> *mUniformBlocks;
+ std::vector<InterfaceBlock> *mShaderStorageBlocks;
+ std::vector<InterfaceBlock> *mInBlocks;
std::map<std::string, InterfaceBlockField *> mInterfaceBlockFields;
+ // Shader uniforms
bool mDepthRangeAdded;
- bool mPointCoordAdded;
- bool mFrontFacingAdded;
- bool mFragCoordAdded;
+ // Vertex Shader builtins
bool mInstanceIDAdded;
bool mVertexIDAdded;
- bool mPositionAdded;
bool mPointSizeAdded;
+
+ // Vertex Shader and Geometry Shader builtins
+ bool mPositionAdded;
+
+ // Fragment Shader builtins
+ bool mPointCoordAdded;
+ bool mFrontFacingAdded;
+ bool mFragCoordAdded;
bool mLastFragDataAdded;
bool mFragColorAdded;
bool mFragDataAdded;
@@ -145,9 +163,19 @@ class CollectVariablesTraverser : public TIntermTraverser
bool mSecondaryFragColorEXTAdded;
bool mSecondaryFragDataEXTAdded;
+ // Geometry Shader builtins
+ bool mPerVertexInAdded;
+ bool mPrimitiveIDInAdded;
+ bool mInvocationIDAdded;
+
+ // Geometry Shader and Fragment Shader builtins
+ bool mPrimitiveIDAdded;
+ bool mLayerAdded;
+
ShHashFunction64 mHashFunction;
int mShaderVersion;
+ GLenum mShaderType;
const TExtensionBehavior &mExtensionBehavior;
};
@@ -155,26 +183,33 @@ CollectVariablesTraverser::CollectVariablesTraverser(
std::vector<sh::Attribute> *attribs,
std::vector<sh::OutputVariable> *outputVariables,
std::vector<sh::Uniform> *uniforms,
- std::vector<sh::Varying> *varyings,
- std::vector<sh::InterfaceBlock> *interfaceBlocks,
+ std::vector<sh::Varying> *inputVaryings,
+ std::vector<sh::Varying> *outputVaryings,
+ std::vector<sh::InterfaceBlock> *uniformBlocks,
+ std::vector<sh::InterfaceBlock> *shaderStorageBlocks,
+ std::vector<sh::InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
int shaderVersion,
+ GLenum shaderType,
const TExtensionBehavior &extensionBehavior)
: TIntermTraverser(true, false, false, symbolTable),
mAttribs(attribs),
mOutputVariables(outputVariables),
mUniforms(uniforms),
- mVaryings(varyings),
- mInterfaceBlocks(interfaceBlocks),
+ mInputVaryings(inputVaryings),
+ mOutputVaryings(outputVaryings),
+ mUniformBlocks(uniformBlocks),
+ mShaderStorageBlocks(shaderStorageBlocks),
+ mInBlocks(inBlocks),
mDepthRangeAdded(false),
- mPointCoordAdded(false),
- mFrontFacingAdded(false),
- mFragCoordAdded(false),
mInstanceIDAdded(false),
mVertexIDAdded(false),
- mPositionAdded(false),
mPointSizeAdded(false),
+ mPositionAdded(false),
+ mPointCoordAdded(false),
+ mFrontFacingAdded(false),
+ mFragCoordAdded(false),
mLastFragDataAdded(false),
mFragColorAdded(false),
mFragDataAdded(false),
@@ -182,8 +217,14 @@ CollectVariablesTraverser::CollectVariablesTraverser(
mFragDepthAdded(false),
mSecondaryFragColorEXTAdded(false),
mSecondaryFragDataEXTAdded(false),
+ mPerVertexInAdded(false),
+ mPrimitiveIDInAdded(false),
+ mInvocationIDAdded(false),
+ mPrimitiveIDAdded(false),
+ mLayerAdded(false),
mHashFunction(hashFunction),
mShaderVersion(shaderVersion),
+ mShaderType(shaderType),
mExtensionBehavior(extensionBehavior)
{
}
@@ -199,19 +240,23 @@ void CollectVariablesTraverser::setBuiltInInfoFromSymbolTable(const char *name,
info->name = name;
info->mappedName = name;
info->type = GLVariableType(type);
- info->arraySize = type.isArray() ? type.getArraySize() : 0;
- info->precision = GLVariablePrecision(type);
+ ASSERT(!type.isArrayOfArrays());
+ info->arraySize = type.isArray() ? type.getOutermostArraySize() : 0;
+ info->precision = GLVariablePrecision(type);
}
-void CollectVariablesTraverser::recordBuiltInVaryingUsed(const char *name, bool *addedFlag)
+void CollectVariablesTraverser::recordBuiltInVaryingUsed(const char *name,
+ bool *addedFlag,
+ std::vector<Varying> *varyings)
{
+ ASSERT(varyings);
if (!(*addedFlag))
{
Varying info;
setBuiltInInfoFromSymbolTable(name, &info);
info.staticUse = true;
info.isInvariant = mSymbolTable->isVaryingInvariant(name);
- mVaryings->push_back(info);
+ varyings->push_back(info);
(*addedFlag) = true;
}
}
@@ -241,6 +286,25 @@ void CollectVariablesTraverser::recordBuiltInAttributeUsed(const char *name, boo
}
}
+InterfaceBlock *CollectVariablesTraverser::recordGLInUsed(const TType &glInType)
+{
+ if (!mPerVertexInAdded)
+ {
+ ASSERT(glInType.getQualifier() == EvqPerVertexIn);
+ InterfaceBlock info;
+ recordInterfaceBlock(glInType, &info);
+ info.staticUse = true;
+
+ mPerVertexInAdded = true;
+ mInBlocks->push_back(info);
+ return &mInBlocks->back();
+ }
+ else
+ {
+ return FindVariable("gl_PerVertex", mInBlocks);
+ }
+}
+
// We want to check whether a uniform/varying is statically used
// because we only count the used ones in packing computing.
// Also, gl_FragCoord, gl_PointCoord, and gl_FrontFacing count
@@ -259,9 +323,13 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
ShaderVariable *var = nullptr;
const TString &symbolName = symbol->getName().getString();
- if (IsVarying(symbol->getQualifier()))
+ if (IsVaryingIn(symbol->getQualifier()))
+ {
+ var = FindVariable(symbolName, mInputVaryings);
+ }
+ else if (IsVaryingOut(symbol->getQualifier()))
{
- var = FindVariable(symbolName, mVaryings);
+ var = FindVariable(symbolName, mOutputVaryings);
}
else if (symbol->getType().getBasicType() == EbtInterfaceBlock)
{
@@ -334,7 +402,7 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
if (interfaceBlock)
{
InterfaceBlock *namedBlock =
- FindVariable(interfaceBlock->name(), mInterfaceBlocks);
+ FindVariable(interfaceBlock->name(), mUniformBlocks);
ASSERT(namedBlock);
var = FindVariable(symbolName, &namedBlock->fields);
@@ -351,13 +419,13 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
}
break;
case EvqFragCoord:
- recordBuiltInVaryingUsed("gl_FragCoord", &mFragCoordAdded);
+ recordBuiltInVaryingUsed("gl_FragCoord", &mFragCoordAdded, mInputVaryings);
return;
case EvqFrontFacing:
- recordBuiltInVaryingUsed("gl_FrontFacing", &mFrontFacingAdded);
+ recordBuiltInVaryingUsed("gl_FrontFacing", &mFrontFacingAdded, mInputVaryings);
return;
case EvqPointCoord:
- recordBuiltInVaryingUsed("gl_PointCoord", &mPointCoordAdded);
+ recordBuiltInVaryingUsed("gl_PointCoord", &mPointCoordAdded, mInputVaryings);
return;
case EvqInstanceID:
// Whenever the SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW option is set,
@@ -384,13 +452,13 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
recordBuiltInAttributeUsed("gl_VertexID", &mVertexIDAdded);
return;
case EvqPosition:
- recordBuiltInVaryingUsed("gl_Position", &mPositionAdded);
+ recordBuiltInVaryingUsed("gl_Position", &mPositionAdded, mOutputVaryings);
return;
case EvqPointSize:
- recordBuiltInVaryingUsed("gl_PointSize", &mPointSizeAdded);
+ recordBuiltInVaryingUsed("gl_PointSize", &mPointSizeAdded, mOutputVaryings);
return;
case EvqLastFragData:
- recordBuiltInVaryingUsed("gl_LastFragData", &mLastFragDataAdded);
+ recordBuiltInVaryingUsed("gl_LastFragData", &mLastFragDataAdded, mInputVaryings);
return;
case EvqFragColor:
recordBuiltInFragmentOutputUsed("gl_FragColor", &mFragColorAdded);
@@ -423,6 +491,39 @@ void CollectVariablesTraverser::visitSymbol(TIntermSymbol *symbol)
recordBuiltInFragmentOutputUsed("gl_SecondaryFragDataEXT",
&mSecondaryFragDataEXTAdded);
return;
+ case EvqInvocationID:
+ recordBuiltInVaryingUsed("gl_InvocationID", &mInvocationIDAdded, mInputVaryings);
+ break;
+ case EvqPrimitiveIDIn:
+ recordBuiltInVaryingUsed("gl_PrimitiveIDIn", &mPrimitiveIDInAdded, mInputVaryings);
+ break;
+ case EvqPrimitiveID:
+ if (mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ recordBuiltInVaryingUsed("gl_PrimitiveID", &mPrimitiveIDAdded, mOutputVaryings);
+ }
+ else
+ {
+ ASSERT(mShaderType == GL_FRAGMENT_SHADER);
+ recordBuiltInVaryingUsed("gl_PrimitiveID", &mPrimitiveIDAdded, mInputVaryings);
+ }
+ break;
+ case EvqLayer:
+ if (mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ recordBuiltInVaryingUsed("gl_Layer", &mLayerAdded, mOutputVaryings);
+ }
+ else if (mShaderType == GL_FRAGMENT_SHADER)
+ {
+ recordBuiltInVaryingUsed("gl_Layer", &mLayerAdded, mInputVaryings);
+ }
+ else
+ {
+ ASSERT(mShaderType == GL_VERTEX_SHADER &&
+ (IsExtensionEnabled(mExtensionBehavior, "GL_OVR_multiview") ||
+ IsExtensionEnabled(mExtensionBehavior, "GL_OVR_multiview2")));
+ }
+ break;
default:
break;
}
@@ -465,7 +566,11 @@ void CollectVariablesTraverser::setCommonVariableProperties(const TType &type,
}
variableOut->name = name.c_str();
variableOut->mappedName = HashName(name, mHashFunction).c_str();
- variableOut->arraySize = type.getArraySize();
+
+ // TODO(oetuaho@nvidia.com): Uniforms can be arrays of arrays, so this assert will need to be
+ // removed.
+ ASSERT(!type.isArrayOfArrays());
+ variableOut->arraySize = type.isArray() ? type.getOutermostArraySize() : 0;
}
Attribute CollectVariablesTraverser::recordAttribute(const TIntermSymbol &variable) const
@@ -521,20 +626,31 @@ Varying CollectVariablesTraverser::recordVarying(const TIntermSymbol &variable)
return varying;
}
-InterfaceBlock CollectVariablesTraverser::recordInterfaceBlock(const TIntermSymbol &variable) const
+// TODO(jiawei.shao@intel.com): implement GL_OES_shader_io_blocks.
+void CollectVariablesTraverser::recordInterfaceBlock(const TType &interfaceBlockType,
+ InterfaceBlock *interfaceBlock) const
{
- const TInterfaceBlock *blockType = variable.getType().getInterfaceBlock();
+ ASSERT(interfaceBlockType.getBasicType() == EbtInterfaceBlock);
+ ASSERT(interfaceBlock);
+
+ const TInterfaceBlock *blockType = interfaceBlockType.getInterfaceBlock();
ASSERT(blockType);
- InterfaceBlock interfaceBlock;
- interfaceBlock.name = blockType->name().c_str();
- interfaceBlock.mappedName = HashName(blockType->name().c_str(), mHashFunction).c_str();
- interfaceBlock.instanceName =
+ interfaceBlock->name = blockType->name().c_str();
+ interfaceBlock->mappedName = HashName(blockType->name().c_str(), mHashFunction).c_str();
+ interfaceBlock->instanceName =
(blockType->hasInstanceName() ? blockType->instanceName().c_str() : "");
- interfaceBlock.arraySize = variable.getArraySize();
- interfaceBlock.isRowMajorLayout = (blockType->matrixPacking() == EmpRowMajor);
- interfaceBlock.binding = blockType->blockBinding();
- interfaceBlock.layout = GetBlockLayoutType(blockType->blockStorage());
+ ASSERT(!interfaceBlockType.isArrayOfArrays()); // Disallowed by GLSL ES 3.10 section 4.3.9
+ interfaceBlock->arraySize = interfaceBlockType.isArray() ? interfaceBlockType.getOutermostArraySize() : 0;
+
+ interfaceBlock->blockType = GetBlockType(interfaceBlockType.getQualifier());
+ if (interfaceBlock->blockType == BlockType::BLOCK_UNIFORM ||
+ interfaceBlock->blockType == BlockType::BLOCK_BUFFER)
+ {
+ interfaceBlock->isRowMajorLayout = (blockType->matrixPacking() == EmpRowMajor);
+ interfaceBlock->binding = blockType->blockBinding();
+ interfaceBlock->layout = GetBlockLayoutType(blockType->blockStorage());
+ }
// Gather field information
for (const TField *field : blockType->fields())
@@ -545,16 +661,15 @@ InterfaceBlock CollectVariablesTraverser::recordInterfaceBlock(const TIntermSymb
setCommonVariableProperties(fieldType, field->name(), &fieldVariable);
fieldVariable.isRowMajorLayout =
(fieldType.getLayoutQualifier().matrixPacking == EmpRowMajor);
- interfaceBlock.fields.push_back(fieldVariable);
+ interfaceBlock->fields.push_back(fieldVariable);
}
- return interfaceBlock;
}
Uniform CollectVariablesTraverser::recordUniform(const TIntermSymbol &variable) const
{
Uniform uniform;
setCommonVariableProperties(variable.getType(), variable.getSymbol(), &uniform);
- uniform.binding = variable.getType().getLayoutQualifier().binding;
+ uniform.binding = variable.getType().getLayoutQualifier().binding;
uniform.location = variable.getType().getLayoutQualifier().location;
uniform.offset = variable.getType().getLayoutQualifier().offset;
return uniform;
@@ -590,14 +705,22 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
continue;
}
+ // TODO(jiawei.shao@intel.com): implement GL_OES_shader_io_blocks.
if (typedNode.getBasicType() == EbtInterfaceBlock)
{
- // TODO(jiajia.qin@intel.com): In order not to affect the old set of mInterfaceBlocks,
- // only uniform blocks are added into mInterfaceBlocks. Refactor it to gather
- // uniformBlocks and shaderStorageBlocks separately.
- if (qualifier == EvqUniform)
+ InterfaceBlock interfaceBlock;
+ recordInterfaceBlock(variable.getType(), &interfaceBlock);
+
+ switch (qualifier)
{
- mInterfaceBlocks->push_back(recordInterfaceBlock(variable));
+ case EvqUniform:
+ mUniformBlocks->push_back(interfaceBlock);
+ break;
+ case EvqBuffer:
+ mShaderStorageBlocks->push_back(interfaceBlock);
+ break;
+ default:
+ UNREACHABLE();
}
}
else
@@ -615,7 +738,15 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
mUniforms->push_back(recordUniform(variable));
break;
default:
- mVaryings->push_back(recordVarying(variable));
+ if (IsVaryingIn(qualifier))
+ {
+ mInputVaryings->push_back(recordVarying(variable));
+ }
+ else
+ {
+ ASSERT(IsVaryingOut(qualifier));
+ mOutputVaryings->push_back(recordVarying(variable));
+ }
break;
}
}
@@ -626,6 +757,18 @@ bool CollectVariablesTraverser::visitDeclaration(Visit, TIntermDeclaration *node
return false;
}
+// TODO(jiawei.shao@intel.com): add search on mInBlocks and mOutBlocks when implementing
+// GL_OES_shader_io_blocks.
+InterfaceBlock *CollectVariablesTraverser::findNamedInterfaceBlock(const TString &blockName) const
+{
+ InterfaceBlock *namedBlock = FindVariable(blockName, mUniformBlocks);
+ if (!namedBlock)
+ {
+ namedBlock = FindVariable(blockName, mShaderStorageBlocks);
+ }
+ return namedBlock;
+}
+
bool CollectVariablesTraverser::visitBinary(Visit, TIntermBinary *binaryNode)
{
if (binaryNode->getOp() == EOpIndexDirectInterfaceBlock)
@@ -637,16 +780,42 @@ bool CollectVariablesTraverser::visitBinary(Visit, TIntermBinary *binaryNode)
TIntermConstantUnion *constantUnion = binaryNode->getRight()->getAsConstantUnion();
ASSERT(constantUnion);
+ InterfaceBlock *namedBlock = nullptr;
+
+ bool traverseIndexExpression = false;
+ TIntermBinary *interfaceIndexingNode = blockNode->getAsBinaryNode();
+ if (interfaceIndexingNode)
+ {
+ TIntermTyped *interfaceNode = interfaceIndexingNode->getLeft()->getAsTyped();
+ ASSERT(interfaceNode);
+
+ const TType &interfaceType = interfaceNode->getType();
+ if (interfaceType.getQualifier() == EvqPerVertexIn)
+ {
+ namedBlock = recordGLInUsed(interfaceType);
+ ASSERT(namedBlock);
+
+ // We need to continue traversing to collect useful variables in the index
+ // expression of gl_in.
+ traverseIndexExpression = true;
+ }
+ }
+
const TInterfaceBlock *interfaceBlock = blockNode->getType().getInterfaceBlock();
- InterfaceBlock *namedBlock = FindVariable(interfaceBlock->name(), mInterfaceBlocks);
- // TODO(jiajia.qin@intel.com): Currently, only uniform blocks are added into
- // mInterfaceBlocks.
- if (namedBlock)
+ if (!namedBlock)
{
- namedBlock->staticUse = true;
- unsigned int fieldIndex = static_cast<unsigned int>(constantUnion->getIConst(0));
- ASSERT(fieldIndex < namedBlock->fields.size());
- namedBlock->fields[fieldIndex].staticUse = true;
+ namedBlock = findNamedInterfaceBlock(interfaceBlock->name());
+ }
+ ASSERT(namedBlock);
+ namedBlock->staticUse = true;
+ unsigned int fieldIndex = static_cast<unsigned int>(constantUnion->getIConst(0));
+ ASSERT(fieldIndex < namedBlock->fields.size());
+ namedBlock->fields[fieldIndex].staticUse = true;
+
+ if (traverseIndexExpression)
+ {
+ ASSERT(interfaceIndexingNode);
+ interfaceIndexingNode->getRight()->traverse(this);
}
return false;
}
@@ -660,71 +829,22 @@ void CollectVariables(TIntermBlock *root,
std::vector<Attribute> *attributes,
std::vector<OutputVariable> *outputVariables,
std::vector<Uniform> *uniforms,
- std::vector<Varying> *varyings,
- std::vector<InterfaceBlock> *interfaceBlocks,
+ std::vector<Varying> *inputVaryings,
+ std::vector<Varying> *outputVaryings,
+ std::vector<InterfaceBlock> *uniformBlocks,
+ std::vector<InterfaceBlock> *shaderStorageBlocks,
+ std::vector<InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
int shaderVersion,
+ GLenum shaderType,
const TExtensionBehavior &extensionBehavior)
{
- CollectVariablesTraverser collect(attributes, outputVariables, uniforms, varyings,
- interfaceBlocks, hashFunction, symbolTable, shaderVersion,
+ CollectVariablesTraverser collect(attributes, outputVariables, uniforms, inputVaryings,
+ outputVaryings, uniformBlocks, shaderStorageBlocks, inBlocks,
+ hashFunction, symbolTable, shaderVersion, shaderType,
extensionBehavior);
root->traverse(&collect);
}
-void ExpandVariable(const ShaderVariable &variable,
- const std::string &name,
- const std::string &mappedName,
- bool markStaticUse,
- std::vector<ShaderVariable> *expanded)
-{
- if (variable.isStruct())
- {
- if (variable.isArray())
- {
- for (unsigned int elementIndex = 0; elementIndex < variable.elementCount();
- elementIndex++)
- {
- std::string lname = name + ::ArrayString(elementIndex);
- std::string lmappedName = mappedName + ::ArrayString(elementIndex);
- ExpandUserDefinedVariable(variable, lname, lmappedName, markStaticUse, expanded);
- }
- }
- else
- {
- ExpandUserDefinedVariable(variable, name, mappedName, markStaticUse, expanded);
- }
- }
- else
- {
- ShaderVariable expandedVar = variable;
-
- expandedVar.name = name;
- expandedVar.mappedName = mappedName;
-
- // Mark all expanded fields as used if the parent is used
- if (markStaticUse)
- {
- expandedVar.staticUse = true;
- }
-
- if (expandedVar.isArray())
- {
- expandedVar.name += "[0]";
- expandedVar.mappedName += "[0]";
- }
-
- expanded->push_back(expandedVar);
- }
-}
-
-void ExpandUniforms(const std::vector<Uniform> &compact, std::vector<ShaderVariable> *expanded)
-{
- for (const Uniform &variable : compact)
- {
- ExpandVariable(variable, variable.name, variable.mappedName, variable.staticUse, expanded);
- }
-}
-
} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/VariableInfo.h b/chromium/third_party/angle/src/compiler/translator/CollectVariables.h
index 96d0b3b9dbd..4d0d1192e0d 100644
--- a/chromium/third_party/angle/src/compiler/translator/VariableInfo.h
+++ b/chromium/third_party/angle/src/compiler/translator/CollectVariables.h
@@ -3,9 +3,10 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
+// CollectVariables.h: Collect lists of shader interface variables based on the AST.
-#ifndef COMPILER_TRANSLATOR_VARIABLEINFO_H_
-#define COMPILER_TRANSLATOR_VARIABLEINFO_H_
+#ifndef COMPILER_TRANSLATOR_COLLECTVARIABLES_H_
+#define COMPILER_TRANSLATOR_COLLECTVARIABLES_H_
#include <GLSLANG/ShaderLang.h>
@@ -21,21 +22,16 @@ void CollectVariables(TIntermBlock *root,
std::vector<Attribute> *attributes,
std::vector<OutputVariable> *outputVariables,
std::vector<Uniform> *uniforms,
- std::vector<Varying> *varyings,
- std::vector<InterfaceBlock> *interfaceBlocks,
+ std::vector<Varying> *inputVaryings,
+ std::vector<Varying> *outputVaryings,
+ std::vector<InterfaceBlock> *uniformBlocks,
+ std::vector<InterfaceBlock> *shaderStorageBlocks,
+ std::vector<InterfaceBlock> *inBlocks,
ShHashFunction64 hashFunction,
TSymbolTable *symbolTable,
int shaderVersion,
+ GLenum shaderType,
const TExtensionBehavior &extensionBehavior);
-
-void ExpandVariable(const ShaderVariable &variable,
- const std::string &name,
- const std::string &mappedName,
- bool markStaticUse,
- std::vector<ShaderVariable> *expanded);
-
-// Expand struct uniforms to flattened lists of split variables
-void ExpandUniforms(const std::vector<Uniform> &compact, std::vector<ShaderVariable> *expanded);
}
-#endif // COMPILER_TRANSLATOR_VARIABLEINFO_H_
+#endif // COMPILER_TRANSLATOR_COLLECTVARIABLES_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/Compiler.cpp b/chromium/third_party/angle/src/compiler/translator/Compiler.cpp
index ab89e9a8722..4b39fe1d738 100644
--- a/chromium/third_party/angle/src/compiler/translator/Compiler.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/Compiler.cpp
@@ -14,6 +14,7 @@
#include "compiler/translator/Cache.h"
#include "compiler/translator/CallDAG.h"
#include "compiler/translator/ClampPointSize.h"
+#include "compiler/translator/CollectVariables.h"
#include "compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h"
#include "compiler/translator/DeferGlobalInitializers.h"
#include "compiler/translator/EmulateGLFragColorBroadcast.h"
@@ -146,11 +147,14 @@ int GetMaxUniformVectorsForShaderType(GLenum shaderType, const ShBuiltInResource
return resources.MaxVertexUniformVectors;
case GL_FRAGMENT_SHADER:
return resources.MaxFragmentUniformVectors;
+
+ // TODO (jiawei.shao@intel.com): check if we need finer-grained component counting
case GL_COMPUTE_SHADER:
- // TODO (jiawei.shao@intel.com): check if we need finer-grained component counting
return resources.MaxComputeUniformComponents / 4;
+ case GL_GEOMETRY_SHADER_OES:
+ return resources.MaxGeometryUniformComponents / 4;
default:
- UNIMPLEMENTED();
+ UNREACHABLE();
return -1;
}
}
@@ -242,7 +246,11 @@ TCompiler::TCompiler(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output)
builtInFunctionEmulator(),
mDiagnostics(infoSink.info),
mSourcePath(nullptr),
- mComputeShaderLocalSizeDeclared(false)
+ mComputeShaderLocalSizeDeclared(false),
+ mGeometryShaderMaxVertices(-1),
+ mGeometryShaderInvocations(0),
+ mGeometryShaderInputPrimitiveType(EptUndefined),
+ mGeometryShaderOutputPrimitiveType(EptUndefined)
{
mComputeShaderLocalSize.fill(1);
}
@@ -360,6 +368,15 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
success = false;
}
+ if (success && shaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ mGeometryShaderInputPrimitiveType = parseContext.getGeometryShaderInputPrimitiveType();
+ mGeometryShaderOutputPrimitiveType =
+ parseContext.getGeometryShaderOutputPrimitiveType();
+ mGeometryShaderMaxVertices = parseContext.getGeometryShaderMaxVertices();
+ mGeometryShaderInvocations = parseContext.getGeometryShaderInvocations();
+ }
+
// Disallow expressions deemed too complex.
if (success && (compileOptions & SH_LIMIT_EXPRESSION_COMPLEXITY))
success = limitExpressionComplexity(root);
@@ -457,9 +474,11 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
if (success && shouldCollectVariables(compileOptions))
{
ASSERT(!variablesCollected);
- CollectVariables(root, &attributes, &outputVariables, &uniforms, &varyings,
- &interfaceBlocks, hashFunction, &symbolTable, shaderVersion,
+ CollectVariables(root, &attributes, &outputVariables, &uniforms, &inputVaryings,
+ &outputVaryings, &uniformBlocks, &shaderStorageBlocks, &inBlocks,
+ hashFunction, &symbolTable, shaderVersion, shaderType,
extensionBehavior);
+ collectInterfaceBlocks();
variablesCollected = true;
if (compileOptions & SH_USE_UNUSED_STANDARD_SHARED_BLOCKS)
{
@@ -467,13 +486,9 @@ TIntermBlock *TCompiler::compileTreeImpl(const char *const shaderStrings[],
}
if (compileOptions & SH_ENFORCE_PACKING_RESTRICTIONS)
{
- std::vector<sh::ShaderVariable> expandedUniforms;
- sh::ExpandUniforms(uniforms, &expandedUniforms);
- VariablePacker packer;
// Returns true if, after applying the packing rules in the GLSL ES 1.00.17 spec
// Appendix A, section 7, the shader does not use too many uniforms.
- success =
- packer.CheckVariablesWithinPackingLimits(maxUniformVectors, expandedUniforms);
+ success = CheckVariablesInPackingLimits(maxUniformVectors, uniforms);
if (!success)
{
mDiagnostics.globalError("too many uniforms");
@@ -614,11 +629,12 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources &resources)
compileResources = resources;
setResourceString();
- assert(symbolTable.isEmpty());
+ ASSERT(symbolTable.isEmpty());
symbolTable.push(); // COMMON_BUILTINS
symbolTable.push(); // ESSL1_BUILTINS
symbolTable.push(); // ESSL3_BUILTINS
symbolTable.push(); // ESSL3_1_BUILTINS
+ symbolTable.push(); // GLSL_BUILTINS
switch (shaderType)
{
@@ -626,15 +642,13 @@ bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources &resources)
symbolTable.setDefaultPrecision(EbtInt, EbpMedium);
break;
case GL_VERTEX_SHADER:
- symbolTable.setDefaultPrecision(EbtInt, EbpHigh);
- symbolTable.setDefaultPrecision(EbtFloat, EbpHigh);
- break;
case GL_COMPUTE_SHADER:
+ case GL_GEOMETRY_SHADER_OES:
symbolTable.setDefaultPrecision(EbtInt, EbpHigh);
symbolTable.setDefaultPrecision(EbtFloat, EbpHigh);
break;
default:
- assert(false && "Language not supported");
+ UNREACHABLE();
}
// Set defaults for sampler types that have default precision, even those that are
// only available if an extension exists.
@@ -694,6 +708,7 @@ void TCompiler::setResourceString()
<< ":ARM_shader_framebuffer_fetch:" << compileResources.ARM_shader_framebuffer_fetch
<< ":OVR_multiview:" << compileResources.OVR_multiview
<< ":EXT_YUV_target:" << compileResources.EXT_YUV_target
+ << ":OES_geometry_shader:" << compileResources.OES_geometry_shader
<< ":MaxVertexOutputVectors:" << compileResources.MaxVertexOutputVectors
<< ":MaxFragmentInputVectors:" << compileResources.MaxFragmentInputVectors
<< ":MinProgramTexelOffset:" << compileResources.MinProgramTexelOffset
@@ -725,12 +740,34 @@ void TCompiler::setResourceString()
<< ":MaxVertexAtomicCounterBuffers:" << compileResources.MaxVertexAtomicCounterBuffers
<< ":MaxFragmentAtomicCounterBuffers:" << compileResources.MaxFragmentAtomicCounterBuffers
<< ":MaxCombinedAtomicCounterBuffers:" << compileResources.MaxCombinedAtomicCounterBuffers
- << ":MaxAtomicCounterBufferSize:" << compileResources.MaxAtomicCounterBufferSize;
+ << ":MaxAtomicCounterBufferSize:" << compileResources.MaxAtomicCounterBufferSize
+ << ":MaxGeometryUniformComponents:" << compileResources.MaxGeometryUniformComponents
+ << ":MaxGeometryUniformBlocks:" << compileResources.MaxGeometryUniformBlocks
+ << ":MaxGeometryInputComponents:" << compileResources.MaxGeometryInputComponents
+ << ":MaxGeometryOutputComponents:" << compileResources.MaxGeometryOutputComponents
+ << ":MaxGeometryOutputVertices:" << compileResources.MaxGeometryOutputVertices
+ << ":MaxGeometryTotalOutputComponents:" << compileResources.MaxGeometryTotalOutputComponents
+ << ":MaxGeometryTextureImageUnits:" << compileResources.MaxGeometryTextureImageUnits
+ << ":MaxGeometryAtomicCounterBuffers:" << compileResources.MaxGeometryAtomicCounterBuffers
+ << ":MaxGeometryAtomicCounters:" << compileResources.MaxGeometryAtomicCounters
+ << ":MaxGeometryShaderStorageBlocks:" << compileResources.MaxGeometryShaderStorageBlocks
+ << ":MaxGeometryShaderInvocations:" << compileResources.MaxGeometryShaderInvocations
+ << ":MaxGeometryImageUniforms:" << compileResources.MaxGeometryImageUniforms;
// clang-format on
builtInResourcesString = strstream.str();
}
+void TCompiler::collectInterfaceBlocks()
+{
+ ASSERT(interfaceBlocks.empty());
+ interfaceBlocks.reserve(uniformBlocks.size() + shaderStorageBlocks.size() + inBlocks.size());
+ interfaceBlocks.insert(interfaceBlocks.end(), uniformBlocks.begin(), uniformBlocks.end());
+ interfaceBlocks.insert(interfaceBlocks.end(), shaderStorageBlocks.begin(),
+ shaderStorageBlocks.end());
+ interfaceBlocks.insert(interfaceBlocks.end(), inBlocks.begin(), inBlocks.end());
+}
+
void TCompiler::clearResults()
{
arrayBoundsClamper.Cleanup();
@@ -742,13 +779,22 @@ void TCompiler::clearResults()
attributes.clear();
outputVariables.clear();
uniforms.clear();
- varyings.clear();
+ inputVaryings.clear();
+ outputVaryings.clear();
interfaceBlocks.clear();
+ uniformBlocks.clear();
+ shaderStorageBlocks.clear();
+ inBlocks.clear();
variablesCollected = false;
mGLPositionInitialized = false;
mNumViews = -1;
+ mGeometryShaderInputPrimitiveType = EptUndefined;
+ mGeometryShaderOutputPrimitiveType = EptUndefined;
+ mGeometryShaderInvocations = 0;
+ mGeometryShaderMaxVertices = -1;
+
builtInFunctionEmulator.cleanup();
nameMap.clear();
@@ -959,7 +1005,7 @@ void TCompiler::useAllMembersInUnusedStandardAndSharedBlocks(TIntermBlock *root)
{
sh::InterfaceBlockList list;
- for (auto block : interfaceBlocks)
+ for (auto block : uniformBlocks)
{
if (!block.staticUse &&
(block.layout == sh::BLOCKLAYOUT_STANDARD || block.layout == sh::BLOCKLAYOUT_SHARED))
@@ -974,9 +1020,9 @@ void TCompiler::useAllMembersInUnusedStandardAndSharedBlocks(TIntermBlock *root)
void TCompiler::initializeOutputVariables(TIntermBlock *root)
{
InitVariableList list;
- if (shaderType == GL_VERTEX_SHADER)
+ if (shaderType == GL_VERTEX_SHADER || shaderType == GL_GEOMETRY_SHADER_OES)
{
- for (auto var : varyings)
+ for (auto var : outputVaryings)
{
list.push_back(var);
if (var.name == "gl_Position")
@@ -1040,9 +1086,16 @@ void TCompiler::writePragma(ShCompileOptions compileOptions)
bool TCompiler::isVaryingDefined(const char *varyingName)
{
ASSERT(variablesCollected);
- for (size_t ii = 0; ii < varyings.size(); ++ii)
+ for (size_t ii = 0; ii < inputVaryings.size(); ++ii)
+ {
+ if (inputVaryings[ii].name == varyingName)
+ {
+ return true;
+ }
+ }
+ for (size_t ii = 0; ii < outputVaryings.size(); ++ii)
{
- if (varyings[ii].name == varyingName)
+ if (outputVaryings[ii].name == varyingName)
{
return true;
}
diff --git a/chromium/third_party/angle/src/compiler/translator/Compiler.h b/chromium/third_party/angle/src/compiler/translator/Compiler.h
index b48c2520998..085b7a93cc9 100644
--- a/chromium/third_party/angle/src/compiler/translator/Compiler.h
+++ b/chromium/third_party/angle/src/compiler/translator/Compiler.h
@@ -14,6 +14,8 @@
// This should not be included by driver code.
//
+#include <GLSLANG/ShaderVars.h>
+
#include "compiler/translator/BuiltInFunctionEmulator.h"
#include "compiler/translator/CallDAG.h"
#include "compiler/translator/Diagnostics.h"
@@ -22,7 +24,6 @@
#include "compiler/translator/InfoSink.h"
#include "compiler/translator/Pragma.h"
#include "compiler/translator/SymbolTable.h"
-#include "compiler/translator/VariableInfo.h"
#include "third_party/compiler/ArrayBoundsClamper.h"
namespace sh
@@ -110,8 +111,15 @@ class TCompiler : public TShHandleBase
const std::vector<sh::Attribute> &getAttributes() const { return attributes; }
const std::vector<sh::OutputVariable> &getOutputVariables() const { return outputVariables; }
const std::vector<sh::Uniform> &getUniforms() const { return uniforms; }
- const std::vector<sh::Varying> &getVaryings() const { return varyings; }
+ const std::vector<sh::Varying> &getInputVaryings() const { return inputVaryings; }
+ const std::vector<sh::Varying> &getOutputVaryings() const { return outputVaryings; }
const std::vector<sh::InterfaceBlock> &getInterfaceBlocks() const { return interfaceBlocks; }
+ const std::vector<sh::InterfaceBlock> &getUniformBlocks() const { return uniformBlocks; }
+ const std::vector<sh::InterfaceBlock> &getShaderStorageBlocks() const
+ {
+ return shaderStorageBlocks;
+ }
+ const std::vector<sh::InterfaceBlock> &getInBlocks() const { return inBlocks; }
ShHashFunction64 getHashFunction() const { return hashFunction; }
NameMap &getNameMap() { return nameMap; }
@@ -125,8 +133,20 @@ class TCompiler : public TShHandleBase
// Get the resources set by InitBuiltInSymbolTable
const ShBuiltInResources &getResources() const;
- protected:
+ int getGeometryShaderMaxVertices() const { return mGeometryShaderMaxVertices; }
+ int getGeometryShaderInvocations() const { return mGeometryShaderInvocations; }
+ TLayoutPrimitiveType getGeometryShaderInputPrimitiveType() const
+ {
+ return mGeometryShaderInputPrimitiveType;
+ }
+ TLayoutPrimitiveType getGeometryShaderOutputPrimitiveType() const
+ {
+ return mGeometryShaderOutputPrimitiveType;
+ }
+
sh::GLenum getShaderType() const { return shaderType; }
+
+ protected:
// Initialize symbol-table with built-in symbols.
bool InitBuiltInSymbolTable(const ShBuiltInResources &resources);
// Compute the string representation of the built-in resources
@@ -172,8 +192,12 @@ class TCompiler : public TShHandleBase
std::vector<sh::Attribute> attributes;
std::vector<sh::OutputVariable> outputVariables;
std::vector<sh::Uniform> uniforms;
- std::vector<sh::Varying> varyings;
+ std::vector<sh::Varying> inputVaryings;
+ std::vector<sh::Varying> outputVaryings;
std::vector<sh::InterfaceBlock> interfaceBlocks;
+ std::vector<sh::InterfaceBlock> uniformBlocks;
+ std::vector<sh::InterfaceBlock> shaderStorageBlocks;
+ std::vector<sh::InterfaceBlock> inBlocks;
private:
// Creates the function call DAG for further analysis, returning false if there is a recursion
@@ -184,6 +208,8 @@ class TCompiler : public TShHandleBase
void initSamplerDefaultPrecision(TBasicType samplerType);
+ void collectInterfaceBlocks();
+
bool variablesCollected;
bool mGLPositionInitialized;
@@ -241,6 +267,12 @@ class TCompiler : public TShHandleBase
// GL_OVR_multiview num_views.
int mNumViews;
+ // geometry shader parameters.
+ int mGeometryShaderMaxVertices;
+ int mGeometryShaderInvocations;
+ TLayoutPrimitiveType mGeometryShaderInputPrimitiveType;
+ TLayoutPrimitiveType mGeometryShaderOutputPrimitiveType;
+
// name hashing.
ShHashFunction64 hashFunction;
NameMap nameMap;
diff --git a/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp b/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp
index 94fd6bfc113..01b69c30f6d 100644
--- a/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.cpp
@@ -109,23 +109,51 @@ void DeclareGlobalVariable(TIntermBlock *root, TIntermTyped *typedNode)
globalSequence->insert(globalSequence->begin(), declaration);
}
-// Adds the expression gl_ViewportIndex = int(ViewID_OVR) to the end of the initializers' sequence.
-void SelectViewportIndexInVertexShader(TIntermTyped *viewIDSymbol, TIntermSequence *initializers)
+// Adds a branch to write int(ViewID_OVR) to either gl_ViewportIndex or gl_Layer. The branch is
+// added to the end of the initializers' sequence.
+void SelectViewIndexInVertexShader(TIntermTyped *viewIDSymbol,
+ TIntermTyped *multiviewBaseViewLayerIndexSymbol,
+ TIntermSequence *initializers,
+ const TSymbolTable &symbolTable)
{
- // Create a gl_ViewportIndex node.
- TIntermSymbol *viewportIndexSymbol =
- new TIntermSymbol(0, "gl_ViewportIndex", TType(EbtInt, EbpHigh, EvqViewportIndex));
-
// Create an int(ViewID_OVR) node.
TIntermSequence *viewIDSymbolCastArguments = new TIntermSequence();
viewIDSymbolCastArguments->push_back(viewIDSymbol);
TIntermAggregate *viewIDAsInt = TIntermAggregate::CreateConstructor(
TType(EbtInt, EbpHigh, EvqTemporary), viewIDSymbolCastArguments);
- // Create a gl_ViewportIndex = int(ViewID_OVR) node.
- TIntermBinary *viewIDInitializer =
- new TIntermBinary(EOpAssign, viewportIndexSymbol, viewIDAsInt);
- initializers->push_back(viewIDInitializer);
+ // Create a gl_ViewportIndex node.
+ TIntermSymbol *viewportIndexSymbol =
+ ReferenceBuiltInVariable("gl_ViewportIndex", symbolTable, 0);
+
+ // Create a { gl_ViewportIndex = int(ViewID_OVR) } node.
+ TIntermBlock *viewportIndexInitializerInBlock = new TIntermBlock();
+ viewportIndexInitializerInBlock->appendStatement(
+ new TIntermBinary(EOpAssign, viewportIndexSymbol, viewIDAsInt));
+
+ // Create a gl_Layer node.
+ TIntermSymbol *layerSymbol = new TIntermSymbol(0, "gl_Layer", TType(EbtInt, EbpHigh, EvqLayer));
+
+ // Create an int(ViewID_OVR) + multiviewBaseViewLayerIndex node
+ TIntermBinary *sumOfViewIDAndBaseViewIndex =
+ new TIntermBinary(EOpAdd, viewIDAsInt->deepCopy(), multiviewBaseViewLayerIndexSymbol);
+
+ // Create a { gl_Layer = int(ViewID_OVR) + multiviewBaseViewLayerIndex } node.
+ TIntermBlock *layerInitializerInBlock = new TIntermBlock();
+ layerInitializerInBlock->appendStatement(
+ new TIntermBinary(EOpAssign, layerSymbol, sumOfViewIDAndBaseViewIndex));
+
+ // Create a node to compare whether the base view index uniform is less than zero.
+ TIntermBinary *multiviewBaseViewLayerIndexZeroComparison =
+ new TIntermBinary(EOpLessThan, multiviewBaseViewLayerIndexSymbol->deepCopy(),
+ CreateZeroNode(TType(EbtInt, EbpHigh, EvqConst)));
+
+ // Create an if-else statement to select the code path.
+ TIntermIfElse *multiviewBranch =
+ new TIntermIfElse(multiviewBaseViewLayerIndexZeroComparison,
+ viewportIndexInitializerInBlock, layerInitializerInBlock);
+
+ initializers->push_back(multiviewBranch);
}
} // namespace
@@ -162,15 +190,24 @@ void DeclareAndInitBuiltinsForInstancedMultiview(TIntermBlock *root,
// The AST transformation which adds the expression to select the viewport index should
// be done only for the GLSL and ESSL output.
- const bool selectViewport =
- (compileOptions & SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER) != 0u;
- // Assert that if the viewport is selected in the vertex shader, then the output is
+ const bool selectView = (compileOptions & SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER) != 0u;
+ // Assert that if the view is selected in the vertex shader, then the output is
// either GLSL or ESSL.
- ASSERT(!selectViewport || IsOutputGLSL(shaderOutput) || IsOutputESSL(shaderOutput));
- if (selectViewport)
+ ASSERT(!selectView || IsOutputGLSL(shaderOutput) || IsOutputESSL(shaderOutput));
+ if (selectView)
{
- // Setting a value to gl_ViewportIndex should happen after ViewID_OVR's initialization.
- SelectViewportIndexInVertexShader(viewIDSymbol->deepCopy(), initializers);
+ // Add a uniform to switch between side-by-side and layered rendering.
+ TIntermSymbol *multiviewBaseViewLayerIndexSymbol =
+ new TIntermSymbol(symbolTable->nextUniqueId(), "multiviewBaseViewLayerIndex",
+ TType(EbtInt, EbpHigh, EvqUniform));
+ multiviewBaseViewLayerIndexSymbol->setInternal(true);
+ DeclareGlobalVariable(root, multiviewBaseViewLayerIndexSymbol);
+
+ // Setting a value to gl_ViewportIndex or gl_Layer should happen after ViewID_OVR's
+ // initialization.
+ SelectViewIndexInVertexShader(viewIDSymbol->deepCopy(),
+ multiviewBaseViewLayerIndexSymbol->deepCopy(),
+ initializers, *symbolTable);
}
// Insert initializers at the beginning of main().
diff --git a/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h b/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h
index 201f2a212eb..b4ab05fd0e7 100644
--- a/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h
+++ b/chromium/third_party/angle/src/compiler/translator/DeclareAndInitBuiltinsForInstancedMultiview.h
@@ -14,8 +14,14 @@
// - Add initializers of ViewID_OVR and InstanceID to the beginning of the body of main. The pass
// should be executed before any variables get collected so that usage of gl_InstanceID is recorded.
// - If the output is ESSL or GLSL and the SH_SELECT_VIEW_IN_NV_GLSL_VERTEX_SHADER option is
-// enabled, the expression "gl_ViewportIndex = int(ViewID_OVR)" is added after ViewID and InstanceID
-// are initialized.
+// enabled, the expression
+// "if (multiviewBaseViewLayerIndex < 0) {
+// gl_ViewportIndex = int(ViewID_OVR);
+// } else {
+// gl_Layer = int(ViewID_OVR) + multiviewBaseViewLayerIndex;
+// }"
+// is added after ViewID and InstanceID are initialized. Also, MultiviewRenderPath is added as a
+// uniform.
//
#ifndef COMPILER_TRANSLATOR_DECLAREANDINITBUILTINSFORINSTANCEDMULTIVIEW_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/Initialize.cpp b/chromium/third_party/angle/src/compiler/translator/Initialize.cpp
index 3b0589f3545..dc2cd128fba 100644
--- a/chromium/third_party/angle/src/compiler/translator/Initialize.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/Initialize.cpp
@@ -676,6 +676,15 @@ void InsertBuiltInFunctions(sh::GLenum type,
voidType, "groupMemoryBarrier");
}
+ if (type == GL_GEOMETRY_SHADER_OES)
+ {
+ const char *extension = "GL_OES_geometry_shader";
+ symbolTable.insertBuiltInFunctionNoParametersExt(ESSL3_1_BUILTINS, extension, EOpEmitVertex,
+ voidType, "EmitVertex");
+ symbolTable.insertBuiltInFunctionNoParametersExt(ESSL3_1_BUILTINS, extension,
+ EOpEndPrimitive, voidType, "EndPrimitive");
+ }
+
//
// Depth range in window coordinates
//
@@ -720,7 +729,7 @@ void InsertBuiltInFunctions(sh::GLenum type,
{
symbolTable.insertConstIntExt(COMMON_BUILTINS, "GL_EXT_blend_func_extended",
"gl_MaxDualSourceDrawBuffersEXT",
- resources.MaxDualSourceDrawBuffers);
+ resources.MaxDualSourceDrawBuffers, EbpMedium);
}
symbolTable.insertConstInt(ESSL3_BUILTINS, "gl_MaxVertexOutputVectors",
@@ -777,6 +786,29 @@ void InsertBuiltInFunctions(sh::GLenum type,
resources.MaxCombinedAtomicCounterBuffers, EbpMedium);
symbolTable.insertConstInt(ESSL3_1_BUILTINS, "gl_MaxAtomicCounterBufferSize",
resources.MaxAtomicCounterBufferSize, EbpMedium);
+
+ if (resources.OES_geometry_shader)
+ {
+ const char *ext = "GL_OES_geometry_shader";
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryInputComponents",
+ resources.MaxGeometryInputComponents, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryOutputComponents",
+ resources.MaxGeometryOutputComponents, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryImageUniforms",
+ resources.MaxGeometryImageUniforms, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryTextureImageUnits",
+ resources.MaxGeometryTextureImageUnits, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryOutputVertices",
+ resources.MaxGeometryOutputVertices, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryTotalOutputComponents",
+ resources.MaxGeometryTotalOutputComponents, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryUniformComponents",
+ resources.MaxGeometryUniformComponents, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryAtomicCounters",
+ resources.MaxGeometryAtomicCounters, EbpMedium);
+ symbolTable.insertConstIntExt(ESSL3_1_BUILTINS, ext, "gl_MaxGeometryAtomicCounterBuffers",
+ resources.MaxGeometryAtomicCounterBuffers, EbpMedium);
+ }
}
void IdentifyBuiltIns(sh::GLenum type,
@@ -816,11 +848,11 @@ void IdentifyBuiltIns(sh::GLenum type,
TType fragData(EbtFloat, EbpMedium, EvqFragData, 4);
if (spec != SH_WEBGL2_SPEC && spec != SH_WEBGL3_SPEC)
{
- fragData.setArraySize(resources.MaxDrawBuffers);
+ fragData.makeArray(resources.MaxDrawBuffers);
}
else
{
- fragData.setArraySize(1u);
+ fragData.makeArray(1u);
}
symbolTable.insertVariable(ESSL1_BUILTINS, "gl_FragData", fragData);
@@ -829,8 +861,8 @@ void IdentifyBuiltIns(sh::GLenum type,
symbolTable.insertVariableExt(
ESSL1_BUILTINS, "GL_EXT_blend_func_extended", "gl_SecondaryFragColorEXT",
TType(EbtFloat, EbpMedium, EvqSecondaryFragColorEXT, 4));
- TType secondaryFragData(EbtFloat, EbpMedium, EvqSecondaryFragDataEXT, 4, 1, true);
- secondaryFragData.setArraySize(resources.MaxDualSourceDrawBuffers);
+ TType secondaryFragData(EbtFloat, EbpMedium, EvqSecondaryFragDataEXT, 4, 1);
+ secondaryFragData.makeArray(resources.MaxDualSourceDrawBuffers);
symbolTable.insertVariableExt(ESSL1_BUILTINS, "GL_EXT_blend_func_extended",
"gl_SecondaryFragDataEXT", secondaryFragData);
}
@@ -848,8 +880,8 @@ void IdentifyBuiltIns(sh::GLenum type,
if (resources.EXT_shader_framebuffer_fetch || resources.NV_shader_framebuffer_fetch)
{
- TType lastFragData(EbtFloat, EbpMedium, EvqLastFragData, 4, 1, true);
- lastFragData.setArraySize(resources.MaxDrawBuffers);
+ TType lastFragData(EbtFloat, EbpMedium, EvqLastFragData, 4, 1);
+ lastFragData.makeArray(resources.MaxDrawBuffers);
if (resources.EXT_shader_framebuffer_fetch)
{
@@ -871,11 +903,20 @@ void IdentifyBuiltIns(sh::GLenum type,
"gl_LastFragColorARM",
TType(EbtFloat, EbpMedium, EvqLastFragColor, 4));
}
- }
- break;
+ if (resources.OES_geometry_shader)
+ {
+ const char *extension = "GL_OES_geometry_shader";
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_PrimitiveID",
+ TType(EbtInt, EbpHigh, EvqPrimitiveID, 1));
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_Layer",
+ TType(EbtInt, EbpHigh, EvqLayer, 1));
+ }
+ break;
+ }
case GL_VERTEX_SHADER:
+ {
symbolTable.insertVariable(COMMON_BUILTINS, "gl_Position",
TType(EbtFloat, EbpHigh, EvqPosition, 4));
symbolTable.insertVariable(COMMON_BUILTINS, "gl_PointSize",
@@ -884,7 +925,12 @@ void IdentifyBuiltIns(sh::GLenum type,
TType(EbtInt, EbpHigh, EvqInstanceID, 1));
symbolTable.insertVariable(ESSL3_BUILTINS, "gl_VertexID",
TType(EbtInt, EbpHigh, EvqVertexID, 1));
+
+ // For internal use by ANGLE - not exposed to the parser.
+ symbolTable.insertVariable(GLSL_BUILTINS, "gl_ViewportIndex",
+ TType(EbtInt, EbpHigh, EvqViewportIndex));
break;
+ }
case GL_COMPUTE_SHADER:
{
symbolTable.insertVariable(ESSL3_1_BUILTINS, "gl_NumWorkGroups",
@@ -899,11 +945,51 @@ void IdentifyBuiltIns(sh::GLenum type,
TType(EbtUInt, EbpUndefined, EvqGlobalInvocationID, 3));
symbolTable.insertVariable(ESSL3_1_BUILTINS, "gl_LocalInvocationIndex",
TType(EbtUInt, EbpUndefined, EvqLocalInvocationIndex, 1));
+ break;
}
- break;
+ case GL_GEOMETRY_SHADER_OES:
+ {
+ const char *extension = "GL_OES_geometry_shader";
+
+ // Add built-in interface block gl_PerVertex and the built-in array gl_in.
+ // TODO(jiawei.shao@intel.com): implement GL_OES_geometry_point_size.
+ const TString *glPerVertexString = NewPoolTString("gl_PerVertex");
+ symbolTable.insertInterfaceBlockNameExt(ESSL3_1_BUILTINS, extension, glPerVertexString);
+
+ TFieldList *fieldList = NewPoolTFieldList();
+ TSourceLoc zeroSourceLoc = {0, 0, 0, 0};
+ TField *glPositionField = new TField(new TType(EbtFloat, EbpHigh, EvqPosition, 4),
+ NewPoolTString("gl_Position"), zeroSourceLoc);
+ fieldList->push_back(glPositionField);
+
+ TInterfaceBlock *glInBlock = new TInterfaceBlock(
+ glPerVertexString, fieldList, NewPoolTString("gl_in"), TLayoutQualifier::create());
+
+ // The array size of gl_in is undefined until we get a valid input primitive
+ // declaration.
+ TType glInType(glInBlock, EvqPerVertexIn, TLayoutQualifier::create());
+ glInType.makeArray(0u);
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_in", glInType);
+
+ TType glPositionType(EbtFloat, EbpHigh, EvqPosition, 4);
+ glPositionType.setInterfaceBlock(new TInterfaceBlock(
+ glPerVertexString, fieldList, nullptr, TLayoutQualifier::create()));
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_Position",
+ glPositionType);
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_PrimitiveIDIn",
+ TType(EbtInt, EbpHigh, EvqPrimitiveIDIn, 1));
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_InvocationID",
+ TType(EbtInt, EbpHigh, EvqInvocationID, 1));
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_PrimitiveID",
+ TType(EbtInt, EbpHigh, EvqPrimitiveID, 1));
+ symbolTable.insertVariableExt(ESSL3_1_BUILTINS, extension, "gl_Layer",
+ TType(EbtInt, EbpHigh, EvqLayer, 1));
+
+ break;
+ }
default:
- assert(false && "Language not supported");
+ UNREACHABLE();
}
}
@@ -942,6 +1028,10 @@ void InitExtensionBehavior(const ShBuiltInResources &resources, TExtensionBehavi
{
extBehavior["GL_EXT_YUV_target"] = EBhUndefined;
}
+ if (resources.OES_geometry_shader)
+ {
+ extBehavior["GL_OES_geometry_shader"] = EBhUndefined;
+ }
}
void ResetExtensionBehavior(TExtensionBehavior &extBehavior)
diff --git a/chromium/third_party/angle/src/compiler/translator/InitializeVariables.cpp b/chromium/third_party/angle/src/compiler/translator/InitializeVariables.cpp
index 6b015e2f448..bab1b6a3914 100644
--- a/chromium/third_party/angle/src/compiler/translator/InitializeVariables.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/InitializeVariables.cpp
@@ -68,11 +68,15 @@ void AddArrayZeroInitSequence(const TIntermTyped *initializedNode, TIntermSequen
// doesn't have array assignment.
// Note that it is important to have the array init in the right order to workaround
// http://crbug.com/709317
- for (unsigned int i = 0; i < initializedNode->getArraySize(); ++i)
+ for (unsigned int i = 0; i < initializedNode->getOutermostArraySize(); ++i)
{
TIntermBinary *element =
new TIntermBinary(EOpIndexDirect, initializedNode->deepCopy(), CreateIndexNode(i));
- if (element->getType().isStructureContainingArrays())
+ if (element->isArray())
+ {
+ AddArrayZeroInitSequence(element, initSequenceOut);
+ }
+ else if (element->getType().isStructureContainingArrays())
{
AddStructZeroInitSequence(element, initSequenceOut);
}
diff --git a/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp b/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp
index 1d842cd612c..bf2b8c7884b 100644
--- a/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/IntermNode.cpp
@@ -502,7 +502,7 @@ void TIntermDeclaration::appendDeclarator(TIntermTyped *declarator)
(declarator->getAsBinaryNode() != nullptr &&
declarator->getAsBinaryNode()->getOp() == EOpInitialize));
ASSERT(mDeclarators.empty() ||
- declarator->getType().sameElementType(mDeclarators.back()->getAsTyped()->getType()));
+ declarator->getType().sameNonArrayType(mDeclarators.back()->getAsTyped()->getType()));
mDeclarators.push_back(declarator);
}
@@ -1063,7 +1063,7 @@ void TIntermBinary::promote()
case EOpIndexIndirect:
if (mLeft->isArray())
{
- mType.clearArrayness();
+ mType.toArrayElementType();
}
else if (mLeft->isMatrix())
{
@@ -1242,9 +1242,9 @@ const TConstantUnion *TIntermConstantUnion::foldIndexing(int index)
{
if (isArray())
{
- ASSERT(index < static_cast<int>(getType().getArraySize()));
+ ASSERT(index < static_cast<int>(getType().getOutermostArraySize()));
TType arrayElementType = getType();
- arrayElementType.clearArrayness();
+ arrayElementType.toArrayElementType();
size_t arrayElementSize = arrayElementType.getObjectSize();
return &mUnionArrayPointer[arrayElementSize * index];
}
diff --git a/chromium/third_party/angle/src/compiler/translator/IntermNode.h b/chromium/third_party/angle/src/compiler/translator/IntermNode.h
index 4a906bbbcf6..5dd7da84003 100644
--- a/chromium/third_party/angle/src/compiler/translator/IntermNode.h
+++ b/chromium/third_party/angle/src/compiler/translator/IntermNode.h
@@ -176,7 +176,7 @@ class TIntermTyped : public TIntermNode
const char *getBasicString() const { return mType.getBasicString(); }
TString getCompleteString() const { return mType.getCompleteString(); }
- unsigned int getArraySize() const { return mType.getArraySize(); }
+ unsigned int getOutermostArraySize() const { return mType.getOutermostArraySize(); }
bool isConstructorWithOnlyConstantUnionParameters();
diff --git a/chromium/third_party/angle/src/compiler/translator/IntermNode_util.cpp b/chromium/third_party/angle/src/compiler/translator/IntermNode_util.cpp
index 7afe37196b7..d0ed50a107e 100644
--- a/chromium/third_party/angle/src/compiler/translator/IntermNode_util.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/IntermNode_util.cpp
@@ -116,7 +116,10 @@ TIntermTyped *CreateZeroNode(const TType &type)
// Void array. This happens only on error condition, similarly to the case above. We don't
// have a constructor operator for void, so this needs special handling. We'll end up with a
// value without the array type, but that should not be a problem.
- constType.clearArrayness();
+ while (constType.isArray())
+ {
+ constType.toArrayElementType();
+ }
return CreateZeroNode(constType);
}
@@ -125,9 +128,9 @@ TIntermTyped *CreateZeroNode(const TType &type)
if (type.isArray())
{
TType elementType(type);
- elementType.clearArrayness();
+ elementType.toArrayElementType();
- size_t arraySize = type.getArraySize();
+ size_t arraySize = type.getOutermostArraySize();
for (size_t i = 0; i < arraySize; ++i)
{
arguments->push_back(CreateZeroNode(elementType));
@@ -193,7 +196,7 @@ TIntermSymbol *ReferenceBuiltInVariable(const TString &name,
int shaderVersion)
{
const TVariable *var =
- reinterpret_cast<const TVariable *>(symbolTable.findBuiltIn(name, shaderVersion));
+ reinterpret_cast<const TVariable *>(symbolTable.findBuiltIn(name, shaderVersion, true));
ASSERT(var);
return new TIntermSymbol(var->getUniqueId(), name, var->getType());
}
diff --git a/chromium/third_party/angle/src/compiler/translator/IntermNode_util.h b/chromium/third_party/angle/src/compiler/translator/IntermNode_util.h
index 8cd1568f316..6be81638054 100644
--- a/chromium/third_party/angle/src/compiler/translator/IntermNode_util.h
+++ b/chromium/third_party/angle/src/compiler/translator/IntermNode_util.h
@@ -35,7 +35,10 @@ TIntermConstantUnion *CreateBoolNode(bool value);
// If the input node is not a block node, put it inside a block node and return that.
TIntermBlock *EnsureBlock(TIntermNode *node);
+// Should be called from inside Compiler::compileTreeImpl() where the global level is in scope.
TIntermSymbol *ReferenceGlobalVariable(const TString &name, const TSymbolTable &symbolTable);
+
+// Note: this can access desktop GLSL built-ins that are hidden from the parser.
TIntermSymbol *ReferenceBuiltInVariable(const TString &name,
const TSymbolTable &symbolTable,
int shaderVersion);
diff --git a/chromium/third_party/angle/src/compiler/translator/Operator.cpp b/chromium/third_party/angle/src/compiler/translator/Operator.cpp
index da921156a47..61e39e6c061 100644
--- a/chromium/third_party/angle/src/compiler/translator/Operator.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/Operator.cpp
@@ -341,6 +341,11 @@ const char *GetOperatorString(TOperator op)
return "memoryBarrierShared";
case EOpGroupMemoryBarrier:
return "groupMemoryBarrier";
+
+ case EOpEmitVertex:
+ return "EmitVertex";
+ case EOpEndPrimitive:
+ return "EndPrimitive";
default:
break;
}
diff --git a/chromium/third_party/angle/src/compiler/translator/Operator.h b/chromium/third_party/angle/src/compiler/translator/Operator.h
index 23f78a6d481..c42a5646f3b 100644
--- a/chromium/third_party/angle/src/compiler/translator/Operator.h
+++ b/chromium/third_party/angle/src/compiler/translator/Operator.h
@@ -237,7 +237,11 @@ enum TOperator
EOpMemoryBarrierBuffer,
EOpMemoryBarrierImage,
EOpMemoryBarrierShared,
- EOpGroupMemoryBarrier
+ EOpGroupMemoryBarrier,
+
+ // Geometry only
+ EOpEmitVertex,
+ EOpEndPrimitive
};
// Returns the string corresponding to the operator in GLSL
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp
index 23ec8e1aaf1..c0c043733de 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.cpp
@@ -6,9 +6,11 @@
#include "compiler/translator/OutputGLSLBase.h"
+#include "angle_gl.h"
#include "common/debug.h"
#include "common/mathutil.h"
#include "compiler/translator/Compiler.h"
+#include "compiler/translator/util.h"
#include <cfloat>
@@ -17,13 +19,6 @@ namespace sh
namespace
{
-TString arrayBrackets(const TType &type)
-{
- ASSERT(type.isArray());
- TInfoSinkBase out;
- out << "[" << type.getArraySize() << "]";
- return TString(out.c_str());
-}
bool isSingleStatement(TIntermNode *node)
{
@@ -245,6 +240,11 @@ void TOutputGLSLBase::writeLayoutQualifier(const TType &type)
}
}
+ if (IsAtomicCounter(type.getBasicType()))
+ {
+ out << listItemPrefix << "offset = " << layoutQualifier.offset;
+ }
+
out << ") ";
}
@@ -376,7 +376,7 @@ void TOutputGLSLBase::writeFunctionParameters(const TIntermSequence &args)
if (!arg->getName().getString().empty())
out << " " << hashName(arg->getName());
if (type.isArray())
- out << arrayBrackets(type);
+ out << ArrayString(type);
// Put a comma if this is not the last argument.
if (iter != args.end() - 1)
@@ -450,7 +450,7 @@ void TOutputGLSLBase::writeConstructorTriplet(Visit visit, const TType &type)
if (type.isArray())
{
out << getTypeName(type);
- out << arrayBrackets(type);
+ out << ArrayString(type);
out << "(";
}
else
@@ -470,7 +470,7 @@ void TOutputGLSLBase::visitSymbol(TIntermSymbol *node)
out << hashVariableName(node->getName());
if (mDeclaringVariables && node->getType().isArray())
- out << arrayBrackets(node->getType());
+ out << ArrayString(node->getType());
}
void TOutputGLSLBase::visitConstantUnion(TIntermConstantUnion *node)
@@ -567,7 +567,7 @@ bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary *node)
if (left->isArray())
{
// The shader will fail validation if the array length is not > 0.
- maxSize = static_cast<int>(leftType.getArraySize()) - 1;
+ maxSize = static_cast<int>(leftType.getOutermostArraySize()) - 1;
}
else
{
@@ -616,7 +616,8 @@ bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary *node)
const TField *field = interfaceBlock->fields()[index->getIConst(0)];
TString fieldName = field->name();
- ASSERT(!mSymbolTable->findBuiltIn(interfaceBlock->name(), mShaderVersion));
+ ASSERT(!mSymbolTable->findBuiltIn(interfaceBlock->name(), mShaderVersion) ||
+ interfaceBlock->name() == "gl_PerVertex");
fieldName = hashName(TName(fieldName));
out << fieldName;
@@ -924,7 +925,7 @@ bool TOutputGLSLBase::visitFunctionPrototype(Visit visit, TIntermFunctionPrototy
const TType &type = node->getType();
writeVariableType(type);
if (type.isArray())
- out << arrayBrackets(type);
+ out << ArrayString(type);
out << " " << hashFunctionNameIfNeeded(*node->getFunctionSymbolInfo());
@@ -1005,6 +1006,8 @@ bool TOutputGLSLBase::visitAggregate(Visit visit, TIntermAggregate *node)
case EOpMemoryBarrierImage:
case EOpMemoryBarrierShared:
case EOpGroupMemoryBarrier:
+ case EOpEmitVertex:
+ case EOpEndPrimitive:
writeBuiltInFunctionTriplet(visit, node->getOp(), node->getUseEmulatedFunction());
break;
default:
@@ -1219,7 +1222,7 @@ void TOutputGLSLBase::declareStruct(const TStructure *structure)
out << " ";
out << getTypeName(*field->type()) << " " << hashName(TName(field->name()));
if (field->type()->isArray())
- out << arrayBrackets(*field->type());
+ out << ArrayString(*field->type());
out << ";\n";
}
out << "}";
@@ -1287,10 +1290,58 @@ void TOutputGLSLBase::declareInterfaceBlock(const TInterfaceBlock *interfaceBloc
out << " ";
out << getTypeName(*field->type()) << " " << hashName(TName(field->name()));
if (field->type()->isArray())
- out << arrayBrackets(*field->type());
+ out << ArrayString(*field->type());
out << ";\n";
}
out << "}";
}
+void WriteGeometryShaderLayoutQualifiers(TInfoSinkBase &out,
+ sh::TLayoutPrimitiveType inputPrimitive,
+ int invocations,
+ sh::TLayoutPrimitiveType outputPrimitive,
+ int maxVertices)
+{
+ // Omit 'invocations = 1'
+ if (inputPrimitive != EptUndefined || invocations > 1)
+ {
+ out << "layout (";
+
+ if (inputPrimitive != EptUndefined)
+ {
+ out << getGeometryShaderPrimitiveTypeString(inputPrimitive);
+ }
+
+ if (invocations > 1)
+ {
+ if (inputPrimitive != EptUndefined)
+ {
+ out << ", ";
+ }
+ out << "invocations = " << invocations;
+ }
+ out << ") in;\n";
+ }
+
+ if (outputPrimitive != EptUndefined || maxVertices != -1)
+ {
+ out << "layout (";
+
+ if (outputPrimitive != EptUndefined)
+ {
+ out << getGeometryShaderPrimitiveTypeString(outputPrimitive);
+ }
+
+ if (maxVertices != -1)
+ {
+ if (outputPrimitive != EptUndefined)
+ {
+ out << ", ";
+ }
+ out << "max_vertices = " << maxVertices;
+ }
+ out << ") out;\n";
+ }
+}
+
} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h
index 9aeb83a55a3..c5cc550f241 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h
+++ b/chromium/third_party/angle/src/compiler/translator/OutputGLSLBase.h
@@ -109,6 +109,12 @@ class TOutputGLSLBase : public TIntermTraverser
ShCompileOptions mCompileOptions;
};
+void WriteGeometryShaderLayoutQualifiers(TInfoSinkBase &out,
+ sh::TLayoutPrimitiveType inputPrimitive,
+ int invocations,
+ sh::TLayoutPrimitiveType outputPrimitive,
+ int maxVertices);
+
} // namespace sh
#endif // COMPILER_TRANSLATOR_OUTPUTGLSLBASE_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp
index f708c0ac59f..9bcfe8ce0b7 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/OutputHLSL.cpp
@@ -31,6 +31,23 @@
namespace sh
{
+namespace
+{
+
+TString ArrayHelperFunctionName(const char *prefix, const TType &type)
+{
+ TStringStream fnName;
+ fnName << prefix << "_";
+ for (unsigned int arraySize : type.getArraySizes())
+ {
+ fnName << arraySize << "_";
+ }
+ fnName << TypeString(type);
+ return fnName.str();
+}
+
+} // anonymous namespace
+
void OutputHLSL::writeFloat(TInfoSinkBase &out, float f)
{
// This is known not to work for NaN on all drivers but make the best effort to output NaNs
@@ -113,6 +130,9 @@ OutputHLSL::OutputHLSL(sh::GLenum shaderType,
mUsesFrontFacing = false;
mUsesPointSize = false;
mUsesInstanceID = false;
+ mHasMultiviewExtensionEnabled = IsExtensionEnabled(mExtensionBehavior, "GL_OVR_multiview") ||
+ IsExtensionEnabled(mExtensionBehavior, "GL_OVR_multiview2");
+ mUsesViewID = false;
mUsesVertexID = false;
mUsesFragDepth = false;
mUsesNumWorkGroups = false;
@@ -147,7 +167,7 @@ OutputHLSL::OutputHLSL(sh::GLenum shaderType,
}
// Reserve registers for the default uniform block and driver constants
- mUniformHLSL->reserveInterfaceBlockRegisters(2);
+ mUniformHLSL->reserveUniformBlockRegisters(2);
}
OutputHLSL::~OutputHLSL()
@@ -231,9 +251,9 @@ void OutputHLSL::makeFlaggedStructMaps(const std::vector<TIntermTyped *> &flagge
}
}
-const std::map<std::string, unsigned int> &OutputHLSL::getInterfaceBlockRegisterMap() const
+const std::map<std::string, unsigned int> &OutputHLSL::getUniformBlockRegisterMap() const
{
- return mUniformHLSL->getInterfaceBlockRegisterMap();
+ return mUniformHLSL->getUniformBlockRegisterMap();
}
const std::map<std::string, unsigned int> &OutputHLSL::getUniformRegisterMap() const
@@ -241,53 +261,58 @@ const std::map<std::string, unsigned int> &OutputHLSL::getUniformRegisterMap() c
return mUniformHLSL->getUniformRegisterMap();
}
-int OutputHLSL::vectorSize(const TType &type) const
-{
- int elementSize = type.isMatrix() ? type.getCols() : 1;
- unsigned int arraySize = type.isArray() ? type.getArraySize() : 1u;
-
- return elementSize * arraySize;
-}
-
-TString OutputHLSL::structInitializerString(int indent,
- const TStructure &structure,
- const TString &rhsStructName)
+TString OutputHLSL::structInitializerString(int indent, const TType &type, const TString &name)
{
TString init;
- TString preIndentString;
- TString fullIndentString;
-
- for (int spaces = 0; spaces < (indent * 4); spaces++)
+ TString indentString;
+ for (int spaces = 0; spaces < indent; spaces++)
{
- preIndentString += ' ';
+ indentString += " ";
}
- for (int spaces = 0; spaces < ((indent + 1) * 4); spaces++)
- {
- fullIndentString += ' ';
- }
-
- init += preIndentString + "{\n";
-
- const TFieldList &fields = structure.fields();
- for (unsigned int fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++)
+ if (type.isArray())
{
- const TField &field = *fields[fieldIndex];
- const TString &fieldName = rhsStructName + "." + Decorate(field.name());
- const TType &fieldType = *field.type();
-
- if (fieldType.getStruct())
+ init += indentString + "{\n";
+ for (unsigned int arrayIndex = 0u; arrayIndex < type.getOutermostArraySize(); ++arrayIndex)
{
- init += structInitializerString(indent + 1, *fieldType.getStruct(), fieldName);
+ TStringStream indexedString;
+ indexedString << name << "[" << arrayIndex << "]";
+ TType elementType = type;
+ elementType.toArrayElementType();
+ init += structInitializerString(indent + 1, elementType, indexedString.str());
+ if (arrayIndex < type.getOutermostArraySize() - 1)
+ {
+ init += ",";
+ }
+ init += "\n";
}
- else
+ init += indentString + "}";
+ }
+ else if (type.getBasicType() == EbtStruct)
+ {
+ init += indentString + "{\n";
+ const TStructure &structure = *type.getStruct();
+ const TFieldList &fields = structure.fields();
+ for (unsigned int fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++)
{
- init += fullIndentString + fieldName + ",\n";
+ const TField &field = *fields[fieldIndex];
+ const TString &fieldName = name + "." + Decorate(field.name());
+ const TType &fieldType = *field.type();
+
+ init += structInitializerString(indent + 1, fieldType, fieldName);
+ if (fieldIndex < fields.size() - 1)
+ {
+ init += ",";
+ }
+ init += "\n";
}
+ init += indentString + "}";
+ }
+ else
+ {
+ init += indentString + name;
}
-
- init += preIndentString + "}" + (indent == 0 ? ";" : ",") + "\n";
return init;
}
@@ -307,9 +332,14 @@ void OutputHLSL::header(TInfoSinkBase &out, const BuiltInFunctionEmulator *built
const TStructure &structure = *structNode->getType().getStruct();
const TString &originalName = mFlaggedStructOriginalNames[structNode];
- flaggedStructs += "static " + Decorate(structure.name()) + " " + mappedName + " =\n";
- flaggedStructs += structInitializerString(0, structure, originalName);
- flaggedStructs += "\n";
+ flaggedStructs += "static " + Decorate(structure.name()) + " " + mappedName;
+ if (structNode->isArray())
+ {
+ flaggedStructs += ArrayString(structNode->getType());
+ }
+ flaggedStructs += " =\n";
+ flaggedStructs += structInitializerString(0, structNode->getType(), originalName);
+ flaggedStructs += ";\n";
}
for (ReferencedSymbols::const_iterator varying = mReferencedVaryings.begin();
@@ -336,7 +366,7 @@ void OutputHLSL::header(TInfoSinkBase &out, const BuiltInFunctionEmulator *built
out << mStructureHLSL->structsHeader();
mUniformHLSL->uniformsHeader(out, mOutputType, mReferencedUniforms);
- out << mUniformHLSL->interfaceBlocksHeader(mReferencedInterfaceBlocks);
+ out << mUniformHLSL->uniformBlocksHeader(mReferencedUniformBlocks);
if (!mEqualityFunctions.empty())
{
@@ -698,6 +728,16 @@ void OutputHLSL::header(TInfoSinkBase &out, const BuiltInFunctionEmulator *built
out << "#define GL_USES_POINT_SIZE\n";
}
+ if (mHasMultiviewExtensionEnabled)
+ {
+ out << "#define GL_ANGLE_MULTIVIEW_ENABLED\n";
+ }
+
+ if (mUsesViewID)
+ {
+ out << "#define GL_USES_VIEW_ID\n";
+ }
+
if (mUsesFragDepth)
{
out << "#define GL_USES_FRAG_DEPTH\n";
@@ -774,7 +814,7 @@ void OutputHLSL::visitSymbol(TIntermSymbol *node)
if (interfaceBlock)
{
- mReferencedInterfaceBlocks[interfaceBlock->name()] = node;
+ mReferencedUniformBlocks[interfaceBlock->name()] = node;
}
else
{
@@ -794,6 +834,10 @@ void OutputHLSL::visitSymbol(TIntermSymbol *node)
{
mReferencedVaryings[name] = node;
out << Decorate(name);
+ if (name == "ViewID_OVR")
+ {
+ mUsesViewID = true;
+ }
}
else if (qualifier == EvqFragmentOut)
{
@@ -921,6 +965,19 @@ void OutputHLSL::outputEqual(Visit visit, const TType &type, TOperator op, TInfo
}
}
+void OutputHLSL::outputAssign(Visit visit, const TType &type, TInfoSinkBase &out)
+{
+ if (type.isArray())
+ {
+ const TString &functionName = addArrayAssignmentFunction(type);
+ outputTriplet(out, visit, (functionName + "(").c_str(), ", ", ")");
+ }
+ else
+ {
+ outputTriplet(out, visit, "(", " = ", ")");
+ }
+}
+
bool OutputHLSL::ancestorEvaluatesToSamplerInStruct()
{
for (unsigned int n = 0u; getAncestorNode(n) != nullptr; ++n)
@@ -983,7 +1040,7 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
outputTriplet(out, visit, "(", ", ", ")");
break;
case EOpAssign:
- if (node->getLeft()->isArray())
+ if (node->isArray())
{
TIntermAggregate *rightAgg = node->getRight()->getAsAggregate();
if (rightAgg != nullptr && rightAgg->isConstructor())
@@ -1003,14 +1060,8 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
// ArrayReturnValueToOutParameter should have eliminated expressions where a
// function call is assigned.
ASSERT(rightAgg == nullptr);
-
- const TString &functionName = addArrayAssignmentFunction(node->getType());
- outputTriplet(out, visit, (functionName + "(").c_str(), ", ", ")");
- }
- else
- {
- outputTriplet(out, visit, "(", " = ", ")");
}
+ outputAssign(visit, node->getType(), out);
break;
case EOpInitialize:
if (visit == PreVisit)
@@ -1120,9 +1171,9 @@ bool OutputHLSL::visitBinary(Visit visit, TIntermBinary *node)
{
TInterfaceBlock *interfaceBlock = leftType.getInterfaceBlock();
const int arrayIndex = node->getRight()->getAsConstantUnion()->getIConst(0);
- mReferencedInterfaceBlocks[interfaceBlock->instanceName()] =
+ mReferencedUniformBlocks[interfaceBlock->instanceName()] =
node->getLeft()->getAsSymbolNode();
- out << mUniformHLSL->interfaceBlockInstanceString(*interfaceBlock, arrayIndex);
+ out << mUniformHLSL->uniformBlockInstanceString(*interfaceBlock, arrayIndex);
return false;
}
}
@@ -1811,7 +1862,6 @@ bool OutputHLSL::visitAggregate(Visit visit, TIntermAggregate *node)
TVector<TIntermSymbol *> samplerSymbols;
TString structName = samplerNamePrefixFromStruct(typedArg);
argType.createSamplerSymbols("angle_" + structName, "",
- argType.isArray() ? argType.getArraySize() : 0u,
&samplerSymbols, nullptr);
for (const TIntermSymbol *sampler : samplerSymbols)
{
@@ -2557,33 +2607,29 @@ TString OutputHLSL::argumentString(const TIntermSymbol *symbol)
{
ASSERT(qualifier != EvqOut && qualifier != EvqInOut);
TVector<TIntermSymbol *> samplerSymbols;
- type.createSamplerSymbols("angle" + nameStr, "", type.isArray() ? type.getArraySize() : 0u,
- &samplerSymbols, nullptr);
+ type.createSamplerSymbols("angle" + nameStr, "", &samplerSymbols, nullptr);
for (const TIntermSymbol *sampler : samplerSymbols)
{
+ const TType &samplerType = sampler->getType();
if (mOutputType == SH_HLSL_4_1_OUTPUT)
{
- ASSERT(!sampler->getType().isArray());
- argString << ", const uint " << sampler->getSymbol();
+ argString << ", const uint " << sampler->getSymbol() << ArrayString(samplerType);
}
else if (mOutputType == SH_HLSL_4_0_FL9_3_OUTPUT)
{
- const TType &samplerType = sampler->getType();
- ASSERT(!samplerType.isArray());
ASSERT(IsSampler(samplerType.getBasicType()));
argString << ", " << QualifierString(qualifier) << " "
<< TextureString(samplerType.getBasicType()) << " texture_"
- << sampler->getSymbol() << ", " << QualifierString(qualifier) << " "
+ << sampler->getSymbol() << ArrayString(samplerType) << ", "
+ << QualifierString(qualifier) << " "
<< SamplerString(samplerType.getBasicType()) << " sampler_"
- << sampler->getSymbol();
+ << sampler->getSymbol() << ArrayString(samplerType);
}
else
{
- const TType &samplerType = sampler->getType();
- ASSERT(!samplerType.isArray());
ASSERT(IsSampler(samplerType.getBasicType()));
argString << ", " << QualifierString(qualifier) << " " << TypeString(samplerType)
- << " " << sampler->getSymbol();
+ << " " << sampler->getSymbol() << ArrayString(samplerType);
}
}
}
@@ -2722,31 +2768,33 @@ bool OutputHLSL::canWriteAsHLSLLiteral(TIntermTyped *expression)
{
// We support writing constant unions and constructors that only take constant unions as
// parameters as HLSL literals.
- return expression->getAsConstantUnion() ||
- expression->isConstructorWithOnlyConstantUnionParameters();
+ return !expression->getType().isArrayOfArrays() &&
+ (expression->getAsConstantUnion() ||
+ expression->isConstructorWithOnlyConstantUnionParameters());
}
bool OutputHLSL::writeConstantInitialization(TInfoSinkBase &out,
TIntermSymbol *symbolNode,
- TIntermTyped *expression)
+ TIntermTyped *initializer)
{
- if (canWriteAsHLSLLiteral(expression))
+ if (canWriteAsHLSLLiteral(initializer))
{
symbolNode->traverse(this);
- if (expression->getType().isArray())
+ ASSERT(!symbolNode->getType().isArrayOfArrays());
+ if (symbolNode->getType().isArray())
{
- out << "[" << expression->getType().getArraySize() << "]";
+ out << "[" << symbolNode->getType().getOutermostArraySize() << "]";
}
out << " = {";
- if (expression->getAsConstantUnion())
+ if (initializer->getAsConstantUnion())
{
- TIntermConstantUnion *nodeConst = expression->getAsConstantUnion();
+ TIntermConstantUnion *nodeConst = initializer->getAsConstantUnion();
const TConstantUnion *constUnion = nodeConst->getUnionArrayPointer();
writeConstantUnionArray(out, constUnion, nodeConst->getType().getObjectSize());
}
else
{
- TIntermAggregate *constructor = expression->getAsAggregate();
+ TIntermAggregate *constructor = initializer->getAsAggregate();
ASSERT(constructor != nullptr);
for (TIntermNode *&node : *constructor->getSequence())
{
@@ -2834,33 +2882,31 @@ TString OutputHLSL::addArrayEqualityFunction(const TType &type)
}
}
- const TString &typeName = TypeString(type);
+ TType elementType(type);
+ elementType.toArrayElementType();
ArrayHelperFunction *function = new ArrayHelperFunction();
function->type = type;
- TInfoSinkBase fnNameOut;
- fnNameOut << "angle_eq_" << type.getArraySize() << "_" << typeName;
- function->functionName = fnNameOut.c_str();
-
- TType nonArrayType = type;
- nonArrayType.clearArrayness();
+ function->functionName = ArrayHelperFunctionName("angle_eq", type);
TInfoSinkBase fnOut;
- fnOut << "bool " << function->functionName << "(" << typeName << " a[" << type.getArraySize()
- << "], " << typeName << " b[" << type.getArraySize() << "])\n"
+ const TString &typeName = TypeString(type);
+ fnOut << "bool " << function->functionName << "(" << typeName << " a" << ArrayString(type)
+ << ", " << typeName << " b" << ArrayString(type) << ")\n"
<< "{\n"
" for (int i = 0; i < "
- << type.getArraySize() << "; ++i)\n"
- " {\n"
- " if (";
+ << type.getOutermostArraySize()
+ << "; ++i)\n"
+ " {\n"
+ " if (";
- outputEqual(PreVisit, nonArrayType, EOpNotEqual, fnOut);
+ outputEqual(PreVisit, elementType, EOpNotEqual, fnOut);
fnOut << "a[i]";
- outputEqual(InVisit, nonArrayType, EOpNotEqual, fnOut);
+ outputEqual(InVisit, elementType, EOpNotEqual, fnOut);
fnOut << "b[i]";
- outputEqual(PostVisit, nonArrayType, EOpNotEqual, fnOut);
+ outputEqual(PostVisit, elementType, EOpNotEqual, fnOut);
fnOut << ") { return false; }\n"
" }\n"
@@ -2885,26 +2931,35 @@ TString OutputHLSL::addArrayAssignmentFunction(const TType &type)
}
}
- const TString &typeName = TypeString(type);
+ TType elementType(type);
+ elementType.toArrayElementType();
ArrayHelperFunction function;
function.type = type;
- TInfoSinkBase fnNameOut;
- fnNameOut << "angle_assign_" << type.getArraySize() << "_" << typeName;
- function.functionName = fnNameOut.c_str();
+ function.functionName = ArrayHelperFunctionName("angle_assign", type);
TInfoSinkBase fnOut;
- fnOut << "void " << function.functionName << "(out " << typeName << " a[" << type.getArraySize()
- << "], " << typeName << " b[" << type.getArraySize() << "])\n"
+ const TString &typeName = TypeString(type);
+ fnOut << "void " << function.functionName << "(out " << typeName << " a" << ArrayString(type)
+ << ", " << typeName << " b" << ArrayString(type) << ")\n"
<< "{\n"
" for (int i = 0; i < "
- << type.getArraySize() << "; ++i)\n"
- " {\n"
- " a[i] = b[i];\n"
- " }\n"
- "}\n";
+ << type.getOutermostArraySize()
+ << "; ++i)\n"
+ " {\n"
+ " ";
+
+ outputAssign(PreVisit, elementType, fnOut);
+ fnOut << "a[i]";
+ outputAssign(InVisit, elementType, fnOut);
+ fnOut << "b[i]";
+ outputAssign(PostVisit, elementType, fnOut);
+
+ fnOut << ";\n"
+ " }\n"
+ "}\n";
function.functionDefinition = fnOut.c_str();
@@ -2923,29 +2978,34 @@ TString OutputHLSL::addArrayConstructIntoFunction(const TType &type)
}
}
- const TString &typeName = TypeString(type);
+ TType elementType(type);
+ elementType.toArrayElementType();
ArrayHelperFunction function;
function.type = type;
- TInfoSinkBase fnNameOut;
- fnNameOut << "angle_construct_into_" << type.getArraySize() << "_" << typeName;
- function.functionName = fnNameOut.c_str();
+ function.functionName = ArrayHelperFunctionName("angle_construct_into", type);
TInfoSinkBase fnOut;
- fnOut << "void " << function.functionName << "(out " << typeName << " a[" << type.getArraySize()
- << "]";
- for (unsigned int i = 0u; i < type.getArraySize(); ++i)
+ const TString &typeName = TypeString(type);
+ fnOut << "void " << function.functionName << "(out " << typeName << " a" << ArrayString(type);
+ for (unsigned int i = 0u; i < type.getOutermostArraySize(); ++i)
{
- fnOut << ", " << typeName << " b" << i;
+ fnOut << ", " << typeName << " b" << i << ArrayString(elementType);
}
fnOut << ")\n"
"{\n";
- for (unsigned int i = 0u; i < type.getArraySize(); ++i)
+ for (unsigned int i = 0u; i < type.getOutermostArraySize(); ++i)
{
- fnOut << " a[" << i << "] = b" << i << ";\n";
+ fnOut << " ";
+ outputAssign(PreVisit, elementType, fnOut);
+ fnOut << "a[" << i << "]";
+ outputAssign(InVisit, elementType, fnOut);
+ fnOut << "b" << i;
+ outputAssign(PostVisit, elementType, fnOut);
+ fnOut << ";\n";
}
fnOut << "}\n";
diff --git a/chromium/third_party/angle/src/compiler/translator/OutputHLSL.h b/chromium/third_party/angle/src/compiler/translator/OutputHLSL.h
index 987d1283ff2..3784282bc97 100644
--- a/chromium/third_party/angle/src/compiler/translator/OutputHLSL.h
+++ b/chromium/third_party/angle/src/compiler/translator/OutputHLSL.h
@@ -43,7 +43,7 @@ class OutputHLSL : public TIntermTraverser
void output(TIntermNode *treeRoot, TInfoSinkBase &objSink);
- const std::map<std::string, unsigned int> &getInterfaceBlockRegisterMap() const;
+ const std::map<std::string, unsigned int> &getUniformBlockRegisterMap() const;
const std::map<std::string, unsigned int> &getUniformRegisterMap() const;
static TString initializer(const TType &type);
@@ -96,7 +96,6 @@ class OutputHLSL : public TIntermTraverser
const char *postString);
void outputLineDirective(TInfoSinkBase &out, int line);
TString argumentString(const TIntermSymbol *symbol);
- int vectorSize(const TType &type) const;
// Emit constructor. Called with literal names so using const char* instead of TString.
void outputConstructor(TInfoSinkBase &out,
@@ -109,6 +108,7 @@ class OutputHLSL : public TIntermTraverser
const TConstantUnion *constUnion);
void outputEqual(Visit visit, const TType &type, TOperator op, TInfoSinkBase &out);
+ void outputAssign(Visit visit, const TType &type, TInfoSinkBase &out);
void writeEmulatedFunctionTriplet(TInfoSinkBase &out, Visit visit, TOperator op);
void makeFlaggedStructMaps(const std::vector<TIntermTyped *> &flaggedStructs);
@@ -154,7 +154,7 @@ class OutputHLSL : public TIntermTraverser
std::stack<TInfoSinkBase *> mInfoSinkStack;
ReferencedSymbols mReferencedUniforms;
- ReferencedSymbols mReferencedInterfaceBlocks;
+ ReferencedSymbols mReferencedUniformBlocks;
ReferencedSymbols mReferencedAttributes;
ReferencedSymbols mReferencedVaryings;
ReferencedSymbols mReferencedOutputVariables;
@@ -172,6 +172,8 @@ class OutputHLSL : public TIntermTraverser
bool mUsesFrontFacing;
bool mUsesPointSize;
bool mUsesInstanceID;
+ bool mHasMultiviewExtensionEnabled;
+ bool mUsesViewID;
bool mUsesVertexID;
bool mUsesFragDepth;
bool mUsesNumWorkGroups;
@@ -197,9 +199,7 @@ class OutputHLSL : public TIntermTraverser
TIntermSymbol *mExcessiveLoopIndex;
- TString structInitializerString(int indent,
- const TStructure &structure,
- const TString &rhsStructName);
+ TString structInitializerString(int indent, const TType &type, const TString &name);
std::map<TIntermTyped *, TString> mFlaggedStructMappedNames;
std::map<TIntermTyped *, TString> mFlaggedStructOriginalNames;
diff --git a/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp b/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp
index ae445fd5566..4216a71465a 100644
--- a/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ParseContext.cpp
@@ -95,6 +95,27 @@ bool CanSetDefaultPrecisionOnType(const TPublicType &type)
return true;
}
+// Map input primitive types to input array sizes in a geometry shader.
+GLuint GetGeometryShaderInputArraySize(TLayoutPrimitiveType primitiveType)
+{
+ switch (primitiveType)
+ {
+ case EptPoints:
+ return 1u;
+ case EptLines:
+ return 2u;
+ case EptTriangles:
+ return 3u;
+ case EptLinesAdjacency:
+ return 4u;
+ case EptTrianglesAdjacency:
+ return 6u;
+ default:
+ UNREACHABLE();
+ return 0u;
+ }
+}
+
} // namespace
// This tracks each binding point's current default offset for inheritance of subsequent
@@ -178,7 +199,14 @@ TParseContext::TParseContext(TSymbolTable &symt,
mMaxUniformBufferBindings(resources.MaxUniformBufferBindings),
mMaxAtomicCounterBindings(resources.MaxAtomicCounterBindings),
mMaxShaderStorageBufferBindings(resources.MaxShaderStorageBufferBindings),
- mDeclaringFunction(false)
+ mDeclaringFunction(false),
+ mGeometryShaderInputPrimitiveType(EptUndefined),
+ mGeometryShaderOutputPrimitiveType(EptUndefined),
+ mGeometryShaderInvocations(0),
+ mGeometryShaderMaxVertices(-1),
+ mMaxGeometryShaderInvocations(resources.MaxGeometryShaderInvocations),
+ mMaxGeometryShaderMaxVertices(resources.MaxGeometryOutputVertices),
+ mGeometryShaderInputArraySize(0)
{
mComputeShaderLocalSize.fill(-1);
}
@@ -446,9 +474,10 @@ bool TParseContext::checkCanBeLValue(const TSourceLoc &line, const char *op, TIn
message = "can't modify an attribute";
break;
case EvqFragmentIn:
- message = "can't modify an input";
- break;
case EvqVertexIn:
+ case EvqFlatIn:
+ case EvqSmoothIn:
+ case EvqCentroidIn:
message = "can't modify an input";
break;
case EvqUniform:
@@ -490,6 +519,27 @@ bool TParseContext::checkCanBeLValue(const TSourceLoc &line, const char *op, TIn
case EvqComputeIn:
message = "can't modify work group size variable";
break;
+ case EvqPerVertexIn:
+ message = "can't modify any member in gl_in";
+ break;
+ case EvqPrimitiveIDIn:
+ message = "can't modify gl_PrimitiveIDIn";
+ break;
+ case EvqInvocationID:
+ message = "can't modify gl_InvocationID";
+ break;
+ case EvqPrimitiveID:
+ if (mShaderType == GL_FRAGMENT_SHADER)
+ {
+ message = "can't modify gl_PrimitiveID in a fragment shader";
+ }
+ break;
+ case EvqLayer:
+ if (mShaderType == GL_FRAGMENT_SHADER)
+ {
+ message = "can't modify gl_Layer in a fragment shader";
+ }
+ break;
default:
//
// Type that can't be written to?
@@ -649,7 +699,7 @@ bool TParseContext::checkConstructorArguments(const TSourceLoc &line,
{
// The size of an unsized constructor should already have been determined.
ASSERT(!type.isUnsizedArray());
- if (static_cast<size_t>(type.getArraySize()) != arguments->size())
+ if (static_cast<size_t>(type.getOutermostArraySize()) != arguments->size())
{
error(line, "array constructor needs one argument per array element", "constructor");
return false;
@@ -664,7 +714,7 @@ bool TParseContext::checkConstructorArguments(const TSourceLoc &line,
error(line, "constructing from a non-dereferenced array", "constructor");
return false;
}
- if (!argType.sameElementType(type))
+ if (!argType.isElementTypeOf(type))
{
error(line, "Array constructor argument has an incorrect type", "constructor");
return false;
@@ -937,40 +987,42 @@ bool TParseContext::checkIsValidQualifierForArray(const TSourceLoc &line,
}
// See if this element type can be formed into an array.
-bool TParseContext::checkIsValidTypeForArray(const TSourceLoc &line, const TPublicType &elementType)
+bool TParseContext::checkArrayElementIsNotArray(const TSourceLoc &line,
+ const TPublicType &elementType)
{
- //
- // Can the type be an array?
- //
if (elementType.array)
{
error(line, "cannot declare arrays of arrays",
TType(elementType).getCompleteString().c_str());
return false;
}
+ return true;
+}
+
+// Check if this qualified element type can be formed into an array. This is only called when array
+// brackets are associated with an identifier in a declaration, like this:
+// float a[2];
+// Similar checks are done in addFullySpecifiedType for array declarations where the array brackets
+// are associated with the type, like this:
+// float[2] a;
+bool TParseContext::checkIsValidTypeAndQualifierForArray(const TSourceLoc &indexLocation,
+ const TPublicType &elementType)
+{
+ if (!checkArrayElementIsNotArray(indexLocation, elementType))
+ {
+ return false;
+ }
// In ESSL1.00 shaders, structs cannot be varying (section 4.3.5). This is checked elsewhere.
// In ESSL3.00 shaders, struct inputs/outputs are allowed but not arrays of structs (section
// 4.3.4).
if (mShaderVersion >= 300 && elementType.getBasicType() == EbtStruct &&
sh::IsVarying(elementType.qualifier))
{
- error(line, "cannot declare arrays of structs of this qualifier",
+ error(indexLocation, "cannot declare arrays of structs of this qualifier",
TType(elementType).getCompleteString().c_str());
return false;
}
-
- return true;
-}
-
-// Check if this qualified element type can be formed into an array.
-bool TParseContext::checkIsValidTypeAndQualifierForArray(const TSourceLoc &indexLocation,
- const TPublicType &elementType)
-{
- if (checkIsValidTypeForArray(indexLocation, elementType))
- {
- return checkIsValidQualifierForArray(indexLocation, elementType);
- }
- return false;
+ return checkIsValidQualifierForArray(indexLocation, elementType);
}
// Enforce non-initializer type/qualifier rules.
@@ -1026,7 +1078,14 @@ bool TParseContext::declareVariable(const TSourceLoc &line,
{
const TVariable *maxDrawBuffers = static_cast<const TVariable *>(
symbolTable.findBuiltIn("gl_MaxDrawBuffers", mShaderVersion));
- if (static_cast<int>(type.getArraySize()) == maxDrawBuffers->getConstPointer()->getIConst())
+ if (type.isArrayOfArrays())
+ {
+ error(line, "redeclaration of gl_LastFragData as an array of arrays",
+ identifier.c_str());
+ return false;
+ }
+ else if (static_cast<int>(type.getOutermostArraySize()) ==
+ maxDrawBuffers->getConstPointer()->getIConst())
{
if (TSymbol *builtInSymbol = symbolTable.findBuiltIn(identifier, mShaderVersion))
{
@@ -1358,14 +1417,21 @@ void TParseContext::nonEmptyDeclarationErrorCheck(const TPublicType &publicType,
void TParseContext::checkBindingIsValid(const TSourceLoc &identifierLocation, const TType &type)
{
TLayoutQualifier layoutQualifier = type.getLayoutQualifier();
- int arraySize = type.isArray() ? type.getArraySize() : 1;
+ // Note that the ESSL 3.10 section 4.4.5 is not particularly clear on how the binding qualifier
+ // on arrays of arrays should be handled. We interpret the spec so that the binding value is
+ // incremented for each element of the innermost nested arrays. This is in line with how arrays
+ // of arrays of blocks are specified to behave in GLSL 4.50 and a conservative interpretation
+ // when it comes to which shaders are accepted by the compiler.
+ int arrayTotalElementCount = type.getArraySizeProduct();
if (IsImage(type.getBasicType()))
{
- checkImageBindingIsValid(identifierLocation, layoutQualifier.binding, arraySize);
+ checkImageBindingIsValid(identifierLocation, layoutQualifier.binding,
+ arrayTotalElementCount);
}
else if (IsSampler(type.getBasicType()))
{
- checkSamplerBindingIsValid(identifierLocation, layoutQualifier.binding, arraySize);
+ checkSamplerBindingIsValid(identifierLocation, layoutQualifier.binding,
+ arrayTotalElementCount);
}
else if (IsAtomicCounter(type.getBasicType()))
{
@@ -1437,10 +1503,12 @@ void TParseContext::checkOffsetIsNotSpecified(const TSourceLoc &location, int of
}
}
-void TParseContext::checkImageBindingIsValid(const TSourceLoc &location, int binding, int arraySize)
+void TParseContext::checkImageBindingIsValid(const TSourceLoc &location,
+ int binding,
+ int arrayTotalElementCount)
{
// Expects arraySize to be 1 when setting binding for only a single variable.
- if (binding >= 0 && binding + arraySize > mMaxImageUnits)
+ if (binding >= 0 && binding + arrayTotalElementCount > mMaxImageUnits)
{
error(location, "image binding greater than gl_MaxImageUnits", "binding");
}
@@ -1448,10 +1516,10 @@ void TParseContext::checkImageBindingIsValid(const TSourceLoc &location, int bin
void TParseContext::checkSamplerBindingIsValid(const TSourceLoc &location,
int binding,
- int arraySize)
+ int arrayTotalElementCount)
{
// Expects arraySize to be 1 when setting binding for only a single variable.
- if (binding >= 0 && binding + arraySize > mMaxCombinedTextureImageUnits)
+ if (binding >= 0 && binding + arrayTotalElementCount > mMaxCombinedTextureImageUnits)
{
error(location, "sampler binding greater than maximum texture units", "binding");
}
@@ -1742,6 +1810,13 @@ TIntermTyped *TParseContext::parseVariableIdentifier(const TSourceLoc &location,
type.setQualifier(EvqConst);
node = new TIntermConstantUnion(constArray, type);
}
+ // TODO(jiawei.shao@intel.com): set array sizes for user-defined geometry shader inputs.
+ else if (variable->getType().getQualifier() == EvqPerVertexIn)
+ {
+ TType type(variable->getType());
+ type.setArraySize(0, mGeometryShaderInputArraySize);
+ node = new TIntermSymbol(variable->getUniqueId(), variable->getName(), type);
+ }
else
{
node = new TIntermSymbol(variable->getUniqueId(), variable->getName(), variable->getType());
@@ -1768,17 +1843,11 @@ bool TParseContext::executeInitializer(const TSourceLoc &line,
TVariable *variable = nullptr;
if (type.isUnsizedArray())
{
- // We have not checked yet whether the initializer actually is an array or not.
- if (initializer->isArray())
- {
- type.setArraySize(initializer->getArraySize());
- }
- else
- {
- // Having a non-array initializer for an unsized array will result in an error later,
- // so we don't generate an error message here.
- type.setArraySize(1u);
- }
+ // In case initializer is not an array or type has more dimensions than initializer, this
+ // will default to setting array sizes to 1. We have not checked yet whether the initializer
+ // actually is an array or not. Having a non-array initializer for an unsized array will
+ // result in an error later, so we don't generate an error message here.
+ type.sizeUnsizedArrays(initializer->getType().getArraySizes());
}
if (!declareVariable(line, identifier, type, &variable))
{
@@ -2315,7 +2384,7 @@ TIntermDeclaration *TParseContext::parseSingleArrayDeclaration(TPublicType &publ
unsigned int size = checkIsValidArraySize(identifierLocation, indexExpression);
// Make the type an array even if size check failed.
// This ensures useless error messages regarding the variable's non-arrayness won't follow.
- arrayType.setArraySize(size);
+ arrayType.makeArray(size);
if (IsAtomicCounter(publicType.getBasicType()))
{
@@ -2526,7 +2595,7 @@ void TParseContext::parseArrayDeclarator(TPublicType &publicType,
{
TType arrayType = TType(publicType);
unsigned int size = checkIsValidArraySize(arrayLocation, indexExpression);
- arrayType.setArraySize(size);
+ arrayType.makeArray(size);
if (IsAtomicCounter(publicType.getBasicType()))
{
@@ -2654,6 +2723,143 @@ void TParseContext::parseDefaultPrecisionQualifier(const TPrecision precision,
symbolTable.setDefaultPrecision(type.getBasicType(), precision);
}
+bool TParseContext::checkPrimitiveTypeMatchesTypeQualifier(const TTypeQualifier &typeQualifier)
+{
+ switch (typeQualifier.layoutQualifier.primitiveType)
+ {
+ case EptLines:
+ case EptLinesAdjacency:
+ case EptTriangles:
+ case EptTrianglesAdjacency:
+ return typeQualifier.qualifier == EvqGeometryIn;
+
+ case EptLineStrip:
+ case EptTriangleStrip:
+ return typeQualifier.qualifier == EvqGeometryOut;
+
+ case EptPoints:
+ return true;
+
+ default:
+ UNREACHABLE();
+ return false;
+ }
+}
+
+void TParseContext::setGeometryShaderInputArraySizes()
+{
+ // TODO(jiawei.shao@intel.com): check former input array sizes match the input primitive
+ // declaration.
+ ASSERT(mGeometryShaderInputArraySize == 0);
+ mGeometryShaderInputArraySize =
+ GetGeometryShaderInputArraySize(mGeometryShaderInputPrimitiveType);
+}
+
+bool TParseContext::parseGeometryShaderInputLayoutQualifier(const TTypeQualifier &typeQualifier)
+{
+ ASSERT(typeQualifier.qualifier == EvqGeometryIn);
+
+ const TLayoutQualifier &layoutQualifier = typeQualifier.layoutQualifier;
+
+ if (layoutQualifier.maxVertices != -1)
+ {
+ error(typeQualifier.line,
+ "max_vertices can only be declared in 'out' layout in a geometry shader", "layout");
+ return false;
+ }
+
+ // Set mGeometryInputPrimitiveType if exists
+ if (layoutQualifier.primitiveType != EptUndefined)
+ {
+ if (!checkPrimitiveTypeMatchesTypeQualifier(typeQualifier))
+ {
+ error(typeQualifier.line, "invalid primitive type for 'in' layout", "layout");
+ return false;
+ }
+
+ if (mGeometryShaderInputPrimitiveType == EptUndefined)
+ {
+ mGeometryShaderInputPrimitiveType = layoutQualifier.primitiveType;
+ setGeometryShaderInputArraySizes();
+ }
+ else if (mGeometryShaderInputPrimitiveType != layoutQualifier.primitiveType)
+ {
+ error(typeQualifier.line, "primitive doesn't match earlier input primitive declaration",
+ "layout");
+ return false;
+ }
+ }
+
+ // Set mGeometryInvocations if exists
+ if (layoutQualifier.invocations > 0)
+ {
+ if (mGeometryShaderInvocations == 0)
+ {
+ mGeometryShaderInvocations = layoutQualifier.invocations;
+ }
+ else if (mGeometryShaderInvocations != layoutQualifier.invocations)
+ {
+ error(typeQualifier.line, "invocations contradicts to the earlier declaration",
+ "layout");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool TParseContext::parseGeometryShaderOutputLayoutQualifier(const TTypeQualifier &typeQualifier)
+{
+ ASSERT(typeQualifier.qualifier == EvqGeometryOut);
+
+ const TLayoutQualifier &layoutQualifier = typeQualifier.layoutQualifier;
+
+ if (layoutQualifier.invocations > 0)
+ {
+ error(typeQualifier.line,
+ "invocations can only be declared in 'in' layout in a geometry shader", "layout");
+ return false;
+ }
+
+ // Set mGeometryOutputPrimitiveType if exists
+ if (layoutQualifier.primitiveType != EptUndefined)
+ {
+ if (!checkPrimitiveTypeMatchesTypeQualifier(typeQualifier))
+ {
+ error(typeQualifier.line, "invalid primitive type for 'out' layout", "layout");
+ return false;
+ }
+
+ if (mGeometryShaderOutputPrimitiveType == EptUndefined)
+ {
+ mGeometryShaderOutputPrimitiveType = layoutQualifier.primitiveType;
+ }
+ else if (mGeometryShaderOutputPrimitiveType != layoutQualifier.primitiveType)
+ {
+ error(typeQualifier.line,
+ "primitive doesn't match earlier output primitive declaration", "layout");
+ return false;
+ }
+ }
+
+ // Set mGeometryMaxVertices if exists
+ if (layoutQualifier.maxVertices > -1)
+ {
+ if (mGeometryShaderMaxVertices == -1)
+ {
+ mGeometryShaderMaxVertices = layoutQualifier.maxVertices;
+ }
+ else if (mGeometryShaderMaxVertices != layoutQualifier.maxVertices)
+ {
+ error(typeQualifier.line, "max_vertices contradicts to the earlier declaration",
+ "layout");
+ return false;
+ }
+ }
+
+ return true;
+}
+
void TParseContext::parseGlobalLayoutQualifier(const TTypeQualifierBuilder &typeQualifierBuilder)
{
TTypeQualifier typeQualifier = typeQualifierBuilder.getVariableTypeQualifier(mDiagnostics);
@@ -2735,6 +2941,33 @@ void TParseContext::parseGlobalLayoutQualifier(const TTypeQualifierBuilder &type
mComputeShaderLocalSizeDeclared = true;
}
+ else if (typeQualifier.qualifier == EvqGeometryIn)
+ {
+ if (mShaderVersion < 310)
+ {
+ error(typeQualifier.line, "in type qualifier supported in GLSL ES 3.10 only", "layout");
+ return;
+ }
+
+ if (!parseGeometryShaderInputLayoutQualifier(typeQualifier))
+ {
+ return;
+ }
+ }
+ else if (typeQualifier.qualifier == EvqGeometryOut)
+ {
+ if (mShaderVersion < 310)
+ {
+ error(typeQualifier.line, "out type qualifier supported in GLSL ES 3.10 only",
+ "layout");
+ return;
+ }
+
+ if (!parseGeometryShaderOutputLayoutQualifier(typeQualifier))
+ {
+ return;
+ }
+ }
else if (isMultiviewExtensionEnabled() && typeQualifier.qualifier == EvqVertexIn)
{
// This error is only specified in WebGL, but tightens unspecified behavior in the native
@@ -2845,7 +3078,7 @@ TIntermFunctionPrototype *TParseContext::createPrototypeNodeFromFunction(
}
else
{
- error(location, "redefinition", variable->getName().c_str());
+ error(location, "redefinition", param.name->c_str());
}
}
}
@@ -3133,12 +3366,51 @@ TParameter TParseContext::parseParameterArrayDeclarator(const TString *identifie
const TSourceLoc &arrayLoc,
TPublicType *type)
{
- checkIsValidTypeForArray(arrayLoc, *type);
+ checkArrayElementIsNotArray(arrayLoc, *type);
unsigned int size = checkIsValidArraySize(arrayLoc, arraySize);
type->setArraySize(size);
return parseParameterDeclarator(*type, identifier, identifierLoc);
}
+bool TParseContext::checkUnsizedArrayConstructorArgumentDimensionality(TIntermSequence *arguments,
+ TType type,
+ const TSourceLoc &line)
+{
+ if (arguments->empty())
+ {
+ error(line, "implicitly sized array constructor must have at least one argument", "[]");
+ return false;
+ }
+ for (TIntermNode *arg : *arguments)
+ {
+ TIntermTyped *element = arg->getAsTyped();
+ ASSERT(element);
+ size_t dimensionalityFromElement = element->getType().getArraySizes().size() + 1u;
+ if (dimensionalityFromElement > type.getArraySizes().size())
+ {
+ error(line, "constructing from a non-dereferenced array", "constructor");
+ return false;
+ }
+ else if (dimensionalityFromElement < type.getArraySizes().size())
+ {
+ if (dimensionalityFromElement == 1u)
+ {
+ error(line, "implicitly sized array of arrays constructor argument is not an array",
+ "constructor");
+ }
+ else
+ {
+ error(line,
+ "implicitly sized array of arrays constructor argument dimensionality is too "
+ "low",
+ "constructor");
+ }
+ return false;
+ }
+ }
+ return true;
+}
+
// This function is used to test for the correctness of the parameters passed to various constructor
// functions and also convert them to the right datatype if it is allowed and required.
//
@@ -3150,13 +3422,23 @@ TIntermTyped *TParseContext::addConstructor(TIntermSequence *arguments,
{
if (type.isUnsizedArray())
{
- if (arguments->empty())
+ if (!checkUnsizedArrayConstructorArgumentDimensionality(arguments, type, line))
{
- error(line, "implicitly sized array constructor must have at least one argument", "[]");
- type.setArraySize(1u);
+ type.sizeUnsizedArrays(TVector<unsigned int>());
return CreateZeroNode(type);
}
- type.setArraySize(static_cast<unsigned int>(arguments->size()));
+ TIntermTyped *firstElement = arguments->at(0)->getAsTyped();
+ ASSERT(firstElement);
+ type.setArraySize(type.getArraySizes().size() - 1u,
+ static_cast<unsigned int>(arguments->size()));
+ for (size_t i = 0; i < firstElement->getType().getArraySizes().size(); ++i)
+ {
+ if (type.getArraySizes()[i] == 0u)
+ {
+ type.setArraySize(i, firstElement->getType().getArraySizes().at(i));
+ }
+ }
+ ASSERT(!type.isUnsizedArray());
}
if (!checkConstructorArguments(line, arguments, type))
@@ -3177,6 +3459,7 @@ TIntermTyped *TParseContext::addConstructor(TIntermSequence *arguments,
//
// Interface/uniform blocks
+// TODO(jiawei.shao@intel.com): implement GL_OES_shader_io_blocks.
//
TIntermDeclaration *TParseContext::addInterfaceBlock(
const TTypeQualifierBuilder &typeQualifierBuilder,
@@ -3357,9 +3640,12 @@ TIntermDeclaration *TParseContext::addInterfaceBlock(
}
TInterfaceBlock *interfaceBlock =
- new TInterfaceBlock(&blockName, fieldList, instanceName, arraySize, blockLayoutQualifier);
- TType interfaceBlockType(interfaceBlock, typeQualifier.qualifier, blockLayoutQualifier,
- arraySize);
+ new TInterfaceBlock(&blockName, fieldList, instanceName, blockLayoutQualifier);
+ TType interfaceBlockType(interfaceBlock, typeQualifier.qualifier, blockLayoutQualifier);
+ if (arrayIndex != nullptr)
+ {
+ interfaceBlockType.makeArray(arraySize);
+ }
TString symbolName = "";
int symbolId = 0;
@@ -3481,6 +3767,16 @@ TIntermTyped *TParseContext::addIndexExpression(TIntermTyped *baseExpression,
return CreateZeroNode(TType(EbtFloat, EbpHigh, EvqConst));
}
+ if (baseExpression->getQualifier() == EvqPerVertexIn)
+ {
+ ASSERT(mShaderType == GL_GEOMETRY_SHADER_OES);
+ if (mGeometryShaderInputPrimitiveType == EptUndefined)
+ {
+ error(location, "missing input primitive declaration before indexing gl_in.", "[");
+ return CreateZeroNode(TType(EbtFloat, EbpHigh, EvqConst));
+ }
+ }
+
TIntermConstantUnion *indexConstantUnion = indexExpression->getAsConstantUnion();
// TODO(oetuaho@nvidia.com): Get rid of indexConstantUnion == nullptr below once ANGLE is able
@@ -3491,9 +3787,23 @@ TIntermTyped *TParseContext::addIndexExpression(TIntermTyped *baseExpression,
{
if (baseExpression->isInterfaceBlock())
{
- error(location,
- "array indexes for interface blocks arrays must be constant integral expressions",
- "[");
+ // TODO(jiawei.shao@intel.com): implement GL_OES_shader_io_blocks.
+ switch (baseExpression->getQualifier())
+ {
+ case EvqPerVertexIn:
+ break;
+ case EvqUniform:
+ case EvqBuffer:
+ error(location,
+ "array indexes for uniform block arrays and shader storage block arrays "
+ "must be constant integral expressions",
+ "[");
+ break;
+ default:
+ // We can reach here only in error cases.
+ ASSERT(mDiagnostics->numErrors() > 0);
+ break;
+ }
}
else if (baseExpression->getQualifier() == EvqFragmentOut)
{
@@ -3543,7 +3853,7 @@ TIntermTyped *TParseContext::addIndexExpression(TIntermTyped *baseExpression,
if (safeIndex < 0)
{
safeIndex = checkIndexOutOfRange(outOfRangeIndexIsError, location, index,
- baseExpression->getArraySize(),
+ baseExpression->getOutermostArraySize(),
"array index out of range");
}
}
@@ -3833,6 +4143,48 @@ TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierTyp
checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
qualifier.imageInternalFormat = EiifR32UI;
}
+ else if (qualifierType == "points" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
+ qualifier.primitiveType = EptPoints;
+ }
+ else if (qualifierType == "lines" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
+ qualifier.primitiveType = EptLines;
+ }
+ else if (qualifierType == "lines_adjacency" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
+ qualifier.primitiveType = EptLinesAdjacency;
+ }
+ else if (qualifierType == "triangles" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
+ qualifier.primitiveType = EptTriangles;
+ }
+ else if (qualifierType == "triangles_adjacency" &&
+ isExtensionEnabled("GL_OES_geometry_shader") && mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
+ qualifier.primitiveType = EptTrianglesAdjacency;
+ }
+ else if (qualifierType == "line_strip" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
+ qualifier.primitiveType = EptLineStrip;
+ }
+ else if (qualifierType == "triangle_strip" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ checkLayoutQualifierSupported(qualifierTypeLine, qualifierType, 310);
+ qualifier.primitiveType = EptTriangleStrip;
+ }
else
{
@@ -3875,6 +4227,46 @@ void TParseContext::parseNumViews(int intValue,
*numViews = intValue;
}
+void TParseContext::parseInvocations(int intValue,
+ const TSourceLoc &intValueLine,
+ const std::string &intValueString,
+ int *numInvocations)
+{
+ // Although SPEC isn't clear whether invocations can be less than 1, we add this limit because
+ // it doesn't make sense to accept invocations <= 0.
+ if (intValue < 1 || intValue > mMaxGeometryShaderInvocations)
+ {
+ error(intValueLine,
+ "out of range: invocations must be in the range of [1, "
+ "MAX_GEOMETRY_SHADER_INVOCATIONS_OES]",
+ intValueString.c_str());
+ }
+ else
+ {
+ *numInvocations = intValue;
+ }
+}
+
+void TParseContext::parseMaxVertices(int intValue,
+ const TSourceLoc &intValueLine,
+ const std::string &intValueString,
+ int *maxVertices)
+{
+ // Although SPEC isn't clear whether max_vertices can be less than 0, we add this limit because
+ // it doesn't make sense to accept max_vertices < 0.
+ if (intValue < 0 || intValue > mMaxGeometryShaderMaxVertices)
+ {
+ error(
+ intValueLine,
+ "out of range: max_vertices must be in the range of [0, gl_MaxGeometryOutputVertices]",
+ intValueString.c_str());
+ }
+ else
+ {
+ *maxVertices = intValue;
+ }
+}
+
TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierType,
const TSourceLoc &qualifierTypeLine,
int intValue,
@@ -3944,6 +4336,17 @@ TLayoutQualifier TParseContext::parseLayoutQualifier(const TString &qualifierTyp
{
parseNumViews(intValue, intValueLine, intValueString, &qualifier.numViews);
}
+ else if (qualifierType == "invocations" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ parseInvocations(intValue, intValueLine, intValueString, &qualifier.invocations);
+ }
+ else if (qualifierType == "max_vertices" && isExtensionEnabled("GL_OES_geometry_shader") &&
+ mShaderType == GL_GEOMETRY_SHADER_OES)
+ {
+ parseMaxVertices(intValue, intValueLine, intValueString, &qualifier.maxVertices);
+ }
+
else
{
error(qualifierTypeLine, "invalid layout qualifier", qualifierType.c_str());
@@ -3981,23 +4384,39 @@ TStorageQualifierWrapper *TParseContext::parseInQualifier(const TSourceLoc &loc)
{
return new TStorageQualifierWrapper(EvqIn, loc);
}
- if (getShaderType() == GL_FRAGMENT_SHADER)
+
+ switch (getShaderType())
{
- if (mShaderVersion < 300)
+ case GL_VERTEX_SHADER:
+ {
+ if (mShaderVersion < 300 && !isMultiviewExtensionEnabled())
+ {
+ error(loc, "storage qualifier supported in GLSL ES 3.00 and above only", "in");
+ }
+ return new TStorageQualifierWrapper(EvqVertexIn, loc);
+ }
+ case GL_FRAGMENT_SHADER:
{
- error(loc, "storage qualifier supported in GLSL ES 3.00 and above only", "in");
+ if (mShaderVersion < 300)
+ {
+ error(loc, "storage qualifier supported in GLSL ES 3.00 and above only", "in");
+ }
+ return new TStorageQualifierWrapper(EvqFragmentIn, loc);
}
- return new TStorageQualifierWrapper(EvqFragmentIn, loc);
- }
- if (getShaderType() == GL_VERTEX_SHADER)
- {
- if (mShaderVersion < 300 && !isMultiviewExtensionEnabled())
+ case GL_COMPUTE_SHADER:
+ {
+ return new TStorageQualifierWrapper(EvqComputeIn, loc);
+ }
+ case GL_GEOMETRY_SHADER_OES:
{
- error(loc, "storage qualifier supported in GLSL ES 3.00 and above only", "in");
+ return new TStorageQualifierWrapper(EvqGeometryIn, loc);
+ }
+ default:
+ {
+ UNREACHABLE();
+ return new TStorageQualifierWrapper(EvqLast, loc);
}
- return new TStorageQualifierWrapper(EvqVertexIn, loc);
}
- return new TStorageQualifierWrapper(EvqComputeIn, loc);
}
TStorageQualifierWrapper *TParseContext::parseOutQualifier(const TSourceLoc &loc)
@@ -4006,19 +4425,39 @@ TStorageQualifierWrapper *TParseContext::parseOutQualifier(const TSourceLoc &loc
{
return new TStorageQualifierWrapper(EvqOut, loc);
}
- if (mShaderVersion < 300)
- {
- error(loc, "storage qualifier supported in GLSL ES 3.00 and above only", "out");
- }
- if (getShaderType() != GL_VERTEX_SHADER && getShaderType() != GL_FRAGMENT_SHADER)
- {
- error(loc, "storage qualifier supported in vertex and fragment shaders only", "out");
- }
- if (getShaderType() == GL_VERTEX_SHADER)
+ switch (getShaderType())
{
- return new TStorageQualifierWrapper(EvqVertexOut, loc);
+ case GL_VERTEX_SHADER:
+ {
+ if (mShaderVersion < 300)
+ {
+ error(loc, "storage qualifier supported in GLSL ES 3.00 and above only", "out");
+ }
+ return new TStorageQualifierWrapper(EvqVertexOut, loc);
+ }
+ case GL_FRAGMENT_SHADER:
+ {
+ if (mShaderVersion < 300)
+ {
+ error(loc, "storage qualifier supported in GLSL ES 3.00 and above only", "out");
+ }
+ return new TStorageQualifierWrapper(EvqFragmentOut, loc);
+ }
+ case GL_COMPUTE_SHADER:
+ {
+ error(loc, "storage qualifier isn't supported in compute shaders", "out");
+ return new TStorageQualifierWrapper(EvqLast, loc);
+ }
+ case GL_GEOMETRY_SHADER_OES:
+ {
+ return new TStorageQualifierWrapper(EvqGeometryOut, loc);
+ }
+ default:
+ {
+ UNREACHABLE();
+ return new TStorageQualifierWrapper(EvqLast, loc);
+ }
}
- return new TStorageQualifierWrapper(EvqFragmentOut, loc);
}
TStorageQualifierWrapper *TParseContext::parseInOutQualifier(const TSourceLoc &loc)
@@ -4054,7 +4493,7 @@ TField *TParseContext::parseStructArrayDeclarator(TString *identifier,
TType *type = new TType(EbtVoid, EbpUndefined);
unsigned int size = checkIsValidArraySize(arraySizeLoc, arraySize);
- type->setArraySize(size);
+ type->makeArray(size);
return new TField(type, identifier, loc);
}
@@ -4096,46 +4535,36 @@ TFieldList *TParseContext::addStructDeclaratorListWithQualifiers(
}
TFieldList *TParseContext::addStructDeclaratorList(const TPublicType &typeSpecifier,
- TFieldList *fieldList)
+ TFieldList *declaratorList)
{
checkPrecisionSpecified(typeSpecifier.getLine(), typeSpecifier.precision,
typeSpecifier.getBasicType());
- checkIsNonVoid(typeSpecifier.getLine(), (*fieldList)[0]->name(), typeSpecifier.getBasicType());
+ checkIsNonVoid(typeSpecifier.getLine(), (*declaratorList)[0]->name(),
+ typeSpecifier.getBasicType());
checkWorkGroupSizeIsNotSpecified(typeSpecifier.getLine(), typeSpecifier.layoutQualifier);
- for (unsigned int i = 0; i < fieldList->size(); ++i)
+ for (unsigned int i = 0; i < declaratorList->size(); ++i)
{
- //
- // Careful not to replace already known aspects of type, like array-ness
- //
- TType *type = (*fieldList)[i]->type();
- type->setBasicType(typeSpecifier.getBasicType());
- type->setPrimarySize(typeSpecifier.getPrimarySize());
- type->setSecondarySize(typeSpecifier.getSecondarySize());
- type->setPrecision(typeSpecifier.precision);
- type->setQualifier(typeSpecifier.qualifier);
- type->setLayoutQualifier(typeSpecifier.layoutQualifier);
- type->setMemoryQualifier(typeSpecifier.memoryQualifier);
- type->setInvariant(typeSpecifier.invariant);
-
+ auto declaratorArraySizes = (*declaratorList)[i]->type()->getArraySizes();
// don't allow arrays of arrays
- if (type->isArray())
+ if (!declaratorArraySizes.empty())
{
- checkIsValidTypeForArray(typeSpecifier.getLine(), typeSpecifier);
+ checkArrayElementIsNotArray(typeSpecifier.getLine(), typeSpecifier);
}
- if (typeSpecifier.array)
- type->setArraySize(static_cast<unsigned int>(typeSpecifier.arraySize));
- if (typeSpecifier.getUserDef())
+
+ TType *type = (*declaratorList)[i]->type();
+ *type = TType(typeSpecifier);
+ for (unsigned int arraySize : declaratorArraySizes)
{
- type->setStruct(typeSpecifier.getUserDef());
+ type->makeArray(arraySize);
}
- checkIsBelowStructNestingLimit(typeSpecifier.getLine(), *(*fieldList)[i]);
+ checkIsBelowStructNestingLimit(typeSpecifier.getLine(), *(*declaratorList)[i]);
}
- return fieldList;
+ return declaratorList;
}
TTypeSpecifierNonArray TParseContext::addStructure(const TSourceLoc &structLine,
@@ -4446,7 +4875,7 @@ bool TParseContext::binaryOpCommonCheck(TOperator op,
return false;
}
// At this point, size of implicitly sized arrays should be resolved.
- if (left->getArraySize() != right->getArraySize())
+ if (left->getType().getArraySizes() != right->getType().getArraySizes())
{
error(loc, "array size mismatch", GetOperatorString(op));
return false;
@@ -5037,9 +5466,14 @@ TIntermTyped *TParseContext::addMethod(TFunction *fnCall,
{
error(loc, "length can only be called on arrays", "length");
}
+ else if (typedThis->getQualifier() == EvqPerVertexIn &&
+ mGeometryShaderInputPrimitiveType == EptUndefined)
+ {
+ error(loc, "missing input primitive declaration before calling length on gl_in", "length");
+ }
else
{
- arraySize = typedThis->getArraySize();
+ arraySize = typedThis->getOutermostArraySize();
if (typedThis->getAsSymbolNode() == nullptr)
{
// This code path can be hit with expressions like these:
diff --git a/chromium/third_party/angle/src/compiler/translator/ParseContext.h b/chromium/third_party/angle/src/compiler/translator/ParseContext.h
index 6c3a50e9e20..784de139605 100644
--- a/chromium/third_party/angle/src/compiler/translator/ParseContext.h
+++ b/chromium/third_party/angle/src/compiler/translator/ParseContext.h
@@ -125,7 +125,7 @@ class TParseContext : angle::NonCopyable
// Returns a sanitized array size to use (the size is at least 1).
unsigned int checkIsValidArraySize(const TSourceLoc &line, TIntermTyped *expr);
bool checkIsValidQualifierForArray(const TSourceLoc &line, const TPublicType &elementQualifier);
- bool checkIsValidTypeForArray(const TSourceLoc &line, const TPublicType &elementType);
+ bool checkArrayElementIsNotArray(const TSourceLoc &line, const TPublicType &elementType);
bool checkIsNonVoid(const TSourceLoc &line, const TString &identifier, const TBasicType &type);
bool checkIsScalarBool(const TSourceLoc &line, const TIntermTyped *type);
void checkIsScalarBool(const TSourceLoc &line, const TPublicType &pType);
@@ -340,6 +340,14 @@ class TParseContext : angle::NonCopyable
const TSourceLoc &intValueLine,
const std::string &intValueString,
int *numViews);
+ void parseInvocations(int intValue,
+ const TSourceLoc &intValueLine,
+ const std::string &intValueString,
+ int *numInvocations);
+ void parseMaxVertices(int intValue,
+ const TSourceLoc &intValueLine,
+ const std::string &intValueString,
+ int *numMaxVertices);
TLayoutQualifier parseLayoutQualifier(const TString &qualifierType,
const TSourceLoc &qualifierTypeLine);
TLayoutQualifier parseLayoutQualifier(const TString &qualifierType,
@@ -407,6 +415,20 @@ class TParseContext : angle::NonCopyable
TIntermTyped *falseExpression,
const TSourceLoc &line);
+ int getGeometryShaderMaxVertices() const { return mGeometryShaderMaxVertices; }
+ int getGeometryShaderInvocations() const
+ {
+ return (mGeometryShaderInvocations > 0) ? mGeometryShaderInvocations : 1;
+ }
+ TLayoutPrimitiveType getGeometryShaderInputPrimitiveType() const
+ {
+ return mGeometryShaderInputPrimitiveType;
+ }
+ TLayoutPrimitiveType getGeometryShaderOutputPrimitiveType() const
+ {
+ return mGeometryShaderOutputPrimitiveType;
+ }
+
// TODO(jmadill): make this private
TSymbolTable &symbolTable; // symbol table that goes with the language currently being parsed
@@ -462,8 +484,12 @@ class TParseContext : angle::NonCopyable
void checkBindingIsValid(const TSourceLoc &identifierLocation, const TType &type);
void checkBindingIsNotSpecified(const TSourceLoc &location, int binding);
void checkOffsetIsNotSpecified(const TSourceLoc &location, int offset);
- void checkImageBindingIsValid(const TSourceLoc &location, int binding, int arraySize);
- void checkSamplerBindingIsValid(const TSourceLoc &location, int binding, int arraySize);
+ void checkImageBindingIsValid(const TSourceLoc &location,
+ int binding,
+ int arrayTotalElementCount);
+ void checkSamplerBindingIsValid(const TSourceLoc &location,
+ int binding,
+ int arrayTotalElementCount);
void checkBlockBindingIsValid(const TSourceLoc &location,
const TQualifier &qualifier,
int binding,
@@ -476,6 +502,10 @@ class TParseContext : angle::NonCopyable
void checkYuvIsNotSpecified(const TSourceLoc &location, bool yuv);
+ bool checkUnsizedArrayConstructorArgumentDimensionality(TIntermSequence *arguments,
+ TType type,
+ const TSourceLoc &line);
+
TIntermTyped *addBinaryMathInternal(TOperator op,
TIntermTyped *left,
TIntermTyped *right,
@@ -510,6 +540,11 @@ class TParseContext : angle::NonCopyable
void setAtomicCounterBindingDefaultOffset(const TPublicType &declaration,
const TSourceLoc &location);
+ bool checkPrimitiveTypeMatchesTypeQualifier(const TTypeQualifier &typeQualifier);
+ bool parseGeometryShaderInputLayoutQualifier(const TTypeQualifier &typeQualifier);
+ bool parseGeometryShaderOutputLayoutQualifier(const TTypeQualifier &typeQualifier);
+ void setGeometryShaderInputArraySizes();
+
// Set to true when the last/current declarator list was started with an empty declaration. The
// non-empty declaration error check will need to be performed if the empty declaration is
// followed by a declarator.
@@ -566,6 +601,16 @@ class TParseContext : angle::NonCopyable
// Track the state of each atomic counter binding.
std::map<int, AtomicCounterBindingState> mAtomicCounterBindingStates;
+
+ // Track the geometry shader global parameters declared in layout.
+ TLayoutPrimitiveType mGeometryShaderInputPrimitiveType;
+ TLayoutPrimitiveType mGeometryShaderOutputPrimitiveType;
+ int mGeometryShaderInvocations;
+ int mGeometryShaderMaxVertices;
+ int mMaxGeometryShaderInvocations;
+ int mMaxGeometryShaderMaxVertices;
+ int mGeometryShaderInputArraySize; // Track if all input array sizes are same and matches the
+ // latter input primitive declaration.
};
int PaParseStrings(size_t count,
diff --git a/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp b/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp
index 4d7b206c3e3..ca45c880b0e 100644
--- a/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/QualifierTypes.cpp
@@ -606,6 +606,42 @@ TLayoutQualifier JoinLayoutQualifiers(TLayoutQualifier leftQualifier,
joinedQualifier.imageInternalFormat = rightQualifier.imageInternalFormat;
}
+ if (rightQualifier.primitiveType != EptUndefined)
+ {
+ if (joinedQualifier.primitiveType != EptUndefined &&
+ joinedQualifier.primitiveType != rightQualifier.primitiveType)
+ {
+ diagnostics->error(rightQualifierLocation,
+ "Cannot have multiple different primitive specifiers",
+ getGeometryShaderPrimitiveTypeString(rightQualifier.primitiveType));
+ }
+ joinedQualifier.primitiveType = rightQualifier.primitiveType;
+ }
+
+ if (rightQualifier.invocations != 0)
+ {
+ if (joinedQualifier.invocations != 0 &&
+ joinedQualifier.invocations != rightQualifier.invocations)
+ {
+ diagnostics->error(rightQualifierLocation,
+ "Cannot have multiple different invocations specifiers",
+ "invocations");
+ }
+ joinedQualifier.invocations = rightQualifier.invocations;
+ }
+
+ if (rightQualifier.maxVertices != -1)
+ {
+ if (joinedQualifier.maxVertices != -1 &&
+ joinedQualifier.maxVertices != rightQualifier.maxVertices)
+ {
+ diagnostics->error(rightQualifierLocation,
+ "Cannot have multiple different max_vertices specifiers",
+ "max_vertices");
+ }
+ joinedQualifier.maxVertices = rightQualifier.maxVertices;
+ }
+
return joinedQualifier;
}
diff --git a/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp b/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp
index b0c0fdeb33c..c1085de07ba 100644
--- a/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/RemoveDynamicIndexing.cpp
@@ -57,25 +57,26 @@ std::string GetIndexFunctionName(const TType &type, bool write)
return nameSink.str();
}
-TIntermSymbol *CreateBaseSymbol(const TType &type, TQualifier qualifier)
+TIntermSymbol *CreateBaseSymbol(const TType &type, TQualifier qualifier, TSymbolTable *symbolTable)
{
- TIntermSymbol *symbol = new TIntermSymbol(0, "base", type);
+ TIntermSymbol *symbol = new TIntermSymbol(symbolTable->nextUniqueId(), "base", type);
symbol->setInternal(true);
symbol->getTypePointer()->setQualifier(qualifier);
return symbol;
}
-TIntermSymbol *CreateIndexSymbol()
+TIntermSymbol *CreateIndexSymbol(TSymbolTable *symbolTable)
{
- TIntermSymbol *symbol = new TIntermSymbol(0, "index", TType(EbtInt, EbpHigh));
+ TIntermSymbol *symbol =
+ new TIntermSymbol(symbolTable->nextUniqueId(), "index", TType(EbtInt, EbpHigh));
symbol->setInternal(true);
symbol->getTypePointer()->setQualifier(EvqIn);
return symbol;
}
-TIntermSymbol *CreateValueSymbol(const TType &type)
+TIntermSymbol *CreateValueSymbol(const TType &type, TSymbolTable *symbolTable)
{
- TIntermSymbol *symbol = new TIntermSymbol(0, "value", type);
+ TIntermSymbol *symbol = new TIntermSymbol(symbolTable->nextUniqueId(), "value", type);
symbol->setInternal(true);
symbol->getTypePointer()->setQualifier(EvqIn);
return symbol;
@@ -88,22 +89,6 @@ TIntermConstantUnion *CreateIntConstantNode(int i)
return new TIntermConstantUnion(constant, TType(EbtInt, EbpHigh));
}
-TIntermBinary *CreateIndexDirectBaseSymbolNode(const TType &indexedType,
- const TType &fieldType,
- const int index,
- TQualifier baseQualifier)
-{
- TIntermSymbol *baseSymbol = CreateBaseSymbol(indexedType, baseQualifier);
- TIntermBinary *indexNode =
- new TIntermBinary(EOpIndexDirect, baseSymbol, CreateIndexNode(index));
- return indexNode;
-}
-
-TIntermBinary *CreateAssignValueSymbolNode(TIntermTyped *targetNode, const TType &assignedValueType)
-{
- return new TIntermBinary(EOpAssign, targetNode, CreateValueSymbol(assignedValueType));
-}
-
TIntermTyped *EnsureSignedInt(TIntermTyped *node)
{
if (node->getBasicType() == EbtInt)
@@ -173,7 +158,8 @@ TType GetFieldType(const TType &indexedType)
// Note that else is not used in above functions to avoid the RewriteElseBlocks transformation.
TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type,
bool write,
- const TSymbolUniqueId &functionId)
+ const TSymbolUniqueId &functionId,
+ TSymbolTable *symbolTable)
{
ASSERT(!type.isArray());
// Conservatively use highp here, even if the indexed type is not highp. That way the code can't
@@ -206,13 +192,14 @@ TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type,
TQualifier baseQualifier = EvqInOut;
if (!write)
baseQualifier = EvqIn;
- TIntermSymbol *baseParam = CreateBaseSymbol(type, baseQualifier);
+ TIntermSymbol *baseParam = CreateBaseSymbol(type, baseQualifier, symbolTable);
prototypeNode->getSequence()->push_back(baseParam);
- TIntermSymbol *indexParam = CreateIndexSymbol();
+ TIntermSymbol *indexParam = CreateIndexSymbol(symbolTable);
prototypeNode->getSequence()->push_back(indexParam);
+ TIntermSymbol *valueParam = nullptr;
if (write)
{
- TIntermSymbol *valueParam = CreateValueSymbol(fieldType);
+ valueParam = CreateValueSymbol(fieldType, symbolTable);
prototypeNode->getSequence()->push_back(valueParam);
}
@@ -223,10 +210,11 @@ TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type,
statementList->getSequence()->push_back(caseNode);
TIntermBinary *indexNode =
- CreateIndexDirectBaseSymbolNode(type, fieldType, i, baseQualifier);
+ new TIntermBinary(EOpIndexDirect, baseParam->deepCopy(), CreateIndexNode(i));
if (write)
{
- TIntermBinary *assignNode = CreateAssignValueSymbolNode(indexNode, fieldType);
+ TIntermBinary *assignNode =
+ new TIntermBinary(EOpAssign, indexNode, valueParam->deepCopy());
statementList->getSequence()->push_back(assignNode);
TIntermBranch *returnNode = new TIntermBranch(EOpReturn, nullptr);
statementList->getSequence()->push_back(returnNode);
@@ -244,13 +232,13 @@ TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type,
TIntermBranch *breakNode = new TIntermBranch(EOpBreak, nullptr);
statementList->getSequence()->push_back(breakNode);
- TIntermSwitch *switchNode = new TIntermSwitch(CreateIndexSymbol(), statementList);
+ TIntermSwitch *switchNode = new TIntermSwitch(indexParam->deepCopy(), statementList);
TIntermBlock *bodyNode = new TIntermBlock();
bodyNode->getSequence()->push_back(switchNode);
TIntermBinary *cond =
- new TIntermBinary(EOpLessThan, CreateIndexSymbol(), CreateIntConstantNode(0));
+ new TIntermBinary(EOpLessThan, indexParam->deepCopy(), CreateIntConstantNode(0));
cond->setType(TType(EbtBool, EbpUndefined));
// Two blocks: one accesses (either reads or writes) the first element and returns,
@@ -258,17 +246,19 @@ TIntermFunctionDefinition *GetIndexFunctionDefinition(TType type,
TIntermBlock *useFirstBlock = new TIntermBlock();
TIntermBlock *useLastBlock = new TIntermBlock();
TIntermBinary *indexFirstNode =
- CreateIndexDirectBaseSymbolNode(type, fieldType, 0, baseQualifier);
+ new TIntermBinary(EOpIndexDirect, baseParam->deepCopy(), CreateIndexNode(0));
TIntermBinary *indexLastNode =
- CreateIndexDirectBaseSymbolNode(type, fieldType, numCases - 1, baseQualifier);
+ new TIntermBinary(EOpIndexDirect, baseParam->deepCopy(), CreateIndexNode(numCases - 1));
if (write)
{
- TIntermBinary *assignFirstNode = CreateAssignValueSymbolNode(indexFirstNode, fieldType);
+ TIntermBinary *assignFirstNode =
+ new TIntermBinary(EOpAssign, indexFirstNode, valueParam->deepCopy());
useFirstBlock->getSequence()->push_back(assignFirstNode);
TIntermBranch *returnNode = new TIntermBranch(EOpReturn, nullptr);
useFirstBlock->getSequence()->push_back(returnNode);
- TIntermBinary *assignLastNode = CreateAssignValueSymbolNode(indexLastNode, fieldType);
+ TIntermBinary *assignLastNode =
+ new TIntermBinary(EOpAssign, indexLastNode, valueParam->deepCopy());
useLastBlock->getSequence()->push_back(assignLastNode);
}
else
@@ -332,11 +322,13 @@ void RemoveDynamicIndexingTraverser::insertHelperDefinitions(TIntermNode *root)
TIntermSequence insertions;
for (auto &type : mIndexedVecAndMatrixTypes)
{
- insertions.push_back(GetIndexFunctionDefinition(type.first, false, *type.second));
+ insertions.push_back(
+ GetIndexFunctionDefinition(type.first, false, *type.second, mSymbolTable));
}
for (auto &type : mWrittenVecAndMatrixTypes)
{
- insertions.push_back(GetIndexFunctionDefinition(type.first, true, *type.second));
+ insertions.push_back(
+ GetIndexFunctionDefinition(type.first, true, *type.second, mSymbolTable));
}
mInsertions.push_back(NodeInsertMultipleEntry(rootBlock, 0, insertions, TIntermSequence()));
}
diff --git a/chromium/third_party/angle/src/compiler/translator/RewriteDoWhile.cpp b/chromium/third_party/angle/src/compiler/translator/RewriteDoWhile.cpp
index 69597a374d8..dc3fb7a74eb 100644
--- a/chromium/third_party/angle/src/compiler/translator/RewriteDoWhile.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/RewriteDoWhile.cpp
@@ -44,7 +44,9 @@ namespace
class DoWhileRewriter : public TIntermTraverser
{
public:
- DoWhileRewriter(const TSymbolTable *symbolTable) : TIntermTraverser(true, false, false) {}
+ DoWhileRewriter(TSymbolTable *symbolTable) : TIntermTraverser(true, false, false, symbolTable)
+ {
+ }
bool visitBlock(Visit, TIntermBlock *node) override
{
@@ -67,6 +69,9 @@ class DoWhileRewriter : public TIntermTraverser
continue;
}
+ // Found a loop to change.
+ nextTemporaryId();
+
TType boolType = TType(EbtBool);
// bool temp = false;
@@ -137,8 +142,6 @@ class DoWhileRewriter : public TIntermTraverser
replacement.push_back(newLoop);
node->replaceChildNodeWithMultiple(loop, replacement);
-
- nextTemporaryId();
}
return true;
}
diff --git a/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp b/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp
index 08c4bbf7088..75e5490af43 100644
--- a/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ShaderLang.cpp
@@ -45,7 +45,20 @@ const std::vector<Uniform> *GetVariableList(const TCompiler *compiler)
template <>
const std::vector<Varying> *GetVariableList(const TCompiler *compiler)
{
- return &compiler->getVaryings();
+ switch (compiler->getShaderType())
+ {
+ case GL_VERTEX_SHADER:
+ return &compiler->getOutputVaryings();
+ case GL_FRAGMENT_SHADER:
+ return &compiler->getInputVaryings();
+ case GL_COMPUTE_SHADER:
+ ASSERT(compiler->getOutputVaryings().empty() && compiler->getInputVaryings().empty());
+ return &compiler->getOutputVaryings();
+ // Since geometry shaders have both input and output varyings, we shouldn't call GetVaryings
+ // on a geometry shader.
+ default:
+ return nullptr;
+ }
}
template <>
@@ -66,8 +79,7 @@ const std::vector<InterfaceBlock> *GetVariableList(const TCompiler *compiler)
return &compiler->getInterfaceBlocks();
}
-template <typename VarT>
-const std::vector<VarT> *GetShaderVariables(const ShHandle handle)
+TCompiler *GetCompilerFromHandle(ShHandle handle)
{
if (!handle)
{
@@ -75,7 +87,13 @@ const std::vector<VarT> *GetShaderVariables(const ShHandle handle)
}
TShHandleBase *base = static_cast<TShHandleBase *>(handle);
- TCompiler *compiler = base->getAsCompiler();
+ return base->getAsCompiler();
+}
+
+template <typename VarT>
+const std::vector<VarT> *GetShaderVariables(const ShHandle handle)
+{
+ TCompiler *compiler = GetCompilerFromHandle(handle);
if (!compiler)
{
return nullptr;
@@ -84,14 +102,6 @@ const std::vector<VarT> *GetShaderVariables(const ShHandle handle)
return GetVariableList<VarT>(compiler);
}
-TCompiler *GetCompilerFromHandle(ShHandle handle)
-{
- if (!handle)
- return nullptr;
- TShHandleBase *base = static_cast<TShHandleBase *>(handle);
- return base->getAsCompiler();
-}
-
#ifdef ANGLE_ENABLE_HLSL
TranslatorHLSL *GetTranslatorHLSLFromHandle(ShHandle handle)
{
@@ -164,6 +174,7 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->ARM_shader_framebuffer_fetch = 0;
resources->OVR_multiview = 0;
resources->EXT_YUV_target = 0;
+ resources->OES_geometry_shader = 0;
resources->NV_draw_buffers = 0;
@@ -224,6 +235,19 @@ void InitBuiltInResources(ShBuiltInResources *resources)
resources->MaxAtomicCounterBufferSize = 32;
resources->MaxUniformBufferBindings = 32;
+
+ resources->MaxGeometryUniformComponents = 1024;
+ resources->MaxGeometryUniformBlocks = 12;
+ resources->MaxGeometryInputComponents = 64;
+ resources->MaxGeometryOutputComponents = 64;
+ resources->MaxGeometryOutputVertices = 256;
+ resources->MaxGeometryTotalOutputComponents = 1024;
+ resources->MaxGeometryTextureImageUnits = 16;
+ resources->MaxGeometryAtomicCounterBuffers = 0;
+ resources->MaxGeometryAtomicCounters = 0;
+ resources->MaxGeometryShaderStorageBlocks = 0;
+ resources->MaxGeometryShaderInvocations = 32;
+ resources->MaxGeometryImageUniforms = 0;
}
//
@@ -349,6 +373,26 @@ const std::vector<Uniform> *GetUniforms(const ShHandle handle)
return GetShaderVariables<Uniform>(handle);
}
+const std::vector<Varying> *GetInputVaryings(const ShHandle handle)
+{
+ TCompiler *compiler = GetCompilerFromHandle(handle);
+ if (compiler == nullptr)
+ {
+ return nullptr;
+ }
+ return &compiler->getInputVaryings();
+}
+
+const std::vector<Varying> *GetOutputVaryings(const ShHandle handle)
+{
+ TCompiler *compiler = GetCompilerFromHandle(handle);
+ if (compiler == nullptr)
+ {
+ return nullptr;
+ }
+ return &compiler->getOutputVaryings();
+}
+
const std::vector<Varying> *GetVaryings(const ShHandle handle)
{
return GetShaderVariables<Varying>(handle);
@@ -369,6 +413,26 @@ const std::vector<InterfaceBlock> *GetInterfaceBlocks(const ShHandle handle)
return GetShaderVariables<InterfaceBlock>(handle);
}
+const std::vector<InterfaceBlock> *GetUniformBlocks(const ShHandle handle)
+{
+ ASSERT(handle);
+ TShHandleBase *base = static_cast<TShHandleBase *>(handle);
+ TCompiler *compiler = base->getAsCompiler();
+ ASSERT(compiler);
+
+ return &compiler->getUniformBlocks();
+}
+
+const std::vector<InterfaceBlock> *GetShaderStorageBlocks(const ShHandle handle)
+{
+ ASSERT(handle);
+ TShHandleBase *base = static_cast<TShHandleBase *>(handle);
+ TCompiler *compiler = base->getAsCompiler();
+ ASSERT(compiler);
+
+ return &compiler->getShaderStorageBlocks();
+}
+
WorkGroupSize GetComputeShaderLocalGroupSize(const ShHandle handle)
{
ASSERT(handle);
@@ -392,13 +456,12 @@ int GetVertexShaderNumViews(const ShHandle handle)
bool CheckVariablesWithinPackingLimits(int maxVectors, const std::vector<ShaderVariable> &variables)
{
- VariablePacker packer;
- return packer.CheckVariablesWithinPackingLimits(maxVectors, variables);
+ return CheckVariablesInPackingLimits(maxVectors, variables);
}
-bool GetInterfaceBlockRegister(const ShHandle handle,
- const std::string &interfaceBlockName,
- unsigned int *indexOut)
+bool GetUniformBlockRegister(const ShHandle handle,
+ const std::string &uniformBlockName,
+ unsigned int *indexOut)
{
#ifdef ANGLE_ENABLE_HLSL
ASSERT(indexOut);
@@ -406,12 +469,12 @@ bool GetInterfaceBlockRegister(const ShHandle handle,
TranslatorHLSL *translator = GetTranslatorHLSLFromHandle(handle);
ASSERT(translator);
- if (!translator->hasInterfaceBlock(interfaceBlockName))
+ if (!translator->hasUniformBlock(uniformBlockName))
{
return false;
}
- *indexOut = translator->getInterfaceBlockRegister(interfaceBlockName);
+ *indexOut = translator->getUniformBlockRegister(uniformBlockName);
return true;
#else
return false;
diff --git a/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp b/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp
index 7c2f9cec12b..ccd0221fff0 100644
--- a/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ShaderVars.cpp
@@ -374,7 +374,8 @@ InterfaceBlock::InterfaceBlock()
layout(BLOCKLAYOUT_PACKED),
isRowMajorLayout(false),
binding(-1),
- staticUse(false)
+ staticUse(false),
+ blockType(BlockType::BLOCK_UNIFORM)
{
}
@@ -391,6 +392,7 @@ InterfaceBlock::InterfaceBlock(const InterfaceBlock &other)
isRowMajorLayout(other.isRowMajorLayout),
binding(other.binding),
staticUse(other.staticUse),
+ blockType(other.blockType),
fields(other.fields)
{
}
@@ -405,6 +407,7 @@ InterfaceBlock &InterfaceBlock::operator=(const InterfaceBlock &other)
isRowMajorLayout = other.isRowMajorLayout;
binding = other.binding;
staticUse = other.staticUse;
+ blockType = other.blockType;
fields = other.fields;
return *this;
}
@@ -418,7 +421,8 @@ bool InterfaceBlock::isSameInterfaceBlockAtLinkTime(const InterfaceBlock &other)
{
if (name != other.name || mappedName != other.mappedName || arraySize != other.arraySize ||
layout != other.layout || isRowMajorLayout != other.isRowMajorLayout ||
- binding != other.binding || fields.size() != other.fields.size())
+ binding != other.binding || blockType != other.blockType ||
+ fields.size() != other.fields.size())
{
return false;
}
diff --git a/chromium/third_party/angle/src/compiler/translator/StructureHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/StructureHLSL.cpp
index 57c7c759c86..1f5199ba3d4 100644
--- a/chromium/third_party/angle/src/compiler/translator/StructureHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/StructureHLSL.cpp
@@ -236,7 +236,10 @@ TString StructureHLSL::addConstructor(const TType &type,
}
TType ctorType = type;
- ctorType.clearArrayness();
+ while (ctorType.isArray())
+ {
+ ctorType.toArrayElementType();
+ }
ctorType.setPrecision(EbpHigh);
ctorType.setQualifier(EvqTemporary);
@@ -248,6 +251,20 @@ TString StructureHLSL::addConstructor(const TType &type,
const TStructure *structure = type.getStruct();
if (structure)
{
+ const TFieldList &fields = structure->fields();
+ for (const TField *field : fields)
+ {
+ const TType *fieldType = field->type();
+ if (!IsSampler(fieldType->getBasicType()))
+ {
+ ctorParameters.push_back(*fieldType);
+ }
+ if (fieldType->getBasicType() == EbtStruct)
+ {
+ addConstructor(*fieldType, StructNameString(*fieldType->getStruct()), nullptr);
+ }
+ }
+
mStructNames.insert(name);
// Add element index
@@ -275,15 +292,6 @@ TString StructureHLSL::addConstructor(const TType &type,
mStructDeclarations.push_back(std140RowMajorString);
}
- const TFieldList &fields = structure->fields();
- for (const TField *field : fields)
- {
- const TType *fieldType = field->type();
- if (!IsSampler(fieldType->getBasicType()))
- {
- ctorParameters.push_back(*fieldType);
- }
- }
constructorFunctionName = TString(name);
}
else if (parameters)
@@ -556,9 +564,9 @@ void StructureHLSL::storeStd140ElementIndex(const TStructure &structure,
Std140PaddingHelper padHelper = getPaddingHelper();
const TFieldList &fields = structure.fields();
- for (unsigned int i = 0; i < fields.size(); i++)
+ for (const TField *field : fields)
{
- padHelper.prePadding(*fields[i]->type());
+ padHelper.prePadding(*field->type());
}
// Add remaining element index to the global map, for use with nested structs in standard
@@ -566,4 +574,5 @@ void StructureHLSL::storeStd140ElementIndex(const TStructure &structure,
const TString &structName = QualifiedStructNameString(structure, useHLSLRowMajorPacking, true);
mStd140StructElementIndexes[structName] = padHelper.elementIndex();
}
-}
+
+} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp b/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp
index c3ca92826d5..1c2de5cccdb 100644
--- a/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/SymbolTable.cpp
@@ -141,6 +141,8 @@ TSymbol *TSymbolTable::find(const TString &name,
do
{
+ if (level == GLSL_BUILTINS)
+ level--;
if (level == ESSL3_1_BUILTINS && shaderVersion != 310)
level--;
if (level == ESSL3_BUILTINS && shaderVersion < 300)
@@ -167,8 +169,17 @@ TSymbol *TSymbolTable::findGlobal(const TString &name) const
TSymbol *TSymbolTable::findBuiltIn(const TString &name, int shaderVersion) const
{
+ return findBuiltIn(name, shaderVersion, false);
+}
+
+TSymbol *TSymbolTable::findBuiltIn(const TString &name,
+ int shaderVersion,
+ bool includeGLSLBuiltins) const
+{
for (int level = LAST_BUILTIN_LEVEL; level >= 0; level--)
{
+ if (level == GLSL_BUILTINS && !includeGLSLBuiltins)
+ level--;
if (level == ESSL3_1_BUILTINS && shaderVersion != 310)
level--;
if (level == ESSL3_BUILTINS && shaderVersion < 300)
@@ -182,7 +193,7 @@ TSymbol *TSymbolTable::findBuiltIn(const TString &name, int shaderVersion) const
return symbol;
}
- return 0;
+ return nullptr;
}
TSymbolTable::~TSymbolTable()
@@ -288,6 +299,18 @@ TInterfaceBlockName *TSymbolTable::declareInterfaceBlockName(const TString *name
return nullptr;
}
+TInterfaceBlockName *TSymbolTable::insertInterfaceBlockNameExt(ESymbolLevel level,
+ const char *ext,
+ const TString *name)
+{
+ TInterfaceBlockName *blockNameSymbol = new TInterfaceBlockName(this, name);
+ if (insert(level, ext, blockNameSymbol))
+ {
+ return blockNameSymbol;
+ }
+ return nullptr;
+}
+
TVariable *TSymbolTable::insertVariable(ESymbolLevel level, const char *name, const TType &type)
{
return insertVariable(level, NewPoolTString(name), type);
@@ -534,6 +557,16 @@ void TSymbolTable::insertBuiltInFunctionNoParameters(ESymbolLevel level,
insert(level, new TFunction(this, NewPoolTString(name), rvalue, op));
}
+void TSymbolTable::insertBuiltInFunctionNoParametersExt(ESymbolLevel level,
+ const char *ext,
+ TOperator op,
+ const TType *rvalue,
+ const char *name)
+{
+ insertUnmangledBuiltInName(name, level);
+ insert(level, new TFunction(this, NewPoolTString(name), rvalue, op, ext));
+}
+
TPrecision TSymbolTable::getDefaultPrecision(TBasicType type) const
{
if (!SupportsPrecision(type))
diff --git a/chromium/third_party/angle/src/compiler/translator/SymbolTable.h b/chromium/third_party/angle/src/compiler/translator/SymbolTable.h
index e929fcd7a95..58788a19519 100644
--- a/chromium/third_party/angle/src/compiler/translator/SymbolTable.h
+++ b/chromium/third_party/angle/src/compiler/translator/SymbolTable.h
@@ -292,8 +292,11 @@ const int COMMON_BUILTINS = 0;
const int ESSL1_BUILTINS = 1;
const int ESSL3_BUILTINS = 2;
const int ESSL3_1_BUILTINS = 3;
-const int LAST_BUILTIN_LEVEL = ESSL3_1_BUILTINS;
-const int GLOBAL_LEVEL = 4;
+// GLSL_BUILTINS are desktop GLSL builtins that don't exist in ESSL but are used to implement
+// features in ANGLE's GLSL backend. They're not visible to the parser.
+const int GLSL_BUILTINS = 4;
+const int LAST_BUILTIN_LEVEL = GLSL_BUILTINS;
+const int GLOBAL_LEVEL = 5;
class TSymbolTable : angle::NonCopyable
{
@@ -344,6 +347,9 @@ class TSymbolTable : angle::NonCopyable
const char *name,
const TType &type);
TVariable *insertStructType(ESymbolLevel level, TStructure *str);
+ TInterfaceBlockName *insertInterfaceBlockNameExt(ESymbolLevel level,
+ const char *ext,
+ const TString *name);
bool insertConstInt(ESymbolLevel level, const char *name, int value, TPrecision precision)
{
@@ -355,10 +361,14 @@ class TSymbolTable : angle::NonCopyable
return insert(level, constant);
}
- bool insertConstIntExt(ESymbolLevel level, const char *ext, const char *name, int value)
+ bool insertConstIntExt(ESymbolLevel level,
+ const char *ext,
+ const char *name,
+ int value,
+ TPrecision precision)
{
TVariable *constant =
- new TVariable(this, NewPoolTString(name), TType(EbtInt, EbpUndefined, EvqConst, 1));
+ new TVariable(this, NewPoolTString(name), TType(EbtInt, precision, EvqConst, 1));
TConstantUnion *unionArray = new TConstantUnion[1];
unionArray[0].setIConst(value);
constant->shareConstPointer(unionArray);
@@ -445,6 +455,12 @@ class TSymbolTable : angle::NonCopyable
const TType *rvalue,
const char *name);
+ void insertBuiltInFunctionNoParametersExt(ESymbolLevel level,
+ const char *ext,
+ TOperator op,
+ const TType *rvalue,
+ const char *name);
+
TSymbol *find(const TString &name,
int shaderVersion,
bool *builtIn = nullptr,
@@ -454,6 +470,8 @@ class TSymbolTable : angle::NonCopyable
TSymbol *findBuiltIn(const TString &name, int shaderVersion) const;
+ TSymbol *findBuiltIn(const TString &name, int shaderVersion, bool includeGLSLBuiltins) const;
+
TSymbolTableLevel *getOuterLevel()
{
assert(currentLevel() >= 1);
diff --git a/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp b/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp
index 9710f811fb3..8fd5f0a63e6 100644
--- a/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/TranslatorESSL.cpp
@@ -95,6 +95,13 @@ void TranslatorESSL::translate(TIntermBlock *root, ShCompileOptions compileOptio
<< ", local_size_z=" << localSize[2] << ") in;\n";
}
+ if (getShaderType() == GL_GEOMETRY_SHADER_OES)
+ {
+ WriteGeometryShaderLayoutQualifiers(
+ sink, getGeometryShaderInputPrimitiveType(), getGeometryShaderInvocations(),
+ getGeometryShaderOutputPrimitiveType(), getGeometryShaderMaxVertices());
+ }
+
// Write translated shader.
TOutputESSL outputESSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(),
&getSymbolTable(), getShaderType(), shaderVer, precisionEmulation,
@@ -153,6 +160,22 @@ void TranslatorESSL::writeExtensionBehavior(ShCompileOptions compileOptions)
sink << "#extension GL_NV_viewport_array2 : require\n";
}
}
+ else if (iter->first == "GL_OES_geometry_shader")
+ {
+ sink << "#ifdef GL_OES_geometry_shader\n"
+ << "#extension GL_OES_geometry_shader : " << getBehaviorString(iter->second)
+ << "\n"
+ << "#elif defined GL_EXT_geometry_shader\n"
+ << "#extension GL_EXT_geometry_shader : " << getBehaviorString(iter->second)
+ << "\n";
+ if (iter->second == EBhRequire)
+ {
+ sink << "#else\n"
+ << "#error \"No geometry shader extensions available.\" // Only generate "
+ "this if the extension is \"required\"\n";
+ }
+ sink << "#endif\n";
+ }
else
{
sink << "#extension " << iter->first << " : " << getBehaviorString(iter->second)
diff --git a/chromium/third_party/angle/src/compiler/translator/TranslatorGLSL.cpp b/chromium/third_party/angle/src/compiler/translator/TranslatorGLSL.cpp
index b5138294243..29e9b778dbf 100644
--- a/chromium/third_party/angle/src/compiler/translator/TranslatorGLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/TranslatorGLSL.cpp
@@ -200,6 +200,13 @@ void TranslatorGLSL::translate(TIntermBlock *root, ShCompileOptions compileOptio
<< ", local_size_z=" << localSize[2] << ") in;\n";
}
+ if (getShaderType() == GL_GEOMETRY_SHADER_OES)
+ {
+ WriteGeometryShaderLayoutQualifiers(
+ sink, getGeometryShaderInputPrimitiveType(), getGeometryShaderInvocations(),
+ getGeometryShaderOutputPrimitiveType(), getGeometryShaderMaxVertices());
+ }
+
// Write translated shader.
TOutputGLSL outputGLSL(sink, getArrayIndexClampingStrategy(), getHashFunction(), getNameMap(),
&getSymbolTable(), getShaderType(), getShaderVersion(), getOutputType(),
@@ -268,6 +275,12 @@ void TranslatorGLSL::writeExtensionBehavior(TIntermNode *root, ShCompileOptions
sink << "#extension GL_ARB_draw_buffers : " << getBehaviorString(iter.second)
<< "\n";
}
+
+ if (iter.first == "GL_OES_geometry_shader")
+ {
+ sink << "#extension GL_ARB_geometry_shader4 : " << getBehaviorString(iter.second)
+ << "\n";
+ }
}
const bool isMultiview =
diff --git a/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.cpp
index b9a42b86a43..005edf54f03 100644
--- a/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.cpp
@@ -123,7 +123,7 @@ void TranslatorHLSL::translate(TIntermBlock *root, ShCompileOptions compileOptio
outputHLSL.output(root, getInfoSink().obj);
- mInterfaceBlockRegisterMap = outputHLSL.getInterfaceBlockRegisterMap();
+ mUniformBlockRegisterMap = outputHLSL.getUniformBlockRegisterMap();
mUniformRegisterMap = outputHLSL.getUniformRegisterMap();
}
@@ -133,15 +133,15 @@ bool TranslatorHLSL::shouldFlattenPragmaStdglInvariantAll()
return false;
}
-bool TranslatorHLSL::hasInterfaceBlock(const std::string &interfaceBlockName) const
+bool TranslatorHLSL::hasUniformBlock(const std::string &uniformBlockName) const
{
- return (mInterfaceBlockRegisterMap.count(interfaceBlockName) > 0);
+ return (mUniformBlockRegisterMap.count(uniformBlockName) > 0);
}
-unsigned int TranslatorHLSL::getInterfaceBlockRegister(const std::string &interfaceBlockName) const
+unsigned int TranslatorHLSL::getUniformBlockRegister(const std::string &uniformBlockName) const
{
- ASSERT(hasInterfaceBlock(interfaceBlockName));
- return mInterfaceBlockRegisterMap.find(interfaceBlockName)->second;
+ ASSERT(hasUniformBlock(uniformBlockName));
+ return mUniformBlockRegisterMap.find(uniformBlockName)->second;
}
const std::map<std::string, unsigned int> *TranslatorHLSL::getUniformRegisterMap() const
diff --git a/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.h b/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.h
index a668cc9b93e..ca8241f6d6a 100644
--- a/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.h
+++ b/chromium/third_party/angle/src/compiler/translator/TranslatorHLSL.h
@@ -18,8 +18,8 @@ class TranslatorHLSL : public TCompiler
TranslatorHLSL(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
TranslatorHLSL *getAsTranslatorHLSL() override { return this; }
- bool hasInterfaceBlock(const std::string &interfaceBlockName) const;
- unsigned int getInterfaceBlockRegister(const std::string &interfaceBlockName) const;
+ bool hasUniformBlock(const std::string &interfaceBlockName) const;
+ unsigned int getUniformBlockRegister(const std::string &interfaceBlockName) const;
const std::map<std::string, unsigned int> *getUniformRegisterMap() const;
@@ -33,7 +33,7 @@ class TranslatorHLSL : public TCompiler
// Globals are initialized in output so it is redundant to initialize them in the AST.
bool needToInitializeGlobalsInAST() const override { return false; }
- std::map<std::string, unsigned int> mInterfaceBlockRegisterMap;
+ std::map<std::string, unsigned int> mUniformBlockRegisterMap;
std::map<std::string, unsigned int> mUniformRegisterMap;
};
diff --git a/chromium/third_party/angle/src/compiler/translator/Types.cpp b/chromium/third_party/angle/src/compiler/translator/Types.cpp
index 2dd55ac280c..b252512dc83 100644
--- a/chromium/third_party/angle/src/compiler/translator/Types.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/Types.cpp
@@ -122,13 +122,15 @@ TType::TType(const TPublicType &p)
layoutQualifier(p.layoutQualifier),
primarySize(p.getPrimarySize()),
secondarySize(p.getSecondarySize()),
- array(p.array),
- arraySize(p.arraySize),
interfaceBlock(0),
structure(0)
{
ASSERT(primarySize <= 4);
ASSERT(secondarySize <= 4);
+ if (p.array)
+ {
+ makeArray(p.arraySize);
+ }
if (p.getUserDef())
structure = p.getUserDef();
}
@@ -279,8 +281,11 @@ TString TType::getCompleteString() const
stream << getQualifierString() << " ";
if (precision != EbpUndefined)
stream << getPrecisionString() << " ";
- if (array)
- stream << "array[" << getArraySize() << "] of ";
+ for (auto arraySizeIter = mArraySizes.rbegin(); arraySizeIter != mArraySizes.rend();
+ ++arraySizeIter)
+ {
+ stream << "array[" << (*arraySizeIter) << "] of ";
+ }
if (isMatrix())
stream << getCols() << "X" << getRows() << " matrix of ";
else if (isVector())
@@ -417,6 +422,9 @@ TString TType::buildMangledName() const
case EbtUImageCube:
mangledName += "uimc";
break;
+ case EbtAtomicCounter:
+ mangledName += "ac";
+ break;
case EbtStruct:
mangledName += structure->mangledName();
break;
@@ -439,7 +447,7 @@ TString TType::buildMangledName() const
mangledName += static_cast<char>('0' + getNominalSize());
}
- if (isArray())
+ for (unsigned int arraySize : mArraySizes)
{
char buf[20];
snprintf(buf, sizeof(buf), "%d", arraySize);
@@ -459,16 +467,15 @@ size_t TType::getObjectSize() const
else
totalSize = primarySize * secondarySize;
- if (isArray())
- {
- if (totalSize == 0)
- return 0;
+ if (totalSize == 0)
+ return 0;
- size_t currentArraySize = getArraySize();
- if (currentArraySize > INT_MAX / totalSize)
+ for (size_t arraySize : mArraySizes)
+ {
+ if (arraySize > INT_MAX / totalSize)
totalSize = INT_MAX;
else
- totalSize *= currentArraySize;
+ totalSize *= arraySize;
}
return totalSize;
@@ -483,27 +490,93 @@ int TType::getLocationCount() const
count = structure->getLocationCount();
}
- if (isArray())
+ if (count == 0)
{
- if (count == 0)
- {
- return 0;
- }
+ return 0;
+ }
- unsigned int currentArraySize = getArraySize();
- if (currentArraySize > static_cast<unsigned int>(std::numeric_limits<int>::max() / count))
+ for (unsigned int arraySize : mArraySizes)
+ {
+ if (arraySize > static_cast<unsigned int>(std::numeric_limits<int>::max() / count))
{
count = std::numeric_limits<int>::max();
}
else
{
- count *= static_cast<int>(currentArraySize);
+ count *= static_cast<int>(arraySize);
}
}
return count;
}
+unsigned int TType::getArraySizeProduct() const
+{
+ unsigned int product = 1u;
+ for (unsigned int arraySize : mArraySizes)
+ {
+ product *= arraySize;
+ }
+ return product;
+}
+
+bool TType::isUnsizedArray() const
+{
+ for (unsigned int arraySize : mArraySizes)
+ {
+ if (arraySize == 0u)
+ {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool TType::sameNonArrayType(const TType &right) const
+{
+ return (type == right.type && primarySize == right.primarySize &&
+ secondarySize == right.secondarySize && structure == right.structure);
+}
+
+bool TType::isElementTypeOf(const TType &arrayType) const
+{
+ if (!sameNonArrayType(arrayType))
+ {
+ return false;
+ }
+ if (arrayType.mArraySizes.size() != mArraySizes.size() + 1u)
+ {
+ return false;
+ }
+ for (size_t i = 0; i < mArraySizes.size(); ++i)
+ {
+ if (mArraySizes[i] != arrayType.mArraySizes[i])
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+void TType::sizeUnsizedArrays(const TVector<unsigned int> &arraySizes)
+{
+ for (size_t i = 0u; i < mArraySizes.size(); ++i)
+ {
+ if (mArraySizes[i] == 0)
+ {
+ if (i < arraySizes.size())
+ {
+ mArraySizes[i] = arraySizes[i];
+ }
+ else
+ {
+ mArraySizes[i] = 1u;
+ }
+ }
+ }
+ invalidateMangledName();
+}
+
TStructure::TStructure(TSymbolTable *symbolTable, const TString *name, TFieldList *fields)
: TFieldListCollection(name, fields),
mDeepestNesting(0),
@@ -545,73 +618,58 @@ bool TStructure::containsSamplers() const
return false;
}
-void TStructure::createSamplerSymbols(const TString &structName,
- const TString &structAPIName,
- const unsigned int arrayOfStructsSize,
- TVector<TIntermSymbol *> *outputSymbols,
- TMap<TIntermSymbol *, TString> *outputSymbolsToAPINames) const
+void TType::createSamplerSymbols(const TString &namePrefix,
+ const TString &apiNamePrefix,
+ TVector<TIntermSymbol *> *outputSymbols,
+ TMap<TIntermSymbol *, TString> *outputSymbolsToAPINames) const
{
- for (auto &field : *mFields)
+ if (isStructureContainingSamplers())
{
- const TType *fieldType = field->type();
- if (IsSampler(fieldType->getBasicType()))
+ if (isArray())
{
- if (arrayOfStructsSize > 0u)
+ TType elementType(*this);
+ elementType.toArrayElementType();
+ for (unsigned int arrayIndex = 0u; arrayIndex < getOutermostArraySize(); ++arrayIndex)
{
- for (unsigned int arrayIndex = 0u; arrayIndex < arrayOfStructsSize; ++arrayIndex)
- {
- TStringStream name;
- name << structName << "_" << arrayIndex << "_" << field->name();
- TIntermSymbol *symbol = new TIntermSymbol(0, name.str(), *fieldType);
- outputSymbols->push_back(symbol);
-
- if (outputSymbolsToAPINames)
- {
- TStringStream apiName;
- apiName << structAPIName << "[" << arrayIndex << "]." << field->name();
- (*outputSymbolsToAPINames)[symbol] = apiName.str();
- }
- }
- }
- else
- {
- TString symbolName = structName + "_" + field->name();
- TIntermSymbol *symbol = new TIntermSymbol(0, symbolName, *fieldType);
- outputSymbols->push_back(symbol);
-
- if (outputSymbolsToAPINames)
- {
- TString apiName = structAPIName + "." + field->name();
- (*outputSymbolsToAPINames)[symbol] = apiName;
- }
+ TStringStream elementName;
+ elementName << namePrefix << "_" << arrayIndex;
+ TStringStream elementApiName;
+ elementApiName << apiNamePrefix << "[" << arrayIndex << "]";
+ elementType.createSamplerSymbols(elementName.str(), elementApiName.str(),
+ outputSymbols, outputSymbolsToAPINames);
}
}
- else if (fieldType->isStructureContainingSamplers())
+ else
{
- unsigned int nestedArrayOfStructsSize =
- fieldType->isArray() ? fieldType->getArraySize() : 0u;
- if (arrayOfStructsSize > 0)
- {
- for (unsigned int arrayIndex = 0u; arrayIndex < arrayOfStructsSize; ++arrayIndex)
- {
- TStringStream fieldName;
- fieldName << structName << "_" << arrayIndex << "_" << field->name();
- TStringStream fieldAPIName;
- if (outputSymbolsToAPINames)
- {
- fieldAPIName << structAPIName << "[" << arrayIndex << "]." << field->name();
- }
- fieldType->createSamplerSymbols(fieldName.str(), fieldAPIName.str(),
- nestedArrayOfStructsSize, outputSymbols,
- outputSymbolsToAPINames);
- }
- }
- else
- {
- fieldType->createSamplerSymbols(
- structName + "_" + field->name(), structAPIName + "." + field->name(),
- nestedArrayOfStructsSize, outputSymbols, outputSymbolsToAPINames);
- }
+ structure->createSamplerSymbols(namePrefix, apiNamePrefix, outputSymbols,
+ outputSymbolsToAPINames);
+ }
+ return;
+ }
+ ASSERT(IsSampler(type));
+ TIntermSymbol *symbol = new TIntermSymbol(0, namePrefix, *this);
+ outputSymbols->push_back(symbol);
+ if (outputSymbolsToAPINames)
+ {
+ (*outputSymbolsToAPINames)[symbol] = apiNamePrefix;
+ }
+}
+
+void TStructure::createSamplerSymbols(const TString &namePrefix,
+ const TString &apiNamePrefix,
+ TVector<TIntermSymbol *> *outputSymbols,
+ TMap<TIntermSymbol *, TString> *outputSymbolsToAPINames) const
+{
+ ASSERT(containsSamplers());
+ for (auto &field : *mFields)
+ {
+ const TType *fieldType = field->type();
+ if (IsSampler(fieldType->getBasicType()) || fieldType->isStructureContainingSamplers())
+ {
+ TString fieldName = namePrefix + "_" + field->name();
+ TString fieldApiName = apiNamePrefix + "." + field->name();
+ fieldType->createSamplerSymbols(fieldName, fieldApiName, outputSymbols,
+ outputSymbolsToAPINames);
}
}
}
diff --git a/chromium/third_party/angle/src/compiler/translator/Types.h b/chromium/third_party/angle/src/compiler/translator/Types.h
index 367d3278e41..eaa5479c359 100644
--- a/chromium/third_party/angle/src/compiler/translator/Types.h
+++ b/chromium/third_party/angle/src/compiler/translator/Types.h
@@ -100,9 +100,8 @@ class TStructure : public TFieldListCollection
bool containsType(TBasicType t) const;
bool containsSamplers() const;
- void createSamplerSymbols(const TString &structName,
- const TString &structAPIName,
- const unsigned int arrayOfStructsSize,
+ void createSamplerSymbols(const TString &namePrefix,
+ const TString &apiNamePrefix,
TVector<TIntermSymbol *> *outputSymbols,
TMap<TIntermSymbol *, TString> *outputSymbolsToAPINames) const;
@@ -150,11 +149,9 @@ class TInterfaceBlock : public TFieldListCollection
TInterfaceBlock(const TString *name,
TFieldList *fields,
const TString *instanceName,
- int arraySize,
const TLayoutQualifier &layoutQualifier)
: TFieldListCollection(name, fields),
mInstanceName(instanceName),
- mArraySize(arraySize),
mBlockStorage(layoutQualifier.blockStorage),
mMatrixPacking(layoutQualifier.matrixPacking),
mBinding(layoutQualifier.binding)
@@ -163,8 +160,6 @@ class TInterfaceBlock : public TFieldListCollection
const TString &instanceName() const { return *mInstanceName; }
bool hasInstanceName() const { return mInstanceName != nullptr; }
- bool isArray() const { return mArraySize > 0; }
- int arraySize() const { return mArraySize; }
TLayoutBlockStorage blockStorage() const { return mBlockStorage; }
TLayoutMatrixPacking matrixPacking() const { return mMatrixPacking; }
int blockBinding() const { return mBinding; }
@@ -177,7 +172,6 @@ class TInterfaceBlock : public TFieldListCollection
private:
const TString *mInstanceName; // for interface block instance names
- int mArraySize; // 0 if not an array
TLayoutBlockStorage mBlockStorage;
TLayoutMatrixPacking mMatrixPacking;
int mBinding;
@@ -199,8 +193,6 @@ class TType
layoutQualifier(TLayoutQualifier::create()),
primarySize(0),
secondarySize(0),
- array(false),
- arraySize(0),
interfaceBlock(nullptr),
structure(nullptr)
{
@@ -214,8 +206,6 @@ class TType
layoutQualifier(TLayoutQualifier::create()),
primarySize(ps),
secondarySize(ss),
- array(false),
- arraySize(0),
interfaceBlock(0),
structure(0)
{
@@ -224,8 +214,7 @@ class TType
TPrecision p,
TQualifier q = EvqTemporary,
unsigned char ps = 1,
- unsigned char ss = 1,
- bool a = false)
+ unsigned char ss = 1)
: type(t),
precision(p),
qualifier(q),
@@ -234,8 +223,6 @@ class TType
layoutQualifier(TLayoutQualifier::create()),
primarySize(ps),
secondarySize(ss),
- array(a),
- arraySize(0),
interfaceBlock(0),
structure(0)
{
@@ -250,16 +237,13 @@ class TType
layoutQualifier(TLayoutQualifier::create()),
primarySize(1),
secondarySize(1),
- array(false),
- arraySize(0),
interfaceBlock(0),
structure(userDef)
{
}
TType(TInterfaceBlock *interfaceBlockIn,
TQualifier qualifierIn,
- TLayoutQualifier layoutQualifierIn,
- int arraySizeIn)
+ TLayoutQualifier layoutQualifierIn)
: type(EbtInterfaceBlock),
precision(EbpUndefined),
qualifier(qualifierIn),
@@ -268,8 +252,6 @@ class TType
layoutQualifier(layoutQualifierIn),
primarySize(1),
secondarySize(1),
- array(arraySizeIn > 0),
- arraySize(arraySizeIn),
interfaceBlock(interfaceBlockIn),
structure(0)
{
@@ -343,24 +325,38 @@ class TType
bool isMatrix() const { return primarySize > 1 && secondarySize > 1; }
bool isNonSquareMatrix() const { return isMatrix() && primarySize != secondarySize; }
- bool isArray() const { return array; }
- bool isUnsizedArray() const { return array && arraySize == 0u; }
- unsigned int getArraySize() const { return arraySize; }
- void setArraySize(unsigned int s)
- {
- if (!array || arraySize != s)
+ bool isArray() const { return !mArraySizes.empty(); }
+ bool isArrayOfArrays() const { return mArraySizes.size() > 1u; }
+ const TVector<unsigned int> &getArraySizes() const { return mArraySizes; }
+ unsigned int getArraySizeProduct() const;
+ bool isUnsizedArray() const;
+ unsigned int getOutermostArraySize() const { return mArraySizes.back(); }
+ void makeArray(unsigned int s)
+ {
+ mArraySizes.push_back(s);
+ invalidateMangledName();
+ }
+ // Here, the array dimension value 0 corresponds to the innermost array.
+ void setArraySize(size_t arrayDimension, unsigned int s)
+ {
+ ASSERT(arrayDimension < mArraySizes.size());
+ if (mArraySizes.at(arrayDimension) != s)
{
- array = true;
- arraySize = s;
+ mArraySizes[arrayDimension] = s;
invalidateMangledName();
}
}
- void clearArrayness()
+
+ // Will set unsized array sizes according to arraySizes. In case there are more unsized arrays
+ // than there are sizes in arraySizes, defaults to setting array sizes to 1.
+ void sizeUnsizedArrays(const TVector<unsigned int> &arraySizes);
+
+ // Note that the array element type might still be an array type in GLSL ES version >= 3.10.
+ void toArrayElementType()
{
- if (array)
+ if (mArraySizes.size() > 0)
{
- array = false;
- arraySize = 0u;
+ mArraySizes.pop_back();
invalidateMangledName();
}
}
@@ -377,7 +373,10 @@ class TType
bool isInterfaceBlock() const { return type == EbtInterfaceBlock; }
bool isVector() const { return primarySize > 1 && secondarySize == 1; }
- bool isScalar() const { return primarySize == 1 && secondarySize == 1 && !structure && !array; }
+ bool isScalar() const
+ {
+ return primarySize == 1 && secondarySize == 1 && !structure && !isArray();
+ }
bool isScalarFloat() const { return isScalar() && type == EbtFloat; }
bool isScalarInt() const { return isScalar() && (type == EbtInt || type == EbtUInt); }
@@ -404,16 +403,16 @@ class TType
return mangled;
}
- bool sameElementType(const TType &right) const
- {
- return type == right.type && primarySize == right.primarySize &&
- secondarySize == right.secondarySize && structure == right.structure;
- }
+ bool sameNonArrayType(const TType &right) const;
+
+ // Returns true if arrayType is an array made of this type.
+ bool isElementTypeOf(const TType &arrayType) const;
+
bool operator==(const TType &right) const
{
return type == right.type && primarySize == right.primarySize &&
- secondarySize == right.secondarySize && array == right.array &&
- (!array || arraySize == right.arraySize) && structure == right.structure;
+ secondarySize == right.secondarySize && mArraySizes == right.mArraySizes &&
+ structure == right.structure;
// don't check the qualifier, it's not ever what's being sought after
}
bool operator!=(const TType &right) const { return !operator==(right); }
@@ -425,10 +424,13 @@ class TType
return primarySize < right.primarySize;
if (secondarySize != right.secondarySize)
return secondarySize < right.secondarySize;
- if (array != right.array)
- return array < right.array;
- if (arraySize != right.arraySize)
- return arraySize < right.arraySize;
+ if (mArraySizes.size() != right.mArraySizes.size())
+ return mArraySizes.size() < right.mArraySizes.size();
+ for (size_t i = 0; i < mArraySizes.size(); ++i)
+ {
+ if (mArraySizes[i] != right.mArraySizes[i])
+ return mArraySizes[i] < right.mArraySizes[i];
+ }
if (structure != right.structure)
return structure < right.structure;
@@ -473,16 +475,10 @@ class TType
return structure ? structure->containsSamplers() : false;
}
- void createSamplerSymbols(const TString &structName,
- const TString &structAPIName,
- const unsigned int arrayOfStructsSize,
+ void createSamplerSymbols(const TString &namePrefix,
+ const TString &apiNamePrefix,
TVector<TIntermSymbol *> *outputSymbols,
- TMap<TIntermSymbol *, TString> *outputSymbolsToAPINames) const
- {
- ASSERT(structure != nullptr && structure->containsSamplers());
- structure->createSamplerSymbols(structName, structAPIName, arrayOfStructsSize,
- outputSymbols, outputSymbolsToAPINames);
- }
+ TMap<TIntermSymbol *, TString> *outputSymbolsToAPINames) const;
// Initializes all lazily-initialized members.
void realize() { getMangledName(); }
@@ -499,10 +495,15 @@ class TType
TLayoutQualifier layoutQualifier;
unsigned char primarySize; // size of vector or cols matrix
unsigned char secondarySize; // rows of a matrix
- bool array;
- unsigned int arraySize;
- // 0 unless this is an interface block, or interface block member variable
+ // Used to make an array type. Outermost array size is stored at the end of the vector. Having 0
+ // in this vector means an unsized array.
+ TVector<unsigned int> mArraySizes;
+
+ // This is set only in the following two cases:
+ // 1) Represents an interface block.
+ // 2) Represents the member variable of an unnamed interface block.
+ // It's nullptr also for members of named interface blocks.
TInterfaceBlock *interfaceBlock;
// 0 unless this is a struct
diff --git a/chromium/third_party/angle/src/compiler/translator/UniformHLSL.cpp b/chromium/third_party/angle/src/compiler/translator/UniformHLSL.cpp
index 55aa4adb893..07badbb0349 100644
--- a/chromium/third_party/angle/src/compiler/translator/UniformHLSL.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/UniformHLSL.cpp
@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// UniformHLSL.cpp:
-// Methods for GLSL to HLSL translation for uniforms and interface blocks.
+// Methods for GLSL to HLSL translation for uniforms and uniform blocks.
//
#include "compiler/translator/UniformHLSL.h"
@@ -18,6 +18,9 @@
namespace sh
{
+namespace
+{
+
static const char *UniformRegisterPrefix(const TType &type)
{
if (IsSampler(type.getBasicType()))
@@ -61,11 +64,39 @@ static TString InterfaceBlockStructName(const TInterfaceBlock &interfaceBlock)
return DecoratePrivate(interfaceBlock.name()) + "_type";
}
+void OutputSamplerIndexArrayInitializer(TInfoSinkBase &out,
+ const TType &type,
+ unsigned int startIndex)
+{
+ out << "{";
+ TType elementType(type);
+ elementType.toArrayElementType();
+ for (unsigned int i = 0u; i < type.getOutermostArraySize(); ++i)
+ {
+ if (i > 0u)
+ {
+ out << ", ";
+ }
+ if (elementType.isArray())
+ {
+ OutputSamplerIndexArrayInitializer(out, elementType,
+ startIndex + i * elementType.getArraySizeProduct());
+ }
+ else
+ {
+ out << (startIndex + i);
+ }
+ }
+ out << "}";
+}
+
+} // anonymous namespace
+
UniformHLSL::UniformHLSL(StructureHLSL *structureHLSL,
ShShaderOutput outputType,
const std::vector<Uniform> &uniforms)
: mUniformRegister(0),
- mInterfaceBlockRegister(0),
+ mUniformBlockRegister(0),
mSamplerRegister(0),
mStructureHLSL(structureHLSL),
mOutputType(outputType),
@@ -78,9 +109,9 @@ void UniformHLSL::reserveUniformRegisters(unsigned int registerCount)
mUniformRegister = registerCount;
}
-void UniformHLSL::reserveInterfaceBlockRegisters(unsigned int registerCount)
+void UniformHLSL::reserveUniformBlockRegisters(unsigned int registerCount)
{
- mInterfaceBlockRegister = registerCount;
+ mUniformBlockRegister = registerCount;
}
const Uniform *UniformHLSL::findUniformByName(const TString &name) const
@@ -133,7 +164,7 @@ unsigned int UniformHLSL::assignSamplerInStructUniformRegister(const TType &type
ASSERT(IsSampler(type.getBasicType()));
unsigned int registerIndex = mSamplerRegister;
mUniformRegisterMap[std::string(name.c_str())] = registerIndex;
- unsigned int registerCount = type.isArray() ? type.getArraySize() : 1u;
+ unsigned int registerCount = type.isArray() ? type.getArraySizeProduct() : 1u;
mSamplerRegister += registerCount;
if (outRegisterCount)
{
@@ -179,14 +210,9 @@ void UniformHLSL::outputHLSLSamplerUniformGroup(
if (type.isArray())
{
out << "static const uint " << DecorateVariableIfNeeded(uniform->getName())
- << ArrayString(type) << " = {";
- for (unsigned int i = 0u; i < type.getArraySize(); ++i)
- {
- if (i > 0u)
- out << ", ";
- out << (samplerArrayIndex + i);
- }
- out << "};\n";
+ << ArrayString(type) << " = ";
+ OutputSamplerIndexArrayInitializer(out, type, samplerArrayIndex);
+ out << ";\n";
}
else
{
@@ -286,9 +312,8 @@ void UniformHLSL::uniformsHeader(TInfoSinkBase &out,
{
TVector<TIntermSymbol *> samplerSymbols;
TMap<TIntermSymbol *, TString> symbolsToAPINames;
- unsigned int arrayOfStructsSize = type.isArray() ? type.getArraySize() : 0u;
type.createSamplerSymbols("angle_" + name.getString(), name.getString(),
- arrayOfStructsSize, &samplerSymbols, &symbolsToAPINames);
+ &samplerSymbols, &symbolsToAPINames);
for (TIntermSymbol *sampler : samplerSymbols)
{
const TType &samplerType = sampler->getType();
@@ -354,7 +379,7 @@ void UniformHLSL::samplerMetadataUniforms(TInfoSinkBase &out, const char *reg)
}
}
-TString UniformHLSL::interfaceBlocksHeader(const ReferencedSymbols &referencedInterfaceBlocks)
+TString UniformHLSL::uniformBlocksHeader(const ReferencedSymbols &referencedInterfaceBlocks)
{
TString interfaceBlocks;
@@ -364,40 +389,45 @@ TString UniformHLSL::interfaceBlocksHeader(const ReferencedSymbols &referencedIn
const TType &nodeType = interfaceBlockIt->second->getType();
const TInterfaceBlock &interfaceBlock = *nodeType.getInterfaceBlock();
- unsigned int arraySize = static_cast<unsigned int>(interfaceBlock.arraySize());
- unsigned int activeRegister = mInterfaceBlockRegister;
+ // nodeType.isInterfaceBlock() == false means the node is a field of a uniform block which
+ // doesn't have instance name, so this block cannot be an array.
+ unsigned int interfaceBlockArraySize = 0u;
+ if (nodeType.isInterfaceBlock() && nodeType.isArray())
+ {
+ interfaceBlockArraySize = nodeType.getOutermostArraySize();
+ }
+ unsigned int activeRegister = mUniformBlockRegister;
- mInterfaceBlockRegisterMap[interfaceBlock.name().c_str()] = activeRegister;
- mInterfaceBlockRegister += std::max(1u, arraySize);
+ mUniformBlockRegisterMap[interfaceBlock.name().c_str()] = activeRegister;
+ mUniformBlockRegister += std::max(1u, interfaceBlockArraySize);
// FIXME: interface block field names
if (interfaceBlock.hasInstanceName())
{
- interfaceBlocks += interfaceBlockStructString(interfaceBlock);
+ interfaceBlocks += uniformBlockStructString(interfaceBlock);
}
- if (arraySize > 0)
+ if (interfaceBlockArraySize > 0)
{
- for (unsigned int arrayIndex = 0; arrayIndex < arraySize; arrayIndex++)
+ for (unsigned int arrayIndex = 0; arrayIndex < interfaceBlockArraySize; arrayIndex++)
{
interfaceBlocks +=
- interfaceBlockString(interfaceBlock, activeRegister + arrayIndex, arrayIndex);
+ uniformBlockString(interfaceBlock, activeRegister + arrayIndex, arrayIndex);
}
}
else
{
- interfaceBlocks +=
- interfaceBlockString(interfaceBlock, activeRegister, GL_INVALID_INDEX);
+ interfaceBlocks += uniformBlockString(interfaceBlock, activeRegister, GL_INVALID_INDEX);
}
}
- return (interfaceBlocks.empty() ? "" : ("// Interface Blocks\n\n" + interfaceBlocks));
+ return (interfaceBlocks.empty() ? "" : ("// Uniform Blocks\n\n" + interfaceBlocks));
}
-TString UniformHLSL::interfaceBlockString(const TInterfaceBlock &interfaceBlock,
- unsigned int registerIndex,
- unsigned int arrayIndex)
+TString UniformHLSL::uniformBlockString(const TInterfaceBlock &interfaceBlock,
+ unsigned int registerIndex,
+ unsigned int arrayIndex)
{
const TString &arrayIndexString =
(arrayIndex != GL_INVALID_INDEX ? Decorate(str(arrayIndex)) : "");
@@ -411,12 +441,12 @@ TString UniformHLSL::interfaceBlockString(const TInterfaceBlock &interfaceBlock,
if (interfaceBlock.hasInstanceName())
{
hlsl += " " + InterfaceBlockStructName(interfaceBlock) + " " +
- interfaceBlockInstanceString(interfaceBlock, arrayIndex) + ";\n";
+ uniformBlockInstanceString(interfaceBlock, arrayIndex) + ";\n";
}
else
{
const TLayoutBlockStorage blockStorage = interfaceBlock.blockStorage();
- hlsl += interfaceBlockMembersString(interfaceBlock, blockStorage);
+ hlsl += uniformBlockMembersString(interfaceBlock, blockStorage);
}
hlsl += "};\n\n";
@@ -424,14 +454,14 @@ TString UniformHLSL::interfaceBlockString(const TInterfaceBlock &interfaceBlock,
return hlsl;
}
-TString UniformHLSL::interfaceBlockInstanceString(const TInterfaceBlock &interfaceBlock,
- unsigned int arrayIndex)
+TString UniformHLSL::uniformBlockInstanceString(const TInterfaceBlock &interfaceBlock,
+ unsigned int arrayIndex)
{
if (!interfaceBlock.hasInstanceName())
{
return "";
}
- else if (interfaceBlock.isArray())
+ else if (arrayIndex != GL_INVALID_INDEX)
{
return DecoratePrivate(interfaceBlock.instanceName()) + "_" + str(arrayIndex);
}
@@ -441,8 +471,8 @@ TString UniformHLSL::interfaceBlockInstanceString(const TInterfaceBlock &interfa
}
}
-TString UniformHLSL::interfaceBlockMembersString(const TInterfaceBlock &interfaceBlock,
- TLayoutBlockStorage blockStorage)
+TString UniformHLSL::uniformBlockMembersString(const TInterfaceBlock &interfaceBlock,
+ TLayoutBlockStorage blockStorage)
{
TString hlsl;
@@ -475,13 +505,13 @@ TString UniformHLSL::interfaceBlockMembersString(const TInterfaceBlock &interfac
return hlsl;
}
-TString UniformHLSL::interfaceBlockStructString(const TInterfaceBlock &interfaceBlock)
+TString UniformHLSL::uniformBlockStructString(const TInterfaceBlock &interfaceBlock)
{
const TLayoutBlockStorage blockStorage = interfaceBlock.blockStorage();
return "struct " + InterfaceBlockStructName(interfaceBlock) +
"\n"
"{\n" +
- interfaceBlockMembersString(interfaceBlock, blockStorage) + "};\n\n";
+ uniformBlockMembersString(interfaceBlock, blockStorage) + "};\n\n";
}
}
diff --git a/chromium/third_party/angle/src/compiler/translator/UniformHLSL.h b/chromium/third_party/angle/src/compiler/translator/UniformHLSL.h
index 7bbf41b58f7..05474c29805 100644
--- a/chromium/third_party/angle/src/compiler/translator/UniformHLSL.h
+++ b/chromium/third_party/angle/src/compiler/translator/UniformHLSL.h
@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
// UniformHLSL.h:
-// Methods for GLSL to HLSL translation for uniforms and interface blocks.
+// Methods for GLSL to HLSL translation for uniforms and uniform blocks.
//
#ifndef COMPILER_TRANSLATOR_UNIFORMHLSL_H_
@@ -25,7 +25,7 @@ class UniformHLSL : angle::NonCopyable
const std::vector<Uniform> &uniforms);
void reserveUniformRegisters(unsigned int registerCount);
- void reserveInterfaceBlockRegisters(unsigned int registerCount);
+ void reserveUniformBlockRegisters(unsigned int registerCount);
void uniformsHeader(TInfoSinkBase &out,
ShShaderOutput outputType,
const ReferencedSymbols &referencedUniforms);
@@ -33,15 +33,15 @@ class UniformHLSL : angle::NonCopyable
// Must be called after uniformsHeader
void samplerMetadataUniforms(TInfoSinkBase &out, const char *reg);
- TString interfaceBlocksHeader(const ReferencedSymbols &referencedInterfaceBlocks);
+ TString uniformBlocksHeader(const ReferencedSymbols &referencedInterfaceBlocks);
// Used for direct index references
- static TString interfaceBlockInstanceString(const TInterfaceBlock &interfaceBlock,
- unsigned int arrayIndex);
+ static TString uniformBlockInstanceString(const TInterfaceBlock &interfaceBlock,
+ unsigned int arrayIndex);
- const std::map<std::string, unsigned int> &getInterfaceBlockRegisterMap() const
+ const std::map<std::string, unsigned int> &getUniformBlockRegisterMap() const
{
- return mInterfaceBlockRegisterMap;
+ return mUniformBlockRegisterMap;
}
const std::map<std::string, unsigned int> &getUniformRegisterMap() const
{
@@ -49,12 +49,12 @@ class UniformHLSL : angle::NonCopyable
}
private:
- TString interfaceBlockString(const TInterfaceBlock &interfaceBlock,
- unsigned int registerIndex,
- unsigned int arrayIndex);
- TString interfaceBlockMembersString(const TInterfaceBlock &interfaceBlock,
- TLayoutBlockStorage blockStorage);
- TString interfaceBlockStructString(const TInterfaceBlock &interfaceBlock);
+ TString uniformBlockString(const TInterfaceBlock &interfaceBlock,
+ unsigned int registerIndex,
+ unsigned int arrayIndex);
+ TString uniformBlockMembersString(const TInterfaceBlock &interfaceBlock,
+ TLayoutBlockStorage blockStorage);
+ TString uniformBlockStructString(const TInterfaceBlock &interfaceBlock);
const Uniform *findUniformByName(const TString &name) const;
void outputHLSL4_0_FL9_3Sampler(TInfoSinkBase &out,
@@ -83,13 +83,13 @@ class UniformHLSL : angle::NonCopyable
unsigned int *groupTextureRegisterIndex);
unsigned int mUniformRegister;
- unsigned int mInterfaceBlockRegister;
+ unsigned int mUniformBlockRegister;
unsigned int mSamplerRegister;
StructureHLSL *mStructureHLSL;
ShShaderOutput mOutputType;
const std::vector<Uniform> &mUniforms;
- std::map<std::string, unsigned int> mInterfaceBlockRegisterMap;
+ std::map<std::string, unsigned int> mUniformBlockRegisterMap;
std::map<std::string, unsigned int> mUniformRegisterMap;
};
}
diff --git a/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp b/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp
index 9ac9c68d59e..e4ff46fcb8b 100644
--- a/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/ValidateOutputs.cpp
@@ -95,7 +95,9 @@ void ValidateOutputsTraverser::validate(TDiagnostics *diagnostics) const
for (const auto &symbol : mOutputs)
{
const TType &type = symbol->getType();
- const size_t elementCount = static_cast<size_t>(type.isArray() ? type.getArraySize() : 1u);
+ ASSERT(!type.isArrayOfArrays()); // Disallowed in GLSL ES 3.10 section 4.3.6.
+ const size_t elementCount =
+ static_cast<size_t>(type.isArray() ? type.getOutermostArraySize() : 1u);
const size_t location = static_cast<size_t>(type.getLayoutQualifier().location);
ASSERT(type.getLayoutQualifier().location != -1);
diff --git a/chromium/third_party/angle/src/compiler/translator/VariablePacker.cpp b/chromium/third_party/angle/src/compiler/translator/VariablePacker.cpp
index 9c4c9376b54..1fa668b2143 100644
--- a/chromium/third_party/angle/src/compiler/translator/VariablePacker.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/VariablePacker.cpp
@@ -3,6 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
+// Check whether variables fit within packing limits according to the packing rules from the GLSL ES
+// 1.00.17 spec, Appendix A, section 7.
#include <algorithm>
@@ -11,62 +13,102 @@
#include "compiler/translator/VariablePacker.h"
#include "common/utilities.h"
-int VariablePacker::GetNumComponentsPerRow(sh::GLenum type)
+namespace sh
{
- switch (type)
+
+namespace
+{
+
+void ExpandVariable(const ShaderVariable &variable,
+ const std::string &name,
+ const std::string &mappedName,
+ bool markStaticUse,
+ std::vector<ShaderVariable> *expanded);
+
+void ExpandUserDefinedVariable(const ShaderVariable &variable,
+ const std::string &name,
+ const std::string &mappedName,
+ bool markStaticUse,
+ std::vector<ShaderVariable> *expanded)
+{
+ ASSERT(variable.isStruct());
+
+ const std::vector<ShaderVariable> &fields = variable.fields;
+
+ for (size_t fieldIndex = 0; fieldIndex < fields.size(); fieldIndex++)
{
- case GL_FLOAT_MAT4:
- case GL_FLOAT_MAT2:
- case GL_FLOAT_MAT2x4:
- case GL_FLOAT_MAT3x4:
- case GL_FLOAT_MAT4x2:
- case GL_FLOAT_MAT4x3:
- case GL_FLOAT_VEC4:
- case GL_INT_VEC4:
- case GL_BOOL_VEC4:
- case GL_UNSIGNED_INT_VEC4:
- return 4;
- case GL_FLOAT_MAT3:
- case GL_FLOAT_MAT2x3:
- case GL_FLOAT_MAT3x2:
- case GL_FLOAT_VEC3:
- case GL_INT_VEC3:
- case GL_BOOL_VEC3:
- case GL_UNSIGNED_INT_VEC3:
- return 3;
- case GL_FLOAT_VEC2:
- case GL_INT_VEC2:
- case GL_BOOL_VEC2:
- case GL_UNSIGNED_INT_VEC2:
- return 2;
- default:
- ASSERT(gl::VariableComponentCount(type) == 1);
- return 1;
+ const ShaderVariable &field = fields[fieldIndex];
+ ExpandVariable(field, name + "." + field.name, mappedName + "." + field.mappedName,
+ markStaticUse, expanded);
}
}
-int VariablePacker::GetNumRows(sh::GLenum type)
+void ExpandVariable(const ShaderVariable &variable,
+ const std::string &name,
+ const std::string &mappedName,
+ bool markStaticUse,
+ std::vector<ShaderVariable> *expanded)
{
- switch (type)
+ if (variable.isStruct())
{
- case GL_FLOAT_MAT4:
- case GL_FLOAT_MAT2x4:
- case GL_FLOAT_MAT3x4:
- case GL_FLOAT_MAT4x3:
- case GL_FLOAT_MAT4x2:
- return 4;
- case GL_FLOAT_MAT3:
- case GL_FLOAT_MAT2x3:
- case GL_FLOAT_MAT3x2:
- return 3;
- case GL_FLOAT_MAT2:
- return 2;
- default:
- ASSERT(gl::VariableRowCount(type) == 1);
- return 1;
+ if (variable.isArray())
+ {
+ for (unsigned int elementIndex = 0; elementIndex < variable.elementCount();
+ elementIndex++)
+ {
+ std::string lname = name + ::ArrayString(elementIndex);
+ std::string lmappedName = mappedName + ::ArrayString(elementIndex);
+ ExpandUserDefinedVariable(variable, lname, lmappedName, markStaticUse, expanded);
+ }
+ }
+ else
+ {
+ ExpandUserDefinedVariable(variable, name, mappedName, markStaticUse, expanded);
+ }
+ }
+ else
+ {
+ ShaderVariable expandedVar = variable;
+
+ expandedVar.name = name;
+ expandedVar.mappedName = mappedName;
+
+ // Mark all expanded fields as used if the parent is used
+ if (markStaticUse)
+ {
+ expandedVar.staticUse = true;
+ }
+
+ if (expandedVar.isArray())
+ {
+ expandedVar.name += "[0]";
+ expandedVar.mappedName += "[0]";
+ }
+
+ expanded->push_back(expandedVar);
}
}
+class VariablePacker
+{
+ public:
+ bool checkExpandedVariablesWithinPackingLimits(unsigned int maxVectors,
+ std::vector<sh::ShaderVariable> *variables);
+
+ private:
+ static const int kNumColumns = 4;
+ static const unsigned kColumnMask = (1 << kNumColumns) - 1;
+
+ unsigned makeColumnFlags(int column, int numComponentsPerRow);
+ void fillColumns(int topRow, int numRows, int column, int numComponentsPerRow);
+ bool searchColumn(int column, int numRows, int *destRow, int *destSize);
+
+ int topNonFullRow_;
+ int bottomNonFullRow_;
+ int maxRows_;
+ std::vector<unsigned> rows_;
+};
+
struct TVariableInfoComparer
{
bool operator()(const sh::ShaderVariable &lhs, const sh::ShaderVariable &rhs) const
@@ -159,27 +201,21 @@ bool VariablePacker::searchColumn(int column, int numRows, int *destRow, int *de
return true;
}
-bool VariablePacker::CheckVariablesWithinPackingLimits(
+bool VariablePacker::checkExpandedVariablesWithinPackingLimits(
unsigned int maxVectors,
- const std::vector<sh::ShaderVariable> &in_variables)
+ std::vector<sh::ShaderVariable> *variables)
{
ASSERT(maxVectors > 0);
maxRows_ = maxVectors;
topNonFullRow_ = 0;
bottomNonFullRow_ = maxRows_ - 1;
- std::vector<sh::ShaderVariable> variables;
-
- for (const auto &variable : in_variables)
- {
- ExpandVariable(variable, variable.name, variable.mappedName, variable.staticUse,
- &variables);
- }
// Check whether each variable fits in the available vectors.
- for (size_t i = 0; i < variables.size(); i++)
+ for (const sh::ShaderVariable &variable : *variables)
{
- const sh::ShaderVariable &variable = variables[i];
- if (variable.elementCount() > maxVectors / GetNumRows(variable.type))
+ // Structs should have been expanded before reaching here.
+ ASSERT(!variable.isStruct());
+ if (variable.elementCount() > maxVectors / GetVariablePackingRows(variable.type))
{
return false;
}
@@ -187,20 +223,20 @@ bool VariablePacker::CheckVariablesWithinPackingLimits(
// As per GLSL 1.017 Appendix A, Section 7 variables are packed in specific
// order by type, then by size of array, largest first.
- std::sort(variables.begin(), variables.end(), TVariableInfoComparer());
+ std::sort(variables->begin(), variables->end(), TVariableInfoComparer());
rows_.clear();
rows_.resize(maxVectors, 0);
// Packs the 4 column variables.
size_t ii = 0;
- for (; ii < variables.size(); ++ii)
+ for (; ii < variables->size(); ++ii)
{
- const sh::ShaderVariable &variable = variables[ii];
- if (GetNumComponentsPerRow(variable.type) != 4)
+ const sh::ShaderVariable &variable = (*variables)[ii];
+ if (GetVariablePackingComponentsPerRow(variable.type) != 4)
{
break;
}
- topNonFullRow_ += GetNumRows(variable.type) * variable.elementCount();
+ topNonFullRow_ += GetVariablePackingRows(variable.type) * variable.elementCount();
}
if (topNonFullRow_ > maxRows_)
@@ -210,14 +246,14 @@ bool VariablePacker::CheckVariablesWithinPackingLimits(
// Packs the 3 column variables.
int num3ColumnRows = 0;
- for (; ii < variables.size(); ++ii)
+ for (; ii < variables->size(); ++ii)
{
- const sh::ShaderVariable &variable = variables[ii];
- if (GetNumComponentsPerRow(variable.type) != 3)
+ const sh::ShaderVariable &variable = (*variables)[ii];
+ if (GetVariablePackingComponentsPerRow(variable.type) != 3)
{
break;
}
- num3ColumnRows += GetNumRows(variable.type) * variable.elementCount();
+ num3ColumnRows += GetVariablePackingRows(variable.type) * variable.elementCount();
}
if (topNonFullRow_ + num3ColumnRows > maxRows_)
@@ -232,14 +268,14 @@ bool VariablePacker::CheckVariablesWithinPackingLimits(
int twoColumnRowsAvailable = maxRows_ - top2ColumnRow;
int rowsAvailableInColumns01 = twoColumnRowsAvailable;
int rowsAvailableInColumns23 = twoColumnRowsAvailable;
- for (; ii < variables.size(); ++ii)
+ for (; ii < variables->size(); ++ii)
{
- const sh::ShaderVariable &variable = variables[ii];
- if (GetNumComponentsPerRow(variable.type) != 2)
+ const sh::ShaderVariable &variable = (*variables)[ii];
+ if (GetVariablePackingComponentsPerRow(variable.type) != 2)
{
break;
}
- int numRows = GetNumRows(variable.type) * variable.elementCount();
+ int numRows = GetVariablePackingRows(variable.type) * variable.elementCount();
if (numRows <= rowsAvailableInColumns01)
{
rowsAvailableInColumns01 -= numRows;
@@ -260,11 +296,11 @@ bool VariablePacker::CheckVariablesWithinPackingLimits(
fillColumns(maxRows_ - numRowsUsedInColumns23, numRowsUsedInColumns23, 2, 2);
// Packs the 1 column variables.
- for (; ii < variables.size(); ++ii)
+ for (; ii < variables->size(); ++ii)
{
- const sh::ShaderVariable &variable = variables[ii];
- ASSERT(1 == GetNumComponentsPerRow(variable.type));
- int numRows = GetNumRows(variable.type) * variable.elementCount();
+ const sh::ShaderVariable &variable = (*variables)[ii];
+ ASSERT(1 == GetVariablePackingComponentsPerRow(variable.type));
+ int numRows = GetVariablePackingRows(variable.type) * variable.elementCount();
int smallestColumn = -1;
int smallestSize = maxRows_ + 1;
int topRow = -1;
@@ -291,7 +327,86 @@ bool VariablePacker::CheckVariablesWithinPackingLimits(
fillColumns(topRow, numRows, smallestColumn, 1);
}
- ASSERT(variables.size() == ii);
+ ASSERT(variables->size() == ii);
return true;
}
+
+} // anonymous namespace
+
+int GetVariablePackingComponentsPerRow(sh::GLenum type)
+{
+ switch (type)
+ {
+ case GL_FLOAT_MAT4:
+ case GL_FLOAT_MAT2:
+ case GL_FLOAT_MAT2x4:
+ case GL_FLOAT_MAT3x4:
+ case GL_FLOAT_MAT4x2:
+ case GL_FLOAT_MAT4x3:
+ case GL_FLOAT_VEC4:
+ case GL_INT_VEC4:
+ case GL_BOOL_VEC4:
+ case GL_UNSIGNED_INT_VEC4:
+ return 4;
+ case GL_FLOAT_MAT3:
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT3x2:
+ case GL_FLOAT_VEC3:
+ case GL_INT_VEC3:
+ case GL_BOOL_VEC3:
+ case GL_UNSIGNED_INT_VEC3:
+ return 3;
+ case GL_FLOAT_VEC2:
+ case GL_INT_VEC2:
+ case GL_BOOL_VEC2:
+ case GL_UNSIGNED_INT_VEC2:
+ return 2;
+ default:
+ ASSERT(gl::VariableComponentCount(type) == 1);
+ return 1;
+ }
+}
+
+int GetVariablePackingRows(sh::GLenum type)
+{
+ switch (type)
+ {
+ case GL_FLOAT_MAT4:
+ case GL_FLOAT_MAT2x4:
+ case GL_FLOAT_MAT3x4:
+ case GL_FLOAT_MAT4x3:
+ case GL_FLOAT_MAT4x2:
+ return 4;
+ case GL_FLOAT_MAT3:
+ case GL_FLOAT_MAT2x3:
+ case GL_FLOAT_MAT3x2:
+ return 3;
+ case GL_FLOAT_MAT2:
+ return 2;
+ default:
+ ASSERT(gl::VariableRowCount(type) == 1);
+ return 1;
+ }
+}
+
+template <typename T>
+bool CheckVariablesInPackingLimits(unsigned int maxVectors, const std::vector<T> &variables)
+{
+ VariablePacker packer;
+ std::vector<sh::ShaderVariable> expandedVariables;
+ for (const ShaderVariable &variable : variables)
+ {
+ ExpandVariable(variable, variable.name, variable.mappedName, variable.staticUse,
+ &expandedVariables);
+ }
+ return packer.checkExpandedVariablesWithinPackingLimits(maxVectors, &expandedVariables);
+}
+
+template bool CheckVariablesInPackingLimits<ShaderVariable>(
+ unsigned int maxVectors,
+ const std::vector<ShaderVariable> &variables);
+template bool CheckVariablesInPackingLimits<Uniform>(unsigned int maxVectors,
+ const std::vector<Uniform> &variables);
+
+} // namespace sh
diff --git a/chromium/third_party/angle/src/compiler/translator/VariablePacker.h b/chromium/third_party/angle/src/compiler/translator/VariablePacker.h
index c6a320649c1..3bc73a068c2 100644
--- a/chromium/third_party/angle/src/compiler/translator/VariablePacker.h
+++ b/chromium/third_party/angle/src/compiler/translator/VariablePacker.h
@@ -3,39 +3,30 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
+// Check whether variables fit within packing limits according to the packing rules from the GLSL ES
+// 1.00.17 spec, Appendix A, section 7.
#ifndef COMPILER_TRANSLATOR_VARIABLEPACKER_H_
#define COMPILER_TRANSLATOR_VARIABLEPACKER_H_
#include <vector>
-#include "compiler/translator/VariableInfo.h"
-class VariablePacker
+#include <GLSLANG/ShaderLang.h>
+
+namespace sh
{
- public:
- // Returns true if the passed in variables pack in maxVectors following
- // the packing rules from the GLSL 1.017 spec, Appendix A, section 7.
- bool CheckVariablesWithinPackingLimits(unsigned int maxVectors,
- const std::vector<sh::ShaderVariable> &in_variables);
-
- // Gets how many components in a row a data type takes.
- static int GetNumComponentsPerRow(sh::GLenum type);
-
- // Gets how many rows a data type takes.
- static int GetNumRows(sh::GLenum type);
-
- private:
- static const int kNumColumns = 4;
- static const unsigned kColumnMask = (1 << kNumColumns) - 1;
-
- unsigned makeColumnFlags(int column, int numComponentsPerRow);
- void fillColumns(int topRow, int numRows, int column, int numComponentsPerRow);
- bool searchColumn(int column, int numRows, int *destRow, int *destSize);
-
- int topNonFullRow_;
- int bottomNonFullRow_;
- int maxRows_;
- std::vector<unsigned> rows_;
-};
+
+// Gets how many components in a row a data type takes.
+int GetVariablePackingComponentsPerRow(sh::GLenum type);
+
+// Gets how many rows a data type takes.
+int GetVariablePackingRows(sh::GLenum type);
+
+// Returns true if the passed in variables pack in maxVectors.
+// T should be ShaderVariable or one of the subclasses of ShaderVariable.
+template <typename T>
+bool CheckVariablesInPackingLimits(unsigned int maxVectors, const std::vector<T> &variables);
+
+} // namespace sh
#endif // COMPILER_TRANSLATOR_VARIABLEPACKER_H_
diff --git a/chromium/third_party/angle/src/compiler/translator/glslang.y b/chromium/third_party/angle/src/compiler/translator/glslang.y
index f6c182b9680..8a5e6eb71b4 100644
--- a/chromium/third_party/angle/src/compiler/translator/glslang.y
+++ b/chromium/third_party/angle/src/compiler/translator/glslang.y
@@ -943,11 +943,8 @@ type_specifier_no_prec
}
| type_specifier_nonarray LEFT_BRACKET constant_expression RIGHT_BRACKET {
$$.initialize($1, (context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary));
- if (context->checkIsValidTypeForArray(@2, $$))
- {
- unsigned int size = context->checkIsValidArraySize(@2, $3);
- $$.setArraySize(size);
- }
+ unsigned int size = context->checkIsValidArraySize(@2, $3);
+ $$.setArraySize(size);
}
;
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 ed83499b133..794794b6152 100644
--- a/chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/glslang_tab.cpp
@@ -757,20 +757,20 @@ static const yytype_uint16 yyrline[] =
813, 817, 820, 823, 832, 837, 841, 844, 847, 850,
853, 857, 860, 864, 867, 870, 873, 876, 879, 886,
893, 896, 899, 905, 912, 915, 921, 924, 927, 930,
- 936, 939, 944, 955, 958, 961, 964, 967, 970, 974,
- 978, 982, 986, 990, 994, 998, 1002, 1006, 1010, 1014,
- 1018, 1022, 1026, 1030, 1034, 1038, 1042, 1046, 1050, 1054,
- 1060, 1063, 1066, 1069, 1072, 1075, 1078, 1081, 1084, 1087,
- 1090, 1093, 1096, 1099, 1102, 1105, 1108, 1111, 1114, 1121,
- 1127, 1133, 1136, 1139, 1142, 1145, 1148, 1151, 1154, 1157,
- 1160, 1163, 1166, 1169, 1172, 1175, 1183, 1183, 1186, 1186,
- 1192, 1195, 1201, 1204, 1211, 1215, 1221, 1224, 1230, 1234,
- 1238, 1239, 1245, 1246, 1247, 1248, 1249, 1250, 1251, 1255,
- 1256, 1256, 1256, 1263, 1264, 1268, 1268, 1269, 1269, 1274,
- 1277, 1284, 1288, 1295, 1296, 1300, 1306, 1310, 1317, 1317,
- 1324, 1327, 1333, 1337, 1343, 1343, 1348, 1348, 1352, 1352,
- 1360, 1363, 1369, 1372, 1378, 1382, 1389, 1392, 1395, 1398,
- 1401, 1409, 1415, 1421, 1424, 1430, 1430
+ 936, 939, 944, 952, 955, 958, 961, 964, 967, 971,
+ 975, 979, 983, 987, 991, 995, 999, 1003, 1007, 1011,
+ 1015, 1019, 1023, 1027, 1031, 1035, 1039, 1043, 1047, 1051,
+ 1057, 1060, 1063, 1066, 1069, 1072, 1075, 1078, 1081, 1084,
+ 1087, 1090, 1093, 1096, 1099, 1102, 1105, 1108, 1111, 1118,
+ 1124, 1130, 1133, 1136, 1139, 1142, 1145, 1148, 1151, 1154,
+ 1157, 1160, 1163, 1166, 1169, 1172, 1180, 1180, 1183, 1183,
+ 1189, 1192, 1198, 1201, 1208, 1212, 1218, 1221, 1227, 1231,
+ 1235, 1236, 1242, 1243, 1244, 1245, 1246, 1247, 1248, 1252,
+ 1253, 1253, 1253, 1260, 1261, 1265, 1265, 1266, 1266, 1271,
+ 1274, 1281, 1285, 1292, 1293, 1297, 1303, 1307, 1314, 1314,
+ 1321, 1324, 1330, 1334, 1340, 1340, 1345, 1345, 1349, 1349,
+ 1357, 1360, 1366, 1369, 1375, 1379, 1386, 1389, 1392, 1395,
+ 1398, 1406, 1412, 1418, 1421, 1427, 1427
};
#endif
@@ -3851,11 +3851,8 @@ yyreduce:
{
(yyval.interm.type).initialize((yyvsp[-3].interm.typeSpecifierNonArray), (context->symbolTable.atGlobalLevel() ? EvqGlobal : EvqTemporary));
- if (context->checkIsValidTypeForArray((yylsp[-2]), (yyval.interm.type)))
- {
- unsigned int size = context->checkIsValidArraySize((yylsp[-2]), (yyvsp[-1].interm.intermTypedNode));
- (yyval.interm.type).setArraySize(size);
- }
+ unsigned int size = context->checkIsValidArraySize((yylsp[-2]), (yyvsp[-1].interm.intermTypedNode));
+ (yyval.interm.type).setArraySize(size);
}
break;
diff --git a/chromium/third_party/angle/src/compiler/translator/util.cpp b/chromium/third_party/angle/src/compiler/translator/util.cpp
index 32ed1286728..22f4ea9928d 100644
--- a/chromium/third_party/angle/src/compiler/translator/util.cpp
+++ b/chromium/third_party/angle/src/compiler/translator/util.cpp
@@ -332,7 +332,7 @@ GLenum GLVariableType(const TType &type)
case EbtSamplerExternal2DY2YEXT:
return GL_SAMPLER_EXTERNAL_2D_Y2Y_EXT;
case EbtSampler2DRect:
- return GL_SAMPLER_2D_RECT_ARB;
+ return GL_SAMPLER_2D_RECT_ANGLE;
case EbtSampler2DArray:
return GL_SAMPLER_2D_ARRAY;
case EbtSampler2DMS:
@@ -437,12 +437,14 @@ GLenum GLVariablePrecision(const TType &type)
TString ArrayString(const TType &type)
{
- if (!type.isArray())
+ TStringStream arrayString;
+ const TVector<unsigned int> &arraySizes = type.getArraySizes();
+ for (auto arraySizeIter = arraySizes.rbegin(); arraySizeIter != arraySizes.rend();
+ ++arraySizeIter)
{
- return "";
+ arrayString << "[" << (*arraySizeIter) << "]";
}
-
- return "[" + str(type.getArraySize()) + "]";
+ return arrayString.str();
}
bool IsVaryingOut(TQualifier qualifier)
diff --git a/chromium/third_party/angle/src/compiler/translator/util.h b/chromium/third_party/angle/src/compiler/translator/util.h
index 453b1bc39db..dd22a702b63 100644
--- a/chromium/third_party/angle/src/compiler/translator/util.h
+++ b/chromium/third_party/angle/src/compiler/translator/util.h
@@ -39,6 +39,9 @@ bool IsVaryingIn(TQualifier qualifier);
bool IsVaryingOut(TQualifier qualifier);
bool IsVarying(TQualifier qualifier);
InterpolationType GetInterpolationType(TQualifier qualifier);
+
+// Returns array brackets including size with outermost array size first, as specified in GLSL ES
+// 3.10 section 4.1.9.
TString ArrayString(const TType &type);
TType GetShaderVariableBasicType(const sh::ShaderVariable &var);
diff --git a/chromium/third_party/angle/src/libANGLE/Caps.cpp b/chromium/third_party/angle/src/libANGLE/Caps.cpp
index 8b159f63915..67d53e5edee 100644
--- a/chromium/third_party/angle/src/libANGLE/Caps.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Caps.cpp
@@ -229,7 +229,8 @@ Extensions::Extensions()
surfacelessContext(false),
clientArrays(false),
robustResourceInitialization(false),
- programCacheControl(false)
+ programCacheControl(false),
+ textureRectangle(false)
{
}
@@ -699,6 +700,7 @@ const ExtensionInfoMap &GetExtensionInfoMap()
map["GL_ANGLE_client_arrays"] = esOnlyExtension(&Extensions::clientArrays);
map["GL_ANGLE_robust_resource_initialization"] = esOnlyExtension(&Extensions::robustResourceInitialization);
map["GL_ANGLE_program_cache_control"] = esOnlyExtension(&Extensions::programCacheControl);
+ map["GL_ANGLE_texture_rectangle"] = enableableExtension(&Extensions::textureRectangle);
// clang-format on
return map;
@@ -746,6 +748,7 @@ Caps::Caps()
: maxElementIndex(0),
max3DTextureSize(0),
max2DTextureSize(0),
+ maxRectangleTextureSize(0),
maxArrayTextureLayers(0),
maxLODBias(0),
maxCubeMapTextureSize(0),
diff --git a/chromium/third_party/angle/src/libANGLE/Caps.h b/chromium/third_party/angle/src/libANGLE/Caps.h
index 67dbbeb708a..797a24975aa 100644
--- a/chromium/third_party/angle/src/libANGLE/Caps.h
+++ b/chromium/third_party/angle/src/libANGLE/Caps.h
@@ -370,6 +370,9 @@ struct Extensions
// GL_ANGLE_program_cache_control
bool programCacheControl;
+
+ // GL_ANGLE_texture_rectangle
+ bool textureRectangle;
};
struct ExtensionInfo
@@ -432,6 +435,7 @@ struct Caps
GLuint64 maxElementIndex;
GLuint max3DTextureSize;
GLuint max2DTextureSize;
+ GLuint maxRectangleTextureSize;
GLuint maxArrayTextureLayers;
GLfloat maxLODBias;
GLuint maxCubeMapTextureSize;
diff --git a/chromium/third_party/angle/src/libANGLE/Compiler.cpp b/chromium/third_party/angle/src/libANGLE/Compiler.cpp
index 30af05bcbbc..430cb7947f4 100644
--- a/chromium/third_party/angle/src/libANGLE/Compiler.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Compiler.cpp
@@ -72,6 +72,7 @@ Compiler::Compiler(rx::GLImplFactory *implFactory, const ContextState &state)
mResources.OES_EGL_image_external = extensions.eglImageExternal;
mResources.OES_EGL_image_external_essl3 = extensions.eglImageExternalEssl3;
mResources.NV_EGL_stream_consumer_external = extensions.eglStreamConsumerExternal;
+ mResources.ARB_texture_rectangle = extensions.textureRectangle;
// TODO: use shader precision caps to determine if high precision is supported?
mResources.FragmentPrecisionHigh = 1;
mResources.EXT_frag_depth = extensions.fragDepth;
diff --git a/chromium/third_party/angle/src/libANGLE/Context.cpp b/chromium/third_party/angle/src/libANGLE/Context.cpp
index 349491ddd20..137b7c1677d 100644
--- a/chromium/third_party/angle/src/libANGLE/Context.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Context.cpp
@@ -45,6 +45,11 @@
namespace
{
+#define ANGLE_HANDLE_ERR(X) \
+ handleError(X); \
+ return;
+#define ANGLE_CONTEXT_TRY(EXPR) ANGLE_TRY_TEMPLATE(EXPR, ANGLE_HANDLE_ERR);
+
template <typename T>
std::vector<gl::Path *> GatherPaths(gl::PathManager &resourceManager,
GLsizei numPaths,
@@ -329,6 +334,13 @@ Context::Context(rx::EGLImplFactory *implFactory,
}
}
+ if (mExtensions.textureRectangle)
+ {
+ Texture *zeroTextureRectangle =
+ new Texture(mImplementation.get(), 0, GL_TEXTURE_RECTANGLE_ANGLE);
+ mZeroTextures[GL_TEXTURE_RECTANGLE_ANGLE].set(this, zeroTextureRectangle);
+ }
+
if (mExtensions.eglImageExternal || mExtensions.eglStreamConsumerExternal)
{
Texture *zeroTextureExternal =
@@ -362,7 +374,7 @@ Context::Context(rx::EGLImplFactory *implFactory,
// In the initial state, a default transform feedback object is bound and treated as
// a transform feedback object with a name of zero. That object is bound any time
// BindTransformFeedback is called with id of zero
- bindTransformFeedback(0);
+ bindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
}
// Initialize dirty bit masks
@@ -461,7 +473,7 @@ egl::Error Context::onDestroy(const egl::Display *display)
mState.mTextures->release(this);
mState.mRenderbuffers->release(this);
mState.mSamplers->release(this);
- mState.mFenceSyncs->release(this);
+ mState.mSyncs->release(this);
mState.mPaths->release(this);
mState.mFramebuffers->release(this);
@@ -594,13 +606,6 @@ GLuint Context::createRenderbuffer()
return mState.mRenderbuffers->createRenderbuffer();
}
-GLsync Context::createFenceSync()
-{
- GLuint handle = mState.mFenceSyncs->createFenceSync(mImplementation.get());
-
- return reinterpret_cast<GLsync>(static_cast<uintptr_t>(handle));
-}
-
GLuint Context::createPaths(GLsizei range)
{
auto resultOrError = mState.mPaths->createPaths(mImplementation.get(), range);
@@ -612,25 +617,6 @@ GLuint Context::createPaths(GLsizei range)
return resultOrError.getResult();
}
-GLuint Context::createVertexArray()
-{
- GLuint vertexArray = mVertexArrayHandleAllocator.allocate();
- mVertexArrayMap.assign(vertexArray, nullptr);
- return vertexArray;
-}
-
-GLuint Context::createSampler()
-{
- return mState.mSamplers->createSampler();
-}
-
-GLuint Context::createTransformFeedback()
-{
- GLuint transformFeedback = mTransformFeedbackAllocator.allocate();
- mTransformFeedbackMap.assign(transformFeedback, nullptr);
- return transformFeedback;
-}
-
// Returns an unused framebuffer name
GLuint Context::createFramebuffer()
{
@@ -644,14 +630,6 @@ GLuint Context::createFenceNV()
return handle;
}
-// Returns an unused query name
-GLuint Context::createQuery()
-{
- GLuint handle = mQueryHandleAllocator.allocate();
- mQueryMap.assign(handle, nullptr);
- return handle;
-}
-
void Context::deleteBuffer(GLuint buffer)
{
if (mState.mBuffers->getBuffer(buffer))
@@ -692,14 +670,13 @@ void Context::deleteRenderbuffer(GLuint renderbuffer)
mState.mRenderbuffers->deleteObject(this, renderbuffer);
}
-void Context::deleteFenceSync(GLsync fenceSync)
+void Context::deleteSync(GLsync sync)
{
// The spec specifies the underlying Fence object is not deleted until all current
// wait commands finish. However, since the name becomes invalid, we cannot query the fence,
// and since our API is currently designed for being called from a single thread, we can delete
// the fence immediately.
- mState.mFenceSyncs->deleteObject(this,
- static_cast<GLuint>(reinterpret_cast<uintptr_t>(fenceSync)));
+ mState.mSyncs->deleteObject(this, static_cast<GLuint>(reinterpret_cast<uintptr_t>(sync)));
}
void Context::deletePaths(GLuint first, GLsizei range)
@@ -792,51 +769,6 @@ void Context::setPathStencilFunc(GLenum func, GLint ref, GLuint mask)
mGLState.setPathStencilFunc(func, ref, mask);
}
-void Context::deleteVertexArray(GLuint vertexArray)
-{
- VertexArray *vertexArrayObject = nullptr;
- if (mVertexArrayMap.erase(vertexArray, &vertexArrayObject))
- {
- if (vertexArrayObject != nullptr)
- {
- detachVertexArray(vertexArray);
- vertexArrayObject->onDestroy(this);
- }
-
- mVertexArrayHandleAllocator.release(vertexArray);
- }
-}
-
-void Context::deleteSampler(GLuint sampler)
-{
- if (mState.mSamplers->getSampler(sampler))
- {
- detachSampler(sampler);
- }
-
- mState.mSamplers->deleteObject(this, sampler);
-}
-
-void Context::deleteTransformFeedback(GLuint transformFeedback)
-{
- if (transformFeedback == 0)
- {
- return;
- }
-
- TransformFeedback *transformFeedbackObject = nullptr;
- if (mTransformFeedbackMap.erase(transformFeedback, &transformFeedbackObject))
- {
- if (transformFeedbackObject != nullptr)
- {
- detachTransformFeedback(transformFeedback);
- transformFeedbackObject->release(this);
- }
-
- mTransformFeedbackAllocator.release(transformFeedback);
- }
-}
-
void Context::deleteFramebuffer(GLuint framebuffer)
{
if (mState.mFramebuffers->getFramebuffer(framebuffer))
@@ -857,19 +789,6 @@ void Context::deleteFenceNV(GLuint fence)
}
}
-void Context::deleteQuery(GLuint query)
-{
- Query *queryObject = nullptr;
- if (mQueryMap.erase(query, &queryObject))
- {
- mQueryHandleAllocator.release(query);
- if (queryObject)
- {
- queryObject->release(this);
- }
- }
-}
-
Buffer *Context::getBuffer(GLuint handle) const
{
return mState.mBuffers->getBuffer(handle);
@@ -885,10 +804,9 @@ Renderbuffer *Context::getRenderbuffer(GLuint handle) const
return mState.mRenderbuffers->getRenderbuffer(handle);
}
-FenceSync *Context::getFenceSync(GLsync handle) const
+Sync *Context::getSync(GLsync handle) const
{
- return mState.mFenceSyncs->getFenceSync(
- static_cast<GLuint>(reinterpret_cast<uintptr_t>(handle)));
+ return mState.mSyncs->getSync(static_cast<GLuint>(reinterpret_cast<uintptr_t>(handle)));
}
VertexArray *Context::getVertexArray(GLuint handle) const
@@ -938,7 +856,7 @@ LabeledObject *Context::getLabeledObject(GLenum identifier, GLuint name) const
LabeledObject *Context::getLabeledObjectFromPtr(const void *ptr) const
{
- return getFenceSync(reinterpret_cast<GLsync>(const_cast<void *>(ptr)));
+ return getSync(reinterpret_cast<GLsync>(const_cast<void *>(ptr)));
}
void Context::objectLabel(GLenum identifier, GLuint name, GLsizei length, const GLchar *label)
@@ -1162,52 +1080,45 @@ void Context::useProgram(GLuint program)
mGLState.setProgram(this, getProgram(program));
}
-void Context::bindTransformFeedback(GLuint transformFeedbackHandle)
+void Context::bindTransformFeedback(GLenum target, GLuint transformFeedbackHandle)
{
+ ASSERT(target == GL_TRANSFORM_FEEDBACK);
TransformFeedback *transformFeedback =
checkTransformFeedbackAllocation(transformFeedbackHandle);
mGLState.setTransformFeedbackBinding(this, transformFeedback);
}
-Error Context::beginQuery(GLenum target, GLuint query)
+void Context::beginQuery(GLenum target, GLuint query)
{
Query *queryObject = getQuery(query, true, target);
ASSERT(queryObject);
// begin query
- Error error = queryObject->begin();
- if (error.isError())
- {
- return error;
- }
+ ANGLE_CONTEXT_TRY(queryObject->begin());
// set query as active for specified target only if begin succeeded
mGLState.setActiveQuery(this, target, queryObject);
-
- return NoError();
}
-Error Context::endQuery(GLenum target)
+void Context::endQuery(GLenum target)
{
Query *queryObject = mGLState.getActiveQuery(target);
ASSERT(queryObject);
- gl::Error error = queryObject->end();
+ handleError(queryObject->end());
// Always unbind the query, even if there was an error. This may delete the query object.
mGLState.setActiveQuery(this, target, nullptr);
-
- return error;
}
-Error Context::queryCounter(GLuint id, GLenum target)
+void Context::queryCounter(GLuint id, GLenum target)
{
ASSERT(target == GL_TIMESTAMP_EXT);
Query *queryObject = getQuery(id, true, target);
ASSERT(queryObject);
- return queryObject->queryCounter();
+ handleError(queryObject->queryCounter());
}
void Context::getQueryiv(GLenum target, GLenum pname, GLint *params)
@@ -1417,6 +1328,9 @@ void Context::getIntegervImpl(GLenum pname, GLint *params)
case GL_MAX_TEXTURE_SIZE:
*params = mCaps.max2DTextureSize;
break;
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE:
+ *params = mCaps.maxRectangleTextureSize;
+ break;
case GL_MAX_CUBE_MAP_TEXTURE_SIZE:
*params = mCaps.maxCubeMapTextureSize;
break;
@@ -1661,7 +1575,7 @@ void Context::getIntegervImpl(GLenum pname, GLint *params)
}
}
-void Context::getInteger64v(GLenum pname, GLint64 *params)
+void Context::getInteger64vImpl(GLenum pname, GLint64 *params)
{
// Queries about context capabilities and maximums are answered by Context.
// Queries about current GL state values are answered by State.
@@ -1832,31 +1746,23 @@ void Context::texParameteriv(GLenum target, GLenum pname, const GLint *params)
void Context::drawArrays(GLenum mode, GLint first, GLsizei count)
{
- syncRendererState();
- auto error = mImplementation->drawArrays(this, mode, first, count);
- handleError(error);
- if (!error.isError())
- {
- MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
- }
+ ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+ ANGLE_CONTEXT_TRY(mImplementation->drawArrays(this, mode, first, count));
+ MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
}
void Context::drawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
{
- syncRendererState();
- auto error = mImplementation->drawArraysInstanced(this, mode, first, count, instanceCount);
- handleError(error);
- if (!error.isError())
- {
- MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
- }
+ ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+ ANGLE_CONTEXT_TRY(
+ mImplementation->drawArraysInstanced(this, mode, first, count, instanceCount));
+ MarkTransformFeedbackBufferUsage(mGLState.getCurrentTransformFeedback());
}
void Context::drawElements(GLenum mode, GLsizei count, GLenum type, const void *indices)
{
- syncRendererState();
- const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
- handleError(mImplementation->drawElements(this, mode, count, type, indices, indexRange));
+ ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+ ANGLE_CONTEXT_TRY(mImplementation->drawElements(this, mode, count, type, indices));
}
void Context::drawElementsInstanced(GLenum mode,
@@ -1865,10 +1771,9 @@ void Context::drawElementsInstanced(GLenum mode,
const void *indices,
GLsizei instances)
{
- syncRendererState();
- const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
- handleError(mImplementation->drawElementsInstanced(this, mode, count, type, indices, instances,
- indexRange));
+ ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+ ANGLE_CONTEXT_TRY(
+ mImplementation->drawElementsInstanced(this, mode, count, type, indices, instances));
}
void Context::drawRangeElements(GLenum mode,
@@ -1878,22 +1783,21 @@ void Context::drawRangeElements(GLenum mode,
GLenum type,
const void *indices)
{
- syncRendererState();
- const IndexRange &indexRange = getParams<HasIndexRange>().getIndexRange().value();
- handleError(mImplementation->drawRangeElements(this, mode, start, end, count, type, indices,
- indexRange));
+ ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+ ANGLE_CONTEXT_TRY(
+ mImplementation->drawRangeElements(this, mode, start, end, count, type, indices));
}
void Context::drawArraysIndirect(GLenum mode, const void *indirect)
{
- syncRendererState();
- handleError(mImplementation->drawArraysIndirect(this, mode, indirect));
+ ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+ ANGLE_CONTEXT_TRY(mImplementation->drawArraysIndirect(this, mode, indirect));
}
void Context::drawElementsIndirect(GLenum mode, GLenum type, const void *indirect)
{
- syncRendererState();
- handleError(mImplementation->drawElementsIndirect(this, mode, type, indirect));
+ ANGLE_CONTEXT_TRY(prepareForDraw(mode));
+ ANGLE_CONTEXT_TRY(mImplementation->drawElementsIndirect(this, mode, type, indirect));
}
void Context::flush()
@@ -2175,7 +2079,21 @@ GLint Context::getProgramResourceLocation(GLuint program,
return QueryProgramResourceLocation(programObject, programInterface, name);
}
-void Context::handleError(const Error &error)
+void Context::getProgramResourceiv(GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei propCount,
+ const GLenum *props,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *params)
+{
+ const auto *programObject = getProgram(program);
+ QueryProgramResourceiv(programObject, programInterface, index, propCount, props, bufSize,
+ length, params);
+}
+
+Error Context::handleError(const Error &error)
{
if (error.isError())
{
@@ -2193,6 +2111,8 @@ void Context::handleError(const Error &error)
GL_DEBUG_SEVERITY_HIGH, error.getMessage());
}
}
+
+ return error;
}
// Get one of the recorded errors and clear its flag, if any.
@@ -2413,7 +2333,7 @@ void Context::detachTransformFeedback(GLuint transformFeedback)
// VAOs and FBOs and set the current bound transform feedback back to 0.
if (mGLState.removeTransformFeedbackBinding(this, transformFeedback))
{
- bindTransformFeedback(0);
+ bindTransformFeedback(GL_TRANSFORM_FEEDBACK, 0);
}
}
@@ -2422,7 +2342,7 @@ void Context::detachSampler(GLuint sampler)
mGLState.detachSampler(this, sampler);
}
-void Context::setVertexAttribDivisor(GLuint index, GLuint divisor)
+void Context::vertexAttribDivisor(GLuint index, GLuint divisor)
{
mGLState.setVertexAttribDivisor(this, index, divisor);
}
@@ -2825,6 +2745,20 @@ void Context::initWorkarounds()
mWorkarounds.loseContextOnOutOfMemory = (mResetStrategy == GL_LOSE_CONTEXT_ON_RESET_EXT);
}
+Error Context::prepareForDraw(GLenum drawMode)
+{
+ syncRendererState();
+
+ InfoLog infoLog;
+ Error err = mImplementation->triggerDrawCallProgramRecompilation(this, &infoLog,
+ mMemoryProgramCache, drawMode);
+ if (err.isError() || infoLog.getLength() > 0)
+ {
+ WARN() << "Dynamic recompilation error log: " << infoLog.str();
+ }
+ return err;
+}
+
void Context::syncRendererState()
{
const State::DirtyBits &dirtyBits = mGLState.getDirtyBits();
@@ -2919,11 +2853,11 @@ void Context::readPixels(GLint x,
syncStateForReadPixels();
- Framebuffer *framebufferObject = mGLState.getReadFramebuffer();
- ASSERT(framebufferObject);
+ Framebuffer *readFBO = mGLState.getReadFramebuffer();
+ ASSERT(readFBO);
Rectangle area(x, y, width, height);
- handleError(framebufferObject->readPixels(this, area, format, type, pixels));
+ handleError(readFBO->readPixels(this, area, format, type, pixels));
}
void Context::copyTexImage2D(GLenum target,
@@ -3017,6 +2951,10 @@ void Context::framebufferTexture2D(GLenum target,
{
index = ImageIndex::Make2D(level);
}
+ else if (textarget == GL_TEXTURE_RECTANGLE_ANGLE)
+ {
+ index = ImageIndex::MakeRectangle(level);
+ }
else if (textarget == GL_TEXTURE_2D_MULTISAMPLE)
{
ASSERT(level == 0);
@@ -3103,7 +3041,23 @@ void Context::framebufferTextureMultiviewLayeredANGLE(GLenum target,
GLint baseViewIndex,
GLsizei numViews)
{
- UNIMPLEMENTED();
+ Framebuffer *framebuffer = mGLState.getTargetFramebuffer(target);
+ ASSERT(framebuffer);
+
+ if (texture != 0)
+ {
+ Texture *textureObj = getTexture(texture);
+
+ ImageIndex index = ImageIndex::Make2DArrayRange(level, baseViewIndex, numViews);
+ framebuffer->setAttachmentMultiviewLayered(this, GL_TEXTURE, attachment, index, textureObj,
+ numViews, baseViewIndex);
+ }
+ else
+ {
+ framebuffer->resetAttachment(this, attachment);
+ }
+
+ mGLState.setObjectDirty(target);
}
void Context::framebufferTextureMultiviewSideBySideANGLE(GLenum target,
@@ -4194,7 +4148,7 @@ void Context::renderbufferStorageMultisample(GLenum target,
void Context::getSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
{
- const FenceSync *syncObject = getFenceSync(sync);
+ const Sync *syncObject = getSync(sync);
handleError(QuerySynciv(syncObject, pname, bufSize, length, values));
}
@@ -4562,14 +4516,14 @@ void Context::getUniformfv(GLuint program, GLint location, GLfloat *params)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
- programObject->getUniformfv(location, params);
+ programObject->getUniformfv(this, location, params);
}
void Context::getUniformiv(GLuint program, GLint location, GLint *params)
{
Program *programObject = getProgram(program);
ASSERT(programObject);
- programObject->getUniformiv(location, params);
+ programObject->getUniformiv(this, location, params);
}
GLint Context::getUniformLocation(GLuint program, const GLchar *name)
@@ -4847,4 +4801,446 @@ void Context::programBinary(GLuint program, GLenum binaryFormat, const void *bin
handleError(programObject->loadBinary(this, binaryFormat, binary, length));
}
+void Context::uniform1ui(GLint location, GLuint v0)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniform1uiv(location, 1, &v0);
+}
+
+void Context::uniform2ui(GLint location, GLuint v0, GLuint v1)
+{
+ Program *program = mGLState.getProgram();
+ const GLuint xy[] = {v0, v1};
+ program->setUniform2uiv(location, 1, xy);
+}
+
+void Context::uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+ Program *program = mGLState.getProgram();
+ const GLuint xyz[] = {v0, v1, v2};
+ program->setUniform3uiv(location, 1, xyz);
+}
+
+void Context::uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+ Program *program = mGLState.getProgram();
+ const GLuint xyzw[] = {v0, v1, v2, v3};
+ program->setUniform4uiv(location, 1, xyzw);
+}
+
+void Context::uniform1uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniform1uiv(location, count, value);
+}
+void Context::uniform2uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniform2uiv(location, count, value);
+}
+
+void Context::uniform3uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniform3uiv(location, count, value);
+}
+
+void Context::uniform4uiv(GLint location, GLsizei count, const GLuint *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniform4uiv(location, count, value);
+}
+
+void Context::genQueries(GLsizei n, GLuint *ids)
+{
+ for (GLsizei i = 0; i < n; i++)
+ {
+ GLuint handle = mQueryHandleAllocator.allocate();
+ mQueryMap.assign(handle, nullptr);
+ ids[i] = handle;
+ }
+}
+
+void Context::deleteQueries(GLsizei n, const GLuint *ids)
+{
+ for (int i = 0; i < n; i++)
+ {
+ GLuint query = ids[i];
+
+ Query *queryObject = nullptr;
+ if (mQueryMap.erase(query, &queryObject))
+ {
+ mQueryHandleAllocator.release(query);
+ if (queryObject)
+ {
+ queryObject->release(this);
+ }
+ }
+ }
+}
+
+GLboolean Context::isQuery(GLuint id)
+{
+ return (getQuery(id, false, GL_NONE) != nullptr) ? GL_TRUE : GL_FALSE;
+}
+
+void Context::uniformMatrix2x3fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniformMatrix2x3fv(location, count, transpose, value);
+}
+
+void Context::uniformMatrix3x2fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniformMatrix3x2fv(location, count, transpose, value);
+}
+
+void Context::uniformMatrix2x4fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniformMatrix2x4fv(location, count, transpose, value);
+}
+
+void Context::uniformMatrix4x2fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniformMatrix4x2fv(location, count, transpose, value);
+}
+
+void Context::uniformMatrix3x4fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniformMatrix3x4fv(location, count, transpose, value);
+}
+
+void Context::uniformMatrix4x3fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ Program *program = mGLState.getProgram();
+ program->setUniformMatrix4x3fv(location, count, transpose, value);
+}
+
+void Context::deleteVertexArrays(GLsizei n, const GLuint *arrays)
+{
+ for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
+ {
+ GLuint vertexArray = arrays[arrayIndex];
+
+ if (arrays[arrayIndex] != 0)
+ {
+ VertexArray *vertexArrayObject = nullptr;
+ if (mVertexArrayMap.erase(vertexArray, &vertexArrayObject))
+ {
+ if (vertexArrayObject != nullptr)
+ {
+ detachVertexArray(vertexArray);
+ vertexArrayObject->onDestroy(this);
+ }
+
+ mVertexArrayHandleAllocator.release(vertexArray);
+ }
+ }
+ }
+}
+
+void Context::genVertexArrays(GLsizei n, GLuint *arrays)
+{
+ for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
+ {
+ GLuint vertexArray = mVertexArrayHandleAllocator.allocate();
+ mVertexArrayMap.assign(vertexArray, nullptr);
+ arrays[arrayIndex] = vertexArray;
+ }
+}
+
+bool Context::isVertexArray(GLuint array)
+{
+ if (array == 0)
+ {
+ return GL_FALSE;
+ }
+
+ VertexArray *vao = getVertexArray(array);
+ return (vao != nullptr ? GL_TRUE : GL_FALSE);
+}
+
+void Context::endTransformFeedback()
+{
+ TransformFeedback *transformFeedback = mGLState.getCurrentTransformFeedback();
+ transformFeedback->end(this);
+}
+
+void Context::transformFeedbackVaryings(GLuint program,
+ GLsizei count,
+ const GLchar *const *varyings,
+ GLenum bufferMode)
+{
+ Program *programObject = getProgram(program);
+ ASSERT(programObject);
+ programObject->setTransformFeedbackVaryings(count, varyings, bufferMode);
+}
+
+void Context::getTransformFeedbackVarying(GLuint program,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLsizei *size,
+ GLenum *type,
+ GLchar *name)
+{
+ Program *programObject = getProgram(program);
+ ASSERT(programObject);
+ programObject->getTransformFeedbackVarying(index, bufSize, length, size, type, name);
+}
+
+void Context::deleteTransformFeedbacks(GLsizei n, const GLuint *ids)
+{
+ for (int i = 0; i < n; i++)
+ {
+ GLuint transformFeedback = ids[i];
+ if (transformFeedback == 0)
+ {
+ continue;
+ }
+
+ TransformFeedback *transformFeedbackObject = nullptr;
+ if (mTransformFeedbackMap.erase(transformFeedback, &transformFeedbackObject))
+ {
+ if (transformFeedbackObject != nullptr)
+ {
+ detachTransformFeedback(transformFeedback);
+ transformFeedbackObject->release(this);
+ }
+
+ mTransformFeedbackHandleAllocator.release(transformFeedback);
+ }
+ }
+}
+
+void Context::genTransformFeedbacks(GLsizei n, GLuint *ids)
+{
+ for (int i = 0; i < n; i++)
+ {
+ GLuint transformFeedback = mTransformFeedbackHandleAllocator.allocate();
+ mTransformFeedbackMap.assign(transformFeedback, nullptr);
+ ids[i] = transformFeedback;
+ }
+}
+
+bool Context::isTransformFeedback(GLuint id)
+{
+ if (id == 0)
+ {
+ // The 3.0.4 spec [section 6.1.11] states that if ID is zero, IsTransformFeedback
+ // returns FALSE
+ return GL_FALSE;
+ }
+
+ const TransformFeedback *transformFeedback = getTransformFeedback(id);
+ return ((transformFeedback != nullptr) ? GL_TRUE : GL_FALSE);
+}
+
+void Context::pauseTransformFeedback()
+{
+ TransformFeedback *transformFeedback = mGLState.getCurrentTransformFeedback();
+ transformFeedback->pause();
+}
+
+void Context::resumeTransformFeedback()
+{
+ TransformFeedback *transformFeedback = mGLState.getCurrentTransformFeedback();
+ transformFeedback->resume();
+}
+
+void Context::getUniformuiv(GLuint program, GLint location, GLuint *params)
+{
+ const Program *programObject = getProgram(program);
+ programObject->getUniformuiv(this, location, params);
+}
+
+GLint Context::getFragDataLocation(GLuint program, const GLchar *name)
+{
+ const Program *programObject = getProgram(program);
+ return programObject->getFragDataLocation(name);
+}
+
+void Context::getUniformIndices(GLuint program,
+ GLsizei uniformCount,
+ const GLchar *const *uniformNames,
+ GLuint *uniformIndices)
+{
+ const Program *programObject = getProgram(program);
+ if (!programObject->isLinked())
+ {
+ for (int uniformId = 0; uniformId < uniformCount; uniformId++)
+ {
+ uniformIndices[uniformId] = GL_INVALID_INDEX;
+ }
+ }
+ else
+ {
+ for (int uniformId = 0; uniformId < uniformCount; uniformId++)
+ {
+ uniformIndices[uniformId] = programObject->getUniformIndex(uniformNames[uniformId]);
+ }
+ }
+}
+
+void Context::getActiveUniformsiv(GLuint program,
+ GLsizei uniformCount,
+ const GLuint *uniformIndices,
+ GLenum pname,
+ GLint *params)
+{
+ const Program *programObject = getProgram(program);
+ for (int uniformId = 0; uniformId < uniformCount; uniformId++)
+ {
+ const GLuint index = uniformIndices[uniformId];
+ params[uniformId] = programObject->getActiveUniformi(index, pname);
+ }
+}
+
+GLuint Context::getUniformBlockIndex(GLuint program, const GLchar *uniformBlockName)
+{
+ const Program *programObject = getProgram(program);
+ return programObject->getUniformBlockIndex(uniformBlockName);
+}
+
+void Context::getActiveUniformBlockiv(GLuint program,
+ GLuint uniformBlockIndex,
+ GLenum pname,
+ GLint *params)
+{
+ const Program *programObject = getProgram(program);
+ QueryActiveUniformBlockiv(programObject, uniformBlockIndex, pname, params);
+}
+
+void Context::getActiveUniformBlockName(GLuint program,
+ GLuint uniformBlockIndex,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *uniformBlockName)
+{
+ const Program *programObject = getProgram(program);
+ programObject->getActiveUniformBlockName(uniformBlockIndex, bufSize, length, uniformBlockName);
+}
+
+void Context::uniformBlockBinding(GLuint program,
+ GLuint uniformBlockIndex,
+ GLuint uniformBlockBinding)
+{
+ Program *programObject = getProgram(program);
+ programObject->bindUniformBlock(uniformBlockIndex, uniformBlockBinding);
+}
+
+GLsync Context::fenceSync(GLenum condition, GLbitfield flags)
+{
+ GLuint handle = mState.mSyncs->createSync(mImplementation.get());
+ GLsync syncHandle = reinterpret_cast<GLsync>(static_cast<uintptr_t>(handle));
+
+ Sync *syncObject = getSync(syncHandle);
+ Error error = syncObject->set(condition, flags);
+ if (error.isError())
+ {
+ deleteSync(syncHandle);
+ handleError(error);
+ return nullptr;
+ }
+
+ return syncHandle;
+}
+
+GLboolean Context::isSync(GLsync sync)
+{
+ return (getSync(sync) != nullptr);
+}
+
+GLenum Context::clientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ Sync *syncObject = getSync(sync);
+
+ GLenum result = GL_WAIT_FAILED;
+ handleError(syncObject->clientWait(flags, timeout, &result));
+ return result;
+}
+
+void Context::waitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ Sync *syncObject = getSync(sync);
+ handleError(syncObject->serverWait(flags, timeout));
+}
+
+void Context::getInteger64v(GLenum pname, GLint64 *params)
+{
+ GLenum nativeType = GL_NONE;
+ unsigned int numParams = 0;
+ getQueryParameterInfo(pname, &nativeType, &numParams);
+
+ if (nativeType == GL_INT_64_ANGLEX)
+ {
+ getInteger64vImpl(pname, params);
+ }
+ else
+ {
+ CastStateValues(this, nativeType, pname, numParams, params);
+ }
+}
+
+void Context::getBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params)
+{
+ Buffer *buffer = mGLState.getTargetBuffer(target);
+ QueryBufferParameteri64v(buffer, pname, params);
+}
+
+void Context::genSamplers(GLsizei count, GLuint *samplers)
+{
+ for (int i = 0; i < count; i++)
+ {
+ samplers[i] = mState.mSamplers->createSampler();
+ }
+}
+
+void Context::deleteSamplers(GLsizei count, const GLuint *samplers)
+{
+ for (int i = 0; i < count; i++)
+ {
+ GLuint sampler = samplers[i];
+
+ if (mState.mSamplers->getSampler(sampler))
+ {
+ detachSampler(sampler);
+ }
+
+ mState.mSamplers->deleteObject(this, sampler);
+ }
+}
+
+void Context::getInternalformativ(GLenum target,
+ GLenum internalformat,
+ GLenum pname,
+ GLsizei bufSize,
+ GLint *params)
+{
+ const TextureCaps &formatCaps = mTextureCaps.get(internalformat);
+ QueryInternalFormativ(formatCaps, pname, bufSize, params);
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/Context.h b/chromium/third_party/angle/src/libANGLE/Context.h
index 163a5705c08..40a292046f7 100644
--- a/chromium/third_party/angle/src/libANGLE/Context.h
+++ b/chromium/third_party/angle/src/libANGLE/Context.h
@@ -46,7 +46,7 @@ namespace gl
class Buffer;
class Compiler;
class FenceNV;
-class FenceSync;
+class Sync;
class Framebuffer;
class MemoryProgramCache;
class Program;
@@ -84,9 +84,6 @@ class Context final : public ValidationContext
GLuint createProgram();
GLuint createTexture();
GLuint createRenderbuffer();
- GLuint createSampler();
- GLuint createTransformFeedback();
- GLsync createFenceSync();
GLuint createPaths(GLsizei range);
void deleteBuffer(GLuint buffer);
@@ -94,9 +91,6 @@ class Context final : public ValidationContext
void deleteProgram(GLuint program);
void deleteTexture(GLuint texture);
void deleteRenderbuffer(GLuint renderbuffer);
- void deleteSampler(GLuint sampler);
- void deleteTransformFeedback(GLuint transformFeedback);
- void deleteFenceSync(GLsync fenceSync);
void deletePaths(GLuint first, GLsizei range);
// CHROMIUM_path_rendering
@@ -120,14 +114,6 @@ class Context final : public ValidationContext
GLuint createFenceNV();
void deleteFenceNV(GLuint fence);
- // Queries are owned by the Context;
- GLuint createQuery();
- void deleteQuery(GLuint query);
-
- // Vertex arrays are owned by the Context
- GLuint createVertexArray();
- void deleteVertexArray(GLuint vertexArray);
-
void bindArrayBuffer(GLuint bufferHandle);
void bindElementArrayBuffer(GLuint bufferHandle);
void bindTexture(GLenum target, GLuint handle);
@@ -171,19 +157,19 @@ class Context final : public ValidationContext
void bindPixelPackBuffer(GLuint bufferHandle);
void bindPixelUnpackBuffer(GLuint bufferHandle);
void useProgram(GLuint program);
- void bindTransformFeedback(GLuint transformFeedbackHandle);
+ void bindTransformFeedback(GLenum target, GLuint transformFeedbackHandle);
void bindDrawIndirectBuffer(GLuint bufferHandle);
- Error beginQuery(GLenum target, GLuint query);
- Error endQuery(GLenum target);
- Error queryCounter(GLuint id, GLenum target);
+ void beginQuery(GLenum target, GLuint query);
+ void endQuery(GLenum target);
+ void queryCounter(GLuint id, GLenum target);
void getQueryiv(GLenum target, GLenum pname, GLint *params);
void getQueryObjectiv(GLuint id, GLenum pname, GLint *params);
void getQueryObjectuiv(GLuint id, GLenum pname, GLuint *params);
void getQueryObjecti64v(GLuint id, GLenum pname, GLint64 *params);
void getQueryObjectui64v(GLuint id, GLenum pname, GLuint64 *params);
- void setVertexAttribDivisor(GLuint index, GLuint divisor);
+ void vertexAttribDivisor(GLuint index, GLuint divisor);
void setVertexBindingDivisor(GLuint bindingIndex, GLuint divisor);
void getBufferParameteriv(GLenum target, GLenum pname, GLint *params);
@@ -218,10 +204,18 @@ class Context final : public ValidationContext
GLsizei *length,
GLchar *name);
GLint getProgramResourceLocation(GLuint program, GLenum programInterface, const GLchar *name);
+ void getProgramResourceiv(GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei propCount,
+ const GLenum *props,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *params);
Buffer *getBuffer(GLuint handle) const;
FenceNV *getFenceNV(GLuint handle);
- FenceSync *getFenceSync(GLsync handle) const;
+ Sync *getSync(GLsync handle) const;
Texture *getTexture(GLuint handle) const;
Framebuffer *getFramebuffer(GLuint handle) const;
Renderbuffer *getRenderbuffer(GLuint handle) const;
@@ -255,7 +249,7 @@ class Context final : public ValidationContext
void getFloatvImpl(GLenum pname, GLfloat *params);
void getIntegerv(GLenum pname, GLint *params);
void getIntegervImpl(GLenum pname, GLint *params);
- void getInteger64v(GLenum pname, GLint64 *params);
+ void getInteger64vImpl(GLenum pname, GLint64 *params);
void getPointerv(GLenum pname, void **params) const;
void getBooleani_v(GLenum target, GLuint index, GLboolean *data);
void getIntegeri_v(GLenum target, GLuint index, GLint *data);
@@ -772,6 +766,67 @@ class Context final : public ValidationContext
void uniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
void validateProgram(GLuint program);
+ void genQueries(GLsizei n, GLuint *ids);
+ void deleteQueries(GLsizei n, const GLuint *ids);
+ GLboolean isQuery(GLuint id);
+
+ void uniform1ui(GLint location, GLuint v0);
+ void uniform2ui(GLint location, GLuint v0, GLuint v1);
+ void uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2);
+ void uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+ void uniform1uiv(GLint location, GLsizei count, const GLuint *value);
+ void uniform2uiv(GLint location, GLsizei count, const GLuint *value);
+ void uniform3uiv(GLint location, GLsizei count, const GLuint *value);
+ void uniform4uiv(GLint location, GLsizei count, const GLuint *value);
+
+ void uniformMatrix2x3fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+ void uniformMatrix3x2fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+ void uniformMatrix2x4fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+ void uniformMatrix4x2fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+ void uniformMatrix3x4fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+ void uniformMatrix4x3fv(GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+
+ void deleteVertexArrays(GLsizei n, const GLuint *arrays);
+ void genVertexArrays(GLsizei n, GLuint *arrays);
+ bool isVertexArray(GLuint array);
+
+ void endTransformFeedback();
+ void transformFeedbackVaryings(GLuint program,
+ GLsizei count,
+ const GLchar *const *varyings,
+ GLenum bufferMode);
+ void getTransformFeedbackVarying(GLuint program,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLsizei *size,
+ GLenum *type,
+ GLchar *name);
+
+ void deleteTransformFeedbacks(GLsizei n, const GLuint *ids);
+ void genTransformFeedbacks(GLsizei n, GLuint *ids);
+ bool isTransformFeedback(GLuint id);
+ void pauseTransformFeedback();
+ void resumeTransformFeedback();
+
void getProgramBinary(GLuint program,
GLsizei bufSize,
GLsizei *length,
@@ -779,7 +834,47 @@ class Context final : public ValidationContext
void *binary);
void programBinary(GLuint program, GLenum binaryFormat, const void *binary, GLsizei length);
- void handleError(const Error &error) override;
+ void getUniformuiv(GLuint program, GLint location, GLuint *params);
+ GLint getFragDataLocation(GLuint program, const GLchar *name);
+ void getUniformIndices(GLuint program,
+ GLsizei uniformCount,
+ const GLchar *const *uniformNames,
+ GLuint *uniformIndices);
+ void getActiveUniformsiv(GLuint program,
+ GLsizei uniformCount,
+ const GLuint *uniformIndices,
+ GLenum pname,
+ GLint *params);
+ GLuint getUniformBlockIndex(GLuint program, const GLchar *uniformBlockName);
+ void getActiveUniformBlockiv(GLuint program,
+ GLuint uniformBlockIndex,
+ GLenum pname,
+ GLint *params);
+ void getActiveUniformBlockName(GLuint program,
+ GLuint uniformBlockIndex,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *uniformBlockName);
+ void uniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+
+ GLsync fenceSync(GLenum condition, GLbitfield flags);
+ GLboolean isSync(GLsync sync);
+ void deleteSync(GLsync sync);
+ GLenum clientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void waitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
+ void getInteger64v(GLenum pname, GLint64 *params);
+
+ void getBufferParameteri64v(GLenum target, GLenum pname, GLint64 *params);
+ void genSamplers(GLsizei count, GLuint *samplers);
+ void deleteSamplers(GLsizei count, const GLuint *samplers);
+ void getInternalformativ(GLenum target,
+ GLenum internalformat,
+ GLenum pname,
+ GLsizei bufSize,
+ GLint *params);
+
+ // Returns the error.
+ Error handleError(const Error &error) override;
GLenum getError();
void markContextLost();
@@ -832,6 +927,7 @@ class Context final : public ValidationContext
egl::Surface *getCurrentReadSurface() const { return mCurrentSurface; }
private:
+ Error prepareForDraw(GLenum drawMode);
void syncRendererState();
void syncRendererState(const State::DirtyBits &bitMask, const State::DirtyObjects &objectMask);
void syncStateForReadPixels();
@@ -888,7 +984,7 @@ class Context final : public ValidationContext
HandleAllocator mVertexArrayHandleAllocator;
ResourceMap<TransformFeedback> mTransformFeedbackMap;
- HandleAllocator mTransformFeedbackAllocator;
+ HandleAllocator mTransformFeedbackHandleAllocator;
const char *mVersionString;
const char *mShadingLanguageString;
@@ -932,7 +1028,7 @@ class Context final : public ValidationContext
};
template <EntryPoint EP, typename... ArgsT>
-void Context::gatherParams(ArgsT &&... args)
+ANGLE_INLINE void Context::gatherParams(ArgsT &&... args)
{
static_assert(sizeof(EntryPointParamType<EP>) <= kParamsBufferSize,
"Params struct too large, please increase kParamsBufferSize.");
diff --git a/chromium/third_party/angle/src/libANGLE/ContextState.cpp b/chromium/third_party/angle/src/libANGLE/ContextState.cpp
index f1e89d9cf64..ca3d2ef0f5b 100644
--- a/chromium/third_party/angle/src/libANGLE/ContextState.cpp
+++ b/chromium/third_party/angle/src/libANGLE/ContextState.cpp
@@ -86,8 +86,7 @@ ContextState::ContextState(ContextID contextIn,
mRenderbuffers(
AllocateOrGetSharedResourceManager(shareContextState, &ContextState::mRenderbuffers)),
mSamplers(AllocateOrGetSharedResourceManager(shareContextState, &ContextState::mSamplers)),
- mFenceSyncs(
- AllocateOrGetSharedResourceManager(shareContextState, &ContextState::mFenceSyncs)),
+ mSyncs(AllocateOrGetSharedResourceManager(shareContextState, &ContextState::mSyncs)),
mPaths(AllocateOrGetSharedResourceManager(shareContextState, &ContextState::mPaths)),
mFramebuffers(new FramebufferManager())
{
@@ -98,9 +97,14 @@ ContextState::~ContextState()
// Handles are released by the Context.
}
+bool ContextState::isWebGL() const
+{
+ return mExtensions.webglCompatibility;
+}
+
bool ContextState::isWebGL1() const
{
- return (mExtensions.webglCompatibility && mClientVersion.major == 2);
+ return (isWebGL() && mClientVersion.major == 2);
}
const TextureCaps &ContextState::getTextureCap(GLenum internalFormat) const
@@ -229,6 +233,17 @@ bool ValidationContext::getQueryParameterInfo(GLenum pname, GLenum *type, unsign
*numParams = 1;
return true;
}
+ case GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE:
+ case GL_TEXTURE_BINDING_RECTANGLE_ANGLE:
+ {
+ if (!getExtensions().textureRectangle)
+ {
+ return false;
+ }
+ *type = GL_INT;
+ *numParams = 1;
+ return true;
+ }
case GL_MAX_DRAW_BUFFERS_EXT:
case GL_MAX_COLOR_ATTACHMENTS_EXT:
{
diff --git a/chromium/third_party/angle/src/libANGLE/ContextState.h b/chromium/third_party/angle/src/libANGLE/ContextState.h
index 6f6a167d066..eed578fed2e 100644
--- a/chromium/third_party/angle/src/libANGLE/ContextState.h
+++ b/chromium/third_party/angle/src/libANGLE/ContextState.h
@@ -19,12 +19,12 @@ namespace gl
{
class BufferManager;
class ContextState;
-class FenceSyncManager;
class FramebufferManager;
class PathManager;
class RenderbufferManager;
class SamplerManager;
class ShaderProgramManager;
+class SyncManager;
class TextureManager;
class ValidationContext;
@@ -62,6 +62,7 @@ class ContextState final : angle::NonCopyable
bool usingDisplayTextureShareGroup() const;
+ bool isWebGL() const;
bool isWebGL1() const;
private:
@@ -81,7 +82,7 @@ class ContextState final : angle::NonCopyable
TextureManager *mTextures;
RenderbufferManager *mRenderbuffers;
SamplerManager *mSamplers;
- FenceSyncManager *mFenceSyncs;
+ SyncManager *mSyncs;
PathManager *mPaths;
FramebufferManager *mFramebuffers;
};
@@ -100,7 +101,7 @@ class ValidationContext : angle::NonCopyable
bool skipValidation);
virtual ~ValidationContext() {}
- virtual void handleError(const Error &error) = 0;
+ virtual Error handleError(const Error &error) = 0;
const ContextState &getContextState() const { return mState; }
GLint getClientMajorVersion() const { return mState.getClientMajorVersion(); }
@@ -130,6 +131,7 @@ class ValidationContext : angle::NonCopyable
// Hack for the special WebGL 1 "DEPTH_STENCIL" internal format.
GLenum getConvertedRenderbufferFormat(GLenum internalformat) const;
+ bool isWebGL() const { return mState.isWebGL(); }
bool isWebGL1() const { return mState.isWebGL1(); }
template <typename T>
diff --git a/chromium/third_party/angle/src/libANGLE/Error.h b/chromium/third_party/angle/src/libANGLE/Error.h
index 9357b41637b..7e8c70b4efd 100644
--- a/chromium/third_party/angle/src/libANGLE/Error.h
+++ b/chromium/third_party/angle/src/libANGLE/Error.h
@@ -205,16 +205,19 @@ inline Error NoError()
#define ANGLE_CONCAT2(x, y) ANGLE_CONCAT1(x, y)
#define ANGLE_LOCAL_VAR ANGLE_CONCAT2(_localVar, __LINE__)
-#define ANGLE_TRY(EXPR) \
+#define ANGLE_TRY_TEMPLATE(EXPR, FUNC) \
{ \
auto ANGLE_LOCAL_VAR = EXPR; \
if (ANGLE_LOCAL_VAR.isError()) \
{ \
- return ANGLE_LOCAL_VAR; \
+ FUNC(ANGLE_LOCAL_VAR); \
} \
} \
ANGLE_EMPTY_STATEMENT
+#define ANGLE_RETURN(X) return X;
+#define ANGLE_TRY(EXPR) ANGLE_TRY_TEMPLATE(EXPR, ANGLE_RETURN);
+
#define ANGLE_TRY_RESULT(EXPR, RESULT) \
{ \
auto ANGLE_LOCAL_VAR = EXPR; \
diff --git a/chromium/third_party/angle/src/libANGLE/ErrorStrings.h b/chromium/third_party/angle/src/libANGLE/ErrorStrings.h
index e4bbb2464bc..369b4443ab4 100644
--- a/chromium/third_party/angle/src/libANGLE/ErrorStrings.h
+++ b/chromium/third_party/angle/src/libANGLE/ErrorStrings.h
@@ -16,27 +16,35 @@
namespace gl
{
-ERRMSG(ActiveTextureRange, "Cannot be less than 0 or greater than maximum number of textures.");
ERRMSG(BufferNotBound, "A buffer must be bound.");
-ERRMSG(ClearInvalidMask, "Invalid mask bits.");
+ERRMSG(CompressedTextureDimensionsMustMatchData,
+ "Compressed texture dimensions must exactly match the dimensions of the data passed in.");
ERRMSG(CompressedTexturesNotAttachable, "Compressed textures cannot be attached to a framebuffer.");
ERRMSG(CubemapFacesEqualDimensions, "Each cubemap face must have equal width and height.");
ERRMSG(CubemapIncomplete,
"Texture is not cubemap complete. All cubemaps faces must be defined and be the same size.");
+ERRMSG(DefaultFramebufferInvalidAttachment,
+ "Invalid attachment when the default framebuffer is bound.");
ERRMSG(DefaultFramebufferTarget, "It is invalid to change default FBO's attachments");
ERRMSG(EnumNotSupported, "Enum is not currently supported.");
ERRMSG(EnumRequiresGLES31, "Enum requires GLES 3.1");
+ERRMSG(ES31Required, "OpenGL ES 3.1 Required");
+ERRMSG(ES3Required, "OpenGL ES 3.0 Required.");
ERRMSG(ExceedsMaxElement, "Element value exceeds maximum element index.");
ERRMSG(ExpectedProgramName, "Expected a program name, but found a shader name.");
ERRMSG(ExpectedShaderName, "Expected a shader name, but found a program name.");
ERRMSG(ExtensionNotEnabled, "Extension is not enabled.");
+ERRMSG(FeedbackLoop, "Feedback loop formed between Framebuffer and active Texture.");
ERRMSG(FramebufferIncompleteAttachment,
"Attachment type must be compatible with attachment object.");
-ERRMSG(FramebufferInvalidAttachment, "Invalid Attachment Type");
ERRMSG(GenerateMipmapNotAllowed, "Compressed textures do not support mipmap generation.");
-ERRMSG(IndexExceedsMax, "Index exceeds MAX_VERTEX_ATTRIBS");
+ERRMSG(IndexExceedsMaxActiveUniform, "Index exceeds program active uniform count.");
+ERRMSG(IndexExceedsMaxDrawBuffer, "Index exceeds MAX_DRAW_BUFFERS.");
+ERRMSG(IndexExceedsMaxVertexAttribute, "Index exceeds MAX_VERTEX_ATTRIBS.");
ERRMSG(InsufficientBufferSize, "Insufficient buffer size.");
+ERRMSG(InsufficientVertexBufferSize, "Vertex buffer is not big enough for the draw call");
ERRMSG(IntegerOverflow, "Integer overflow.");
+ERRMSG(InvalidAttachment, "Invalid Attachment Type.");
ERRMSG(InvalidBlendEquation, "Invalid blend equation.");
ERRMSG(InvalidBlendFunction, "Invalid blend function.");
ERRMSG(InvalidBorder, "Border must be 0.");
@@ -47,53 +55,86 @@ ERRMSG(InvalidConstantColor,
"CONSTANT_COLOR (or ONE_MINUS_CONSTANT_COLOR) and CONSTANT_ALPHA (or "
"ONE_MINUS_CONSTANT_ALPHA) cannot be used together as source and destination factors in the "
"blend function.");
+ERRMSG(InvalidCoverMode, "Invalid cover mode.");
ERRMSG(InvalidCullMode, "Cull mode not recognized.");
+ERRMSG(InvalidDebugSeverity, "Invalid debug severity.");
+ERRMSG(InvalidDebugSource, "Invalid debug source.");
+ERRMSG(InvalidDebugType, "Invalid debug type.");
ERRMSG(InvalidDepthRange, "Near value cannot be greater than far.");
ERRMSG(InvalidDrawMode, "Invalid draw mode.");
ERRMSG(InvalidDrawModeTransformFeedback,
"Draw mode must match current transform feedback object's draw mode.");
+ERRMSG(InvalidFillMode, "Invalid fill mode.");
+ERRMSG(InvalidFilterTexture, "Texture only supports NEAREST and LINEAR filtering.");
ERRMSG(InvalidFormat, "Invalid format.");
ERRMSG(InvalidFramebufferTarget, "Invalid framebuffer target.");
ERRMSG(InvalidFramebufferTextureLevel, "Mipmap level must be 0 when attaching a texture.");
+ERRMSG(InvalidFramebufferTextureParameter, "Invalid parameter name for framebuffer attachment.");
ERRMSG(InvalidInternalFormat, "Invalid internal format.");
+ERRMSG(InvalidMatrixMode, "Invalid matrix mode.");
ERRMSG(InvalidMipLevel, "Level of detail outside of range.");
+ERRMSG(InvalidName, "Invalid name.");
ERRMSG(InvalidNameCharacters, "Name contains invalid characters.");
+ERRMSG(InvalidPname, "Invalid pname.");
ERRMSG(InvalidPrecision, "Invalid or unsupported precision type.");
ERRMSG(InvalidProgramName, "Program object expected.");
+ERRMSG(InvalidQueryId, "Invalid query Id.");
+ERRMSG(InvalidQueryTarget, "Invalid query target.");
+ERRMSG(InvalidQueryType, "Invalid query type.");
+ERRMSG(InvalidRange, "Invalid range.");
ERRMSG(InvalidRenderbufferInternalFormat, "Invalid renderbuffer internalformat.");
ERRMSG(InvalidRenderbufferTarget, "Invalid renderbuffer target.");
ERRMSG(InvalidRenderbufferTextureParameter, "Invalid parameter name for renderbuffer attachment.");
ERRMSG(InvalidRenderbufferWidthHeight,
"Renderbuffer width and height cannot be negative and cannot exceed maximum texture size.");
+ERRMSG(InvalidSampler, "Sampler is not valid");
ERRMSG(InvalidShaderName, "Shader object expected.");
ERRMSG(InvalidShaderType, "Invalid shader type.");
ERRMSG(InvalidStencil, "Invalid stencil.");
+ERRMSG(InvalidStencilBitMask, "Invalid stencil bit mask.");
+ERRMSG(InvalidTarget, "Invalid target.");
ERRMSG(InvalidTextureFilterParam, "Texture filter not recognized.");
+ERRMSG(InvalidTextureRange, "Cannot be less than 0 or greater than maximum number of textures.");
ERRMSG(InvalidTextureTarget, "Invalid or unsupported texture target.");
+ERRMSG(InvalidTextureWrap, "Texture wrap mode not recognized.");
ERRMSG(InvalidType, "Invalid type.");
ERRMSG(InvalidTypePureInt, "Invalid type, should be integer");
ERRMSG(InvalidUnpackAlignment, "Unpack alignment must be 1, 2, 4, or 8.");
ERRMSG(InvalidVertexAttrSize, "Vertex attribute size must be 1, 2, 3, or 4.");
+ERRMSG(InvalidWidth, "Invalid width.");
+ERRMSG(InvalidWrapModeTexture, "Invalid wrap mode for texture type.");
+ERRMSG(LevelNotZero, "Texture level must be zero.");
+ERRMSG(MismatchedByteCountType, "Buffer size does not align with data type.");
ERRMSG(MismatchedFormat, "Format must match internal format.");
+ERRMSG(MismatchedTargetAndFormat, "Invalid texture target and format combination.");
ERRMSG(MismatchedTypeAndFormat, "Invalid format and type combination.");
ERRMSG(MismatchedVariableProgram, "Variable is not part of the current program.");
ERRMSG(MissingReadAttachment, "Missing read attachment.");
ERRMSG(MustHaveElementArrayBinding, "Must have element array buffer binding.");
ERRMSG(NameBeginsWithGL, "Attributes that begin with 'gl_' are not allowed.");
+ERRMSG(NegativeAttachments, "Negative number of attachments.");
ERRMSG(NegativeBufferSize, "Negative buffer size.");
ERRMSG(NegativeCount, "Negative count.");
ERRMSG(NegativeLength, "Negative length.");
+ERRMSG(NegativeMaxCount, "Negative maxcount.");
ERRMSG(NegativeOffset, "Negative offset.");
+ERRMSG(NegativePrimcount, "Primcount must be greater than or equal to zero.");
ERRMSG(NegativeSize, "Cannot have negative height or width.");
ERRMSG(NegativeStart, "Cannot have negative start.");
ERRMSG(NegativeStride, "Cannot have negative stride.");
+ERRMSG(NoSuchPath, "No such path object.");
+ERRMSG(NoZeroDivisor, "At least one enabled attribute must have a divisor of zero.");
ERRMSG(ObjectNotGenerated, "Object cannot be used because it has not been generated.");
ERRMSG(OffsetMustBeMultipleOfType, "Offset must be a multiple of the passed in datatype.");
ERRMSG(OutsideOfBounds, "Parameter outside of bounds.");
ERRMSG(ParamOverflow, "The provided parameters overflow with the provided buffer.");
+ERRMSG(PixelDataNotNull, "Pixel data must be null.");
ERRMSG(ProgramDoesNotExist, "Program doesn't exist.");
ERRMSG(ProgramNotBound, "A program must be bound.");
ERRMSG(ProgramNotLinked, "Program not linked.");
+ERRMSG(QueryActive, "Query is active.");
+ERRMSG(QueryExtensionNotEnabled, "Query extension not enabled.");
+ERRMSG(ReadBufferNone, "Read buffer is GL_NONE.");
ERRMSG(RenderbufferNotBound, "A renderbuffer must be bound.");
ERRMSG(ResourceMaxTextureSize, "Desired resource size is greater than max texture size.");
ERRMSG(ShaderAttachmentHasShader, "Shader attachment already has a shader.");
@@ -107,14 +148,21 @@ ERRMSG(StencilReferenceMaskOrMismatch,
ERRMSG(StrideMustBeMultipleOfType, "Stride must be a multiple of the passed in datatype.");
ERRMSG(TextureNotBound, "A texture must be bound.");
ERRMSG(TextureNotPow2, "The texture is a non-power-of-two texture.");
-ERRMSG(TypeMustMatchOriginalType,
+ERRMSG(TransformFeedbackDoesNotExist, "Transform feedback object that does not exist.");
+ERRMSG(TypeMismatch,
"Passed in texture target and format must match the one originally used to define the "
"texture.");
ERRMSG(TypeNotUnsignedShortByte, "Only UNSIGNED_SHORT and UNSIGNED_BYTE types are supported.");
-ERRMSG(UniformSizeDoesNotMatchMethod, "Uniform size does not match uniform method.");
+ERRMSG(UniformSizeMismatch, "Uniform size does not match uniform method.");
+ERRMSG(UnknownParameter, "Unknown parameter value.");
+ERRMSG(VertexArrayNoBuffer, "An enabled vertex array has no buffer.");
+ERRMSG(VertexArrayNoBufferPointer, "An enabled vertex array has no buffer and no pointer.");
ERRMSG(ViewportNegativeSize, "Viewport size cannot be negative.");
+ERRMSG(Webgl2NameLengthLimitExceeded, "Location lengths must not be greater than 1024 characters.");
ERRMSG(WebglBindAttribLocationReservedPrefix,
"Attributes that begin with 'webgl_', or '_webgl_' are not allowed.");
+ERRMSG(WebglNameLengthLimitExceeded,
+ "Location name lengths must not be greater than 256 characters.");
}
#undef ERRMSG
#endif // LIBANGLE_ERRORSTRINGS_H_
diff --git a/chromium/third_party/angle/src/libANGLE/Fence.cpp b/chromium/third_party/angle/src/libANGLE/Fence.cpp
index 2e1c5903dc6..be663db7508 100644
--- a/chromium/third_party/angle/src/libANGLE/Fence.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Fence.cpp
@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
-// Fence.cpp: Implements the gl::FenceNV and gl::FenceSync classes, which support the GL_NV_fence
+// Fence.cpp: Implements the gl::FenceNV and gl::Sync classes, which support the GL_NV_fence
// extension and GLES3 sync objects.
#include "libANGLE/Fence.h"
@@ -13,7 +13,7 @@
#include "common/utilities.h"
#include "libANGLE/renderer/FenceNVImpl.h"
-#include "libANGLE/renderer/FenceSyncImpl.h"
+#include "libANGLE/renderer/SyncImpl.h"
namespace gl
{
@@ -74,27 +74,31 @@ Error FenceNV::finish()
return NoError();
}
-FenceSync::FenceSync(rx::FenceSyncImpl *impl, GLuint id)
- : RefCountObject(id), mFence(impl), mLabel(), mCondition(GL_SYNC_GPU_COMMANDS_COMPLETE), mFlags(0)
+Sync::Sync(rx::SyncImpl *impl, GLuint id)
+ : RefCountObject(id),
+ mFence(impl),
+ mLabel(),
+ mCondition(GL_SYNC_GPU_COMMANDS_COMPLETE),
+ mFlags(0)
{
}
-FenceSync::~FenceSync()
+Sync::~Sync()
{
SafeDelete(mFence);
}
-void FenceSync::setLabel(const std::string &label)
+void Sync::setLabel(const std::string &label)
{
mLabel = label;
}
-const std::string &FenceSync::getLabel() const
+const std::string &Sync::getLabel() const
{
return mLabel;
}
-Error FenceSync::set(GLenum condition, GLbitfield flags)
+Error Sync::set(GLenum condition, GLbitfield flags)
{
Error error = mFence->set(condition, flags);
if (error.isError())
@@ -107,20 +111,20 @@ Error FenceSync::set(GLenum condition, GLbitfield flags)
return NoError();
}
-Error FenceSync::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
+Error Sync::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
{
ASSERT(mCondition != GL_NONE);
return mFence->clientWait(flags, timeout, outResult);
}
-Error FenceSync::serverWait(GLbitfield flags, GLuint64 timeout)
+Error Sync::serverWait(GLbitfield flags, GLuint64 timeout)
{
return mFence->serverWait(flags, timeout);
}
-Error FenceSync::getStatus(GLint *outResult) const
+Error Sync::getStatus(GLint *outResult) const
{
return mFence->getStatus(outResult);
}
-}
+} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/Fence.h b/chromium/third_party/angle/src/libANGLE/Fence.h
index 876840712c3..2a0fc8e0c58 100644
--- a/chromium/third_party/angle/src/libANGLE/Fence.h
+++ b/chromium/third_party/angle/src/libANGLE/Fence.h
@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
-// Fence.h: Defines the gl::FenceNV and gl::FenceSync classes, which support the GL_NV_fence
+// Fence.h: Defines the gl::FenceNV and gl::Sync classes, which support the GL_NV_fence
// extension and GLES3 sync objects.
#ifndef LIBANGLE_FENCE_H_
@@ -19,7 +19,7 @@
namespace rx
{
class FenceNVImpl;
-class FenceSyncImpl;
+class SyncImpl;
}
namespace gl
@@ -48,11 +48,11 @@ class FenceNV final : angle::NonCopyable
GLenum mCondition;
};
-class FenceSync final : public RefCountObject, public LabeledObject
+class Sync final : public RefCountObject, public LabeledObject
{
public:
- FenceSync(rx::FenceSyncImpl *impl, GLuint id);
- virtual ~FenceSync();
+ Sync(rx::SyncImpl *impl, GLuint id);
+ virtual ~Sync();
void onDestroy(const Context *context) override {}
@@ -68,7 +68,7 @@ class FenceSync final : public RefCountObject, public LabeledObject
GLbitfield getFlags() const { return mFlags; }
private:
- rx::FenceSyncImpl *mFence;
+ rx::SyncImpl *mFence;
std::string mLabel;
@@ -76,6 +76,6 @@ class FenceSync final : public RefCountObject, public LabeledObject
GLbitfield mFlags;
};
-}
+} // namespace gl
#endif // LIBANGLE_FENCE_H_
diff --git a/chromium/third_party/angle/src/libANGLE/Fence_unittest.cpp b/chromium/third_party/angle/src/libANGLE/Fence_unittest.cpp
index 6305f78986b..39972cadd2f 100644
--- a/chromium/third_party/angle/src/libANGLE/Fence_unittest.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Fence_unittest.cpp
@@ -8,7 +8,7 @@
#include "gtest/gtest.h"
#include "libANGLE/Fence.h"
#include "libANGLE/renderer/FenceNVImpl.h"
-#include "libANGLE/renderer/FenceSyncImpl.h"
+#include "libANGLE/renderer/SyncImpl.h"
using ::testing::_;
using ::testing::Return;
@@ -84,13 +84,13 @@ TEST_F(FenceNVTest, SetAndTestBehavior)
}
//
-// FenceSync tests
+// Sync tests
//
-class MockFenceSyncImpl : public rx::FenceSyncImpl
+class MockSyncImpl : public rx::SyncImpl
{
public:
- virtual ~MockFenceSyncImpl() { destroy(); }
+ virtual ~MockSyncImpl() { destroy(); }
MOCK_METHOD2(set, gl::Error(GLenum, GLbitfield));
MOCK_METHOD3(clientWait, gl::Error(GLbitfield, GLuint64, GLenum *));
@@ -105,24 +105,24 @@ class FenceSyncTest : public testing::Test
protected:
virtual void SetUp()
{
- mImpl = new MockFenceSyncImpl;
+ mImpl = new MockSyncImpl;
EXPECT_CALL(*mImpl, destroy());
- mFence = new gl::FenceSync(mImpl, 1);
+ mFence = new gl::Sync(mImpl, 1);
mFence->addRef();
}
virtual void TearDown() { mFence->release(nullptr); }
- MockFenceSyncImpl *mImpl;
- gl::FenceSync* mFence;
+ MockSyncImpl *mImpl;
+ gl::Sync *mFence;
};
TEST_F(FenceSyncTest, DestructionDeletesImpl)
{
- MockFenceSyncImpl* impl = new MockFenceSyncImpl;
+ MockSyncImpl *impl = new MockSyncImpl;
EXPECT_CALL(*impl, destroy()).Times(1).RetiresOnSaturation();
- gl::FenceSync* fence = new gl::FenceSync(impl, 1);
+ gl::Sync *fence = new gl::Sync(impl, 1);
fence->addRef();
fence->release(nullptr);
diff --git a/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp b/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp
index b5803ce55ac..3892f1fddb4 100644
--- a/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Framebuffer.cpp
@@ -39,6 +39,32 @@ void BindResourceChannel(OnAttachmentDirtyBinding *binding, FramebufferAttachmen
binding->bind(resource ? resource->getDirtyChannel() : nullptr);
}
+bool CheckMultiviewStateMatchesForCompleteness(const FramebufferAttachment *firstAttachment,
+ const FramebufferAttachment *secondAttachment)
+{
+ ASSERT(firstAttachment && secondAttachment);
+ ASSERT(firstAttachment->isAttached() && secondAttachment->isAttached());
+
+ if (firstAttachment->getNumViews() != secondAttachment->getNumViews())
+ {
+ return false;
+ }
+ if (firstAttachment->getBaseViewIndex() != secondAttachment->getBaseViewIndex())
+ {
+ return false;
+ }
+ if (firstAttachment->getMultiviewLayout() != secondAttachment->getMultiviewLayout())
+ {
+ return false;
+ }
+ if (firstAttachment->getMultiviewViewportOffsets() !=
+ secondAttachment->getMultiviewViewportOffsets())
+ {
+ return false;
+ }
+ return true;
+}
+
bool CheckAttachmentCompleteness(const Context *context, const FramebufferAttachment &attachment)
{
ASSERT(attachment.isAttached());
@@ -201,7 +227,6 @@ FramebufferState::FramebufferState(const Caps &caps)
{
ASSERT(mDrawBufferStates.size() > 0);
mDrawBufferStates[0] = GL_COLOR_ATTACHMENT0_EXT;
- mEnabledDrawBuffers.set(0);
}
FramebufferState::~FramebufferState()
@@ -428,6 +453,46 @@ bool FramebufferState::hasStencil() const
return (mStencilAttachment.isAttached() && mStencilAttachment.getStencilSize() > 0);
}
+GLsizei FramebufferState::getNumViews() const
+{
+ const FramebufferAttachment *attachment = getFirstNonNullAttachment();
+ if (attachment == nullptr)
+ {
+ return FramebufferAttachment::kDefaultNumViews;
+ }
+ return attachment->getNumViews();
+}
+
+const std::vector<Offset> *FramebufferState::getViewportOffsets() const
+{
+ const FramebufferAttachment *attachment = getFirstNonNullAttachment();
+ if (attachment == nullptr)
+ {
+ return nullptr;
+ }
+ return &attachment->getMultiviewViewportOffsets();
+}
+
+GLenum FramebufferState::getMultiviewLayout() const
+{
+ const FramebufferAttachment *attachment = getFirstNonNullAttachment();
+ if (attachment == nullptr)
+ {
+ return GL_NONE;
+ }
+ return attachment->getMultiviewLayout();
+}
+
+int FramebufferState::getBaseViewIndex() const
+{
+ const FramebufferAttachment *attachment = getFirstNonNullAttachment();
+ if (attachment == nullptr)
+ {
+ return GL_NONE;
+ }
+ return attachment->getBaseViewIndex();
+}
+
Framebuffer::Framebuffer(const Caps &caps, rx::GLImplFactory *factory, GLuint id)
: mState(caps),
mImpl(factory->createFramebuffer(mState)),
@@ -798,6 +863,8 @@ GLenum Framebuffer::checkStatusImpl(const Context *context)
Optional<GLboolean> fixedSampleLocations;
bool hasRenderbuffer = false;
+ const FramebufferAttachment *firstAttachment = getFirstNonNullAttachment();
+
for (const FramebufferAttachment &colorAttachment : mState.mColorAttachments)
{
if (colorAttachment.isAttached())
@@ -836,6 +903,11 @@ GLenum Framebuffer::checkStatusImpl(const Context *context)
}
}
+ if (!CheckMultiviewStateMatchesForCompleteness(firstAttachment, &colorAttachment))
+ {
+ return GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_ANGLE;
+ }
+
hasRenderbuffer = hasRenderbuffer || (colorAttachment.type() == GL_RENDERBUFFER);
hasAttachments = true;
}
@@ -861,6 +933,11 @@ GLenum Framebuffer::checkStatusImpl(const Context *context)
return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
}
+ if (!CheckMultiviewStateMatchesForCompleteness(firstAttachment, &depthAttachment))
+ {
+ return GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_ANGLE;
+ }
+
hasRenderbuffer = hasRenderbuffer || (depthAttachment.type() == GL_RENDERBUFFER);
hasAttachments = true;
}
@@ -885,6 +962,11 @@ GLenum Framebuffer::checkStatusImpl(const Context *context)
return GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE;
}
+ if (!CheckMultiviewStateMatchesForCompleteness(firstAttachment, &stencilAttachment))
+ {
+ return GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_ANGLE;
+ }
+
hasRenderbuffer = hasRenderbuffer || (stencilAttachment.type() == GL_RENDERBUFFER);
hasAttachments = true;
}
@@ -911,6 +993,12 @@ GLenum Framebuffer::checkStatusImpl(const Context *context)
{
return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
}
+
+ if (!CheckMultiviewStateMatchesForCompleteness(firstAttachment,
+ &mState.mWebGLDepthStencilAttachment))
+ {
+ return GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_ANGLE;
+ }
}
else if (mState.mStencilAttachment.isAttached() &&
mState.mStencilAttachment.getDepthSize() > 0)
@@ -1196,6 +1284,19 @@ void Framebuffer::setAttachment(const Context *context,
viewportOffsets);
}
+void Framebuffer::setAttachmentMultiviewLayered(const Context *context,
+ GLenum type,
+ GLenum binding,
+ const ImageIndex &textureIndex,
+ FramebufferAttachmentObject *resource,
+ GLsizei numViews,
+ GLint baseViewIndex)
+{
+ setAttachment(context, type, binding, textureIndex, resource, numViews, baseViewIndex,
+ GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE,
+ FramebufferAttachment::kDefaultViewportOffsets);
+}
+
void Framebuffer::setAttachmentMultiviewSideBySide(const Context *context,
GLenum type,
GLenum binding,
@@ -1430,11 +1531,12 @@ bool Framebuffer::formsRenderingFeedbackLoopWith(const State &state) const
// The bitset will skip inactive draw buffers.
for (size_t drawIndex : mState.mEnabledDrawBuffers)
{
- const FramebufferAttachment *attachment = getDrawBuffer(drawIndex);
- if (attachment && attachment->type() == GL_TEXTURE)
+ const FramebufferAttachment &attachment = mState.mColorAttachments[drawIndex];
+ ASSERT(attachment.isAttached());
+ if (attachment.type() == GL_TEXTURE)
{
// Validate the feedback loop.
- if (program->samplesFromTexture(state, attachment->id()))
+ if (program->samplesFromTexture(state, attachment.id()))
{
return true;
}
@@ -1555,4 +1657,24 @@ int Framebuffer::getSamples(const ValidationContext *context)
return getSamples(static_cast<const Context *>(context));
}
+GLsizei Framebuffer::getNumViews() const
+{
+ return mState.getNumViews();
+}
+
+GLint Framebuffer::getBaseViewIndex() const
+{
+ return mState.getBaseViewIndex();
+}
+
+const std::vector<Offset> *Framebuffer::getViewportOffsets() const
+{
+ return mState.getViewportOffsets();
+}
+
+GLenum Framebuffer::getMultiviewLayout() const
+{
+ return mState.getMultiviewLayout();
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/Framebuffer.h b/chromium/third_party/angle/src/libANGLE/Framebuffer.h
index 40f100a7877..1d0191c5cec 100644
--- a/chromium/third_party/angle/src/libANGLE/Framebuffer.h
+++ b/chromium/third_party/angle/src/libANGLE/Framebuffer.h
@@ -92,6 +92,11 @@ class FramebufferState final : angle::NonCopyable
bool hasDepth() const;
bool hasStencil() const;
+ GLenum getMultiviewLayout() const;
+ GLsizei getNumViews() const;
+ const std::vector<Offset> *getViewportOffsets() const;
+ GLint getBaseViewIndex() const;
+
private:
friend class Framebuffer;
@@ -148,6 +153,13 @@ class Framebuffer final : public LabeledObject, public OnAttachmentDirtyReceiver
GLenum binding,
const ImageIndex &textureIndex,
FramebufferAttachmentObject *resource);
+ void setAttachmentMultiviewLayered(const Context *context,
+ GLenum type,
+ GLenum binding,
+ const ImageIndex &textureIndex,
+ FramebufferAttachmentObject *resource,
+ GLsizei numViews,
+ GLint baseViewIndex);
void setAttachmentMultiviewSideBySide(const Context *context,
GLenum type,
GLenum binding,
@@ -172,6 +184,10 @@ class Framebuffer final : public LabeledObject, public OnAttachmentDirtyReceiver
const FramebufferAttachment *getFirstNonNullAttachment() const;
const FramebufferAttachment *getAttachment(GLenum attachment) const;
+ GLenum getMultiviewLayout() const;
+ GLsizei getNumViews() const;
+ GLint getBaseViewIndex() const;
+ const std::vector<Offset> *getViewportOffsets() const;
size_t getDrawbufferStateCount() const;
GLenum getDrawBufferState(size_t drawBuffer) const;
diff --git a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp
index 4fbb8028fbe..66429dfdc81 100644
--- a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp
+++ b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.cpp
@@ -21,13 +21,37 @@
namespace gl
{
+namespace
+{
+
+std::vector<Offset> TransformViewportOffsetArrayToVectorOfOffsets(const GLint *viewportOffsets,
+ GLsizei numViews)
+{
+ const size_t numViewsAsSizeT = static_cast<size_t>(numViews);
+ std::vector<Offset> offsetVector;
+ offsetVector.reserve(numViewsAsSizeT);
+ for (size_t i = 0u; i < numViewsAsSizeT; ++i)
+ {
+ offsetVector.emplace_back(Offset(viewportOffsets[i * 2u], viewportOffsets[i * 2u + 1u], 0));
+ }
+ return offsetVector;
+}
+
+} // namespace
+
////// FramebufferAttachment::Target Implementation //////
-const GLint FramebufferAttachment::kDefaultNumViews = 1;
+const GLsizei FramebufferAttachment::kDefaultNumViews = 1;
const GLenum FramebufferAttachment::kDefaultMultiviewLayout = GL_NONE;
const GLint FramebufferAttachment::kDefaultBaseViewIndex = 0;
const GLint FramebufferAttachment::kDefaultViewportOffsets[2] = {0};
+std::vector<Offset> FramebufferAttachment::GetDefaultViewportOffsetVector()
+{
+ return TransformViewportOffsetArrayToVectorOfOffsets(
+ FramebufferAttachment::kDefaultViewportOffsets, FramebufferAttachment::kDefaultNumViews);
+}
+
FramebufferAttachment::Target::Target()
: mBinding(GL_NONE),
mTextureIndex(ImageIndex::MakeInvalid())
@@ -61,7 +85,7 @@ FramebufferAttachment::FramebufferAttachment()
mNumViews(kDefaultNumViews),
mMultiviewLayout(kDefaultMultiviewLayout),
mBaseViewIndex(kDefaultBaseViewIndex),
- mViewportOffsets(1u)
+ mViewportOffsets(GetDefaultViewportOffsetVector())
{
}
@@ -110,8 +134,7 @@ void FramebufferAttachment::detach(const Context *context)
mNumViews = kDefaultNumViews;
mMultiviewLayout = kDefaultMultiviewLayout;
mBaseViewIndex = kDefaultBaseViewIndex;
- mViewportOffsets.resize(1u);
- mViewportOffsets[0] = Offset();
+ mViewportOffsets = GetDefaultViewportOffsetVector();
// not technically necessary, could omit for performance
mTarget = Target();
@@ -138,10 +161,13 @@ void FramebufferAttachment::attach(const Context *context,
mNumViews = numViews;
mBaseViewIndex = baseViewIndex;
mMultiviewLayout = multiviewLayout;
- mViewportOffsets.resize(numViews);
- for (size_t i = 0u; i < mViewportOffsets.size(); ++i)
+ if (multiviewLayout == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE)
+ {
+ mViewportOffsets = TransformViewportOffsetArrayToVectorOfOffsets(viewportOffsets, numViews);
+ }
+ else
{
- mViewportOffsets[i] = Offset(viewportOffsets[i * 2u], viewportOffsets[i * 2u + 1u], 0);
+ mViewportOffsets = GetDefaultViewportOffsetVector();
}
resource->onAttach(context);
@@ -231,7 +257,7 @@ GLint FramebufferAttachment::layer() const
return 0;
}
-GLint FramebufferAttachment::getNumViews() const
+GLsizei FramebufferAttachment::getNumViews() const
{
return mNumViews;
}
diff --git a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h
index a9ec03a467d..60d1da1ef87 100644
--- a/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h
+++ b/chromium/third_party/angle/src/libANGLE/FramebufferAttachment.h
@@ -97,7 +97,7 @@ class FramebufferAttachment final
GLenum cubeMapFace() const;
GLint mipLevel() const;
GLint layer() const;
- GLint getNumViews() const;
+ GLsizei getNumViews() const;
GLenum getMultiviewLayout() const;
GLint getBaseViewIndex() const;
const std::vector<Offset> &getMultiviewViewportOffsets() const;
@@ -129,7 +129,8 @@ class FramebufferAttachment final
bool operator==(const FramebufferAttachment &other) const;
bool operator!=(const FramebufferAttachment &other) const;
- static const GLint kDefaultNumViews;
+ static std::vector<Offset> GetDefaultViewportOffsetVector();
+ static const GLsizei kDefaultNumViews;
static const GLenum kDefaultMultiviewLayout;
static const GLint kDefaultBaseViewIndex;
static const GLint kDefaultViewportOffsets[2];
@@ -163,7 +164,7 @@ class FramebufferAttachment final
GLenum mType;
Target mTarget;
FramebufferAttachmentObject *mResource;
- GLint mNumViews;
+ GLsizei mNumViews;
GLenum mMultiviewLayout;
GLint mBaseViewIndex;
std::vector<Offset> mViewportOffsets;
diff --git a/chromium/third_party/angle/src/libANGLE/ImageIndex.cpp b/chromium/third_party/angle/src/libANGLE/ImageIndex.cpp
index 657e3ade05d..f2af70d5baf 100644
--- a/chromium/third_party/angle/src/libANGLE/ImageIndex.cpp
+++ b/chromium/third_party/angle/src/libANGLE/ImageIndex.cpp
@@ -17,7 +17,8 @@ namespace gl
ImageIndex::ImageIndex(const ImageIndex &other)
: type(other.type),
mipIndex(other.mipIndex),
- layerIndex(other.layerIndex)
+ layerIndex(other.layerIndex),
+ numLayers(other.numLayers)
{}
ImageIndex &ImageIndex::operator=(const ImageIndex &other)
@@ -25,6 +26,7 @@ ImageIndex &ImageIndex::operator=(const ImageIndex &other)
type = other.type;
mipIndex = other.mipIndex;
layerIndex = other.layerIndex;
+ numLayers = other.numLayers;
return *this;
}
@@ -35,24 +37,34 @@ bool ImageIndex::is3D() const
ImageIndex ImageIndex::Make2D(GLint mipIndex)
{
- return ImageIndex(GL_TEXTURE_2D, mipIndex, ENTIRE_LEVEL);
+ return ImageIndex(GL_TEXTURE_2D, mipIndex, ENTIRE_LEVEL, 1);
+}
+
+ImageIndex ImageIndex::MakeRectangle(GLint mipIndex)
+{
+ return ImageIndex(GL_TEXTURE_RECTANGLE_ANGLE, mipIndex, ENTIRE_LEVEL, 1);
}
ImageIndex ImageIndex::MakeCube(GLenum target, GLint mipIndex)
{
ASSERT(gl::IsCubeMapTextureTarget(target));
return ImageIndex(target, mipIndex,
- static_cast<GLint>(CubeMapTextureTargetToLayerIndex(target)));
+ static_cast<GLint>(CubeMapTextureTargetToLayerIndex(target)), 1);
}
ImageIndex ImageIndex::Make2DArray(GLint mipIndex, GLint layerIndex)
{
- return ImageIndex(GL_TEXTURE_2D_ARRAY, mipIndex, layerIndex);
+ return ImageIndex(GL_TEXTURE_2D_ARRAY, mipIndex, layerIndex, 1);
+}
+
+ImageIndex ImageIndex::Make2DArrayRange(GLint mipIndex, GLint layerIndex, GLint numLayers)
+{
+ return ImageIndex(GL_TEXTURE_2D_ARRAY, mipIndex, layerIndex, numLayers);
}
ImageIndex ImageIndex::Make3D(GLint mipIndex, GLint layerIndex)
{
- return ImageIndex(GL_TEXTURE_3D, mipIndex, layerIndex);
+ return ImageIndex(GL_TEXTURE_3D, mipIndex, layerIndex, 1);
}
ImageIndex ImageIndex::MakeGeneric(GLenum target, GLint mipIndex)
@@ -60,17 +72,17 @@ ImageIndex ImageIndex::MakeGeneric(GLenum target, GLint mipIndex)
GLint layerIndex = IsCubeMapTextureTarget(target)
? static_cast<GLint>(CubeMapTextureTargetToLayerIndex(target))
: ENTIRE_LEVEL;
- return ImageIndex(target, mipIndex, layerIndex);
+ return ImageIndex(target, mipIndex, layerIndex, 1);
}
ImageIndex ImageIndex::Make2DMultisample()
{
- return ImageIndex(GL_TEXTURE_2D_MULTISAMPLE, 0, ENTIRE_LEVEL);
+ return ImageIndex(GL_TEXTURE_2D_MULTISAMPLE, 0, ENTIRE_LEVEL, 1);
}
ImageIndex ImageIndex::MakeInvalid()
{
- return ImageIndex(GL_NONE, -1, -1);
+ return ImageIndex(GL_NONE, -1, -1, -1);
}
bool ImageIndex::operator<(const ImageIndex &other) const
@@ -83,15 +95,20 @@ bool ImageIndex::operator<(const ImageIndex &other) const
{
return mipIndex < other.mipIndex;
}
- else
+ else if (layerIndex != other.layerIndex)
{
return layerIndex < other.layerIndex;
}
+ else
+ {
+ return numLayers < other.numLayers;
+ }
}
bool ImageIndex::operator==(const ImageIndex &other) const
{
- return (type == other.type) && (mipIndex == other.mipIndex) && (layerIndex == other.layerIndex);
+ return (type == other.type) && (mipIndex == other.mipIndex) &&
+ (layerIndex == other.layerIndex) && (numLayers == other.numLayers);
}
bool ImageIndex::operator!=(const ImageIndex &other) const
@@ -99,10 +116,8 @@ bool ImageIndex::operator!=(const ImageIndex &other) const
return !(*this == other);
}
-ImageIndex::ImageIndex(GLenum typeIn, GLint mipIndexIn, GLint layerIndexIn)
- : type(typeIn),
- mipIndex(mipIndexIn),
- layerIndex(layerIndexIn)
+ImageIndex::ImageIndex(GLenum typeIn, GLint mipIndexIn, GLint layerIndexIn, GLint numLayersIn)
+ : type(typeIn), mipIndex(mipIndexIn), layerIndex(layerIndexIn), numLayers(numLayersIn)
{}
ImageIndexIterator ImageIndexIterator::Make2D(GLint minMip, GLint maxMip)
@@ -112,6 +127,13 @@ ImageIndexIterator ImageIndexIterator::Make2D(GLint minMip, GLint maxMip)
nullptr);
}
+ImageIndexIterator ImageIndexIterator::MakeRectangle(GLint minMip, GLint maxMip)
+{
+ return ImageIndexIterator(GL_TEXTURE_RECTANGLE_ANGLE, Range<GLint>(minMip, maxMip),
+ Range<GLint>(ImageIndex::ENTIRE_LEVEL, ImageIndex::ENTIRE_LEVEL),
+ nullptr);
+}
+
ImageIndexIterator ImageIndexIterator::MakeCube(GLint minMip, GLint maxMip)
{
return ImageIndexIterator(GL_TEXTURE_CUBE_MAP, Range<GLint>(minMip, maxMip), Range<GLint>(0, 6),
@@ -201,7 +223,7 @@ ImageIndex ImageIndexIterator::next()
ImageIndex ImageIndexIterator::current() const
{
- ImageIndex value(mType, mCurrentMip, mCurrentLayer);
+ ImageIndex value(mType, mCurrentMip, mCurrentLayer, 1);
if (mType == GL_TEXTURE_CUBE_MAP)
{
diff --git a/chromium/third_party/angle/src/libANGLE/ImageIndex.h b/chromium/third_party/angle/src/libANGLE/ImageIndex.h
index 5992784452c..46934933b1e 100644
--- a/chromium/third_party/angle/src/libANGLE/ImageIndex.h
+++ b/chromium/third_party/angle/src/libANGLE/ImageIndex.h
@@ -23,6 +23,7 @@ struct ImageIndex
GLenum type;
GLint mipIndex;
GLint layerIndex;
+ GLint numLayers;
ImageIndex(const ImageIndex &other);
ImageIndex &operator=(const ImageIndex &other);
@@ -31,8 +32,10 @@ struct ImageIndex
bool is3D() const;
static ImageIndex Make2D(GLint mipIndex);
+ static ImageIndex MakeRectangle(GLint mipIndex);
static ImageIndex MakeCube(GLenum target, GLint mipIndex);
static ImageIndex Make2DArray(GLint mipIndex, GLint layerIndex);
+ static ImageIndex Make2DArrayRange(GLint mipIndex, GLint layerIndex, GLint numLayers);
static ImageIndex Make3D(GLint mipIndex, GLint layerIndex = ENTIRE_LEVEL);
static ImageIndex MakeGeneric(GLenum target, GLint mipIndex);
static ImageIndex Make2DMultisample();
@@ -48,13 +51,14 @@ struct ImageIndex
private:
friend class ImageIndexIterator;
- ImageIndex(GLenum typeIn, GLint mipIndexIn, GLint layerIndexIn);
+ ImageIndex(GLenum typeIn, GLint mipIndexIn, GLint layerIndexIn, GLint numLayersIn);
};
class ImageIndexIterator
{
public:
static ImageIndexIterator Make2D(GLint minMip, GLint maxMip);
+ static ImageIndexIterator MakeRectangle(GLint minMip, GLint maxMip);
static ImageIndexIterator MakeCube(GLint minMip, GLint maxMip);
static ImageIndexIterator Make3D(GLint minMip, GLint maxMip, GLint minLayer, GLint maxLayer);
static ImageIndexIterator Make2DArray(GLint minMip, GLint maxMip, const GLsizei *layerCounts);
diff --git a/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.cpp b/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.cpp
index 1a93cd87364..b6c2d73e16d 100644
--- a/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.cpp
+++ b/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.cpp
@@ -16,6 +16,7 @@
#include "libANGLE/BinaryStream.h"
#include "libANGLE/Context.h"
#include "libANGLE/Uniform.h"
+#include "libANGLE/histogram_macros.h"
#include "libANGLE/renderer/ProgramImpl.h"
#include "platform/Platform.h"
@@ -24,6 +25,14 @@ namespace gl
namespace
{
+enum CacheResult
+{
+ kCacheMiss,
+ kCacheHitMemory,
+ kCacheHitDisk,
+ kCacheResultMax,
+};
+
constexpr unsigned int kWarningLimit = 3;
void WriteShaderVar(BinaryOutputStream *stream, const sh::ShaderVariable &var)
@@ -168,6 +177,8 @@ LinkResult MemoryProgramCache::Deserialize(const Context *context,
state->mComputeShaderLocalSize[1] = stream.readInt<int>();
state->mComputeShaderLocalSize[2] = stream.readInt<int>();
+ state->mNumViews = stream.readInt<int>();
+
static_assert(MAX_VERTEX_ATTRIBS <= sizeof(unsigned long) * 8,
"Too many vertex attribs for mask");
state->mActiveAttribLocationsMask = stream.readInt<unsigned long>();
@@ -304,18 +315,24 @@ LinkResult MemoryProgramCache::Deserialize(const Context *context,
{
GLenum textureType = stream.readInt<GLenum>();
size_t bindingCount = stream.readInt<size_t>();
- state->mSamplerBindings.emplace_back(SamplerBinding(textureType, bindingCount));
+ bool unreferenced = stream.readBool();
+ state->mSamplerBindings.emplace_back(
+ SamplerBinding(textureType, bindingCount, unreferenced));
}
unsigned int imageRangeLow = stream.readInt<unsigned int>();
unsigned int imageRangeHigh = stream.readInt<unsigned int>();
state->mImageUniformRange = RangeUI(imageRangeLow, imageRangeHigh);
- unsigned int imageCount = stream.readInt<unsigned int>();
- for (unsigned int imageIndex = 0; imageIndex < imageCount; ++imageIndex)
+ unsigned int imageBindingCount = stream.readInt<unsigned int>();
+ for (unsigned int imageIndex = 0; imageIndex < imageBindingCount; ++imageIndex)
{
- GLuint boundImageUnit = stream.readInt<unsigned int>();
- size_t elementCount = stream.readInt<size_t>();
- state->mImageBindings.emplace_back(ImageBinding(boundImageUnit, elementCount));
+ unsigned int elementCount = stream.readInt<unsigned int>();
+ ImageBinding imageBinding(elementCount);
+ for (unsigned int i = 0; i < elementCount; ++i)
+ {
+ imageBinding.boundImageUnits[i] = stream.readInt<unsigned int>();
+ }
+ state->mImageBindings.emplace_back(imageBinding);
}
unsigned int atomicCounterRangeLow = stream.readInt<unsigned int>();
@@ -355,6 +372,8 @@ void MemoryProgramCache::Serialize(const Context *context,
stream.writeInt(computeLocalSize[1]);
stream.writeInt(computeLocalSize[2]);
+ stream.writeInt(state.mNumViews);
+
stream.writeInt(state.getActiveAttribLocationsMask().to_ulong());
stream.writeInt(state.getAttributes().size());
@@ -458,6 +477,7 @@ void MemoryProgramCache::Serialize(const Context *context,
{
stream.writeInt(samplerBinding.textureType);
stream.writeInt(samplerBinding.boundTextureUnits.size());
+ stream.writeInt(samplerBinding.unreferenced);
}
stream.writeInt(state.getImageUniformRange().low());
@@ -466,8 +486,11 @@ void MemoryProgramCache::Serialize(const Context *context,
stream.writeInt(state.getImageBindings().size());
for (const auto &imageBinding : state.getImageBindings())
{
- stream.writeInt(imageBinding.boundImageUnit);
- stream.writeInt(imageBinding.elementCount);
+ stream.writeInt(imageBinding.boundImageUnits.size());
+ for (size_t i = 0; i < imageBinding.boundImageUnits.size(); ++i)
+ {
+ stream.writeInt(imageBinding.boundImageUnits[i]);
+ }
}
stream.writeInt(state.getAtomicCounterUniformRange().low());
@@ -523,6 +546,7 @@ LinkResult MemoryProgramCache::getProgram(const Context *context,
ANGLE_TRY_RESULT(Deserialize(context, program, state, binaryProgram->data(),
binaryProgram->size(), infoLog),
result);
+ ANGLE_HISTOGRAM_BOOLEAN("GPU.ANGLE.ProgramCache.LoadBinarySuccess", result.getResult());
if (!result.getResult())
{
// Cache load failed, evict.
@@ -544,14 +568,41 @@ LinkResult MemoryProgramCache::getProgram(const Context *context,
bool MemoryProgramCache::get(const ProgramHash &programHash, const angle::MemoryBuffer **programOut)
{
- return mProgramBinaryCache.get(programHash, programOut);
+ const CacheEntry *entry = nullptr;
+ if (!mProgramBinaryCache.get(programHash, &entry))
+ {
+ ANGLE_HISTOGRAM_ENUMERATION("GPU.ANGLE.ProgramCache.CacheResult", kCacheMiss,
+ kCacheResultMax);
+ return false;
+ }
+
+ if (entry->second == CacheSource::PutProgram)
+ {
+ ANGLE_HISTOGRAM_ENUMERATION("GPU.ANGLE.ProgramCache.CacheResult", kCacheHitMemory,
+ kCacheResultMax);
+ }
+ else
+ {
+ ANGLE_HISTOGRAM_ENUMERATION("GPU.ANGLE.ProgramCache.CacheResult", kCacheHitDisk,
+ kCacheResultMax);
+ }
+
+ *programOut = &entry->first;
+ return true;
}
bool MemoryProgramCache::getAt(size_t index,
ProgramHash *hashOut,
const angle::MemoryBuffer **programOut)
{
- return mProgramBinaryCache.getAt(index, hashOut, programOut);
+ const CacheEntry *entry = nullptr;
+ if (!mProgramBinaryCache.getAt(index, hashOut, &entry))
+ {
+ return false;
+ }
+
+ *programOut = &entry->first;
+ return true;
}
void MemoryProgramCache::remove(const ProgramHash &programHash)
@@ -560,11 +611,19 @@ void MemoryProgramCache::remove(const ProgramHash &programHash)
ASSERT(result);
}
-void MemoryProgramCache::put(const ProgramHash &program,
- angle::MemoryBuffer &&binaryProgram)
+void MemoryProgramCache::putProgram(const ProgramHash &programHash,
+ const Context *context,
+ const Program *program)
{
- const angle::MemoryBuffer *result =
- mProgramBinaryCache.put(program, std::move(binaryProgram), binaryProgram.size());
+ CacheEntry newEntry;
+ Serialize(context, program, &newEntry.first);
+ newEntry.second = CacheSource::PutProgram;
+
+ ANGLE_HISTOGRAM_COUNTS("GPU.ANGLE.ProgramCache.ProgramBinarySizeBytes",
+ static_cast<int>(newEntry.first.size()));
+
+ const CacheEntry *result =
+ mProgramBinaryCache.put(programHash, std::move(newEntry), newEntry.first.size());
if (!result)
{
ERR() << "Failed to store binary program in memory cache, program is too large.";
@@ -572,17 +631,15 @@ void MemoryProgramCache::put(const ProgramHash &program,
else
{
auto *platform = ANGLEPlatformCurrent();
- platform->cacheProgram(platform, program, result->size(), result->data());
+ platform->cacheProgram(platform, programHash, result->first.size(), result->first.data());
}
}
-void MemoryProgramCache::putProgram(const ProgramHash &programHash,
- const Context *context,
- const Program *program)
+void MemoryProgramCache::updateProgram(const Context *context, const Program *program)
{
- angle::MemoryBuffer binaryProgram;
- Serialize(context, program, &binaryProgram);
- put(programHash, std::move(binaryProgram));
+ gl::ProgramHash programHash;
+ ComputeHash(context, program, &programHash);
+ putProgram(programHash, context, program);
}
void MemoryProgramCache::putBinary(const ProgramHash &programHash,
@@ -590,13 +647,13 @@ void MemoryProgramCache::putBinary(const ProgramHash &programHash,
size_t length)
{
// Copy the binary.
- angle::MemoryBuffer binaryProgram;
- binaryProgram.resize(length);
- memcpy(binaryProgram.data(), binary, length);
+ CacheEntry newEntry;
+ newEntry.first.resize(length);
+ memcpy(newEntry.first.data(), binary, length);
+ newEntry.second = CacheSource::PutBinary;
// Store the binary.
- const angle::MemoryBuffer *result =
- mProgramBinaryCache.put(programHash, std::move(binaryProgram), binaryProgram.size());
+ const CacheEntry *result = mProgramBinaryCache.put(programHash, std::move(newEntry), length);
if (!result)
{
ERR() << "Failed to store binary program in memory cache, program is too large.";
diff --git a/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.h b/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.h
index 039561bedf0..044bd48ecc2 100644
--- a/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.h
+++ b/chromium/third_party/angle/src/libANGLE/MemoryProgramCache.h
@@ -82,6 +82,9 @@ class MemoryProgramCache final : angle::NonCopyable
// Helper method that serializes a program.
void putProgram(const ProgramHash &programHash, const Context *context, const Program *program);
+ // Same as putProgram but computes the hash.
+ void updateProgram(const Context *context, const Program *program);
+
// Store a binary directly.
void putBinary(const ProgramHash &programHash, const uint8_t *binary, size_t length);
@@ -111,11 +114,14 @@ class MemoryProgramCache final : angle::NonCopyable
size_t maxSize() const;
private:
- // Insert or update a binary program. Program contents are transferred.
- void put(const ProgramHash &programHash,
- angle::MemoryBuffer &&binaryProgram);
+ enum class CacheSource
+ {
+ PutProgram,
+ PutBinary,
+ };
- angle::SizedMRUCache<ProgramHash, angle::MemoryBuffer> mProgramBinaryCache;
+ using CacheEntry = std::pair<angle::MemoryBuffer, CacheSource>;
+ angle::SizedMRUCache<ProgramHash, CacheEntry> mProgramBinaryCache;
unsigned int mIssuedWarnings;
};
diff --git a/chromium/third_party/angle/src/libANGLE/Program.cpp b/chromium/third_party/angle/src/libANGLE/Program.cpp
index cc66a723019..5a15847a0c8 100644
--- a/chromium/third_party/angle/src/libANGLE/Program.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Program.cpp
@@ -23,9 +23,11 @@
#include "libANGLE/UniformLinker.h"
#include "libANGLE/VaryingPacking.h"
#include "libANGLE/features.h"
+#include "libANGLE/histogram_macros.h"
#include "libANGLE/queryconversions.h"
#include "libANGLE/renderer/GLImplFactory.h"
#include "libANGLE/renderer/ProgramImpl.h"
+#include "platform/Platform.h"
namespace gl
{
@@ -205,7 +207,12 @@ InfoLog::~InfoLog()
size_t InfoLog::getLength() const
{
- const std::string &logString = mStream.str();
+ if (!mLazyStream)
+ {
+ return 0;
+ }
+
+ const std::string &logString = mLazyStream->str();
return logString.empty() ? 0 : logString.length() + 1;
}
@@ -215,12 +222,12 @@ void InfoLog::getLog(GLsizei bufSize, GLsizei *length, char *infoLog) const
if (bufSize > 0)
{
- const std::string str(mStream.str());
+ const std::string logString(str());
- if (!str.empty())
+ if (!logString.empty())
{
- index = std::min(static_cast<size_t>(bufSize) - 1, str.length());
- memcpy(infoLog, str.c_str(), index);
+ index = std::min(static_cast<size_t>(bufSize) - 1, logString.length());
+ memcpy(infoLog, logString.c_str(), index);
}
infoLog[index] = '\0';
@@ -237,6 +244,8 @@ void InfoLog::getLog(GLsizei bufSize, GLsizei *length, char *infoLog) const
// messages, so lets remove all occurrences of this fake file path from the log.
void InfoLog::appendSanitized(const char *message)
{
+ ensureInitialized();
+
std::string msg(message);
size_t found;
@@ -250,7 +259,7 @@ void InfoLog::appendSanitized(const char *message)
}
while (found != std::string::npos);
- mStream << message << std::endl;
+ *mLazyStream << message << std::endl;
}
void InfoLog::reset()
@@ -298,7 +307,8 @@ ProgramState::ProgramState()
mSamplerUniformRange(0, 0),
mImageUniformRange(0, 0),
mAtomicCounterUniformRange(0, 0),
- mBinaryRetrieveableHint(false)
+ mBinaryRetrieveableHint(false),
+ mNumViews(-1)
{
mComputeShaderLocalSize.fill(1);
}
@@ -616,6 +626,9 @@ Error Program::link(const gl::Context *context)
{
const auto &data = context->getContextState();
+ auto *platform = ANGLEPlatformCurrent();
+ double startTime = platform->currentTime(platform);
+
unlink();
ProgramHash programHash;
@@ -623,10 +636,14 @@ Error Program::link(const gl::Context *context)
if (cache)
{
ANGLE_TRY_RESULT(cache->getProgram(context, this, &mState, &programHash), mLinked);
+ ANGLE_HISTOGRAM_BOOLEAN("GPU.ANGLE.ProgramCache.LoadBinarySuccess", mLinked);
}
if (mLinked)
{
+ double delta = platform->currentTime(platform) - startTime;
+ int us = static_cast<int>(delta * 1000000.0);
+ ANGLE_HISTOGRAM_COUNTS("GPU.ANGLE.ProgramCache.ProgramCacheHitTimeUS", us);
return NoError();
}
@@ -734,10 +751,7 @@ Error Program::link(const gl::Context *context)
const auto &mergedVaryings = getMergedVaryings(context);
- if (!linkValidateTransformFeedback(context, mInfoLog, mergedVaryings, caps))
- {
- return NoError();
- }
+ mState.mNumViews = vertexShader->getNumViews(context);
linkOutputVariables(context);
@@ -755,6 +769,11 @@ Error Program::link(const gl::Context *context)
return NoError();
}
+ if (!linkValidateTransformFeedback(context, mInfoLog, mergedVaryings, caps))
+ {
+ return NoError();
+ }
+
ANGLE_TRY_RESULT(mProgram->link(context, varyingPacking, mInfoLog), mLinked);
if (!mLinked)
{
@@ -769,6 +788,19 @@ Error Program::link(const gl::Context *context)
setUniformValuesFromBindingQualifiers();
+ // Mark implementation-specific unreferenced uniforms as ignored.
+ mProgram->markUnusedUniformLocations(&mState.mUniformLocations);
+
+ // Update sampler bindings with unreferenced uniforms.
+ for (const auto &location : mState.mUniformLocations)
+ {
+ if (!location.used && mState.isSamplerUniformIndex(location.index))
+ {
+ GLuint samplerIndex = mState.getSamplerIndexFromUniformIndex(location.index);
+ mState.mSamplerBindings[samplerIndex].unreferenced = true;
+ }
+ }
+
// Save to the program cache.
if (cache && (mState.mLinkedTransformFeedbackVaryings.empty() ||
!context->getWorkarounds().disableProgramCachingForTransformFeedback))
@@ -776,6 +808,10 @@ Error Program::link(const gl::Context *context)
cache->putProgram(programHash, context, this);
}
+ double delta = platform->currentTime(platform) - startTime;
+ int us = static_cast<int>(delta * 1000000.0);
+ ANGLE_HISTOGRAM_COUNTS("GPU.ANGLE.ProgramCache.ProgramCacheMissTimeUS", us);
+
return NoError();
}
@@ -797,6 +833,7 @@ void Program::unlink()
mState.mComputeShaderLocalSize.fill(1);
mState.mSamplerBindings.clear();
mState.mImageBindings.clear();
+ mState.mNumViews = -1;
mValidated = false;
@@ -1127,6 +1164,18 @@ void Program::getOutputResourceName(GLuint index,
}
}
+const sh::Attribute &Program::getInputResource(GLuint index) const
+{
+ ASSERT(index < mState.mAttributes.size());
+ return mState.mAttributes[index];
+}
+
+const sh::OutputVariable &Program::getOutputResource(GLuint index) const
+{
+ ASSERT(index < mState.mOutputVariables.size());
+ return mState.mOutputVariables[index];
+}
+
GLint Program::getFragDataLocation(const std::string &name) const
{
std::string baseName(name);
@@ -1408,19 +1457,55 @@ void Program::setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean tra
mProgram->setUniformMatrix4x3fv(location, clampedCount, transpose, v);
}
-void Program::getUniformfv(GLint location, GLfloat *v) const
+void Program::getUniformfv(const Context *context, GLint location, GLfloat *v) const
{
- getUniformInternal(location, v);
+ const auto &uniformLocation = mState.getUniformLocations()[location];
+ const auto &uniform = mState.getUniforms()[uniformLocation.index];
+
+ GLenum nativeType = gl::VariableComponentType(uniform.type);
+ if (nativeType == GL_FLOAT)
+ {
+ mProgram->getUniformfv(context, location, v);
+ }
+ else
+ {
+ getUniformInternal(context, v, location, nativeType,
+ gl::VariableComponentCount(uniform.type));
+ }
}
-void Program::getUniformiv(GLint location, GLint *v) const
+void Program::getUniformiv(const Context *context, GLint location, GLint *v) const
{
- getUniformInternal(location, v);
+ const auto &uniformLocation = mState.getUniformLocations()[location];
+ const auto &uniform = mState.getUniforms()[uniformLocation.index];
+
+ GLenum nativeType = gl::VariableComponentType(uniform.type);
+ if (nativeType == GL_INT || nativeType == GL_BOOL)
+ {
+ mProgram->getUniformiv(context, location, v);
+ }
+ else
+ {
+ getUniformInternal(context, v, location, nativeType,
+ gl::VariableComponentCount(uniform.type));
+ }
}
-void Program::getUniformuiv(GLint location, GLuint *v) const
+void Program::getUniformuiv(const Context *context, GLint location, GLuint *v) const
{
- getUniformInternal(location, v);
+ const auto &uniformLocation = mState.getUniformLocations()[location];
+ const auto &uniform = mState.getUniforms()[uniformLocation.index];
+
+ GLenum nativeType = gl::VariableComponentType(uniform.type);
+ if (nativeType == GL_UNSIGNED_INT)
+ {
+ mProgram->getUniformuiv(context, location, v);
+ }
+ else
+ {
+ getUniformInternal(context, v, location, nativeType,
+ gl::VariableComponentCount(uniform.type));
+ }
}
void Program::flagForDeletion()
@@ -1470,6 +1555,9 @@ bool Program::validateSamplers(InfoLog *infoLog, const Caps &caps)
// DrawArrays and DrawElements will issue the INVALID_OPERATION error.
for (const auto &samplerBinding : mState.mSamplerBindings)
{
+ if (samplerBinding.unreferenced)
+ continue;
+
GLenum textureType = samplerBinding.textureType;
for (GLuint textureUnit : samplerBinding.boundTextureUnits)
@@ -1808,17 +1896,20 @@ void Program::linkSamplerAndImageBindings()
// If uniform is a image type, insert it into the mImageBindings array.
for (unsigned int imageIndex : mState.mImageUniformRange)
{
- // ES3.1 (section 7.6.1) and GLSL ES3.1 (section 4.4.5), Uniform*i{v}
- // commands cannot load values into a uniform defined as an image,
- // if declare without a binding qualifier, the image variable is
- // initially bound to unit zero.
+ // ES3.1 (section 7.6.1) and GLSL ES3.1 (section 4.4.5), Uniform*i{v} commands
+ // cannot load values into a uniform defined as an image. if declare without a
+ // binding qualifier, any uniform image variable (include all elements of
+ // unbound image array) shoud be bound to unit zero.
auto &imageUniform = mState.mUniforms[imageIndex];
if (imageUniform.binding == -1)
{
- imageUniform.binding = 0;
+ mState.mImageBindings.emplace_back(ImageBinding(imageUniform.elementCount()));
+ }
+ else
+ {
+ mState.mImageBindings.emplace_back(
+ ImageBinding(imageUniform.binding, imageUniform.elementCount()));
}
- mState.mImageBindings.emplace_back(
- ImageBinding(imageUniform.binding, imageUniform.elementCount()));
}
high = low;
@@ -1837,7 +1928,7 @@ void Program::linkSamplerAndImageBindings()
const auto &samplerUniform = mState.mUniforms[samplerIndex];
GLenum textureType = SamplerTypeToTextureType(samplerUniform.type);
mState.mSamplerBindings.emplace_back(
- SamplerBinding(textureType, samplerUniform.elementCount()));
+ SamplerBinding(textureType, samplerUniform.elementCount(), false));
}
}
@@ -2055,7 +2146,7 @@ bool Program::linkUniformBlocks(const Context *context, InfoLog &infoLog)
if (mState.mAttachedComputeShader)
{
Shader &computeShader = *mState.mAttachedComputeShader;
- const auto &computeInterfaceBlocks = computeShader.getInterfaceBlocks(context);
+ const auto &computeInterfaceBlocks = computeShader.getUniformBlocks(context);
if (!validateUniformBlocksCount(
caps.maxComputeUniformBlocks, computeInterfaceBlocks,
@@ -2070,8 +2161,8 @@ bool Program::linkUniformBlocks(const Context *context, InfoLog &infoLog)
Shader &vertexShader = *mState.mAttachedVertexShader;
Shader &fragmentShader = *mState.mAttachedFragmentShader;
- const auto &vertexInterfaceBlocks = vertexShader.getInterfaceBlocks(context);
- const auto &fragmentInterfaceBlocks = fragmentShader.getInterfaceBlocks(context);
+ const auto &vertexInterfaceBlocks = vertexShader.getUniformBlocks(context);
+ const auto &fragmentInterfaceBlocks = fragmentShader.getUniformBlocks(context);
if (!validateUniformBlocksCount(
caps.maxVertexUniformBlocks, vertexInterfaceBlocks,
@@ -2375,7 +2466,8 @@ bool Program::linkValidateTransformFeedback(const gl::Context *context,
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.
+ // All transform feedback varyings are expected to exist since packUserVaryings checks for
+ // them.
ASSERT(found);
}
@@ -2635,7 +2727,7 @@ void Program::gatherInterfaceBlockInfo(const Context *context)
{
Shader *computeShader = mState.getAttachedComputeShader();
- for (const sh::InterfaceBlock &computeBlock : computeShader->getInterfaceBlocks(context))
+ for (const sh::InterfaceBlock &computeBlock : computeShader->getUniformBlocks(context))
{
// Only 'packed' blocks are allowed to be considered inactive.
@@ -2659,7 +2751,7 @@ void Program::gatherInterfaceBlockInfo(const Context *context)
Shader *vertexShader = mState.getAttachedVertexShader();
- for (const sh::InterfaceBlock &vertexBlock : vertexShader->getInterfaceBlocks(context))
+ for (const sh::InterfaceBlock &vertexBlock : vertexShader->getUniformBlocks(context))
{
// Only 'packed' blocks are allowed to be considered inactive.
if (!vertexBlock.staticUse && vertexBlock.layout == sh::BLOCKLAYOUT_PACKED)
@@ -2674,7 +2766,7 @@ void Program::gatherInterfaceBlockInfo(const Context *context)
Shader *fragmentShader = mState.getAttachedFragmentShader();
- for (const sh::InterfaceBlock &fragmentBlock : fragmentShader->getInterfaceBlocks(context))
+ for (const sh::InterfaceBlock &fragmentBlock : fragmentShader->getUniformBlocks(context))
{
// Only 'packed' blocks are allowed to be considered inactive.
if (!fragmentBlock.staticUse && fragmentBlock.layout == sh::BLOCKLAYOUT_PACKED)
@@ -2887,7 +2979,9 @@ GLsizei Program::setUniformInternal(GLint location, GLsizei countIn, int vectorS
count = maxElementCount / vectorSize;
}
- if (VariableComponentType(linkedUniform->type) == GL_BOOL)
+ // VariableComponentType(linkedUniform->type) has a dozens of compares and thus is evil for
+ // inlining with regards to code size. This version is one subtract and one compare only.
+ if (IsVariableComponentTypeBool(linkedUniform->type))
{
// Do a cast conversion for boolean types. From the spec:
// "The uniform is set to FALSE if the input value is 0 or 0.0f, and set to TRUE otherwise."
@@ -2943,39 +3037,52 @@ GLsizei Program::setMatrixUniformInternal(GLint location,
return clampedCount;
}
+// Driver differences mean that doing the uniform value cast ourselves gives consistent results.
+// EG: on NVIDIA drivers, it was observed that getUniformi for MAX_INT+1 returned MIN_INT.
template <typename DestT>
-void Program::getUniformInternal(GLint location, DestT *dataOut) const
+void Program::getUniformInternal(const Context *context,
+ DestT *dataOut,
+ GLint location,
+ GLenum nativeType,
+ int components) const
{
- const VariableLocation &locationInfo = mState.mUniformLocations[location];
- const LinkedUniform &uniform = mState.mUniforms[locationInfo.index];
-
- const uint8_t *srcPointer = uniform.getDataPtrToElement(locationInfo.element);
-
- GLenum componentType = VariableComponentType(uniform.type);
- if (componentType == GLTypeToGLenum<DestT>::value)
- {
- memcpy(dataOut, srcPointer, uniform.getElementSize());
- return;
- }
-
- int components = VariableComponentCount(uniform.type);
-
- switch (componentType)
+ switch (nativeType)
{
+ case GL_BOOL:
+ {
+ GLint tempValue[16] = {0};
+ mProgram->getUniformiv(context, location, tempValue);
+ UniformStateQueryCastLoop<GLboolean>(
+ dataOut, reinterpret_cast<const uint8_t *>(tempValue), components);
+ break;
+ }
case GL_INT:
- UniformStateQueryCastLoop<GLint>(dataOut, srcPointer, components);
+ {
+ GLint tempValue[16] = {0};
+ mProgram->getUniformiv(context, location, tempValue);
+ UniformStateQueryCastLoop<GLint>(dataOut, reinterpret_cast<const uint8_t *>(tempValue),
+ components);
break;
+ }
case GL_UNSIGNED_INT:
- UniformStateQueryCastLoop<GLuint>(dataOut, srcPointer, components);
- break;
- case GL_BOOL:
- UniformStateQueryCastLoop<GLboolean>(dataOut, srcPointer, components);
+ {
+ GLuint tempValue[16] = {0};
+ mProgram->getUniformuiv(context, location, tempValue);
+ UniformStateQueryCastLoop<GLuint>(dataOut, reinterpret_cast<const uint8_t *>(tempValue),
+ components);
break;
+ }
case GL_FLOAT:
- UniformStateQueryCastLoop<GLfloat>(dataOut, srcPointer, components);
+ {
+ GLfloat tempValue[16] = {0};
+ mProgram->getUniformfv(context, location, tempValue);
+ UniformStateQueryCastLoop<GLfloat>(
+ dataOut, reinterpret_cast<const uint8_t *>(tempValue), components);
break;
+ }
default:
UNREACHABLE();
+ break;
}
}
diff --git a/chromium/third_party/angle/src/libANGLE/Program.h b/chromium/third_party/angle/src/libANGLE/Program.h
index 88399747825..fb976435c7f 100644
--- a/chromium/third_party/angle/src/libANGLE/Program.h
+++ b/chromium/third_party/angle/src/libANGLE/Program.h
@@ -112,15 +112,24 @@ class InfoLog : angle::NonCopyable
template <typename T>
StreamHelper operator<<(const T &value)
{
- StreamHelper helper(&mStream);
+ ensureInitialized();
+ StreamHelper helper(mLazyStream.get());
helper << value;
return helper;
}
- std::string str() const { return mStream.str(); }
+ std::string str() const { return mLazyStream ? mLazyStream->str() : ""; }
private:
- std::stringstream mStream;
+ void ensureInitialized()
+ {
+ if (!mLazyStream)
+ {
+ mLazyStream.reset(new std::stringstream());
+ }
+ }
+
+ std::unique_ptr<std::stringstream> mLazyStream;
};
// Struct used for correlating uniforms/elements of uniform arrays to handles
@@ -162,8 +171,8 @@ struct BindingInfo
// This small structure encapsulates binding sampler uniforms to active GL textures.
struct SamplerBinding
{
- SamplerBinding(GLenum textureTypeIn, size_t elementCount)
- : textureType(textureTypeIn), boundTextureUnits(elementCount, 0)
+ SamplerBinding(GLenum textureTypeIn, size_t elementCount, bool unreferenced)
+ : textureType(textureTypeIn), boundTextureUnits(elementCount, 0), unreferenced(unreferenced)
{
}
@@ -172,6 +181,9 @@ struct SamplerBinding
// List of all textures bound to this sampler, of type textureType.
std::vector<GLuint> boundTextureUnits;
+
+ // A note if this sampler is an unreferenced uniform.
+ bool unreferenced;
};
// A varying with tranform feedback enabled. If it's an array, either the whole array or one of its
@@ -199,10 +211,16 @@ struct TransformFeedbackVarying : public sh::Varying
struct ImageBinding
{
- ImageBinding(GLuint imageUnit, size_t count) : boundImageUnit(imageUnit), elementCount(count) {}
+ ImageBinding(size_t count) : boundImageUnits(count, 0) {}
+ ImageBinding(GLuint imageUnit, size_t count)
+ {
+ for (size_t index = 0; index < count; ++index)
+ {
+ boundImageUnits.push_back(imageUnit + static_cast<GLuint>(index));
+ }
+ }
- GLuint boundImageUnit;
- size_t elementCount;
+ std::vector<GLuint> boundImageUnits;
};
class ProgramState final : angle::NonCopyable
@@ -265,6 +283,9 @@ class ProgramState final : angle::NonCopyable
GLuint getSamplerIndexFromUniformIndex(GLuint uniformIndex) const;
GLuint getAttributeLocation(const std::string &name) const;
+ int getNumViews() const { return mNumViews; }
+ bool usesMultiview() const { return mNumViews != -1; }
+
private:
friend class MemoryProgramCache;
friend class Program;
@@ -318,6 +339,9 @@ class ProgramState final : angle::NonCopyable
bool mBinaryRetrieveableHint;
bool mSeparable;
+
+ // ANGLE_multiview.
+ int mNumViews;
};
class Program final : angle::NonCopyable, public LabeledObject
@@ -436,9 +460,9 @@ class Program final : angle::NonCopyable, public LabeledObject
void setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
void setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
- void getUniformfv(GLint location, GLfloat *params) const;
- void getUniformiv(GLint location, GLint *params) const;
- void getUniformuiv(GLint location, GLuint *params) const;
+ void getUniformfv(const Context *context, GLint location, GLfloat *params) const;
+ void getUniformiv(const Context *context, GLint location, GLint *params) const;
+ void getUniformuiv(const Context *context, GLint location, GLuint *params) const;
void getActiveUniformBlockName(GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName) const;
GLuint getActiveUniformBlockCount() const;
@@ -498,6 +522,8 @@ class Program final : angle::NonCopyable, public LabeledObject
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;
+ const sh::Attribute &getInputResource(GLuint index) const;
+ const sh::OutputVariable &getOutputResource(GLuint index) const;
class Bindings final : angle::NonCopyable
{
@@ -517,6 +543,9 @@ class Program final : angle::NonCopyable, public LabeledObject
const Bindings &getUniformLocationBindings() const { return mUniformLocationBindings; }
const Bindings &getFragmentInputBindings() const { return mFragmentInputBindings; }
+ int getNumViews() const { return mState.getNumViews(); }
+ bool usesMultiview() const { return mState.usesMultiview(); }
+
private:
~Program();
@@ -601,7 +630,11 @@ class Program final : angle::NonCopyable, public LabeledObject
const T *v);
template <typename DestT>
- void getUniformInternal(GLint location, DestT *dataOut) const;
+ void getUniformInternal(const Context *context,
+ DestT *dataOut,
+ GLint location,
+ GLenum nativeType,
+ int components) const;
ProgramState mState;
rx::ProgramImpl *mProgram;
diff --git a/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp b/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp
index 7a4918133a3..f970602c808 100644
--- a/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp
+++ b/chromium/third_party/angle/src/libANGLE/ResourceManager.cpp
@@ -102,7 +102,7 @@ template class TypedResourceManager<Buffer, HandleAllocator, BufferManager>;
template class TypedResourceManager<Texture, HandleAllocator, TextureManager>;
template class TypedResourceManager<Renderbuffer, HandleAllocator, RenderbufferManager>;
template class TypedResourceManager<Sampler, HandleAllocator, SamplerManager>;
-template class TypedResourceManager<FenceSync, HandleAllocator, FenceSyncManager>;
+template class TypedResourceManager<Sync, HandleAllocator, SyncManager>;
template class TypedResourceManager<Framebuffer, HandleAllocator, FramebufferManager>;
// BufferManager Implementation.
@@ -272,7 +272,7 @@ GLuint RenderbufferManager::createRenderbuffer()
return AllocateEmptyObject(&mHandleAllocator, &mObjectMap);
}
-Renderbuffer *RenderbufferManager::getRenderbuffer(GLuint handle)
+Renderbuffer *RenderbufferManager::getRenderbuffer(GLuint handle) const
{
return mObjectMap.query(handle);
}
@@ -298,34 +298,34 @@ GLuint SamplerManager::createSampler()
return AllocateEmptyObject(&mHandleAllocator, &mObjectMap);
}
-Sampler *SamplerManager::getSampler(GLuint handle)
+Sampler *SamplerManager::getSampler(GLuint handle) const
{
return mObjectMap.query(handle);
}
-bool SamplerManager::isSampler(GLuint sampler)
+bool SamplerManager::isSampler(GLuint sampler) const
{
return mObjectMap.contains(sampler);
}
-// FenceSyncManager Implementation.
+// SyncManager Implementation.
// static
-void FenceSyncManager::DeleteObject(const Context *context, FenceSync *fenceSync)
+void SyncManager::DeleteObject(const Context *context, Sync *sync)
{
- fenceSync->release(context);
+ sync->release(context);
}
-GLuint FenceSyncManager::createFenceSync(rx::GLImplFactory *factory)
+GLuint SyncManager::createSync(rx::GLImplFactory *factory)
{
- GLuint handle = mHandleAllocator.allocate();
- FenceSync *fenceSync = new FenceSync(factory->createFenceSync(), handle);
- fenceSync->addRef();
- mObjectMap.assign(handle, fenceSync);
+ GLuint handle = mHandleAllocator.allocate();
+ Sync *sync = new Sync(factory->createSync(), handle);
+ sync->addRef();
+ mObjectMap.assign(handle, sync);
return handle;
}
-FenceSync *FenceSyncManager::getFenceSync(GLuint handle)
+Sync *SyncManager::getSync(GLuint handle) const
{
return mObjectMap.query(handle);
}
diff --git a/chromium/third_party/angle/src/libANGLE/ResourceManager.h b/chromium/third_party/angle/src/libANGLE/ResourceManager.h
index 1d21332fe3a..78804395fb8 100644
--- a/chromium/third_party/angle/src/libANGLE/ResourceManager.h
+++ b/chromium/third_party/angle/src/libANGLE/ResourceManager.h
@@ -27,7 +27,7 @@ namespace gl
class Buffer;
struct Caps;
class Context;
-class FenceSync;
+class Sync;
class Framebuffer;
struct Limitations;
class Path;
@@ -173,7 +173,7 @@ class RenderbufferManager
{
public:
GLuint createRenderbuffer();
- Renderbuffer *getRenderbuffer(GLuint handle);
+ Renderbuffer *getRenderbuffer(GLuint handle) const;
Renderbuffer *checkRenderbufferAllocation(rx::GLImplFactory *factory, GLuint handle)
{
@@ -191,8 +191,8 @@ class SamplerManager : public TypedResourceManager<Sampler, HandleAllocator, Sam
{
public:
GLuint createSampler();
- Sampler *getSampler(GLuint handle);
- bool isSampler(GLuint sampler);
+ Sampler *getSampler(GLuint handle) const;
+ bool isSampler(GLuint sampler) const;
Sampler *checkSamplerAllocation(rx::GLImplFactory *factory, GLuint handle)
{
@@ -206,16 +206,16 @@ class SamplerManager : public TypedResourceManager<Sampler, HandleAllocator, Sam
~SamplerManager() override {}
};
-class FenceSyncManager : public TypedResourceManager<FenceSync, HandleAllocator, FenceSyncManager>
+class SyncManager : public TypedResourceManager<Sync, HandleAllocator, SyncManager>
{
public:
- GLuint createFenceSync(rx::GLImplFactory *factory);
- FenceSync *getFenceSync(GLuint handle);
+ GLuint createSync(rx::GLImplFactory *factory);
+ Sync *getSync(GLuint handle) const;
- static void DeleteObject(const Context *context, FenceSync *fenceSync);
+ static void DeleteObject(const Context *context, Sync *sync);
protected:
- ~FenceSyncManager() override {}
+ ~SyncManager() override {}
};
class PathManager : public ResourceManagerBase<HandleRangeAllocator>
diff --git a/chromium/third_party/angle/src/libANGLE/Shader.cpp b/chromium/third_party/angle/src/libANGLE/Shader.cpp
index e477df0d624..6bdc65a0596 100644
--- a/chromium/third_party/angle/src/libANGLE/Shader.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Shader.cpp
@@ -78,6 +78,7 @@ ShaderState::ShaderState(GLenum shaderType)
: mLabel(),
mShaderType(shaderType),
mShaderVersion(100),
+ mNumViews(-1),
mCompileStatus(CompileStatus::NOT_COMPILED)
{
mLocalSize.fill(-1);
@@ -269,9 +270,11 @@ void Shader::compile(const Context *context)
mState.mShaderVersion = 100;
mState.mVaryings.clear();
mState.mUniforms.clear();
- mState.mInterfaceBlocks.clear();
+ mState.mUniformBlocks.clear();
+ mState.mShaderStorageBlocks.clear();
mState.mActiveAttributes.clear();
mState.mActiveOutputVariables.clear();
+ mState.mNumViews = -1;
mState.mCompileStatus = CompileStatus::COMPILE_REQUESTED;
mBoundCompiler.set(context, context->getCompiler());
@@ -359,7 +362,8 @@ void Shader::resolveCompile(const Context *context)
mState.mVaryings = GetShaderVariables(sh::GetVaryings(compilerHandle));
mState.mUniforms = GetShaderVariables(sh::GetUniforms(compilerHandle));
- mState.mInterfaceBlocks = GetShaderVariables(sh::GetInterfaceBlocks(compilerHandle));
+ mState.mUniformBlocks = GetShaderVariables(sh::GetUniformBlocks(compilerHandle));
+ mState.mShaderStorageBlocks = GetShaderVariables(sh::GetShaderStorageBlocks(compilerHandle));
switch (mState.mShaderType)
{
@@ -370,7 +374,11 @@ void Shader::resolveCompile(const Context *context)
}
case GL_VERTEX_SHADER:
{
- mState.mActiveAttributes = GetActiveShaderVariables(sh::GetAttributes(compilerHandle));
+ {
+ mState.mActiveAttributes =
+ GetActiveShaderVariables(sh::GetAttributes(compilerHandle));
+ mState.mNumViews = sh::GetVertexShaderNumViews(compilerHandle);
+ }
break;
}
case GL_FRAGMENT_SHADER:
@@ -445,10 +453,16 @@ const std::vector<sh::Uniform> &Shader::getUniforms(const Context *context)
return mState.getUniforms();
}
-const std::vector<sh::InterfaceBlock> &Shader::getInterfaceBlocks(const Context *context)
+const std::vector<sh::InterfaceBlock> &Shader::getUniformBlocks(const Context *context)
{
resolveCompile(context);
- return mState.getInterfaceBlocks();
+ return mState.getUniformBlocks();
+}
+
+const std::vector<sh::InterfaceBlock> &Shader::getShaderStorageBlocks(const Context *context)
+{
+ resolveCompile(context);
+ return mState.getShaderStorageBlocks();
}
const std::vector<sh::Attribute> &Shader::getActiveAttributes(const Context *context)
@@ -469,6 +483,12 @@ const sh::WorkGroupSize &Shader::getWorkGroupSize(const Context *context)
return mState.mLocalSize;
}
+int Shader::getNumViews(const Context *context)
+{
+ resolveCompile(context);
+ return mState.mNumViews;
+}
+
const std::string &Shader::getCompilerResourcesString() const
{
ASSERT(mBoundCompiler.get());
diff --git a/chromium/third_party/angle/src/libANGLE/Shader.h b/chromium/third_party/angle/src/libANGLE/Shader.h
index 6fcb62c3e43..311ff9c8e22 100644
--- a/chromium/third_party/angle/src/libANGLE/Shader.h
+++ b/chromium/third_party/angle/src/libANGLE/Shader.h
@@ -64,7 +64,11 @@ class ShaderState final : angle::NonCopyable
const std::vector<sh::Varying> &getVaryings() const { return mVaryings; }
const std::vector<sh::Uniform> &getUniforms() const { return mUniforms; }
- const std::vector<sh::InterfaceBlock> &getInterfaceBlocks() const { return mInterfaceBlocks; }
+ const std::vector<sh::InterfaceBlock> &getUniformBlocks() const { return mUniformBlocks; }
+ const std::vector<sh::InterfaceBlock> &getShaderStorageBlocks() const
+ {
+ return mShaderStorageBlocks;
+ }
const std::vector<sh::Attribute> &getActiveAttributes() const { return mActiveAttributes; }
const std::vector<sh::OutputVariable> &getActiveOutputVariables() const
{
@@ -87,10 +91,14 @@ class ShaderState final : angle::NonCopyable
std::vector<sh::Varying> mVaryings;
std::vector<sh::Uniform> mUniforms;
- std::vector<sh::InterfaceBlock> mInterfaceBlocks;
+ std::vector<sh::InterfaceBlock> mUniformBlocks;
+ std::vector<sh::InterfaceBlock> mShaderStorageBlocks;
std::vector<sh::Attribute> mActiveAttributes;
std::vector<sh::OutputVariable> mActiveOutputVariables;
+ // ANGLE_multiview.
+ int mNumViews;
+
// Indicates if this shader has been successfully compiled
CompileStatus mCompileStatus;
};
@@ -145,12 +153,15 @@ class Shader final : angle::NonCopyable, public LabeledObject
const std::vector<sh::Varying> &getVaryings(const Context *context);
const std::vector<sh::Uniform> &getUniforms(const Context *context);
- const std::vector<sh::InterfaceBlock> &getInterfaceBlocks(const Context *context);
+ const std::vector<sh::InterfaceBlock> &getUniformBlocks(const Context *context);
+ const std::vector<sh::InterfaceBlock> &getShaderStorageBlocks(const Context *context);
const std::vector<sh::Attribute> &getActiveAttributes(const Context *context);
const std::vector<sh::OutputVariable> &getActiveOutputVariables(const Context *context);
const sh::WorkGroupSize &getWorkGroupSize(const Context *context);
+ int getNumViews(const Context *context);
+
const std::string &getCompilerResourcesString() const;
private:
diff --git a/chromium/third_party/angle/src/libANGLE/State.cpp b/chromium/third_party/angle/src/libANGLE/State.cpp
index 77432c21de5..070bf7e49dc 100644
--- a/chromium/third_party/angle/src/libANGLE/State.cpp
+++ b/chromium/third_party/angle/src/libANGLE/State.cpp
@@ -150,6 +150,10 @@ void State::initialize(const Context *context,
mShaderStorageBuffers.resize(caps.maxShaderStorageBufferBindings);
mImageUnits.resize(caps.maxImageUnits);
}
+ if (extensions.textureRectangle)
+ {
+ mSamplerTextures[GL_TEXTURE_RECTANGLE_ANGLE].resize(caps.maxCombinedTextureImageUnits);
+ }
if (extensions.eglImageExternal || extensions.eglStreamConsumerExternal)
{
mSamplerTextures[GL_TEXTURE_EXTERNAL_OES].resize(caps.maxCombinedTextureImageUnits);
@@ -257,8 +261,6 @@ void State::reset(const Context *context)
buf.set(context, nullptr);
}
- mProgram = nullptr;
-
angle::Matrix<GLfloat>::setToIdentity(mPathMatrixProj);
angle::Matrix<GLfloat>::setToIdentity(mPathMatrixMV);
mPathStencilFunc = GL_ALWAYS;
@@ -1102,6 +1104,8 @@ void State::setProgram(const Context *context, Program *newProgram)
{
newProgram->addRef();
}
+ mDirtyBits.set(DIRTY_BIT_PROGRAM_EXECUTABLE);
+ mDirtyBits.set(DIRTY_BIT_PROGRAM_BINDING);
}
}
@@ -1915,6 +1919,11 @@ void State::getIntegerv(const Context *context, GLenum pname, GLint *params)
ASSERT(mActiveSampler < mMaxCombinedTextureImageUnits);
*params = getSamplerTextureId(static_cast<unsigned int>(mActiveSampler), GL_TEXTURE_2D);
break;
+ case GL_TEXTURE_BINDING_RECTANGLE_ANGLE:
+ ASSERT(mActiveSampler < mMaxCombinedTextureImageUnits);
+ *params = getSamplerTextureId(static_cast<unsigned int>(mActiveSampler),
+ GL_TEXTURE_RECTANGLE_ANGLE);
+ break;
case GL_TEXTURE_BINDING_CUBE_MAP:
ASSERT(mActiveSampler < mMaxCombinedTextureImageUnits);
*params =
@@ -2154,9 +2163,6 @@ void State::syncDirtyObjects(const Context *context, const DirtyObjects &bitset)
ASSERT(mVertexArray);
mVertexArray->syncImplState(context);
break;
- case DIRTY_OBJECT_PROGRAM:
- // TODO(jmadill): implement this
- break;
default:
UNREACHABLE();
break;
@@ -2185,9 +2191,6 @@ void State::syncDirtyObject(const Context *context, GLenum target)
case GL_VERTEX_ARRAY:
localSet.set(DIRTY_OBJECT_VERTEX_ARRAY);
break;
- case GL_PROGRAM:
- localSet.set(DIRTY_OBJECT_PROGRAM);
- break;
}
syncDirtyObjects(context, localSet);
@@ -2210,9 +2213,18 @@ void State::setObjectDirty(GLenum target)
case GL_VERTEX_ARRAY:
mDirtyObjects.set(DIRTY_OBJECT_VERTEX_ARRAY);
break;
- case GL_PROGRAM:
- mDirtyObjects.set(DIRTY_OBJECT_PROGRAM);
- break;
+ }
+}
+
+void State::onProgramExecutableChange(Program *program)
+{
+ // OpenGL Spec:
+ // "If LinkProgram or ProgramBinary successfully re-links a program object
+ // that was already in use as a result of a previous call to UseProgram, then the
+ // generated executable code will be installed as part of the current rendering state."
+ if (program->isLinked() && mProgram == program)
+ {
+ mDirtyBits.set(DIRTY_BIT_PROGRAM_EXECUTABLE);
}
}
diff --git a/chromium/third_party/angle/src/libANGLE/State.h b/chromium/third_party/angle/src/libANGLE/State.h
index 959b1533959..953bccbfb8c 100644
--- a/chromium/third_party/angle/src/libANGLE/State.h
+++ b/chromium/third_party/angle/src/libANGLE/State.h
@@ -362,6 +362,9 @@ class State : angle::NonCopyable
bool hasMappedBuffer(GLenum target) const;
bool isRobustResourceInitEnabled() const { return mRobustResourceInit; }
+ // Sets the dirty bit for the program executable.
+ void onProgramExecutableChange(Program *program);
+
enum DirtyBitType
{
DIRTY_BIT_SCISSOR_TEST_ENABLED,
@@ -419,6 +422,7 @@ class State : angle::NonCopyable
DIRTY_BIT_VERTEX_ARRAY_BINDING,
DIRTY_BIT_DRAW_INDIRECT_BUFFER_BINDING,
DIRTY_BIT_PROGRAM_BINDING,
+ DIRTY_BIT_PROGRAM_EXECUTABLE,
DIRTY_BIT_MULTISAMPLING,
DIRTY_BIT_SAMPLE_ALPHA_TO_ONE,
DIRTY_BIT_COVERAGE_MODULATION, // CHROMIUM_framebuffer_mixed_samples
@@ -438,7 +442,6 @@ class State : angle::NonCopyable
DIRTY_OBJECT_READ_FRAMEBUFFER,
DIRTY_OBJECT_DRAW_FRAMEBUFFER,
DIRTY_OBJECT_VERTEX_ARRAY,
- DIRTY_OBJECT_PROGRAM,
DIRTY_OBJECT_UNKNOWN,
DIRTY_OBJECT_MAX = DIRTY_OBJECT_UNKNOWN,
};
diff --git a/chromium/third_party/angle/src/libANGLE/Surface.cpp b/chromium/third_party/angle/src/libANGLE/Surface.cpp
index 7625b3b3310..cc95edd1f9c 100644
--- a/chromium/third_party/angle/src/libANGLE/Surface.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Surface.cpp
@@ -39,6 +39,15 @@ Surface::Surface(EGLint surfaceType, const egl::Config *config, const AttributeM
mDestroyed(false),
mType(surfaceType),
mPostSubBufferRequested(false),
+ mLargestPbuffer(false),
+ mGLColorspace(EGL_GL_COLORSPACE_LINEAR),
+ mVGAlphaFormat(EGL_VG_ALPHA_FORMAT_NONPRE),
+ mVGColorspace(EGL_VG_COLORSPACE_sRGB),
+ mMipmapTexture(false),
+ mMipmapLevel(0),
+ mHorizontalResolution(EGL_UNKNOWN),
+ mVerticalResolution(EGL_UNKNOWN),
+ mMultisampleResolve(EGL_MULTISAMPLE_RESOLVE_DEFAULT),
mFixedSize(false),
mFixedWidth(0),
mFixedHeight(0),
@@ -57,6 +66,18 @@ Surface::Surface(EGLint surfaceType, const egl::Config *config, const AttributeM
mFlexibleSurfaceCompatibilityRequested =
(attributes.get(EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE, EGL_FALSE) == EGL_TRUE);
+ if (mType == EGL_PBUFFER_BIT)
+ {
+ mLargestPbuffer = (attributes.get(EGL_LARGEST_PBUFFER, EGL_FALSE) == EGL_TRUE);
+ }
+
+ mGLColorspace =
+ static_cast<EGLenum>(attributes.get(EGL_GL_COLORSPACE, EGL_GL_COLORSPACE_LINEAR));
+ mVGAlphaFormat =
+ static_cast<EGLenum>(attributes.get(EGL_VG_ALPHA_FORMAT, EGL_VG_ALPHA_FORMAT_NONPRE));
+ mVGColorspace = static_cast<EGLenum>(attributes.get(EGL_VG_COLORSPACE, EGL_VG_COLORSPACE_sRGB));
+ mMipmapTexture = (attributes.get(EGL_MIPMAP_TEXTURE, EGL_FALSE) == EGL_TRUE);
+
mDirectComposition = (attributes.get(EGL_DIRECT_COMPOSITION_ANGLE, EGL_FALSE) == EGL_TRUE);
mFixedSize = (attributes.get(EGL_FIXED_SIZE_ANGLE, EGL_FALSE) == EGL_TRUE);
@@ -197,6 +218,27 @@ void Surface::setSwapInterval(EGLint interval)
mImplementation->setSwapInterval(interval);
}
+void Surface::setMipmapLevel(EGLint level)
+{
+ // Level is set but ignored
+ UNIMPLEMENTED();
+ mMipmapLevel = level;
+}
+
+void Surface::setMultisampleResolve(EGLenum resolve)
+{
+ // Behaviour is set but ignored
+ UNIMPLEMENTED();
+ mMultisampleResolve = resolve;
+}
+
+void Surface::setSwapBehavior(EGLenum behavior)
+{
+ // Behaviour is set but ignored
+ UNIMPLEMENTED();
+ mSwapBehavior = behavior;
+}
+
const Config *Surface::getConfig() const
{
return mState.config;
@@ -227,6 +269,51 @@ EGLenum Surface::getTextureTarget() const
return mTextureTarget;
}
+bool Surface::getLargestPbuffer() const
+{
+ return mLargestPbuffer;
+}
+
+EGLenum Surface::getGLColorspace() const
+{
+ return mGLColorspace;
+}
+
+EGLenum Surface::getVGAlphaFormat() const
+{
+ return mVGAlphaFormat;
+}
+
+EGLenum Surface::getVGColorspace() const
+{
+ return mVGColorspace;
+}
+
+bool Surface::getMipmapTexture() const
+{
+ return mMipmapTexture;
+}
+
+EGLint Surface::getMipmapLevel() const
+{
+ return mMipmapLevel;
+}
+
+EGLint Surface::getHorizontalResolution() const
+{
+ return mHorizontalResolution;
+}
+
+EGLint Surface::getVerticalResolution() const
+{
+ return mVerticalResolution;
+}
+
+EGLenum Surface::getMultisampleResolve() const
+{
+ return mMultisampleResolve;
+}
+
EGLint Surface::isFixedSize() const
{
return mFixedSize;
diff --git a/chromium/third_party/angle/src/libANGLE/Surface.h b/chromium/third_party/angle/src/libANGLE/Surface.h
index f670cafc3f8..4707e86bc61 100644
--- a/chromium/third_party/angle/src/libANGLE/Surface.h
+++ b/chromium/third_party/angle/src/libANGLE/Surface.h
@@ -72,6 +72,10 @@ class Surface : public gl::FramebufferAttachmentObject
Error setIsCurrent(const gl::Context *context, bool isCurrent);
Error onDestroy(const Display *display);
+ void setMipmapLevel(EGLint level);
+ void setMultisampleResolve(EGLenum resolve);
+ void setSwapBehavior(EGLenum behavior);
+
const Config *getConfig() const;
// width and height can change with client window resizing
@@ -82,6 +86,15 @@ class Surface : public gl::FramebufferAttachmentObject
EGLenum getSwapBehavior() const;
EGLenum getTextureFormat() const;
EGLenum getTextureTarget() const;
+ bool getLargestPbuffer() const;
+ EGLenum getGLColorspace() const;
+ EGLenum getVGAlphaFormat() const;
+ EGLenum getVGColorspace() const;
+ bool getMipmapTexture() const;
+ EGLint getMipmapLevel() const;
+ EGLint getHorizontalResolution() const;
+ EGLint getVerticalResolution() const;
+ EGLenum getMultisampleResolve() const;
gl::Texture *getBoundTexture() const { return mTexture.get(); }
gl::Framebuffer *getDefaultFramebuffer() { return mState.defaultFramebuffer; }
@@ -127,6 +140,16 @@ class Surface : public gl::FramebufferAttachmentObject
bool mPostSubBufferRequested;
bool mFlexibleSurfaceCompatibilityRequested;
+ bool mLargestPbuffer;
+ EGLenum mGLColorspace;
+ EGLenum mVGAlphaFormat;
+ EGLenum mVGColorspace;
+ bool mMipmapTexture;
+ EGLint mMipmapLevel;
+ EGLint mHorizontalResolution;
+ EGLint mVerticalResolution;
+ EGLenum mMultisampleResolve;
+
bool mFixedSize;
size_t mFixedWidth;
size_t mFixedHeight;
diff --git a/chromium/third_party/angle/src/libANGLE/Texture.cpp b/chromium/third_party/angle/src/libANGLE/Texture.cpp
index 2340e5d961a..057d9c6a6fc 100644
--- a/chromium/third_party/angle/src/libANGLE/Texture.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Texture.cpp
@@ -1158,7 +1158,7 @@ Error Texture::bindTexImageFromSurface(const Context *context, egl::Surface *sur
mBoundSurface = surface;
// Set the image info to the size and format of the surface
- ASSERT(mState.mTarget == GL_TEXTURE_2D);
+ ASSERT(mState.mTarget == GL_TEXTURE_2D || mState.mTarget == GL_TEXTURE_RECTANGLE_ANGLE);
Extents size(surface->getWidth(), surface->getHeight(), 1);
ImageDesc desc(size, Format(surface->getConfig()->renderTargetFormat));
mState.setImageDesc(mState.mTarget, 0, desc);
@@ -1173,7 +1173,7 @@ Error Texture::releaseTexImageFromSurface(const Context *context)
ANGLE_TRY(mTexture->releaseTexImage(context));
// Erase the image info for level 0
- ASSERT(mState.mTarget == GL_TEXTURE_2D);
+ ASSERT(mState.mTarget == GL_TEXTURE_2D || mState.mTarget == GL_TEXTURE_RECTANGLE_ANGLE);
mState.clearImageDesc(mState.mTarget, 0);
mDirtyChannel.signal();
return NoError();
diff --git a/chromium/third_party/angle/src/libANGLE/Uniform.cpp b/chromium/third_party/angle/src/libANGLE/Uniform.cpp
index bef0c6a2afd..5fe62f5b2c7 100644
--- a/chromium/third_party/angle/src/libANGLE/Uniform.cpp
+++ b/chromium/third_party/angle/src/libANGLE/Uniform.cpp
@@ -83,18 +83,6 @@ size_t LinkedUniform::dataSize() const
return mLazyData.size();
}
-uint8_t *LinkedUniform::data()
-{
- if (mLazyData.empty())
- {
- // dataSize() will init the data store.
- size_t size = dataSize();
- memset(mLazyData.data(), 0, size);
- }
-
- return mLazyData.data();
-}
-
const uint8_t *LinkedUniform::data() const
{
return const_cast<LinkedUniform *>(this)->data();
diff --git a/chromium/third_party/angle/src/libANGLE/Uniform.h b/chromium/third_party/angle/src/libANGLE/Uniform.h
index d8a5acc8b7c..53f103efa11 100644
--- a/chromium/third_party/angle/src/libANGLE/Uniform.h
+++ b/chromium/third_party/angle/src/libANGLE/Uniform.h
@@ -38,7 +38,17 @@ struct LinkedUniform : public sh::Uniform
~LinkedUniform();
size_t dataSize() const;
- uint8_t *data();
+ uint8_t *data()
+ {
+ if (mLazyData.empty())
+ {
+ // dataSize() will init the data store.
+ size_t size = dataSize();
+ memset(mLazyData.data(), 0, size);
+ }
+
+ return mLazyData.data();
+ }
const uint8_t *data() const;
bool isSampler() const;
bool isImage() const;
diff --git a/chromium/third_party/angle/src/libANGLE/VertexAttribute.cpp b/chromium/third_party/angle/src/libANGLE/VertexAttribute.cpp
index 086e64cfc72..0c0fbc8ac92 100644
--- a/chromium/third_party/angle/src/libANGLE/VertexAttribute.cpp
+++ b/chromium/third_party/angle/src/libANGLE/VertexAttribute.cpp
@@ -110,16 +110,13 @@ GLintptr ComputeVertexAttributeOffset(const VertexAttribute &attrib, const Verte
return attrib.relativeOffset + binding.getOffset();
}
-size_t ComputeVertexBindingElementCount(const VertexBinding &binding,
- size_t drawCount,
- size_t instanceCount)
+size_t ComputeVertexBindingElementCount(GLuint divisor, size_t drawCount, size_t instanceCount)
{
// For instanced rendering, we draw "instanceDrawCount" sets of "vertexDrawCount" vertices.
//
// A vertex attribute with a positive divisor loads one instanced vertex for every set of
// non-instanced vertices, and the instanced vertex index advances once every "mDivisor"
// instances.
- GLuint divisor = binding.getDivisor();
if (instanceCount > 0 && divisor > 0)
{
// When instanceDrawCount is not a multiple attrib.divisor, the division must round up.
diff --git a/chromium/third_party/angle/src/libANGLE/VertexAttribute.h b/chromium/third_party/angle/src/libANGLE/VertexAttribute.h
index bccc49fd530..4014edf4b23 100644
--- a/chromium/third_party/angle/src/libANGLE/VertexAttribute.h
+++ b/chromium/third_party/angle/src/libANGLE/VertexAttribute.h
@@ -76,9 +76,7 @@ size_t ComputeVertexAttributeStride(const VertexAttribute &attrib, const VertexB
// Warning: you should ensure binding really matches attrib.bindingIndex before using this function.
GLintptr ComputeVertexAttributeOffset(const VertexAttribute &attrib, const VertexBinding &binding);
-size_t ComputeVertexBindingElementCount(const VertexBinding &binding,
- size_t drawCount,
- size_t instanceCount);
+size_t ComputeVertexBindingElementCount(GLuint divisor, size_t drawCount, size_t instanceCount);
GLenum GetVertexAttributeBaseType(const VertexAttribute &attrib);
diff --git a/chromium/third_party/angle/src/libANGLE/entry_points_enum_autogen.h b/chromium/third_party/angle/src/libANGLE/entry_points_enum_autogen.h
index 290e2f4015b..08399122fd9 100644
--- a/chromium/third_party/angle/src/libANGLE/entry_points_enum_autogen.h
+++ b/chromium/third_party/angle/src/libANGLE/entry_points_enum_autogen.h
@@ -158,8 +158,110 @@ enum class EntryPoint
VertexAttrib4fv,
VertexAttribPointer,
Viewport,
- DrawElementsInstanced,
+ ReadBuffer,
DrawRangeElements,
+ TexImage3D,
+ TexSubImage3D,
+ CopyTexSubImage3D,
+ CompressedTexImage3D,
+ CompressedTexSubImage3D,
+ GenQueries,
+ DeleteQueries,
+ IsQuery,
+ BeginQuery,
+ EndQuery,
+ GetQueryiv,
+ GetQueryObjectuiv,
+ UnmapBuffer,
+ GetBufferPointerv,
+ DrawBuffers,
+ UniformMatrix2x3fv,
+ UniformMatrix3x2fv,
+ UniformMatrix2x4fv,
+ UniformMatrix4x2fv,
+ UniformMatrix3x4fv,
+ UniformMatrix4x3fv,
+ BlitFramebuffer,
+ RenderbufferStorageMultisample,
+ FramebufferTextureLayer,
+ MapBufferRange,
+ FlushMappedBufferRange,
+ BindVertexArray,
+ DeleteVertexArrays,
+ GenVertexArrays,
+ IsVertexArray,
+ GetIntegeri_v,
+ BeginTransformFeedback,
+ EndTransformFeedback,
+ BindBufferRange,
+ BindBufferBase,
+ TransformFeedbackVaryings,
+ GetTransformFeedbackVarying,
+ VertexAttribIPointer,
+ GetVertexAttribIiv,
+ GetVertexAttribIuiv,
+ VertexAttribI4i,
+ VertexAttribI4ui,
+ VertexAttribI4iv,
+ VertexAttribI4uiv,
+ GetUniformuiv,
+ GetFragDataLocation,
+ Uniform1ui,
+ Uniform2ui,
+ Uniform3ui,
+ Uniform4ui,
+ Uniform1uiv,
+ Uniform2uiv,
+ Uniform3uiv,
+ Uniform4uiv,
+ ClearBufferiv,
+ ClearBufferuiv,
+ ClearBufferfv,
+ ClearBufferfi,
+ GetStringi,
+ CopyBufferSubData,
+ GetUniformIndices,
+ GetActiveUniformsiv,
+ GetUniformBlockIndex,
+ GetActiveUniformBlockiv,
+ GetActiveUniformBlockName,
+ UniformBlockBinding,
+ DrawArraysInstanced,
+ DrawElementsInstanced,
+ FenceSync,
+ IsSync,
+ DeleteSync,
+ ClientWaitSync,
+ WaitSync,
+ GetInteger64v,
+ GetSynciv,
+ GetInteger64i_v,
+ GetBufferParameteri64v,
+ GenSamplers,
+ DeleteSamplers,
+ IsSampler,
+ BindSampler,
+ SamplerParameteri,
+ SamplerParameteriv,
+ SamplerParameterf,
+ SamplerParameterfv,
+ GetSamplerParameteriv,
+ GetSamplerParameterfv,
+ VertexAttribDivisor,
+ BindTransformFeedback,
+ DeleteTransformFeedbacks,
+ GenTransformFeedbacks,
+ IsTransformFeedback,
+ PauseTransformFeedback,
+ ResumeTransformFeedback,
+ GetProgramBinary,
+ ProgramBinary,
+ ProgramParameteri,
+ InvalidateFramebuffer,
+ InvalidateSubFramebuffer,
+ TexStorage2D,
+ TexStorage3D,
+ GetInternalformativ,
DrawElementsInstancedANGLE
};
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/formatutils.cpp b/chromium/third_party/angle/src/libANGLE/formatutils.cpp
index 53eabe48292..faf985cdc61 100644
--- a/chromium/third_party/angle/src/libANGLE/formatutils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/formatutils.cpp
@@ -458,6 +458,24 @@ bool Format::SameSized(const Format &a, const Format &b)
return a.info->sizedInternalFormat == b.info->sizedInternalFormat;
}
+static GLenum EquivalentBlitInternalFormat(GLenum internalformat)
+{
+ // BlitFramebuffer works if the color channels are identically
+ // sized, even if there is a swizzle (for example, blitting from a
+ // multisampled RGBA8 renderbuffer to a BGRA8 texture). This could
+ // be expanded and/or autogenerated if that is found necessary.
+ if (internalformat == GL_BGRA8_EXT)
+ return GL_RGBA8;
+ return internalformat;
+}
+
+// static
+bool Format::EquivalentForBlit(const Format &a, const Format &b)
+{
+ return (EquivalentBlitInternalFormat(a.info->sizedInternalFormat) ==
+ EquivalentBlitInternalFormat(b.info->sizedInternalFormat));
+}
+
// static
Format Format::Invalid()
{
diff --git a/chromium/third_party/angle/src/libANGLE/formatutils.h b/chromium/third_party/angle/src/libANGLE/formatutils.h
index f8c9ef39791..2d3f5f1bb54 100644
--- a/chromium/third_party/angle/src/libANGLE/formatutils.h
+++ b/chromium/third_party/angle/src/libANGLE/formatutils.h
@@ -150,6 +150,7 @@ struct Format
static Format Invalid();
static bool SameSized(const Format &a, const Format &b);
+ static bool EquivalentForBlit(const Format &a, const Format &b);
friend std::ostream &operator<<(std::ostream &os, const Format &fmt);
diff --git a/chromium/third_party/angle/src/libANGLE/params.cpp b/chromium/third_party/angle/src/libANGLE/params.cpp
index 18f8faac135..0c7d8cebfee 100644
--- a/chromium/third_party/angle/src/libANGLE/params.cpp
+++ b/chromium/third_party/angle/src/libANGLE/params.cpp
@@ -20,15 +20,6 @@ namespace gl
constexpr ParamTypeInfo ParamsBase::TypeInfo;
constexpr ParamTypeInfo HasIndexRange::TypeInfo;
-ParamsBase::ParamsBase(Context *context, ...)
-{
-}
-
-HasIndexRange::HasIndexRange(Context *context, GLsizei count, GLenum type, const void *indices)
- : ParamsBase(context), mContext(context), mCount(count), mType(type), mIndices(indices)
-{
-}
-
const Optional<IndexRange> &HasIndexRange::getIndexRange() const
{
if (mIndexRange.valid())
diff --git a/chromium/third_party/angle/src/libANGLE/params.h b/chromium/third_party/angle/src/libANGLE/params.h
index 32a57953deb..230e2bdec7a 100644
--- a/chromium/third_party/angle/src/libANGLE/params.h
+++ b/chromium/third_party/angle/src/libANGLE/params.h
@@ -53,7 +53,7 @@ class ParamTypeInfo
class ParamsBase : angle::NonCopyable
{
public:
- ParamsBase(Context *context, ...);
+ ParamsBase(Context *context, ...){};
template <EntryPoint EP, typename... ArgsT>
static void Factory(EntryPointParamType<EP> *objBuffer, ArgsT... args);
@@ -63,7 +63,7 @@ class ParamsBase : angle::NonCopyable
// static
template <EntryPoint EP, typename... ArgsT>
-void ParamsBase::Factory(EntryPointParamType<EP> *objBuffer, ArgsT... args)
+ANGLE_INLINE void ParamsBase::Factory(EntryPointParamType<EP> *objBuffer, ArgsT... args)
{
new (objBuffer) EntryPointParamType<EP>(args...);
}
@@ -71,7 +71,10 @@ void ParamsBase::Factory(EntryPointParamType<EP> *objBuffer, ArgsT... args)
class HasIndexRange : public ParamsBase
{
public:
- HasIndexRange(Context *context, GLsizei count, GLenum type, const void *indices);
+ HasIndexRange(Context *context, GLsizei count, GLenum type, const void *indices)
+ : ParamsBase(context), mContext(context), mCount(count), mType(type), mIndices(indices)
+ {
+ }
template <EntryPoint EP, typename... ArgsT>
static void Factory(HasIndexRange *objBuffer, ArgsT... args);
@@ -164,6 +167,43 @@ struct EntryPointParam
using Type = ParamsBase;
};
+// A template struct for determining the default value to return for each entry point.
+template <EntryPoint EP, typename ReturnType>
+struct DefaultReturnValue;
+
+// Default return values for each basic return type.
+template <EntryPoint EP>
+struct DefaultReturnValue<EP, GLint>
+{
+ static constexpr GLint kValue = -1;
+};
+
+// This doubles as the GLenum return value.
+template <EntryPoint EP>
+struct DefaultReturnValue<EP, GLuint>
+{
+ static constexpr GLuint kValue = 0;
+};
+
+template <EntryPoint EP>
+struct DefaultReturnValue<EP, GLboolean>
+{
+ static constexpr GLboolean kValue = GL_FALSE;
+};
+
+// Catch-all rule for pointer types.
+template <EntryPoint EP, typename PointerType>
+struct DefaultReturnValue<EP, const PointerType *>
+{
+ static constexpr const PointerType *kValue = nullptr;
+};
+
+template <EntryPoint EP, typename ReturnType>
+constexpr ANGLE_INLINE ReturnType GetDefaultReturnValue()
+{
+ return DefaultReturnValue<EP, ReturnType>::kValue;
+}
+
} // namespace gl
#endif // LIBANGLE_PARAMS_H_
diff --git a/chromium/third_party/angle/src/libANGLE/queryutils.cpp b/chromium/third_party/angle/src/libANGLE/queryutils.cpp
index 389f3a525a8..46bc6563ded 100644
--- a/chromium/third_party/angle/src/libANGLE/queryutils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/queryutils.cpp
@@ -19,6 +19,7 @@
#include "libANGLE/Renderbuffer.h"
#include "libANGLE/Sampler.h"
#include "libANGLE/Shader.h"
+#include "libANGLE/Surface.h"
#include "libANGLE/Texture.h"
#include "libANGLE/Uniform.h"
#include "libANGLE/VertexAttribute.h"
@@ -439,6 +440,93 @@ void QueryBufferParameterBase(const Buffer *buffer, GLenum pname, ParamType *par
}
}
+GLint GetLocationVariableProperty(const sh::VariableWithLocation &var, GLenum prop)
+{
+ switch (prop)
+ {
+ case GL_TYPE:
+ return var.type;
+
+ case GL_ARRAY_SIZE:
+ // TODO(jie.a.chen@intel.com): check array of array.
+ if (var.isArray() && !var.isStruct())
+ {
+ return static_cast<GLint>(var.elementCount());
+ }
+ return 1;
+
+ case GL_NAME_LENGTH:
+ {
+ GLint length = static_cast<GLint>(var.name.size());
+ if (var.isArray())
+ {
+ // Counts "[0]".
+ length += 3;
+ }
+ // ES31 spec p84: This counts the terminating null char.
+ ++length;
+ return length;
+ }
+
+ case GL_LOCATION:
+ return var.location;
+
+ default:
+ UNREACHABLE();
+ return GL_INVALID_VALUE;
+ }
+}
+
+GLint GetInputResourceProperty(const Program *program, GLuint index, GLenum prop)
+{
+ const auto &attribute = program->getInputResource(index);
+ switch (prop)
+ {
+ case GL_TYPE:
+ case GL_ARRAY_SIZE:
+ case GL_LOCATION:
+ case GL_NAME_LENGTH:
+ return GetLocationVariableProperty(attribute, prop);
+
+ case GL_REFERENCED_BY_VERTEX_SHADER:
+ return 1;
+
+ case GL_REFERENCED_BY_FRAGMENT_SHADER:
+ case GL_REFERENCED_BY_COMPUTE_SHADER:
+ return 0;
+
+ default:
+ UNREACHABLE();
+ return GL_INVALID_VALUE;
+ }
+}
+
+GLint GetOutputResourceProperty(const Program *program, GLuint index, const GLenum prop)
+{
+ const auto &outputVariable = program->getOutputResource(index);
+ switch (prop)
+ {
+ case GL_TYPE:
+ case GL_ARRAY_SIZE:
+ case GL_LOCATION:
+ case GL_NAME_LENGTH:
+ return GetLocationVariableProperty(outputVariable, prop);
+
+ case GL_REFERENCED_BY_VERTEX_SHADER:
+ return 0;
+
+ case GL_REFERENCED_BY_FRAGMENT_SHADER:
+ return 1;
+
+ case GL_REFERENCED_BY_COMPUTE_SHADER:
+ return 0;
+
+ default:
+ UNREACHABLE();
+ return GL_INVALID_VALUE;
+ }
+}
+
} // anonymous namespace
void QueryFramebufferAttachmentParameteriv(const Framebuffer *framebuffer,
@@ -910,11 +998,7 @@ void QueryFramebufferParameteriv(const Framebuffer *framebuffer, GLenum pname, G
}
}
-Error QuerySynciv(const FenceSync *sync,
- GLenum pname,
- GLsizei bufSize,
- GLsizei *length,
- GLint *values)
+Error QuerySynciv(const Sync *sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values)
{
ASSERT(sync);
@@ -1123,6 +1207,60 @@ GLint QueryProgramResourceLocation(const Program *program,
}
}
+void QueryProgramResourceiv(const Program *program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei propCount,
+ const GLenum *props,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *params)
+{
+ if (!program->isLinked())
+ {
+ if (length != nullptr)
+ {
+ *length = 0;
+ }
+ return;
+ }
+
+ GLsizei count = std::min(propCount, bufSize);
+ if (length != nullptr)
+ {
+ *length = count;
+ }
+
+ for (GLsizei i = 0; i < count; i++)
+ {
+ switch (programInterface)
+ {
+ case GL_PROGRAM_INPUT:
+ params[i] = GetInputResourceProperty(program, index, props[i]);
+ break;
+
+ case GL_PROGRAM_OUTPUT:
+ params[i] = GetOutputResourceProperty(program, index, props[i]);
+ break;
+
+ // TODO(jie.a.chen@intel.com): more interfaces.
+ case GL_UNIFORM:
+ case GL_UNIFORM_BLOCK:
+ case GL_TRANSFORM_FEEDBACK_VARYING:
+ case GL_BUFFER_VARIABLE:
+ case GL_SHADER_STORAGE_BLOCK:
+ case GL_ATOMIC_COUNTER_BUFFER:
+ UNIMPLEMENTED();
+ params[i] = GL_INVALID_VALUE;
+ break;
+
+ default:
+ UNREACHABLE();
+ params[i] = GL_INVALID_VALUE;
+ }
+ }
+}
+
} // namespace gl
namespace egl
@@ -1245,4 +1383,119 @@ void QueryConfigAttrib(const Config *config, EGLint attribute, EGLint *value)
}
}
+void QuerySurfaceAttrib(const Surface *surface, EGLint attribute, EGLint *value)
+{
+ switch (attribute)
+ {
+ case EGL_GL_COLORSPACE:
+ *value = surface->getGLColorspace();
+ break;
+ case EGL_VG_ALPHA_FORMAT:
+ *value = surface->getVGAlphaFormat();
+ break;
+ case EGL_VG_COLORSPACE:
+ *value = surface->getVGColorspace();
+ break;
+ case EGL_CONFIG_ID:
+ *value = surface->getConfig()->configID;
+ break;
+ case EGL_HEIGHT:
+ *value = surface->getHeight();
+ break;
+ case EGL_HORIZONTAL_RESOLUTION:
+ *value = surface->getHorizontalResolution();
+ break;
+ case EGL_LARGEST_PBUFFER:
+ // The EGL spec states that value is not written if the surface is not a pbuffer
+ if (surface->getType() == EGL_PBUFFER_BIT)
+ {
+ *value = surface->getLargestPbuffer();
+ }
+ break;
+ case EGL_MIPMAP_TEXTURE:
+ // The EGL spec states that value is not written if the surface is not a pbuffer
+ if (surface->getType() == EGL_PBUFFER_BIT)
+ {
+ *value = surface->getMipmapTexture();
+ }
+ break;
+ case EGL_MIPMAP_LEVEL:
+ // The EGL spec states that value is not written if the surface is not a pbuffer
+ if (surface->getType() == EGL_PBUFFER_BIT)
+ {
+ *value = surface->getMipmapLevel();
+ }
+ break;
+ case EGL_MULTISAMPLE_RESOLVE:
+ *value = surface->getMultisampleResolve();
+ break;
+ case EGL_PIXEL_ASPECT_RATIO:
+ *value = surface->getPixelAspectRatio();
+ break;
+ case EGL_RENDER_BUFFER:
+ *value = surface->getRenderBuffer();
+ break;
+ case EGL_SWAP_BEHAVIOR:
+ *value = surface->getSwapBehavior();
+ break;
+ case EGL_TEXTURE_FORMAT:
+ // The EGL spec states that value is not written if the surface is not a pbuffer
+ if (surface->getType() == EGL_PBUFFER_BIT)
+ {
+ *value = surface->getTextureFormat();
+ }
+ break;
+ case EGL_TEXTURE_TARGET:
+ // The EGL spec states that value is not written if the surface is not a pbuffer
+ if (surface->getType() == EGL_PBUFFER_BIT)
+ {
+ *value = surface->getTextureTarget();
+ }
+ break;
+ case EGL_VERTICAL_RESOLUTION:
+ *value = surface->getVerticalResolution();
+ break;
+ case EGL_WIDTH:
+ *value = surface->getWidth();
+ break;
+ case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
+ *value = surface->isPostSubBufferSupported();
+ break;
+ case EGL_FIXED_SIZE_ANGLE:
+ *value = surface->isFixedSize();
+ break;
+ case EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE:
+ *value = surface->flexibleSurfaceCompatibilityRequested();
+ break;
+ case EGL_SURFACE_ORIENTATION_ANGLE:
+ *value = surface->getOrientation();
+ break;
+ case EGL_DIRECT_COMPOSITION_ANGLE:
+ *value = surface->directComposition();
+ break;
+ default:
+ UNREACHABLE();
+ break;
+ }
+}
+
+void SetSurfaceAttrib(Surface *surface, EGLint attribute, EGLint value)
+{
+ switch (attribute)
+ {
+ case EGL_MIPMAP_LEVEL:
+ surface->setMipmapLevel(value);
+ break;
+ case EGL_MULTISAMPLE_RESOLVE:
+ surface->setMultisampleResolve(value);
+ break;
+ case EGL_SWAP_BEHAVIOR:
+ surface->setSwapBehavior(value);
+ break;
+ default:
+ UNREACHABLE();
+ break;
+ }
+}
+
} // namespace egl
diff --git a/chromium/third_party/angle/src/libANGLE/queryutils.h b/chromium/third_party/angle/src/libANGLE/queryutils.h
index c0de4a55cfb..e47776cbb28 100644
--- a/chromium/third_party/angle/src/libANGLE/queryutils.h
+++ b/chromium/third_party/angle/src/libANGLE/queryutils.h
@@ -19,7 +19,7 @@ namespace gl
class Buffer;
class Context;
class Error;
-class FenceSync;
+class Sync;
class Framebuffer;
class Program;
class Renderbuffer;
@@ -97,11 +97,7 @@ 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);
+Error QuerySynciv(const Sync *sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
void SetTexParameterf(Context *context, Texture *texture, GLenum pname, GLfloat param);
void SetTexParameterfv(Context *context, Texture *texture, GLenum pname, const GLfloat *params);
@@ -131,15 +127,27 @@ void QueryProgramResourceName(const Program *program,
GLint QueryProgramResourceLocation(const Program *program,
GLenum programInterface,
const GLchar *name);
+void QueryProgramResourceiv(const Program *program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei propCount,
+ const GLenum *props,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *params);
} // namespace gl
namespace egl
{
struct Config;
+class Surface;
void QueryConfigAttrib(const Config *config, EGLint attribute, EGLint *value);
+void QuerySurfaceAttrib(const Surface *surface, EGLint attribute, EGLint *value);
+void SetSurfaceAttrib(Surface *surface, EGLint attribute, EGLint value);
+
} // namespace egl
#endif // LIBANGLE_QUERYUTILS_H_
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h
index 472caeda27d..406796e15cc 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/ContextImpl.h
@@ -18,6 +18,7 @@
namespace gl
{
+class MemoryProgramCache;
class Path;
struct Workarounds;
}
@@ -51,23 +52,20 @@ class ContextImpl : public GLImplFactory
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) = 0;
+ const void *indices) = 0;
virtual gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange) = 0;
+ GLsizei instances) = 0;
virtual gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) = 0;
+ const void *indices) = 0;
virtual gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
@@ -158,6 +156,18 @@ class ContextImpl : public GLImplFactory
GLuint numGroupsY,
GLuint numGroupsZ) = 0;
+ // This does not correspond to a GL API, but matches a common GL driver behaviour where
+ // draw call states can trigger dynamic shader recompilation. We pass the Program cache
+ // handle as a mutable pointer to this Impl method to both trigger dynamic recompilations
+ // and to allow the back-end to store the refreshed shaders in the cache.
+ virtual gl::Error triggerDrawCallProgramRecompilation(const gl::Context *context,
+ gl::InfoLog *infoLog,
+ gl::MemoryProgramCache *memoryCache,
+ GLenum drawMode)
+ {
+ return gl::NoError();
+ }
+
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/Format.h b/chromium/third_party/angle/src/libANGLE/renderer/Format.h
index bf4f0d0b410..38087335f1d 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/Format.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/Format.h
@@ -38,6 +38,7 @@ struct Format final : private angle::NonCopyable
GLuint stencilBits);
static const Format &Get(ID id);
+ static ID InternalFormatToID(GLenum internalFormat);
ID id;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/Format_table_autogen.cpp b/chromium/third_party/angle/src/libANGLE/renderer/Format_table_autogen.cpp
index 3c5aced6bab..559c4168af9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/Format_table_autogen.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/Format_table_autogen.cpp
@@ -153,6 +153,146 @@ constexpr Format g_formatInfoTable[] = {
};
// static
+Format::ID Format::InternalFormatToID(GLenum internalFormat)
+{
+ switch (internalFormat)
+ {
+ // clang-format off
+ case GL_RGBA16_EXT: return Format::ID::R16G16B16A16_UNORM;
+ case GL_ETC1_RGB8_LOSSY_DECODE_ANGLE: return Format::ID::NONE;
+ case GL_RG8I: return Format::ID::R8G8_SINT;
+ case GL_R16F: return Format::ID::R16_FLOAT;
+ case GL_RGBA8I: return Format::ID::R8G8B8A8_SINT;
+ case GL_RG8UI: return Format::ID::R8G8_UINT;
+ case GL_RGBA8_SNORM: return Format::ID::R8G8B8A8_SNORM;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR: return Format::ID::ASTC_12x10_SRGB_BLOCK;
+ case GL_RG8_SNORM: return Format::ID::R8G8_SNORM;
+ case GL_BGR565_ANGLEX: return Format::ID::B5G6R5_UNORM;
+ case GL_DEPTH_COMPONENT24: return Format::ID::D24_UNORM;
+ case GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2: return Format::ID::ETC2_R8G8B8A1_UNORM_BLOCK;
+ case GL_COMPRESSED_RGBA_ASTC_10x10_KHR: return Format::ID::ASTC_10x10_UNORM_BLOCK;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR: return Format::ID::ASTC_8x6_SRGB_BLOCK;
+ case GL_RGB32UI: return Format::ID::R32G32B32_UINT;
+ case GL_COMPRESSED_RGBA_ASTC_6x5_KHR: return Format::ID::ASTC_6x5_UNORM_BLOCK;
+ case GL_ALPHA32F_EXT: return Format::ID::A32_FLOAT;
+ case GL_R16UI: return Format::ID::R16_UINT;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR: return Format::ID::ASTC_5x4_SRGB_BLOCK;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR: return Format::ID::ASTC_5x5_SRGB_BLOCK;
+ case GL_COMPRESSED_R11_EAC: return Format::ID::EAC_R11_UNORM_BLOCK;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR: return Format::ID::ASTC_10x10_SRGB_BLOCK;
+ case GL_RGBA32UI: return Format::ID::R32G32B32A32_UINT;
+ case GL_R8_SNORM: return Format::ID::R8_SNORM;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT: return Format::ID::BC1_RGBA_UNORM_SRGB_BLOCK;
+ case GL_LUMINANCE32F_EXT: return Format::ID::L32_FLOAT;
+ case GL_RG16_EXT: return Format::ID::R16G16_UNORM;
+ case GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2: return Format::ID::ETC2_R8G8B8A1_SRGB_BLOCK;
+ case GL_SRGB8: return Format::ID::R8G8B8_UNORM_SRGB;
+ case GL_LUMINANCE8_ALPHA8_EXT: return Format::ID::L8A8_UNORM;
+ case GL_BGRX8_ANGLEX: return Format::ID::B8G8R8X8_UNORM;
+ case GL_RGB16_SNORM_EXT: return Format::ID::R16G16B16_SNORM;
+ case GL_RGBA8UI: return Format::ID::R8G8B8A8_UINT;
+ case GL_BGRA4_ANGLEX: return Format::ID::B4G4R4A4_UNORM;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC: return Format::ID::ETC2_R8G8B8A8_SRGB_BLOCK;
+ case GL_LUMINANCE8_EXT: return Format::ID::L8_UNORM;
+ case GL_COMPRESSED_RGBA_S3TC_DXT5_ANGLE: return Format::ID::BC3_RGBA_UNORM_BLOCK;
+ case GL_R16I: return Format::ID::R16_SINT;
+ case GL_RGB5_A1: return Format::ID::R5G5B5A1_UNORM;
+ case GL_RGB16UI: return Format::ID::R16G16B16_UINT;
+ case GL_COMPRESSED_RGBA_ASTC_4x4_KHR: return Format::ID::ASTC_4x4_UNORM_BLOCK;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT: return Format::ID::BC2_RGBA_UNORM_SRGB_BLOCK;
+ case GL_R16_SNORM_EXT: return Format::ID::R16_SNORM;
+ case GL_COMPRESSED_RGB8_ETC2: return Format::ID::ETC2_R8G8B8_UNORM_BLOCK;
+ case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: return Format::ID::BC1_RGB_UNORM_SRGB_BLOCK;
+ case GL_RGBA32F: return Format::ID::R32G32B32A32_FLOAT;
+ case GL_RGBA32I: return Format::ID::R32G32B32A32_SINT;
+ case GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT: return Format::ID::BC3_RGBA_UNORM_SRGB_BLOCK;
+ case GL_COMPRESSED_RGBA_ASTC_8x5_KHR: return Format::ID::ASTC_8x5_UNORM_BLOCK;
+ case GL_RG8: return Format::ID::R8G8_UNORM;
+ case GL_COMPRESSED_RGBA_ASTC_8x8_KHR: return Format::ID::ASTC_8x8_UNORM_BLOCK;
+ case GL_RGB10_A2: return Format::ID::R10G10B10A2_UNORM;
+ case GL_COMPRESSED_SIGNED_RG11_EAC: return Format::ID::EAC_R11G11_SNORM_BLOCK;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR: return Format::ID::ASTC_6x6_SRGB_BLOCK;
+ case GL_DEPTH_COMPONENT16: return Format::ID::D16_UNORM;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR: return Format::ID::ASTC_10x5_SRGB_BLOCK;
+ case GL_RGB32I: return Format::ID::R32G32B32_SINT;
+ case GL_R8: return Format::ID::R8_UNORM;
+ case GL_RGB32F: return Format::ID::R32G32B32_FLOAT;
+ case GL_R16_EXT: return Format::ID::R16_UNORM;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR: return Format::ID::ASTC_8x8_SRGB_BLOCK;
+ case GL_COMPRESSED_RGBA_ASTC_10x5_KHR: return Format::ID::ASTC_10x5_UNORM_BLOCK;
+ case GL_R11F_G11F_B10F: return Format::ID::R11G11B10_FLOAT;
+ case GL_RGB8: return Format::ID::R8G8B8_UNORM;
+ case GL_COMPRESSED_RGBA_ASTC_5x5_KHR: return Format::ID::ASTC_5x5_UNORM_BLOCK;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR: return Format::ID::ASTC_8x5_SRGB_BLOCK;
+ case GL_RGBA16I: return Format::ID::R16G16B16A16_SINT;
+ case GL_R8I: return Format::ID::R8_SINT;
+ case GL_RGB8_SNORM: return Format::ID::R8G8B8_SNORM;
+ case GL_RG32F: return Format::ID::R32G32_FLOAT;
+ case GL_DEPTH_COMPONENT32F: return Format::ID::D32_FLOAT;
+ case GL_RG32I: return Format::ID::R32G32_SINT;
+ case GL_ALPHA8_EXT: return Format::ID::A8_UNORM;
+ case GL_RGB16_EXT: return Format::ID::R16G16B16_UNORM;
+ case GL_BGRA8_EXT: return Format::ID::B8G8R8A8_UNORM;
+ case GL_RG32UI: return Format::ID::R32G32_UINT;
+ case GL_RGBA16UI: return Format::ID::R16G16B16A16_UINT;
+ case GL_COMPRESSED_RGBA8_ETC2_EAC: return Format::ID::ETC2_R8G8B8A8_UNORM_BLOCK;
+ case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT: return Format::ID::BC1_RGBA_UNORM_BLOCK;
+ case GL_COMPRESSED_RGBA_ASTC_10x6_KHR: return Format::ID::ASTC_10x6_UNORM_BLOCK;
+ case GL_COMPRESSED_SRGB8_ETC2: return Format::ID::ETC2_R8G8B8_SRGB_BLOCK;
+ case GL_DEPTH32F_STENCIL8: return Format::ID::D32_FLOAT_S8X24_UINT;
+ case GL_COMPRESSED_RGBA_ASTC_6x6_KHR: return Format::ID::ASTC_6x6_UNORM_BLOCK;
+ case GL_R32UI: return Format::ID::R32_UINT;
+ case GL_BGR5_A1_ANGLEX: return Format::ID::B5G5R5A1_UNORM;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR: return Format::ID::ASTC_12x12_SRGB_BLOCK;
+ case GL_COMPRESSED_RG11_EAC: return Format::ID::EAC_R11G11_UNORM_BLOCK;
+ case GL_SRGB8_ALPHA8: return Format::ID::R8G8B8A8_UNORM_SRGB;
+ case GL_LUMINANCE_ALPHA16F_EXT: return Format::ID::L16A16_FLOAT;
+ case GL_RGBA: return Format::ID::R8G8B8A8_UNORM;
+ case GL_ETC1_RGB8_OES: return Format::ID::NONE;
+ case GL_DEPTH24_STENCIL8: return Format::ID::D24_UNORM_S8_UINT;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR: return Format::ID::ASTC_4x4_SRGB_BLOCK;
+ case GL_RGB16I: return Format::ID::R16G16B16_SINT;
+ case GL_R8UI: return Format::ID::R8_UINT;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR: return Format::ID::ASTC_10x6_SRGB_BLOCK;
+ case GL_RGBA16F: return Format::ID::R16G16B16A16_FLOAT;
+ case GL_COMPRESSED_SIGNED_R11_EAC: return Format::ID::EAC_R11_SNORM_BLOCK;
+ case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: return Format::ID::BC1_RGB_UNORM_BLOCK;
+ case GL_RGB8I: return Format::ID::R8G8B8_SINT;
+ case GL_COMPRESSED_RGBA_ASTC_8x6_KHR: return Format::ID::ASTC_8x6_UNORM_BLOCK;
+ case GL_STENCIL_INDEX8: return Format::ID::S8_UINT;
+ case GL_LUMINANCE_ALPHA32F_EXT: return Format::ID::L32A32_FLOAT;
+ case GL_ALPHA16F_EXT: return Format::ID::A16_FLOAT;
+ case GL_RGB8UI: return Format::ID::R8G8B8_UINT;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR: return Format::ID::ASTC_10x8_SRGB_BLOCK;
+ case GL_COMPRESSED_RGBA_ASTC_12x10_KHR: return Format::ID::ASTC_12x10_UNORM_BLOCK;
+ case GL_RGB9_E5: return Format::ID::R9G9B9E5_SHAREDEXP;
+ case GL_RGBA16_SNORM_EXT: return Format::ID::R16G16B16A16_SNORM;
+ case GL_R32I: return Format::ID::R32_SINT;
+ case GL_DEPTH_COMPONENT32_OES: return Format::ID::D32_UNORM;
+ case GL_R32F: return Format::ID::R32_FLOAT;
+ case GL_NONE: return Format::ID::NONE;
+ case GL_RG16F: return Format::ID::R16G16_FLOAT;
+ case GL_RGB: return Format::ID::R8G8B8_UNORM;
+ case GL_RGB565: return Format::ID::R5G6B5_UNORM;
+ case GL_LUMINANCE16F_EXT: return Format::ID::L16_FLOAT;
+ case GL_RG16UI: return Format::ID::R16G16_UINT;
+ case GL_COMPRESSED_RGBA_S3TC_DXT3_ANGLE: return Format::ID::BC2_RGBA_UNORM_BLOCK;
+ case GL_RG16I: return Format::ID::R16G16_SINT;
+ case GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR: return Format::ID::ASTC_6x5_SRGB_BLOCK;
+ case GL_RG16_SNORM_EXT: return Format::ID::R16G16_SNORM;
+ case GL_COMPRESSED_RGBA_ASTC_12x12_KHR: return Format::ID::ASTC_12x12_UNORM_BLOCK;
+ case GL_COMPRESSED_RGBA_ASTC_5x4_KHR: return Format::ID::ASTC_5x4_UNORM_BLOCK;
+ case GL_COMPRESSED_RGBA_ASTC_10x8_KHR: return Format::ID::ASTC_10x8_UNORM_BLOCK;
+ case GL_RGBA4: return Format::ID::R4G4B4A4_UNORM;
+ case GL_RGBA8: return Format::ID::R8G8B8A8_UNORM;
+ case GL_RGB16F: return Format::ID::R16G16B16_FLOAT;
+ case GL_RGB10_A2UI: return Format::ID::R10G10B10A2_UINT;
+ default: return Format::ID::NONE;
+ // clang-format on
+ }
+}
+
+// static
const Format &Format::Get(ID id)
{
return g_formatInfoTable[static_cast<size_t>(id)];
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/GLImplFactory.h b/chromium/third_party/angle/src/libANGLE/renderer/GLImplFactory.h
index 20a48fc723a..2f72425a8c0 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/GLImplFactory.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/GLImplFactory.h
@@ -30,7 +30,7 @@ class BufferImpl;
class CompilerImpl;
class ContextImpl;
class FenceNVImpl;
-class FenceSyncImpl;
+class SyncImpl;
class FramebufferImpl;
class PathImpl;
class ProgramImpl;
@@ -71,7 +71,7 @@ class GLImplFactory : angle::NonCopyable
// Query and Fence creation
virtual QueryImpl *createQuery(GLenum type) = 0;
virtual FenceNVImpl *createFenceNV() = 0;
- virtual FenceSyncImpl *createFenceSync() = 0;
+ virtual SyncImpl *createSync() = 0;
// Transform Feedback creation
virtual TransformFeedbackImpl *createTransformFeedback(
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h
index d2b71187c6c..b32b93b54d7 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl.h
@@ -72,6 +72,15 @@ class ProgramImpl : angle::NonCopyable
virtual void setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = 0;
virtual void setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) = 0;
+ // Done in the back-end to avoid having to keep a system copy of uniform data.
+ virtual void getUniformfv(const gl::Context *context,
+ GLint location,
+ GLfloat *params) const = 0;
+ virtual void getUniformiv(const gl::Context *context, GLint location, GLint *params) const = 0;
+ virtual void getUniformuiv(const gl::Context *context,
+ GLint location,
+ GLuint *params) const = 0;
+
// TODO: synchronize in syncState when dirty bits exist.
virtual void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) = 0;
@@ -90,6 +99,11 @@ class ProgramImpl : angle::NonCopyable
GLint components,
const GLfloat *coeffs) = 0;
+ // Implementation-specific method for ignoring unreferenced uniforms. Some implementations may
+ // perform more extensive analysis and ignore some locations that ANGLE doesn't detect as
+ // unreferenced. This method is not required to be overriden by a back-end.
+ virtual void markUnusedUniformLocations(std::vector<gl::VariableLocation> *uniformLocations) {}
+
protected:
const gl::ProgramState &mState;
};
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 8883ca4a52e..9587dbdfe6f 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/ProgramImpl_mock.h
@@ -55,6 +55,10 @@ class MockProgramImpl : public rx::ProgramImpl
MOCK_METHOD4(setUniformMatrix3x4fv, void(GLint, GLsizei, GLboolean, const GLfloat *));
MOCK_METHOD4(setUniformMatrix4x3fv, void(GLint, GLsizei, GLboolean, const GLfloat *));
+ MOCK_CONST_METHOD3(getUniformfv, void(const gl::Context *, GLint, GLfloat *));
+ MOCK_CONST_METHOD3(getUniformiv, void(const gl::Context *, GLint, GLint *));
+ MOCK_CONST_METHOD3(getUniformuiv, void(const gl::Context *, GLint, GLuint *));
+
MOCK_METHOD2(setUniformBlockBinding, void(GLuint, GLuint));
MOCK_CONST_METHOD2(getUniformBlockSize, bool(const std::string &, size_t *));
MOCK_CONST_METHOD2(getUniformBlockMemberInfo, bool(const std::string &, sh::BlockMemberInfo *));
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/FenceSyncImpl.h b/chromium/third_party/angle/src/libANGLE/renderer/SyncImpl.h
index 6b78e69d47a..22c92c3729e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/FenceSyncImpl.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/SyncImpl.h
@@ -4,7 +4,7 @@
// found in the LICENSE file.
//
-// FenceSyncImpl.h: Defines the rx::FenceSyncImpl class.
+// SyncImpl.h: Defines the rx::SyncImpl class.
#ifndef LIBANGLE_RENDERER_FENCESYNCIMPL_H_
#define LIBANGLE_RENDERER_FENCESYNCIMPL_H_
@@ -18,18 +18,17 @@
namespace rx
{
-class FenceSyncImpl : angle::NonCopyable
+class SyncImpl : angle::NonCopyable
{
public:
- FenceSyncImpl() { };
- virtual ~FenceSyncImpl() { };
+ SyncImpl(){};
+ virtual ~SyncImpl(){};
virtual gl::Error set(GLenum condition, GLbitfield flags) = 0;
virtual gl::Error clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult) = 0;
virtual gl::Error serverWait(GLbitfield flags, GLuint64 timeout) = 0;
virtual gl::Error getStatus(GLint *outResult) = 0;
};
-
}
-#endif // LIBANGLE_RENDERER_FENCESYNCIMPL_H_
+#endif // LIBANGLE_RENDERER_FENCESYNCIMPL_H_
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 27d29948b7f..8bc7c58dcd9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp
@@ -294,8 +294,13 @@ std::string DynamicHLSL::generatePixelShaderForOutputSignature(
declarationStream << "struct PS_OUTPUT\n"
"{\n";
+ size_t numOutputs = outputLayout.size();
+
// Workaround for HLSL 3.x: We can't do a depth/stencil only render, the runtime will complain.
- size_t numOutputs = outputLayout.empty() ? 1u : outputLayout.size();
+ if (numOutputs == 0 && (shaderModel == 3 || !mRenderer->getShaderModelSuffix().empty()))
+ {
+ numOutputs = 1u;
+ }
const PixelShaderOutputVariable defaultOutput(GL_FLOAT_VEC4, "dummy", "float4(0, 0, 0, 1)", 0);
for (size_t layoutIndex = 0; layoutIndex < numOutputs; ++layoutIndex)
@@ -379,6 +384,18 @@ void DynamicHLSL::generateVaryingLinkHLSL(const VaryingPacking &varyingPacking,
hlslStream << " float gl_PointSize : " << builtins.glPointSize.str() << ";\n";
}
+ if (builtins.glViewIDOVR.enabled)
+ {
+ hlslStream << " nointerpolation uint gl_ViewID_OVR : " << builtins.glViewIDOVR.str()
+ << ";\n";
+ }
+
+ if (builtins.glViewportIndex.enabled)
+ {
+ hlslStream << " nointerpolation uint gl_ViewportIndex : "
+ << builtins.glViewportIndex.str() << ";\n";
+ }
+
std::string varyingSemantic =
GetVaryingSemantic(mRenderer->getMajorShaderModel(), programUsesPointSize);
@@ -483,6 +500,11 @@ void DynamicHLSL::generateShaderLinkHLSL(const gl::Context *context,
vertexStream << " output.gl_Position = gl_Position;\n";
}
+ if (vertexBuiltins.glViewIDOVR.enabled)
+ {
+ vertexStream << " output.gl_ViewID_OVR = _ViewID_OVR;\n";
+ }
+
// On D3D9 or D3D11 Feature Level 9, we need to emulate large viewports using dx_ViewAdjust.
if (shaderModel >= 4 && mRenderer->getShaderModelSuffix() == "")
{
@@ -642,6 +664,12 @@ void DynamicHLSL::generateShaderLinkHLSL(const gl::Context *context,
<< "{\n";
}
+ if (fragmentShader->usesViewID())
+ {
+ ASSERT(pixelBuiltins.glViewIDOVR.enabled);
+ pixelStream << " _ViewID_OVR = input.gl_ViewID_OVR;\n";
+ }
+
if (pixelBuiltins.glFragCoord.enabled)
{
pixelStream << " float rhw = 1.0 / input.gl_FragCoord.w;\n";
@@ -872,7 +900,8 @@ std::string DynamicHLSL::generateComputeShaderLinkHLSL(const gl::Context *contex
}
std::string DynamicHLSL::generateGeometryShaderPreamble(const VaryingPacking &varyingPacking,
- const BuiltinVaryingsD3D &builtinsD3D) const
+ const BuiltinVaryingsD3D &builtinsD3D,
+ const bool hasANGLEMultiviewEnabled) const
{
ASSERT(mRenderer->getMajorShaderModel() >= 4);
@@ -919,6 +948,15 @@ std::string DynamicHLSL::generateGeometryShaderPreamble(const VaryingPacking &va
<< "#endif // ANGLE_POINT_SPRITE_SHADER\n"
<< "}\n";
+ if (builtinsD3D[SHADER_GEOMETRY].glViewportIndex.enabled && hasANGLEMultiviewEnabled)
+ {
+ preambleStream << "\n"
+ << "void selectView(inout GS_OUTPUT output, GS_INPUT input)\n"
+ << "{\n"
+ << " output.gl_ViewportIndex = input.gl_ViewID_OVR;\n"
+ << "}\n";
+ }
+
return preambleStream.str();
}
@@ -926,13 +964,15 @@ std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveT
const gl::ContextState &data,
const gl::ProgramState &programData,
const bool useViewScale,
+ const bool hasANGLEMultiviewEnabled,
+ const bool pointSpriteEmulation,
const std::string &preambleString) const
{
ASSERT(mRenderer->getMajorShaderModel() >= 4);
std::stringstream shaderStream;
- const bool pointSprites = (primitiveType == PRIMITIVE_POINTS);
+ const bool pointSprites = (primitiveType == PRIMITIVE_POINTS) && pointSpriteEmulation;
const bool usesPointCoord = preambleString.find("gl_PointCoord") != std::string::npos;
const char *inputPT = nullptr;
@@ -944,9 +984,19 @@ std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveT
{
case PRIMITIVE_POINTS:
inputPT = "point";
- outputPT = "Triangle";
inputSize = 1;
- maxVertexOutput = 4;
+
+ if (pointSprites)
+ {
+ outputPT = "Triangle";
+ maxVertexOutput = 4;
+ }
+ else
+ {
+ outputPT = "Point";
+ maxVertexOutput = 1;
+ }
+
break;
case PRIMITIVE_LINES:
@@ -1034,7 +1084,10 @@ std::string DynamicHLSL::generateGeometryShaderHLSL(gl::PrimitiveType primitiveT
{
shaderStream << " copyVertex(output, input[" << vertexIndex
<< "], input[lastVertexIndex]);\n";
-
+ if (hasANGLEMultiviewEnabled)
+ {
+ shaderStream << " selectView(output, input[" << vertexIndex << "]);\n";
+ }
if (!pointSprites)
{
ASSERT(inputSize == maxVertexOutput);
@@ -1253,6 +1306,21 @@ void BuiltinVaryingsD3D::updateBuiltins(ShaderType shaderType,
}
}
+ if (shaderType == SHADER_VERTEX && metadata.hasANGLEMultiviewEnabled())
+ {
+ builtins->glViewIDOVR.enable(userSemantic, reservedSemanticIndex++);
+ }
+
+ if (shaderType == SHADER_PIXEL && metadata.hasANGLEMultiviewEnabled())
+ {
+ builtins->glViewIDOVR.enableSystem("SV_ViewportArrayIndex");
+ }
+
+ if (shaderType == SHADER_GEOMETRY && metadata.hasANGLEMultiviewEnabled())
+ {
+ builtins->glViewportIndex.enableSystem("SV_ViewportArrayIndex");
+ }
+
// Special case: do not include PSIZE semantic in HLSL 3 pixel shaders
if (metadata.usesSystemValuePointSize() &&
(shaderType != SHADER_PIXEL || metadata.getRendererMajorShaderModel() >= 4))
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.h
index 4ab0626cc2c..a5fa3b57c9c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/DynamicHLSL.h
@@ -76,6 +76,8 @@ struct BuiltinInfo
BuiltinVarying glFragCoord;
BuiltinVarying glPointCoord;
BuiltinVarying glPointSize;
+ BuiltinVarying glViewIDOVR;
+ BuiltinVarying glViewportIndex;
};
inline std::string GetVaryingSemantic(int majorShaderModel, bool programUsesPointSize)
@@ -128,12 +130,15 @@ class DynamicHLSL : angle::NonCopyable
const gl::ProgramState &programData) const;
std::string generateGeometryShaderPreamble(const gl::VaryingPacking &varyingPacking,
- const BuiltinVaryingsD3D &builtinsD3D) const;
+ const BuiltinVaryingsD3D &builtinsD3D,
+ const bool hasANGLEMultiviewEnabled) const;
std::string generateGeometryShaderHLSL(gl::PrimitiveType primitiveType,
const gl::ContextState &data,
const gl::ProgramState &programData,
const bool useViewScale,
+ const bool hasANGLEMultiviewEnabled,
+ const bool pointSpriteEmulation,
const std::string &preambleString) const;
void getPixelShaderOutputKey(const gl::ContextState &data,
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
index 3953100e3bd..b38765070b2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp
@@ -6,6 +6,8 @@
#include "libANGLE/renderer/d3d/HLSLCompiler.h"
+#include <sstream>
+
#include "common/utilities.h"
#include "libANGLE/Program.h"
#include "libANGLE/features.h"
@@ -190,7 +192,9 @@ gl::Error HLSLCompiler::compileToBinary(gl::InfoLog &infoLog, const std::string
if (gl::DebugAnnotationsActive())
{
std::string sourcePath = getTempPath();
- std::string sourceText = FormatString("#line 2 \"%s\"\n\n%s", sourcePath.c_str(), hlsl.c_str());
+ std::ostringstream stream;
+ stream << "#line 2 \"" << sourcePath << "\"\n\n" << hlsl;
+ std::string sourceText = stream.str();
writeFile(sourcePath.c_str(), sourceText.c_str(), sourceText.size());
}
#endif
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 47c68ec85b8..045d477e67a 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp
@@ -11,6 +11,8 @@
#include "common/utilities.h"
#include "libANGLE/Buffer.h"
+#include "libANGLE/Context.h"
+#include "libANGLE/VertexArray.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/BufferD3D.h"
#include "libANGLE/renderer/d3d/IndexBuffer.h"
@@ -126,31 +128,41 @@ gl::Error StreamInIndexBuffer(IndexBufferInterface *buffer,
IndexDataManager::IndexDataManager(BufferFactoryD3D *factory, RendererClass rendererClass)
: mFactory(factory),
mRendererClass(rendererClass),
- mStreamingBufferShort(nullptr),
- mStreamingBufferInt(nullptr)
+ mStreamingBufferShort(),
+ mStreamingBufferInt()
{
}
IndexDataManager::~IndexDataManager()
{
- SafeDelete(mStreamingBufferShort);
- SafeDelete(mStreamingBufferInt);
}
-bool IndexDataManager::usePrimitiveRestartWorkaround(bool primitiveRestartFixedIndexEnabled,
- GLenum type)
+void IndexDataManager::deinitialize()
+{
+ mStreamingBufferShort.reset();
+ mStreamingBufferInt.reset();
+}
+
+// static
+bool IndexDataManager::UsePrimitiveRestartWorkaround(bool primitiveRestartFixedIndexEnabled,
+ GLenum type,
+ RendererClass rendererClass)
{
// 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);
+ rendererClass == RENDERER_D3D11);
}
-bool IndexDataManager::isStreamingIndexData(bool primitiveRestartWorkaround,
+// static
+bool IndexDataManager::IsStreamingIndexData(const gl::Context *context,
GLenum srcType,
- gl::Buffer *glBuffer)
+ RendererClass rendererClass)
{
- BufferD3D *buffer = glBuffer ? GetImplAs<BufferD3D>(glBuffer) : nullptr;
+ const auto &glState = context->getGLState();
+ bool primitiveRestartWorkaround =
+ UsePrimitiveRestartWorkaround(glState.isPrimitiveRestartEnabled(), srcType, rendererClass);
+ gl::Buffer *glBuffer = glState.getVertexArray()->getElementArrayBuffer().get();
// Case 1: the indices are passed by pointer, which forces the streaming of index data
if (glBuffer == nullptr)
@@ -158,6 +170,7 @@ bool IndexDataManager::isStreamingIndexData(bool primitiveRestartWorkaround,
return true;
}
+ BufferD3D *buffer = GetImplAs<BufferD3D>(glBuffer);
const GLenum dstType = (srcType == GL_UNSIGNED_INT || primitiveRestartWorkaround)
? GL_UNSIGNED_INT
: GL_UNSIGNED_SHORT;
@@ -175,7 +188,7 @@ bool IndexDataManager::isStreamingIndexData(bool primitiveRestartWorkaround,
return true;
}
- if ((staticBuffer->getBufferSize() != 0) && (staticBuffer->getIndexType() != dstType))
+ if ((staticBuffer->getBufferSize() == 0) || (staticBuffer->getIndexType() != dstType))
{
return true;
}
@@ -204,7 +217,7 @@ gl::Error IndexDataManager::prepareIndexData(GLenum srcType,
translated->indexRange.vertexIndexCount < static_cast<size_t>(count) ||
translated->indexRange.end == gl::GetPrimitiveRestartIndex(srcType);
bool primitiveRestartWorkaround =
- usePrimitiveRestartWorkaround(primitiveRestartFixedIndexEnabled, srcType) &&
+ UsePrimitiveRestartWorkaround(primitiveRestartFixedIndexEnabled, srcType, mRendererClass) &&
hasPrimitiveRestartIndex;
// We should never have to deal with MAX_UINT indices, since we restrict it via
@@ -367,41 +380,19 @@ gl::Error IndexDataManager::getStreamingIndexBuffer(GLenum destinationIndexType,
IndexBufferInterface **outBuffer)
{
ASSERT(outBuffer);
- if (destinationIndexType == GL_UNSIGNED_INT)
- {
- if (!mStreamingBufferInt)
- {
- mStreamingBufferInt = new StreamingIndexBufferInterface(mFactory);
- gl::Error error =
- mStreamingBufferInt->reserveBufferSpace(INITIAL_INDEX_BUFFER_SIZE, GL_UNSIGNED_INT);
- if (error.isError())
- {
- SafeDelete(mStreamingBufferInt);
- return error;
- }
- }
-
- *outBuffer = mStreamingBufferInt;
- return gl::NoError();
- }
- else
- {
- ASSERT(destinationIndexType == GL_UNSIGNED_SHORT);
+ ASSERT(destinationIndexType == GL_UNSIGNED_SHORT || destinationIndexType == GL_UNSIGNED_INT);
- if (!mStreamingBufferShort)
- {
- mStreamingBufferShort = new StreamingIndexBufferInterface(mFactory);
- gl::Error error = mStreamingBufferShort->reserveBufferSpace(INITIAL_INDEX_BUFFER_SIZE,
- GL_UNSIGNED_SHORT);
- if (error.isError())
- {
- SafeDelete(mStreamingBufferShort);
- return error;
- }
- }
+ auto &streamingBuffer =
+ (destinationIndexType == GL_UNSIGNED_INT) ? mStreamingBufferInt : mStreamingBufferShort;
- *outBuffer = mStreamingBufferShort;
- return gl::NoError();
+ if (!streamingBuffer)
+ {
+ StreamingBuffer newBuffer(new StreamingIndexBufferInterface(mFactory));
+ ANGLE_TRY(newBuffer->reserveBufferSpace(INITIAL_INDEX_BUFFER_SIZE, destinationIndexType));
+ streamingBuffer = std::move(newBuffer);
}
+
+ *outBuffer = streamingBuffer.get();
+ return gl::NoError();
}
-}
+} // namespace rx
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 84ab219236a..cd969547d12 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/IndexDataManager.h
@@ -68,10 +68,14 @@ 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);
+ void deinitialize();
+
+ static bool UsePrimitiveRestartWorkaround(bool primitiveRestartFixedIndexEnabled,
+ GLenum type,
+ RendererClass rendererClass);
+ static bool IsStreamingIndexData(const gl::Context *context,
+ GLenum srcType,
+ RendererClass rendererClass);
gl::Error prepareIndexData(GLenum srcType,
GLsizei count,
gl::Buffer *glBuffer,
@@ -89,11 +93,13 @@ class IndexDataManager : angle::NonCopyable
gl::Error getStreamingIndexBuffer(GLenum destinationIndexType,
IndexBufferInterface **outBuffer);
+ using StreamingBuffer = std::unique_ptr<StreamingIndexBufferInterface>;
+
BufferFactoryD3D *const mFactory;
RendererClass mRendererClass;
- StreamingIndexBufferInterface *mStreamingBufferShort;
- StreamingIndexBufferInterface *mStreamingBufferInt;
+ std::unique_ptr<StreamingIndexBufferInterface> mStreamingBufferShort;
+ std::unique_ptr<StreamingIndexBufferInterface> mStreamingBufferInt;
};
-}
+} // namespace rx
#endif // LIBANGLE_INDEXDATAMANAGER_H_
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 c8cc0ca21b9..dfe0665f331 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp
@@ -18,6 +18,7 @@
#include "libANGLE/VaryingPacking.h"
#include "libANGLE/VertexArray.h"
#include "libANGLE/features.h"
+#include "libANGLE/queryconversions.h"
#include "libANGLE/renderer/ContextImpl.h"
#include "libANGLE/renderer/d3d/DynamicHLSL.h"
#include "libANGLE/renderer/d3d/FramebufferD3D.h"
@@ -34,10 +35,12 @@ namespace rx
namespace
{
-gl::InputLayout GetDefaultInputLayoutFromShader(const gl::Context *context,
- gl::Shader *vertexShader)
+void GetDefaultInputLayoutFromShader(const gl::Context *context,
+ gl::Shader *vertexShader,
+ gl::InputLayout *inputLayoutOut)
{
- gl::InputLayout defaultLayout;
+ inputLayoutOut->clear();
+
for (const sh::Attribute &shaderAttr : vertexShader->getActiveAttributes(context))
{
if (shaderAttr.type != GL_NONE)
@@ -53,26 +56,48 @@ gl::InputLayout GetDefaultInputLayoutFromShader(const gl::Context *context,
gl::VertexFormatType defaultType =
gl::GetVertexFormatType(componentType, GL_FALSE, components, pureInt);
- defaultLayout.push_back(defaultType);
+ inputLayoutOut->push_back(defaultType);
}
}
}
-
- return defaultLayout;
}
-std::vector<GLenum> GetDefaultOutputLayoutFromShader(
- const std::vector<PixelShaderOutputVariable> &shaderOutputVars)
+void GetDefaultOutputLayoutFromShader(
+ const std::vector<PixelShaderOutputVariable> &shaderOutputVars,
+ std::vector<GLenum> *outputLayoutOut)
{
- std::vector<GLenum> defaultPixelOutput;
+ outputLayoutOut->clear();
if (!shaderOutputVars.empty())
{
- defaultPixelOutput.push_back(GL_COLOR_ATTACHMENT0 +
- static_cast<unsigned int>(shaderOutputVars[0].outputIndex));
+ outputLayoutOut->push_back(GL_COLOR_ATTACHMENT0 +
+ static_cast<unsigned int>(shaderOutputVars[0].outputIndex));
}
+}
+
+void GetPixelOutputLayoutFromFramebuffer(const gl::Context *context,
+ const gl::Framebuffer *framebuffer,
+ std::vector<GLenum> *signature)
+{
+ signature->clear();
+
+ FramebufferD3D *fboD3D = GetImplAs<FramebufferD3D>(framebuffer);
+ const auto &colorbuffers = fboD3D->getColorAttachmentsForRender(context);
+
+ for (size_t colorAttachment = 0; colorAttachment < colorbuffers.size(); ++colorAttachment)
+ {
+ const gl::FramebufferAttachment *colorbuffer = colorbuffers[colorAttachment];
- return defaultPixelOutput;
+ if (colorbuffer)
+ {
+ signature->push_back(colorbuffer->getBinding() == GL_BACK ? GL_COLOR_ATTACHMENT0
+ : colorbuffer->getBinding());
+ }
+ else
+ {
+ signature->push_back(GL_NONE);
+ }
+ }
}
bool IsRowMajorLayout(const sh::InterfaceBlockField &var)
@@ -319,6 +344,8 @@ ProgramD3DMetadata::ProgramD3DMetadata(RendererD3D *renderer,
mUsesInstancedPointSpriteEmulation(
renderer->getWorkarounds().useInstancedPointSpriteEmulation),
mUsesViewScale(renderer->presentPathFastEnabled()),
+ mHasANGLEMultiviewEnabled(vertexShader->hasANGLEMultiviewEnabled()),
+ mUsesViewID(fragmentShader->usesViewID()),
mVertexShader(vertexShader),
mFragmentShader(fragmentShader)
{
@@ -366,6 +393,16 @@ bool ProgramD3DMetadata::usesViewScale() const
return mUsesViewScale;
}
+bool ProgramD3DMetadata::hasANGLEMultiviewEnabled() const
+{
+ return mHasANGLEMultiviewEnabled;
+}
+
+bool ProgramD3DMetadata::usesViewID() const
+{
+ return mUsesViewID;
+}
+
bool ProgramD3DMetadata::addsPointCoordToVertexShader() const
{
// PointSprite emulation requiress that gl_PointCoord is present in the vertex shader
@@ -525,14 +562,22 @@ bool ProgramD3D::usesPointSpriteEmulation() const
return mUsesPointSize && mRenderer->getMajorShaderModel() >= 4;
}
+bool ProgramD3D::usesGeometryShaderForPointSpriteEmulation() const
+{
+ return usesPointSpriteEmulation() && !usesInstancedPointSpriteEmulation();
+}
+
bool ProgramD3D::usesGeometryShader(GLenum drawMode) const
{
+ if (mHasANGLEMultiviewEnabled)
+ {
+ return true;
+ }
if (drawMode != GL_POINTS)
{
return mUsesFlatInterpolation;
}
-
- return usesPointSpriteEmulation() && !usesInstancedPointSpriteEmulation();
+ return usesGeometryShaderForPointSpriteEmulation();
}
bool ProgramD3D::usesInstancedPointSpriteEmulation() const
@@ -819,6 +864,8 @@ gl::LinkResult ProgramD3D::load(const gl::Context *context,
stream->readBytes(reinterpret_cast<unsigned char *>(&mPixelWorkarounds),
sizeof(angle::CompilerWorkaroundsD3D));
stream->readBool(&mUsesFragDepth);
+ stream->readBool(&mHasANGLEMultiviewEnabled);
+ stream->readBool(&mUsesViewID);
stream->readBool(&mUsesPointSize);
stream->readBool(&mUsesFlatInterpolation);
@@ -1042,6 +1089,8 @@ void ProgramD3D::save(const gl::Context *context, gl::BinaryOutputStream *stream
stream->writeBytes(reinterpret_cast<unsigned char *>(&mPixelWorkarounds),
sizeof(angle::CompilerWorkaroundsD3D));
stream->writeInt(mUsesFragDepth);
+ stream->writeInt(mHasANGLEMultiviewEnabled);
+ stream->writeInt(mUsesViewID);
stream->writeInt(mUsesPointSize);
stream->writeInt(mUsesFlatInterpolation);
@@ -1133,49 +1182,20 @@ void ProgramD3D::setSeparable(bool /* separable */)
{
}
-gl::Error ProgramD3D::getPixelExecutableForFramebuffer(const gl::Context *context,
- const gl::Framebuffer *fbo,
- ShaderExecutableD3D **outExecutable)
-{
- mPixelShaderOutputFormatCache.clear();
-
- FramebufferD3D *fboD3D = GetImplAs<FramebufferD3D>(fbo);
- const gl::AttachmentList &colorbuffers = fboD3D->getColorAttachmentsForRender(context);
-
- for (size_t colorAttachment = 0; colorAttachment < colorbuffers.size(); ++colorAttachment)
- {
- const gl::FramebufferAttachment *colorbuffer = colorbuffers[colorAttachment];
-
- if (colorbuffer)
- {
- mPixelShaderOutputFormatCache.push_back(colorbuffer->getBinding() == GL_BACK
- ? GL_COLOR_ATTACHMENT0
- : colorbuffer->getBinding());
- }
- else
- {
- mPixelShaderOutputFormatCache.push_back(GL_NONE);
- }
- }
-
- return getPixelExecutableForOutputLayout(mPixelShaderOutputFormatCache, outExecutable, nullptr);
-}
-
-gl::Error ProgramD3D::getPixelExecutableForOutputLayout(const std::vector<GLenum> &outputSignature,
- ShaderExecutableD3D **outExectuable,
- gl::InfoLog *infoLog)
+gl::Error ProgramD3D::getPixelExecutableForCachedOutputLayout(ShaderExecutableD3D **outExecutable,
+ gl::InfoLog *infoLog)
{
for (size_t executableIndex = 0; executableIndex < mPixelExecutables.size(); executableIndex++)
{
- if (mPixelExecutables[executableIndex]->matchesSignature(outputSignature))
+ if (mPixelExecutables[executableIndex]->matchesSignature(mPixelShaderOutputLayoutCache))
{
- *outExectuable = mPixelExecutables[executableIndex]->shaderExecutable();
+ *outExecutable = mPixelExecutables[executableIndex]->shaderExecutable();
return gl::NoError();
}
}
std::string finalPixelHLSL = mDynamicHLSL->generatePixelShaderForOutputSignature(
- mPixelHLSL, mPixelShaderKey, mUsesFragDepth, outputSignature);
+ mPixelHLSL, mPixelShaderKey, mUsesFragDepth, mPixelShaderOutputLayoutCache);
// Generate new pixel executable
ShaderExecutableD3D *pixelExecutable = nullptr;
@@ -1191,7 +1211,7 @@ gl::Error ProgramD3D::getPixelExecutableForOutputLayout(const std::vector<GLenum
if (pixelExecutable)
{
mPixelExecutables.push_back(std::unique_ptr<PixelExecutable>(
- new PixelExecutable(outputSignature, pixelExecutable)));
+ new PixelExecutable(mPixelShaderOutputLayoutCache, pixelExecutable)));
}
else if (!infoLog)
{
@@ -1199,16 +1219,13 @@ gl::Error ProgramD3D::getPixelExecutableForOutputLayout(const std::vector<GLenum
<< tempInfoLog.str() << std::endl;
}
- *outExectuable = pixelExecutable;
+ *outExecutable = pixelExecutable;
return gl::NoError();
}
-gl::Error ProgramD3D::getVertexExecutableForInputLayout(const gl::InputLayout &inputLayout,
- ShaderExecutableD3D **outExectuable,
- gl::InfoLog *infoLog)
+gl::Error ProgramD3D::getVertexExecutableForCachedInputLayout(ShaderExecutableD3D **outExectuable,
+ gl::InfoLog *infoLog)
{
- VertexExecutable::getSignature(mRenderer, inputLayout, &mCachedVertexSignature);
-
for (size_t executableIndex = 0; executableIndex < mVertexExecutables.size(); executableIndex++)
{
if (mVertexExecutables[executableIndex]->matchesSignature(mCachedVertexSignature))
@@ -1220,7 +1237,7 @@ gl::Error ProgramD3D::getVertexExecutableForInputLayout(const gl::InputLayout &i
// Generate new dynamic layout with attribute conversions
std::string finalVertexHLSL = mDynamicHLSL->generateVertexShaderForInputLayout(
- mVertexHLSL, inputLayout, mState.getAttributes());
+ mVertexHLSL, mCachedInputLayout, mState.getAttributes());
// Generate new vertex executable
ShaderExecutableD3D *vertexExecutable = nullptr;
@@ -1236,7 +1253,7 @@ gl::Error ProgramD3D::getVertexExecutableForInputLayout(const gl::InputLayout &i
if (vertexExecutable)
{
mVertexExecutables.push_back(std::unique_ptr<VertexExecutable>(
- new VertexExecutable(inputLayout, mCachedVertexSignature, vertexExecutable)));
+ new VertexExecutable(mCachedInputLayout, mCachedVertexSignature, vertexExecutable)));
}
else if (!infoLog)
{
@@ -1277,6 +1294,7 @@ gl::Error ProgramD3D::getGeometryExecutableForPrimitiveType(const gl::ContextSta
std::string geometryHLSL = mDynamicHLSL->generateGeometryShaderHLSL(
geometryShaderType, data, mState, mRenderer->presentPathFastEnabled(),
+ mHasANGLEMultiviewEnabled, usesGeometryShaderForPointSpriteEmulation(),
mGeometryShaderPreamble);
gl::InfoLog tempInfoLog;
@@ -1338,11 +1356,9 @@ class ProgramD3D::GetVertexExecutableTask : public ProgramD3D::GetExecutableTask
}
gl::Error run() override
{
- const auto &defaultInputLayout =
- GetDefaultInputLayoutFromShader(mContext, mProgram->mState.getAttachedVertexShader());
+ mProgram->updateCachedInputLayoutFromShader(mContext);
- ANGLE_TRY(
- mProgram->getVertexExecutableForInputLayout(defaultInputLayout, &mResult, &mInfoLog));
+ ANGLE_TRY(mProgram->getVertexExecutableForCachedInputLayout(&mResult, &mInfoLog));
return gl::NoError();
}
@@ -1351,22 +1367,31 @@ class ProgramD3D::GetVertexExecutableTask : public ProgramD3D::GetExecutableTask
const gl::Context *mContext;
};
+void ProgramD3D::updateCachedInputLayoutFromShader(const gl::Context *context)
+{
+ GetDefaultInputLayoutFromShader(context, mState.getAttachedVertexShader(), &mCachedInputLayout);
+ VertexExecutable::getSignature(mRenderer, mCachedInputLayout, &mCachedVertexSignature);
+}
+
class ProgramD3D::GetPixelExecutableTask : public ProgramD3D::GetExecutableTask
{
public:
GetPixelExecutableTask(ProgramD3D *program) : GetExecutableTask(program) {}
gl::Error run() override
{
- const auto &defaultPixelOutput =
- GetDefaultOutputLayoutFromShader(mProgram->getPixelShaderKey());
+ mProgram->updateCachedOutputLayoutFromShader();
- ANGLE_TRY(
- mProgram->getPixelExecutableForOutputLayout(defaultPixelOutput, &mResult, &mInfoLog));
+ ANGLE_TRY(mProgram->getPixelExecutableForCachedOutputLayout(&mResult, &mInfoLog));
return gl::NoError();
}
};
+void ProgramD3D::updateCachedOutputLayoutFromShader()
+{
+ GetDefaultOutputLayoutFromShader(mPixelShaderKey, &mPixelShaderOutputLayoutCache);
+}
+
class ProgramD3D::GetGeometryExecutableTask : public ProgramD3D::GetExecutableTask
{
public:
@@ -1559,6 +1584,8 @@ gl::LinkResult ProgramD3D::link(const gl::Context *context,
mUsesPointSize = vertexShaderD3D->usesPointSize();
mDynamicHLSL->getPixelShaderOutputKey(data, mState, metadata, &mPixelShaderKey);
mUsesFragDepth = metadata.usesFragDepth();
+ mUsesViewID = metadata.usesViewID();
+ mHasANGLEMultiviewEnabled = metadata.hasANGLEMultiviewEnabled();
// Cache if we use flat shading
mUsesFlatInterpolation =
@@ -1567,8 +1594,8 @@ gl::LinkResult ProgramD3D::link(const gl::Context *context,
if (mRenderer->getMajorShaderModel() >= 4)
{
- mGeometryShaderPreamble =
- mDynamicHLSL->generateGeometryShaderPreamble(packing, builtins);
+ mGeometryShaderPreamble = mDynamicHLSL->generateGeometryShaderPreamble(
+ packing, builtins, mHasANGLEMultiviewEnabled);
}
initAttribLocationsToD3DSemantic(context);
@@ -1604,7 +1631,7 @@ GLboolean ProgramD3D::validate(const gl::Caps & /*caps*/, gl::InfoLog * /*infoLo
void ProgramD3D::initUniformBlockInfo(const gl::Context *context, gl::Shader *shader)
{
- for (const sh::InterfaceBlock &interfaceBlock : shader->getInterfaceBlocks(context))
+ for (const sh::InterfaceBlock &interfaceBlock : shader->getUniformBlocks(context))
{
if (!interfaceBlock.staticUse && interfaceBlock.layout == sh::BLOCKLAYOUT_PACKED)
continue;
@@ -1640,8 +1667,7 @@ void ProgramD3D::ensureUniformBlocksInitialized()
if (uniformBlock.vertexStaticUse)
{
ASSERT(vertexShaderD3D != nullptr);
- unsigned int baseRegister =
- vertexShaderD3D->getInterfaceBlockRegister(uniformBlock.name);
+ unsigned int baseRegister = vertexShaderD3D->getUniformBlockRegister(uniformBlock.name);
d3dUniformBlock.vsRegisterIndex = baseRegister + uniformBlockElement;
}
@@ -1649,7 +1675,7 @@ void ProgramD3D::ensureUniformBlocksInitialized()
{
ASSERT(fragmentShaderD3D != nullptr);
unsigned int baseRegister =
- fragmentShaderD3D->getInterfaceBlockRegister(uniformBlock.name);
+ fragmentShaderD3D->getUniformBlockRegister(uniformBlock.name);
d3dUniformBlock.psRegisterIndex = baseRegister + uniformBlockElement;
}
@@ -1657,7 +1683,7 @@ void ProgramD3D::ensureUniformBlocksInitialized()
{
ASSERT(computeShaderD3D != nullptr);
unsigned int baseRegister =
- computeShaderD3D->getInterfaceBlockRegister(uniformBlock.name);
+ computeShaderD3D->getUniformBlockRegister(uniformBlock.name);
d3dUniformBlock.csRegisterIndex = baseRegister + uniformBlockElement;
}
@@ -2332,6 +2358,8 @@ void ProgramD3D::reset()
mPixelHLSL.clear();
mPixelWorkarounds = angle::CompilerWorkaroundsD3D();
mUsesFragDepth = false;
+ mHasANGLEMultiviewEnabled = false;
+ mUsesViewID = false;
mPixelShaderKey.clear();
mUsesPointSize = false;
mUsesFlatInterpolation = false;
@@ -2389,8 +2417,14 @@ void ProgramD3D::initAttribLocationsToD3DSemantic(const gl::Context *context)
}
}
-void ProgramD3D::updateCachedInputLayout(const gl::State &state)
+void ProgramD3D::updateCachedInputLayout(Serial associatedSerial, const gl::State &state)
{
+ if (mCurrentVertexArrayStateSerial == associatedSerial)
+ {
+ return;
+ }
+
+ mCurrentVertexArrayStateSerial = associatedSerial;
mCachedInputLayout.clear();
const auto &vertexAttributes = state.getVertexArray()->getVertexAttributes();
@@ -2409,6 +2443,14 @@ void ProgramD3D::updateCachedInputLayout(const gl::State &state)
state.getVertexAttribCurrentValue(locationIndex).Type);
}
}
+
+ VertexExecutable::getSignature(mRenderer, mCachedInputLayout, &mCachedVertexSignature);
+}
+
+void ProgramD3D::updateCachedOutputLayout(const gl::Context *context,
+ const gl::Framebuffer *framebuffer)
+{
+ GetPixelOutputLayoutFromFramebuffer(context, framebuffer, &mPixelShaderOutputLayoutCache);
}
void ProgramD3D::gatherTransformFeedbackVaryings(const gl::VaryingPacking &varyingPacking,
@@ -2521,4 +2563,69 @@ void ProgramD3D::setPathFragmentInputGen(const std::string &inputName,
UNREACHABLE();
}
+bool ProgramD3D::hasVertexExecutableForCachedInputLayout()
+{
+ VertexExecutable::getSignature(mRenderer, mCachedInputLayout, &mCachedVertexSignature);
+
+ for (size_t executableIndex = 0; executableIndex < mVertexExecutables.size(); executableIndex++)
+ {
+ if (mVertexExecutables[executableIndex]->matchesSignature(mCachedVertexSignature))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+bool ProgramD3D::hasGeometryExecutableForPrimitiveType(GLenum drawMode)
+{
+ if (!usesGeometryShader(drawMode))
+ {
+ // No shader necessary mean we have the required (null) executable.
+ return true;
+ }
+
+ gl::PrimitiveType geometryShaderType = GetGeometryShaderTypeFromDrawMode(drawMode);
+ return mGeometryExecutables[geometryShaderType].get() != nullptr;
+}
+
+bool ProgramD3D::hasPixelExecutableForCachedOutputLayout()
+{
+ for (size_t executableIndex = 0; executableIndex < mPixelExecutables.size(); executableIndex++)
+ {
+ if (mPixelExecutables[executableIndex]->matchesSignature(mPixelShaderOutputLayoutCache))
+ {
+ return true;
+ }
+ }
+
+ return false;
+}
+
+template <typename DestT>
+void ProgramD3D::getUniformInternal(GLint location, DestT *dataOut) const
+{
+ const gl::VariableLocation &locationInfo = mState.getUniformLocations()[location];
+ const gl::LinkedUniform &uniform = mState.getUniforms()[locationInfo.index];
+
+ const uint8_t *srcPointer = uniform.getDataPtrToElement(locationInfo.element);
+ memcpy(dataOut, srcPointer, uniform.getElementSize());
+}
+
+void ProgramD3D::getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const
+{
+ getUniformInternal(location, params);
+}
+
+void ProgramD3D::getUniformiv(const gl::Context *context, GLint location, GLint *params) const
+{
+ getUniformInternal(location, params);
+}
+
+void ProgramD3D::getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const
+{
+ getUniformInternal(location, params);
+}
+
} // namespace rx
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 7f0a48bf8cb..eb24bbc8901 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ProgramD3D.h
@@ -122,6 +122,8 @@ class ProgramD3DMetadata final : angle::NonCopyable
bool usesPointSize() const;
bool usesInsertedPointCoordValue() const;
bool usesViewScale() const;
+ bool hasANGLEMultiviewEnabled() const;
+ bool usesViewID() const;
bool addsPointCoordToVertexShader() const;
bool usesTransformFeedbackGLPosition() const;
bool usesSystemValuePointSize() const;
@@ -134,6 +136,8 @@ class ProgramD3DMetadata final : angle::NonCopyable
const std::string mShaderModelSuffix;
const bool mUsesInstancedPointSpriteEmulation;
const bool mUsesViewScale;
+ const bool mHasANGLEMultiviewEnabled;
+ const bool mUsesViewID;
const ShaderD3D *mVertexShader;
const ShaderD3D *mFragmentShader;
};
@@ -156,6 +160,7 @@ class ProgramD3D : public ProgramImpl
bool usesPointSize() const { return mUsesPointSize; }
bool usesPointSpriteEmulation() const;
bool usesGeometryShader(GLenum drawMode) const;
+ bool usesGeometryShaderForPointSpriteEmulation() const;
bool usesInstancedPointSpriteEmulation() const;
gl::LinkResult load(const gl::Context *context,
@@ -165,19 +170,14 @@ class ProgramD3D : public ProgramImpl
void setBinaryRetrievableHint(bool retrievable) override;
void setSeparable(bool separable) override;
- gl::Error getPixelExecutableForFramebuffer(const gl::Context *context,
- const gl::Framebuffer *fbo,
- ShaderExecutableD3D **outExectuable);
- gl::Error getPixelExecutableForOutputLayout(const std::vector<GLenum> &outputLayout,
- ShaderExecutableD3D **outExectuable,
- gl::InfoLog *infoLog);
- gl::Error getVertexExecutableForInputLayout(const gl::InputLayout &inputLayout,
- ShaderExecutableD3D **outExectuable,
- gl::InfoLog *infoLog);
+ gl::Error getVertexExecutableForCachedInputLayout(ShaderExecutableD3D **outExectuable,
+ gl::InfoLog *infoLog);
gl::Error getGeometryExecutableForPrimitiveType(const gl::ContextState &data,
GLenum drawMode,
ShaderExecutableD3D **outExecutable,
gl::InfoLog *infoLog);
+ gl::Error getPixelExecutableForCachedOutputLayout(ShaderExecutableD3D **outExectuable,
+ gl::InfoLog *infoLog);
gl::Error getComputeExecutable(ShaderExecutableD3D **outExecutable);
gl::LinkResult link(const gl::Context *context,
const gl::VaryingPacking &packing,
@@ -247,6 +247,10 @@ class ProgramD3D : public ProgramImpl
GLboolean transpose,
const GLfloat *value);
+ void getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const override;
+ void getUniformiv(const gl::Context *context, GLint location, GLint *params) const override;
+ void getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const override;
+
void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override;
UniformStorageD3D &getVertexUniformStorage() const { return *mVertexUniformStorage.get(); }
@@ -260,11 +264,16 @@ class ProgramD3D : public ProgramImpl
return mAttribLocationToD3DSemantic;
}
- void updateCachedInputLayout(const gl::State &state);
- const gl::InputLayout &getCachedInputLayout() const { return mCachedInputLayout; }
+ void updateCachedInputLayout(Serial associatedSerial, const gl::State &state);
+ void updateCachedOutputLayout(const gl::Context *context, const gl::Framebuffer *framebuffer);
bool isSamplerMappingDirty() { return mDirtySamplerMapping; }
+ // Checks if we need to recompile certain shaders.
+ bool hasVertexExecutableForCachedInputLayout();
+ bool hasGeometryExecutableForPrimitiveType(GLenum drawMode);
+ bool hasPixelExecutableForCachedOutputLayout();
+
private:
// These forward-declared tasks are used for multi-thread shader compiles.
class GetExecutableTask;
@@ -355,6 +364,9 @@ class ProgramD3D : public ProgramImpl
std::vector<Sampler> &outSamplers,
GLuint *outUsedRange);
+ template <typename DestT>
+ void getUniformInternal(GLint location, DestT *dataOut) const;
+
template <typename T>
void setUniform(GLint location, GLsizei count, const T *v, GLenum targetUniformType);
@@ -381,6 +393,9 @@ class ProgramD3D : public ProgramImpl
void initUniformBlockInfo(const gl::Context *context, gl::Shader *shader);
size_t getUniformBlockInfo(const sh::InterfaceBlock &interfaceBlock);
+ void updateCachedInputLayoutFromShader(const gl::Context *context);
+ void updateCachedOutputLayoutFromShader();
+
RendererD3D *mRenderer;
DynamicHLSL *mDynamicHLSL;
@@ -395,6 +410,8 @@ class ProgramD3D : public ProgramImpl
std::string mPixelHLSL;
angle::CompilerWorkaroundsD3D mPixelWorkarounds;
bool mUsesFragDepth;
+ bool mHasANGLEMultiviewEnabled;
+ bool mUsesViewID;
std::vector<PixelShaderOutputVariable> mPixelShaderKey;
// Common code for all dynamic geometry shaders. Consists mainly of the GS input and output
@@ -417,8 +434,8 @@ class ProgramD3D : public ProgramImpl
GLuint mUsedComputeSamplerRange;
bool mDirtySamplerMapping;
- // Cache for getPixelExecutableForFramebuffer
- std::vector<GLenum> mPixelShaderOutputFormatCache;
+ // Cache for pixel shader output layout to save reallocations.
+ std::vector<GLenum> mPixelShaderOutputLayoutCache;
AttribIndexArray mAttribLocationToD3DSemantic;
@@ -438,7 +455,9 @@ class ProgramD3D : public ProgramImpl
static unsigned int issueSerial();
static unsigned int mCurrentSerial;
+
+ Serial mCurrentVertexArrayStateSerial;
};
-}
+} // namespace rx
#endif // LIBANGLE_RENDERER_D3D_PROGRAMD3D_H_
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.h
index c96da5ce14e..0a89333acec 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.h
@@ -29,6 +29,7 @@ class RenderTargetD3D : public FramebufferAttachmentRenderTarget
virtual GLenum getInternalFormat() const = 0;
virtual GLsizei getSamples() const = 0;
gl::Extents getExtents() const { return gl::Extents(getWidth(), getHeight(), getDepth()); }
+ bool isMultisampled() const { return getSamples() > 0; }
virtual unsigned int getSerial() const;
static unsigned int issueSerials(unsigned int count);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.cpp
index 9f624b63af3..08fb172a398 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.cpp
@@ -59,88 +59,6 @@ void RendererD3D::cleanup()
mIncompleteTextures.clear();
}
-// For each Direct3D sampler of either the pixel or vertex stage,
-// looks up the corresponding OpenGL texture image unit and texture type,
-// and sets the texture and its addressing/filtering state (or NULL when inactive).
-// Sampler mapping needs to be up-to-date on the program object before this is called.
-gl::Error RendererD3D::applyTextures(const gl::Context *context,
- gl::SamplerType shaderType,
- const FramebufferTextureArray &framebufferTextures,
- size_t framebufferTextureCount)
-{
- const auto &glState = context->getGLState();
- const auto &caps = context->getCaps();
- ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
-
- ASSERT(!programD3D->isSamplerMappingDirty());
-
- // TODO(jmadill): Use the Program's sampler bindings.
-
- unsigned int samplerRange = programD3D->getUsedSamplerRange(shaderType);
- for (unsigned int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++)
- {
- GLenum textureType = programD3D->getSamplerTextureType(shaderType, samplerIndex);
- GLint textureUnit = programD3D->getSamplerMapping(shaderType, samplerIndex, caps);
- if (textureUnit != -1)
- {
- gl::Texture *texture = glState.getSamplerTexture(textureUnit, textureType);
- ASSERT(texture);
-
- gl::Sampler *samplerObject = glState.getSampler(textureUnit);
-
- const gl::SamplerState &samplerState =
- samplerObject ? samplerObject->getSamplerState() : texture->getSamplerState();
-
- // TODO: std::binary_search may become unavailable using older versions of GCC
- if (texture->getTextureState().isSamplerComplete(samplerState,
- context->getContextState()) &&
- !std::binary_search(framebufferTextures.begin(),
- framebufferTextures.begin() + framebufferTextureCount, texture))
- {
- ANGLE_TRY(
- setSamplerState(context, shaderType, samplerIndex, texture, samplerState));
- ANGLE_TRY(setTexture(context, shaderType, samplerIndex, texture));
- }
- else
- {
- // Texture is not sampler complete or it is in use by the framebuffer. Bind the
- // incomplete texture.
- gl::Texture *incompleteTexture = getIncompleteTexture(context, textureType);
-
- ANGLE_TRY(setSamplerState(context, shaderType, samplerIndex, incompleteTexture,
- incompleteTexture->getSamplerState()));
- ANGLE_TRY(setTexture(context, shaderType, samplerIndex, incompleteTexture));
- }
- }
- else
- {
- // No texture bound to this slot even though it is used by the shader, bind a NULL
- // texture
- ANGLE_TRY(setTexture(context, shaderType, samplerIndex, nullptr));
- }
- }
-
- // Set all the remaining textures to NULL
- size_t samplerCount = (shaderType == gl::SAMPLER_PIXEL) ? caps.maxTextureImageUnits
- : caps.maxVertexTextureImageUnits;
- clearTextures(context, shaderType, samplerRange, samplerCount);
-
- return gl::NoError();
-}
-
-gl::Error RendererD3D::applyTextures(const gl::Context *context)
-{
- FramebufferTextureArray framebufferTextures;
- size_t framebufferSerialCount =
- getBoundFramebufferTextures(context->getContextState(), &framebufferTextures);
-
- ANGLE_TRY(
- applyTextures(context, gl::SAMPLER_VERTEX, framebufferTextures, framebufferSerialCount));
- ANGLE_TRY(
- applyTextures(context, gl::SAMPLER_PIXEL, framebufferTextures, framebufferSerialCount));
- return gl::NoError();
-}
-
bool RendererD3D::skipDraw(const gl::ContextState &data, GLenum drawMode)
{
const gl::State &state = data.getState();
@@ -252,7 +170,7 @@ gl::Texture *RendererD3D::getIncompleteTexture(const gl::Context *context, GLenu
{
gl::ColorF clearValue(0, 0, 0, 1);
gl::ImageIndex index = gl::ImageIndex::Make2DMultisample();
- GetImplAs<TextureD3D>(t)->clearLevel(context, index, clearValue);
+ GetImplAs<TextureD3D>(t)->clearLevel(context, index, clearValue, 1.0f, 0);
}
else
{
@@ -370,9 +288,19 @@ bool RendererD3D::isRobustResourceInitEnabled() const
return mDisplay->isRobustResourceInitEnabled();
}
-unsigned int GetBlendSampleMask(const gl::ContextState &data, int samples)
+Serial RendererD3D::generateSerial()
+{
+ return mSerialFactory.generate();
+}
+
+bool InstancedPointSpritesActive(ProgramD3D *programD3D, GLenum mode)
+{
+ return programD3D->usesPointSize() && programD3D->usesInstancedPointSpriteEmulation() &&
+ mode == GL_POINTS;
+}
+
+unsigned int GetBlendSampleMask(const gl::State &glState, int samples)
{
- const auto &glState = data.getState();
unsigned int mask = 0;
if (glState.isSampleCoverageEnabled())
{
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 a4edbdc36a1..aae5d3ea8d3 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/RendererD3D.h
@@ -21,6 +21,7 @@
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/VertexDataManager.h"
#include "libANGLE/renderer/d3d/formatutilsD3D.h"
+#include "libANGLE/renderer/renderer_utils.h"
#include "platform/WorkaroundsD3D.h"
namespace egl
@@ -104,6 +105,8 @@ class BufferFactoryD3D : angle::NonCopyable
};
using AttribIndexArray = std::array<int, gl::MAX_VERTEX_ATTRIBS>;
+using FramebufferTextureArray =
+ std::array<gl::Texture *, gl::IMPLEMENTATION_MAX_FRAMEBUFFER_ATTACHMENTS>;
class RendererD3D : public BufferFactoryD3D
{
@@ -147,16 +150,6 @@ class RendererD3D : public BufferFactoryD3D
HANDLE shareHandle,
const egl::AttributeMap &attribs) const = 0;
- virtual gl::Error setSamplerState(const gl::Context *context,
- gl::SamplerType type,
- int index,
- gl::Texture *texture,
- const gl::SamplerState &sampler) = 0;
- virtual gl::Error setTexture(const gl::Context *context,
- gl::SamplerType type,
- int index,
- gl::Texture *texture) = 0;
-
virtual gl::Error setUniformBuffers(const gl::ContextState &data,
const std::vector<GLint> &vertexUniformBuffers,
const std::vector<GLint> &fragmentUniformBuffers) = 0;
@@ -301,14 +294,10 @@ class RendererD3D : public BufferFactoryD3D
GLint getGPUDisjoint();
GLint64 getTimestamp();
- // In D3D11, faster than calling setTexture a jillion times
- virtual gl::Error clearTextures(const gl::Context *context,
- gl::SamplerType samplerType,
- size_t rangeStart,
- size_t rangeEnd) = 0;
-
virtual gl::Error clearRenderTarget(RenderTargetD3D *renderTarget,
- const gl::ColorF &clearValues) = 0;
+ const gl::ColorF &clearColorValue,
+ const float clearDepthValue,
+ const unsigned int clearStencilValue) = 0;
virtual egl::Error getEGLDevice(DeviceImpl **device) = 0;
@@ -336,6 +325,13 @@ class RendererD3D : public BufferFactoryD3D
bool isRobustResourceInitEnabled() const;
+ size_t getBoundFramebufferTextures(const gl::ContextState &data,
+ FramebufferTextureArray *outTextureArray);
+
+ gl::Texture *getIncompleteTexture(const gl::Context *context, GLenum type);
+
+ Serial generateSerial();
+
protected:
virtual bool getLUID(LUID *adapterLuid) const = 0;
virtual void generateCaps(gl::Caps *outCaps,
@@ -347,7 +343,6 @@ class RendererD3D : public BufferFactoryD3D
// dirtyPointer is a special value that will make the comparison with any valid pointer fail and force the renderer to re-apply the state.
- gl::Error applyTextures(const gl::Context *context);
bool skipDraw(const gl::ContextState &data, GLenum drawMode);
gl::Error markTransformFeedbackUsage(const gl::ContextState &data);
@@ -358,17 +353,6 @@ class RendererD3D : public BufferFactoryD3D
private:
void ensureCapsInitialized() const;
- typedef std::array<gl::Texture*, gl::IMPLEMENTATION_MAX_FRAMEBUFFER_ATTACHMENTS> FramebufferTextureArray;
-
- gl::Error applyTextures(const gl::Context *context,
- gl::SamplerType shaderType,
- const FramebufferTextureArray &framebufferTextures,
- size_t framebufferTextureCount);
-
- size_t getBoundFramebufferTextures(const gl::ContextState &data,
- FramebufferTextureArray *outTextureArray);
- gl::Texture *getIncompleteTexture(const gl::Context *context, GLenum type);
-
virtual angle::WorkaroundsD3D generateWorkarounds() const = 0;
mutable bool mCapsInitialized;
@@ -386,9 +370,12 @@ class RendererD3D : public BufferFactoryD3D
bool mDeviceLost;
angle::WorkerThreadPool mWorkerThreadPool;
+
+ SerialFactory mSerialFactory;
};
-unsigned int GetBlendSampleMask(const gl::ContextState &data, int samples);
+unsigned int GetBlendSampleMask(const gl::State &glState, int samples);
+bool InstancedPointSpritesActive(ProgramD3D *programD3D, GLenum mode);
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp
index 4978b92710c..43d8f3df845 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp
@@ -9,11 +9,12 @@
#include "libANGLE/renderer/d3d/ShaderD3D.h"
#include "common/utilities.h"
+#include "libANGLE/Caps.h"
#include "libANGLE/Compiler.h"
#include "libANGLE/Shader.h"
#include "libANGLE/features.h"
-#include "libANGLE/renderer/d3d/RendererD3D.h"
#include "libANGLE/renderer/d3d/ProgramD3D.h"
+#include "libANGLE/renderer/d3d/RendererD3D.h"
// Definitions local to the translation unit
namespace
@@ -43,7 +44,9 @@ const char *GetShaderTypeString(GLenum type)
namespace rx
{
-ShaderD3D::ShaderD3D(const gl::ShaderState &data, const angle::WorkaroundsD3D &workarounds)
+ShaderD3D::ShaderD3D(const gl::ShaderState &data,
+ const angle::WorkaroundsD3D &workarounds,
+ const gl::Extensions &extensions)
: ShaderImpl(data), mAdditionalOptions(0)
{
uncompile();
@@ -70,6 +73,10 @@ ShaderD3D::ShaderD3D(const gl::ShaderState &data, const angle::WorkaroundsD3D &w
{
mAdditionalOptions |= SH_EMULATE_ISNAN_FLOAT_FUNCTION;
}
+ if (extensions.multiview)
+ {
+ mAdditionalOptions |= SH_INITIALIZE_BUILTINS_FOR_INSTANCED_MULTIVIEW;
+ }
}
ShaderD3D::~ShaderD3D()
@@ -102,6 +109,8 @@ void ShaderD3D::uncompile()
mUsesPointCoord = false;
mUsesDepthRange = false;
mUsesFragDepth = false;
+ mHasANGLEMultiviewEnabled = false;
+ mUsesViewID = false;
mUsesDiscardRewriting = false;
mUsesNestedBreak = false;
mRequiresIEEEStrictCompiling = false;
@@ -138,10 +147,10 @@ unsigned int ShaderD3D::getUniformRegister(const std::string &uniformName) const
return mUniformRegisterMap.find(uniformName)->second;
}
-unsigned int ShaderD3D::getInterfaceBlockRegister(const std::string &blockName) const
+unsigned int ShaderD3D::getUniformBlockRegister(const std::string &blockName) const
{
- ASSERT(mInterfaceBlockRegisterMap.count(blockName) > 0);
- return mInterfaceBlockRegisterMap.find(blockName)->second;
+ ASSERT(mUniformBlockRegisterMap.count(blockName) > 0);
+ return mUniformBlockRegisterMap.find(blockName)->second;
}
ShShaderOutput ShaderD3D::getCompilerOutputType() const
@@ -201,6 +210,9 @@ bool ShaderD3D::postTranslateCompile(gl::Compiler *compiler, std::string *infoLo
mUsesPointCoord = translatedSource.find("GL_USES_POINT_COORD") != std::string::npos;
mUsesDepthRange = translatedSource.find("GL_USES_DEPTH_RANGE") != std::string::npos;
mUsesFragDepth = translatedSource.find("GL_USES_FRAG_DEPTH") != std::string::npos;
+ mHasANGLEMultiviewEnabled =
+ translatedSource.find("GL_ANGLE_MULTIVIEW_ENABLED") != std::string::npos;
+ mUsesViewID = translatedSource.find("GL_USES_VIEW_ID") != std::string::npos;
mUsesDiscardRewriting =
translatedSource.find("ANGLE_USES_DISCARD_REWRITING") != std::string::npos;
mUsesNestedBreak = translatedSource.find("ANGLE_USES_NESTED_BREAK") != std::string::npos;
@@ -211,16 +223,16 @@ bool ShaderD3D::postTranslateCompile(gl::Compiler *compiler, std::string *infoLo
mUniformRegisterMap = GetUniformRegisterMap(sh::GetUniformRegisterMap(compilerHandle));
- for (const sh::InterfaceBlock &interfaceBlock : mData.getInterfaceBlocks())
+ for (const sh::InterfaceBlock &interfaceBlock : mData.getUniformBlocks())
{
if (interfaceBlock.staticUse)
{
unsigned int index = static_cast<unsigned int>(-1);
bool blockRegisterResult =
- sh::GetInterfaceBlockRegister(compilerHandle, interfaceBlock.name, &index);
+ sh::GetUniformBlockRegister(compilerHandle, interfaceBlock.name, &index);
ASSERT(blockRegisterResult);
- mInterfaceBlockRegisterMap[interfaceBlock.name] = index;
+ mUniformBlockRegisterMap[interfaceBlock.name] = index;
}
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.h
index dc99ac44f3b..ed6b5ecfa59 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/ShaderD3D.h
@@ -19,6 +19,11 @@ struct CompilerWorkaroundsD3D;
struct WorkaroundsD3D;
}
+namespace gl
+{
+struct Extensions;
+}
+
namespace rx
{
class DynamicHLSL;
@@ -28,7 +33,9 @@ struct D3DUniform;
class ShaderD3D : public ShaderImpl
{
public:
- ShaderD3D(const gl::ShaderState &data, const angle::WorkaroundsD3D &workarounds);
+ ShaderD3D(const gl::ShaderState &data,
+ const angle::WorkaroundsD3D &workarounds,
+ const gl::Extensions &extensions);
virtual ~ShaderD3D();
// ShaderImpl implementation
@@ -46,7 +53,7 @@ class ShaderD3D : public ShaderImpl
// using dot (.) operator.
unsigned int getUniformRegister(const std::string &uniformName) const;
- unsigned int getInterfaceBlockRegister(const std::string &blockName) const;
+ unsigned int getUniformBlockRegister(const std::string &blockName) const;
void appendDebugInfo(const std::string &info) const { mDebugInfo += info; }
void generateWorkarounds(angle::CompilerWorkaroundsD3D *workarounds) const;
@@ -60,6 +67,8 @@ class ShaderD3D : public ShaderImpl
bool usesPointCoord() const { return mUsesPointCoord; }
bool usesDepthRange() const { return mUsesDepthRange; }
bool usesFragDepth() const { return mUsesFragDepth; }
+ bool usesViewID() const { return mUsesViewID; }
+ bool hasANGLEMultiviewEnabled() const { return mHasANGLEMultiviewEnabled; }
ShShaderOutput getCompilerOutputType() const;
@@ -73,6 +82,8 @@ class ShaderD3D : public ShaderImpl
bool mUsesPointCoord;
bool mUsesDepthRange;
bool mUsesFragDepth;
+ bool mHasANGLEMultiviewEnabled;
+ bool mUsesViewID;
bool mUsesDiscardRewriting;
bool mUsesNestedBreak;
bool mRequiresIEEEStrictCompiling;
@@ -80,7 +91,7 @@ class ShaderD3D : public ShaderImpl
ShShaderOutput mCompilerOutputType;
mutable std::string mDebugInfo;
std::map<std::string, unsigned int> mUniformRegisterMap;
- std::map<std::string, unsigned int> mInterfaceBlockRegisterMap;
+ std::map<std::string, unsigned int> mUniformBlockRegisterMap;
ShCompileOptions mAdditionalOptions;
};
} // namespace rx
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 69dc9de0aa1..4a78b6a3cbc 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp
@@ -635,14 +635,17 @@ void TextureD3D::syncState(const gl::Texture::DirtyBits &dirtyBits)
gl::Error TextureD3D::clearLevel(const gl::Context *context,
const gl::ImageIndex &index,
- const gl::ColorF &clearValues)
+ const gl::ColorF &clearColorValue,
+ const float clearDepthValue,
+ const unsigned int clearStencilValue)
{
TextureStorage *storage = nullptr;
ANGLE_TRY(getNativeTexture(context, &storage));
RenderTargetD3D *renderTargetD3D = nullptr;
ANGLE_TRY(storage->getRenderTarget(context, index, &renderTargetD3D));
- mRenderer->clearRenderTarget(renderTargetD3D, clearValues);
+ mRenderer->clearRenderTarget(renderTargetD3D, clearColorValue, clearDepthValue,
+ clearStencilValue);
return gl::NoError();
}
@@ -1150,7 +1153,9 @@ gl::Error TextureD3D_2D::bindTexImage(const gl::Context *context, egl::Surface *
mTexStorage = mRenderer->createTextureStorage2D(surfaceD3D->getSwapChain());
mEGLImageTarget = false;
- mDirtyImages = true;
+ mDirtyImages = false;
+ mImageArray[0]->markClean();
+
return gl::NoError();
}
@@ -1617,7 +1622,7 @@ gl::Error TextureD3D_Cube::setCompressedSubImage(const gl::Context *context,
gl::Error TextureD3D_Cube::copyImage(const gl::Context *context,
GLenum target,
size_t imageLevel,
- const gl::Rectangle &sourceArea,
+ const gl::Rectangle &origSourceArea,
GLenum internalFormat,
const gl::Framebuffer *source)
{
@@ -1627,13 +1632,43 @@ gl::Error TextureD3D_Cube::copyImage(const gl::Context *context,
GLint level = static_cast<GLint>(imageLevel);
- gl::Extents size(sourceArea.width, sourceArea.height, 1);
+ gl::Extents size(origSourceArea.width, origSourceArea.height, 1);
ANGLE_TRY(redefineImage(context, static_cast<int>(faceIndex), level,
internalFormatInfo.sizedInternalFormat, size,
mRenderer->isRobustResourceInitEnabled()));
+ gl::Extents fbSize = source->getReadColorbuffer()->getSize();
+
+ // Does the read area extend beyond the framebuffer?
+ bool outside = origSourceArea.x < 0 || origSourceArea.y < 0 ||
+ origSourceArea.x + origSourceArea.width > fbSize.width ||
+ origSourceArea.y + origSourceArea.height > fbSize.height;
+
+ // In WebGL mode we need to zero the texture outside the framebuffer.
+ // If we have robust resource init, it was already zeroed by redefineImage() above, otherwise
+ // zero it explicitly.
+ // TODO(fjhenigman): When robust resource is fully implemented look into making it a
+ // prerequisite for WebGL and deleting this code.
+ if (outside && context->getExtensions().webglCompatibility &&
+ !mRenderer->isRobustResourceInitEnabled())
+ {
+ angle::MemoryBuffer *zero;
+ ANGLE_TRY(context->getZeroFilledBuffer(
+ origSourceArea.width * origSourceArea.height * internalFormatInfo.pixelBytes, &zero));
+ setImage(context, target, imageLevel, internalFormat, size, internalFormatInfo.format,
+ internalFormatInfo.type, gl::PixelUnpackState(1, 0), zero->data());
+ }
+
+ gl::Rectangle sourceArea;
+ if (!ClipRectangle(origSourceArea, gl::Rectangle(0, 0, fbSize.width, fbSize.height),
+ &sourceArea))
+ {
+ // Empty source area, nothing to do.
+ return gl::NoError();
+ }
+
gl::ImageIndex index = gl::ImageIndex::MakeCube(target, level);
- gl::Offset destOffset(0, 0, 0);
+ gl::Offset destOffset(sourceArea.x - origSourceArea.x, sourceArea.y - origSourceArea.y, 0);
// If the zero max LOD workaround is active, then we can't sample from individual layers of the framebuffer in shaders,
// so we should use the non-rendering copy path.
@@ -1663,10 +1698,20 @@ gl::Error TextureD3D_Cube::copyImage(const gl::Context *context,
gl::Error TextureD3D_Cube::copySubImage(const gl::Context *context,
GLenum target,
size_t imageLevel,
- const gl::Offset &destOffset,
- const gl::Rectangle &sourceArea,
+ const gl::Offset &origDestOffset,
+ const gl::Rectangle &origSourceArea,
const gl::Framebuffer *source)
{
+ gl::Extents fbSize = source->getReadColorbuffer()->getSize();
+ gl::Rectangle sourceArea;
+ if (!ClipRectangle(origSourceArea, gl::Rectangle(0, 0, fbSize.width, fbSize.height),
+ &sourceArea))
+ {
+ return gl::NoError();
+ }
+ const gl::Offset destOffset(origDestOffset.x + sourceArea.x - origSourceArea.x,
+ origDestOffset.y + sourceArea.y - origSourceArea.y, 0);
+
int faceIndex = static_cast<int>(gl::CubeMapTextureTargetToLayerIndex(target));
GLint level = static_cast<GLint>(imageLevel);
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 e72c670c343..6cdd352cb59 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/TextureD3D.h
@@ -102,7 +102,9 @@ class TextureD3D : public TextureImpl
gl::Error clearLevel(const gl::Context *context,
const gl::ImageIndex &index,
- const gl::ColorF &clearValues);
+ const gl::ColorF &clearColorValue,
+ const float clearDepthValue,
+ const unsigned int clearStencilValue);
protected:
gl::Error setImageImpl(const gl::Context *context,
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 46592e5478a..f5c6cf08231 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp
@@ -113,6 +113,7 @@ bool DirectStoragePossible(const gl::VertexAttribute &attrib, const gl::VertexBi
TranslatedAttribute::TranslatedAttribute()
: active(false),
attribute(nullptr),
+ binding(nullptr),
currentValueType(GL_NONE),
baseOffset(0),
usesFirstVertexOffset(false),
@@ -176,9 +177,7 @@ VertexStorageType ClassifyAttributeStorage(const gl::VertexAttribute &attrib,
}
}
-VertexDataManager::CurrentValueState::CurrentValueState()
- : buffer(nullptr),
- offset(0)
+VertexDataManager::CurrentValueState::CurrentValueState() : buffer(), offset(0)
{
data.FloatValues[0] = std::numeric_limits<float>::quiet_NaN();
data.FloatValues[1] = std::numeric_limits<float>::quiet_NaN();
@@ -189,26 +188,33 @@ VertexDataManager::CurrentValueState::CurrentValueState()
VertexDataManager::CurrentValueState::~CurrentValueState()
{
- SafeDelete(buffer);
}
VertexDataManager::VertexDataManager(BufferFactoryD3D *factory)
- : mFactory(factory),
- mStreamingBuffer(nullptr),
- // TODO(jmadill): use context caps
- mCurrentValueCache(gl::MAX_VERTEX_ATTRIBS)
+ : mFactory(factory), mStreamingBuffer(), mCurrentValueCache(gl::MAX_VERTEX_ATTRIBS)
{
- mStreamingBuffer = new StreamingVertexBufferInterface(factory, INITIAL_STREAM_BUFFER_SIZE);
+}
+
+VertexDataManager::~VertexDataManager()
+{
+}
+gl::Error VertexDataManager::initialize()
+{
+ mStreamingBuffer.reset(
+ new StreamingVertexBufferInterface(mFactory, INITIAL_STREAM_BUFFER_SIZE));
if (!mStreamingBuffer)
{
- ERR() << "Failed to allocate the streaming vertex buffer.";
+ return gl::OutOfMemory() << "Failed to allocate the streaming vertex buffer.";
}
+
+ return gl::NoError();
}
-VertexDataManager::~VertexDataManager()
+void VertexDataManager::deinitialize()
{
- SafeDelete(mStreamingBuffer);
+ mStreamingBuffer.reset();
+ mCurrentValueCache.clear();
}
gl::Error VertexDataManager::prepareVertexData(const gl::State &state,
@@ -398,7 +404,7 @@ gl::Error VertexDataManager::storeDynamicAttribs(
};
// Will trigger unmapping on return.
- StreamingBufferUnmapper localUnmapper(mStreamingBuffer);
+ StreamingBufferUnmapper localUnmapper(mStreamingBuffer.get());
// Reserve the required space for the dynamic buffers.
for (auto attribIndex : dynamicAttribsMask)
@@ -452,7 +458,8 @@ gl::Error VertexDataManager::reserveSpaceForAttrib(const TranslatedAttribute &tr
BufferD3D *bufferD3D = buffer ? GetImplAs<BufferD3D>(buffer) : nullptr;
ASSERT(!bufferD3D || bufferD3D->getStaticVertexBuffer(attrib, binding) == nullptr);
- size_t totalCount = ComputeVertexBindingElementCount(binding, count, instances);
+ size_t totalCount = gl::ComputeVertexBindingElementCount(
+ binding.getDivisor(), static_cast<size_t>(count), static_cast<size_t>(instances));
ASSERT(!bufferD3D ||
ElementsInBuffer(attrib, binding, static_cast<unsigned int>(bufferD3D->getSize())) >=
static_cast<int>(totalCount));
@@ -499,7 +506,8 @@ gl::Error VertexDataManager::storeDynamicAttrib(TranslatedAttribute *translated,
translated->storage = nullptr;
ANGLE_TRY_RESULT(mFactory->getVertexSpaceRequired(attrib, binding, 1, 0), translated->stride);
- size_t totalCount = ComputeVertexBindingElementCount(binding, count, instances);
+ size_t totalCount = gl::ComputeVertexBindingElementCount(
+ binding.getDivisor(), static_cast<size_t>(count), static_cast<size_t>(instances));
ANGLE_TRY(mStreamingBuffer->storeDynamicAttribute(
attrib, binding, translated->currentValueType, firstVertexIndex,
@@ -520,11 +528,11 @@ gl::Error VertexDataManager::storeCurrentValue(const gl::VertexAttribCurrentValu
size_t attribIndex)
{
CurrentValueState *cachedState = &mCurrentValueCache[attribIndex];
- auto *&buffer = cachedState->buffer;
+ auto &buffer = cachedState->buffer;
if (!buffer)
{
- buffer = new StreamingVertexBufferInterface(mFactory, CONSTANT_VERTEX_BUFFER_SIZE);
+ buffer.reset(new StreamingVertexBufferInterface(mFactory, CONSTANT_VERTEX_BUFFER_SIZE));
}
if (cachedState->data != currentValue)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.h
index e411c6c921b..cbdb2830e38 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/VertexDataManager.h
@@ -87,6 +87,9 @@ class VertexDataManager : angle::NonCopyable
VertexDataManager(BufferFactoryD3D *factory);
virtual ~VertexDataManager();
+ gl::Error initialize();
+ void deinitialize();
+
gl::Error prepareVertexData(const gl::State &state,
GLint start,
GLsizei count,
@@ -118,7 +121,7 @@ class VertexDataManager : angle::NonCopyable
CurrentValueState();
~CurrentValueState();
- StreamingVertexBufferInterface *buffer;
+ std::unique_ptr<StreamingVertexBufferInterface> buffer;
gl::VertexAttribCurrentValueData data;
size_t offset;
};
@@ -134,7 +137,7 @@ class VertexDataManager : angle::NonCopyable
BufferFactoryD3D *const mFactory;
- StreamingVertexBufferInterface *mStreamingBuffer;
+ std::unique_ptr<StreamingVertexBufferInterface> mStreamingBuffer;
std::vector<CurrentValueState> mCurrentValueCache;
gl::AttributesMask mDynamicAttribsMaskCache;
};
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 a5b3641f54e..d365ac1b765 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
@@ -21,11 +21,35 @@
// Precompiled shaders
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11_fl9vs.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewgs.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewvs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11vs.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/cleardepth11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11_fl9ps.h"
-#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h"
-#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h"
-#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps1.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps2.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps3.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps4.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps5.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps6.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps7.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps8.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps1.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps2.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps3.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps4.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps5.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps6.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps7.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps8.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps1.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps2.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps3.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps4.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps5.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps6.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps7.h"
+#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps8.h"
namespace rx
{
@@ -79,27 +103,55 @@ bool UpdateDataCache(RtvDsvClearInfo<T> *dataCache,
return cacheDirty;
}
+
+bool AllOffsetsAreNonNegative(const std::vector<gl::Offset> &viewportOffsets)
+{
+ for (size_t i = 0u; i < viewportOffsets.size(); ++i)
+ {
+ const auto &offset = viewportOffsets[i];
+ if (offset.x < 0 || offset.y < 0)
+ {
+ return false;
+ }
+ }
+ return true;
+}
} // anonymous namespace
+#define CLEARPS(Index) \
+ d3d11::LazyShader<ID3D11PixelShader>(g_PS_Clear##Index, ArraySize(g_PS_Clear##Index), \
+ "Clear11 PS " ANGLE_STRINGIFY(Index))
+
Clear11::ShaderManager::ShaderManager()
: mIl9(),
mVs9(g_VS_Clear_FL9, ArraySize(g_VS_Clear_FL9), "Clear11 VS FL9"),
mPsFloat9(g_PS_ClearFloat_FL9, ArraySize(g_PS_ClearFloat_FL9), "Clear11 PS FloatFL9"),
mVs(g_VS_Clear, ArraySize(g_VS_Clear), "Clear11 VS"),
- mPsFloat(g_PS_ClearFloat, ArraySize(g_PS_ClearFloat), "Clear11 PS Float"),
- mPsUInt(g_PS_ClearUint, ArraySize(g_PS_ClearUint), "Clear11 PS UINT"),
- mPsSInt(g_PS_ClearSint, ArraySize(g_PS_ClearSint), "Clear11 PS SINT")
+ mVsMultiview(g_VS_Multiview_Clear, ArraySize(g_VS_Multiview_Clear), "Clear11 VS Multiview"),
+ mGsMultiview(g_GS_Multiview_Clear, ArraySize(g_GS_Multiview_Clear), "Clear11 GS Multiview"),
+ mPsDepth(g_PS_ClearDepth, ArraySize(g_PS_ClearDepth), "Clear11 PS Depth"),
+ mPsFloat{{CLEARPS(Float1), CLEARPS(Float2), CLEARPS(Float3), CLEARPS(Float4), CLEARPS(Float5),
+ CLEARPS(Float6), CLEARPS(Float7), CLEARPS(Float8)}},
+ mPsUInt{{CLEARPS(Uint1), CLEARPS(Uint2), CLEARPS(Uint3), CLEARPS(Uint4), CLEARPS(Uint5),
+ CLEARPS(Uint6), CLEARPS(Uint7), CLEARPS(Uint8)}},
+ mPsSInt{{CLEARPS(Sint1), CLEARPS(Sint2), CLEARPS(Sint3), CLEARPS(Sint4), CLEARPS(Sint5),
+ CLEARPS(Sint6), CLEARPS(Sint7), CLEARPS(Sint8)}}
{
}
+#undef CLEARPS
+
Clear11::ShaderManager::~ShaderManager()
{
}
gl::Error Clear11::ShaderManager::getShadersAndLayout(Renderer11 *renderer,
const INT clearType,
+ const uint32_t numRTs,
+ const bool hasLayeredLayout,
const d3d11::InputLayout **il,
const d3d11::VertexShader **vs,
+ const d3d11::GeometryShader **gs,
const d3d11::PixelShader **ps)
{
if (renderer->getRenderer11DeviceCaps().featureLevel <= D3D_FEATURE_LEVEL_9_3)
@@ -121,28 +173,48 @@ gl::Error Clear11::ShaderManager::getShadersAndLayout(Renderer11 *renderer,
}
*vs = &mVs9.getObj();
+ *gs = nullptr;
*il = &mIl9;
*ps = &mPsFloat9.getObj();
return gl::NoError();
}
+ if (!hasLayeredLayout)
+ {
+ ANGLE_TRY(mVs.resolve(renderer));
+ *vs = &mVs.getObj();
+ *gs = nullptr;
+ }
+ else
+ {
+ // For layered framebuffers we have to use the multi-view versions of the VS and GS.
+ ANGLE_TRY(mVsMultiview.resolve(renderer));
+ ANGLE_TRY(mGsMultiview.resolve(renderer));
+ *vs = &mVsMultiview.getObj();
+ *gs = &mGsMultiview.getObj();
+ }
- ANGLE_TRY(mVs.resolve(renderer));
- *vs = &mVs.getObj();
*il = nullptr;
+ if (numRTs == 0)
+ {
+ ANGLE_TRY(mPsDepth.resolve(renderer));
+ *ps = &mPsDepth.getObj();
+ return gl::NoError();
+ }
+
switch (clearType)
{
case GL_FLOAT:
- ANGLE_TRY(mPsFloat.resolve(renderer));
- *ps = &mPsFloat.getObj();
+ ANGLE_TRY(mPsFloat[numRTs - 1].resolve(renderer));
+ *ps = &mPsFloat[numRTs - 1].getObj();
break;
case GL_UNSIGNED_INT:
- ANGLE_TRY(mPsUInt.resolve(renderer));
- *ps = &mPsUInt.getObj();
+ ANGLE_TRY(mPsUInt[numRTs - 1].resolve(renderer));
+ *ps = &mPsUInt[numRTs - 1].getObj();
break;
case GL_INT:
- ANGLE_TRY(mPsSInt.resolve(renderer));
- *ps = &mPsSInt.getObj();
+ ANGLE_TRY(mPsSInt[numRTs - 1].resolve(renderer));
+ *ps = &mPsSInt[numRTs - 1].getObj();
break;
default:
UNREACHABLE();
@@ -364,24 +436,66 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
framebufferSize = colorAttachment->getSize();
}
+ const bool isSideBySideFBO =
+ (fboData.getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE);
bool needScissoredClear = false;
-
+ std::vector<D3D11_RECT> scissorRects;
if (clearParams.scissorEnabled)
{
+ const std::vector<gl::Offset> *viewportOffsets = fboData.getViewportOffsets();
+ ASSERT(viewportOffsets != nullptr);
+ ASSERT(AllOffsetsAreNonNegative(*fboData.getViewportOffsets()));
+
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)
+ clearParams.scissor.y >= framebufferSize.height || clearParams.scissor.width == 0 ||
+ clearParams.scissor.height == 0)
{
- // Scissor rect is outside the renderbuffer or is an empty rect
+ // The check assumes that the viewport offsets are not negative as according to the
+ // ANGLE_multiview spec.
+ // 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;
+ if (isSideBySideFBO)
+ {
+ // We always have to do a scissor clear for side-by-side framebuffers.
+ needScissoredClear = true;
+ }
+ else
+ {
+ // Because the viewport offsets can generate scissor rectangles within the framebuffer's
+ // bounds, we can do this check only for non-side-by-side framebuffers.
+ if (clearParams.scissor.x + clearParams.scissor.width <= 0 ||
+ clearParams.scissor.y + clearParams.scissor.height <= 0)
+ {
+ // Scissor rect is outside the renderbuffer.
+ 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;
+ }
+
+ if (needScissoredClear)
+ {
+ // Apply viewport offsets to compute the final scissor rectangles. This is valid also
+ // for non-side-by-side framebuffers, because the default viewport offset is {0,0}.
+ const size_t numViews = viewportOffsets->size();
+ scissorRects.reserve(numViews);
+ for (size_t i = 0u; i < numViews; ++i)
+ {
+ const gl::Offset &offset = (*viewportOffsets)[i];
+ D3D11_RECT rect;
+ int x = clearParams.scissor.x + offset.x;
+ int y = clearParams.scissor.y + offset.y;
+ rect.left = x;
+ rect.right = x + clearParams.scissor.width;
+ rect.top = y;
+ rect.bottom = y + clearParams.scissor.height;
+ scissorRects.emplace_back(rect);
+ }
+ }
}
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
@@ -479,19 +593,17 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
{
// We shouldn't reach here if deviceContext1 is unavailable.
ASSERT(deviceContext1);
-
- D3D11_RECT rect;
- rect.left = clearParams.scissor.x;
- rect.right = clearParams.scissor.x + clearParams.scissor.width;
- rect.top = clearParams.scissor.y;
- rect.bottom = clearParams.scissor.y + clearParams.scissor.height;
-
- deviceContext1->ClearView(framebufferRTV.get(), clearValues, &rect, 1);
+ // There must be at least one scissor rectangle.
+ ASSERT(!scissorRects.empty());
+ deviceContext1->ClearView(framebufferRTV.get(), clearValues, scissorRects.data(),
+ static_cast<UINT>(scissorRects.size()));
if (mRenderer->getWorkarounds().callClearTwiceOnSmallTarget)
{
if (clearParams.scissor.width <= 16 || clearParams.scissor.height <= 16)
{
- deviceContext1->ClearView(framebufferRTV.get(), clearValues, &rect, 1);
+ deviceContext1->ClearView(framebufferRTV.get(), clearValues,
+ scissorRects.data(),
+ static_cast<UINT>(scissorRects.size()));
}
}
}
@@ -649,7 +761,7 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
deviceContext->Unmap(mConstantBuffer.get(), 0);
}
- // Set the viewport to be the same size as the framebuffer
+ // Set the viewport to be the same size as the framebuffer.
D3D11_VIEWPORT viewport;
viewport.TopLeftX = 0;
viewport.TopLeftY = 0;
@@ -667,9 +779,6 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
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
@@ -681,13 +790,16 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
// Get Shaders
const d3d11::VertexShader *vs = nullptr;
+ const d3d11::GeometryShader *gs = nullptr;
const d3d11::InputLayout *il = nullptr;
const d3d11::PixelShader *ps = nullptr;
-
- ANGLE_TRY(mShaderManager.getShadersAndLayout(mRenderer, clearParams.colorType, &il, &vs, &ps));
+ const bool hasLayeredLayout =
+ (fboData.getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE);
+ ANGLE_TRY(mShaderManager.getShadersAndLayout(mRenderer, clearParams.colorType, numRtvs,
+ hasLayeredLayout, &il, &vs, &gs, &ps));
// Apply Shaders
- stateManager->setDrawShaders(vs, nullptr, ps);
+ stateManager->setDrawShaders(vs, gs, ps);
ID3D11Buffer *constantBuffer = mConstantBuffer.get();
deviceContext->PSSetConstantBuffers(0, 1, &constantBuffer);
@@ -710,8 +822,27 @@ gl::Error Clear11::clearFramebuffer(const gl::Context *context,
// Apply render targets
stateManager->setOneTimeRenderTargets(context, &rtvs[0], numRtvs, dsv);
- // Draw the fullscreen quad
- deviceContext->Draw(6, 0);
+ // If scissors are necessary to be applied, then the number of clears is the number of scissor
+ // rects. If no scissors are necessary, then a single full-size clear is enough.
+ size_t necessaryNumClears = needScissoredClear ? scissorRects.size() : 1u;
+ for (size_t i = 0u; i < necessaryNumClears; ++i)
+ {
+ if (needScissoredClear)
+ {
+ ASSERT(i < scissorRects.size());
+ deviceContext->RSSetScissorRects(1, &scissorRects[i]);
+ }
+ // Draw the fullscreen quad.
+ if (!hasLayeredLayout || isSideBySideFBO)
+ {
+ deviceContext->Draw(6, 0);
+ }
+ else
+ {
+ ASSERT(hasLayeredLayout);
+ deviceContext->DrawInstanced(6, static_cast<UINT>(fboData.getNumViews()), 0, 0);
+ }
+ }
// Clean up
mRenderer->markAllStateDirty(context);
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 00990951c2e..a09812c42be 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
@@ -50,18 +50,26 @@ class Clear11 : angle::NonCopyable
~ShaderManager();
gl::Error getShadersAndLayout(Renderer11 *renderer,
const INT clearType,
+ const uint32_t numRTs,
+ const bool hasLayeredLayout,
const d3d11::InputLayout **il,
const d3d11::VertexShader **vs,
+ const d3d11::GeometryShader **gs,
const d3d11::PixelShader **ps);
private:
+ constexpr static size_t kNumShaders = D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT;
+
d3d11::InputLayout mIl9;
d3d11::LazyShader<ID3D11VertexShader> mVs9;
d3d11::LazyShader<ID3D11PixelShader> mPsFloat9;
d3d11::LazyShader<ID3D11VertexShader> mVs;
- d3d11::LazyShader<ID3D11PixelShader> mPsFloat;
- d3d11::LazyShader<ID3D11PixelShader> mPsUInt;
- d3d11::LazyShader<ID3D11PixelShader> mPsSInt;
+ d3d11::LazyShader<ID3D11VertexShader> mVsMultiview;
+ d3d11::LazyShader<ID3D11GeometryShader> mGsMultiview;
+ d3d11::LazyShader<ID3D11PixelShader> mPsDepth;
+ std::array<d3d11::LazyShader<ID3D11PixelShader>, kNumShaders> mPsFloat;
+ std::array<d3d11::LazyShader<ID3D11PixelShader>, kNumShaders> mPsUInt;
+ std::array<d3d11::LazyShader<ID3D11PixelShader>, kNumShaders> mPsSInt;
};
bool useVertexBuffer() const;
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 91a3622a5b4..4ea46e4eb06 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
@@ -10,6 +10,8 @@
#include "libANGLE/renderer/d3d/d3d11/Context11.h"
#include "common/string_utils.h"
+#include "libANGLE/Context.h"
+#include "libANGLE/MemoryProgramCache.h"
#include "libANGLE/renderer/d3d/CompilerD3D.h"
#include "libANGLE/renderer/d3d/ProgramD3D.h"
#include "libANGLE/renderer/d3d/RenderbufferD3D.h"
@@ -55,7 +57,7 @@ CompilerImpl *Context11::createCompiler()
ShaderImpl *Context11::createShader(const gl::ShaderState &data)
{
- return new ShaderD3D(data, mRenderer->getWorkarounds());
+ return new ShaderD3D(data, mRenderer->getWorkarounds(), mRenderer->getNativeExtensions());
}
ProgramImpl *Context11::createProgram(const gl::ProgramState &data)
@@ -119,9 +121,9 @@ FenceNVImpl *Context11::createFenceNV()
return new FenceNV11(mRenderer);
}
-FenceSyncImpl *Context11::createFenceSync()
+SyncImpl *Context11::createSync()
{
- return new FenceSync11(mRenderer);
+ return new Sync11(mRenderer);
}
TransformFeedbackImpl *Context11::createTransformFeedback(const gl::TransformFeedbackState &state)
@@ -167,10 +169,9 @@ gl::Error Context11::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
- return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
+ return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context11::drawElementsInstanced(const gl::Context *context,
@@ -178,11 +179,9 @@ gl::Error Context11::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
- return mRenderer->genericDrawElements(context, mode, count, type, indices, instances,
- indexRange);
+ return mRenderer->genericDrawElements(context, mode, count, type, indices, instances);
}
gl::Error Context11::drawRangeElements(const gl::Context *context,
@@ -191,10 +190,9 @@ gl::Error Context11::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
- return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
+ return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context11::drawArraysIndirect(const gl::Context *context,
@@ -298,4 +296,70 @@ gl::Error Context11::dispatchCompute(const gl::Context *context,
return mRenderer->dispatchCompute(context, numGroupsX, numGroupsY, numGroupsZ);
}
+gl::Error Context11::triggerDrawCallProgramRecompilation(const gl::Context *context,
+ gl::InfoLog *infoLog,
+ gl::MemoryProgramCache *memoryCache,
+ GLenum drawMode)
+{
+ const auto &glState = context->getGLState();
+ const auto *va11 = GetImplAs<VertexArray11>(glState.getVertexArray());
+ const auto *drawFBO = glState.getDrawFramebuffer();
+ gl::Program *program = glState.getProgram();
+ ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program);
+
+ programD3D->updateCachedInputLayout(va11->getCurrentStateSerial(), glState);
+ programD3D->updateCachedOutputLayout(context, drawFBO);
+
+ bool recompileVS = !programD3D->hasVertexExecutableForCachedInputLayout();
+ bool recompileGS = !programD3D->hasGeometryExecutableForPrimitiveType(drawMode);
+ bool recompilePS = !programD3D->hasPixelExecutableForCachedOutputLayout();
+
+ if (!recompileVS && !recompileGS && !recompilePS)
+ {
+ return gl::NoError();
+ }
+
+ // Load the compiler if necessary and recompile the programs.
+ ANGLE_TRY(mRenderer->ensureHLSLCompilerInitialized());
+
+ if (recompileVS)
+ {
+ ShaderExecutableD3D *vertexExe = nullptr;
+ ANGLE_TRY(programD3D->getVertexExecutableForCachedInputLayout(&vertexExe, infoLog));
+ if (!programD3D->hasVertexExecutableForCachedInputLayout())
+ {
+ return gl::InternalError() << "Error compiling dynamic vertex executable.";
+ }
+ }
+
+ if (recompileGS)
+ {
+ ShaderExecutableD3D *geometryExe = nullptr;
+ ANGLE_TRY(programD3D->getGeometryExecutableForPrimitiveType(
+ context->getContextState(), drawMode, &geometryExe, infoLog));
+ if (!programD3D->hasGeometryExecutableForPrimitiveType(drawMode))
+ {
+ return gl::InternalError() << "Error compiling dynamic geometry executable.";
+ }
+ }
+
+ if (recompilePS)
+ {
+ ShaderExecutableD3D *pixelExe = nullptr;
+ ANGLE_TRY(programD3D->getPixelExecutableForCachedOutputLayout(&pixelExe, infoLog));
+ if (!programD3D->hasPixelExecutableForCachedOutputLayout())
+ {
+ return gl::InternalError() << "Error compiling dynamic pixel executable.";
+ }
+ }
+
+ // Refresh the program cache entry.
+ if (memoryCache)
+ {
+ memoryCache->updateProgram(context, program);
+ }
+
+ 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 f11c533f4e2..09d58318863 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
@@ -47,7 +47,7 @@ class Context11 : public ContextImpl
// Query and Fence creation
QueryImpl *createQuery(GLenum type) override;
FenceNVImpl *createFenceNV() override;
- FenceSyncImpl *createFenceSync() override;
+ SyncImpl *createSync() override;
// Transform Feedback creation
TransformFeedbackImpl *createTransformFeedback(
@@ -78,23 +78,20 @@ class Context11 : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange) override;
+ GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
@@ -138,6 +135,11 @@ class Context11 : public ContextImpl
GLuint numGroupsY,
GLuint numGroupsZ) override;
+ gl::Error triggerDrawCallProgramRecompilation(const gl::Context *context,
+ gl::InfoLog *infoLog,
+ gl::MemoryProgramCache *memoryCache,
+ GLenum drawMode) override;
+
private:
Renderer11 *mRenderer;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp
index 51449f68372..a342cdde583 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-// Fence11.cpp: Defines the rx::FenceNV11 and rx::FenceSync11 classes which implement
-// rx::FenceNVImpl and rx::FenceSyncImpl.
+// Fence11.cpp: Defines the rx::FenceNV11 and rx::Sync11 classes which implement
+// rx::FenceNVImpl and rx::SyncImpl.
#include "libANGLE/renderer/d3d/d3d11/Fence11.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
@@ -105,7 +105,7 @@ gl::Error FenceNV11::finish()
}
//
-// FenceSync11
+// Sync11
//
// Important note on accurate timers in Windows:
@@ -119,8 +119,7 @@ gl::Error FenceNV11::finish()
// We still opt to use QPC. In the present and moving forward, most newer systems will not suffer
// from buggy implementations.
-FenceSync11::FenceSync11(Renderer11 *renderer)
- : FenceSyncImpl(), mRenderer(renderer), mQuery(nullptr)
+Sync11::Sync11(Renderer11 *renderer) : SyncImpl(), mRenderer(renderer), mQuery(nullptr)
{
LARGE_INTEGER counterFreqency = {};
BOOL success = QueryPerformanceFrequency(&counterFreqency);
@@ -129,18 +128,18 @@ FenceSync11::FenceSync11(Renderer11 *renderer)
mCounterFrequency = counterFreqency.QuadPart;
}
-FenceSync11::~FenceSync11()
+Sync11::~Sync11()
{
SafeRelease(mQuery);
}
-gl::Error FenceSync11::set(GLenum condition, GLbitfield flags)
+gl::Error Sync11::set(GLenum condition, GLbitfield flags)
{
ASSERT(condition == GL_SYNC_GPU_COMMANDS_COMPLETE && flags == 0);
return FenceSetHelper(this);
}
-gl::Error FenceSync11::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
+gl::Error Sync11::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
{
ASSERT(outResult);
@@ -207,7 +206,7 @@ gl::Error FenceSync11::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *ou
return gl::NoError();
}
-gl::Error FenceSync11::serverWait(GLbitfield flags, GLuint64 timeout)
+gl::Error Sync11::serverWait(GLbitfield flags, GLuint64 timeout)
{
// Because our API is currently designed to be called from a single thread, we don't need to do
// extra work for a server-side fence. GPU commands issued after the fence is created will
@@ -215,7 +214,7 @@ gl::Error FenceSync11::serverWait(GLbitfield flags, GLuint64 timeout)
return gl::NoError();
}
-gl::Error FenceSync11::getStatus(GLint *outResult)
+gl::Error Sync11::getStatus(GLint *outResult)
{
GLboolean result = GL_FALSE;
gl::Error error = FenceTestHelper(this, false, &result);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.h
index 595978885b9..4168df5365d 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.h
@@ -4,13 +4,14 @@
// found in the LICENSE file.
//
-// Fence11.h: Defines the rx::FenceNV11 and rx::FenceSync11 classes which implement rx::FenceNVImpl and rx::FenceSyncImpl.
+// Fence11.h: Defines the rx::FenceNV11 and rx::Sync11 classes which implement rx::FenceNVImpl
+// and rx::SyncImpl.
#ifndef LIBANGLE_RENDERER_D3D_D3D11_FENCE11_H_
#define LIBANGLE_RENDERER_D3D_D3D11_FENCE11_H_
#include "libANGLE/renderer/FenceNVImpl.h"
-#include "libANGLE/renderer/FenceSyncImpl.h"
+#include "libANGLE/renderer/SyncImpl.h"
namespace rx
{
@@ -34,11 +35,11 @@ class FenceNV11 : public FenceNVImpl
ID3D11Query *mQuery;
};
-class FenceSync11 : public FenceSyncImpl
+class Sync11 : public SyncImpl
{
public:
- explicit FenceSync11(Renderer11 *renderer);
- ~FenceSync11() override;
+ explicit Sync11(Renderer11 *renderer);
+ ~Sync11() override;
gl::Error set(GLenum condition, GLbitfield flags) override;
gl::Error clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult) override;
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 edafee91bf6..d71572ce1c3 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
@@ -8,19 +8,20 @@
#include "libANGLE/renderer/d3d/d3d11/Framebuffer11.h"
-#include "common/debug.h"
#include "common/bitset_utils.h"
+#include "common/debug.h"
+#include "libANGLE/Context.h"
+#include "libANGLE/Framebuffer.h"
+#include "libANGLE/FramebufferAttachment.h"
+#include "libANGLE/Texture.h"
+#include "libANGLE/renderer/d3d/TextureD3D.h"
#include "libANGLE/renderer/d3d/d3d11/Buffer11.h"
#include "libANGLE/renderer/d3d/d3d11/Clear11.h"
-#include "libANGLE/renderer/d3d/d3d11/TextureStorage11.h"
-#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
-#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/RenderTarget11.h"
+#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
+#include "libANGLE/renderer/d3d/d3d11/TextureStorage11.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
-#include "libANGLE/renderer/d3d/TextureD3D.h"
-#include "libANGLE/Framebuffer.h"
-#include "libANGLE/FramebufferAttachment.h"
-#include "libANGLE/Texture.h"
+#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
using namespace angle;
@@ -413,6 +414,11 @@ void Framebuffer11::syncState(const gl::Context *context,
case gl::Framebuffer::DIRTY_BIT_DRAW_BUFFERS:
case gl::Framebuffer::DIRTY_BIT_READ_BUFFER:
break;
+ case gl::Framebuffer::DIRTY_BIT_DEFAULT_WIDTH:
+ case gl::Framebuffer::DIRTY_BIT_DEFAULT_HEIGHT:
+ case gl::Framebuffer::DIRTY_BIT_DEFAULT_SAMPLES:
+ case gl::Framebuffer::DIRTY_BIT_DEFAULT_FIXED_SAMPLE_LOCATIONS:
+ break;
default:
{
ASSERT(gl::Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_0 == 0 &&
@@ -432,6 +438,12 @@ void Framebuffer11::syncState(const gl::Context *context,
// Call this last to allow the state manager to take advantage of the cached render targets.
mRenderer->getStateManager()->invalidateRenderTarget(context);
+
+ // Call this to syncViewport for framebuffer default parameters.
+ if (mState.getDefaultWidth() != 0 || mState.getDefaultHeight() != 0)
+ {
+ mRenderer->getStateManager()->invalidateViewport(context);
+ }
}
void Framebuffer11::signal(size_t channelID)
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 780587f1506..de9e06ffdb2 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
@@ -23,84 +23,6 @@
namespace rx
{
-namespace
-{
-void CopyColor(gl::ColorF *color)
-{
- // No-op
-}
-
-void PremultiplyAlpha(gl::ColorF *color)
-{
- color->red *= color->alpha;
- color->green *= color->alpha;
- color->blue *= color->alpha;
-}
-
-void UnmultiplyAlpha(gl::ColorF *color)
-{
- if (color->alpha != 0.0f)
- {
- float invAlpha = 1.0f / color->alpha;
- color->red *= invAlpha;
- color->green *= invAlpha;
- color->blue *= invAlpha;
- }
-}
-
-void ClipChannelsR(gl::ColorF *color)
-{
- color->green = 0.0f;
- color->blue = 0.0f;
- color->alpha = 1.0f;
-}
-
-void ClipChannelsRG(gl::ColorF *color)
-{
- color->blue = 0.0f;
- color->alpha = 1.0f;
-}
-
-void ClipChannelsRGB(gl::ColorF *color)
-{
- color->alpha = 1.0f;
-}
-
-void ClipChannelsLuminance(gl::ColorF *color)
-{
- color->alpha = 1.0f;
-}
-
-void ClipChannelsAlpha(gl::ColorF *color)
-{
- color->red = 0.0f;
- color->green = 0.0f;
- color->blue = 0.0f;
-}
-
-void ClipChannelsNoOp(gl::ColorF *color)
-{
-}
-
-void WriteUintColor(const gl::ColorF &color,
- ColorWriteFunction colorWriteFunction,
- uint8_t *destPixelData)
-{
- gl::ColorUI destColor(
- static_cast<unsigned int>(color.red * 255), static_cast<unsigned int>(color.green * 255),
- static_cast<unsigned int>(color.red * 255), static_cast<unsigned int>(color.alpha * 255));
- colorWriteFunction(reinterpret_cast<const uint8_t *>(&destColor), destPixelData);
-}
-
-void WriteFloatColor(const gl::ColorF &color,
- ColorWriteFunction colorWriteFunction,
- uint8_t *destPixelData)
-{
- colorWriteFunction(reinterpret_cast<const uint8_t *>(&color), destPixelData);
-}
-
-} // anonymous namespace
-
Image11::Image11(Renderer11 *renderer)
: mRenderer(renderer),
mDXGIFormat(DXGI_FORMAT_UNKNOWN),
@@ -190,79 +112,16 @@ gl::Error Image11::CopyImage(const gl::Context *context,
gl::GetSizedInternalFormatInfo(destFormat.fboImplementationInternalFormat);
GLuint destPixelBytes = destFormatInfo.pixelBytes;
- const uint8_t *sourceData = reinterpret_cast<const uint8_t *>(srcMapped.pData);
- uint8_t *destData = reinterpret_cast<uint8_t *>(destMapped.pData);
+ const uint8_t *sourceData = reinterpret_cast<const uint8_t *>(srcMapped.pData) +
+ sourceRect.x * sourcePixelBytes + sourceRect.y * srcMapped.RowPitch;
+ uint8_t *destData = reinterpret_cast<uint8_t *>(destMapped.pData) +
+ destOffset.x * destPixelBytes + destOffset.y * destMapped.RowPitch;
- using ConversionFunction = void (*)(gl::ColorF *);
- ConversionFunction conversionFunction = CopyColor;
- if (unpackPremultiplyAlpha != unpackUnmultiplyAlpha)
- {
- if (unpackPremultiplyAlpha)
- {
- conversionFunction = PremultiplyAlpha;
- }
- else
- {
- conversionFunction = UnmultiplyAlpha;
- }
- }
-
- auto clipChannelsFunction = ClipChannelsNoOp;
- switch (destUnsizedFormat)
- {
- case GL_RED:
- clipChannelsFunction = ClipChannelsR;
- break;
- case GL_RG:
- clipChannelsFunction = ClipChannelsRG;
- break;
- case GL_RGB:
- clipChannelsFunction = ClipChannelsRGB;
- break;
- case GL_LUMINANCE:
- clipChannelsFunction = ClipChannelsLuminance;
- break;
- case GL_ALPHA:
- clipChannelsFunction = ClipChannelsAlpha;
- break;
- }
-
- auto writeFunction =
- (destFormatInfo.componentType == GL_UNSIGNED_INT) ? WriteUintColor : WriteFloatColor;
-
- for (int y = 0; y < sourceRect.height; y++)
- {
- for (int x = 0; x < sourceRect.width; x++)
- {
- int sourceX = sourceRect.x + x;
- int sourceY = sourceRect.y + y;
- const uint8_t *sourcePixelData =
- sourceData + sourceY * srcMapped.RowPitch + sourceX * sourcePixelBytes;
-
- gl::ColorF sourceColor;
- sourceFormat.colorReadFunction(sourcePixelData,
- reinterpret_cast<uint8_t *>(&sourceColor));
-
- conversionFunction(&sourceColor);
- clipChannelsFunction(&sourceColor);
-
- int destX = destOffset.x + x;
- int destY = destOffset.y;
- if (unpackFlipY)
- {
- destY += (sourceRect.height - 1);
- destY -= y;
- }
- else
- {
- destY += y;
- }
-
- uint8_t *destPixelData =
- destData + destY * destMapped.RowPitch + destX * destPixelBytes;
- writeFunction(sourceColor, destFormat.colorWriteFunction, destPixelData);
- }
- }
+ CopyImageCHROMIUM(sourceData, srcMapped.RowPitch, sourcePixelBytes,
+ sourceFormat.colorReadFunction, destData, destMapped.RowPitch, destPixelBytes,
+ destFormat.colorWriteFunction, destUnsizedFormat,
+ destFormatInfo.componentType, sourceRect.width, sourceRect.height,
+ unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
dest->unmap();
source->unmap();
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 1064f865300..95a931635da 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
@@ -35,19 +35,6 @@ size_t GetReservedBufferCount(bool usesPointSpriteEmulation)
return usesPointSpriteEmulation ? 1 : 0;
}
-gl::InputLayout GetInputLayout(const std::vector<const TranslatedAttribute *> &translatedAttributes)
-{
- gl::InputLayout inputLayout(translatedAttributes.size(), gl::VERTEX_FORMAT_INVALID);
-
- for (size_t attributeIndex = 0; attributeIndex < translatedAttributes.size(); ++attributeIndex)
- {
- const TranslatedAttribute *translatedAttribute = translatedAttributes[attributeIndex];
- inputLayout[attributeIndex] = gl::GetVertexFormatType(
- *translatedAttribute->attribute, translatedAttribute->currentValueType);
- }
- return inputLayout;
-}
-
GLenum GetGLSLAttributeType(const std::vector<sh::Attribute> &shaderAttributes, size_t index)
{
// Count matrices differently
@@ -80,54 +67,6 @@ struct PackedAttribute
uint8_t divisor;
};
-Optional<size_t> FindFirstNonInstanced(
- const std::vector<const TranslatedAttribute *> &currentAttributes)
-{
- for (size_t index = 0; index < currentAttributes.size(); ++index)
- {
- if (currentAttributes[index]->divisor == 0)
- {
- return Optional<size_t>(index);
- }
- }
-
- return Optional<size_t>::Invalid();
-}
-
-void SortAttributesByLayout(const gl::Program *program,
- const std::vector<TranslatedAttribute> &vertexArrayAttribs,
- const std::vector<TranslatedAttribute> &currentValueAttribs,
- AttribIndexArray *sortedD3DSemanticsOut,
- std::vector<const TranslatedAttribute *> *sortedAttributesOut)
-{
- sortedAttributesOut->clear();
-
- const auto &locationToSemantic =
- GetImplAs<ProgramD3D>(program)->getAttribLocationToD3DSemantics();
-
- for (auto locationIndex : program->getActiveAttribLocationsMask())
- {
- int d3dSemantic = locationToSemantic[locationIndex];
- if (sortedAttributesOut->size() <= static_cast<size_t>(d3dSemantic))
- {
- sortedAttributesOut->resize(d3dSemantic + 1);
- }
-
- (*sortedD3DSemanticsOut)[d3dSemantic] = d3dSemantic;
-
- const auto *arrayAttrib = &vertexArrayAttribs[locationIndex];
- if (arrayAttrib->attribute && arrayAttrib->attribute->enabled)
- {
- (*sortedAttributesOut)[d3dSemantic] = arrayAttrib;
- }
- else
- {
- ASSERT(currentValueAttribs[locationIndex].attribute);
- (*sortedAttributesOut)[d3dSemantic] = &currentValueAttribs[locationIndex];
- }
- }
-}
-
} // anonymous namespace
PackedAttributeLayout::PackedAttributeLayout() : numAttributes(0), flags(0), attributeData({})
@@ -166,7 +105,6 @@ bool PackedAttributeLayout::operator==(const PackedAttributeLayout &other) const
InputLayoutCache::InputLayoutCache()
: mLayoutCache(kDefaultCacheSize * 2), mPointSpriteVertexBuffer(), mPointSpriteIndexBuffer()
{
- mCurrentAttributes.reserve(gl::MAX_VERTEX_ATTRIBS);
}
InputLayoutCache::~InputLayoutCache()
@@ -183,12 +121,10 @@ void InputLayoutCache::clear()
gl::Error InputLayoutCache::applyVertexBuffers(
Renderer11 *renderer,
const gl::State &state,
- const std::vector<TranslatedAttribute> &vertexArrayAttribs,
- const std::vector<TranslatedAttribute> &currentValueAttribs,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
GLenum mode,
GLint start,
- TranslatedIndexData *indexInfo,
- GLsizei numIndicesPerInstance)
+ TranslatedIndexData *indexInfo)
{
ID3D11DeviceContext *deviceContext = renderer->getDeviceContext();
auto *stateManager = renderer->getStateManager();
@@ -199,30 +135,6 @@ gl::Error InputLayoutCache::applyVertexBuffers(
bool programUsesInstancedPointSprites = programD3D->usesPointSize() && programD3D->usesInstancedPointSpriteEmulation();
bool instancedPointSpritesActive = programUsesInstancedPointSprites && (mode == GL_POINTS);
- AttribIndexArray sortedSemanticIndices;
- SortAttributesByLayout(program, vertexArrayAttribs, currentValueAttribs, &sortedSemanticIndices,
- &mCurrentAttributes);
-
- auto featureLevel = renderer->getRenderer11DeviceCaps().featureLevel;
-
- // If we are using FL 9_3, make sure the first attribute is not instanced
- if (featureLevel <= D3D_FEATURE_LEVEL_9_3 && !mCurrentAttributes.empty())
- {
- if (mCurrentAttributes[0]->divisor > 0)
- {
- Optional<size_t> firstNonInstancedIndex = FindFirstNonInstanced(mCurrentAttributes);
- if (firstNonInstancedIndex.valid())
- {
- size_t index = firstNonInstancedIndex.value();
- std::swap(mCurrentAttributes[0], mCurrentAttributes[index]);
- std::swap(sortedSemanticIndices[0], sortedSemanticIndices[index]);
- }
- }
- }
-
- ANGLE_TRY(
- updateInputLayout(renderer, state, mode, sortedSemanticIndices, numIndicesPerInstance));
-
// Note that if we use instance emulation, we reserve the first buffer slot.
size_t reservedBuffers = GetReservedBufferCount(programUsesInstancedPointSprites);
@@ -233,9 +145,9 @@ gl::Error InputLayoutCache::applyVertexBuffers(
UINT vertexStride = 0;
UINT vertexOffset = 0;
- if (attribIndex < mCurrentAttributes.size())
+ if (attribIndex < currentAttributes.size())
{
- const auto &attrib = *mCurrentAttributes[attribIndex];
+ const auto &attrib = *currentAttributes[attribIndex];
Buffer11 *bufferStorage = attrib.storage ? GetAs<Buffer11>(attrib.storage) : nullptr;
// If indexed pointsprite emulation is active, then we need to take a less efficent code path.
@@ -357,16 +269,18 @@ gl::Error InputLayoutCache::applyVertexBuffers(
return gl::NoError();
}
-gl::Error InputLayoutCache::updateVertexOffsetsForPointSpritesEmulation(Renderer11 *renderer,
- GLint startVertex,
- GLsizei emulatedInstanceId)
+gl::Error InputLayoutCache::updateVertexOffsetsForPointSpritesEmulation(
+ Renderer11 *renderer,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
+ GLint startVertex,
+ GLsizei emulatedInstanceId)
{
auto *stateManager = renderer->getStateManager();
size_t reservedBuffers = GetReservedBufferCount(true);
- for (size_t attribIndex = 0; attribIndex < mCurrentAttributes.size(); ++attribIndex)
+ for (size_t attribIndex = 0; attribIndex < currentAttributes.size(); ++attribIndex)
{
- const auto &attrib = *mCurrentAttributes[attribIndex];
+ const auto &attrib = *currentAttributes[attribIndex];
size_t bufferIndex = reservedBuffers + attribIndex;
if (attrib.divisor > 0)
@@ -382,11 +296,13 @@ gl::Error InputLayoutCache::updateVertexOffsetsForPointSpritesEmulation(Renderer
return gl::NoError();
}
-gl::Error InputLayoutCache::updateInputLayout(Renderer11 *renderer,
- const gl::State &state,
- GLenum mode,
- const AttribIndexArray &sortedSemanticIndices,
- GLsizei numIndicesPerInstance)
+gl::Error InputLayoutCache::updateInputLayout(
+ Renderer11 *renderer,
+ const gl::State &state,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
+ GLenum mode,
+ const AttribIndexArray &sortedSemanticIndices,
+ GLsizei numIndicesPerInstance)
{
gl::Program *program = state.getProgram();
const auto &shaderAttributes = program->getAttributes();
@@ -447,8 +363,8 @@ gl::Error InputLayoutCache::updateInputLayout(Renderer11 *renderer,
angle::TrimCache(mLayoutCache.max_size() / 2, kGCLimit, "input layout", &mLayoutCache);
d3d11::InputLayout newInputLayout;
- ANGLE_TRY(createInputLayout(renderer, sortedSemanticIndices, mode, program,
- numIndicesPerInstance, &newInputLayout));
+ ANGLE_TRY(createInputLayout(renderer, sortedSemanticIndices, currentAttributes, mode,
+ program, numIndicesPerInstance, &newInputLayout));
auto insertIt = mLayoutCache.Put(layout, std::move(newInputLayout));
inputLayout = &insertIt->second;
@@ -459,12 +375,14 @@ gl::Error InputLayoutCache::updateInputLayout(Renderer11 *renderer,
return gl::NoError();
}
-gl::Error InputLayoutCache::createInputLayout(Renderer11 *renderer,
- const AttribIndexArray &sortedSemanticIndices,
- GLenum mode,
- gl::Program *program,
- GLsizei numIndicesPerInstance,
- d3d11::InputLayout *inputLayoutOut)
+gl::Error InputLayoutCache::createInputLayout(
+ Renderer11 *renderer,
+ const AttribIndexArray &sortedSemanticIndices,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
+ GLenum mode,
+ gl::Program *program,
+ GLsizei numIndicesPerInstance,
+ d3d11::InputLayout *inputLayoutOut)
{
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program);
auto featureLevel = renderer->getRenderer11DeviceCaps().featureLevel;
@@ -475,9 +393,9 @@ gl::Error InputLayoutCache::createInputLayout(Renderer11 *renderer,
unsigned int inputElementCount = 0;
std::array<D3D11_INPUT_ELEMENT_DESC, gl::MAX_VERTEX_ATTRIBS> inputElements;
- for (size_t attribIndex = 0; attribIndex < mCurrentAttributes.size(); ++attribIndex)
+ for (size_t attribIndex = 0; attribIndex < currentAttributes.size(); ++attribIndex)
{
- const auto &attrib = *mCurrentAttributes[attribIndex];
+ const auto &attrib = *currentAttributes[attribIndex];
const int sortedIndex = sortedSemanticIndices[attribIndex];
D3D11_INPUT_CLASSIFICATION inputClass =
@@ -520,7 +438,7 @@ gl::Error InputLayoutCache::createInputLayout(Renderer11 *renderer,
{
inputElements[elementIndex].InputSlotClass = D3D11_INPUT_PER_INSTANCE_DATA;
inputElements[elementIndex].InstanceDataStepRate = 1;
- if (numIndicesPerInstance > 0 && mCurrentAttributes[elementIndex]->divisor > 0)
+ if (numIndicesPerInstance > 0 && currentAttributes[elementIndex]->divisor > 0)
{
inputElements[elementIndex].InstanceDataStepRate = numIndicesPerInstance;
}
@@ -547,10 +465,8 @@ gl::Error InputLayoutCache::createInputLayout(Renderer11 *renderer,
inputElementCount++;
}
- const gl::InputLayout &shaderInputLayout = GetInputLayout(mCurrentAttributes);
-
ShaderExecutableD3D *shader = nullptr;
- ANGLE_TRY(programD3D->getVertexExecutableForInputLayout(shaderInputLayout, &shader, nullptr));
+ ANGLE_TRY(programD3D->getVertexExecutableForCachedInputLayout(&shader, nullptr));
ShaderExecutableD3D *shader11 = GetAs<ShaderExecutable11>(shader);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h
index b8b29ebcac7..e559b602a42 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h
@@ -87,28 +87,31 @@ class InputLayoutCache : angle::NonCopyable
gl::Error applyVertexBuffers(Renderer11 *renderer,
const gl::State &state,
- const std::vector<TranslatedAttribute> &vertexArrayAttribs,
- const std::vector<TranslatedAttribute> &currentValueAttribs,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
GLenum mode,
GLint start,
- TranslatedIndexData *indexInfo,
- GLsizei numIndicesPerInstance);
+ TranslatedIndexData *indexInfo);
- gl::Error updateVertexOffsetsForPointSpritesEmulation(Renderer11 *renderer,
- GLint startVertex,
- GLsizei emulatedInstanceId);
+ gl::Error updateVertexOffsetsForPointSpritesEmulation(
+ Renderer11 *renderer,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
+ GLint startVertex,
+ GLsizei emulatedInstanceId);
// Useful for testing
void setCacheSize(size_t newCacheSize);
- private:
gl::Error updateInputLayout(Renderer11 *renderer,
const gl::State &state,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
GLenum mode,
const AttribIndexArray &sortedSemanticIndices,
GLsizei numIndicesPerInstance);
+
+ private:
gl::Error createInputLayout(Renderer11 *renderer,
const AttribIndexArray &sortedSemanticIndices,
+ const std::vector<const TranslatedAttribute *> &currentAttributes,
GLenum mode,
gl::Program *program,
GLsizei numIndicesPerInstance,
@@ -123,8 +126,6 @@ class InputLayoutCache : angle::NonCopyable
using LayoutCache = angle::base::HashingMRUCache<PackedAttributeLayout, d3d11::InputLayout>;
LayoutCache mLayoutCache;
- std::vector<const TranslatedAttribute *> mCurrentAttributes;
-
d3d11::Buffer mPointSpriteVertexBuffer;
d3d11::Buffer mPointSpriteIndexBuffer;
};
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 45e7706bd33..3df27b032b9 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
@@ -360,20 +360,32 @@ void GetTriFanIndices(const void *indices,
}
}
-int GetWrapBits(GLenum wrap)
+bool DrawCallNeedsTranslation(const gl::Context *context, GLenum mode, GLenum type)
{
- switch (wrap)
+ const auto &glState = context->getGLState();
+ const auto &vertexArray = glState.getVertexArray();
+ auto *vertexArray11 = GetImplAs<VertexArray11>(vertexArray);
+ // Direct 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(context) || mode == GL_LINE_LOOP || mode == GL_TRIANGLE_FAN)
{
- case GL_CLAMP_TO_EDGE:
- return 0x1;
- case GL_REPEAT:
- return 0x2;
- case GL_MIRRORED_REPEAT:
- return 0x3;
- default:
- UNREACHABLE();
- return 0;
+ return true;
+ }
+
+ ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
+ if (InstancedPointSpritesActive(programD3D, mode))
+ {
+ return true;
}
+
+ if (type != GL_NONE)
+ {
+ // Only non-streaming index data can be directly used to draw since they don't
+ // need the indices and count informations.
+ return IndexDataManager::IsStreamingIndexData(context, type, RENDERER_D3D11);
+ }
+ return false;
}
const uint32_t ScratchMemoryBufferLifetime = 1000;
@@ -391,12 +403,8 @@ Renderer11::Renderer11(egl::Display *display)
mScratchMemoryBuffer(ScratchMemoryBufferLifetime),
mAnnotator(nullptr)
{
- mVertexDataManager = nullptr;
- mIndexDataManager = nullptr;
-
mLineLoopIB = nullptr;
mTriangleFanIB = nullptr;
- mAppliedIBChanged = false;
mBlit = nullptr;
mPixelTransfer = nullptr;
@@ -671,7 +679,7 @@ egl::Error Renderer11::initialize()
mDebug = d3d11::DynamicCastComObject<ID3D11Debug>(mDevice);
#endif
- initializeDevice();
+ ANGLE_TRY(initializeDevice());
return egl::NoError();
}
@@ -778,7 +786,7 @@ egl::Error Renderer11::initializeD3DDevice()
// do any one-time device initialization
// NOTE: this is also needed after a device lost/reset
// to reset the scene status and ensure the default states are reset.
-void Renderer11::initializeDevice()
+egl::Error Renderer11::initializeDevice()
{
SCOPED_ANGLE_HISTOGRAM_TIMER("GPU.ANGLE.Renderer11InitializeDeviceMS");
TRACE_EVENT0("gpu.angle", "Renderer11::initializeDevice");
@@ -787,10 +795,6 @@ void Renderer11::initializeDevice()
mStateCache.clear();
- ASSERT(!mVertexDataManager && !mIndexDataManager);
- mVertexDataManager = new VertexDataManager(this);
- mIndexDataManager = new IndexDataManager(this, getRendererClass());
-
ASSERT(!mBlit);
mBlit = new Blit11(this);
@@ -815,21 +819,10 @@ void Renderer11::initializeDevice()
const gl::Caps &rendererCaps = getNativeCaps();
- mStateManager.initialize(rendererCaps);
-
- mForceSetVertexSamplerStates.resize(rendererCaps.maxVertexTextureImageUnits);
- mCurVertexSamplerStates.resize(rendererCaps.maxVertexTextureImageUnits);
- mSamplerMetadataVS.initData(rendererCaps.maxVertexTextureImageUnits);
-
- mForceSetPixelSamplerStates.resize(rendererCaps.maxTextureImageUnits);
- mCurPixelSamplerStates.resize(rendererCaps.maxTextureImageUnits);
- mSamplerMetadataPS.initData(rendererCaps.maxTextureImageUnits);
-
- mForceSetComputeSamplerStates.resize(rendererCaps.maxComputeTextureImageUnits);
- mCurComputeSamplerStates.resize(rendererCaps.maxComputeTextureImageUnits);
- mSamplerMetadataCS.initData(rendererCaps.maxComputeTextureImageUnits);
-
- mStateManager.initialize(rendererCaps);
+ if (mStateManager.initialize(rendererCaps).isError())
+ {
+ return egl::EglBadAlloc() << "Error initializing state manager.";
+ }
// No context is available here, use the proxy context in the display.
markAllStateDirty(mDisplay->getProxyContext());
@@ -850,6 +843,8 @@ void Renderer11::initializeDevice()
ANGLE_HISTOGRAM_ENUMERATION("GPU.ANGLE.D3D11FeatureLevel", angleFeatureLevel,
NUM_ANGLE_FEATURE_LEVELS);
+
+ return egl::NoError();
}
void Renderer11::populateRenderer11DeviceCaps()
@@ -979,7 +974,7 @@ egl::ConfigSet Renderer11::generateConfigs()
}
static const GLenum depthStencilBufferFormats[] = {
- GL_NONE, GL_DEPTH24_STENCIL8_OES, GL_DEPTH_COMPONENT16,
+ GL_NONE, GL_DEPTH24_STENCIL8_OES, GL_DEPTH_COMPONENT16, GL_STENCIL_INDEX8,
};
const gl::Caps &rendererCaps = getNativeCaps();
@@ -1404,134 +1399,6 @@ gl::Error Renderer11::generateSwizzles(const gl::Context *context)
ANGLE_TRY(generateSwizzles(context, gl::SAMPLER_PIXEL));
return gl::NoError();
}
-gl::Error Renderer11::setSamplerState(const gl::Context *context,
- gl::SamplerType type,
- int index,
- gl::Texture *texture,
- const gl::SamplerState &samplerState)
-{
-#if !defined(NDEBUG)
- // Make sure to add the level offset for our tiny compressed texture workaround
- TextureD3D *textureD3D = GetImplAs<TextureD3D>(texture);
-
- TextureStorage *storage = nullptr;
- ANGLE_TRY(textureD3D->getNativeTexture(context, &storage));
-
- // Storage should exist, texture should be complete
- ASSERT(storage);
-#endif // !defined(NDEBUG)
-
- // Sampler metadata that's passed to shaders in uniforms is stored separately from rest of the
- // sampler state since having it in contiguous memory makes it possible to memcpy to a constant
- // buffer, and it doesn't affect the state set by PSSetSamplers/VSSetSamplers.
- SamplerMetadataD3D11 *metadata = nullptr;
-
- if (type == gl::SAMPLER_PIXEL)
- {
- ASSERT(static_cast<unsigned int>(index) < getNativeCaps().maxTextureImageUnits);
-
- if (mForceSetPixelSamplerStates[index] ||
- memcmp(&samplerState, &mCurPixelSamplerStates[index], sizeof(gl::SamplerState)) != 0)
- {
- ID3D11SamplerState *dxSamplerState = nullptr;
- ANGLE_TRY(mStateCache.getSamplerState(this, samplerState, &dxSamplerState));
-
- ASSERT(dxSamplerState != nullptr);
- mDeviceContext->PSSetSamplers(index, 1, &dxSamplerState);
-
- mCurPixelSamplerStates[index] = samplerState;
- }
-
- mForceSetPixelSamplerStates[index] = false;
-
- metadata = &mSamplerMetadataPS;
- }
- else if (type == gl::SAMPLER_VERTEX)
- {
- ASSERT(static_cast<unsigned int>(index) < getNativeCaps().maxVertexTextureImageUnits);
-
- if (mForceSetVertexSamplerStates[index] ||
- memcmp(&samplerState, &mCurVertexSamplerStates[index], sizeof(gl::SamplerState)) != 0)
- {
- ID3D11SamplerState *dxSamplerState = nullptr;
- ANGLE_TRY(mStateCache.getSamplerState(this, samplerState, &dxSamplerState));
-
- ASSERT(dxSamplerState != nullptr);
- mDeviceContext->VSSetSamplers(index, 1, &dxSamplerState);
-
- mCurVertexSamplerStates[index] = samplerState;
- }
-
- mForceSetVertexSamplerStates[index] = false;
-
- metadata = &mSamplerMetadataVS;
- }
- else if (type == gl::SAMPLER_COMPUTE)
- {
- ASSERT(static_cast<unsigned int>(index) < getNativeCaps().maxComputeTextureImageUnits);
-
- if (mForceSetComputeSamplerStates[index] ||
- memcmp(&samplerState, &mCurComputeSamplerStates[index], sizeof(gl::SamplerState)) != 0)
- {
- ID3D11SamplerState *dxSamplerState = nullptr;
- ANGLE_TRY(mStateCache.getSamplerState(this, samplerState, &dxSamplerState));
-
- ASSERT(dxSamplerState != nullptr);
- mDeviceContext->CSSetSamplers(index, 1, &dxSamplerState);
-
- mCurComputeSamplerStates[index] = samplerState;
- }
-
- mForceSetComputeSamplerStates[index] = false;
-
- metadata = &mSamplerMetadataCS;
- }
- else
- UNREACHABLE();
-
- ASSERT(metadata != nullptr);
- metadata->update(index, *texture);
-
- return gl::NoError();
-}
-
-gl::Error Renderer11::setTexture(const gl::Context *context,
- gl::SamplerType type,
- int index,
- gl::Texture *texture)
-{
- const d3d11::SharedSRV *textureSRV = nullptr;
-
- if (texture)
- {
- TextureD3D *textureImpl = GetImplAs<TextureD3D>(texture);
-
- TextureStorage *texStorage = nullptr;
- ANGLE_TRY(textureImpl->getNativeTexture(context, &texStorage));
-
- // Texture should be complete and have a storage
- ASSERT(texStorage);
-
- TextureStorage11 *storage11 = GetAs<TextureStorage11>(texStorage);
-
- ANGLE_TRY(storage11->getSRV(context, texture->getTextureState(), &textureSRV));
-
- // If we get an invalid SRV here, something went wrong in the texture class and we're
- // unexpectedly missing the shader resource view.
- ASSERT(textureSRV->valid());
-
- textureImpl->resetDirty();
- }
-
- ASSERT((type == gl::SAMPLER_PIXEL &&
- static_cast<unsigned int>(index) < getNativeCaps().maxTextureImageUnits) ||
- (type == gl::SAMPLER_VERTEX &&
- static_cast<unsigned int>(index) < getNativeCaps().maxVertexTextureImageUnits));
-
- mStateManager.setShaderResource(type, index, textureSRV->get());
-
- return gl::NoError();
-}
gl::Error Renderer11::setUniformBuffers(const gl::ContextState &data,
const std::vector<GLint> &vertexUniformBuffers,
@@ -1715,94 +1582,6 @@ bool Renderer11::applyPrimitiveType(GLenum mode, GLsizei count, bool usesPointSi
return count >= minCount;
}
-gl::Error Renderer11::applyVertexBuffer(const gl::Context *context,
- GLenum mode,
- GLint first,
- GLsizei count,
- GLsizei instances,
- TranslatedIndexData *indexInfo)
-{
- const auto &state = context->getGLState();
- const auto &vertexArray = state.getVertexArray();
- auto *vertexArray11 = GetImplAs<VertexArray11>(vertexArray);
-
- ANGLE_TRY(vertexArray11->updateDirtyAndDynamicAttribs(context, mVertexDataManager, first, count,
- instances));
-
- ANGLE_TRY(mStateManager.updateCurrentValueAttribs(state, mVertexDataManager));
-
- // If index information is passed, mark it with the current changed status.
- if (indexInfo)
- {
- indexInfo->srcIndexData.srcIndicesChanged = mAppliedIBChanged;
- }
-
- GLsizei numIndicesPerInstance = 0;
- if (instances > 0)
- {
- numIndicesPerInstance = count;
- }
- const auto &vertexArrayAttribs = vertexArray11->getTranslatedAttribs();
- const auto &currentValueAttribs = mStateManager.getCurrentValueAttribs();
- ANGLE_TRY(mInputLayoutCache.applyVertexBuffers(this, state, vertexArrayAttribs,
- currentValueAttribs, mode, first, indexInfo,
- numIndicesPerInstance));
-
- // InputLayoutCache::applyVertexBuffers calls through to the Bufer11 to get the native vertex
- // buffer (ID3D11Buffer *). Because we allocate these buffers lazily, this will trigger
- // allocation. This in turn will signal that the buffer is dirty. Since we just resolved the
- // dirty-ness in VertexArray11::updateDirtyAndDynamicAttribs, this can make us do a needless
- // update on the second draw call.
- // Hence we clear the flags here, after we've applied vertex data, since we know everything
- // is clean. This is a bit of a hack.
- vertexArray11->clearDirtyAndPromoteDynamicAttribs(state, count);
-
- return gl::NoError();
-}
-
-gl::Error Renderer11::applyIndexBuffer(const gl::ContextState &data,
- const void *indices,
- GLsizei count,
- GLenum mode,
- GLenum type,
- TranslatedIndexData *indexInfo)
-{
- const auto &glState = data.getState();
- gl::VertexArray *vao = glState.getVertexArray();
- gl::Buffer *elementArrayBuffer = vao->getElementArrayBuffer().get();
- ANGLE_TRY(mIndexDataManager->prepareIndexData(type, count, elementArrayBuffer, indices,
- indexInfo, glState.isPrimitiveRestartEnabled()));
-
- ID3D11Buffer *buffer = nullptr;
- DXGI_FORMAT bufferFormat =
- (indexInfo->indexType == GL_UNSIGNED_INT) ? DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT;
-
- if (indexInfo->storage)
- {
- Buffer11 *storage = GetAs<Buffer11>(indexInfo->storage);
- ANGLE_TRY_RESULT(storage->getBuffer(BUFFER_USAGE_INDEX), buffer);
- }
- else
- {
- IndexBuffer11 *indexBuffer = GetAs<IndexBuffer11>(indexInfo->indexBuffer);
- buffer = indexBuffer->getBuffer().get();
- }
-
- mAppliedIBChanged = false;
- if (buffer != mAppliedIB || bufferFormat != mAppliedIBFormat ||
- indexInfo->startOffset != mAppliedIBOffset)
- {
- mDeviceContext->IASetIndexBuffer(buffer, bufferFormat, indexInfo->startOffset);
-
- mAppliedIB = buffer;
- mAppliedIBFormat = bufferFormat;
- mAppliedIBOffset = indexInfo->startOffset;
- mAppliedIBChanged = true;
- }
-
- return gl::NoError();
-}
-
gl::Error Renderer11::applyTransformFeedbackBuffers(const gl::ContextState &data)
{
const auto &state = data.getState();
@@ -1867,8 +1646,7 @@ gl::Error Renderer11::drawArraysImpl(const gl::Context *context,
}
rx::ShaderExecutableD3D *pixelExe = nullptr;
- ANGLE_TRY(programD3D->getPixelExecutableForFramebuffer(
- context, glState.getDrawFramebuffer(), &pixelExe));
+ ANGLE_TRY(programD3D->getPixelExecutableForCachedOutputLayout(&pixelExe, nullptr));
// Skip the draw call if rasterizer discard is enabled (or no fragment shader).
if (!pixelExe || glState.getRasterizerState().rasterizerDiscard)
@@ -1910,24 +1688,11 @@ gl::Error Renderer11::drawArraysImpl(const gl::Context *context,
bool useInstancedPointSpriteEmulation =
programD3D->usesPointSize() && getWorkarounds().useInstancedPointSpriteEmulation;
- if (instances > 0)
+ if (mode != GL_POINTS || !useInstancedPointSpriteEmulation)
{
- if (mode == GL_POINTS && useInstancedPointSpriteEmulation)
+ if (instances == 0)
{
- // If pointsprite emulation is used with glDrawArraysInstanced then we need to take a
- // less efficent code path.
- // Instanced rendering of emulated pointsprites requires a loop to draw each batch of
- // points. An offset into the instanced data buffer is calculated and applied on each
- // iteration to ensure all instances are rendered correctly.
-
- // Each instance being rendered requires the inputlayout cache to reapply buffers and
- // offsets.
- for (GLsizei i = 0; i < instances; i++)
- {
- ANGLE_TRY(mInputLayoutCache.updateVertexOffsetsForPointSpritesEmulation(
- this, startVertex, i));
- mDeviceContext->DrawIndexedInstanced(6, count, 0, 0, 0);
- }
+ mDeviceContext->Draw(count, 0);
}
else
{
@@ -1939,25 +1704,66 @@ gl::Error Renderer11::drawArraysImpl(const gl::Context *context,
// If the shader is writing to gl_PointSize, then pointsprites are being rendered.
// Emulating instanced point sprites for FL9_3 requires the topology to be
// D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST and DrawIndexedInstanced is called instead.
- if (mode == GL_POINTS && useInstancedPointSpriteEmulation)
+ if (instances == 0)
{
mDeviceContext->DrawIndexedInstanced(6, count, 0, 0, 0);
+ return gl::NoError();
}
- else
+
+ // If pointsprite emulation is used with glDrawArraysInstanced then we need to take a less
+ // efficent code path. Instanced rendering of emulated pointsprites requires a loop to draw each
+ // batch of points. An offset into the instanced data buffer is calculated and applied on each
+ // iteration to ensure all instances are rendered correctly. Each instance being rendered
+ // requires the inputlayout cache to reapply buffers and offsets.
+ for (GLsizei i = 0; i < instances; i++)
{
- mDeviceContext->Draw(count, 0);
+ ANGLE_TRY(mStateManager.updateVertexOffsetsForPointSpritesEmulation(startVertex, i));
+ mDeviceContext->DrawIndexedInstanced(6, count, 0, 0, 0);
}
+
+ // This required by updateVertexOffsets... above but is outside of the loop for speed.
+ mStateManager.invalidateVertexBuffer();
return gl::NoError();
}
-gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data,
- const TranslatedIndexData &indexInfo,
+gl::Error Renderer11::drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
GLsizei instances)
{
+ const auto &data = context->getContextState();
+ TranslatedIndexData indexInfo;
+
+ if (!DrawCallNeedsTranslation(context, mode, type))
+ {
+ ANGLE_TRY(mStateManager.applyIndexBuffer(data, nullptr, 0, type, &indexInfo));
+ ANGLE_TRY(mStateManager.applyVertexBuffer(context, mode, 0, 0, 0, &indexInfo));
+ const gl::Type &typeInfo = gl::GetTypeInfo(type);
+ unsigned int startIndexLocation =
+ static_cast<unsigned int>(reinterpret_cast<const uintptr_t>(indices)) / typeInfo.bytes;
+ if (instances > 0)
+ {
+ mDeviceContext->DrawIndexedInstanced(count, instances, startIndexLocation, 0, 0);
+ }
+ else
+ {
+ mDeviceContext->DrawIndexed(count, startIndexLocation, 0);
+ }
+ return gl::NoError();
+ }
+
+ const gl::IndexRange &indexRange =
+ context->getParams<gl::HasIndexRange>().getIndexRange().value();
+ indexInfo.indexRange = indexRange;
+
+ ANGLE_TRY(mStateManager.applyIndexBuffer(data, indices, count, type, &indexInfo));
+ size_t vertexCount = indexInfo.indexRange.vertexCount();
+ ANGLE_TRY(mStateManager.applyVertexBuffer(
+ context, mode, static_cast<GLsizei>(indexInfo.indexRange.start),
+ static_cast<GLsizei>(vertexCount), instances, &indexInfo));
+
int startVertex = static_cast<int>(indexInfo.indexRange.start);
int baseVertex = -startVertex;
@@ -1972,25 +1778,12 @@ gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data,
}
const ProgramD3D *programD3D = GetImplAs<ProgramD3D>(data.getState().getProgram());
- if (instances > 0)
+
+ if (mode != GL_POINTS || !programD3D->usesInstancedPointSpriteEmulation())
{
- if (mode == GL_POINTS && programD3D->usesInstancedPointSpriteEmulation())
+ if (instances == 0)
{
- // If pointsprite emulation is used with glDrawElementsInstanced then we need to take a
- // less efficent code path.
- // Instanced rendering of emulated pointsprites requires a loop to draw each batch of
- // points. An offset into the instanced data buffer is calculated and applied on each
- // iteration to ensure all instances are rendered correctly.
- GLsizei elementsToRender = static_cast<GLsizei>(indexInfo.indexRange.vertexCount());
-
- // Each instance being rendered requires the inputlayout cache to reapply buffers and
- // offsets.
- for (GLsizei i = 0; i < instances; i++)
- {
- ANGLE_TRY(mInputLayoutCache.updateVertexOffsetsForPointSpritesEmulation(
- this, startVertex, i));
- mDeviceContext->DrawIndexedInstanced(6, elementsToRender, 0, 0, 0);
- }
+ mDeviceContext->DrawIndexed(count, 0, baseVertex);
}
else
{
@@ -2002,52 +1795,33 @@ gl::Error Renderer11::drawElementsImpl(const gl::ContextState &data,
// If the shader is writing to gl_PointSize, then pointsprites are being rendered.
// Emulating instanced point sprites for FL9_3 requires the topology to be
// D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST and DrawIndexedInstanced is called instead.
- if (mode == GL_POINTS && programD3D->usesInstancedPointSpriteEmulation())
- {
- // The count parameter passed to drawElements represents the total number of instances
- // to be rendered. Each instance is referenced by the bound index buffer from the
- // the caller.
- //
- // Indexed pointsprite emulation replicates data for duplicate entries found
- // in the index buffer.
- // This is not an efficent rendering mechanism and is only used on downlevel renderers
- // that do not support geometry shaders.
- mDeviceContext->DrawIndexedInstanced(6, count, 0, 0, 0);
- }
- else
+ //
+ // The count parameter passed to drawElements represents the total number of instances to be
+ // rendered. Each instance is referenced by the bound index buffer from the the caller.
+ //
+ // Indexed pointsprite emulation replicates data for duplicate entries found in the index
+ // buffer. This is not an efficent rendering mechanism and is only used on downlevel renderers
+ // that do not support geometry shaders.
+ if (instances == 0)
{
- mDeviceContext->DrawIndexed(count, 0, baseVertex);
+ mDeviceContext->DrawIndexedInstanced(6, count, 0, 0, 0);
+ return gl::NoError();
}
- return gl::NoError();
-}
-bool Renderer11::supportsFastIndirectDraw(const gl::Context *context, GLenum mode, GLenum type)
-{
- const auto &glState = context->getGLState();
- const auto &vertexArray = glState.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(context) || mode == GL_LINE_LOOP || mode == GL_TRIANGLE_FAN)
- {
- return false;
- }
+ // If pointsprite emulation is used with glDrawElementsInstanced then we need to take a less
+ // efficent code path. Instanced rendering of emulated pointsprites requires a loop to draw each
+ // batch of points. An offset into the instanced data buffer is calculated and applied on each
+ // iteration to ensure all instances are rendered correctly.
+ GLsizei elementsToRender = static_cast<GLsizei>(indexInfo.indexRange.vertexCount());
- if (type != GL_NONE)
+ // Each instance being rendered requires the inputlayout cache to reapply buffers and offsets.
+ for (GLsizei i = 0; i < instances; i++)
{
- 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(
- glState.isPrimitiveRestartEnabled(), type);
- return !mIndexDataManager->isStreamingIndexData(primitiveRestartWorkaround, type,
- elementArrayBuffer);
+ ANGLE_TRY(mStateManager.updateVertexOffsetsForPointSpritesEmulation(startVertex, i));
+ mDeviceContext->DrawIndexedInstanced(6, elementsToRender, 0, 0, 0);
}
- return true;
+ mStateManager.invalidateVertexBuffer();
+ return gl::NoError();
}
gl::Error Renderer11::drawArraysIndirectImpl(const gl::Context *context,
@@ -2066,9 +1840,9 @@ gl::Error Renderer11::drawArraysIndirectImpl(const gl::Context *context,
Buffer11 *storage = GetImplAs<Buffer11>(drawIndirectBuffer);
uintptr_t offset = reinterpret_cast<uintptr_t>(indirect);
- if (supportsFastIndirectDraw(context, mode, GL_NONE))
+ if (!DrawCallNeedsTranslation(context, mode, GL_NONE))
{
- applyVertexBuffer(context, mode, 0, 0, 0, nullptr);
+ mStateManager.applyVertexBuffer(context, 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));
@@ -2084,7 +1858,7 @@ gl::Error Renderer11::drawArraysIndirectImpl(const gl::Context *context,
GLuint instances = args->instanceCount;
GLuint first = args->first;
- ANGLE_TRY(applyVertexBuffer(context, mode, first, count, instances, nullptr));
+ ANGLE_TRY(mStateManager.applyVertexBuffer(context, mode, first, count, instances, nullptr));
if (mode == GL_LINE_LOOP)
{
@@ -2117,10 +1891,10 @@ gl::Error Renderer11::drawElementsIndirectImpl(const gl::Context *context,
uintptr_t offset = reinterpret_cast<uintptr_t>(indirect);
TranslatedIndexData indexInfo;
- if (supportsFastIndirectDraw(context, mode, type))
+ if (!DrawCallNeedsTranslation(context, mode, type))
{
- ANGLE_TRY(applyIndexBuffer(contextState, nullptr, 0, mode, type, &indexInfo));
- ANGLE_TRY(applyVertexBuffer(context, mode, 0, 0, 0, &indexInfo));
+ ANGLE_TRY(mStateManager.applyIndexBuffer(contextState, nullptr, 0, type, &indexInfo));
+ ANGLE_TRY(mStateManager.applyVertexBuffer(context, 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));
@@ -2148,10 +1922,11 @@ gl::Error Renderer11::drawElementsIndirectImpl(const gl::Context *context,
glState.isPrimitiveRestartEnabled(), &indexRange));
indexInfo.indexRange = indexRange;
- ANGLE_TRY(applyIndexBuffer(contextState, indices, count, mode, type, &indexInfo));
+ ANGLE_TRY(mStateManager.applyIndexBuffer(contextState, indices, count, type, &indexInfo));
size_t vertexCount = indexRange.vertexCount();
- ANGLE_TRY(applyVertexBuffer(context, mode, static_cast<GLsizei>(indexRange.start) + baseVertex,
- static_cast<GLsizei>(vertexCount), instances, &indexInfo));
+ ANGLE_TRY(mStateManager.applyVertexBuffer(
+ context, 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)
@@ -2236,14 +2011,7 @@ gl::Error Renderer11::drawLineLoop(const gl::ContextState &data,
const d3d11::Buffer &d3dIndexBuffer = indexBuffer->getBuffer();
DXGI_FORMAT indexFormat = indexBuffer->getIndexFormat();
- if (mAppliedIB != d3dIndexBuffer.get() || mAppliedIBFormat != indexFormat ||
- mAppliedIBOffset != offset)
- {
- mDeviceContext->IASetIndexBuffer(d3dIndexBuffer.get(), indexFormat, offset);
- mAppliedIB = d3dIndexBuffer.get();
- mAppliedIBFormat = indexFormat;
- mAppliedIBOffset = offset;
- }
+ mStateManager.setIndexBuffer(d3dIndexBuffer.get(), indexFormat, offset, false);
UINT indexCount = static_cast<UINT>(mScratchIndexDataBuffer.size());
@@ -2325,14 +2093,7 @@ gl::Error Renderer11::drawTriangleFan(const gl::ContextState &data,
const d3d11::Buffer &d3dIndexBuffer = indexBuffer->getBuffer();
DXGI_FORMAT indexFormat = indexBuffer->getIndexFormat();
- if (mAppliedIB != d3dIndexBuffer.get() || mAppliedIBFormat != indexFormat ||
- mAppliedIBOffset != offset)
- {
- mDeviceContext->IASetIndexBuffer(d3dIndexBuffer.get(), indexFormat, offset);
- mAppliedIB = d3dIndexBuffer.get();
- mAppliedIBFormat = indexFormat;
- mAppliedIBOffset = offset;
- }
+ mStateManager.setIndexBuffer(d3dIndexBuffer.get(), indexFormat, offset, false);
UINT indexCount = static_cast<UINT>(mScratchIndexDataBuffer.size());
@@ -2348,56 +2109,7 @@ gl::Error Renderer11::drawTriangleFan(const gl::ContextState &data,
return gl::NoError();
}
-gl::Error Renderer11::applyShaders(const gl::Context *context, GLenum drawMode)
-{
- // This method is called single-threaded.
- ANGLE_TRY(ensureHLSLCompilerInitialized());
-
- const auto &data = context->getContextState();
- const auto &glState = data.getState();
- ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
- programD3D->updateCachedInputLayout(glState);
-
- const auto &inputLayout = programD3D->getCachedInputLayout();
-
- ShaderExecutableD3D *vertexExe = nullptr;
- ANGLE_TRY(programD3D->getVertexExecutableForInputLayout(inputLayout, &vertexExe, nullptr));
-
- const gl::Framebuffer *drawFramebuffer = glState.getDrawFramebuffer();
- ShaderExecutableD3D *pixelExe = nullptr;
- ANGLE_TRY(programD3D->getPixelExecutableForFramebuffer(context, drawFramebuffer, &pixelExe));
-
- ShaderExecutableD3D *geometryExe = nullptr;
- ANGLE_TRY(
- programD3D->getGeometryExecutableForPrimitiveType(data, drawMode, &geometryExe, nullptr));
-
- const d3d11::VertexShader *vertexShader =
- (vertexExe ? &GetAs<ShaderExecutable11>(vertexExe)->getVertexShader() : nullptr);
-
- // Skip pixel shader if we're doing rasterizer discard.
- const d3d11::PixelShader *pixelShader = nullptr;
- if (!glState.getRasterizerState().rasterizerDiscard)
- {
- pixelShader = (pixelExe ? &GetAs<ShaderExecutable11>(pixelExe)->getPixelShader() : nullptr);
- }
-
- const d3d11::GeometryShader *geometryShader = nullptr;
- if (glState.isTransformFeedbackActiveUnpaused())
- {
- geometryShader =
- (vertexExe ? &GetAs<ShaderExecutable11>(vertexExe)->getStreamOutShader() : nullptr);
- }
- else
- {
- geometryShader =
- (geometryExe ? &GetAs<ShaderExecutable11>(geometryExe)->getGeometryShader() : nullptr);
- }
-
- mStateManager.setDrawShaders(vertexShader, geometryShader, pixelShader);
-
- return programD3D->applyUniforms(drawMode);
-}
-
+// TODO(jmadill): Move to StateManager11.
gl::Error Renderer11::applyUniforms(const ProgramD3D &programD3D,
GLenum drawMode,
const std::vector<D3DUniform *> &uniformArray)
@@ -2505,12 +2217,15 @@ gl::Error Renderer11::applyUniforms(const ProgramD3D &programD3D,
mCurrentPixelConstantBuffer = reinterpret_cast<uintptr_t>(appliedPixelConstants);
}
+ auto *samplerMetadataVS = mStateManager.getVertexSamplerMetadata();
+ auto *samplerMetadataPS = mStateManager.getPixelSamplerMetadata();
+
if (!mDriverConstantBufferVS.valid())
{
D3D11_BUFFER_DESC constantBufferDescription = {0};
d3d11::InitConstantBufferDesc(
&constantBufferDescription,
- sizeof(dx_VertexConstants11) + mSamplerMetadataVS.sizeBytes());
+ sizeof(dx_VertexConstants11) + samplerMetadataVS->sizeBytes());
ANGLE_TRY(allocateResource(constantBufferDescription, &mDriverConstantBufferVS));
ID3D11Buffer *driverVSConstants = mDriverConstantBufferVS.get();
@@ -2522,7 +2237,7 @@ gl::Error Renderer11::applyUniforms(const ProgramD3D &programD3D,
{
D3D11_BUFFER_DESC constantBufferDescription = {0};
d3d11::InitConstantBufferDesc(&constantBufferDescription,
- sizeof(dx_PixelConstants11) + mSamplerMetadataPS.sizeBytes());
+ sizeof(dx_PixelConstants11) + samplerMetadataPS->sizeBytes());
ANGLE_TRY(allocateResource(constantBufferDescription, &mDriverConstantBufferPS));
ID3D11Buffer *driverVSConstants = mDriverConstantBufferPS.get();
@@ -2533,15 +2248,15 @@ gl::Error Renderer11::applyUniforms(const ProgramD3D &programD3D,
// Sampler metadata and driver constants need to coexist in the same constant buffer to conserve
// constant buffer slots. We update both in the constant buffer if needed.
const dx_VertexConstants11 &vertexConstants = mStateManager.getVertexConstants();
- size_t samplerMetadataReferencedBytesVS = sizeof(SamplerMetadataD3D11::dx_SamplerMetadata) *
+ size_t samplerMetadataReferencedBytesVS = sizeof(SamplerMetadata11::dx_SamplerMetadata) *
programD3D.getUsedSamplerRange(gl::SAMPLER_VERTEX);
- applyDriverConstantsIfNeeded(&mAppliedVertexConstants, vertexConstants, &mSamplerMetadataVS,
+ applyDriverConstantsIfNeeded(&mAppliedVertexConstants, vertexConstants, samplerMetadataVS,
samplerMetadataReferencedBytesVS, mDriverConstantBufferVS);
const dx_PixelConstants11 &pixelConstants = mStateManager.getPixelConstants();
- size_t samplerMetadataReferencedBytesPS = sizeof(SamplerMetadataD3D11::dx_SamplerMetadata) *
+ size_t samplerMetadataReferencedBytesPS = sizeof(SamplerMetadata11::dx_SamplerMetadata) *
programD3D.getUsedSamplerRange(gl::SAMPLER_PIXEL);
- applyDriverConstantsIfNeeded(&mAppliedPixelConstants, pixelConstants, &mSamplerMetadataPS,
+ applyDriverConstantsIfNeeded(&mAppliedPixelConstants, pixelConstants, samplerMetadataPS,
samplerMetadataReferencedBytesPS, mDriverConstantBufferPS);
// GSSetConstantBuffers triggers device removal on 9_3, so we should only call it if necessary
@@ -2560,115 +2275,10 @@ gl::Error Renderer11::applyUniforms(const ProgramD3D &programD3D,
return gl::NoError();
}
-// SamplerMetadataD3D11 implementation
-
-Renderer11::SamplerMetadataD3D11::SamplerMetadataD3D11() : mDirty(true)
-{
-}
-
-Renderer11::SamplerMetadataD3D11::~SamplerMetadataD3D11()
-{
-}
-
-void Renderer11::SamplerMetadataD3D11::initData(unsigned int samplerCount)
-{
- mSamplerMetadata.resize(samplerCount);
-}
-
-void Renderer11::SamplerMetadataD3D11::update(unsigned int samplerIndex, const gl::Texture &texture)
-{
- unsigned int baseLevel = texture.getTextureState().getEffectiveBaseLevel();
- GLenum sizedFormat =
- texture.getFormat(texture.getTarget(), baseLevel).info->sizedInternalFormat;
- if (mSamplerMetadata[samplerIndex].baseLevel != static_cast<int>(baseLevel))
- {
- mSamplerMetadata[samplerIndex].baseLevel = static_cast<int>(baseLevel);
- mDirty = true;
- }
-
- // Some metadata is needed only for integer textures. We avoid updating the constant buffer
- // unnecessarily by changing the data only in case the texture is an integer texture and
- // the values have changed.
- bool needIntegerTextureMetadata = false;
- // internalFormatBits == 0 means a 32-bit texture in the case of integer textures.
- int internalFormatBits = 0;
- switch (sizedFormat)
- {
- case GL_RGBA32I:
- case GL_RGBA32UI:
- case GL_RGB32I:
- case GL_RGB32UI:
- case GL_RG32I:
- case GL_RG32UI:
- case GL_R32I:
- case GL_R32UI:
- needIntegerTextureMetadata = true;
- break;
- case GL_RGBA16I:
- case GL_RGBA16UI:
- case GL_RGB16I:
- case GL_RGB16UI:
- case GL_RG16I:
- case GL_RG16UI:
- case GL_R16I:
- case GL_R16UI:
- needIntegerTextureMetadata = true;
- internalFormatBits = 16;
- break;
- case GL_RGBA8I:
- case GL_RGBA8UI:
- case GL_RGB8I:
- case GL_RGB8UI:
- case GL_RG8I:
- case GL_RG8UI:
- case GL_R8I:
- case GL_R8UI:
- needIntegerTextureMetadata = true;
- internalFormatBits = 8;
- break;
- case GL_RGB10_A2UI:
- needIntegerTextureMetadata = true;
- internalFormatBits = 10;
- break;
- default:
- break;
- }
- if (needIntegerTextureMetadata)
- {
- if (mSamplerMetadata[samplerIndex].internalFormatBits != internalFormatBits)
- {
- mSamplerMetadata[samplerIndex].internalFormatBits = internalFormatBits;
- mDirty = true;
- }
- // Pack the wrap values into one integer so we can fit all the metadata in one 4-integer
- // vector.
- GLenum wrapS = texture.getWrapS();
- GLenum wrapT = texture.getWrapT();
- GLenum wrapR = texture.getWrapR();
- int wrapModes = GetWrapBits(wrapS) | (GetWrapBits(wrapT) << 2) | (GetWrapBits(wrapR) << 4);
- if (mSamplerMetadata[samplerIndex].wrapModes != wrapModes)
- {
- mSamplerMetadata[samplerIndex].wrapModes = wrapModes;
- mDirty = true;
- }
- }
-}
-
-const Renderer11::SamplerMetadataD3D11::dx_SamplerMetadata *
-Renderer11::SamplerMetadataD3D11::getData() const
-{
- return mSamplerMetadata.data();
-}
-
-size_t Renderer11::SamplerMetadataD3D11::sizeBytes() const
-{
- return sizeof(SamplerMetadataD3D11::dx_SamplerMetadata) * mSamplerMetadata.size();
-}
-
template <class TShaderConstants>
void Renderer11::applyDriverConstantsIfNeeded(TShaderConstants *appliedConstants,
const TShaderConstants &constants,
- SamplerMetadataD3D11 *samplerMetadata,
+ SamplerMetadata11 *samplerMetadata,
size_t samplerMetadataReferencedBytes,
const d3d11::Buffer &driverConstantBuffer)
{
@@ -2696,19 +2306,19 @@ void Renderer11::applyDriverConstantsIfNeeded(TShaderConstants *appliedConstants
template void Renderer11::applyDriverConstantsIfNeeded<dx_VertexConstants11>(
dx_VertexConstants11 *appliedConstants,
const dx_VertexConstants11 &constants,
- SamplerMetadataD3D11 *samplerMetadata,
+ SamplerMetadata11 *samplerMetadata,
size_t samplerMetadataReferencedBytes,
const d3d11::Buffer &driverConstantBuffer);
template void Renderer11::applyDriverConstantsIfNeeded<dx_PixelConstants11>(
dx_PixelConstants11 *appliedConstants,
const dx_PixelConstants11 &constants,
- SamplerMetadataD3D11 *samplerMetadata,
+ SamplerMetadata11 *samplerMetadata,
size_t samplerMetadataReferencedBytes,
const d3d11::Buffer &driverConstantBuffer);
template void Renderer11::applyDriverConstantsIfNeeded<dx_ComputeConstants11>(
dx_ComputeConstants11 *appliedConstants,
const dx_ComputeConstants11 &constants,
- SamplerMetadataD3D11 *samplerMetadata,
+ SamplerMetadata11 *samplerMetadata,
size_t samplerMetadataReferencedBytes,
const d3d11::Buffer &driverConstantBuffer);
@@ -2716,27 +2326,8 @@ void Renderer11::markAllStateDirty(const gl::Context *context)
{
TRACE_EVENT0("gpu.angle", "Renderer11::markAllStateDirty");
- for (size_t vsamplerId = 0; vsamplerId < mForceSetVertexSamplerStates.size(); ++vsamplerId)
- {
- mForceSetVertexSamplerStates[vsamplerId] = true;
- }
-
- for (size_t fsamplerId = 0; fsamplerId < mForceSetPixelSamplerStates.size(); ++fsamplerId)
- {
- mForceSetPixelSamplerStates[fsamplerId] = true;
- }
-
- for (size_t csamplerId = 0; csamplerId < mForceSetComputeSamplerStates.size(); ++csamplerId)
- {
- mForceSetComputeSamplerStates[csamplerId] = true;
- }
-
mStateManager.invalidateEverything(context);
- mAppliedIB = nullptr;
- mAppliedIBFormat = DXGI_FORMAT_UNKNOWN;
- mAppliedIBOffset = 0;
-
mAppliedTFObject = angle::DirtyPointer;
memset(&mAppliedVertexConstants, 0, sizeof(dx_VertexConstants11));
@@ -2762,10 +2353,7 @@ void Renderer11::releaseDeviceResources()
{
mStateManager.deinitialize();
mStateCache.clear();
- mInputLayoutCache.clear();
- SafeDelete(mVertexDataManager);
- SafeDelete(mIndexDataManager);
SafeDelete(mLineLoopIB);
SafeDelete(mTriangleFanIB);
SafeDelete(mBlit);
@@ -4119,7 +3707,7 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Context *context,
unsigned int readSubresource = 0;
d3d11::SharedSRV readSRV;
- if (readRenderTarget->getSamples() > 1)
+ if (readRenderTarget->isMultisampled())
{
ANGLE_TRY_RESULT(
resolveMultisampledTexture(context, readRenderTarget11, depthBlit, stencilBlit),
@@ -4414,7 +4002,11 @@ gl::ErrorOrResult<TextureHelper11> Renderer11::resolveMultisampledTexture(
const auto &formatSet = renderTarget->getFormatSet();
- ASSERT(renderTarget->getSamples() > 1);
+ ASSERT(renderTarget->isMultisampled());
+ const d3d11::SharedSRV &sourceSRV = renderTarget->getShaderResourceView();
+ D3D11_SHADER_RESOURCE_VIEW_DESC sourceSRVDesc;
+ sourceSRV.get()->GetDesc(&sourceSRVDesc);
+ ASSERT(sourceSRVDesc.ViewDimension == D3D_SRV_DIMENSION_TEXTURE2DMS);
D3D11_TEXTURE2D_DESC resolveDesc;
resolveDesc.Width = renderTarget->getWidth();
@@ -4523,14 +4115,6 @@ angle::WorkaroundsD3D Renderer11::generateWorkarounds() const
return d3d11::GenerateWorkarounds(mRenderer11DeviceCaps, mAdapterDescription);
}
-gl::Error Renderer11::clearTextures(const gl::Context *context,
- gl::SamplerType samplerType,
- size_t rangeStart,
- size_t rangeEnd)
-{
- return mStateManager.clearTextures(samplerType, rangeStart, rangeEnd);
-}
-
egl::Error Renderer11::getEGLDevice(DeviceImpl **device)
{
if (mEGLDevice == nullptr)
@@ -4561,8 +4145,7 @@ gl::Error Renderer11::genericDrawElements(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
const auto &data = context->getContextState();
const auto &glState = data.getState();
@@ -4582,26 +4165,16 @@ gl::Error Renderer11::genericDrawElements(const gl::Context *context,
ANGLE_TRY(mStateManager.updateState(context, mode));
- TranslatedIndexData indexInfo;
- indexInfo.indexRange = indexRange;
-
- ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
-
applyTransformFeedbackBuffers(data);
// Transform feedback is not allowed for DrawElements, this error should have been caught at the
// API validation layer.
ASSERT(!glState.isTransformFeedbackActiveUnpaused());
- size_t vertexCount = indexInfo.indexRange.vertexCount();
- ANGLE_TRY(applyVertexBuffer(context, mode, static_cast<GLsizei>(indexInfo.indexRange.start),
- static_cast<GLsizei>(vertexCount), instances, &indexInfo));
- ANGLE_TRY(applyTextures(context));
- ANGLE_TRY(applyShaders(context, mode));
ANGLE_TRY(programD3D->applyUniformBuffers(data));
if (!skipDraw(data, mode))
{
- ANGLE_TRY(drawElementsImpl(data, indexInfo, mode, count, type, indices, instances));
+ ANGLE_TRY(drawElementsImpl(context, mode, count, type, indices, instances));
}
return gl::NoError();
@@ -4630,9 +4203,7 @@ gl::Error Renderer11::genericDrawArrays(const gl::Context *context,
ANGLE_TRY(mStateManager.updateState(context, mode));
ANGLE_TRY(applyTransformFeedbackBuffers(data));
- ANGLE_TRY(applyVertexBuffer(context, mode, first, count, instances, nullptr));
- ANGLE_TRY(applyTextures(context));
- ANGLE_TRY(applyShaders(context, mode));
+ ANGLE_TRY(mStateManager.applyVertexBuffer(context, mode, first, count, instances, nullptr));
ANGLE_TRY(programD3D->applyUniformBuffers(data));
if (!skipDraw(data, mode))
@@ -4666,8 +4237,6 @@ gl::Error Renderer11::genericDrawIndirect(const gl::Context *context,
ANGLE_TRY(mStateManager.updateState(context, mode));
ANGLE_TRY(applyTransformFeedbackBuffers(contextState));
ASSERT(!glState.isTransformFeedbackActiveUnpaused());
- ANGLE_TRY(applyTextures(context));
- ANGLE_TRY(applyShaders(context, mode));
ANGLE_TRY(programD3D->applyUniformBuffers(contextState));
if (type == GL_NONE)
@@ -4706,11 +4275,11 @@ gl::DebugAnnotator *Renderer11::getAnnotator()
return mAnnotator;
}
-gl::Error Renderer11::applyComputeShader(const gl::ContextState &data)
+gl::Error Renderer11::applyComputeShader(const gl::Context *context)
{
ANGLE_TRY(ensureHLSLCompilerInitialized());
- const auto &glState = data.getState();
+ const auto &glState = context->getGLState();
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
ShaderExecutableD3D *computeExe = nullptr;
@@ -4727,18 +4296,16 @@ gl::Error Renderer11::dispatchCompute(const gl::Context *context,
GLuint numGroupsY,
GLuint numGroupsZ)
{
- const auto &data = context->getContextState();
- gl::Program *program = data.getState().getProgram();
+ gl::Program *program = context->getGLState().getProgram();
ASSERT(program != nullptr);
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(program);
- mStateManager.setComputeConstants(numGroupsX, numGroupsY, numGroupsZ);
-
programD3D->updateSamplerMapping();
-
ANGLE_TRY(generateSwizzles(context, gl::SAMPLER_COMPUTE));
- ANGLE_TRY(applyTextures(context));
- ANGLE_TRY(applyComputeShader(data));
+
+ ANGLE_TRY(mStateManager.updateStateForCompute(context, numGroupsX, numGroupsY, numGroupsZ));
+
+ ANGLE_TRY(applyComputeShader(context));
// TODO(Xinghua): applyUniformBuffers for compute shader.
mDeviceContext->Dispatch(numGroupsX, numGroupsY, numGroupsZ);
@@ -4805,12 +4372,14 @@ gl::Error Renderer11::applyComputeUniforms(const ProgramD3D &programD3D,
mCurrentComputeConstantBuffer = reinterpret_cast<uintptr_t>(computeConstantBuffer);
}
+ auto *samplerMetadataCS = mStateManager.getComputeSamplerMetadata();
+
if (!mDriverConstantBufferCS.valid())
{
D3D11_BUFFER_DESC constantBufferDescription = {0};
d3d11::InitConstantBufferDesc(
&constantBufferDescription,
- sizeof(dx_ComputeConstants11) + mSamplerMetadataCS.sizeBytes());
+ sizeof(dx_ComputeConstants11) + samplerMetadataCS->sizeBytes());
ANGLE_TRY(allocateResource(constantBufferDescription, &mDriverConstantBufferCS));
ID3D11Buffer *buffer = mDriverConstantBufferCS.get();
mDeviceContext->CSSetConstantBuffers(d3d11::RESERVED_CONSTANT_BUFFER_SLOT_DRIVER, 1,
@@ -4818,9 +4387,9 @@ gl::Error Renderer11::applyComputeUniforms(const ProgramD3D &programD3D,
}
const dx_ComputeConstants11 &computeConstants = mStateManager.getComputeConstants();
- size_t samplerMetadataReferencedBytesCS = sizeof(SamplerMetadataD3D11::dx_SamplerMetadata) *
+ size_t samplerMetadataReferencedBytesCS = sizeof(SamplerMetadata11::dx_SamplerMetadata) *
programD3D.getUsedSamplerRange(gl::SAMPLER_COMPUTE);
- applyDriverConstantsIfNeeded(&mAppliedComputeConstants, computeConstants, &mSamplerMetadataCS,
+ applyDriverConstantsIfNeeded(&mAppliedComputeConstants, computeConstants, samplerMetadataCS,
samplerMetadataReferencedBytesCS, mDriverConstantBufferCS);
return gl::NoError();
@@ -4922,12 +4491,15 @@ gl::Error Renderer11::getSamplerState(const gl::SamplerState &samplerState,
}
gl::Error Renderer11::clearRenderTarget(RenderTargetD3D *renderTarget,
- const gl::ColorF &clearValues)
+ const gl::ColorF &clearColorValue,
+ const float clearDepthValue,
+ const unsigned int clearStencilValue)
{
RenderTarget11 *renderTarget11 = GetAs<RenderTarget11>(renderTarget);
const d3d11::RenderTargetView &rtv = renderTarget11->getRenderTargetView();
+ ASSERT(rtv.valid());
- mDeviceContext->ClearRenderTargetView(rtv.get(), &clearValues.red);
+ mDeviceContext->ClearRenderTargetView(rtv.get(), &clearColorValue.red);
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 b70cb937b61..f3ab7a0d3f0 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
@@ -18,7 +18,6 @@
#include "libANGLE/renderer/d3d/RenderTargetD3D.h"
#include "libANGLE/renderer/d3d/RendererD3D.h"
#include "libANGLE/renderer/d3d/d3d11/DebugAnnotator11.h"
-#include "libANGLE/renderer/d3d/d3d11/InputLayoutCache.h"
#include "libANGLE/renderer/d3d/d3d11/RenderStateCache.h"
#include "libANGLE/renderer/d3d/d3d11/ResourceManager11.h"
#include "libANGLE/renderer/d3d/d3d11/StateManager11.h"
@@ -138,16 +137,6 @@ class Renderer11 : public RendererD3D
HANDLE shareHandle,
const egl::AttributeMap &attribs) const override;
- gl::Error setSamplerState(const gl::Context *context,
- gl::SamplerType type,
- int index,
- gl::Texture *texture,
- const gl::SamplerState &sampler) override;
- gl::Error setTexture(const gl::Context *context,
- gl::SamplerType type,
- int index,
- gl::Texture *texture) override;
-
gl::Error setUniformBuffers(const gl::ContextState &data,
const std::vector<GLint> &vertexUniformBuffers,
const std::vector<GLint> &fragmentUniformBuffers) override;
@@ -156,18 +145,6 @@ class Renderer11 : public RendererD3D
gl::Error applyUniforms(const ProgramD3D &programD3D,
GLenum drawMode,
const std::vector<D3DUniform *> &uniformArray) override;
- gl::Error applyVertexBuffer(const gl::Context *context,
- GLenum mode,
- GLint first,
- GLsizei count,
- GLsizei instances,
- TranslatedIndexData *indexInfo);
- gl::Error applyIndexBuffer(const gl::ContextState &data,
- const void *indices,
- GLsizei count,
- GLenum mode,
- GLenum type,
- TranslatedIndexData *indexInfo);
gl::Error applyTransformFeedbackBuffers(const gl::ContextState &data);
// lost device
@@ -394,7 +371,6 @@ class Renderer11 : public RendererD3D
const Renderer11DeviceCaps &getRenderer11DeviceCaps() const { return mRenderer11DeviceCaps; };
RendererClass getRendererClass() const override { return RENDERER_D3D11; }
- InputLayoutCache *getInputLayoutCache() { return &mInputLayoutCache; }
StateManager11 *getStateManager() { return &mStateManager; }
void onSwap();
@@ -414,8 +390,7 @@ class Renderer11 : public RendererD3D
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange);
+ GLsizei instances);
gl::Error genericDrawIndirect(const gl::Context *context,
GLenum mode,
@@ -435,7 +410,7 @@ class Renderer11 : public RendererD3D
GLuint numGroupsZ);
gl::Error applyComputeUniforms(const ProgramD3D &programD3D,
const std::vector<D3DUniform *> &uniformArray) override;
- gl::Error applyComputeShader(const gl::ContextState &data);
+ gl::Error applyComputeShader(const gl::Context *context);
gl::ErrorOrResult<TextureHelper11> createStagingTexture(ResourceType textureType,
const d3d11::Format &formatSet,
@@ -479,13 +454,9 @@ class Renderer11 : public RendererD3D
TextureHelper11 *textureOut);
gl::Error clearRenderTarget(RenderTargetD3D *renderTarget,
- const gl::ColorF &clearValues) override;
-
- protected:
- gl::Error clearTextures(const gl::Context *context,
- gl::SamplerType samplerType,
- size_t rangeStart,
- size_t rangeEnd) override;
+ const gl::ColorF &clearColorValue,
+ const float clearDepthValue,
+ const unsigned int clearStencilValue) override;
private:
gl::Error drawArraysImpl(const gl::Context *context,
@@ -493,8 +464,7 @@ class Renderer11 : public RendererD3D
GLint startVertex,
GLsizei count,
GLsizei instances);
- gl::Error drawElementsImpl(const gl::ContextState &data,
- const TranslatedIndexData &indexInfo,
+ gl::Error drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
@@ -506,9 +476,6 @@ class Renderer11 : public RendererD3D
GLenum type,
const void *indirect);
- // Support directly using indirect draw buffer.
- bool supportsFastIndirectDraw(const gl::Context *context, GLenum mode, GLenum type);
-
void generateCaps(gl::Caps *outCaps,
gl::TextureCapsMap *outTextureCaps,
gl::Extensions *outExtensions,
@@ -529,7 +496,6 @@ class Renderer11 : public RendererD3D
int baseVertex,
int instances);
- gl::Error applyShaders(const gl::Context *context, GLenum drawMode);
gl::Error generateSwizzle(const gl::Context *context, gl::Texture *texture);
gl::Error generateSwizzles(const gl::Context *context, gl::SamplerType type);
gl::Error generateSwizzles(const gl::Context *context);
@@ -543,39 +509,10 @@ class Renderer11 : public RendererD3D
void updateHistograms();
- class SamplerMetadataD3D11 final : angle::NonCopyable
- {
- public:
- SamplerMetadataD3D11();
- ~SamplerMetadataD3D11();
-
- struct dx_SamplerMetadata
- {
- int baseLevel;
- int internalFormatBits;
- int wrapModes;
- int padding; // This just pads the struct to 16 bytes
- };
- static_assert(sizeof(dx_SamplerMetadata) == 16u,
- "Sampler metadata struct must be one 4-vec / 16 bytes.");
-
- void initData(unsigned int samplerCount);
- void update(unsigned int samplerIndex, const gl::Texture &texture);
-
- const dx_SamplerMetadata *getData() const;
- size_t sizeBytes() const;
- bool isDirty() const { return mDirty; }
- void markClean() { mDirty = false; }
-
- private:
- std::vector<dx_SamplerMetadata> mSamplerMetadata;
- bool mDirty;
- };
-
template <class TShaderConstants>
void applyDriverConstantsIfNeeded(TShaderConstants *appliedConstants,
const TShaderConstants &constants,
- SamplerMetadataD3D11 *samplerMetadata,
+ SamplerMetadata11 *samplerMetadata,
size_t samplerMetadataReferencedBytes,
const d3d11::Buffer &driverConstantBuffer);
@@ -591,7 +528,7 @@ class Renderer11 : public RendererD3D
const gl::TextureCaps &depthStencilBufferFormatCaps) const;
egl::Error initializeD3DDevice();
- void initializeDevice();
+ egl::Error initializeDevice();
void releaseDeviceResources();
void release();
@@ -610,30 +547,13 @@ class Renderer11 : public RendererD3D
RenderStateCache mStateCache;
- // Currently applied sampler states
- std::vector<bool> mForceSetVertexSamplerStates;
- std::vector<gl::SamplerState> mCurVertexSamplerStates;
-
- std::vector<bool> mForceSetPixelSamplerStates;
- std::vector<gl::SamplerState> mCurPixelSamplerStates;
-
- std::vector<bool> mForceSetComputeSamplerStates;
- std::vector<gl::SamplerState> mCurComputeSamplerStates;
-
StateManager11 mStateManager;
- // Currently applied index buffer
- ID3D11Buffer *mAppliedIB;
- DXGI_FORMAT mAppliedIBFormat;
- unsigned int mAppliedIBOffset;
- bool mAppliedIBChanged;
-
// Currently applied transform feedback buffers
uintptr_t mAppliedTFObject;
dx_VertexConstants11 mAppliedVertexConstants;
d3d11::Buffer mDriverConstantBufferVS;
- SamplerMetadataD3D11 mSamplerMetadataVS;
uintptr_t mCurrentVertexConstantBuffer;
unsigned int mCurrentConstantBufferVS[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS];
GLintptr mCurrentConstantBufferVSOffset[gl::IMPLEMENTATION_MAX_VERTEX_SHADER_UNIFORM_BUFFERS];
@@ -641,7 +561,6 @@ class Renderer11 : public RendererD3D
dx_PixelConstants11 mAppliedPixelConstants;
d3d11::Buffer mDriverConstantBufferPS;
- SamplerMetadataD3D11 mSamplerMetadataPS;
uintptr_t mCurrentPixelConstantBuffer;
unsigned int mCurrentConstantBufferPS[gl::IMPLEMENTATION_MAX_FRAGMENT_SHADER_UNIFORM_BUFFERS];
GLintptr mCurrentConstantBufferPSOffset[gl::IMPLEMENTATION_MAX_FRAGMENT_SHADER_UNIFORM_BUFFERS];
@@ -649,16 +568,10 @@ class Renderer11 : public RendererD3D
dx_ComputeConstants11 mAppliedComputeConstants;
d3d11::Buffer mDriverConstantBufferCS;
- SamplerMetadataD3D11 mSamplerMetadataCS;
uintptr_t mCurrentComputeConstantBuffer;
uintptr_t mCurrentGeometryConstantBuffer;
- // Vertex, index and input layouts
- VertexDataManager *mVertexDataManager;
- IndexDataManager *mIndexDataManager;
- InputLayoutCache mInputLayoutCache;
-
StreamingIndexBufferInterface *mLineLoopIB;
StreamingIndexBufferInterface *mTriangleFanIB;
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 5beb6479ba3..a5ecb380831 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
@@ -13,9 +13,15 @@
#include "libANGLE/Context.h"
#include "libANGLE/Query.h"
#include "libANGLE/VertexArray.h"
+#include "libANGLE/renderer/d3d/TextureD3D.h"
+#include "libANGLE/renderer/d3d/d3d11/Buffer11.h"
#include "libANGLE/renderer/d3d/d3d11/Framebuffer11.h"
+#include "libANGLE/renderer/d3d/d3d11/IndexBuffer11.h"
#include "libANGLE/renderer/d3d/d3d11/RenderTarget11.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
+#include "libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h"
+#include "libANGLE/renderer/d3d/d3d11/TextureStorage11.h"
+#include "libANGLE/renderer/d3d/d3d11/VertexArray11.h"
namespace rx
{
@@ -97,8 +103,74 @@ ID3D11Resource *GetViewResource(ID3D11View *view)
return resource;
}
+int GetWrapBits(GLenum wrap)
+{
+ switch (wrap)
+ {
+ case GL_CLAMP_TO_EDGE:
+ return 0x1;
+ case GL_REPEAT:
+ return 0x2;
+ case GL_MIRRORED_REPEAT:
+ return 0x3;
+ default:
+ UNREACHABLE();
+ return 0;
+ }
+}
+
+Optional<size_t> FindFirstNonInstanced(
+ const std::vector<const TranslatedAttribute *> &currentAttributes)
+{
+ for (size_t index = 0; index < currentAttributes.size(); ++index)
+ {
+ if (currentAttributes[index]->divisor == 0)
+ {
+ return Optional<size_t>(index);
+ }
+ }
+
+ return Optional<size_t>::Invalid();
+}
+
+void SortAttributesByLayout(const gl::Program *program,
+ const std::vector<TranslatedAttribute> &vertexArrayAttribs,
+ const std::vector<TranslatedAttribute> &currentValueAttribs,
+ AttribIndexArray *sortedD3DSemanticsOut,
+ std::vector<const TranslatedAttribute *> *sortedAttributesOut)
+{
+ sortedAttributesOut->clear();
+
+ const auto &locationToSemantic =
+ GetImplAs<ProgramD3D>(program)->getAttribLocationToD3DSemantics();
+
+ for (auto locationIndex : program->getActiveAttribLocationsMask())
+ {
+ int d3dSemantic = locationToSemantic[locationIndex];
+ if (sortedAttributesOut->size() <= static_cast<size_t>(d3dSemantic))
+ {
+ sortedAttributesOut->resize(d3dSemantic + 1);
+ }
+
+ (*sortedD3DSemanticsOut)[d3dSemantic] = d3dSemantic;
+
+ const auto *arrayAttrib = &vertexArrayAttribs[locationIndex];
+ if (arrayAttrib->attribute && arrayAttrib->attribute->enabled)
+ {
+ (*sortedAttributesOut)[d3dSemantic] = arrayAttrib;
+ }
+ else
+ {
+ ASSERT(currentValueAttribs[locationIndex].attribute);
+ (*sortedAttributesOut)[d3dSemantic] = &currentValueAttribs[locationIndex];
+ }
+ }
+}
+
} // anonymous namespace
+// StateManager11::SRVCache Implementation.
+
void StateManager11::SRVCache::update(size_t resourceIndex, ID3D11ShaderResourceView *srv)
{
ASSERT(resourceIndex < mCurrentSRVs.size());
@@ -136,6 +208,110 @@ void StateManager11::SRVCache::clear()
mHighestUsedSRV = 0;
}
+// SamplerMetadataD3D11 implementation
+
+SamplerMetadata11::SamplerMetadata11() : mDirty(true)
+{
+}
+
+SamplerMetadata11::~SamplerMetadata11()
+{
+}
+
+void SamplerMetadata11::initData(unsigned int samplerCount)
+{
+ mSamplerMetadata.resize(samplerCount);
+}
+
+void SamplerMetadata11::update(unsigned int samplerIndex, const gl::Texture &texture)
+{
+ unsigned int baseLevel = texture.getTextureState().getEffectiveBaseLevel();
+ GLenum sizedFormat =
+ texture.getFormat(texture.getTarget(), baseLevel).info->sizedInternalFormat;
+ if (mSamplerMetadata[samplerIndex].baseLevel != static_cast<int>(baseLevel))
+ {
+ mSamplerMetadata[samplerIndex].baseLevel = static_cast<int>(baseLevel);
+ mDirty = true;
+ }
+
+ // Some metadata is needed only for integer textures. We avoid updating the constant buffer
+ // unnecessarily by changing the data only in case the texture is an integer texture and
+ // the values have changed.
+ bool needIntegerTextureMetadata = false;
+ // internalFormatBits == 0 means a 32-bit texture in the case of integer textures.
+ int internalFormatBits = 0;
+ switch (sizedFormat)
+ {
+ case GL_RGBA32I:
+ case GL_RGBA32UI:
+ case GL_RGB32I:
+ case GL_RGB32UI:
+ case GL_RG32I:
+ case GL_RG32UI:
+ case GL_R32I:
+ case GL_R32UI:
+ needIntegerTextureMetadata = true;
+ break;
+ case GL_RGBA16I:
+ case GL_RGBA16UI:
+ case GL_RGB16I:
+ case GL_RGB16UI:
+ case GL_RG16I:
+ case GL_RG16UI:
+ case GL_R16I:
+ case GL_R16UI:
+ needIntegerTextureMetadata = true;
+ internalFormatBits = 16;
+ break;
+ case GL_RGBA8I:
+ case GL_RGBA8UI:
+ case GL_RGB8I:
+ case GL_RGB8UI:
+ case GL_RG8I:
+ case GL_RG8UI:
+ case GL_R8I:
+ case GL_R8UI:
+ needIntegerTextureMetadata = true;
+ internalFormatBits = 8;
+ break;
+ case GL_RGB10_A2UI:
+ needIntegerTextureMetadata = true;
+ internalFormatBits = 10;
+ break;
+ default:
+ break;
+ }
+ if (needIntegerTextureMetadata)
+ {
+ if (mSamplerMetadata[samplerIndex].internalFormatBits != internalFormatBits)
+ {
+ mSamplerMetadata[samplerIndex].internalFormatBits = internalFormatBits;
+ mDirty = true;
+ }
+ // Pack the wrap values into one integer so we can fit all the metadata in one 4-integer
+ // vector.
+ GLenum wrapS = texture.getWrapS();
+ GLenum wrapT = texture.getWrapT();
+ GLenum wrapR = texture.getWrapR();
+ int wrapModes = GetWrapBits(wrapS) | (GetWrapBits(wrapT) << 2) | (GetWrapBits(wrapR) << 4);
+ if (mSamplerMetadata[samplerIndex].wrapModes != wrapModes)
+ {
+ mSamplerMetadata[samplerIndex].wrapModes = wrapModes;
+ mDirty = true;
+ }
+ }
+}
+
+const SamplerMetadata11::dx_SamplerMetadata *SamplerMetadata11::getData() const
+{
+ return mSamplerMetadata.data();
+}
+
+size_t SamplerMetadata11::sizeBytes() const
+{
+ return sizeof(dx_SamplerMetadata) * mSamplerMetadata.size();
+}
+
static const GLenum QueryTypes[] = {GL_ANY_SAMPLES_PASSED, GL_ANY_SAMPLES_PASSED_CONSERVATIVE,
GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN, GL_TIME_ELAPSED_EXT,
GL_COMMANDS_COMPLETED_CHROMIUM};
@@ -159,8 +335,15 @@ StateManager11::StateManager11(Renderer11 *renderer)
mDirtyCurrentValueAttribs(),
mCurrentValueAttribs(),
mCurrentInputLayout(),
+ mInputLayoutIsDirty(false),
mDirtyVertexBufferRange(gl::MAX_VERTEX_ATTRIBS, 0),
- mCurrentPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_UNDEFINED)
+ mCurrentPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_UNDEFINED),
+ mAppliedIB(nullptr),
+ mAppliedIBFormat(DXGI_FORMAT_UNKNOWN),
+ mAppliedIBOffset(0),
+ mAppliedIBChanged(false),
+ mVertexDataManager(renderer),
+ mIndexDataManager(renderer, RENDERER_D3D11)
{
mCurBlendState.blend = false;
mCurBlendState.sourceBlendRGB = GL_ONE;
@@ -252,11 +435,19 @@ void StateManager11::checkPresentPath(const gl::Context *context)
}
}
-void StateManager11::setComputeConstants(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ)
+gl::Error StateManager11::updateStateForCompute(const gl::Context *context,
+ GLuint numGroupsX,
+ GLuint numGroupsY,
+ GLuint numGroupsZ)
{
mComputeConstants.numWorkGroups[0] = numGroupsX;
mComputeConstants.numWorkGroups[1] = numGroupsY;
mComputeConstants.numWorkGroups[2] = numGroupsZ;
+
+ // TODO(jmadill): More complete implementation.
+ ANGLE_TRY(syncTextures(context));
+
+ return gl::NoError();
}
void StateManager11::syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits)
@@ -487,6 +678,17 @@ void StateManager11::syncState(const gl::Context *context, const gl::State::Dirt
case gl::State::DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING:
invalidateRenderTarget(context);
break;
+ case gl::State::DIRTY_BIT_VERTEX_ARRAY_BINDING:
+ invalidateVertexBuffer();
+ // Force invalidate the current value attributes, since the VertexArray11 keeps an
+ // internal cache of TranslatedAttributes, and they CurrentValue attributes are
+ // owned by the StateManager11/Context.
+ mDirtyCurrentValueAttribs.set();
+ break;
+ case gl::State::DIRTY_BIT_PROGRAM_EXECUTABLE:
+ invalidateVertexBuffer();
+ invalidateRenderTarget(context);
+ break;
default:
if (dirtyBit >= gl::State::DIRTY_BIT_CURRENT_VALUE_0 &&
dirtyBit < gl::State::DIRTY_BIT_CURRENT_VALUE_MAX)
@@ -662,16 +864,16 @@ void StateManager11::syncScissorRectangle(const gl::Rectangle &scissor, bool ena
mCurScissorEnabled = enabled;
}
-void StateManager11::syncViewport(const gl::Caps *caps,
- const gl::Rectangle &viewport,
- float zNear,
- float zFar)
+void StateManager11::syncViewport(const gl::Context *context)
{
- float actualZNear = gl::clamp01(zNear);
- float actualZFar = gl::clamp01(zFar);
+ const auto &glState = context->getGLState();
+ gl::Framebuffer *framebuffer = glState.getDrawFramebuffer();
+ float actualZNear = gl::clamp01(glState.getNearPlane());
+ float actualZFar = gl::clamp01(glState.getFarPlane());
- int dxMaxViewportBoundsX = static_cast<int>(caps->maxViewportWidth);
- int dxMaxViewportBoundsY = static_cast<int>(caps->maxViewportHeight);
+ const auto &caps = context->getCaps();
+ int dxMaxViewportBoundsX = static_cast<int>(caps.maxViewportWidth);
+ int dxMaxViewportBoundsY = static_cast<int>(caps.maxViewportHeight);
int dxMinViewportBoundsX = -dxMaxViewportBoundsX;
int dxMinViewportBoundsY = -dxMaxViewportBoundsY;
@@ -684,6 +886,7 @@ void StateManager11::syncViewport(const gl::Caps *caps,
dxMinViewportBoundsY = 0;
}
+ const auto &viewport = glState.getViewport();
int dxViewportTopLeftX = gl::clamp(viewport.x, dxMinViewportBoundsX, dxMaxViewportBoundsX);
int dxViewportTopLeftY = gl::clamp(viewport.y, dxMinViewportBoundsY, dxMaxViewportBoundsY);
int dxViewportWidth = gl::clamp(viewport.width, 0, dxMaxViewportBoundsX - dxViewportTopLeftX);
@@ -712,6 +915,22 @@ void StateManager11::syncViewport(const gl::Caps *caps,
dxViewport.MinDepth = actualZNear;
dxViewport.MaxDepth = actualZFar;
+ // The es 3.1 spec section 9.2 states that, "If there are no attachments, rendering
+ // will be limited to a rectangle having a lower left of (0, 0) and an upper right of
+ // (width, height), where width and height are the framebuffer object's default width
+ // and height." See http://anglebug.com/1594
+ // If the Framebuffer has no color attachment and the default width or height is smaller
+ // than the current viewport, use the smaller of the two sizes.
+ // If framebuffer default width or height is 0, the params should not set.
+ if (!framebuffer->getFirstNonNullAttachment() &&
+ (framebuffer->getDefaultWidth() || framebuffer->getDefaultHeight()))
+ {
+ dxViewport.Width =
+ static_cast<GLfloat>(std::min(viewport.width, framebuffer->getDefaultWidth()));
+ dxViewport.Height =
+ static_cast<GLfloat>(std::min(viewport.height, framebuffer->getDefaultHeight()));
+ }
+
mRenderer->getDeviceContext()->RSSetViewports(1, &dxViewport);
mCurViewport = viewport;
@@ -853,6 +1072,16 @@ void StateManager11::invalidateEverything(const gl::Context *context)
mAppliedGeometryShader.dirty();
mAppliedPixelShader.dirty();
mAppliedComputeShader.dirty();
+
+ std::fill(mForceSetVertexSamplerStates.begin(), mForceSetVertexSamplerStates.end(), true);
+ std::fill(mForceSetPixelSamplerStates.begin(), mForceSetPixelSamplerStates.end(), true);
+ std::fill(mForceSetComputeSamplerStates.begin(), mForceSetComputeSamplerStates.end(), true);
+
+ mAppliedIB = nullptr;
+ mAppliedIBFormat = DXGI_FORMAT_UNKNOWN;
+ mAppliedIBOffset = 0;
+
+ mLastFirstVertex.reset();
}
void StateManager11::invalidateVertexBuffer()
@@ -860,6 +1089,12 @@ void StateManager11::invalidateVertexBuffer()
unsigned int limit = std::min<unsigned int>(mRenderer->getNativeCaps().maxVertexAttributes,
gl::MAX_VERTEX_ATTRIBS);
mDirtyVertexBufferRange = gl::RangeUI(0, limit);
+ mInputLayoutIsDirty = true;
+}
+
+void StateManager11::invalidateViewport(const gl::Context *context)
+{
+ mInternalDirtyBits.set(DIRTY_BIT_VIEWPORT_STATE);
}
void StateManager11::setOneTimeRenderTarget(const gl::Context *context,
@@ -1011,7 +1246,7 @@ void StateManager11::unsetConflictingAttachmentResources(
}
}
-void StateManager11::initialize(const gl::Caps &caps)
+gl::Error StateManager11::initialize(const gl::Caps &caps)
{
mCurVertexSRVs.initialize(caps.maxVertexTextureImageUnits);
mCurPixelSRVs.initialize(caps.maxTextureImageUnits);
@@ -1020,11 +1255,32 @@ void StateManager11::initialize(const gl::Caps &caps)
mNullSRVs.resize(caps.maxTextureImageUnits, nullptr);
mCurrentValueAttribs.resize(caps.maxVertexAttributes);
+
+ mForceSetVertexSamplerStates.resize(caps.maxVertexTextureImageUnits);
+ mForceSetPixelSamplerStates.resize(caps.maxTextureImageUnits);
+ mForceSetComputeSamplerStates.resize(caps.maxComputeTextureImageUnits);
+
+ mCurVertexSamplerStates.resize(caps.maxVertexTextureImageUnits);
+ mCurPixelSamplerStates.resize(caps.maxTextureImageUnits);
+ mCurComputeSamplerStates.resize(caps.maxComputeTextureImageUnits);
+
+ mSamplerMetadataVS.initData(caps.maxVertexTextureImageUnits);
+ mSamplerMetadataPS.initData(caps.maxTextureImageUnits);
+ mSamplerMetadataCS.initData(caps.maxComputeTextureImageUnits);
+
+ ANGLE_TRY(mVertexDataManager.initialize());
+
+ mCurrentAttributes.reserve(gl::MAX_VERTEX_ATTRIBS);
+
+ return gl::NoError();
}
void StateManager11::deinitialize()
{
mCurrentValueAttribs.clear();
+ mInputLayoutCache.clear();
+ mVertexDataManager.deinitialize();
+ mIndexDataManager.deinitialize();
}
gl::Error StateManager11::syncFramebuffer(const gl::Context *context, gl::Framebuffer *framebuffer)
@@ -1057,7 +1313,7 @@ gl::Error StateManager11::syncFramebuffer(const gl::Context *context, gl::Frameb
const auto &drawStates = framebuffer->getDrawBufferStates();
gl::DrawBufferMask activeProgramOutputs =
context->getContextState().getState().getProgram()->getActiveOutputVariables();
- UINT maxExistingRT = 0;
+ UINT maxExistingRT = 0;
for (size_t rtIndex = 0; rtIndex < colorRTs.size(); ++rtIndex)
{
@@ -1087,7 +1343,7 @@ gl::Error StateManager11::syncFramebuffer(const gl::Context *context, gl::Frameb
// Get the depth stencil buffers
ID3D11DepthStencilView *framebufferDSV = nullptr;
- const auto *depthStencilRenderTarget = framebuffer11->getCachedDepthStencilRenderTarget();
+ const auto *depthStencilRenderTarget = framebuffer11->getCachedDepthStencilRenderTarget();
if (depthStencilRenderTarget)
{
framebufferDSV = depthStencilRenderTarget->getDepthStencilView().get();
@@ -1110,21 +1366,31 @@ gl::Error StateManager11::syncFramebuffer(const gl::Context *context, gl::Frameb
return gl::NoError();
}
-gl::Error StateManager11::updateCurrentValueAttribs(const gl::State &state,
- VertexDataManager *vertexDataManager)
+void StateManager11::invalidateCurrentValueAttrib(size_t attribIndex)
+{
+ mDirtyCurrentValueAttribs.set(attribIndex);
+}
+
+gl::Error StateManager11::syncCurrentValueAttribs(const gl::State &state)
{
const auto &activeAttribsMask = state.getProgram()->getActiveAttribLocationsMask();
const auto &dirtyActiveAttribs = (activeAttribsMask & mDirtyCurrentValueAttribs);
const auto &vertexAttributes = state.getVertexArray()->getVertexAttributes();
const auto &vertexBindings = state.getVertexArray()->getVertexBindings();
+ if (!dirtyActiveAttribs.any())
+ {
+ return gl::NoError();
+ }
+
+ invalidateVertexBuffer();
+ mDirtyCurrentValueAttribs = (mDirtyCurrentValueAttribs & ~dirtyActiveAttribs);
+
for (auto attribIndex : dirtyActiveAttribs)
{
if (vertexAttributes[attribIndex].enabled)
continue;
- mDirtyCurrentValueAttribs.reset(attribIndex);
-
const auto *attrib = &vertexAttributes[attribIndex];
const auto &currentValue = state.getVertexAttribCurrentValue(attribIndex);
auto currentValueAttrib = &mCurrentValueAttribs[attribIndex];
@@ -1132,18 +1398,13 @@ gl::Error StateManager11::updateCurrentValueAttribs(const gl::State &state,
currentValueAttrib->attribute = attrib;
currentValueAttrib->binding = &vertexBindings[attrib->bindingIndex];
- ANGLE_TRY(vertexDataManager->storeCurrentValue(currentValue, currentValueAttrib,
+ ANGLE_TRY(mVertexDataManager.storeCurrentValue(currentValue, currentValueAttrib,
static_cast<size_t>(attribIndex)));
}
return gl::NoError();
}
-const std::vector<TranslatedAttribute> &StateManager11::getCurrentValueAttribs() const
-{
- return mCurrentValueAttribs;
-}
-
void StateManager11::setInputLayout(const d3d11::InputLayout *inputLayout)
{
ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext();
@@ -1153,12 +1414,14 @@ void StateManager11::setInputLayout(const d3d11::InputLayout *inputLayout)
{
deviceContext->IASetInputLayout(nullptr);
mCurrentInputLayout = 0;
+ mInputLayoutIsDirty = true;
}
}
else if (inputLayout->getSerial() != mCurrentInputLayout)
{
deviceContext->IASetInputLayout(inputLayout->get());
mCurrentInputLayout = inputLayout->getSerial();
+ mInputLayoutIsDirty = true;
}
}
@@ -1171,6 +1434,7 @@ bool StateManager11::queueVertexBufferChange(size_t bufferIndex,
stride != mCurrentVertexStrides[bufferIndex] ||
offset != mCurrentVertexOffsets[bufferIndex])
{
+ mInputLayoutIsDirty = true;
mDirtyVertexBufferRange.extend(static_cast<unsigned int>(bufferIndex));
mCurrentVertexBuffers[bufferIndex] = buffer;
@@ -1186,6 +1450,7 @@ bool StateManager11::queueVertexOffsetChange(size_t bufferIndex, UINT offsetOnly
{
if (offsetOnly != mCurrentVertexOffsets[bufferIndex])
{
+ mInputLayoutIsDirty = true;
mDirtyVertexBufferRange.extend(static_cast<unsigned int>(bufferIndex));
mCurrentVertexOffsets[bufferIndex] = offsetOnly;
return true;
@@ -1223,8 +1488,10 @@ void StateManager11::setSingleVertexBuffer(const d3d11::Buffer *buffer, UINT str
gl::Error StateManager11::updateState(const gl::Context *context, GLenum drawMode)
{
- const auto &data = context->getContextState();
- const auto &glState = data.getState();
+ const auto &glState = context->getGLState();
+
+ // TODO(jmadill): Use dirty bits.
+ ANGLE_TRY(syncProgram(context, drawMode));
gl::Framebuffer *framebuffer = glState.getDrawFramebuffer();
Framebuffer11 *framebuffer11 = GetImplAs<Framebuffer11>(framebuffer);
@@ -1245,7 +1512,7 @@ gl::Error StateManager11::updateState(const gl::Context *context, GLenum drawMod
// TODO(jmadill): This can be recomputed only on framebuffer changes.
RenderTarget11 *firstRT = framebuffer11->getFirstRenderTarget();
int samples = (firstRT ? firstRT->getSamples() : 0);
- unsigned int sampleMask = GetBlendSampleMask(data, samples);
+ unsigned int sampleMask = GetBlendSampleMask(glState, samples);
if (sampleMask != mCurSampleMask)
{
mInternalDirtyBits.set(DIRTY_BIT_BLEND_STATE);
@@ -1262,8 +1529,7 @@ gl::Error StateManager11::updateState(const gl::Context *context, GLenum drawMod
ANGLE_TRY(syncFramebuffer(context, framebuffer));
break;
case DIRTY_BIT_VIEWPORT_STATE:
- syncViewport(&data.getCaps(), glState.getViewport(), glState.getNearPlane(),
- glState.getFarPlane());
+ syncViewport(context);
break;
case DIRTY_BIT_SCISSOR_STATE:
syncScissorRectangle(glState.getScissor(), glState.isScissorTestEnabled());
@@ -1284,6 +1550,14 @@ gl::Error StateManager11::updateState(const gl::Context *context, GLenum drawMod
}
}
+ // TODO(jmadill): Use dirty bits.
+ ANGLE_TRY(syncTextures(context));
+
+ // This must happen after viewport sync, because the viewport affects builtin uniforms.
+ // TODO(jmadill): Use dirty bits.
+ auto *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
+ ANGLE_TRY(programD3D->applyUniforms(drawMode));
+
// Check that we haven't set any dirty bits in the flushing of the dirty bits loop.
ASSERT(mInternalDirtyBits.none());
@@ -1356,4 +1630,418 @@ void StateManager11::setComputeShader(const d3d11::ComputeShader *shader)
}
}
+// For each Direct3D sampler of either the pixel or vertex stage,
+// looks up the corresponding OpenGL texture image unit and texture type,
+// and sets the texture and its addressing/filtering state (or NULL when inactive).
+// Sampler mapping needs to be up-to-date on the program object before this is called.
+gl::Error StateManager11::applyTextures(const gl::Context *context,
+ gl::SamplerType shaderType,
+ const FramebufferTextureArray &framebufferTextures,
+ size_t framebufferTextureCount)
+{
+ const auto &glState = context->getGLState();
+ const auto &caps = context->getCaps();
+ ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
+
+ ASSERT(!programD3D->isSamplerMappingDirty());
+
+ // TODO(jmadill): Use the Program's sampler bindings.
+
+ unsigned int samplerRange = programD3D->getUsedSamplerRange(shaderType);
+ for (unsigned int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++)
+ {
+ GLenum textureType = programD3D->getSamplerTextureType(shaderType, samplerIndex);
+ GLint textureUnit = programD3D->getSamplerMapping(shaderType, samplerIndex, caps);
+ if (textureUnit != -1)
+ {
+ gl::Texture *texture = glState.getSamplerTexture(textureUnit, textureType);
+ ASSERT(texture);
+
+ gl::Sampler *samplerObject = glState.getSampler(textureUnit);
+
+ const gl::SamplerState &samplerState =
+ samplerObject ? samplerObject->getSamplerState() : texture->getSamplerState();
+
+ // TODO: std::binary_search may become unavailable using older versions of GCC
+ if (texture->getTextureState().isSamplerComplete(samplerState,
+ context->getContextState()) &&
+ !std::binary_search(framebufferTextures.begin(),
+ framebufferTextures.begin() + framebufferTextureCount, texture))
+ {
+ ANGLE_TRY(
+ setSamplerState(context, shaderType, samplerIndex, texture, samplerState));
+ ANGLE_TRY(setTexture(context, shaderType, samplerIndex, texture));
+ }
+ else
+ {
+ // Texture is not sampler complete or it is in use by the framebuffer. Bind the
+ // incomplete texture.
+ gl::Texture *incompleteTexture =
+ mRenderer->getIncompleteTexture(context, textureType);
+
+ ANGLE_TRY(setSamplerState(context, shaderType, samplerIndex, incompleteTexture,
+ incompleteTexture->getSamplerState()));
+ ANGLE_TRY(setTexture(context, shaderType, samplerIndex, incompleteTexture));
+ }
+ }
+ else
+ {
+ // No texture bound to this slot even though it is used by the shader, bind a NULL
+ // texture
+ ANGLE_TRY(setTexture(context, shaderType, samplerIndex, nullptr));
+ }
+ }
+
+ // Set all the remaining textures to NULL
+ size_t samplerCount = (shaderType == gl::SAMPLER_PIXEL) ? caps.maxTextureImageUnits
+ : caps.maxVertexTextureImageUnits;
+ clearTextures(shaderType, samplerRange, samplerCount);
+
+ return gl::NoError();
+}
+
+gl::Error StateManager11::syncTextures(const gl::Context *context)
+{
+ FramebufferTextureArray framebufferTextures;
+ size_t framebufferSerialCount =
+ mRenderer->getBoundFramebufferTextures(context->getContextState(), &framebufferTextures);
+
+ ANGLE_TRY(
+ applyTextures(context, gl::SAMPLER_VERTEX, framebufferTextures, framebufferSerialCount));
+ ANGLE_TRY(
+ applyTextures(context, gl::SAMPLER_PIXEL, framebufferTextures, framebufferSerialCount));
+ return gl::NoError();
+}
+
+gl::Error StateManager11::setSamplerState(const gl::Context *context,
+ gl::SamplerType type,
+ int index,
+ gl::Texture *texture,
+ const gl::SamplerState &samplerState)
+{
+#if !defined(NDEBUG)
+ // Storage should exist, texture should be complete. Only verified in Debug.
+ TextureD3D *textureD3D = GetImplAs<TextureD3D>(texture);
+ TextureStorage *storage = nullptr;
+ ANGLE_TRY(textureD3D->getNativeTexture(context, &storage));
+ ASSERT(storage);
+#endif // !defined(NDEBUG)
+
+ // Sampler metadata that's passed to shaders in uniforms is stored separately from rest of the
+ // sampler state since having it in contiguous memory makes it possible to memcpy to a constant
+ // buffer, and it doesn't affect the state set by PSSetSamplers/VSSetSamplers.
+ SamplerMetadata11 *metadata = nullptr;
+
+ auto *deviceContext = mRenderer->getDeviceContext();
+
+ if (type == gl::SAMPLER_PIXEL)
+ {
+ ASSERT(static_cast<unsigned int>(index) < mRenderer->getNativeCaps().maxTextureImageUnits);
+
+ if (mForceSetPixelSamplerStates[index] ||
+ memcmp(&samplerState, &mCurPixelSamplerStates[index], sizeof(gl::SamplerState)) != 0)
+ {
+ ID3D11SamplerState *dxSamplerState = nullptr;
+ ANGLE_TRY(mRenderer->getSamplerState(samplerState, &dxSamplerState));
+
+ ASSERT(dxSamplerState != nullptr);
+ deviceContext->PSSetSamplers(index, 1, &dxSamplerState);
+
+ mCurPixelSamplerStates[index] = samplerState;
+ }
+
+ mForceSetPixelSamplerStates[index] = false;
+
+ metadata = &mSamplerMetadataPS;
+ }
+ else if (type == gl::SAMPLER_VERTEX)
+ {
+ ASSERT(static_cast<unsigned int>(index) <
+ mRenderer->getNativeCaps().maxVertexTextureImageUnits);
+
+ if (mForceSetVertexSamplerStates[index] ||
+ memcmp(&samplerState, &mCurVertexSamplerStates[index], sizeof(gl::SamplerState)) != 0)
+ {
+ ID3D11SamplerState *dxSamplerState = nullptr;
+ ANGLE_TRY(mRenderer->getSamplerState(samplerState, &dxSamplerState));
+
+ ASSERT(dxSamplerState != nullptr);
+ deviceContext->VSSetSamplers(index, 1, &dxSamplerState);
+
+ mCurVertexSamplerStates[index] = samplerState;
+ }
+
+ mForceSetVertexSamplerStates[index] = false;
+
+ metadata = &mSamplerMetadataVS;
+ }
+ else if (type == gl::SAMPLER_COMPUTE)
+ {
+ ASSERT(static_cast<unsigned int>(index) <
+ mRenderer->getNativeCaps().maxComputeTextureImageUnits);
+
+ if (mForceSetComputeSamplerStates[index] ||
+ memcmp(&samplerState, &mCurComputeSamplerStates[index], sizeof(gl::SamplerState)) != 0)
+ {
+ ID3D11SamplerState *dxSamplerState = nullptr;
+ ANGLE_TRY(mRenderer->getSamplerState(samplerState, &dxSamplerState));
+
+ ASSERT(dxSamplerState != nullptr);
+ deviceContext->CSSetSamplers(index, 1, &dxSamplerState);
+
+ mCurComputeSamplerStates[index] = samplerState;
+ }
+
+ mForceSetComputeSamplerStates[index] = false;
+
+ metadata = &mSamplerMetadataCS;
+ }
+ else
+ UNREACHABLE();
+
+ ASSERT(metadata != nullptr);
+ metadata->update(index, *texture);
+
+ return gl::NoError();
+}
+
+gl::Error StateManager11::setTexture(const gl::Context *context,
+ gl::SamplerType type,
+ int index,
+ gl::Texture *texture)
+{
+ const d3d11::SharedSRV *textureSRV = nullptr;
+
+ if (texture)
+ {
+ TextureD3D *textureImpl = GetImplAs<TextureD3D>(texture);
+
+ TextureStorage *texStorage = nullptr;
+ ANGLE_TRY(textureImpl->getNativeTexture(context, &texStorage));
+
+ // Texture should be complete and have a storage
+ ASSERT(texStorage);
+
+ TextureStorage11 *storage11 = GetAs<TextureStorage11>(texStorage);
+
+ ANGLE_TRY(storage11->getSRV(context, texture->getTextureState(), &textureSRV));
+
+ // If we get an invalid SRV here, something went wrong in the texture class and we're
+ // unexpectedly missing the shader resource view.
+ ASSERT(textureSRV->valid());
+
+ textureImpl->resetDirty();
+ }
+
+ ASSERT(
+ (type == gl::SAMPLER_PIXEL &&
+ static_cast<unsigned int>(index) < mRenderer->getNativeCaps().maxTextureImageUnits) ||
+ (type == gl::SAMPLER_VERTEX &&
+ static_cast<unsigned int>(index) < mRenderer->getNativeCaps().maxVertexTextureImageUnits));
+
+ setShaderResource(type, index, textureSRV->get());
+ return gl::NoError();
+}
+
+gl::Error StateManager11::syncProgram(const gl::Context *context, GLenum drawMode)
+{
+ const auto &glState = context->getGLState();
+ const auto *va11 = GetImplAs<VertexArray11>(glState.getVertexArray());
+ auto *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
+
+ programD3D->updateCachedInputLayout(va11->getCurrentStateSerial(), glState);
+
+ // Binaries must be compiled before the sync.
+ ASSERT(programD3D->hasVertexExecutableForCachedInputLayout());
+ ASSERT(programD3D->hasGeometryExecutableForPrimitiveType(drawMode));
+ ASSERT(programD3D->hasPixelExecutableForCachedOutputLayout());
+
+ ShaderExecutableD3D *vertexExe = nullptr;
+ ANGLE_TRY(programD3D->getVertexExecutableForCachedInputLayout(&vertexExe, nullptr));
+
+ ShaderExecutableD3D *pixelExe = nullptr;
+ ANGLE_TRY(programD3D->getPixelExecutableForCachedOutputLayout(&pixelExe, nullptr));
+
+ ShaderExecutableD3D *geometryExe = nullptr;
+ ANGLE_TRY(programD3D->getGeometryExecutableForPrimitiveType(context->getContextState(),
+ drawMode, &geometryExe, nullptr));
+
+ const d3d11::VertexShader *vertexShader =
+ (vertexExe ? &GetAs<ShaderExecutable11>(vertexExe)->getVertexShader() : nullptr);
+
+ // Skip pixel shader if we're doing rasterizer discard.
+ const d3d11::PixelShader *pixelShader = nullptr;
+ if (!glState.getRasterizerState().rasterizerDiscard)
+ {
+ pixelShader = (pixelExe ? &GetAs<ShaderExecutable11>(pixelExe)->getPixelShader() : nullptr);
+ }
+
+ const d3d11::GeometryShader *geometryShader = nullptr;
+ if (glState.isTransformFeedbackActiveUnpaused())
+ {
+ geometryShader =
+ (vertexExe ? &GetAs<ShaderExecutable11>(vertexExe)->getStreamOutShader() : nullptr);
+ }
+ else
+ {
+ geometryShader =
+ (geometryExe ? &GetAs<ShaderExecutable11>(geometryExe)->getGeometryShader() : nullptr);
+ }
+
+ setDrawShaders(vertexShader, geometryShader, pixelShader);
+ return gl::NoError();
+}
+
+gl::Error StateManager11::applyVertexBuffer(const gl::Context *context,
+ GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei instances,
+ TranslatedIndexData *indexInfo)
+{
+ const auto &state = context->getGLState();
+ const auto &vertexArray = state.getVertexArray();
+ auto *vertexArray11 = GetImplAs<VertexArray11>(vertexArray);
+
+ if (vertexArray11->hasDirtyOrDynamicAttrib(context))
+ {
+ ANGLE_TRY(vertexArray11->updateDirtyAndDynamicAttribs(context, &mVertexDataManager, first,
+ count, instances));
+ invalidateVertexBuffer();
+ }
+
+ ANGLE_TRY(syncCurrentValueAttribs(state));
+
+ // If index information is passed, mark it with the current changed status.
+ if (indexInfo)
+ {
+ indexInfo->srcIndexData.srcIndicesChanged = mAppliedIBChanged;
+ }
+
+ if (!mLastFirstVertex.valid() || mLastFirstVertex.value() != first)
+ {
+ mLastFirstVertex = first;
+ mInputLayoutIsDirty = true;
+ }
+
+ // Currently buffer data updates sometimes won't get flushed if we short-circuit.
+ // TODO(jmadill): Re-enable once we fix updates.
+ //if (!mInputLayoutIsDirty)
+ //{
+ // return gl::NoError();
+ //}
+
+ GLsizei numIndicesPerInstance = 0;
+ if (instances > 0)
+ {
+ numIndicesPerInstance = count;
+ }
+
+ const auto &vertexArrayAttribs = vertexArray11->getTranslatedAttribs();
+ gl::Program *program = state.getProgram();
+
+ // Sort the attributes according to ensure we re-use similar input layouts.
+ AttribIndexArray sortedSemanticIndices;
+ SortAttributesByLayout(program, vertexArrayAttribs, mCurrentValueAttribs,
+ &sortedSemanticIndices, &mCurrentAttributes);
+
+ auto featureLevel = mRenderer->getRenderer11DeviceCaps().featureLevel;
+
+ // If we are using FL 9_3, make sure the first attribute is not instanced
+ if (featureLevel <= D3D_FEATURE_LEVEL_9_3 && !mCurrentAttributes.empty())
+ {
+ if (mCurrentAttributes[0]->divisor > 0)
+ {
+ Optional<size_t> firstNonInstancedIndex = FindFirstNonInstanced(mCurrentAttributes);
+ if (firstNonInstancedIndex.valid())
+ {
+ size_t index = firstNonInstancedIndex.value();
+ std::swap(mCurrentAttributes[0], mCurrentAttributes[index]);
+ std::swap(sortedSemanticIndices[0], sortedSemanticIndices[index]);
+ }
+ }
+ }
+
+ // Update the applied input layout by querying the cache.
+ ANGLE_TRY(mInputLayoutCache.updateInputLayout(mRenderer, state, mCurrentAttributes, mode,
+ sortedSemanticIndices, numIndicesPerInstance));
+
+ // Update the applied vertex buffers.
+ ANGLE_TRY(mInputLayoutCache.applyVertexBuffers(mRenderer, state, mCurrentAttributes, mode,
+ first, indexInfo));
+
+ // InputLayoutCache::applyVertexBuffers calls through to the Bufer11 to get the native vertex
+ // buffer (ID3D11Buffer *). Because we allocate these buffers lazily, this will trigger
+ // allocation. This in turn will signal that the buffer is dirty. Since we just resolved the
+ // dirty-ness in VertexArray11::updateDirtyAndDynamicAttribs, this can make us do a needless
+ // update on the second draw call.
+ // Hence we clear the flags here, after we've applied vertex data, since we know everything
+ // is clean. This is a bit of a hack.
+ vertexArray11->clearDirtyAndPromoteDynamicAttribs(state, count);
+
+ mInputLayoutIsDirty = false;
+ return gl::NoError();
+}
+
+gl::Error StateManager11::applyIndexBuffer(const gl::ContextState &data,
+ const void *indices,
+ GLsizei count,
+ GLenum type,
+ TranslatedIndexData *indexInfo)
+{
+ const auto &glState = data.getState();
+ gl::VertexArray *vao = glState.getVertexArray();
+ gl::Buffer *elementArrayBuffer = vao->getElementArrayBuffer().get();
+ ANGLE_TRY(mIndexDataManager.prepareIndexData(type, count, elementArrayBuffer, indices,
+ indexInfo, glState.isPrimitiveRestartEnabled()));
+
+ ID3D11Buffer *buffer = nullptr;
+ DXGI_FORMAT bufferFormat =
+ (indexInfo->indexType == GL_UNSIGNED_INT) ? DXGI_FORMAT_R32_UINT : DXGI_FORMAT_R16_UINT;
+
+ if (indexInfo->storage)
+ {
+ Buffer11 *storage = GetAs<Buffer11>(indexInfo->storage);
+ ANGLE_TRY_RESULT(storage->getBuffer(BUFFER_USAGE_INDEX), buffer);
+ }
+ else
+ {
+ IndexBuffer11 *indexBuffer = GetAs<IndexBuffer11>(indexInfo->indexBuffer);
+ buffer = indexBuffer->getBuffer().get();
+ }
+
+ mAppliedIBChanged = false;
+ setIndexBuffer(buffer, bufferFormat, indexInfo->startOffset, true);
+
+ return gl::NoError();
+}
+
+void StateManager11::setIndexBuffer(ID3D11Buffer *buffer,
+ DXGI_FORMAT indexFormat,
+ unsigned int offset,
+ bool indicesChanged)
+{
+ if (buffer != mAppliedIB || indexFormat != mAppliedIBFormat || offset != mAppliedIBOffset)
+ {
+ mRenderer->getDeviceContext()->IASetIndexBuffer(buffer, indexFormat, offset);
+
+ mAppliedIB = buffer;
+ mAppliedIBFormat = indexFormat;
+ mAppliedIBOffset = offset;
+
+ if (indicesChanged)
+ {
+ mAppliedIBChanged = true;
+ }
+ }
+}
+
+// Vertex buffer is invalidated outside this function.
+gl::Error StateManager11::updateVertexOffsetsForPointSpritesEmulation(GLint startVertex,
+ GLsizei emulatedInstanceId)
+{
+ return mInputLayoutCache.updateVertexOffsetsForPointSpritesEmulation(
+ mRenderer, mCurrentAttributes, startVertex, emulatedInstanceId);
+}
+
} // namespace rx
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 bc0f47675fd..abe324da9e1 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
@@ -11,13 +11,15 @@
#include <array>
-#include "libANGLE/angletypes.h"
#include "libANGLE/ContextState.h"
#include "libANGLE/State.h"
+#include "libANGLE/angletypes.h"
+#include "libANGLE/renderer/d3d/IndexDataManager.h"
+#include "libANGLE/renderer/d3d/RendererD3D.h"
+#include "libANGLE/renderer/d3d/d3d11/InputLayoutCache.h"
+#include "libANGLE/renderer/d3d/d3d11/Query11.h"
#include "libANGLE/renderer/d3d/d3d11/RenderStateCache.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
-#include "libANGLE/renderer/d3d/d3d11/Query11.h"
-#include "libANGLE/renderer/d3d/RendererD3D.h"
namespace rx
{
@@ -47,29 +49,65 @@ struct dx_ComputeConstants11
unsigned int padding; // This just pads the struct to 16 bytes
};
+class SamplerMetadata11 final : angle::NonCopyable
+{
+ public:
+ SamplerMetadata11();
+ ~SamplerMetadata11();
+
+ struct dx_SamplerMetadata
+ {
+ int baseLevel;
+ int internalFormatBits;
+ int wrapModes;
+ int padding; // This just pads the struct to 16 bytes
+ };
+ static_assert(sizeof(dx_SamplerMetadata) == 16u,
+ "Sampler metadata struct must be one 4-vec / 16 bytes.");
+
+ void initData(unsigned int samplerCount);
+ void update(unsigned int samplerIndex, const gl::Texture &texture);
+
+ const dx_SamplerMetadata *getData() const;
+ size_t sizeBytes() const;
+ bool isDirty() const { return mDirty; }
+ void markClean() { mDirty = false; }
+
+ private:
+ std::vector<dx_SamplerMetadata> mSamplerMetadata;
+ bool mDirty;
+};
+
class StateManager11 final : angle::NonCopyable
{
public:
StateManager11(Renderer11 *renderer);
~StateManager11();
- void initialize(const gl::Caps &caps);
+ gl::Error initialize(const gl::Caps &caps);
void deinitialize();
void syncState(const gl::Context *context, const gl::State::DirtyBits &dirtyBits);
+ // TODO(jmadill): Don't expose these.
const dx_VertexConstants11 &getVertexConstants() const { return mVertexConstants; }
const dx_PixelConstants11 &getPixelConstants() const { return mPixelConstants; }
const dx_ComputeConstants11 &getComputeConstants() const { return mComputeConstants; }
- void setComputeConstants(GLuint numGroupsX, GLuint numGroupsY, GLuint numGroupsZ);
+ SamplerMetadata11 *getVertexSamplerMetadata() { return &mSamplerMetadataVS; }
+ SamplerMetadata11 *getPixelSamplerMetadata() { return &mSamplerMetadataPS; }
+ SamplerMetadata11 *getComputeSamplerMetadata() { return &mSamplerMetadataCS; }
+
+ gl::Error updateStateForCompute(const gl::Context *context,
+ GLuint numGroupsX,
+ GLuint numGroupsY,
+ GLuint numGroupsZ);
void updateStencilSizeIfChanged(bool depthStencilInitialized, unsigned int stencilSize);
void setShaderResource(gl::SamplerType shaderType,
UINT resourceSlot,
ID3D11ShaderResourceView *srv);
- gl::Error clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd);
// Checks are done on a framebuffer state change to trigger other state changes.
// The Context is allowed to be nullptr for these methods, when called in EGL init code.
@@ -77,6 +115,10 @@ class StateManager11 final : angle::NonCopyable
void invalidateBoundViews(const gl::Context *context);
void invalidateVertexBuffer();
void invalidateEverything(const gl::Context *context);
+ void invalidateViewport(const gl::Context *context);
+
+ // Called from VertexArray11::updateVertexAttribStorage.
+ void invalidateCurrentValueAttrib(size_t attribIndex);
void setOneTimeRenderTarget(const gl::Context *context,
ID3D11RenderTargetView *rtv,
@@ -90,11 +132,6 @@ class StateManager11 final : angle::NonCopyable
void onDeleteQueryObject(Query11 *query);
gl::Error onMakeCurrent(const gl::Context *context);
- gl::Error updateCurrentValueAttribs(const gl::State &state,
- VertexDataManager *vertexDataManager);
-
- const std::vector<TranslatedAttribute> &getCurrentValueAttribs() const;
-
void setInputLayout(const d3d11::InputLayout *inputLayout);
// TODO(jmadill): Migrate to d3d11::Buffer.
@@ -119,6 +156,31 @@ class StateManager11 final : angle::NonCopyable
void setPixelShader(const d3d11::PixelShader *shader);
void setComputeShader(const d3d11::ComputeShader *shader);
+ // Not handled by an internal dirty bit because of the extra draw parameters.
+ gl::Error applyVertexBuffer(const gl::Context *context,
+ GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei instances,
+ TranslatedIndexData *indexInfo);
+
+ gl::Error applyIndexBuffer(const gl::ContextState &data,
+ const void *indices,
+ GLsizei count,
+ GLenum type,
+ TranslatedIndexData *indexInfo);
+
+ void setIndexBuffer(ID3D11Buffer *buffer,
+ DXGI_FORMAT indexFormat,
+ unsigned int offset,
+ bool indicesChanged);
+
+ gl::Error updateVertexOffsetsForPointSpritesEmulation(GLint startVertex,
+ GLsizei emulatedInstanceId);
+
+ // Only used in testing.
+ InputLayoutCache *getInputLayoutCache() { return &mInputLayoutCache; }
+
private:
void unsetConflictingSRVs(gl::SamplerType shaderType,
uintptr_t resource,
@@ -138,11 +200,33 @@ class StateManager11 final : angle::NonCopyable
void syncScissorRectangle(const gl::Rectangle &scissor, bool enabled);
- void syncViewport(const gl::Caps *caps, const gl::Rectangle &viewport, float zNear, float zFar);
+ void syncViewport(const gl::Context *context);
void checkPresentPath(const gl::Context *context);
gl::Error syncFramebuffer(const gl::Context *context, gl::Framebuffer *framebuffer);
+ gl::Error syncProgram(const gl::Context *context, GLenum drawMode);
+
+ gl::Error syncTextures(const gl::Context *context);
+ gl::Error applyTextures(const gl::Context *context,
+ gl::SamplerType shaderType,
+ const FramebufferTextureArray &framebufferTextures,
+ size_t framebufferTextureCount);
+
+ gl::Error setSamplerState(const gl::Context *context,
+ gl::SamplerType type,
+ int index,
+ gl::Texture *texture,
+ const gl::SamplerState &sampler);
+ gl::Error setTexture(const gl::Context *context,
+ gl::SamplerType type,
+ int index,
+ gl::Texture *texture);
+
+ // Faster than calling setTexture a jillion times
+ gl::Error clearTextures(gl::SamplerType samplerType, size_t rangeStart, size_t rangeEnd);
+
+ gl::Error syncCurrentValueAttribs(const gl::State &state);
enum DirtyBitType
{
@@ -247,6 +331,7 @@ class StateManager11 final : angle::NonCopyable
// Current applied input layout.
ResourceSerial mCurrentInputLayout;
+ bool mInputLayoutIsDirty;
// Current applied vertex states.
// TODO(jmadill): Figure out how to use ResourceSerial here.
@@ -263,6 +348,33 @@ class StateManager11 final : angle::NonCopyable
ResourceSerial mAppliedGeometryShader;
ResourceSerial mAppliedPixelShader;
ResourceSerial mAppliedComputeShader;
+
+ // Currently applied sampler states
+ std::vector<bool> mForceSetVertexSamplerStates;
+ std::vector<gl::SamplerState> mCurVertexSamplerStates;
+
+ std::vector<bool> mForceSetPixelSamplerStates;
+ std::vector<gl::SamplerState> mCurPixelSamplerStates;
+
+ std::vector<bool> mForceSetComputeSamplerStates;
+ std::vector<gl::SamplerState> mCurComputeSamplerStates;
+
+ SamplerMetadata11 mSamplerMetadataVS;
+ SamplerMetadata11 mSamplerMetadataPS;
+ SamplerMetadata11 mSamplerMetadataCS;
+
+ // Currently applied index buffer
+ ID3D11Buffer *mAppliedIB;
+ DXGI_FORMAT mAppliedIBFormat;
+ unsigned int mAppliedIBOffset;
+ bool mAppliedIBChanged;
+
+ // Vertex, index and input layouts
+ VertexDataManager mVertexDataManager;
+ IndexDataManager mIndexDataManager;
+ InputLayoutCache mInputLayoutCache;
+ std::vector<const TranslatedAttribute *> mCurrentAttributes;
+ Optional<GLint> mLastFirstVertex;
};
} // namespace rx
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 24420243ed0..e3ab308e758 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
@@ -224,6 +224,14 @@ EGLint SwapChain11::resetOffscreenColorBuffer(const gl::Context *context,
}
ASSERT(mOffscreenTexture.valid());
mOffscreenTexture.getDesc(&offscreenTextureDesc);
+
+ // Fail if the offscreen texture is not renderable.
+ if ((offscreenTextureDesc.BindFlags & D3D11_BIND_RENDER_TARGET) == 0)
+ {
+ ERR() << "Could not use provided offscreen texture, texture not renderable.";
+ release();
+ return EGL_BAD_SURFACE;
+ }
}
else
{
@@ -307,6 +315,23 @@ EGLint SwapChain11::resetOffscreenColorBuffer(const gl::Context *context,
ASSERT(!err.isError());
mOffscreenSRView.setDebugName("Offscreen back buffer shader resource");
}
+ else
+ {
+ // Special case for external textures that cannot support sampling. Since internally we
+ // assume our SwapChain is always readable, we make a copy texture that is compatible.
+ D3D11_TEXTURE2D_DESC offscreenCopyDesc = offscreenTextureDesc;
+ offscreenCopyDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ offscreenCopyDesc.MiscFlags = 0;
+ offscreenCopyDesc.CPUAccessFlags = 0;
+ err = mRenderer->allocateTexture(offscreenCopyDesc, backbufferFormatInfo,
+ &mOffscreenTextureCopyForSRV);
+ ASSERT(!err.isError());
+ mOffscreenTextureCopyForSRV.setDebugName("Offscreen back buffer copy for SRV");
+ err = mRenderer->allocateResource(offscreenSRVDesc, mOffscreenTextureCopyForSRV.get(),
+ &mOffscreenSRView);
+ ASSERT(!err.isError());
+ mOffscreenSRView.setDebugName("Offscreen back buffer shader resource");
+ }
if (previousOffscreenTexture.valid())
{
@@ -928,7 +953,24 @@ const d3d11::RenderTargetView &SwapChain11::getRenderTarget()
const d3d11::SharedSRV &SwapChain11::getRenderTargetShaderResource()
{
- return mNeedsOffscreenTexture ? mOffscreenSRView : mBackBufferSRView;
+ if (!mNeedsOffscreenTexture)
+ {
+ ASSERT(mBackBufferSRView.valid());
+ return mBackBufferSRView;
+ }
+
+ if (!mOffscreenTextureCopyForSRV.valid())
+ {
+ ASSERT(mOffscreenSRView.valid());
+ return mOffscreenSRView;
+ }
+
+ // Need to copy the offscreen texture into the shader-readable copy, since it's external and
+ // we don't know if the copy is up-to-date. This works around the problem we have when the app
+ // passes in a texture that isn't shader-readable.
+ mRenderer->getDeviceContext()->CopyResource(mOffscreenTextureCopyForSRV.get(),
+ mOffscreenTexture.get());
+ return mOffscreenSRView;
}
const d3d11::DepthStencilView &SwapChain11::getDepthStencil()
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 d64d821f060..cceb8ec33cc 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
@@ -110,6 +110,7 @@ class SwapChain11 final : public SwapChainD3D
TextureHelper11 mOffscreenTexture;
d3d11::RenderTargetView mOffscreenRTView;
d3d11::SharedSRV mOffscreenSRView;
+ TextureHelper11 mOffscreenTextureCopyForSRV;
TextureHelper11 mDepthStencilTexture;
d3d11::DepthStencilView mDepthStencilDSView;
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 4e6ddfffa0c..ee0d513e42e 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
@@ -1045,6 +1045,12 @@ gl::Error TextureStorage11_2D::getRenderTarget(const gl::Context *context,
return gl::NoError();
}
+ if (mRenderer->getWorkarounds().zeroMaxLodWorkaround)
+ {
+ ASSERT(index.mipIndex == 0);
+ useLevelZeroWorkaroundTexture(true);
+ }
+
const TextureHelper11 *texture = nullptr;
ANGLE_TRY(getResource(context, &texture));
@@ -1986,6 +1992,12 @@ gl::Error TextureStorage11_Cube::getRenderTarget(const gl::Context *context,
if (!mRenderTarget[faceIndex][level])
{
+ if (mRenderer->getWorkarounds().zeroMaxLodWorkaround)
+ {
+ ASSERT(index.mipIndex == 0);
+ useLevelZeroWorkaroundTexture(true);
+ }
+
const TextureHelper11 *texture = nullptr;
ANGLE_TRY(getResource(context, &texture));
@@ -2609,12 +2621,13 @@ void TextureStorage11_2DArray::associateImage(Image11 *image, const gl::ImageInd
{
const GLint level = index.mipIndex;
const GLint layerTarget = index.layerIndex;
+ const GLint numLayers = index.numLayers;
ASSERT(0 <= level && level < getLevelCount());
if (0 <= level && level < getLevelCount())
{
- LevelLayerKey key(level, layerTarget);
+ LevelLayerRangeKey key(level, layerTarget, numLayers);
mAssociatedImages[key] = image;
}
}
@@ -2624,8 +2637,9 @@ void TextureStorage11_2DArray::verifyAssociatedImageValid(const gl::ImageIndex &
{
const GLint level = index.mipIndex;
const GLint layerTarget = index.layerIndex;
+ const GLint numLayers = index.numLayers;
- LevelLayerKey key(level, layerTarget);
+ LevelLayerRangeKey key(level, layerTarget, numLayers);
// This validation check should never return false. It means the Image/TextureStorage
// association is broken.
@@ -2640,8 +2654,9 @@ void TextureStorage11_2DArray::disassociateImage(const gl::ImageIndex &index,
{
const GLint level = index.mipIndex;
const GLint layerTarget = index.layerIndex;
+ const GLint numLayers = index.numLayers;
- LevelLayerKey key(level, layerTarget);
+ LevelLayerRangeKey key(level, layerTarget, numLayers);
bool imageAssociationCorrect = (mAssociatedImages.find(key) != mAssociatedImages.end() &&
(mAssociatedImages[key] == expectedImage));
@@ -2657,8 +2672,9 @@ gl::Error TextureStorage11_2DArray::releaseAssociatedImage(const gl::Context *co
{
const GLint level = index.mipIndex;
const GLint layerTarget = index.layerIndex;
+ const GLint numLayers = index.numLayers;
- LevelLayerKey key(level, layerTarget);
+ LevelLayerRangeKey key(level, layerTarget, numLayers);
if (mAssociatedImages.find(key) != mAssociatedImages.end())
{
@@ -2738,7 +2754,7 @@ gl::Error TextureStorage11_2DArray::createRenderTargetSRV(const TextureHelper11
srvDesc.Texture2DArray.MostDetailedMip = mTopLevel + index.mipIndex;
srvDesc.Texture2DArray.MipLevels = 1;
srvDesc.Texture2DArray.FirstArraySlice = index.layerIndex;
- srvDesc.Texture2DArray.ArraySize = 1;
+ srvDesc.Texture2DArray.ArraySize = index.numLayers;
ANGLE_TRY(mRenderer->allocateResource(srvDesc, texture.get(), srv));
@@ -2753,10 +2769,11 @@ gl::Error TextureStorage11_2DArray::getRenderTarget(const gl::Context *context,
const int mipLevel = index.mipIndex;
const int layer = index.layerIndex;
+ const int numLayers = index.numLayers;
ASSERT(mipLevel >= 0 && mipLevel < getLevelCount());
- LevelLayerKey key(mipLevel, layer);
+ LevelLayerRangeKey key(mipLevel, layer, numLayers);
if (mRenderTargets.find(key) == mRenderTargets.end())
{
const TextureHelper11 *texture = nullptr;
@@ -2782,7 +2799,7 @@ gl::Error TextureStorage11_2DArray::getRenderTarget(const gl::Context *context,
rtvDesc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DARRAY;
rtvDesc.Texture2DArray.MipSlice = mTopLevel + mipLevel;
rtvDesc.Texture2DArray.FirstArraySlice = layer;
- rtvDesc.Texture2DArray.ArraySize = 1;
+ rtvDesc.Texture2DArray.ArraySize = numLayers;
d3d11::RenderTargetView rtv;
ANGLE_TRY(mRenderer->allocateResource(rtvDesc, texture->get(), &rtv));
@@ -2801,7 +2818,7 @@ gl::Error TextureStorage11_2DArray::getRenderTarget(const gl::Context *context,
dsvDesc.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2DARRAY;
dsvDesc.Texture2DArray.MipSlice = mTopLevel + mipLevel;
dsvDesc.Texture2DArray.FirstArraySlice = layer;
- dsvDesc.Texture2DArray.ArraySize = 1;
+ dsvDesc.Texture2DArray.ArraySize = numLayers;
dsvDesc.Flags = 0;
d3d11::DepthStencilView dsv;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h
index 1f28f76fd06..de2ed5a1c83 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h
@@ -485,6 +485,30 @@ class TextureStorage11_2DArray : public TextureStorage11
gl::ErrorOrResult<DropStencil> ensureDropStencilTexture(const gl::Context *context) override;
private:
+ struct LevelLayerRangeKey
+ {
+ LevelLayerRangeKey(int mipLevelIn, int layerIn, int numLayersIn)
+ : mipLevel(mipLevelIn), layer(layerIn), numLayers(numLayersIn)
+ {
+ }
+ bool operator<(const LevelLayerRangeKey &other) const
+ {
+ if (mipLevel != other.mipLevel)
+ {
+ return mipLevel < other.mipLevel;
+ }
+ if (layer != other.layer)
+ {
+ return layer < other.layer;
+ }
+ return numLayers < other.numLayers;
+ }
+ int mipLevel;
+ int layer;
+ int numLayers;
+ };
+
+ private:
gl::Error createSRV(const gl::Context *context,
int baseLevel,
int mipLevels,
@@ -496,8 +520,7 @@ class TextureStorage11_2DArray : public TextureStorage11
DXGI_FORMAT resourceFormat,
d3d11::SharedSRV *srv) const;
- typedef std::pair<int, int> LevelLayerKey;
- typedef std::map<LevelLayerKey, RenderTarget11*> RenderTargetMap;
+ typedef std::map<LevelLayerRangeKey, RenderTarget11 *> RenderTargetMap;
RenderTargetMap mRenderTargets;
TextureHelper11 mTexture;
@@ -505,7 +528,7 @@ class TextureStorage11_2DArray : public TextureStorage11
TextureHelper11 mSwizzleTexture;
d3d11::RenderTargetView mSwizzleRenderTargets[gl::IMPLEMENTATION_MAX_TEXTURE_LEVELS];
- typedef std::map<LevelLayerKey, Image11*> ImageMap;
+ typedef std::map<LevelLayerRangeKey, Image11 *> ImageMap;
ImageMap mAssociatedImages;
};
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 4697a87cc25..a3b38acc5f7 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
@@ -45,6 +45,16 @@ void VertexArray11::destroy(const gl::Context *context)
void VertexArray11::syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits)
{
+ ASSERT(dirtyBits.any());
+
+ // Generate a state serial. This serial is used in the program class to validate the cached
+ // input layout, and skip recomputation in the fast path.
+ auto renderer = GetImplAs<Context11>(context)->getRenderer();
+ mCurrentStateSerial = renderer->generateSerial();
+
+ // TODO(jmadill): Individual attribute invalidation.
+ renderer->getStateManager()->invalidateVertexBuffer();
+
for (auto dirtyBit : dirtyBits)
{
if (dirtyBit == gl::VertexArray::DIRTY_BIT_ELEMENT_ARRAY_BUFFER)
@@ -111,13 +121,20 @@ void VertexArray11::updateVertexAttribStorage(const gl::Context *context, size_t
Buffer11 *oldBuffer11 = oldBufferGL ? GetImplAs<Buffer11>(oldBufferGL) : nullptr;
Buffer11 *newBuffer11 = newBufferGL ? GetImplAs<Buffer11>(newBufferGL) : nullptr;
+ StateManager11 *stateManager = GetImplAs<Context11>(context)->getRenderer()->getStateManager();
+
if (oldBuffer11 != newBuffer11 || oldStorageType != newStorageType)
{
- // Note that for static callbacks, promotion to a static buffer from a dynamic buffer means
- // we need to tag dynamic buffers with static callbacks.
OnBufferDataDirtyChannel *newChannel = nullptr;
- if (newBuffer11 != nullptr)
+
+ if (newStorageType == VertexStorageType::CURRENT_VALUE)
+ {
+ stateManager->invalidateCurrentValueAttrib(attribIndex);
+ }
+ else if (newBuffer11 != nullptr)
{
+ // Note that for static callbacks, promotion to a static buffer from a dynamic buffer
+ // means we need to tag dynamic buffers with static callbacks.
switch (newStorageType)
{
case VertexStorageType::DIRECT:
@@ -128,9 +145,11 @@ void VertexArray11::updateVertexAttribStorage(const gl::Context *context, size_t
newChannel = newBuffer11->getStaticBroadcastChannel();
break;
default:
+ UNREACHABLE();
break;
}
}
+
mOnBufferDataDirty[attribIndex].bind(newChannel);
mCurrentBuffers[attribIndex].set(context, binding.getBuffer().get());
}
@@ -142,6 +161,12 @@ bool VertexArray11::hasDynamicAttrib(const gl::Context *context)
return mDynamicAttribsMask.any();
}
+bool VertexArray11::hasDirtyOrDynamicAttrib(const gl::Context *context)
+{
+ flushAttribUpdates(context);
+ return mAttribsToTranslate.any() || mDynamicAttribsMask.any();
+}
+
gl::Error VertexArray11::updateDirtyAndDynamicAttribs(const gl::Context *context,
VertexDataManager *vertexDataManager,
GLint start,
@@ -210,8 +235,8 @@ gl::Error VertexArray11::updateDirtyAndDynamicAttribs(const gl::Context *context
dynamicAttrib->divisor = dynamicAttrib->binding->getDivisor();
}
- return vertexDataManager->storeDynamicAttribs(&mTranslatedAttribs, activeDynamicAttribs,
- start, count, instances);
+ ANGLE_TRY(vertexDataManager->storeDynamicAttribs(&mTranslatedAttribs, activeDynamicAttribs,
+ start, count, instances));
}
return gl::NoError();
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 449ca596958..fc9ed0b1abe 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
@@ -28,6 +28,7 @@ class VertexArray11 : public VertexArrayImpl, public OnBufferDataDirtyReceiver
const gl::VertexArray::DirtyBits &dirtyBits) override;
// This will flush any pending attrib updates and then check the dynamic attribs mask.
bool hasDynamicAttrib(const gl::Context *context);
+ bool hasDirtyOrDynamicAttrib(const gl::Context *context);
gl::Error updateDirtyAndDynamicAttribs(const gl::Context *context,
VertexDataManager *vertexDataManager,
GLint start,
@@ -40,6 +41,8 @@ class VertexArray11 : public VertexArrayImpl, public OnBufferDataDirtyReceiver
// SignalReceiver implementation
void signal(size_t channelID) override;
+ Serial getCurrentStateSerial() const { return mCurrentStateSerial; }
+
private:
void updateVertexAttribStorage(const gl::Context *context, size_t attribIndex);
void flushAttribUpdates(const gl::Context *context);
@@ -60,6 +63,8 @@ class VertexArray11 : public VertexArrayImpl, public OnBufferDataDirtyReceiver
std::vector<gl::BindingPointer<gl::Buffer>> mCurrentBuffers;
std::vector<OnBufferDataDirtyBinding> mOnBufferDataDirty;
+
+ Serial mCurrentStateSerial;
};
} // 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 0b7815dfffe..f62dcfb91b9 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
@@ -1058,6 +1058,31 @@ size_t GetMaximumStreamOutputSeparateComponents(D3D_FEATURE_LEVEL featureLevel)
}
}
+size_t GetMaximumRenderToBufferWindowSize(D3D_FEATURE_LEVEL featureLevel)
+{
+ switch (featureLevel)
+ {
+ case D3D_FEATURE_LEVEL_11_1:
+ case D3D_FEATURE_LEVEL_11_0:
+ return D3D11_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH;
+ case D3D_FEATURE_LEVEL_10_1:
+ case D3D_FEATURE_LEVEL_10_0:
+ return D3D10_REQ_RENDER_TO_BUFFER_WINDOW_WIDTH;
+
+ // REQ_RENDER_TO_BUFFER_WINDOW_WIDTH not supported on D3D11 Feature Level 9,
+ // use the maximum texture sizes
+ case D3D_FEATURE_LEVEL_9_3:
+ return D3D_FL9_3_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+ case D3D_FEATURE_LEVEL_9_2:
+ case D3D_FEATURE_LEVEL_9_1:
+ return D3D_FL9_1_REQ_TEXTURE2D_U_OR_V_DIMENSION;
+
+ default:
+ UNREACHABLE();
+ return 0;
+ }
+}
+
IntelDriverVersion GetIntelDriverVersion(const Optional<LARGE_INTEGER> driverVersion)
{
if (!driverVersion.valid())
@@ -1136,10 +1161,41 @@ gl::Version GetMaximumClientVersion(D3D_FEATURE_LEVEL featureLevel)
}
}
+unsigned int GetMaxViewportAndScissorRectanglesPerPipeline(D3D_FEATURE_LEVEL featureLevel)
+{
+ switch (featureLevel)
+ {
+ case D3D_FEATURE_LEVEL_11_1:
+ case D3D_FEATURE_LEVEL_11_0:
+ return D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE;
+ case D3D_FEATURE_LEVEL_10_1:
+ case D3D_FEATURE_LEVEL_10_0:
+ case D3D_FEATURE_LEVEL_9_3:
+ case D3D_FEATURE_LEVEL_9_2:
+ case D3D_FEATURE_LEVEL_9_1:
+ return 1;
+ default:
+ UNREACHABLE();
+ return 0;
+ }
+}
+
+bool IsMultiviewSupported(D3D_FEATURE_LEVEL featureLevel)
+{
+ // The ANGLE_multiview extension can always be supported in D3D11 through geometry shaders.
+ switch (featureLevel)
+ {
+ case D3D_FEATURE_LEVEL_11_1:
+ case D3D_FEATURE_LEVEL_11_0:
+ return true;
+ default:
+ return false;
+ }
+}
+
void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, const Renderer11DeviceCaps &renderer11DeviceCaps, gl::Caps *caps,
gl::TextureCapsMap *textureCapsMap, gl::Extensions *extensions, gl::Limitations *limitations)
{
- GLuint maxSamples = 0;
D3D_FEATURE_LEVEL featureLevel = renderer11DeviceCaps.featureLevel;
const gl::FormatSet &allFormats = gl::GetAllSizedInternalFormats();
for (GLenum internalFormat : allFormats)
@@ -1148,8 +1204,6 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
GetMaximumClientVersion(featureLevel), internalFormat, device, renderer11DeviceCaps);
textureCapsMap->insert(internalFormat, textureCaps);
- maxSamples = std::max(maxSamples, textureCaps.getMaxSamples());
-
if (gl::GetSizedInternalFormatInfo(internalFormat).compressed)
{
caps->compressedTextureFormats.push_back(internalFormat);
@@ -1292,9 +1346,18 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
caps->maxTransformFeedbackSeparateComponents =
static_cast<GLuint>(GetMaximumStreamOutputSeparateComponents(featureLevel));
- // Multisample limits
- caps->maxSamples = maxSamples;
- caps->maxColorTextureSamples = maxSamples;
+ // Defer the computation of multisample limits to Context::updateCaps() where max*Samples values
+ // are determined according to available sample counts for each individual format.
+ caps->maxSamples = std::numeric_limits<GLint>::max();
+ caps->maxColorTextureSamples = std::numeric_limits<GLint>::max();
+ caps->maxDepthTextureSamples = std::numeric_limits<GLint>::max();
+ caps->maxIntegerSamples = std::numeric_limits<GLint>::max();
+
+ // Framebuffer limits
+ caps->maxFramebufferSamples = std::numeric_limits<GLint>::max();
+ caps->maxFramebufferWidth =
+ static_cast<GLuint>(GetMaximumRenderToBufferWindowSize(featureLevel));
+ caps->maxFramebufferHeight = caps->maxFramebufferWidth;
// GL extension support
extensions->setTextureExtensionSupport(*textureCapsMap);
@@ -1326,6 +1389,13 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
extensions->standardDerivatives = GetDerivativeInstructionSupport(featureLevel);
extensions->shaderTextureLOD = GetShaderTextureLODSupport(featureLevel);
extensions->fragDepth = true;
+ extensions->multiview = IsMultiviewSupported(featureLevel);
+ if (extensions->multiview)
+ {
+ extensions->maxViews =
+ std::min(static_cast<GLuint>(GetMaximum2DTextureArraySize(featureLevel)),
+ GetMaxViewportAndScissorRectanglesPerPipeline(featureLevel));
+ }
extensions->textureUsage = true; // This could be false since it has no effect in D3D11
extensions->discardFramebuffer = true;
extensions->translatedShaderSource = true;
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 d83839c37f7..b4fef5e2714 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
@@ -194,6 +194,7 @@ class LazyResource : angle::NonCopyable
const Resource11<GetD3D11Type<ResourceT>> &getObj() const { return mResource; }
protected:
+ LazyResource(LazyResource &&other) : mResource(std::move(other.mResource)) {}
gl::Error resolveImpl(Renderer11 *renderer,
const GetDescType<ResourceT> &desc,
GetInitDataType<ResourceT> *initData,
@@ -220,6 +221,13 @@ class LazyShader final : public LazyResource<GetResourceTypeFromD3D11<D3D11Shade
{
}
+ constexpr LazyShader(LazyShader &&shader)
+ : LazyResource<GetResourceTypeFromD3D11<D3D11ShaderType>()>(std::move(shader)),
+ mByteCode(std::move(shader.mByteCode)),
+ mName(shader.mName)
+ {
+ }
+
gl::Error resolve(Renderer11 *renderer) override
{
return this->resolveImpl(renderer, mByteCode, nullptr, mName);
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Clear11.hlsl b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Clear11.hlsl
index 771dad39bee..48f5b427ec1 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Clear11.hlsl
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Clear11.hlsl
@@ -30,12 +30,48 @@ void VS_Clear(in uint id : SV_VertexID,
outPosition = float4(corner.x, corner.y, 0.0f, 1.0f);
}
+void VS_Multiview_Clear(in uint id : SV_VertexID,
+ in uint instanceID : SV_InstanceID,
+ out float4 outPosition : SV_POSITION,
+ out uint outLayerID : TEXCOORD0)
+{
+ float2 corner = g_Corners[id];
+ outPosition = float4(corner.x, corner.y, 0.0f, 1.0f);
+ outLayerID = instanceID;
+}
+
void VS_Clear_FL9( in float4 inPosition : POSITION,
out float4 outPosition : SV_POSITION)
{
outPosition = inPosition;
}
+// Geometry shader for clearing multiview layered textures
+struct GS_INPUT
+{
+ float4 inPosition : SV_Position;
+ uint inLayerID : TEXCOORD0;
+};
+
+struct GS_OUTPUT
+{
+ float4 outPosition : SV_Position;
+ uint outLayerID : SV_RenderTargetArrayIndex;
+};
+
+[maxvertexcount(3)]
+void GS_Multiview_Clear(triangle GS_INPUT input[3], inout TriangleStream<GS_OUTPUT> outStream)
+{
+ GS_OUTPUT output = (GS_OUTPUT)0;
+ for (int i = 0; i < 3; i++)
+ {
+ output.outPosition = input[i].inPosition;
+ output.outLayerID = input[i].inLayerID;
+ outStream.Append(output);
+ }
+ outStream.RestartStrip();
+}
+
// Pixel Shader Constant Buffers
cbuffer ColorAndDepthDataFloat : register(b0)
{
@@ -55,6 +91,11 @@ cbuffer ColorAndDepthDataUint : register(b0)
float zValueF_Uint : packoffset(c1);
}
+cbuffer DepthOnlyData : register(b0)
+{
+ float zValue_Depth : packoffset(c1);
+}
+
// Pixel Shader Output Structs
struct PS_OutputFloat_FL9
{
@@ -65,7 +106,70 @@ struct PS_OutputFloat_FL9
float depth : SV_DEPTH;
};
-struct PS_OutputFloat
+struct PS_OutputFloat1
+{
+ float4 color0 : SV_TARGET0;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputFloat2
+{
+ float4 color0 : SV_TARGET0;
+ float4 color1 : SV_TARGET1;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputFloat3
+{
+ float4 color0 : SV_TARGET0;
+ float4 color1 : SV_TARGET1;
+ float4 color2 : SV_TARGET2;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputFloat4
+{
+ float4 color0 : SV_TARGET0;
+ float4 color1 : SV_TARGET1;
+ float4 color2 : SV_TARGET2;
+ float4 color3 : SV_TARGET3;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputFloat5
+{
+ float4 color0 : SV_TARGET0;
+ float4 color1 : SV_TARGET1;
+ float4 color2 : SV_TARGET2;
+ float4 color3 : SV_TARGET3;
+ float4 color4 : SV_TARGET4;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputFloat6
+{
+ float4 color0 : SV_TARGET0;
+ float4 color1 : SV_TARGET1;
+ float4 color2 : SV_TARGET2;
+ float4 color3 : SV_TARGET3;
+ float4 color4 : SV_TARGET4;
+ float4 color5 : SV_TARGET5;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputFloat7
+{
+ float4 color0 : SV_TARGET0;
+ float4 color1 : SV_TARGET1;
+ float4 color2 : SV_TARGET2;
+ float4 color3 : SV_TARGET3;
+ float4 color4 : SV_TARGET4;
+ float4 color5 : SV_TARGET5;
+ float4 color6 : SV_TARGET6;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputFloat8
{
float4 color0 : SV_TARGET0;
float4 color1 : SV_TARGET1;
@@ -78,7 +182,70 @@ struct PS_OutputFloat
float depth : SV_DEPTH;
};
-struct PS_OutputUint
+struct PS_OutputUint1
+{
+ uint4 color0 : SV_TARGET0;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputUint2
+{
+ uint4 color0 : SV_TARGET0;
+ uint4 color1 : SV_TARGET1;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputUint3
+{
+ uint4 color0 : SV_TARGET0;
+ uint4 color1 : SV_TARGET1;
+ uint4 color2 : SV_TARGET2;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputUint4
+{
+ uint4 color0 : SV_TARGET0;
+ uint4 color1 : SV_TARGET1;
+ uint4 color2 : SV_TARGET2;
+ uint4 color3 : SV_TARGET3;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputUint5
+{
+ uint4 color0 : SV_TARGET0;
+ uint4 color1 : SV_TARGET1;
+ uint4 color2 : SV_TARGET2;
+ uint4 color3 : SV_TARGET3;
+ uint4 color4 : SV_TARGET4;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputUint6
+{
+ uint4 color0 : SV_TARGET0;
+ uint4 color1 : SV_TARGET1;
+ uint4 color2 : SV_TARGET2;
+ uint4 color3 : SV_TARGET3;
+ uint4 color4 : SV_TARGET4;
+ uint4 color5 : SV_TARGET5;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputUint7
+{
+ uint4 color0 : SV_TARGET0;
+ uint4 color1 : SV_TARGET1;
+ uint4 color2 : SV_TARGET2;
+ uint4 color3 : SV_TARGET3;
+ uint4 color4 : SV_TARGET4;
+ uint4 color5 : SV_TARGET5;
+ uint4 color6 : SV_TARGET6;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputUint8
{
uint4 color0 : SV_TARGET0;
uint4 color1 : SV_TARGET1;
@@ -91,7 +258,70 @@ struct PS_OutputUint
float depth : SV_DEPTH;
};
-struct PS_OutputSint
+struct PS_OutputSint1
+{
+ int4 color0 : SV_TARGET0;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputSint2
+{
+ int4 color0 : SV_TARGET0;
+ int4 color1 : SV_TARGET1;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputSint3
+{
+ int4 color0 : SV_TARGET0;
+ int4 color1 : SV_TARGET1;
+ int4 color2 : SV_TARGET2;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputSint4
+{
+ int4 color0 : SV_TARGET0;
+ int4 color1 : SV_TARGET1;
+ int4 color2 : SV_TARGET2;
+ int4 color3 : SV_TARGET3;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputSint5
+{
+ int4 color0 : SV_TARGET0;
+ int4 color1 : SV_TARGET1;
+ int4 color2 : SV_TARGET2;
+ int4 color3 : SV_TARGET3;
+ int4 color4 : SV_TARGET4;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputSint6
+{
+ int4 color0 : SV_TARGET0;
+ int4 color1 : SV_TARGET1;
+ int4 color2 : SV_TARGET2;
+ int4 color3 : SV_TARGET3;
+ int4 color4 : SV_TARGET4;
+ int4 color5 : SV_TARGET5;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputSint7
+{
+ int4 color0 : SV_TARGET0;
+ int4 color1 : SV_TARGET1;
+ int4 color2 : SV_TARGET2;
+ int4 color3 : SV_TARGET3;
+ int4 color4 : SV_TARGET4;
+ int4 color5 : SV_TARGET5;
+ int4 color6 : SV_TARGET6;
+ float depth : SV_DEPTH;
+};
+
+struct PS_OutputSint8
{
int4 color0 : SV_TARGET0;
int4 color1 : SV_TARGET1;
@@ -104,6 +334,11 @@ struct PS_OutputSint
float depth : SV_DEPTH;
};
+struct PS_OutputDepth
+{
+ float depth : SV_DEPTH;
+};
+
// Pixel Shaders
PS_OutputFloat_FL9 PS_ClearFloat_FL9(in float4 inPosition : SV_POSITION)
{
@@ -116,9 +351,86 @@ PS_OutputFloat_FL9 PS_ClearFloat_FL9(in float4 inPosition : SV_POSITION)
return outData;
}
-PS_OutputFloat PS_ClearFloat(in float4 inPosition : SV_POSITION)
+PS_OutputFloat1 PS_ClearFloat1(in float4 inPosition : SV_POSITION)
{
- PS_OutputFloat outData;
+ PS_OutputFloat1 outData;
+ outData.color0 = color_Float;
+ outData.depth = zValueF_Float;
+ return outData;
+}
+
+PS_OutputFloat2 PS_ClearFloat2(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputFloat2 outData;
+ outData.color0 = color_Float;
+ outData.color1 = color_Float;
+ outData.depth = zValueF_Float;
+ return outData;
+}
+
+PS_OutputFloat3 PS_ClearFloat3(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputFloat3 outData;
+ outData.color0 = color_Float;
+ outData.color1 = color_Float;
+ outData.color2 = color_Float;
+ outData.depth = zValueF_Float;
+ return outData;
+}
+
+PS_OutputFloat4 PS_ClearFloat4(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputFloat4 outData;
+ outData.color0 = color_Float;
+ outData.color1 = color_Float;
+ outData.color2 = color_Float;
+ outData.color3 = color_Float;
+ outData.depth = zValueF_Float;
+ return outData;
+}
+
+PS_OutputFloat5 PS_ClearFloat5(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputFloat5 outData;
+ outData.color0 = color_Float;
+ outData.color1 = color_Float;
+ outData.color2 = color_Float;
+ outData.color3 = color_Float;
+ outData.color4 = color_Float;
+ outData.depth = zValueF_Float;
+ return outData;
+}
+
+PS_OutputFloat6 PS_ClearFloat6(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputFloat6 outData;
+ outData.color0 = color_Float;
+ outData.color1 = color_Float;
+ outData.color2 = color_Float;
+ outData.color3 = color_Float;
+ outData.color4 = color_Float;
+ outData.color5 = color_Float;
+ outData.depth = zValueF_Float;
+ return outData;
+}
+
+PS_OutputFloat7 PS_ClearFloat7(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputFloat7 outData;
+ outData.color0 = color_Float;
+ outData.color1 = color_Float;
+ outData.color2 = color_Float;
+ outData.color3 = color_Float;
+ outData.color4 = color_Float;
+ outData.color5 = color_Float;
+ outData.color6 = color_Float;
+ outData.depth = zValueF_Float;
+ return outData;
+}
+
+PS_OutputFloat8 PS_ClearFloat8(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputFloat8 outData;
outData.color0 = color_Float;
outData.color1 = color_Float;
outData.color2 = color_Float;
@@ -131,9 +443,86 @@ PS_OutputFloat PS_ClearFloat(in float4 inPosition : SV_POSITION)
return outData;
}
-PS_OutputUint PS_ClearUint(in float4 inPosition : SV_POSITION)
+PS_OutputUint1 PS_ClearUint1(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputUint1 outData;
+ outData.color0 = color_Uint;
+ outData.depth = zValueF_Uint;
+ return outData;
+}
+
+PS_OutputUint2 PS_ClearUint2(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputUint2 outData;
+ outData.color0 = color_Uint;
+ outData.color1 = color_Uint;
+ outData.depth = zValueF_Uint;
+ return outData;
+}
+
+PS_OutputUint3 PS_ClearUint3(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputUint3 outData;
+ outData.color0 = color_Uint;
+ outData.color1 = color_Uint;
+ outData.color2 = color_Uint;
+ outData.depth = zValueF_Uint;
+ return outData;
+}
+
+PS_OutputUint4 PS_ClearUint4(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputUint4 outData;
+ outData.color0 = color_Uint;
+ outData.color1 = color_Uint;
+ outData.color2 = color_Uint;
+ outData.color3 = color_Uint;
+ outData.depth = zValueF_Uint;
+ return outData;
+}
+
+PS_OutputUint5 PS_ClearUint5(in float4 inPosition : SV_POSITION)
{
- PS_OutputUint outData;
+ PS_OutputUint5 outData;
+ outData.color0 = color_Uint;
+ outData.color1 = color_Uint;
+ outData.color2 = color_Uint;
+ outData.color3 = color_Uint;
+ outData.color4 = color_Uint;
+ outData.depth = zValueF_Uint;
+ return outData;
+}
+
+PS_OutputUint6 PS_ClearUint6(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputUint6 outData;
+ outData.color0 = color_Uint;
+ outData.color1 = color_Uint;
+ outData.color2 = color_Uint;
+ outData.color3 = color_Uint;
+ outData.color4 = color_Uint;
+ outData.color5 = color_Uint;
+ outData.depth = zValueF_Uint;
+ return outData;
+}
+
+PS_OutputUint7 PS_ClearUint7(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputUint7 outData;
+ outData.color0 = color_Uint;
+ outData.color1 = color_Uint;
+ outData.color2 = color_Uint;
+ outData.color3 = color_Uint;
+ outData.color4 = color_Uint;
+ outData.color5 = color_Uint;
+ outData.color6 = color_Uint;
+ outData.depth = zValueF_Uint;
+ return outData;
+}
+
+PS_OutputUint8 PS_ClearUint8(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputUint8 outData;
outData.color0 = color_Uint;
outData.color1 = color_Uint;
outData.color2 = color_Uint;
@@ -146,9 +535,86 @@ PS_OutputUint PS_ClearUint(in float4 inPosition : SV_POSITION)
return outData;
}
-PS_OutputSint PS_ClearSint(in float4 inPosition : SV_POSITION)
+PS_OutputSint1 PS_ClearSint1(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputSint1 outData;
+ outData.color0 = color_Sint;
+ outData.depth = zValueF_Sint;
+ return outData;
+}
+
+PS_OutputSint2 PS_ClearSint2(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputSint2 outData;
+ outData.color0 = color_Sint;
+ outData.color1 = color_Sint;
+ outData.depth = zValueF_Sint;
+ return outData;
+}
+
+PS_OutputSint3 PS_ClearSint3(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputSint3 outData;
+ outData.color0 = color_Sint;
+ outData.color1 = color_Sint;
+ outData.color2 = color_Sint;
+ outData.depth = zValueF_Sint;
+ return outData;
+}
+
+PS_OutputSint4 PS_ClearSint4(in float4 inPosition : SV_POSITION)
{
- PS_OutputSint outData;
+ PS_OutputSint4 outData;
+ outData.color0 = color_Sint;
+ outData.color1 = color_Sint;
+ outData.color2 = color_Sint;
+ outData.color3 = color_Sint;
+ outData.depth = zValueF_Sint;
+ return outData;
+}
+
+PS_OutputSint5 PS_ClearSint5(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputSint5 outData;
+ outData.color0 = color_Sint;
+ outData.color1 = color_Sint;
+ outData.color2 = color_Sint;
+ outData.color3 = color_Sint;
+ outData.color4 = color_Sint;
+ outData.depth = zValueF_Sint;
+ return outData;
+}
+
+PS_OutputSint6 PS_ClearSint6(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputSint6 outData;
+ outData.color0 = color_Sint;
+ outData.color1 = color_Sint;
+ outData.color2 = color_Sint;
+ outData.color3 = color_Sint;
+ outData.color4 = color_Sint;
+ outData.color5 = color_Sint;
+ outData.depth = zValueF_Sint;
+ return outData;
+}
+
+PS_OutputSint7 PS_ClearSint7(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputSint7 outData;
+ outData.color0 = color_Sint;
+ outData.color1 = color_Sint;
+ outData.color2 = color_Sint;
+ outData.color3 = color_Sint;
+ outData.color4 = color_Sint;
+ outData.color5 = color_Sint;
+ outData.color6 = color_Sint;
+ outData.depth = zValueF_Sint;
+ return outData;
+}
+
+PS_OutputSint8 PS_ClearSint8(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputSint8 outData;
outData.color0 = color_Sint;
outData.color1 = color_Sint;
outData.color2 = color_Sint;
@@ -159,4 +625,11 @@ PS_OutputSint PS_ClearSint(in float4 inPosition : SV_POSITION)
outData.color7 = color_Sint;
outData.depth = zValueF_Sint;
return outData;
-} \ No newline at end of file
+}
+
+PS_OutputDepth PS_ClearDepth(in float4 inPosition : SV_POSITION)
+{
+ PS_OutputDepth outData;
+ outData.depth = zValue_Depth;
+ return outData;
+}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewgs.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewgs.h
new file mode 100644
index 00000000000..870f4156cc8
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewgs.h
@@ -0,0 +1,84 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_Position 0 xyzw 0 POS float xyzw
+// TEXCOORD 0 x 1 NONE uint x
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_Position 0 xyzw 0 POS float xyzw
+// SV_RenderTargetArrayIndex 0 x 1 RTINDEX uint x
+//
+gs_4_0
+dcl_input_siv v[3][0].xyzw, position
+dcl_input v[3][1].x
+dcl_temps 1
+dcl_inputprimitive triangle
+dcl_outputtopology trianglestrip
+dcl_output_siv o0.xyzw, position
+dcl_output_siv o1.x, rendertarget_array_index
+dcl_maxout 3
+mov r0.x, l(0)
+loop
+ ige r0.y, r0.x, l(3)
+ breakc_nz r0.y
+ mov o0.xyzw, v[r0.x + 0][0].xyzw
+ mov o1.x, v[r0.x + 0][1].x
+ emit
+ iadd r0.x, r0.x, l(1)
+endloop
+cut
+ret
+// Approximately 11 instruction slots used
+#endif
+
+const BYTE g_GS_Multiview_Clear[] = {
+ 68, 88, 66, 67, 244, 54, 208, 241, 128, 215, 208, 159, 113, 168, 148, 173, 167, 24, 78,
+ 189, 1, 0, 0, 0, 216, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 140, 0,
+ 0, 0, 228, 0, 0, 0, 76, 1, 0, 0, 92, 2, 0, 0, 82, 68, 69, 70, 80,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 83, 71, 0, 1, 0, 0, 28, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111,
+ 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32,
+ 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49,
+ 54, 51, 56, 52, 0, 171, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0,
+ 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 15, 15, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 83, 86, 95, 80, 111,
+ 115, 105, 116, 105, 111, 110, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171,
+ 79, 83, 71, 78, 96, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 1, 14, 0, 0, 83, 86, 95, 80, 111, 115, 105, 116, 105, 111, 110, 0,
+ 83, 86, 95, 82, 101, 110, 100, 101, 114, 84, 97, 114, 103, 101, 116, 65, 114, 114, 97,
+ 121, 73, 110, 100, 101, 120, 0, 171, 171, 83, 72, 68, 82, 8, 1, 0, 0, 64, 0,
+ 2, 0, 66, 0, 0, 0, 97, 0, 0, 5, 242, 16, 32, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 1, 0, 0, 0, 95, 0, 0, 4, 18, 16, 32, 0, 3, 0, 0, 0,
+ 1, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0, 93, 24, 0, 1, 92, 40, 0,
+ 1, 103, 0, 0, 4, 242, 32, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 103, 0,
+ 0, 4, 18, 32, 16, 0, 1, 0, 0, 0, 4, 0, 0, 0, 94, 0, 0, 2, 3,
+ 0, 0, 0, 54, 0, 0, 5, 18, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0,
+ 0, 0, 0, 0, 48, 0, 0, 1, 33, 0, 0, 7, 34, 0, 16, 0, 0, 0, 0,
+ 0, 10, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 3, 0, 0, 0, 3, 0,
+ 4, 3, 26, 0, 16, 0, 0, 0, 0, 0, 54, 0, 0, 7, 242, 32, 16, 0, 0,
+ 0, 0, 0, 70, 30, 160, 0, 10, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 54, 0, 0, 7, 18, 32, 16, 0, 1, 0, 0, 0, 10, 16, 160, 0, 10, 0, 16,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 19, 0, 0, 1, 30, 0, 0, 7, 18, 0,
+ 16, 0, 0, 0, 0, 0, 10, 0, 16, 0, 0, 0, 0, 0, 1, 64, 0, 0, 1,
+ 0, 0, 0, 22, 0, 0, 1, 9, 0, 0, 1, 62, 0, 0, 1, 83, 84, 65, 84,
+ 116, 0, 0, 0, 11, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 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, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 5, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewvs.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewvs.h
new file mode 100644
index 00000000000..bc2c19663e8
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11multiviewvs.h
@@ -0,0 +1,81 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_VertexID 0 x 0 VERTID uint x
+// SV_InstanceID 0 x 1 INSTID uint x
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float xyzw
+// TEXCOORD 0 x 1 NONE uint x
+//
+vs_4_0
+dcl_immediateConstantBuffer { { -1.000000, 1.000000, 0, 0},
+ { 1.000000, -1.000000, 0, 0},
+ { -1.000000, -1.000000, 0, 0},
+ { -1.000000, 1.000000, 0, 0},
+ { 1.000000, 1.000000, 0, 0},
+ { 1.000000, -1.000000, 0, 0} }
+dcl_input_sgv v0.x, vertex_id
+dcl_input_sgv v1.x, instance_id
+dcl_output_siv o0.xyzw, position
+dcl_output o1.x
+dcl_temps 1
+mov r0.x, v0.x
+mov o0.xy, icb[r0.x + 0].xyxx
+mov o0.zw, l(0,0,0,1.000000)
+mov o1.x, v1.x
+ret
+// Approximately 5 instruction slots used
+#endif
+
+const BYTE g_VS_Multiview_Clear[] = {
+ 68, 88, 66, 67, 45, 246, 70, 124, 58, 101, 157, 14, 171, 136, 167, 118, 133, 161, 59,
+ 68, 1, 0, 0, 0, 220, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 140, 0,
+ 0, 0, 232, 0, 0, 0, 64, 1, 0, 0, 96, 2, 0, 0, 82, 68, 69, 70, 80,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 254, 255, 0, 1, 0, 0, 28, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111,
+ 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32,
+ 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49,
+ 54, 51, 56, 52, 0, 171, 171, 73, 83, 71, 78, 84, 0, 0, 0, 2, 0, 0, 0,
+ 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 1, 1, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 8, 0,
+ 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 83, 86, 95, 86, 101,
+ 114, 116, 101, 120, 73, 68, 0, 83, 86, 95, 73, 110, 115, 116, 97, 110, 99, 101, 73,
+ 68, 0, 171, 171, 79, 83, 71, 78, 80, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0,
+ 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0,
+ 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
+ 0, 0, 0, 1, 0, 0, 0, 1, 14, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84,
+ 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171, 171, 171, 83, 72, 68,
+ 82, 24, 1, 0, 0, 64, 0, 1, 0, 70, 0, 0, 0, 53, 24, 0, 0, 26, 0,
+ 0, 0, 0, 0, 128, 191, 0, 0, 128, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 128, 63, 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191,
+ 0, 0, 128, 191, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 191, 0, 0, 128,
+ 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 63, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 0, 0, 128, 191, 0, 0, 0, 0, 0,
+ 0, 0, 0, 96, 0, 0, 4, 18, 16, 16, 0, 0, 0, 0, 0, 6, 0, 0, 0,
+ 96, 0, 0, 4, 18, 16, 16, 0, 1, 0, 0, 0, 8, 0, 0, 0, 103, 0, 0,
+ 4, 242, 32, 16, 0, 0, 0, 0, 0, 1, 0, 0, 0, 101, 0, 0, 3, 18, 32,
+ 16, 0, 1, 0, 0, 0, 104, 0, 0, 2, 1, 0, 0, 0, 54, 0, 0, 5, 18,
+ 0, 16, 0, 0, 0, 0, 0, 10, 16, 16, 0, 0, 0, 0, 0, 54, 0, 0, 6,
+ 50, 32, 16, 0, 0, 0, 0, 0, 70, 144, 144, 0, 10, 0, 16, 0, 0, 0, 0,
+ 0, 54, 0, 0, 8, 194, 32, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 63, 54, 0, 0, 5, 18,
+ 32, 16, 0, 1, 0, 0, 0, 10, 16, 16, 0, 1, 0, 0, 0, 62, 0, 0, 1,
+ 83, 84, 65, 84, 116, 0, 0, 0, 5, 0, 0, 0, 1, 0, 0, 0, 6, 0, 0,
+ 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 4, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/cleardepth11ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/cleardepth11ps.h
new file mode 100644
index 00000000000..dab2e9e7b46
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/cleardepth11ps.h
@@ -0,0 +1,75 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer DepthOnlyData
+// {
+//
+// float zValue_Depth; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// DepthOnlyData cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output oDepth
+mov oDepth, cb0[1].x
+ret
+// Approximately 2 instruction slots used
+#endif
+
+const BYTE g_PS_ClearDepth[] = {
+ 68, 88, 66, 67, 118, 105, 246, 232, 152, 45, 90, 172, 38, 100, 140, 153, 229, 217, 123,
+ 120, 1, 0, 0, 0, 48, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 12, 1,
+ 0, 0, 64, 1, 0, 0, 116, 1, 0, 0, 180, 1, 0, 0, 82, 68, 69, 70, 208,
+ 0, 0, 0, 1, 0, 0, 0, 76, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 156, 0, 0, 0, 60, 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, 1, 0, 0, 0, 68, 101, 112, 116, 104, 79, 110, 108, 121, 68, 97, 116, 97,
+ 0, 171, 171, 60, 0, 0, 0, 1, 0, 0, 0, 100, 0, 0, 0, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 124, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0,
+ 0, 2, 0, 0, 0, 140, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97, 108, 117, 101,
+ 95, 68, 101, 112, 116, 104, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0, 1, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82,
+ 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105,
+ 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51, 56, 52, 0,
+ 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32,
+ 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
+ 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 79, 83, 71,
+ 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83,
+ 86, 95, 68, 69, 80, 84, 72, 0, 171, 171, 171, 83, 72, 68, 82, 56, 0, 0, 0,
+ 64, 0, 0, 0, 14, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0,
+ 0, 2, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 5, 1, 192,
+ 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83,
+ 84, 65, 84, 116, 0, 0, 0, 2, 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, 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, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h
deleted file mode 100644
index f54ac3d8bea..00000000000
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h
+++ /dev/null
@@ -1,257 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
-//
-//
-// Buffer Definitions:
-//
-// cbuffer ColorAndDepthDataFloat
-// {
-//
-// float4 color_Float; // Offset: 0 Size: 16
-// float zValueF_Float; // Offset: 16 Size: 4
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name Type Format Dim Slot Elements
-// ------------------------------ ---------- ------- ----------- ---- --------
-// ColorAndDepthDataFloat cbuffer NA NA 0 1
-//
-//
-//
-// Input signature:
-//
-// Name Index Mask Register SysValue Format Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_POSITION 0 xyzw 0 POS float
-//
-//
-// Output signature:
-//
-// Name Index Mask Register SysValue Format Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_TARGET 0 xyzw 0 TARGET float xyzw
-// SV_TARGET 1 xyzw 1 TARGET float xyzw
-// SV_TARGET 2 xyzw 2 TARGET float xyzw
-// SV_TARGET 3 xyzw 3 TARGET float xyzw
-// SV_TARGET 4 xyzw 4 TARGET float xyzw
-// SV_TARGET 5 xyzw 5 TARGET float xyzw
-// SV_TARGET 6 xyzw 6 TARGET float xyzw
-// SV_TARGET 7 xyzw 7 TARGET float xyzw
-// SV_DEPTH 0 N/A oDepth DEPTH float YES
-//
-ps_4_0
-dcl_constantbuffer cb0[2], immediateIndexed
-dcl_output o0.xyzw
-dcl_output o1.xyzw
-dcl_output o2.xyzw
-dcl_output o3.xyzw
-dcl_output o4.xyzw
-dcl_output o5.xyzw
-dcl_output o6.xyzw
-dcl_output o7.xyzw
-dcl_output oDepth
-mov o0.xyzw, cb0[0].xyzw
-mov o1.xyzw, cb0[0].xyzw
-mov o2.xyzw, cb0[0].xyzw
-mov o3.xyzw, cb0[0].xyzw
-mov o4.xyzw, cb0[0].xyzw
-mov o5.xyzw, cb0[0].xyzw
-mov o6.xyzw, cb0[0].xyzw
-mov o7.xyzw, cb0[0].xyzw
-mov oDepth, cb0[1].x
-ret
-// Approximately 10 instruction slots used
-#endif
-
-const BYTE g_PS_ClearFloat[] =
-{
- 68, 88, 66, 67, 0, 45,
- 15, 86, 227, 217, 47, 173,
- 72, 182, 197, 224, 178, 165,
- 77, 73, 1, 0, 0, 0,
- 84, 4, 0, 0, 5, 0,
- 0, 0, 52, 0, 0, 0,
- 72, 1, 0, 0, 124, 1,
- 0, 0, 120, 2, 0, 0,
- 216, 3, 0, 0, 82, 68,
- 69, 70, 12, 1, 0, 0,
- 1, 0, 0, 0, 84, 0,
- 0, 0, 1, 0, 0, 0,
- 28, 0, 0, 0, 0, 4,
- 255, 255, 0, 1, 0, 0,
- 216, 0, 0, 0, 60, 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, 1, 0, 0, 0,
- 67, 111, 108, 111, 114, 65,
- 110, 100, 68, 101, 112, 116,
- 104, 68, 97, 116, 97, 70,
- 108, 111, 97, 116, 0, 171,
- 60, 0, 0, 0, 2, 0,
- 0, 0, 108, 0, 0, 0,
- 32, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 156, 0, 0, 0, 0, 0,
- 0, 0, 16, 0, 0, 0,
- 2, 0, 0, 0, 168, 0,
- 0, 0, 0, 0, 0, 0,
- 184, 0, 0, 0, 16, 0,
- 0, 0, 4, 0, 0, 0,
- 2, 0, 0, 0, 200, 0,
- 0, 0, 0, 0, 0, 0,
- 99, 111, 108, 111, 114, 95,
- 70, 108, 111, 97, 116, 0,
- 1, 0, 3, 0, 1, 0,
- 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 122, 86,
- 97, 108, 117, 101, 70, 95,
- 70, 108, 111, 97, 116, 0,
- 171, 171, 0, 0, 3, 0,
- 1, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 77, 105, 99, 114, 111, 115,
- 111, 102, 116, 32, 40, 82,
- 41, 32, 72, 76, 83, 76,
- 32, 83, 104, 97, 100, 101,
- 114, 32, 67, 111, 109, 112,
- 105, 108, 101, 114, 32, 54,
- 46, 51, 46, 57, 54, 48,
- 48, 46, 49, 54, 51, 56,
- 52, 0, 171, 171, 73, 83,
- 71, 78, 44, 0, 0, 0,
- 1, 0, 0, 0, 8, 0,
- 0, 0, 32, 0, 0, 0,
- 0, 0, 0, 0, 1, 0,
- 0, 0, 3, 0, 0, 0,
- 0, 0, 0, 0, 15, 0,
- 0, 0, 83, 86, 95, 80,
- 79, 83, 73, 84, 73, 79,
- 78, 0, 79, 83, 71, 78,
- 244, 0, 0, 0, 9, 0,
- 0, 0, 8, 0, 0, 0,
- 224, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 0, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 1, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 2, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 2, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 3, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 3, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 4, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 4, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 5, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 5, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 6, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 6, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 7, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 7, 0,
- 0, 0, 15, 0, 0, 0,
- 234, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 255, 255,
- 255, 255, 1, 14, 0, 0,
- 83, 86, 95, 84, 65, 82,
- 71, 69, 84, 0, 83, 86,
- 95, 68, 69, 80, 84, 72,
- 0, 171, 83, 72, 68, 82,
- 88, 1, 0, 0, 64, 0,
- 0, 0, 86, 0, 0, 0,
- 89, 0, 0, 4, 70, 142,
- 32, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 0, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 1, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 2, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 3, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 4, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 5, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 6, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 7, 0, 0, 0, 101, 0,
- 0, 2, 1, 192, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 0, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 1, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 2, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 3, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 4, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 5, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 6, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 7, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 5, 1, 192,
- 0, 0, 10, 128, 32, 0,
- 0, 0, 0, 0, 1, 0,
- 0, 0, 62, 0, 0, 1,
- 83, 84, 65, 84, 116, 0,
- 0, 0, 10, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 9, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 9, 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
-};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps1.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps1.h
new file mode 100644
index 00000000000..4cba9bcf7a2
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps1.h
@@ -0,0 +1,86 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 3 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat1[] = {
+ 68, 88, 66, 67, 193, 98, 147, 208, 43, 53, 161, 136, 243, 53, 114, 47, 211, 102, 138,
+ 40, 1, 0, 0, 0, 176, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 208, 1, 0, 0, 52, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 76, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255,
+ 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86,
+ 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 92, 0, 0, 0, 64, 0, 0,
+ 0, 23, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 2, 1,
+ 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 2, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps2.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps2.h
new file mode 100644
index 00000000000..a54484148a2
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps2.h
@@ -0,0 +1,92 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_TARGET 1 xyzw 1 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 4 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat2[] = {
+ 68, 88, 66, 67, 108, 104, 239, 227, 97, 196, 142, 3, 142, 195, 239, 186, 183, 205, 245,
+ 112, 1, 0, 0, 0, 236, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 232, 1, 0, 0, 112, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 100, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71,
+ 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 128, 0,
+ 0, 0, 64, 0, 0, 0, 32, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0,
+ 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0,
+ 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70,
+ 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0,
+ 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65,
+ 84, 116, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps3.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps3.h
new file mode 100644
index 00000000000..88a9b6ce592
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps3.h
@@ -0,0 +1,98 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_TARGET 1 xyzw 1 TARGET float xyzw
+// SV_TARGET 2 xyzw 2 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 5 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat3[] = {
+ 68, 88, 66, 67, 84, 28, 124, 78, 93, 18, 144, 54, 107, 173, 223, 168, 80, 58, 53,
+ 212, 1, 0, 0, 0, 40, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 0, 2, 0, 0, 172, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 124, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 104, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 104, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 104, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86,
+ 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83,
+ 72, 68, 82, 164, 0, 0, 0, 64, 0, 0, 0, 41, 0, 0, 0, 89, 0, 0, 4,
+ 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16,
+ 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0,
+ 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0,
+ 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1,
+ 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1,
+ 83, 84, 65, 84, 116, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 4, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps4.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps4.h
new file mode 100644
index 00000000000..97281b18eba
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps4.h
@@ -0,0 +1,104 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_TARGET 1 xyzw 1 TARGET float xyzw
+// SV_TARGET 2 xyzw 2 TARGET float xyzw
+// SV_TARGET 3 xyzw 3 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 6 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat4[] = {
+ 68, 88, 66, 67, 207, 141, 9, 109, 48, 1, 5, 41, 68, 133, 156, 207, 12, 211, 147,
+ 112, 1, 0, 0, 0, 100, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 24, 2, 0, 0, 232, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 148, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 128, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 128, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 128, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 128, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 138, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1,
+ 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80,
+ 84, 72, 0, 171, 83, 72, 68, 82, 200, 0, 0, 0, 64, 0, 0, 0, 50, 0, 0,
+ 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0,
+ 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1,
+ 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3,
+ 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0,
+ 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0,
+ 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16,
+ 0, 3, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0,
+ 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62,
+ 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps5.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps5.h
new file mode 100644
index 00000000000..af69c011168
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps5.h
@@ -0,0 +1,110 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_TARGET 1 xyzw 1 TARGET float xyzw
+// SV_TARGET 2 xyzw 2 TARGET float xyzw
+// SV_TARGET 3 xyzw 3 TARGET float xyzw
+// SV_TARGET 4 xyzw 4 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 7 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat5[] = {
+ 68, 88, 66, 67, 110, 251, 0, 120, 207, 72, 250, 15, 78, 51, 222, 23, 61, 180, 247,
+ 36, 1, 0, 0, 0, 160, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 48, 2, 0, 0, 36, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 172, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 152, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 152, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 152, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 152, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 152, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83,
+ 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 236, 0, 0, 0, 64, 0,
+ 0, 0, 59, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2,
+ 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3,
+ 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0,
+ 0, 101, 0, 0, 3, 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 4, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242,
+ 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142,
+ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3,
+ 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6,
+ 242, 32, 16, 0, 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps6.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps6.h
new file mode 100644
index 00000000000..6d0f73c3481
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps6.h
@@ -0,0 +1,116 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_TARGET 1 xyzw 1 TARGET float xyzw
+// SV_TARGET 2 xyzw 2 TARGET float xyzw
+// SV_TARGET 3 xyzw 3 TARGET float xyzw
+// SV_TARGET 4 xyzw 4 TARGET float xyzw
+// SV_TARGET 5 xyzw 5 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 8 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat6[] = {
+ 68, 88, 66, 67, 89, 150, 245, 198, 63, 119, 94, 62, 185, 247, 214, 162, 19, 194, 96,
+ 152, 1, 0, 0, 0, 220, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 72, 2, 0, 0, 96, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 196, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 176, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 176, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 176, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 176, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 176, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 176, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82,
+ 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 16,
+ 1, 0, 0, 64, 0, 0, 0, 68, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0,
+ 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 3, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 4, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 5, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16,
+ 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0,
+ 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0,
+ 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32,
+ 16, 0, 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 8, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps7.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps7.h
new file mode 100644
index 00000000000..06467129214
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps7.h
@@ -0,0 +1,123 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_TARGET 1 xyzw 1 TARGET float xyzw
+// SV_TARGET 2 xyzw 2 TARGET float xyzw
+// SV_TARGET 3 xyzw 3 TARGET float xyzw
+// SV_TARGET 4 xyzw 4 TARGET float xyzw
+// SV_TARGET 5 xyzw 5 TARGET float xyzw
+// SV_TARGET 6 xyzw 6 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output o6.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov o6.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 9 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat7[] = {
+ 68, 88, 66, 67, 148, 239, 191, 126, 102, 53, 77, 186, 61, 158, 28, 92, 123, 95, 81,
+ 17, 1, 0, 0, 0, 24, 4, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 96, 2, 0, 0, 156, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 220, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 200, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 200, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 200, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 200, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 210, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83,
+ 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171,
+ 83, 72, 68, 82, 52, 1, 0, 0, 64, 0, 0, 0, 77, 0, 0, 0, 89, 0, 0,
+ 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 3, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 4, 0, 0, 0, 101, 0, 0,
+ 3, 242, 32, 16, 0, 5, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 6, 0,
+ 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0,
+ 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6,
+ 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0, 0, 70,
+ 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0,
+ 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0,
+ 6, 242, 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 6, 0, 0, 0, 70, 142, 32, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 8, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps8.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps8.h
new file mode 100644
index 00000000000..a0ca6e16653
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps8.h
@@ -0,0 +1,129 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataFloat
+// {
+//
+// float4 color_Float; // Offset: 0 Size: 16
+// float zValueF_Float; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataFloat cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET float xyzw
+// SV_TARGET 1 xyzw 1 TARGET float xyzw
+// SV_TARGET 2 xyzw 2 TARGET float xyzw
+// SV_TARGET 3 xyzw 3 TARGET float xyzw
+// SV_TARGET 4 xyzw 4 TARGET float xyzw
+// SV_TARGET 5 xyzw 5 TARGET float xyzw
+// SV_TARGET 6 xyzw 6 TARGET float xyzw
+// SV_TARGET 7 xyzw 7 TARGET float xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output o6.xyzw
+dcl_output o7.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov o6.xyzw, cb0[0].xyzw
+mov o7.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 10 instruction slots used
+#endif
+
+const BYTE g_PS_ClearFloat8[] = {
+ 68, 88, 66, 67, 0, 45, 15, 86, 227, 217, 47, 173, 72, 182, 197, 224, 178, 165, 77,
+ 73, 1, 0, 0, 0, 84, 4, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 120, 2, 0, 0, 216, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 70, 108, 111, 97, 116, 0, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 70, 108, 111, 97, 116, 0,
+ 1, 0, 3, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 70, 108, 111, 97, 116, 0, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 244, 0, 0, 0, 9, 0, 0, 0, 8, 0, 0, 0, 224, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 224, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 224, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 224, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 7, 0,
+ 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 7, 0, 0, 0, 15, 0, 0, 0, 234,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255,
+ 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69,
+ 80, 84, 72, 0, 171, 83, 72, 68, 82, 88, 1, 0, 0, 64, 0, 0, 0, 86, 0,
+ 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0,
+ 3, 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 4, 0,
+ 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 5, 0, 0, 0, 101, 0, 0, 3, 242,
+ 32, 16, 0, 6, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 7, 0, 0, 0,
+ 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0,
+ 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32,
+ 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0, 0, 70, 142, 32,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 4, 0,
+ 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242,
+ 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 54, 0, 0, 6, 242, 32, 16, 0, 6, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 7, 0, 0, 0, 70, 142,
+ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10,
+ 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84,
+ 116, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h
deleted file mode 100644
index 385a7518ba5..00000000000
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h
+++ /dev/null
@@ -1,257 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
-//
-//
-// Buffer Definitions:
-//
-// cbuffer ColorAndDepthDataSint
-// {
-//
-// int4 color_Sint; // Offset: 0 Size: 16
-// float zValueF_Sint; // Offset: 16 Size: 4
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name Type Format Dim Slot Elements
-// ------------------------------ ---------- ------- ----------- ---- --------
-// ColorAndDepthDataSint cbuffer NA NA 0 1
-//
-//
-//
-// Input signature:
-//
-// Name Index Mask Register SysValue Format Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_POSITION 0 xyzw 0 POS float
-//
-//
-// Output signature:
-//
-// Name Index Mask Register SysValue Format Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_TARGET 0 xyzw 0 TARGET int xyzw
-// SV_TARGET 1 xyzw 1 TARGET int xyzw
-// SV_TARGET 2 xyzw 2 TARGET int xyzw
-// SV_TARGET 3 xyzw 3 TARGET int xyzw
-// SV_TARGET 4 xyzw 4 TARGET int xyzw
-// SV_TARGET 5 xyzw 5 TARGET int xyzw
-// SV_TARGET 6 xyzw 6 TARGET int xyzw
-// SV_TARGET 7 xyzw 7 TARGET int xyzw
-// SV_DEPTH 0 N/A oDepth DEPTH float YES
-//
-ps_4_0
-dcl_constantbuffer cb0[2], immediateIndexed
-dcl_output o0.xyzw
-dcl_output o1.xyzw
-dcl_output o2.xyzw
-dcl_output o3.xyzw
-dcl_output o4.xyzw
-dcl_output o5.xyzw
-dcl_output o6.xyzw
-dcl_output o7.xyzw
-dcl_output oDepth
-mov o0.xyzw, cb0[0].xyzw
-mov o1.xyzw, cb0[0].xyzw
-mov o2.xyzw, cb0[0].xyzw
-mov o3.xyzw, cb0[0].xyzw
-mov o4.xyzw, cb0[0].xyzw
-mov o5.xyzw, cb0[0].xyzw
-mov o6.xyzw, cb0[0].xyzw
-mov o7.xyzw, cb0[0].xyzw
-mov oDepth, cb0[1].x
-ret
-// Approximately 10 instruction slots used
-#endif
-
-const BYTE g_PS_ClearSint[] =
-{
- 68, 88, 66, 67, 40, 80,
- 87, 20, 166, 137, 87, 18,
- 79, 10, 71, 118, 4, 27,
- 31, 113, 1, 0, 0, 0,
- 84, 4, 0, 0, 5, 0,
- 0, 0, 52, 0, 0, 0,
- 72, 1, 0, 0, 124, 1,
- 0, 0, 120, 2, 0, 0,
- 216, 3, 0, 0, 82, 68,
- 69, 70, 12, 1, 0, 0,
- 1, 0, 0, 0, 84, 0,
- 0, 0, 1, 0, 0, 0,
- 28, 0, 0, 0, 0, 4,
- 255, 255, 0, 1, 0, 0,
- 216, 0, 0, 0, 60, 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, 1, 0, 0, 0,
- 67, 111, 108, 111, 114, 65,
- 110, 100, 68, 101, 112, 116,
- 104, 68, 97, 116, 97, 83,
- 105, 110, 116, 0, 171, 171,
- 60, 0, 0, 0, 2, 0,
- 0, 0, 108, 0, 0, 0,
- 32, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 156, 0, 0, 0, 0, 0,
- 0, 0, 16, 0, 0, 0,
- 2, 0, 0, 0, 168, 0,
- 0, 0, 0, 0, 0, 0,
- 184, 0, 0, 0, 16, 0,
- 0, 0, 4, 0, 0, 0,
- 2, 0, 0, 0, 200, 0,
- 0, 0, 0, 0, 0, 0,
- 99, 111, 108, 111, 114, 95,
- 83, 105, 110, 116, 0, 171,
- 1, 0, 2, 0, 1, 0,
- 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 122, 86,
- 97, 108, 117, 101, 70, 95,
- 83, 105, 110, 116, 0, 171,
- 171, 171, 0, 0, 3, 0,
- 1, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 77, 105, 99, 114, 111, 115,
- 111, 102, 116, 32, 40, 82,
- 41, 32, 72, 76, 83, 76,
- 32, 83, 104, 97, 100, 101,
- 114, 32, 67, 111, 109, 112,
- 105, 108, 101, 114, 32, 54,
- 46, 51, 46, 57, 54, 48,
- 48, 46, 49, 54, 51, 56,
- 52, 0, 171, 171, 73, 83,
- 71, 78, 44, 0, 0, 0,
- 1, 0, 0, 0, 8, 0,
- 0, 0, 32, 0, 0, 0,
- 0, 0, 0, 0, 1, 0,
- 0, 0, 3, 0, 0, 0,
- 0, 0, 0, 0, 15, 0,
- 0, 0, 83, 86, 95, 80,
- 79, 83, 73, 84, 73, 79,
- 78, 0, 79, 83, 71, 78,
- 244, 0, 0, 0, 9, 0,
- 0, 0, 8, 0, 0, 0,
- 224, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 0, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 1, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 2, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 2, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 3, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 3, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 4, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 4, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 5, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 5, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 6, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 6, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 7, 0,
- 0, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 7, 0,
- 0, 0, 15, 0, 0, 0,
- 234, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 255, 255,
- 255, 255, 1, 14, 0, 0,
- 83, 86, 95, 84, 65, 82,
- 71, 69, 84, 0, 83, 86,
- 95, 68, 69, 80, 84, 72,
- 0, 171, 83, 72, 68, 82,
- 88, 1, 0, 0, 64, 0,
- 0, 0, 86, 0, 0, 0,
- 89, 0, 0, 4, 70, 142,
- 32, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 0, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 1, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 2, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 3, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 4, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 5, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 6, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 7, 0, 0, 0, 101, 0,
- 0, 2, 1, 192, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 0, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 1, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 2, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 3, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 4, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 5, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 6, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 7, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 5, 1, 192,
- 0, 0, 10, 128, 32, 0,
- 0, 0, 0, 0, 1, 0,
- 0, 0, 62, 0, 0, 1,
- 83, 84, 65, 84, 116, 0,
- 0, 0, 10, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 9, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 9, 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
-};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps1.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps1.h
new file mode 100644
index 00000000000..e9757d01edf
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps1.h
@@ -0,0 +1,86 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 3 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint1[] = {
+ 68, 88, 66, 67, 234, 238, 101, 91, 76, 164, 85, 240, 165, 134, 177, 247, 216, 133, 221,
+ 129, 1, 0, 0, 0, 176, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 208, 1, 0, 0, 52, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 76, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255,
+ 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86,
+ 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 92, 0, 0, 0, 64, 0, 0,
+ 0, 23, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 2, 1,
+ 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 2, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps2.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps2.h
new file mode 100644
index 00000000000..1099ee2efdb
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps2.h
@@ -0,0 +1,92 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_TARGET 1 xyzw 1 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 4 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint2[] = {
+ 68, 88, 66, 67, 222, 216, 239, 82, 222, 254, 123, 203, 132, 152, 125, 4, 154, 18, 65,
+ 65, 1, 0, 0, 0, 236, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 232, 1, 0, 0, 112, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 100, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71,
+ 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 128, 0,
+ 0, 0, 64, 0, 0, 0, 32, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0,
+ 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0,
+ 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70,
+ 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0,
+ 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65,
+ 84, 116, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps3.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps3.h
new file mode 100644
index 00000000000..81b756e843f
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps3.h
@@ -0,0 +1,98 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_TARGET 1 xyzw 1 TARGET int xyzw
+// SV_TARGET 2 xyzw 2 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 5 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint3[] = {
+ 68, 88, 66, 67, 251, 25, 49, 126, 247, 6, 239, 75, 31, 240, 87, 139, 35, 246, 130,
+ 22, 1, 0, 0, 0, 40, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 0, 2, 0, 0, 172, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 124, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 104, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 104, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 104, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86,
+ 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83,
+ 72, 68, 82, 164, 0, 0, 0, 64, 0, 0, 0, 41, 0, 0, 0, 89, 0, 0, 4,
+ 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16,
+ 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0,
+ 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0,
+ 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1,
+ 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1,
+ 83, 84, 65, 84, 116, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 4, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps4.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps4.h
new file mode 100644
index 00000000000..2ed28789ecb
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps4.h
@@ -0,0 +1,104 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_TARGET 1 xyzw 1 TARGET int xyzw
+// SV_TARGET 2 xyzw 2 TARGET int xyzw
+// SV_TARGET 3 xyzw 3 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 6 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint4[] = {
+ 68, 88, 66, 67, 86, 121, 157, 133, 160, 178, 28, 19, 207, 77, 229, 165, 39, 10, 12,
+ 177, 1, 0, 0, 0, 100, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 24, 2, 0, 0, 232, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 148, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 128, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 128, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 128, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 128, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 138, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1,
+ 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80,
+ 84, 72, 0, 171, 83, 72, 68, 82, 200, 0, 0, 0, 64, 0, 0, 0, 50, 0, 0,
+ 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0,
+ 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1,
+ 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3,
+ 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0,
+ 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0,
+ 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16,
+ 0, 3, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0,
+ 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62,
+ 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps5.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps5.h
new file mode 100644
index 00000000000..3c7f640f77a
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps5.h
@@ -0,0 +1,110 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_TARGET 1 xyzw 1 TARGET int xyzw
+// SV_TARGET 2 xyzw 2 TARGET int xyzw
+// SV_TARGET 3 xyzw 3 TARGET int xyzw
+// SV_TARGET 4 xyzw 4 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 7 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint5[] = {
+ 68, 88, 66, 67, 107, 129, 105, 65, 196, 155, 48, 132, 184, 42, 88, 150, 96, 246, 10,
+ 243, 1, 0, 0, 0, 160, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 48, 2, 0, 0, 36, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 172, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 152, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 152, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 152, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 152, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 152, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83,
+ 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 236, 0, 0, 0, 64, 0,
+ 0, 0, 59, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2,
+ 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3,
+ 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0,
+ 0, 101, 0, 0, 3, 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 4, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242,
+ 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142,
+ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3,
+ 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6,
+ 242, 32, 16, 0, 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps6.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps6.h
new file mode 100644
index 00000000000..b1d48a30de1
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps6.h
@@ -0,0 +1,116 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_TARGET 1 xyzw 1 TARGET int xyzw
+// SV_TARGET 2 xyzw 2 TARGET int xyzw
+// SV_TARGET 3 xyzw 3 TARGET int xyzw
+// SV_TARGET 4 xyzw 4 TARGET int xyzw
+// SV_TARGET 5 xyzw 5 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 8 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint6[] = {
+ 68, 88, 66, 67, 224, 172, 158, 172, 195, 197, 14, 59, 216, 200, 243, 209, 33, 202, 68,
+ 50, 1, 0, 0, 0, 220, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 72, 2, 0, 0, 96, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 196, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 176, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 176, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 176, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 176, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 176, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 176, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82,
+ 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 16,
+ 1, 0, 0, 64, 0, 0, 0, 68, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0,
+ 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 3, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 4, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 5, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16,
+ 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0,
+ 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0,
+ 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32,
+ 16, 0, 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 8, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps7.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps7.h
new file mode 100644
index 00000000000..3d68c783e93
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps7.h
@@ -0,0 +1,123 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_TARGET 1 xyzw 1 TARGET int xyzw
+// SV_TARGET 2 xyzw 2 TARGET int xyzw
+// SV_TARGET 3 xyzw 3 TARGET int xyzw
+// SV_TARGET 4 xyzw 4 TARGET int xyzw
+// SV_TARGET 5 xyzw 5 TARGET int xyzw
+// SV_TARGET 6 xyzw 6 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output o6.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov o6.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 9 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint7[] = {
+ 68, 88, 66, 67, 7, 138, 112, 174, 240, 99, 49, 26, 154, 27, 225, 30, 199, 218, 197,
+ 44, 1, 0, 0, 0, 24, 4, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 96, 2, 0, 0, 156, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 220, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 200, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 200, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 200, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 200, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
+ 0, 2, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 210, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83,
+ 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171,
+ 83, 72, 68, 82, 52, 1, 0, 0, 64, 0, 0, 0, 77, 0, 0, 0, 89, 0, 0,
+ 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 3, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 4, 0, 0, 0, 101, 0, 0,
+ 3, 242, 32, 16, 0, 5, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 6, 0,
+ 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0,
+ 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6,
+ 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0, 0, 70,
+ 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0,
+ 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0,
+ 6, 242, 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 6, 0, 0, 0, 70, 142, 32, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 8, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps8.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps8.h
new file mode 100644
index 00000000000..64d87d6280e
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps8.h
@@ -0,0 +1,129 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataSint
+// {
+//
+// int4 color_Sint; // Offset: 0 Size: 16
+// float zValueF_Sint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataSint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET int xyzw
+// SV_TARGET 1 xyzw 1 TARGET int xyzw
+// SV_TARGET 2 xyzw 2 TARGET int xyzw
+// SV_TARGET 3 xyzw 3 TARGET int xyzw
+// SV_TARGET 4 xyzw 4 TARGET int xyzw
+// SV_TARGET 5 xyzw 5 TARGET int xyzw
+// SV_TARGET 6 xyzw 6 TARGET int xyzw
+// SV_TARGET 7 xyzw 7 TARGET int xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output o6.xyzw
+dcl_output o7.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov o6.xyzw, cb0[0].xyzw
+mov o7.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 10 instruction slots used
+#endif
+
+const BYTE g_PS_ClearSint8[] = {
+ 68, 88, 66, 67, 40, 80, 87, 20, 166, 137, 87, 18, 79, 10, 71, 118, 4, 27, 31,
+ 113, 1, 0, 0, 0, 84, 4, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 120, 2, 0, 0, 216, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 83, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 83, 105, 110, 116, 0, 171,
+ 1, 0, 2, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 83, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 244, 0, 0, 0, 9, 0, 0, 0, 8, 0, 0, 0, 224, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 224, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 2, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 2, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 224, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 224, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
+ 0, 2, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 7, 0,
+ 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 7, 0, 0, 0, 15, 0, 0, 0, 234,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255,
+ 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69,
+ 80, 84, 72, 0, 171, 83, 72, 68, 82, 88, 1, 0, 0, 64, 0, 0, 0, 86, 0,
+ 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0,
+ 3, 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 4, 0,
+ 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 5, 0, 0, 0, 101, 0, 0, 3, 242,
+ 32, 16, 0, 6, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 7, 0, 0, 0,
+ 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0,
+ 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32,
+ 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0, 0, 70, 142, 32,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 4, 0,
+ 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242,
+ 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 54, 0, 0, 6, 242, 32, 16, 0, 6, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 7, 0, 0, 0, 70, 142,
+ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10,
+ 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84,
+ 116, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h
deleted file mode 100644
index d241562bd06..00000000000
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h
+++ /dev/null
@@ -1,257 +0,0 @@
-#if 0
-//
-// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
-//
-//
-// Buffer Definitions:
-//
-// cbuffer ColorAndDepthDataUint
-// {
-//
-// uint4 color_Uint; // Offset: 0 Size: 16
-// float zValueF_Uint; // Offset: 16 Size: 4
-//
-// }
-//
-//
-// Resource Bindings:
-//
-// Name Type Format Dim Slot Elements
-// ------------------------------ ---------- ------- ----------- ---- --------
-// ColorAndDepthDataUint cbuffer NA NA 0 1
-//
-//
-//
-// Input signature:
-//
-// Name Index Mask Register SysValue Format Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_POSITION 0 xyzw 0 POS float
-//
-//
-// Output signature:
-//
-// Name Index Mask Register SysValue Format Used
-// -------------------- ----- ------ -------- -------- ------- ------
-// SV_TARGET 0 xyzw 0 TARGET uint xyzw
-// SV_TARGET 1 xyzw 1 TARGET uint xyzw
-// SV_TARGET 2 xyzw 2 TARGET uint xyzw
-// SV_TARGET 3 xyzw 3 TARGET uint xyzw
-// SV_TARGET 4 xyzw 4 TARGET uint xyzw
-// SV_TARGET 5 xyzw 5 TARGET uint xyzw
-// SV_TARGET 6 xyzw 6 TARGET uint xyzw
-// SV_TARGET 7 xyzw 7 TARGET uint xyzw
-// SV_DEPTH 0 N/A oDepth DEPTH float YES
-//
-ps_4_0
-dcl_constantbuffer cb0[2], immediateIndexed
-dcl_output o0.xyzw
-dcl_output o1.xyzw
-dcl_output o2.xyzw
-dcl_output o3.xyzw
-dcl_output o4.xyzw
-dcl_output o5.xyzw
-dcl_output o6.xyzw
-dcl_output o7.xyzw
-dcl_output oDepth
-mov o0.xyzw, cb0[0].xyzw
-mov o1.xyzw, cb0[0].xyzw
-mov o2.xyzw, cb0[0].xyzw
-mov o3.xyzw, cb0[0].xyzw
-mov o4.xyzw, cb0[0].xyzw
-mov o5.xyzw, cb0[0].xyzw
-mov o6.xyzw, cb0[0].xyzw
-mov o7.xyzw, cb0[0].xyzw
-mov oDepth, cb0[1].x
-ret
-// Approximately 10 instruction slots used
-#endif
-
-const BYTE g_PS_ClearUint[] =
-{
- 68, 88, 66, 67, 31, 50,
- 232, 254, 182, 197, 174, 161,
- 39, 175, 44, 65, 71, 251,
- 37, 230, 1, 0, 0, 0,
- 84, 4, 0, 0, 5, 0,
- 0, 0, 52, 0, 0, 0,
- 72, 1, 0, 0, 124, 1,
- 0, 0, 120, 2, 0, 0,
- 216, 3, 0, 0, 82, 68,
- 69, 70, 12, 1, 0, 0,
- 1, 0, 0, 0, 84, 0,
- 0, 0, 1, 0, 0, 0,
- 28, 0, 0, 0, 0, 4,
- 255, 255, 0, 1, 0, 0,
- 216, 0, 0, 0, 60, 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, 1, 0, 0, 0,
- 67, 111, 108, 111, 114, 65,
- 110, 100, 68, 101, 112, 116,
- 104, 68, 97, 116, 97, 85,
- 105, 110, 116, 0, 171, 171,
- 60, 0, 0, 0, 2, 0,
- 0, 0, 108, 0, 0, 0,
- 32, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 156, 0, 0, 0, 0, 0,
- 0, 0, 16, 0, 0, 0,
- 2, 0, 0, 0, 168, 0,
- 0, 0, 0, 0, 0, 0,
- 184, 0, 0, 0, 16, 0,
- 0, 0, 4, 0, 0, 0,
- 2, 0, 0, 0, 200, 0,
- 0, 0, 0, 0, 0, 0,
- 99, 111, 108, 111, 114, 95,
- 85, 105, 110, 116, 0, 171,
- 1, 0, 19, 0, 1, 0,
- 4, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 122, 86,
- 97, 108, 117, 101, 70, 95,
- 85, 105, 110, 116, 0, 171,
- 171, 171, 0, 0, 3, 0,
- 1, 0, 1, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 77, 105, 99, 114, 111, 115,
- 111, 102, 116, 32, 40, 82,
- 41, 32, 72, 76, 83, 76,
- 32, 83, 104, 97, 100, 101,
- 114, 32, 67, 111, 109, 112,
- 105, 108, 101, 114, 32, 54,
- 46, 51, 46, 57, 54, 48,
- 48, 46, 49, 54, 51, 56,
- 52, 0, 171, 171, 73, 83,
- 71, 78, 44, 0, 0, 0,
- 1, 0, 0, 0, 8, 0,
- 0, 0, 32, 0, 0, 0,
- 0, 0, 0, 0, 1, 0,
- 0, 0, 3, 0, 0, 0,
- 0, 0, 0, 0, 15, 0,
- 0, 0, 83, 86, 95, 80,
- 79, 83, 73, 84, 73, 79,
- 78, 0, 79, 83, 71, 78,
- 244, 0, 0, 0, 9, 0,
- 0, 0, 8, 0, 0, 0,
- 224, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 0, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 1, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 2, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 2, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 3, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 3, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 4, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 4, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 5, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 5, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 6, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 6, 0,
- 0, 0, 15, 0, 0, 0,
- 224, 0, 0, 0, 7, 0,
- 0, 0, 0, 0, 0, 0,
- 1, 0, 0, 0, 7, 0,
- 0, 0, 15, 0, 0, 0,
- 234, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 3, 0, 0, 0, 255, 255,
- 255, 255, 1, 14, 0, 0,
- 83, 86, 95, 84, 65, 82,
- 71, 69, 84, 0, 83, 86,
- 95, 68, 69, 80, 84, 72,
- 0, 171, 83, 72, 68, 82,
- 88, 1, 0, 0, 64, 0,
- 0, 0, 86, 0, 0, 0,
- 89, 0, 0, 4, 70, 142,
- 32, 0, 0, 0, 0, 0,
- 2, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 0, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 1, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 2, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 3, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 4, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 5, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 6, 0, 0, 0, 101, 0,
- 0, 3, 242, 32, 16, 0,
- 7, 0, 0, 0, 101, 0,
- 0, 2, 1, 192, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 0, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 1, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 2, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 3, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 4, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 5, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 6, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 6, 242, 32,
- 16, 0, 7, 0, 0, 0,
- 70, 142, 32, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 54, 0, 0, 5, 1, 192,
- 0, 0, 10, 128, 32, 0,
- 0, 0, 0, 0, 1, 0,
- 0, 0, 62, 0, 0, 1,
- 83, 84, 65, 84, 116, 0,
- 0, 0, 10, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 9, 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, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0,
- 9, 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
-};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps1.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps1.h
new file mode 100644
index 00000000000..79b9cfb9460
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps1.h
@@ -0,0 +1,86 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 3 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint1[] = {
+ 68, 88, 66, 67, 165, 251, 33, 78, 86, 103, 162, 162, 213, 224, 91, 62, 153, 83, 9,
+ 114, 1, 0, 0, 0, 176, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 208, 1, 0, 0, 52, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 76, 0, 0, 0, 2, 0, 0, 0, 8, 0, 0, 0, 56, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 66, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255,
+ 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86,
+ 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 92, 0, 0, 0, 64, 0, 0,
+ 0, 23, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0,
+ 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 2, 1,
+ 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0,
+ 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 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,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 2, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps2.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps2.h
new file mode 100644
index 00000000000..3c3fbdfeae1
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps2.h
@@ -0,0 +1,92 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_TARGET 1 xyzw 1 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 4 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint2[] = {
+ 68, 88, 66, 67, 64, 241, 9, 8, 108, 162, 163, 180, 109, 195, 189, 181, 110, 171, 114,
+ 118, 1, 0, 0, 0, 236, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 232, 1, 0, 0, 112, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 100, 0, 0, 0, 3, 0, 0, 0, 8, 0, 0, 0, 80, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 80, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71,
+ 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 128, 0,
+ 0, 0, 64, 0, 0, 0, 32, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0,
+ 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0,
+ 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0,
+ 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70,
+ 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0,
+ 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65,
+ 84, 116, 0, 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps3.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps3.h
new file mode 100644
index 00000000000..0181d051e41
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps3.h
@@ -0,0 +1,98 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_TARGET 1 xyzw 1 TARGET uint xyzw
+// SV_TARGET 2 xyzw 2 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 5 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint3[] = {
+ 68, 88, 66, 67, 207, 249, 236, 218, 42, 28, 216, 245, 185, 80, 143, 139, 56, 108, 199,
+ 11, 1, 0, 0, 0, 40, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 0, 2, 0, 0, 172, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 124, 0, 0, 0, 4, 0, 0, 0, 8, 0, 0, 0, 104, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 104, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 104, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 114, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86,
+ 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83,
+ 72, 68, 82, 164, 0, 0, 0, 64, 0, 0, 0, 41, 0, 0, 0, 89, 0, 0, 4,
+ 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16,
+ 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0,
+ 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0,
+ 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1,
+ 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1,
+ 83, 84, 65, 84, 116, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 4, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 4, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps4.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps4.h
new file mode 100644
index 00000000000..a26ec174834
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps4.h
@@ -0,0 +1,104 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_TARGET 1 xyzw 1 TARGET uint xyzw
+// SV_TARGET 2 xyzw 2 TARGET uint xyzw
+// SV_TARGET 3 xyzw 3 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 6 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint4[] = {
+ 68, 88, 66, 67, 199, 123, 16, 1, 215, 108, 177, 8, 10, 177, 4, 33, 216, 58, 53,
+ 78, 1, 0, 0, 0, 100, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 24, 2, 0, 0, 232, 2, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 148, 0, 0, 0, 5, 0, 0, 0, 8, 0, 0, 0, 128, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 128, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 128, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 128, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 138, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1,
+ 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80,
+ 84, 72, 0, 171, 83, 72, 68, 82, 200, 0, 0, 0, 64, 0, 0, 0, 50, 0, 0,
+ 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0,
+ 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1,
+ 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3,
+ 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0,
+ 6, 242, 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0,
+ 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16,
+ 0, 3, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0,
+ 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62,
+ 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 5, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps5.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps5.h
new file mode 100644
index 00000000000..db295eed3f5
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps5.h
@@ -0,0 +1,110 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_TARGET 1 xyzw 1 TARGET uint xyzw
+// SV_TARGET 2 xyzw 2 TARGET uint xyzw
+// SV_TARGET 3 xyzw 3 TARGET uint xyzw
+// SV_TARGET 4 xyzw 4 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 7 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint5[] = {
+ 68, 88, 66, 67, 200, 229, 167, 131, 228, 54, 139, 228, 159, 151, 189, 241, 206, 62, 101,
+ 65, 1, 0, 0, 0, 160, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 48, 2, 0, 0, 36, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 172, 0, 0, 0, 6, 0, 0, 0, 8, 0, 0, 0, 152, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 152, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 152, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 152, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 152, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 162, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0,
+ 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83,
+ 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 236, 0, 0, 0, 64, 0,
+ 0, 0, 59, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2,
+ 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3,
+ 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0,
+ 0, 101, 0, 0, 3, 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 4, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242,
+ 32, 16, 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 54, 0, 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142,
+ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3,
+ 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6,
+ 242, 32, 16, 0, 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0, 0, 1, 0,
+ 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 7, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 6, 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, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 6, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps6.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps6.h
new file mode 100644
index 00000000000..6062871a7fa
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps6.h
@@ -0,0 +1,116 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_TARGET 1 xyzw 1 TARGET uint xyzw
+// SV_TARGET 2 xyzw 2 TARGET uint xyzw
+// SV_TARGET 3 xyzw 3 TARGET uint xyzw
+// SV_TARGET 4 xyzw 4 TARGET uint xyzw
+// SV_TARGET 5 xyzw 5 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 8 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint6[] = {
+ 68, 88, 66, 67, 92, 35, 11, 26, 168, 95, 96, 195, 79, 231, 8, 0, 53, 204, 222,
+ 121, 1, 0, 0, 0, 220, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 72, 2, 0, 0, 96, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 196, 0, 0, 0, 7, 0, 0, 0, 8, 0, 0, 0, 176, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 176, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 176, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 176, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 176, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 176, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 186, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83, 86, 95, 84, 65, 82,
+ 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171, 83, 72, 68, 82, 16,
+ 1, 0, 0, 64, 0, 0, 0, 68, 0, 0, 0, 89, 0, 0, 4, 70, 142, 32, 0,
+ 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0,
+ 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 3, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 4, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 5, 0, 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16,
+ 0, 0, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0,
+ 0, 6, 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0,
+ 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32,
+ 16, 0, 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 8, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps7.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps7.h
new file mode 100644
index 00000000000..381c1ea6d5d
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps7.h
@@ -0,0 +1,123 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_TARGET 1 xyzw 1 TARGET uint xyzw
+// SV_TARGET 2 xyzw 2 TARGET uint xyzw
+// SV_TARGET 3 xyzw 3 TARGET uint xyzw
+// SV_TARGET 4 xyzw 4 TARGET uint xyzw
+// SV_TARGET 5 xyzw 5 TARGET uint xyzw
+// SV_TARGET 6 xyzw 6 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output o6.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov o6.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 9 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint7[] = {
+ 68, 88, 66, 67, 222, 54, 153, 233, 23, 19, 230, 114, 59, 92, 55, 31, 123, 0, 252,
+ 103, 1, 0, 0, 0, 24, 4, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 96, 2, 0, 0, 156, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 220, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 200, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 200, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 200, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 200, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 200, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 210, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255, 1, 14, 0, 0, 83,
+ 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69, 80, 84, 72, 0, 171,
+ 83, 72, 68, 82, 52, 1, 0, 0, 64, 0, 0, 0, 77, 0, 0, 0, 89, 0, 0,
+ 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32,
+ 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 1, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 3, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 4, 0, 0, 0, 101, 0, 0,
+ 3, 242, 32, 16, 0, 5, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 6, 0,
+ 0, 0, 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0,
+ 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6,
+ 242, 32, 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 54, 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0, 0, 70,
+ 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0,
+ 4, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0,
+ 6, 242, 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 6, 0, 0, 0, 70, 142, 32, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10, 128, 32, 0,
+ 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0,
+ 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8, 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, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 8, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps8.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps8.h
new file mode 100644
index 00000000000..55424732c8d
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps8.h
@@ -0,0 +1,129 @@
+#if 0
+//
+// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
+//
+//
+// Buffer Definitions:
+//
+// cbuffer ColorAndDepthDataUint
+// {
+//
+// uint4 color_Uint; // Offset: 0 Size: 16
+// float zValueF_Uint; // Offset: 16 Size: 4
+//
+// }
+//
+//
+// Resource Bindings:
+//
+// Name Type Format Dim Slot Elements
+// ------------------------------ ---------- ------- ----------- ---- --------
+// ColorAndDepthDataUint cbuffer NA NA 0 1
+//
+//
+//
+// Input signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_POSITION 0 xyzw 0 POS float
+//
+//
+// Output signature:
+//
+// Name Index Mask Register SysValue Format Used
+// -------------------- ----- ------ -------- -------- ------- ------
+// SV_TARGET 0 xyzw 0 TARGET uint xyzw
+// SV_TARGET 1 xyzw 1 TARGET uint xyzw
+// SV_TARGET 2 xyzw 2 TARGET uint xyzw
+// SV_TARGET 3 xyzw 3 TARGET uint xyzw
+// SV_TARGET 4 xyzw 4 TARGET uint xyzw
+// SV_TARGET 5 xyzw 5 TARGET uint xyzw
+// SV_TARGET 6 xyzw 6 TARGET uint xyzw
+// SV_TARGET 7 xyzw 7 TARGET uint xyzw
+// SV_DEPTH 0 N/A oDepth DEPTH float YES
+//
+ps_4_0
+dcl_constantbuffer cb0[2], immediateIndexed
+dcl_output o0.xyzw
+dcl_output o1.xyzw
+dcl_output o2.xyzw
+dcl_output o3.xyzw
+dcl_output o4.xyzw
+dcl_output o5.xyzw
+dcl_output o6.xyzw
+dcl_output o7.xyzw
+dcl_output oDepth
+mov o0.xyzw, cb0[0].xyzw
+mov o1.xyzw, cb0[0].xyzw
+mov o2.xyzw, cb0[0].xyzw
+mov o3.xyzw, cb0[0].xyzw
+mov o4.xyzw, cb0[0].xyzw
+mov o5.xyzw, cb0[0].xyzw
+mov o6.xyzw, cb0[0].xyzw
+mov o7.xyzw, cb0[0].xyzw
+mov oDepth, cb0[1].x
+ret
+// Approximately 10 instruction slots used
+#endif
+
+const BYTE g_PS_ClearUint8[] = {
+ 68, 88, 66, 67, 31, 50, 232, 254, 182, 197, 174, 161, 39, 175, 44, 65, 71, 251, 37,
+ 230, 1, 0, 0, 0, 84, 4, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 72, 1,
+ 0, 0, 124, 1, 0, 0, 120, 2, 0, 0, 216, 3, 0, 0, 82, 68, 69, 70, 12,
+ 1, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 1, 0, 0, 0, 28, 0, 0, 0,
+ 0, 4, 255, 255, 0, 1, 0, 0, 216, 0, 0, 0, 60, 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, 1, 0, 0, 0, 67, 111, 108, 111, 114, 65, 110, 100, 68, 101, 112, 116, 104,
+ 68, 97, 116, 97, 85, 105, 110, 116, 0, 171, 171, 60, 0, 0, 0, 2, 0, 0, 0,
+ 108, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 156, 0, 0,
+ 0, 0, 0, 0, 0, 16, 0, 0, 0, 2, 0, 0, 0, 168, 0, 0, 0, 0, 0,
+ 0, 0, 184, 0, 0, 0, 16, 0, 0, 0, 4, 0, 0, 0, 2, 0, 0, 0, 200,
+ 0, 0, 0, 0, 0, 0, 0, 99, 111, 108, 111, 114, 95, 85, 105, 110, 116, 0, 171,
+ 1, 0, 19, 0, 1, 0, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 122, 86, 97,
+ 108, 117, 101, 70, 95, 85, 105, 110, 116, 0, 171, 171, 171, 0, 0, 3, 0, 1, 0,
+ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116,
+ 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111,
+ 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51,
+ 56, 52, 0, 171, 171, 73, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0,
+ 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 0,
+ 0, 0, 0, 15, 0, 0, 0, 83, 86, 95, 80, 79, 83, 73, 84, 73, 79, 78, 0,
+ 79, 83, 71, 78, 244, 0, 0, 0, 9, 0, 0, 0, 8, 0, 0, 0, 224, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 15, 0,
+ 0, 0, 224, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1,
+ 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0,
+ 1, 0, 0, 0, 2, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 3, 0, 0,
+ 0, 0, 0, 0, 0, 1, 0, 0, 0, 3, 0, 0, 0, 15, 0, 0, 0, 224, 0,
+ 0, 0, 4, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 4, 0, 0, 0, 15,
+ 0, 0, 0, 224, 0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
+ 5, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 6, 0, 0, 0, 0, 0, 0,
+ 0, 1, 0, 0, 0, 6, 0, 0, 0, 15, 0, 0, 0, 224, 0, 0, 0, 7, 0,
+ 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 7, 0, 0, 0, 15, 0, 0, 0, 234,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 255, 255, 255, 255,
+ 1, 14, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 83, 86, 95, 68, 69,
+ 80, 84, 72, 0, 171, 83, 72, 68, 82, 88, 1, 0, 0, 64, 0, 0, 0, 86, 0,
+ 0, 0, 89, 0, 0, 4, 70, 142, 32, 0, 0, 0, 0, 0, 2, 0, 0, 0, 101,
+ 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0,
+ 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 2, 0, 0, 0, 101, 0, 0,
+ 3, 242, 32, 16, 0, 3, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 4, 0,
+ 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 5, 0, 0, 0, 101, 0, 0, 3, 242,
+ 32, 16, 0, 6, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 7, 0, 0, 0,
+ 101, 0, 0, 2, 1, 192, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 0, 0, 0,
+ 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32,
+ 16, 0, 1, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54,
+ 0, 0, 6, 242, 32, 16, 0, 2, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 3, 0, 0, 0, 70, 142, 32,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 4, 0,
+ 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 6, 242,
+ 32, 16, 0, 5, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 54, 0, 0, 6, 242, 32, 16, 0, 6, 0, 0, 0, 70, 142, 32, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 54, 0, 0, 6, 242, 32, 16, 0, 7, 0, 0, 0, 70, 142,
+ 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 54, 0, 0, 5, 1, 192, 0, 0, 10,
+ 128, 32, 0, 0, 0, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84,
+ 116, 0, 0, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 9, 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};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_luma_ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_luma_ps.h
index bd63ef33b0a..2e79ffde702 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_luma_ps.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_luma_ps.h
@@ -16,8 +16,8 @@
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
-// SV_POSITION 0 xyzw 0 POS float
-// TEXCOORD 0 xy 1 NONE float xy
+// SV_POSITION 0 xyzw 0 POS float
+// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
@@ -35,7 +35,7 @@ dcl_temps 1
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul o0.xyz, r0.wwww, r0.xxxx
mov o0.w, l(1.000000)
-ret
+ret
// Approximately 4 instruction slots used
#endif
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_lumaalpha_ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_lumaalpha_ps.h
index 435f5783e9e..62e83d5433c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_lumaalpha_ps.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_lumaalpha_ps.h
@@ -16,8 +16,8 @@
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
-// SV_POSITION 0 xyzw 0 POS float
-// TEXCOORD 0 xy 1 NONE float xy
+// SV_POSITION 0 xyzw 0 POS float
+// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
@@ -35,7 +35,7 @@ dcl_temps 1
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul o0.xyz, r0.wwww, r0.xxxx
mov o0.w, r0.w
-ret
+ret
// Approximately 4 instruction slots used
#endif
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_luma_ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_luma_ps.h
index 333fa69e0ab..a7b3939b7f3 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_luma_ps.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_luma_ps.h
@@ -16,8 +16,8 @@
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
-// SV_POSITION 0 xyzw 0 POS float
-// TEXCOORD 0 xy 1 NONE float xy
+// SV_POSITION 0 xyzw 0 POS float
+// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
@@ -37,7 +37,7 @@ lt r1.x, l(0.000000), r0.w
div r0.w, r0.x, r0.w
movc o0.xyz, r1.xxxx, r0.wwww, r0.xyzx
mov o0.w, l(1.000000)
-ret
+ret
// Approximately 6 instruction slots used
#endif
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_lumaalpha_ps.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_lumaalpha_ps.h
index 64aeb9ae1fc..8aba4805c98 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_lumaalpha_ps.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_lumaalpha_ps.h
@@ -16,8 +16,8 @@
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
-// SV_POSITION 0 xyzw 0 POS float
-// TEXCOORD 0 xy 1 NONE float xy
+// SV_POSITION 0 xyzw 0 POS float
+// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
@@ -37,7 +37,7 @@ lt r1.x, l(0.000000), r0.w
div r1.y, r0.x, r0.w
movc o0.xyz, r1.xxxx, r1.yyyy, r0.xyzx
mov o0.w, r0.w
-ret
+ret
// Approximately 6 instruction slots used
#endif
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/generate_shaders.bat b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/generate_shaders.bat
index def2082434c..bd7bbfe9af2 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/generate_shaders.bat
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d11/shaders/generate_shaders.bat
@@ -5,7 +5,7 @@ REM Use of this source code is governed by a BSD-style license that can be
REM found in the LICENSE file.
REM
-PATH %PATH%;%ProgramFiles(x86)%\Windows Kits\8.1\bin\x86;%DXSDK_DIR%\Utilities\bin\x86
+PATH %ProgramFiles(x86)%\Windows Kits\8.1\bin\x86;%DXSDK_DIR%\Utilities\bin\x86;%PATH%
setlocal
set errorCount=0
@@ -49,7 +49,17 @@ call:BuildShader Clear11.hlsl VS_Clear_FL9 vs_4_0_level_9_
call:BuildShader Clear11.hlsl PS_ClearFloat_FL9 ps_4_0_level_9_3 compiled\clearfloat11_fl9ps.h %debug%
call:BuildShader Clear11.hlsl VS_Clear vs_4_0 compiled\clear11vs.h %debug%
-call:BuildShader Clear11.hlsl PS_ClearFloat ps_4_0 compiled\clearfloat11ps.h %debug%
+call:BuildShader Clear11.hlsl VS_Multiview_Clear vs_4_0 compiled\clear11multiviewvs.h %debug%
+call:BuildShader Clear11.hlsl GS_Multiview_Clear gs_4_0 compiled\clear11multiviewgs.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearDepth ps_4_0 compiled\cleardepth11ps.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat1 ps_4_0 compiled\clearfloat11ps1.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat2 ps_4_0 compiled\clearfloat11ps2.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat3 ps_4_0 compiled\clearfloat11ps3.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat4 ps_4_0 compiled\clearfloat11ps4.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat5 ps_4_0 compiled\clearfloat11ps5.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat6 ps_4_0 compiled\clearfloat11ps6.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat7 ps_4_0 compiled\clearfloat11ps7.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearFloat8 ps_4_0 compiled\clearfloat11ps8.h %debug%
:: Shaders for OpenGL ES 3.0+ only
:: | Input file | Entry point | Type | Output file | Debug |
@@ -92,8 +102,22 @@ call:BuildShader Swizzle11.hlsl PS_SwizzleF2DArray ps_4_0 co
call:BuildShader Swizzle11.hlsl PS_SwizzleI2DArray ps_4_0 compiled\swizzlei2darrayps.h %debug%
call:BuildShader Swizzle11.hlsl PS_SwizzleUI2DArray ps_4_0 compiled\swizzleui2darrayps.h %debug%
-call:BuildShader Clear11.hlsl PS_ClearUint ps_4_0 compiled\clearuint11ps.h %debug%
-call:BuildShader Clear11.hlsl PS_ClearSint ps_4_0 compiled\clearsint11ps.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint1 ps_4_0 compiled\clearuint11ps1.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint2 ps_4_0 compiled\clearuint11ps2.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint3 ps_4_0 compiled\clearuint11ps3.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint4 ps_4_0 compiled\clearuint11ps4.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint5 ps_4_0 compiled\clearuint11ps5.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint6 ps_4_0 compiled\clearuint11ps6.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint7 ps_4_0 compiled\clearuint11ps7.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearUint8 ps_4_0 compiled\clearuint11ps8.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint1 ps_4_0 compiled\clearsint11ps1.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint2 ps_4_0 compiled\clearsint11ps2.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint3 ps_4_0 compiled\clearsint11ps3.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint4 ps_4_0 compiled\clearsint11ps4.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint5 ps_4_0 compiled\clearsint11ps5.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint6 ps_4_0 compiled\clearsint11ps6.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint7 ps_4_0 compiled\clearsint11ps7.h %debug%
+call:BuildShader Clear11.hlsl PS_ClearSint8 ps_4_0 compiled\clearsint11ps8.h %debug%
call:BuildShader BufferToTexture11.hlsl VS_BufferToTexture vs_4_0 compiled/buffertotexture11_vs.h %debug%
call:BuildShader BufferToTexture11.hlsl GS_BufferToTexture gs_4_0 compiled/buffertotexture11_gs.h %debug%
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 6d89ad747d1..c229d8175e4 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
@@ -48,7 +48,7 @@ CompilerImpl *Context9::createCompiler()
ShaderImpl *Context9::createShader(const gl::ShaderState &data)
{
- return new ShaderD3D(data, mRenderer->getWorkarounds());
+ return new ShaderD3D(data, mRenderer->getWorkarounds(), mRenderer->getNativeExtensions());
}
ProgramImpl *Context9::createProgram(const gl::ProgramState &data)
@@ -102,7 +102,7 @@ FenceNVImpl *Context9::createFenceNV()
return new FenceNV9(mRenderer);
}
-FenceSyncImpl *Context9::createFenceSync()
+SyncImpl *Context9::createSync()
{
// D3D9 doesn't support ES 3.0 and its sync objects.
UNREACHABLE();
@@ -153,10 +153,9 @@ gl::Error Context9::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
- return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
+ return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context9::drawElementsInstanced(const gl::Context *context,
@@ -164,11 +163,9 @@ gl::Error Context9::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
- return mRenderer->genericDrawElements(context, mode, count, type, indices, instances,
- indexRange);
+ return mRenderer->genericDrawElements(context, mode, count, type, indices, instances);
}
gl::Error Context9::drawRangeElements(const gl::Context *context,
@@ -177,10 +174,9 @@ gl::Error Context9::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
- return mRenderer->genericDrawElements(context, mode, count, type, indices, 0, indexRange);
+ return mRenderer->genericDrawElements(context, mode, count, type, indices, 0);
}
gl::Error Context9::drawArraysIndirect(const gl::Context *context,
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 f71275f4ef6..1dcdc682400 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
@@ -47,7 +47,7 @@ class Context9 : public ContextImpl
// Query and Fence creation
QueryImpl *createQuery(GLenum type) override;
FenceNVImpl *createFenceNV() override;
- FenceSyncImpl *createFenceSync() override;
+ SyncImpl *createSync() override;
// Transform Feedback creation
TransformFeedbackImpl *createTransformFeedback(
@@ -78,23 +78,20 @@ class Context9 : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange) override;
+ GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
@@ -136,6 +133,8 @@ class Context9 : public ContextImpl
GLuint numGroupsY,
GLuint numGroupsZ) override;
+ Renderer9 *getRenderer() const { return mRenderer; }
+
private:
Renderer9 *mRenderer;
};
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Fence9.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Fence9.h
index 200ac68d276..de0ff20774d 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Fence9.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/Fence9.h
@@ -10,7 +10,7 @@
#define LIBANGLE_RENDERER_D3D_D3D9_FENCE9_H_
#include "libANGLE/renderer/FenceNVImpl.h"
-#include "libANGLE/renderer/FenceSyncImpl.h"
+#include "libANGLE/renderer/SyncImpl.h"
namespace rx
{
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 b8b75c857aa..6e83fec7a00 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
@@ -339,7 +339,7 @@ egl::Error Renderer9::initialize()
mAdapter, mDeviceType, currentDisplayMode.Format,
D3DUSAGE_QUERY_VERTEXTEXTURE, D3DRTYPE_TEXTURE, D3DFMT_R16F));
- initializeDevice();
+ ANGLE_TRY(initializeDevice());
return egl::NoError();
}
@@ -347,7 +347,7 @@ egl::Error Renderer9::initialize()
// do any one-time device initialization
// NOTE: this is also needed after a device lost/reset
// to reset the scene status and ensure the default states are reset.
-void Renderer9::initializeDevice()
+egl::Error Renderer9::initializeDevice()
{
// Permanent non-default states
mDevice->SetRenderState(D3DRS_POINTSPRITEENABLE, TRUE);
@@ -382,9 +382,16 @@ void Renderer9::initializeDevice()
mVertexDataManager = new VertexDataManager(this);
mIndexDataManager = new IndexDataManager(this, getRendererClass());
+ if (mVertexDataManager->initialize().isError())
+ {
+ return egl::EglBadAlloc() << "Error initializing VertexDataManager";
+ }
+
mTranslatedAttribCache.resize(getNativeCaps().maxVertexAttributes);
mStateManager.initialize();
+
+ return egl::NoError();
}
D3DPRESENT_PARAMETERS Renderer9::getDefaultPresentParameters()
@@ -1037,8 +1044,7 @@ gl::Error Renderer9::setUniformBuffers(const gl::ContextState & /*data*/,
gl::Error Renderer9::updateState(const gl::Context *context, GLenum drawMode)
{
- const auto &data = context->getContextState();
- const auto &glState = data.getState();
+ const auto &glState = context->getGLState();
// Applies the render target surface, depth stencil surface, viewport rectangle and
// scissor rectangle to the renderer
@@ -1071,7 +1077,7 @@ gl::Error Renderer9::updateState(const gl::Context *context, GLenum drawMode)
rasterizer.pointDrawMode = (drawMode == GL_POINTS);
rasterizer.multiSample = (samples != 0);
- unsigned int mask = GetBlendSampleMask(data, samples);
+ unsigned int mask = GetBlendSampleMask(glState, samples);
ANGLE_TRY(setBlendDepthRasterStates(context, mask));
mStateManager.resetDirtyBits();
@@ -1105,7 +1111,7 @@ gl::Error Renderer9::setBlendDepthRasterStates(const gl::Context *context, GLenu
rasterizer.pointDrawMode = (drawMode == GL_POINTS);
rasterizer.multiSample = (samples != 0);
- unsigned int mask = GetBlendSampleMask(context->getContextState(), samples);
+ unsigned int mask = GetBlendSampleMask(glState, samples);
return mStateManager.setBlendDepthRasterStates(glState, mask);
}
@@ -1413,14 +1419,24 @@ gl::Error Renderer9::drawArraysImpl(const gl::ContextState &data,
}
}
-gl::Error Renderer9::drawElementsImpl(const gl::ContextState &data,
- const TranslatedIndexData &indexInfo,
+gl::Error Renderer9::drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei /*instances*/)
+ GLsizei instances)
{
+ const auto &data = context->getContextState();
+ TranslatedIndexData indexInfo;
+ const gl::IndexRange &indexRange =
+ context->getParams<gl::HasIndexRange>().getIndexRange().value();
+ indexInfo.indexRange = indexRange;
+ ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
+ size_t vertexCount = indexInfo.indexRange.vertexCount();
+ ANGLE_TRY(applyVertexBuffer(data.getState(), mode,
+ static_cast<GLsizei>(indexInfo.indexRange.start),
+ static_cast<GLsizei>(vertexCount), instances, &indexInfo));
+
startScene();
int minIndex = static_cast<int>(indexInfo.indexRange.start);
@@ -1438,7 +1454,6 @@ gl::Error Renderer9::drawElementsImpl(const gl::ContextState &data,
}
else
{
- size_t vertexCount = indexInfo.indexRange.vertexCount();
for (int i = 0; i < mRepeatDraw; i++)
{
mDevice->DrawIndexedPrimitive(mPrimitiveType, -minIndex, minIndex,
@@ -1785,16 +1800,17 @@ gl::Error Renderer9::applyShaders(const gl::Context *context, GLenum drawMode)
ANGLE_TRY(ensureHLSLCompilerInitialized());
ProgramD3D *programD3D = GetImplAs<ProgramD3D>(state.getProgram());
- programD3D->updateCachedInputLayout(state);
-
- const auto &inputLayout = programD3D->getCachedInputLayout();
+ VertexArray9 *vao = GetImplAs<VertexArray9>(state.getVertexArray());
+ programD3D->updateCachedInputLayout(vao->getCurrentStateSerial(), state);
ShaderExecutableD3D *vertexExe = nullptr;
- ANGLE_TRY(programD3D->getVertexExecutableForInputLayout(inputLayout, &vertexExe, nullptr));
+ ANGLE_TRY(programD3D->getVertexExecutableForCachedInputLayout(&vertexExe, nullptr));
const gl::Framebuffer *drawFramebuffer = state.getDrawFramebuffer();
- ShaderExecutableD3D *pixelExe = nullptr;
- ANGLE_TRY(programD3D->getPixelExecutableForFramebuffer(context, drawFramebuffer, &pixelExe));
+ programD3D->updateCachedOutputLayout(context, drawFramebuffer);
+
+ ShaderExecutableD3D *pixelExe = nullptr;
+ ANGLE_TRY(programD3D->getPixelExecutableForCachedOutputLayout(&pixelExe, nullptr));
IDirect3DVertexShader9 *vertexShader =
(vertexExe ? GetAs<ShaderExecutable9>(vertexExe)->getVertexShader() : nullptr);
@@ -2353,7 +2369,10 @@ bool Renderer9::resetDevice()
if (!removedDevice)
{
// reset device defaults
- initializeDevice();
+ if (initializeDevice().isError())
+ {
+ return false;
+ }
}
return true;
@@ -3082,20 +3101,6 @@ angle::WorkaroundsD3D Renderer9::generateWorkarounds() const
return d3d9::GenerateWorkarounds();
}
-gl::Error Renderer9::clearTextures(const gl::Context *context,
- gl::SamplerType samplerType,
- size_t rangeStart,
- size_t rangeEnd)
-{
- // TODO(jmadill): faster way?
- for (size_t samplerIndex = rangeStart; samplerIndex < rangeEnd; samplerIndex++)
- {
- ANGLE_TRY(setTexture(context, samplerType, static_cast<int>(samplerIndex), nullptr));
- }
-
- return gl::NoError();
-}
-
egl::Error Renderer9::getEGLDevice(DeviceImpl **device)
{
if (mEGLDevice == nullptr)
@@ -3126,8 +3131,7 @@ gl::Error Renderer9::genericDrawElements(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
const auto &data = context->getContextState();
gl::Program *program = context->getGLState().getProgram();
@@ -3144,10 +3148,7 @@ gl::Error Renderer9::genericDrawElements(const gl::Context *context,
ANGLE_TRY(updateState(context, mode));
- TranslatedIndexData indexInfo;
- indexInfo.indexRange = indexRange;
- ANGLE_TRY(applyIndexBuffer(data, indices, count, mode, type, &indexInfo));
applyTransformFeedbackBuffers(data.getState());
// Transform feedback is not allowed for DrawElements, this error should have been caught at the
@@ -3155,17 +3156,13 @@ gl::Error Renderer9::genericDrawElements(const gl::Context *context,
// layer.
ASSERT(!data.getState().isTransformFeedbackActiveUnpaused());
- size_t vertexCount = indexInfo.indexRange.vertexCount();
- ANGLE_TRY(applyVertexBuffer(data.getState(), mode,
- static_cast<GLsizei>(indexInfo.indexRange.start),
- static_cast<GLsizei>(vertexCount), instances, &indexInfo));
ANGLE_TRY(applyTextures(context));
ANGLE_TRY(applyShaders(context, mode));
ANGLE_TRY(programD3D->applyUniformBuffers(data));
if (!skipDraw(data, mode))
{
- ANGLE_TRY(drawElementsImpl(data, indexInfo, mode, count, type, indices, instances));
+ ANGLE_TRY(drawElementsImpl(context, mode, count, type, indices, instances));
}
return gl::NoError();
@@ -3227,10 +3224,100 @@ gl::Error Renderer9::applyComputeUniforms(const ProgramD3D &programD3D,
return gl::InternalError() << "Compute shader is not implemented on D3D9";
}
-gl::Error Renderer9::clearRenderTarget(RenderTargetD3D *renderTarget, const gl::ColorF &clearValues)
+gl::Error Renderer9::clearRenderTarget(RenderTargetD3D *renderTarget,
+ const gl::ColorF &clearColorValue,
+ const float clearDepthValue,
+ const unsigned int clearStencilValue)
{
UNIMPLEMENTED();
return gl::InternalError() << "clearRenderTarget is not implemented on D3D9";
}
+// For each Direct3D sampler of either the pixel or vertex stage,
+// looks up the corresponding OpenGL texture image unit and texture type,
+// and sets the texture and its addressing/filtering state (or NULL when inactive).
+// Sampler mapping needs to be up-to-date on the program object before this is called.
+gl::Error Renderer9::applyTextures(const gl::Context *context,
+ gl::SamplerType shaderType,
+ const FramebufferTextureArray &framebufferTextures,
+ size_t framebufferTextureCount)
+{
+ const auto &glState = context->getGLState();
+ const auto &caps = context->getCaps();
+ ProgramD3D *programD3D = GetImplAs<ProgramD3D>(glState.getProgram());
+
+ ASSERT(!programD3D->isSamplerMappingDirty());
+
+ // TODO(jmadill): Use the Program's sampler bindings.
+
+ unsigned int samplerRange = programD3D->getUsedSamplerRange(shaderType);
+ for (unsigned int samplerIndex = 0; samplerIndex < samplerRange; samplerIndex++)
+ {
+ GLenum textureType = programD3D->getSamplerTextureType(shaderType, samplerIndex);
+ GLint textureUnit = programD3D->getSamplerMapping(shaderType, samplerIndex, caps);
+ if (textureUnit != -1)
+ {
+ gl::Texture *texture = glState.getSamplerTexture(textureUnit, textureType);
+ ASSERT(texture);
+
+ gl::Sampler *samplerObject = glState.getSampler(textureUnit);
+
+ const gl::SamplerState &samplerState =
+ samplerObject ? samplerObject->getSamplerState() : texture->getSamplerState();
+
+ // TODO: std::binary_search may become unavailable using older versions of GCC
+ if (texture->getTextureState().isSamplerComplete(samplerState,
+ context->getContextState()) &&
+ !std::binary_search(framebufferTextures.begin(),
+ framebufferTextures.begin() + framebufferTextureCount, texture))
+ {
+ ANGLE_TRY(
+ setSamplerState(context, shaderType, samplerIndex, texture, samplerState));
+ ANGLE_TRY(setTexture(context, shaderType, samplerIndex, texture));
+ }
+ else
+ {
+ // Texture is not sampler complete or it is in use by the framebuffer. Bind the
+ // incomplete texture.
+ gl::Texture *incompleteTexture = getIncompleteTexture(context, textureType);
+
+ ANGLE_TRY(setSamplerState(context, shaderType, samplerIndex, incompleteTexture,
+ incompleteTexture->getSamplerState()));
+ ANGLE_TRY(setTexture(context, shaderType, samplerIndex, incompleteTexture));
+ }
+ }
+ else
+ {
+ // No texture bound to this slot even though it is used by the shader, bind a NULL
+ // texture
+ ANGLE_TRY(setTexture(context, shaderType, samplerIndex, nullptr));
+ }
+ }
+
+ // Set all the remaining textures to NULL
+ size_t samplerCount = (shaderType == gl::SAMPLER_PIXEL) ? caps.maxTextureImageUnits
+ : caps.maxVertexTextureImageUnits;
+
+ // TODO(jmadill): faster way?
+ for (size_t samplerIndex = samplerRange; samplerIndex < samplerCount; samplerIndex++)
+ {
+ ANGLE_TRY(setTexture(context, shaderType, static_cast<int>(samplerIndex), nullptr));
+ }
+
+ return gl::NoError();
+}
+
+gl::Error Renderer9::applyTextures(const gl::Context *context)
+{
+ FramebufferTextureArray framebufferTextures;
+ size_t framebufferSerialCount =
+ getBoundFramebufferTextures(context->getContextState(), &framebufferTextures);
+
+ ANGLE_TRY(
+ applyTextures(context, gl::SAMPLER_VERTEX, framebufferTextures, framebufferSerialCount));
+ ANGLE_TRY(
+ applyTextures(context, gl::SAMPLER_PIXEL, framebufferTextures, framebufferSerialCount));
+ return gl::NoError();
+}
+
} // namespace rx
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 e22239ce2fb..642e82b472e 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
@@ -123,11 +123,11 @@ class Renderer9 : public RendererD3D
gl::SamplerType type,
int index,
gl::Texture *texture,
- const gl::SamplerState &sampler) override;
+ const gl::SamplerState &sampler);
gl::Error setTexture(const gl::Context *context,
gl::SamplerType type,
int index,
- gl::Texture *texture) override;
+ gl::Texture *texture);
gl::Error setUniformBuffers(const gl::ContextState &data,
const std::vector<GLint> &vertexUniformBuffers,
@@ -382,8 +382,7 @@ class Renderer9 : public RendererD3D
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange);
+ GLsizei instances);
// Necessary hack for default framebuffers in D3D.
FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override;
@@ -396,13 +395,9 @@ class Renderer9 : public RendererD3D
const std::vector<D3DUniform *> &uniformArray) override;
gl::Error clearRenderTarget(RenderTargetD3D *renderTarget,
- const gl::ColorF &clearValues) override;
-
- protected:
- gl::Error clearTextures(const gl::Context *context,
- gl::SamplerType samplerType,
- size_t rangeStart,
- size_t rangeEnd) override;
+ const gl::ColorF &clearColorValue,
+ const float clearDepthValue,
+ const unsigned int clearStencilValue) override;
private:
gl::Error drawArraysImpl(const gl::ContextState &data,
@@ -410,8 +405,7 @@ class Renderer9 : public RendererD3D
GLint startVertex,
GLsizei count,
GLsizei instances);
- gl::Error drawElementsImpl(const gl::ContextState &data,
- const TranslatedIndexData &indexInfo,
+ gl::Error drawElementsImpl(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
@@ -420,6 +414,12 @@ class Renderer9 : public RendererD3D
gl::Error applyShaders(const gl::Context *context, GLenum drawMode);
+ gl::Error applyTextures(const gl::Context *context);
+ gl::Error applyTextures(const gl::Context *context,
+ gl::SamplerType shaderType,
+ const FramebufferTextureArray &framebufferTextures,
+ size_t framebufferTextureCount);
+
void generateCaps(gl::Caps *outCaps,
gl::TextureCapsMap *outTextureCaps,
gl::Extensions *outExtensions,
@@ -456,7 +456,7 @@ class Renderer9 : public RendererD3D
HMODULE mD3d9Module;
- void initializeDevice();
+ egl::Error initializeDevice();
D3DPRESENT_PARAMETERS getDefaultPresentParameters();
void releaseDeviceResources();
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h
index 28b8717e6ea..08c40e83659 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h
@@ -9,7 +9,9 @@
#ifndef LIBANGLE_RENDERER_D3D_D3D9_VERTEXARRAY9_H_
#define LIBANGLE_RENDERER_D3D_D3D9_VERTEXARRAY9_H_
+#include "libANGLE/Context.h"
#include "libANGLE/renderer/VertexArrayImpl.h"
+#include "libANGLE/renderer/d3d/d3d9/Context9.h"
#include "libANGLE/renderer/d3d/d3d9/Renderer9.h"
namespace rx
@@ -21,7 +23,19 @@ class VertexArray9 : public VertexArrayImpl
public:
VertexArray9(const gl::VertexArrayState &data) : VertexArrayImpl(data) {}
- virtual ~VertexArray9() { }
+ void syncState(const gl::Context *context, const gl::VertexArray::DirtyBits &dirtyBits) override
+ {
+ ASSERT(dirtyBits.any());
+ Renderer9 *renderer = GetImplAs<Context9>(context)->getRenderer();
+ mCurrentStateSerial = renderer->generateSerial();
+ }
+
+ ~VertexArray9() override {}
+
+ Serial getCurrentStateSerial() const { return mCurrentStateSerial; }
+
+ private:
+ Serial mCurrentStateSerial;
};
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gen_angle_format_table.py b/chromium/third_party/angle/src/libANGLE/renderer/gen_angle_format_table.py
index 2afab2a3938..c66bce7b279 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gen_angle_format_table.py
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gen_angle_format_table.py
@@ -66,6 +66,17 @@ constexpr Format g_formatInfoTable[] = {{
}};
// static
+Format::ID Format::InternalFormatToID(GLenum internalFormat)
+{{
+ switch (internalFormat)
+ {{
+ // clang-format off
+{angle_format_switch}
+ // clang-format on
+ }}
+}}
+
+// static
const Format &Format::Get(ID id)
{{
return g_formatInfoTable[static_cast<size_t>(id)];
@@ -216,6 +227,14 @@ def gen_enum_string(all_angle):
enum_data += ',\n ' + format_id
return enum_data
+def gen_map_switch_string(gl_to_angle):
+ switch_data = '';
+ for gl_format in gl_to_angle:
+ angle_format = gl_to_angle[gl_format]
+ switch_data += " case " + gl_format + ": return Format::ID::" + angle_format + ";\n"
+ switch_data += " default: return Format::ID::NONE;"
+ return switch_data;
+
gl_to_angle = angle_format.load_forward_table('angle_format_map.json')
angle_to_gl = angle_format.load_inverse_table('angle_format_map.json')
data_source_name = 'angle_format_data.json'
@@ -224,10 +243,12 @@ all_angle = angle_to_gl.keys()
angle_format_cases = parse_angle_format_table(
all_angle, json_data, angle_to_gl)
+switch_data = gen_map_switch_string(gl_to_angle)
output_cpp = template_autogen_inl.format(
script_name = sys.argv[0],
copyright_year = date.today().year,
angle_format_info_cases = angle_format_cases,
+ angle_format_switch = switch_data,
data_source_name = data_source_name)
with open('Format_table_autogen.cpp', 'wt') as out_file:
out_file.write(output_cpp)
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 a97c9cfb6ac..90ee4a795bf 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.cpp
@@ -9,14 +9,18 @@
#include "libANGLE/renderer/gl/BlitGL.h"
#include "common/vector_utils.h"
-#include "libANGLE/formatutils.h"
+#include "image_util/copyimage.h"
+#include "libANGLE/Context.h"
#include "libANGLE/Framebuffer.h"
-#include "libANGLE/renderer/gl/formatutilsgl.h"
+#include "libANGLE/formatutils.h"
+#include "libANGLE/renderer/Format.h"
#include "libANGLE/renderer/gl/FramebufferGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
-#include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"
+#include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/WorkaroundsGL.h"
+#include "libANGLE/renderer/gl/formatutilsgl.h"
+#include "libANGLE/renderer/renderer_utils.h"
using angle::Vector2;
@@ -114,12 +118,6 @@ BlitGL::BlitGL(const FunctionsGL *functions,
: mFunctions(functions),
mWorkarounds(workarounds),
mStateManager(stateManager),
- mBlitProgram(0),
- mSourceTextureLocation(-1),
- mScaleLocation(-1),
- mOffsetLocation(-1),
- mMultiplyAlphaLocation(-1),
- mUnMultiplyAlphaLocation(-1),
mScratchFBO(0),
mVAO(0),
mVertexBuffer(0)
@@ -135,11 +133,11 @@ BlitGL::BlitGL(const FunctionsGL *functions,
BlitGL::~BlitGL()
{
- if (mBlitProgram != 0)
+ for (const auto &blitProgram : mBlitPrograms)
{
- mStateManager->deleteProgram(mBlitProgram);
- mBlitProgram = 0;
+ mStateManager->deleteProgram(blitProgram.second.program);
}
+ mBlitPrograms.clear();
for (size_t i = 0; i < ArraySize(mScratchTextures); i++)
{
@@ -200,6 +198,9 @@ gl::Error BlitGL::copySubImageToLUMAWorkaroundTexture(const gl::Context *context
{
ANGLE_TRY(initializeResources());
+ BlitProgram *blitProgram = nullptr;
+ ANGLE_TRY(getBlitProgram(BlitProgramType::FLOAT_TO_FLOAT, &blitProgram));
+
// Blit the framebuffer to the first scratch texture
const FramebufferGL *sourceFramebufferGL = GetImplAs<FramebufferGL>(source);
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, sourceFramebufferGL->getFramebufferID());
@@ -243,12 +244,12 @@ gl::Error BlitGL::copySubImageToLUMAWorkaroundTexture(const gl::Context *context
mStateManager->activeTexture(0);
mStateManager->bindTexture(GL_TEXTURE_2D, mScratchTextures[0]);
- mStateManager->useProgram(mBlitProgram);
- mFunctions->uniform1i(mSourceTextureLocation, 0);
- mFunctions->uniform2f(mScaleLocation, 1.0, 1.0);
- mFunctions->uniform2f(mOffsetLocation, 0.0, 0.0);
- mFunctions->uniform1i(mMultiplyAlphaLocation, 0);
- mFunctions->uniform1i(mUnMultiplyAlphaLocation, 0);
+ mStateManager->useProgram(blitProgram->program);
+ mFunctions->uniform1i(blitProgram->sourceTextureLocation, 0);
+ mFunctions->uniform2f(blitProgram->scaleLocation, 1.0, 1.0);
+ mFunctions->uniform2f(blitProgram->offsetLocation, 0.0, 0.0);
+ mFunctions->uniform1i(blitProgram->multiplyAlphaLocation, 0);
+ mFunctions->uniform1i(blitProgram->unMultiplyAlphaLocation, 0);
mStateManager->bindVertexArray(mVAO, 0);
mFunctions->drawArrays(GL_TRIANGLES, 0, 3);
@@ -281,6 +282,9 @@ gl::Error BlitGL::blitColorBufferWithShader(const gl::Framebuffer *source,
{
ANGLE_TRY(initializeResources());
+ BlitProgram *blitProgram = nullptr;
+ ANGLE_TRY(getBlitProgram(BlitProgramType::FLOAT_TO_FLOAT, &blitProgram));
+
// Normalize the destination area to have positive width and height because we will use
// glViewport to set it, which doesn't allow negative width or height.
gl::Rectangle sourceArea = sourceAreaIn;
@@ -412,12 +416,12 @@ gl::Error BlitGL::blitColorBufferWithShader(const gl::Framebuffer *source,
mStateManager->activeTexture(0);
mStateManager->bindTexture(GL_TEXTURE_2D, textureId);
- mStateManager->useProgram(mBlitProgram);
- mFunctions->uniform1i(mSourceTextureLocation, 0);
- mFunctions->uniform2f(mScaleLocation, texCoordScale.x(), texCoordScale.y());
- mFunctions->uniform2f(mOffsetLocation, texCoordOffset.x(), texCoordOffset.y());
- mFunctions->uniform1i(mMultiplyAlphaLocation, 0);
- mFunctions->uniform1i(mUnMultiplyAlphaLocation, 0);
+ mStateManager->useProgram(blitProgram->program);
+ mFunctions->uniform1i(blitProgram->sourceTextureLocation, 0);
+ mFunctions->uniform2f(blitProgram->scaleLocation, texCoordScale.x(), texCoordScale.y());
+ mFunctions->uniform2f(blitProgram->offsetLocation, texCoordOffset.x(), texCoordOffset.y());
+ mFunctions->uniform1i(blitProgram->multiplyAlphaLocation, 0);
+ mFunctions->uniform1i(blitProgram->unMultiplyAlphaLocation, 0);
const FramebufferGL *destGL = GetImplAs<FramebufferGL>(dest);
mStateManager->bindFramebuffer(GL_DRAW_FRAMEBUFFER, destGL->getFramebufferID());
@@ -431,9 +435,11 @@ gl::Error BlitGL::blitColorBufferWithShader(const gl::Framebuffer *source,
gl::Error BlitGL::copySubTexture(const gl::Context *context,
TextureGL *source,
size_t sourceLevel,
+ GLenum sourceComponentType,
TextureGL *dest,
GLenum destTarget,
size_t destLevel,
+ GLenum destComponentType,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
@@ -445,6 +451,10 @@ gl::Error BlitGL::copySubTexture(const gl::Context *context,
{
ANGLE_TRY(initializeResources());
+ BlitProgramType blitProgramType = getBlitProgramType(sourceComponentType, destComponentType);
+ BlitProgram *blitProgram = nullptr;
+ ANGLE_TRY(getBlitProgram(blitProgramType, &blitProgram));
+
// Setup the source texture
if (needsLumaWorkaround)
{
@@ -490,19 +500,19 @@ gl::Error BlitGL::copySubTexture(const gl::Context *context,
scale.y() = -scale.y();
}
- mStateManager->useProgram(mBlitProgram);
- mFunctions->uniform1i(mSourceTextureLocation, 0);
- mFunctions->uniform2f(mScaleLocation, scale.x(), scale.y());
- mFunctions->uniform2f(mOffsetLocation, offset.x(), offset.y());
+ mStateManager->useProgram(blitProgram->program);
+ mFunctions->uniform1i(blitProgram->sourceTextureLocation, 0);
+ mFunctions->uniform2f(blitProgram->scaleLocation, scale.x(), scale.y());
+ mFunctions->uniform2f(blitProgram->offsetLocation, offset.x(), offset.y());
if (unpackPremultiplyAlpha == unpackUnmultiplyAlpha)
{
- mFunctions->uniform1i(mMultiplyAlphaLocation, 0);
- mFunctions->uniform1i(mUnMultiplyAlphaLocation, 0);
+ mFunctions->uniform1i(blitProgram->multiplyAlphaLocation, 0);
+ mFunctions->uniform1i(blitProgram->unMultiplyAlphaLocation, 0);
}
else
{
- mFunctions->uniform1i(mMultiplyAlphaLocation, unpackPremultiplyAlpha);
- mFunctions->uniform1i(mUnMultiplyAlphaLocation, unpackUnmultiplyAlpha);
+ mFunctions->uniform1i(blitProgram->multiplyAlphaLocation, unpackPremultiplyAlpha);
+ mFunctions->uniform1i(blitProgram->unMultiplyAlphaLocation, unpackUnmultiplyAlpha);
}
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mScratchFBO);
@@ -515,6 +525,78 @@ gl::Error BlitGL::copySubTexture(const gl::Context *context,
return gl::NoError();
}
+gl::Error BlitGL::copySubTextureCPUReadback(const gl::Context *context,
+ TextureGL *source,
+ size_t sourceLevel,
+ GLenum sourceComponentType,
+ TextureGL *dest,
+ GLenum destTarget,
+ size_t destLevel,
+ GLenum destFormat,
+ GLenum destType,
+ const gl::Rectangle &sourceArea,
+ const gl::Offset &destOffset,
+ bool unpackFlipY,
+ bool unpackPremultiplyAlpha,
+ bool unpackUnmultiplyAlpha)
+{
+ ASSERT(source->getTarget() == GL_TEXTURE_2D);
+ const auto &destInternalFormatInfo = gl::GetInternalFormatInfo(destFormat, destType);
+
+ // Create a buffer for holding the source and destination memory
+ const size_t sourcePixelSize = 4;
+ size_t sourceBufferSize = sourceArea.width * sourceArea.height * sourcePixelSize;
+ size_t destBufferSize =
+ sourceArea.width * sourceArea.height * destInternalFormatInfo.pixelBytes;
+ angle::MemoryBuffer *buffer = nullptr;
+ ANGLE_TRY(context->getScratchBuffer(sourceBufferSize + destBufferSize, &buffer));
+ uint8_t *sourceMemory = buffer->data();
+ uint8_t *destMemory = buffer->data() + sourceBufferSize;
+
+ mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mScratchFBO);
+ mFunctions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, source->getTarget(),
+ source->getTextureID(), static_cast<GLint>(sourceLevel));
+
+ GLenum readPixelsFormat = GL_NONE;
+ ColorReadFunction readFunction = nullptr;
+ if (sourceComponentType == GL_UNSIGNED_INT)
+ {
+ readPixelsFormat = GL_RGBA_INTEGER;
+ readFunction = angle::ReadColor<angle::R8G8B8A8, GLuint>;
+ }
+ else
+ {
+ ASSERT(sourceComponentType != GL_INT);
+ readPixelsFormat = GL_RGBA;
+ readFunction = angle::ReadColor<angle::R8G8B8A8, GLfloat>;
+ }
+
+ mStateManager->setPixelUnpackState(gl::PixelUnpackState(1, 0));
+ mFunctions->readPixels(sourceArea.x, sourceArea.y, sourceArea.width, sourceArea.height,
+ readPixelsFormat, GL_UNSIGNED_BYTE, sourceMemory);
+
+ angle::Format::ID destFormatID =
+ angle::Format::InternalFormatToID(destInternalFormatInfo.sizedInternalFormat);
+ const auto &destFormatInfo = angle::Format::Get(destFormatID);
+ CopyImageCHROMIUM(
+ sourceMemory, sourceArea.width * sourcePixelSize, sourcePixelSize, readFunction, destMemory,
+ sourceArea.width * destInternalFormatInfo.pixelBytes, destInternalFormatInfo.pixelBytes,
+ destFormatInfo.colorWriteFunction, destInternalFormatInfo.format,
+ destInternalFormatInfo.componentType, sourceArea.width, sourceArea.height, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
+
+ mStateManager->setPixelPackState(gl::PixelPackState(1, false));
+
+ nativegl::TexSubImageFormat texSubImageFormat =
+ nativegl::GetTexSubImageFormat(mFunctions, mWorkarounds, destFormat, destType);
+
+ mFunctions->texSubImage2D(destTarget, static_cast<GLint>(destLevel), destOffset.x, destOffset.y,
+ sourceArea.width, sourceArea.height, texSubImageFormat.format,
+ texSubImageFormat.type, destMemory);
+
+ return gl::NoError();
+}
+
gl::Error BlitGL::copyTexSubImage(TextureGL *source,
size_t sourceLevel,
TextureGL *dest,
@@ -540,75 +622,6 @@ gl::Error BlitGL::copyTexSubImage(TextureGL *source,
gl::Error BlitGL::initializeResources()
{
- if (mBlitProgram == 0)
- {
- mBlitProgram = mFunctions->createProgram();
-
- // Compile the fragment shader
- const char *vsSource =
- "#version 100\n"
- "varying vec2 v_texcoord;\n"
- "uniform vec2 u_scale;\n"
- "uniform vec2 u_offset;\n"
- "attribute vec2 a_texcoord;\n"
- "\n"
- "void main()\n"
- "{\n"
- " gl_Position = vec4((a_texcoord * 2.0) - 1.0, 0.0, 1.0);\n"
- " v_texcoord = a_texcoord * u_scale + u_offset;\n"
- "}\n";
-
- GLuint vs = mFunctions->createShader(GL_VERTEX_SHADER);
- mFunctions->shaderSource(vs, 1, &vsSource, nullptr);
- mFunctions->compileShader(vs);
- ANGLE_TRY(CheckCompileStatus(mFunctions, vs));
-
- mFunctions->attachShader(mBlitProgram, vs);
- mFunctions->deleteShader(vs);
-
- // Compile the vertex shader
- // It discards if the texcoord is outside (0, 1)^2 so the blitframebuffer workaround
- // doesn't write when the point sampled is outside of the source framebuffer.
- const char *fsSource =
- "#version 100\n"
- "precision highp float;"
- "uniform sampler2D u_source_texture;\n"
- "uniform bool u_multiply_alpha;\n"
- "uniform bool u_unmultiply_alpha;\n"
- "varying vec2 v_texcoord;\n"
- "\n"
- "void main()\n"
- "{\n"
- " if (clamp(v_texcoord, vec2(0.0), vec2(1.0)) != v_texcoord)\n"
- " {\n"
- " discard;\n"
- " }\n"
- " vec4 color = texture2D(u_source_texture, v_texcoord);\n"
- " if (u_multiply_alpha) {color.xyz = color.xyz * color.a;}"
- " if (u_unmultiply_alpha && color.a != 0.0) {color.xyz = color.xyz / color.a;}"
- " gl_FragColor = color;"
- "}\n";
-
- GLuint fs = mFunctions->createShader(GL_FRAGMENT_SHADER);
- mFunctions->shaderSource(fs, 1, &fsSource, nullptr);
- mFunctions->compileShader(fs);
- ANGLE_TRY(CheckCompileStatus(mFunctions, fs));
-
- mFunctions->attachShader(mBlitProgram, fs);
- mFunctions->deleteShader(fs);
-
- mFunctions->linkProgram(mBlitProgram);
- ANGLE_TRY(CheckLinkStatus(mFunctions, mBlitProgram));
-
- mTexCoordAttributeLocation = mFunctions->getAttribLocation(mBlitProgram, "a_texcoord");
- mSourceTextureLocation = mFunctions->getUniformLocation(mBlitProgram, "u_source_texture");
- mScaleLocation = mFunctions->getUniformLocation(mBlitProgram, "u_scale");
- mOffsetLocation = mFunctions->getUniformLocation(mBlitProgram, "u_offset");
- mMultiplyAlphaLocation = mFunctions->getUniformLocation(mBlitProgram, "u_multiply_alpha");
- mUnMultiplyAlphaLocation =
- mFunctions->getUniformLocation(mBlitProgram, "u_unmultiply_alpha");
- }
-
for (size_t i = 0; i < ArraySize(mScratchTextures); i++)
{
if (mScratchTextures[i] == 0)
@@ -642,9 +655,17 @@ gl::Error BlitGL::initializeResources()
mStateManager->bindVertexArray(mVAO, 0);
mStateManager->bindBuffer(GL_ARRAY_BUFFER, mVertexBuffer);
- mFunctions->enableVertexAttribArray(mTexCoordAttributeLocation);
- mFunctions->vertexAttribPointer(mTexCoordAttributeLocation, 2, GL_FLOAT, GL_FALSE, 0,
- nullptr);
+
+ // Enable all attributes with the same buffer so that it doesn't matter what location the
+ // texcoord attribute is assigned
+ GLint maxAttributes = 0;
+ mFunctions->getIntegerv(GL_MAX_VERTEX_ATTRIBS, &maxAttributes);
+
+ for (GLint i = 0; i < maxAttributes; i++)
+ {
+ mFunctions->enableVertexAttribArray(i);
+ mFunctions->vertexAttribPointer(i, 2, GL_FLOAT, GL_FALSE, 0, nullptr);
+ }
}
return gl::NoError();
@@ -672,4 +693,222 @@ void BlitGL::setScratchTextureParameter(GLenum param, GLenum value)
}
}
+BlitGL::BlitProgramType BlitGL::getBlitProgramType(GLenum sourceComponentType,
+ GLenum destComponentType)
+{
+ if (sourceComponentType == GL_UNSIGNED_INT)
+ {
+ ASSERT(destComponentType == GL_UNSIGNED_INT);
+ return BlitProgramType::UINT_TO_UINT;
+ }
+ else
+ {
+ // Source is a float type
+ ASSERT(sourceComponentType != GL_INT);
+ if (destComponentType == GL_UNSIGNED_INT)
+ {
+ return BlitProgramType::FLOAT_TO_UINT;
+ }
+ else
+ {
+ // Dest is a float type
+ return BlitProgramType::FLOAT_TO_FLOAT;
+ }
+ }
+}
+
+gl::Error BlitGL::getBlitProgram(BlitProgramType type, BlitProgram **program)
+{
+ BlitProgram &result = mBlitPrograms[type];
+ if (result.program == 0)
+ {
+ result.program = mFunctions->createProgram();
+
+ // Depending on what types need to be output by the shaders, different versions need to be
+ // used.
+ std::string version;
+ std::string vsInputVariableQualifier;
+ std::string vsOutputVariableQualifier;
+ std::string fsInputVariableQualifier;
+ std::string fsOutputVariableQualifier;
+ std::string sampleFunction;
+ if (type == BlitProgramType::FLOAT_TO_FLOAT)
+ {
+ version = "100";
+ vsInputVariableQualifier = "attribute";
+ vsOutputVariableQualifier = "varying";
+ fsInputVariableQualifier = "varying";
+ fsOutputVariableQualifier = "";
+ sampleFunction = "texture2D";
+ }
+ else
+ {
+ // Need to use a higher version to support non-float output types
+ if (mFunctions->standard == STANDARD_GL_DESKTOP)
+ {
+ version = "330";
+ }
+ else
+ {
+ ASSERT(mFunctions->standard == STANDARD_GL_ES);
+ version = "300 es";
+ }
+ vsInputVariableQualifier = "in";
+ vsOutputVariableQualifier = "out";
+ fsInputVariableQualifier = "in";
+ fsOutputVariableQualifier = "out";
+ sampleFunction = "texture";
+ }
+
+ {
+ // Compile the vertex shader
+ std::ostringstream vsSourceStream;
+ vsSourceStream << "#version " << version << "\n";
+ vsSourceStream << vsInputVariableQualifier << " vec2 a_texcoord;\n";
+ vsSourceStream << "uniform vec2 u_scale;\n";
+ vsSourceStream << "uniform vec2 u_offset;\n";
+ vsSourceStream << vsOutputVariableQualifier << " vec2 v_texcoord;\n";
+ vsSourceStream << "\n";
+ vsSourceStream << "void main()\n";
+ vsSourceStream << "{\n";
+ vsSourceStream << " gl_Position = vec4((a_texcoord * 2.0) - 1.0, 0.0, 1.0);\n";
+ vsSourceStream << " v_texcoord = a_texcoord * u_scale + u_offset;\n";
+ vsSourceStream << "}\n";
+
+ std::string vsSourceStr = vsSourceStream.str();
+ const char *vsSourceCStr = vsSourceStr.c_str();
+
+ GLuint vs = mFunctions->createShader(GL_VERTEX_SHADER);
+ mFunctions->shaderSource(vs, 1, &vsSourceCStr, nullptr);
+ mFunctions->compileShader(vs);
+ ANGLE_TRY(CheckCompileStatus(mFunctions, vs));
+
+ mFunctions->attachShader(result.program, vs);
+ mFunctions->deleteShader(vs);
+ }
+
+ {
+ // Sampling texture uniform changes depending on source texture type.
+ std::string samplerType;
+ std::string samplerResultType;
+ switch (type)
+ {
+ case BlitProgramType::FLOAT_TO_FLOAT:
+ case BlitProgramType::FLOAT_TO_UINT:
+ samplerType = "sampler2D";
+ samplerResultType = "vec4";
+ break;
+
+ case BlitProgramType::UINT_TO_UINT:
+ samplerType = "usampler2D";
+ samplerResultType = "uvec4";
+ break;
+
+ default:
+ UNREACHABLE();
+ break;
+ }
+
+ // Output variables depend on the output type
+ std::string outputType;
+ std::string outputVariableName;
+ std::string outputMultiplier;
+ switch (type)
+ {
+ case BlitProgramType::FLOAT_TO_FLOAT:
+ outputType = "";
+ outputVariableName = "gl_FragColor";
+ outputMultiplier = "1.0";
+ break;
+
+ case BlitProgramType::FLOAT_TO_UINT:
+ case BlitProgramType::UINT_TO_UINT:
+ outputType = "uvec4";
+ outputVariableName = "outputUint";
+ outputMultiplier = "255.0";
+ break;
+
+ default:
+ UNREACHABLE();
+ break;
+ }
+
+ // Compile the fragment shader
+ std::ostringstream fsSourceStream;
+ fsSourceStream << "#version " << version << "\n";
+ fsSourceStream << "precision highp float;\n";
+ fsSourceStream << "uniform " << samplerType << " u_source_texture;\n";
+
+ // Write the rest of the uniforms and varyings
+ fsSourceStream << "uniform bool u_multiply_alpha;\n";
+ fsSourceStream << "uniform bool u_unmultiply_alpha;\n";
+ fsSourceStream << fsInputVariableQualifier << " vec2 v_texcoord;\n";
+ if (!outputType.empty())
+ {
+ fsSourceStream << fsOutputVariableQualifier << " " << outputType << " "
+ << outputVariableName << ";\n";
+ }
+
+ // Write the main body
+ fsSourceStream << "\n";
+ fsSourceStream << "void main()\n";
+ fsSourceStream << "{\n";
+
+ // discard if the texcoord is outside (0, 1)^2 so the blitframebuffer workaround
+ // doesn't write when the point sampled is outside of the source framebuffer.
+ fsSourceStream << " if (clamp(v_texcoord, vec2(0.0), vec2(1.0)) != v_texcoord)\n";
+ fsSourceStream << " {\n";
+ fsSourceStream << " discard;\n";
+ fsSourceStream << " }\n";
+
+ // Sampling code depends on the input data type
+ fsSourceStream << " " << samplerResultType << " color = " << sampleFunction
+ << "(u_source_texture, v_texcoord);\n";
+
+ // Perform the premultiply or unmultiply alpha logic
+ fsSourceStream << " if (u_multiply_alpha)\n";
+ fsSourceStream << " {\n";
+ fsSourceStream << " color.xyz = color.xyz * color.a;\n";
+ fsSourceStream << " }\n";
+ fsSourceStream << " if (u_unmultiply_alpha && color.a != 0.0)\n";
+ fsSourceStream << " {\n";
+ fsSourceStream << " color.xyz = color.xyz / color.a;\n";
+ fsSourceStream << " }\n";
+
+ // Write the conversion to the destionation type
+ fsSourceStream << " color = color * " << outputMultiplier << ";\n";
+
+ // Write the output assignment code
+ fsSourceStream << " " << outputVariableName << " = " << outputType << "(color);\n";
+ fsSourceStream << "}\n";
+
+ std::string fsSourceStr = fsSourceStream.str();
+ const char *fsSourceCStr = fsSourceStr.c_str();
+
+ GLuint fs = mFunctions->createShader(GL_FRAGMENT_SHADER);
+ mFunctions->shaderSource(fs, 1, &fsSourceCStr, nullptr);
+ mFunctions->compileShader(fs);
+ ANGLE_TRY(CheckCompileStatus(mFunctions, fs));
+
+ mFunctions->attachShader(result.program, fs);
+ mFunctions->deleteShader(fs);
+ }
+
+ mFunctions->linkProgram(result.program);
+ ANGLE_TRY(CheckLinkStatus(mFunctions, result.program));
+
+ result.sourceTextureLocation =
+ mFunctions->getUniformLocation(result.program, "u_source_texture");
+ result.scaleLocation = mFunctions->getUniformLocation(result.program, "u_scale");
+ result.offsetLocation = mFunctions->getUniformLocation(result.program, "u_offset");
+ result.multiplyAlphaLocation =
+ mFunctions->getUniformLocation(result.program, "u_multiply_alpha");
+ result.unMultiplyAlphaLocation =
+ mFunctions->getUniformLocation(result.program, "u_unmultiply_alpha");
+ }
+
+ *program = &result;
+ return gl::NoError();
+}
+
} // namespace rx
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 0a49d051d8c..ea17b896a37 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/BlitGL.h
@@ -14,6 +14,8 @@
#include "libANGLE/angletypes.h"
#include "libANGLE/Error.h"
+#include <map>
+
namespace gl
{
class Framebuffer;
@@ -65,9 +67,11 @@ class BlitGL : angle::NonCopyable
gl::Error copySubTexture(const gl::Context *context,
TextureGL *source,
size_t sourceLevel,
+ GLenum sourceComponentType,
TextureGL *dest,
GLenum destTarget,
size_t destLevel,
+ GLenum destComponentType,
const gl::Extents &sourceSize,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset,
@@ -77,6 +81,21 @@ class BlitGL : angle::NonCopyable
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha);
+ gl::Error copySubTextureCPUReadback(const gl::Context *context,
+ TextureGL *source,
+ size_t sourceLevel,
+ GLenum sourceComponentType,
+ TextureGL *dest,
+ GLenum destTarget,
+ size_t destLevel,
+ GLenum destFormat,
+ GLenum destType,
+ const gl::Rectangle &sourceArea,
+ const gl::Offset &destOffset,
+ bool unpackFlipY,
+ bool unpackPremultiplyAlpha,
+ bool unpackUnmultiplyAlpha);
+
gl::Error copyTexSubImage(TextureGL *source,
size_t sourceLevel,
TextureGL *dest,
@@ -95,13 +114,27 @@ class BlitGL : angle::NonCopyable
const WorkaroundsGL &mWorkarounds;
StateManagerGL *mStateManager;
- GLuint mBlitProgram;
- GLint mTexCoordAttributeLocation;
- GLint mSourceTextureLocation;
- GLint mScaleLocation;
- GLint mOffsetLocation;
- GLint mMultiplyAlphaLocation;
- GLint mUnMultiplyAlphaLocation;
+ struct BlitProgram
+ {
+ GLuint program = 0;
+ GLint sourceTextureLocation = -1;
+ GLint scaleLocation = -1;
+ GLint offsetLocation = -1;
+ GLint multiplyAlphaLocation = -1;
+ GLint unMultiplyAlphaLocation = -1;
+ };
+
+ enum class BlitProgramType
+ {
+ FLOAT_TO_FLOAT,
+ FLOAT_TO_UINT,
+ UINT_TO_UINT,
+ };
+
+ static BlitProgramType getBlitProgramType(GLenum sourceComponentType, GLenum destComponentType);
+ gl::Error getBlitProgram(BlitProgramType type, BlitProgram **program);
+
+ std::map<BlitProgramType, BlitProgram> mBlitPrograms;
GLuint mScratchTextures[2];
GLuint mScratchFBO;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp
new file mode 100644
index 00000000000..0c9a3ba60ac
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.cpp
@@ -0,0 +1,240 @@
+//
+// Copyright 2017 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// ClearMultiviewGL:
+// A helper for clearing multiview side-by-side and layered framebuffers.
+//
+
+#include "libANGLE/renderer/gl/ClearMultiviewGL.h"
+#include "libANGLE/renderer/gl/FunctionsGL.h"
+#include "libANGLE/renderer/gl/StateManagerGL.h"
+#include "libANGLE/renderer/gl/TextureGL.h"
+
+#include "libANGLE/Framebuffer.h"
+
+namespace rx
+{
+
+ClearMultiviewGL::ClearMultiviewGL(const FunctionsGL *functions, StateManagerGL *stateManager)
+ : mFunctions(functions), mStateManager(stateManager), mFramebuffer(0u)
+{
+}
+
+ClearMultiviewGL::~ClearMultiviewGL()
+{
+ if (mFramebuffer != 0u)
+ {
+ mFunctions->deleteFramebuffers(1, &mFramebuffer);
+ }
+}
+
+void ClearMultiviewGL::clearMultiviewFBO(const gl::FramebufferState &state,
+ const gl::Rectangle &scissorBase,
+ ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil)
+{
+ const auto &firstAttachment = state.getFirstNonNullAttachment();
+ switch (firstAttachment->getMultiviewLayout())
+ {
+ case GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE:
+ clearLayeredFBO(state, clearCommandType, mask, buffer, drawbuffer, values, depth,
+ stencil);
+ break;
+ case GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE:
+ clearSideBySideFBO(state, scissorBase, clearCommandType, mask, buffer, drawbuffer,
+ values, depth, stencil);
+ break;
+ default:
+ UNREACHABLE();
+ }
+}
+
+void ClearMultiviewGL::clearLayeredFBO(const gl::FramebufferState &state,
+ ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil)
+{
+ initializeResources();
+
+ mStateManager->bindFramebuffer(GL_DRAW_FRAMEBUFFER, mFramebuffer);
+
+ const auto &firstAttachment = state.getFirstNonNullAttachment();
+ ASSERT(firstAttachment->getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE);
+
+ const auto &drawBuffers = state.getDrawBufferStates();
+ mFunctions->drawBuffers(static_cast<GLsizei>(drawBuffers.size()), drawBuffers.data());
+
+ // Attach the new attachments and clear.
+ int numViews = firstAttachment->getNumViews();
+ int baseViewIndex = firstAttachment->getBaseViewIndex();
+ for (int i = 0; i < numViews; ++i)
+ {
+ attachTextures(state, baseViewIndex + i);
+ genericClear(clearCommandType, mask, buffer, drawbuffer, values, depth, stencil);
+ }
+
+ detachTextures(state);
+}
+
+void ClearMultiviewGL::clearSideBySideFBO(const gl::FramebufferState &state,
+ const gl::Rectangle &scissorBase,
+ ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil)
+{
+ const auto &firstAttachment = state.getFirstNonNullAttachment();
+ ASSERT(firstAttachment->getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE);
+
+ const auto &viewportOffsets = firstAttachment->getMultiviewViewportOffsets();
+ for (size_t i = 0u; i < viewportOffsets.size(); ++i)
+ {
+ gl::Rectangle scissor(scissorBase.x + viewportOffsets[i].x,
+ scissorBase.y + viewportOffsets[i].y, scissorBase.width,
+ scissorBase.height);
+ mStateManager->setScissorIndexed(0u, scissor);
+ genericClear(clearCommandType, mask, buffer, drawbuffer, values, depth, stencil);
+ }
+}
+
+void ClearMultiviewGL::genericClear(ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil)
+{
+ switch (clearCommandType)
+ {
+ case ClearCommandType::Clear:
+ mFunctions->clear(mask);
+ break;
+ case ClearCommandType::ClearBufferfv:
+ mFunctions->clearBufferfv(buffer, drawbuffer,
+ reinterpret_cast<const GLfloat *>(values));
+ break;
+ case ClearCommandType::ClearBufferuiv:
+ mFunctions->clearBufferuiv(buffer, drawbuffer,
+ reinterpret_cast<const GLuint *>(values));
+ break;
+ case ClearCommandType::ClearBufferiv:
+ mFunctions->clearBufferiv(buffer, drawbuffer, reinterpret_cast<const GLint *>(values));
+ break;
+ case ClearCommandType::ClearBufferfi:
+ mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil);
+ break;
+ default:
+ UNREACHABLE();
+ }
+}
+
+void ClearMultiviewGL::attachTextures(const gl::FramebufferState &state, int layer)
+{
+ for (auto drawBufferId : state.getEnabledDrawBuffers())
+ {
+ const auto &attachment = state.getColorAttachment(drawBufferId);
+ if (attachment == nullptr)
+ {
+ continue;
+ }
+
+ const auto &imageIndex = attachment->getTextureImageIndex();
+ ASSERT(imageIndex.type == GL_TEXTURE_2D_ARRAY);
+
+ GLenum colorAttachment =
+ static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + static_cast<int>(drawBufferId));
+ const TextureGL *textureGL = GetImplAs<TextureGL>(attachment->getTexture());
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, colorAttachment,
+ textureGL->getTextureID(), imageIndex.mipIndex, layer);
+ }
+
+ const auto &depthStencilAttachment = state.getDepthStencilAttachment();
+ const auto &depthAttachment = state.getDepthAttachment();
+ const auto &stencilAttachment = state.getStencilAttachment();
+ if (depthStencilAttachment != nullptr)
+ {
+ const auto &imageIndex = depthStencilAttachment->getTextureImageIndex();
+ ASSERT(imageIndex.type == GL_TEXTURE_2D_ARRAY);
+
+ const TextureGL *textureGL = GetImplAs<TextureGL>(depthStencilAttachment->getTexture());
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT,
+ textureGL->getTextureID(), imageIndex.mipIndex, layer);
+ }
+ else if (depthAttachment != nullptr)
+ {
+ const auto &imageIndex = depthAttachment->getTextureImageIndex();
+ ASSERT(imageIndex.type == GL_TEXTURE_2D_ARRAY);
+
+ const TextureGL *textureGL = GetImplAs<TextureGL>(depthAttachment->getTexture());
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT,
+ textureGL->getTextureID(), imageIndex.mipIndex, layer);
+ }
+ else if (stencilAttachment != nullptr)
+ {
+ const auto &imageIndex = stencilAttachment->getTextureImageIndex();
+ ASSERT(imageIndex.type == GL_TEXTURE_2D_ARRAY);
+
+ const TextureGL *textureGL = GetImplAs<TextureGL>(stencilAttachment->getTexture());
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT,
+ textureGL->getTextureID(), imageIndex.mipIndex, layer);
+ }
+}
+
+void ClearMultiviewGL::detachTextures(const gl::FramebufferState &state)
+{
+ for (auto drawBufferId : state.getEnabledDrawBuffers())
+ {
+ const auto &attachment = state.getColorAttachment(drawBufferId);
+ if (attachment == nullptr)
+ {
+ continue;
+ }
+
+ GLenum colorAttachment =
+ static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + static_cast<int>(drawBufferId));
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, colorAttachment, 0, 0, 0);
+ }
+
+ const auto &depthStencilAttachment = state.getDepthStencilAttachment();
+ const auto &depthAttachment = state.getDepthAttachment();
+ const auto &stencilAttachment = state.getStencilAttachment();
+ if (depthStencilAttachment != nullptr)
+ {
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, 0, 0,
+ 0);
+ }
+ else if (depthAttachment != nullptr)
+ {
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, 0, 0, 0);
+ }
+ else if (stencilAttachment != nullptr)
+ {
+ mFunctions->framebufferTextureLayer(GL_DRAW_FRAMEBUFFER, GL_STENCIL_ATTACHMENT, 0, 0, 0);
+ }
+}
+
+void ClearMultiviewGL::initializeResources()
+{
+ if (mFramebuffer == 0u)
+ {
+ mFunctions->genFramebuffers(1, &mFramebuffer);
+ }
+ ASSERT(mFramebuffer != 0u);
+}
+
+} // namespace rx \ No newline at end of file
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.h
new file mode 100644
index 00000000000..cdbbfad1327
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ClearMultiviewGL.h
@@ -0,0 +1,95 @@
+//
+// Copyright 2017 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// ClearMultiviewGL:
+// A helper for clearing multiview side-by-side and layered framebuffers.
+//
+
+#ifndef LIBANGLE_RENDERER_GL_CLEARMULTIVIEWGL_H_
+#define LIBANGLE_RENDERER_GL_CLEARMULTIVIEWGL_H_
+
+#include "angle_gl.h"
+#include "libANGLE/Error.h"
+#include "libANGLE/angletypes.h"
+
+namespace gl
+{
+class FramebufferState;
+} // namespace gl
+
+namespace rx
+{
+class FunctionsGL;
+class StateManagerGL;
+
+class ClearMultiviewGL : angle::NonCopyable
+{
+ public:
+ // Enum containing the different types of Clear* commands.
+ enum class ClearCommandType
+ {
+ Clear,
+ ClearBufferfv,
+ ClearBufferuiv,
+ ClearBufferiv,
+ ClearBufferfi
+ };
+
+ public:
+ ClearMultiviewGL(const FunctionsGL *functions, StateManagerGL *stateManager);
+ ~ClearMultiviewGL();
+
+ ClearMultiviewGL(const ClearMultiviewGL &rht) = delete;
+ ClearMultiviewGL &operator=(const ClearMultiviewGL &rht) = delete;
+ ClearMultiviewGL(ClearMultiviewGL &&rht) = delete;
+ ClearMultiviewGL &operator=(ClearMultiviewGL &&rht) = delete;
+
+ void clearMultiviewFBO(const gl::FramebufferState &state,
+ const gl::Rectangle &scissorBase,
+ ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil);
+ void initializeResources();
+
+ private:
+ void attachTextures(const gl::FramebufferState &state, int layer);
+ void detachTextures(const gl::FramebufferState &state);
+ void clearLayeredFBO(const gl::FramebufferState &state,
+ ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil);
+ void clearSideBySideFBO(const gl::FramebufferState &state,
+ const gl::Rectangle &scissorBase,
+ ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil);
+ void genericClear(ClearCommandType clearCommandType,
+ GLbitfield mask,
+ GLenum buffer,
+ GLint drawbuffer,
+ const uint8_t *values,
+ GLfloat depth,
+ GLint stencil);
+
+ const FunctionsGL *mFunctions;
+ StateManagerGL *mStateManager;
+
+ GLuint mFramebuffer;
+};
+} // namespace rx
+
+#endif // LIBANGLE_RENDERER_GL_CLEARMULTIVIEWGL_H_ \ No newline at end of file
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 2634d12247f..e77ebfa1f95 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.cpp
@@ -12,7 +12,6 @@
#include "libANGLE/renderer/gl/BufferGL.h"
#include "libANGLE/renderer/gl/CompilerGL.h"
#include "libANGLE/renderer/gl/FenceNVGL.h"
-#include "libANGLE/renderer/gl/FenceSyncGL.h"
#include "libANGLE/renderer/gl/FramebufferGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/PathGL.h"
@@ -23,6 +22,7 @@
#include "libANGLE/renderer/gl/SamplerGL.h"
#include "libANGLE/renderer/gl/ShaderGL.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"
+#include "libANGLE/renderer/gl/SyncGL.h"
#include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/TransformFeedbackGL.h"
#include "libANGLE/renderer/gl/VertexArrayGL.h"
@@ -65,7 +65,7 @@ ProgramImpl *ContextGL::createProgram(const gl::ProgramState &data)
FramebufferImpl *ContextGL::createFramebuffer(const gl::FramebufferState &data)
{
return new FramebufferGL(data, getFunctions(), getStateManager(), getWorkaroundsGL(),
- mRenderer->getBlitter(), false);
+ mRenderer->getBlitter(), mRenderer->getMultiviewClearer(), false);
}
TextureImpl *ContextGL::createTexture(const gl::TextureState &state)
@@ -107,9 +107,9 @@ FenceNVImpl *ContextGL::createFenceNV()
return new FenceNVGL(getFunctions());
}
-FenceSyncImpl *ContextGL::createFenceSync()
+SyncImpl *ContextGL::createSync()
{
- return new FenceSyncGL(getFunctions());
+ return new SyncGL(getFunctions());
}
TransformFeedbackImpl *ContextGL::createTransformFeedback(const gl::TransformFeedbackState &state)
@@ -170,10 +170,9 @@ gl::Error ContextGL::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
- return mRenderer->drawElements(context, mode, count, type, indices, indexRange);
+ return mRenderer->drawElements(context, mode, count, type, indices);
}
gl::Error ContextGL::drawElementsInstanced(const gl::Context *context,
@@ -181,11 +180,9 @@ gl::Error ContextGL::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
- return mRenderer->drawElementsInstanced(context, mode, count, type, indices, instances,
- indexRange);
+ return mRenderer->drawElementsInstanced(context, mode, count, type, indices, instances);
}
gl::Error ContextGL::drawRangeElements(const gl::Context *context,
@@ -194,11 +191,9 @@ gl::Error ContextGL::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
- return mRenderer->drawRangeElements(context, mode, start, end, count, type, indices,
- indexRange);
+ return mRenderer->drawRangeElements(context, mode, start, end, count, type, indices);
}
gl::Error ContextGL::drawArraysIndirect(const gl::Context *context,
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 de5ae6dc30b..3fadd284e1d 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ContextGL.h
@@ -55,7 +55,7 @@ class ContextGL : public ContextImpl
// Query and Fence creation
QueryImpl *createQuery(GLenum type) override;
FenceNVImpl *createFenceNV() override;
- FenceSyncImpl *createFenceSync() override;
+ SyncImpl *createSync() override;
// Transform Feedback creation
TransformFeedbackImpl *createTransformFeedback(
@@ -86,23 +86,20 @@ class ContextGL : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange) override;
+ GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
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 805f923dc27..811fd5d3be1 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.cpp
@@ -17,6 +17,7 @@
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/ContextImpl.h"
#include "libANGLE/renderer/gl/BlitGL.h"
+#include "libANGLE/renderer/gl/ClearMultiviewGL.h"
#include "libANGLE/renderer/gl/ContextGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/RenderbufferGL.h"
@@ -33,53 +34,12 @@ using angle::CheckedNumeric;
namespace rx
{
-FramebufferGL::FramebufferGL(const FramebufferState &state,
- const FunctionsGL *functions,
- StateManagerGL *stateManager,
- const WorkaroundsGL &workarounds,
- BlitGL *blitter,
- bool isDefault)
- : FramebufferImpl(state),
- mFunctions(functions),
- mStateManager(stateManager),
- mWorkarounds(workarounds),
- mBlitter(blitter),
- mFramebufferID(0),
- mIsDefault(isDefault),
- mAppliedEnabledDrawBuffers(1)
+namespace
{
- if (!mIsDefault)
- {
- mFunctions->genFramebuffers(1, &mFramebufferID);
- }
-}
-FramebufferGL::FramebufferGL(GLuint id,
- const FramebufferState &state,
- const FunctionsGL *functions,
- const WorkaroundsGL &workarounds,
- BlitGL *blitter,
- StateManagerGL *stateManager)
- : FramebufferImpl(state),
- mFunctions(functions),
- mStateManager(stateManager),
- mWorkarounds(workarounds),
- mBlitter(blitter),
- mFramebufferID(id),
- mIsDefault(true),
- mAppliedEnabledDrawBuffers(1)
-{
-}
-
-FramebufferGL::~FramebufferGL()
-{
- mStateManager->deleteFramebuffer(mFramebufferID);
- mFramebufferID = 0;
-}
-
-static void BindFramebufferAttachment(const FunctionsGL *functions,
- GLenum attachmentPoint,
- const FramebufferAttachment *attachment)
+void BindFramebufferAttachment(const FunctionsGL *functions,
+ GLenum attachmentPoint,
+ const FramebufferAttachment *attachment)
{
if (attachment)
{
@@ -89,7 +49,8 @@ static void BindFramebufferAttachment(const FunctionsGL *functions,
const TextureGL *textureGL = GetImplAs<TextureGL>(texture);
if (texture->getTarget() == GL_TEXTURE_2D ||
- texture->getTarget() == GL_TEXTURE_2D_MULTISAMPLE)
+ texture->getTarget() == GL_TEXTURE_2D_MULTISAMPLE ||
+ texture->getTarget() == GL_TEXTURE_RECTANGLE_ANGLE)
{
functions->framebufferTexture2D(GL_FRAMEBUFFER, attachmentPoint,
texture->getTarget(), textureGL->getTextureID(),
@@ -104,9 +65,19 @@ static void BindFramebufferAttachment(const FunctionsGL *functions,
else if (texture->getTarget() == GL_TEXTURE_2D_ARRAY ||
texture->getTarget() == GL_TEXTURE_3D)
{
- functions->framebufferTextureLayer(GL_FRAMEBUFFER, attachmentPoint,
- textureGL->getTextureID(),
- attachment->mipLevel(), attachment->layer());
+ if (attachment->getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE)
+ {
+ ASSERT(functions->framebufferTexture);
+ functions->framebufferTexture(GL_FRAMEBUFFER, attachmentPoint,
+ textureGL->getTextureID(),
+ attachment->mipLevel());
+ }
+ else
+ {
+ functions->framebufferTextureLayer(GL_FRAMEBUFFER, attachmentPoint,
+ textureGL->getTextureID(),
+ attachment->mipLevel(), attachment->layer());
+ }
}
else
{
@@ -133,6 +104,78 @@ static void BindFramebufferAttachment(const FunctionsGL *functions,
}
}
+bool RequiresMultiviewClear(const FramebufferAttachment *attachment, bool scissorTestEnabled)
+{
+ if (attachment == nullptr)
+ {
+ return false;
+ }
+ switch (attachment->getMultiviewLayout())
+ {
+ case GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE:
+ // TODO(mradev): Optimize this for layered FBOs in which all of the layers in each
+ // attachment are active.
+ return true;
+ case GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE:
+ return (scissorTestEnabled == true);
+ case GL_NONE:
+ return false;
+ default:
+ UNREACHABLE();
+ }
+ return false;
+}
+
+} // namespace
+
+FramebufferGL::FramebufferGL(const FramebufferState &state,
+ const FunctionsGL *functions,
+ StateManagerGL *stateManager,
+ const WorkaroundsGL &workarounds,
+ BlitGL *blitter,
+ ClearMultiviewGL *multiviewClearer,
+ bool isDefault)
+ : FramebufferImpl(state),
+ mFunctions(functions),
+ mStateManager(stateManager),
+ mWorkarounds(workarounds),
+ mBlitter(blitter),
+ mMultiviewClearer(multiviewClearer),
+ mFramebufferID(0),
+ mIsDefault(isDefault),
+ mAppliedEnabledDrawBuffers(1)
+{
+ if (!mIsDefault)
+ {
+ mFunctions->genFramebuffers(1, &mFramebufferID);
+ }
+}
+
+FramebufferGL::FramebufferGL(GLuint id,
+ const FramebufferState &state,
+ const FunctionsGL *functions,
+ const WorkaroundsGL &workarounds,
+ BlitGL *blitter,
+ ClearMultiviewGL *multiviewClearer,
+ StateManagerGL *stateManager)
+ : FramebufferImpl(state),
+ mFunctions(functions),
+ mStateManager(stateManager),
+ mWorkarounds(workarounds),
+ mBlitter(blitter),
+ mMultiviewClearer(multiviewClearer),
+ mFramebufferID(id),
+ mIsDefault(true),
+ mAppliedEnabledDrawBuffers(1)
+{
+}
+
+FramebufferGL::~FramebufferGL()
+{
+ mStateManager->deleteFramebuffer(mFramebufferID);
+ mFramebufferID = 0;
+}
+
Error FramebufferGL::discard(const gl::Context *context, size_t count, const GLenum *attachments)
{
// glInvalidateFramebuffer accepts the same enums as glDiscardFramebufferEXT
@@ -197,7 +240,18 @@ Error FramebufferGL::clear(const gl::Context *context, GLbitfield mask)
{
syncClearState(context, mask);
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctions->clear(mask);
+
+ const auto &firstAttachment = mState.getFirstNonNullAttachment();
+ if (!RequiresMultiviewClear(firstAttachment, context->getGLState().isScissorTestEnabled()))
+ {
+ mFunctions->clear(mask);
+ }
+ else
+ {
+ mMultiviewClearer->clearMultiviewFBO(mState, context->getGLState().getScissor(),
+ ClearMultiviewGL::ClearCommandType::Clear, mask,
+ GL_NONE, 0, nullptr, 0.0f, 0);
+ }
return gl::NoError();
}
@@ -209,7 +263,19 @@ Error FramebufferGL::clearBufferfv(const gl::Context *context,
{
syncClearBufferState(context, buffer, drawbuffer);
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctions->clearBufferfv(buffer, drawbuffer, values);
+
+ const auto &firstAttachment = mState.getFirstNonNullAttachment();
+ if (!RequiresMultiviewClear(firstAttachment, context->getGLState().isScissorTestEnabled()))
+ {
+ mFunctions->clearBufferfv(buffer, drawbuffer, values);
+ }
+ else
+ {
+ mMultiviewClearer->clearMultiviewFBO(mState, context->getGLState().getScissor(),
+ ClearMultiviewGL::ClearCommandType::ClearBufferfv,
+ static_cast<GLbitfield>(0u), buffer, drawbuffer,
+ reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
+ }
return gl::NoError();
}
@@ -221,7 +287,19 @@ Error FramebufferGL::clearBufferuiv(const gl::Context *context,
{
syncClearBufferState(context, buffer, drawbuffer);
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctions->clearBufferuiv(buffer, drawbuffer, values);
+
+ const auto &firstAttachment = mState.getFirstNonNullAttachment();
+ if (!RequiresMultiviewClear(firstAttachment, context->getGLState().isScissorTestEnabled()))
+ {
+ mFunctions->clearBufferuiv(buffer, drawbuffer, values);
+ }
+ else
+ {
+ mMultiviewClearer->clearMultiviewFBO(mState, context->getGLState().getScissor(),
+ ClearMultiviewGL::ClearCommandType::ClearBufferuiv,
+ static_cast<GLbitfield>(0u), buffer, drawbuffer,
+ reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
+ }
return gl::NoError();
}
@@ -233,7 +311,19 @@ Error FramebufferGL::clearBufferiv(const gl::Context *context,
{
syncClearBufferState(context, buffer, drawbuffer);
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctions->clearBufferiv(buffer, drawbuffer, values);
+
+ const auto &firstAttachment = mState.getFirstNonNullAttachment();
+ if (!RequiresMultiviewClear(firstAttachment, context->getGLState().isScissorTestEnabled()))
+ {
+ mFunctions->clearBufferiv(buffer, drawbuffer, values);
+ }
+ else
+ {
+ mMultiviewClearer->clearMultiviewFBO(mState, context->getGLState().getScissor(),
+ ClearMultiviewGL::ClearCommandType::ClearBufferiv,
+ static_cast<GLbitfield>(0u), buffer, drawbuffer,
+ reinterpret_cast<const uint8_t *>(values), 0.0f, 0);
+ }
return gl::NoError();
}
@@ -246,7 +336,19 @@ Error FramebufferGL::clearBufferfi(const gl::Context *context,
{
syncClearBufferState(context, buffer, drawbuffer);
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
- mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil);
+
+ const auto &firstAttachment = mState.getFirstNonNullAttachment();
+ if (!RequiresMultiviewClear(firstAttachment, context->getGLState().isScissorTestEnabled()))
+ {
+ mFunctions->clearBufferfi(buffer, drawbuffer, depth, stencil);
+ }
+ else
+ {
+ mMultiviewClearer->clearMultiviewFBO(mState, context->getGLState().getScissor(),
+ ClearMultiviewGL::ClearCommandType::ClearBufferfi,
+ static_cast<GLbitfield>(0u), buffer, drawbuffer,
+ nullptr, depth, stencil);
+ }
return gl::NoError();
}
@@ -467,18 +569,33 @@ void FramebufferGL::syncState(const gl::Context *context, const Framebuffer::Dir
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mFramebufferID);
+ // A pointer to one of the attachments for which the texture or the render buffer is not zero.
+ const FramebufferAttachment *attachment = nullptr;
+
for (auto dirtyBit : dirtyBits)
{
switch (dirtyBit)
{
case Framebuffer::DIRTY_BIT_DEPTH_ATTACHMENT:
- BindFramebufferAttachment(mFunctions, GL_DEPTH_ATTACHMENT,
- mState.getDepthAttachment());
+ {
+ const FramebufferAttachment *newAttachment = mState.getDepthAttachment();
+ BindFramebufferAttachment(mFunctions, GL_DEPTH_ATTACHMENT, newAttachment);
+ if (newAttachment)
+ {
+ attachment = newAttachment;
+ }
break;
+ }
case Framebuffer::DIRTY_BIT_STENCIL_ATTACHMENT:
- BindFramebufferAttachment(mFunctions, GL_STENCIL_ATTACHMENT,
- mState.getStencilAttachment());
+ {
+ const FramebufferAttachment *newAttachment = mState.getStencilAttachment();
+ BindFramebufferAttachment(mFunctions, GL_STENCIL_ATTACHMENT, newAttachment);
+ if (newAttachment)
+ {
+ attachment = newAttachment;
+ }
break;
+ }
case Framebuffer::DIRTY_BIT_DRAW_BUFFERS:
{
const auto &drawBuffers = mState.getDrawBufferStates();
@@ -513,13 +630,27 @@ void FramebufferGL::syncState(const gl::Context *context, const Framebuffer::Dir
dirtyBit < Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_MAX);
size_t index =
static_cast<size_t>(dirtyBit - Framebuffer::DIRTY_BIT_COLOR_ATTACHMENT_0);
- BindFramebufferAttachment(mFunctions,
- static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + index),
- mState.getColorAttachment(index));
+ const FramebufferAttachment *newAttachment = mState.getColorAttachment(index);
+ BindFramebufferAttachment(
+ mFunctions, static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + index), newAttachment);
+ if (newAttachment)
+ {
+ attachment = newAttachment;
+ }
break;
}
}
}
+
+ if (attachment)
+ {
+ const bool isSideBySide =
+ (attachment->getMultiviewLayout() == GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE);
+ mStateManager->setSideBySide(isSideBySide);
+ mStateManager->setViewportOffsets(attachment->getMultiviewViewportOffsets());
+ mStateManager->updateMultiviewBaseViewLayerIndexUniform(context->getGLState().getProgram(),
+ getState());
+ }
}
GLuint FramebufferGL::getFramebufferID() const
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 ea6f4af5781..84bffdc557a 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/FramebufferGL.h
@@ -15,6 +15,7 @@ namespace rx
{
class BlitGL;
+class ClearMultiviewGL;
class FunctionsGL;
class StateManagerGL;
struct WorkaroundsGL;
@@ -27,6 +28,7 @@ class FramebufferGL : public FramebufferImpl
StateManagerGL *stateManager,
const WorkaroundsGL &workarounds,
BlitGL *blitter,
+ ClearMultiviewGL *multiviewClearer,
bool isDefault);
// Constructor called when we need to create a FramebufferGL from an
// existing framebuffer name, for example for the default framebuffer
@@ -36,6 +38,7 @@ class FramebufferGL : public FramebufferImpl
const FunctionsGL *functions,
const WorkaroundsGL &workarounds,
BlitGL *blitter,
+ ClearMultiviewGL *multiviewClearer,
StateManagerGL *stateManager);
~FramebufferGL() override;
@@ -122,6 +125,7 @@ class FramebufferGL : public FramebufferImpl
StateManagerGL *mStateManager;
const WorkaroundsGL &mWorkarounds;
BlitGL *mBlitter;
+ ClearMultiviewGL *mMultiviewClearer;
GLuint mFramebufferID;
bool mIsDefault;
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 2ea74e2d722..2e3c64bcc21 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.cpp
@@ -35,6 +35,7 @@ ProgramGL::ProgramGL(const gl::ProgramState &data,
mWorkarounds(workarounds),
mStateManager(stateManager),
mEnablePathRendering(enablePathRendering),
+ mMultiviewBaseViewLayerIndexUniformLocation(-1),
mProgramID(0)
{
ASSERT(mFunctions);
@@ -590,6 +591,8 @@ void ProgramGL::preLink()
mUniformRealLocationMap.clear();
mUniformBlockRealLocationMap.clear();
mPathRenderingFragmentInputs.clear();
+
+ mMultiviewBaseViewLayerIndexUniformLocation = -1;
}
bool ProgramGL::checkLinkStatus(gl::InfoLog &infoLog)
@@ -658,6 +661,13 @@ void ProgramGL::postLink()
mUniformRealLocationMap[uniformLocation] = realLocation;
}
+ if (mState.usesMultiview())
+ {
+ mMultiviewBaseViewLayerIndexUniformLocation =
+ mFunctions->getUniformLocation(mProgramID, "webgl_angle_multiviewBaseViewLayerIndex");
+ ASSERT(mMultiviewBaseViewLayerIndexUniformLocation != -1);
+ }
+
// Discover CHROMIUM_path_rendering fragment inputs if enabled.
if (!mEnablePathRendering)
return;
@@ -724,4 +734,50 @@ void ProgramGL::postLink()
}
}
+void ProgramGL::enableSideBySideRenderingPath() const
+{
+ ASSERT(mState.usesMultiview());
+ ASSERT(mMultiviewBaseViewLayerIndexUniformLocation != -1);
+
+ ASSERT(mFunctions->programUniform1i != nullptr);
+ mFunctions->programUniform1i(mProgramID, mMultiviewBaseViewLayerIndexUniformLocation, -1);
+}
+
+void ProgramGL::enableLayeredRenderingPath(int baseViewIndex) const
+{
+ ASSERT(mState.usesMultiview());
+ ASSERT(mMultiviewBaseViewLayerIndexUniformLocation != -1);
+
+ ASSERT(mFunctions->programUniform1i != nullptr);
+ mFunctions->programUniform1i(mProgramID, mMultiviewBaseViewLayerIndexUniformLocation,
+ baseViewIndex);
+}
+
+void ProgramGL::getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const
+{
+ mFunctions->getUniformfv(mProgramID, uniLoc(location), params);
+}
+
+void ProgramGL::getUniformiv(const gl::Context *context, GLint location, GLint *params) const
+{
+ mFunctions->getUniformiv(mProgramID, uniLoc(location), params);
+}
+
+void ProgramGL::getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const
+{
+ mFunctions->getUniformuiv(mProgramID, uniLoc(location), params);
+}
+
+void ProgramGL::markUnusedUniformLocations(std::vector<gl::VariableLocation> *uniformLocations)
+{
+ GLint maxLocation = static_cast<GLint>(uniformLocations->size());
+ for (GLint location = 0; location < maxLocation; ++location)
+ {
+ if (uniLoc(location) == -1)
+ {
+ (*uniformLocations)[location].used = false;
+ }
+ }
+}
+
} // namespace rx
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 29ffb1d2262..01a20db9b8f 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/ProgramGL.h
@@ -65,6 +65,10 @@ class ProgramGL : public ProgramImpl
void setUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) override;
void setUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) override;
+ void getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const override;
+ void getUniformiv(const gl::Context *context, GLint location, GLint *params) const override;
+ void getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const override;
+
void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override;
bool getUniformBlockSize(const std::string &blockName, size_t *sizeOut) const override;
@@ -76,8 +80,13 @@ class ProgramGL : public ProgramImpl
GLint components,
const GLfloat *coeffs) override;
+ void markUnusedUniformLocations(std::vector<gl::VariableLocation> *uniformLocations) override;
+
GLuint getProgramID() const;
+ void enableSideBySideRenderingPath() const;
+ void enableLayeredRenderingPath(int baseViewIndex) const;
+
private:
void preLink();
bool checkLinkStatus(gl::InfoLog &infoLog);
@@ -102,6 +111,7 @@ class ProgramGL : public ProgramImpl
std::vector<PathRenderingFragmentInput> mPathRenderingFragmentInputs;
bool mEnablePathRendering;
+ GLint mMultiviewBaseViewLayerIndexUniformLocation;
GLuint mProgramID;
};
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 7065b2a7485..10dcaa204d9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.cpp
@@ -12,15 +12,16 @@
#include "common/debug.h"
#include "libANGLE/AttributeMap.h"
+#include "libANGLE/Context.h"
#include "libANGLE/ContextState.h"
#include "libANGLE/Path.h"
#include "libANGLE/Surface.h"
#include "libANGLE/renderer/gl/BlitGL.h"
#include "libANGLE/renderer/gl/BufferGL.h"
+#include "libANGLE/renderer/gl/ClearMultiviewGL.h"
#include "libANGLE/renderer/gl/CompilerGL.h"
#include "libANGLE/renderer/gl/ContextGL.h"
#include "libANGLE/renderer/gl/FenceNVGL.h"
-#include "libANGLE/renderer/gl/FenceSyncGL.h"
#include "libANGLE/renderer/gl/FramebufferGL.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
#include "libANGLE/renderer/gl/PathGL.h"
@@ -31,6 +32,7 @@
#include "libANGLE/renderer/gl/ShaderGL.h"
#include "libANGLE/renderer/gl/StateManagerGL.h"
#include "libANGLE/renderer/gl/SurfaceGL.h"
+#include "libANGLE/renderer/gl/SyncGL.h"
#include "libANGLE/renderer/gl/TextureGL.h"
#include "libANGLE/renderer/gl/TransformFeedbackGL.h"
#include "libANGLE/renderer/gl/VertexArrayGL.h"
@@ -167,6 +169,7 @@ RendererGL::RendererGL(const FunctionsGL *functions, const egl::AttributeMap &at
mFunctions(functions),
mStateManager(nullptr),
mBlitter(nullptr),
+ mMultiviewClearer(nullptr),
mUseDebugOutput(false),
mSkipDrawCalls(false),
mCapsInitialized(false),
@@ -174,8 +177,9 @@ RendererGL::RendererGL(const FunctionsGL *functions, const egl::AttributeMap &at
{
ASSERT(mFunctions);
nativegl_gl::GenerateWorkarounds(mFunctions, &mWorkarounds);
- mStateManager = new StateManagerGL(mFunctions, getNativeCaps());
+ mStateManager = new StateManagerGL(mFunctions, getNativeCaps(), getNativeExtensions());
mBlitter = new BlitGL(functions, mWorkarounds, mStateManager);
+ mMultiviewClearer = new ClearMultiviewGL(functions, mStateManager);
bool hasDebugOutput = mFunctions->isAtLeastGL(gl::Version(4, 3)) ||
mFunctions->hasGLExtension("GL_KHR_debug") ||
@@ -221,6 +225,7 @@ RendererGL::RendererGL(const FunctionsGL *functions, const egl::AttributeMap &at
RendererGL::~RendererGL()
{
SafeDelete(mBlitter);
+ SafeDelete(mMultiviewClearer);
SafeDelete(mStateManager);
}
@@ -252,13 +257,22 @@ gl::Error RendererGL::drawArrays(const gl::Context *context,
GLint first,
GLsizei count)
{
- ANGLE_TRY(mStateManager->setDrawArraysState(context, first, count, 0));
+ const gl::Program *program = context->getGLState().getProgram();
+ const bool usesMultiview = program->usesMultiview();
+ const GLsizei instanceCount = usesMultiview ? program->getNumViews() : 0;
+ ANGLE_TRY(mStateManager->setDrawArraysState(context, first, count, instanceCount));
if (!mSkipDrawCalls)
{
- mFunctions->drawArrays(mode, first, count);
+ if (!usesMultiview)
+ {
+ mFunctions->drawArrays(mode, first, count);
+ }
+ else
+ {
+ mFunctions->drawArraysInstanced(mode, first, count, instanceCount);
+ }
}
-
return gl::NoError();
}
@@ -268,13 +282,18 @@ gl::Error RendererGL::drawArraysInstanced(const gl::Context *context,
GLsizei count,
GLsizei instanceCount)
{
- ANGLE_TRY(mStateManager->setDrawArraysState(context, first, count, instanceCount));
+ GLsizei adjustedInstanceCount = instanceCount;
+ const gl::Program *program = context->getGLState().getProgram();
+ if (program->usesMultiview())
+ {
+ adjustedInstanceCount *= program->getNumViews();
+ }
+ ANGLE_TRY(mStateManager->setDrawArraysState(context, first, count, adjustedInstanceCount));
if (!mSkipDrawCalls)
{
- mFunctions->drawArraysInstanced(mode, first, count, instanceCount);
+ mFunctions->drawArraysInstanced(mode, first, count, adjustedInstanceCount);
}
-
return gl::NoError();
}
@@ -282,17 +301,26 @@ gl::Error RendererGL::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
+ const gl::Program *program = context->getGLState().getProgram();
+ const bool usesMultiview = program->usesMultiview();
+ const GLsizei instanceCount = usesMultiview ? program->getNumViews() : 0;
const void *drawIndexPtr = nullptr;
- ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices, 0, &drawIndexPtr));
+ ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices, instanceCount,
+ &drawIndexPtr));
if (!mSkipDrawCalls)
{
- mFunctions->drawElements(mode, count, type, drawIndexPtr);
+ if (!usesMultiview)
+ {
+ mFunctions->drawElements(mode, count, type, drawIndexPtr);
+ }
+ else
+ {
+ mFunctions->drawElementsInstanced(mode, count, type, drawIndexPtr, instanceCount);
+ }
}
-
return gl::NoError();
}
@@ -301,18 +329,23 @@ gl::Error RendererGL::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
+ GLsizei adjustedInstanceCount = instances;
+ const gl::Program *program = context->getGLState().getProgram();
+ if (program->usesMultiview())
+ {
+ adjustedInstanceCount *= program->getNumViews();
+ }
const void *drawIndexPointer = nullptr;
- ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices, instances,
- &drawIndexPointer));
+ ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices,
+ adjustedInstanceCount, &drawIndexPointer));
if (!mSkipDrawCalls)
{
- mFunctions->drawElementsInstanced(mode, count, type, drawIndexPointer, instances);
+ mFunctions->drawElementsInstanced(mode, count, type, drawIndexPointer,
+ adjustedInstanceCount);
}
-
return gl::NoError();
}
@@ -322,18 +355,26 @@ gl::Error RendererGL::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
+ const gl::Program *program = context->getGLState().getProgram();
+ const bool usesMultiview = program->usesMultiview();
+ const GLsizei instanceCount = usesMultiview ? program->getNumViews() : 0;
const void *drawIndexPointer = nullptr;
- ANGLE_TRY(
- mStateManager->setDrawElementsState(context, count, type, indices, 0, &drawIndexPointer));
+ ANGLE_TRY(mStateManager->setDrawElementsState(context, count, type, indices, instanceCount,
+ &drawIndexPointer));
if (!mSkipDrawCalls)
{
- mFunctions->drawRangeElements(mode, start, end, count, type, drawIndexPointer);
+ if (!usesMultiview)
+ {
+ mFunctions->drawRangeElements(mode, start, end, count, type, drawIndexPointer);
+ }
+ else
+ {
+ mFunctions->drawElementsInstanced(mode, count, type, drawIndexPointer, instanceCount);
+ }
}
-
return gl::NoError();
}
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 da4cb7fe70b..00108a94b7c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/RendererGL.h
@@ -36,6 +36,7 @@ struct BlockMemberInfo;
namespace rx
{
class BlitGL;
+class ClearMultiviewGL;
class ContextImpl;
class FunctionsGL;
class StateManagerGL;
@@ -62,23 +63,20 @@ class RendererGL : angle::NonCopyable
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange);
+ const void *indices);
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange);
+ GLsizei instances);
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange);
+ const void *indices);
gl::Error drawArraysIndirect(const gl::Context *context, GLenum mode, const void *indirect);
gl::Error drawElementsIndirect(const gl::Context *context,
GLenum mode,
@@ -162,6 +160,7 @@ class RendererGL : angle::NonCopyable
StateManagerGL *getStateManager() const { return mStateManager; }
const WorkaroundsGL &getWorkarounds() const { return mWorkarounds; }
BlitGL *getBlitter() const { return mBlitter; }
+ ClearMultiviewGL *getMultiviewClearer() const { return mMultiviewClearer; }
MultiviewImplementationTypeGL getMultiviewImplementationType() const;
const gl::Caps &getNativeCaps() const;
@@ -188,6 +187,7 @@ class RendererGL : angle::NonCopyable
StateManagerGL *mStateManager;
BlitGL *mBlitter;
+ ClearMultiviewGL *mMultiviewClearer;
WorkaroundsGL mWorkarounds;
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 e607de130f8..72c816e62d7 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.cpp
@@ -9,6 +9,7 @@
#include "libANGLE/renderer/gl/StateManagerGL.h"
#include <string.h>
+#include <algorithm>
#include <limits>
#include "common/bitset_utils.h"
@@ -40,7 +41,39 @@ StateManagerGL::IndexedBufferBinding::IndexedBufferBinding() : offset(0), size(0
{
}
-StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &rendererCaps)
+namespace
+{
+bool AllRectanglesMatch(const gl::Rectangle &matchingRectangle,
+ const std::vector<gl::Rectangle> &rectangles)
+{
+ for (const auto &rect : rectangles)
+ {
+ if (matchingRectangle != rect)
+ {
+ return false;
+ }
+ }
+ return true;
+}
+
+std::vector<gl::Rectangle> ApplyOffsets(const gl::Rectangle &modifiableRectangle,
+ const std::vector<gl::Offset> &offsets)
+{
+ std::vector<gl::Rectangle> result;
+ result.reserve(offsets.size());
+ for (size_t i = 0u; i < offsets.size(); ++i)
+ {
+ result.emplace_back(gl::Rectangle(modifiableRectangle.x + offsets[i].x,
+ modifiableRectangle.y + offsets[i].y,
+ modifiableRectangle.width, modifiableRectangle.height));
+ }
+ return result;
+}
+} // namespace
+
+StateManagerGL::StateManagerGL(const FunctionsGL *functions,
+ const gl::Caps &rendererCaps,
+ const gl::Extensions &extensions)
: mFunctions(functions),
mProgram(0),
mVAO(0),
@@ -69,8 +102,9 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mFramebuffers(angle::FramebufferBindingSingletonMax, 0),
mRenderbuffer(0),
mScissorTestEnabled(false),
- mScissor(0, 0, 0, 0),
- mViewport(0, 0, 0, 0),
+ mScissors(extensions.maxViews),
+ mViewports(extensions.maxViews),
+ mViewportOffsets(extensions.maxViews),
mNear(0.0f),
mFar(1.0f),
mBlendEnabled(false),
@@ -128,17 +162,23 @@ StateManagerGL::StateManagerGL(const FunctionsGL *functions, const gl::Caps &ren
mPathStencilFunc(GL_ALWAYS),
mPathStencilRef(0),
mPathStencilMask(std::numeric_limits<GLuint>::max()),
- mLocalDirtyBits()
+ mIsSideBySideDrawFramebuffer(false),
+ mIsMultiviewEnabled(extensions.multiview),
+ mLocalDirtyBits(),
+ mMultiviewDirtyBits()
{
ASSERT(mFunctions);
+ ASSERT(extensions.maxViews >= 1u);
mTextures[GL_TEXTURE_2D].resize(rendererCaps.maxCombinedTextureImageUnits);
+ mTextures[GL_TEXTURE_RECTANGLE_ANGLE].resize(rendererCaps.maxCombinedTextureImageUnits);
mTextures[GL_TEXTURE_CUBE_MAP].resize(rendererCaps.maxCombinedTextureImageUnits);
mTextures[GL_TEXTURE_2D_ARRAY].resize(rendererCaps.maxCombinedTextureImageUnits);
mTextures[GL_TEXTURE_3D].resize(rendererCaps.maxCombinedTextureImageUnits);
mTextures[GL_TEXTURE_2D_MULTISAMPLE].resize(rendererCaps.maxCombinedTextureImageUnits);
mIndexedBuffers[GL_UNIFORM_BUFFER].resize(rendererCaps.maxCombinedUniformBlocks);
+ mIndexedBuffers[GL_ATOMIC_COUNTER_BUFFER].resize(rendererCaps.maxCombinedAtomicCounterBuffers);
for (GLenum queryType : QueryTypes)
{
@@ -349,6 +389,8 @@ void StateManagerGL::bindVertexArray(GLuint vao, GLuint elementArrayBuffer)
mVAO = vao;
mBuffers[GL_ELEMENT_ARRAY_BUFFER] = elementArrayBuffer;
mFunctions->bindVertexArray(vao);
+
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_VERTEX_ARRAY_BINDING);
}
}
@@ -883,23 +925,41 @@ void StateManagerGL::setGenericShaderState(const gl::Context *context)
ASSERT(context->getClientVersion() >= gl::ES_3_1 || program->getImageBindings().size() == 0);
for (const gl::ImageBinding &imageUniform : program->getImageBindings())
{
- for (size_t imageUnitIndex = 0; imageUnitIndex < imageUniform.elementCount;
- imageUnitIndex++)
+ for (GLuint imageUnitIndex : imageUniform.boundImageUnits)
{
- const gl::ImageUnit &imageUnit = glState.getImageUnit(
- imageUniform.boundImageUnit + static_cast<GLuint>(imageUnitIndex));
+ const gl::ImageUnit &imageUnit = glState.getImageUnit(imageUnitIndex);
const TextureGL *textureGL = SafeGetImplAs<TextureGL>(imageUnit.texture.get());
if (textureGL)
{
- bindImageTexture(imageUniform.boundImageUnit + static_cast<GLuint>(imageUnitIndex),
- textureGL->getTextureID(), imageUnit.level, imageUnit.layered,
+ bindImageTexture(imageUnitIndex, textureGL->getTextureID(), imageUnit.level,
+ imageUnit.layered, imageUnit.layer, imageUnit.access,
+ imageUnit.format);
+ }
+ else
+ {
+ bindImageTexture(imageUnitIndex, 0, imageUnit.level, imageUnit.layered,
imageUnit.layer, imageUnit.access, imageUnit.format);
}
+ }
+ }
+
+ for (const auto &atomicCounterBuffer : program->getState().getAtomicCounterBuffers())
+ {
+ GLuint binding = atomicCounterBuffer.binding;
+ const auto &buffer = glState.getIndexedAtomicCounterBuffer(binding);
+
+ if (buffer.get() != nullptr)
+ {
+ BufferGL *bufferGL = GetImplAs<BufferGL>(buffer.get());
+
+ if (buffer.getSize() == 0)
+ {
+ bindBufferBase(GL_ATOMIC_COUNTER_BUFFER, binding, bufferGL->getBufferID());
+ }
else
{
- bindImageTexture(imageUniform.boundImageUnit + static_cast<GLuint>(imageUnitIndex),
- 0, imageUnit.level, imageUnit.layered, imageUnit.layer,
- imageUnit.access, imageUnit.format);
+ bindBufferRange(GL_ATOMIC_COUNTER_BUFFER, binding, bufferGL->getBufferID(),
+ buffer.getOffset(), buffer.getSize());
}
}
}
@@ -990,26 +1050,100 @@ void StateManagerGL::setScissorTestEnabled(bool enabled)
void StateManagerGL::setScissor(const gl::Rectangle &scissor)
{
- if (scissor != mScissor)
+ if (!AllRectanglesMatch(scissor, mScissors))
+ {
+ mScissors.assign(mScissors.size(), scissor);
+ mFunctions->scissor(scissor.x, scissor.y, scissor.width, scissor.height);
+
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_SCISSOR);
+ }
+}
+
+void StateManagerGL::setScissorArrayv(GLuint first, const std::vector<gl::Rectangle> &scissors)
+{
+ ASSERT(mFunctions->scissorArrayv != nullptr);
+ size_t offset = static_cast<size_t>(first);
+ ASSERT(offset + scissors.size() <= mScissors.size());
+ if (!std::equal(scissors.cbegin(), scissors.cend(), mScissors.cbegin() + offset))
{
- mScissor = scissor;
- mFunctions->scissor(mScissor.x, mScissor.y, mScissor.width, mScissor.height);
+ std::copy(scissors.begin(), scissors.end(), mScissors.begin() + offset);
+ mFunctions->scissorArrayv(first, static_cast<GLsizei>(scissors.size()), &scissors[0].x);
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_SCISSOR);
+ }
+}
+void StateManagerGL::setScissorIndexed(GLuint index, const gl::Rectangle &scissor)
+{
+ ASSERT(mFunctions->scissorIndexed != nullptr);
+ ASSERT(static_cast<size_t>(index) < mScissors.size());
+ if (mScissors[index] != scissor)
+ {
+ mScissors[index] = scissor;
+ mFunctions->scissorIndexed(index, scissor.x, scissor.y, scissor.width, scissor.height);
mLocalDirtyBits.set(gl::State::DIRTY_BIT_SCISSOR);
}
}
void StateManagerGL::setViewport(const gl::Rectangle &viewport)
{
- if (viewport != mViewport)
+ if (!AllRectanglesMatch(viewport, mViewports))
{
- mViewport = viewport;
- mFunctions->viewport(mViewport.x, mViewport.y, mViewport.width, mViewport.height);
+ mViewports.assign(mViewports.size(), viewport);
+ mFunctions->viewport(viewport.x, viewport.y, viewport.width, viewport.height);
+
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_VIEWPORT);
+ }
+}
+void StateManagerGL::setViewportArrayv(GLuint first, const std::vector<gl::Rectangle> &viewports)
+{
+ ASSERT(mFunctions->viewportArrayv != nullptr);
+ size_t offset = static_cast<size_t>(first);
+ ASSERT(offset + viewports.size() <= mViewports.size());
+ if (!std::equal(viewports.cbegin(), viewports.cend(), mViewports.cbegin() + offset))
+ {
+ std::copy(viewports.begin(), viewports.end(), mViewports.begin() + offset);
+ std::vector<float> viewportsAsFloats(4u * viewports.size());
+ for (size_t i = 0u; i < viewports.size(); ++i)
+ {
+ viewportsAsFloats[i * 4u] = static_cast<float>(viewports[i].x);
+ viewportsAsFloats[i * 4u + 1u] = static_cast<float>(viewports[i].y);
+ viewportsAsFloats[i * 4u + 2u] = static_cast<float>(viewports[i].width);
+ viewportsAsFloats[i * 4u + 3u] = static_cast<float>(viewports[i].height);
+ }
+ mFunctions->viewportArrayv(first, static_cast<GLsizei>(viewports.size()),
+ viewportsAsFloats.data());
mLocalDirtyBits.set(gl::State::DIRTY_BIT_VIEWPORT);
}
}
+void StateManagerGL::setViewportOffsets(const std::vector<gl::Offset> &viewportOffsets)
+{
+ if (!std::equal(viewportOffsets.cbegin(), viewportOffsets.cend(), mViewportOffsets.cbegin()))
+ {
+ std::copy(viewportOffsets.begin(), viewportOffsets.end(), mViewportOffsets.begin());
+
+ const std::vector<gl::Rectangle> &viewportArray =
+ ApplyOffsets(mViewports[0], viewportOffsets);
+ setViewportArrayv(0u, viewportArray);
+
+ const std::vector<gl::Rectangle> &scissorArray =
+ ApplyOffsets(mScissors[0], viewportOffsets);
+ setScissorArrayv(0u, scissorArray);
+
+ mMultiviewDirtyBits.set(MULTIVIEW_DIRTY_BIT_VIEWPORT_OFFSETS);
+ }
+}
+
+void StateManagerGL::setSideBySide(bool isSideBySide)
+{
+ if (mIsSideBySideDrawFramebuffer != isSideBySide)
+ {
+ mIsSideBySideDrawFramebuffer = isSideBySide;
+ mMultiviewDirtyBits.set(MULTIVIEW_DIRTY_BIT_SIDE_BY_SIDE_LAYOUT);
+ }
+}
+
void StateManagerGL::setDepthRange(float near, float far)
{
if (mNear != near || mFar != far)
@@ -1467,10 +1601,55 @@ void StateManagerGL::syncState(const gl::Context *context, const gl::State::Dirt
const gl::State &state = context->getGLState();
// The the current framebuffer binding sometimes requires resetting the srgb blending
- if (glDirtyBits[gl::State::DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING] &&
- mFunctions->standard == STANDARD_GL_DESKTOP)
+ if (glDirtyBits[gl::State::DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING])
{
- mLocalDirtyBits.set(gl::State::DIRTY_BIT_FRAMEBUFFER_SRGB);
+ if (mFunctions->standard == STANDARD_GL_DESKTOP)
+ {
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_FRAMEBUFFER_SRGB);
+ }
+
+ if (mIsMultiviewEnabled)
+ {
+ // When a new draw framebuffer is bound, we have to mark the layout, viewport offsets,
+ // scissor test, scissor and viewport rectangle bits as dirty because it could be a
+ // transition from or to a side-by-side draw framebuffer.
+ mMultiviewDirtyBits.set(MULTIVIEW_DIRTY_BIT_SIDE_BY_SIDE_LAYOUT);
+ mMultiviewDirtyBits.set(MULTIVIEW_DIRTY_BIT_VIEWPORT_OFFSETS);
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_SCISSOR_TEST_ENABLED);
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_SCISSOR);
+ mLocalDirtyBits.set(gl::State::DIRTY_BIT_VIEWPORT);
+ }
+ }
+
+ // Iterate over and resolve multi-view dirty bits.
+ for (auto dirtyBit : mMultiviewDirtyBits)
+ {
+ switch (dirtyBit)
+ {
+ case MULTIVIEW_DIRTY_BIT_SIDE_BY_SIDE_LAYOUT:
+ {
+ const gl::Framebuffer *drawFramebuffer = state.getDrawFramebuffer();
+ ASSERT(drawFramebuffer != nullptr);
+ setSideBySide(drawFramebuffer->getMultiviewLayout() ==
+ GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE);
+ }
+ break;
+ case MULTIVIEW_DIRTY_BIT_VIEWPORT_OFFSETS:
+ {
+ const gl::Framebuffer *drawFramebuffer = state.getDrawFramebuffer();
+ ASSERT(drawFramebuffer != nullptr);
+ const std::vector<gl::Offset> *attachmentViewportOffsets =
+ drawFramebuffer->getViewportOffsets();
+ const std::vector<gl::Offset> &viewportOffsets =
+ attachmentViewportOffsets != nullptr
+ ? *attachmentViewportOffsets
+ : gl::FramebufferAttachment::GetDefaultViewportOffsetVector();
+ setViewportOffsets(viewportOffsets);
+ }
+ break;
+ default:
+ UNREACHABLE();
+ }
}
const gl::State::DirtyBits &glAndLocalDirtyBits = (glDirtyBits | mLocalDirtyBits);
@@ -1489,11 +1668,35 @@ void StateManagerGL::syncState(const gl::Context *context, const gl::State::Dirt
setScissorTestEnabled(state.isScissorTestEnabled());
break;
case gl::State::DIRTY_BIT_SCISSOR:
- setScissor(state.getScissor());
- break;
+ {
+ const gl::Rectangle &scissor = state.getScissor();
+ if (!mIsSideBySideDrawFramebuffer)
+ {
+ setScissor(scissor);
+ }
+ else
+ {
+ const gl::Framebuffer *drawFramebuffer = state.getDrawFramebuffer();
+ ASSERT(drawFramebuffer != nullptr);
+ applyViewportOffsetsAndSetScissors(scissor, *drawFramebuffer);
+ }
+ }
+ break;
case gl::State::DIRTY_BIT_VIEWPORT:
- setViewport(state.getViewport());
- break;
+ {
+ const gl::Rectangle &viewport = state.getViewport();
+ if (!mIsSideBySideDrawFramebuffer)
+ {
+ setViewport(viewport);
+ }
+ else
+ {
+ const gl::Framebuffer *drawFramebuffer = state.getDrawFramebuffer();
+ ASSERT(drawFramebuffer != nullptr);
+ applyViewportOffsetsAndSetViewports(viewport, *drawFramebuffer);
+ }
+ }
+ break;
case gl::State::DIRTY_BIT_DEPTH_RANGE:
setDepthRange(state.getNearPlane(), state.getFarPlane());
break;
@@ -1682,19 +1885,34 @@ void StateManagerGL::syncState(const gl::Context *context, const gl::State::Dirt
// TODO(jmadill): implement this
break;
case gl::State::DIRTY_BIT_DRAW_FRAMEBUFFER_BINDING:
+ {
// TODO(jmadill): implement this
+ updateMultiviewBaseViewLayerIndexUniform(
+ state.getProgram(),
+ state.getDrawFramebuffer()->getImplementation()->getState());
break;
+ }
case gl::State::DIRTY_BIT_RENDERBUFFER_BINDING:
// TODO(jmadill): implement this
break;
case gl::State::DIRTY_BIT_VERTEX_ARRAY_BINDING:
// TODO(jmadill): implement this
+ propagateNumViewsToVAO(state.getProgram(),
+ GetImplAs<VertexArrayGL>(state.getVertexArray()));
break;
case gl::State::DIRTY_BIT_DRAW_INDIRECT_BUFFER_BINDING:
// TODO: implement this
break;
case gl::State::DIRTY_BIT_PROGRAM_BINDING:
// TODO(jmadill): implement this
+ propagateNumViewsToVAO(state.getProgram(),
+ GetImplAs<VertexArrayGL>(state.getVertexArray()));
+ updateMultiviewBaseViewLayerIndexUniform(
+ state.getProgram(),
+ state.getDrawFramebuffer()->getImplementation()->getState());
+ break;
+ case gl::State::DIRTY_BIT_PROGRAM_EXECUTABLE:
+ // TODO(jmadill): implement this
break;
case gl::State::DIRTY_BIT_MULTISAMPLING:
setMultisamplingStateEnabled(state.isMultisamplingEnabled());
@@ -1895,4 +2113,79 @@ void StateManagerGL::setTextureCubemapSeamlessEnabled(bool enabled)
}
}
}
+
+// According to the ANGLE_multiview spec, the behavior of glScissor and glViewport is different
+// if the active draw framebuffer has a side-by-side layout. In such situations glScissor and
+// glViewport specify the static offset and dimensions for each view to which the viewport
+// offsets have to be applied to compute the view's final scissor and viewport rectangles.
+void StateManagerGL::applyViewportOffsetsAndSetScissors(const gl::Rectangle &scissor,
+ const gl::Framebuffer &drawFramebuffer)
+{
+
+ const std::vector<gl::Offset> *attachmentViewportOffsets = drawFramebuffer.getViewportOffsets();
+ const std::vector<gl::Offset> &viewportOffsets =
+ attachmentViewportOffsets != nullptr
+ ? *attachmentViewportOffsets
+ : gl::FramebufferAttachment::GetDefaultViewportOffsetVector();
+ if (!AllRectanglesMatch(scissor, mScissors) ||
+ !std::equal(viewportOffsets.cbegin(), viewportOffsets.cend(), mViewportOffsets.cbegin()))
+ {
+ const std::vector<gl::Rectangle> &scissorArray = ApplyOffsets(scissor, viewportOffsets);
+ std::copy(viewportOffsets.begin(), viewportOffsets.end(), mViewportOffsets.begin());
+ setScissorArrayv(0u, scissorArray);
+ mMultiviewDirtyBits.set(MULTIVIEW_DIRTY_BIT_VIEWPORT_OFFSETS);
+ }
+}
+
+void StateManagerGL::applyViewportOffsetsAndSetViewports(const gl::Rectangle &viewport,
+ const gl::Framebuffer &drawFramebuffer)
+{
+ const std::vector<gl::Offset> *attachmentViewportOffsets = drawFramebuffer.getViewportOffsets();
+ const std::vector<gl::Offset> &viewportOffsets =
+ attachmentViewportOffsets != nullptr
+ ? *attachmentViewportOffsets
+ : gl::FramebufferAttachment::GetDefaultViewportOffsetVector();
+ if (!AllRectanglesMatch(viewport, mViewports) ||
+ !std::equal(viewportOffsets.cbegin(), viewportOffsets.cend(), mViewportOffsets.cbegin()))
+ {
+ const std::vector<gl::Rectangle> &viewportArray = ApplyOffsets(viewport, viewportOffsets);
+ std::copy(viewportOffsets.begin(), viewportOffsets.end(), mViewportOffsets.begin());
+ setViewportArrayv(0u, viewportArray);
+ mMultiviewDirtyBits.set(MULTIVIEW_DIRTY_BIT_VIEWPORT_OFFSETS);
+ }
+}
+
+void StateManagerGL::propagateNumViewsToVAO(const gl::Program *program, VertexArrayGL *vao)
+{
+ if (mIsMultiviewEnabled && vao != nullptr)
+ {
+ int programNumViews = 1;
+ if (program && program->usesMultiview())
+ {
+ programNumViews = program->getNumViews();
+ }
+ vao->applyNumViewsToDivisor(programNumViews);
+ }
+}
+
+void StateManagerGL::updateMultiviewBaseViewLayerIndexUniform(
+ const gl::Program *program,
+ const gl::FramebufferState &drawFramebufferState) const
+{
+ if (mIsMultiviewEnabled && program != nullptr && program->usesMultiview())
+ {
+ const ProgramGL *programGL = GetImplAs<ProgramGL>(program);
+ switch (drawFramebufferState.getMultiviewLayout())
+ {
+ case GL_FRAMEBUFFER_MULTIVIEW_SIDE_BY_SIDE_ANGLE:
+ programGL->enableSideBySideRenderingPath();
+ break;
+ case GL_FRAMEBUFFER_MULTIVIEW_LAYERED_ANGLE:
+ programGL->enableLayeredRenderingPath(drawFramebufferState.getBaseViewIndex());
+ break;
+ default:
+ break;
+ }
+ }
+}
}
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 552c2f95945..98a42bec2c6 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/StateManagerGL.h
@@ -22,6 +22,7 @@ namespace gl
struct Caps;
class ContextState;
class State;
+class FramebufferState;
}
namespace rx
@@ -30,12 +31,15 @@ namespace rx
class FramebufferGL;
class FunctionsGL;
class TransformFeedbackGL;
+class VertexArrayGL;
class QueryGL;
class StateManagerGL final : angle::NonCopyable
{
public:
- StateManagerGL(const FunctionsGL *functions, const gl::Caps &rendererCaps);
+ StateManagerGL(const FunctionsGL *functions,
+ const gl::Caps &rendererCaps,
+ const gl::Extensions &extensions);
void deleteProgram(GLuint program);
void deleteVertexArray(GLuint vao);
@@ -74,10 +78,16 @@ class StateManagerGL final : angle::NonCopyable
void setScissorTestEnabled(bool enabled);
void setScissor(const gl::Rectangle &scissor);
+ void setScissorIndexed(GLuint index, const gl::Rectangle &scissor);
+ void setScissorArrayv(GLuint first, const std::vector<gl::Rectangle> &viewports);
void setViewport(const gl::Rectangle &viewport);
+ void setViewportArrayv(GLuint first, const std::vector<gl::Rectangle> &viewports);
void setDepthRange(float near, float far);
+ void setViewportOffsets(const std::vector<gl::Offset> &kviewportOffsets);
+ void setSideBySide(bool isSideBySide);
+
void setBlendEnabled(bool enabled);
void setBlendColor(const gl::ColorF &blendColor);
void setBlendFuncs(GLenum sourceBlendRGB,
@@ -171,6 +181,10 @@ class StateManagerGL final : angle::NonCopyable
void syncState(const gl::Context *context, const gl::State::DirtyBits &glDirtyBits);
+ void updateMultiviewBaseViewLayerIndexUniform(
+ const gl::Program *program,
+ const gl::FramebufferState &drawFramebufferState) const;
+
private:
// Set state that's common among draw commands and compute invocations.
void setGenericShaderState(const gl::Context *context);
@@ -180,6 +194,19 @@ class StateManagerGL final : angle::NonCopyable
void setTextureCubemapSeamlessEnabled(bool enabled);
+ void applyViewportOffsetsAndSetScissors(const gl::Rectangle &scissor,
+ const gl::Framebuffer &drawFramebuffer);
+ void applyViewportOffsetsAndSetViewports(const gl::Rectangle &viewport,
+ const gl::Framebuffer &drawFramebuffer);
+ void propagateNumViewsToVAO(const gl::Program *program, VertexArrayGL *vao);
+
+ enum MultiviewDirtyBitType
+ {
+ MULTIVIEW_DIRTY_BIT_SIDE_BY_SIDE_LAYOUT,
+ MULTIVIEW_DIRTY_BIT_VIEWPORT_OFFSETS,
+ MULTIVIEW_DIRTY_BIT_MAX
+ };
+
const FunctionsGL *mFunctions;
GLuint mProgram;
@@ -244,9 +271,9 @@ class StateManagerGL final : angle::NonCopyable
GLuint mRenderbuffer;
bool mScissorTestEnabled;
- gl::Rectangle mScissor;
-
- gl::Rectangle mViewport;
+ std::vector<gl::Rectangle> mScissors;
+ std::vector<gl::Rectangle> mViewports;
+ std::vector<gl::Offset> mViewportOffsets;
float mNear;
float mFar;
@@ -316,7 +343,13 @@ class StateManagerGL final : angle::NonCopyable
GLint mPathStencilRef;
GLuint mPathStencilMask;
+ bool mIsSideBySideDrawFramebuffer;
+ const bool mIsMultiviewEnabled;
+
gl::State::DirtyBits mLocalDirtyBits;
+
+ // ANGLE_multiview dirty bits.
+ angle::BitSet<MULTIVIEW_DIRTY_BIT_MAX> mMultiviewDirtyBits;
};
}
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 602319de9d5..21a46097749 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/SurfaceGL.cpp
@@ -26,7 +26,8 @@ SurfaceGL::~SurfaceGL()
FramebufferImpl *SurfaceGL::createDefaultFramebuffer(const gl::FramebufferState &data)
{
return new FramebufferGL(data, mRenderer->getFunctions(), mRenderer->getStateManager(),
- mRenderer->getWorkarounds(), mRenderer->getBlitter(), true);
+ mRenderer->getWorkarounds(), mRenderer->getBlitter(),
+ mRenderer->getMultiviewClearer(), true);
}
egl::Error SurfaceGL::getSyncValues(EGLuint64KHR *ust, EGLuint64KHR *msc, EGLuint64KHR *sbc)
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/FenceSyncGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/SyncGL.cpp
index 6bb14339f0a..15759cf2247 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/FenceSyncGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/SyncGL.cpp
@@ -4,9 +4,9 @@
// found in the LICENSE file.
//
-// FenceSyncGL.cpp: Implements the class methods for FenceSyncGL.
+// SyncGL.cpp: Implements the class methods for SyncGL.
-#include "libANGLE/renderer/gl/FenceSyncGL.h"
+#include "libANGLE/renderer/gl/SyncGL.h"
#include "common/debug.h"
#include "libANGLE/renderer/gl/FunctionsGL.h"
@@ -14,15 +14,12 @@
namespace rx
{
-FenceSyncGL::FenceSyncGL(const FunctionsGL *functions)
- : FenceSyncImpl(),
- mFunctions(functions),
- mSyncObject(0)
+SyncGL::SyncGL(const FunctionsGL *functions) : SyncImpl(), mFunctions(functions), mSyncObject(0)
{
ASSERT(mFunctions);
}
-FenceSyncGL::~FenceSyncGL()
+SyncGL::~SyncGL()
{
if (mSyncObject != 0)
{
@@ -30,7 +27,7 @@ FenceSyncGL::~FenceSyncGL()
}
}
-gl::Error FenceSyncGL::set(GLenum condition, GLbitfield flags)
+gl::Error SyncGL::set(GLenum condition, GLbitfield flags)
{
ASSERT(condition == GL_SYNC_GPU_COMMANDS_COMPLETE && flags == 0);
mSyncObject = mFunctions->fenceSync(condition, flags);
@@ -43,25 +40,24 @@ gl::Error FenceSyncGL::set(GLenum condition, GLbitfield flags)
return gl::NoError();
}
-gl::Error FenceSyncGL::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
+gl::Error SyncGL::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
{
ASSERT(mSyncObject != 0);
*outResult = mFunctions->clientWaitSync(mSyncObject, flags, timeout);
return gl::NoError();
}
-gl::Error FenceSyncGL::serverWait(GLbitfield flags, GLuint64 timeout)
+gl::Error SyncGL::serverWait(GLbitfield flags, GLuint64 timeout)
{
ASSERT(mSyncObject != 0);
mFunctions->waitSync(mSyncObject, flags, timeout);
return gl::NoError();
}
-gl::Error FenceSyncGL::getStatus(GLint *outResult)
+gl::Error SyncGL::getStatus(GLint *outResult)
{
ASSERT(mSyncObject != 0);
mFunctions->getSynciv(mSyncObject, GL_SYNC_STATUS, 1, nullptr, outResult);
return gl::NoError();
}
-
}
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/FenceSyncGL.h b/chromium/third_party/angle/src/libANGLE/renderer/gl/SyncGL.h
index 8dfd6632dad..8e36604ae8d 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/FenceSyncGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/SyncGL.h
@@ -4,22 +4,22 @@
// found in the LICENSE file.
//
-// FenceSyncGL.h: Defines the class interface for FenceSyncGL.
+// SyncGL.h: Defines the class interface for SyncGL.
#ifndef LIBANGLE_RENDERER_GL_FENCESYNCGL_H_
#define LIBANGLE_RENDERER_GL_FENCESYNCGL_H_
-#include "libANGLE/renderer/FenceSyncImpl.h"
+#include "libANGLE/renderer/SyncImpl.h"
namespace rx
{
class FunctionsGL;
-class FenceSyncGL : public FenceSyncImpl
+class SyncGL : public SyncImpl
{
public:
- explicit FenceSyncGL(const FunctionsGL *functions);
- ~FenceSyncGL() override;
+ explicit SyncGL(const FunctionsGL *functions);
+ ~SyncGL() override;
gl::Error set(GLenum condition, GLbitfield flags) override;
gl::Error clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult) override;
@@ -30,7 +30,6 @@ class FenceSyncGL : public FenceSyncImpl
const FunctionsGL *mFunctions;
GLsync mSyncObject;
};
-
}
-#endif // LIBANGLE_RENDERER_GL_FENCESYNCGL_H_
+#endif // LIBANGLE_RENDERER_GL_FENCESYNCGL_H_
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 352cc69ec82..dcf37e7f0b3 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.cpp
@@ -41,7 +41,8 @@ size_t GetLevelInfoIndex(GLenum target, size_t level)
bool UseTexImage2D(GLenum textureType)
{
- return textureType == GL_TEXTURE_2D || textureType == GL_TEXTURE_CUBE_MAP;
+ return textureType == GL_TEXTURE_2D || textureType == GL_TEXTURE_CUBE_MAP ||
+ textureType == GL_TEXTURE_RECTANGLE_ANGLE;
}
bool UseTexImage3D(GLenum textureType)
@@ -87,7 +88,8 @@ LevelInfoGL GetLevelInfo(GLenum originalInternalFormat, GLenum destinationIntern
{
GLenum originalFormat = gl::GetUnsizedFormat(originalInternalFormat);
GLenum destinationFormat = gl::GetUnsizedFormat(destinationInternalFormat);
- return LevelInfoGL(originalFormat, GetDepthStencilWorkaround(originalFormat),
+ return LevelInfoGL(originalFormat, destinationInternalFormat,
+ GetDepthStencilWorkaround(originalFormat),
GetLUMAWorkaroundInfo(originalFormat, destinationFormat));
}
@@ -112,14 +114,16 @@ LUMAWorkaroundGL::LUMAWorkaroundGL(bool enabled_, GLenum workaroundFormat_)
{
}
-LevelInfoGL::LevelInfoGL() : LevelInfoGL(GL_NONE, false, LUMAWorkaroundGL())
+LevelInfoGL::LevelInfoGL() : LevelInfoGL(GL_NONE, GL_NONE, false, LUMAWorkaroundGL())
{
}
LevelInfoGL::LevelInfoGL(GLenum sourceFormat_,
+ GLenum nativeInternalFormat_,
bool depthStencilWorkaround_,
const LUMAWorkaroundGL &lumaWorkaround_)
: sourceFormat(sourceFormat_),
+ nativeInternalFormat(nativeInternalFormat_),
depthStencilWorkaround(depthStencilWorkaround_),
lumaWorkaround(lumaWorkaround_)
{
@@ -714,8 +718,8 @@ gl::Error TextureGL::copyTexture(const gl::Context *context,
gl::GetUnsizedFormat(internalFormat), type);
return copySubTextureHelper(context, target, level, gl::Offset(0, 0, 0), sourceLevel,
- sourceArea, internalFormat, unpackFlipY, unpackPremultiplyAlpha,
- unpackUnmultiplyAlpha, source);
+ sourceArea, gl::GetUnsizedFormat(internalFormat), type, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
}
gl::Error TextureGL::copySubTexture(const gl::Context *context,
@@ -729,10 +733,10 @@ gl::Error TextureGL::copySubTexture(const gl::Context *context,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
- GLenum destFormat = mState.getImageDesc(target, level).format.info->format;
+ const gl::InternalFormat &destFormatInfo = *mState.getImageDesc(target, level).format.info;
return copySubTextureHelper(context, target, level, destOffset, sourceLevel, sourceArea,
- destFormat, unpackFlipY, unpackPremultiplyAlpha,
- unpackUnmultiplyAlpha, source);
+ destFormatInfo.format, destFormatInfo.type, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha, source);
}
gl::Error TextureGL::copySubTextureHelper(const gl::Context *context,
@@ -742,6 +746,7 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Context *context,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
GLenum destFormat,
+ GLenum destType,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
@@ -761,19 +766,36 @@ gl::Error TextureGL::copySubTextureHelper(const gl::Context *context,
(sourceFormat == destFormat && sourceFormat != GL_BGRA_EXT) ||
(sourceFormat == GL_RGBA && destFormat == GL_RGB);
+ GLenum sourceComponentType = sourceImageDesc.format.info->componentType;
+ const auto &destInternalFormatInfo = gl::GetInternalFormatInfo(destFormat, destType);
+ GLenum destComponentType = destInternalFormatInfo.componentType;
+ bool destSRGB = destInternalFormatInfo.colorEncoding == GL_SRGB;
if (source->getTarget() == GL_TEXTURE_2D && !unpackFlipY &&
unpackPremultiplyAlpha == unpackUnmultiplyAlpha && !needsLumaWorkaround &&
- sourceFormatContainSupersetOfDestFormat)
+ sourceFormatContainSupersetOfDestFormat && sourceComponentType == destComponentType &&
+ !destSRGB)
{
return mBlitter->copyTexSubImage(sourceGL, sourceLevel, this, target, level, sourceArea,
destOffset);
}
- // We can't use copyTexSubImage, do a manual copy
- return mBlitter->copySubTexture(context, sourceGL, sourceLevel, this, target, level,
- sourceImageDesc.size, sourceArea, destOffset,
- needsLumaWorkaround, sourceLevelInfo.sourceFormat, unpackFlipY,
- unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
+ // Check if the destination is renderable and copy on the GPU
+ const LevelInfoGL &destLevelInfo = getLevelInfo(target, level);
+ if (!destSRGB &&
+ nativegl::SupportsNativeRendering(mFunctions, target, destLevelInfo.nativeInternalFormat))
+ {
+ return mBlitter->copySubTexture(context, sourceGL, sourceLevel, sourceComponentType, this,
+ target, level, destComponentType, sourceImageDesc.size,
+ sourceArea, destOffset, needsLumaWorkaround,
+ sourceLevelInfo.sourceFormat, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
+ }
+
+ // Fall back to CPU-readback
+ return mBlitter->copySubTextureCPUReadback(context, sourceGL, sourceLevel, sourceComponentType,
+ this, target, level, destFormat, destType,
+ sourceArea, destOffset, unpackFlipY,
+ unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
gl::Error TextureGL::setStorage(const gl::Context *context,
@@ -811,7 +833,7 @@ gl::Error TextureGL::setStorage(const gl::Context *context,
std::max(size.height >> level, 1),
1);
- if (getTarget() == GL_TEXTURE_2D)
+ if (getTarget() == GL_TEXTURE_2D || getTarget() == GL_TEXTURE_RECTANGLE_ANGLE)
{
if (internalFormatInfo.compressed)
{
@@ -989,7 +1011,7 @@ gl::Error TextureGL::generateMipmap(const gl::Context *context)
gl::Error TextureGL::bindTexImage(const gl::Context *context, egl::Surface *surface)
{
- ASSERT(getTarget() == GL_TEXTURE_2D);
+ ASSERT(getTarget() == GL_TEXTURE_2D || getTarget() == GL_TEXTURE_RECTANGLE_ANGLE);
// Make sure this texture is bound
mStateManager->bindTexture(getTarget(), mTextureID);
@@ -1001,7 +1023,7 @@ gl::Error TextureGL::bindTexImage(const gl::Context *context, egl::Surface *surf
gl::Error TextureGL::releaseTexImage(const gl::Context *context)
{
// Not all Surface implementations reset the size of mip 0 when releasing, do it manually
- ASSERT(getTarget() == GL_TEXTURE_2D);
+ ASSERT(getTarget() == GL_TEXTURE_2D || getTarget() == GL_TEXTURE_RECTANGLE_ANGLE);
mStateManager->bindTexture(getTarget(), mTextureID);
if (UseTexImage2D(getTarget()))
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 c3f3fdcc92c..8f2c7c4c334 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/TextureGL.h
@@ -37,6 +37,9 @@ struct LevelInfoGL
// Format of the data used in this mip level.
GLenum sourceFormat;
+ // Internal format used for the native call to define this texture
+ GLenum nativeInternalFormat;
+
// If this mip level requires sampler-state re-writing so that only a red channel is exposed.
bool depthStencilWorkaround;
@@ -45,6 +48,7 @@ struct LevelInfoGL
LevelInfoGL();
LevelInfoGL(GLenum sourceFormat,
+ GLenum nativeInternalFormat,
bool depthStencilWorkaround,
const LUMAWorkaroundGL &lumaWorkaround);
};
@@ -134,6 +138,7 @@ class TextureGL : public TextureImpl
size_t sourceLevel,
const gl::Rectangle &sourceArea,
GLenum destFormat,
+ GLenum destType,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
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 b22a215e46c..43da1ca03a7 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.cpp
@@ -48,6 +48,12 @@ bool IsVertexAttribPointerSupported(size_t attribIndex, const VertexAttribute &a
{
return (attribIndex == attrib.bindingIndex && attrib.relativeOffset == 0);
}
+
+GLuint GetAdjustedDivisor(GLuint numViews, GLuint divisor)
+{
+ return numViews * divisor;
+}
+
} // anonymous namespace
VertexArrayGL::VertexArrayGL(const VertexArrayState &state,
@@ -57,6 +63,7 @@ VertexArrayGL::VertexArrayGL(const VertexArrayState &state,
mFunctions(functions),
mStateManager(stateManager),
mVertexArrayID(0),
+ mAppliedNumViews(1),
mAppliedElementArrayBuffer(),
mAppliedBindings(state.getMaxBindings()),
mStreamingElementArrayBufferSize(0),
@@ -80,6 +87,7 @@ void VertexArrayGL::destroy(const gl::Context *context)
{
mStateManager->deleteVertexArray(mVertexArrayID);
mVertexArrayID = 0;
+ mAppliedNumViews = 1;
mStateManager->deleteBuffer(mStreamingElementArrayBuffer);
mStreamingElementArrayBufferSize = 0;
@@ -283,8 +291,10 @@ void VertexArrayGL::computeStreamingAttributeSizes(const gl::AttributesMask &act
// and how much slack space at the beginning of the buffer will be required by determining
// the attribute with the largest data size.
size_t typeSize = ComputeVertexAttributeTypeSize(attrib);
- *outStreamingDataSize += typeSize * ComputeVertexBindingElementCount(
- binding, indexRange.vertexCount(), instanceCount);
+ GLuint adjustedDivisor = GetAdjustedDivisor(mAppliedNumViews, binding.getDivisor());
+ *outStreamingDataSize +=
+ typeSize * ComputeVertexBindingElementCount(adjustedDivisor, indexRange.vertexCount(),
+ instanceCount);
*outMaxAttributeDataSize = std::max(*outMaxAttributeDataSize, typeSize);
}
}
@@ -347,15 +357,16 @@ gl::Error VertexArrayGL::streamAttributes(const gl::AttributesMask &activeAttrib
const auto &binding = bindings[attrib.bindingIndex];
ASSERT(AttributeNeedsStreaming(attrib, binding));
- const size_t streamedVertexCount =
- ComputeVertexBindingElementCount(binding, indexRange.vertexCount(), instanceCount);
+ GLuint adjustedDivisor = GetAdjustedDivisor(mAppliedNumViews, binding.getDivisor());
+ const size_t streamedVertexCount = ComputeVertexBindingElementCount(
+ adjustedDivisor, indexRange.vertexCount(), instanceCount);
const size_t sourceStride = ComputeVertexAttributeStride(attrib, binding);
const size_t destStride = ComputeVertexAttributeTypeSize(attrib);
// Vertices do not apply the 'start' offset when the divisor is non-zero even when doing
// a non-instanced draw call
- const size_t firstIndex = binding.getDivisor() == 0 ? indexRange.start : 0;
+ const size_t firstIndex = adjustedDivisor == 0 ? indexRange.start : 0;
// Attributes using client memory ignore the VERTEX_ATTRIB_BINDING state.
// https://www.opengl.org/registry/specs/ARB/vertex_attrib_binding.txt
@@ -610,24 +621,25 @@ void VertexArrayGL::updateBindingBuffer(const gl::Context *context, size_t bindi
void VertexArrayGL::updateBindingDivisor(size_t bindingIndex)
{
- GLuint newDivisor = mData.getVertexBinding(bindingIndex).getDivisor();
- if (mAppliedBindings[bindingIndex].getDivisor() == newDivisor)
+ GLuint adjustedDivisor =
+ GetAdjustedDivisor(mAppliedNumViews, mData.getVertexBinding(bindingIndex).getDivisor());
+ if (mAppliedBindings[bindingIndex].getDivisor() == adjustedDivisor)
{
return;
}
if (supportVertexAttribBinding())
{
- mFunctions->vertexBindingDivisor(static_cast<GLuint>(bindingIndex), newDivisor);
+ mFunctions->vertexBindingDivisor(static_cast<GLuint>(bindingIndex), adjustedDivisor);
}
else
{
// We can only use VertexAttribDivisor on platforms that don't support Vertex Attrib
// Binding.
- mFunctions->vertexAttribDivisor(static_cast<GLuint>(bindingIndex), newDivisor);
+ mFunctions->vertexAttribDivisor(static_cast<GLuint>(bindingIndex), adjustedDivisor);
}
- mAppliedBindings[bindingIndex].setDivisor(newDivisor);
+ mAppliedBindings[bindingIndex].setDivisor(adjustedDivisor);
}
void VertexArrayGL::syncState(const gl::Context *context, const VertexArray::DirtyBits &dirtyBits)
@@ -683,4 +695,17 @@ void VertexArrayGL::syncState(const gl::Context *context, const VertexArray::Dir
}
}
+void VertexArrayGL::applyNumViewsToDivisor(int numViews)
+{
+ if (numViews != mAppliedNumViews)
+ {
+ mStateManager->bindVertexArray(mVertexArrayID, getAppliedElementArrayBufferID());
+ mAppliedNumViews = numViews;
+ for (size_t index = 0u; index < mAppliedBindings.size(); ++index)
+ {
+ updateBindingDivisor(index);
+ }
+ }
+}
+
} // rx
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 7445b2c4eb8..615809950c8 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/VertexArrayGL.h
@@ -45,6 +45,7 @@ class VertexArrayGL : public VertexArrayImpl
void syncState(const gl::Context *context,
const gl::VertexArray::DirtyBits &dirtyBits) override;
+ void applyNumViewsToDivisor(int numViews);
private:
gl::Error syncDrawState(const gl::Context *context,
@@ -100,6 +101,7 @@ class VertexArrayGL : public VertexArrayImpl
StateManagerGL *mStateManager;
GLuint mVertexArrayID;
+ int mAppliedNumViews;
mutable gl::BindingPointer<gl::Buffer> mAppliedElementArrayBuffer;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.mm b/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.mm
index f6fe8fe5a80..14a19a3bbd4 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.mm
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/PbufferSurfaceCGL.mm
@@ -141,7 +141,8 @@ FramebufferImpl *PbufferSurfaceCGL::createDefaultFramebuffer(const gl::Framebuff
{
// TODO(cwallez) assert it happens only once?
return new FramebufferGL(mFramebuffer, state, mFunctions, mRenderer->getWorkarounds(),
- mRenderer->getBlitter(), mStateManager);
+ mRenderer->getBlitter(), mRenderer->getMultiviewClearer(),
+ mStateManager);
}
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm b/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
index 44b7271d052..aa9ba1fe27c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/cgl/WindowSurfaceCGL.mm
@@ -330,7 +330,7 @@ FramebufferImpl *WindowSurfaceCGL::createDefaultFramebuffer(const gl::Framebuffe
{
// TODO(cwallez) assert it happens only once?
return new FramebufferGL(mFramebuffer, state, mFunctions, mWorkarounds, mRenderer->getBlitter(),
- mStateManager);
+ mRenderer->getMultiviewClearer(), mStateManager);
}
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp
index cff3a313365..6af884f6608 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/egl/ozone/DisplayOzone.cpp
@@ -309,7 +309,8 @@ FramebufferGL *DisplayOzone::Buffer::framebufferGL(const gl::FramebufferState &s
{
return new FramebufferGL(
mGLFB, state, mDisplay->mFunctionsGL, mDisplay->getRenderer()->getWorkarounds(),
- mDisplay->getRenderer()->getBlitter(), mDisplay->getRenderer()->getStateManager());
+ mDisplay->getRenderer()->getBlitter(), mDisplay->getRenderer()->getMultiviewClearer(),
+ mDisplay->getRenderer()->getStateManager());
}
void DisplayOzone::Buffer::present()
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 d3b1b6e5a87..981d0f23f02 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
@@ -89,8 +89,11 @@ static bool MeetsRequirements(const FunctionsGL *functions, const nativegl::Supp
}
}
-static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, GLenum internalFormat)
+static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions,
+ GLenum internalFormat)
{
+ ASSERT(functions->getError() == GL_NO_ERROR);
+
gl::TextureCaps textureCaps;
const nativegl::InternalFormat &formatInfo = nativegl::GetInternalFormatInfo(internalFormat, functions->standard);
@@ -102,16 +105,27 @@ static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, G
// extension GL_ARB_internalformat_query
if (textureCaps.renderable && functions->getInternalformativ)
{
+ GLenum queryInternalFormat = internalFormat;
+
+ if (internalFormat == GL_BGRA8_EXT && functions->standard == STANDARD_GL_DESKTOP)
+ {
+ // Querying GL_NUM_SAMPLE_COUNTS for GL_BGRA8_EXT generates an INVALID_ENUM on some
+ // drivers. It seems however that allocating a multisampled renderbuffer of this format
+ // succeeds. To avoid breaking multisampling for this format, query the supported sample
+ // counts for GL_RGBA8 instead.
+ queryInternalFormat = GL_RGBA8;
+ }
+
GLint numSamples = 0;
- functions->getInternalformativ(GL_RENDERBUFFER, internalFormat, GL_NUM_SAMPLE_COUNTS, 1, &numSamples);
+ functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_NUM_SAMPLE_COUNTS,
+ 1, &numSamples);
if (numSamples > 0)
{
std::vector<GLint> samples(numSamples);
- functions->getInternalformativ(GL_RENDERBUFFER, internalFormat, GL_SAMPLES,
+ functions->getInternalformativ(GL_RENDERBUFFER, queryInternalFormat, GL_SAMPLES,
static_cast<GLsizei>(samples.size()), &samples[0]);
- GLenum queryInternalFormat = internalFormat;
if (internalFormat == GL_STENCIL_INDEX8)
{
// The query below does generates an error with STENCIL_INDEX8 on NVIDIA driver
@@ -149,6 +163,7 @@ static gl::TextureCaps GenerateTextureFormatCaps(const FunctionsGL *functions, G
}
}
+ ASSERT(functions->getError() == GL_NO_ERROR);
return textureCaps;
}
@@ -539,9 +554,14 @@ void GenerateCaps(const FunctionsGL *functions,
LimitVersion(maxSupportedESVersion, gl::Version(2, 0));
}
- if (functions->isAtLeastGL(gl::Version(3, 0)) ||
- functions->hasGLExtension("GL_ARB_ES2_compatibility") ||
- functions->isAtLeastGLES(gl::Version(2, 0)))
+ if (functions->isAtLeastGL(gl::Version(3, 2)) &&
+ (functions->profile & GL_CONTEXT_CORE_PROFILE_BIT) != 0)
+ {
+ caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VERTEX_OUTPUT_COMPONENTS);
+ }
+ else if (functions->isAtLeastGL(gl::Version(3, 0)) ||
+ functions->hasGLExtension("GL_ARB_ES2_compatibility") ||
+ functions->isAtLeastGLES(gl::Version(2, 0)))
{
caps->maxVaryingComponents = QuerySingleGLInt(functions, GL_MAX_VARYING_COMPONENTS);
}
@@ -982,6 +1002,14 @@ void GenerateCaps(const FunctionsGL *functions,
functions->hasGLESExtension("GL_ARB_invalidate_subdata");
extensions->translatedShaderSource = true;
+
+ if (functions->isAtLeastGL(gl::Version(3, 1)) ||
+ functions->hasGLExtension("GL_ARB_texture_rectangle"))
+ {
+ extensions->textureRectangle = true;
+ caps->maxRectangleTextureSize =
+ QuerySingleGLInt(functions, GL_MAX_RECTANGLE_TEXTURE_SIZE_ANGLE);
+ }
}
void GenerateWorkarounds(const FunctionsGL *functions, WorkaroundsGL *workarounds)
@@ -1092,6 +1120,26 @@ bool SupportsOcclusionQueries(const FunctionsGL *functions)
functions->isAtLeastGLES(gl::Version(3, 0)) ||
functions->hasGLESExtension("GL_EXT_occlusion_query_boolean");
}
+
+bool SupportsNativeRendering(const FunctionsGL *functions, GLenum target, GLenum internalFormat)
+{
+ // Some desktop drivers allow rendering to formats that are not required by the spec, this is
+ // exposed through the GL_FRAMEBUFFER_RENDERABLE query.
+ if (functions->isAtLeastGL(gl::Version(4, 3)) ||
+ functions->hasGLExtension("GL_ARB_internalformat_query2"))
+ {
+ GLint framebufferRenderable = GL_FALSE;
+ functions->getInternalformativ(target, internalFormat, GL_FRAMEBUFFER_RENDERABLE, 1,
+ &framebufferRenderable);
+ return framebufferRenderable != GL_FALSE;
+ }
+ else
+ {
+ const nativegl::InternalFormat &nativeInfo =
+ nativegl::GetInternalFormatInfo(internalFormat, functions->standard);
+ return nativegl_gl::MeetsRequirements(functions, nativeInfo.framebufferAttachment);
+ }
+}
}
bool CanMapBufferForRead(const FunctionsGL *functions)
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 76eb4788ee1..5e60bb004b2 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
@@ -60,6 +60,7 @@ namespace nativegl
{
bool SupportsFenceSync(const FunctionsGL *functions);
bool SupportsOcclusionQueries(const FunctionsGL *functions);
+bool SupportsNativeRendering(const FunctionsGL *functions, GLenum target, GLenum internalFormat);
}
bool CanMapBufferForRead(const FunctionsGL *functions);
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 ca872458518..86af23c8513 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
@@ -466,7 +466,8 @@ EGLint D3DTextureSurfaceWGL::getSwapBehavior() const
FramebufferImpl *D3DTextureSurfaceWGL::createDefaultFramebuffer(const gl::FramebufferState &data)
{
return new FramebufferGL(mFramebufferID, data, mFunctionsGL, mWorkarounds,
- mRenderer->getBlitter(), mStateManager);
+ mRenderer->getBlitter(), mRenderer->getMultiviewClearer(),
+ mStateManager);
}
HDC D3DTextureSurfaceWGL::getDC() const
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
index 5ddff3765c5..4798aa66fca 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/gl/wgl/DXGISwapChainWindowSurfaceWGL.cpp
@@ -270,7 +270,8 @@ FramebufferImpl *DXGISwapChainWindowSurfaceWGL::createDefaultFramebuffer(
const gl::FramebufferState &data)
{
return new FramebufferGL(mFramebufferID, data, mFunctionsGL, mWorkarounds,
- mRenderer->getBlitter(), mStateManager);
+ mRenderer->getBlitter(), mRenderer->getMultiviewClearer(),
+ mStateManager);
}
HDC DXGISwapChainWindowSurfaceWGL::getDC() const
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 bc999c523b9..bc3743d2fa6 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
@@ -104,7 +104,10 @@ egl::Error DisplayWGL::initialize(egl::Display *display)
// Work around compile error from not defining "UNICODE" while Chromium does
const LPSTR idcArrow = MAKEINTRESOURCEA(32512);
- std::string className = FormatString("ANGLE DisplayWGL 0x%0.8p Intermediate Window Class", mDisplay);
+ std::ostringstream stream;
+ stream << "ANGLE DisplayWGL " << std::internal << std::setw(10) << std::setfill('0') << mDisplay
+ << " Intermediate Window Class";
+ std::string className = stream.str();
WNDCLASSA intermediateClassDesc = { 0 };
intermediateClassDesc.style = CS_OWNDC;
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 14e6f6b712f..f0a154554f9 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.cpp
@@ -15,7 +15,6 @@
#include "libANGLE/renderer/null/CompilerNULL.h"
#include "libANGLE/renderer/null/DisplayNULL.h"
#include "libANGLE/renderer/null/FenceNVNULL.h"
-#include "libANGLE/renderer/null/FenceSyncNULL.h"
#include "libANGLE/renderer/null/FramebufferNULL.h"
#include "libANGLE/renderer/null/ImageNULL.h"
#include "libANGLE/renderer/null/PathNULL.h"
@@ -24,6 +23,7 @@
#include "libANGLE/renderer/null/RenderbufferNULL.h"
#include "libANGLE/renderer/null/SamplerNULL.h"
#include "libANGLE/renderer/null/ShaderNULL.h"
+#include "libANGLE/renderer/null/SyncNULL.h"
#include "libANGLE/renderer/null/TextureNULL.h"
#include "libANGLE/renderer/null/TransformFeedbackNULL.h"
#include "libANGLE/renderer/null/VertexArrayNULL.h"
@@ -113,8 +113,7 @@ gl::Error ContextNULL::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
return gl::NoError();
}
@@ -124,8 +123,7 @@ gl::Error ContextNULL::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
return gl::NoError();
}
@@ -136,8 +134,7 @@ gl::Error ContextNULL::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
return gl::NoError();
}
@@ -350,9 +347,9 @@ FenceNVImpl *ContextNULL::createFenceNV()
return new FenceNVNULL();
}
-FenceSyncImpl *ContextNULL::createFenceSync()
+SyncImpl *ContextNULL::createSync()
{
- return new FenceSyncNULL();
+ return new SyncNULL();
}
TransformFeedbackImpl *ContextNULL::createTransformFeedback(const gl::TransformFeedbackState &state)
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 0fe79ed0360..1c581357e32 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ContextNULL.h
@@ -57,23 +57,20 @@ class ContextNULL : public ContextImpl
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange) override;
+ GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
@@ -179,7 +176,7 @@ class ContextNULL : public ContextImpl
// Query and Fence creation
QueryImpl *createQuery(GLenum type) override;
FenceNVImpl *createFenceNV() override;
- FenceSyncImpl *createFenceSync() override;
+ SyncImpl *createSync() override;
// Transform Feedback creation
TransformFeedbackImpl *createTransformFeedback(
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/DisplayNULL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/null/DisplayNULL.cpp
index a90938ed459..b33265bf104 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/DisplayNULL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/DisplayNULL.cpp
@@ -201,7 +201,11 @@ void DisplayNULL::generateExtensions(egl::DisplayExtensions *outExtensions) cons
outExtensions->createContextWebGLCompatibility = true;
outExtensions->createContextBindGeneratesResource = true;
outExtensions->swapBuffersWithDamage = true;
+ outExtensions->pixelFormatFloat = true;
outExtensions->surfacelessContext = true;
+ outExtensions->displayTextureShareGroup = true;
+ outExtensions->createContextClientArrays = true;
+ outExtensions->programCacheControl = true;
}
void DisplayNULL::generateCaps(egl::Caps *outCaps) const
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/FenceSyncNULL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/null/FenceSyncNULL.cpp
deleted file mode 100644
index ae65c0b2766..00000000000
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/FenceSyncNULL.cpp
+++ /dev/null
@@ -1,47 +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.
-//
-// FenceSyncNULL.cpp:
-// Implements the class methods for FenceSyncNULL.
-//
-
-#include "libANGLE/renderer/null/FenceSyncNULL.h"
-
-#include "common/debug.h"
-
-namespace rx
-{
-
-FenceSyncNULL::FenceSyncNULL() : FenceSyncImpl()
-{
-}
-
-FenceSyncNULL::~FenceSyncNULL()
-{
-}
-
-gl::Error FenceSyncNULL::set(GLenum condition, GLbitfield flags)
-{
- return gl::NoError();
-}
-
-gl::Error FenceSyncNULL::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
-{
- *outResult = GL_ALREADY_SIGNALED;
- return gl::NoError();
-}
-
-gl::Error FenceSyncNULL::serverWait(GLbitfield flags, GLuint64 timeout)
-{
- return gl::NoError();
-}
-
-gl::Error FenceSyncNULL::getStatus(GLint *outResult)
-{
- *outResult = GL_SIGNALED;
- return gl::NoError();
-}
-
-} // namespace rx
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 cee30dd08ad..1bdc09bdd9f 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.cpp
@@ -164,6 +164,21 @@ void ProgramNULL::setUniformMatrix4x3fv(GLint location,
{
}
+void ProgramNULL::getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const
+{
+ // TODO(jmadill): Write some values.
+}
+
+void ProgramNULL::getUniformiv(const gl::Context *context, GLint location, GLint *params) const
+{
+ // TODO(jmadill): Write some values.
+}
+
+void ProgramNULL::getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const
+{
+ // TODO(jmadill): Write some values.
+}
+
void ProgramNULL::setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding)
{
}
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 363d3343911..b7c8d7fa667 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/ProgramNULL.h
@@ -82,6 +82,10 @@ class ProgramNULL : public ProgramImpl
GLboolean transpose,
const GLfloat *value) override;
+ void getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const override;
+ void getUniformiv(const gl::Context *context, GLint location, GLint *params) const override;
+ void getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const override;
+
// TODO: synchronize in syncState when dirty bits exist.
void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/SyncNULL.cpp b/chromium/third_party/angle/src/libANGLE/renderer/null/SyncNULL.cpp
new file mode 100644
index 00000000000..e75deb3b6c8
--- /dev/null
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/SyncNULL.cpp
@@ -0,0 +1,47 @@
+//
+// 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.
+//
+// SyncNULL.cpp:
+// Implements the class methods for SyncNULL.
+//
+
+#include "libANGLE/renderer/null/SyncNULL.h"
+
+#include "common/debug.h"
+
+namespace rx
+{
+
+SyncNULL::SyncNULL() : SyncImpl()
+{
+}
+
+SyncNULL::~SyncNULL()
+{
+}
+
+gl::Error SyncNULL::set(GLenum condition, GLbitfield flags)
+{
+ return gl::NoError();
+}
+
+gl::Error SyncNULL::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
+{
+ *outResult = GL_ALREADY_SIGNALED;
+ return gl::NoError();
+}
+
+gl::Error SyncNULL::serverWait(GLbitfield flags, GLuint64 timeout)
+{
+ return gl::NoError();
+}
+
+gl::Error SyncNULL::getStatus(GLint *outResult)
+{
+ *outResult = GL_SIGNALED;
+ return gl::NoError();
+}
+
+} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/null/FenceSyncNULL.h b/chromium/third_party/angle/src/libANGLE/renderer/null/SyncNULL.h
index 28a12f703cd..10096a2438d 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/null/FenceSyncNULL.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/null/SyncNULL.h
@@ -3,23 +3,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// FenceSyncNULL.h:
-// Defines the class interface for FenceSyncNULL, implementing FenceSyncImpl.
+// SyncNULL.h:
+// Defines the class interface for SyncNULL, implementing SyncImpl.
//
#ifndef LIBANGLE_RENDERER_NULL_FENCESYNCNULL_H_
#define LIBANGLE_RENDERER_NULL_FENCESYNCNULL_H_
-#include "libANGLE/renderer/FenceSyncImpl.h"
+#include "libANGLE/renderer/SyncImpl.h"
namespace rx
{
-class FenceSyncNULL : public FenceSyncImpl
+class SyncNULL : public SyncImpl
{
public:
- FenceSyncNULL();
- ~FenceSyncNULL() override;
+ SyncNULL();
+ ~SyncNULL() override;
gl::Error set(GLenum condition, GLbitfield flags) override;
gl::Error clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult) override;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.cpp b/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.cpp
index 8109a56d794..ed3f952d669 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.cpp
@@ -148,6 +148,81 @@ static FormatWriteFunctionMap BuildFormatWriteFunctionMap()
return map;
}
+
+void CopyColor(gl::ColorF *color)
+{
+ // No-op
+}
+
+void PremultiplyAlpha(gl::ColorF *color)
+{
+ color->red *= color->alpha;
+ color->green *= color->alpha;
+ color->blue *= color->alpha;
+}
+
+void UnmultiplyAlpha(gl::ColorF *color)
+{
+ if (color->alpha != 0.0f)
+ {
+ float invAlpha = 1.0f / color->alpha;
+ color->red *= invAlpha;
+ color->green *= invAlpha;
+ color->blue *= invAlpha;
+ }
+}
+
+void ClipChannelsR(gl::ColorF *color)
+{
+ color->green = 0.0f;
+ color->blue = 0.0f;
+ color->alpha = 1.0f;
+}
+
+void ClipChannelsRG(gl::ColorF *color)
+{
+ color->blue = 0.0f;
+ color->alpha = 1.0f;
+}
+
+void ClipChannelsRGB(gl::ColorF *color)
+{
+ color->alpha = 1.0f;
+}
+
+void ClipChannelsLuminance(gl::ColorF *color)
+{
+ color->alpha = 1.0f;
+}
+
+void ClipChannelsAlpha(gl::ColorF *color)
+{
+ color->red = 0.0f;
+ color->green = 0.0f;
+ color->blue = 0.0f;
+}
+
+void ClipChannelsNoOp(gl::ColorF *color)
+{
+}
+
+void WriteUintColor(const gl::ColorF &color,
+ ColorWriteFunction colorWriteFunction,
+ uint8_t *destPixelData)
+{
+ gl::ColorUI destColor(
+ static_cast<unsigned int>(color.red * 255), static_cast<unsigned int>(color.green * 255),
+ static_cast<unsigned int>(color.blue * 255), static_cast<unsigned int>(color.alpha * 255));
+ colorWriteFunction(reinterpret_cast<const uint8_t *>(&destColor), destPixelData);
+}
+
+void WriteFloatColor(const gl::ColorF &color,
+ ColorWriteFunction colorWriteFunction,
+ uint8_t *destPixelData)
+{
+ colorWriteFunction(reinterpret_cast<const uint8_t *>(&color), destPixelData);
+}
+
} // anonymous namespace
PackPixelsParams::PackPixelsParams()
@@ -314,4 +389,85 @@ bool ShouldUseDebugLayers(const egl::AttributeMap &attribs)
#endif // !defined(NDEBUG)
}
+void CopyImageCHROMIUM(const uint8_t *sourceData,
+ size_t sourceRowPitch,
+ size_t sourcePixelBytes,
+ ColorReadFunction colorReadFunction,
+ uint8_t *destData,
+ size_t destRowPitch,
+ size_t destPixelBytes,
+ ColorWriteFunction colorWriteFunction,
+ GLenum destUnsizedFormat,
+ GLenum destComponentType,
+ size_t width,
+ size_t height,
+ bool unpackFlipY,
+ bool unpackPremultiplyAlpha,
+ bool unpackUnmultiplyAlpha)
+{
+ using ConversionFunction = void (*)(gl::ColorF *);
+ ConversionFunction conversionFunction = CopyColor;
+ if (unpackPremultiplyAlpha != unpackUnmultiplyAlpha)
+ {
+ if (unpackPremultiplyAlpha)
+ {
+ conversionFunction = PremultiplyAlpha;
+ }
+ else
+ {
+ conversionFunction = UnmultiplyAlpha;
+ }
+ }
+
+ auto clipChannelsFunction = ClipChannelsNoOp;
+ switch (destUnsizedFormat)
+ {
+ case GL_RED:
+ clipChannelsFunction = ClipChannelsR;
+ break;
+ case GL_RG:
+ clipChannelsFunction = ClipChannelsRG;
+ break;
+ case GL_RGB:
+ clipChannelsFunction = ClipChannelsRGB;
+ break;
+ case GL_LUMINANCE:
+ clipChannelsFunction = ClipChannelsLuminance;
+ break;
+ case GL_ALPHA:
+ clipChannelsFunction = ClipChannelsAlpha;
+ break;
+ }
+
+ auto writeFunction = (destComponentType == GL_UNSIGNED_INT) ? WriteUintColor : WriteFloatColor;
+
+ for (size_t y = 0; y < height; y++)
+ {
+ for (size_t x = 0; x < width; x++)
+ {
+ const uint8_t *sourcePixelData = sourceData + y * sourceRowPitch + x * sourcePixelBytes;
+
+ gl::ColorF sourceColor;
+ colorReadFunction(sourcePixelData, reinterpret_cast<uint8_t *>(&sourceColor));
+
+ conversionFunction(&sourceColor);
+ clipChannelsFunction(&sourceColor);
+
+ size_t destY = 0;
+ if (unpackFlipY)
+ {
+ destY += (height - 1);
+ destY -= y;
+ }
+ else
+ {
+ destY += y;
+ }
+
+ uint8_t *destPixelData = destData + destY * destRowPitch + x * destPixelBytes;
+ writeFunction(sourceColor, colorWriteFunction, destPixelData);
+ }
+ }
+}
+
} // namespace rx
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.h b/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.h
index ab953a9697c..217156e2c00 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/renderer_utils.h
@@ -189,6 +189,22 @@ using LoadFunctionMap = LoadImageFunctionInfo (*)(GLenum);
bool ShouldUseDebugLayers(const egl::AttributeMap &attribs);
+void CopyImageCHROMIUM(const uint8_t *sourceData,
+ size_t sourceRowPitch,
+ size_t sourcePixelBytes,
+ ColorReadFunction readFunction,
+ uint8_t *destData,
+ size_t destRowPitch,
+ size_t destPixelBytes,
+ ColorWriteFunction colorWriteFunction,
+ GLenum destUnsizedFormat,
+ GLenum destComponentType,
+ size_t width,
+ size_t height,
+ bool unpackFlipY,
+ bool unpackPremultiplyAlpha,
+ bool unpackUnmultiplyAlpha);
+
} // namespace rx
#endif // LIBANGLE_RENDERER_RENDERER_UTILS_H_
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 e6a3e29fc82..f0e448a15a1 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp
@@ -17,7 +17,6 @@
#include "libANGLE/renderer/vulkan/ContextVk.h"
#include "libANGLE/renderer/vulkan/DeviceVk.h"
#include "libANGLE/renderer/vulkan/FenceNVVk.h"
-#include "libANGLE/renderer/vulkan/FenceSyncVk.h"
#include "libANGLE/renderer/vulkan/FramebufferVk.h"
#include "libANGLE/renderer/vulkan/ImageVk.h"
#include "libANGLE/renderer/vulkan/ProgramVk.h"
@@ -26,6 +25,7 @@
#include "libANGLE/renderer/vulkan/RendererVk.h"
#include "libANGLE/renderer/vulkan/SamplerVk.h"
#include "libANGLE/renderer/vulkan/ShaderVk.h"
+#include "libANGLE/renderer/vulkan/SyncVk.h"
#include "libANGLE/renderer/vulkan/TextureVk.h"
#include "libANGLE/renderer/vulkan/TransformFeedbackVk.h"
#include "libANGLE/renderer/vulkan/VertexArrayVk.h"
@@ -340,8 +340,7 @@ gl::Error ContextVk::drawElements(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
UNIMPLEMENTED();
return gl::InternalError();
@@ -352,8 +351,7 @@ gl::Error ContextVk::drawElementsInstanced(const gl::Context *context,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange)
+ GLsizei instances)
{
UNIMPLEMENTED();
return gl::InternalError();
@@ -365,8 +363,7 @@ gl::Error ContextVk::drawRangeElements(const gl::Context *context,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange)
+ const void *indices)
{
return gl::NoError();
}
@@ -533,9 +530,9 @@ FenceNVImpl *ContextVk::createFenceNV()
return new FenceNVVk();
}
-FenceSyncImpl *ContextVk::createFenceSync()
+SyncImpl *ContextVk::createSync()
{
- return new FenceSyncVk();
+ return new SyncVk();
}
TransformFeedbackImpl *ContextVk::createTransformFeedback(const gl::TransformFeedbackState &state)
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 b326beeb471..6961be81132 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ContextVk.h
@@ -46,23 +46,20 @@ class ContextVk : public ContextImpl, public ResourceVk
GLenum mode,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawElementsInstanced(const gl::Context *context,
GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instances,
- const gl::IndexRange &indexRange) override;
+ GLsizei instances) override;
gl::Error drawRangeElements(const gl::Context *context,
GLenum mode,
GLuint start,
GLuint end,
GLsizei count,
GLenum type,
- const void *indices,
- const gl::IndexRange &indexRange) override;
+ const void *indices) override;
gl::Error drawArraysIndirect(const gl::Context *context,
GLenum mode,
const void *indirect) override;
@@ -122,7 +119,7 @@ class ContextVk : public ContextImpl, public ResourceVk
// Query and Fence creation
QueryImpl *createQuery(GLenum type) override;
FenceNVImpl *createFenceNV() override;
- FenceSyncImpl *createFenceSync() override;
+ SyncImpl *createSync() override;
// Transform Feedback creation
TransformFeedbackImpl *createTransformFeedback(
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 36cbb29ba4c..7f1bdddd88c 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp
@@ -312,4 +312,19 @@ gl::ErrorOrResult<vk::PipelineLayout *> ProgramVk::getPipelineLayout(VkDevice de
return &mPipelineLayout;
}
+void ProgramVk::getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const
+{
+ UNIMPLEMENTED();
+}
+
+void ProgramVk::getUniformiv(const gl::Context *context, GLint location, GLint *params) const
+{
+ UNIMPLEMENTED();
+}
+
+void ProgramVk::getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const
+{
+ UNIMPLEMENTED();
+}
+
} // namespace rx
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 c24cc3f04eb..50550c77997 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/ProgramVk.h
@@ -84,6 +84,10 @@ class ProgramVk : public ProgramImpl
GLboolean transpose,
const GLfloat *value) override;
+ void getUniformfv(const gl::Context *context, GLint location, GLfloat *params) const override;
+ void getUniformiv(const gl::Context *context, GLint location, GLint *params) const override;
+ void getUniformuiv(const gl::Context *context, GLint location, GLuint *params) const override;
+
// TODO: synchronize in syncState when dirty bits exist.
void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override;
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.cpp b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SyncVk.cpp
index 15a98177c16..cd2be0af8fa 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.cpp
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SyncVk.cpp
@@ -3,44 +3,44 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// FenceSyncVk.cpp:
-// Implements the class methods for FenceSyncVk.
+// SyncVk.cpp:
+// Implements the class methods for SyncVk.
//
-#include "libANGLE/renderer/vulkan/FenceSyncVk.h"
+#include "libANGLE/renderer/vulkan/SyncVk.h"
#include "common/debug.h"
namespace rx
{
-FenceSyncVk::FenceSyncVk() : FenceSyncImpl()
+SyncVk::SyncVk() : SyncImpl()
{
}
-FenceSyncVk::~FenceSyncVk()
+SyncVk::~SyncVk()
{
}
-gl::Error FenceSyncVk::set(GLenum condition, GLbitfield flags)
+gl::Error SyncVk::set(GLenum condition, GLbitfield flags)
{
UNIMPLEMENTED();
return gl::InternalError();
}
-gl::Error FenceSyncVk::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
+gl::Error SyncVk::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult)
{
UNIMPLEMENTED();
return gl::InternalError();
}
-gl::Error FenceSyncVk::serverWait(GLbitfield flags, GLuint64 timeout)
+gl::Error SyncVk::serverWait(GLbitfield flags, GLuint64 timeout)
{
UNIMPLEMENTED();
return gl::InternalError();
}
-gl::Error FenceSyncVk::getStatus(GLint *outResult)
+gl::Error SyncVk::getStatus(GLint *outResult)
{
UNIMPLEMENTED();
return gl::InternalError();
diff --git a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.h b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SyncVk.h
index ab9a10720ae..316c3ad809e 100644
--- a/chromium/third_party/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.h
+++ b/chromium/third_party/angle/src/libANGLE/renderer/vulkan/SyncVk.h
@@ -3,23 +3,23 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-// FenceSyncVk.h:
-// Defines the class interface for FenceSyncVk, implementing FenceSyncImpl.
+// SyncVk:
+// Defines the class interface for SyncVk, implementing SyncImpl.
//
#ifndef LIBANGLE_RENDERER_VULKAN_FENCESYNCVK_H_
#define LIBANGLE_RENDERER_VULKAN_FENCESYNCVK_H_
-#include "libANGLE/renderer/FenceSyncImpl.h"
+#include "libANGLE/renderer/SyncImpl.h"
namespace rx
{
-class FenceSyncVk : public FenceSyncImpl
+class SyncVk : public SyncImpl
{
public:
- FenceSyncVk();
- ~FenceSyncVk() override;
+ SyncVk();
+ ~SyncVk() override;
gl::Error set(GLenum condition, GLbitfield flags) override;
gl::Error clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult) override;
diff --git a/chromium/third_party/angle/src/libANGLE/validationEGL.cpp b/chromium/third_party/angle/src/libANGLE/validationEGL.cpp
index 27d9d52d126..4128289c8b9 100644
--- a/chromium/third_party/angle/src/libANGLE/validationEGL.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationEGL.cpp
@@ -35,6 +35,9 @@ size_t GetMaximumMipLevel(const gl::Context *context, GLenum target)
case GL_TEXTURE_2D:
maxDimension = caps.max2DTextureSize;
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ maxDimension = caps.maxRectangleTextureSize;
+ break;
case GL_TEXTURE_CUBE_MAP:
maxDimension = caps.maxCubeMapTextureSize;
break;
@@ -2285,4 +2288,149 @@ Error ValidateProgramCacheResizeANGLE(const Display *display, EGLint limit, EGLe
return NoError();
}
+Error ValidateSurfaceAttrib(const Display *display,
+ const Surface *surface,
+ EGLint attribute,
+ EGLint value)
+{
+ ANGLE_TRY(ValidateDisplay(display));
+ ANGLE_TRY(ValidateSurface(display, surface));
+
+ if (surface == EGL_NO_SURFACE)
+ {
+ return EglBadSurface() << "Surface cannot be EGL_NO_SURFACE.";
+ }
+
+ switch (attribute)
+ {
+ case EGL_MIPMAP_LEVEL:
+ break;
+
+ case EGL_MULTISAMPLE_RESOLVE:
+ switch (value)
+ {
+ case EGL_MULTISAMPLE_RESOLVE_DEFAULT:
+ break;
+
+ case EGL_MULTISAMPLE_RESOLVE_BOX:
+ if ((surface->getConfig()->surfaceType & EGL_MULTISAMPLE_RESOLVE_BOX_BIT) == 0)
+ {
+ return EglBadMatch()
+ << "Surface does not support EGL_MULTISAMPLE_RESOLVE_BOX.";
+ }
+ break;
+
+ default:
+ return EglBadAttribute() << "Invalid multisample resolve type.";
+ }
+
+ case EGL_SWAP_BEHAVIOR:
+ switch (value)
+ {
+ case EGL_BUFFER_PRESERVED:
+ if ((surface->getConfig()->surfaceType & EGL_SWAP_BEHAVIOR_PRESERVED_BIT) == 0)
+ {
+ return EglBadMatch()
+ << "Surface does not support EGL_SWAP_BEHAVIOR_PRESERVED.";
+ }
+ break;
+
+ case EGL_BUFFER_DESTROYED:
+ break;
+
+ default:
+ return EglBadAttribute() << "Invalid swap behaviour.";
+ }
+
+ default:
+ return EglBadAttribute() << "Invalid surface attribute.";
+ }
+
+ return NoError();
+}
+
+Error ValidateQuerySurface(const Display *display,
+ const Surface *surface,
+ EGLint attribute,
+ EGLint *value)
+{
+ ANGLE_TRY(ValidateDisplay(display));
+ ANGLE_TRY(ValidateSurface(display, surface));
+
+ if (surface == EGL_NO_SURFACE)
+ {
+ return EglBadSurface() << "Surface cannot be EGL_NO_SURFACE.";
+ }
+
+ switch (attribute)
+ {
+ case EGL_GL_COLORSPACE:
+ case EGL_VG_ALPHA_FORMAT:
+ case EGL_VG_COLORSPACE:
+ case EGL_CONFIG_ID:
+ case EGL_HEIGHT:
+ case EGL_HORIZONTAL_RESOLUTION:
+ case EGL_LARGEST_PBUFFER:
+ case EGL_MIPMAP_TEXTURE:
+ case EGL_MIPMAP_LEVEL:
+ case EGL_MULTISAMPLE_RESOLVE:
+ case EGL_PIXEL_ASPECT_RATIO:
+ case EGL_RENDER_BUFFER:
+ case EGL_SWAP_BEHAVIOR:
+ case EGL_TEXTURE_FORMAT:
+ case EGL_TEXTURE_TARGET:
+ case EGL_VERTICAL_RESOLUTION:
+ case EGL_WIDTH:
+ break;
+
+ case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
+ if (!display->getExtensions().postSubBuffer)
+ {
+ return EglBadAttribute() << "EGL_POST_SUB_BUFFER_SUPPORTED_NV cannot be used "
+ "without EGL_ANGLE_surface_orientation support.";
+ }
+ break;
+
+ case EGL_FIXED_SIZE_ANGLE:
+ if (!display->getExtensions().windowFixedSize)
+ {
+ return EglBadAttribute() << "EGL_FIXED_SIZE_ANGLE cannot be used without "
+ "EGL_ANGLE_window_fixed_size support.";
+ }
+ break;
+
+ case EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE:
+ if (!display->getExtensions().flexibleSurfaceCompatibility)
+ {
+ return EglBadAttribute()
+ << "EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE cannot be "
+ "used without EGL_ANGLE_flexible_surface_compatibility support.";
+ }
+ break;
+
+ case EGL_SURFACE_ORIENTATION_ANGLE:
+ if (!display->getExtensions().surfaceOrientation)
+ {
+ return EglBadAttribute() << "EGL_SURFACE_ORIENTATION_ANGLE cannot be "
+ "queried without "
+ "EGL_ANGLE_surface_orientation support.";
+ }
+ break;
+
+ case EGL_DIRECT_COMPOSITION_ANGLE:
+ if (!display->getExtensions().directComposition)
+ {
+ return EglBadAttribute() << "EGL_DIRECT_COMPOSITION_ANGLE cannot be "
+ "used without "
+ "EGL_ANGLE_direct_composition support.";
+ }
+ break;
+
+ default:
+ return EglBadAttribute() << "Invalid surface attribute.";
+ }
+
+ return NoError();
+}
+
} // namespace egl
diff --git a/chromium/third_party/angle/src/libANGLE/validationEGL.h b/chromium/third_party/angle/src/libANGLE/validationEGL.h
index 8362baf0d4e..6b09448ab8d 100644
--- a/chromium/third_party/angle/src/libANGLE/validationEGL.h
+++ b/chromium/third_party/angle/src/libANGLE/validationEGL.h
@@ -147,6 +147,15 @@ Error ValidateProgramCachePopulateANGLE(const Display *display,
Error ValidateProgramCacheResizeANGLE(const Display *display, EGLint limit, EGLenum mode);
+Error ValidateSurfaceAttrib(const Display *display,
+ const Surface *surface,
+ EGLint attribute,
+ EGLint value);
+Error ValidateQuerySurface(const Display *display,
+ const Surface *surface,
+ EGLint attribute,
+ EGLint *value);
+
} // namespace egl
#define ANGLE_EGL_TRY(THREAD, EXPR) \
diff --git a/chromium/third_party/angle/src/libANGLE/validationES.cpp b/chromium/third_party/angle/src/libANGLE/validationES.cpp
index 92402907636..7b551350490 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES.cpp
@@ -70,16 +70,14 @@ bool ValidateDrawAttribs(ValidationContext *context,
// no buffer is bound to that attribute via bindBuffer and vertexAttribPointer,
// then calls to drawArrays or drawElements will generate an INVALID_OPERATION
// error.
- context->handleError(InvalidOperation()
- << "An enabled vertex array has no buffer.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), VertexArrayNoBuffer);
return false;
}
else if (attrib.pointer == nullptr)
{
// This is an application error that would normally result in a crash,
// but we catch it and return an error
- context->handleError(InvalidOperation()
- << "An enabled vertex array has no buffer and no pointer.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), VertexArrayNoBufferPointer);
return false;
}
continue;
@@ -134,7 +132,7 @@ bool ValidateDrawAttribs(ValidationContext *context,
uint64_t attribOffset = ComputeVertexAttributeOffset(attrib, binding);
if (attribDataSizeNoOffset > kUint64Max - attribOffset)
{
- context->handleError(InvalidOperation() << "Integer overflow.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), IntegerOverflow);
return false;
}
uint64_t attribDataSizeWithOffset = attribDataSizeNoOffset + attribOffset;
@@ -144,8 +142,7 @@ bool ValidateDrawAttribs(ValidationContext *context,
// enough backing data.
if (attribDataSizeWithOffset > static_cast<uint64_t>(buffer->getSize()))
{
- context->handleError(InvalidOperation()
- << "Vertex buffer is not big enough for the draw call");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientVertexBufferSize);
return false;
}
}
@@ -257,7 +254,7 @@ bool ValidReadPixelsFormatType(ValidationContext *context,
}
template <typename ParamType>
-bool ValidateTextureWrapModeValue(Context *context, ParamType *params, bool isExternalTextureTarget)
+bool ValidateTextureWrapModeValue(Context *context, ParamType *params, bool restrictedWrapModes)
{
switch (ConvertToGLenum(params[0]))
{
@@ -266,17 +263,16 @@ bool ValidateTextureWrapModeValue(Context *context, ParamType *params, bool isEx
case GL_REPEAT:
case GL_MIRRORED_REPEAT:
- if (isExternalTextureTarget)
+ if (restrictedWrapModes)
{
- // OES_EGL_image_external specifies this error.
- context->handleError(InvalidEnum()
- << "external textures only support CLAMP_TO_EDGE wrap mode");
+ // OES_EGL_image_external and ANGLE_texture_rectangle specifies this error.
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidWrapModeTexture);
return false;
}
break;
default:
- context->handleError(InvalidEnum() << "Unknown param value.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureWrap);
return false;
}
@@ -284,9 +280,7 @@ bool ValidateTextureWrapModeValue(Context *context, ParamType *params, bool isEx
}
template <typename ParamType>
-bool ValidateTextureMinFilterValue(Context *context,
- ParamType *params,
- bool isExternalTextureTarget)
+bool ValidateTextureMinFilterValue(Context *context, ParamType *params, bool restrictedMinFilter)
{
switch (ConvertToGLenum(params[0]))
{
@@ -298,11 +292,10 @@ bool ValidateTextureMinFilterValue(Context *context,
case GL_LINEAR_MIPMAP_NEAREST:
case GL_NEAREST_MIPMAP_LINEAR:
case GL_LINEAR_MIPMAP_LINEAR:
- if (isExternalTextureTarget)
+ if (restrictedMinFilter)
{
// OES_EGL_image_external specifies this error.
- context->handleError(
- InvalidEnum() << "external textures only support NEAREST and LINEAR filtering");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFilterTexture);
return false;
}
break;
@@ -343,7 +336,7 @@ bool ValidateTextureCompareModeValue(Context *context, ParamType *params)
break;
default:
- context->handleError(InvalidEnum() << "Unknown param value.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), UnknownParameter);
return false;
}
@@ -367,7 +360,7 @@ bool ValidateTextureCompareFuncValue(Context *context, ParamType *params)
break;
default:
- context->handleError(InvalidEnum() << "Unknown param value.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), UnknownParameter);
return false;
}
@@ -390,288 +383,10 @@ bool ValidateTextureSRGBDecodeValue(Context *context, ParamType *params)
break;
default:
- context->handleError(InvalidEnum() << "Unknown param value.");
- return false;
- }
-
- return true;
-}
-
-template <typename ParamType>
-bool ValidateSamplerParameterBase(Context *context,
- GLuint sampler,
- GLenum pname,
- GLsizei bufSize,
- ParamType *params)
-{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation() << "Context does not support OpenGL ES 3.0.");
- return false;
- }
-
- if (!context->isSampler(sampler))
- {
- context->handleError(InvalidOperation() << "Sampler is not valid.");
- return false;
- }
-
- const GLsizei minBufSize = 1;
- if (bufSize >= 0 && bufSize < minBufSize)
- {
- context->handleError(InvalidOperation() << "bufSize must be at least " << minBufSize);
- return false;
- }
-
- switch (pname)
- {
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- if (!ValidateTextureWrapModeValue(context, params, false))
- {
- return false;
- }
- break;
-
- case GL_TEXTURE_MIN_FILTER:
- if (!ValidateTextureMinFilterValue(context, params, false))
- {
- return false;
- }
- break;
-
- case GL_TEXTURE_MAG_FILTER:
- if (!ValidateTextureMagFilterValue(context, params))
- {
- return false;
- }
- break;
-
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- // any value is permissible
- break;
-
- case GL_TEXTURE_COMPARE_MODE:
- if (!ValidateTextureCompareModeValue(context, params))
- {
- return false;
- }
- break;
-
- case GL_TEXTURE_COMPARE_FUNC:
- if (!ValidateTextureCompareFuncValue(context, params))
- {
- return false;
- }
- break;
-
- case GL_TEXTURE_SRGB_DECODE_EXT:
- if (!ValidateTextureSRGBDecodeValue(context, params))
- {
- return false;
- }
- break;
-
- default:
- ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
- return false;
- }
-
- return true;
-}
-
-bool ValidateGetSamplerParameterBase(Context *context,
- GLuint sampler,
- GLenum pname,
- GLsizei *length)
-{
- if (length)
- {
- *length = 0;
- }
-
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation() << "Context does not support OpenGL ES 3.0.");
- return false;
- }
-
- if (!context->isSampler(sampler))
- {
- context->handleError(InvalidOperation() << "Sampler is not valid.");
- return false;
- }
-
- switch (pname)
- {
- case GL_TEXTURE_WRAP_S:
- case GL_TEXTURE_WRAP_T:
- case GL_TEXTURE_WRAP_R:
- case GL_TEXTURE_MIN_FILTER:
- case GL_TEXTURE_MAG_FILTER:
- case GL_TEXTURE_MIN_LOD:
- case GL_TEXTURE_MAX_LOD:
- case GL_TEXTURE_COMPARE_MODE:
- case GL_TEXTURE_COMPARE_FUNC:
- break;
-
- case GL_TEXTURE_SRGB_DECODE_EXT:
- if (!context->getExtensions().textureSRGBDecode)
- {
- context->handleError(InvalidEnum() << "GL_EXT_texture_sRGB_decode is not enabled.");
- return false;
- }
- break;
-
- default:
- ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), UnknownParameter);
return false;
}
- if (length)
- {
- *length = 1;
- }
- return true;
-}
-
-bool ValidateGetActiveUniformBlockivBase(Context *context,
- GLuint program,
- GLuint uniformBlockIndex,
- GLenum pname,
- GLsizei *length)
-{
- if (length)
- {
- *length = 0;
- }
-
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation() << "Context does not support OpenGL ES 3.0.");
- return false;
- }
-
- Program *programObject = GetValidProgram(context, program);
- if (!programObject)
- {
- return false;
- }
-
- if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
- {
- context->handleError(InvalidValue()
- << "uniformBlockIndex exceeds active uniform block count.");
- return false;
- }
-
- switch (pname)
- {
- case GL_UNIFORM_BLOCK_BINDING:
- case GL_UNIFORM_BLOCK_DATA_SIZE:
- case GL_UNIFORM_BLOCK_NAME_LENGTH:
- case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:
- case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:
- case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
- case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
- break;
-
- default:
- ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
- return false;
- }
-
- if (length)
- {
- if (pname == GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)
- {
- const UniformBlock &uniformBlock =
- programObject->getUniformBlockByIndex(uniformBlockIndex);
- *length = static_cast<GLsizei>(uniformBlock.memberIndexes.size());
- }
- else
- {
- *length = 1;
- }
- }
-
- return true;
-}
-
-bool ValidateGetInternalFormativBase(Context *context,
- GLenum target,
- GLenum internalformat,
- GLenum pname,
- GLsizei bufSize,
- GLsizei *numParams)
-{
- if (numParams)
- {
- *numParams = 0;
- }
-
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation() << "Context does not support OpenGL ES 3.0.");
- return false;
- }
-
- const TextureCaps &formatCaps = context->getTextureCaps().get(internalformat);
- if (!formatCaps.renderable)
- {
- context->handleError(InvalidEnum() << "Internal format is not renderable.");
- return false;
- }
-
- switch (target)
- {
- case GL_RENDERBUFFER:
- break;
-
- case GL_TEXTURE_2D_MULTISAMPLE:
- if (context->getClientVersion() < ES_3_1)
- {
- context->handleError(InvalidOperation()
- << "Texture target requires at least OpenGL ES 3.1.");
- return false;
- }
- break;
-
- default:
- context->handleError(InvalidEnum() << "Invalid target.");
- return false;
- }
-
- if (bufSize < 0)
- {
- ANGLE_VALIDATION_ERR(context, InvalidValue(), InsufficientBufferSize);
- return false;
- }
-
- GLsizei maxWriteParams = 0;
- switch (pname)
- {
- case GL_NUM_SAMPLE_COUNTS:
- maxWriteParams = 1;
- break;
-
- case GL_SAMPLES:
- maxWriteParams = static_cast<GLsizei>(formatCaps.sampleCounts.size());
- break;
-
- default:
- ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
- return false;
- }
-
- if (numParams)
- {
- // glGetInternalFormativ will not overflow bufSize
- *numParams = std::min(bufSize, maxWriteParams);
- }
-
return true;
}
@@ -781,7 +496,7 @@ bool ValidateUniformValue(ValidationContext *context, GLenum valueType, GLenum u
return true;
}
- ANGLE_VALIDATION_ERR(context, InvalidOperation(), UniformSizeDoesNotMatchMethod);
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), UniformSizeMismatch);
return false;
}
@@ -861,6 +576,9 @@ bool ValidTextureTarget(const ValidationContext *context, GLenum target)
case GL_TEXTURE_CUBE_MAP:
return true;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ return context->getExtensions().textureRectangle;
+
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
return (context->getClientMajorVersion() >= 3);
@@ -881,6 +599,9 @@ bool ValidTexture2DTarget(const ValidationContext *context, GLenum target)
case GL_TEXTURE_CUBE_MAP:
return true;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ return context->getExtensions().textureRectangle;
+
default:
return false;
}
@@ -924,6 +645,8 @@ bool ValidTexture2DDestinationTarget(const ValidationContext *context, GLenum ta
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
return true;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ return context->getExtensions().textureRectangle;
default:
return false;
}
@@ -938,7 +661,7 @@ bool ValidateDrawElementsInstancedBase(ValidationContext *context,
{
if (primcount < 0)
{
- context->handleError(InvalidValue() << "primcount cannot be negative.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativePrimcount);
return false;
}
@@ -959,7 +682,7 @@ bool ValidateDrawArraysInstancedBase(Context *context,
{
if (primcount < 0)
{
- context->handleError(InvalidValue() << "primcount cannot be negative.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativePrimcount);
return false;
}
@@ -991,8 +714,7 @@ bool ValidateDrawInstancedANGLE(ValidationContext *context)
}
}
- context->handleError(InvalidOperation()
- << "At least one attribute must have a divisor of zero.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoZeroDivisor);
return false;
}
@@ -1023,6 +745,8 @@ bool ValidTexLevelDestinationTarget(const ValidationContext *context, GLenum tar
case GL_TEXTURE_2D_ARRAY:
case GL_TEXTURE_2D_MULTISAMPLE:
return true;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ return context->getExtensions().textureRectangle;
default:
return false;
}
@@ -1095,6 +819,8 @@ bool ValidMipLevel(const ValidationContext *context, GLenum target, GLint level)
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
maxDimension = caps.maxCubeMapTextureSize;
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ return level == 0;
case GL_TEXTURE_3D:
maxDimension = caps.max3DTextureSize;
break;
@@ -1727,7 +1453,7 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context,
}
if (readColorBuffer->getSamples() > 0 &&
- (!Format::SameSized(readFormat, drawFormat) || !sameBounds))
+ (!Format::EquivalentForBlit(readFormat, drawFormat) || !sameBounds))
{
context->handleError(InvalidOperation());
return false;
@@ -1778,7 +1504,7 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context,
if (readBuffer && drawBuffer)
{
- if (!Format::SameSized(readBuffer->getFormat(), drawBuffer->getFormat()))
+ if (!Format::EquivalentForBlit(readBuffer->getFormat(), drawBuffer->getFormat()))
{
context->handleError(InvalidOperation());
return false;
@@ -1809,6 +1535,22 @@ bool ValidateBlitFramebufferParameters(ValidationContext *context,
}
}
+ // ANGLE_multiview, Revision 1:
+ // Calling BlitFramebuffer will result in an INVALID_FRAMEBUFFER_OPERATION error if the
+ // multi-view layout of the current draw framebuffer or read framebuffer is not NONE.
+ if (readFramebuffer->getMultiviewLayout() != GL_NONE)
+ {
+ context->handleError(InvalidFramebufferOperation()
+ << "Attempt to read from a multi-view framebuffer.");
+ return false;
+ }
+ if (drawFramebuffer->getMultiviewLayout() != GL_NONE)
+ {
+ context->handleError(InvalidFramebufferOperation()
+ << "Attempt to write to a multi-view framebuffer.");
+ return false;
+ }
+
return true;
}
@@ -1896,35 +1638,47 @@ bool ValidateReadnPixelsRobustANGLE(Context *context,
return true;
}
-bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n)
+bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n, GLuint *ids)
{
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery)
{
- context->handleError(InvalidOperation() << "Query extension not enabled");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
-bool ValidateDeleteQueriesEXT(gl::Context *context, GLsizei n)
+bool ValidateDeleteQueriesEXT(gl::Context *context, GLsizei n, const GLuint *ids)
{
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery)
{
- context->handleError(InvalidOperation() << "Query extension not enabled");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false;
}
return ValidateGenOrDelete(context, n);
}
+bool ValidateIsQueryEXT(gl::Context *context, GLuint id)
+{
+ if (!context->getExtensions().occlusionQueryBoolean &&
+ !context->getExtensions().disjointTimerQuery)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
+ return false;
+ }
+
+ return true;
+}
+
bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id)
{
if (!ValidQueryType(context, target))
{
- context->handleError(InvalidEnum() << "Invalid query target");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryType);
return false;
}
@@ -1961,7 +1715,7 @@ bool ValidateBeginQueryBase(gl::Context *context, GLenum target, GLuint id)
// check that name was obtained with glGenQueries
if (!queryObject)
{
- context->handleError(InvalidOperation() << "Invalid query id");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidQueryId);
return false;
}
@@ -1980,7 +1734,7 @@ bool ValidateBeginQueryEXT(gl::Context *context, GLenum target, GLuint id)
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery)
{
- context->handleError(InvalidOperation() << "Query extension not enabled");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false;
}
@@ -1991,7 +1745,7 @@ bool ValidateEndQueryBase(gl::Context *context, GLenum target)
{
if (!ValidQueryType(context, target))
{
- context->handleError(InvalidEnum() << "Invalid query target");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryType);
return false;
}
@@ -2011,7 +1765,7 @@ bool ValidateEndQueryEXT(gl::Context *context, GLenum target)
if (!context->getExtensions().occlusionQueryBoolean &&
!context->getExtensions().disjointTimerQuery && !context->getExtensions().syncQuery)
{
- context->handleError(InvalidOperation() << "Query extension not enabled");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryExtensionNotEnabled);
return false;
}
@@ -2028,20 +1782,20 @@ bool ValidateQueryCounterEXT(Context *context, GLuint id, GLenum target)
if (target != GL_TIMESTAMP_EXT)
{
- context->handleError(InvalidEnum() << "Invalid query target");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryTarget);
return false;
}
Query *queryObject = context->getQuery(id, true, target);
if (queryObject == nullptr)
{
- context->handleError(InvalidOperation() << "Invalid query id");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidQueryId);
return false;
}
if (context->getGLState().isQueryActive(queryObject))
{
- context->handleError(InvalidOperation() << "Query is active");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryActive);
return false;
}
@@ -2057,7 +1811,7 @@ bool ValidateGetQueryivBase(Context *context, GLenum target, GLenum pname, GLsiz
if (!ValidQueryType(context, target) && target != GL_TIMESTAMP_EXT)
{
- context->handleError(InvalidEnum() << "Invalid query type");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidQueryType);
return false;
}
@@ -2074,12 +1828,12 @@ bool ValidateGetQueryivBase(Context *context, GLenum target, GLenum pname, GLsiz
if (!context->getExtensions().disjointTimerQuery ||
(target != GL_TIMESTAMP_EXT && target != GL_TIME_ELAPSED_EXT))
{
- context->handleError(InvalidEnum() << "Invalid pname");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
break;
default:
- context->handleError(InvalidEnum() << "Invalid pname");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
@@ -2140,13 +1894,13 @@ bool ValidateGetQueryObjectValueBase(Context *context, GLuint id, GLenum pname,
if (!queryObject)
{
- context->handleError(InvalidOperation() << "Query does not exist");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidQueryId);
return false;
}
if (context->getGLState().isQueryActive(queryObject))
{
- context->handleError(InvalidOperation() << "Query currently active");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), QueryActive);
return false;
}
@@ -2395,13 +2149,6 @@ bool ValidateProgramUniformMatrix(gl::Context *context,
bool ValidateUniform(ValidationContext *context, GLenum valueType, GLint location, GLsizei count)
{
- // Check for ES3 uniform entry points
- if (VariableComponentType(valueType) == GL_UNSIGNED_INT && context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return false;
- }
-
const LinkedUniform *uniform = nullptr;
gl::Program *programObject = context->getGLState().getProgram();
return ValidateUniformCommonBase(context, programObject, location, count, &uniform) &&
@@ -2425,15 +2172,6 @@ bool ValidateUniformMatrix(ValidationContext *context,
GLsizei count,
GLboolean transpose)
{
- // Check for ES3 uniform entry points
- int rows = VariableRowCount(valueType);
- int cols = VariableColumnCount(valueType);
- if (rows != cols && context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return false;
- }
-
if (transpose != GL_FALSE && context->getClientMajorVersion() < 3)
{
context->handleError(InvalidValue());
@@ -2478,6 +2216,14 @@ bool ValidateStateQuery(ValidationContext *context,
case GL_TEXTURE_BINDING_2D_ARRAY:
case GL_TEXTURE_BINDING_2D_MULTISAMPLE:
break;
+ case GL_TEXTURE_BINDING_RECTANGLE_ANGLE:
+ if (!context->getExtensions().textureRectangle)
+ {
+ context->handleError(InvalidEnum()
+ << "ANGLE_texture_rectangle extension not present");
+ return false;
+ }
+ break;
case GL_TEXTURE_BINDING_EXTERNAL_OES:
if (!context->getExtensions().eglStreamConsumerExternal &&
!context->getExtensions().eglImageExternal)
@@ -2504,7 +2250,7 @@ bool ValidateStateQuery(ValidationContext *context,
if (framebuffer->getReadBufferState() == GL_NONE)
{
- context->handleError(InvalidOperation() << "Read buffer is GL_NONE");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ReadBufferNone);
return false;
}
@@ -2616,7 +2362,7 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
if (readFramebuffer->getReadBufferState() == GL_NONE)
{
- context->handleError(InvalidOperation() << "Read buffer is GL_NONE");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ReadBufferNone);
return false;
}
@@ -2624,12 +2370,24 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
// In OpenGL ES it is undefined what happens when an operation tries to read from a missing
// attachment and WebGL defines it to be an error. We do the check unconditionally as the
// situation is an application error that would lead to a crash in ANGLE.
- if (readFramebuffer->getReadColorbuffer() == nullptr)
+ const FramebufferAttachment *source = readFramebuffer->getReadColorbuffer();
+ if (source == nullptr)
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(), MissingReadAttachment);
return false;
}
+ // ANGLE_multiview spec, Revision 1:
+ // Calling CopyTexSubImage3D, CopyTexImage2D, or CopyTexSubImage2D will result in an
+ // INVALID_FRAMEBUFFER_OPERATION error if the multi-view layout of the current read framebuffer
+ // is not NONE.
+ if (source->getMultiviewLayout() != GL_NONE)
+ {
+ context->handleError(InvalidFramebufferOperation()
+ << "The active read framebuffer object has multiview attachments.");
+ return false;
+ }
+
const gl::Caps &caps = context->getCaps();
GLuint maxDimension = 0;
@@ -2648,6 +2406,10 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
maxDimension = caps.maxCubeMapTextureSize;
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ maxDimension = caps.maxRectangleTextureSize;
+ break;
+
case GL_TEXTURE_2D_ARRAY:
maxDimension = caps.max2DTextureSize;
break;
@@ -2727,9 +2489,7 @@ bool ValidateCopyTexImageParametersBase(ValidationContext *context,
{
if (readFramebuffer->formsCopyingFeedbackLoopWith(texture->id(), level, zoffset))
{
- context->handleError(InvalidOperation() << "Texture copying feedback loop formed "
- "between Framebuffer and specified "
- "Texture level.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), FeedbackLoop);
return false;
}
}
@@ -2772,8 +2532,8 @@ bool ValidateDrawBase(ValidationContext *context, GLenum mode, GLsizei count)
// Note: these separate values are not supported in WebGL, due to D3D's limitations. See
// Section 6.10 of the WebGL 1.0 spec.
Framebuffer *framebuffer = state.getDrawFramebuffer();
- if (context->getLimitations().noSeparateStencilRefsAndMasks ||
- context->getExtensions().webglCompatibility)
+ const Extensions &extensions = context->getExtensions();
+ if (context->getLimitations().noSeparateStencilRefsAndMasks || extensions.webglCompatibility)
{
const FramebufferAttachment *dsAttachment =
framebuffer->getStencilOrDepthStencilAttachment();
@@ -2790,7 +2550,7 @@ bool ValidateDrawBase(ValidationContext *context, GLenum mode, GLsizei count)
if (differentRefs || differentWritemasks || differentMasks)
{
- if (!context->getExtensions().webglCompatibility)
+ if (!extensions.webglCompatibility)
{
ERR() << "This ANGLE implementation does not support separate front/back stencil "
"writemasks, reference values, or stencil mask values.";
@@ -2819,6 +2579,39 @@ bool ValidateDrawBase(ValidationContext *context, GLenum mode, GLsizei count)
return false;
}
+ if (extensions.multiview)
+ {
+ const int programNumViews = program->getNumViews();
+ const int framebufferNumViews = framebuffer->getNumViews();
+ if (programNumViews != -1 && framebufferNumViews != programNumViews)
+ {
+ context->handleError(InvalidOperation() << "The number of views in the active program "
+ "and draw framebuffer does not match.");
+ return false;
+ }
+
+ const TransformFeedback *transformFeedbackObject = state.getCurrentTransformFeedback();
+ if (transformFeedbackObject != nullptr && transformFeedbackObject->isActive() &&
+ framebufferNumViews > 1)
+ {
+ context->handleError(InvalidOperation()
+ << "There is an active transform feedback object "
+ "when the number of views in the active draw "
+ "framebuffer is greater than 1.");
+ return false;
+ }
+
+ if (extensions.disjointTimerQuery && framebufferNumViews > 1 &&
+ state.isQueryActive(GL_TIME_ELAPSED_EXT))
+ {
+ context->handleError(InvalidOperation() << "There is an active query for target "
+ "GL_TIME_ELAPSED_EXT when the number of "
+ "views in the active draw framebuffer is "
+ "greater than 1.");
+ return false;
+ }
+ }
+
// Uniform buffer validation
for (unsigned int uniformBlockIndex = 0;
uniformBlockIndex < program->getActiveUniformBlockCount(); uniformBlockIndex++)
@@ -2855,14 +2648,12 @@ bool ValidateDrawBase(ValidationContext *context, GLenum mode, GLsizei count)
}
// Do some additonal WebGL-specific validation
- if (context->getExtensions().webglCompatibility)
+ if (extensions.webglCompatibility)
{
// Detect rendering feedback loops for WebGL.
if (framebuffer->formsRenderingFeedbackLoopWith(state))
{
- context->handleError(
- InvalidOperation()
- << "Rendering feedback loop formed between Framebuffer and active Texture.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), FeedbackLoop);
return false;
}
@@ -2933,15 +2724,6 @@ bool ValidateDrawArraysCommon(ValidationContext *context,
return true;
}
-bool ValidateDrawArraysInstanced(Context *context,
- GLenum mode,
- GLint first,
- GLsizei count,
- GLsizei primcount)
-{
- return ValidateDrawArraysInstancedBase(context, mode, first, count, primcount);
-}
-
bool ValidateDrawArraysInstancedANGLE(Context *context,
GLenum mode,
GLint first,
@@ -3088,6 +2870,13 @@ bool ValidateDrawElementsCommon(ValidationContext *context,
ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize);
return false;
}
+
+ ASSERT(typeSize > 0);
+ if (elementArrayBuffer->getSize() % typeSize != 0)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), MismatchedByteCountType);
+ return false;
+ }
}
else if (!indices)
{
@@ -3246,7 +3035,7 @@ static bool ValidateSizedGetUniform(Context *context,
if (bufSize < 0)
{
- context->handleError(InvalidValue() << "bufSize cannot be negative.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize);
return false;
}
@@ -3258,8 +3047,7 @@ static bool ValidateSizedGetUniform(Context *context,
size_t requiredBytes = VariableExternalSize(uniform.type);
if (static_cast<size_t>(bufSize) < requiredBytes)
{
- context->handleError(InvalidOperation()
- << "bufSize of at least " << requiredBytes << " is required.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize);
return false;
}
@@ -3351,7 +3139,7 @@ bool ValidateDiscardFramebufferBase(Context *context,
{
if (numAttachments < 0)
{
- context->handleError(InvalidValue() << "numAttachments must not be less than zero");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeAttachments);
return false;
}
@@ -3361,8 +3149,7 @@ bool ValidateDiscardFramebufferBase(Context *context,
{
if (defaultFramebuffer)
{
- context->handleError(InvalidEnum()
- << "Invalid attachment when the default framebuffer is bound");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), DefaultFramebufferInvalidAttachment);
return false;
}
@@ -3383,9 +3170,8 @@ bool ValidateDiscardFramebufferBase(Context *context,
case GL_DEPTH_STENCIL_ATTACHMENT:
if (defaultFramebuffer)
{
- context->handleError(
- InvalidEnum()
- << "Invalid attachment when the default framebuffer is bound");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(),
+ DefaultFramebufferInvalidAttachment);
return false;
}
break;
@@ -3394,14 +3180,13 @@ bool ValidateDiscardFramebufferBase(Context *context,
case GL_STENCIL:
if (!defaultFramebuffer)
{
- context->handleError(
- InvalidEnum()
- << "Invalid attachment when the default framebuffer is not bound");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(),
+ DefaultFramebufferInvalidAttachment);
return false;
}
break;
default:
- context->handleError(InvalidEnum() << "Invalid attachment");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidAttachment);
return false;
}
}
@@ -3519,7 +3304,7 @@ bool ValidateEGLImageTargetRenderbufferStorageOES(Context *context,
break;
default:
- context->handleError(InvalidEnum() << "invalid renderbuffer target.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidRenderbufferTarget);
return false;
}
@@ -3618,10 +3403,14 @@ bool ValidateGetProgramBinaryBase(Context *context,
bool ValidateDrawBuffersBase(ValidationContext *context, GLsizei n, const GLenum *bufs)
{
// INVALID_VALUE is generated if n is negative or greater than value of MAX_DRAW_BUFFERS
- if (n < 0 || static_cast<GLuint>(n) > context->getCaps().maxDrawBuffers)
+ if (n < 0)
{
- context->handleError(InvalidValue()
- << "n must be non-negative and no greater than MAX_DRAW_BUFFERS");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeCount);
+ return false;
+ }
+ if (static_cast<GLuint>(n) > context->getCaps().maxDrawBuffers)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxDrawBuffer);
return false;
}
@@ -3853,7 +3642,8 @@ bool ValidateMapBufferRangeBase(Context *context,
<< "The explicit flushing bit may only be set if the buffer is mapped for writing.");
return false;
}
- return true;
+
+ return ValidateMapBufferBase(context, target);
}
bool ValidateFlushMappedBufferRangeBase(Context *context,
@@ -4058,7 +3848,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
break;
default:
- ANGLE_VALIDATION_ERR(context, InvalidOperation(), FramebufferInvalidAttachment);
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidAttachment);
return false;
}
}
@@ -4085,7 +3875,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
break;
default:
- ANGLE_VALIDATION_ERR(context, InvalidOperation(), FramebufferInvalidAttachment);
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidAttachment);
return false;
}
}
@@ -4128,7 +3918,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
case GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE:
if (attachment == GL_DEPTH_STENCIL_ATTACHMENT)
{
- ANGLE_VALIDATION_ERR(context, InvalidOperation(), FramebufferInvalidAttachment);
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidAttachment);
return false;
}
break;
@@ -4163,7 +3953,7 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
if (clientVersion < 3)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(),
- InvalidRenderbufferTextureParameter);
+ InvalidFramebufferTextureParameter);
return false;
}
break;
@@ -4172,13 +3962,13 @@ bool ValidateGetFramebufferAttachmentParameterivBase(ValidationContext *context,
if (clientVersion < 3)
{
ANGLE_VALIDATION_ERR(context, InvalidEnum(),
- InvalidRenderbufferTextureParameter);
+ InvalidFramebufferTextureParameter);
return false;
}
else
{
ANGLE_VALIDATION_ERR(context, InvalidOperation(),
- InvalidRenderbufferTextureParameter);
+ InvalidFramebufferTextureParameter);
return false;
}
}
@@ -4254,14 +4044,6 @@ bool ValidateGetBufferParameterivRobustANGLE(ValidationContext *context,
return true;
}
-bool ValidateGetBufferParameteri64v(ValidationContext *context,
- GLenum target,
- GLenum pname,
- GLint64 *params)
-{
- return ValidateGetBufferParameterBase(context, target, pname, false, nullptr);
-}
-
bool ValidateGetBufferParameteri64vRobustANGLE(ValidationContext *context,
GLenum target,
GLenum pname,
@@ -4508,11 +4290,6 @@ bool ValidateTexParameterivRobustANGLE(Context *context,
return ValidateTexParameterBase(context, target, pname, bufSize, params);
}
-bool ValidateGetSamplerParameterfv(Context *context, GLuint sampler, GLenum pname, GLfloat *params)
-{
- return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr);
-}
-
bool ValidateGetSamplerParameterfvRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
@@ -4538,11 +4315,6 @@ bool ValidateGetSamplerParameterfvRobustANGLE(Context *context,
return true;
}
-bool ValidateGetSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, GLint *params)
-{
- return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr);
-}
-
bool ValidateGetSamplerParameterivRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
@@ -4568,19 +4340,6 @@ bool ValidateGetSamplerParameterivRobustANGLE(Context *context,
return true;
}
-bool ValidateSamplerParameterf(Context *context, GLuint sampler, GLenum pname, GLfloat param)
-{
- return ValidateSamplerParameterBase(context, sampler, pname, -1, &param);
-}
-
-bool ValidateSamplerParameterfv(Context *context,
- GLuint sampler,
- GLenum pname,
- const GLfloat *params)
-{
- return ValidateSamplerParameterBase(context, sampler, pname, -1, params);
-}
-
bool ValidateSamplerParameterfvRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
@@ -4595,16 +4354,6 @@ bool ValidateSamplerParameterfvRobustANGLE(Context *context,
return ValidateSamplerParameterBase(context, sampler, pname, bufSize, params);
}
-bool ValidateSamplerParameteri(Context *context, GLuint sampler, GLenum pname, GLint param)
-{
- return ValidateSamplerParameterBase(context, sampler, pname, -1, &param);
-}
-
-bool ValidateSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, const GLint *params)
-{
- return ValidateSamplerParameterBase(context, sampler, pname, -1, params);
-}
-
bool ValidateSamplerParameterivRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
@@ -4694,11 +4443,6 @@ bool ValidateGetVertexAttribPointervRobustANGLE(Context *context,
return true;
}
-bool ValidateGetVertexAttribIiv(Context *context, GLuint index, GLenum pname, GLint *params)
-{
- return ValidateGetVertexAttribBase(context, index, pname, nullptr, false, true);
-}
-
bool ValidateGetVertexAttribIivRobustANGLE(Context *context,
GLuint index,
GLenum pname,
@@ -4724,11 +4468,6 @@ bool ValidateGetVertexAttribIivRobustANGLE(Context *context,
return true;
}
-bool ValidateGetVertexAttribIuiv(Context *context, GLuint index, GLenum pname, GLuint *params)
-{
- return ValidateGetVertexAttribBase(context, index, pname, nullptr, false, true);
-}
-
bool ValidateGetVertexAttribIuivRobustANGLE(Context *context,
GLuint index,
GLenum pname,
@@ -4754,15 +4493,6 @@ bool ValidateGetVertexAttribIuivRobustANGLE(Context *context,
return true;
}
-bool ValidateGetActiveUniformBlockiv(Context *context,
- GLuint program,
- GLuint uniformBlockIndex,
- GLenum pname,
- GLint *params)
-{
- return ValidateGetActiveUniformBlockivBase(context, program, uniformBlockIndex, pname, nullptr);
-}
-
bool ValidateGetActiveUniformBlockivRobustANGLE(Context *context,
GLuint program,
GLuint uniformBlockIndex,
@@ -4789,17 +4519,6 @@ bool ValidateGetActiveUniformBlockivRobustANGLE(Context *context,
return true;
}
-bool ValidateGetInternalFormativ(Context *context,
- GLenum target,
- GLenum internalformat,
- GLenum pname,
- GLsizei bufSize,
- GLint *params)
-{
- return ValidateGetInternalFormativBase(context, target, internalformat, pname, bufSize,
- nullptr);
-}
-
bool ValidateGetInternalFormativRobustANGLE(Context *context,
GLenum target,
GLenum internalformat,
@@ -4835,7 +4554,7 @@ bool ValidateVertexFormatBase(ValidationContext *context,
const Caps &caps = context->getCaps();
if (attribIndex >= caps.maxVertexAttributes)
{
- ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax);
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false;
}
@@ -5260,7 +4979,7 @@ bool ValidateGetVertexAttribBase(Context *context,
if (index >= context->getCaps().maxVertexAttributes)
{
- ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax);
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false;
}
@@ -5390,7 +5109,7 @@ bool ValidateReadPixelsBase(Context *context,
if (framebuffer->getReadBufferState() == GL_NONE)
{
- context->handleError(InvalidOperation() << "Read buffer is GL_NONE");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ReadBufferNone);
return false;
}
@@ -5405,6 +5124,16 @@ bool ValidateReadPixelsBase(Context *context,
return false;
}
+ // ANGLE_multiview, Revision 1:
+ // ReadPixels generates an INVALID_FRAMEBUFFER_OPERATION error if the multi-view layout of the
+ // current read framebuffer is not NONE.
+ if (readBuffer->getMultiviewLayout() != GL_NONE)
+ {
+ context->handleError(InvalidFramebufferOperation()
+ << "Attempting to read from a multi-view framebuffer.");
+ return false;
+ }
+
if (context->getExtensions().webglCompatibility)
{
// The ES 2.0 spec states that the format must be "among those defined in table 3.4,
@@ -5416,13 +5145,13 @@ bool ValidateReadPixelsBase(Context *context,
// dEQP/WebGL.
if (!ValidReadPixelsFormatEnum(context, format))
{
- context->handleError(InvalidEnum() << "Invalid read format.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFormat);
return false;
}
if (!ValidReadPixelsTypeEnum(context, type))
{
- context->handleError(InvalidEnum() << "Invalid read type.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidType);
return false;
}
}
@@ -5467,8 +5196,7 @@ bool ValidateReadPixelsBase(Context *context,
{
if (pixelPackBuffer == nullptr && static_cast<size_t>(bufSize) < endByte)
{
- context->handleError(InvalidOperation()
- << "bufSize must be at least " << endByte << " bytes.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize);
return false;
}
}
@@ -5576,7 +5304,7 @@ bool ValidateTexParameterBase(Context *context,
case GL_TEXTURE_MAX_LOD:
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidEnum() << "pname requires OpenGL ES 3.0.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), ES3Required);
return false;
}
if (target == GL_TEXTURE_EXTERNAL_OES &&
@@ -5617,16 +5345,24 @@ bool ValidateTexParameterBase(Context *context,
case GL_TEXTURE_WRAP_S:
case GL_TEXTURE_WRAP_T:
case GL_TEXTURE_WRAP_R:
- if (!ValidateTextureWrapModeValue(context, params, target == GL_TEXTURE_EXTERNAL_OES))
{
- return false;
+ bool restrictedWrapModes =
+ target == GL_TEXTURE_EXTERNAL_OES || target == GL_TEXTURE_RECTANGLE_ANGLE;
+ if (!ValidateTextureWrapModeValue(context, params, restrictedWrapModes))
+ {
+ return false;
+ }
}
break;
case GL_TEXTURE_MIN_FILTER:
- if (!ValidateTextureMinFilterValue(context, params, target == GL_TEXTURE_EXTERNAL_OES))
{
- return false;
+ bool restrictedMinFilter =
+ target == GL_TEXTURE_EXTERNAL_OES || target == GL_TEXTURE_RECTANGLE_ANGLE;
+ if (!ValidateTextureMinFilterValue(context, params, restrictedMinFilter))
+ {
+ return false;
+ }
}
break;
@@ -5722,6 +5458,12 @@ bool ValidateTexParameterBase(Context *context,
<< "Base level must be 0 for multisampled textures.");
return false;
}
+ if (target == GL_TEXTURE_RECTANGLE_ANGLE && static_cast<GLuint>(params[0]) != 0)
+ {
+ context->handleError(InvalidOperation()
+ << "Base level must be 0 for rectangle textures.");
+ return false;
+ }
break;
case GL_TEXTURE_MAX_LEVEL:
@@ -5768,4 +5510,296 @@ bool ValidateTexParameterBase(Context *context,
template bool ValidateTexParameterBase(Context *, GLenum, GLenum, GLsizei, const GLfloat *);
template bool ValidateTexParameterBase(Context *, GLenum, GLenum, GLsizei, const GLint *);
+bool ValidateVertexAttribIndex(ValidationContext *context, GLuint index)
+{
+ if (index >= MAX_VERTEX_ATTRIBS)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetActiveUniformBlockivBase(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLenum pname,
+ GLsizei *length)
+{
+ if (length)
+ {
+ *length = 0;
+ }
+
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
+ {
+ context->handleError(InvalidValue()
+ << "uniformBlockIndex exceeds active uniform block count.");
+ return false;
+ }
+
+ switch (pname)
+ {
+ case GL_UNIFORM_BLOCK_BINDING:
+ case GL_UNIFORM_BLOCK_DATA_SIZE:
+ case GL_UNIFORM_BLOCK_NAME_LENGTH:
+ case GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS:
+ case GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES:
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER:
+ case GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER:
+ break;
+
+ default:
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
+ return false;
+ }
+
+ if (length)
+ {
+ if (pname == GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES)
+ {
+ const UniformBlock &uniformBlock =
+ programObject->getUniformBlockByIndex(uniformBlockIndex);
+ *length = static_cast<GLsizei>(uniformBlock.memberIndexes.size());
+ }
+ else
+ {
+ *length = 1;
+ }
+ }
+
+ return true;
+}
+
+template <typename ParamType>
+bool ValidateSamplerParameterBase(Context *context,
+ GLuint sampler,
+ GLenum pname,
+ GLsizei bufSize,
+ ParamType *params)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (!context->isSampler(sampler))
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidSampler);
+ return false;
+ }
+
+ const GLsizei minBufSize = 1;
+ if (bufSize >= 0 && bufSize < minBufSize)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InsufficientBufferSize);
+ return false;
+ }
+
+ switch (pname)
+ {
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ if (!ValidateTextureWrapModeValue(context, params, false))
+ {
+ return false;
+ }
+ break;
+
+ case GL_TEXTURE_MIN_FILTER:
+ if (!ValidateTextureMinFilterValue(context, params, false))
+ {
+ return false;
+ }
+ break;
+
+ case GL_TEXTURE_MAG_FILTER:
+ if (!ValidateTextureMagFilterValue(context, params))
+ {
+ return false;
+ }
+ break;
+
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ // any value is permissible
+ break;
+
+ case GL_TEXTURE_COMPARE_MODE:
+ if (!ValidateTextureCompareModeValue(context, params))
+ {
+ return false;
+ }
+ break;
+
+ case GL_TEXTURE_COMPARE_FUNC:
+ if (!ValidateTextureCompareFuncValue(context, params))
+ {
+ return false;
+ }
+ break;
+
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ if (!ValidateTextureSRGBDecodeValue(context, params))
+ {
+ return false;
+ }
+ break;
+
+ default:
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
+ return false;
+ }
+
+ return true;
+}
+
+template bool ValidateSamplerParameterBase(Context *, GLuint, GLenum, GLsizei, GLfloat *);
+template bool ValidateSamplerParameterBase(Context *, GLuint, GLenum, GLsizei, GLint *);
+
+bool ValidateGetSamplerParameterBase(Context *context,
+ GLuint sampler,
+ GLenum pname,
+ GLsizei *length)
+{
+ if (length)
+ {
+ *length = 0;
+ }
+
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (!context->isSampler(sampler))
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), InvalidSampler);
+ return false;
+ }
+
+ switch (pname)
+ {
+ case GL_TEXTURE_WRAP_S:
+ case GL_TEXTURE_WRAP_T:
+ case GL_TEXTURE_WRAP_R:
+ case GL_TEXTURE_MIN_FILTER:
+ case GL_TEXTURE_MAG_FILTER:
+ case GL_TEXTURE_MIN_LOD:
+ case GL_TEXTURE_MAX_LOD:
+ case GL_TEXTURE_COMPARE_MODE:
+ case GL_TEXTURE_COMPARE_FUNC:
+ break;
+
+ case GL_TEXTURE_SRGB_DECODE_EXT:
+ if (!context->getExtensions().textureSRGBDecode)
+ {
+ context->handleError(InvalidEnum() << "GL_EXT_texture_sRGB_decode is not enabled.");
+ return false;
+ }
+ break;
+
+ default:
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
+ return false;
+ }
+
+ if (length)
+ {
+ *length = 1;
+ }
+ return true;
+}
+
+bool ValidateGetInternalFormativBase(Context *context,
+ GLenum target,
+ GLenum internalformat,
+ GLenum pname,
+ GLsizei bufSize,
+ GLsizei *numParams)
+{
+ if (numParams)
+ {
+ *numParams = 0;
+ }
+
+ if (context->getClientMajorVersion() < 3)
+ {
+ context->handleError(InvalidOperation() << "Context does not support OpenGL ES 3.0.");
+ return false;
+ }
+
+ const TextureCaps &formatCaps = context->getTextureCaps().get(internalformat);
+ if (!formatCaps.renderable)
+ {
+ context->handleError(InvalidEnum() << "Internal format is not renderable.");
+ return false;
+ }
+
+ switch (target)
+ {
+ case GL_RENDERBUFFER:
+ break;
+
+ case GL_TEXTURE_2D_MULTISAMPLE:
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(InvalidOperation()
+ << "Texture target requires at least OpenGL ES 3.1.");
+ return false;
+ }
+ break;
+
+ default:
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTarget);
+ return false;
+ }
+
+ if (bufSize < 0)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InsufficientBufferSize);
+ return false;
+ }
+
+ GLsizei maxWriteParams = 0;
+ switch (pname)
+ {
+ case GL_NUM_SAMPLE_COUNTS:
+ maxWriteParams = 1;
+ break;
+
+ case GL_SAMPLES:
+ maxWriteParams = static_cast<GLsizei>(formatCaps.sampleCounts.size());
+ break;
+
+ default:
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), EnumNotSupported);
+ return false;
+ }
+
+ if (numParams)
+ {
+ // glGetInternalFormativ will not overflow bufSize
+ *numParams = std::min(bufSize, maxWriteParams);
+ }
+
+ 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 b041d6c4dc7..9041f44346c 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES.h
@@ -160,8 +160,9 @@ bool ValidateReadnPixelsRobustANGLE(Context *context,
GLsizei *rows,
void *data);
-bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n);
-bool ValidateDeleteQueriesEXT(gl::Context *context, GLsizei n);
+bool ValidateGenQueriesEXT(gl::Context *context, GLsizei n, GLuint *ids);
+bool ValidateDeleteQueriesEXT(gl::Context *context, GLsizei n, const GLuint *ids);
+bool ValidateIsQueryEXT(gl::Context *context, GLuint id);
bool ValidateBeginQueryBase(Context *context, GLenum target, GLuint id);
bool ValidateBeginQueryEXT(Context *context, GLenum target, GLuint id);
bool ValidateEndQueryBase(Context *context, GLenum target);
@@ -264,11 +265,11 @@ bool ValidateDrawArraysCommon(ValidationContext *context,
GLint first,
GLsizei count,
GLsizei primcount);
-bool ValidateDrawArraysInstanced(Context *context,
- GLenum mode,
- GLint first,
- GLsizei count,
- GLsizei primcount);
+bool ValidateDrawArraysInstancedBase(Context *context,
+ GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei primcount);
bool ValidateDrawArraysInstancedANGLE(Context *context,
GLenum mode,
GLint first,
@@ -409,10 +410,6 @@ bool ValidateGetBufferParameterivRobustANGLE(ValidationContext *context,
GLsizei *length,
GLint *params);
-bool ValidateGetBufferParameteri64v(ValidationContext *context,
- GLenum target,
- GLenum pname,
- GLint64 *params);
bool ValidateGetBufferParameteri64vRobustANGLE(ValidationContext *context,
GLenum target,
GLenum pname,
@@ -480,14 +477,12 @@ bool ValidateTexParameterivRobustANGLE(Context *context,
GLsizei bufSize,
const GLint *params);
-bool ValidateGetSamplerParameterfv(Context *context, GLuint sampler, GLenum pname, GLfloat *params);
bool ValidateGetSamplerParameterfvRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
GLuint bufSize,
GLsizei *length,
GLfloat *params);
-bool ValidateGetSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, GLint *params);
bool ValidateGetSamplerParameterivRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
@@ -495,21 +490,11 @@ bool ValidateGetSamplerParameterivRobustANGLE(Context *context,
GLsizei *length,
GLint *params);
-bool ValidateSamplerParameterf(Context *context, GLuint sampler, GLenum pname, GLfloat param);
-bool ValidateSamplerParameterfv(Context *context,
- GLuint sampler,
- GLenum pname,
- const GLfloat *params);
bool ValidateSamplerParameterfvRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
GLsizei bufSize,
const GLfloat *params);
-bool ValidateSamplerParameteri(Context *context, GLuint sampler, GLenum pname, GLint param);
-bool ValidateSamplerParameteriv(Context *context,
- GLuint sampler,
- GLenum pname,
- const GLint *params);
bool ValidateSamplerParameterivRobustANGLE(Context *context,
GLuint sampler,
GLenum pname,
@@ -543,7 +528,6 @@ bool ValidateGetVertexAttribPointervRobustANGLE(Context *context,
GLsizei *length,
void **pointer);
-bool ValidateGetVertexAttribIiv(Context *context, GLuint index, GLenum pname, GLint *params);
bool ValidateGetVertexAttribIivRobustANGLE(Context *context,
GLuint index,
GLenum pname,
@@ -551,7 +535,6 @@ bool ValidateGetVertexAttribIivRobustANGLE(Context *context,
GLsizei *length,
GLint *params);
-bool ValidateGetVertexAttribIuiv(Context *context, GLuint index, GLenum pname, GLuint *params);
bool ValidateGetVertexAttribIuivRobustANGLE(Context *context,
GLuint index,
GLenum pname,
@@ -559,11 +542,6 @@ bool ValidateGetVertexAttribIuivRobustANGLE(Context *context,
GLsizei *length,
GLuint *params);
-bool ValidateGetActiveUniformBlockiv(Context *context,
- GLuint program,
- GLuint uniformBlockIndex,
- GLenum pname,
- GLint *params);
bool ValidateGetActiveUniformBlockivRobustANGLE(Context *context,
GLuint program,
GLuint uniformBlockIndex,
@@ -572,13 +550,6 @@ bool ValidateGetActiveUniformBlockivRobustANGLE(Context *context,
GLsizei *length,
GLint *params);
-bool ValidateGetInternalFormativ(Context *context,
- GLenum target,
- GLenum internalformat,
- GLenum pname,
- GLsizei bufSize,
- GLint *params);
-
bool ValidateGetInternalFormativRobustANGLE(Context *context,
GLenum target,
GLenum internalformat,
@@ -602,6 +573,33 @@ bool ValidateRobustCompressedTexImageBase(ValidationContext *context,
GLsizei imageSize,
GLsizei dataSize);
+bool ValidateVertexAttribIndex(ValidationContext *context, GLuint index);
+
+bool ValidateGetActiveUniformBlockivBase(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLenum pname,
+ GLsizei *length);
+
+bool ValidateGetSamplerParameterBase(Context *context,
+ GLuint sampler,
+ GLenum pname,
+ GLsizei *length);
+
+template <typename ParamType>
+bool ValidateSamplerParameterBase(Context *context,
+ GLuint sampler,
+ GLenum pname,
+ GLsizei bufSize,
+ ParamType *params);
+
+bool ValidateGetInternalFormativBase(Context *context,
+ GLenum target,
+ GLenum internalformat,
+ GLenum pname,
+ GLsizei bufSize,
+ GLsizei *numParams);
+
} // namespace gl
#endif // LIBANGLE_VALIDATION_ES_H_
diff --git a/chromium/third_party/angle/src/libANGLE/validationES2.cpp b/chromium/third_party/angle/src/libANGLE/validationES2.cpp
index e8173902361..10209334c99 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES2.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES2.cpp
@@ -76,7 +76,7 @@ bool ValidatePathInstances(gl::Context *context,
const GLuint pathName = array[i] + pathBase;
if (context->hasPath(pathName) && !context->hasPathData(pathName))
{
- context->handleError(InvalidOperation() << "No such path object.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false;
}
}
@@ -290,6 +290,13 @@ bool IsValidCopyTextureDestinationFormatType(Context *context, GLint internalFor
return false;
}
+ if (!ValidES3FormatCombination(GetUnsizedFormat(internalFormat), type, internalFormat))
+ {
+ context->handleError(InvalidOperation()
+ << "Invalid combination of type and internalFormat.");
+ return false;
+ }
+
const InternalFormat &internalFormatInfo = GetInternalFormatInfo(internalFormat, type);
if (!internalFormatInfo.textureSupport(context->getClientVersion(), context->getExtensions()))
{
@@ -314,8 +321,9 @@ bool IsValidCopyTextureDestinationTarget(Context *context, GLenum textureType, G
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
return textureType == GL_TEXTURE_CUBE_MAP;
- // TODO(geofflang): accept GL_TEXTURE_RECTANGLE_ARB if the texture_rectangle extension is
- // supported
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ return textureType == GL_TEXTURE_RECTANGLE_ANGLE &&
+ context->getExtensions().textureRectangle;
default:
return false;
@@ -328,9 +336,8 @@ bool IsValidCopyTextureSourceTarget(Context *context, GLenum target)
{
case GL_TEXTURE_2D:
return true;
-
- // TODO(geofflang): accept GL_TEXTURE_RECTANGLE_ARB if the texture_rectangle extension is
- // supported
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ return context->getExtensions().textureRectangle;
// TODO(geofflang): accept GL_TEXTURE_EXTERNAL_OES if the texture_external extension is
// supported
@@ -375,6 +382,15 @@ bool IsValidCopyTextureDestinationLevel(Context *context,
return false;
}
}
+ else if (target == GL_TEXTURE_RECTANGLE_ANGLE)
+ {
+ ASSERT(level == 0);
+ if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
+ static_cast<GLuint>(height) > caps.maxRectangleTextureSize)
+ {
+ return false;
+ }
+ }
else if (IsCubeMapTextureTarget(target))
{
if (static_cast<GLuint>(width) > (caps.maxCubeMapTextureSize >> level) ||
@@ -782,11 +798,11 @@ bool ValidCap(const Context *context, GLenum cap, bool queryOnly)
// Return true if a character belongs to the ASCII subset as defined in GLSL ES 1.0 spec section
// 3.1.
-bool IsValidESSLCharacter(unsigned char c, bool allowBackslash)
+bool IsValidESSLCharacter(unsigned char c)
{
// Printing characters are valid except " $ ` @ \ ' DEL.
- if (c >= 32 && c <= 126 && c != '"' && c != '$' && c != '`' && c != '@' &&
- (allowBackslash || c != '\\') && c != '\'')
+ if (c >= 32 && c <= 126 && c != '"' && c != '$' && c != '`' && c != '@' && c != '\\' &&
+ c != '\'')
{
return true;
}
@@ -800,11 +816,11 @@ bool IsValidESSLCharacter(unsigned char c, bool allowBackslash)
return false;
}
-bool IsValidESSLString(const char *str, size_t len, bool allowBackslash)
+bool IsValidESSLString(const char *str, size_t len)
{
for (size_t i = 0; i < len; i++)
{
- if (!IsValidESSLCharacter(str[i], allowBackslash))
+ if (!IsValidESSLCharacter(str[i]))
{
return false;
}
@@ -813,6 +829,165 @@ bool IsValidESSLString(const char *str, size_t len, bool allowBackslash)
return true;
}
+bool IsValidESSLShaderSourceString(const char *str, size_t len, bool lineContinuationAllowed)
+{
+ enum class ParseState
+ {
+ // Have not seen an ASCII non-whitespace character yet on
+ // this line. Possible that we might see a preprocessor
+ // directive.
+ BEGINING_OF_LINE,
+
+ // Have seen at least one ASCII non-whitespace character
+ // on this line.
+ MIDDLE_OF_LINE,
+
+ // Handling a preprocessor directive. Passes through all
+ // characters up to the end of the line. Disables comment
+ // processing.
+ IN_PREPROCESSOR_DIRECTIVE,
+
+ // Handling a single-line comment. The comment text is
+ // replaced with a single space.
+ IN_SINGLE_LINE_COMMENT,
+
+ // Handling a multi-line comment. Newlines are passed
+ // through to preserve line numbers.
+ IN_MULTI_LINE_COMMENT
+ };
+
+ ParseState state = ParseState::BEGINING_OF_LINE;
+ size_t pos = 0;
+
+ while (pos < len)
+ {
+ char c = str[pos];
+ char next = pos + 1 < len ? str[pos + 1] : 0;
+
+ // Check for newlines
+ if (c == '\n' || c == '\r')
+ {
+ if (state != ParseState::IN_MULTI_LINE_COMMENT)
+ {
+ state = ParseState::BEGINING_OF_LINE;
+ }
+
+ pos++;
+ continue;
+ }
+
+ switch (state)
+ {
+ case ParseState::BEGINING_OF_LINE:
+ if (c == ' ')
+ {
+ // Maintain the BEGINING_OF_LINE state until a non-space is seen
+ pos++;
+ }
+ else if (c == '#')
+ {
+ state = ParseState::IN_PREPROCESSOR_DIRECTIVE;
+ pos++;
+ }
+ else
+ {
+ // Don't advance, re-process this character with the MIDDLE_OF_LINE state
+ state = ParseState::MIDDLE_OF_LINE;
+ }
+ break;
+
+ case ParseState::MIDDLE_OF_LINE:
+ if (c == '/' && next == '/')
+ {
+ state = ParseState::IN_SINGLE_LINE_COMMENT;
+ pos++;
+ }
+ else if (c == '/' && next == '*')
+ {
+ state = ParseState::IN_MULTI_LINE_COMMENT;
+ pos++;
+ }
+ else if (lineContinuationAllowed && c == '\\' && (next == '\n' || next == '\r'))
+ {
+ // Skip line continuation characters
+ }
+ else if (!IsValidESSLCharacter(c))
+ {
+ return false;
+ }
+ pos++;
+ break;
+
+ case ParseState::IN_PREPROCESSOR_DIRECTIVE:
+ // No matter what the character is, just pass it
+ // through. Do not parse comments in this state.
+ pos++;
+ break;
+
+ case ParseState::IN_SINGLE_LINE_COMMENT:
+ // Line-continuation characters are processed before comment processing.
+ // Advance string if a new line character is immediately behind
+ // line-continuation character.
+ if (c == '\\' && (next == '\n' || next == '\r'))
+ {
+ pos++;
+ }
+ pos++;
+ break;
+
+ case ParseState::IN_MULTI_LINE_COMMENT:
+ if (c == '*' && next == '/')
+ {
+ state = ParseState::MIDDLE_OF_LINE;
+ pos++;
+ }
+ pos++;
+ break;
+ }
+ }
+
+ return true;
+}
+
+bool ValidateWebGLNamePrefix(ValidationContext *context, const GLchar *name)
+{
+ ASSERT(context->isWebGL());
+
+ // WebGL 1.0 [Section 6.16] GLSL Constructs
+ // Identifiers starting with "webgl_" and "_webgl_" are reserved for use by WebGL.
+ if (strncmp(name, "webgl_", 6) == 0 || strncmp(name, "_webgl_", 7) == 0)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), WebglBindAttribLocationReservedPrefix);
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateWebGLNameLength(ValidationContext *context, size_t length)
+{
+ ASSERT(context->isWebGL());
+
+ if (context->isWebGL1() && length > 256)
+ {
+ // WebGL 1.0 [Section 6.21] Maxmimum Uniform and Attribute Location Lengths
+ // WebGL imposes a limit of 256 characters on the lengths of uniform and attribute
+ // locations.
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), WebglNameLengthLimitExceeded);
+
+ return false;
+ }
+ else if (length > 1024)
+ {
+ // WebGL 2.0 [Section 4.3.2] WebGL 2.0 imposes a limit of 1024 characters on the lengths of
+ // uniform and attribute locations.
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), Webgl2NameLengthLimitExceeded);
+ return false;
+ }
+
+ return true;
+}
+
} // anonymous namespace
bool ValidateES2TexImageParameters(Context *context,
@@ -882,6 +1057,22 @@ bool ValidateES2TexImageParameters(Context *context,
return false;
}
}
+ else if (target == GL_TEXTURE_RECTANGLE_ANGLE)
+ {
+ ASSERT(level == 0);
+ if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
+ static_cast<GLuint>(height) > caps.maxRectangleTextureSize)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ if (isCompressed)
+ {
+ context->handleError(InvalidEnum()
+ << "Rectangle texture cannot have a compressed format.");
+ return false;
+ }
+ }
else if (IsCubeMapTextureTarget(target))
{
if (!isSubImage && width != height)
@@ -925,7 +1116,7 @@ bool ValidateES2TexImageParameters(Context *context,
if (GetInternalFormatInfo(format, type).sizedInternalFormat !=
textureInternalFormat.sizedInternalFormat)
{
- ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMustMatchOriginalType);
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMismatch);
return false;
}
}
@@ -1261,14 +1452,19 @@ bool ValidateES2TexImageParameters(Context *context,
}
if (target != GL_TEXTURE_2D)
{
- context->handleError(InvalidOperation());
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), MismatchedTargetAndFormat);
return false;
}
// OES_depth_texture supports loading depth data and multiple levels,
// but ANGLE_depth_texture does not
- if (pixels != nullptr || level != 0)
+ if (pixels != nullptr)
{
- context->handleError(InvalidOperation());
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), PixelDataNotNull);
+ return false;
+ }
+ if (level != 0)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), LevelNotZero);
return false;
}
break;
@@ -1360,7 +1556,8 @@ bool ValidateES2TexStorageParameters(Context *context,
GLsizei width,
GLsizei height)
{
- if (target != GL_TEXTURE_2D && target != GL_TEXTURE_CUBE_MAP)
+ if (target != GL_TEXTURE_2D && target != GL_TEXTURE_CUBE_MAP &&
+ target != GL_TEXTURE_RECTANGLE_ANGLE)
{
context->handleError(InvalidEnum());
return false;
@@ -1403,6 +1600,20 @@ bool ValidateES2TexStorageParameters(Context *context,
return false;
}
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
+ static_cast<GLuint>(height) > caps.maxRectangleTextureSize || levels != 1)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ if (formatInfo.compressed)
+ {
+ context->handleError(InvalidEnum()
+ << "Rectangle texture cannot have a compressed format.");
+ return false;
+ }
+ break;
case GL_TEXTURE_CUBE_MAP:
if (static_cast<GLuint>(width) > caps.maxCubeMapTextureSize ||
static_cast<GLuint>(height) > caps.maxCubeMapTextureSize)
@@ -1593,7 +1804,7 @@ bool ValidateBindVertexArrayOES(Context *context, GLuint array)
return ValidateBindVertexArrayBase(context, array);
}
-bool ValidateDeleteVertexArraysOES(Context *context, GLsizei n)
+bool ValidateDeleteVertexArraysOES(Context *context, GLsizei n, const GLuint *arrays)
{
if (!context->getExtensions().vertexArrayObject)
{
@@ -1604,7 +1815,7 @@ bool ValidateDeleteVertexArraysOES(Context *context, GLsizei n)
return ValidateGenOrDelete(context, n);
}
-bool ValidateGenVertexArraysOES(Context *context, GLsizei n)
+bool ValidateGenVertexArraysOES(Context *context, GLsizei n, GLuint *arrays)
{
if (!context->getExtensions().vertexArrayObject)
{
@@ -1615,7 +1826,7 @@ bool ValidateGenVertexArraysOES(Context *context, GLsizei n)
return ValidateGenOrDelete(context, n);
}
-bool ValidateIsVertexArrayOES(Context *context)
+bool ValidateIsVertexArrayOES(Context *context, GLuint array)
{
if (!context->getExtensions().vertexArrayObject)
{
@@ -1728,19 +1939,19 @@ bool ValidateDebugMessageControlKHR(Context *context,
if (!ValidDebugSource(source, false) && source != GL_DONT_CARE)
{
- context->handleError(InvalidEnum() << "Invalid debug source.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false;
}
if (!ValidDebugType(type) && type != GL_DONT_CARE)
{
- context->handleError(InvalidEnum() << "Invalid debug type.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugType);
return false;
}
if (!ValidDebugSeverity(severity) && severity != GL_DONT_CARE)
{
- context->handleError(InvalidEnum() << "Invalid debug severity.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSeverity);
return false;
}
@@ -1789,19 +2000,19 @@ bool ValidateDebugMessageInsertKHR(Context *context,
if (!ValidDebugSeverity(severity))
{
- context->handleError(InvalidEnum() << "Invalid debug severity.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false;
}
if (!ValidDebugType(type))
{
- context->handleError(InvalidEnum() << "Invalid debug type.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugType);
return false;
}
if (!ValidDebugSource(source, true))
{
- context->handleError(InvalidEnum() << "Invalid debug source.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false;
}
@@ -1868,7 +2079,7 @@ bool ValidatePushDebugGroupKHR(Context *context,
if (!ValidDebugSource(source, true))
{
- context->handleError(InvalidEnum() << "Invalid debug source.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidDebugSource);
return false;
}
@@ -2079,7 +2290,7 @@ bool ValidateGetObjectLabelKHR(Context *context,
static bool ValidateObjectPtrName(Context *context, const void *ptr)
{
- if (context->getFenceSync(reinterpret_cast<GLsync>(const_cast<void *>(ptr))) == nullptr)
+ if (context->getSync(reinterpret_cast<GLsync>(const_cast<void *>(ptr))) == nullptr)
{
context->handleError(InvalidValue() << "name is not a valid sync.");
return false;
@@ -2230,8 +2441,8 @@ bool ValidateBlitFramebufferANGLE(Context *context,
}
// Return an error if the destination formats do not match
- if (!Format::SameSized(attachment->getFormat(),
- readColorAttachment->getFormat()))
+ if (!Format::EquivalentForBlit(attachment->getFormat(),
+ readColorAttachment->getFormat()))
{
context->handleError(InvalidOperation());
return false;
@@ -2477,7 +2688,13 @@ bool ValidateCompressedTexImage2D(Context *context,
if (imageSize < 0 || static_cast<GLuint>(imageSize) != blockSizeOrErr.getResult())
{
- context->handleError(InvalidValue());
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), CompressedTextureDimensionsMustMatchData);
+ return false;
+ }
+
+ if (target == GL_TEXTURE_RECTANGLE_ANGLE)
+ {
+ context->handleError(InvalidEnum() << "Rectangle texture cannot have a compressed format.");
return false;
}
@@ -2611,7 +2828,7 @@ bool ValidateMapBufferOES(Context *context, GLenum target, GLenum access)
return false;
}
- return true;
+ return ValidateMapBufferBase(context, target);
}
bool ValidateUnmapBufferOES(Context *context, GLenum target)
@@ -2640,6 +2857,30 @@ bool ValidateMapBufferRangeEXT(Context *context,
return ValidateMapBufferRangeBase(context, target, offset, length, access);
}
+bool ValidateMapBufferBase(Context *context, GLenum target)
+{
+ Buffer *buffer = context->getGLState().getTargetBuffer(target);
+ ASSERT(buffer != nullptr);
+
+ // Check if this buffer is currently being used as a transform feedback output buffer
+ TransformFeedback *transformFeedback = context->getGLState().getCurrentTransformFeedback();
+ if (transformFeedback != nullptr && transformFeedback->isActive())
+ {
+ for (size_t i = 0; i < transformFeedback->getIndexedBufferCount(); i++)
+ {
+ const auto &transformFeedbackBuffer = transformFeedback->getIndexedBuffer(i);
+ if (transformFeedbackBuffer.get() == buffer)
+ {
+ context->handleError(InvalidOperation()
+ << "Buffer is currently bound for transform feedback.");
+ return false;
+ }
+ }
+ }
+
+ return true;
+}
+
bool ValidateFlushMappedBufferRangeEXT(Context *context,
GLenum target,
GLintptr offset,
@@ -2659,7 +2900,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture)
Texture *textureObject = context->getTexture(texture);
if (textureObject && textureObject->getTarget() != target && texture != 0)
{
- ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMustMatchOriginalType);
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), TypeMismatch);
return false;
}
@@ -2676,11 +2917,20 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture)
case GL_TEXTURE_CUBE_MAP:
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ if (!context->getExtensions().textureRectangle)
+ {
+ context->handleError(InvalidEnum()
+ << "Context does not support GL_ANGLE_texture_rectangle");
+ return false;
+ }
+ break;
+
case GL_TEXTURE_3D:
case GL_TEXTURE_2D_ARRAY:
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidEnum() << "GLES 3.0 disabled");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), ES3Required);
return false;
}
break;
@@ -2688,7 +2938,7 @@ bool ValidateBindTexture(Context *context, GLenum target, GLuint texture)
case GL_TEXTURE_2D_MULTISAMPLE:
if (context->getClientVersion() < Version(3, 1))
{
- context->handleError(InvalidEnum() << "Context does not support GLES3.1");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), ES31Required);
return false;
}
break;
@@ -2745,8 +2995,7 @@ bool ValidateBindUniformLocationCHROMIUM(Context *context,
// The WebGL spec (section 6.20) disallows strings containing invalid ESSL characters for
// shader-related entry points
- if (context->getExtensions().webglCompatibility &&
- !IsValidESSLString(name, strlen(name), false))
+ if (context->getExtensions().webglCompatibility && !IsValidESSLString(name, strlen(name)))
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidNameCharacters);
return false;
@@ -2797,7 +3046,7 @@ bool ValidateMatrix(Context *context, GLenum matrixMode, const GLfloat *matrix)
}
if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM)
{
- context->handleError(InvalidEnum() << "Invalid matrix mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
return false;
}
if (matrix == nullptr)
@@ -2817,7 +3066,7 @@ bool ValidateMatrixMode(Context *context, GLenum matrixMode)
}
if (matrixMode != GL_PATH_MODELVIEW_CHROMIUM && matrixMode != GL_PATH_PROJECTION_CHROMIUM)
{
- context->handleError(InvalidEnum() << "Invalid matrix mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidMatrixMode);
return false;
}
return true;
@@ -2835,7 +3084,7 @@ bool ValidateGenPaths(Context *context, GLsizei range)
// we add stricter semantic check here and require a non zero positive range.
if (range <= 0)
{
- context->handleError(InvalidValue() << "Invalid range.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidRange);
return false;
}
@@ -2860,7 +3109,7 @@ bool ValidateDeletePaths(Context *context, GLuint path, GLsizei range)
// we add stricter semantic check here and require a non zero positive range.
if (range <= 0)
{
- context->handleError(InvalidValue() << "Invalid range.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidRange);
return false;
}
@@ -2890,7 +3139,7 @@ bool ValidatePathCommands(Context *context,
}
if (!context->hasPath(path))
{
- context->handleError(InvalidOperation() << "No such path object.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false;
}
@@ -3005,7 +3254,7 @@ bool ValidateSetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
}
if (!context->hasPath(path))
{
- context->handleError(InvalidOperation() << "No such path object.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false;
}
@@ -3070,7 +3319,7 @@ bool ValidateGetPathParameter(Context *context, GLuint path, GLenum pname, GLflo
if (!context->hasPath(path))
{
- context->handleError(InvalidOperation() << "No such path object.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false;
}
if (!value)
@@ -3138,7 +3387,7 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu
}
if (context->hasPath(path) && !context->hasPathData(path))
{
- context->handleError(InvalidOperation() << "No such path object.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false;
}
@@ -3148,13 +3397,13 @@ bool ValidateStencilFillPath(Context *context, GLuint path, GLenum fillMode, GLu
case GL_COUNT_DOWN_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid fill mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFillMode);
return false;
}
if (!isPow2(mask + 1))
{
- context->handleError(InvalidValue() << "Invalid stencil bit mask.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidStencilBitMask);
return false;
}
@@ -3186,7 +3435,7 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode)
}
if (context->hasPath(path) && !context->hasPathData(path))
{
- context->handleError(InvalidOperation() << "No such path object.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NoSuchPath);
return false;
}
@@ -3196,7 +3445,7 @@ bool ValidateCoverPath(Context *context, GLuint path, GLenum coverMode)
case GL_BOUNDING_BOX_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid cover mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false;
}
return true;
@@ -3252,7 +3501,7 @@ bool ValidateCoverFillPathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid cover mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false;
}
@@ -3279,7 +3528,7 @@ bool ValidateCoverStrokePathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid cover mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false;
}
@@ -3307,12 +3556,12 @@ bool ValidateStencilFillPathInstanced(Context *context,
case GL_COUNT_DOWN_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid fill mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFillMode);
return false;
}
if (!isPow2(mask + 1))
{
- context->handleError(InvalidValue() << "Invalid stencil bit mask.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidStencilBitMask);
return false;
}
return true;
@@ -3359,7 +3608,7 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid cover mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false;
}
@@ -3369,12 +3618,12 @@ bool ValidateStencilThenCoverFillPathInstanced(Context *context,
case GL_COUNT_DOWN_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid fill mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFillMode);
return false;
}
if (!isPow2(mask + 1))
{
- context->handleError(InvalidValue() << "Invalid stencil bit mask.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidStencilBitMask);
return false;
}
@@ -3403,7 +3652,7 @@ bool ValidateStencilThenCoverStrokePathInstanced(Context *context,
case GL_BOUNDING_BOX_OF_BOUNDING_BOXES_CHROMIUM:
break;
default:
- context->handleError(InvalidEnum() << "Invalid cover mode.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidCoverMode);
return false;
}
@@ -3443,7 +3692,7 @@ bool ValidateBindFragmentInputLocation(Context *context,
if (angle::BeginsWith(name, "gl_"))
{
- context->handleError(InvalidOperation() << "Cannot bind a built-in variable.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), NameBeginsWithGL);
return false;
}
@@ -4064,7 +4313,7 @@ bool ValidateBindAttribLocation(ValidationContext *context,
{
if (index >= MAX_VERTEX_ATTRIBS)
{
- ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax);
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false;
}
@@ -4074,13 +4323,22 @@ bool ValidateBindAttribLocation(ValidationContext *context,
return false;
}
- // The WebGL spec (section 6.20) disallows strings containing invalid ESSL characters for
- // shader-related entry points
- if (context->getExtensions().webglCompatibility &&
- !IsValidESSLString(name, strlen(name), false))
+ if (context->isWebGL())
{
- ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidNameCharacters);
- return false;
+ const size_t length = strlen(name);
+
+ if (!IsValidESSLString(name, length))
+ {
+ // The WebGL spec (section 6.20) disallows strings containing invalid ESSL characters
+ // for shader-related entry points
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidNameCharacters);
+ return false;
+ }
+
+ if (!ValidateWebGLNameLength(context, length) || !ValidateWebGLNamePrefix(context, name))
+ {
+ return false;
+ }
}
return GetValidProgram(context, program) != nullptr;
@@ -4330,13 +4588,13 @@ bool ValidateGetString(Context *context, GLenum name)
case GL_REQUESTABLE_EXTENSIONS_ANGLE:
if (!context->getExtensions().requestExtension)
{
- context->handleError(InvalidEnum() << "Invalid name.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false;
}
break;
default:
- context->handleError(InvalidEnum() << "Invalid name.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false;
}
@@ -4347,7 +4605,7 @@ bool ValidateLineWidth(ValidationContext *context, GLfloat width)
{
if (width <= 0.0f || isNaN(width))
{
- context->handleError(InvalidValue() << "Invalid width value.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidWidth);
return false;
}
@@ -4678,7 +4936,7 @@ bool ValidateDisableVertexAttribArray(ValidationContext *context, GLuint index)
{
if (index >= MAX_VERTEX_ATTRIBS)
{
- ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax);
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false;
}
@@ -4689,7 +4947,7 @@ bool ValidateEnableVertexAttribArray(ValidationContext *context, GLuint index)
{
if (index >= MAX_VERTEX_ATTRIBS)
{
- ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax);
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false;
}
@@ -4745,7 +5003,7 @@ bool ValidateGetActiveAttrib(ValidationContext *context,
if (index >= static_cast<GLuint>(programObject->getActiveAttributeCount()))
{
- context->handleError(InvalidValue() << "index exeeds program active attribute count.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxActiveUniform);
return false;
}
@@ -4776,7 +5034,7 @@ bool ValidateGetActiveUniform(ValidationContext *context,
if (index >= static_cast<GLuint>(programObject->getActiveUniformCount()))
{
- context->handleError(InvalidValue() << "index exceeds program active uniform count.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxActiveUniform);
return false;
}
@@ -4791,7 +5049,7 @@ bool ValidateGetAttachedShaders(ValidationContext *context,
{
if (maxcount < 0)
{
- context->handleError(InvalidValue() << "max count must be non-negative.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeMaxCount);
return false;
}
@@ -4809,8 +5067,7 @@ bool ValidateGetAttribLocation(ValidationContext *context, GLuint program, const
{
// The WebGL spec (section 6.20) disallows strings containing invalid ESSL characters for
// shader-related entry points
- if (context->getExtensions().webglCompatibility &&
- !IsValidESSLString(name, strlen(name), false))
+ if (context->getExtensions().webglCompatibility && !IsValidESSLString(name, strlen(name)))
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidNameCharacters);
return false;
@@ -4969,8 +5226,7 @@ bool ValidateGetUniformLocation(ValidationContext *context, GLuint program, cons
// The WebGL spec (section 6.20) disallows strings containing invalid ESSL characters for
// shader-related entry points
- if (context->getExtensions().webglCompatibility &&
- !IsValidESSLString(name, strlen(name), false))
+ if (context->getExtensions().webglCompatibility && !IsValidESSLString(name, strlen(name)))
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidNameCharacters);
return false;
@@ -5197,10 +5453,12 @@ bool ValidateShaderSource(ValidationContext *context,
{
for (GLsizei i = 0; i < count; i++)
{
- size_t len = length ? static_cast<size_t>(length[i]) : strlen(string[i]);
+ size_t len =
+ (length && length[i] >= 0) ? static_cast<size_t>(length[i]) : strlen(string[i]);
// Backslash as line-continuation is allowed in WebGL 2.0.
- if (!IsValidESSLString(string[i], len, context->getClientVersion() >= ES_3_0))
+ if (!IsValidESSLShaderSourceString(string[i], len,
+ context->getClientVersion() >= ES_3_0))
{
ANGLE_VALIDATION_ERR(context, InvalidValue(), ShaderSourceInvalidCharacters);
return false;
@@ -5427,17 +5685,6 @@ bool ValidateValidateProgram(ValidationContext *context, GLuint program)
return true;
}
-bool ValidateVertexAttribIndex(ValidationContext *context, GLuint index)
-{
- if (index >= MAX_VERTEX_ATTRIBS)
- {
- ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMax);
- return false;
- }
-
- return true;
-}
-
bool ValidateVertexAttrib1f(ValidationContext *context, GLuint index, GLfloat x)
{
return ValidateVertexAttribIndex(context, index);
@@ -5689,6 +5936,22 @@ bool ValidateFramebufferTexture2D(Context *context,
}
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ {
+ if (level != 0)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ if (tex->getTarget() != GL_TEXTURE_RECTANGLE_ANGLE)
+ {
+ context->handleError(InvalidOperation()
+ << "Textarget must match the texture target type.");
+ return false;
+ }
+ }
+ break;
+
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
@@ -5714,15 +5977,13 @@ bool ValidateFramebufferTexture2D(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation()
- << "Texture target requires at least OpenGL ES 3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
if (level != 0)
{
- context->handleError(InvalidValue()
- << "Level must be 0 for TEXTURE_2D_MULTISAMPLE.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), LevelNotZero);
return false;
}
if (tex->getTarget() != GL_TEXTURE_2D_MULTISAMPLE)
@@ -5836,7 +6097,8 @@ bool ValidateGenerateMipmap(Context *context, GLenum target)
(!isPow2(static_cast<int>(texture->getWidth(baseTarget, 0))) ||
!isPow2(static_cast<int>(texture->getHeight(baseTarget, 0)))))
{
- ASSERT(target == GL_TEXTURE_2D || target == GL_TEXTURE_CUBE_MAP);
+ ASSERT(target == GL_TEXTURE_2D || target == GL_TEXTURE_RECTANGLE_ANGLE ||
+ target == GL_TEXTURE_CUBE_MAP);
ANGLE_VALIDATION_ERR(context, InvalidOperation(), TextureNotPow2);
return false;
}
diff --git a/chromium/third_party/angle/src/libANGLE/validationES2.h b/chromium/third_party/angle/src/libANGLE/validationES2.h
index b6c3ddda5d8..efb50c9491c 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES2.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES2.h
@@ -32,9 +32,9 @@ bool ValidateDiscardFramebufferEXT(Context *context,
bool ValidateDrawBuffersEXT(ValidationContext *context, GLsizei n, const GLenum *bufs);
bool ValidateBindVertexArrayOES(Context *context, GLuint array);
-bool ValidateDeleteVertexArraysOES(Context *context, GLsizei n);
-bool ValidateGenVertexArraysOES(Context *context, GLsizei n);
-bool ValidateIsVertexArrayOES(Context *context);
+bool ValidateDeleteVertexArraysOES(Context *context, GLsizei n, const GLuint *arrays);
+bool ValidateGenVertexArraysOES(Context *context, GLsizei n, GLuint *arrays);
+bool ValidateIsVertexArrayOES(Context *context, GLuint array);
bool ValidateProgramBinaryOES(Context *context,
GLuint program,
@@ -208,6 +208,7 @@ bool ValidateMapBufferRangeEXT(Context *context,
GLintptr offset,
GLsizeiptr length,
GLbitfield access);
+bool ValidateMapBufferBase(Context *context, GLenum target);
bool ValidateFlushMappedBufferRangeEXT(Context *context,
GLenum target,
GLintptr offset,
diff --git a/chromium/third_party/angle/src/libANGLE/validationES3.cpp b/chromium/third_party/angle/src/libANGLE/validationES3.cpp
index 6cc18273dfc..de011ece35c 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES3.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES3.cpp
@@ -45,7 +45,7 @@ bool ValidateFramebufferTextureMultiviewBaseANGLE(Context *context,
return false;
}
- if (numViews < 1)
+ if (texture != 0 && numViews < 1)
{
context->handleError(InvalidValue() << "numViews cannot be less than 1.");
return false;
@@ -82,7 +82,34 @@ bool ValidateFramebufferTextureMultiviewLevelAndFormat(Context *context,
return true;
}
-} // namespace
+bool ValidateUniformES3(Context *context, GLenum uniformType, GLint location, GLint count)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateUniform(context, uniformType, location, count);
+}
+
+bool ValidateUniformMatrixES3(Context *context,
+ GLenum valueType,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose)
+{
+ // Check for ES3 uniform entry points
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateUniformMatrix(context, valueType, location, count, transpose);
+}
+
+} // anonymous namespace
static bool ValidateTexImageFormatCombination(gl::Context *context,
GLenum target,
@@ -94,13 +121,13 @@ static bool ValidateTexImageFormatCombination(gl::Context *context,
// The type and format are valid if any supported internal format has that type and format
if (!ValidES3Format(format))
{
- context->handleError(InvalidEnum() << "Invalid format.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFormat);
return false;
}
if (!ValidES3Type(type))
{
- context->handleError(InvalidEnum() << "Invalid type.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidType);
return false;
}
@@ -110,7 +137,7 @@ static bool ValidateTexImageFormatCombination(gl::Context *context,
// the validation codepaths for glTexImage2D/3D, we record a GL_INVALID_VALUE error.
if (!ValidES3InternalFormat(internalFormat))
{
- context->handleError(InvalidValue() << "Invalid internalFormat.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), InvalidInternalFormat);
return false;
}
@@ -199,6 +226,22 @@ bool ValidateES3TexImageParametersBase(Context *context,
}
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ ASSERT(level == 0);
+ if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
+ static_cast<GLuint>(height) > caps.maxRectangleTextureSize)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ if (isCompressed)
+ {
+ context->handleError(InvalidEnum()
+ << "Rectangle texture cannot have a compressed format.");
+ return false;
+ }
+ break;
+
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
@@ -851,6 +894,17 @@ bool ValidateES3TexStorageParametersBase(Context *context,
}
break;
+ case GL_TEXTURE_RECTANGLE_ANGLE:
+ {
+ if (static_cast<GLuint>(width) > caps.maxRectangleTextureSize ||
+ static_cast<GLuint>(height) > caps.maxRectangleTextureSize || levels != 1)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ }
+ break;
+
case GL_TEXTURE_CUBE_MAP:
{
if (width != height)
@@ -922,6 +976,12 @@ bool ValidateES3TexStorageParametersBase(Context *context,
return false;
}
+ if (formatInfo.compressed && target == GL_TEXTURE_RECTANGLE_ANGLE)
+ {
+ context->handleError(InvalidEnum() << "Rectangle texture cannot have a compressed format.");
+ return false;
+ }
+
return true;
}
@@ -1092,7 +1152,7 @@ bool ValidateInvalidateFramebuffer(Context *context,
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Operation only supported on ES 3.0 and above");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -1108,7 +1168,7 @@ bool ValidateInvalidateFramebuffer(Context *context,
defaultFramebuffer = context->getGLState().getReadFramebuffer()->id() == 0;
break;
default:
- context->handleError(InvalidEnum() << "Invalid framebuffer target");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFramebufferTarget);
return false;
}
@@ -1116,6 +1176,18 @@ bool ValidateInvalidateFramebuffer(Context *context,
defaultFramebuffer);
}
+bool ValidateInvalidateSubFramebuffer(Context *context,
+ GLenum target,
+ GLsizei numAttachments,
+ const GLenum *attachments,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height)
+{
+ return ValidateInvalidateFramebuffer(context, target, numAttachments, attachments);
+}
+
bool ValidateClearBuffer(ValidationContext *context)
{
if (context->getClientMajorVersion() < 3)
@@ -1143,7 +1215,7 @@ bool ValidateDrawRangeElements(Context *context,
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -1338,11 +1410,11 @@ bool ValidateBindVertexArray(Context *context, GLuint array)
return ValidateBindVertexArrayBase(context, array);
}
-bool ValidateIsVertexArray(Context *context)
+bool ValidateIsVertexArray(Context *context, GLuint array)
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation());
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -1533,7 +1605,7 @@ bool ValidateProgramParameteri(Context *context, GLuint program, GLenum pname, G
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -1744,7 +1816,7 @@ bool ValidateDrawBuffers(ValidationContext *context, GLsizei n, const GLenum *bu
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2018,7 +2090,7 @@ bool ValidateGenOrDeleteCountES3(Context *context, GLint count)
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
if (count < 0)
@@ -2033,7 +2105,7 @@ bool ValidateBeginTransformFeedback(Context *context, GLenum primitiveMode)
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
switch (primitiveMode)
@@ -2056,6 +2128,17 @@ bool ValidateBeginTransformFeedback(Context *context, GLenum primitiveMode)
context->handleError(InvalidOperation() << "Transform feedback is already active.");
return false;
}
+
+ for (size_t i = 0; i < transformFeedback->getIndexedBufferCount(); i++)
+ {
+ const auto &buffer = transformFeedback->getIndexedBuffer(i);
+ if (buffer.get() && buffer->isMapped())
+ {
+ context->handleError(InvalidOperation() << "Transform feedback has a mapped buffer.");
+ return false;
+ }
+ }
+
return true;
}
@@ -2108,7 +2191,7 @@ bool ValidateMapBufferRange(Context *context,
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2122,7 +2205,7 @@ bool ValidateFlushMappedBufferRange(Context *context,
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2253,7 +2336,7 @@ bool ValidateGetIntegeri_v(ValidationContext *context, GLenum target, GLuint ind
{
if (context->getClientVersion() < ES_3_0)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.0");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
return ValidateIndexedStateQuery(context, target, index, nullptr);
@@ -2268,7 +2351,7 @@ bool ValidateGetIntegeri_vRobustANGLE(ValidationContext *context,
{
if (context->getClientVersion() < ES_3_0)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.0");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2294,7 +2377,7 @@ bool ValidateGetInteger64i_v(ValidationContext *context, GLenum target, GLuint i
{
if (context->getClientVersion() < ES_3_0)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.0");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
return ValidateIndexedStateQuery(context, target, index, nullptr);
@@ -2309,7 +2392,7 @@ bool ValidateGetInteger64i_vRobustANGLE(ValidationContext *context,
{
if (context->getClientVersion() < ES_3_0)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.0");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2340,7 +2423,7 @@ bool ValidateCopyBufferSubData(ValidationContext *context,
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "CopyBufferSubData requires ES 3 or greater");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2422,8 +2505,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation()
- << "glGetStringi requires OpenGL ES 3.0 or higher.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2441,7 +2523,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
case GL_REQUESTABLE_EXTENSIONS_ANGLE:
if (!context->getExtensions().requestExtension)
{
- context->handleError(InvalidEnum() << "Invalid name.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false;
}
if (index >= context->getRequestableExtensionStringCount())
@@ -2454,7 +2536,7 @@ bool ValidateGetStringi(Context *context, GLenum name, GLuint index)
break;
default:
- context->handleError(InvalidEnum() << "Invalid name.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidName);
return false;
}
@@ -2512,8 +2594,7 @@ bool ValidateVertexAttribIPointer(ValidationContext *context,
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation()
- << "VertexAttribIPointer requires OpenGL ES 3.0 or higher.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
@@ -2524,7 +2605,7 @@ bool ValidateVertexAttribIPointer(ValidationContext *context,
if (stride < 0)
{
- context->handleError(InvalidValue() << "stride cannot be negative.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeStride);
return false;
}
@@ -2582,18 +2663,18 @@ bool ValidateGetSynciv(Context *context,
{
if (context->getClientMajorVersion() < 3)
{
- context->handleError(InvalidOperation() << "GetSynciv requires OpenGL ES 3.0 or higher.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
return false;
}
if (bufSize < 0)
{
- context->handleError(InvalidValue() << "bufSize cannot be negative.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize);
return false;
}
- FenceSync *fenceSync = context->getFenceSync(sync);
- if (!fenceSync)
+ Sync *syncObject = context->getSync(sync);
+ if (!syncObject)
{
context->handleError(InvalidValue() << "Invalid sync object.");
return false;
@@ -2608,7 +2689,7 @@ bool ValidateGetSynciv(Context *context,
break;
default:
- context->handleError(InvalidEnum() << "Invalid pname.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
@@ -2646,14 +2727,14 @@ bool ValidateFramebufferTextureMultiviewLayeredANGLE(Context *context,
return false;
}
- if (baseViewIndex < 0)
- {
- context->handleError(InvalidValue() << "baseViewIndex cannot be less than 0.");
- return false;
- }
-
if (texture != 0)
{
+ if (baseViewIndex < 0)
+ {
+ context->handleError(InvalidValue() << "baseViewIndex cannot be less than 0.");
+ return false;
+ }
+
Texture *tex = context->getTexture(texture);
ASSERT(tex);
@@ -2700,19 +2781,19 @@ bool ValidateFramebufferTextureMultiviewSideBySideANGLE(Context *context,
return false;
}
- const GLsizei numViewportOffsetValues = numViews * 2;
- for (GLsizei i = 0; i < numViewportOffsetValues; ++i)
+ if (texture != 0)
{
- if (viewportOffsets[i] < 0)
+ const GLsizei numViewportOffsetValues = numViews * 2;
+ for (GLsizei i = 0; i < numViewportOffsetValues; ++i)
{
- context->handleError(InvalidValue()
- << "viewportOffsets cannot contain negative values.");
- return false;
+ if (viewportOffsets[i] < 0)
+ {
+ context->handleError(InvalidValue()
+ << "viewportOffsets cannot contain negative values.");
+ return false;
+ }
}
- }
- if (texture != 0)
- {
Texture *tex = context->getTexture(texture);
ASSERT(tex);
@@ -2735,4 +2816,848 @@ bool ValidateFramebufferTextureMultiviewSideBySideANGLE(Context *context,
return true;
}
+bool ValidateUniform1ui(Context *context, GLint location, GLuint v0)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT, location, 1);
+}
+
+bool ValidateUniform2ui(Context *context, GLint location, GLuint v0, GLuint v1)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT_VEC2, location, 1);
+}
+
+bool ValidateUniform3ui(Context *context, GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT_VEC3, location, 1);
+}
+
+bool ValidateUniform4ui(Context *context,
+ GLint location,
+ GLuint v0,
+ GLuint v1,
+ GLuint v2,
+ GLuint v3)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT_VEC4, location, 1);
+}
+
+bool ValidateUniform1uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT, location, count);
+}
+
+bool ValidateUniform2uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT_VEC2, location, count);
+}
+
+bool ValidateUniform3uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT_VEC3, location, count);
+}
+
+bool ValidateUniform4uiv(Context *context, GLint location, GLsizei count, const GLuint *value)
+{
+ return ValidateUniformES3(context, GL_UNSIGNED_INT_VEC4, location, count);
+}
+
+bool ValidateIsQuery(Context *context, GLuint id)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateUniformMatrix2x3fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ return ValidateUniformMatrixES3(context, GL_FLOAT_MAT2x3, location, count, transpose);
+}
+
+bool ValidateUniformMatrix3x2fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ return ValidateUniformMatrixES3(context, GL_FLOAT_MAT3x2, location, count, transpose);
+}
+
+bool ValidateUniformMatrix2x4fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ return ValidateUniformMatrixES3(context, GL_FLOAT_MAT2x4, location, count, transpose);
+}
+
+bool ValidateUniformMatrix4x2fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ return ValidateUniformMatrixES3(context, GL_FLOAT_MAT4x2, location, count, transpose);
+}
+
+bool ValidateUniformMatrix3x4fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ return ValidateUniformMatrixES3(context, GL_FLOAT_MAT3x4, location, count, transpose);
+}
+
+bool ValidateUniformMatrix4x3fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value)
+{
+ return ValidateUniformMatrixES3(context, GL_FLOAT_MAT4x3, location, count, transpose);
+}
+
+bool ValidateEndTransformFeedback(Context *context)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ TransformFeedback *transformFeedback = context->getGLState().getCurrentTransformFeedback();
+ ASSERT(transformFeedback != nullptr);
+
+ if (!transformFeedback->isActive())
+ {
+ context->handleError(InvalidOperation());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateTransformFeedbackVaryings(Context *context,
+ GLuint program,
+ GLsizei count,
+ const GLchar *const *varyings,
+ GLenum bufferMode)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (count < 0)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeCount);
+ return false;
+ }
+
+ switch (bufferMode)
+ {
+ case GL_INTERLEAVED_ATTRIBS:
+ break;
+ case GL_SEPARATE_ATTRIBS:
+ {
+ const Caps &caps = context->getCaps();
+ if (static_cast<GLuint>(count) > caps.maxTransformFeedbackSeparateAttributes)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ break;
+ }
+ default:
+ context->handleError(InvalidEnum());
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetTransformFeedbackVarying(Context *context,
+ GLuint program,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLsizei *size,
+ GLenum *type,
+ GLchar *name)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (bufSize < 0)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize);
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ if (index >= static_cast<GLuint>(programObject->getTransformFeedbackVaryingCount()))
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ switch (target)
+ {
+ case GL_TRANSFORM_FEEDBACK:
+ {
+ // Cannot bind a transform feedback object if the current one is started and not
+ // paused (3.0.2 pg 85 section 2.14.1)
+ TransformFeedback *curTransformFeedback =
+ context->getGLState().getCurrentTransformFeedback();
+ if (curTransformFeedback && curTransformFeedback->isActive() &&
+ !curTransformFeedback->isPaused())
+ {
+ context->handleError(InvalidOperation());
+ return false;
+ }
+
+ // Cannot bind a transform feedback object that does not exist (3.0.2 pg 85 section
+ // 2.14.1)
+ if (!context->isTransformFeedbackGenerated(id))
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), TransformFeedbackDoesNotExist);
+ return false;
+ }
+ }
+ break;
+
+ default:
+ context->handleError(InvalidEnum());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateIsTransformFeedback(Context *context, GLuint id)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidatePauseTransformFeedback(Context *context)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ TransformFeedback *transformFeedback = context->getGLState().getCurrentTransformFeedback();
+ ASSERT(transformFeedback != nullptr);
+
+ // Current transform feedback must be active and not paused in order to pause (3.0.2 pg 86)
+ if (!transformFeedback->isActive() || transformFeedback->isPaused())
+ {
+ context->handleError(InvalidOperation());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateResumeTransformFeedback(Context *context)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ TransformFeedback *transformFeedback = context->getGLState().getCurrentTransformFeedback();
+ ASSERT(transformFeedback != nullptr);
+
+ // Current transform feedback must be active and paused in order to resume (3.0.2 pg 86)
+ if (!transformFeedback->isActive() || !transformFeedback->isPaused())
+ {
+ context->handleError(InvalidOperation());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateVertexAttribI4i(Context *context, GLuint index, GLint x, GLint y, GLint z, GLint w)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateVertexAttribIndex(context, index);
+}
+
+bool ValidateVertexAttribI4ui(Context *context,
+ GLuint index,
+ GLuint x,
+ GLuint y,
+ GLuint z,
+ GLuint w)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateVertexAttribIndex(context, index);
+}
+
+bool ValidateVertexAttribI4iv(Context *context, GLuint index, const GLint *v)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateVertexAttribIndex(context, index);
+}
+
+bool ValidateVertexAttribI4uiv(Context *context, GLuint index, const GLuint *v)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateVertexAttribIndex(context, index);
+}
+
+bool ValidateGetFragDataLocation(Context *context, GLuint program, const GLchar *name)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ if (!programObject->isLinked())
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ProgramNotLinked);
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetUniformIndices(Context *context,
+ GLuint program,
+ GLsizei uniformCount,
+ const GLchar *const *uniformNames,
+ GLuint *uniformIndices)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (uniformCount < 0)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetActiveUniformsiv(Context *context,
+ GLuint program,
+ GLsizei uniformCount,
+ const GLuint *uniformIndices,
+ GLenum pname,
+ GLint *params)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (uniformCount < 0)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ switch (pname)
+ {
+ case GL_UNIFORM_TYPE:
+ case GL_UNIFORM_SIZE:
+ case GL_UNIFORM_NAME_LENGTH:
+ case GL_UNIFORM_BLOCK_INDEX:
+ case GL_UNIFORM_OFFSET:
+ case GL_UNIFORM_ARRAY_STRIDE:
+ case GL_UNIFORM_MATRIX_STRIDE:
+ case GL_UNIFORM_IS_ROW_MAJOR:
+ break;
+
+ default:
+ context->handleError(InvalidEnum());
+ return false;
+ }
+
+ if (uniformCount > programObject->getActiveUniformCount())
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ for (int uniformId = 0; uniformId < uniformCount; uniformId++)
+ {
+ const GLuint index = uniformIndices[uniformId];
+
+ if (index >= static_cast<GLuint>(programObject->getActiveUniformCount()))
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+ }
+
+ return true;
+}
+
+bool ValidateGetUniformBlockIndex(Context *context, GLuint program, const GLchar *uniformBlockName)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetActiveUniformBlockiv(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLenum pname,
+ GLint *params)
+{
+ return ValidateGetActiveUniformBlockivBase(context, program, uniformBlockIndex, pname, nullptr);
+}
+
+bool ValidateGetActiveUniformBlockName(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *uniformBlockName)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateUniformBlockBinding(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLuint uniformBlockBinding)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (uniformBlockBinding >= context->getCaps().maxUniformBufferBindings)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (!programObject)
+ {
+ return false;
+ }
+
+ // if never linked, there won't be any uniform blocks
+ if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateDrawArraysInstanced(Context *context,
+ GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei primcount)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateDrawArraysInstancedBase(context, mode, first, count, primcount);
+}
+
+bool ValidateFenceSync(Context *context, GLenum condition, GLbitfield flags)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (condition != GL_SYNC_GPU_COMMANDS_COMPLETE)
+ {
+ context->handleError(InvalidEnum());
+ return false;
+ }
+
+ if (flags != 0)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateIsSync(Context *context, GLsync sync)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateDeleteSync(Context *context, GLsync sync)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (sync != static_cast<GLsync>(0) && !context->getSync(sync))
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateClientWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if ((flags & ~(GL_SYNC_FLUSH_COMMANDS_BIT)) != 0)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ Sync *clientWaitSync = context->getSync(sync);
+ if (!clientWaitSync)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64 timeout)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (flags != 0)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ if (timeout != GL_TIMEOUT_IGNORED)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ Sync *waitSync = context->getSync(sync);
+ if (!waitSync)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetInteger64v(Context *context, GLenum pname, GLint64 *params)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ GLenum nativeType = GL_NONE;
+ unsigned int numParams = 0;
+ if (!ValidateStateQuery(context, pname, &nativeType, &numParams))
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateIsSampler(Context *context, GLuint sampler)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ context->handleError(InvalidOperation());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateBindSampler(Context *context, GLuint unit, GLuint sampler)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (sampler != 0 && !context->isSampler(sampler))
+ {
+ context->handleError(InvalidOperation());
+ return false;
+ }
+
+ if (unit >= context->getCaps().maxCombinedTextureImageUnits)
+ {
+ context->handleError(InvalidValue());
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateVertexAttribDivisor(Context *context, GLuint index, GLuint divisor)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ return ValidateVertexAttribIndex(context, index);
+}
+
+bool ValidateTexStorage2D(Context *context,
+ GLenum target,
+ GLsizei levels,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (!ValidateES3TexStorage2DParameters(context, target, levels, internalformat, width, height,
+ 1))
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateTexStorage3D(Context *context,
+ GLenum target,
+ GLsizei levels,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth)
+{
+ if (context->getClientMajorVersion() < 3)
+ {
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES3Required);
+ return false;
+ }
+
+ if (!ValidateES3TexStorage3DParameters(context, target, levels, internalformat, width, height,
+ depth))
+ {
+ return false;
+ }
+
+ return true;
+}
+
+bool ValidateGetBufferParameteri64v(ValidationContext *context,
+ GLenum target,
+ GLenum pname,
+ GLint64 *params)
+{
+ return ValidateGetBufferParameterBase(context, target, pname, false, nullptr);
+}
+
+bool ValidateGetSamplerParameterfv(Context *context, GLuint sampler, GLenum pname, GLfloat *params)
+{
+ return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr);
+}
+
+bool ValidateGetSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, GLint *params)
+{
+ return ValidateGetSamplerParameterBase(context, sampler, pname, nullptr);
+}
+
+bool ValidateSamplerParameterf(Context *context, GLuint sampler, GLenum pname, GLfloat param)
+{
+ return ValidateSamplerParameterBase(context, sampler, pname, -1, &param);
+}
+
+bool ValidateSamplerParameterfv(Context *context,
+ GLuint sampler,
+ GLenum pname,
+ const GLfloat *params)
+{
+ return ValidateSamplerParameterBase(context, sampler, pname, -1, params);
+}
+
+bool ValidateSamplerParameteri(Context *context, GLuint sampler, GLenum pname, GLint param)
+{
+ return ValidateSamplerParameterBase(context, sampler, pname, -1, &param);
+}
+
+bool ValidateSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, const GLint *params)
+{
+ return ValidateSamplerParameterBase(context, sampler, pname, -1, params);
+}
+
+bool ValidateGetVertexAttribIiv(Context *context, GLuint index, GLenum pname, GLint *params)
+{
+ return ValidateGetVertexAttribBase(context, index, pname, nullptr, false, true);
+}
+
+bool ValidateGetVertexAttribIuiv(Context *context, GLuint index, GLenum pname, GLuint *params)
+{
+ return ValidateGetVertexAttribBase(context, index, pname, nullptr, false, true);
+}
+
+bool ValidateGetInternalformativ(Context *context,
+ GLenum target,
+ GLenum internalformat,
+ GLenum pname,
+ GLsizei bufSize,
+ GLint *params)
+{
+ return ValidateGetInternalFormativBase(context, target, internalformat, pname, bufSize,
+ nullptr);
+}
+
} // namespace gl
diff --git a/chromium/third_party/angle/src/libANGLE/validationES3.h b/chromium/third_party/angle/src/libANGLE/validationES3.h
index 91e8332a409..cb18fe824be 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES3.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES3.h
@@ -165,6 +165,15 @@ bool ValidateInvalidateFramebuffer(Context *context,
GLsizei numAttachments,
const GLenum *attachments);
+bool ValidateInvalidateSubFramebuffer(Context *context,
+ GLenum target,
+ GLsizei numAttachments,
+ const GLenum *attachments,
+ GLint x,
+ GLint y,
+ GLsizei width,
+ GLsizei height);
+
bool ValidateClearBuffer(ValidationContext *context);
bool ValidateDrawRangeElements(Context *context,
@@ -202,7 +211,7 @@ bool ValidateCompressedTexImage3DRobustANGLE(Context *context,
const void *data);
bool ValidateBindVertexArray(Context *context, GLuint array);
-bool ValidateIsVertexArray(Context *context);
+bool ValidateIsVertexArray(Context *context, GLuint array);
bool ValidateBindBufferBase(Context *context, GLenum target, GLuint index, GLuint buffer);
bool ValidateBindBufferRange(Context *context,
@@ -443,6 +452,164 @@ bool ValidateFramebufferTextureMultiviewSideBySideANGLE(Context *context,
GLsizei numViews,
const GLint *viewportOffsets);
+bool ValidateIsQuery(Context *context, GLuint id);
+
+bool ValidateUniform1ui(Context *context, GLint location, GLuint v0);
+bool ValidateUniform2ui(Context *context, GLint location, GLuint v0, GLuint v1);
+bool ValidateUniform3ui(Context *context, GLint location, GLuint v0, GLuint v1, GLuint v2);
+bool ValidateUniform4ui(Context *context,
+ GLint location,
+ GLuint v0,
+ GLuint v1,
+ GLuint v2,
+ GLuint v3);
+
+bool ValidateUniform1uiv(Context *context, GLint location, GLsizei count, const GLuint *value);
+bool ValidateUniform2uiv(Context *context, GLint location, GLsizei count, const GLuint *value);
+bool ValidateUniform3uiv(Context *context, GLint location, GLsizei count, const GLuint *value);
+bool ValidateUniform4uiv(Context *context, GLint location, GLsizei count, const GLuint *value);
+
+bool ValidateUniformMatrix2x3fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+bool ValidateUniformMatrix3x2fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+bool ValidateUniformMatrix2x4fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+bool ValidateUniformMatrix4x2fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+bool ValidateUniformMatrix3x4fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+bool ValidateUniformMatrix4x3fv(Context *context,
+ GLint location,
+ GLsizei count,
+ GLboolean transpose,
+ const GLfloat *value);
+
+bool ValidateEndTransformFeedback(Context *context);
+bool ValidateTransformFeedbackVaryings(Context *context,
+ GLuint program,
+ GLsizei count,
+ const GLchar *const *varyings,
+ GLenum bufferMode);
+bool ValidateGetTransformFeedbackVarying(Context *context,
+ GLuint program,
+ GLuint index,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLsizei *size,
+ GLenum *type,
+ GLchar *name);
+bool ValidateBindTransformFeedback(Context *context, GLenum target, GLuint id);
+bool ValidateIsTransformFeedback(Context *context, GLuint id);
+bool ValidatePauseTransformFeedback(Context *context);
+bool ValidateResumeTransformFeedback(Context *context);
+bool ValidateVertexAttribI4i(Context *context, GLuint index, GLint x, GLint y, GLint z, GLint w);
+bool ValidateVertexAttribI4ui(Context *context,
+ GLuint index,
+ GLuint x,
+ GLuint y,
+ GLuint z,
+ GLuint w);
+bool ValidateVertexAttribI4iv(Context *context, GLuint index, const GLint *v);
+bool ValidateVertexAttribI4uiv(Context *context, GLuint index, const GLuint *v);
+bool ValidateGetFragDataLocation(Context *context, GLuint program, const GLchar *name);
+bool ValidateGetUniformIndices(Context *context,
+ GLuint program,
+ GLsizei uniformCount,
+ const GLchar *const *uniformNames,
+ GLuint *uniformIndices);
+bool ValidateGetActiveUniformsiv(Context *context,
+ GLuint program,
+ GLsizei uniformCount,
+ const GLuint *uniformIndices,
+ GLenum pname,
+ GLint *params);
+bool ValidateGetUniformBlockIndex(Context *context, GLuint program, const GLchar *uniformBlockName);
+bool ValidateGetActiveUniformBlockiv(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLenum pname,
+ GLint *params);
+bool ValidateGetActiveUniformBlockName(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLchar *uniformBlockName);
+bool ValidateUniformBlockBinding(Context *context,
+ GLuint program,
+ GLuint uniformBlockIndex,
+ GLuint uniformBlockBinding);
+bool ValidateDrawArraysInstanced(Context *context,
+ GLenum mode,
+ GLint first,
+ GLsizei count,
+ GLsizei primcount);
+
+bool ValidateFenceSync(Context *context, GLenum condition, GLbitfield flags);
+bool ValidateIsSync(Context *context, GLsync sync);
+bool ValidateDeleteSync(Context *context, GLsync sync);
+bool ValidateClientWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64 timeout);
+bool ValidateWaitSync(Context *context, GLsync sync, GLbitfield flags, GLuint64 timeout);
+bool ValidateGetInteger64v(Context *context, GLenum pname, GLint64 *params);
+
+bool ValidateIsSampler(Context *context, GLuint sampler);
+bool ValidateBindSampler(Context *context, GLuint unit, GLuint sampler);
+bool ValidateVertexAttribDivisor(Context *context, GLuint index, GLuint divisor);
+bool ValidateTexStorage2D(Context *context,
+ GLenum target,
+ GLsizei levels,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height);
+bool ValidateTexStorage3D(Context *context,
+ GLenum target,
+ GLsizei levels,
+ GLenum internalformat,
+ GLsizei width,
+ GLsizei height,
+ GLsizei depth);
+
+bool ValidateGetVertexAttribIiv(Context *context, GLuint index, GLenum pname, GLint *params);
+bool ValidateGetVertexAttribIuiv(Context *context, GLuint index, GLenum pname, GLuint *params);
+bool ValidateGetBufferParameteri64v(ValidationContext *context,
+ GLenum target,
+ GLenum pname,
+ GLint64 *params);
+bool ValidateSamplerParameteri(Context *context, GLuint sampler, GLenum pname, GLint param);
+bool ValidateSamplerParameteriv(Context *context,
+ GLuint sampler,
+ GLenum pname,
+ const GLint *params);
+bool ValidateSamplerParameterf(Context *context, GLuint sampler, GLenum pname, GLfloat param);
+bool ValidateSamplerParameterfv(Context *context,
+ GLuint sampler,
+ GLenum pname,
+ const GLfloat *params);
+bool ValidateGetSamplerParameteriv(Context *context, GLuint sampler, GLenum pname, GLint *params);
+bool ValidateGetSamplerParameterfv(Context *context, GLuint sampler, GLenum pname, GLfloat *params);
+bool ValidateGetInternalformativ(Context *context,
+ GLenum target,
+ GLenum internalformat,
+ GLenum pname,
+ GLsizei bufSize,
+ GLint *params);
+
} // 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 4856d852da4..09719ceaff9 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES31.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES31.cpp
@@ -9,6 +9,7 @@
#include "libANGLE/validationES31.h"
#include "libANGLE/Context.h"
+#include "libANGLE/ErrorStrings.h"
#include "libANGLE/Framebuffer.h"
#include "libANGLE/VertexArray.h"
#include "libANGLE/validationES.h"
@@ -54,6 +55,195 @@ bool ValidateLocationProgramInterface(GLenum programInterface)
}
}
+bool ValidateProgramInterface(GLenum programInterface)
+{
+ return (programInterface == GL_ATOMIC_COUNTER_BUFFER ||
+ ValidateNamedProgramInterface(programInterface));
+}
+
+bool ValidateProgramResourceProperty(GLenum prop)
+{
+ switch (prop)
+ {
+ case GL_ACTIVE_VARIABLES:
+ case GL_BUFFER_BINDING:
+ case GL_NUM_ACTIVE_VARIABLES:
+
+ case GL_ARRAY_SIZE:
+
+ case GL_ARRAY_STRIDE:
+ case GL_BLOCK_INDEX:
+ case GL_IS_ROW_MAJOR:
+ case GL_MATRIX_STRIDE:
+
+ case GL_ATOMIC_COUNTER_BUFFER_INDEX:
+
+ case GL_BUFFER_DATA_SIZE:
+
+ case GL_LOCATION:
+
+ case GL_NAME_LENGTH:
+
+ case GL_OFFSET:
+
+ case GL_REFERENCED_BY_VERTEX_SHADER:
+ case GL_REFERENCED_BY_FRAGMENT_SHADER:
+ case GL_REFERENCED_BY_COMPUTE_SHADER:
+
+ case GL_TOP_LEVEL_ARRAY_SIZE:
+ case GL_TOP_LEVEL_ARRAY_STRIDE:
+
+ case GL_TYPE:
+ return true;
+
+ default:
+ return false;
+ }
+}
+
+// GLES 3.10 spec: Page 82 -- Table 7.2
+bool ValidateProgramResourcePropertyByInterface(GLenum prop, GLenum programInterface)
+{
+ switch (prop)
+ {
+ case GL_ACTIVE_VARIABLES:
+ case GL_BUFFER_BINDING:
+ case GL_NUM_ACTIVE_VARIABLES:
+ {
+ switch (programInterface)
+ {
+ case GL_ATOMIC_COUNTER_BUFFER:
+ case GL_SHADER_STORAGE_BLOCK:
+ case GL_UNIFORM_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ case GL_ARRAY_SIZE:
+ {
+ switch (programInterface)
+ {
+ case GL_BUFFER_VARIABLE:
+ case GL_PROGRAM_INPUT:
+ case GL_PROGRAM_OUTPUT:
+ case GL_TRANSFORM_FEEDBACK_VARYING:
+ case GL_UNIFORM:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ case GL_ARRAY_STRIDE:
+ case GL_BLOCK_INDEX:
+ case GL_IS_ROW_MAJOR:
+ case GL_MATRIX_STRIDE:
+ {
+ switch (programInterface)
+ {
+ case GL_BUFFER_VARIABLE:
+ case GL_UNIFORM:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ case GL_ATOMIC_COUNTER_BUFFER_INDEX:
+ {
+ if (programInterface == GL_UNIFORM)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ case GL_BUFFER_DATA_SIZE:
+ {
+ switch (programInterface)
+ {
+ case GL_ATOMIC_COUNTER_BUFFER:
+ case GL_SHADER_STORAGE_BLOCK:
+ case GL_UNIFORM_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ case GL_LOCATION:
+ {
+ return ValidateLocationProgramInterface(programInterface);
+ }
+
+ case GL_NAME_LENGTH:
+ {
+ return ValidateNamedProgramInterface(programInterface);
+ }
+
+ case GL_OFFSET:
+ {
+ switch (programInterface)
+ {
+ case GL_BUFFER_VARIABLE:
+ case GL_UNIFORM:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ case GL_REFERENCED_BY_VERTEX_SHADER:
+ case GL_REFERENCED_BY_FRAGMENT_SHADER:
+ case GL_REFERENCED_BY_COMPUTE_SHADER:
+ {
+ switch (programInterface)
+ {
+ case GL_ATOMIC_COUNTER_BUFFER:
+ case GL_BUFFER_VARIABLE:
+ case GL_PROGRAM_INPUT:
+ case GL_PROGRAM_OUTPUT:
+ case GL_SHADER_STORAGE_BLOCK:
+ case GL_UNIFORM:
+ case GL_UNIFORM_BLOCK:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ case GL_TOP_LEVEL_ARRAY_SIZE:
+ case GL_TOP_LEVEL_ARRAY_STRIDE:
+ {
+ if (programInterface == GL_BUFFER_VARIABLE)
+ {
+ return true;
+ }
+ return false;
+ }
+
+ case GL_TYPE:
+ {
+ switch (programInterface)
+ {
+ case GL_BUFFER_VARIABLE:
+ case GL_PROGRAM_INPUT:
+ case GL_PROGRAM_OUTPUT:
+ case GL_TRANSFORM_FEEDBACK_VARYING:
+ case GL_UNIFORM:
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ default:
+ return false;
+ }
+}
+
bool ValidateProgramResourceIndex(const Program *programObject,
GLenum programInterface,
GLuint index)
@@ -66,12 +256,13 @@ bool ValidateProgramResourceIndex(const Program *programObject,
case GL_PROGRAM_OUTPUT:
return (index < static_cast<GLuint>(programObject->getOutputResourceCount()));
- // TODO(Jie): more interfaces.
+ // TODO(jie.a.chen@intel.com): more interfaces.
case GL_UNIFORM:
case GL_UNIFORM_BLOCK:
case GL_TRANSFORM_FEEDBACK_VARYING:
case GL_BUFFER_VARIABLE:
case GL_SHADER_STORAGE_BLOCK:
+ case GL_ATOMIC_COUNTER_BUFFER:
UNIMPLEMENTED();
return false;
@@ -87,7 +278,7 @@ bool ValidateGetBooleani_v(Context *context, GLenum target, GLuint index, GLbool
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -108,7 +299,7 @@ bool ValidateGetBooleani_vRobustANGLE(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -134,7 +325,7 @@ bool ValidateDrawIndirectBase(Context *context, GLenum mode, const void *indirec
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -172,6 +363,19 @@ bool ValidateDrawIndirectBase(Context *context, GLenum mode, const void *indirec
return false;
}
+ // ANGLE_multiview spec, revision 1:
+ // An INVALID_OPERATION is generated by DrawArraysIndirect and DrawElementsIndirect if the
+ // number of views in the draw framebuffer is greater than 1.
+ const Framebuffer *drawFramebuffer = context->getGLState().getDrawFramebuffer();
+ ASSERT(drawFramebuffer != nullptr);
+ if (drawFramebuffer->getNumViews() > 1)
+ {
+ context->handleError(
+ InvalidOperation()
+ << "The number of views in the active draw framebuffer is greater than 1.");
+ return false;
+ }
+
return true;
}
@@ -249,7 +453,7 @@ bool ValidateGetTexLevelParameterBase(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -260,7 +464,7 @@ bool ValidateGetTexLevelParameterBase(Context *context,
if (!ValidTexLevelDestinationTarget(context, target))
{
- context->handleError(InvalidEnum() << "Invalid texture target");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidTextureTarget);
return false;
}
@@ -304,7 +508,7 @@ bool ValidateGetTexLevelParameterBase(Context *context,
case GL_TEXTURE_COMPRESSED:
break;
default:
- context->handleError(InvalidEnum() << "Unknown pname.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
@@ -343,7 +547,7 @@ bool ValidateTexStorage2DMultiSample(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -355,7 +559,7 @@ bool ValidateTexStorage2DMultiSample(Context *context,
if (width < 1 || height < 1)
{
- context->handleError(InvalidValue() << "Width and height must be positive.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeSize);
return false;
}
@@ -424,7 +628,7 @@ bool ValidateGetMultisamplefv(Context *context, GLenum pname, GLuint index, GLfl
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -448,7 +652,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -502,8 +706,7 @@ bool ValidationFramebufferParameteri(Context *context, GLenum target, GLenum pna
}
default:
{
- context->handleError(InvalidEnum()
- << "Invalid pname: 0x" << std::hex << std::uppercase << pname);
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
}
@@ -525,13 +728,13 @@ bool ValidationGetFramebufferParameteri(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
if (!ValidFramebufferTarget(target))
{
- context->handleError(InvalidEnum() << "Invalid framebuffer target.");
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidFramebufferTarget);
return false;
}
@@ -543,8 +746,7 @@ bool ValidationGetFramebufferParameteri(Context *context,
case GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS:
break;
default:
- context->handleError(InvalidEnum()
- << "Invalid pname: 0x" << std::hex << std::uppercase << pname);
+ ANGLE_VALIDATION_ERR(context, InvalidEnum(), InvalidPname);
return false;
}
@@ -566,7 +768,7 @@ bool ValidateGetProgramResourceIndex(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES 3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -594,7 +796,7 @@ bool ValidateBindVertexBuffer(ValidationContext *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -614,7 +816,7 @@ bool ValidateBindVertexBuffer(ValidationContext *context,
if (offset < 0)
{
- context->handleError(InvalidValue() << "offset cannot be negative.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeOffset);
return false;
}
@@ -640,7 +842,7 @@ bool ValidateVertexBindingDivisor(ValidationContext *context, GLuint bindingInde
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -672,7 +874,7 @@ bool ValidateVertexAttribFormat(ValidationContext *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -702,7 +904,7 @@ bool ValidateVertexAttribBinding(ValidationContext *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -717,8 +919,7 @@ bool ValidateVertexAttribBinding(ValidationContext *context,
const Caps &caps = context->getCaps();
if (attribIndex >= caps.maxVertexAttributes)
{
- context->handleError(InvalidValue()
- << "attribindex must be smaller than MAX_VERTEX_ATTRIBS.");
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), IndexExceedsMaxVertexAttribute);
return false;
}
@@ -742,7 +943,7 @@ bool ValidateGetProgramResourceName(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -767,7 +968,7 @@ bool ValidateGetProgramResourceName(Context *context,
if (bufSize < 0)
{
- context->handleError(InvalidValue() << "Invalid bufSize: " << bufSize);
+ ANGLE_VALIDATION_ERR(context, InvalidValue(), NegativeBufferSize);
return false;
}
@@ -781,7 +982,7 @@ bool ValidateDispatchCompute(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -916,7 +1117,7 @@ bool ValidateGetProgramResourceLocation(Context *context,
{
if (context->getClientVersion() < ES_3_1)
{
- context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ ANGLE_VALIDATION_ERR(context, InvalidOperation(), ES31Required);
return false;
}
@@ -940,4 +1141,61 @@ bool ValidateGetProgramResourceLocation(Context *context,
return true;
}
+bool ValidateGetProgramResourceiv(Context *context,
+ GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei propCount,
+ const GLenum *props,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *params)
+{
+ if (context->getClientVersion() < ES_3_1)
+ {
+ context->handleError(InvalidOperation() << "Context does not support GLES3.1.");
+ return false;
+ }
+
+ Program *programObject = GetValidProgram(context, program);
+ if (programObject == nullptr)
+ {
+ return false;
+ }
+ if (!ValidateProgramInterface(programInterface))
+ {
+ context->handleError(InvalidEnum() << "Invalid program interface.");
+ return false;
+ }
+ if (propCount <= 0)
+ {
+ context->handleError(InvalidValue() << "Invalid propCount.");
+ return false;
+ }
+ if (bufSize < 0)
+ {
+ context->handleError(InvalidValue() << "Invalid bufSize.");
+ return false;
+ }
+ if (!ValidateProgramResourceIndex(programObject, programInterface, index))
+ {
+ context->handleError(InvalidValue() << "Invalid index: " << index);
+ return false;
+ }
+ for (GLsizei i = 0; i < propCount; i++)
+ {
+ if (!ValidateProgramResourceProperty(props[i]))
+ {
+ context->handleError(InvalidEnum() << "Invalid prop.");
+ return false;
+ }
+ if (!ValidateProgramResourcePropertyByInterface(props[i], programInterface))
+ {
+ context->handleError(InvalidOperation() << "Not an allowed prop for interface");
+ 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 2e70006e7e3..a48eac16561 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES31.h
+++ b/chromium/third_party/angle/src/libANGLE/validationES31.h
@@ -70,6 +70,16 @@ bool ValidateGetProgramResourceLocation(Context *context,
GLenum programInterface,
const GLchar *name);
+bool ValidateGetProgramResourceiv(Context *context,
+ GLuint program,
+ GLenum programInterface,
+ GLuint index,
+ GLsizei propCount,
+ const GLenum *props,
+ GLsizei bufSize,
+ GLsizei *length,
+ GLint *params);
+
bool ValidateBindVertexBuffer(ValidationContext *context,
GLuint bindingIndex,
GLuint buffer,
diff --git a/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp b/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp
index 49f6e3025b8..d0e601c2667 100644
--- a/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp
+++ b/chromium/third_party/angle/src/libANGLE/validationES_unittest.cpp
@@ -52,7 +52,7 @@ class MockValidationContext : public ValidationContext
{
}
- MOCK_METHOD1(handleError, void(const Error &));
+ MOCK_METHOD1(handleError, Error(const Error &));
};
// Test that ANGLE generates an INVALID_OPERATION when validating index data that uses a value
diff --git a/chromium/third_party/angle/src/libGLESv2.gypi b/chromium/third_party/angle/src/libGLESv2.gypi
index e0167d7a62b..8f12a4a9b7e 100644
--- a/chromium/third_party/angle/src/libGLESv2.gypi
+++ b/chromium/third_party/angle/src/libGLESv2.gypi
@@ -241,7 +241,6 @@
'libANGLE/renderer/DisplayImpl.h',
'libANGLE/renderer/EGLImplFactory.h',
'libANGLE/renderer/FenceNVImpl.h',
- 'libANGLE/renderer/FenceSyncImpl.h',
'libANGLE/renderer/Format_ID_autogen.inl',
'libANGLE/renderer/Format_table_autogen.cpp',
'libANGLE/renderer/Format.h',
@@ -257,6 +256,7 @@
'libANGLE/renderer/StreamProducerImpl.h',
'libANGLE/renderer/SurfaceImpl.cpp',
'libANGLE/renderer/SurfaceImpl.h',
+ 'libANGLE/renderer/SyncImpl.h',
'libANGLE/renderer/TextureImpl.cpp',
'libANGLE/renderer/TextureImpl.h',
'libANGLE/renderer/TransformFeedbackImpl.h',
@@ -437,10 +437,32 @@
'libANGLE/renderer/d3d/d3d11/shaders/compiled/buffertotexture11_vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11_fl9vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clear11vs.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/cleardepth11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11_fl9ps.h',
- 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h',
- 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h',
- 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps1.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps2.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps3.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps4.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps5.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps6.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps7.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps8.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps1.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps2.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps3.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps4.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps5.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps6.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps7.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps8.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps1.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps2.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps3.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps4.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps5.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps6.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps7.h',
+ 'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps8.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_rgba_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_rgba_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_rgb_ps.h',
@@ -537,6 +559,8 @@
'libANGLE/renderer/gl/BlitGL.h',
'libANGLE/renderer/gl/BufferGL.cpp',
'libANGLE/renderer/gl/BufferGL.h',
+ 'libANGLE/renderer/gl/ClearMultiviewGL.cpp',
+ 'libANGLE/renderer/gl/ClearMultiviewGL.h',
'libANGLE/renderer/gl/CompilerGL.cpp',
'libANGLE/renderer/gl/CompilerGL.h',
'libANGLE/renderer/gl/ContextGL.cpp',
@@ -545,8 +569,6 @@
'libANGLE/renderer/gl/DisplayGL.h',
'libANGLE/renderer/gl/FenceNVGL.cpp',
'libANGLE/renderer/gl/FenceNVGL.h',
- 'libANGLE/renderer/gl/FenceSyncGL.cpp',
- 'libANGLE/renderer/gl/FenceSyncGL.h',
'libANGLE/renderer/gl/FramebufferGL.cpp',
'libANGLE/renderer/gl/FramebufferGL.h',
'libANGLE/renderer/gl/FunctionsGL.cpp',
@@ -569,6 +591,8 @@
'libANGLE/renderer/gl/StateManagerGL.h',
'libANGLE/renderer/gl/SurfaceGL.cpp',
'libANGLE/renderer/gl/SurfaceGL.h',
+ 'libANGLE/renderer/gl/SyncGL.cpp',
+ 'libANGLE/renderer/gl/SyncGL.h',
'libANGLE/renderer/gl/TextureGL.cpp',
'libANGLE/renderer/gl/TextureGL.h',
'libANGLE/renderer/gl/TransformFeedbackGL.cpp',
@@ -671,8 +695,6 @@
'libANGLE/renderer/vulkan/DisplayVk.h',
'libANGLE/renderer/vulkan/FenceNVVk.cpp',
'libANGLE/renderer/vulkan/FenceNVVk.h',
- 'libANGLE/renderer/vulkan/FenceSyncVk.cpp',
- 'libANGLE/renderer/vulkan/FenceSyncVk.h',
'libANGLE/renderer/vulkan/FramebufferVk.cpp',
'libANGLE/renderer/vulkan/FramebufferVk.h',
'libANGLE/renderer/vulkan/GlslangWrapper.cpp',
@@ -695,6 +717,8 @@
'libANGLE/renderer/vulkan/ShaderVk.h',
'libANGLE/renderer/vulkan/SurfaceVk.cpp',
'libANGLE/renderer/vulkan/SurfaceVk.h',
+ 'libANGLE/renderer/vulkan/SyncVk.cpp',
+ 'libANGLE/renderer/vulkan/SyncVk.h',
'libANGLE/renderer/vulkan/TextureVk.cpp',
'libANGLE/renderer/vulkan/TextureVk.h',
'libANGLE/renderer/vulkan/TransformFeedbackVk.cpp',
@@ -735,8 +759,6 @@
'libANGLE/renderer/null/DisplayNULL.h',
'libANGLE/renderer/null/FenceNVNULL.cpp',
'libANGLE/renderer/null/FenceNVNULL.h',
- 'libANGLE/renderer/null/FenceSyncNULL.cpp',
- 'libANGLE/renderer/null/FenceSyncNULL.h',
'libANGLE/renderer/null/FramebufferNULL.cpp',
'libANGLE/renderer/null/FramebufferNULL.h',
'libANGLE/renderer/null/ImageNULL.cpp',
@@ -755,6 +777,8 @@
'libANGLE/renderer/null/ShaderNULL.h',
'libANGLE/renderer/null/SurfaceNULL.cpp',
'libANGLE/renderer/null/SurfaceNULL.h',
+ 'libANGLE/renderer/null/SyncNULL.cpp',
+ 'libANGLE/renderer/null/SyncNULL.h',
'libANGLE/renderer/null/TextureNULL.cpp',
'libANGLE/renderer/null/TextureNULL.h',
'libANGLE/renderer/null/TransformFeedbackNULL.cpp',
@@ -775,7 +799,7 @@
'libGLESv2/entry_points_gles_2_0_ext.cpp',
'libGLESv2/entry_points_gles_2_0_ext.h',
'libGLESv2/entry_points_gles_3_0.cpp',
- 'libGLESv2/entry_points_gles_3_0.h',
+ 'libGLESv2/entry_points_gles_3_0_autogen.h',
'libGLESv2/entry_points_gles_3_1.cpp',
'libGLESv2/entry_points_gles_3_1.h',
'libGLESv2/global_state.cpp',
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 67583a4e6cb..f66d70eb23e 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_egl.cpp
@@ -10,7 +10,7 @@
#include "libGLESv2/entry_points_egl_ext.h"
#include "libGLESv2/entry_points_gles_2_0_autogen.h"
#include "libGLESv2/entry_points_gles_2_0_ext.h"
-#include "libGLESv2/entry_points_gles_3_0.h"
+#include "libGLESv2/entry_points_gles_3_0_autogen.h"
#include "libGLESv2/entry_points_gles_3_1.h"
#include "libGLESv2/global_state.h"
@@ -393,123 +393,17 @@ EGLBoolean EGLAPIENTRY QuerySurface(EGLDisplay dpy,
dpy, surface, attribute, value);
Thread *thread = GetCurrentThread();
- Display *display = static_cast<Display *>(dpy);
- Surface *eglSurface = (Surface *)surface;
+ const Display *display = static_cast<const Display *>(dpy);
+ const Surface *eglSurface = static_cast<const Surface *>(surface);
- Error error = ValidateSurface(display, eglSurface);
+ Error error = ValidateQuerySurface(display, eglSurface, attribute, value);
if (error.isError())
{
thread->setError(error);
return EGL_FALSE;
}
- if (surface == EGL_NO_SURFACE)
- {
- thread->setError(EglBadSurface());
- return EGL_FALSE;
- }
-
- switch (attribute)
- {
- case EGL_VG_ALPHA_FORMAT:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_VG_COLORSPACE:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_CONFIG_ID:
- *value = eglSurface->getConfig()->configID;
- break;
- case EGL_HEIGHT:
- *value = eglSurface->getHeight();
- break;
- case EGL_HORIZONTAL_RESOLUTION:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_LARGEST_PBUFFER:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_MIPMAP_TEXTURE:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_MIPMAP_LEVEL:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_MULTISAMPLE_RESOLVE:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_PIXEL_ASPECT_RATIO:
- *value = eglSurface->getPixelAspectRatio();
- break;
- case EGL_RENDER_BUFFER:
- *value = eglSurface->getRenderBuffer();
- break;
- case EGL_SWAP_BEHAVIOR:
- *value = eglSurface->getSwapBehavior();
- break;
- case EGL_TEXTURE_FORMAT:
- *value = eglSurface->getTextureFormat();
- break;
- case EGL_TEXTURE_TARGET:
- *value = eglSurface->getTextureTarget();
- break;
- case EGL_VERTICAL_RESOLUTION:
- UNIMPLEMENTED(); // FIXME
- break;
- case EGL_WIDTH:
- *value = eglSurface->getWidth();
- break;
- case EGL_POST_SUB_BUFFER_SUPPORTED_NV:
- if (!display->getExtensions().postSubBuffer)
- {
- thread->setError(EglBadAttribute());
- return EGL_FALSE;
- }
- *value = eglSurface->isPostSubBufferSupported();
- break;
- case EGL_FIXED_SIZE_ANGLE:
- if (!display->getExtensions().windowFixedSize)
- {
- thread->setError(EglBadAttribute());
- return EGL_FALSE;
- }
- *value = eglSurface->isFixedSize();
- break;
- case EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE:
- if (!display->getExtensions().flexibleSurfaceCompatibility)
- {
- thread->setError(
- EglBadAttribute()
- << "EGL_FLEXIBLE_SURFACE_COMPATIBILITY_SUPPORTED_ANGLE cannot be "
- "used without EGL_ANGLE_flexible_surface_compatibility support.");
- return EGL_FALSE;
- }
- *value = eglSurface->flexibleSurfaceCompatibilityRequested();
- break;
- case EGL_SURFACE_ORIENTATION_ANGLE:
- if (!display->getExtensions().surfaceOrientation)
- {
- thread->setError(EglBadAttribute() << "EGL_SURFACE_ORIENTATION_ANGLE cannot be "
- "queried without "
- "EGL_ANGLE_surface_orientation support.");
- return EGL_FALSE;
- }
- *value = eglSurface->getOrientation();
- break;
- case EGL_DIRECT_COMPOSITION_ANGLE:
- if (!display->getExtensions().directComposition)
- {
- thread->setError(EglBadAttribute() << "EGL_DIRECT_COMPOSITION_ANGLE cannot be "
- "used without "
- "EGL_ANGLE_direct_composition support.");
- return EGL_FALSE;
- }
- *value = eglSurface->directComposition();
- break;
- default:
- thread->setError(EglBadAttribute());
- return EGL_FALSE;
- }
+ QuerySurfaceAttrib(eglSurface, attribute, value);
thread->setError(NoError());
return EGL_TRUE;
@@ -920,14 +814,14 @@ EGLBoolean EGLAPIENTRY SurfaceAttrib(EGLDisplay dpy,
Display *display = static_cast<Display *>(dpy);
Surface *eglSurface = static_cast<Surface *>(surface);
- Error error = ValidateSurface(display, eglSurface);
+ Error error = ValidateSurfaceAttrib(display, eglSurface, attribute, value);
if (error.isError())
{
thread->setError(error);
return EGL_FALSE;
}
- UNIMPLEMENTED(); // FIXME
+ SetSurfaceAttrib(eglSurface, attribute, value);
thread->setError(NoError());
return EGL_TRUE;
@@ -1706,8 +1600,7 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
INSERT_PROC_ADDRESS(gl, UniformBlockBinding);
INSERT_PROC_ADDRESS(gl, DrawArraysInstanced);
INSERT_PROC_ADDRESS(gl, DrawElementsInstanced);
- // FenceSync is the name of a class, the function has an added _ to prevent a name conflict.
- INSERT_PROC_ADDRESS_NO_NS("glFenceSync", gl::FenceSync_);
+ INSERT_PROC_ADDRESS(gl, FenceSync);
INSERT_PROC_ADDRESS(gl, IsSync);
INSERT_PROC_ADDRESS(gl, DeleteSync);
INSERT_PROC_ADDRESS(gl, ClientWaitSync);
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp
index 8ccdb1be63b..f4a7ec858fe 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_2_0_autogen.cpp
@@ -8,9 +8,6 @@
// entry_points_gles_2_0_autogen.cpp:
// Defines the GLES 2.0 entry points.
-#include "libGLESv2/entry_points_gles_2_0_autogen.h"
-
-#include "common/debug.h"
#include "libANGLE/Context.h"
#include "libANGLE/validationES2.h"
#include "libGLESv2/global_state.h"
@@ -35,7 +32,7 @@ void GL_APIENTRY ActiveTexture(GLenum texture)
void GL_APIENTRY AttachShader(GLuint program, GLuint shader)
{
- EVENT("(GLuint program = %d, GLuint shader = %d)", program, shader);
+ EVENT("(GLuint program = %u, GLuint shader = %u)", program, shader);
Context *context = GetValidGlobalContext();
if (context)
@@ -51,7 +48,7 @@ void GL_APIENTRY AttachShader(GLuint program, GLuint shader)
void GL_APIENTRY BindAttribLocation(GLuint program, GLuint index, const GLchar *name)
{
- EVENT("(GLuint program = %d, GLuint index = %d, const GLchar *name = 0x%0.8p)", program, index,
+ EVENT("(GLuint program = %u, GLuint index = %u, const GLchar *name = 0x%0.8p)", program, index,
name);
Context *context = GetValidGlobalContext();
@@ -68,7 +65,7 @@ void GL_APIENTRY BindAttribLocation(GLuint program, GLuint index, const GLchar *
void GL_APIENTRY BindBuffer(GLenum target, GLuint buffer)
{
- EVENT("(GLenum target = 0x%X, GLuint buffer = %d)", target, buffer);
+ EVENT("(GLenum target = 0x%X, GLuint buffer = %u)", target, buffer);
Context *context = GetValidGlobalContext();
if (context)
@@ -84,7 +81,7 @@ void GL_APIENTRY BindBuffer(GLenum target, GLuint buffer)
void GL_APIENTRY BindFramebuffer(GLenum target, GLuint framebuffer)
{
- EVENT("(GLenum target = 0x%X, GLuint framebuffer = %d)", target, framebuffer);
+ EVENT("(GLenum target = 0x%X, GLuint framebuffer = %u)", target, framebuffer);
Context *context = GetValidGlobalContext();
if (context)
@@ -100,7 +97,7 @@ void GL_APIENTRY BindFramebuffer(GLenum target, GLuint framebuffer)
void GL_APIENTRY BindRenderbuffer(GLenum target, GLuint renderbuffer)
{
- EVENT("(GLenum target = 0x%X, GLuint renderbuffer = %d)", target, renderbuffer);
+ EVENT("(GLenum target = 0x%X, GLuint renderbuffer = %u)", target, renderbuffer);
Context *context = GetValidGlobalContext();
if (context)
@@ -116,7 +113,7 @@ void GL_APIENTRY BindRenderbuffer(GLenum target, GLuint renderbuffer)
void GL_APIENTRY BindTexture(GLenum target, GLuint texture)
{
- EVENT("(GLenum target = 0x%X, GLuint texture = %d)", target, texture);
+ EVENT("(GLenum target = 0x%X, GLuint texture = %u)", target, texture);
Context *context = GetValidGlobalContext();
if (context)
@@ -272,7 +269,7 @@ GLenum GL_APIENTRY CheckFramebufferStatus(GLenum target)
}
}
- return 0;
+ return GetDefaultReturnValue<EntryPoint::CheckFramebufferStatus, GLenum>();
}
void GL_APIENTRY Clear(GLbitfield mask)
@@ -359,7 +356,7 @@ void GL_APIENTRY ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboo
void GL_APIENTRY CompileShader(GLuint shader)
{
- EVENT("(GLuint shader = %d)", shader);
+ EVENT("(GLuint shader = %u)", shader);
Context *context = GetValidGlobalContext();
if (context)
@@ -508,7 +505,7 @@ GLuint GL_APIENTRY CreateProgram()
}
}
- return 0;
+ return GetDefaultReturnValue<EntryPoint::CreateProgram, GLuint>();
}
GLuint GL_APIENTRY CreateShader(GLenum type)
@@ -526,7 +523,7 @@ GLuint GL_APIENTRY CreateShader(GLenum type)
}
}
- return 0;
+ return GetDefaultReturnValue<EntryPoint::CreateShader, GLuint>();
}
void GL_APIENTRY CullFace(GLenum mode)
@@ -579,7 +576,7 @@ void GL_APIENTRY DeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
void GL_APIENTRY DeleteProgram(GLuint program)
{
- EVENT("(GLuint program = %d)", program);
+ EVENT("(GLuint program = %u)", program);
Context *context = GetValidGlobalContext();
if (context)
@@ -611,7 +608,7 @@ void GL_APIENTRY DeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
void GL_APIENTRY DeleteShader(GLuint shader)
{
- EVENT("(GLuint shader = %d)", shader);
+ EVENT("(GLuint shader = %u)", shader);
Context *context = GetValidGlobalContext();
if (context)
@@ -691,7 +688,7 @@ void GL_APIENTRY DepthRangef(GLfloat n, GLfloat f)
void GL_APIENTRY DetachShader(GLuint program, GLuint shader)
{
- EVENT("(GLuint program = %d, GLuint shader = %d)", program, shader);
+ EVENT("(GLuint program = %u, GLuint shader = %u)", program, shader);
Context *context = GetValidGlobalContext();
if (context)
@@ -723,7 +720,7 @@ void GL_APIENTRY Disable(GLenum cap)
void GL_APIENTRY DisableVertexAttribArray(GLuint index)
{
- EVENT("(GLuint index = %d)", index);
+ EVENT("(GLuint index = %u)", index);
Context *context = GetValidGlobalContext();
if (context)
@@ -790,7 +787,7 @@ void GL_APIENTRY Enable(GLenum cap)
void GL_APIENTRY EnableVertexAttribArray(GLuint index)
{
- EVENT("(GLuint index = %d)", index);
+ EVENT("(GLuint index = %u)", index);
Context *context = GetValidGlobalContext();
if (context)
@@ -843,7 +840,7 @@ void GL_APIENTRY FramebufferRenderbuffer(GLenum target,
{
EVENT(
"(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum renderbuffertarget = 0x%X, GLuint "
- "renderbuffer = %d)",
+ "renderbuffer = %u)",
target, attachment, renderbuffertarget, renderbuffer);
Context *context = GetValidGlobalContext();
@@ -869,7 +866,7 @@ void GL_APIENTRY FramebufferTexture2D(GLenum target,
{
EVENT(
"(GLenum target = 0x%X, GLenum attachment = 0x%X, GLenum textarget = 0x%X, GLuint texture "
- "= %d, GLint level = %d)",
+ "= %u, GLint level = %d)",
target, attachment, textarget, texture, level);
Context *context = GetValidGlobalContext();
@@ -991,7 +988,7 @@ void GL_APIENTRY GetActiveAttrib(GLuint program,
GLchar *name)
{
EVENT(
- "(GLuint program = %d, GLuint index = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, "
+ "(GLuint program = %u, GLuint index = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, "
"GLint *size = 0x%0.8p, GLenum *type = 0x%0.8p, GLchar *name = 0x%0.8p)",
program, index, bufSize, length, size, type, name);
@@ -1018,7 +1015,7 @@ void GL_APIENTRY GetActiveUniform(GLuint program,
GLchar *name)
{
EVENT(
- "(GLuint program = %d, GLuint index = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, "
+ "(GLuint program = %u, GLuint index = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, "
"GLint *size = 0x%0.8p, GLenum *type = 0x%0.8p, GLchar *name = 0x%0.8p)",
program, index, bufSize, length, size, type, name);
@@ -1042,7 +1039,7 @@ void GL_APIENTRY GetAttachedShaders(GLuint program,
GLuint *shaders)
{
EVENT(
- "(GLuint program = %d, GLsizei maxCount = %d, GLsizei *count = 0x%0.8p, GLuint *shaders = "
+ "(GLuint program = %u, GLsizei maxCount = %d, GLsizei *count = 0x%0.8p, GLuint *shaders = "
"0x%0.8p)",
program, maxCount, count, shaders);
@@ -1061,7 +1058,7 @@ void GL_APIENTRY GetAttachedShaders(GLuint program,
GLint GL_APIENTRY GetAttribLocation(GLuint program, const GLchar *name)
{
- EVENT("(GLuint program = %d, const GLchar *name = 0x%0.8p)", program, name);
+ EVENT("(GLuint program = %u, const GLchar *name = 0x%0.8p)", program, name);
Context *context = GetValidGlobalContext();
if (context)
@@ -1074,7 +1071,7 @@ GLint GL_APIENTRY GetAttribLocation(GLuint program, const GLchar *name)
}
}
- return 0;
+ return GetDefaultReturnValue<EntryPoint::GetAttribLocation, GLint>();
}
void GL_APIENTRY GetBooleanv(GLenum pname, GLboolean *data)
@@ -1126,7 +1123,7 @@ GLenum GL_APIENTRY GetError()
}
}
- return 0;
+ return GetDefaultReturnValue<EntryPoint::GetError, GLenum>();
}
void GL_APIENTRY GetFloatv(GLenum pname, GLfloat *data)
@@ -1187,7 +1184,7 @@ void GL_APIENTRY GetIntegerv(GLenum pname, GLint *data)
void GL_APIENTRY GetProgramiv(GLuint program, GLenum pname, GLint *params)
{
- EVENT("(GLuint program = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", program, pname,
+ EVENT("(GLuint program = %u, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", program, pname,
params);
Context *context = GetValidGlobalContext();
@@ -1208,7 +1205,7 @@ void GL_APIENTRY GetProgramInfoLog(GLuint program,
GLchar *infoLog)
{
EVENT(
- "(GLuint program = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *infoLog = "
+ "(GLuint program = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *infoLog = "
"0x%0.8p)",
program, bufSize, length, infoLog);
@@ -1245,7 +1242,7 @@ void GL_APIENTRY GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint *
void GL_APIENTRY GetShaderiv(GLuint shader, GLenum pname, GLint *params)
{
- EVENT("(GLuint shader = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", shader, pname,
+ EVENT("(GLuint shader = %u, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", shader, pname,
params);
Context *context = GetValidGlobalContext();
@@ -1263,7 +1260,7 @@ void GL_APIENTRY GetShaderiv(GLuint shader, GLenum pname, GLint *params)
void GL_APIENTRY GetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog)
{
EVENT(
- "(GLuint shader = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *infoLog = "
+ "(GLuint shader = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *infoLog = "
"0x%0.8p)",
shader, bufSize, length, infoLog);
@@ -1307,7 +1304,7 @@ void GL_APIENTRY GetShaderPrecisionFormat(GLenum shadertype,
void GL_APIENTRY GetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source)
{
EVENT(
- "(GLuint shader = %d, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *source = "
+ "(GLuint shader = %u, GLsizei bufSize = %d, GLsizei *length = 0x%0.8p, GLchar *source = "
"0x%0.8p)",
shader, bufSize, length, source);
@@ -1339,7 +1336,7 @@ const GLubyte *GL_APIENTRY GetString(GLenum name)
}
}
- return nullptr;
+ return GetDefaultReturnValue<EntryPoint::GetString, const GLubyte *>();
}
void GL_APIENTRY GetTexParameterfv(GLenum target, GLenum pname, GLfloat *params)
@@ -1378,7 +1375,7 @@ void GL_APIENTRY GetTexParameteriv(GLenum target, GLenum pname, GLint *params)
void GL_APIENTRY GetUniformfv(GLuint program, GLint location, GLfloat *params)
{
- EVENT("(GLuint program = %d, GLint location = %d, GLfloat *params = 0x%0.8p)", program,
+ EVENT("(GLuint program = %u, GLint location = %d, GLfloat *params = 0x%0.8p)", program,
location, params);
Context *context = GetValidGlobalContext();
@@ -1395,7 +1392,7 @@ void GL_APIENTRY GetUniformfv(GLuint program, GLint location, GLfloat *params)
void GL_APIENTRY GetUniformiv(GLuint program, GLint location, GLint *params)
{
- EVENT("(GLuint program = %d, GLint location = %d, GLint *params = 0x%0.8p)", program, location,
+ EVENT("(GLuint program = %u, GLint location = %d, GLint *params = 0x%0.8p)", program, location,
params);
Context *context = GetValidGlobalContext();
@@ -1412,7 +1409,7 @@ void GL_APIENTRY GetUniformiv(GLuint program, GLint location, GLint *params)
GLint GL_APIENTRY GetUniformLocation(GLuint program, const GLchar *name)
{
- EVENT("(GLuint program = %d, const GLchar *name = 0x%0.8p)", program, name);
+ EVENT("(GLuint program = %u, const GLchar *name = 0x%0.8p)", program, name);
Context *context = GetValidGlobalContext();
if (context)
@@ -1425,12 +1422,12 @@ GLint GL_APIENTRY GetUniformLocation(GLuint program, const GLchar *name)
}
}
- return 0;
+ return GetDefaultReturnValue<EntryPoint::GetUniformLocation, GLint>();
}
void GL_APIENTRY GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params)
{
- EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLfloat *params = 0x%0.8p)", index, pname,
+ EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLfloat *params = 0x%0.8p)", index, pname,
params);
Context *context = GetValidGlobalContext();
@@ -1447,7 +1444,7 @@ void GL_APIENTRY GetVertexAttribfv(GLuint index, GLenum pname, GLfloat *params)
void GL_APIENTRY GetVertexAttribiv(GLuint index, GLenum pname, GLint *params)
{
- EVENT("(GLuint index = %d, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", index, pname,
+ EVENT("(GLuint index = %u, GLenum pname = 0x%X, GLint *params = 0x%0.8p)", index, pname,
params);
Context *context = GetValidGlobalContext();
@@ -1464,7 +1461,7 @@ void GL_APIENTRY GetVertexAttribiv(GLuint index, GLenum pname, GLint *params)
void GL_APIENTRY GetVertexAttribPointerv(GLuint index, GLenum pname, void **pointer)
{
- EVENT("(GLuint index = %d, GLenum pname = 0x%X, void **pointer = 0x%0.8p)", index, pname,
+ EVENT("(GLuint index = %u, GLenum pname = 0x%X, void **pointer = 0x%0.8p)", index, pname,
pointer);
Context *context = GetValidGlobalContext();
@@ -1498,7 +1495,7 @@ void GL_APIENTRY Hint(GLenum target, GLenum mode)
GLboolean GL_APIENTRY IsBuffer(GLuint buffer)
{
- EVENT("(GLuint buffer = %d)", buffer);
+ EVENT("(GLuint buffer = %u)", buffer);
Context *context = GetValidGlobalContext();
if (context)
@@ -1511,7 +1508,7 @@ GLboolean GL_APIENTRY IsBuffer(GLuint buffer)
}
}
- return GL_FALSE;
+ return GetDefaultReturnValue<EntryPoint::IsBuffer, GLboolean>();
}
GLboolean GL_APIENTRY IsEnabled(GLenum cap)
@@ -1529,12 +1526,12 @@ GLboolean GL_APIENTRY IsEnabled(GLenum cap)
}
}
- return GL_FALSE;
+ return GetDefaultReturnValue<EntryPoint::IsEnabled, GLboolean>();
}
GLboolean GL_APIENTRY IsFramebuffer(GLuint framebuffer)
{
- EVENT("(GLuint framebuffer = %d)", framebuffer);
+ EVENT("(GLuint framebuffer = %u)", framebuffer);
Context *context = GetValidGlobalContext();
if (context)
@@ -1547,12 +1544,12 @@ GLboolean GL_APIENTRY IsFramebuffer(GLuint framebuffer)
}
}
- return GL_FALSE;
+ return GetDefaultReturnValue<EntryPoint::IsFramebuffer, GLboolean>();
}
GLboolean GL_APIENTRY IsProgram(GLuint program)
{
- EVENT("(GLuint program = %d)", program);
+ EVENT("(GLuint program = %u)", program);
Context *context = GetValidGlobalContext();
if (context)
@@ -1565,12 +1562,12 @@ GLboolean GL_APIENTRY IsProgram(GLuint program)
}
}
- return GL_FALSE;
+ return GetDefaultReturnValue<EntryPoint::IsProgram, GLboolean>();
}
GLboolean GL_APIENTRY IsRenderbuffer(GLuint renderbuffer)
{
- EVENT("(GLuint renderbuffer = %d)", renderbuffer);
+ EVENT("(GLuint renderbuffer = %u)", renderbuffer);
Context *context = GetValidGlobalContext();
if (context)
@@ -1583,12 +1580,12 @@ GLboolean GL_APIENTRY IsRenderbuffer(GLuint renderbuffer)
}
}
- return GL_FALSE;
+ return GetDefaultReturnValue<EntryPoint::IsRenderbuffer, GLboolean>();
}
GLboolean GL_APIENTRY IsShader(GLuint shader)
{
- EVENT("(GLuint shader = %d)", shader);
+ EVENT("(GLuint shader = %u)", shader);
Context *context = GetValidGlobalContext();
if (context)
@@ -1601,12 +1598,12 @@ GLboolean GL_APIENTRY IsShader(GLuint shader)
}
}
- return GL_FALSE;
+ return GetDefaultReturnValue<EntryPoint::IsShader, GLboolean>();
}
GLboolean GL_APIENTRY IsTexture(GLuint texture)
{
- EVENT("(GLuint texture = %d)", texture);
+ EVENT("(GLuint texture = %u)", texture);
Context *context = GetValidGlobalContext();
if (context)
@@ -1619,7 +1616,7 @@ GLboolean GL_APIENTRY IsTexture(GLuint texture)
}
}
- return GL_FALSE;
+ return GetDefaultReturnValue<EntryPoint::IsTexture, GLboolean>();
}
void GL_APIENTRY LineWidth(GLfloat width)
@@ -1640,7 +1637,7 @@ void GL_APIENTRY LineWidth(GLfloat width)
void GL_APIENTRY LinkProgram(GLuint program)
{
- EVENT("(GLuint program = %d)", program);
+ EVENT("(GLuint program = %u)", program);
Context *context = GetValidGlobalContext();
if (context)
@@ -1816,7 +1813,7 @@ void GL_APIENTRY ShaderSource(GLuint shader,
const GLint *length)
{
EVENT(
- "(GLuint shader = %d, GLsizei count = %d, const GLchar *const*string = 0x%0.8p, const "
+ "(GLuint shader = %u, GLsizei count = %d, const GLchar *const*string = 0x%0.8p, const "
"GLint *length = 0x%0.8p)",
shader, count, string, length);
@@ -1835,7 +1832,7 @@ void GL_APIENTRY ShaderSource(GLuint shader,
void GL_APIENTRY StencilFunc(GLenum func, GLint ref, GLuint mask)
{
- EVENT("(GLenum func = 0x%X, GLint ref = %d, GLuint mask = %d)", func, ref, mask);
+ EVENT("(GLenum func = 0x%X, GLint ref = %d, GLuint mask = %u)", func, ref, mask);
Context *context = GetValidGlobalContext();
if (context)
@@ -1851,7 +1848,7 @@ void GL_APIENTRY StencilFunc(GLenum func, GLint ref, GLuint mask)
void GL_APIENTRY StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
{
- EVENT("(GLenum face = 0x%X, GLenum func = 0x%X, GLint ref = %d, GLuint mask = %d)", face, func,
+ EVENT("(GLenum face = 0x%X, GLenum func = 0x%X, GLint ref = %d, GLuint mask = %u)", face, func,
ref, mask);
Context *context = GetValidGlobalContext();
@@ -1869,7 +1866,7 @@ void GL_APIENTRY StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint
void GL_APIENTRY StencilMask(GLuint mask)
{
- EVENT("(GLuint mask = %d)", mask);
+ EVENT("(GLuint mask = %u)", mask);
Context *context = GetValidGlobalContext();
if (context)
@@ -1885,7 +1882,7 @@ void GL_APIENTRY StencilMask(GLuint mask)
void GL_APIENTRY StencilMaskSeparate(GLenum face, GLuint mask)
{
- EVENT("(GLenum face = 0x%X, GLuint mask = %d)", face, mask);
+ EVENT("(GLenum face = 0x%X, GLuint mask = %u)", face, mask);
Context *context = GetValidGlobalContext();
if (context)
@@ -2403,7 +2400,7 @@ void GL_APIENTRY UniformMatrix4fv(GLint location,
void GL_APIENTRY UseProgram(GLuint program)
{
- EVENT("(GLuint program = %d)", program);
+ EVENT("(GLuint program = %u)", program);
Context *context = GetValidGlobalContext();
if (context)
@@ -2419,7 +2416,7 @@ void GL_APIENTRY UseProgram(GLuint program)
void GL_APIENTRY ValidateProgram(GLuint program)
{
- EVENT("(GLuint program = %d)", program);
+ EVENT("(GLuint program = %u)", program);
Context *context = GetValidGlobalContext();
if (context)
@@ -2435,7 +2432,7 @@ void GL_APIENTRY ValidateProgram(GLuint program)
void GL_APIENTRY VertexAttrib1f(GLuint index, GLfloat x)
{
- EVENT("(GLuint index = %d, GLfloat x = %f)", index, x);
+ EVENT("(GLuint index = %u, GLfloat x = %f)", index, x);
Context *context = GetValidGlobalContext();
if (context)
@@ -2451,7 +2448,7 @@ void GL_APIENTRY VertexAttrib1f(GLuint index, GLfloat x)
void GL_APIENTRY VertexAttrib1fv(GLuint index, const GLfloat *v)
{
- EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
+ EVENT("(GLuint index = %u, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext();
if (context)
@@ -2467,7 +2464,7 @@ void GL_APIENTRY VertexAttrib1fv(GLuint index, const GLfloat *v)
void GL_APIENTRY VertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
{
- EVENT("(GLuint index = %d, GLfloat x = %f, GLfloat y = %f)", index, x, y);
+ EVENT("(GLuint index = %u, GLfloat x = %f, GLfloat y = %f)", index, x, y);
Context *context = GetValidGlobalContext();
if (context)
@@ -2483,7 +2480,7 @@ void GL_APIENTRY VertexAttrib2f(GLuint index, GLfloat x, GLfloat y)
void GL_APIENTRY VertexAttrib2fv(GLuint index, const GLfloat *v)
{
- EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
+ EVENT("(GLuint index = %u, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext();
if (context)
@@ -2499,7 +2496,7 @@ void GL_APIENTRY VertexAttrib2fv(GLuint index, const GLfloat *v)
void GL_APIENTRY VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
{
- EVENT("(GLuint index = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", index, x, y, z);
+ EVENT("(GLuint index = %u, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f)", index, x, y, z);
Context *context = GetValidGlobalContext();
if (context)
@@ -2515,7 +2512,7 @@ void GL_APIENTRY VertexAttrib3f(GLuint index, GLfloat x, GLfloat y, GLfloat z)
void GL_APIENTRY VertexAttrib3fv(GLuint index, const GLfloat *v)
{
- EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
+ EVENT("(GLuint index = %u, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext();
if (context)
@@ -2531,7 +2528,7 @@ void GL_APIENTRY VertexAttrib3fv(GLuint index, const GLfloat *v)
void GL_APIENTRY VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
{
- EVENT("(GLuint index = %d, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f, GLfloat w = %f)",
+ EVENT("(GLuint index = %u, GLfloat x = %f, GLfloat y = %f, GLfloat z = %f, GLfloat w = %f)",
index, x, y, z, w);
Context *context = GetValidGlobalContext();
@@ -2548,7 +2545,7 @@ void GL_APIENTRY VertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, G
void GL_APIENTRY VertexAttrib4fv(GLuint index, const GLfloat *v)
{
- EVENT("(GLuint index = %d, const GLfloat *v = 0x%0.8p)", index, v);
+ EVENT("(GLuint index = %u, const GLfloat *v = 0x%0.8p)", index, v);
Context *context = GetValidGlobalContext();
if (context)
@@ -2570,7 +2567,7 @@ void GL_APIENTRY VertexAttribPointer(GLuint index,
const void *pointer)
{
EVENT(
- "(GLuint index = %d, GLint size = %d, GLenum type = 0x%X, GLboolean normalized = %u, "
+ "(GLuint index = %u, GLint size = %d, GLenum type = 0x%X, GLboolean normalized = %u, "
"GLsizei stride = %d, const void *pointer = 0x%0.8p)",
index, size, type, normalized, stride, pointer);
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 d722af3f2dd..0def42070cd 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
@@ -52,15 +52,12 @@ void GL_APIENTRY GenQueriesEXT(GLsizei n, GLuint *ids)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation() && !ValidateGenQueriesEXT(context, n))
+ if (!context->skipValidation() && !ValidateGenQueriesEXT(context, n, ids))
{
return;
}
- for (GLsizei i = 0; i < n; i++)
- {
- ids[i] = context->createQuery();
- }
+ context->genQueries(n, ids);
}
}
@@ -71,15 +68,12 @@ void GL_APIENTRY DeleteQueriesEXT(GLsizei n, const GLuint *ids)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation() && !ValidateDeleteQueriesEXT(context, n))
+ if (!context->skipValidation() && !ValidateDeleteQueriesEXT(context, n, ids))
{
return;
}
- for (int i = 0; i < n; i++)
- {
- context->deleteQuery(ids[i]);
- }
+ context->deleteQueries(n, ids);
}
}
@@ -90,7 +84,12 @@ GLboolean GL_APIENTRY IsQueryEXT(GLuint id)
Context *context = GetValidGlobalContext();
if (context)
{
- return (context->getQuery(id, false, GL_NONE) != nullptr) ? GL_TRUE : GL_FALSE;
+ if (!context->skipValidation() && !ValidateIsQueryEXT(context, id))
+ {
+ return GL_FALSE;
+ }
+
+ return context->isQuery(id);
}
return GL_FALSE;
@@ -103,17 +102,12 @@ void GL_APIENTRY BeginQueryEXT(GLenum target, GLuint id)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateBeginQueryEXT(context, target, id))
+ if (!context->skipValidation() && !ValidateBeginQueryEXT(context, target, id))
{
return;
}
- Error error = context->beginQuery(target, id);
- if (error.isError())
- {
- context->handleError(error);
- return;
- }
+ context->beginQuery(target, id);
}
}
@@ -124,17 +118,12 @@ void GL_APIENTRY EndQueryEXT(GLenum target)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateEndQueryEXT(context, target))
+ if (!context->skipValidation() && !ValidateEndQueryEXT(context, target))
{
return;
}
- Error error = context->endQuery(target);
- if (error.isError())
- {
- context->handleError(error);
- return;
- }
+ context->endQuery(target);
}
}
@@ -145,17 +134,12 @@ void GL_APIENTRY QueryCounterEXT(GLuint id, GLenum target)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateQueryCounterEXT(context, id, target))
+ if (!context->skipValidation() && !ValidateQueryCounterEXT(context, id, target))
{
return;
}
- Error error = context->queryCounter(id, target);
- if (error.isError())
- {
- context->handleError(error);
- return;
- }
+ context->queryCounter(id, target);
}
}
@@ -474,7 +458,7 @@ void GL_APIENTRY GetnUniformfvEXT(GLuint program, GLint location, GLsizei bufSiz
Program *programObject = context->getProgram(program);
ASSERT(programObject);
- programObject->getUniformfv(location, params);
+ programObject->getUniformfv(context, location, params);
}
}
@@ -495,7 +479,7 @@ void GL_APIENTRY GetnUniformivEXT(GLuint program, GLint location, GLsizei bufSiz
Program *programObject = context->getProgram(program);
ASSERT(programObject);
- programObject->getUniformiv(location, params);
+ programObject->getUniformiv(context, location, params);
}
}
@@ -706,7 +690,7 @@ void GL_APIENTRY VertexAttribDivisorANGLE(GLuint index, GLuint divisor)
}
}
- context->setVertexAttribDivisor(index, divisor);
+ context->vertexAttribDivisor(index, divisor);
}
}
@@ -1073,7 +1057,7 @@ void GL_APIENTRY BindVertexArrayOES(GLuint array)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateBindVertexArrayOES(context, array))
+ if (!context->skipValidation() && !ValidateBindVertexArrayOES(context, array))
{
return;
}
@@ -1089,18 +1073,12 @@ void GL_APIENTRY DeleteVertexArraysOES(GLsizei n, const GLuint *arrays)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateDeleteVertexArraysOES(context, n))
+ if (!context->skipValidation() && !ValidateDeleteVertexArraysOES(context, n, arrays))
{
return;
}
- for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
- {
- if (arrays[arrayIndex] != 0)
- {
- context->deleteVertexArray(arrays[arrayIndex]);
- }
- }
+ context->deleteVertexArrays(n, arrays);
}
}
@@ -1111,15 +1089,12 @@ void GL_APIENTRY GenVertexArraysOES(GLsizei n, GLuint *arrays)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateGenVertexArraysOES(context, n))
+ if (!context->skipValidation() && !ValidateGenVertexArraysOES(context, n, arrays))
{
return;
}
- for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
- {
- arrays[arrayIndex] = context->createVertexArray();
- }
+ context->genVertexArrays(n, arrays);
}
}
@@ -1130,19 +1105,12 @@ GLboolean GL_APIENTRY IsVertexArrayOES(GLuint array)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateIsVertexArrayOES(context))
- {
- return GL_FALSE;
- }
-
- if (array == 0)
+ if (!context->skipValidation() && !ValidateIsVertexArrayOES(context, array))
{
return GL_FALSE;
}
- VertexArray *vao = context->getVertexArray(array);
-
- return (vao != nullptr ? GL_TRUE : GL_FALSE);
+ return context->isVertexArray(array);
}
return GL_FALSE;
@@ -2288,7 +2256,7 @@ ANGLE_EXPORT void GL_APIENTRY GetUniformfvRobustANGLE(GLuint program,
Program *programObject = context->getProgram(program);
ASSERT(programObject);
- programObject->getUniformfv(location, params);
+ programObject->getUniformfv(context, location, params);
SetRobustLengthParam(length, writeLength);
}
}
@@ -2317,7 +2285,7 @@ ANGLE_EXPORT void GL_APIENTRY GetUniformivRobustANGLE(GLuint program,
Program *programObject = context->getProgram(program);
ASSERT(programObject);
- programObject->getUniformiv(location, params);
+ programObject->getUniformiv(context, location, params);
SetRobustLengthParam(length, writeLength);
}
}
@@ -2946,7 +2914,7 @@ ANGLE_EXPORT void GL_APIENTRY GetUniformuivRobustANGLE(GLuint program,
Program *programObject = context->getProgram(program);
ASSERT(programObject);
- programObject->getUniformuiv(location, params);
+ programObject->getUniformuiv(context, location, params);
SetRobustLengthParam(length, writeLength);
}
}
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 167d1ba2a58..b4440f7a70c 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
@@ -6,25 +6,9 @@
// entry_points_gles_3_0.cpp : Implements the GLES 3.0 entry points.
-#include "libGLESv2/entry_points_gles_3_0.h"
-#include "libGLESv2/entry_points_gles_2_0_ext.h"
-#include "libGLESv2/global_state.h"
-
-#include "libANGLE/Buffer.h"
#include "libANGLE/Context.h"
-#include "libANGLE/Error.h"
-#include "libANGLE/Fence.h"
-#include "libANGLE/Framebuffer.h"
-#include "libANGLE/Query.h"
-#include "libANGLE/VertexArray.h"
-#include "libANGLE/formatutils.h"
-
-#include "libANGLE/queryconversions.h"
-#include "libANGLE/queryutils.h"
-#include "libANGLE/validationES.h"
#include "libANGLE/validationES3.h"
-
-#include "common/debug.h"
+#include "libGLESv2/global_state.h"
namespace gl
{
@@ -245,10 +229,7 @@ void GL_APIENTRY GenQueries(GLsizei n, GLuint *ids)
return;
}
- for (GLsizei i = 0; i < n; i++)
- {
- ids[i] = context->createQuery();
- }
+ context->genQueries(n, ids);
}
}
@@ -264,10 +245,7 @@ void GL_APIENTRY DeleteQueries(GLsizei n, const GLuint *ids)
return;
}
- for (int i = 0; i < n; i++)
- {
- context->deleteQuery(ids[i]);
- }
+ context->deleteQueries(n, ids);
}
}
@@ -278,13 +256,12 @@ GLboolean GL_APIENTRY IsQuery(GLuint id)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateIsQuery(context, id))
{
- context->handleError(InvalidOperation());
return GL_FALSE;
}
- return (context->getQuery(id, false, GL_NONE) != nullptr) ? GL_TRUE : GL_FALSE;
+ return context->isQuery(id);
}
return GL_FALSE;
@@ -297,17 +274,12 @@ void GL_APIENTRY BeginQuery(GLenum target, GLuint id)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateBeginQuery(context, target, id))
+ if (!context->skipValidation() && !ValidateBeginQuery(context, target, id))
{
return;
}
- Error error = context->beginQuery(target, id);
- if (error.isError())
- {
- context->handleError(error);
- return;
- }
+ context->beginQuery(target, id);
}
}
@@ -318,17 +290,12 @@ void GL_APIENTRY EndQuery(GLenum target)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateEndQuery(context, target))
+ if (!context->skipValidation() && !ValidateEndQuery(context, target))
{
return;
}
- Error error = context->endQuery(target);
- if (error.isError())
- {
- context->handleError(error);
- return;
- }
+ context->endQuery(target);
}
}
@@ -340,7 +307,7 @@ void GL_APIENTRY GetQueryiv(GLenum target, GLenum pname, GLint *params)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateGetQueryiv(context, target, pname, params))
+ if (!context->skipValidation() && !ValidateGetQueryiv(context, target, pname, params))
{
return;
}
@@ -356,7 +323,7 @@ void GL_APIENTRY GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateGetQueryObjectuiv(context, id, pname, params))
+ if (!context->skipValidation() && !ValidateGetQueryObjectuiv(context, id, pname, params))
{
return;
}
@@ -428,13 +395,13 @@ void GL_APIENTRY UniformMatrix2x3fv(GLint location,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniformMatrix(context, GL_FLOAT_MAT2x3, location, count, transpose))
+ if (!context->skipValidation() &&
+ !ValidateUniformMatrix2x3fv(context, location, count, transpose, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniformMatrix2x3fv(location, count, transpose, value);
+ context->uniformMatrix2x3fv(location, count, transpose, value);
}
}
@@ -451,13 +418,13 @@ void GL_APIENTRY UniformMatrix3x2fv(GLint location,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniformMatrix(context, GL_FLOAT_MAT3x2, location, count, transpose))
+ if (!context->skipValidation() &&
+ !ValidateUniformMatrix3x2fv(context, location, count, transpose, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniformMatrix3x2fv(location, count, transpose, value);
+ context->uniformMatrix3x2fv(location, count, transpose, value);
}
}
@@ -474,13 +441,13 @@ void GL_APIENTRY UniformMatrix2x4fv(GLint location,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniformMatrix(context, GL_FLOAT_MAT2x4, location, count, transpose))
+ if (!context->skipValidation() &&
+ !ValidateUniformMatrix2x4fv(context, location, count, transpose, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniformMatrix2x4fv(location, count, transpose, value);
+ context->uniformMatrix2x4fv(location, count, transpose, value);
}
}
@@ -497,13 +464,13 @@ void GL_APIENTRY UniformMatrix4x2fv(GLint location,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniformMatrix(context, GL_FLOAT_MAT4x2, location, count, transpose))
+ if (!context->skipValidation() &&
+ !ValidateUniformMatrix4x2fv(context, location, count, transpose, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniformMatrix4x2fv(location, count, transpose, value);
+ context->uniformMatrix4x2fv(location, count, transpose, value);
}
}
@@ -520,13 +487,13 @@ void GL_APIENTRY UniformMatrix3x4fv(GLint location,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniformMatrix(context, GL_FLOAT_MAT3x4, location, count, transpose))
+ if (!context->skipValidation() &&
+ !ValidateUniformMatrix3x4fv(context, location, count, transpose, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniformMatrix3x4fv(location, count, transpose, value);
+ context->uniformMatrix3x4fv(location, count, transpose, value);
}
}
@@ -543,13 +510,13 @@ void GL_APIENTRY UniformMatrix4x3fv(GLint location,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniformMatrix(context, GL_FLOAT_MAT4x3, location, count, transpose))
+ if (!context->skipValidation() &&
+ !ValidateUniformMatrix4x3fv(context, location, count, transpose, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniformMatrix4x3fv(location, count, transpose, value);
+ context->uniformMatrix4x3fv(location, count, transpose, value);
}
}
@@ -703,13 +670,7 @@ void GL_APIENTRY DeleteVertexArrays(GLsizei n, const GLuint *arrays)
return;
}
- for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
- {
- if (arrays[arrayIndex] != 0)
- {
- context->deleteVertexArray(arrays[arrayIndex]);
- }
- }
+ context->deleteVertexArrays(n, arrays);
}
}
@@ -725,10 +686,7 @@ void GL_APIENTRY GenVertexArrays(GLsizei n, GLuint *arrays)
return;
}
- for (int arrayIndex = 0; arrayIndex < n; arrayIndex++)
- {
- arrays[arrayIndex] = context->createVertexArray();
- }
+ context->genVertexArrays(n, arrays);
}
}
@@ -739,19 +697,12 @@ GLboolean GL_APIENTRY IsVertexArray(GLuint array)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateIsVertexArray(context))
+ if (!context->skipValidation() && !ValidateIsVertexArray(context, array))
{
return GL_FALSE;
}
- if (array == 0)
- {
- return GL_FALSE;
- }
-
- VertexArray *vao = context->getVertexArray(array);
-
- return (vao != nullptr ? GL_TRUE : GL_FALSE);
+ return context->isVertexArray(array);
}
return GL_FALSE;
@@ -768,6 +719,7 @@ void GL_APIENTRY GetIntegeri_v(GLenum target, GLuint index, GLint *data)
{
return;
}
+
context->getIntegeri_v(target, index, data);
}
}
@@ -795,22 +747,12 @@ void GL_APIENTRY EndTransformFeedback(void)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateEndTransformFeedback(context))
{
- context->handleError(InvalidOperation());
return;
}
- TransformFeedback *transformFeedback = context->getGLState().getCurrentTransformFeedback();
- ASSERT(transformFeedback != nullptr);
-
- if (!transformFeedback->isActive())
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- transformFeedback->end(context);
+ context->endTransformFeedback();
}
}
@@ -830,6 +772,7 @@ BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLs
{
return;
}
+
context->bindBufferRange(target, index, buffer, offset, size);
}
}
@@ -845,6 +788,7 @@ void GL_APIENTRY BindBufferBase(GLenum target, GLuint index, GLuint buffer)
{
return;
}
+
context->bindBufferBase(target, index, buffer);
}
}
@@ -862,42 +806,13 @@ void GL_APIENTRY TransformFeedbackVaryings(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (count < 0)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- const Caps &caps = context->getCaps();
- switch (bufferMode)
- {
- case GL_INTERLEAVED_ATTRIBS:
- break;
- case GL_SEPARATE_ATTRIBS:
- if (static_cast<GLuint>(count) > caps.maxTransformFeedbackSeparateAttributes)
- {
- context->handleError(InvalidValue());
- return;
- }
- break;
- default:
- context->handleError(InvalidEnum());
- return;
- }
-
- Program *programObject = GetValidProgram(context, program);
- if (!programObject)
+ if (!context->skipValidation() &&
+ !ValidateTransformFeedbackVaryings(context, program, count, varyings, bufferMode))
{
return;
}
- programObject->setTransformFeedbackVaryings(count, varyings, bufferMode);
+ context->transformFeedbackVaryings(program, count, varyings, bufferMode);
}
}
@@ -917,31 +832,14 @@ void GL_APIENTRY GetTransformFeedbackVarying(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (bufSize < 0)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- Program *programObject = GetValidProgram(context, program);
- if (!programObject)
- {
- return;
- }
-
- if (index >= static_cast<GLuint>(programObject->getTransformFeedbackVaryingCount()))
+ if (!context->skipValidation() &&
+ !ValidateGetTransformFeedbackVarying(context, program, index, bufSize, length, size,
+ type, name))
{
- context->handleError(InvalidValue());
return;
}
- programObject->getTransformFeedbackVarying(index, bufSize, length, size, type, name);
+ context->getTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
}
}
@@ -1010,15 +908,8 @@ void GL_APIENTRY VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (index >= MAX_VERTEX_ATTRIBS)
+ if (!context->skipValidation() && !ValidateVertexAttribI4i(context, index, x, y, z, w))
{
- context->handleError(InvalidValue());
return;
}
@@ -1034,15 +925,8 @@ void GL_APIENTRY VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GL
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateVertexAttribI4ui(context, index, x, y, z, w))
{
- context->handleError(InvalidOperation());
- return;
- }
-
- if (index >= MAX_VERTEX_ATTRIBS)
- {
- context->handleError(InvalidValue());
return;
}
@@ -1057,15 +941,8 @@ void GL_APIENTRY VertexAttribI4iv(GLuint index, const GLint *v)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateVertexAttribI4iv(context, index, v))
{
- context->handleError(InvalidOperation());
- return;
- }
-
- if (index >= MAX_VERTEX_ATTRIBS)
- {
- context->handleError(InvalidValue());
return;
}
@@ -1080,15 +957,8 @@ void GL_APIENTRY VertexAttribI4uiv(GLuint index, const GLuint *v)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateVertexAttribI4uiv(context, index, v))
{
- context->handleError(InvalidOperation());
- return;
- }
-
- if (index >= MAX_VERTEX_ATTRIBS)
- {
- context->handleError(InvalidValue());
return;
}
@@ -1104,15 +974,13 @@ void GL_APIENTRY GetUniformuiv(GLuint program, GLint location, GLuint *params)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateGetUniformuiv(context, program, location, params))
+ if (!context->skipValidation() &&
+ !ValidateGetUniformuiv(context, program, location, params))
{
return;
}
- Program *programObject = context->getProgram(program);
- ASSERT(programObject);
-
- programObject->getUniformuiv(location, params);
+ context->getUniformuiv(program, location, params);
}
}
@@ -1123,53 +991,81 @@ GLint GL_APIENTRY GetFragDataLocation(GLuint program, const GLchar *name)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateGetFragDataLocation(context, program, name))
{
- context->handleError(InvalidOperation());
return -1;
}
- if (program == 0)
- {
- context->handleError(InvalidValue());
- return -1;
- }
-
- Program *programObject = context->getProgram(program);
-
- if (!programObject || !programObject->isLinked())
- {
- context->handleError(InvalidOperation());
- return -1;
- }
-
- return programObject->getFragDataLocation(name);
+ return context->getFragDataLocation(program, name);
}
- return 0;
+ return -1;
}
void GL_APIENTRY Uniform1ui(GLint location, GLuint v0)
{
- Uniform1uiv(location, 1, &v0);
+ EVENT("(GLint location = %d, GLuint v0 = %u)", location, v0);
+
+ Context *context = GetValidGlobalContext();
+ if (context)
+ {
+ if (!context->skipValidation() && !ValidateUniform1ui(context, location, v0))
+ {
+ return;
+ }
+
+ context->uniform1ui(location, v0);
+ }
}
void GL_APIENTRY Uniform2ui(GLint location, GLuint v0, GLuint v1)
{
- const GLuint xy[] = {v0, v1};
- Uniform2uiv(location, 1, xy);
+ EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u)", location, v0, v1);
+
+ Context *context = GetValidGlobalContext();
+ if (context)
+ {
+ if (!context->skipValidation() && !ValidateUniform2ui(context, location, v0, v1))
+ {
+ return;
+ }
+
+ context->uniform2ui(location, v0, v1);
+ }
}
void GL_APIENTRY Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
{
- const GLuint xyz[] = {v0, v1, v2};
- Uniform3uiv(location, 1, xyz);
+ EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = %u)", location, v0, v1,
+ v2);
+
+ Context *context = GetValidGlobalContext();
+ if (context)
+ {
+ if (!context->skipValidation() && !ValidateUniform3ui(context, location, v0, v1, v2))
+ {
+ return;
+ }
+
+ context->uniform3ui(location, v0, v1, v2);
+ }
}
void GL_APIENTRY Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
{
- const GLuint xyzw[] = {v0, v1, v2, v3};
- Uniform4uiv(location, 1, xyzw);
+ EVENT("(GLint location = %d, GLuint v0 = %u, GLuint v1 = %u, GLuint v2 = %u, GLuint v3 = %u)",
+ location, v0, v1, v2, v3);
+
+ Context *context = GetValidGlobalContext();
+ if (context)
+ {
+ if (!context->skipValidation() && !ValidateUniform4ui(context, location, v0, v1, v2, v3))
+ {
+ return;
+ }
+
+ context->uniform4ui(location, v0, v1, v2, v3);
+ }
}
void GL_APIENTRY Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
@@ -1180,13 +1076,12 @@ void GL_APIENTRY Uniform1uiv(GLint location, GLsizei count, const GLuint *value)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniform(context, GL_UNSIGNED_INT, location, count))
+ if (!context->skipValidation() && !ValidateUniform1uiv(context, location, count, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniform1uiv(location, count, value);
+ context->uniform1uiv(location, count, value);
}
}
@@ -1198,13 +1093,12 @@ void GL_APIENTRY Uniform2uiv(GLint location, GLsizei count, const GLuint *value)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniform(context, GL_UNSIGNED_INT_VEC2, location, count))
+ if (!context->skipValidation() && !ValidateUniform2uiv(context, location, count, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniform2uiv(location, count, value);
+ context->uniform2uiv(location, count, value);
}
}
@@ -1215,13 +1109,12 @@ void GL_APIENTRY Uniform3uiv(GLint location, GLsizei count, const GLuint *value)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniform(context, GL_UNSIGNED_INT_VEC3, location, count))
+ if (!context->skipValidation() && !ValidateUniform3uiv(context, location, count, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniform3uiv(location, count, value);
+ context->uniform3uiv(location, count, value);
}
}
@@ -1233,13 +1126,12 @@ void GL_APIENTRY Uniform4uiv(GLint location, GLsizei count, const GLuint *value)
Context *context = GetValidGlobalContext();
if (context)
{
- if (!ValidateUniform(context, GL_UNSIGNED_INT_VEC4, location, count))
+ if (!context->skipValidation() && !ValidateUniform4uiv(context, location, count, value))
{
return;
}
- Program *program = context->getGLState().getProgram();
- program->setUniform4uiv(location, count, value);
+ context->uniform4uiv(location, count, value);
}
}
@@ -1371,39 +1263,13 @@ void GL_APIENTRY GetUniformIndices(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateGetUniformIndices(context, program, uniformCount,
+ uniformNames, uniformIndices))
{
- context->handleError(InvalidOperation());
return;
}
- if (uniformCount < 0)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- Program *programObject = GetValidProgram(context, program);
-
- if (!programObject)
- {
- return;
- }
-
- if (!programObject->isLinked())
- {
- for (int uniformId = 0; uniformId < uniformCount; uniformId++)
- {
- uniformIndices[uniformId] = GL_INVALID_INDEX;
- }
- }
- else
- {
- for (int uniformId = 0; uniformId < uniformCount; uniformId++)
- {
- uniformIndices[uniformId] = programObject->getUniformIndex(uniformNames[uniformId]);
- }
- }
+ context->getUniformIndices(program, uniformCount, uniformNames, uniformIndices);
}
}
@@ -1421,64 +1287,14 @@ void GL_APIENTRY GetActiveUniformsiv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (uniformCount < 0)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- Program *programObject = GetValidProgram(context, program);
-
- if (!programObject)
- {
- return;
- }
-
- switch (pname)
- {
- case GL_UNIFORM_TYPE:
- case GL_UNIFORM_SIZE:
- case GL_UNIFORM_NAME_LENGTH:
- case GL_UNIFORM_BLOCK_INDEX:
- case GL_UNIFORM_OFFSET:
- case GL_UNIFORM_ARRAY_STRIDE:
- case GL_UNIFORM_MATRIX_STRIDE:
- case GL_UNIFORM_IS_ROW_MAJOR:
- break;
-
- default:
- context->handleError(InvalidEnum());
- return;
- }
-
- if (uniformCount > programObject->getActiveUniformCount())
+ if (!context->skipValidation() &&
+ !ValidateGetActiveUniformsiv(context, program, uniformCount, uniformIndices, pname,
+ params))
{
- context->handleError(InvalidValue());
return;
}
- for (int uniformId = 0; uniformId < uniformCount; uniformId++)
- {
- const GLuint index = uniformIndices[uniformId];
-
- if (index >= static_cast<GLuint>(programObject->getActiveUniformCount()))
- {
- context->handleError(InvalidValue());
- return;
- }
- }
-
- for (int uniformId = 0; uniformId < uniformCount; uniformId++)
- {
- const GLuint index = uniformIndices[uniformId];
- params[uniformId] = programObject->getActiveUniformi(index, pname);
- }
+ context->getActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
}
}
@@ -1490,22 +1306,16 @@ GLuint GL_APIENTRY GetUniformBlockIndex(GLuint program, const GLchar *uniformBlo
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return GL_INVALID_INDEX;
- }
-
- Program *programObject = GetValidProgram(context, program);
- if (!programObject)
+ if (!context->skipValidation() &&
+ !ValidateGetUniformBlockIndex(context, program, uniformBlockName))
{
return GL_INVALID_INDEX;
}
- return programObject->getUniformBlockIndex(uniformBlockName);
+ return context->getUniformBlockIndex(program, uniformBlockName);
}
- return 0;
+ return GL_INVALID_INDEX;
}
void GL_APIENTRY GetActiveUniformBlockiv(GLuint program,
@@ -1527,8 +1337,7 @@ void GL_APIENTRY GetActiveUniformBlockiv(GLuint program,
return;
}
- const Program *programObject = context->getProgram(program);
- QueryActiveUniformBlockiv(programObject, uniformBlockIndex, pname, params);
+ context->getActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
}
}
@@ -1546,27 +1355,15 @@ void GL_APIENTRY GetActiveUniformBlockName(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- Program *programObject = GetValidProgram(context, program);
-
- if (!programObject)
- {
- return;
- }
-
- if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
+ if (!context->skipValidation() &&
+ !ValidateGetActiveUniformBlockName(context, program, uniformBlockIndex, bufSize, length,
+ uniformBlockName))
{
- context->handleError(InvalidValue());
return;
}
- programObject->getActiveUniformBlockName(uniformBlockIndex, bufSize, length,
- uniformBlockName);
+ context->getActiveUniformBlockName(program, uniformBlockIndex, bufSize, length,
+ uniformBlockName);
}
}
@@ -1580,33 +1377,13 @@ void GL_APIENTRY UniformBlockBinding(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (uniformBlockBinding >= context->getCaps().maxUniformBufferBindings)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- Program *programObject = GetValidProgram(context, program);
-
- if (!programObject)
- {
- return;
- }
-
- // if never linked, there won't be any uniform blocks
- if (uniformBlockIndex >= programObject->getActiveUniformBlockCount())
+ if (!context->skipValidation() &&
+ !ValidateUniformBlockBinding(context, program, uniformBlockIndex, uniformBlockBinding))
{
- context->handleError(InvalidValue());
return;
}
- programObject->bindUniformBlock(uniformBlockIndex, uniformBlockBinding);
+ context->uniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
}
}
@@ -1618,13 +1395,8 @@ void GL_APIENTRY DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GL
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (!ValidateDrawArraysInstanced(context, mode, first, count, instanceCount))
+ if (!context->skipValidation() &&
+ !ValidateDrawArraysInstanced(context, mode, first, count, instanceCount))
{
return;
}
@@ -1660,43 +1432,19 @@ void GL_APIENTRY DrawElementsInstanced(GLenum mode,
}
}
-GLsync GL_APIENTRY FenceSync_(GLenum condition, GLbitfield flags)
+GLsync GL_APIENTRY FenceSync(GLenum condition, GLbitfield flags)
{
EVENT("(GLenum condition = 0x%X, GLbitfield flags = 0x%X)", condition, flags);
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return 0;
- }
-
- if (condition != GL_SYNC_GPU_COMMANDS_COMPLETE)
- {
- context->handleError(InvalidEnum());
- return 0;
- }
-
- if (flags != 0)
- {
- context->handleError(InvalidValue());
- return 0;
- }
-
- GLsync fenceSync = context->createFenceSync();
-
- FenceSync *fenceSyncObject = context->getFenceSync(fenceSync);
- Error error = fenceSyncObject->set(condition, flags);
- if (error.isError())
+ if (!context->skipValidation() && !ValidateFenceSync(context, condition, flags))
{
- context->deleteFenceSync(fenceSync);
- context->handleError(error);
return nullptr;
}
- return fenceSync;
+ return context->fenceSync(condition, flags);
}
return nullptr;
@@ -1709,13 +1457,12 @@ GLboolean GL_APIENTRY IsSync(GLsync sync)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateIsSync(context, sync))
{
- context->handleError(InvalidOperation());
return GL_FALSE;
}
- return (context->getFenceSync(sync) != nullptr);
+ return context->isSync(sync);
}
return GL_FALSE;
@@ -1728,19 +1475,12 @@ void GL_APIENTRY DeleteSync(GLsync sync)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateDeleteSync(context, sync))
{
- context->handleError(InvalidOperation());
return;
}
- if (sync != static_cast<GLsync>(0) && !context->getFenceSync(sync))
- {
- context->handleError(InvalidValue());
- return;
- }
-
- context->deleteFenceSync(sync);
+ context->deleteSync(sync);
}
}
@@ -1752,38 +1492,15 @@ GLenum GL_APIENTRY ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeou
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return GL_WAIT_FAILED;
- }
-
- if ((flags & ~(GL_SYNC_FLUSH_COMMANDS_BIT)) != 0)
- {
- context->handleError(InvalidValue());
- return GL_WAIT_FAILED;
- }
-
- FenceSync *fenceSync = context->getFenceSync(sync);
-
- if (!fenceSync)
+ if (!context->skipValidation() && !ValidateClientWaitSync(context, sync, flags, timeout))
{
- context->handleError(InvalidValue());
return GL_WAIT_FAILED;
}
- GLenum result = GL_WAIT_FAILED;
- Error error = fenceSync->clientWait(flags, timeout, &result);
- if (error.isError())
- {
- context->handleError(error);
- return GL_WAIT_FAILED;
- }
-
- return result;
+ return context->clientWaitSync(sync, flags, timeout);
}
- return GL_FALSE;
+ return GL_WAIT_FAILED;
}
void GL_APIENTRY WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
@@ -1794,37 +1511,12 @@ void GL_APIENTRY WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateWaitSync(context, sync, flags, timeout))
{
- context->handleError(InvalidOperation());
return;
}
- if (flags != 0)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- if (timeout != GL_TIMEOUT_IGNORED)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- FenceSync *fenceSync = context->getFenceSync(sync);
-
- if (!fenceSync)
- {
- context->handleError(InvalidValue());
- return;
- }
-
- Error error = fenceSync->serverWait(flags, timeout);
- if (error.isError())
- {
- context->handleError(error);
- }
+ context->waitSync(sync, flags, timeout);
}
}
@@ -1835,27 +1527,12 @@ void GL_APIENTRY GetInteger64v(GLenum pname, GLint64 *params)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- GLenum nativeType;
- unsigned int numParams = 0;
- if (!ValidateStateQuery(context, pname, &nativeType, &numParams))
+ if (!context->skipValidation() && !ValidateGetInteger64v(context, pname, params))
{
return;
}
- if (nativeType == GL_INT_64_ANGLEX)
- {
- context->getInteger64v(pname, params);
- }
- else
- {
- CastStateValues(context, nativeType, pname, numParams, params);
- }
+ context->getInteger64v(pname, params);
}
}
@@ -1892,6 +1569,7 @@ void GL_APIENTRY GetInteger64i_v(GLenum target, GLuint index, GLint64 *data)
{
return;
}
+
context->getInteger64i_v(target, index, data);
}
}
@@ -1910,8 +1588,7 @@ void GL_APIENTRY GetBufferParameteri64v(GLenum target, GLenum pname, GLint64 *pa
return;
}
- Buffer *buffer = context->getGLState().getTargetBuffer(target);
- QueryBufferParameteri64v(buffer, pname, params);
+ context->getBufferParameteri64v(target, pname, params);
}
}
@@ -1927,10 +1604,7 @@ void GL_APIENTRY GenSamplers(GLsizei count, GLuint *samplers)
return;
}
- for (int i = 0; i < count; i++)
- {
- samplers[i] = context->createSampler();
- }
+ context->genSamplers(count, samplers);
}
}
@@ -1946,10 +1620,7 @@ void GL_APIENTRY DeleteSamplers(GLsizei count, const GLuint *samplers)
return;
}
- for (int i = 0; i < count; i++)
- {
- context->deleteSampler(samplers[i]);
- }
+ context->deleteSamplers(count, samplers);
}
}
@@ -1960,9 +1631,8 @@ GLboolean GL_APIENTRY IsSampler(GLuint sampler)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateIsSampler(context, sampler))
{
- context->handleError(InvalidOperation());
return GL_FALSE;
}
@@ -1979,21 +1649,8 @@ void GL_APIENTRY BindSampler(GLuint unit, GLuint sampler)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateBindSampler(context, unit, sampler))
{
- context->handleError(InvalidOperation());
- return;
- }
-
- if (sampler != 0 && !context->isSampler(sampler))
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (unit >= context->getCaps().maxCombinedTextureImageUnits)
- {
- context->handleError(InvalidValue());
return;
}
@@ -2114,19 +1771,12 @@ void GL_APIENTRY VertexAttribDivisor(GLuint index, GLuint divisor)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (index >= MAX_VERTEX_ATTRIBS)
+ if (!context->skipValidation() && !ValidateVertexAttribDivisor(context, index, divisor))
{
- context->handleError(InvalidValue());
return;
}
- context->setVertexAttribDivisor(index, divisor);
+ context->vertexAttribDivisor(index, divisor);
}
}
@@ -2137,45 +1787,12 @@ void GL_APIENTRY BindTransformFeedback(GLenum target, GLuint id)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateBindTransformFeedback(context, target, id))
{
- context->handleError(InvalidOperation());
return;
}
- switch (target)
- {
- case GL_TRANSFORM_FEEDBACK:
- {
- // Cannot bind a transform feedback object if the current one is started and not
- // paused (3.0.2 pg 85 section 2.14.1)
- TransformFeedback *curTransformFeedback =
- context->getGLState().getCurrentTransformFeedback();
- if (curTransformFeedback && curTransformFeedback->isActive() &&
- !curTransformFeedback->isPaused())
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- // Cannot bind a transform feedback object that does not exist (3.0.2 pg 85 section
- // 2.14.1)
- if (!context->isTransformFeedbackGenerated(id))
- {
- context->handleError(
- InvalidOperation()
- << "Cannot bind a transform feedback object that does not exist.");
- return;
- }
-
- context->bindTransformFeedback(id);
- }
- break;
-
- default:
- context->handleError(InvalidEnum());
- return;
- }
+ context->bindTransformFeedback(target, id);
}
}
@@ -2191,10 +1808,7 @@ void GL_APIENTRY DeleteTransformFeedbacks(GLsizei n, const GLuint *ids)
return;
}
- for (int i = 0; i < n; i++)
- {
- context->deleteTransformFeedback(ids[i]);
- }
+ context->deleteTransformFeedbacks(n, ids);
}
}
@@ -2210,10 +1824,7 @@ void GL_APIENTRY GenTransformFeedbacks(GLsizei n, GLuint *ids)
return;
}
- for (int i = 0; i < n; i++)
- {
- ids[i] = context->createTransformFeedback();
- }
+ context->genTransformFeedbacks(n, ids);
}
}
@@ -2224,21 +1835,12 @@ GLboolean GL_APIENTRY IsTransformFeedback(GLuint id)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateIsTransformFeedback(context, id))
{
- context->handleError(InvalidOperation());
return GL_FALSE;
}
- if (id == 0)
- {
- // The 3.0.4 spec [section 6.1.11] states that if ID is zero, IsTransformFeedback
- // returns FALSE
- return GL_FALSE;
- }
-
- const TransformFeedback *transformFeedback = context->getTransformFeedback(id);
- return ((transformFeedback != nullptr) ? GL_TRUE : GL_FALSE);
+ return context->isTransformFeedback(id);
}
return GL_FALSE;
@@ -2251,23 +1853,12 @@ void GL_APIENTRY PauseTransformFeedback(void)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidatePauseTransformFeedback(context))
{
- context->handleError(InvalidOperation());
return;
}
- TransformFeedback *transformFeedback = context->getGLState().getCurrentTransformFeedback();
- ASSERT(transformFeedback != nullptr);
-
- // Current transform feedback must be active and not paused in order to pause (3.0.2 pg 86)
- if (!transformFeedback->isActive() || transformFeedback->isPaused())
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- transformFeedback->pause();
+ context->pauseTransformFeedback();
}
}
@@ -2278,23 +1869,12 @@ void GL_APIENTRY ResumeTransformFeedback(void)
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
+ if (!context->skipValidation() && !ValidateResumeTransformFeedback(context))
{
- context->handleError(InvalidOperation());
return;
}
- TransformFeedback *transformFeedback = context->getGLState().getCurrentTransformFeedback();
- ASSERT(transformFeedback != nullptr);
-
- // Current transform feedback must be active and paused in order to resume (3.0.2 pg 86)
- if (!transformFeedback->isActive() || !transformFeedback->isPaused())
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- transformFeedback->resume();
+ context->resumeTransformFeedback();
}
}
@@ -2401,7 +1981,8 @@ void GL_APIENTRY InvalidateSubFramebuffer(GLenum target,
if (context)
{
if (!context->skipValidation() &&
- !ValidateInvalidateFramebuffer(context, target, numAttachments, attachments))
+ !ValidateInvalidateSubFramebuffer(context, target, numAttachments, attachments, x, y,
+ width, height))
{
return;
}
@@ -2421,14 +2002,8 @@ TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (!ValidateES3TexStorage2DParameters(context, target, levels, internalformat, width,
- height, 1))
+ if (!context->skipValidation() &&
+ !ValidateTexStorage2D(context, target, levels, internalformat, width, height))
{
return;
}
@@ -2453,14 +2028,8 @@ void GL_APIENTRY TexStorage3D(GLenum target,
Context *context = GetValidGlobalContext();
if (context)
{
- if (context->getClientMajorVersion() < 3)
- {
- context->handleError(InvalidOperation());
- return;
- }
-
- if (!ValidateES3TexStorage3DParameters(context, target, levels, internalformat, width,
- height, depth))
+ if (!context->skipValidation() &&
+ !ValidateTexStorage3D(context, target, levels, internalformat, width, height, depth))
{
return;
}
@@ -2485,13 +2054,12 @@ void GL_APIENTRY GetInternalformativ(GLenum target,
if (context)
{
if (!context->skipValidation() &&
- !ValidateGetInternalFormativ(context, target, internalformat, pname, bufSize, params))
+ !ValidateGetInternalformativ(context, target, internalformat, pname, bufSize, params))
{
return;
}
- const TextureCaps &formatCaps = context->getTextureCaps().get(internalformat);
- QueryInternalFormativ(formatCaps, pname, bufSize, params);
+ context->getInternalformativ(target, internalformat, pname, bufSize, params);
}
}
}
diff --git a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.h b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0_autogen.h
index b93b8aad2c4..e93dde96ed0 100644
--- a/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0.h
+++ b/chromium/third_party/angle/src/libGLESv2/entry_points_gles_3_0_autogen.h
@@ -1,21 +1,22 @@
+// GENERATED FILE - DO NOT EDIT.
+// Generated by generate_entry_points.py using data from gl.xml.
//
-// Copyright(c) 2014 The ANGLE Project Authors. All rights reserved.
+// Copyright 2017 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
+// entry_points_gles_3_0_autogen.h:
+// Defines the GLES 3.0 entry points.
-// entry_points_gles_3_0.h : Defines the GLES 3.0 entry points.
-
-#ifndef LIBGLESV2_ENTRYPOINTGLES30_H_
-#define LIBGLESV2_ENTRYPOINTGLES30_H_
+#ifndef LIBGLESV2_ENTRYPOINTSGLES30_AUTOGEN_H_
+#define LIBGLESV2_ENTRYPOINTSGLES30_AUTOGEN_H_
#include <GLES3/gl3.h>
#include <export.h>
namespace gl
{
-
-ANGLE_EXPORT void GL_APIENTRY ReadBuffer(GLenum mode);
+ANGLE_EXPORT void GL_APIENTRY ReadBuffer(GLenum src);
ANGLE_EXPORT void GL_APIENTRY DrawRangeElements(GLenum mode,
GLuint start,
GLuint end,
@@ -136,7 +137,7 @@ ANGLE_EXPORT void GL_APIENTRY GenVertexArrays(GLsizei n, GLuint *arrays);
ANGLE_EXPORT GLboolean GL_APIENTRY IsVertexArray(GLuint array);
ANGLE_EXPORT void GL_APIENTRY GetIntegeri_v(GLenum target, GLuint index, GLint *data);
ANGLE_EXPORT void GL_APIENTRY BeginTransformFeedback(GLenum primitiveMode);
-ANGLE_EXPORT void GL_APIENTRY EndTransformFeedback(void);
+ANGLE_EXPORT void GL_APIENTRY EndTransformFeedback();
ANGLE_EXPORT void GL_APIENTRY
BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
ANGLE_EXPORT void GL_APIENTRY BindBufferBase(GLenum target, GLuint index, GLuint buffer);
@@ -210,18 +211,18 @@ ANGLE_EXPORT void GL_APIENTRY UniformBlockBinding(GLuint program,
ANGLE_EXPORT void GL_APIENTRY DrawArraysInstanced(GLenum mode,
GLint first,
GLsizei count,
- GLsizei instanceCount);
+ GLsizei instancecount);
ANGLE_EXPORT void GL_APIENTRY DrawElementsInstanced(GLenum mode,
GLsizei count,
GLenum type,
const void *indices,
- GLsizei instanceCount);
-ANGLE_EXPORT GLsync GL_APIENTRY FenceSync_(GLenum condition, GLbitfield flags);
+ GLsizei instancecount);
+ANGLE_EXPORT GLsync GL_APIENTRY FenceSync(GLenum condition, GLbitfield flags);
ANGLE_EXPORT GLboolean GL_APIENTRY IsSync(GLsync sync);
ANGLE_EXPORT void GL_APIENTRY DeleteSync(GLsync sync);
ANGLE_EXPORT GLenum GL_APIENTRY ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
ANGLE_EXPORT void GL_APIENTRY WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout);
-ANGLE_EXPORT void GL_APIENTRY GetInteger64v(GLenum pname, GLint64 *params);
+ANGLE_EXPORT void GL_APIENTRY GetInteger64v(GLenum pname, GLint64 *data);
ANGLE_EXPORT void GL_APIENTRY
GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values);
ANGLE_EXPORT void GL_APIENTRY GetInteger64i_v(GLenum target, GLuint index, GLint64 *data);
@@ -243,8 +244,8 @@ ANGLE_EXPORT void GL_APIENTRY BindTransformFeedback(GLenum target, GLuint id);
ANGLE_EXPORT void GL_APIENTRY DeleteTransformFeedbacks(GLsizei n, const GLuint *ids);
ANGLE_EXPORT void GL_APIENTRY GenTransformFeedbacks(GLsizei n, GLuint *ids);
ANGLE_EXPORT GLboolean GL_APIENTRY IsTransformFeedback(GLuint id);
-ANGLE_EXPORT void GL_APIENTRY PauseTransformFeedback(void);
-ANGLE_EXPORT void GL_APIENTRY ResumeTransformFeedback(void);
+ANGLE_EXPORT void GL_APIENTRY PauseTransformFeedback();
+ANGLE_EXPORT void GL_APIENTRY ResumeTransformFeedback();
ANGLE_EXPORT void GL_APIENTRY GetProgramBinary(GLuint program,
GLsizei bufSize,
GLsizei *length,
@@ -278,6 +279,6 @@ ANGLE_EXPORT void GL_APIENTRY GetInternalformativ(GLenum target,
GLenum pname,
GLsizei bufSize,
GLint *params);
-}
+} // namespace gl
-#endif // LIBGLESV2_ENTRYPOINTGLES30_H_
+#endif // LIBGLESV2_ENTRYPOINTSGLES30_AUTOGEN_H_
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 d958b55295a..4413f1a03c7 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
@@ -198,11 +198,14 @@ void GL_APIENTRY GetProgramResourceiv(GLuint program,
Context *context = GetValidGlobalContext();
if (context)
{
- if (!context->skipValidation())
+ if (!context->skipValidation() &&
+ !ValidateGetProgramResourceiv(context, program, programInterface, index, propCount,
+ props, bufSize, length, params))
{
- context->handleError(InvalidOperation() << "Entry point not implemented");
+ return;
}
- UNIMPLEMENTED();
+ context->getProgramResourceiv(program, programInterface, index, propCount, props, bufSize,
+ length, params);
}
}
diff --git a/chromium/third_party/angle/src/libGLESv2/libGLESv2.cpp b/chromium/third_party/angle/src/libGLESv2/libGLESv2.cpp
index cb489fc3f89..da80caca854 100644
--- a/chromium/third_party/angle/src/libGLESv2/libGLESv2.cpp
+++ b/chromium/third_party/angle/src/libGLESv2/libGLESv2.cpp
@@ -8,7 +8,7 @@
#include "libGLESv2/entry_points_gles_2_0_autogen.h"
#include "libGLESv2/entry_points_gles_2_0_ext.h"
-#include "libGLESv2/entry_points_gles_3_0.h"
+#include "libGLESv2/entry_points_gles_3_0_autogen.h"
#include "libGLESv2/entry_points_gles_3_1.h"
#include "common/event_tracer.h"
@@ -1321,7 +1321,7 @@ void GL_APIENTRY glDrawElementsInstanced(GLenum mode,
GLsync GL_APIENTRY glFenceSync(GLenum condition, GLbitfield flags)
{
- return gl::FenceSync_(condition, flags);
+ return gl::FenceSync(condition, flags);
}
GLboolean GL_APIENTRY glIsSync(GLsync sync)
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 504791e7425..13b1361e8ad 100644
--- a/chromium/third_party/angle/src/tests/angle_end2end_tests.gypi
+++ b/chromium/third_party/angle/src/tests/angle_end2end_tests.gypi
@@ -55,6 +55,7 @@
'<(angle_path)/src/tests/gl_tests/MaxTextureSizeTest.cpp',
'<(angle_path)/src/tests/gl_tests/MipmapTest.cpp',
'<(angle_path)/src/tests/gl_tests/MultisampleCompatibilityTest.cpp',
+ '<(angle_path)/src/tests/gl_tests/MultiviewDrawTest.cpp',
'<(angle_path)/src/tests/gl_tests/media/pixel.inl',
'<(angle_path)/src/tests/gl_tests/PackUnpackTest.cpp',
'<(angle_path)/src/tests/gl_tests/PathRenderingTest.cpp',
@@ -79,6 +80,7 @@
'<(angle_path)/src/tests/gl_tests/SwizzleTest.cpp',
'<(angle_path)/src/tests/gl_tests/SyncQueriesTest.cpp',
'<(angle_path)/src/tests/gl_tests/TextureMultisampleTest.cpp',
+ '<(angle_path)/src/tests/gl_tests/TextureRectangleTest.cpp',
'<(angle_path)/src/tests/gl_tests/TextureTest.cpp',
'<(angle_path)/src/tests/gl_tests/TimerQueriesTest.cpp',
'<(angle_path)/src/tests/gl_tests/TransformFeedbackTest.cpp',
diff --git a/chromium/third_party/angle/src/tests/angle_perftests.gypi b/chromium/third_party/angle/src/tests/angle_perftests.gypi
index 438fc59a8fc..ea9c1141cf3 100644
--- a/chromium/third_party/angle/src/tests/angle_perftests.gypi
+++ b/chromium/third_party/angle/src/tests/angle_perftests.gypi
@@ -24,12 +24,14 @@
'<(angle_path)/src/tests/perf_tests/DrawCallPerf.cpp',
'<(angle_path)/src/tests/perf_tests/DrawCallPerfParams.cpp',
'<(angle_path)/src/tests/perf_tests/DrawCallPerfParams.h',
+ '<(angle_path)/src/tests/perf_tests/DrawElementsPerf.cpp',
'<(angle_path)/src/tests/perf_tests/DynamicPromotionPerfTest.cpp',
'<(angle_path)/src/tests/perf_tests/EGLInitializePerf.cpp',
'<(angle_path)/src/tests/perf_tests/IndexConversionPerf.cpp',
'<(angle_path)/src/tests/perf_tests/InstancingPerf.cpp',
'<(angle_path)/src/tests/perf_tests/InterleavedAttributeData.cpp',
'<(angle_path)/src/tests/perf_tests/LinkProgramPerfTest.cpp',
+ '<(angle_path)/src/tests/perf_tests/MultiviewPerf.cpp',
'<(angle_path)/src/tests/perf_tests/PointSprites.cpp',
'<(angle_path)/src/tests/perf_tests/TexSubImage.cpp',
'<(angle_path)/src/tests/perf_tests/TextureSampling.cpp',
diff --git a/chromium/third_party/angle/src/tests/angle_unittests.gypi b/chromium/third_party/angle/src/tests/angle_unittests.gypi
index 7c1aeaaad1c..145d8f94762 100644
--- a/chromium/third_party/angle/src/tests/angle_unittests.gypi
+++ b/chromium/third_party/angle/src/tests/angle_unittests.gypi
@@ -49,6 +49,7 @@
'<(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/ARB_texture_rectangle_test.cpp',
'<(angle_path)/src/tests/compiler_tests/AtomicCounter_test.cpp',
'<(angle_path)/src/tests/compiler_tests/BufferVariables_test.cpp',
'<(angle_path)/src/tests/compiler_tests/CollectVariables_test.cpp',
@@ -64,6 +65,7 @@
'<(angle_path)/src/tests/compiler_tests/FloatLex_test.cpp',
'<(angle_path)/src/tests/compiler_tests/FragDepth_test.cpp',
'<(angle_path)/src/tests/compiler_tests/GLSLCompatibilityOutput_test.cpp',
+ '<(angle_path)/src/tests/compiler_tests/GeometryShader_test.cpp',
'<(angle_path)/src/tests/compiler_tests/InitOutputVariables_test.cpp',
'<(angle_path)/src/tests/compiler_tests/IntermNode_test.cpp',
'<(angle_path)/src/tests/compiler_tests/NV_draw_buffers_test.cpp',
@@ -75,6 +77,7 @@
'<(angle_path)/src/tests/compiler_tests/QualificationOrder_test.cpp',
'<(angle_path)/src/tests/compiler_tests/RecordConstantPrecision_test.cpp',
'<(angle_path)/src/tests/compiler_tests/RemovePow_test.cpp',
+ '<(angle_path)/src/tests/compiler_tests/RewriteDoWhile_test.cpp',
'<(angle_path)/src/tests/compiler_tests/SamplerMultisample_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ShaderExtension_test.cpp',
'<(angle_path)/src/tests/compiler_tests/ShaderImage_test.cpp',
diff --git a/chromium/third_party/angle/src/tests/angle_white_box_tests.gypi b/chromium/third_party/angle/src/tests/angle_white_box_tests.gypi
index 2d872d6e285..d2f12d407fe 100644
--- a/chromium/third_party/angle/src/tests/angle_white_box_tests.gypi
+++ b/chromium/third_party/angle/src/tests/angle_white_box_tests.gypi
@@ -30,6 +30,7 @@
'<(angle_path)/src/tests/gl_tests/D3D11FormatTablesTest.cpp',
'<(angle_path)/src/tests/gl_tests/D3D11InputLayoutCacheTest.cpp',
'<(angle_path)/src/tests/gl_tests/D3DTextureTest.cpp',
+ '<(angle_path)/src/tests/gl_tests/ErrorMessages.cpp'
],
},
'dependencies':
diff --git a/chromium/third_party/angle/src/vulkan_support/BUILD.gn b/chromium/third_party/angle/src/vulkan_support/BUILD.gn
index 51c8c103577..230c0aae06f 100644
--- a/chromium/third_party/angle/src/vulkan_support/BUILD.gn
+++ b/chromium/third_party/angle/src/vulkan_support/BUILD.gn
@@ -476,7 +476,7 @@ foreach(layer_info, layers) {
}
sources = rebase_path(layer_info[1], ".", "src")
if (is_win) {
- sources += [ "$vulkan_layers_dir/layers/VKLayer_$name.def" ]
+ sources += [ "$vulkan_layers_dir/layers/VkLayer_$name.def" ]
}
}
}
diff --git a/chromium/third_party/angle/util/shader_utils.cpp b/chromium/third_party/angle/util/shader_utils.cpp
index adc7b369361..3b6dffaf989 100644
--- a/chromium/third_party/angle/util/shader_utils.cpp
+++ b/chromium/third_party/angle/util/shader_utils.cpp
@@ -208,3 +208,9 @@ GLuint LoadBinaryProgramES3(const std::vector<uint8_t> &binary, GLenum binaryFor
glProgramBinary(program, binaryFormat, binary.data(), static_cast<GLint>(binary.size()));
return CheckLinkStatusAndReturnProgram(program, true);
}
+
+bool LinkAttachedProgram(GLuint program)
+{
+ glLinkProgram(program);
+ return (CheckLinkStatusAndReturnProgram(program, true) != 0);
+}
diff --git a/chromium/third_party/angle/util/shader_utils.h b/chromium/third_party/angle/util/shader_utils.h
index 706b6d7b7a6..f559e1d9fce 100644
--- a/chromium/third_party/angle/util/shader_utils.h
+++ b/chromium/third_party/angle/util/shader_utils.h
@@ -32,6 +32,7 @@ ANGLE_EXPORT GLuint CompileProgram(const std::string &vsSource, const std::strin
ANGLE_EXPORT GLuint CompileProgramFromFiles(const std::string &vsPath, const std::string &fsPath);
ANGLE_EXPORT GLuint CompileComputeProgram(const std::string &csSource,
bool outputErrorMessages = true);
+ANGLE_EXPORT bool LinkAttachedProgram(GLuint program);
ANGLE_EXPORT GLuint LoadBinaryProgramOES(const std::vector<uint8_t> &binary, GLenum binaryFormat);
ANGLE_EXPORT GLuint LoadBinaryProgramES3(const std::vector<uint8_t> &binary, GLenum binaryFormat);
diff --git a/chromium/third_party/angle/util/windows/win32/Win32Window.cpp b/chromium/third_party/angle/util/windows/win32/Win32Window.cpp
index 694b431c63c..ee848f1f318 100644
--- a/chromium/third_party/angle/util/windows/win32/Win32Window.cpp
+++ b/chromium/third_party/angle/util/windows/win32/Win32Window.cpp
@@ -627,7 +627,7 @@ bool Win32Window::takeScreenshot(uint8_t *pixelData)
if (!error)
{
- screenDC = GetDC(nullptr);
+ screenDC = GetDC(HWND_DESKTOP);
error = screenDC == nullptr;
}
@@ -649,18 +649,20 @@ bool Win32Window::takeScreenshot(uint8_t *pixelData)
error = tmpBitmap == nullptr;
}
- RECT rect = {0, 0, 0, 0};
+ POINT topLeft = {0, 0};
if (!error)
{
- MapWindowPoints(mNativeWindow, nullptr, reinterpret_cast<LPPOINT>(&rect), 0);
+ error = (MapWindowPoints(mNativeWindow, HWND_DESKTOP, &topLeft, 1) == 0);
+ }
+ if (!error)
+ {
error = SelectObject(tmpDC, tmpBitmap) == nullptr;
}
if (!error)
{
- error =
- BitBlt(tmpDC, 0, 0, mWidth, mHeight, screenDC, rect.left, rect.top, SRCCOPY) == TRUE;
+ error = BitBlt(tmpDC, 0, 0, mWidth, mHeight, screenDC, topLeft.x, topLeft.y, SRCCOPY) == 0;
}
if (!error)
@@ -679,7 +681,7 @@ bool Win32Window::takeScreenshot(uint8_t *pixelData)
bitmapInfo.biClrImportant = 0;
int getBitsResult = GetDIBits(screenDC, tmpBitmap, 0, mHeight, pixelData,
reinterpret_cast<BITMAPINFO *>(&bitmapInfo), DIB_RGB_COLORS);
- error = getBitsResult != 0;
+ error = (getBitsResult == 0);
}
if (tmpBitmap != nullptr)