summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbin/syncqt.pl13
-rw-r--r--config.tests/qpa/eglfs-brcm/eglfs-brcm.pro6
-rwxr-xr-xconfigure20
-rw-r--r--doc/global/html-footer-online.qdocconf17
-rw-r--r--doc/global/html-header-online.qdocconf15
-rw-r--r--doc/global/template/scripts/extras.js6
-rw-r--r--doc/global/template/scripts/main.js6
-rw-r--r--doc/global/template/style/online.css8
-rw-r--r--mkspecs/features/create_cmake.prf25
-rw-r--r--mkspecs/features/ctest_testcase_common.prf7
-rw-r--r--mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in40
-rw-r--r--mkspecs/features/data/dummy.cpp2
-rw-r--r--mkspecs/features/device_config.prf13
-rw-r--r--mkspecs/features/qt_headersclean.prf47
-rw-r--r--mkspecs/features/qt_module.prf10
-rw-r--r--mkspecs/features/qt_module_headers.prf88
-rw-r--r--mkspecs/features/qt_module_pris.prf7
-rw-r--r--mkspecs/features/spec_pre.prf14
-rw-r--r--mkspecs/features/win32/dumpcpp.prf14
-rw-r--r--mkspecs/features/win32/opengl.prf2
-rw-r--r--qmake/doc/snippets/code/doc_src_qmake-manual.pro7
-rw-r--r--qmake/doc/src/qmake-manual.qdoc130
-rw-r--r--qmake/generators/mac/pbuilder_pbx.cpp68
-rw-r--r--qmake/generators/makefile.cpp89
-rw-r--r--qmake/generators/makefile.h27
-rw-r--r--qmake/generators/projectgenerator.cpp2
-rw-r--r--qmake/generators/unix/unixmake2.cpp6
-rw-r--r--qmake/generators/win32/cesdkhandler.cpp266
-rw-r--r--qmake/generators/win32/cesdkhandler.h12
-rw-r--r--qmake/generators/win32/msvc_nmake.cpp20
-rw-r--r--qmake/generators/win32/msvc_objectmodel.cpp2
-rw-r--r--qmake/generators/win32/msvc_vcproj.cpp46
-rw-r--r--qmake/project.cpp1
-rw-r--r--qmake/project.h2
-rw-r--r--src/3rdparty/angle/.gitignore15
-rw-r--r--src/3rdparty/angle/AUTHORS6
-rw-r--r--src/3rdparty/angle/CONTRIBUTORS21
-rw-r--r--src/3rdparty/angle/include/EGL/egl.h9
-rw-r--r--src/3rdparty/angle/include/EGL/eglext.h24
-rw-r--r--src/3rdparty/angle/include/EGL/eglplatform.h17
-rw-r--r--src/3rdparty/angle/include/GLSLANG/ShaderLang.h30
-rw-r--r--src/3rdparty/angle/include/GLSLANG/ShaderVars.h9
-rwxr-xr-x[-rw-r--r--]src/3rdparty/angle/include/KHR/khrplatform.h2
-rw-r--r--src/3rdparty/angle/include/angle_gl.h6
-rw-r--r--src/3rdparty/angle/include/export.h28
-rw-r--r--src/3rdparty/angle/include/platform/Platform.h112
-rw-r--r--src/3rdparty/angle/src/commit.h12
-rw-r--r--src/3rdparty/angle/src/common/MemoryBuffer.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/MemoryBuffer.cpp)42
-rw-r--r--src/3rdparty/angle/src/common/MemoryBuffer.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/MemoryBuffer.h)12
-rw-r--r--src/3rdparty/angle/src/common/Optional.h61
-rw-r--r--src/3rdparty/angle/src/common/RefCountObject.h95
-rw-r--r--src/3rdparty/angle/src/common/angleutils.cpp3
-rw-r--r--src/3rdparty/angle/src/common/angleutils.h35
-rw-r--r--src/3rdparty/angle/src/common/debug.cpp263
-rw-r--r--src/3rdparty/angle/src/common/debug.h82
-rw-r--r--src/3rdparty/angle/src/common/event_tracer.cpp38
-rw-r--r--src/3rdparty/angle/src/common/event_tracer.h34
-rw-r--r--src/3rdparty/angle/src/common/mathutil.h61
-rw-r--r--src/3rdparty/angle/src/common/platform.h109
-rw-r--r--src/3rdparty/angle/src/common/tls.h4
-rw-r--r--src/3rdparty/angle/src/common/utilities.cpp40
-rw-r--r--src/3rdparty/angle/src/common/utilities.h18
-rw-r--r--src/3rdparty/angle/src/common/version.h13
-rw-r--r--src/3rdparty/angle/src/common/winrt/CoreWindowNativeWindow.h39
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h7
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/DirectiveHandlerBase.h7
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.h6
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.h7
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y4
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Input.h2
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Lexer.h2
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Macro.h1
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.h6
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.h2
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/SourceLocation.h7
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Token.h1
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.h2
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l4
-rw-r--r--src/3rdparty/angle/src/compiler/preprocessor/numeric_lex.h7
-rw-r--r--src/3rdparty/angle/src/compiler/translator/BaseTypes.h49
-rw-r--r--src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.cpp415
-rw-r--r--src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.h112
-rw-r--r--src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp37
-rw-r--r--src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.h19
-rw-r--r--src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp410
-rw-r--r--src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.h16
-rw-r--r--src/3rdparty/angle/src/compiler/translator/CodeGen.cpp22
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Common.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Compiler.cpp107
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Compiler.h29
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ConstantUnion.h13
-rw-r--r--src/3rdparty/angle/src/compiler/translator/DetectCallDepth.cpp6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/DetectCallDepth.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/DetectDiscontinuity.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Diagnostics.h9
-rw-r--r--src/3rdparty/angle/src/compiler/translator/DirectiveHandler.cpp13
-rw-r--r--src/3rdparty/angle/src/compiler/translator/DirectiveHandler.h13
-rw-r--r--src/3rdparty/angle/src/compiler/translator/EmulatePrecision.cpp528
-rw-r--r--src/3rdparty/angle/src/compiler/translator/EmulatePrecision.h74
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ExtensionBehavior.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/FlagStd140Structs.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ForLoopUnroll.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/HashNames.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/InfoSink.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Initialize.cpp703
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Initialize.h12
-rw-r--r--src/3rdparty/angle/src/compiler/translator/InitializeDll.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/InitializeGlobals.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/InitializeParseContext.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/InitializeVariables.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/IntermNode.cpp311
-rw-r--r--src/3rdparty/angle/src/compiler/translator/IntermNode.h287
-rw-r--r--src/3rdparty/angle/src/compiler/translator/IntermTraverse.cpp54
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Intermediate.cpp114
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Intermediate.h (renamed from src/3rdparty/angle/src/compiler/translator/intermediate.h)16
-rw-r--r--src/3rdparty/angle/src/compiler/translator/LoopInfo.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/MMap.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/NodeSearch.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Operator.cpp195
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Operator.h226
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputESSL.cpp23
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputESSL.h11
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputGLSL.cpp52
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputGLSL.h13
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputGLSLBase.cpp216
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputGLSLBase.h18
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputHLSL.cpp991
-rw-r--r--src/3rdparty/angle/src/compiler/translator/OutputHLSL.h113
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ParseContext.cpp626
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ParseContext.h61
-rw-r--r--src/3rdparty/angle/src/compiler/translator/PoolAlloc.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Pragma.h13
-rw-r--r--src/3rdparty/angle/src/compiler/translator/QualifierAlive.cpp2
-rw-r--r--src/3rdparty/angle/src/compiler/translator/QualifierAlive.h5
-rw-r--r--src/3rdparty/angle/src/compiler/translator/RegenerateStructNames.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/RemoveSwitchFallThrough.cpp157
-rw-r--r--src/3rdparty/angle/src/compiler/translator/RemoveSwitchFallThrough.h43
-rw-r--r--src/3rdparty/angle/src/compiler/translator/RemoveTree.cpp29
-rw-r--r--src/3rdparty/angle/src/compiler/translator/RemoveTree.h7
-rw-r--r--src/3rdparty/angle/src/compiler/translator/RenameFunction.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/RewriteElseBlocks.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ScalarizeVecAndMatConstructorArgs.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/SearchSymbol.cpp1
-rw-r--r--src/3rdparty/angle/src/compiler/translator/SearchSymbol.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ShaderLang.cpp16
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ShaderVars.cpp18
-rw-r--r--src/3rdparty/angle/src/compiler/translator/SimplifyArrayAssignment.cpp38
-rw-r--r--src/3rdparty/angle/src/compiler/translator/SimplifyArrayAssignment.h25
-rw-r--r--src/3rdparty/angle/src/compiler/translator/StructureHLSL.cpp22
-rw-r--r--src/3rdparty/angle/src/compiler/translator/StructureHLSL.h14
-rw-r--r--src/3rdparty/angle/src/compiler/translator/SymbolTable.cpp218
-rw-r--r--src/3rdparty/angle/src/compiler/translator/SymbolTable.h70
-rw-r--r--src/3rdparty/angle/src/compiler/translator/TranslatorESSL.cpp69
-rw-r--r--src/3rdparty/angle/src/compiler/translator/TranslatorESSL.h19
-rw-r--r--src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.cpp114
-rw-r--r--src/3rdparty/angle/src/compiler/translator/TranslatorGLSL.h12
-rw-r--r--src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.cpp16
-rw-r--r--src/3rdparty/angle/src/compiler/translator/TranslatorHLSL.h8
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Types.cpp18
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Types.h38
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UnfoldShortCircuit.cpp6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UnfoldShortCircuit.h9
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UnfoldShortCircuitAST.cpp28
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UnfoldShortCircuitAST.h29
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UniformHLSL.cpp17
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UniformHLSL.h12
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UtilsHLSL.cpp7
-rw-r--r--src/3rdparty/angle/src/compiler/translator/UtilsHLSL.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ValidateLimitations.cpp87
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ValidateLimitations.h4
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ValidateOutputs.h5
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ValidateSwitch.cpp200
-rw-r--r--src/3rdparty/angle/src/compiler/translator/ValidateSwitch.h52
-rw-r--r--src/3rdparty/angle/src/compiler/translator/VariableInfo.cpp36
-rw-r--r--src/3rdparty/angle/src/compiler/translator/VariableInfo.h8
-rw-r--r--src/3rdparty/angle/src/compiler/translator/VariablePacker.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/VersionGLSL.cpp19
-rw-r--r--src/3rdparty/angle/src/compiler/translator/VersionGLSL.h18
-rw-r--r--src/3rdparty/angle/src/compiler/translator/blocklayout.cpp123
-rw-r--r--src/3rdparty/angle/src/compiler/translator/blocklayout.h (renamed from src/3rdparty/angle/src/common/blocklayout.h)45
-rw-r--r--src/3rdparty/angle/src/compiler/translator/blocklayoutHLSL.cpp (renamed from src/3rdparty/angle/src/common/blocklayout.cpp)110
-rw-r--r--src/3rdparty/angle/src/compiler/translator/blocklayoutHLSL.h62
-rw-r--r--src/3rdparty/angle/src/compiler/translator/compilerdebug.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraph.h8
-rw-r--r--src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphBuilder.h12
-rw-r--r--src/3rdparty/angle/src/compiler/translator/depgraph/DependencyGraphOutput.h25
-rw-r--r--src/3rdparty/angle/src/compiler/translator/glslang.h4
-rw-r--r--src/3rdparty/angle/src/compiler/translator/glslang.l19
-rw-r--r--src/3rdparty/angle/src/compiler/translator/glslang.y427
-rw-r--r--src/3rdparty/angle/src/compiler/translator/intermOut.cpp110
-rw-r--r--src/3rdparty/angle/src/compiler/translator/length_limits.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/timing/RestrictFragmentShaderTiming.h33
-rw-r--r--src/3rdparty/angle/src/compiler/translator/timing/RestrictVertexShaderTiming.h6
-rw-r--r--src/3rdparty/angle/src/compiler/translator/util.cpp2
-rw-r--r--src/3rdparty/angle/src/compiler/translator/util.h10
-rw-r--r--src/3rdparty/angle/src/id/commit.h3
-rw-r--r--src/3rdparty/angle/src/libANGLE/AttributeMap.cpp (renamed from src/3rdparty/angle/src/libEGL/AttributeMap.cpp)19
-rw-r--r--src/3rdparty/angle/src/libANGLE/AttributeMap.h (renamed from src/3rdparty/angle/src/libEGL/AttributeMap.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/BinaryStream.h (renamed from src/3rdparty/angle/src/libGLESv2/BinaryStream.h)28
-rw-r--r--src/3rdparty/angle/src/libANGLE/Buffer.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Buffer.cpp)13
-rw-r--r--src/3rdparty/angle/src/libANGLE/Buffer.h (renamed from src/3rdparty/angle/src/libGLESv2/Buffer.h)16
-rw-r--r--src/3rdparty/angle/src/libANGLE/Caps.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Caps.cpp)120
-rw-r--r--src/3rdparty/angle/src/libANGLE/Caps.h (renamed from src/3rdparty/angle/src/libGLESv2/Caps.h)117
-rw-r--r--src/3rdparty/angle/src/libANGLE/Compiler.cpp38
-rw-r--r--src/3rdparty/angle/src/libANGLE/Compiler.h39
-rw-r--r--src/3rdparty/angle/src/libANGLE/Config.cpp275
-rw-r--r--src/3rdparty/angle/src/libANGLE/Config.h91
-rw-r--r--src/3rdparty/angle/src/libANGLE/Constants.h (renamed from src/3rdparty/angle/src/libGLESv2/constants.h)6
-rw-r--r--src/3rdparty/angle/src/libANGLE/Context.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Context.cpp)356
-rw-r--r--src/3rdparty/angle/src/libANGLE/Context.h (renamed from src/3rdparty/angle/src/libGLESv2/Context.h)84
-rw-r--r--src/3rdparty/angle/src/libANGLE/Data.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Data.cpp)4
-rw-r--r--src/3rdparty/angle/src/libANGLE/Data.h (renamed from src/3rdparty/angle/src/libGLESv2/Data.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/Display.cpp675
-rw-r--r--src/3rdparty/angle/src/libANGLE/Display.h124
-rw-r--r--src/3rdparty/angle/src/libANGLE/Error.cpp86
-rw-r--r--src/3rdparty/angle/src/libANGLE/Error.h83
-rw-r--r--src/3rdparty/angle/src/libANGLE/Error.inl163
-rw-r--r--src/3rdparty/angle/src/libANGLE/Fence.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Fence.cpp)9
-rw-r--r--src/3rdparty/angle/src/libANGLE/Fence.h (renamed from src/3rdparty/angle/src/libGLESv2/Fence.h)22
-rw-r--r--src/3rdparty/angle/src/libANGLE/Float16ToFloat32.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Float16ToFloat32.cpp)0
-rw-r--r--src/3rdparty/angle/src/libANGLE/Framebuffer.cpp658
-rw-r--r--src/3rdparty/angle/src/libANGLE/Framebuffer.h144
-rw-r--r--src/3rdparty/angle/src/libANGLE/FramebufferAttachment.cpp (renamed from src/3rdparty/angle/src/libGLESv2/FramebufferAttachment.cpp)148
-rw-r--r--src/3rdparty/angle/src/libANGLE/FramebufferAttachment.h (renamed from src/3rdparty/angle/src/libGLESv2/FramebufferAttachment.h)70
-rw-r--r--src/3rdparty/angle/src/libANGLE/HandleAllocator.cpp133
-rw-r--r--src/3rdparty/angle/src/libANGLE/HandleAllocator.h63
-rw-r--r--src/3rdparty/angle/src/libANGLE/ImageIndex.cpp (renamed from src/3rdparty/angle/src/libGLESv2/ImageIndex.cpp)32
-rw-r--r--src/3rdparty/angle/src/libANGLE/ImageIndex.h (renamed from src/3rdparty/angle/src/libGLESv2/ImageIndex.h)21
-rw-r--r--src/3rdparty/angle/src/libANGLE/Platform.cpp35
-rw-r--r--src/3rdparty/angle/src/libANGLE/Program.cpp (renamed from src/3rdparty/angle/src/libGLESv2/ProgramBinary.cpp)1764
-rw-r--r--src/3rdparty/angle/src/libANGLE/Program.h (renamed from src/3rdparty/angle/src/libGLESv2/ProgramBinary.h)225
-rw-r--r--src/3rdparty/angle/src/libANGLE/Query.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Query.cpp)4
-rw-r--r--src/3rdparty/angle/src/libANGLE/Query.h (renamed from src/3rdparty/angle/src/libGLESv2/Query.h)13
-rw-r--r--src/3rdparty/angle/src/libANGLE/RefCountObject.cpp (renamed from src/3rdparty/angle/src/common/RefCountObject.cpp)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/RefCountObject.h110
-rw-r--r--src/3rdparty/angle/src/libANGLE/Renderbuffer.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Renderbuffer.cpp)69
-rw-r--r--src/3rdparty/angle/src/libANGLE/Renderbuffer.h (renamed from src/3rdparty/angle/src/libGLESv2/Renderbuffer.h)18
-rw-r--r--src/3rdparty/angle/src/libANGLE/ResourceManager.cpp (renamed from src/3rdparty/angle/src/libGLESv2/ResourceManager.cpp)117
-rw-r--r--src/3rdparty/angle/src/libANGLE/ResourceManager.h (renamed from src/3rdparty/angle/src/libGLESv2/ResourceManager.h)45
-rw-r--r--src/3rdparty/angle/src/libANGLE/Sampler.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Sampler.cpp)4
-rw-r--r--src/3rdparty/angle/src/libANGLE/Sampler.h (renamed from src/3rdparty/angle/src/libGLESv2/Sampler.h)8
-rw-r--r--src/3rdparty/angle/src/libANGLE/Shader.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Shader.cpp)38
-rw-r--r--src/3rdparty/angle/src/libANGLE/Shader.h (renamed from src/3rdparty/angle/src/libGLESv2/Shader.h)18
-rw-r--r--src/3rdparty/angle/src/libANGLE/State.cpp (renamed from src/3rdparty/angle/src/libGLESv2/State.cpp)236
-rw-r--r--src/3rdparty/angle/src/libANGLE/State.h (renamed from src/3rdparty/angle/src/libGLESv2/State.h)60
-rw-r--r--src/3rdparty/angle/src/libANGLE/Surface.cpp166
-rw-r--r--src/3rdparty/angle/src/libANGLE/Surface.h98
-rw-r--r--src/3rdparty/angle/src/libANGLE/Texture.cpp573
-rw-r--r--src/3rdparty/angle/src/libANGLE/Texture.h156
-rw-r--r--src/3rdparty/angle/src/libANGLE/TransformFeedback.cpp (renamed from src/3rdparty/angle/src/libGLESv2/TransformFeedback.cpp)4
-rw-r--r--src/3rdparty/angle/src/libANGLE/TransformFeedback.h (renamed from src/3rdparty/angle/src/libGLESv2/TransformFeedback.h)11
-rw-r--r--src/3rdparty/angle/src/libANGLE/Uniform.cpp (renamed from src/3rdparty/angle/src/libGLESv2/Uniform.cpp)6
-rw-r--r--src/3rdparty/angle/src/libANGLE/Uniform.h (renamed from src/3rdparty/angle/src/libGLESv2/Uniform.h)22
-rw-r--r--src/3rdparty/angle/src/libANGLE/VertexArray.cpp (renamed from src/3rdparty/angle/src/libGLESv2/VertexArray.cpp)13
-rw-r--r--src/3rdparty/angle/src/libANGLE/VertexArray.h (renamed from src/3rdparty/angle/src/libGLESv2/VertexArray.h)18
-rw-r--r--src/3rdparty/angle/src/libANGLE/VertexAttribute.cpp (renamed from src/3rdparty/angle/src/libGLESv2/VertexAttribute.cpp)22
-rw-r--r--src/3rdparty/angle/src/libANGLE/VertexAttribute.h (renamed from src/3rdparty/angle/src/libGLESv2/VertexAttribute.h)11
-rw-r--r--src/3rdparty/angle/src/libANGLE/angletypes.cpp (renamed from src/3rdparty/angle/src/libGLESv2/angletypes.cpp)62
-rw-r--r--src/3rdparty/angle/src/libANGLE/angletypes.h (renamed from src/3rdparty/angle/src/libGLESv2/angletypes.h)160
-rw-r--r--src/3rdparty/angle/src/libANGLE/features.h (renamed from src/3rdparty/angle/src/common/features.h)5
-rw-r--r--src/3rdparty/angle/src/libANGLE/formatutils.cpp (renamed from src/3rdparty/angle/src/libGLESv2/formatutils.cpp)383
-rw-r--r--src/3rdparty/angle/src/libANGLE/formatutils.h81
-rw-r--r--src/3rdparty/angle/src/libANGLE/queryconversions.cpp (renamed from src/3rdparty/angle/src/libGLESv2/queryconversions.cpp)2
-rw-r--r--src/3rdparty/angle/src/libANGLE/queryconversions.h (renamed from src/3rdparty/angle/src/libGLESv2/queryconversions.h)0
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/BufferImpl.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/BufferImpl.h)17
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/CompilerImpl.h30
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/DisplayImpl.cpp58
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/DisplayImpl.h99
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/FenceNVImpl.h34
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/FenceSyncImpl.h35
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/FramebufferImpl.h68
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/Image.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/Image.h)26
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/ImplFactory.h68
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/IndexRangeCache.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/IndexRangeCache.cpp)38
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/IndexRangeCache.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/IndexRangeCache.h)23
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/ProgramImpl.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/ProgramImpl.cpp)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/ProgramImpl.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/ProgramImpl.h)96
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/QueryImpl.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/QueryImpl.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/RenderbufferImpl.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/RenderbufferImpl.cpp)2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/RenderbufferImpl.h33
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/Renderer.cpp72
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/Renderer.h91
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/ShaderImpl.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/ShaderImpl.h)20
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/SurfaceImpl.cpp22
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/SurfaceImpl.h48
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/TextureImpl.h72
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/TransformFeedbackImpl.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/TransformFeedbackImpl.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/VertexArrayImpl.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/VertexArrayImpl.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/Workarounds.h74
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/BufferD3D.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/BufferD3D.cpp)36
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/BufferD3D.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/BufferD3D.h)29
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/CompilerD3D.cpp128
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/CompilerD3D.h48
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/DisplayD3D.cpp357
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/DisplayD3D.h61
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/DynamicHLSL.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/DynamicHLSL.cpp)287
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/DynamicHLSL.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/DynamicHLSL.h)16
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/FramebufferD3D.cpp463
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/FramebufferD3D.h111
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/HLSLCompiler.cpp)35
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/HLSLCompiler.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/HLSLCompiler.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ImageD3D.cpp47
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ImageD3D.h84
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/IndexBuffer.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/IndexBuffer.cpp)21
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/IndexBuffer.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/IndexBuffer.h)39
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/IndexDataManager.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/IndexDataManager.cpp)60
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/IndexDataManager.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/IndexDataManager.h)25
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ProgramD3D.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/ProgramD3D.cpp)384
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ProgramD3D.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/ProgramD3D.h)105
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.cpp36
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/RenderTargetD3D.h42
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/RenderbufferD3D.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/RenderbufferD3D.cpp)57
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/RenderbufferD3D.h43
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/RendererD3D.cpp628
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/RendererD3D.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.h)182
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ShaderD3D.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/ShaderD3D.cpp)229
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ShaderD3D.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/ShaderD3D.h)47
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ShaderExecutableD3D.cpp61
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/ShaderExecutableD3D.h54
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.cpp396
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/SurfaceD3D.h92
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/SwapChainD3D.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/SwapChain.h)29
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/TextureD3D.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/TextureD3D.cpp)897
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/TextureD3D.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/TextureD3D.h)183
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/TextureStorage.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/TextureStorage.cpp)14
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/TextureStorage.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/TextureStorage.h)29
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/TransformFeedbackD3D.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/TransformFeedbackD3D.cpp)2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/TransformFeedbackD3D.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/TransformFeedbackD3D.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexBuffer.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexBuffer.cpp)26
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexBuffer.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexBuffer.h)29
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.cpp)104
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/VertexDataManager.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/VertexDataManager.h)23
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/copyimage.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/copyimage.cpp)2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/copyimage.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/copyimage.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/copyimage.inl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/copyimage.inl)0
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Blit11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Blit11.cpp)208
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Blit11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Blit11.h)14
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Buffer11.cpp)491
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Buffer11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Buffer11.h)38
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Clear11.cpp)320
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Clear11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Clear11.h)53
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/DebugAnnotator11.cpp119
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/DebugAnnotator11.h39
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Fence11.cpp)11
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Fence11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Fence11.h)13
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.cpp270
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Framebuffer11.h45
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Image11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Image11.cpp)198
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Image11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Image11.h)31
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/IndexBuffer11.cpp)4
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/IndexBuffer11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/IndexBuffer11.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.cpp430
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/InputLayoutCache.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/InputLayoutCache.h)22
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/NativeWindow.h (renamed from src/3rdparty/angle/src/common/NativeWindow.h)28
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.cpp)52
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/PixelTransfer11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/PixelTransfer11.h)13
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Query11.cpp)19
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Query11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Query11.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.cpp)27
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/RenderStateCache.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/RenderStateCache.h)14
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.cpp)52
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/RenderTarget11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/RenderTarget11.h)34
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.cpp)1729
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/Renderer11.h)214
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/ShaderExecutable11.cpp)16
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/ShaderExecutable11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/ShaderExecutable11.h)18
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.cpp)174
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/SwapChain11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/SwapChain11.h)25
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.cpp)716
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/TextureStorage11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/TextureStorage11.h)82
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Trim11.cpp95
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Trim11.h43
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/VertexArray11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/VertexArray11.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/VertexBuffer11.cpp)66
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/VertexBuffer11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/VertexBuffer11.h)16
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/copyvertex.h40
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/copyvertex.inl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/copyvertex.inl)123
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/formatutils11.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/formatutils11.cpp)479
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/formatutils11.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/formatutils11.h)21
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.cpp)310
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/renderer11_utils.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/renderer11_utils.h)21
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/shaders/BufferToTexture11.hlsl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/BufferToTexture11.hlsl)3
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Clear11.hlsl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Clear11.hlsl)21
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Passthrough2D11.hlsl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Passthrough2D11.hlsl)0
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Passthrough3D11.hlsl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Passthrough3D11.hlsl)0
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/shaders/Swizzle11.hlsl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/shaders/Swizzle11.hlsl)0
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow.cpp (renamed from src/3rdparty/angle/src/common/win32/NativeWindow.cpp)16
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.cpp (renamed from src/3rdparty/angle/src/common/winrt/CoreWindowNativeWindow.cpp)116
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/CoreWindowNativeWindow.h110
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.cpp (renamed from src/3rdparty/angle/src/common/winrt/InspectableNativeWindow.cpp)29
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/InspectableNativeWindow.h (renamed from src/3rdparty/angle/src/common/winrt/InspectableNativeWindow.h)30
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.cpp (renamed from src/3rdparty/angle/src/common/winrt/SwapChainPanelNativeWindow.cpp)6
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/winrt/SwapChainPanelNativeWindow.h (renamed from src/3rdparty/angle/src/common/winrt/SwapChainPanelNativeWindow.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.cpp)74
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Blit9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Blit9.h)24
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Buffer9.cpp)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Buffer9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Buffer9.h)15
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/DebugAnnotator9.cpp36
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/DebugAnnotator9.h29
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Fence9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Fence9.cpp)7
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Fence9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Fence9.h)11
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.cpp422
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Framebuffer9.h41
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Image9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Image9.cpp)106
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Image9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Image9.h)28
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/IndexBuffer9.cpp)4
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/IndexBuffer9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/IndexBuffer9.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Query9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Query9.cpp)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Query9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Query9.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/RenderTarget9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.cpp)43
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/RenderTarget9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/RenderTarget9.h)29
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.cpp)1080
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/Renderer9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/Renderer9.h)167
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/ShaderCache.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/ShaderCache.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/ShaderExecutable9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/ShaderExecutable9.cpp)8
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/ShaderExecutable9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/ShaderExecutable9.h)14
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/SwapChain9.cpp)23
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/SwapChain9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/SwapChain9.h)21
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.cpp)26
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/TextureStorage9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/TextureStorage9.h)26
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/VertexArray9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/VertexArray9.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/VertexBuffer9.cpp)18
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/VertexBuffer9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/VertexBuffer9.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/VertexDeclarationCache.cpp)14
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/VertexDeclarationCache.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/VertexDeclarationCache.h)13
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/formatutils9.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/formatutils9.cpp)96
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/formatutils9.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/formatutils9.h)20
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.cpp)91
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/renderer9_utils.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/renderer9_utils.h)14
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/shaders/Blit.ps (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/Blit.ps)6
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/shaders/Blit.vs (renamed from src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d9/shaders/Blit.vs)4
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d9/vertexconversion.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/vertexconversion.h)6
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/formatutilsD3D.cpp147
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/formatutilsD3D.h50
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/generatemip.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/generatemip.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/generatemip.inl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/generatemip.inl)2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/imageformats.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/imageformats.h)10
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/loadimage.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/loadimage.cpp)13
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/loadimage.h (renamed from src/3rdparty/angle/src/libGLESv2/renderer/loadimage.h)12
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/loadimage.inl (renamed from src/3rdparty/angle/src/libGLESv2/renderer/loadimage.inl)2
-rw-r--r--src/3rdparty/angle/src/libANGLE/renderer/d3d/loadimageSSE2.cpp (renamed from src/3rdparty/angle/src/libGLESv2/renderer/loadimageSSE2.cpp)39
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationEGL.cpp503
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationEGL.h49
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationES.cpp (renamed from src/3rdparty/angle/src/libGLESv2/validationES.cpp)406
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationES.h (renamed from src/3rdparty/angle/src/libGLESv2/validationES.h)22
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationES2.cpp (renamed from src/3rdparty/angle/src/libGLESv2/validationES2.cpp)286
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationES2.h (renamed from src/3rdparty/angle/src/libGLESv2/validationES2.h)8
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationES3.cpp (renamed from src/3rdparty/angle/src/libGLESv2/validationES3.cpp)266
-rw-r--r--src/3rdparty/angle/src/libANGLE/validationES3.h (renamed from src/3rdparty/angle/src/libGLESv2/validationES3.h)11
-rw-r--r--src/3rdparty/angle/src/libEGL/Config.cpp353
-rw-r--r--src/3rdparty/angle/src/libEGL/Config.h114
-rw-r--r--src/3rdparty/angle/src/libEGL/Display.cpp648
-rw-r--r--src/3rdparty/angle/src/libEGL/Display.h104
-rw-r--r--src/3rdparty/angle/src/libEGL/Error.cpp48
-rw-r--r--src/3rdparty/angle/src/libEGL/Error.h39
-rw-r--r--src/3rdparty/angle/src/libEGL/Surface.cpp505
-rw-r--r--src/3rdparty/angle/src/libEGL/Surface.h120
-rw-r--r--src/3rdparty/angle/src/libEGL/libEGL.cpp1235
-rw-r--r--src/3rdparty/angle/src/libEGL/libEGL.def12
-rw-r--r--src/3rdparty/angle/src/libEGL/libEGL.rc103
-rw-r--r--src/3rdparty/angle/src/libEGL/libEGL_mingw32.def12
-rw-r--r--src/3rdparty/angle/src/libEGL/libEGLd.def12
-rw-r--r--src/3rdparty/angle/src/libEGL/main.cpp203
-rw-r--r--src/3rdparty/angle/src/libEGL/main.h45
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Error.cpp48
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Error.h39
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Float16ToFloat32.py78
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Framebuffer.cpp672
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Framebuffer.h126
-rw-r--r--src/3rdparty/angle/src/libGLESv2/HandleAllocator.cpp63
-rw-r--r--src/3rdparty/angle/src/libGLESv2/HandleAllocator.h44
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Program.cpp668
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Program.h151
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Texture.cpp1012
-rw-r--r--src/3rdparty/angle/src/libGLESv2/Texture.h241
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_egl.cpp1127
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_egl.h74
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.cpp271
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_egl_ext.h30
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0.cpp4318
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0.h163
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.cpp1058
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_2_0_ext.h78
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_3_0.cpp3394
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_3_0.h125
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_3_0_ext.cpp14
-rw-r--r--src/3rdparty/angle/src/libGLESv2/entry_points_gles_3_0_ext.h23
-rw-r--r--src/3rdparty/angle/src/libGLESv2/formatutils.h106
-rw-r--r--src/3rdparty/angle/src/libGLESv2/global_state.cpp235
-rw-r--r--src/3rdparty/angle/src/libGLESv2/global_state.h49
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2.cpp8423
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2.def12
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2.rc103
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2_mingw32.def12
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2d.def12
-rw-r--r--src/3rdparty/angle/src/libGLESv2/libGLESv2d_mingw32.def12
-rw-r--r--src/3rdparty/angle/src/libGLESv2/main.cpp186
-rw-r--r--src/3rdparty/angle/src/libGLESv2/main.h61
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/FenceImpl.h52
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/Image.cpp46
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/RenderTarget.cpp36
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/RenderTarget.h53
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/RenderbufferImpl.h41
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/Renderer.cpp172
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/Renderer.h193
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/ShaderExecutable.h78
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/TextureImpl.h64
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/Workarounds.h39
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/copyvertex.h35
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/d3d/ImageD3D.cpp26
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/d3d/ImageD3D.h50
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/d3d/RenderbufferD3D.h51
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/d3d/RendererD3D.cpp801
-rw-r--r--src/3rdparty/angle/src/libGLESv2/renderer/d3d/d3d11/InputLayoutCache.cpp255
-rw-r--r--src/3rdparty/angle/src/third_party/compiler/ArrayBoundsClamper.h6
-rw-r--r--src/3rdparty/angle/src/third_party/murmurhash/MurmurHash3.cpp2
-rw-r--r--src/3rdparty/angle/src/third_party/murmurhash/MurmurHash3.h2
-rw-r--r--src/3rdparty/angle/src/third_party/systeminfo/SystemInfo.h6
-rw-r--r--src/3rdparty/angle/src/third_party/trace_event/trace_event.h795
-rw-r--r--src/3rdparty/libpng.pri1
-rw-r--r--src/3rdparty/libpng/ANNOUNCE86
-rw-r--r--src/3rdparty/libpng/CHANGES1452
-rw-r--r--src/3rdparty/libpng/INSTALL316
-rw-r--r--src/3rdparty/libpng/LICENSE6
-rw-r--r--src/3rdparty/libpng/README63
-rw-r--r--src/3rdparty/libpng/libpng-manual.txt1399
-rw-r--r--src/3rdparty/libpng/png.c2716
-rw-r--r--src/3rdparty/libpng/png.h1902
-rw-r--r--src/3rdparty/libpng/pngconf.h468
-rw-r--r--src/3rdparty/libpng/pngdebug.h22
-rw-r--r--src/3rdparty/libpng/pngerror.c434
-rw-r--r--src/3rdparty/libpng/pngget.c563
-rw-r--r--src/3rdparty/libpng/pnginfo.h76
-rw-r--r--src/3rdparty/libpng/pnglibconf.h183
-rw-r--r--src/3rdparty/libpng/pngmem.c672
-rw-r--r--src/3rdparty/libpng/pngpread.c426
-rw-r--r--src/3rdparty/libpng/pngpriv.h1649
-rw-r--r--src/3rdparty/libpng/pngread.c3689
-rw-r--r--src/3rdparty/libpng/pngrio.c74
-rw-r--r--src/3rdparty/libpng/pngrtran.c1501
-rw-r--r--src/3rdparty/libpng/pngrutil.c3233
-rw-r--r--src/3rdparty/libpng/pngset.c1115
-rw-r--r--src/3rdparty/libpng/pngstruct.h213
-rw-r--r--src/3rdparty/libpng/pngtrans.c180
-rw-r--r--src/3rdparty/libpng/pngwio.c114
-rw-r--r--src/3rdparty/libpng/pngwrite.c1742
-rw-r--r--src/3rdparty/libpng/pngwtran.c255
-rw-r--r--src/3rdparty/libpng/pngwutil.c1858
-rw-r--r--src/3rdparty/libpng/qtpatches.diff77
-rw-r--r--src/3rdparty/pcre/pcre_compile.c142
-rw-r--r--src/3rdparty/pcre/pcre_dfa_exec.c5
-rw-r--r--src/3rdparty/pcre/pcre_exec.c20
-rw-r--r--src/3rdparty/pcre/pcre_jit_compile.c8
-rw-r--r--src/3rdparty/pcre/sljit/sljitLir.c6
-rw-r--r--src/3rdparty/pcre/sljit/sljitLir.h12
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtActivityDelegate.java9
-rw-r--r--src/android/jar/src/org/qtproject/qt5/android/QtNative.java4
-rw-r--r--src/angle/patches/0000-General-fixes-for-ANGLE-2.1.patch477
-rw-r--r--src/angle/patches/0001-ANGLE-Improve-Windows-Phone-Support.patch439
-rw-r--r--src/angle/patches/0002-ANGLE-Fix-compilation-with-MinGW.patch927
-rw-r--r--src/angle/patches/0003-ANGLE-Fix-compilation-on-MSVC2010-2012.patch363
-rw-r--r--src/angle/patches/0004-ANGLE-Dynamically-load-D3D-compiler-from-a-list.patch (renamed from src/angle/patches/0008-ANGLE-Dynamically-load-D3D-compiler-from-a-list-or-t.patch)33
-rw-r--r--src/angle/patches/0004-Make-it-possible-to-link-ANGLE-statically-for-single.patch109
-rw-r--r--src/angle/patches/0005-ANGLE-Add-support-for-querying-platform-device.patch84
-rw-r--r--src/angle/patches/0009-ANGLE-Support-WinRT.patch837
-rw-r--r--src/angle/patches/0010-ANGLE-Enable-D3D11-for-feature-level-9-cards.patch637
-rw-r--r--src/angle/patches/0012-ANGLE-fix-semantic-index-lookup.patch48
-rw-r--r--src/angle/patches/0013-ANGLE-Add-support-for-querying-platform-device.patch100
-rw-r--r--src/angle/patches/0014-Let-ANGLE-use-multithreaded-devices-if-necessary.patch69
-rw-r--r--src/angle/patches/0015-ANGLE-Fix-angle-d3d11-on-MSVC2010.patch536
-rw-r--r--src/angle/patches/0016-ANGLE-Fix-compilation-with-MinGW-D3D11.patch169
-rw-r--r--src/angle/patches/0017-ANGLE-Fix-compilation-with-D3D9.patch62
-rw-r--r--src/angle/patches/0018-ANGLE-Fix-releasing-textures-after-we-kill-D3D11.patch106
-rw-r--r--src/angle/patches/0019-ANGLE-Fix-handling-of-shader-source-with-fixed-lengt.patch37
-rw-r--r--src/angle/patches/0020-ANGLE-Do-not-use-std-strlen.patch30
-rw-r--r--src/angle/patches/0020-ANGLE-Fix-compilation-with-MSVC2013-Update4.patch43
-rw-r--r--src/angle/src/common/common.pri18
-rw-r--r--src/angle/src/compiler/preprocessor/preprocessor.pro2
-rw-r--r--src/angle/src/compiler/translator.pro39
-rw-r--r--src/angle/src/config.pri5
-rw-r--r--src/angle/src/libEGL/libEGL.pro35
-rw-r--r--src/angle/src/libGLESv2/libGLESv2.pro760
-rw-r--r--src/corelib/codecs/qiconvcodec.cpp2
-rw-r--r--src/corelib/doc/src/resource-system.qdoc2
-rw-r--r--src/corelib/global/qcompilerdetection.h4
-rw-r--r--src/corelib/global/qnamespace.h1
-rw-r--r--src/corelib/global/qnamespace.qdoc53
-rw-r--r--src/corelib/io/qabstractfileengine.cpp2
-rw-r--r--src/corelib/io/qdir.cpp6
-rw-r--r--src/corelib/io/qfile.cpp4
-rw-r--r--src/corelib/io/qfileinfo.cpp8
-rw-r--r--src/corelib/io/qfilesystemengine.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp2
-rw-r--r--src/corelib/io/qfilesystemengine_win.cpp10
-rw-r--r--src/corelib/io/qfilesystemwatcher.cpp2
-rw-r--r--src/corelib/io/qfilesystemwatcher.h12
-rw-r--r--src/corelib/io/qfsfileengine.cpp4
-rw-r--r--src/corelib/io/qiodevice.cpp6
-rw-r--r--src/corelib/io/qlockfile_unix.cpp2
-rw-r--r--src/corelib/io/qloggingcategory.cpp2
-rw-r--r--src/corelib/io/qprocess.cpp34
-rw-r--r--src/corelib/io/qprocess.h25
-rw-r--r--src/corelib/io/qprocess_p.h4
-rw-r--r--src/corelib/io/qprocess_unix.cpp4
-rw-r--r--src/corelib/io/qprocess_win.cpp19
-rw-r--r--src/corelib/io/qprocess_wince.cpp4
-rw-r--r--src/corelib/io/qsettings.cpp42
-rw-r--r--src/corelib/io/qstorageinfo_unix.cpp6
-rw-r--r--src/corelib/itemmodels/qabstractitemmodel.h84
-rw-r--r--src/corelib/itemmodels/qabstractproxymodel.h6
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
-rw-r--r--src/corelib/kernel/qcoreapplication.h6
-rw-r--r--src/corelib/kernel/qcoreapplication_win.cpp46
-rw-r--r--src/corelib/kernel/qcoreevent.cpp4
-rw-r--r--src/corelib/kernel/qeventdispatcher_blackberry.cpp2
-rw-r--r--src/corelib/kernel/qeventdispatcher_winrt.cpp327
-rw-r--r--src/corelib/kernel/qmetatype.cpp63
-rw-r--r--src/corelib/kernel/qmetatype.h1
-rw-r--r--src/corelib/kernel/qobject.cpp4
-rw-r--r--src/corelib/kernel/qobject.h34
-rw-r--r--src/corelib/kernel/qppsattribute.cpp4
-rw-r--r--src/corelib/kernel/qppsattribute_p.h5
-rw-r--r--src/corelib/kernel/qppsobject.cpp4
-rw-r--r--src/corelib/kernel/qsocketnotifier.h6
-rw-r--r--src/corelib/kernel/qtimer.h6
-rw-r--r--src/corelib/kernel/qwineventnotifier.h6
-rw-r--r--src/corelib/mimetypes/qmimedatabase.cpp2
-rw-r--r--src/corelib/plugin/qlibrary.cpp8
-rw-r--r--src/corelib/plugin/qpluginloader.cpp2
-rw-r--r--src/corelib/statemachine/qabstractstate.h12
-rw-r--r--src/corelib/statemachine/qabstracttransition.h18
-rw-r--r--src/corelib/statemachine/qhistorystate.h12
-rw-r--r--src/corelib/statemachine/qsignaltransition.h12
-rw-r--r--src/corelib/statemachine/qstate.h30
-rw-r--r--src/corelib/statemachine/qstatemachine.cpp566
-rw-r--r--src/corelib/statemachine/qstatemachine.h12
-rw-r--r--src/corelib/statemachine/qstatemachine_p.h26
-rw-r--r--src/corelib/thread/qreadwritelock.cpp57
-rw-r--r--src/corelib/thread/qreadwritelock_p.h1
-rw-r--r--src/corelib/thread/qthread.h12
-rw-r--r--src/corelib/thread/qthread_unix.cpp2
-rw-r--r--src/corelib/tools/qbytearraylist.h4
-rw-r--r--src/corelib/tools/qelapsedtimer.cpp6
-rw-r--r--src/corelib/tools/qlist.h7
-rw-r--r--src/corelib/tools/qscopedvaluerollback.h10
-rw-r--r--src/corelib/tools/qstring.cpp12
-rw-r--r--src/corelib/tools/qstringlist.h4
-rw-r--r--src/corelib/tools/qtimeline.h24
-rw-r--r--src/corelib/tools/qtimezone.cpp2
-rw-r--r--src/dbus/qdbusintegrator.cpp11
-rw-r--r--src/dbus/qdbusserver.cpp1
-rw-r--r--src/gui/image/qimage.cpp10
-rw-r--r--src/gui/image/qimage_conversions.cpp6
-rw-r--r--src/gui/image/qimage_sse4.cpp3
-rw-r--r--src/gui/kernel/qclipboard.cpp4
-rw-r--r--src/gui/kernel/qguiapplication.cpp7
-rw-r--r--src/gui/kernel/qpaintdevicewindow.cpp22
-rw-r--r--src/gui/kernel/qplatformintegration.cpp16
-rw-r--r--src/gui/kernel/qplatformintegration.h8
-rw-r--r--src/gui/kernel/qplatformtheme.cpp2
-rw-r--r--src/gui/kernel/qstylehints.cpp12
-rw-r--r--src/gui/kernel/qstylehints.h2
-rw-r--r--src/gui/kernel/qwindow.cpp4
-rw-r--r--src/gui/opengl/qopengl.cpp42
-rw-r--r--src/gui/opengl/qopengl_p.h24
-rw-r--r--src/gui/opengl/qopengltexture.cpp10
-rw-r--r--src/gui/opengl/qopengltexturehelper.cpp2
-rw-r--r--src/gui/painting/painting.pri3
-rw-r--r--src/gui/painting/qblendfunctions.cpp2136
-rw-r--r--src/gui/painting/qdrawhelper.cpp92
-rw-r--r--src/gui/painting/qdrawhelper_p.h36
-rw-r--r--src/gui/painting/qdrawhelper_sse4.cpp7
-rw-r--r--src/gui/painting/qdrawingprimitive_sse2_p.h21
-rw-r--r--src/gui/painting/qimagescale.cpp1155
-rw-r--r--src/gui/painting/qimagescale_p.h9
-rw-r--r--src/gui/painting/qimagescale_sse4.cpp247
-rw-r--r--src/gui/painting/qpdf.cpp490
-rw-r--r--src/gui/painting/qpdf_p.h13
-rw-r--r--src/gui/painting/qrgb.h37
-rw-r--r--src/gui/text/qfontdatabase.cpp2
-rw-r--r--src/gui/text/qtextcursor.cpp8
-rw-r--r--src/gui/text/qtextdocument.cpp3
-rw-r--r--src/gui/text/qtextengine.cpp15
-rw-r--r--src/gui/text/qtextengine_p.h1
-rw-r--r--src/gui/text/qtextformat.cpp4
-rw-r--r--src/gui/text/qtextlayout.cpp8
-rw-r--r--src/gui/text/qtextobject.cpp2
-rw-r--r--src/gui/util/qvalidator.cpp3
-rw-r--r--src/network/access/qnetworkaccessbackend.cpp3
-rw-r--r--src/network/access/qnetworkreplynsurlconnectionimpl.mm13
-rw-r--r--src/network/bearer/qnetworkconfigmanager_p.cpp4
-rw-r--r--src/network/ssl/qsslsocket.cpp2
-rw-r--r--src/network/ssl/qsslsocket_openssl.cpp2
-rw-r--r--src/platformheaders/xcbfunctions/qxcbwindowfunctions.h11
-rw-r--r--src/platformsupport/eglconvenience/qeglplatformintegration.cpp4
-rw-r--r--src/platformsupport/fontdatabases/mac/qcoretextfontdatabase.mm2
-rw-r--r--src/platformsupport/input/evdevtouch/evdevtouch.pri6
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp (renamed from src/platformsupport/input/evdevtouch/qevdevtouch.cpp)75
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchhandler_p.h (renamed from src/platformsupport/input/evdevtouch/qevdevtouch_p.h)9
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager.cpp122
-rw-r--r--src/platformsupport/input/evdevtouch/qevdevtouchmanager_p.h (renamed from mkspecs/features/data/headersclean/tst_headersclean.cpp.in)53
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp8
-rw-r--r--src/plugins/generic/evdevtouch/main.cpp4
-rw-r--r--src/plugins/platforminputcontexts/compose/generator/qtablegenerator.cpp6
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.cpp32
-rw-r--r--src/plugins/platforminputcontexts/compose/qcomposeplatforminputcontext.h1
-rw-r--r--src/plugins/platforms/android/androidjniinput.cpp12
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaintegration.mm13
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenuitem.mm3
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm3
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h1
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm72
-rw-r--r--src/plugins/platforms/ios/qiostextresponder.mm4
-rw-r--r--src/plugins/platforms/linuxfb/qlinuxfbintegration.cpp4
-rw-r--r--src/plugins/platforms/qnx/qqnxfilepicker.cpp4
-rw-r--r--src/plugins/platforms/qnx/qqnxfilepicker.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxsystemsettings.h4
-rw-r--r--src/plugins/platforms/qnx/qqnxvirtualkeyboardpps.h2
-rw-r--r--src/plugins/platforms/windows/accessible/iaccessible2.cpp2
-rw-r--r--src/plugins/platforms/windows/accessible/qwindowsmsaaaccessible.cpp4
-rw-r--r--src/plugins/platforms/windows/openglblacklists/default.json6
-rw-r--r--src/plugins/platforms/windows/qwindowseglcontext.cpp3
-rw-r--r--src/plugins/platforms/windows/qwindowsglcontext.cpp8
-rw-r--r--src/plugins/platforms/windows/qwindowsopengltester.cpp5
-rw-r--r--src/plugins/platforms/windows/qwindowswindow.cpp10
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.cpp64
-rw-r--r--src/plugins/platforms/winrt/qwinrtinputcontext.h8
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.cpp29
-rw-r--r--src/plugins/platforms/winrt/qwinrtscreen.h1
-rw-r--r--src/plugins/platforms/xcb/gl_integrations/gl_integrations_plugin_base.pri4
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.cpp74
-rw-r--r--src/plugins/platforms/xcb/qxcbconnection.h15
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.cpp9
-rw-r--r--src/plugins/platforms/xcb/qxcbcursor.h2
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.cpp11
-rw-r--r--src/plugins/platforms/xcb/qxcbintegration.h3
-rw-r--r--src/plugins/platforms/xcb/qxcbkeyboard.cpp1
-rw-r--r--src/plugins/platforms/xcb/qxcbnativeinterface.cpp3
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.cpp95
-rw-r--r--src/plugins/platforms/xcb/qxcbscreen.h41
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.cpp226
-rw-r--r--src/plugins/platforms/xcb/qxcbwindow.h12
-rw-r--r--src/plugins/platforms/xcb/qxcbwmsupport.cpp12
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.cpp10
-rw-r--r--src/plugins/platforms/xcb/qxcbxsettings.h4
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_win.cpp2
-rw-r--r--src/printsupport/dialogs/qprintdialog_mac.mm13
-rw-r--r--src/printsupport/kernel/qprintengine_win.cpp39
-rw-r--r--src/src.pro4
-rw-r--r--src/testlib/qtestblacklist.cpp9
-rw-r--r--src/testlib/qtestmouse.h2
-rw-r--r--src/testlib/testlib.pro8
-rw-r--r--src/tools/moc/generator.cpp3
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp5
-rw-r--r--src/tools/qdoc/generator.cpp21
-rw-r--r--src/tools/qdoc/generator.h1
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp19
-rw-r--r--src/tools/qdoc/node.cpp2
-rw-r--r--src/tools/qdoc/node.h5
-rw-r--r--src/tools/qdoc/tokenizer.cpp3
-rw-r--r--src/tools/qdoc/tokenizer.h4
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp149
-rw-r--r--src/widgets/dialogs/qfiledialog_p.h6
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.h4
-rw-r--r--src/widgets/graphicsview/qgraphicsitem.cpp2
-rw-r--r--src/widgets/kernel/qapplication.cpp1
-rw-r--r--src/widgets/kernel/qwidget.cpp2
-rw-r--r--src/widgets/kernel/qwidgetbackingstore.cpp1
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp4
-rw-r--r--tests/auto/corelib/io/qdir/tst_qdir.cpp41
-rw-r--r--tests/auto/corelib/kernel/qmetatype/tst_qmetatype.cpp48
-rw-r--r--tests/auto/corelib/statemachine/qstatemachine/tst_qstatemachine.cpp186
-rw-r--r--tests/auto/gui/image/qimage/tst_qimage.cpp103
-rw-r--r--tests/auto/gui/kernel/qguiapplication/tst_qguiapplication.cpp17
-rw-r--r--tests/auto/gui/painting/qcolor/tst_qcolor.cpp19
-rw-r--r--tests/auto/gui/qopenglconfig/buglist.json8
-rw-r--r--tests/auto/gui/qopenglconfig/tst_qopenglconfig.cpp38
-rw-r--r--tests/auto/other/headersclean/headersclean.pro3
-rw-r--r--tests/auto/other/macnativeevents/BLACKLIST11
-rw-r--r--tests/auto/other/macnativeevents/macnativeevents.pro1
-rw-r--r--tests/auto/other/other.pro5
-rw-r--r--tests/auto/widgets/dialogs/qfiledialog/tst_qfiledialog.cpp7
-rw-r--r--tests/benchmarks/gui/image/image.pro1
-rw-r--r--tests/benchmarks/gui/image/qimagescale/qimagescale.pro4
-rw-r--r--tests/benchmarks/gui/image/qimagescale/tst_qimagescale.cpp140
-rw-r--r--tests/manual/cocoa/appicon/README3
-rw-r--r--tests/manual/cocoa/appicon/appicon.pro4
-rw-r--r--tests/manual/cocoa/appicon/main.cpp68
-rw-r--r--tools/configure/configureapp.cpp10
790 files changed, 62924 insertions, 44804 deletions
diff --git a/bin/syncqt.pl b/bin/syncqt.pl
index 3bee0175ff..3b3e127e86 100755
--- a/bin/syncqt.pl
+++ b/bin/syncqt.pl
@@ -190,8 +190,9 @@ sub shouldMasterInclude {
}
######################################################################
-# Syntax: classNames(iheader)
+# Syntax: classNames(iheader, clean)
# Params: iheader, string, filename to parse for classname "symlinks"
+# (out) clean, boolean, will be set to false if the header isn't clean
#
# Purpose: Scans through iheader to find all classnames that should be
# synced into library's include structure.
@@ -199,7 +200,8 @@ sub shouldMasterInclude {
######################################################################
sub classNames {
my @ret;
- my ($iheader) = @_;
+ my ($iheader, $clean) = @_;
+ $$clean = 1;
my $ihdrbase = basename($iheader);
my $classname = $classnames{$ihdrbase};
@@ -212,6 +214,7 @@ sub classNames {
chomp $line;
chop $line if ($line =~ /\r$/);
if($line =~ /^\#/) {
+ $$clean = 0 if ($line =~ m/^#pragma qt_sync_skip_header_check/);
return @ret if($line =~ m/^#pragma qt_sync_stop_processing/);
push(@ret, $1) if($line =~ m/^#pragma qt_class\(([^)]*)\)[\r\n]*$/);
$line = 0;
@@ -828,6 +831,7 @@ foreach my $lib (@modules_to_sync) {
my $pri_install_pfiles = "";
my $pri_install_qpafiles = "";
my $pri_injections = "";
+ my $pri_clean_files = "";
my $libcapitals = uc($lib);
my $master_contents =
@@ -929,9 +933,10 @@ foreach my $lib (@modules_to_sync) {
}
}
+ my $clean_header;
my $iheader = $subdir . "/" . $header;
$iheader =~ s/^\Q$basedir\E/$out_basedir/ if ($shadow);
- my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader) : ();
+ my @classes = $public_header && (!$minimal && $is_qt) ? classNames($iheader, \$clean_header) : ();
if($showonly) {
print "$header [$lib]\n";
foreach(@classes) {
@@ -980,6 +985,7 @@ foreach my $lib (@modules_to_sync) {
$injection .= ":$class";
}
$pri_install_files.= "$pri_install_iheader ";;
+ $pri_clean_files .= "$pri_install_iheader " if ($clean_header);
}
elsif ($qpa_header) {
$pri_install_qpafiles.= "$pri_install_iheader ";;
@@ -1120,6 +1126,7 @@ foreach my $lib (@modules_to_sync) {
$headers_pri_contents .= "SYNCQT.HEADER_CLASSES = $pri_install_classes\n";
$headers_pri_contents .= "SYNCQT.PRIVATE_HEADER_FILES = $pri_install_pfiles\n";
$headers_pri_contents .= "SYNCQT.QPA_HEADER_FILES = $pri_install_qpafiles\n";
+ $headers_pri_contents .= "SYNCQT.CLEAN_HEADER_FILES = $pri_clean_files\n";
$headers_pri_contents .= "SYNCQT.INJECTIONS = $pri_injections\n";
my $headers_pri_file = "$out_basedir/include/$lib/headers.pri";
writeFile($headers_pri_file, $headers_pri_contents, $lib, "headers.pri file");
diff --git a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
index 623726c9f3..b63c75c070 100644
--- a/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
+++ b/config.tests/qpa/eglfs-brcm/eglfs-brcm.pro
@@ -2,8 +2,6 @@ SOURCES = eglfs-brcm.cpp
CONFIG -= qt
-INCLUDEPATH += $$[QT_SYSROOT]/opt/vc/include \
- $$[QT_SYSROOT]/opt/vc/include/interface/vcos/pthreads \
- $$[QT_SYSROOT]/opt/vc/include/interface/vmcs_host/linux
+INCLUDEPATH += $$QMAKE_INCDIR_EGL
-LIBS += -L$$[QT_SYSROOT]/opt/vc/lib -lEGL -lGLESv2 -lbcm_host
+LIBS += -L$$QMAKE_LIBDIR_EGL -lEGL -lGLESv2 -lbcm_host
diff --git a/configure b/configure
index 4addf22896..03421dfc4c 100755
--- a/configure
+++ b/configure
@@ -762,6 +762,7 @@ QPA_PLATFORM_GUARD=yes
CFG_CXX11=auto
CFG_DIRECTWRITE=no
CFG_WERROR=auto
+CFG_HEADERSCLEAN=auto
CFG_QREAL=double
OPT_MAC_SDK=
COMMERCIAL_USER=ask
@@ -2240,6 +2241,13 @@ while [ "$#" -gt 0 ]; do
UNKNOWN_OPT=yes
fi
;;
+ headersclean)
+ if [ "$VAL" = "yes" ] || [ "$VAL" = "no" ]; then
+ CFG_HEADERSCLEAN="$VAL"
+ else
+ UNKNOWN_OPT=yes
+ fi
+ ;;
xkb-config-root)
CFG_XKB_CONFIG_ROOT="$VAL"
;;
@@ -6712,8 +6720,16 @@ if [ "$CFG_DEV" = "yes" ]; then
if [ "$CFG_WERROR" != "no" ]; then
QMAKE_CONFIG="$QMAKE_CONFIG warnings_are_errors"
fi
-elif [ "$CFG_WERROR" = "yes" ]; then
- QMAKE_CONFIG="$QMAKE_CONFIG warnings_are_errors"
+ if [ "$CFG_HEADERSCLEAN" != "no" ]; then
+ QMAKE_CONFIG="$QMAKE_CONFIG headersclean"
+ fi
+else
+ if [ "$CFG_WERROR" = "yes" ]; then
+ QMAKE_CONFIG="$QMAKE_CONFIG warnings_are_errors"
+ fi
+ if [ "$CFG_HEADERSCLEAN" = "yes" ]; then
+ QMAKE_CONFIG="$QMAKE_CONFIG headersclean"
+ fi
fi
cat >>"$QTCONFIG.tmp" <<EOF
diff --git a/doc/global/html-footer-online.qdocconf b/doc/global/html-footer-online.qdocconf
index 5c72819341..1937d97cbb 100644
--- a/doc/global/html-footer-online.qdocconf
+++ b/doc/global/html-footer-online.qdocconf
@@ -13,12 +13,12 @@ HTML.footer += \
" <nav class=\"footer-nav clearfix\">\n" \
" <div class=\"menu-footer-menu-container\"><ul id=\"menu-footer-menu\" class=\"menu\"><li id=\"menu-item-1350\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1350\"><a href=\"http://qt.io/about-us/\">About us</a>\n" \
"<ul class=\"sub-menu\">\n" \
- " <li id=\"menu-item-1353\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1353\"><a href=\"http://qt.io/events/\">Events</a></li>\n" \
+ " <li id=\"menu-item-1353\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1353\"><a href=\"http://qt.io/events/\">Training &amp; Events</a></li>\n" \
" <li id=\"menu-item-1596\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1596\"><a href=\"http://qt.io/news/\">News</a></li>\n" \
" <li id=\"menu-item-1354\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1354\"><a href=\"http://qt.io/resource-center/\">Resource Center</a></li>\n" \
" <li id=\"menu-item-1352\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1352\"><a href=\"http://qt.io/partners/\">Partners</a></li>\n" \
" <li id=\"menu-item-1349\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1349\"><a href=\"http://qt.io/careers/\">Careers</a></li>\n" \
- " <li id=\"menu-item-1415\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1415\"><a href=\"http://qt.io/terms-conditions/\">Terms &amp; Conditions</a></li>\n" \
+ " <li id=\"menu-item-11676\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-11676\"><a href=\"http://qt.io/locations/\">Locations</a></li>\n" \
"</ul>\n" \
"</li>\n" \
"<li id=\"menu-item-1355\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1355\"><a href=\"http://qt.io/product/\">Product</a>\n" \
@@ -28,7 +28,7 @@ HTML.footer += \
" <li id=\"menu-item-1359\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1359\"><a href=\"http://qt.io/qt-quick/\">Qt Quick</a></li>\n" \
" <li id=\"menu-item-1357\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1357\"><a href=\"http://qt.io/qt-for-device-creation/\">Qt for Device Creation</a></li>\n" \
" <li id=\"menu-item-10159\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-10159\"><a href=\"http://qt.io/mobile-app-development/\">Qt for Mobile Apps</a></li>\n" \
- " <li id=\"menu-item-1366\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-1366\"><a href=\"http://showroom.qt-project.org/\">Showroom</a></li>\n" \
+ " <li id=\"menu-item-12576\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-12576\"><a href=\"http://qt.io/qt-in-use/\">Qt in Use</a></li>\n" \
"</ul>\n" \
"</li>\n" \
"<li id=\"menu-item-33\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-33\"><a href=\"http://qt.io/developers/\">Developers</a>\n" \
@@ -53,18 +53,19 @@ HTML.footer += \
"</li>\n" \
"<li id=\"menu-item-1403\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-has-children menu-item-1403\"><a href=\"http://qt.io/download/\">Download</a>\n" \
"<ul class=\"sub-menu\">\n" \
- " <li id=\"menu-item-1985\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1985\"><a title=\"Professional\" href=\"http://qt.io/buy/\">Professional</a></li>\n" \
- " <li id=\"menu-item-3346\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3346\"><a title=\"Indie Mobile\" href=\"http://qt.io/download-mobile/\">Indie Mobile</a></li>\n" \
- " <li id=\"menu-item-1982\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1982\"><a title=\"Enterprise\" href=\"http://qt.io/download-enterprise-step-2/\">Enterprise</a></li>\n" \
- " <li id=\"menu-item-3013\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3013\"><a title=\"Evaluation\" href=\"http://qt.io/download-eval-step-2/\">Evaluation</a></li>\n" \
+ " <li id=\"menu-item-11677\" class=\"menu-item menu-item-type-custom menu-item-object-custom menu-item-11677\"><a href=\"http://qt.io/download/\">Free 30-Day Trial</a></li>\n" \
+ " <li id=\"menu-item-1982\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1982\"><a href=\"http://qt.io/buy-enterprise-step-2/\">Enterprise</a></li>\n" \
+ " <li id=\"menu-item-1985\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1985\"><a href=\"http://qt.io/buy-professional-step-2/\">Professional</a></li>\n" \
+ " <li id=\"menu-item-3346\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3346\"><a href=\"http://qt.io/buy-indiemobile-step-2/\">Indie Mobile</a></li>\n" \
" <li id=\"menu-item-3343\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-3343\"><a href=\"http://qt.io/download-open-source/\">Community</a></li>\n" \
+ " <li id=\"menu-item-1415\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1415\"><a href=\"http://qt.io/terms-conditions/\">Legal | Terms &amp; Conditions</a></li>\n" \
"</ul>\n" \
"</li>\n" \
"</ul></div></nav>\n" \
"<a href=\"http://qt.io/about-us/\" target=\"_blank\" class=\"theqtcompany\"></a>\n" \
" <div class=\"footer-social clearfix\">\n" \
" <div class=\"facebook\">\n" \
- " <iframe scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" src=\"//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fqtbydigia&amp;width&amp;layout=button_count&amp;action=like&amp;show_faces=true&amp;share=false&amp;height=21\" style=\"border:none;overflow:hidden;height:21px;\"></iframe>\n" \
+ " <iframe scrolling=\"no\" frameborder=\"0\" allowTransparency=\"true\" src=\"//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fqt&amp;width&amp;layout=button_count&amp;action=like&amp;show_faces=true&amp;share=false&amp;height=21\" style=\"border:none;overflow:hidden;height:21px;\"></iframe>\n" \
" </div>\n" \
" <div class=\"twitter\">\n" \
" <iframe id=\"twitter-widget-0\" scrolling=\"no\" frameborder=\"0\" allowtransparency=\"true\" src=\"http://platform.twitter.com/widgets/follow_button.33b190ea0cba008796487b65df7f6d8e.en.html#_=1414403615717&amp;id=twitter-widget-0&amp;lang=en&amp;screen_name=qtproject&amp;show_count=true&amp;show_screen_name=false&amp;size=m\" class=\"twitter-follow-button twitter-follow-button\" title=\"Twitter Follow Button\" data-twttr-rendered=\"true\" style=\"width: 160px; height: 20px;\"></iframe>\n" \
diff --git a/doc/global/html-header-online.qdocconf b/doc/global/html-header-online.qdocconf
index e6dcbe19fa..aa67c43947 100644
--- a/doc/global/html-header-online.qdocconf
+++ b/doc/global/html-header-online.qdocconf
@@ -29,7 +29,7 @@ HTML.headerstyles = \
HTML.headerscripts = \
" <script type=\"text/javascript\"> wpThemeFolder = \'http://qt.io/wp-content/themes/oneqt\'; </script>\n" \
- " <script type=\"text/javascript\" src=\"http://d3hp9ud7yvwzy0.cloudfront.net/wp-content/themes/oneqt/js/combo.js.gzip\"></script>\n" \
+ " <script type=\"text/javascript\" src=\"//d3hp9ud7yvwzy0.cloudfront.net/wp-content/themes/oneqt/js/combo.js.gzip\"></script>\n" \
" <script type=\"text/javascript\" src=\"scripts/main.js\"></script>\n" \
" <script type=\"text/javascript\" src=\"scripts/extras.js\"></script>\n" \
" <script type=\"text/javascript\">\n" \
@@ -62,7 +62,7 @@ HTML.postheader = \
"<header id=\"navbar\" class=\"\">\n" \
" <div class=\"cookies_yum\">\n" \
" <div>\n" \
- " <img src=\"http://qt.io/wp-content/themes/oneqt/assets/images/cookie_small.png\" align=\"left\">\n" \
+ " <img src=\"//d3hp9ud7yvwzy0.cloudfront.net/wp-content/themes/oneqt/assets/images/cookie_small.png\" align=\"left\">\n" \
" <p class=\"close_button\">\n" \
" We bake cookies in your browser for a better experience. Using this site means that you consent. <a href=\"//qt.io/terms-conditions/\">Read More</a>\n" \
" </p>\n" \
@@ -95,12 +95,11 @@ HTML.postheader = \
" <a href=\"http://qt.io/\" class=\"navbar-oneQt retina\" data-icon=\"\">\n" \
" </a>\n" \
" <nav class=\"navbar-menu clearfix\" role=\"navigation\">\n" \
- " <ul id=\"mainmenu\" class=\"menu\"><li id=\"menu-item-21\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-21\"><a href=\"http://qt.io/product/\">Product</a></li>\n" \
- "<li id=\"menu-item-1381\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1381\"><a href=\"http://qt.io/services/\">Services</a></li>\n" \
- "<li id=\"menu-item-22\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-22\"><a href=\"http://qt.io/qt-in-use/\">Qt in Use</a></li>\n" \
- "<li id=\"menu-item-20\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-20\"><a href=\"http://qt.io/developers/\">Developers</a></li>\n" \
- "<li id=\"menu-item-4466\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-4466\"><a href=\"http://qt.io/licensing/\">Licensing</a></li>\n" \
- "<li id=\"menu-item-18\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-18\"><a href=\"http://qt.io/download/\">Download</a></li>\n" \
+ " <ul id=\"mainmenu\" class=\"menu\"><li id=\"menu-item-18\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-18\"><a href=\"http://qt.io/download/\">Download</a></li>\n" \
+ "<li id=\"menu-item-12207\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-12207\"><a href=\"http://www.qt.io/qt-for-device-creation/\">Device Creation</a></li>\n" \
+ "<li id=\"menu-item-12208\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-12208\"><a href=\"http://www.qt.io/application-development/\">Application Development</a></li>\n" \
+ "<li id=\"menu-item-1381\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-1381\"><a href=\"http://www.qt.io/services/\">Services</a></li>\n" \
+ "<li id=\"menu-item-20\" class=\"menu-item menu-item-type-post_type menu-item-object-page menu-item-20\"><a href=\"http://www.qt.io/developers/\">Developers</a></li>\n" \
"</ul> <ul class=\"menuextraslanguages\">\n" \
" <li class=\"active dark\"><a class=\"dark\" href=\"http://qt.io/support/\">EN</a></li><li class=\"dark\"><a class=\"dark\" href=\"http://qt.io/ru/\">RU</a></li><li class=\"dark\"><a class=\"dark\" href=\"http://qt.io/zh-hans/\">ZH</a></li></ul>\n" \
" </nav>\n" \
diff --git a/doc/global/template/scripts/extras.js b/doc/global/template/scripts/extras.js
index 409215f2d8..8a623a037e 100644
--- a/doc/global/template/scripts/extras.js
+++ b/doc/global/template/scripts/extras.js
@@ -4,7 +4,7 @@ $(function () {
$('a[href*=#]:not([href=#])').on('click', function (e) {
if (e.which == 2)
return true;
- var target = $(this.hash);
+ var target = $(this.hash.replace(/(\.)/g, "\\$1"));
target = target.length ? target : $('[name=' + this.hash.slice(1) + ']');
if (target.length) {
setTimeout(function () {
@@ -15,10 +15,10 @@ $(function () {
$(window).load(function () {
var h = window.location.hash;
- var re = /[^a-z0-9_\#\-]/i
+ var re = /[^a-z0-9_\.\#\-]/i
if (h.length > 1 && !re.test(h)) {
setTimeout(function () {
- $(window).scrollTop($(h).offset().top - vOffset);
+ $(window).scrollTop($(h.replace(/(\.)/g, "\\$1")).offset().top - vOffset);
}, 0);
}
});
diff --git a/doc/global/template/scripts/main.js b/doc/global/template/scripts/main.js
index 79de4ea5b2..823cebecf8 100644
--- a/doc/global/template/scripts/main.js
+++ b/doc/global/template/scripts/main.js
@@ -36,7 +36,7 @@ function load_sdk(s, id, src) {
fjs.parentNode.insertBefore(js, fjs);
}
$(document).ready(function($) {
- if (document.documentElement.clientWidth < 1220) {
+ if (document.documentElement.clientWidth < 1280) {
oneQt.extraLinksToMain();
}
@@ -76,7 +76,7 @@ $(document).ready(function($) {
$(window).resize(function() {
oneQt.stickySidebar();
oneQt.footerPosition();
- if (document.documentElement.clientWidth < 1220) {
+ if (document.documentElement.clientWidth < 1280) {
oneQt.extraLinksToMain();
} else {
oneQt.mainLinkstoExtra();
@@ -216,7 +216,7 @@ var oneQt = {
var extramenuLinks = $('#menuextras').find('li');
var mainmenu = $('#mainmenu');
var count = 0;
- if ($(extramenuLinks).length > 3) {
+ if ($(extramenuLinks).length > 2) {
$(extramenuLinks).each(function() {
if (count < 3) {
var newLink = $(this);
diff --git a/doc/global/template/style/online.css b/doc/global/template/style/online.css
index d1cfcd2d20..240a818798 100644
--- a/doc/global/template/style/online.css
+++ b/doc/global/template/style/online.css
@@ -25,7 +25,9 @@
min-width:95px;
position:relative;
text-align:center;
- margin:10px 0 0 0
+ border-left:1px solid #eee;
+ border-right:1px solid #eee;
+ padding:10px 0 10px 0
}
#navbar .navbar-toggle:hover figure {
background:#5caa15
@@ -873,13 +875,13 @@ body.qt-account #navbar .navbar-oneQt h2 {
.clearfix .right {
float:right
}
-html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
margin:0;
padding:0;
border:0;
font-size:100%
}
-html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,caption,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video {
vertical-align:baseline
}
body {
diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
index 9f7ba46c3c..395d6f247c 100644
--- a/mkspecs/features/create_cmake.prf
+++ b/mkspecs/features/create_cmake.prf
@@ -173,9 +173,28 @@ contains(CONFIG, plugin) {
CMAKE_MKSPEC = $$[QMAKE_XSPEC]
-CMAKE_MODULE_DEPS = $$cmakeModuleList($$sort_depends(QT.$${MODULE}.depends, QT.))
-CMAKE_PARTIAL_MODULE_DEPS = $$replace(CMAKE_MODULE_DEPS, ";", ";Qt5::")
-!isEmpty(CMAKE_PARTIAL_MODULE_DEPS):CMAKE_QT5_MODULE_DEPS = "Qt5::$${CMAKE_PARTIAL_MODULE_DEPS}"
+sorted_deps = $$sort_depends(QT.$${MODULE}.depends, QT.)
+mod_deps =
+lib_deps =
+aux_mod_deps =
+aux_lib_deps =
+# Until CMake 3.0 is the minimum requirement of Qt 5, we need to filter
+# out header-only modules from dependencies. CMake 3.0 provides INTERFACE
+# libraries which are equivalent to header-only modules.
+for (dep, sorted_deps) {
+ cdep = $$cmakeModuleName($$dep)
+ !contains(QT.$${dep}.module_config, no_link) {
+ mod_deps += $$cdep
+ lib_deps += Qt5::$$cdep
+ } else {
+ aux_mod_deps += $$cdep
+ aux_lib_deps += Qt5::$$cdep
+ }
+}
+CMAKE_MODULE_DEPS = $$join(mod_deps, ";")
+CMAKE_QT5_MODULE_DEPS = $$join(lib_deps, ";")
+CMAKE_INTERFACE_MODULE_DEPS = $$join(aux_mod_deps, ";")
+CMAKE_INTERFACE_QT5_MODULE_DEPS = $$join(aux_lib_deps, ";")
CMAKE_QT_STEM = Qt$$QT_MAJOR_VERSION$${CMAKE_MODULE_NAME}$${QT_LIBINFIX}
diff --git a/mkspecs/features/ctest_testcase_common.prf b/mkspecs/features/ctest_testcase_common.prf
index b98a613f55..bdf40541ec 100644
--- a/mkspecs/features/ctest_testcase_common.prf
+++ b/mkspecs/features/ctest_testcase_common.prf
@@ -61,7 +61,12 @@ BUILD_DIR = $$replace($$list($$OUT_PWD/build), /, $$QMAKE_DIR_SEP)
dependentmodules = $$resolve_depends(CMAKE_QT_MODULES_UNDER_TEST, "QT.")
dependentmodules -= $$CMAKE_QT_MODULES_UNDER_TEST
-dependentmodules = $$cmakeModuleList($$dependentmodules)
+
+mod_deps =
+for (dep, dependentmodules): \
+ !contains(QT.$${dep}.module_config, no_link): \
+ mod_deps += $$cmakeModuleName($$dep)
+dependentmodules = $$join(mod_deps, ";")
contains(QT_CONFIG, angle): CMAKE_GL_DEFINES = -DQT_WITH_ANGLE=True
!contains(QT_CONFIG, egl): CMAKE_GL_DEFINES += -DNO_EGL=True
diff --git a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
index d1dfeed535..70b9ed941a 100644
--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
@@ -1,7 +1,13 @@
+!!IF !equals(TEMPLATE, aux)
if (CMAKE_VERSION VERSION_LESS 2.8.3)
message(FATAL_ERROR \"Qt 5 requires at least CMake version 2.8.3\")
endif()
+!!ELSE
+if (CMAKE_VERSION VERSION_LESS 3.0.0)
+ message(FATAL_ERROR \"Qt 5 $${CMAKE_MODULE_NAME} module requires at least CMake version 3.0.0\")
+endif()
+!!ENDIF
!!IF !isEmpty(CMAKE_USR_MOVE_WORKAROUND)
!!IF !isEmpty(CMAKE_LIB_DIR_IS_ABSOLUTE)
@@ -46,7 +52,7 @@ but not all the files it references.
endif()
endmacro()
-
+!!IF !equals(TEMPLATE, aux)
macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATION IMPLIB_LOCATION)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} APPEND PROPERTY IMPORTED_CONFIGURATIONS ${Configuration})
@@ -80,6 +86,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
endif()
!!ENDIF
endmacro()
+!!ENDIF
if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
@@ -143,13 +150,20 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
endif()
!!ENDIF
+!!IF !equals(TEMPLATE, aux)
set(Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS ${_Qt5$${CMAKE_MODULE_NAME}_OWN_INCLUDE_DIRS})
set(Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS -D$${MODULE_DEFINE})
set(Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS $${MODULE_DEFINE})
-
+!!ENDIF // TEMPLATE != aux
set(_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_MODULE_DEPS}\")
+!!IF !isEmpty(CMAKE_INTERFACE_MODULE_DEPS)
+ if (NOT CMAKE_VERSION VERSION_LESS 3.0.0)
+ list(APPEND _Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES \"$${CMAKE_INTERFACE_MODULE_DEPS}\")
+ endif()
+!!ENDIF
+
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED)
if (Qt5$${CMAKE_MODULE_NAME}_FIND_REQUIRED)
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_DEPENDENCIES_REQUIRED REQUIRED)
@@ -163,7 +177,9 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set(_Qt5$${CMAKE_MODULE_NAME}_FIND_VERSION_EXACT EXACT)
endif()
+!!IF !equals(TEMPLATE, aux)
set(Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS \"\")
+!!ENDIF // TEMPLATE != aux
foreach(_module_dep ${_Qt5$${CMAKE_MODULE_NAME}_MODULE_DEPENDENCIES})
if (NOT Qt5${_module_dep}_FOUND)
@@ -180,26 +196,40 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
return()
endif()
+!!IF !equals(TEMPLATE, aux)
list(APPEND Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS \"${Qt5${_module_dep}_INCLUDE_DIRS}\")
list(APPEND Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS \"${Qt5${_module_dep}_PRIVATE_INCLUDE_DIRS}\")
list(APPEND Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS ${Qt5${_module_dep}_DEFINITIONS})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS ${Qt5${_module_dep}_COMPILE_DEFINITIONS})
list(APPEND Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS ${Qt5${_module_dep}_EXECUTABLE_COMPILE_FLAGS})
+!!ENDIF // TEMPLATE != aux
endforeach()
+!!IF !equals(TEMPLATE, aux)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_PRIVATE_INCLUDE_DIRS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_COMPILE_DEFINITIONS)
list(REMOVE_DUPLICATES Qt5$${CMAKE_MODULE_NAME}_EXECUTABLE_COMPILE_FLAGS)
+!!ENDIF // TEMPLATE != aux
set(_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_QT5_MODULE_DEPS}\")
+!!IF !isEmpty(CMAKE_INTERFACE_QT5_MODULE_DEPS)
+ if (NOT CMAKE_VERSION VERSION_LESS 3.0.0)
+ list(APPEND _Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES \"$${CMAKE_INTERFACE_QT5_MODULE_DEPS}\")
+ endif()
+!!ENDIF
+
!!IF !isEmpty(CMAKE_STATIC_TYPE)
add_library(Qt5::$${CMAKE_MODULE_NAME} STATIC IMPORTED)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY IMPORTED_LINK_INTERFACE_LANGUAGES "CXX")
!!ELSE
+!!IF equals(TEMPLATE, aux)
+ add_library(Qt5::$${CMAKE_MODULE_NAME} INTERFACE IMPORTED)
+!!ELSE
add_library(Qt5::$${CMAKE_MODULE_NAME} SHARED IMPORTED)
!!ENDIF
+!!ENDIF
!!IF !isEmpty(CMAKE_BUILD_IS_FRAMEWORK)
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY FRAMEWORK 1)
!!ENDIF
@@ -209,6 +239,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
set_property(TARGET Qt5::$${CMAKE_MODULE_NAME} PROPERTY
INTERFACE_COMPILE_DEFINITIONS $${MODULE_DEFINE})
+!!IF !equals(TEMPLATE, aux)
!!IF !isEmpty(CMAKE_RELEASE_TYPE)
!!IF !isEmpty(CMAKE_STATIC_WINDOWS_BUILD)
_populate_$${CMAKE_MODULE_NAME}_target_properties(RELEASE \"$${CMAKE_IMPLIB_FILE_LOCATION_RELEASE}\" \"\" )
@@ -282,6 +313,11 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
!!ENDIF // CMAKE_FIND_OTHER_LIBRARY_BUILD
!!ENDIF // CMAKE_DEBUG_TYPE
+!!ELSE // TEMPLATE != aux
+ set_target_properties(Qt5::$${CMAKE_MODULE_NAME} PROPERTIES
+ INTERFACE_LINK_LIBRARIES \"${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}\"
+ )
+!!ENDIF // TEMPLATE != aux
file(GLOB pluginTargets \"${CMAKE_CURRENT_LIST_DIR}/Qt5$${CMAKE_MODULE_NAME}_*Plugin.cmake\")
diff --git a/mkspecs/features/data/dummy.cpp b/mkspecs/features/data/dummy.cpp
new file mode 100644
index 0000000000..6bda7320e9
--- /dev/null
+++ b/mkspecs/features/data/dummy.cpp
@@ -0,0 +1,2 @@
+// Used when we need to compile with no source code
+// (controls are in the command-line)
diff --git a/mkspecs/features/device_config.prf b/mkspecs/features/device_config.prf
index 1de64b8821..cd3a0cf8cd 100644
--- a/mkspecs/features/device_config.prf
+++ b/mkspecs/features/device_config.prf
@@ -14,17 +14,26 @@ host_build {
# Provide a function to be used by mkspecs
defineTest(deviceSanityCheckCompiler) {
+ equals(QMAKE_HOST.os, Windows): \
+ sfx = .exe
+ else: \
+ sfx =
+
# Check if the binary exists with an absolute path. Do this check
# before the CROSS_COMPILE empty check below to allow the mkspec
# to derive the compiler path from other device options.
- exists($$QMAKE_CXX):return()
+ exists($$QMAKE_CXX$$sfx):return()
# Check for possible reasons of failure
# check if CROSS_COMPILE device-option is set
isEmpty(CROSS_COMPILE):error("CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>")
# Check if QMAKE_CXX points to an executable.
- system("which $$QMAKE_CXX > /dev/null"):return()
+ ensurePathEnv()
+ for (dir, QMAKE_PATH_ENV) {
+ exists($$dir/$${QMAKE_CXX}$$sfx): \
+ return()
+ }
# QMAKE_CXX does not point to a compiler.
error("Compiler $$QMAKE_CXX not found. Check the value of CROSS_COMPILE -device-option")
diff --git a/mkspecs/features/qt_headersclean.prf b/mkspecs/features/qt_headersclean.prf
deleted file mode 100644
index 06a20ad2c0..0000000000
--- a/mkspecs/features/qt_headersclean.prf
+++ /dev/null
@@ -1,47 +0,0 @@
-# The headersclean test attempts to ensure all public Qt headers
-# abide by various rules.
-#
-# To use this test, create a project which contains nothing else than a
-# QT= line with the modules you want to test (no presence conditionals needed),
-# followed by load(qt_headersclean).
-
-*-g++*: QMAKE_CXXFLAGS += -W -Wall -Wextra -Werror
-
-# The flags here come from http://wiki.qt.io/Coding_Conventions#Conventions_for_public_header_files
-# -Wold-style-cast cannot be used, /usr/include/bits/byteswap.h defines the macro bswap_16 using C style casts :(
-# -Wfloat-equal cannot be used, qrect.h and qvector2d.h do exact comparisons in isNull and operator==. Would need #pragmas.
-*-g++*: QMAKE_CXXFLAGS += -Woverloaded-virtual -Wshadow -Wundef
-
-# Other nice flags
-*-g++*: QMAKE_CXXFLAGS += -Wnon-virtual-dtor -ansi -Wchar-subscripts -Wpointer-arith -Wformat-security
-
-# Enable pedantic mode, but accept variadic macros and 'long long' usage.
-*-g++*: QMAKE_CXXFLAGS += -Wno-long-long -Wno-variadic-macros -pedantic-errors
-
-QMAKE_CXXFLAGS += -DQT_NO_CAST_TO_ASCII \
- -DQT_NO_CAST_FROM_ASCII \
- -DQT_STRICT_ITERATORS \
- -DQT_NO_URL_CAST_FROM_STRING \
- -DQT_NO_CAST_FROM_BYTEARRAY \
- -DQT_NO_KEYWORDS \
- -DQT_USE_FAST_CONCATENATION \
- -DQT_USE_FAST_OPERATOR_PLUS
-
-TARGET = tst_headersclean
-
-includes =
-for(q, QT) {
- sq = $$replace(q, -private\$, )
- qn = $$eval(QT.$${sq}.name)
- isEmpty(qn): \
- QT -= $$q
- else: \
- includes += "$${LITERAL_HASH}include <$$qn/$$qn>"
-}
-includes = $$join(includes, $$escape_expand(\\n))
-
-testfile.input = $$PWD/data/headersclean/tst_headersclean.cpp.in
-testfile.output = $$OUT_PWD/tst_headersclean.cpp
-QMAKE_SUBSTITUTES += testfile
-
-SOURCES += $$testfile.output
diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
index b85dbfb9c3..7ed5ea0561 100644
--- a/mkspecs/features/qt_module.prf
+++ b/mkspecs/features/qt_module.prf
@@ -60,10 +60,6 @@ MODULE_DEFINES = $$MODULE_DEFINE $$MODULE_DEFINES
load(qt_module_pris)
-INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.includes)
-
-!no_module_headers: load(qt_module_headers)
-
#other
TEMPLATE = lib
DESTDIR = $$eval(QT.$${MODULE_ID}.libs)
@@ -73,6 +69,11 @@ CONFIG += qmake_cache target_qt
QMAKE_DOCS_TARGETDIR = qt$${MODULE}
+load(qt_common)
+
+!no_module_headers: load(qt_module_headers)
+INCLUDEPATH *= $$eval(QT.$${MODULE}.includes) $$eval(QT.$${MODULE}_private.includes)
+
# If Qt was configured with -debug-and-release then build the module the same way
# - unless this is a host library
!host_build:if(win32|mac):!macx-xcode {
@@ -175,7 +176,6 @@ android: CONFIG += qt_android_deps
load(qt_installs)
load(qt_targets)
-load(qt_common)
# this builds on top of qt_common
unix|mingw {
diff --git a/mkspecs/features/qt_module_headers.prf b/mkspecs/features/qt_module_headers.prf
index fc3ec75e82..aed04c3c1c 100644
--- a/mkspecs/features/qt_module_headers.prf
+++ b/mkspecs/features/qt_module_headers.prf
@@ -71,8 +71,94 @@ SYNCQT.HEADER_FILES += $$MODULE_MASTER_DEPS_HEADER
# Automatically enable precompiled headers for Qt modules,
# except for Gcc/Windows: Larger precompiled headers crash cc1plus.exe
# (e.g. with i686-4.8.2-release-posix-dwarf-rt_v3-rev3)
-!gcc|!equals(QMAKE_HOST.os, Windows) {
+!if(gcc:equals(QMAKE_HOST.os, Windows)):!equals(TEMPLATE, aux) {
isEmpty(PRECOMPILED_HEADER): PRECOMPILED_HEADER = $$MODULE_MASTER_DEPS_HEADER
}
CONFIG += qt_install_headers
+
+headersclean:!internal_module {
+ # Make sure that the header compiles with our strict options
+ hcleanDEFS = -DQT_NO_CAST_TO_ASCII=1 \
+ -DQT_NO_CAST_FROM_ASCII=1 \
+ -DQT_STRICT_ITERATORS \
+ -DQT_NO_URL_CAST_FROM_STRING=1 \
+ -DQT_NO_CAST_FROM_BYTEARRAY=1 \
+ -DQT_NO_KEYWORDS=1 \
+ -DQT_USE_FAST_CONCATENATION \
+ -DQT_USE_FAST_OPERATOR_PLUS \
+ -Dsignals=int \
+ -Dslots=int \
+ -Demit=public: \
+ -Dforeach=public: \
+ -Dforever=public:
+
+ gcc {
+ # Turn on some extra warnings not found in -Wall -Wextra.
+ # Common to GCC, Clang and ICC (and other compilers that masquerade as GCC):
+ hcleanFLAGS = -Wall -Wextra -Werror \
+ -Woverloaded-virtual -Wshadow -Wundef \
+ -Wnon-virtual-dtor -Wpointer-arith -Wformat-security \
+ -Wno-long-long -Wno-variadic-macros -pedantic-errors
+
+ intel_icc {
+ # these warnings are disabled because explicit constructors with zero or
+ # multiple arguments are permitted in C++11:
+ # 2304: non-explicit constructor with single argument may cause implicit type conversion
+ # 2305: declaration of 'explicit' constructor without a single argument is redundant
+ hcleanFLAGS += -wd2304,2305
+ greaterThan(QT_ICC_MAJOR_VERSION, 13) {
+ # ICC 14+ has a bug with -Wshadow, emitting it for cases where there's no shadowing
+ # (issue ID 0000698329, task DPD200245740)
+ hcleanFLAGS -= -Wshadow
+ }
+ } else {
+ hcleanFLAGS += -Wchar-subscripts
+
+ !contains(QT_ARCH, arm):!contains(QT_ARCH, mips): \
+ hcleanFLAGS += -Wcast-align
+ }
+
+ # Use strict mode C++11 or C++98, with no GNU extensions (see -pedantic-errors above).
+ # The module might set CONFIG += c++11, but it might also change QMAKE_CXXFLAGS_CXX11
+ # or the module (or the mkspec) can set the C++11 flag on QMAKE_CXXFLAGS
+ # (or QMAKE_CXXFLAGS_{RELEASE,DEBUG} but that's unlikely).
+ c++11:contains(QMAKE_CXXFLAGS_CXX11, -std=gnu++11) {
+ hcleanFLAGS += -std=c++11
+ } else: contains(QMAKE_CXXFLAGS, -std=gnu++11) {
+ hcleanFLAGS += -std=c++11
+ } else: c++11:contains(QMAKE_CXXFLAGS_CXX11, -std=gnu++0x) {
+ hcleanFLAGS += -std=c++0x
+ } else: contains(QMAKE_CXXFLAGS, -std=gnu++0x) {
+ hcleanFLAGS += -std=c++0x
+ } else: !c++11:!contains(QMAKE_CXXFLAGS, -std=c++0x):!contains(QMAKE_CXXFLAGS, -std=c++11) {
+ hcleanFLAGS += -std=c++98
+ }
+
+ hcleanCOMMAND = $$QMAKE_CXX -c $(CXXFLAGS) $$hcleanFLAGS $(INCPATH) $$hcleanDEFS -xc++ ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT}
+ } else: win32-msvc2013 {
+ # 4180: qualifier applied to function type has no meaning; ignored
+ # 4458: declaration of 'identifier' hides class member
+ # -Za enables strict standards behavior, but we can't add it because
+ # <windows.h> and <GL.h> violate the standards.
+ hcleanFLAGS = -WX -W3 -wd4180 -wd4458
+ hcleanCOMMAND = $$QMAKE_CXX -c $(CXXFLAGS) $$hcleanFLAGS $(INCPATH) $$hcleanDEFS -FI${QMAKE_FILE_IN} -Fo${QMAKE_FILE_OUT} \
+ $$[QT_INSTALL_DATA/src]/mkspecs/features/data/dummy.cpp
+ }
+
+ !isEmpty(hcleanCOMMAND):if(!contains(QT_CONFIG, debug_and_release)|CONFIG(release, debug|release)) {
+ header_check.dependency_type = TYPE_C
+ header_check.CONFIG += no_link
+ header_check.output = ${QMAKE_VAR_OBJECTS_DIR}header_${QMAKE_FILE_BASE}$${first(QMAKE_EXT_OBJ)}
+ header_check.input = SYNCQT.CLEAN_HEADER_FILES
+ header_check.variable_out = PRE_TARGETDEPS
+ header_check.name = headercheck ${QMAKE_FILE_IN}
+ header_check.commands = $$hcleanCOMMAND
+ silent:header_check.commands = @echo compiling[header] ${QMAKE_FILE_IN} && $$hcleanCOMMAND
+ QMAKE_EXTRA_COMPILERS += header_check
+ SYNCQT.CLEAN_HEADER_FILES -= $$HEADERSCLEAN_EXCLUDE
+ }
+ unset(hcleanCOMMAND)
+ unset(hcleanFLAGS)
+ unset(hcleanDEFS)
+}
diff --git a/mkspecs/features/qt_module_pris.prf b/mkspecs/features/qt_module_pris.prf
index b40e1391ac..46971ba604 100644
--- a/mkspecs/features/qt_module_pris.prf
+++ b/mkspecs/features/qt_module_pris.prf
@@ -26,8 +26,11 @@ else: \
mod_inst_pfx = $$mod_work_pfx
!internal_module {
MODULE_ID = $$MODULE
- MODULE_PRIVATE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE}_private.pri
- mods_to_load = $$MODULE $${MODULE}_private
+ mods_to_load = $$MODULE
+ !no_private_module {
+ MODULE_PRIVATE_PRI = $$mod_inst_pfx/qt_lib_$${MODULE}_private.pri
+ mods_to_load += $${MODULE}_private
+ }
} else {
MODULE_ID = $${MODULE}_private
mods_to_load = $${MODULE}_private
diff --git a/mkspecs/features/spec_pre.prf b/mkspecs/features/spec_pre.prf
index 844fa35579..cdc1d7ee1e 100644
--- a/mkspecs/features/spec_pre.prf
+++ b/mkspecs/features/spec_pre.prf
@@ -23,19 +23,25 @@ QMAKE_H_MOD_MOC = moc_
QMAKE_MOD_LEX = _lex
QMAKE_MOD_YACC = _yacc
+defineTest(ensurePathEnv) {
+ isEmpty(QMAKE_PATH_ENV) {
+ QMAKE_PATH_ENV = $$(PATH)
+ QMAKE_PATH_ENV = $$split(QMAKE_PATH_ENV, $$QMAKE_DIRLIST_SEP)
+ export(QMAKE_PATH_ENV)
+ }
+}
+
equals(QMAKE_HOST.os, Windows) {
QMAKE_EXT_OBJ = .obj
QMAKE_EXT_RES = .res
QMAKE_SH =
- PATH = $$(PATH)
- PATH = $$split(PATH, ;)
- for(dir, PATH) {
+ ensurePathEnv()
+ for(dir, QMAKE_PATH_ENV) {
exists($$dir/sh.exe) {
QMAKE_SH = $$dir/sh.exe
break()
}
}
- unset(PATH)
} else {
QMAKE_EXT_CPP += .C
QMAKE_EXT_H += .H
diff --git a/mkspecs/features/win32/dumpcpp.prf b/mkspecs/features/win32/dumpcpp.prf
index 3da54fb66d..61fd386832 100644
--- a/mkspecs/features/win32/dumpcpp.prf
+++ b/mkspecs/features/win32/dumpcpp.prf
@@ -19,3 +19,17 @@ dumpcpp_impl.name = CPP
dumpcpp_impl.depends = ${QMAKE_FILE_BASE}.h
QMAKE_EXTRA_COMPILERS += dumpcpp_impl
+
+
+# Create dependencies from every object file to our generated header files.
+if(isEmpty(BUILDS)|build_pass):have_target:!contains(TEMPLATE, vc.*) {
+ for(tlb, TYPELIBS) {
+ hdr = $$basename(tlb)
+ hdr = $$section(hdr, ., 0, -2).h
+ TYPELIB_HEADERS += $$hdr
+ }
+
+ objtgt.target = $(OBJECTS)
+ objtgt.depends = $$TYPELIB_HEADERS
+ QMAKE_EXTRA_TARGETS += objtgt
+}
diff --git a/mkspecs/features/win32/opengl.prf b/mkspecs/features/win32/opengl.prf
index 46101d6b76..8173348bc4 100644
--- a/mkspecs/features/win32/opengl.prf
+++ b/mkspecs/features/win32/opengl.prf
@@ -21,7 +21,7 @@ wince* {
QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2_RELEASE
}
DEFINES += QT_OPENGL_ES_2 QT_OPENGL_ES_2_ANGLE
- contains(QT_CONFIG, static): DEFINES += QT_OPENGL_ES_2_ANGLE_STATIC
+ contains(QT_CONFIG, static): DEFINES += QT_OPENGL_ES_2_ANGLE_STATIC GL_APICALL= EGLAPI=
QT_CONFIG -= opengl
} else {
!contains(QT_CONFIG, dynamicgl) {
diff --git a/qmake/doc/snippets/code/doc_src_qmake-manual.pro b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
index 857a311e91..335fa6f97e 100644
--- a/qmake/doc/snippets/code/doc_src_qmake-manual.pro
+++ b/qmake/doc/snippets/code/doc_src_qmake-manual.pro
@@ -333,7 +333,8 @@ win32:UI_DIR = c:/myproject/ui
#! [57]
-VERSION = 1.2.3
+win32:VERSION = 1.2.3.4 # major.minor.patch.build
+else:VERSION = 1.2.3 # major.minor.patch
#! [57]
@@ -982,3 +983,7 @@ QMAKE_SONAME_PREFIX = @executable_path/../Frameworks
QMAKE_SONAME_PREFIX = @loader_path/Frameworks
QMAKE_SONAME_PREFIX = /Library/Frameworks
#! [184]
+
+#! [185]
+VERSION_PE_HEADER = 1.2
+#! [185]
diff --git a/qmake/doc/src/qmake-manual.qdoc b/qmake/doc/src/qmake-manual.qdoc
index 2def71c723..56d9dd35ae 100644
--- a/qmake/doc/src/qmake-manual.qdoc
+++ b/qmake/doc/src/qmake-manual.qdoc
@@ -763,9 +763,55 @@
\section1 Windows
- Features specific to this platform include support for creating Visual
- Studio project files and handling manifest files when deploying Qt
- applications developed using Visual Studio 2005, or later.
+ Features specific to this platform include support for Windows resource
+ files (provided or auto-generated), creating Visual Studio project files,
+ and handling manifest files when deploying Qt applications developed
+ using Visual Studio 2005, or later.
+
+ \section2 Adding Windows Resource Files
+
+ This section describes how to handle a Windows resource file with
+ qmake to have it linked to an application executable (EXE) or dynamic
+ link library (DLL). qmake can optionally auto-generate a suitably
+ filled Windows resource file.
+
+ A linked Windows resource file may contain many elements that can
+ be accessed by its EXE or DLL. However, the
+ \l{The Qt Resource System}{Qt resource system} should be used for
+ accessing linked-in resources in a platform-independent way. But
+ some standard elements of the linked Windows resource file are
+ accessed by Windows itself. For example, in Windows explorer the
+ version tab of the file properties is filled by resource elements.
+ In addition, the program icon of the EXE is read from these elements.
+ So it is good practice for a Qt created Windows EXE or DLL to use
+ both techniques at the same time: link platform-independent resources
+ via the \l{The Qt Resource System}{Qt resource system} and add Windows
+ specific resources via a Windows resource file.
+
+ Typically, a resource-definition script (.rc file) is compiled to a
+ Windows resource file. Within the Microsoft toolchain, the RC tool
+ generates a .res file, which can be linked with the Microsoft linker
+ to an EXE or DLL. The MinGW toolchain uses the windres tool to generate
+ an .o file that can be linked with the MinGW linker to an EXE or DLL.
+
+ The optional auto-generation of a suitably filled .rc file by qmake is
+ triggered by setting at least one of the system variables \l{VERSION}
+ and \l{RC_ICONS}. The generated .rc file is automatically compiled and
+ linked. Elements that are added to the .rc file are defined by the system
+ variables \l{QMAKE_TARGET_COMPANY}, \l{QMAKE_TARGET_DESCRIPTION},
+ \l{QMAKE_TARGET_COPYRIGHT}, \l{QMAKE_TARGET_PRODUCT}, \l{RC_CODEPAGE},
+ \l{RC_ICONS}, \l{RC_LANG},and \l{VERSION}.
+
+ If these elements are not sufficient, qmake has the two system variables
+ \l{RC_FILE} and \l{RES_FILE} that point directly to an externally created
+ .rc or .res file. By setting one of these variables, the specified file
+ is linked to the EXE or DLL.
+
+ \note The generation of the .rc file by qmake is blocked, if \l{RC_FILE}
+ or \l{RES_FILE} is set. In this case, no further changes are made to the
+ given .rc file or the .res or .o file by qmake; the variables pertaining
+ to .rc file generation have no effect.
+
\section2 Creating Visual Studio Project Files
@@ -2132,34 +2178,35 @@
\target QMAKE_TARGET_COMPANY
\section1 QMAKE_TARGET_COMPANY
- Windows only. Specifies the company for the project target, this is used where
- applicable for putting the company name in the application's properties. This is
- only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE
- variables are not set.
+ Windows only. Specifies the company for the project target; this is
+ used where applicable for putting the company name in the application's
+ properties. This is only utilized if the \l{VERSION} or \l{RC_ICONS}
+ variable is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set.
\target QMAKE_TARGET_DESCRIPTION
\section1 QMAKE_TARGET_DESCRIPTION
- Windows only. Specifies the description for the project target, this is used where
- applicable for putting the description in the application's properties. This is only
- utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables
- are not set.
+ Windows only. Specifies the description for the project target; this is
+ used where applicable for putting the description in the application's
+ properties. This is only utilized if the \l{VERSION} or \l{RC_ICONS}
+ variable is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set.
\target QMAKE_TARGET_COPYRIGHT
\section1 QMAKE_TARGET_COPYRIGHT
- Windows only. Specifies the copyright information for the project target, this is used where
- applicable for putting the copyright information in the application's properties. This is only
- utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables
+ Windows only. Specifies the copyright information for the project target;
+ this is used where applicable for putting the copyright information in the
+ application's properties. This is only utilized if the \l{VERSION} or
+ \l{RC_ICONS} variable is set and the \l{RC_FILE} and \l{RES_FILE} variables
are not set.
\target QMAKE_TARGET_PRODUCT
\section1 QMAKE_TARGET_PRODUCT
- Windows only. Specifies the product for the project target, this is used where
- applicable for putting the product in the application's properties. This is only utilized if
- the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables
- are not set.
+ Windows only. Specifies the product for the project target; this is used
+ where applicable for putting the product in the application's properties.
+ This is only utilized if the \l{VERSION} or \l{RC_ICONS} variable is set
+ and the \l{RC_FILE} and \l{RES_FILE} variables are not set.
\section1 QT
@@ -2263,22 +2310,24 @@
\target RC_CODEPAGE
\section1 RC_CODEPAGE
- Windows only. Specifies the codepage that should be specified in a generated rc file. This is
- only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables
- are not set.
+ Windows only. Specifies the codepage that should be specified in a generated
+ .rc file. This is only utilized if the \l{VERSION} or \l{RC_ICONS} variable
+ is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set.
\target RC_ICONS
\section1 RC_ICONS
- Windows only. Specifies the icons that should be included into a generated rc file, this
- is only utilized if the RC_FILE and RES_FILE variable are not set.
+ Windows only. Specifies the icons that should be included into a generated
+ .rc file. This is only utilized if the \l{RC_FILE} and \l{RES_FILE} variable
+ are not set. More details about the generation of .rc files can be found in
+ the \l{Platform Notes}.
\target RC_LANG
\section1 RC_LANG
- Windows only. Specifies the language that should be specified in a generated rc file. This is
- only utilized if the VERSION or RC_ICONS variable is set and the RC_FILE and RES_FILE variables
- are not set.
+ Windows only. Specifies the language that should be specified in a generated
+ .rc file. This is only utilized if the \l{VERSION} or \l{RC_ICONS} variable
+ is set and the \l{RC_FILE} and \l{RES_FILE} variables are not set.
\section1 RC_INCLUDEPATH
@@ -2477,13 +2526,31 @@
\target VERSION
\section1 VERSION
- Specifies the version number of the application if the \c app \l{#TEMPLATE}{template} is
- specified or the version number of the library if the \c lib template is specified.
+ Specifies the version number of the application if the \c app
+ \l{#TEMPLATE}{template} is specified or the version number of
+ the library if the \c lib template is specified.
+
+ On Windows, triggers auto-generation of an .rc file if the \l{RC_FILE}
+ and \l{RES_FILE} variables are not set. The generated .rc file will have
+ the FILEVERSION and PRODUCTVERSION entries filled with major, minor, patch
+ level, and build number. Each number must be in the range from 0 to 65535.
+ More details about the generation of .rc files can be found in the
+ \l{Platform Notes}.
For example:
\snippet code/doc_src_qmake-manual.pro 57
+ \section1 VERSION_PE_HEADER
+
+ Windows only. Specifies the version number, that the Windows linker
+ puts into the header of the .exe or .dll file via the /VERSION option.
+ Only a major and minor version may be specified.
+ If VERSION_PE_HEADER is not set, it falls back to
+ the major and minor version from \l{VERSION} (if set).
+
+ \snippet code/doc_src_qmake-manual.pro 185
+
\section1 VER_MAJ
Specifies the major version number of the library if the
@@ -4638,7 +4705,9 @@
When using this template, the following qmake
system variables are recognized. You should use these in your .pro file to
- specify information about your application.
+ specify information about your application. For additional
+ platform-dependent system variables, you could have a look at the
+ \l{Platform Notes}.
\list
\li \l{HEADERS} - A list of header files for the application.
@@ -4660,9 +4729,6 @@
\li \l{VPATH} - The search path to find supplied files.
\li \l{DEF_FILE} - Windows only: A .def file to be linked against for the
application.
- \li \l{RC_FILE} - Windows only: A resource file for the application.
- \li \l{RES_FILE} - Windows only: A resource file to be linked against for
- the application.
\endlist
You only need to use the system variables that you have values for. For
diff --git a/qmake/generators/mac/pbuilder_pbx.cpp b/qmake/generators/mac/pbuilder_pbx.cpp
index 3383e66ea6..fcd6bf8308 100644
--- a/qmake/generators/mac/pbuilder_pbx.cpp
+++ b/qmake/generators/mac/pbuilder_pbx.cpp
@@ -105,7 +105,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
{
if(project->isActiveConfig("generate_pbxbuild_makefile")) {
QString mkwrap = fileFixify(pbx_dir + Option::dir_sep + ".." + Option::dir_sep + project->first("MAKEFILE"),
- qmake_getpwd());
+ FileFixifyToIndir);
QFile mkwrapf(mkwrap);
if(mkwrapf.open(QIODevice::WriteOnly | QIODevice::Text)) {
debug_msg(1, "pbuilder: Creating file: %s", mkwrap.toLatin1().constData());
@@ -184,13 +184,13 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
bool in_root = true;
QString name = qmake_getpwd();
if(project->isActiveConfig("flat")) {
- QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
+ QString flat_file = fileFixify(name, FileFixifyBackwards | FileFixifyRelative);
if(flat_file.indexOf(Option::dir_sep) != -1) {
QStringList dirs = flat_file.split(Option::dir_sep);
name = dirs.back();
}
} else {
- QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
+ QString flat_file = fileFixify(name, FileFixifyBackwards | FileFixifyRelative);
if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) {
QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP");
QStringList dirs = flat_file.split(Option::dir_sep);
@@ -507,14 +507,6 @@ static QString xcodeFiletypeForFilename(const QString &filename)
bool
ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
{
- // The code in this function assumes that the current directory matches
- // the output directory, which is not actually the case when we are called
- // from the generic generator code. Instead of changing every single
- // assumption and fileFixify we cheat by moving into the output directory
- // for the duration of this function.
- QString input_dir = qmake_getpwd();
- qmake_setpwd(Option::output_dir);
-
ProStringList tmp;
bool did_preprocess = false;
@@ -536,7 +528,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
QFile mkf(mkfile);
if(mkf.open(QIODevice::WriteOnly | QIODevice::Text)) {
writingUnixMakefileGenerator = true;
- qmake_setpwd(input_dir); // Makefile generation assumes input_dir as pwd
debug_msg(1, "pbuilder: Creating file: %s", mkfile.toLatin1().constData());
QTextStream mkt(&mkf);
writeHeader(mkt);
@@ -545,10 +536,9 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
mkt.flush();
mkf.close();
writingUnixMakefileGenerator = false;
- qmake_setpwd(Option::output_dir);
}
QString phase_key = keyFor("QMAKE_PBX_MAKEQMAKE_BUILDPHASE");
- mkfile = fileFixify(mkfile, qmake_getpwd());
+ mkfile = fileFixify(mkfile);
project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
@@ -557,17 +547,20 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("name", "Qt Qmake") << ";\n"
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n"
- << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(qmake_getpwd()) + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
+ << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(Option::output_dir)
+ + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
<< "\t\t\t" << writeSettings("showEnvVarsInLog", "0") << ";\n"
<< "\t\t};\n";
}
// FIXME: Move all file resolving logic out of ProjectBuilderSources::files(), as it
// doesn't have access to any of the information it needs to resolve relative paths.
- project->values("QMAKE_INTERNAL_INCLUDED_FILES").prepend(fileFixify(project->projectFile(), qmake_getpwd(), input_dir));
+ project->values("QMAKE_INTERNAL_INCLUDED_FILES").prepend(project->projectFile());
// Since we can't fileFixify inside ProjectBuilderSources::files(), we resolve the absolute paths here
- project->values("QMAKE_INTERNAL_INCLUDED_FILES") = ProStringList(fileFixify(project->values("QMAKE_INTERNAL_INCLUDED_FILES").toQStringList(), FileFixifyAbsolute));
+ project->values("QMAKE_INTERNAL_INCLUDED_FILES") = ProStringList(
+ fileFixify(project->values("QMAKE_INTERNAL_INCLUDED_FILES").toQStringList(),
+ FileFixifyFromOutdir | FileFixifyAbsolute));
//DUMP SOURCES
QMap<QString, ProStringList> groups;
@@ -624,7 +617,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
ProStringList &src_list = project->values(ProKey("QMAKE_PBX_" + sources.at(source).keyName()));
ProStringList &root_group_list = project->values("QMAKE_PBX_GROUPS");
- const QStringList &files = fileFixify(sources.at(source).files(project));
+ const QStringList &files = fileFixify(sources.at(source).files(project),
+ FileFixifyFromOutdir | FileFixifyAbsolute);
for(int f = 0; f < files.count(); ++f) {
QString file = files[f];
if(!sources.at(source).compilerName().isNull() &&
@@ -636,12 +630,11 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
bool in_root = true;
QString src_key = keyFor(file);
- file = fileFixify(file, qmake_getpwd(), Option::output_dir, FileFixifyAbsolute);
QString name = file.split(Option::dir_sep).back();
if (!project->isActiveConfig("flat")) {
// Build group hierarchy for file references that match the source our build dir
- QString relativePath = fileFixify(file, input_dir, qmake_getpwd(), FileFixifyRelative);
+ QString relativePath = fileFixify(file, FileFixifyToIndir | FileFixifyRelative);
if (QDir::isRelativePath(relativePath) && relativePath.startsWith(QLatin1String("../")))
relativePath = fileFixify(file, FileFixifyRelative); // Try build dir
@@ -771,7 +764,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(added && !(added % 3))
mkt << "\\\n\t";
++added;
- const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir);
+ const QString file_name = fileFixify(fn, FileFixifyFromOutdir);
mkt << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
replaceExtraCompilerVariables(tmp_out.first().toQString(), file_name, QString(), NoShell)));
}
@@ -784,7 +777,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
mkt.flush();
mkf.close();
}
- mkfile = fileFixify(mkfile, qmake_getpwd());
+ mkfile = fileFixify(mkfile);
QString phase_key = keyFor("QMAKE_PBX_PREPROCESS_TARGET");
// project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
@@ -795,7 +788,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("name", "Qt Preprocessors") << ";\n"
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << ";\n"
- << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(qmake_getpwd()) + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
+ << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(Option::output_dir)
+ + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
<< "\t\t\t" << writeSettings("showEnvVarsInLog", "0") << ";\n"
<< "\t\t};\n";
}
@@ -927,7 +921,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if(!path.isEmpty() && !libdirs.contains(path))
libdirs += path;
}
- library = fileFixify(library);
+ library = fileFixify(library, FileFixifyFromOutdir);
QString key = keyFor(library);
if (!project->values("QMAKE_PBX_LIBRARIES").contains(key)) {
bool is_frmwrk = (library.endsWith(".framework"));
@@ -984,7 +978,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
writingUnixMakefileGenerator = false;
}
QString phase_key = keyFor("QMAKE_PBX_SUBLIBS_BUILDPHASE");
- mkfile = fileFixify(mkfile, qmake_getpwd());
+ mkfile = fileFixify(mkfile);
project->values("QMAKE_PBX_PRESCRIPT_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("buildActionMask", "2147483647", SettingsNoQuote) << ";\n"
@@ -993,7 +987,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "\t\t\t" << writeSettings("runOnlyForDeploymentPostprocessing", "0", SettingsNoQuote) << ";\n"
<< "\t\t\t" << writeSettings("name", "Qt Sublibs") << ";\n"
<< "\t\t\t" << writeSettings("shellPath", "/bin/sh") << "\n"
- << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(qmake_getpwd()) + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
+ << "\t\t\t" << writeSettings("shellScript", "make -C " + IoUtils::shellQuoteUnix(Option::output_dir)
+ + " -f " + IoUtils::shellQuoteUnix(mkfile)) << ";\n"
<< "\t\t\t" << writeSettings("showEnvVarsInLog", "0") << ";\n"
<< "\t\t};\n";
}
@@ -1080,8 +1075,8 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if (!project->isEmpty("DESTDIR")) {
QString phase_key = keyFor("QMAKE_PBX_TARGET_COPY_PHASE");
- QString destDir = project->first("DESTDIR").toQString();
- destDir = fileInfo(Option::normalizePath(destDir)).absoluteFilePath();
+ QString destDir = fileFixify(project->first("DESTDIR").toQString(),
+ FileFixifyFromOutdir | FileFixifyAbsolute);
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
t << "\t\t" << phase_key << " = {\n"
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n"
@@ -1111,7 +1106,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
//all files
const ProStringList &files = project->values(ProKey(bundle_data[i] + ".files"));
for(int file = 0; file < files.count(); file++) {
- QString fn = fileFixify(files[file].toQString(), Option::output_dir, input_dir, FileFixifyRelative);
+ QString fn = fileFixify(files[file].toQString(), FileFixifyAbsolute);
QString name = fn.split(Option::dir_sep).back();
QString file_ref_key = keyFor("QMAKE_PBX_BUNDLE_DATA_FILE_REF." + bundle_data[i] + "-" + fn);
bundle_file_refs += file_ref_key;
@@ -1475,10 +1470,10 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
if ((project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) ||
(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
project->isActiveConfig("lib_bundle"))) {
- QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), Option::output_dir, input_dir);
+ QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), FileFixifyToIndir);
if (!plist.isEmpty()) {
if (exists(plist))
- t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", plist) << ";\n";
+ t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", fileFixify(plist)) << ";\n";
else
warn_msg(WarnLogic, "Could not resolve Info.plist: '%s'. Check if QMAKE_INFO_PLIST points to a valid file.", plist.toLatin1().constData());
} else {
@@ -1504,7 +1499,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
plist_in_text.replace("@TYPEINFO@",
(project->isEmpty("QMAKE_PKGINFO_TYPEINFO")
? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4).toQString()));
- QFile plist_out_file("Info.plist");
+ QFile plist_out_file(Option::output_dir + "/Info.plist");
if (plist_out_file.open(QIODevice::WriteOnly | QIODevice::Text)) {
QTextStream plist_out(&plist_out_file);
plist_out << plist_in_text;
@@ -1514,12 +1509,12 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
}
}
- t << "\t\t\t\t" << writeSettings("SYMROOT", qmake_getpwd()) << ";\n";
+ t << "\t\t\t\t" << writeSettings("SYMROOT", Option::output_dir) << ";\n";
if (!project->isEmpty("DESTDIR")) {
ProString dir = project->first("DESTDIR");
if (QDir::isRelativePath(dir.toQString()))
- dir.prepend(qmake_getpwd() + Option::dir_sep);
+ dir.prepend(Option::output_dir + Option::dir_sep);
t << "\t\t\t\t" << writeSettings("INSTALL_DIR", dir) << ";\n";
}
@@ -1656,8 +1651,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
<< "}\n";
if(project->isActiveConfig("generate_pbxbuild_makefile")) {
- QString mkwrap = fileFixify(pbx_dir + Option::dir_sep + ".." + Option::dir_sep + project->first("MAKEFILE"),
- qmake_getpwd());
+ QString mkwrap = Option::output_dir + project->first("/MAKEFILE");
QFile mkwrapf(mkwrap);
if(mkwrapf.open(QIODevice::WriteOnly | QIODevice::Text)) {
writingUnixMakefileGenerator = true;
@@ -1729,8 +1723,6 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
"falling back to Xcode auto-generated schemes", qPrintable(projectSharedSchemesPath));
}
- qmake_setpwd(input_dir);
-
return true;
}
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
index f2decd71a5..5aaaf49334 100644
--- a/qmake/generators/makefile.cpp
+++ b/qmake/generators/makefile.cpp
@@ -162,8 +162,6 @@ MakefileGenerator::initOutPaths()
v["QMAKE_ABSOLUTE_SOURCE_PATH"].clear();
}
- QString currentDir = qmake_getpwd(); //just to go back to
-
//some builtin directories
if(project->isEmpty("PRECOMPILED_DIR") && !project->isEmpty("OBJECTS_DIR"))
v["PRECOMPILED_DIR"] = v["OBJECTS_DIR"];
@@ -177,7 +175,7 @@ MakefileGenerator::initOutPaths()
const ProString orig_path = v[dkey].first();
ProString &pathRef = v[dkey].first();
- pathRef = fileFixify(pathRef.toQString(), Option::output_dir, Option::output_dir);
+ pathRef = fileFixify(pathRef.toQString(), FileFixifyFromOutdir);
#ifdef Q_OS_WIN
// We don't want to add a separator for DLLDESTDIR on Windows (###why?)
@@ -192,7 +190,7 @@ MakefileGenerator::initOutPaths()
continue;
QString path = project->first(dkey).toQString(); //not to be changed any further
- path = fileFixify(path, currentDir, Option::output_dir);
+ path = fileFixify(path, FileFixifyBackwards);
debug_msg(3, "Fixed output_dir %s (%s) into %s", dirs[x],
orig_path.toLatin1().constData(), path.toLatin1().constData());
if(!mkdir(path))
@@ -210,7 +208,7 @@ MakefileGenerator::initOutPaths()
for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
ProStringList &inputs = project->values((*it2).toKey());
for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
- QString finp = fileFixify((*input).toQString(), Option::output_dir, Option::output_dir);
+ QString finp = fileFixify((*input).toQString(), FileFixifyFromOutdir);
*input = ProString(finp);
QString path = replaceExtraCompilerVariables(tmp_out, finp, QString(), NoShell);
path = Option::normalizePath(path);
@@ -220,7 +218,7 @@ MakefileGenerator::initOutPaths()
// Make out path only if it does not contain makefile variables
if(!path.contains("${"))
if(path != "." &&
- !mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
+ !mkdir(fileFixify(path, FileFixifyBackwards)))
warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
(*it).toLatin1().constData(), path.toLatin1().constData());
}
@@ -276,7 +274,7 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
continue;
}
if(!(flags & VPATH_NoFixify))
- file = fileFixify(file, qmake_getpwd(), Option::output_dir);
+ file = fileFixify(file, FileFixifyBackwards);
if(exists(file)) {
++val_it;
@@ -314,7 +312,7 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
real_dir = dir;
if(!(flags & VPATH_NoFixify))
- real_dir = fileFixify(real_dir, qmake_getpwd(), Option::output_dir) + '/';
+ real_dir = fileFixify(real_dir, FileFixifyBackwards) + '/';
regex.remove(0, dir.length());
}
if(real_dir.isEmpty() || exists(real_dir)) {
@@ -495,10 +493,10 @@ MakefileGenerator::init()
sub.toLatin1().constData());
continue;
}
- inn = fileFixify(tinn.first().toQString(), qmake_getpwd());
- outn = fileFixify(toutn.first().toQString(), qmake_getpwd(), Option::output_dir);
+ inn = fileFixify(tinn.first().toQString(), FileFixifyToIndir);
+ outn = fileFixify(toutn.first().toQString(), FileFixifyBackwards);
} else {
- inn = fileFixify(sub, qmake_getpwd());
+ inn = fileFixify(sub, FileFixifyToIndir);
if (!QFile::exists(inn)) {
// random insanity for backwards compat: .in file specified with absolute out dir
inn = fileFixify(sub);
@@ -508,7 +506,7 @@ MakefileGenerator::init()
inn.toLatin1().constData());
continue;
}
- outn = fileFixify(inn.left(inn.length()-3), qmake_getpwd(), Option::output_dir);
+ outn = fileFixify(inn.left(inn.length() - 3), FileFixifyBackwards);
}
const ProKey confign(sub + ".CONFIG");
@@ -687,7 +685,7 @@ MakefileGenerator::init()
if(tmp_out.indexOf("$") == -1) {
if(!verifyExtraCompiler((*it), QString())) //verify
continue;
- QString out = fileFixify(tmp_out.toQString(), Option::output_dir, Option::output_dir);
+ QString out = fileFixify(tmp_out.toQString(), FileFixifyFromOutdir);
bool pre_dep = (config.indexOf("target_predeps") != -1);
if (v.contains(vokey)) {
const ProStringList &var_out = v.value(vokey);
@@ -728,7 +726,7 @@ MakefileGenerator::init()
if (!verifyExtraCompiler((*it).toQString(), inpf)) //verify
continue;
QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell);
- out = fileFixify(out, Option::output_dir, Option::output_dir);
+ out = fileFixify(out, FileFixifyFromOutdir);
bool pre_dep = (config.indexOf("target_predeps") != -1);
if (v.contains(vokey)) {
const ProStringList &var_out = project->values(vokey);
@@ -886,7 +884,7 @@ MakefileGenerator::processPrlFile(QString &file)
// meta_file = fileFixify(meta_file);
QString real_meta_file = Option::normalizePath(meta_file);
if(!meta_file.isEmpty()) {
- QString f = fileFixify(real_meta_file, qmake_getpwd(), Option::output_dir);
+ QString f = fileFixify(real_meta_file, FileFixifyBackwards);
if(QMakeMetaInfo::libExists(f)) {
QMakeMetaInfo libinfo(project);
debug_msg(1, "Processing PRL file: %s", real_meta_file.toLatin1().constData());
@@ -1101,7 +1099,7 @@ MakefileGenerator::prlFileName(bool fixify)
if(fixify) {
if(!project->isEmpty("DESTDIR"))
ret.prepend(project->first("DESTDIR").toQString());
- ret = fileFixify(ret, qmake_getpwd(), Option::output_dir);
+ ret = fileFixify(ret, FileFixifyBackwards);
}
return ret;
}
@@ -1507,7 +1505,7 @@ MakefileGenerator::createObjectList(const ProStringList &sources)
QString dir;
if (project->isActiveConfig("object_parallel_to_source")) {
// The source paths are relative to the output dir, but we need source-relative paths
- QString sourceRelativePath = fileFixify(sfn, qmake_getpwd(), Option::output_dir);
+ QString sourceRelativePath = fileFixify(sfn, FileFixifyBackwards);
if (sourceRelativePath.startsWith(".." + Option::dir_sep))
sourceRelativePath = fileFixify(sourceRelativePath, FileFixifyAbsolute);
@@ -1523,7 +1521,7 @@ MakefileGenerator::createObjectList(const ProStringList &sources)
if (!noIO()) {
// Ensure that the final output directory of each object exists
- QString outRelativePath = fileFixify(dir, qmake_getpwd(), Option::output_dir);
+ QString outRelativePath = fileFixify(dir, FileFixifyBackwards);
if (!mkdir(outRelativePath))
warn_msg(WarnLogic, "Cannot create directory '%s'", outRelativePath.toLatin1().constData());
}
@@ -1795,7 +1793,7 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
}
const ProStringList &config = project->values(ProKey(*it + ".CONFIG"));
if (config.indexOf("fix_target") != -1)
- targ = fileFixify(targ, Option::output_dir, Option::output_dir);
+ targ = fileFixify(targ, FileFixifyFromOutdir);
if (config.indexOf("phony") != -1)
deps += QLatin1String(" FORCE");
t << escapeDependencyPath(targ) << ":" << deps;
@@ -1812,7 +1810,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
QString tmp_out = fileFixify(project->first(ProKey(*it + ".output")).toQString(),
- Option::output_dir, Option::output_dir);
+ FileFixifyFromOutdir);
const QString tmp_cmd = project->values(ProKey(*it + ".commands")).join(' ');
const QString tmp_dep_cmd = project->values(ProKey(*it + ".depend_command")).join(' ');
QString dep_cd_cmd;
@@ -1923,7 +1921,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
}
QStringList deps, inputs;
if(!tmp_dep.isEmpty())
- deps += fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
+ deps += fileFixify(tmp_dep, FileFixifyFromOutdir);
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
QString inpf = (*input).toQString();
deps += findDependencies(inpf);
@@ -1998,7 +1996,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":";
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
if (config.indexOf("explicit_dependencies") != -1) {
- t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
+ t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, FileFixifyFromOutdir)));
} else {
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
}
@@ -2012,7 +2010,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
deps << in;
QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell));
if(!tmp_dep.isEmpty()) {
- QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
+ QStringList pre_deps = fileFixify(tmp_dep, FileFixifyFromOutdir);
for(int i = 0; i < pre_deps.size(); ++i)
deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell);
}
@@ -2243,7 +2241,7 @@ QString MakefileGenerator::buildArgs()
//could get stored argv, but then it would have more options than are
//probably necesary this will try to guess the bare minimum..
-QString MakefileGenerator::build_args(const QString &outdir)
+QString MakefileGenerator::build_args()
{
QString ret = "$(QMAKE)";
@@ -2256,7 +2254,7 @@ QString MakefileGenerator::build_args(const QString &outdir)
ret += " -o " + escapeFilePath(ofile);
//inputs
- ret += " " + escapeFilePath(fileFixify(project->projectFile(), outdir));
+ ret += " " + escapeFilePath(fileFixify(project->projectFile()));
return ret;
}
@@ -2330,7 +2328,7 @@ MakefileGenerator::findSubDirsSubTargets() const
if(fileInfo(st->in_directory).isRelative())
st->out_directory = st->in_directory;
else
- st->out_directory = fileFixify(st->in_directory, qmake_getpwd(), Option::output_dir);
+ st->out_directory = fileFixify(st->in_directory, FileFixifyBackwards);
const ProKey mkey(fixedSubdir + ".makefile");
if (!project->isEmpty(mkey)) {
st->makefile = project->first(mkey).toQString();
@@ -2808,22 +2806,20 @@ MakefileGenerator::escapeDependencyPaths(const ProStringList &paths) const
}
QStringList
-MakefileGenerator::fileFixify(const QStringList& files, const QString &out_dir, const QString &in_dir,
- FileFixifyType fix, bool canon) const
+MakefileGenerator::fileFixify(const QStringList &files, FileFixifyTypes fix, bool canon) const
{
if(files.isEmpty())
return files;
QStringList ret;
for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
if(!(*it).isEmpty())
- ret << fileFixify((*it), out_dir, in_dir, fix, canon);
+ ret << fileFixify((*it), fix, canon);
}
return ret;
}
QString
-MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const QString &in_d,
- FileFixifyType fix, bool canon) const
+MakefileGenerator::fileFixify(const QString &file, FileFixifyTypes fix, bool canon) const
{
if(file.isEmpty())
return file;
@@ -2837,17 +2833,23 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
else
warn_msg(WarnLogic, "Unable to expand ~ in %s", ret.toLatin1().constData());
}
- if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) {
- if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) { //already absolute
- QString pwd = qmake_getpwd();
+ if ((fix & FileFixifyAbsolute)
+ || (!(fix & FileFixifyRelative) && project->isActiveConfig("no_fixpath"))) {
+ if ((fix & FileFixifyAbsolute) && QDir::isRelativePath(ret)) {
+ QString pwd = !(fix & FileFixifyFromOutdir) ? project->projectDir() : Option::output_dir;
+ {
+ QFileInfo in_fi(fileInfo(pwd));
+ if (in_fi.exists())
+ pwd = in_fi.canonicalFilePath();
+ }
if (!pwd.endsWith(QLatin1Char('/')))
pwd += QLatin1Char('/');
ret.prepend(pwd);
}
ret = Option::fixPathToTargetOS(ret, false, canon);
} else { //fix it..
- QString out_dir = QDir(Option::output_dir).absoluteFilePath(out_d);
- QString in_dir = QDir(qmake_getpwd()).absoluteFilePath(in_d);
+ QString out_dir = (fix & FileFixifyToIndir) ? project->projectDir() : Option::output_dir;
+ QString in_dir = !(fix & FileFixifyFromOutdir) ? project->projectDir() : Option::output_dir;
{
QFileInfo in_fi(fileInfo(in_dir));
if(in_fi.exists())
@@ -2865,9 +2867,6 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
qfileinfo.setFile(ret);
}
ret = Option::fixPathToTargetOS(ret, false, canon);
- if(canon && qfileinfo.exists() &&
- file == Option::fixPathToTargetOS(ret, true, canon))
- ret = Option::fixPathToTargetOS(qfileinfo.canonicalFilePath());
QString match_dir = Option::fixPathToTargetOS(out_dir, false, canon);
if(ret == match_dir) {
ret = "";
@@ -2912,8 +2911,8 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
}
if(ret.isEmpty())
ret = ".";
- debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(),
- ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(),
+ debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s]",
+ int(fix), canon, orig_file.toLatin1().constData(), ret.toLatin1().constData(),
qmake_getpwd().toLatin1().constData(), Option::output_dir.toLatin1().constData());
return ret;
}
@@ -2922,7 +2921,7 @@ QMakeLocalFileName
MakefileGenerator::fixPathForFile(const QMakeLocalFileName &file, bool forOpen)
{
if(forOpen)
- return QMakeLocalFileName(fileFixify(file.real(), qmake_getpwd(), Option::output_dir));
+ return QMakeLocalFileName(fileFixify(file.real(), FileFixifyBackwards));
return QMakeLocalFileName(fileFixify(file.real()));
}
@@ -2977,7 +2976,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
if(QDir::isRelativePath(dir)) {
if(!dir.endsWith(Option::dir_sep))
dir += Option::dir_sep;
- QString shadow = fileFixify(dir + dep.local(), pwd, Option::output_dir);
+ QString shadow = fileFixify(dir + dep.local(), FileFixifyBackwards);
if(exists(shadow)) {
ret = QMakeLocalFileName(shadow);
goto found_dep_from_heuristic;
@@ -3013,7 +3012,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
QString out = Option::fixPathToTargetOS(
replaceExtraCompilerVariables(tmp_out.toQString(), (*input).toQString(), QString(), NoShell));
if (out == dep.real() || out.section(Option::dir_sep, -1) == dep_basename) {
- ret = QMakeLocalFileName(fileFixify(out, qmake_getpwd(), Option::output_dir));
+ ret = QMakeLocalFileName(fileFixify(out, FileFixifyBackwards));
goto found_dep_from_heuristic;
}
}
@@ -3130,7 +3129,7 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
if(fixify) {
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
ret.prepend(project->first("DESTDIR").toQString());
- ret = fileFixify(ret, qmake_getpwd(), Option::output_dir);
+ ret = fileFixify(ret, FileFixifyBackwards);
}
return ret;
}
diff --git a/qmake/generators/makefile.h b/qmake/generators/makefile.h
index 7282d3ad1f..07483dbcb0 100644
--- a/qmake/generators/makefile.h
+++ b/qmake/generators/makefile.h
@@ -60,7 +60,7 @@ class MakefileGenerator : protected QMakeSourceFileInfo
bool no_io;
QHash<QString, bool> init_compiler_already;
QString makedir, chkexists;
- QString build_args(const QString &outdir=QString());
+ QString build_args();
//internal caches
mutable QHash<QString, QMakeLocalFileName> depHeuristicsCache;
@@ -224,16 +224,22 @@ protected:
ProStringList fixLibFlags(const ProKey &var);
virtual ProString fixLibFlag(const ProString &lib);
+public:
//file fixification to unify all file names into a single pattern
- enum FileFixifyType { FileFixifyAbsolute, FileFixifyRelative, FileFixifyDefault };
- QString fileFixify(const QString& file, const QString &out_dir=QString(),
- const QString &in_dir=QString(), FileFixifyType fix=FileFixifyDefault, bool canon=true) const;
- inline QString fileFixify(const QString& file, FileFixifyType fix, bool canon=true) const
- { return fileFixify(file, QString(), QString(), fix, canon); }
- QStringList fileFixify(const QStringList& files, const QString &out_dir=QString(),
- const QString &in_dir=QString(), FileFixifyType fix=FileFixifyDefault, bool canon=true) const;
- inline QStringList fileFixify(const QStringList& files, FileFixifyType fix, bool canon=true) const
- { return fileFixify(files, QString(), QString(), fix, canon); }
+ enum FileFixifyType {
+ FileFixifyFromIndir = 0,
+ FileFixifyFromOutdir = 1,
+ FileFixifyToOutDir = 0,
+ FileFixifyToIndir = 2,
+ FileFixifyBackwards = FileFixifyFromOutdir | FileFixifyToIndir,
+ FileFixifyDefault = 0,
+ FileFixifyAbsolute = 4,
+ FileFixifyRelative = 8
+ };
+ Q_DECLARE_FLAGS(FileFixifyTypes, FileFixifyType)
+protected:
+ QString fileFixify(const QString &file, FileFixifyTypes fix = FileFixifyDefault, bool canon = true) const;
+ QStringList fileFixify(const QStringList &files, FileFixifyTypes fix = FileFixifyDefault, bool canon = true) const;
QString installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst);
@@ -259,6 +265,7 @@ public:
bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); }
QString shellQuote(const QString &str);
};
+Q_DECLARE_OPERATORS_FOR_FLAGS(MakefileGenerator::FileFixifyTypes)
inline void MakefileGenerator::setNoIO(bool o)
{ no_io = o; }
diff --git a/qmake/generators/projectgenerator.cpp b/qmake/generators/projectgenerator.cpp
index bcda1dbf0c..9b1796c45d 100644
--- a/qmake/generators/projectgenerator.cpp
+++ b/qmake/generators/projectgenerator.cpp
@@ -379,7 +379,7 @@ ProjectGenerator::addConfig(const QString &cfg, bool add)
bool
ProjectGenerator::addFile(QString file)
{
- file = fileFixify(file, qmake_getpwd());
+ file = fileFixify(file, FileFixifyToIndir);
QString dir;
int s = file.lastIndexOf(Option::dir_sep);
if(s != -1)
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp
index 7822107a37..d873e91170 100644
--- a/qmake/generators/unix/unixmake2.cpp
+++ b/qmake/generators/unix/unixmake2.cpp
@@ -107,7 +107,7 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
t << "DISTDIR = " << escapeFilePath(fileFixify(
(project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"),
- Option::output_dir, Option::output_dir, FileFixifyAbsolute)) << endl;
+ FileFixifyFromOutdir | FileFixifyAbsolute)) << endl;
}
void
@@ -377,7 +377,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
}
if(!d_file.isEmpty()) {
- d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d";
+ d_file = odir + ".deps/" + fileFixify(d_file, FileFixifyBackwards) + ".d";
QString d_file_d = escapeDependencyPath(d_file);
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
@@ -1396,7 +1396,7 @@ UnixMakefileGenerator::libtoolFileName(bool fixify)
if(fixify) {
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
ret.prepend(project->first("DESTDIR").toQString());
- ret = fileFixify(ret, qmake_getpwd(), Option::output_dir);
+ ret = fileFixify(ret, FileFixifyBackwards);
}
return ret;
}
diff --git a/qmake/generators/win32/cesdkhandler.cpp b/qmake/generators/win32/cesdkhandler.cpp
index 3afed2b8c1..cbee1d0dbd 100644
--- a/qmake/generators/win32/cesdkhandler.cpp
+++ b/qmake/generators/win32/cesdkhandler.cpp
@@ -34,11 +34,22 @@
#include "cesdkhandler.h"
#include <qfile.h>
+#include <qfileinfo.h>
#include <qdebug.h>
#include <qxmlstream.h>
+#include <qsettings.h>
+#include <qtextstream.h>
QT_BEGIN_NAMESPACE
+struct PropertyContainer
+{
+ void clear() { name.clear(); value.clear(); properties.clear(); }
+ QString name;
+ QString value;
+ QMap<QString, PropertyContainer> properties;
+};
+
CeSdkInfo::CeSdkInfo() : m_major(0) , m_minor(0)
{
}
@@ -47,22 +58,255 @@ CeSdkHandler::CeSdkHandler()
{
}
-bool CeSdkHandler::parse()
+struct ContainsPathKey
+{
+ bool operator()(const QString &val)
+ {
+ return !(val.endsWith(QStringLiteral("MSBuildToolsPath"))
+ || val.endsWith(QStringLiteral("MSBuildToolsRoot")));
+ }
+};
+
+struct ValueFromKey
+{
+ ValueFromKey(const QSettings *settings) : settings(settings){}
+ QString operator()(const QString &key)
+ {
+ return settings->value(key).toString();
+ }
+
+ const QSettings *settings;
+};
+
+bool CeSdkHandler::parseMsBuildFile(QFile *file, CeSdkInfo *info)
+{
+ bool result = file->open(QFile::ReadOnly | QFile::Text);
+ const QString IncludePath = QStringLiteral("IncludePath");
+ const QString LibraryPath = QStringLiteral("LibraryPath");
+ const QString PreprocessorDefinitions = QStringLiteral("PreprocessorDefinitions");
+ const QString SdkRootPathString = QStringLiteral("SdkRootPath");
+ const QString ExecutablePath = QStringLiteral("ExecutablePath");
+ enum ParserState{Not, Include, Lib, Define, BinDir, SdkRootPath};
+ QString includePath;
+ QString libraryPath;
+ QString defines;
+ QString binDirs;
+ QString sdkRootPath;
+ ParserState state = Not;
+ if (result) {
+ QXmlStreamReader xml(file);
+ while (!xml.atEnd()) {
+ if (xml.isStartElement()) {
+ if (xml.name() == IncludePath)
+ state = Include;
+ else if (xml.name() == LibraryPath)
+ state = Lib;
+ else if (xml.name() == PreprocessorDefinitions)
+ state = Define;
+ else if (xml.name() == SdkRootPathString)
+ state = SdkRootPath;
+ else if (xml.name() == ExecutablePath)
+ state = BinDir;
+ else
+ state = Not;
+ } else if (xml.isEndElement()) {
+ state = Not;
+ } else if (xml.isCharacters()) {
+ switch (state) {
+ case Include:
+ includePath += xml.text();
+ break;
+ case Lib:
+ libraryPath += xml.text();
+ break;
+ case Define:
+ defines += xml.text();
+ break;
+ case SdkRootPath:
+ sdkRootPath = xml.text().toString();
+ break;
+ case BinDir:
+ binDirs += xml.text();
+ case(Not):
+ break;
+ }
+ }
+ xml.readNext();
+ }
+ }
+ file->close();
+ const bool success = result && !includePath.isEmpty() && !libraryPath.isEmpty() &&
+ !defines.isEmpty() && !sdkRootPath.isEmpty();
+ if (success) {
+ const QString startPattern = QStringLiteral("$(Registry:");
+ const int startIndex = sdkRootPath.indexOf(startPattern);
+ const int endIndex = sdkRootPath.lastIndexOf(QStringLiteral(")"));
+ const QString regString = sdkRootPath.mid(startIndex + startPattern.size(),
+ endIndex - startIndex - startPattern.size());
+ QSettings sdkRootPathRegistry(regString, QSettings::NativeFormat);
+ const QString erg = sdkRootPathRegistry.value(QStringLiteral(".")).toString();
+ const QString fullSdkRootPath = erg + sdkRootPath.mid(endIndex + 1);
+ const QString rootString = QStringLiteral("$(SdkRootPath)");
+
+ includePath = includePath.replace(rootString, fullSdkRootPath);
+ libraryPath = libraryPath.replace(rootString, fullSdkRootPath);
+ binDirs = binDirs.replace(rootString, fullSdkRootPath);
+ info->m_include = includePath + ";$(INCLUDE)";
+ info->m_lib = libraryPath;
+ info->m_bin = binDirs;
+ }
+ return success;
+}
+
+QStringList CeSdkHandler::getMsBuildToolPaths() const
+{
+ QSettings msbuildEntries("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\MSBuild\\ToolsVersions",
+ QSettings::NativeFormat);
+ const QStringList allKeys = msbuildEntries.allKeys();
+ QStringList toolVersionKeys;
+ toolVersionKeys.push_back(QStringLiteral("c:\\Program Files\\MSBuild\\"));
+ std::remove_copy_if(allKeys.cbegin(), allKeys.cend(),
+ std::back_inserter(toolVersionKeys), ContainsPathKey());
+ QStringList toolVersionValues;
+ std::transform(toolVersionKeys.constBegin(), toolVersionKeys.constEnd(),
+ std::back_inserter(toolVersionValues),
+ ValueFromKey(&msbuildEntries));
+ return toolVersionValues;
+}
+
+QStringList CeSdkHandler::filterMsBuildToolPaths(const QStringList &paths) const
+{
+ QStringList result;
+ foreach (const QString &path, paths) {
+ QDir dir(path);
+ if (path.endsWith(QStringLiteral("bin")))
+ dir.cdUp();
+ if (dir.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V110\\Platforms"))
+ || dir.cd(QStringLiteral("Microsoft.Cpp\\v4.0\\V120\\Platforms"))) {
+ result << dir.absolutePath();
+ }
+ }
+ return result;
+}
+
+bool CeSdkHandler::retrieveEnvironment(const QStringList &relativePaths,
+ const QStringList &toolPaths,
+ CeSdkInfo *info)
+{
+ bool result = false;
+ foreach (const QString &path, toolPaths) {
+ const QDir dir(path);
+ foreach (const QString &filePath, relativePaths) {
+ QFile file(dir.absoluteFilePath(filePath));
+ if (file.exists())
+ result = parseMsBuildFile(&file, info) || result;
+ }
+ }
+
+ return result;
+}
+
+void CeSdkHandler::retrieveWEC2013SDKs()
+{
+ const QStringList toolPaths = getMsBuildToolPaths();
+ const QStringList filteredToolPaths = filterMsBuildToolPaths(toolPaths);
+ QSettings settings("HKEY_LOCAL_MACHINE\\Software\\Microsoft\\Windows CE Tools\\SDKs", QSettings::NativeFormat);
+ const QStringList keys = settings.allKeys();
+ foreach (const QString &key, keys) {
+ if (key.contains(QLatin1String("SDKInformation")) || key.contains(QLatin1Char('.'))) {
+ QFile sdkPropertyFile(settings.value(key).toString());
+ if (!sdkPropertyFile.exists())
+ continue;
+ QFileInfo info(sdkPropertyFile);
+ if (info.isDir()) {
+ const QDir dir = info.absoluteFilePath();
+ QFileInfo fInfo(dir.filePath(QLatin1String("Properties.xml")));
+ if (fInfo.exists())
+ sdkPropertyFile.setFileName(fInfo.absoluteFilePath());
+ }
+ if (!sdkPropertyFile.open(QFile::ReadOnly))
+ continue;
+ QXmlStreamReader xml(&sdkPropertyFile);
+ QString currentElement;
+ QString curName;
+ PropertyContainer currentProperty;
+ QVector<PropertyContainer> propStack;
+ propStack.push_back(currentProperty);
+ while (!xml.atEnd()) {
+ xml.readNext();
+ if (xml.isStartElement()) {
+ currentElement = xml.name().toString();
+ if (currentElement == QLatin1String("Property")) {
+ QXmlStreamAttributes attributes = xml.attributes();
+ if (attributes.hasAttribute(QLatin1String("NAME")))
+ curName = attributes.value(QLatin1String("NAME")).toString();
+ Q_ASSERT(!curName.isEmpty());
+ currentProperty.clear();
+ currentProperty.name = curName;
+ propStack.push_back(currentProperty);
+ } else if (currentElement == QLatin1String("PropertyBag")) {
+ QXmlStreamAttributes attributes = xml.attributes();
+ if (attributes.hasAttribute(QLatin1String("NAME")))
+ curName = attributes.value(QLatin1String("NAME")).toString();
+ Q_ASSERT(!curName.isEmpty());
+ currentProperty.clear();
+ currentProperty.name = curName;
+ propStack.push_back(currentProperty);
+ }
+ } else if (xml.isEndElement()) {
+ currentElement = xml.name().toString();
+ PropertyContainer self = propStack.takeLast();
+ if (currentElement != QLatin1String("Root")) {
+ PropertyContainer &last = propStack.last();
+ last.properties[self.name] = self;
+ } else {
+ currentProperty = self;
+ }
+ } else if (xml.isCharacters()) {
+ PropertyContainer &self = propStack.last();
+ self.value = xml.text().toString();
+ }
+ }
+
+ if (xml.error() && xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) {
+ qWarning() << "XML ERROR:" << xml.lineNumber() << ": " << xml.errorString();
+ return;
+ }
+ CeSdkInfo currentSdk;
+ const PropertyContainer &cpuInfo = currentProperty.properties.value(QLatin1String("CPU info"));
+ if (cpuInfo.properties.isEmpty())
+ continue;
+ const PropertyContainer &cpuInfoVal = cpuInfo.properties.first().properties.value(QLatin1String("CpuName"));
+ if (cpuInfoVal.name != QStringLiteral("CpuName"))
+ continue;
+ const QString SDKName = QStringLiteral("SDK name");
+ currentSdk.m_name = currentProperty.properties.value(SDKName).value+
+ QStringLiteral(" (") + cpuInfoVal.value + ")";
+ currentSdk.m_major = currentProperty.properties.value(QLatin1String("OSMajor")).value.toInt();
+ currentSdk.m_minor = currentProperty.properties.value(QLatin1String("OSMinor")).value.toInt();
+ retrieveEnvironment(currentProperty.properties.value(QLatin1String("MSBuild Files110")).value.split(';'),
+ filteredToolPaths, &currentSdk);
+ if (!currentSdk.m_include.isEmpty())
+ m_list.append(currentSdk);
+ }
+ }
+}
+
+void CeSdkHandler::retrieveWEC6n7SDKs()
{
// look at the file at %VCInstallDir%/vcpackages/WCE.VCPlatform.config
// and scan through all installed sdks...
- m_list.clear();
m_vcInstallDir = QString::fromLatin1(qgetenv("VCInstallDir"));
if (m_vcInstallDir.isEmpty())
- return false;
+ return;
QDir vStudioDir(m_vcInstallDir);
if (!vStudioDir.cd(QLatin1String("vcpackages")))
- return false;
+ return;
QFile configFile(vStudioDir.absoluteFilePath(QLatin1String("WCE.VCPlatform.config")));
if (!configFile.open(QIODevice::ReadOnly))
- return false;
+ return;
QString currentElement;
CeSdkInfo currentItem;
@@ -94,13 +338,19 @@ bool CeSdkHandler::parse()
if (xml.error() && xml.error() != QXmlStreamReader::PrematureEndOfDocumentError) {
qWarning() << "XML ERROR:" << xml.lineNumber() << ": " << xml.errorString();
- return false;
+ return;
}
+}
- return m_list.size() > 0;
+bool CeSdkHandler::retrieveAvailableSDKs()
+{
+ m_list.clear();
+ retrieveWEC2013SDKs();
+ retrieveWEC6n7SDKs();
+ return !m_list.empty();
}
-QString CeSdkHandler::fixPaths(QString path) const
+QString CeSdkHandler::fixPaths(const QString &path) const
{
QRegExp searchStr(QLatin1String("(\\$\\(\\w+\\))"));
QString fixedString = path;
diff --git a/qmake/generators/win32/cesdkhandler.h b/qmake/generators/win32/cesdkhandler.h
index 42c0121720..b90c3c6dce 100644
--- a/qmake/generators/win32/cesdkhandler.h
+++ b/qmake/generators/win32/cesdkhandler.h
@@ -73,10 +73,18 @@ class CeSdkHandler
{
public:
CeSdkHandler();
- bool parse();
+ bool retrieveAvailableSDKs();
inline QList<CeSdkInfo> listAll() const { return m_list; }
private:
- inline QString fixPaths(QString path) const;
+ void retrieveWEC6n7SDKs();
+ void retrieveWEC2013SDKs();
+ inline QString fixPaths(const QString &path) const;
+ QStringList getMsBuildToolPaths() const;
+ QStringList filterMsBuildToolPaths(const QStringList &paths) const;
+ bool parseMsBuildFile(QFile *file, CeSdkInfo *info);
+ bool retrieveEnvironment(const QStringList &relativePaths,
+ const QStringList &toolPaths,
+ CeSdkInfo *info);
QList<CeSdkInfo> m_list;
QString m_vcInstallDir;
};
diff --git a/qmake/generators/win32/msvc_nmake.cpp b/qmake/generators/win32/msvc_nmake.cpp
index 740c8c4d13..eb8ae23384 100644
--- a/qmake/generators/win32/msvc_nmake.cpp
+++ b/qmake/generators/win32/msvc_nmake.cpp
@@ -79,7 +79,7 @@ NmakeMakefileGenerator::writeMakefile(QTextStream &t)
const ProValueMap &variables = project->variables();
if (project->isActiveConfig("wince")) {
CeSdkHandler sdkhandler;
- sdkhandler.parse();
+ sdkhandler.retrieveAvailableSDKs();
const QString sdkName = variables["CE_SDK"].join(' ')
+ " (" + variables["CE_ARCH"].join(' ') + ")";
const QList<CeSdkInfo> sdkList = sdkhandler.listAll();
@@ -354,14 +354,18 @@ void NmakeMakefileGenerator::init()
project->values("QMAKE_LFLAGS").append(QString("/DEF:") + escapeFilePath(defFileName));
}
- if(!project->values("VERSION").isEmpty()) {
- ProString version = project->values("VERSION")[0];
- int firstDot = version.indexOf(".");
- QString major = version.left(firstDot).toQString();
- QString minor = version.right(version.length() - firstDot - 1).toQString();
- minor.replace(".", "");
- project->values("QMAKE_LFLAGS").append("/VERSION:" + major + "." + minor);
+ // set /VERSION for EXE/DLL header
+ ProString major_minor = project->first("VERSION_PE_HEADER");
+ if (major_minor.isEmpty()) {
+ ProString version = project->first("VERSION");
+ if (!version.isEmpty()) {
+ int firstDot = version.indexOf(".");
+ int secondDot = version.indexOf(".", firstDot + 1);
+ major_minor = version.left(secondDot);
+ }
}
+ if (!major_minor.isEmpty())
+ project->values("QMAKE_LFLAGS").append("/VERSION:" + major_minor);
if (project->isEmpty("QMAKE_LINK_O_FLAG"))
project->values("QMAKE_LINK_O_FLAG").append("/OUT:");
diff --git a/qmake/generators/win32/msvc_objectmodel.cpp b/qmake/generators/win32/msvc_objectmodel.cpp
index 917f4467a0..aa7320bc27 100644
--- a/qmake/generators/win32/msvc_objectmodel.cpp
+++ b/qmake/generators/win32/msvc_objectmodel.cpp
@@ -2337,7 +2337,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
for (int i = 0; i < extradeps.count(); ++i) {
QString dd = extradeps.at(i).simplified();
if (!dd.isEmpty())
- deps += Project->fileFixify(dd, QString(), Option::output_dir);
+ deps += Project->fileFixify(dd, MakefileGenerator::FileFixifyFromOutdir);
}
}
}
diff --git a/qmake/generators/win32/msvc_vcproj.cpp b/qmake/generators/win32/msvc_vcproj.cpp
index 3222030018..0d78766606 100644
--- a/qmake/generators/win32/msvc_vcproj.cpp
+++ b/qmake/generators/win32/msvc_vcproj.cpp
@@ -787,14 +787,18 @@ void VcprojGenerator::init()
processVars();
- if(!project->values("VERSION").isEmpty()) {
- QString version = project->values("VERSION")[0].toQString();
- int firstDot = version.indexOf(".");
- QString major = version.left(firstDot);
- QString minor = version.right(version.length() - firstDot - 1);
- minor.replace(QRegExp("\\."), "");
- project->values("QMAKE_LFLAGS").append("/VERSION:" + major + "." + minor);
+ // set /VERSION for EXE/DLL header
+ ProString major_minor = project->first("VERSION_PE_HEADER");
+ if (major_minor.isEmpty()) {
+ ProString version = project->first("VERSION");
+ if (!version.isEmpty()) {
+ int firstDot = version.indexOf(".");
+ int secondDot = version.indexOf(".", firstDot + 1);
+ major_minor = version.left(secondDot);
+ }
}
+ if (!major_minor.isEmpty())
+ project->values("QMAKE_LFLAGS").append("/VERSION:" + major_minor);
MakefileGenerator::init();
@@ -1414,9 +1418,29 @@ void VcprojGenerator::initWinDeployQtTool()
conf.windeployqt.ExcludedFromBuild = true;
if (project->isActiveConfig("windeployqt")) {
conf.windeployqt.Record = QStringLiteral("$(TargetName).windeployqt.$(Platform).$(Configuration)");
- conf.windeployqt.CommandLine =
- MakefileGenerator::shellQuote(QDir::toNativeSeparators(project->first("QMAKE_WINDEPLOYQT").toQString()))
- + QLatin1Char(' ') + project->values("WINDEPLOYQT_OPTIONS").join(QLatin1Char(' '))
+ const QString commandLine = MakefileGenerator::shellQuote(QDir::toNativeSeparators(project->first("QMAKE_WINDEPLOYQT").toQString()))
+ + QLatin1Char(' ') + project->values("WINDEPLOYQT_OPTIONS").join(QLatin1Char(' '));
+
+ // Visual Studio copies all files to be deployed into the MSIL directory
+ // and then invokes MDILXapCompile on it, which checks for managed code and
+ // translates it into native code. The problem is that all entries of the
+ // package will be copied into the MSIL directly, losing the subdirectory
+ // structure (for instance for plugins). However, the MDILXapCompile call
+ // itself contains the original subdirectories as parameters and hence the
+ // call fails.
+ // Neither there is a way to disable this behavior for Windows Phone, nor
+ // to influence the parameters. Hence the only way to get a release build
+ // done is to recreate the directory structure manually by invoking
+ // windeployqt a second time, so that the MDILXapCompile call succeeds and
+ // deployment continues.
+ if (conf.WinPhone && conf.Name == QStringLiteral("Release|ARM")) {
+ conf.windeployqt.CommandLine = commandLine
+ + QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\\")
+ + var("OBJECTS_DIR")
+ + QStringLiteral("MSIL\" \"$(OutDir)\\$(TargetName).exe\" ")
+ + QLatin1String(" && ");
+ }
+ conf.windeployqt.CommandLine += commandLine
+ QStringLiteral(" -list relative -dir \"$(MSBuildProjectDirectory)\" \"$(OutDir)\\$(TargetName).exe\" > ")
+ MakefileGenerator::shellQuote(conf.windeployqt.Record);
conf.windeployqt.config = &vcProject.Configuration;
@@ -1564,7 +1588,7 @@ void VcprojGenerator::initResourceFiles()
QT_PCLOSE(proc);
if(!indeps.isEmpty())
deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '),
- QString(), Option::output_dir);
+ FileFixifyFromOutdir);
}
}
}
diff --git a/qmake/project.cpp b/qmake/project.cpp
index 445c5c9bc5..faea6da650 100644
--- a/qmake/project.cpp
+++ b/qmake/project.cpp
@@ -70,6 +70,7 @@ bool QMakeProject::read(const QString &project, LoadFlags what)
QString absproj = (project == QLatin1String("-"))
? QLatin1String("(stdin)")
: QDir::cleanPath(QDir(qmake_getpwd()).absoluteFilePath(project));
+ m_projectDir = QFileInfo(absproj).path();
return boolRet(evaluateFile(absproj, QMakeHandler::EvalProjectFile, what));
}
diff --git a/qmake/project.h b/qmake/project.h
index 9a5d0e285e..7cd49a457c 100644
--- a/qmake/project.h
+++ b/qmake/project.h
@@ -41,6 +41,7 @@ QT_BEGIN_NAMESPACE
class QMakeProject : private QMakeEvaluator
{
QString m_projectFile;
+ QString m_projectDir;
public:
QMakeProject();
@@ -49,6 +50,7 @@ public:
bool read(const QString &project, LoadFlags what = LoadAll);
QString projectFile() const { return m_projectFile; }
+ QString projectDir() const { return m_projectDir; }
QString sourceRoot() const { return m_sourceRoot.isEmpty() ? m_buildRoot : m_sourceRoot; }
QString buildRoot() const { return m_buildRoot; }
QString confFile() const { return m_conffile; }
diff --git a/src/3rdparty/angle/.gitignore b/src/3rdparty/angle/.gitignore
index cbb7e6a5af..17958a0fb5 100644
--- a/src/3rdparty/angle/.gitignore
+++ b/src/3rdparty/angle/.gitignore
@@ -6,19 +6,28 @@ build
extensions
samples
tests
-third_party
src/ipch
+util
.svn
# Files from ANGLE we don't want/need
DEPS
+*.chromium
+*.isolate
+*.md
+*.gn
*.gyp
*.gypi
*.sh
*.bat
*.patch
*.py
+*.rc
+*_unittest.cpp
codereview.settings
+src/commit.h
+src/libANGLE/renderer/gl
+src/third_party/khronos/GL
# Generated by flex/bison
src/compiler/preprocessor/Tokenizer.cpp
@@ -28,5 +37,5 @@ src/compiler/translator/glslang_tab.cpp
src/compiler/translator/glslang_tab.h
# Generated by FXC
-src/libGLESv2/renderer/d3d/d3d9/shaders/compiled/*.h
-src/libGLESv2/renderer/d3d/d3d11/shaders/compiled/*.h
+src/libANGLE/renderer/d3d/d3d9/shaders/compiled/*.h
+src/libANGLE/renderer/d3d/d3d11/shaders/compiled/*.h
diff --git a/src/3rdparty/angle/AUTHORS b/src/3rdparty/angle/AUTHORS
index be114bcf68..836bed8e8a 100644
--- a/src/3rdparty/angle/AUTHORS
+++ b/src/3rdparty/angle/AUTHORS
@@ -16,17 +16,22 @@ Autodesk, Inc.
BlackBerry Limited
Cable Television Laboratories, Inc.
Cloud Party, Inc.
+Imagination Technologies Ltd.
Intel Corporation
Mozilla Corporation
Turbulenz
Klarälvdalens Datakonsult AB
+Microsoft Corporation
Microsoft Open Technologies, Inc.
NVIDIA Corporation
+Opera Software ASA
+The Qt Company Ltd.
Jacek Caban
Mark Callow
Ginn Chen
Tibor den Ouden
+Régis Fénéon
James Hauxwell
Sam Hocevar
Pierre Leveille
@@ -35,3 +40,4 @@ Boying Lu
Aitor Moreno
Yuri O'Donnell
Josh Soref
+Maks Naumov
diff --git a/src/3rdparty/angle/CONTRIBUTORS b/src/3rdparty/angle/CONTRIBUTORS
index 6b27416e38..5252141973 100644
--- a/src/3rdparty/angle/CONTRIBUTORS
+++ b/src/3rdparty/angle/CONTRIBUTORS
@@ -1,4 +1,4 @@
-# This is the official list of people who can contribute
+# This is the official list of people who can contribute
# (and who have contributed) code to the ANGLE project
# repository.
# The AUTHORS file lists the copyright holders; this file
@@ -40,6 +40,7 @@ Google Inc.
thestig@chromium.org
Justin Schuh
Scott Graham
+ Corentin Wallez
Adobe Systems Inc.
Alexandru Chiculita
@@ -55,6 +56,9 @@ Cloud Party, Inc.
The Qt Company Ltd.
Andrew Knight
+Imagination Technologies Ltd.
+ Gregoire Payen de La Garanderie
+
Intel Corporation
Jin Yang
Andy Chen
@@ -80,10 +84,21 @@ Mark Banner (standard8mbp)
David Kilzer
Jacek Caban
Tibor den Ouden
+Régis Fénéon
+
+Microsoft Corporation
+ Cooper Partin
+ Austin Kinross
+ Minmin Gong
Microsoft Open Technologies, Inc.
-Cooper Partin
-Austin Kinross
+ Cooper Partin
+ Austin Kinross
NVIDIA Corporation
Olli Etuaho
+ Arun Patole
+ Qingqing Deng
+
+Opera Software ASA
+ Daniel Bratell
diff --git a/src/3rdparty/angle/include/EGL/egl.h b/src/3rdparty/angle/include/EGL/egl.h
index 12590a0e20..5a27291213 100644
--- a/src/3rdparty/angle/include/EGL/egl.h
+++ b/src/3rdparty/angle/include/EGL/egl.h
@@ -33,12 +33,12 @@ extern "C" {
** used to make the header, and the header can be found at
** http://www.opengl.org/registry/
**
-** Khronos $Revision: 27018 $ on $Date: 2014-06-10 08:06:12 -0700 (Tue, 10 Jun 2014) $
+** Khronos $Revision: 29318 $ on $Date: 2015-01-02 03:16:10 -0800 (Fri, 02 Jan 2015) $
*/
#include <EGL/eglplatform.h>
-/* Generated on date 20140610 */
+/* Generated on date 20150102 */
/* Generated C header for:
* API: egl
@@ -240,6 +240,7 @@ EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
typedef void *EGLSync;
typedef intptr_t EGLAttrib;
typedef khronos_utime_nanoseconds_t EGLTime;
+typedef void *EGLImage;
#define EGL_CONTEXT_MAJOR_VERSION 0x3098
#define EGL_CONTEXT_MINOR_VERSION 0x30FB
#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
@@ -281,10 +282,14 @@ typedef khronos_utime_nanoseconds_t EGLTime;
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
+#define EGL_IMAGE_PRESERVED 0x30D2
+#define EGL_NO_IMAGE ((EGLImage)0)
EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
+EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
+EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image);
EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
diff --git a/src/3rdparty/angle/include/EGL/eglext.h b/src/3rdparty/angle/include/EGL/eglext.h
index 0cc5eec293..a44afecb3f 100644
--- a/src/3rdparty/angle/include/EGL/eglext.h
+++ b/src/3rdparty/angle/include/EGL/eglext.h
@@ -440,24 +440,28 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
#ifndef EGL_ANGLE_platform_angle
#define EGL_ANGLE_platform_angle 1
-#define EGL_PLATFORM_ANGLE_ANGLE 0x3201
-#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3202
-#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3203
-#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3204
-#define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE 0x3205
+#define EGL_PLATFORM_ANGLE_ANGLE 0x3202
+#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203
+#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204
+#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205
+#define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE 0x3206
#endif /* EGL_ANGLE_platform_angle */
#ifndef EGL_ANGLE_platform_angle_d3d
#define EGL_ANGLE_platform_angle_d3d 1
-#define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3206
-#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3207
-#define EGL_PLATFORM_ANGLE_USE_WARP_ANGLE 0x3208
+#define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3207
+#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
+#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209
+#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE 0x320A
+#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE 0x320B
+#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_REFERENCE_ANGLE 0x320C
+#define EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE 0x320F
#endif /* EGL_ANGLE_platform_angle_d3d */
#ifndef EGL_ANGLE_platform_angle_opengl
#define EGL_ANGLE_platform_angle_opengl 1
-#define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x3209
-#define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320A
+#define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x320D
+#define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320E
#endif /* EGL_ANGLE_platform_angle_opengl */
#ifndef EGL_ARM_pixmap_multisample_discard
diff --git a/src/3rdparty/angle/include/EGL/eglplatform.h b/src/3rdparty/angle/include/EGL/eglplatform.h
index 2eb3674a0b..519df3e750 100644
--- a/src/3rdparty/angle/include/EGL/eglplatform.h
+++ b/src/3rdparty/angle/include/EGL/eglplatform.h
@@ -73,15 +73,14 @@
#endif
#include <windows.h>
+typedef HDC EGLNativeDisplayType;
typedef HBITMAP EGLNativePixmapType;
-#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP) /* Windows Store */
+#if !defined(WINAPI_FAMILY) || (WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP) /* Windows Desktop */
+typedef HWND EGLNativeWindowType;
+#else /* Windows Store */
#include <inspectable.h>
-typedef IInspectable* EGLNativeDisplayType;
typedef IInspectable* EGLNativeWindowType;
-#else
-typedef HDC EGLNativeDisplayType;
-typedef HWND EGLNativeWindowType;
#endif
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
@@ -110,6 +109,14 @@ typedef Display *EGLNativeDisplayType;
typedef Pixmap EGLNativePixmapType;
typedef Window EGLNativeWindowType;
+#elif defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) || defined(__MACOS_CLASSIC__) )
+
+// TODO(jmadill): native implementation for OSX
+
+typedef void *EGLNativeDisplayType;
+typedef void *EGLNativePixmapType;
+typedef void *EGLNativeWindowType;
+
#else
#error "Platform not recognized"
#endif
diff --git a/src/3rdparty/angle/include/GLSLANG/ShaderLang.h b/src/3rdparty/angle/include/GLSLANG/ShaderLang.h
index 647fed6a02..126205af2c 100644
--- a/src/3rdparty/angle/include/GLSLANG/ShaderLang.h
+++ b/src/3rdparty/angle/include/GLSLANG/ShaderLang.h
@@ -3,8 +3,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-#ifndef _COMPILER_INTERFACE_INCLUDED_
-#define _COMPILER_INTERFACE_INCLUDED_
+#ifndef GLSLANG_SHADERLANG_H_
+#define GLSLANG_SHADERLANG_H_
#if defined(COMPONENT_BUILD) && !defined(ANGLE_TRANSLATOR_STATIC)
#if defined(_WIN32) || defined(_WIN64)
@@ -48,7 +48,7 @@ typedef unsigned int GLenum;
// Version number for shader translation API.
// It is incremented every time the API changes.
-#define ANGLE_SH_VERSION 132
+#define ANGLE_SH_VERSION 134
typedef enum {
SH_GLES2_SPEC = 0x8B40,
@@ -81,11 +81,16 @@ typedef enum {
} ShShaderSpec;
typedef enum {
- SH_ESSL_OUTPUT = 0x8B45,
- SH_GLSL_OUTPUT = 0x8B46,
- SH_HLSL_OUTPUT = 0x8B47,
- SH_HLSL9_OUTPUT = 0x8B47,
- SH_HLSL11_OUTPUT = 0x8B48
+ SH_ESSL_OUTPUT = 0x8B45,
+ // SH_GLSL_OUTPUT is deprecated. This is to not break the build.
+ SH_GLSL_OUTPUT = 0x8B46,
+ SH_GLSL_COMPATIBILITY_OUTPUT = 0x8B46,
+ SH_GLSL_CORE_OUTPUT = 0x8B47,
+
+ // HLSL output only supported in some configurations.
+ SH_HLSL_OUTPUT = 0x8B48,
+ SH_HLSL9_OUTPUT = 0x8B48,
+ SH_HLSL11_OUTPUT = 0x8B49
} ShShaderOutput;
// Compile options.
@@ -223,6 +228,10 @@ typedef struct
int EXT_draw_buffers;
int EXT_frag_depth;
int EXT_shader_texture_lod;
+ int WEBGL_debug_shader_precision;
+ int EXT_shader_framebuffer_fetch;
+ int NV_shader_framebuffer_fetch;
+ int ARM_shader_framebuffer_fetch;
// 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
@@ -290,7 +299,8 @@ COMPILER_EXPORT const std::string &ShGetBuiltInResourcesString(const ShHandle ha
// spec: Specifies the language spec the compiler must conform to -
// SH_GLES2_SPEC or SH_WEBGL_SPEC.
// output: Specifies the output code type - SH_ESSL_OUTPUT, SH_GLSL_OUTPUT,
-// SH_HLSL9_OUTPUT or SH_HLSL11_OUTPUT.
+// SH_HLSL9_OUTPUT or SH_HLSL11_OUTPUT. Note: HLSL output is only
+// supported in some configurations.
// resources: Specifies the built-in resources.
COMPILER_EXPORT ShHandle ShConstructCompiler(
sh::GLenum type,
@@ -408,4 +418,4 @@ COMPILER_EXPORT bool ShGetUniformRegister(const ShHandle handle,
const std::string &uniformName,
unsigned int *indexOut);
-#endif // _COMPILER_INTERFACE_INCLUDED_
+#endif // GLSLANG_SHADERLANG_H_
diff --git a/src/3rdparty/angle/include/GLSLANG/ShaderVars.h b/src/3rdparty/angle/include/GLSLANG/ShaderVars.h
index da21c3e76e..4128c343f8 100644
--- a/src/3rdparty/angle/include/GLSLANG/ShaderVars.h
+++ b/src/3rdparty/angle/include/GLSLANG/ShaderVars.h
@@ -7,8 +7,8 @@
// Types to represent GL variables (varyings, uniforms, etc)
//
-#ifndef _COMPILER_INTERFACE_VARIABLES_
-#define _COMPILER_INTERFACE_VARIABLES_
+#ifndef GLSLANG_SHADERVARS_H_
+#define GLSLANG_SHADERVARS_H_
#include <string>
#include <vector>
@@ -28,6 +28,9 @@ enum InterpolationType
INTERPOLATION_FLAT
};
+// Validate link & SSO consistency of interpolation qualifiers
+COMPILER_EXPORT bool InterpolationTypesMatch(InterpolationType a, InterpolationType b);
+
// Uniform block layout qualifier, see section 4.3.8.3 of the ESSL 3.00.4 spec
enum BlockLayoutType
{
@@ -182,4 +185,4 @@ struct COMPILER_EXPORT InterfaceBlock
}
-#endif // _COMPILER_INTERFACE_VARIABLES_
+#endif // GLSLANG_SHADERVARS_H_
diff --git a/src/3rdparty/angle/include/KHR/khrplatform.h b/src/3rdparty/angle/include/KHR/khrplatform.h
index 1ac2d3f324..c9e6f17d34 100644..100755
--- a/src/3rdparty/angle/include/KHR/khrplatform.h
+++ b/src/3rdparty/angle/include/KHR/khrplatform.h
@@ -97,7 +97,7 @@
*-------------------------------------------------------------------------
* This precedes the return type of the function in the function prototype.
*/
-#if defined(_WIN32) && !defined(__SCITECH_SNAP__) && !defined(QT_OPENGL_ES_2_ANGLE_STATIC)
+#if defined(_WIN32) && !defined(__SCITECH_SNAP__)
# define KHRONOS_APICALL __declspec(dllimport)
#elif defined (__SYMBIAN32__)
# define KHRONOS_APICALL IMPORT_C
diff --git a/src/3rdparty/angle/include/angle_gl.h b/src/3rdparty/angle/include/angle_gl.h
index d093f75ee2..e7ecdbd2f0 100644
--- a/src/3rdparty/angle/include/angle_gl.h
+++ b/src/3rdparty/angle/include/angle_gl.h
@@ -7,8 +7,8 @@
// Includes all necessary GL headers and definitions for ANGLE.
//
-#ifndef ANGLE_GL_H_
-#define ANGLE_GL_H_
+#ifndef ANGLEGL_H_
+#define ANGLEGL_H_
#include "GLES2/gl2.h"
#include "GLES2/gl2ext.h"
@@ -20,4 +20,4 @@
#define GL_SAMPLER_2D_RECT_ARB 0x8B63
#endif
-#endif // ANGLE_GL_H_
+#endif // ANGLEGL_H_
diff --git a/src/3rdparty/angle/include/export.h b/src/3rdparty/angle/include/export.h
new file mode 100644
index 0000000000..cdf6245d6d
--- /dev/null
+++ b/src/3rdparty/angle/include/export.h
@@ -0,0 +1,28 @@
+//
+// Copyright(c) 2014 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.
+//
+
+// export.h : Defines ANGLE_EXPORT, a macro for exporting functions from the DLL
+
+#ifndef LIBGLESV2_EXPORT_H_
+#define LIBGLESV2_EXPORT_H_
+
+#if defined(_WIN32)
+# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION)
+# define ANGLE_EXPORT __declspec(dllexport)
+# else
+# define ANGLE_EXPORT __declspec(dllimport)
+# endif
+#elif defined(__GNUC__)
+# if defined(LIBGLESV2_IMPLEMENTATION) || defined(LIBANGLE_IMPLEMENTATION)
+# define ANGLE_EXPORT __attribute__((visibility ("default")))
+# else
+# define ANGLE_EXPORT
+# endif
+#else
+# define ANGLE_EXPORT
+#endif
+
+#endif // LIBGLESV2_EXPORT_H_
diff --git a/src/3rdparty/angle/include/platform/Platform.h b/src/3rdparty/angle/include/platform/Platform.h
new file mode 100644
index 0000000000..d915d5c0fd
--- /dev/null
+++ b/src/3rdparty/angle/include/platform/Platform.h
@@ -0,0 +1,112 @@
+//
+// Copyright (c) 2015 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.
+
+// Platform.h: The public interface ANGLE exposes to the API layer, for
+// doing platform-specific tasks like gathering data, or for tracing.
+
+#ifndef ANGLE_PLATFORM_H
+#define ANGLE_PLATFORM_H
+
+#include <stdint.h>
+
+#include "../export.h"
+
+namespace angle
+{
+
+class Platform
+{
+ public:
+
+ // Tracing --------
+
+ typedef uint64_t TraceEventHandle;
+
+ // Add a trace event to the platform tracing system. Depending on the actual
+ // enabled state, this event may be recorded or dropped.
+ // - phase specifies the type of event:
+ // - BEGIN ('B'): Marks the beginning of a scoped event.
+ // - END ('E'): Marks the end of a scoped event.
+ // - COMPLETE ('X'): Marks the beginning of a scoped event, but doesn't
+ // need a matching END event. Instead, at the end of the scope,
+ // updateTraceEventDuration() must be called with the TraceEventHandle
+ // returned from addTraceEvent().
+ // - INSTANT ('I'): Standalone, instantaneous event.
+ // - START ('S'): Marks the beginning of an asynchronous event (the end
+ // event can occur in a different scope or thread). The id parameter is
+ // used to match START/FINISH pairs.
+ // - FINISH ('F'): Marks the end of an asynchronous event.
+ // - COUNTER ('C'): Used to trace integer quantities that change over
+ // time. The argument values are expected to be of type int.
+ // - METADATA ('M'): Reserved for internal use.
+ // - categoryEnabled is the pointer returned by getTraceCategoryEnabledFlag.
+ // - name is the name of the event. Also used to match BEGIN/END and
+ // START/FINISH pairs.
+ // - id optionally allows events of the same name to be distinguished from
+ // each other. For example, to trace the consutruction and destruction of
+ // objects, specify the pointer as the id parameter.
+ // - numArgs specifies the number of elements in argNames, argTypes, and
+ // argValues.
+ // - argNames is the array of argument names. Use long-lived literal strings
+ // or specify the COPY flag.
+ // - argTypes is the array of argument types:
+ // - BOOL (1): bool
+ // - UINT (2): unsigned long long
+ // - INT (3): long long
+ // - DOUBLE (4): double
+ // - POINTER (5): void*
+ // - STRING (6): char* (long-lived null-terminated char* string)
+ // - COPY_STRING (7): char* (temporary null-terminated char* string)
+ // - CONVERTABLE (8): WebConvertableToTraceFormat
+ // - argValues is the array of argument values. Each value is the unsigned
+ // long long member of a union of all supported types.
+ // - flags can be 0 or one or more of the following, ORed together:
+ // - COPY (0x1): treat all strings (name, argNames and argValues of type
+ // string) as temporary so that they will be copied by addTraceEvent.
+ // - HAS_ID (0x2): use the id argument to uniquely identify the event for
+ // matching with other events of the same name.
+ // - MANGLE_ID (0x4): specify this flag if the id parameter is the value
+ // of a pointer.
+ virtual TraceEventHandle addTraceEvent(char phase,
+ const unsigned char *categoryEnabledFlag,
+ const char *name,
+ unsigned long long id,
+ double timestamp,
+ int numArgs,
+ const char **argNames,
+ const unsigned char *argTypes,
+ const unsigned long long *argValues,
+ unsigned char flags)
+ {
+ return 0;
+ }
+
+ // Set the duration field of a COMPLETE trace event.
+ virtual void updateTraceEventDuration(const unsigned char* categoryEnabledFlag, const char* name, TraceEventHandle) { }
+
+ // Callbacks for reporting histogram data.
+ // CustomCounts histogram has exponential bucket sizes, so that min=1, max=1000000, bucketCount=50 would do.
+ virtual void histogramCustomCounts(const char* name, int sample, int min, int max, int bucketCount) { }
+ // Enumeration histogram buckets are linear, boundaryValue should be larger than any possible sample value.
+ virtual void histogramEnumeration(const char* name, int sample, int boundaryValue) { }
+ // Unlike enumeration histograms, sparse histograms only allocate memory for non-empty buckets.
+ virtual void histogramSparse(const char* name, int sample) { }
+
+ protected:
+ virtual ~Platform() { }
+};
+
+}
+
+typedef void(*ANGLEPlatformInitializeFunc)(angle::Platform*);
+ANGLE_EXPORT void ANGLEPlatformInitialize(angle::Platform*);
+
+typedef void (*ANGLEPlatformShutdownFunc)();
+ANGLE_EXPORT void ANGLEPlatformShutdown();
+
+typedef angle::Platform *(*ANGLEPlatformCurrentFunc)();
+ANGLE_EXPORT angle::Platform *ANGLEPlatformCurrent();
+
+#endif // ANGLE_PLATFORM_H
diff --git a/src/3rdparty/angle/src/commit.h b/src/3rdparty/angle/src/commit.h
deleted file mode 100644
index 08fc893c25..0000000000
--- a/src/3rdparty/angle/src/commit.h
+++ /dev/null
@@ -1,12 +0,0 @@
-//
-// Copyright (c) 2014 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.
-//
-// commit.h:
-// This is a default commit hash header, when git is not available.
-//
-
-#define ANGLE_COMMIT_HASH "30d6c255d238"
-#define ANGLE_COMMIT_HASH_SIZE 12
-#define ANGLE_COMMIT_DATE "2014-11-13 17:37:03 +0000"
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/MemoryBuffer.cpp b/src/3rdparty/angle/src/common/MemoryBuffer.cpp
index 2b5b09a324..e7a3fb4a2b 100644
--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/MemoryBuffer.cpp
+++ b/src/3rdparty/angle/src/common/MemoryBuffer.cpp
@@ -4,12 +4,13 @@
// found in the LICENSE file.
//
-#include "libGLESv2/renderer/d3d/MemoryBuffer.h"
-#include "common/debug.h"
+#include "common/MemoryBuffer.h"
#include <algorithm>
#include <cstdlib>
+#include "common/debug.h"
+
namespace rx
{
@@ -32,26 +33,31 @@ bool MemoryBuffer::resize(size_t size)
free(mData);
mData = NULL;
mSize = 0;
+ return true;
+ }
+
+ if (size == mSize)
+ {
+ return true;
}
- else
+
+ // Only reallocate if the size has changed.
+ uint8_t *newMemory = reinterpret_cast<uint8_t*>(malloc(sizeof(uint8_t) * size));
+ if (newMemory == NULL)
+ {
+ return false;
+ }
+
+ if (mData)
{
- uint8_t *newMemory = reinterpret_cast<uint8_t*>(malloc(sizeof(uint8_t) * size));
- if (newMemory == NULL)
- {
- return false;
- }
-
- if (mData)
- {
- // Copy the intersection of the old data and the new data
- std::copy(mData, mData + std::min(mSize, size), newMemory);
- free(mData);
- }
-
- mData = newMemory;
- mSize = size;
+ // Copy the intersection of the old data and the new data
+ std::copy(mData, mData + std::min(mSize, size), newMemory);
+ free(mData);
}
+ mData = newMemory;
+ mSize = size;
+
return true;
}
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/MemoryBuffer.h b/src/3rdparty/angle/src/common/MemoryBuffer.h
index c65f79fe10..ec621cbca7 100644
--- a/src/3rdparty/angle/src/libGLESv2/renderer/d3d/MemoryBuffer.h
+++ b/src/3rdparty/angle/src/common/MemoryBuffer.h
@@ -4,16 +4,18 @@
// found in the LICENSE file.
//
-#ifndef LIBGLESV2_RENDERER_D3D_MEMORYBUFFER_H_
-#define LIBGLESV2_RENDERER_D3D_MEMORYBUFFER_H_
+#ifndef COMMON_MEMORYBUFFER_H_
+#define COMMON_MEMORYBUFFER_H_
+
+#include "common/angleutils.h"
#include <cstddef>
-#include <cstdint>
+#include <stdint.h>
namespace rx
{
-class MemoryBuffer
+class MemoryBuffer : angle::NonCopyable
{
public:
MemoryBuffer();
@@ -33,4 +35,4 @@ class MemoryBuffer
}
-#endif // LIBGLESV2_RENDERER_D3D_MEMORYBUFFER_H
+#endif // COMMON_MEMORYBUFFER_H_
diff --git a/src/3rdparty/angle/src/common/Optional.h b/src/3rdparty/angle/src/common/Optional.h
new file mode 100644
index 0000000000..9665b7ddf6
--- /dev/null
+++ b/src/3rdparty/angle/src/common/Optional.h
@@ -0,0 +1,61 @@
+//
+// Copyright (c) 2015 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.
+//
+// Optional.h:
+// Represents a type that may be invalid, similar to std::optional.
+//
+
+#ifndef COMMON_OPTIONAL_H_
+#define COMMON_OPTIONAL_H_
+
+template <class T>
+struct Optional
+{
+ Optional()
+ : mValid(false),
+ mValue(T())
+ {}
+
+ explicit Optional(const T &valueIn)
+ : mValid(true),
+ mValue(valueIn)
+ {}
+
+ Optional(const Optional &other)
+ : mValid(other.mValid),
+ mValue(other.mValue)
+ {}
+
+ Optional &operator=(const Optional &other)
+ {
+ this->mValid = other.mValid;
+ this->mValue = other.mValue;
+ return *this;
+ }
+
+ static Optional None()
+ {
+ return Optional();
+ }
+
+ bool valid() const { return mValid; }
+ const T &value() const { return mValue; }
+
+ bool operator==(const Optional &other) const
+ {
+ return ((mValid == other.mValid) && (!mValid || (mValue == other.mValue)));
+ }
+
+ bool operator!=(const Optional &other) const
+ {
+ return !(*this == other);
+ }
+
+ private:
+ bool mValid;
+ T mValue;
+};
+
+#endif // COMMON_OPTIONAL_H_
diff --git a/src/3rdparty/angle/src/common/RefCountObject.h b/src/3rdparty/angle/src/common/RefCountObject.h
deleted file mode 100644
index 6eeaee1928..0000000000
--- a/src/3rdparty/angle/src/common/RefCountObject.h
+++ /dev/null
@@ -1,95 +0,0 @@
-//
-// Copyright (c) 2002-2010 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-
-// RefCountObject.h: Defines the gl::RefCountObject base class that provides
-// lifecycle support for GL objects using the traditional BindObject scheme, but
-// that need to be reference counted for correct cross-context deletion.
-// (Concretely, textures, buffers and renderbuffers.)
-
-#ifndef COMMON_REFCOUNTOBJECT_H_
-#define COMMON_REFCOUNTOBJECT_H_
-
-#include "common/debug.h"
-
-#include "angle_gl.h"
-
-#include <cstddef>
-
-class RefCountObject
-{
- public:
- explicit RefCountObject(GLuint id);
- virtual ~RefCountObject();
-
- virtual void addRef() const;
- virtual void release() const;
-
- GLuint id() const { return mId; }
-
- private:
- GLuint mId;
-
- mutable std::size_t mRefCount;
-};
-
-class RefCountObjectBindingPointer
-{
- protected:
- RefCountObjectBindingPointer() : mObject(NULL) { }
- ~RefCountObjectBindingPointer() { ASSERT(mObject == NULL); } // Objects have to be released before the resource manager is destroyed, so they must be explicitly cleaned up.
-
- void set(RefCountObject *newObject);
- RefCountObject *get() const { return mObject; }
-
- public:
- GLuint id() const { return (mObject != NULL) ? mObject->id() : 0; }
- bool operator!() const { return (get() == NULL); }
-
- private:
- RefCountObject *mObject;
-};
-
-template <class ObjectType>
-class BindingPointer : public RefCountObjectBindingPointer
-{
- public:
- void set(ObjectType *newObject) { RefCountObjectBindingPointer::set(newObject); }
- ObjectType *get() const { return static_cast<ObjectType*>(RefCountObjectBindingPointer::get()); }
- ObjectType *operator->() const { return get(); }
-};
-
-template <class ObjectType>
-class OffsetBindingPointer : public RefCountObjectBindingPointer
-{
- public:
- OffsetBindingPointer() : mOffset(0), mSize(0) { }
-
- void set(ObjectType *newObject)
- {
- RefCountObjectBindingPointer::set(newObject);
- mOffset = 0;
- mSize = 0;
- }
-
- void set(ObjectType *newObject, GLintptr offset, GLsizeiptr size)
- {
- RefCountObjectBindingPointer::set(newObject);
- mOffset = offset;
- mSize = size;
- }
-
- GLintptr getOffset() const { return mOffset; }
- GLsizeiptr getSize() const { return mSize; }
-
- ObjectType *get() const { return static_cast<ObjectType*>(RefCountObjectBindingPointer::get()); }
- ObjectType *operator->() const { return get(); }
-
- private:
- GLintptr mOffset;
- GLsizeiptr mSize;
-};
-
-#endif // COMMON_REFCOUNTOBJECT_H_
diff --git a/src/3rdparty/angle/src/common/angleutils.cpp b/src/3rdparty/angle/src/common/angleutils.cpp
index c1367c460a..af5eb6c447 100644
--- a/src/3rdparty/angle/src/common/angleutils.cpp
+++ b/src/3rdparty/angle/src/common/angleutils.cpp
@@ -5,7 +5,8 @@
//
#include "common/angleutils.h"
-#include "debug.h"
+#include "common/debug.h"
+
#include <stdio.h>
#include <vector>
diff --git a/src/3rdparty/angle/src/common/angleutils.h b/src/3rdparty/angle/src/common/angleutils.h
index b343ece5bc..4cf84a3182 100644
--- a/src/3rdparty/angle/src/common/angleutils.h
+++ b/src/3rdparty/angle/src/common/angleutils.h
@@ -11,19 +11,31 @@
#include "common/platform.h"
-#include <stddef.h>
-#include <limits.h>
+#include <climits>
+#include <cstdarg>
+#include <cstddef>
#include <string>
#include <set>
#include <sstream>
-#include <cstdarg>
#include <vector>
-// A macro to disallow the copy constructor and operator= functions
-// This must be used in the private: declarations for a class
-#define DISALLOW_COPY_AND_ASSIGN(TypeName) \
- TypeName(const TypeName&); \
- void operator=(const TypeName&)
+// A helper class to disallow copy and assignment operators
+namespace angle
+{
+
+class NonCopyable
+{
+#if !defined(_MSC_VER) || (_MSC_VER >= 1800)
+ public:
+ NonCopyable() = default;
+ ~NonCopyable() = default;
+ protected:
+ NonCopyable(const NonCopyable&) = delete;
+ void operator=(const NonCopyable&) = delete;
+#endif
+};
+
+}
template <typename T, size_t N>
inline size_t ArraySize(T(&)[N])
@@ -150,13 +162,12 @@ std::string FormatString(const char *fmt, ...);
#define snprintf _snprintf
#endif
-#define VENDOR_ID_AMD 0x1002
-#define VENDOR_ID_INTEL 0x8086
-#define VENDOR_ID_NVIDIA 0x10DE
-
#define GL_BGRA4_ANGLEX 0x6ABC
#define GL_BGR5_A1_ANGLEX 0x6ABD
#define GL_INT_64_ANGLEX 0x6ABE
#define GL_STRUCT_ANGLEX 0x6ABF
+// Hidden enum for the NULL D3D device type.
+#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x6AC0
+
#endif // COMMON_ANGLEUTILS_H_
diff --git a/src/3rdparty/angle/src/common/debug.cpp b/src/3rdparty/angle/src/common/debug.cpp
index 5f55ff1e39..2fc0a2984a 100644
--- a/src/3rdparty/angle/src/common/debug.cpp
+++ b/src/3rdparty/angle/src/common/debug.cpp
@@ -17,172 +17,9 @@
namespace gl
{
-#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
-// Wraps the D3D9/D3D11 debug annotation functions.
-class DebugAnnotationWrapper
-{
- public:
- DebugAnnotationWrapper() { };
- virtual ~DebugAnnotationWrapper() { };
- virtual void beginEvent(const std::wstring &eventName) = 0;
- virtual void endEvent() = 0;
- virtual void setMarker(const std::wstring &markerName) = 0;
- virtual bool getStatus() = 0;
-};
-#if defined(ANGLE_ENABLE_D3D9)
-class D3D9DebugAnnotationWrapper : public DebugAnnotationWrapper
+namespace
{
- public:
- void beginEvent(const std::wstring &eventName)
- {
- D3DPERF_BeginEvent(0, eventName.c_str());
- }
-
- void endEvent()
- {
- D3DPERF_EndEvent();
- }
-
- void setMarker(const std::wstring &markerName)
- {
- D3DPERF_SetMarker(0, markerName.c_str());
- }
-
- bool getStatus()
- {
- return !!D3DPERF_GetStatus();
- }
-};
-#endif // ANGLE_ENABLE_D3D9
-
-#if defined(ANGLE_ENABLE_D3D11)
-class D3D11DebugAnnotationWrapper : public DebugAnnotationWrapper
-{
- public:
-
- D3D11DebugAnnotationWrapper()
- : mInitialized(false),
- mD3d11Module(NULL),
- mUserDefinedAnnotation(NULL)
- {
- // D3D11 devices can't be created during DllMain.
- // We defer device creation until the object is actually used.
- }
-
- ~D3D11DebugAnnotationWrapper()
- {
- if (mInitialized)
- {
- SafeRelease(mUserDefinedAnnotation);
- FreeLibrary(mD3d11Module);
- }
- }
-
- virtual void beginEvent(const std::wstring &eventName)
- {
- initializeDevice();
-
- mUserDefinedAnnotation->BeginEvent(eventName.c_str());
- }
-
- virtual void endEvent()
- {
- initializeDevice();
-
- mUserDefinedAnnotation->EndEvent();
- }
-
- virtual void setMarker(const std::wstring &markerName)
- {
- initializeDevice();
-
- mUserDefinedAnnotation->SetMarker(markerName.c_str());
- }
-
- virtual bool getStatus()
- {
- // ID3DUserDefinedAnnotation::GetStatus doesn't work with the Graphics Diagnostics tools in Visual Studio 2013.
-
-#if defined(_DEBUG) && defined(ANGLE_ENABLE_WINDOWS_STORE)
- // In the Windows Store, we can use IDXGraphicsAnalysis. The call to GetDebugInterface1 only succeeds if the app is under capture.
- // This should only be called in DEBUG mode.
- // If an app links against DXGIGetDebugInterface1 in release mode then it will fail Windows Store ingestion checks.
- IDXGraphicsAnalysis* graphicsAnalysis;
- DXGIGetDebugInterface1(0, IID_PPV_ARGS(&graphicsAnalysis));
- bool underCapture = (graphicsAnalysis != NULL);
- SafeRelease(graphicsAnalysis);
- return underCapture;
-#endif
-
- // Otherwise, we have to return true here.
- return true;
- }
-
- protected:
-
- void initializeDevice()
- {
- if (!mInitialized)
- {
-#if !defined(ANGLE_ENABLE_WINDOWS_STORE)
- mD3d11Module = LoadLibrary(TEXT("d3d11.dll"));
- ASSERT(mD3d11Module);
-
- PFN_D3D11_CREATE_DEVICE D3D11CreateDevice = (PFN_D3D11_CREATE_DEVICE)GetProcAddress(mD3d11Module, "D3D11CreateDevice");
- ASSERT(D3D11CreateDevice != NULL);
-#endif // !ANGLE_ENABLE_WINDOWS_STORE
-
- ID3D11Device* device = NULL;
- ID3D11DeviceContext* context = NULL;
-
- HRESULT hr = E_FAIL;
-
- // Create a D3D_DRIVER_TYPE_NULL device, which is much cheaper than other types of device.
- hr = D3D11CreateDevice(NULL, D3D_DRIVER_TYPE_NULL, NULL, 0, NULL, 0, D3D11_SDK_VERSION, &device, NULL, &context);
- ASSERT(SUCCEEDED(hr));
-
- hr = context->QueryInterface(__uuidof(mUserDefinedAnnotation), reinterpret_cast<void**>(&mUserDefinedAnnotation));
- ASSERT(SUCCEEDED(hr) && mUserDefinedAnnotation != NULL);
-
- SafeRelease(device);
- SafeRelease(context);
-
- mInitialized = true;
- }
- }
-
- bool mInitialized;
- HMODULE mD3d11Module;
- ID3DUserDefinedAnnotation* mUserDefinedAnnotation;
-};
-#endif // ANGLE_ENABLE_D3D11
-
-static DebugAnnotationWrapper* g_DebugAnnotationWrapper = NULL;
-
-void InitializeDebugAnnotations()
-{
-#if defined(ANGLE_ENABLE_D3D9)
- g_DebugAnnotationWrapper = new D3D9DebugAnnotationWrapper();
-#elif defined(ANGLE_ENABLE_D3D11)
- // If the project uses D3D9 then we can use the D3D9 debug annotations, even with the D3D11 renderer.
- // However, if D3D9 is unavailable (e.g. in Windows Store), then we use D3D11 debug annotations.
- // The D3D11 debug annotations are methods on ID3DUserDefinedAnnotation, which is implemented by the DeviceContext.
- // This doesn't have to be the same DeviceContext that the renderer uses, though.
- g_DebugAnnotationWrapper = new D3D11DebugAnnotationWrapper();
-#endif
-}
-
-void UninitializeDebugAnnotations()
-{
- if (g_DebugAnnotationWrapper != NULL)
- {
- SafeDelete(g_DebugAnnotationWrapper);
- }
-}
-
-#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
-
enum DebugTraceOutputType
{
DebugTraceOutputTypeNone,
@@ -190,29 +27,44 @@ enum DebugTraceOutputType
DebugTraceOutputTypeBeginEvent
};
-static void output(bool traceInDebugOnly, DebugTraceOutputType outputType, const char *format, va_list vararg)
-{
-#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
- static std::vector<char> buffer(512);
+DebugAnnotator *g_debugAnnotator = nullptr;
- if (perfActive())
+void output(bool traceInDebugOnly, MessageType messageType, DebugTraceOutputType outputType,
+ const char *format, va_list vararg)
+{
+ if (DebugAnnotationsActive())
{
+ static std::vector<char> buffer(512);
size_t len = FormatStringIntoVector(format, vararg, buffer);
std::wstring formattedWideMessage(buffer.begin(), buffer.begin() + len);
+ ASSERT(g_debugAnnotator != nullptr);
switch (outputType)
{
- case DebugTraceOutputTypeNone:
- break;
- case DebugTraceOutputTypeBeginEvent:
- g_DebugAnnotationWrapper->beginEvent(formattedWideMessage);
- break;
- case DebugTraceOutputTypeSetMarker:
- g_DebugAnnotationWrapper->setMarker(formattedWideMessage);
- break;
+ case DebugTraceOutputTypeNone:
+ break;
+ case DebugTraceOutputTypeBeginEvent:
+ g_debugAnnotator->beginEvent(formattedWideMessage);
+ break;
+ case DebugTraceOutputTypeSetMarker:
+ g_debugAnnotator->setMarker(formattedWideMessage);
+ break;
}
}
-#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
+
+ std::string formattedMessage;
+ UNUSED_TRACE_VARIABLE(formattedMessage);
+
+#if !defined(NDEBUG) && defined(_MSC_VER)
+ if (messageType == MESSAGE_ERR)
+ {
+ if (formattedMessage.empty())
+ {
+ formattedMessage = FormatString(format, vararg);
+ }
+ OutputDebugStringA(formattedMessage.c_str());
+ }
+#endif
#if defined(ANGLE_ENABLE_DEBUG_TRACE)
#if defined(NDEBUG)
@@ -221,7 +73,10 @@ static void output(bool traceInDebugOnly, DebugTraceOutputType outputType, const
return;
}
#endif // NDEBUG
- std::string formattedMessage = FormatString(format, vararg);
+ if (formattedMessage.empty())
+ {
+ formattedMessage = FormatString(format, vararg);
+ }
static std::ofstream file(TRACE_OUTPUT_FILE, std::ofstream::app);
if (file)
@@ -237,53 +92,57 @@ static void output(bool traceInDebugOnly, DebugTraceOutputType outputType, const
#endif // ANGLE_ENABLE_DEBUG_TRACE
}
-void trace(bool traceInDebugOnly, const char *format, ...)
+} // namespace
+
+bool DebugAnnotationsActive()
{
- va_list vararg;
- va_start(vararg, format);
#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
- output(traceInDebugOnly, DebugTraceOutputTypeSetMarker, format, vararg);
+ return g_debugAnnotator != nullptr && g_debugAnnotator->getStatus();
#else
- output(traceInDebugOnly, DebugTraceOutputTypeNone, format, vararg);
+ return false;
#endif
- va_end(vararg);
}
-bool perfActive()
+void InitializeDebugAnnotations(DebugAnnotator *debugAnnotator)
{
-#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
- static bool active = g_DebugAnnotationWrapper->getStatus();
- return active;
-#else
- return false;
-#endif
+ UninitializeDebugAnnotations();
+ g_debugAnnotator = debugAnnotator;
+}
+
+void UninitializeDebugAnnotations()
+{
+ // Pointer is not managed.
+ g_debugAnnotator = nullptr;
+}
+
+void trace(bool traceInDebugOnly, MessageType messageType, const char *format, ...)
+{
+ va_list vararg;
+ va_start(vararg, format);
+ output(traceInDebugOnly, messageType, DebugTraceOutputTypeSetMarker, format, vararg);
+ va_end(vararg);
}
ScopedPerfEventHelper::ScopedPerfEventHelper(const char* format, ...)
{
#if !defined(ANGLE_ENABLE_DEBUG_TRACE)
- if (!perfActive())
+ if (!DebugAnnotationsActive())
{
return;
}
#endif // !ANGLE_ENABLE_DEBUG_TRACE
va_list vararg;
va_start(vararg, format);
-#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
- output(true, DebugTraceOutputTypeBeginEvent, format, vararg);
-#else
- output(true, DebugTraceOutputTypeNone, format, vararg);
-#endif // ANGLE_ENABLE_DEBUG_ANNOTATIONS
+ output(true, MESSAGE_EVENT, DebugTraceOutputTypeBeginEvent, format, vararg);
va_end(vararg);
}
ScopedPerfEventHelper::~ScopedPerfEventHelper()
{
-#if defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
- if (perfActive())
+ if (DebugAnnotationsActive())
{
- g_DebugAnnotationWrapper->endEvent();
+ g_debugAnnotator->endEvent();
}
-#endif
}
+
}
diff --git a/src/3rdparty/angle/src/common/debug.h b/src/3rdparty/angle/src/common/debug.h
index c177f51314..c4f118ebae 100644
--- a/src/3rdparty/angle/src/common/debug.h
+++ b/src/3rdparty/angle/src/common/debug.h
@@ -9,8 +9,9 @@
#ifndef COMMON_DEBUG_H_
#define COMMON_DEBUG_H_
-#include <stdio.h>
#include <assert.h>
+#include <stdio.h>
+#include <string>
#include "common/angleutils.h"
@@ -20,50 +21,71 @@
namespace gl
{
- // Outputs text to the debugging log, or the debugging window
- void trace(bool traceInDebugOnly, const char *format, ...);
- // Returns whether D3DPERF is active.
- bool perfActive();
+enum MessageType
+{
+ MESSAGE_TRACE,
+ MESSAGE_FIXME,
+ MESSAGE_ERR,
+ MESSAGE_EVENT,
+};
- // Pairs a D3D begin event with an end event.
- class ScopedPerfEventHelper
- {
- public:
- ScopedPerfEventHelper(const char* format, ...);
- ~ScopedPerfEventHelper();
+// Outputs text to the debugging log, or the debugging window
+void trace(bool traceInDebugOnly, MessageType messageType, const char *format, ...);
- private:
- DISALLOW_COPY_AND_ASSIGN(ScopedPerfEventHelper);
- };
+// Pairs a D3D begin event with an end event.
+class ScopedPerfEventHelper : angle::NonCopyable
+{
+ public:
+ ScopedPerfEventHelper(const char* format, ...);
+ ~ScopedPerfEventHelper();
+};
+
+// Wraps the D3D9/D3D11 debug annotation functions.
+class DebugAnnotator : angle::NonCopyable
+{
+ public:
+ DebugAnnotator() { };
+ virtual ~DebugAnnotator() { };
+ virtual void beginEvent(const std::wstring &eventName) = 0;
+ virtual void endEvent() = 0;
+ virtual void setMarker(const std::wstring &markerName) = 0;
+ virtual bool getStatus() = 0;
+};
+
+void InitializeDebugAnnotations(DebugAnnotator *debugAnnotator);
+void UninitializeDebugAnnotations();
+bool DebugAnnotationsActive();
- void InitializeDebugAnnotations();
- void UninitializeDebugAnnotations();
}
-// A macro to output a trace of a function call and its arguments to the debugging log
#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
-#define TRACE(message, ...) gl::trace(true, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#define ANGLE_TRACE_ENABLED
+#endif
+
+// A macro to output a trace of a function call and its arguments to the debugging log
+#if defined(ANGLE_TRACE_ENABLED)
+#define TRACE(message, ...) gl::trace(true, gl::MESSAGE_TRACE, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define TRACE(message, ...) (void(0))
#endif
// A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing.
-#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
-#define FIXME(message, ...) gl::trace(false, "fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#if defined(ANGLE_TRACE_ENABLED)
+#define FIXME(message, ...) gl::trace(false, gl::MESSAGE_FIXME, "fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define FIXME(message, ...) (void(0))
#endif
// A macro to output a function call and its arguments to the debugging log, in case of error.
-#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
-#define ERR(message, ...) gl::trace(false, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
+#if defined(ANGLE_TRACE_ENABLED)
+#define ERR(message, ...) gl::trace(false, gl::MESSAGE_ERR, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__)
#else
#define ERR(message, ...) (void(0))
#endif
// A macro to log a performance event around a scope.
-#if defined(ANGLE_ENABLE_DEBUG_TRACE) || defined(ANGLE_ENABLE_DEBUG_ANNOTATIONS)
+#if defined(ANGLE_TRACE_ENABLED)
#if defined(_MSC_VER)
#define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper ## __LINE__("%s" message "\n", __FUNCTION__, __VA_ARGS__);
#else
@@ -73,6 +95,10 @@ namespace gl
#define EVENT(message, ...) (void(0))
#endif
+#if defined(ANGLE_TRACE_ENABLED)
+#undef ANGLE_TRACE_ENABLED
+#endif
+
// A macro asserting a condition and outputting failures to the debug log
#if !defined(NDEBUG)
#define ASSERT(expression) do { \
@@ -130,14 +156,4 @@ namespace gl
#define HAS_DYNAMIC_TYPE(type, obj) true
#endif
-// A macro functioning as a compile-time assert to validate constant conditions
-#if (defined(_MSC_VER) && _MSC_VER >= 1600) || (defined(__GNUC__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3))
-#define META_ASSERT_MSG(condition, msg) static_assert(condition, msg)
-#else
-#define META_ASSERT_CONCAT(a, b) a ## b
-#define META_ASSERT_CONCAT2(a, b) META_ASSERT_CONCAT(a, b)
-#define META_ASSERT_MSG(condition, msg) typedef int META_ASSERT_CONCAT2(COMPILE_TIME_ASSERT_, __LINE__)[static_cast<bool>(condition)?1:-1]
-#endif
-#define META_ASSERT(condition) META_ASSERT_MSG(condition, "compile time assertion failed.")
-
#endif // COMMON_DEBUG_H_
diff --git a/src/3rdparty/angle/src/common/event_tracer.cpp b/src/3rdparty/angle/src/common/event_tracer.cpp
new file mode 100644
index 0000000000..eb0c98c9e5
--- /dev/null
+++ b/src/3rdparty/angle/src/common/event_tracer.cpp
@@ -0,0 +1,38 @@
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "common/event_tracer.h"
+
+namespace gl
+{
+
+GetCategoryEnabledFlagFunc g_getCategoryEnabledFlag;
+AddTraceEventFunc g_addTraceEvent;
+
+} // namespace gl
+
+namespace gl
+{
+
+const unsigned char* TraceGetTraceCategoryEnabledFlag(const char* name)
+{
+ if (g_getCategoryEnabledFlag)
+ {
+ return g_getCategoryEnabledFlag(name);
+ }
+ static unsigned char disabled = 0;
+ return &disabled;
+}
+
+void TraceAddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id,
+ int numArgs, const char** argNames, const unsigned char* argTypes,
+ const unsigned long long* argValues, unsigned char flags)
+{
+ if (g_addTraceEvent)
+ {
+ g_addTraceEvent(phase, categoryGroupEnabled, name, id, numArgs, argNames, argTypes, argValues, flags);
+ }
+}
+
+} // namespace gl
diff --git a/src/3rdparty/angle/src/common/event_tracer.h b/src/3rdparty/angle/src/common/event_tracer.h
new file mode 100644
index 0000000000..dbe4c1bef9
--- /dev/null
+++ b/src/3rdparty/angle/src/common/event_tracer.h
@@ -0,0 +1,34 @@
+// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMMON_EVENT_TRACER_H_
+#define COMMON_EVENT_TRACER_H_
+
+#include "common/platform.h"
+
+extern "C" {
+
+typedef const unsigned char* (*GetCategoryEnabledFlagFunc)(const char* name);
+typedef void (*AddTraceEventFunc)(char phase, const unsigned char* categoryGroupEnabled, const char* name,
+ unsigned long long id, int numArgs, const char** argNames,
+ const unsigned char* argTypes, const unsigned long long* argValues,
+ unsigned char flags);
+
+}
+
+namespace gl
+{
+
+extern GetCategoryEnabledFlagFunc g_getCategoryEnabledFlag;
+extern AddTraceEventFunc g_addTraceEvent;
+
+const unsigned char* TraceGetTraceCategoryEnabledFlag(const char* name);
+
+void TraceAddTraceEvent(char phase, const unsigned char* categoryGroupEnabled, const char* name, unsigned long long id,
+ int numArgs, const char** argNames, const unsigned char* argTypes,
+ const unsigned long long* argValues, unsigned char flags);
+
+}
+
+#endif // COMMON_EVENT_TRACER_H_
diff --git a/src/3rdparty/angle/src/common/mathutil.h b/src/3rdparty/angle/src/common/mathutil.h
index a1717892fd..1015bd2312 100644
--- a/src/3rdparty/angle/src/common/mathutil.h
+++ b/src/3rdparty/angle/src/common/mathutil.h
@@ -6,8 +6,8 @@
// mathutil.h: Math and bit manipulation functions.
-#ifndef LIBGLESV2_MATHUTIL_H_
-#define LIBGLESV2_MATHUTIL_H_
+#ifndef COMMON_MATHUTIL_H_
+#define COMMON_MATHUTIL_H_
#include "common/debug.h"
#include "common/platform.h"
@@ -15,6 +15,7 @@
#include <limits>
#include <algorithm>
#include <string.h>
+#include <stdlib.h>
namespace gl
{
@@ -118,6 +119,9 @@ inline bool supportsSSE2()
return supports;
}
+#if defined(__GNUC__)
+ supports = __builtin_cpu_supports("sse2");
+#else
int info[4];
__cpuid(info, 0);
@@ -127,6 +131,7 @@ inline bool supportsSSE2()
supports = (info[3] >> 26) & 1;
}
+#endif
checked = true;
@@ -353,7 +358,7 @@ inline float float11ToFloat32(unsigned short fp11)
}
else // The value is zero
{
- exponent = -112;
+ exponent = static_cast<unsigned short>(-112);
}
return bitCast<float>(((exponent + 112) << 23) | (mantissa << 17));
@@ -392,7 +397,7 @@ inline float float10ToFloat32(unsigned short fp11)
}
else // The value is zero
{
- exponent = -112;
+ exponent = static_cast<unsigned short>(-112);
}
return bitCast<float>(((exponent + 112) << 23) | (mantissa << 18));
@@ -402,7 +407,7 @@ inline float float10ToFloat32(unsigned short fp11)
template <typename T>
inline float normalizedToFloat(T input)
{
- META_ASSERT(std::numeric_limits<T>::is_integer);
+ static_assert(std::numeric_limits<T>::is_integer, "T must be an integer.");
const float inverseMax = 1.0f / std::numeric_limits<T>::max();
return input * inverseMax;
@@ -411,8 +416,8 @@ inline float normalizedToFloat(T input)
template <unsigned int inputBitCount, typename T>
inline float normalizedToFloat(T input)
{
- META_ASSERT(std::numeric_limits<T>::is_integer);
- META_ASSERT(inputBitCount < (sizeof(T) * 8));
+ static_assert(std::numeric_limits<T>::is_integer, "T must be an integer.");
+ static_assert(inputBitCount < (sizeof(T) * 8), "T must have more bits than inputBitCount.");
const float inverseMax = 1.0f / ((1 << inputBitCount) - 1);
return input * inverseMax;
@@ -427,14 +432,15 @@ inline T floatToNormalized(float input)
template <unsigned int outputBitCount, typename T>
inline T floatToNormalized(float input)
{
- META_ASSERT(outputBitCount < (sizeof(T) * 8));
+ static_assert(outputBitCount < (sizeof(T) * 8), "T must have more bits than outputBitCount.");
return ((1 << outputBitCount) - 1) * input + 0.5f;
}
template <unsigned int inputBitCount, unsigned int inputBitStart, typename T>
inline T getShiftedData(T input)
{
- META_ASSERT(inputBitCount + inputBitStart <= (sizeof(T) * 8));
+ static_assert(inputBitCount + inputBitStart <= (sizeof(T) * 8),
+ "T must have at least as many bits as inputBitCount + inputBitStart.");
const T mask = (1 << inputBitCount) - 1;
return (input >> inputBitStart) & mask;
}
@@ -442,7 +448,8 @@ inline T getShiftedData(T input)
template <unsigned int inputBitCount, unsigned int inputBitStart, typename T>
inline T shiftData(T input)
{
- META_ASSERT(inputBitCount + inputBitStart <= (sizeof(T) * 8));
+ static_assert(inputBitCount + inputBitStart <= (sizeof(T) * 8),
+ "T must have at least as many bits as inputBitCount + inputBitStart.");
const T mask = (1 << inputBitCount) - 1;
return (input & mask) << inputBitStart;
}
@@ -503,6 +510,7 @@ inline unsigned int averageFloat10(unsigned int a, unsigned int b)
namespace rx
{
+// Represents intervals of the type [a, b)
template <typename T>
struct Range
{
@@ -513,6 +521,18 @@ struct Range
T end;
T length() const { return end - start; }
+
+ bool intersects(Range<T> other)
+ {
+ if (start <= other.start)
+ {
+ return other.start < end;
+ }
+ else
+ {
+ return start < other.end;
+ }
+ }
};
typedef Range<int> RangeI;
@@ -533,14 +553,14 @@ inline unsigned int UnsignedCeilDivide(unsigned int value, unsigned int divisor)
template <class T>
inline bool IsUnsignedAdditionSafe(T lhs, T rhs)
{
- META_ASSERT(!std::numeric_limits<T>::is_signed);
+ static_assert(!std::numeric_limits<T>::is_signed, "T must be unsigned.");
return (rhs <= std::numeric_limits<T>::max() - lhs);
}
template <class T>
inline bool IsUnsignedMultiplicationSafe(T lhs, T rhs)
{
- META_ASSERT(!std::numeric_limits<T>::is_signed);
+ static_assert(!std::numeric_limits<T>::is_signed, "T must be unsigned.");
return (lhs == T(0) || rhs == T(0) || (rhs <= std::numeric_limits<T>::max() / lhs));
}
@@ -550,6 +570,21 @@ inline bool IsIntegerCastSafe(BigIntT bigValue)
return (static_cast<BigIntT>(static_cast<SmallIntT>(bigValue)) == bigValue);
}
+#if defined(_MSC_VER)
+
+#define ANGLE_ROTL(x,y) _rotl(x,y)
+
+#else
+
+inline uint32_t RotL(uint32_t x, int8_t r)
+{
+ return (x << r) | (x >> (32 - r));
+}
+
+#define ANGLE_ROTL(x,y) RotL(x,y)
+
+#endif // namespace rx
+
}
-#endif // LIBGLESV2_MATHUTIL_H_
+#endif // COMMON_MATHUTIL_H_
diff --git a/src/3rdparty/angle/src/common/platform.h b/src/3rdparty/angle/src/common/platform.h
index 5bf97f9184..3a2aa91bed 100644
--- a/src/3rdparty/angle/src/common/platform.h
+++ b/src/3rdparty/angle/src/common/platform.h
@@ -14,12 +14,12 @@
#elif defined(__APPLE__)
# define ANGLE_PLATFORM_APPLE 1
# define ANGLE_PLATFORM_POSIX 1
-#elif defined(__linux__)
-# define ANGLE_PLATFORM_LINUX 1
-# define ANGLE_PLATFORM_POSIX 1
#elif defined(ANDROID)
# define ANGLE_PLATFORM_ANDROID 1
# define ANGLE_PLATFORM_POSIX 1
+#elif defined(__linux__) || defined(EMSCRIPTEN)
+# define ANGLE_PLATFORM_LINUX 1
+# define ANGLE_PLATFORM_POSIX 1
#elif defined(__FreeBSD__) || \
defined(__OpenBSD__) || \
defined(__NetBSD__) || \
@@ -34,9 +34,6 @@
#endif
#ifdef ANGLE_PLATFORM_WINDOWS
-# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_PC_APP || WINAPI_FAMILY == WINAPI_FAMILY_PHONE_APP)
-# define ANGLE_ENABLE_WINDOWS_STORE 1
-# endif
# ifndef STRICT
# define STRICT 1
# endif
@@ -50,24 +47,32 @@
# include <windows.h>
# include <intrin.h>
+# if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP)
+# define ANGLE_ENABLE_WINDOWS_STORE 1
+# endif
+
# if defined(ANGLE_ENABLE_D3D9)
# include <d3d9.h>
-# include <dxgi.h>
-# if !defined(COMPILER_IMPLEMENTATION)
+# if !defined(ANGLE_TRANSLATOR_IMPLEMENTATION)
# include <d3dcompiler.h>
# endif
# endif
# if defined(ANGLE_ENABLE_D3D11)
# include <d3d10_1.h>
-# include <d3d10.h>
# include <d3d11.h>
# include <dxgi.h>
-# if defined(_MSC_VER) && (_MSC_VER >= 1700)
+# if defined(__MINGW32__) && !defined(__d3d11sdklayers_h__)
+# define ANGLE_MINGW32_COMPAT
+# endif
+# if defined(_MSC_VER) && _MSC_VER >= 1800
+# define ANGLE_ENABLE_D3D11_1
+# endif
+# if defined(ANGLE_ENABLE_D3D11_1)
# include <d3d11_1.h>
# include <dxgi1_2.h>
# endif
-# if !defined(COMPILER_IMPLEMENTATION)
+# if !defined(ANGLE_TRANSLATOR_IMPLEMENTATION)
# include <d3dcompiler.h>
# endif
# endif
@@ -75,88 +80,24 @@
# if defined(ANGLE_ENABLE_WINDOWS_STORE)
# include <dxgi1_3.h>
# if defined(_DEBUG)
-# if (WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP)
+# if WINAPI_FAMILY != WINAPI_FAMILY_PHONE_APP
# include <DXProgrammableCapture.h>
# endif
# include <dxgidebug.h>
# endif
# endif
-# if defined(__MINGW32__) // Missing defines on MinGW
-typedef enum D3D11_MAP_FLAG
-{
- D3D11_MAP_FLAG_DO_NOT_WAIT = 0x100000L
-} D3D11_MAP_FLAG;
-typedef struct D3D11_QUERY_DATA_SO_STATISTICS
-{
- UINT64 NumPrimitivesWritten;
- UINT64 PrimitivesStorageNeeded;
-} D3D11_QUERY_DATA_SO_STATISTICS;
-typedef HRESULT (WINAPI *PFN_D3D11_CREATE_DEVICE)(
- IDXGIAdapter *, D3D_DRIVER_TYPE, HMODULE, UINT, CONST D3D_FEATURE_LEVEL *,
- UINT FeatureLevels, UINT, ID3D11Device **, D3D_FEATURE_LEVEL *, ID3D11DeviceContext **);
-#define D3D11_MESSAGE_CATEGORY UINT
-#define D3D11_MESSAGE_SEVERITY UINT
-#define D3D11_MESSAGE_ID UINT
-struct D3D11_MESSAGE;
-typedef struct D3D11_INFO_QUEUE_FILTER_DESC
-{
- UINT NumCategories;
- D3D11_MESSAGE_CATEGORY *pCategoryList;
- UINT NumSeverities;
- D3D11_MESSAGE_SEVERITY *pSeverityList;
- UINT NumIDs;
- D3D11_MESSAGE_ID *pIDList;
-} D3D11_INFO_QUEUE_FILTER_DESC;
-typedef struct D3D11_INFO_QUEUE_FILTER
-{
- D3D11_INFO_QUEUE_FILTER_DESC AllowList;
- D3D11_INFO_QUEUE_FILTER_DESC DenyList;
-} D3D11_INFO_QUEUE_FILTER;
-static const IID IID_ID3D11InfoQueue = { 0x6543dbb6, 0x1b48, 0x42f5, 0xab, 0x82, 0xe9, 0x7e, 0xc7, 0x43, 0x26, 0xf6 };
-MIDL_INTERFACE("6543dbb6-1b48-42f5-ab82-e97ec74326f6") ID3D11InfoQueue : public IUnknown
-{
-public:
- virtual HRESULT __stdcall SetMessageCountLimit(UINT64) = 0;
- virtual void __stdcall ClearStoredMessages() = 0;
- virtual HRESULT __stdcall GetMessage(UINT64, D3D11_MESSAGE *, SIZE_T *) = 0;
- virtual UINT64 __stdcall GetNumMessagesAllowedByStorageFilter() = 0;
- virtual UINT64 __stdcall GetNumMessagesDeniedByStorageFilter() = 0;
- virtual UINT64 __stdcall GetNumStoredMessages() = 0;
- virtual UINT64 __stdcall GetNumStoredMessagesAllowedByRetrievalFilter() = 0;
- virtual UINT64 __stdcall GetNumMessagesDiscardedByMessageCountLimit() = 0;
- virtual UINT64 __stdcall GetMessageCountLimit() = 0;
- virtual HRESULT __stdcall AddStorageFilterEntries(D3D11_INFO_QUEUE_FILTER *) = 0;
- virtual HRESULT __stdcall GetStorageFilter(D3D11_INFO_QUEUE_FILTER *, SIZE_T *) = 0;
- virtual void __stdcall ClearStorageFilter() = 0;
- virtual HRESULT __stdcall PushEmptyStorageFilter() = 0;
- virtual HRESULT __stdcall PushCopyOfStorageFilter() = 0;
- virtual HRESULT __stdcall PushStorageFilter(D3D11_INFO_QUEUE_FILTER *) = 0;
- virtual void __stdcall PopStorageFilter() = 0;
- virtual UINT __stdcall GetStorageFilterStackSize() = 0;
- virtual HRESULT __stdcall AddRetrievalFilterEntries(D3D11_INFO_QUEUE_FILTER *) = 0;
- virtual HRESULT __stdcall GetRetrievalFilter(D3D11_INFO_QUEUE_FILTER *, SIZE_T *) = 0;
- virtual void __stdcall ClearRetrievalFilter() = 0;
- virtual HRESULT __stdcall PushEmptyRetrievalFilter() = 0;
- virtual HRESULT __stdcall PushCopyOfRetrievalFilter() = 0;
- virtual HRESULT __stdcall PushRetrievalFilter(D3D11_INFO_QUEUE_FILTER *) = 0;
- virtual void __stdcall PopRetrievalFilter() = 0;
- virtual UINT __stdcall GetRetrievalFilterStackSize() = 0;
- virtual HRESULT __stdcall AddMessage(D3D11_MESSAGE_CATEGORY, D3D11_MESSAGE_SEVERITY, D3D11_MESSAGE_ID, LPCSTR) = 0;
- virtual HRESULT __stdcall AddApplicationMessage(D3D11_MESSAGE_SEVERITY, LPCSTR) = 0;
- virtual HRESULT __stdcall SetBreakOnCategory(D3D11_MESSAGE_CATEGORY, BOOL) = 0;
- virtual HRESULT __stdcall SetBreakOnSeverity(D3D11_MESSAGE_SEVERITY, BOOL) = 0;
- virtual HRESULT __stdcall SetBreakOnID(D3D11_MESSAGE_ID, BOOL) = 0;
- virtual BOOL __stdcall GetBreakOnCategory(D3D11_MESSAGE_CATEGORY) = 0;
- virtual BOOL __stdcall GetBreakOnSeverity(D3D11_MESSAGE_SEVERITY) = 0;
- virtual BOOL __stdcall GetBreakOnID(D3D11_MESSAGE_ID) = 0;
- virtual void __stdcall SetMuteDebugOutput(BOOL) = 0;
- virtual BOOL __stdcall GetMuteDebugOutput() = 0;
-};
-#endif // __MINGW32__
+# if defined(_MSC_VER) && (_MSC_VER <= 1600)
+# define final
+# define override
+# endif
# undef near
# undef far
#endif
+#if !defined(_M_ARM) && !defined(ANGLE_PLATFORM_ANDROID)
+# define ANGLE_USE_SSE
+#endif
+
#endif // COMMON_PLATFORM_H_
diff --git a/src/3rdparty/angle/src/common/tls.h b/src/3rdparty/angle/src/common/tls.h
index 8a06e92d1a..ca9e07ab70 100644
--- a/src/3rdparty/angle/src/common/tls.h
+++ b/src/3rdparty/angle/src/common/tls.h
@@ -15,7 +15,9 @@
// TLS does not exist for Windows Store and needs to be emulated
# ifdef ANGLE_ENABLE_WINDOWS_STORE
-# define TLS_OUT_OF_INDEXES -1
+# ifndef TLS_OUT_OF_INDEXES
+# define TLS_OUT_OF_INDEXES static_cast<DWORD>(0xFFFFFFFF)
+# endif
# ifndef CREATE_SUSPENDED
# define CREATE_SUSPENDED 0x00000004
# endif
diff --git a/src/3rdparty/angle/src/common/utilities.cpp b/src/3rdparty/angle/src/common/utilities.cpp
index 0eae42cac2..501e9c2564 100644
--- a/src/3rdparty/angle/src/common/utilities.cpp
+++ b/src/3rdparty/angle/src/common/utilities.cpp
@@ -254,7 +254,7 @@ int VariableColumnCount(GLenum type)
return 0;
}
-bool IsSampler(GLenum type)
+bool IsSamplerType(GLenum type)
{
switch (type)
{
@@ -343,9 +343,27 @@ int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsig
return -1;
}
-bool IsCubemapTextureTarget(GLenum target)
+static_assert(GL_TEXTURE_CUBE_MAP_NEGATIVE_X - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 1, "Unexpected GL cube map enum value.");
+static_assert(GL_TEXTURE_CUBE_MAP_POSITIVE_Y - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 2, "Unexpected GL cube map enum value.");
+static_assert(GL_TEXTURE_CUBE_MAP_NEGATIVE_Y - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 3, "Unexpected GL cube map enum value.");
+static_assert(GL_TEXTURE_CUBE_MAP_POSITIVE_Z - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 4, "Unexpected GL cube map enum value.");
+static_assert(GL_TEXTURE_CUBE_MAP_NEGATIVE_Z - GL_TEXTURE_CUBE_MAP_POSITIVE_X == 5, "Unexpected GL cube map enum value.");
+
+bool IsCubeMapTextureTarget(GLenum target)
+{
+ return (target >= FirstCubeMapTextureTarget && target <= LastCubeMapTextureTarget);
+}
+
+size_t CubeMapTextureTargetToLayerIndex(GLenum target)
{
- return (target >= GL_TEXTURE_CUBE_MAP_POSITIVE_X && target <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z);
+ ASSERT(IsCubeMapTextureTarget(target));
+ return target - static_cast<size_t>(FirstCubeMapTextureTarget);
+}
+
+GLenum LayerIndexToCubeMapTextureTarget(size_t index)
+{
+ ASSERT(index <= (LastCubeMapTextureTarget - FirstCubeMapTextureTarget));
+ return FirstCubeMapTextureTarget + static_cast<GLenum>(index);
}
bool IsTriangleMode(GLenum drawMode)
@@ -486,10 +504,15 @@ void writeFile(const char* path, const void* content, size_t size)
}
#endif // !ANGLE_ENABLE_WINDOWS_STORE
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && _MSC_FULL_VER < 180031101
+#if defined (ANGLE_PLATFORM_WINDOWS)
-void Sleep(unsigned long dwMilliseconds)
+// Causes the thread to relinquish the remainder of its time slice to any
+// other thread that is ready to run.If there are no other threads ready
+// to run, the function returns immediately, and the thread continues execution.
+void ScheduleYield()
{
+#if defined(ANGLE_ENABLE_WINDOWS_STORE)
+ // This implementation of Sleep exists because it is not available prior to Update 4.
static HANDLE singletonEvent = nullptr;
HANDLE sleepEvent = singletonEvent;
if (!sleepEvent)
@@ -510,7 +533,10 @@ void Sleep(unsigned long dwMilliseconds)
}
// Emulate sleep by waiting with timeout on an event that is never signalled.
- WaitForSingleObjectEx(sleepEvent, dwMilliseconds, false);
+ WaitForSingleObjectEx(sleepEvent, 0, false);
+#else
+ Sleep(0);
+#endif
}
-#endif // ANGLE_ENABLE_WINDOWS_STORE
+#endif
diff --git a/src/3rdparty/angle/src/common/utilities.h b/src/3rdparty/angle/src/common/utilities.h
index 7583d3e160..9f7f5e03c0 100644
--- a/src/3rdparty/angle/src/common/utilities.h
+++ b/src/3rdparty/angle/src/common/utilities.h
@@ -6,8 +6,8 @@
// utilities.h: Conversion functions and other utility routines.
-#ifndef LIBGLESV2_UTILITIES_H
-#define LIBGLESV2_UTILITIES_H
+#ifndef COMMON_UTILITIES_H_
+#define COMMON_UTILITIES_H_
#include "angle_gl.h"
#include <string>
@@ -24,7 +24,7 @@ size_t VariableExternalSize(GLenum type);
GLenum VariableBoolVectorType(GLenum type);
int VariableRowCount(GLenum type);
int VariableColumnCount(GLenum type);
-bool IsSampler(GLenum type);
+bool IsSamplerType(GLenum type);
bool IsMatrixType(GLenum type);
GLenum TransposeMatrixType(GLenum type);
int VariableRegisterCount(GLenum type);
@@ -34,7 +34,11 @@ int VariableSortOrder(GLenum type);
int AllocateFirstFreeBits(unsigned int *bits, unsigned int allocationSize, unsigned int bitsSize);
-bool IsCubemapTextureTarget(GLenum target);
+static const GLenum FirstCubeMapTextureTarget = GL_TEXTURE_CUBE_MAP_POSITIVE_X;
+static const GLenum LastCubeMapTextureTarget = GL_TEXTURE_CUBE_MAP_NEGATIVE_Z;
+bool IsCubeMapTextureTarget(GLenum target);
+size_t CubeMapTextureTargetToLayerIndex(GLenum target);
+GLenum LayerIndexToCubeMapTextureTarget(size_t index);
bool IsTriangleMode(GLenum drawMode);
@@ -51,8 +55,8 @@ std::string getTempPath();
void writeFile(const char* path, const void* data, size_t size);
#endif
-#if defined(ANGLE_ENABLE_WINDOWS_STORE) && _MSC_FULL_VER < 180031101
-void Sleep(_In_ unsigned long dwMilliseconds);
+#if defined (ANGLE_PLATFORM_WINDOWS)
+void ScheduleYield();
#endif
-#endif // LIBGLESV2_UTILITIES_H
+#endif // COMMON_UTILITIES_H_
diff --git a/src/3rdparty/angle/src/common/version.h b/src/3rdparty/angle/src/common/version.h
index f01e0242cb..758c78d44a 100644
--- a/src/3rdparty/angle/src/common/version.h
+++ b/src/3rdparty/angle/src/common/version.h
@@ -1,4 +1,13 @@
-#include "../commit.h"
+//
+// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMMON_VERSION_H_
+#define COMMON_VERSION_H_
+
+#include "id/commit.h"
#define ANGLE_MAJOR_VERSION 2
#define ANGLE_MINOR_VERSION 1
@@ -10,3 +19,5 @@
ANGLE_MACRO_STRINGIFY(ANGLE_MAJOR_VERSION) "." \
ANGLE_MACRO_STRINGIFY(ANGLE_MINOR_VERSION) "." \
ANGLE_COMMIT_HASH
+
+#endif // COMMON_VERSION_H_
diff --git a/src/3rdparty/angle/src/common/winrt/CoreWindowNativeWindow.h b/src/3rdparty/angle/src/common/winrt/CoreWindowNativeWindow.h
deleted file mode 100644
index 1c5512417d..0000000000
--- a/src/3rdparty/angle/src/common/winrt/CoreWindowNativeWindow.h
+++ /dev/null
@@ -1,39 +0,0 @@
-//
-// Copyright (c) 2014 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.
-//
-
-// CoreWindowNativeWindow.h: NativeWindow for managing ICoreWindow native window types.
-
-#ifndef COMMON_WINRT_COREWINDOWNATIVEWINDOW_H_
-#define COMMON_WINRT_COREWINDOWNATIVEWINDOW_H_
-
-#include "common/winrt/InspectableNativeWindow.h"
-#include <memory>
-#include <windows.graphics.display.h>
-
-namespace rx
-{
-
-class CoreWindowNativeWindow : public InspectableNativeWindow, public std::enable_shared_from_this<CoreWindowNativeWindow>
-{
- public:
- ~CoreWindowNativeWindow();
-
- bool initialize(EGLNativeWindowType window, EGLNativeDisplayType display, IPropertySet *propertySet);
- bool registerForSizeChangeEvents();
- void unregisterForSizeChangeEvents();
- HRESULT createSwapChain(ID3D11Device *device, DXGIFactory *factory, DXGI_FORMAT format, unsigned int width, unsigned int height, DXGISwapChain **swapChain);
-
- private:
- HRESULT onSizeChanged(ABI::Windows::UI::Core::ICoreWindow *, ABI::Windows::UI::Core::IWindowSizeChangedEventArgs *);
-
- ComPtr<ABI::Windows::UI::Core::ICoreWindow> mCoreWindow;
- ComPtr<ABI::Windows::Graphics::Display::IDisplayInformation> mDisplayInformation;
- ComPtr<IMap<HSTRING, IInspectable*>> mPropertyMap;
-};
-
-}
-
-#endif // COMMON_WINRT_COREWINDOWNATIVEWINDOW_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h b/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h
index a7587ed657..5922d03857 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/DiagnosticsBase.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
-#define COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
+#ifndef COMPILER_PREPROCESSOR_DIAGNOSTICSBASE_H_
+#define COMPILER_PREPROCESSOR_DIAGNOSTICSBASE_H_
#include <string>
@@ -84,4 +84,5 @@ class Diagnostics
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_DIAGNOSTICS_H_
+
+#endif // COMPILER_PREPROCESSOR_DIAGNOSTICSBASE_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/DirectiveHandlerBase.h b/src/3rdparty/angle/src/compiler/preprocessor/DirectiveHandlerBase.h
index eec0d5e5f0..cf67895764 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/DirectiveHandlerBase.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/DirectiveHandlerBase.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
-#define COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
+#ifndef COMPILER_PREPROCESSOR_DIRECTIVEHANDLERBASE_H_
+#define COMPILER_PREPROCESSOR_DIRECTIVEHANDLERBASE_H_
#include <string>
@@ -41,4 +41,5 @@ class DirectiveHandler
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_DIRECTIVE_HANDLER_H_
+
+#endif // COMPILER_PREPROCESSOR_DIRECTIVEHANDLERBASE_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.h b/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.h
index 335091781c..e1acdbb8d0 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/DirectiveParser.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_PREPROCESSOR_DIRECTIVE_PARSER_H_
-#define COMPILER_PREPROCESSOR_DIRECTIVE_PARSER_H_
+#ifndef COMPILER_PREPROCESSOR_DIRECTIVEPARSER_H_
+#define COMPILER_PREPROCESSOR_DIRECTIVEPARSER_H_
#include "Lexer.h"
#include "Macro.h"
@@ -78,5 +78,5 @@ class DirectiveParser : public Lexer
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_DIRECTIVE_PARSER_H_
+#endif // COMPILER_PREPROCESSOR_DIRECTIVEPARSER_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.h b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.h
index f040cb01fa..4b80ba7261 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_PREPROCESSOR_EXPRESSION_PARSER_H_
-#define COMPILER_PREPROCESSOR_EXPRESSION_PARSER_H_
+#ifndef COMPILER_PREPROCESSOR_EXPRESSIONPARSER_H_
+#define COMPILER_PREPROCESSOR_EXPRESSIONPARSER_H_
#include "pp_utils.h"
@@ -31,4 +31,5 @@ class ExpressionParser
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_EXPRESSION_PARSER_H_
+
+#endif // COMPILER_PREPROCESSOR_EXPRESSIONPARSER_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y
index 662a31b650..8caf36bfc8 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y
+++ b/src/3rdparty/angle/src/compiler/preprocessor/ExpressionParser.y
@@ -28,7 +28,7 @@ WHICH GENERATES THE GLSL ES preprocessor expression parser.
#pragma GCC diagnostic ignored "-Wuninitialized"
#endif
#elif defined(_MSC_VER)
-#pragma warning(disable: 4065 4701)
+#pragma warning(disable: 4065 4701 4702)
#endif
#include "ExpressionParser.h"
@@ -69,7 +69,7 @@ struct Context
%}
%pure-parser
-%name-prefix="pp"
+%name-prefix "pp"
%parse-param {Context *context}
%lex-param {Context *context}
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Input.h b/src/3rdparty/angle/src/compiler/preprocessor/Input.h
index 2ac4f0c170..e951cb4d5f 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/Input.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/Input.h
@@ -58,5 +58,5 @@ class Input
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_INPUT_H_
+#endif // COMPILER_PREPROCESSOR_INPUT_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Lexer.h b/src/3rdparty/angle/src/compiler/preprocessor/Lexer.h
index d42d3db7e0..990dc5e21d 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/Lexer.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/Lexer.h
@@ -21,5 +21,5 @@ class Lexer
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_LEXER_H_
+#endif // COMPILER_PREPROCESSOR_LEXER_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Macro.h b/src/3rdparty/angle/src/compiler/preprocessor/Macro.h
index b77e7bc15c..7662a9c5a2 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/Macro.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/Macro.h
@@ -46,4 +46,5 @@ struct Macro
typedef std::map<std::string, Macro> MacroSet;
} // namespace pp
+
#endif // COMPILER_PREPROCESSOR_MACRO_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.h b/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.h
index d4fd091786..5a0c7751a8 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/MacroExpander.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_PREPROCESSOR_MACRO_EXPANDER_H_
-#define COMPILER_PREPROCESSOR_MACRO_EXPANDER_H_
+#ifndef COMPILER_PREPROCESSOR_MACROEXPANDER_H_
+#define COMPILER_PREPROCESSOR_MACROEXPANDER_H_
#include <cassert>
#include <memory>
@@ -85,5 +85,5 @@ class MacroExpander : public Lexer
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_MACRO_EXPANDER_H_
+#endif // COMPILER_PREPROCESSOR_MACROEXPANDER_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.h b/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.h
index 0a55f1c9c1..fe25daa123 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/Preprocessor.h
@@ -50,5 +50,5 @@ class Preprocessor
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_PREPROCESSOR_H_
+#endif // COMPILER_PREPROCESSOR_PREPROCESSOR_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/SourceLocation.h b/src/3rdparty/angle/src/compiler/preprocessor/SourceLocation.h
index d4c1a5e178..af8a8d5d19 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/SourceLocation.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/SourceLocation.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_
-#define COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_
+#ifndef COMPILER_PREPROCESSOR_SOURCELOCATION_H_
+#define COMPILER_PREPROCESSOR_SOURCELOCATION_H_
namespace pp
{
@@ -43,4 +43,5 @@ inline bool operator!=(const SourceLocation &lhs, const SourceLocation &rhs)
}
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_SOURCE_LOCATION_H_
+
+#endif // COMPILER_PREPROCESSOR_SOURCELOCATION_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Token.h b/src/3rdparty/angle/src/compiler/preprocessor/Token.h
index 8832e279c7..347c47e307 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/Token.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/Token.h
@@ -116,4 +116,5 @@ inline bool operator!=(const Token &lhs, const Token &rhs)
extern std::ostream &operator<<(std::ostream &out, const Token &token);
} // namepsace pp
+
#endif // COMPILER_PREPROCESSOR_TOKEN_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.h b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.h
index 07ad93da05..78eb86dd3b 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.h
@@ -55,5 +55,5 @@ class Tokenizer : public Lexer
};
} // namespace pp
-#endif // COMPILER_PREPROCESSOR_TOKENIZER_H_
+#endif // COMPILER_PREPROCESSOR_TOKENIZER_H_
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l
index 2a77b905a4..89cb5c8596 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l
+++ b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l
@@ -267,7 +267,9 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".")
namespace pp {
-Tokenizer::Tokenizer(Diagnostics *diagnostics) : mHandle(0)
+Tokenizer::Tokenizer(Diagnostics *diagnostics)
+ : mHandle(0),
+ mMaxTokenSize(256)
{
mContext.diagnostics = diagnostics;
}
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/numeric_lex.h b/src/3rdparty/angle/src/compiler/preprocessor/numeric_lex.h
index 8a24540696..58c51b0961 100644
--- a/src/3rdparty/angle/src/compiler/preprocessor/numeric_lex.h
+++ b/src/3rdparty/angle/src/compiler/preprocessor/numeric_lex.h
@@ -6,8 +6,8 @@
// numeric_lex.h: Functions to extract numeric values from string.
-#ifndef COMPILER_PREPROCESSOR_NUMERIC_LEX_H_
-#define COMPILER_PREPROCESSOR_NUMERIC_LEX_H_
+#ifndef COMPILER_PREPROCESSOR_NUMERICLEX_H_
+#define COMPILER_PREPROCESSOR_NUMERICLEX_H_
#include <sstream>
@@ -58,4 +58,5 @@ bool numeric_lex_float(const std::string &str, FloatType *value)
}
} // namespace pp.
-#endif // COMPILER_PREPROCESSOR_NUMERIC_LEX_H_
+
+#endif // COMPILER_PREPROCESSOR_NUMERICLEX_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/BaseTypes.h b/src/3rdparty/angle/src/compiler/translator/BaseTypes.h
index 324b0669f4..ee1428b2d3 100644
--- a/src/3rdparty/angle/src/compiler/translator/BaseTypes.h
+++ b/src/3rdparty/angle/src/compiler/translator/BaseTypes.h
@@ -4,10 +4,10 @@
// found in the LICENSE file.
//
-#ifndef _BASICTYPES_INCLUDED_
-#define _BASICTYPES_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_BASETYPES_H_
+#define COMPILER_TRANSLATOR_BASETYPES_H_
-#include <assert.h>
+#include "compiler/translator/compilerdebug.h"
//
// Precision qualifiers
@@ -42,7 +42,15 @@ enum TBasicType
EbtInt,
EbtUInt,
EbtBool,
- EbtGVec4, // non type: represents vec4, ivec4 and uvec4
+ EbtGVec4, // non type: represents vec4, ivec4, and uvec4
+ EbtGenType, // non type: represents float, vec2, vec3, and vec4
+ EbtGenIType, // non type: represents int, ivec2, ivec3, and ivec4
+ EbtGenUType, // non type: represents uint, uvec2, uvec3, and uvec4
+ EbtGenBType, // non type: represents bool, bvec2, bvec3, and bvec4
+ EbtVec, // non type: represents vec2, vec3, and vec4
+ EbtIVec, // non type: represents ivec2, ivec3, and ivec4
+ EbtUVec, // non type: represents uvec2, uvec3, and uvec4
+ EbtBVec, // non type: represents bvec2, bvec3, and bvec4
EbtGuardSamplerBegin, // non type: see implementation of IsSampler()
EbtSampler2D,
EbtSampler3D,
@@ -62,10 +70,10 @@ enum TBasicType
EbtSamplerCubeShadow,
EbtSampler2DArrayShadow,
EbtGuardSamplerEnd, // non type: see implementation of IsSampler()
- EbtGSampler2D, // non type: represents sampler2D, isampler2D and usampler2D
- EbtGSampler3D, // non type: represents sampler3D, isampler3D and usampler3D
- EbtGSamplerCube, // non type: represents samplerCube, isamplerCube and usamplerCube
- EbtGSampler2DArray, // non type: represents sampler2DArray, isampler2DArray and usampler2DArray
+ EbtGSampler2D, // non type: represents sampler2D, isampler2D, and usampler2D
+ EbtGSampler3D, // non type: represents sampler3D, isampler3D, and usampler3D
+ EbtGSamplerCube, // non type: represents samplerCube, isamplerCube, and usamplerCube
+ EbtGSampler2DArray, // non type: represents sampler2DArray, isampler2DArray, and usampler2DArray
EbtStruct,
EbtInterfaceBlock,
EbtAddress, // should be deprecated??
@@ -258,6 +266,11 @@ inline bool IsShadowSampler(TBasicType type)
return false;
}
+inline bool IsInteger(TBasicType type)
+{
+ return type == EbtInt || type == EbtUInt;
+}
+
inline bool SupportsPrecision(TBasicType type)
{
return type == EbtFloat || type == EbtInt || type == EbtUInt || IsSampler(type);
@@ -293,6 +306,9 @@ enum TQualifier
EvqInOut,
EvqConstReadOnly,
+ // built-ins read by vertex shader
+ EvqInstanceID,
+
// built-ins written by vertex shader
EvqPosition,
EvqPointSize,
@@ -307,6 +323,10 @@ enum TQualifier
EvqFragData,
EvqFragDepth,
+ // built-ins written by the shader_framebuffer_fetch extension(s)
+ EvqLastFragColor,
+ EvqLastFragData,
+
// GLSL ES 3.0 vertex output and fragment input
EvqSmooth, // Incomplete qualifier, smooth is the default
EvqFlat, // Incomplete qualifier
@@ -383,6 +403,7 @@ inline const char* getQualifierString(TQualifier q)
case EvqIn: return "in"; break;
case EvqOut: return "out"; break;
case EvqInOut: return "inout"; break;
+ case EvqInstanceID: return "InstanceID"; break;
case EvqPosition: return "Position"; break;
case EvqPointSize: return "PointSize"; break;
case EvqFragCoord: return "FragCoord"; break;
@@ -396,7 +417,9 @@ inline const char* getQualifierString(TQualifier q)
case EvqSmoothIn: return "smooth in"; break;
case EvqCentroidIn: return "centroid in"; break;
case EvqFlatIn: return "flat in"; break;
- default: return "unknown qualifier";
+ case EvqLastFragColor: return "LastFragColor"; break;
+ case EvqLastFragData: return "LastFragData"; break;
+ default: UNREACHABLE(); return "unknown qualifier";
}
}
@@ -407,7 +430,7 @@ inline const char* getMatrixPackingString(TLayoutMatrixPacking mpq)
case EmpUnspecified: return "mp_unspecified";
case EmpRowMajor: return "row_major";
case EmpColumnMajor: return "column_major";
- default: return "unknown matrix packing";
+ default: UNREACHABLE(); return "unknown matrix packing";
}
}
@@ -419,7 +442,7 @@ inline const char* getBlockStorageString(TLayoutBlockStorage bsq)
case EbsShared: return "shared";
case EbsPacked: return "packed";
case EbsStd140: return "std140";
- default: return "unknown block storage";
+ default: UNREACHABLE(); return "unknown block storage";
}
}
@@ -433,8 +456,8 @@ inline const char* getInterpolationString(TQualifier q)
case EvqSmoothIn: return "smooth"; break;
case EvqCentroidIn: return "centroid"; break;
case EvqFlatIn: return "flat"; break;
- default: return "unknown interpolation";
+ default: UNREACHABLE(); return "unknown interpolation";
}
}
-#endif // _BASICTYPES_INCLUDED_
+#endif // COMPILER_TRANSLATOR_BASETYPES_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.cpp b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.cpp
index 0e8239cc1e..51461207c5 100644
--- a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.cpp
@@ -8,193 +8,9 @@
#include "compiler/translator/BuiltInFunctionEmulator.h"
#include "compiler/translator/SymbolTable.h"
-namespace {
-
-// we use macros here instead of function definitions to work around more GLSL
-// compiler bugs, in particular on NVIDIA hardware on Mac OSX. Macros are
-// problematic because if the argument has side-effects they will be repeatedly
-// evaluated. This is unlikely to show up in real shaders, but is something to
-// consider.
-const char* kFunctionEmulationVertexSource[] = {
- "#error no emulation for cos(float)",
- "#error no emulation for cos(vec2)",
- "#error no emulation for cos(vec3)",
- "#error no emulation for cos(vec4)",
-
- "#define webgl_distance_emu(x, y) ((x) >= (y) ? (x) - (y) : (y) - (x))",
- "#error no emulation for distance(vec2, vec2)",
- "#error no emulation for distance(vec3, vec3)",
- "#error no emulation for distance(vec4, vec4)",
-
- "#define webgl_dot_emu(x, y) ((x) * (y))",
- "#error no emulation for dot(vec2, vec2)",
- "#error no emulation for dot(vec3, vec3)",
- "#error no emulation for dot(vec4, vec4)",
-
- "#define webgl_length_emu(x) ((x) >= 0.0 ? (x) : -(x))",
- "#error no emulation for length(vec2)",
- "#error no emulation for length(vec3)",
- "#error no emulation for length(vec4)",
-
- "#define webgl_normalize_emu(x) ((x) == 0.0 ? 0.0 : ((x) > 0.0 ? 1.0 : -1.0))",
- "#error no emulation for normalize(vec2)",
- "#error no emulation for normalize(vec3)",
- "#error no emulation for normalize(vec4)",
-
- "#define webgl_reflect_emu(I, N) ((I) - 2.0 * (N) * (I) * (N))",
- "#error no emulation for reflect(vec2, vec2)",
- "#error no emulation for reflect(vec3, vec3)",
- "#error no emulation for reflect(vec4, vec4)"
-};
-
-const char* kFunctionEmulationFragmentSource[] = {
- "webgl_emu_precision float webgl_cos_emu(webgl_emu_precision float a) { return cos(a); }",
- "webgl_emu_precision vec2 webgl_cos_emu(webgl_emu_precision vec2 a) { return cos(a); }",
- "webgl_emu_precision vec3 webgl_cos_emu(webgl_emu_precision vec3 a) { return cos(a); }",
- "webgl_emu_precision vec4 webgl_cos_emu(webgl_emu_precision vec4 a) { return cos(a); }",
-
- "#define webgl_distance_emu(x, y) ((x) >= (y) ? (x) - (y) : (y) - (x))",
- "#error no emulation for distance(vec2, vec2)",
- "#error no emulation for distance(vec3, vec3)",
- "#error no emulation for distance(vec4, vec4)",
-
- "#define webgl_dot_emu(x, y) ((x) * (y))",
- "#error no emulation for dot(vec2, vec2)",
- "#error no emulation for dot(vec3, vec3)",
- "#error no emulation for dot(vec4, vec4)",
-
- "#define webgl_length_emu(x) ((x) >= 0.0 ? (x) : -(x))",
- "#error no emulation for length(vec2)",
- "#error no emulation for length(vec3)",
- "#error no emulation for length(vec4)",
-
- "#define webgl_normalize_emu(x) ((x) == 0.0 ? 0.0 : ((x) > 0.0 ? 1.0 : -1.0))",
- "#error no emulation for normalize(vec2)",
- "#error no emulation for normalize(vec3)",
- "#error no emulation for normalize(vec4)",
-
- "#define webgl_reflect_emu(I, N) ((I) - 2.0 * (N) * (I) * (N))",
- "#error no emulation for reflect(vec2, vec2)",
- "#error no emulation for reflect(vec3, vec3)",
- "#error no emulation for reflect(vec4, vec4)"
-};
-
-const bool kFunctionEmulationVertexMask[] = {
-#if defined(__APPLE__)
- // Work around ATI driver bugs in Mac.
- false, // TFunctionCos1
- false, // TFunctionCos2
- false, // TFunctionCos3
- false, // TFunctionCos4
- true, // TFunctionDistance1_1
- false, // TFunctionDistance2_2
- false, // TFunctionDistance3_3
- false, // TFunctionDistance4_4
- true, // TFunctionDot1_1
- false, // TFunctionDot2_2
- false, // TFunctionDot3_3
- false, // TFunctionDot4_4
- true, // TFunctionLength1
- false, // TFunctionLength2
- false, // TFunctionLength3
- false, // TFunctionLength4
- true, // TFunctionNormalize1
- false, // TFunctionNormalize2
- false, // TFunctionNormalize3
- false, // TFunctionNormalize4
- true, // TFunctionReflect1_1
- false, // TFunctionReflect2_2
- false, // TFunctionReflect3_3
- false, // TFunctionReflect4_4
-#else
- // Work around D3D driver bug in Win.
- false, // TFunctionCos1
- false, // TFunctionCos2
- false, // TFunctionCos3
- false, // TFunctionCos4
- false, // TFunctionDistance1_1
- false, // TFunctionDistance2_2
- false, // TFunctionDistance3_3
- false, // TFunctionDistance4_4
- false, // TFunctionDot1_1
- false, // TFunctionDot2_2
- false, // TFunctionDot3_3
- false, // TFunctionDot4_4
- false, // TFunctionLength1
- false, // TFunctionLength2
- false, // TFunctionLength3
- false, // TFunctionLength4
- false, // TFunctionNormalize1
- false, // TFunctionNormalize2
- false, // TFunctionNormalize3
- false, // TFunctionNormalize4
- false, // TFunctionReflect1_1
- false, // TFunctionReflect2_2
- false, // TFunctionReflect3_3
- false, // TFunctionReflect4_4
-#endif
- false // TFunctionUnknown
-};
-
-const bool kFunctionEmulationFragmentMask[] = {
-#if defined(__APPLE__)
- // Work around ATI driver bugs in Mac.
- true, // TFunctionCos1
- true, // TFunctionCos2
- true, // TFunctionCos3
- true, // TFunctionCos4
- true, // TFunctionDistance1_1
- false, // TFunctionDistance2_2
- false, // TFunctionDistance3_3
- false, // TFunctionDistance4_4
- true, // TFunctionDot1_1
- false, // TFunctionDot2_2
- false, // TFunctionDot3_3
- false, // TFunctionDot4_4
- true, // TFunctionLength1
- false, // TFunctionLength2
- false, // TFunctionLength3
- false, // TFunctionLength4
- true, // TFunctionNormalize1
- false, // TFunctionNormalize2
- false, // TFunctionNormalize3
- false, // TFunctionNormalize4
- true, // TFunctionReflect1_1
- false, // TFunctionReflect2_2
- false, // TFunctionReflect3_3
- false, // TFunctionReflect4_4
-#else
- // Work around D3D driver bug in Win.
- false, // TFunctionCos1
- false, // TFunctionCos2
- false, // TFunctionCos3
- false, // TFunctionCos4
- false, // TFunctionDistance1_1
- false, // TFunctionDistance2_2
- false, // TFunctionDistance3_3
- false, // TFunctionDistance4_4
- false, // TFunctionDot1_1
- false, // TFunctionDot2_2
- false, // TFunctionDot3_3
- false, // TFunctionDot4_4
- false, // TFunctionLength1
- false, // TFunctionLength2
- false, // TFunctionLength3
- false, // TFunctionLength4
- false, // TFunctionNormalize1
- false, // TFunctionNormalize2
- false, // TFunctionNormalize3
- false, // TFunctionNormalize4
- false, // TFunctionReflect1_1
- false, // TFunctionReflect2_2
- false, // TFunctionReflect3_3
- false, // TFunctionReflect4_4
-#endif
- false // TFunctionUnknown
-};
-
-class BuiltInFunctionEmulationMarker : public TIntermTraverser {
-public:
+class BuiltInFunctionEmulator::BuiltInFunctionEmulationMarker : public TIntermTraverser
+{
+ public:
BuiltInFunctionEmulationMarker(BuiltInFunctionEmulator& emulator)
: mEmulator(emulator)
{
@@ -238,148 +54,119 @@ public:
case EOpFaceForward:
case EOpReflect:
case EOpRefract:
+ case EOpOuterProduct:
case EOpMul:
break;
default:
return true;
};
const TIntermSequence& sequence = *(node->getSequence());
- // Right now we only handle built-in functions with two parameters.
- if (sequence.size() != 2)
- return true;
- TIntermTyped* param1 = sequence[0]->getAsTyped();
- TIntermTyped* param2 = sequence[1]->getAsTyped();
- if (!param1 || !param2)
+ bool needToEmulate = false;
+ // Right now we only handle built-in functions with two or three parameters.
+ if (sequence.size() == 2)
+ {
+ TIntermTyped* param1 = sequence[0]->getAsTyped();
+ TIntermTyped* param2 = sequence[1]->getAsTyped();
+ if (!param1 || !param2)
+ return true;
+ needToEmulate = mEmulator.SetFunctionCalled(
+ node->getOp(), param1->getType(), param2->getType());
+ }
+ else if (sequence.size() == 3)
+ {
+ TIntermTyped* param1 = sequence[0]->getAsTyped();
+ TIntermTyped* param2 = sequence[1]->getAsTyped();
+ TIntermTyped* param3 = sequence[2]->getAsTyped();
+ if (!param1 || !param2 || !param3)
+ return true;
+ needToEmulate = mEmulator.SetFunctionCalled(
+ node->getOp(), param1->getType(), param2->getType(), param3->getType());
+ }
+ else
+ {
return true;
- bool needToEmulate = mEmulator.SetFunctionCalled(
- node->getOp(), param1->getType(), param2->getType());
+ }
+
if (needToEmulate)
node->setUseEmulatedFunction();
}
return true;
}
-private:
+ private:
BuiltInFunctionEmulator& mEmulator;
};
-} // anonymous namepsace
+BuiltInFunctionEmulator::BuiltInFunctionEmulator()
+{}
-BuiltInFunctionEmulator::BuiltInFunctionEmulator(sh::GLenum shaderType)
+void BuiltInFunctionEmulator::addEmulatedFunction(
+ TOperator op, const TType& param,
+ const char* emulatedFunctionDefinition)
{
- if (shaderType == GL_FRAGMENT_SHADER) {
- mFunctionMask = kFunctionEmulationFragmentMask;
- mFunctionSource = kFunctionEmulationFragmentSource;
- } else {
- mFunctionMask = kFunctionEmulationVertexMask;
- mFunctionSource = kFunctionEmulationVertexSource;
- }
+ mEmulatedFunctions[FunctionId(op, param)] =
+ std::string(emulatedFunctionDefinition);
}
-bool BuiltInFunctionEmulator::SetFunctionCalled(
- TOperator op, const TType& param)
+void BuiltInFunctionEmulator::addEmulatedFunction(
+ TOperator op, const TType& param1, const TType& param2,
+ const char* emulatedFunctionDefinition)
{
- TBuiltInFunction function = IdentifyFunction(op, param);
- return SetFunctionCalled(function);
+ mEmulatedFunctions[FunctionId(op, param1, param2)] =
+ std::string(emulatedFunctionDefinition);
}
-bool BuiltInFunctionEmulator::SetFunctionCalled(
- TOperator op, const TType& param1, const TType& param2)
+void BuiltInFunctionEmulator::addEmulatedFunction(
+ TOperator op, const TType& param1, const TType& param2, const TType& param3,
+ const char* emulatedFunctionDefinition)
{
- TBuiltInFunction function = IdentifyFunction(op, param1, param2);
- return SetFunctionCalled(function);
+ mEmulatedFunctions[FunctionId(op, param1, param2, param3)] =
+ std::string(emulatedFunctionDefinition);
}
-bool BuiltInFunctionEmulator::SetFunctionCalled(
- BuiltInFunctionEmulator::TBuiltInFunction function) {
- if (function == TFunctionUnknown || mFunctionMask[function] == false)
- return false;
- for (size_t i = 0; i < mFunctions.size(); ++i) {
- if (mFunctions[i] == function)
- return true;
- }
- mFunctions.push_back(function);
- return true;
+bool BuiltInFunctionEmulator::IsOutputEmpty() const
+{
+ return (mFunctions.size() == 0);
}
-void BuiltInFunctionEmulator::OutputEmulatedFunctionDefinition(
- TInfoSinkBase& out, bool withPrecision) const
+void BuiltInFunctionEmulator::OutputEmulatedFunctions(
+ TInfoSinkBase& out) const
{
- if (mFunctions.size() == 0)
- return;
- out << "// BEGIN: Generated code for built-in function emulation\n\n";
- if (withPrecision) {
- out << "#if defined(GL_FRAGMENT_PRECISION_HIGH)\n"
- << "#define webgl_emu_precision highp\n"
- << "#else\n"
- << "#define webgl_emu_precision mediump\n"
- << "#endif\n\n";
- } else {
- out << "#define webgl_emu_precision\n\n";
- }
for (size_t i = 0; i < mFunctions.size(); ++i) {
- out << mFunctionSource[mFunctions[i]] << "\n\n";
+ out << mEmulatedFunctions.find(mFunctions[i])->second << "\n\n";
}
- out << "// END: Generated code for built-in function emulation\n\n";
}
-BuiltInFunctionEmulator::TBuiltInFunction
-BuiltInFunctionEmulator::IdentifyFunction(
+bool BuiltInFunctionEmulator::SetFunctionCalled(
TOperator op, const TType& param)
{
- if (param.getNominalSize() > 4 || param.getSecondarySize() > 4)
- return TFunctionUnknown;
- unsigned int function = TFunctionUnknown;
- switch (op) {
- case EOpCos:
- function = TFunctionCos1;
- break;
- case EOpLength:
- function = TFunctionLength1;
- break;
- case EOpNormalize:
- function = TFunctionNormalize1;
- break;
- default:
- break;
- }
- if (function == TFunctionUnknown)
- return TFunctionUnknown;
- if (param.isVector())
- function += param.getNominalSize() - 1;
- return static_cast<TBuiltInFunction>(function);
+ return SetFunctionCalled(FunctionId(op, param));
}
-BuiltInFunctionEmulator::TBuiltInFunction
-BuiltInFunctionEmulator::IdentifyFunction(
+bool BuiltInFunctionEmulator::SetFunctionCalled(
TOperator op, const TType& param1, const TType& param2)
{
- // Right now for all the emulated functions with two parameters, the two
- // parameters have the same type.
- if (param1.getNominalSize() != param2.getNominalSize() ||
- param1.getSecondarySize() != param2.getSecondarySize() ||
- param1.getNominalSize() > 4 || param1.getSecondarySize() > 4)
- return TFunctionUnknown;
+ return SetFunctionCalled(FunctionId(op, param1, param2));
+}
+
+bool BuiltInFunctionEmulator::SetFunctionCalled(
+ TOperator op, const TType& param1, const TType& param2, const TType& param3)
+{
+ return SetFunctionCalled(FunctionId(op, param1, param2, param3));
+}
- unsigned int function = TFunctionUnknown;
- switch (op) {
- case EOpDistance:
- function = TFunctionDistance1_1;
- break;
- case EOpDot:
- function = TFunctionDot1_1;
- break;
- case EOpReflect:
- function = TFunctionReflect1_1;
- break;
- default:
- break;
+bool BuiltInFunctionEmulator::SetFunctionCalled(
+ const FunctionId& functionId) {
+ if (mEmulatedFunctions.find(functionId) != mEmulatedFunctions.end())
+ {
+ for (size_t i = 0; i < mFunctions.size(); ++i) {
+ if (mFunctions[i] == functionId)
+ return true;
+ }
+ mFunctions.push_back(functionId);
+ return true;
}
- if (function == TFunctionUnknown)
- return TFunctionUnknown;
- if (param1.isVector())
- function += param1.getNominalSize() - 1;
- return static_cast<TBuiltInFunction>(function);
+ return false;
}
void BuiltInFunctionEmulator::MarkBuiltInFunctionsForEmulation(
@@ -387,6 +174,9 @@ void BuiltInFunctionEmulator::MarkBuiltInFunctionsForEmulation(
{
ASSERT(root);
+ if (mEmulatedFunctions.empty())
+ return;
+
BuiltInFunctionEmulationMarker marker(*this);
root->traverse(&marker);
}
@@ -404,3 +194,52 @@ TString BuiltInFunctionEmulator::GetEmulatedFunctionName(
return "webgl_" + name.substr(0, name.length() - 1) + "_emu(";
}
+BuiltInFunctionEmulator::FunctionId::FunctionId
+ (TOperator op, const TType& param)
+ : mOp(op),
+ mParam1(param),
+ mParam2(EbtVoid),
+ mParam3(EbtVoid)
+{
+}
+
+BuiltInFunctionEmulator::FunctionId::FunctionId
+ (TOperator op, const TType& param1, const TType& param2)
+ : mOp(op),
+ mParam1(param1),
+ mParam2(param2),
+ mParam3(EbtVoid)
+{
+}
+
+BuiltInFunctionEmulator::FunctionId::FunctionId
+ (TOperator op, const TType& param1, const TType& param2, const TType& param3)
+ : mOp(op),
+ mParam1(param1),
+ mParam2(param2),
+ mParam3(param3)
+{
+}
+
+bool BuiltInFunctionEmulator::FunctionId::operator==
+ (const BuiltInFunctionEmulator::FunctionId& other) const
+{
+ return (mOp == other.mOp &&
+ mParam1 == other.mParam1 &&
+ mParam2 == other.mParam2 &&
+ mParam3 == other.mParam3);
+}
+
+bool BuiltInFunctionEmulator::FunctionId::operator<
+ (const BuiltInFunctionEmulator::FunctionId& other) const
+{
+ if (mOp != other.mOp)
+ return mOp < other.mOp;
+ if (mParam1 != other.mParam1)
+ return mParam1 < other.mParam1;
+ if (mParam2 != other.mParam2)
+ return mParam2 < other.mParam2;
+ if (mParam3 != other.mParam3)
+ return mParam3 < other.mParam3;
+ return false; // all fields are equal
+}
diff --git a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.h b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.h
index c6bf77c386..df556985e1 100644
--- a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.h
+++ b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulator.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILIER_BUILT_IN_FUNCTION_EMULATOR_H_
-#define COMPILIER_BUILT_IN_FUNCTION_EMULATOR_H_
+#ifndef COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATOR_H_
+#define COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATOR_H_
#include "compiler/translator/InfoSink.h"
#include "compiler/translator/IntermNode.h"
@@ -13,23 +13,13 @@
//
// This class decides which built-in functions need to be replaced with the
// emulated ones.
-// It's only a workaround for OpenGL driver bugs, and isn't needed in general.
+// It can be used to work around driver bugs or implement functions that are
+// not natively implemented on a specific platform.
//
-class BuiltInFunctionEmulator {
-public:
- BuiltInFunctionEmulator(sh::GLenum shaderType);
- // Records that a function is called by the shader and might needs to be
- // emulated. If the function's group is not in mFunctionGroupFilter, this
- // becomes an no-op.
- // Returns true if the function call needs to be replaced with an emulated
- // one.
- bool SetFunctionCalled(TOperator op, const TType& param);
- bool SetFunctionCalled(
- TOperator op, const TType& param1, const TType& param2);
-
- // Output function emulation definition. This should be before any other
- // shader source.
- void OutputEmulatedFunctionDefinition(TInfoSinkBase& out, bool withPrecision) const;
+class BuiltInFunctionEmulator
+{
+ public:
+ BuiltInFunctionEmulator();
void MarkBuiltInFunctionsForEmulation(TIntermNode* root);
@@ -38,54 +28,52 @@ public:
// "name(" becomes "webgl_name_emu(".
static TString GetEmulatedFunctionName(const TString& name);
-private:
- //
- // Built-in functions.
- //
- enum TBuiltInFunction {
- TFunctionCos1 = 0, // float cos(float);
- TFunctionCos2, // vec2 cos(vec2);
- TFunctionCos3, // vec3 cos(vec3);
- TFunctionCos4, // vec4 cos(vec4);
-
- TFunctionDistance1_1, // float distance(float, float);
- TFunctionDistance2_2, // vec2 distance(vec2, vec2);
- TFunctionDistance3_3, // vec3 distance(vec3, vec3);
- TFunctionDistance4_4, // vec4 distance(vec4, vec4);
-
- TFunctionDot1_1, // float dot(float, float);
- TFunctionDot2_2, // vec2 dot(vec2, vec2);
- TFunctionDot3_3, // vec3 dot(vec3, vec3);
- TFunctionDot4_4, // vec4 dot(vec4, vec4);
-
- TFunctionLength1, // float length(float);
- TFunctionLength2, // float length(vec2);
- TFunctionLength3, // float length(vec3);
- TFunctionLength4, // float length(vec4);
-
- TFunctionNormalize1, // float normalize(float);
- TFunctionNormalize2, // vec2 normalize(vec2);
- TFunctionNormalize3, // vec3 normalize(vec3);
- TFunctionNormalize4, // vec4 normalize(vec4);
-
- TFunctionReflect1_1, // float reflect(float, float);
- TFunctionReflect2_2, // vec2 reflect(vec2, vec2);
- TFunctionReflect3_3, // vec3 reflect(vec3, vec3);
- TFunctionReflect4_4, // vec4 reflect(vec4, vec4);
-
- TFunctionUnknown
- };
+ bool IsOutputEmpty() const;
+
+ // Output function emulation definition. This should be before any other
+ // shader source.
+ void OutputEmulatedFunctions(TInfoSinkBase& out) const;
+
+ // Add functions that need to be emulated.
+ void addEmulatedFunction(TOperator op, const TType& param, const char* emulatedFunctionDefinition);
+ void addEmulatedFunction(TOperator op, const TType& param1, const TType& param2, const char* emulatedFunctionDefinition);
+ void addEmulatedFunction(TOperator op, const TType& param1, const TType& param2, const TType& param3, const char* emulatedFunctionDefinition);
- TBuiltInFunction IdentifyFunction(TOperator op, const TType& param);
- TBuiltInFunction IdentifyFunction(
+ private:
+ class BuiltInFunctionEmulationMarker;
+
+ // Records that a function is called by the shader and might need to be
+ // emulated. If the function is not in mEmulatedFunctions, this becomes a
+ // no-op. Returns true if the function call needs to be replaced with an
+ // emulated one.
+ bool SetFunctionCalled(TOperator op, const TType& param);
+ bool SetFunctionCalled(
TOperator op, const TType& param1, const TType& param2);
+ bool SetFunctionCalled(
+ TOperator op, const TType& param1, const TType& param2, const TType& param3);
+
+ class FunctionId {
+ public:
+ FunctionId(TOperator op, const TType& param);
+ FunctionId(TOperator op, const TType& param1, const TType& param2);
+ FunctionId(TOperator op, const TType& param1, const TType& param2, const TType& param3);
+
+ bool operator==(const FunctionId& other) const;
+ bool operator<(const FunctionId& other) const;
+ private:
+ TOperator mOp;
+ TType mParam1;
+ TType mParam2;
+ TType mParam3;
+ };
- bool SetFunctionCalled(TBuiltInFunction function);
+ bool SetFunctionCalled(const FunctionId& functionId);
- std::vector<TBuiltInFunction> mFunctions;
+ // Map from function id to emulated function definition
+ std::map<FunctionId, std::string> mEmulatedFunctions;
- const bool* mFunctionMask; // a boolean flag for each function.
- const char** mFunctionSource;
+ // Called function ids
+ std::vector<FunctionId> mFunctions;
};
-#endif // COMPILIER_BUILT_IN_FUNCTION_EMULATOR_H_
+#endif // COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATOR_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp
new file mode 100644
index 0000000000..9de99831ad
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.cpp
@@ -0,0 +1,37 @@
+//
+// Copyright (c) 2002-2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "angle_gl.h"
+#include "compiler/translator/BuiltInFunctionEmulator.h"
+#include "compiler/translator/BuiltInFunctionEmulatorGLSL.h"
+#include "compiler/translator/SymbolTable.h"
+
+void InitBuiltInFunctionEmulatorForGLSL(BuiltInFunctionEmulator *emu, sh::GLenum shaderType)
+{
+ // we use macros here instead of function definitions to work around more GLSL
+ // compiler bugs, in particular on NVIDIA hardware on Mac OSX. Macros are
+ // problematic because if the argument has side-effects they will be repeatedly
+ // evaluated. This is unlikely to show up in real shaders, but is something to
+ // consider.
+
+ TType float1(EbtFloat);
+ TType float2(EbtFloat, 2);
+ TType float3(EbtFloat, 3);
+ TType float4(EbtFloat, 4);
+
+ if (shaderType == GL_FRAGMENT_SHADER)
+ {
+ emu->addEmulatedFunction(EOpCos, float1, "webgl_emu_precision float webgl_cos_emu(webgl_emu_precision float a) { return cos(a); }");
+ emu->addEmulatedFunction(EOpCos, float2, "webgl_emu_precision vec2 webgl_cos_emu(webgl_emu_precision vec2 a) { return cos(a); }");
+ emu->addEmulatedFunction(EOpCos, float3, "webgl_emu_precision vec3 webgl_cos_emu(webgl_emu_precision vec3 a) { return cos(a); }");
+ emu->addEmulatedFunction(EOpCos, float4, "webgl_emu_precision vec4 webgl_cos_emu(webgl_emu_precision vec4 a) { return cos(a); }");
+ }
+ emu->addEmulatedFunction(EOpDistance, float1, float1, "#define webgl_distance_emu(x, y) ((x) >= (y) ? (x) - (y) : (y) - (x))");
+ emu->addEmulatedFunction(EOpDot, float1, float1, "#define webgl_dot_emu(x, y) ((x) * (y))");
+ emu->addEmulatedFunction(EOpLength, float1, "#define webgl_length_emu(x) ((x) >= 0.0 ? (x) : -(x))");
+ emu->addEmulatedFunction(EOpNormalize, float1, "#define webgl_normalize_emu(x) ((x) == 0.0 ? 0.0 : ((x) > 0.0 ? 1.0 : -1.0))");
+ emu->addEmulatedFunction(EOpReflect, float1, float1, "#define webgl_reflect_emu(I, N) ((I) - 2.0 * (N) * (I) * (N))");
+}
diff --git a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.h b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.h
new file mode 100644
index 0000000000..5707a4b35a
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorGLSL.h
@@ -0,0 +1,19 @@
+//
+// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATORGLSL_H_
+#define COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATORGLSL_H_
+
+#include "GLSLANG/ShaderLang.h"
+
+class BuiltInFunctionEmulator;
+
+//
+// This is only a workaround for OpenGL driver bugs, and isn't needed in general.
+//
+void InitBuiltInFunctionEmulatorForGLSL(BuiltInFunctionEmulator *emu, sh::GLenum shaderType);
+
+#endif // COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATORGLSL_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp
new file mode 100644
index 0000000000..7123a0d5c0
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.cpp
@@ -0,0 +1,410 @@
+//
+// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "angle_gl.h"
+#include "compiler/translator/BuiltInFunctionEmulator.h"
+#include "compiler/translator/BuiltInFunctionEmulatorHLSL.h"
+#include "compiler/translator/SymbolTable.h"
+
+void InitBuiltInFunctionEmulatorForHLSL(BuiltInFunctionEmulator *emu)
+{
+ TType float1(EbtFloat);
+ TType float2(EbtFloat, 2);
+ TType float3(EbtFloat, 3);
+ TType float4(EbtFloat, 4);
+
+ emu->addEmulatedFunction(EOpMod, float1, float1,
+ "float webgl_mod_emu(float x, float y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpMod, float2, float2,
+ "float2 webgl_mod_emu(float2 x, float2 y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpMod, float2, float1,
+ "float2 webgl_mod_emu(float2 x, float y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpMod, float3, float3,
+ "float3 webgl_mod_emu(float3 x, float3 y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpMod, float3, float1,
+ "float3 webgl_mod_emu(float3 x, float y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpMod, float4, float4,
+ "float4 webgl_mod_emu(float4 x, float4 y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpMod, float4, float1,
+ "float4 webgl_mod_emu(float4 x, float y)\n"
+ "{\n"
+ " return x - y * floor(x / y);\n"
+ "}\n"
+ "\n");
+
+ emu->addEmulatedFunction(EOpFaceForward, float1, float1, float1,
+ "float webgl_faceforward_emu(float N, float I, float Nref)\n"
+ "{\n"
+ " if(dot(Nref, I) >= 0)\n"
+ " {\n"
+ " return -N;\n"
+ " }\n"
+ " else\n"
+ " {\n"
+ " return N;\n"
+ " }\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpFaceForward, float2, float2, float2,
+ "float2 webgl_faceforward_emu(float2 N, float2 I, float2 Nref)\n"
+ "{\n"
+ " if(dot(Nref, I) >= 0)\n"
+ " {\n"
+ " return -N;\n"
+ " }\n"
+ " else\n"
+ " {\n"
+ " return N;\n"
+ " }\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpFaceForward, float3, float3, float3,
+ "float3 webgl_faceforward_emu(float3 N, float3 I, float3 Nref)\n"
+ "{\n"
+ " if(dot(Nref, I) >= 0)\n"
+ " {\n"
+ " return -N;\n"
+ " }\n"
+ " else\n"
+ " {\n"
+ " return N;\n"
+ " }\n"
+ "}\n"
+ "\n");
+ emu->addEmulatedFunction(EOpFaceForward, float4, float4, float4,
+ "float4 webgl_faceforward_emu(float4 N, float4 I, float4 Nref)\n"
+ "{\n"
+ " if(dot(Nref, I) >= 0)\n"
+ " {\n"
+ " return -N;\n"
+ " }\n"
+ " else\n"
+ " {\n"
+ " return N;\n"
+ " }\n"
+ "}\n"
+ "\n");
+
+ emu->addEmulatedFunction(EOpAtan, float1, float1,
+ "float webgl_atan_emu(float y, float x)\n"
+ "{\n"
+ " if(x == 0 && y == 0) x = 1;\n" // Avoid producing a NaN
+ " return atan2(y, x);\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAtan, float2, float2,
+ "float2 webgl_atan_emu(float2 y, float2 x)\n"
+ "{\n"
+ " if(x[0] == 0 && y[0] == 0) x[0] = 1;\n"
+ " if(x[1] == 0 && y[1] == 0) x[1] = 1;\n"
+ " return float2(atan2(y[0], x[0]), atan2(y[1], x[1]));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAtan, float3, float3,
+ "float3 webgl_atan_emu(float3 y, float3 x)\n"
+ "{\n"
+ " if(x[0] == 0 && y[0] == 0) x[0] = 1;\n"
+ " if(x[1] == 0 && y[1] == 0) x[1] = 1;\n"
+ " if(x[2] == 0 && y[2] == 0) x[2] = 1;\n"
+ " return float3(atan2(y[0], x[0]), atan2(y[1], x[1]), atan2(y[2], x[2]));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAtan, float4, float4,
+ "float4 webgl_atan_emu(float4 y, float4 x)\n"
+ "{\n"
+ " if(x[0] == 0 && y[0] == 0) x[0] = 1;\n"
+ " if(x[1] == 0 && y[1] == 0) x[1] = 1;\n"
+ " if(x[2] == 0 && y[2] == 0) x[2] = 1;\n"
+ " if(x[3] == 0 && y[3] == 0) x[3] = 1;\n"
+ " return float4(atan2(y[0], x[0]), atan2(y[1], x[1]), atan2(y[2], x[2]), atan2(y[3], x[3]));\n"
+ "}\n");
+
+ emu->addEmulatedFunction(EOpAsinh, float1,
+ "float webgl_asinh_emu(in float x) {\n"
+ " return log(x + sqrt(pow(x, 2.0) + 1.0));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAsinh, float2,
+ "float2 webgl_asinh_emu(in float2 x) {\n"
+ " return log(x + sqrt(pow(x, 2.0) + 1.0));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAsinh, float3,
+ "float3 webgl_asinh_emu(in float3 x) {\n"
+ " return log(x + sqrt(pow(x, 2.0) + 1.0));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAsinh, float4,
+ "float4 webgl_asinh_emu(in float4 x) {\n"
+ " return log(x + sqrt(pow(x, 2.0) + 1.0));\n"
+ "}\n");
+
+ emu->addEmulatedFunction(EOpAcosh, float1,
+ "float webgl_acosh_emu(in float x) {\n"
+ " return log(x + sqrt(x + 1.0) * sqrt(x - 1.0));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAcosh, float2,
+ "float2 webgl_acosh_emu(in float2 x) {\n"
+ " return log(x + sqrt(x + 1.0) * sqrt(x - 1.0));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAcosh, float3,
+ "float3 webgl_acosh_emu(in float3 x) {\n"
+ " return log(x + sqrt(x + 1.0) * sqrt(x - 1.0));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAcosh, float4,
+ "float4 webgl_acosh_emu(in float4 x) {\n"
+ " return log(x + sqrt(x + 1.0) * sqrt(x - 1.0));\n"
+ "}\n");
+
+ emu->addEmulatedFunction(EOpAtanh, float1,
+ "float webgl_atanh_emu(in float x) {\n"
+ " return 0.5 * log((1.0 + x) / (1.0 - x));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAtanh, float2,
+ "float2 webgl_atanh_emu(in float2 x) {\n"
+ " return 0.5 * log((1.0 + x) / (1.0 - x));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAtanh, float3,
+ "float3 webgl_atanh_emu(in float3 x) {\n"
+ " return 0.5 * log((1.0 + x) / (1.0 - x));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpAtanh, float4,
+ "float4 webgl_atanh_emu(in float4 x) {\n"
+ " return 0.5 * log((1.0 + x) / (1.0 - x));\n"
+ "}\n");
+
+ emu->addEmulatedFunction(EOpRoundEven, float1,
+ "float webgl_roundEven_emu(in float x) {\n"
+ " return (frac(x) == 0.5 && trunc(x) % 2.0 == 0.0) ? trunc(x) : round(x);\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpRoundEven, float2,
+ "float2 webgl_roundEven_emu(in float2 x) {\n"
+ " float2 v;\n"
+ " v[0] = (frac(x[0]) == 0.5 && trunc(x[0]) % 2.0 == 0.0) ? trunc(x[0]) : round(x[0]);\n"
+ " v[1] = (frac(x[1]) == 0.5 && trunc(x[1]) % 2.0 == 0.0) ? trunc(x[1]) : round(x[1]);\n"
+ " return v;\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpRoundEven, float3,
+ "float3 webgl_roundEven_emu(in float3 x) {\n"
+ " float3 v;\n"
+ " v[0] = (frac(x[0]) == 0.5 && trunc(x[0]) % 2.0 == 0.0) ? trunc(x[0]) : round(x[0]);\n"
+ " v[1] = (frac(x[1]) == 0.5 && trunc(x[1]) % 2.0 == 0.0) ? trunc(x[1]) : round(x[1]);\n"
+ " v[2] = (frac(x[2]) == 0.5 && trunc(x[2]) % 2.0 == 0.0) ? trunc(x[2]) : round(x[2]);\n"
+ " return v;\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpRoundEven, float4,
+ "float4 webgl_roundEven_emu(in float4 x) {\n"
+ " float4 v;\n"
+ " v[0] = (frac(x[0]) == 0.5 && trunc(x[0]) % 2.0 == 0.0) ? trunc(x[0]) : round(x[0]);\n"
+ " v[1] = (frac(x[1]) == 0.5 && trunc(x[1]) % 2.0 == 0.0) ? trunc(x[1]) : round(x[1]);\n"
+ " v[2] = (frac(x[2]) == 0.5 && trunc(x[2]) % 2.0 == 0.0) ? trunc(x[2]) : round(x[2]);\n"
+ " v[3] = (frac(x[3]) == 0.5 && trunc(x[3]) % 2.0 == 0.0) ? trunc(x[3]) : round(x[3]);\n"
+ " return v;\n"
+ "}\n");
+
+ emu->addEmulatedFunction(EOpPackSnorm2x16, float2,
+ "int webgl_toSnorm(in float x) {\n"
+ " return int(round(clamp(x, -1.0, 1.0) * 32767.0));\n"
+ "}\n"
+ "\n"
+ "uint webgl_packSnorm2x16_emu(in float2 v) {\n"
+ " int x = webgl_toSnorm(v.x);\n"
+ " int y = webgl_toSnorm(v.y);\n"
+ " return (asuint(y) << 16) | (asuint(x) & 0xffffu);\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpPackUnorm2x16, float2,
+ "uint webgl_toUnorm(in float x) {\n"
+ " return uint(round(clamp(x, 0.0, 1.0) * 65535.0));\n"
+ "}\n"
+ "\n"
+ "uint webgl_packUnorm2x16_emu(in float2 v) {\n"
+ " uint x = webgl_toUnorm(v.x);\n"
+ " uint y = webgl_toUnorm(v.y);\n"
+ " return (y << 16) | x;\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpPackHalf2x16, float2,
+ "uint webgl_packHalf2x16_emu(in float2 v) {\n"
+ " uint x = f32tof16(v.x);\n"
+ " uint y = f32tof16(v.y);\n"
+ " return (y << 16) | x;\n"
+ "}\n");
+
+ TType uint1(EbtUInt);
+
+ emu->addEmulatedFunction(EOpUnpackSnorm2x16, uint1,
+ "float webgl_fromSnorm(in uint x) {\n"
+ " int xi = asint(x & 0x7fffu) - asint(x & 0x8000u);\n"
+ " return clamp(float(xi) / 32767.0, -1.0, 1.0);\n"
+ "}\n"
+ "\n"
+ "float2 webgl_unpackSnorm2x16_emu(in uint u) {\n"
+ " uint y = (u >> 16);\n"
+ " uint x = u;\n"
+ " return float2(webgl_fromSnorm(x), webgl_fromSnorm(y));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpUnpackUnorm2x16, uint1,
+ "float webgl_fromUnorm(in uint x) {\n"
+ " return float(x) / 65535.0;\n"
+ "}\n"
+ "\n"
+ "float2 webgl_unpackUnorm2x16_emu(in uint u) {\n"
+ " uint y = (u >> 16);\n"
+ " uint x = u & 0xffffu;\n"
+ " return float2(webgl_fromUnorm(x), webgl_fromUnorm(y));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpUnpackHalf2x16, uint1,
+ "float2 webgl_unpackHalf2x16_emu(in uint u) {\n"
+ " uint y = (u >> 16);\n"
+ " uint x = u & 0xffffu;\n"
+ " return float2(f16tof32(x), f16tof32(y));\n"
+ "}\n");
+
+ // The matrix resulting from outer product needs to be transposed
+ // (matrices are stored as transposed to simplify element access in HLSL).
+ // So the function should return transpose(c * r) where c is a column vector
+ // and r is a row vector. This can be simplified by using the following
+ // formula:
+ // transpose(c * r) = transpose(r) * transpose(c)
+ // transpose(r) and transpose(c) are in a sense free, since to get the
+ // transpose of r, we simply can build a column matrix out of the original
+ // vector instead of a row matrix.
+ emu->addEmulatedFunction(EOpOuterProduct, float2, float2,
+ "float2x2 webgl_outerProduct_emu(in float2 c, in float2 r) {\n"
+ " return mul(float2x1(r), float1x2(c));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpOuterProduct, float3, float3,
+ "float3x3 webgl_outerProduct_emu(in float3 c, in float3 r) {\n"
+ " return mul(float3x1(r), float1x3(c));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpOuterProduct, float4, float4,
+ "float4x4 webgl_outerProduct_emu(in float4 c, in float4 r) {\n"
+ " return mul(float4x1(r), float1x4(c));\n"
+ "}\n");
+
+ emu->addEmulatedFunction(EOpOuterProduct, float3, float2,
+ "float2x3 webgl_outerProduct_emu(in float3 c, in float2 r) {\n"
+ " return mul(float2x1(r), float1x3(c));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpOuterProduct, float2, float3,
+ "float3x2 webgl_outerProduct_emu(in float2 c, in float3 r) {\n"
+ " return mul(float3x1(r), float1x2(c));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpOuterProduct, float4, float2,
+ "float2x4 webgl_outerProduct_emu(in float4 c, in float2 r) {\n"
+ " return mul(float2x1(r), float1x4(c));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpOuterProduct, float2, float4,
+ "float4x2 webgl_outerProduct_emu(in float2 c, in float4 r) {\n"
+ " return mul(float4x1(r), float1x2(c));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpOuterProduct, float4, float3,
+ "float3x4 webgl_outerProduct_emu(in float4 c, in float3 r) {\n"
+ " return mul(float3x1(r), float1x4(c));\n"
+ "}\n");
+ emu->addEmulatedFunction(EOpOuterProduct, float3, float4,
+ "float4x3 webgl_outerProduct_emu(in float3 c, in float4 r) {\n"
+ " return mul(float4x1(r), float1x3(c));\n"
+ "}\n");
+
+ TType mat2(EbtFloat, 2, 2);
+ TType mat3(EbtFloat, 3, 3);
+ TType mat4(EbtFloat, 4, 4);
+
+ // Remember here that the parameter matrix is actually the transpose
+ // of the matrix that we're trying to invert, and the resulting matrix
+ // should also be the transpose of the inverse.
+
+ // When accessing the parameter matrix with m[a][b] it can be thought of so
+ // that a is the column and b is the row of the matrix that we're inverting.
+
+ // We calculate the inverse as the adjugate matrix divided by the
+ // determinant of the matrix being inverted. However, as the result needs
+ // to be transposed, we actually use of the transpose of the adjugate matrix
+ // which happens to be the cofactor matrix. That's stored in "cof".
+
+ // We don't need to care about divide-by-zero since results are undefined
+ // for singular or poorly-conditioned matrices.
+
+ emu->addEmulatedFunction(EOpInverse, mat2,
+ "float2x2 webgl_inverse_emu(in float2x2 m) {\n"
+ " float2x2 cof = { m[1][1], -m[0][1], -m[1][0], m[0][0] };\n"
+ " return cof / determinant(transpose(m));\n"
+ "}\n");
+
+ // cofAB is the cofactor for column A and row B.
+
+ emu->addEmulatedFunction(EOpInverse, mat3,
+ "float3x3 webgl_inverse_emu(in float3x3 m) {\n"
+ " float cof00 = m[1][1] * m[2][2] - m[2][1] * m[1][2];\n"
+ " float cof01 = -(m[1][0] * m[2][2] - m[2][0] * m[1][2]);\n"
+ " float cof02 = m[1][0] * m[2][1] - m[2][0] * m[1][1];\n"
+ " float cof10 = -(m[0][1] * m[2][2] - m[2][1] * m[0][2]);\n"
+ " float cof11 = m[0][0] * m[2][2] - m[2][0] * m[0][2];\n"
+ " float cof12 = -(m[0][0] * m[2][1] - m[2][0] * m[0][1]);\n"
+ " float cof20 = m[0][1] * m[1][2] - m[1][1] * m[0][2];\n"
+ " float cof21 = -(m[0][0] * m[1][2] - m[1][0] * m[0][2]);\n"
+ " float cof22 = m[0][0] * m[1][1] - m[1][0] * m[0][1];\n"
+ " float3x3 cof = { cof00, cof10, cof20, cof01, cof11, cof21, cof02, cof12, cof22 };\n"
+ " return cof / determinant(transpose(m));\n"
+ "}\n");
+
+ emu->addEmulatedFunction(EOpInverse, mat4,
+ "float4x4 webgl_inverse_emu(in float4x4 m) {\n"
+ " float cof00 = m[1][1] * m[2][2] * m[3][3] + m[2][1] * m[3][2] * m[1][3] + m[3][1] * m[1][2] * m[2][3]"
+ " - m[1][1] * m[3][2] * m[2][3] - m[2][1] * m[1][2] * m[3][3] - m[3][1] * m[2][2] * m[1][3];\n"
+ " float cof01 = -(m[1][0] * m[2][2] * m[3][3] + m[2][0] * m[3][2] * m[1][3] + m[3][0] * m[1][2] * m[2][3]"
+ " - m[1][0] * m[3][2] * m[2][3] - m[2][0] * m[1][2] * m[3][3] - m[3][0] * m[2][2] * m[1][3]);\n"
+ " float cof02 = m[1][0] * m[2][1] * m[3][3] + m[2][0] * m[3][1] * m[1][3] + m[3][0] * m[1][1] * m[2][3]"
+ " - m[1][0] * m[3][1] * m[2][3] - m[2][0] * m[1][1] * m[3][3] - m[3][0] * m[2][1] * m[1][3];\n"
+ " float cof03 = -(m[1][0] * m[2][1] * m[3][2] + m[2][0] * m[3][1] * m[1][2] + m[3][0] * m[1][1] * m[2][2]"
+ " - m[1][0] * m[3][1] * m[2][2] - m[2][0] * m[1][1] * m[3][2] - m[3][0] * m[2][1] * m[1][2]);\n"
+ " float cof10 = -(m[0][1] * m[2][2] * m[3][3] + m[2][1] * m[3][2] * m[0][3] + m[3][1] * m[0][2] * m[2][3]"
+ " - m[0][1] * m[3][2] * m[2][3] - m[2][1] * m[0][2] * m[3][3] - m[3][1] * m[2][2] * m[0][3]);\n"
+ " float cof11 = m[0][0] * m[2][2] * m[3][3] + m[2][0] * m[3][2] * m[0][3] + m[3][0] * m[0][2] * m[2][3]"
+ " - m[0][0] * m[3][2] * m[2][3] - m[2][0] * m[0][2] * m[3][3] - m[3][0] * m[2][2] * m[0][3];\n"
+ " float cof12 = -(m[0][0] * m[2][1] * m[3][3] + m[2][0] * m[3][1] * m[0][3] + m[3][0] * m[0][1] * m[2][3]"
+ " - m[0][0] * m[3][1] * m[2][3] - m[2][0] * m[0][1] * m[3][3] - m[3][0] * m[2][1] * m[0][3]);\n"
+ " float cof13 = m[0][0] * m[2][1] * m[3][2] + m[2][0] * m[3][1] * m[0][2] + m[3][0] * m[0][1] * m[2][2]"
+ " - m[0][0] * m[3][1] * m[2][2] - m[2][0] * m[0][1] * m[3][2] - m[3][0] * m[2][1] * m[0][2];\n"
+ " float cof20 = m[0][1] * m[1][2] * m[3][3] + m[1][1] * m[3][2] * m[0][3] + m[3][1] * m[0][2] * m[1][3]"
+ " - m[0][1] * m[3][2] * m[1][3] - m[1][1] * m[0][2] * m[3][3] - m[3][1] * m[1][2] * m[0][3];\n"
+ " float cof21 = -(m[0][0] * m[1][2] * m[3][3] + m[1][0] * m[3][2] * m[0][3] + m[3][0] * m[0][2] * m[1][3]"
+ " - m[0][0] * m[3][2] * m[1][3] - m[1][0] * m[0][2] * m[3][3] - m[3][0] * m[1][2] * m[0][3]);\n"
+ " float cof22 = m[0][0] * m[1][1] * m[3][3] + m[1][0] * m[3][1] * m[0][3] + m[3][0] * m[0][1] * m[1][3]"
+ " - m[0][0] * m[3][1] * m[1][3] - m[1][0] * m[0][1] * m[3][3] - m[3][0] * m[1][1] * m[0][3];\n"
+ " float cof23 = -(m[0][0] * m[1][1] * m[3][2] + m[1][0] * m[3][1] * m[0][2] + m[3][0] * m[0][1] * m[1][2]"
+ " - m[0][0] * m[3][1] * m[1][2] - m[1][0] * m[0][1] * m[3][2] - m[3][0] * m[1][1] * m[0][2]);\n"
+ " float cof30 = -(m[0][1] * m[1][2] * m[2][3] + m[1][1] * m[2][2] * m[0][3] + m[2][1] * m[0][2] * m[1][3]"
+ " - m[0][1] * m[2][2] * m[1][3] - m[1][1] * m[0][2] * m[2][3] - m[2][1] * m[1][2] * m[0][3]);\n"
+ " float cof31 = m[0][0] * m[1][2] * m[2][3] + m[1][0] * m[2][2] * m[0][3] + m[2][0] * m[0][2] * m[1][3]"
+ " - m[0][0] * m[2][2] * m[1][3] - m[1][0] * m[0][2] * m[2][3] - m[2][0] * m[1][2] * m[0][3];\n"
+ " float cof32 = -(m[0][0] * m[1][1] * m[2][3] + m[1][0] * m[2][1] * m[0][3] + m[2][0] * m[0][1] * m[1][3]"
+ " - m[0][0] * m[2][1] * m[1][3] - m[1][0] * m[0][1] * m[2][3] - m[2][0] * m[1][1] * m[0][3]);\n"
+ " float cof33 = m[0][0] * m[1][1] * m[2][2] + m[1][0] * m[2][1] * m[0][2] + m[2][0] * m[0][1] * m[1][2]"
+ " - m[0][0] * m[2][1] * m[1][2] - m[1][0] * m[0][1] * m[2][2] - m[2][0] * m[1][1] * m[0][2];\n"
+ " float4x4 cof = { cof00, cof10, cof20, cof30, cof01, cof11, cof21, cof31,"
+ " cof02, cof12, cof22, cof32, cof03, cof13, cof23, cof33 };\n"
+ " return cof / determinant(transpose(m));\n"
+ "}\n");
+}
diff --git a/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.h b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.h
new file mode 100644
index 0000000000..4c45a93dc4
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/BuiltInFunctionEmulatorHLSL.h
@@ -0,0 +1,16 @@
+//
+// Copyright (c) 2014 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATORHLSL_H_
+#define COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATORHLSL_H_
+
+#include "GLSLANG/ShaderLang.h"
+
+class BuiltInFunctionEmulator;
+
+void InitBuiltInFunctionEmulatorForHLSL(BuiltInFunctionEmulator *emu);
+
+#endif // COMPILER_TRANSLATOR_BUILTINFUNCTIONEMULATORHLSL_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/CodeGen.cpp b/src/3rdparty/angle/src/compiler/translator/CodeGen.cpp
index 71056f4297..5e3eb1cc05 100644
--- a/src/3rdparty/angle/src/compiler/translator/CodeGen.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/CodeGen.cpp
@@ -6,7 +6,9 @@
#include "compiler/translator/TranslatorESSL.h"
#include "compiler/translator/TranslatorGLSL.h"
+#ifdef ANGLE_ENABLE_HLSL
#include "compiler/translator/TranslatorHLSL.h"
+#endif // ANGLE_ENABLE_HLSL
//
// This function must be provided to create the actual
@@ -17,14 +19,22 @@ TCompiler* ConstructCompiler(
sh::GLenum type, ShShaderSpec spec, ShShaderOutput output)
{
switch (output) {
- case SH_ESSL_OUTPUT:
+ case SH_ESSL_OUTPUT:
return new TranslatorESSL(type, spec);
- case SH_GLSL_OUTPUT:
- return new TranslatorGLSL(type, spec);
- case SH_HLSL9_OUTPUT:
- case SH_HLSL11_OUTPUT:
+ case SH_GLSL_CORE_OUTPUT:
+ case SH_GLSL_COMPATIBILITY_OUTPUT:
+ return new TranslatorGLSL(type, spec, output);
+ case SH_HLSL9_OUTPUT:
+ case SH_HLSL11_OUTPUT:
+#ifdef ANGLE_ENABLE_HLSL
return new TranslatorHLSL(type, spec, output);
- default:
+#else
+ // This compiler is not supported in this
+ // configuration. Return NULL per the ShConstructCompiler API.
+ return NULL;
+#endif // ANGLE_ENABLE_HLSL
+ default:
+ // Unknown format. Return NULL per the ShConstructCompiler API.
return NULL;
}
}
diff --git a/src/3rdparty/angle/src/compiler/translator/Common.h b/src/3rdparty/angle/src/compiler/translator/Common.h
index 1e4503e340..ac1aef0f4c 100644
--- a/src/3rdparty/angle/src/compiler/translator/Common.h
+++ b/src/3rdparty/angle/src/compiler/translator/Common.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef _COMMON_INCLUDED_
-#define _COMMON_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_COMMON_H_
+#define COMPILER_TRANSLATOR_COMMON_H_
#include <map>
#include <sstream>
@@ -89,4 +89,4 @@ inline TString str(T i)
return buffer;
}
-#endif // _COMMON_INCLUDED_
+#endif // COMPILER_TRANSLATOR_COMMON_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/Compiler.cpp b/src/3rdparty/angle/src/compiler/translator/Compiler.cpp
index 5c62a64d10..534861ca70 100644
--- a/src/3rdparty/angle/src/compiler/translator/Compiler.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/Compiler.cpp
@@ -4,7 +4,6 @@
// found in the LICENSE file.
//
-#include "compiler/translator/BuiltInFunctionEmulator.h"
#include "compiler/translator/Compiler.h"
#include "compiler/translator/DetectCallDepth.h"
#include "compiler/translator/ForLoopUnroll.h"
@@ -126,7 +125,8 @@ TCompiler::TCompiler(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output)
maxCallStackDepth(0),
fragmentPrecisionHigh(false),
clampingStrategy(SH_CLAMP_WITH_CLAMP_INTRINSIC),
- builtInFunctionEmulator(type)
+ builtInFunctionEmulator(),
+ mSourcePath(NULL)
{
}
@@ -159,33 +159,41 @@ bool TCompiler::Init(const ShBuiltInResources& resources)
return true;
}
-bool TCompiler::compile(const char* const shaderStrings[],
- size_t numStrings,
- int compileOptions)
+TIntermNode *TCompiler::compileTreeForTesting(const char* const shaderStrings[],
+ size_t numStrings, int compileOptions)
+{
+ return compileTreeImpl(shaderStrings, numStrings, compileOptions);
+}
+
+TIntermNode *TCompiler::compileTreeImpl(const char* const shaderStrings[],
+ size_t numStrings, int compileOptions)
{
- TScopedPoolAllocator scopedAlloc(&allocator);
clearResults();
- if (numStrings == 0)
- return true;
+ ASSERT(numStrings > 0);
+ ASSERT(GetGlobalPoolAllocator());
+
+ // Reset the extension behavior for each compilation unit.
+ ResetExtensionBehavior(extensionBehavior);
// If compiling for WebGL, validate loop and indexing as well.
if (IsWebGLBasedSpec(shaderSpec))
compileOptions |= SH_VALIDATE_LOOP_INDEXING;
// First string is path of source file if flag is set. The actual source follows.
- const char* sourcePath = NULL;
size_t firstSource = 0;
if (compileOptions & SH_SOURCE_PATH)
{
- sourcePath = shaderStrings[0];
+ mSourcePath = shaderStrings[0];
++firstSource;
}
+ bool debugShaderPrecision = getResources().WEBGL_debug_shader_precision == 1;
TIntermediate intermediate(infoSink);
TParseContext parseContext(symbolTable, extensionBehavior, intermediate,
shaderType, shaderSpec, compileOptions, true,
- sourcePath, infoSink);
+ infoSink, debugShaderPrecision);
+
parseContext.fragmentPrecisionHigh = fragmentPrecisionHigh;
SetGlobalParseContext(&parseContext);
@@ -206,6 +214,8 @@ bool TCompiler::compile(const char* const shaderStrings[],
success = false;
}
+ TIntermNode *root = NULL;
+
if (success)
{
mPragma = parseContext.pragma();
@@ -214,7 +224,7 @@ bool TCompiler::compile(const char* const shaderStrings[],
symbolTable.setGlobalInvariant();
}
- TIntermNode* root = parseContext.treeRoot;
+ root = parseContext.treeRoot;
success = intermediate.postProcess(root);
// Disallow expressions deemed too complex.
@@ -255,8 +265,11 @@ bool TCompiler::compile(const char* const shaderStrings[],
}
// Built-in function emulation needs to happen after validateLimitations pass.
- if (success && (compileOptions & SH_EMULATE_BUILT_IN_FUNCTIONS))
+ if (success)
+ {
+ initBuiltInFunctionEmulator(&builtInFunctionEmulator, compileOptions);
builtInFunctionEmulator.MarkBuiltInFunctionsForEmulation(root);
+ }
// Clamping uniform array bounds needs to happen after validateLimitations pass.
if (success && (compileOptions & SH_CLAMP_INDIRECT_ARRAY_BOUNDS))
@@ -301,18 +314,37 @@ bool TCompiler::compile(const char* const shaderStrings[],
RegenerateStructNames gen(symbolTable, shaderVersion);
root->traverse(&gen);
}
-
- if (success && (compileOptions & SH_INTERMEDIATE_TREE))
- intermediate.outputTree(root);
-
- if (success && (compileOptions & SH_OBJECT_CODE))
- translate(root);
}
- // Cleanup memory.
- intermediate.remove(parseContext.treeRoot);
SetGlobalParseContext(NULL);
- return success;
+ if (success)
+ return root;
+
+ return NULL;
+}
+
+bool TCompiler::compile(const char* const shaderStrings[],
+ size_t numStrings, int compileOptions)
+{
+ if (numStrings == 0)
+ return true;
+
+ TScopedPoolAllocator scopedAlloc(&allocator);
+ TIntermNode *root = compileTreeImpl(shaderStrings, numStrings, compileOptions);
+
+ if (root)
+ {
+ if (compileOptions & SH_INTERMEDIATE_TREE)
+ TIntermediate::outputTree(root, infoSink.info);
+
+ if (compileOptions & SH_OBJECT_CODE)
+ translate(root, compileOptions);
+
+ // The IntermNode tree doesn't need to be deleted here, since the
+ // memory will be freed in a big chunk by the PoolAllocator.
+ return true;
+ }
+ return false;
}
bool TCompiler::InitBuiltInSymbolTable(const ShBuiltInResources &resources)
@@ -390,11 +422,15 @@ void TCompiler::setResourceString()
<< ":MaxCallStackDepth:" << compileResources.MaxCallStackDepth
<< ":EXT_frag_depth:" << compileResources.EXT_frag_depth
<< ":EXT_shader_texture_lod:" << compileResources.EXT_shader_texture_lod
+ << ":EXT_shader_framebuffer_fetch:" << compileResources.EXT_shader_framebuffer_fetch
+ << ":NV_shader_framebuffer_fetch:" << compileResources.NV_shader_framebuffer_fetch
+ << ":ARM_shader_framebuffer_fetch:" << compileResources.ARM_shader_framebuffer_fetch
<< ":MaxVertexOutputVectors:" << compileResources.MaxVertexOutputVectors
<< ":MaxFragmentInputVectors:" << compileResources.MaxFragmentInputVectors
<< ":MinProgramTexelOffset:" << compileResources.MinProgramTexelOffset
<< ":MaxProgramTexelOffset:" << compileResources.MaxProgramTexelOffset
- << ":NV_draw_buffers:" << compileResources.NV_draw_buffers;
+ << ":NV_draw_buffers:" << compileResources.NV_draw_buffers
+ << ":WEBGL_debug_shader_precision:" << compileResources.WEBGL_debug_shader_precision;
builtInResourcesString = strstream.str();
}
@@ -416,27 +452,29 @@ void TCompiler::clearResults()
builtInFunctionEmulator.Cleanup();
nameMap.clear();
+
+ mSourcePath = NULL;
}
-bool TCompiler::detectCallDepth(TIntermNode* root, TInfoSink& infoSink, bool limitCallStackDepth)
+bool TCompiler::detectCallDepth(TIntermNode* inputRoot, TInfoSink& inputInfoSink, bool limitCallStackDepth)
{
- DetectCallDepth detect(infoSink, limitCallStackDepth, maxCallStackDepth);
- root->traverse(&detect);
+ DetectCallDepth detect(inputInfoSink, limitCallStackDepth, maxCallStackDepth);
+ inputRoot->traverse(&detect);
switch (detect.detectCallDepth())
{
case DetectCallDepth::kErrorNone:
return true;
case DetectCallDepth::kErrorMissingMain:
- infoSink.info.prefix(EPrefixError);
- infoSink.info << "Missing main()";
+ inputInfoSink.info.prefix(EPrefixError);
+ inputInfoSink.info << "Missing main()";
return false;
case DetectCallDepth::kErrorRecursion:
- infoSink.info.prefix(EPrefixError);
- infoSink.info << "Function recursion detected";
+ inputInfoSink.info.prefix(EPrefixError);
+ inputInfoSink.info << "Function recursion detected";
return false;
case DetectCallDepth::kErrorMaxDepthExceeded:
- infoSink.info.prefix(EPrefixError);
- infoSink.info << "Function call stack too deep";
+ inputInfoSink.info.prefix(EPrefixError);
+ inputInfoSink.info << "Function call stack too deep";
return false;
default:
UNREACHABLE();
@@ -594,6 +632,11 @@ const TExtensionBehavior& TCompiler::getExtensionBehavior() const
return extensionBehavior;
}
+const char *TCompiler::getSourcePath() const
+{
+ return mSourcePath;
+}
+
const ShBuiltInResources& TCompiler::getResources() const
{
return compileResources;
diff --git a/src/3rdparty/angle/src/compiler/translator/Compiler.h b/src/3rdparty/angle/src/compiler/translator/Compiler.h
index b6c9d13ed0..bcdb0d4c9d 100644
--- a/src/3rdparty/angle/src/compiler/translator/Compiler.h
+++ b/src/3rdparty/angle/src/compiler/translator/Compiler.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef _SHHANDLE_INCLUDED_
-#define _SHHANDLE_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_COMPILER_H_
+#define COMPILER_TRANSLATOR_COMPILER_H_
//
// Machine independent part of the compiler private objects
@@ -25,7 +25,9 @@
class TCompiler;
class TDependencyGraph;
+#ifdef ANGLE_ENABLE_HLSL
class TranslatorHLSL;
+#endif // ANGLE_ENABLE_HLSL
//
// Helper function to identify specs that are based on the WebGL spec,
@@ -41,7 +43,9 @@ public:
TShHandleBase();
virtual ~TShHandleBase();
virtual TCompiler* getAsCompiler() { return 0; }
+#ifdef ANGLE_ENABLE_HLSL
virtual TranslatorHLSL* getAsTranslatorHLSL() { return 0; }
+#endif // ANGLE_ENABLE_HLSL
protected:
// Memory allocator. Allocates and tracks memory required by the compiler.
@@ -61,9 +65,15 @@ class TCompiler : public TShHandleBase
virtual TCompiler* getAsCompiler() { return this; }
bool Init(const ShBuiltInResources& resources);
+
+ // compileTreeForTesting should be used only when tests require access to
+ // the AST. Users of this function need to manually manage the global pool
+ // allocator. Returns NULL whenever there are compilation errors.
+ TIntermNode *compileTreeForTesting(const char* const shaderStrings[],
+ size_t numStrings, int compileOptions);
+
bool compile(const char* const shaderStrings[],
- size_t numStrings,
- int compileOptions);
+ size_t numStrings, int compileOptions);
// Get results of the last compilation.
int getShaderVersion() const { return shaderVersion; }
@@ -104,8 +114,10 @@ class TCompiler : public TShHandleBase
bool validateLimitations(TIntermNode* root);
// Collect info for all attribs, uniforms, varyings.
void collectVariables(TIntermNode* root);
+ // Add emulated functions to the built-in function emulator.
+ virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu, int compileOptions) {};
// Translate to object code.
- virtual void translate(TIntermNode* root) = 0;
+ virtual void translate(TIntermNode *root, int compileOptions) = 0;
// Returns true if, after applying the packing rules in the GLSL 1.017 spec
// Appendix A, section 7, the shader does not use too many uniforms.
bool enforcePackingRestrictions();
@@ -130,6 +142,7 @@ class TCompiler : public TShHandleBase
bool limitExpressionComplexity(TIntermNode* root);
// Get built-in extensions with default behavior.
const TExtensionBehavior& getExtensionBehavior() const;
+ const char *getSourcePath() const;
const TPragma& getPragma() const { return mPragma; }
void writePragma();
@@ -145,6 +158,9 @@ class TCompiler : public TShHandleBase
std::vector<sh::InterfaceBlock> interfaceBlocks;
private:
+ TIntermNode *compileTreeImpl(const char* const shaderStrings[],
+ size_t numStrings, int compileOptions);
+
sh::GLenum shaderType;
ShShaderSpec shaderSpec;
ShShaderOutput outputType;
@@ -170,6 +186,7 @@ class TCompiler : public TShHandleBase
// Results of compilation.
int shaderVersion;
TInfoSink infoSink; // Output sink.
+ const char *mSourcePath; // Path of source file or NULL
// name hashing.
ShHashFunction64 hashFunction;
@@ -191,4 +208,4 @@ TCompiler* ConstructCompiler(
sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
void DeleteCompiler(TCompiler*);
-#endif // _SHHANDLE_INCLUDED_
+#endif // COMPILER_TRANSLATOR_COMPILER_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/ConstantUnion.h b/src/3rdparty/angle/src/compiler/translator/ConstantUnion.h
index 5e86c64805..31ff2ccfa7 100644
--- a/src/3rdparty/angle/src/compiler/translator/ConstantUnion.h
+++ b/src/3rdparty/angle/src/compiler/translator/ConstantUnion.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef _CONSTANT_UNION_INCLUDED_
-#define _CONSTANT_UNION_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_CONSTANTUNION_H_
+#define COMPILER_TRANSLATOR_CONSTANTUNION_H_
#include <assert.h>
@@ -254,7 +254,10 @@ public:
ConstantUnion operator<<(const ConstantUnion& constant) const
{
ConstantUnion returnValue;
- assert(type == constant.type);
+ // The signedness of the second parameter might be different, but we
+ // don't care, since the result is undefined if the second parameter is
+ // negative, and aliasing should not be a problem with unions.
+ assert(constant.type == EbtInt || constant.type == EbtUInt);
switch (type) {
case EbtInt: returnValue.setIConst(iConst << constant.iConst); break;
case EbtUInt: returnValue.setUConst(uConst << constant.uConst); break;
@@ -267,7 +270,7 @@ public:
ConstantUnion operator&(const ConstantUnion& constant) const
{
ConstantUnion returnValue;
- assert(type == constant.type);
+ assert(constant.type == EbtInt || constant.type == EbtUInt);
switch (type) {
case EbtInt: returnValue.setIConst(iConst & constant.iConst); break;
case EbtUInt: returnValue.setUConst(uConst & constant.uConst); break;
@@ -340,4 +343,4 @@ private:
TBasicType type;
};
-#endif // _CONSTANT_UNION_INCLUDED_
+#endif // COMPILER_TRANSLATOR_CONSTANTUNION_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.cpp b/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.cpp
index bfc1d5852f..0dc5d22709 100644
--- a/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.cpp
@@ -33,7 +33,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe
ASSERT(visit == PreVisit);
ASSERT(detectCallDepth);
- int maxDepth = depth;
+ int retMaxDepth = depth;
visit = InVisit;
for (size_t i = 0; i < callees.size(); ++i) {
switch (callees[i]->visit) {
@@ -52,7 +52,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe
detectCallDepth->getInfoSink().info << "<-" << callees[i]->getName();
return callDepth;
}
- maxDepth = std::max(callDepth, maxDepth);
+ retMaxDepth = std::max(callDepth, retMaxDepth);
break;
}
default:
@@ -61,7 +61,7 @@ int DetectCallDepth::FunctionNode::detectCallDepth(DetectCallDepth* detectCallDe
}
}
visit = PostVisit;
- return maxDepth;
+ return retMaxDepth;
}
void DetectCallDepth::FunctionNode::reset()
diff --git a/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.h b/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.h
index 86810650dc..8dd1391e67 100644
--- a/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.h
+++ b/src/3rdparty/angle/src/compiler/translator/DetectCallDepth.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_DETECT_RECURSION_H_
-#define COMPILER_DETECT_RECURSION_H_
+#ifndef COMPILER_TRANSLATOR_DETECTCALLDEPTH_H_
+#define COMPILER_TRANSLATOR_DETECTCALLDEPTH_H_
#include <limits.h>
#include "compiler/translator/IntermNode.h"
@@ -75,4 +75,4 @@ private:
void operator=(const DetectCallDepth&);
};
-#endif // COMPILER_DETECT_RECURSION_H_
+#endif // COMPILER_TRANSLATOR_DETECTCALLDEPTH_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/DetectDiscontinuity.h b/src/3rdparty/angle/src/compiler/translator/DetectDiscontinuity.h
index 67e37be398..623be13533 100644
--- a/src/3rdparty/angle/src/compiler/translator/DetectDiscontinuity.h
+++ b/src/3rdparty/angle/src/compiler/translator/DetectDiscontinuity.h
@@ -8,8 +8,8 @@
// gradients of functions with discontinuities.
//
-#ifndef COMPILER_DETECTDISCONTINUITY_H_
-#define COMPILER_DETECTDISCONTINUITY_H_
+#ifndef COMPILER_TRANSLATOR_DETECTDISCONTINUITY_H_
+#define COMPILER_TRANSLATOR_DETECTDISCONTINUITY_H_
#include "compiler/translator/IntermNode.h"
@@ -68,4 +68,4 @@ bool containsGradientOperation(TIntermNode *node);
}
-#endif // COMPILER_DETECTDISCONTINUITY_H_
+#endif // COMPILER_TRANSLATOR_DETECTDISCONTINUITY_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/Diagnostics.h b/src/3rdparty/angle/src/compiler/translator/Diagnostics.h
index 664da7803b..078bc97772 100644
--- a/src/3rdparty/angle/src/compiler/translator/Diagnostics.h
+++ b/src/3rdparty/angle/src/compiler/translator/Diagnostics.h
@@ -4,14 +4,15 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_DIAGNOSTICS_H_
-#define COMPILER_DIAGNOSTICS_H_
+#ifndef COMPILER_TRANSLATOR_DIAGNOSTICS_H_
+#define COMPILER_TRANSLATOR_DIAGNOSTICS_H_
+#include "common/angleutils.h"
#include "compiler/preprocessor/DiagnosticsBase.h"
class TInfoSink;
-class TDiagnostics : public pp::Diagnostics
+class TDiagnostics : public pp::Diagnostics, angle::NonCopyable
{
public:
TDiagnostics(TInfoSink& infoSink);
@@ -41,4 +42,4 @@ class TDiagnostics : public pp::Diagnostics
int mNumWarnings;
};
-#endif // COMPILER_DIAGNOSTICS_H_
+#endif // COMPILER_TRANSLATOR_DIAGNOSTICS_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.cpp b/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.cpp
index f67a03aa93..936c00a56c 100644
--- a/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.cpp
@@ -27,10 +27,12 @@ static TBehavior getBehavior(const std::string& str)
TDirectiveHandler::TDirectiveHandler(TExtensionBehavior& extBehavior,
TDiagnostics& diagnostics,
- int& shaderVersion)
+ int& shaderVersion,
+ bool debugShaderPrecisionSupported)
: mExtensionBehavior(extBehavior),
mDiagnostics(diagnostics),
- mShaderVersion(shaderVersion)
+ mShaderVersion(shaderVersion),
+ mDebugShaderPrecisionSupported(debugShaderPrecisionSupported)
{
}
@@ -65,6 +67,7 @@ void TDirectiveHandler::handlePragma(const pp::SourceLocation& loc,
{
const char kOptimize[] = "optimize";
const char kDebug[] = "debug";
+ const char kDebugShaderPrecision[] = "webgl_debug_shader_precision";
const char kOn[] = "on";
const char kOff[] = "off";
@@ -81,6 +84,12 @@ void TDirectiveHandler::handlePragma(const pp::SourceLocation& loc,
else if (value == kOff) mPragma.debug = false;
else invalidValue = true;
}
+ else if (name == kDebugShaderPrecision && mDebugShaderPrecisionSupported)
+ {
+ if (value == kOn) mPragma.debugShaderPrecision = true;
+ else if (value == kOff) mPragma.debugShaderPrecision = false;
+ else invalidValue = true;
+ }
else
{
mDiagnostics.report(pp::Diagnostics::PP_UNRECOGNIZED_PRAGMA, loc, name);
diff --git a/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.h b/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.h
index 0433c3bf89..2a81ee5707 100644
--- a/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.h
+++ b/src/3rdparty/angle/src/compiler/translator/DirectiveHandler.h
@@ -4,21 +4,23 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_DIRECTIVE_HANDLER_H_
-#define COMPILER_DIRECTIVE_HANDLER_H_
+#ifndef COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_
+#define COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_
+#include "common/angleutils.h"
#include "compiler/translator/ExtensionBehavior.h"
#include "compiler/translator/Pragma.h"
#include "compiler/preprocessor/DirectiveHandlerBase.h"
class TDiagnostics;
-class TDirectiveHandler : public pp::DirectiveHandler
+class TDirectiveHandler : public pp::DirectiveHandler, angle::NonCopyable
{
public:
TDirectiveHandler(TExtensionBehavior& extBehavior,
TDiagnostics& diagnostics,
- int& shaderVersion);
+ int& shaderVersion,
+ bool debugShaderPrecisionSupported);
virtual ~TDirectiveHandler();
const TPragma& pragma() const { return mPragma; }
@@ -44,6 +46,7 @@ class TDirectiveHandler : public pp::DirectiveHandler
TExtensionBehavior& mExtensionBehavior;
TDiagnostics& mDiagnostics;
int& mShaderVersion;
+ bool mDebugShaderPrecisionSupported;
};
-#endif // COMPILER_DIRECTIVE_HANDLER_H_
+#endif // COMPILER_TRANSLATOR_DIRECTIVEHANDLER_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/EmulatePrecision.cpp b/src/3rdparty/angle/src/compiler/translator/EmulatePrecision.cpp
new file mode 100644
index 0000000000..697e042954
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/EmulatePrecision.cpp
@@ -0,0 +1,528 @@
+//
+// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "compiler/translator/EmulatePrecision.h"
+
+namespace
+{
+
+static void writeVectorPrecisionEmulationHelpers(
+ TInfoSinkBase& sink, ShShaderOutput outputLanguage, unsigned int size)
+{
+ std::stringstream vecTypeStrStr;
+ if (outputLanguage == SH_ESSL_OUTPUT)
+ vecTypeStrStr << "highp ";
+ vecTypeStrStr << "vec" << size;
+ std::string vecType = vecTypeStrStr.str();
+
+ sink <<
+ vecType << " angle_frm(in " << vecType << " v) {\n"
+ " v = clamp(v, -65504.0, 65504.0);\n"
+ " " << vecType << " exponent = floor(log2(abs(v) + 1e-30)) - 10.0;\n"
+ " bvec" << size << " isNonZero = greaterThanEqual(exponent, vec" << size << "(-25.0));\n"
+ " v = v * exp2(-exponent);\n"
+ " v = sign(v) * floor(abs(v));\n"
+ " return v * exp2(exponent) * vec" << size << "(isNonZero);\n"
+ "}\n";
+
+ sink <<
+ vecType << " angle_frl(in " << vecType << " v) {\n"
+ " v = clamp(v, -2.0, 2.0);\n"
+ " v = v * 256.0;\n"
+ " v = sign(v) * floor(abs(v));\n"
+ " return v * 0.00390625;\n"
+ "}\n";
+}
+
+static void writeMatrixPrecisionEmulationHelper(
+ TInfoSinkBase& sink, ShShaderOutput outputLanguage, unsigned int size, const char *functionName)
+{
+ std::stringstream matTypeStrStr;
+ if (outputLanguage == SH_ESSL_OUTPUT)
+ matTypeStrStr << "highp ";
+ matTypeStrStr << "mat" << size;
+ std::string matType = matTypeStrStr.str();
+
+ sink << matType << " " << functionName << "(in " << matType << " m) {\n"
+ " " << matType << " rounded;\n";
+
+ for (unsigned int i = 0; i < size; ++i)
+ {
+ sink << " rounded[" << i << "] = " << functionName << "(m[" << i << "]);\n";
+ }
+
+ sink << " return rounded;\n"
+ "}\n";
+}
+
+static void writeCommonPrecisionEmulationHelpers(TInfoSinkBase& sink, ShShaderOutput outputLanguage)
+{
+ // Write the angle_frm functions that round floating point numbers to
+ // half precision, and angle_frl functions that round them to minimum lowp
+ // precision.
+
+ // Unoptimized version of angle_frm for single floats:
+ //
+ // int webgl_maxNormalExponent(in int exponentBits) {
+ // int possibleExponents = int(exp2(float(exponentBits)));
+ // int exponentBias = possibleExponents / 2 - 1;
+ // int allExponentBitsOne = possibleExponents - 1;
+ // return (allExponentBitsOne - 1) - exponentBias;
+ // }
+ //
+ // float angle_frm(in float x) {
+ // int mantissaBits = 10;
+ // int exponentBits = 5;
+ // float possibleMantissas = exp2(float(mantissaBits));
+ // float mantissaMax = 2.0 - 1.0 / possibleMantissas;
+ // int maxNE = webgl_maxNormalExponent(exponentBits);
+ // float max = exp2(float(maxNE)) * mantissaMax;
+ // if (x > max) {
+ // return max;
+ // }
+ // if (x < -max) {
+ // return -max;
+ // }
+ // float exponent = floor(log2(abs(x)));
+ // if (abs(x) == 0.0 || exponent < -float(maxNE)) {
+ // return 0.0 * sign(x)
+ // }
+ // x = x * exp2(-(exponent - float(mantissaBits)));
+ // x = sign(x) * floor(abs(x));
+ // return x * exp2(exponent - float(mantissaBits));
+ // }
+
+ // All numbers with a magnitude less than 2^-15 are subnormal, and are
+ // flushed to zero.
+
+ // Note the constant numbers below:
+ // a) 65504 is the maximum possible mantissa (1.1111111111 in binary) times
+ // 2^15, the maximum normal exponent.
+ // b) 10.0 is the number of mantissa bits.
+ // c) -25.0 is the minimum normal half-float exponent -15.0 minus the number
+ // of mantissa bits.
+ // d) + 1e-30 is to make sure the argument of log2() won't be zero. It can
+ // only affect the result of log2 on x where abs(x) < 1e-22. Since these
+ // numbers will be flushed to zero either way (2^-15 is the smallest
+ // normal positive number), this does not introduce any error.
+
+ std::string floatType = "float";
+ if (outputLanguage == SH_ESSL_OUTPUT)
+ floatType = "highp float";
+
+ sink <<
+ floatType << " angle_frm(in " << floatType << " x) {\n"
+ " x = clamp(x, -65504.0, 65504.0);\n"
+ " " << floatType << " exponent = floor(log2(abs(x) + 1e-30)) - 10.0;\n"
+ " bool isNonZero = (exponent >= -25.0);\n"
+ " x = x * exp2(-exponent);\n"
+ " x = sign(x) * floor(abs(x));\n"
+ " return x * exp2(exponent) * float(isNonZero);\n"
+ "}\n";
+
+ sink <<
+ floatType << " angle_frl(in " << floatType << " x) {\n"
+ " x = clamp(x, -2.0, 2.0);\n"
+ " x = x * 256.0;\n"
+ " x = sign(x) * floor(abs(x));\n"
+ " return x * 0.00390625;\n"
+ "}\n";
+
+ writeVectorPrecisionEmulationHelpers(sink, outputLanguage, 2);
+ writeVectorPrecisionEmulationHelpers(sink, outputLanguage, 3);
+ writeVectorPrecisionEmulationHelpers(sink, outputLanguage, 4);
+ for (unsigned int size = 2; size <= 4; ++size)
+ {
+ writeMatrixPrecisionEmulationHelper(sink, outputLanguage, size, "angle_frm");
+ writeMatrixPrecisionEmulationHelper(sink, outputLanguage, size, "angle_frl");
+ }
+}
+
+static void writeCompoundAssignmentPrecisionEmulation(
+ TInfoSinkBase& sink, ShShaderOutput outputLanguage,
+ const char *lType, const char *rType, const char *opStr, const char *opNameStr)
+{
+ std::string lTypeStr = lType;
+ std::string rTypeStr = rType;
+ if (outputLanguage == SH_ESSL_OUTPUT)
+ {
+ std::stringstream lTypeStrStr;
+ lTypeStrStr << "highp " << lType;
+ lTypeStr = lTypeStrStr.str();
+ std::stringstream rTypeStrStr;
+ rTypeStrStr << "highp " << rType;
+ rTypeStr = rTypeStrStr.str();
+ }
+
+ // Note that y should be passed through angle_frm at the function call site,
+ // but x can't be passed through angle_frm there since it is an inout parameter.
+ // So only pass x and the result through angle_frm here.
+ sink <<
+ lTypeStr << " angle_compound_" << opNameStr << "_frm(inout " << lTypeStr << " x, in " << rTypeStr << " y) {\n"
+ " x = angle_frm(angle_frm(x) " << opStr << " y);\n"
+ " return x;\n"
+ "}\n";
+ sink <<
+ lTypeStr << " angle_compound_" << opNameStr << "_frl(inout " << lTypeStr << " x, in " << rTypeStr << " y) {\n"
+ " x = angle_frl(angle_frm(x) " << opStr << " y);\n"
+ " return x;\n"
+ "}\n";
+}
+
+const char *getFloatTypeStr(const TType& type)
+{
+ switch (type.getNominalSize())
+ {
+ case 1:
+ return "float";
+ case 2:
+ return type.getSecondarySize() > 1 ? "mat2" : "vec2";
+ case 3:
+ return type.getSecondarySize() > 1 ? "mat3" : "vec3";
+ case 4:
+ return type.getSecondarySize() > 1 ? "mat4" : "vec4";
+ default:
+ UNREACHABLE();
+ return NULL;
+ }
+}
+
+bool canRoundFloat(const TType &type)
+{
+ return type.getBasicType() == EbtFloat && !type.isNonSquareMatrix() && !type.isArray() &&
+ (type.getPrecision() == EbpLow || type.getPrecision() == EbpMedium);
+}
+
+TIntermAggregate *createInternalFunctionCallNode(TString name, TIntermNode *child)
+{
+ TIntermAggregate *callNode = new TIntermAggregate();
+ callNode->setOp(EOpInternalFunctionCall);
+ callNode->setName(name);
+ callNode->getSequence()->push_back(child);
+ return callNode;
+}
+
+TIntermAggregate *createRoundingFunctionCallNode(TIntermTyped *roundedChild)
+{
+ TString roundFunctionName;
+ if (roundedChild->getPrecision() == EbpMedium)
+ roundFunctionName = "angle_frm";
+ else
+ roundFunctionName = "angle_frl";
+ return createInternalFunctionCallNode(roundFunctionName, roundedChild);
+}
+
+TIntermAggregate *createCompoundAssignmentFunctionCallNode(TIntermTyped *left, TIntermTyped *right, const char *opNameStr)
+{
+ std::stringstream strstr;
+ if (left->getPrecision() == EbpMedium)
+ strstr << "angle_compound_" << opNameStr << "_frm";
+ else
+ strstr << "angle_compound_" << opNameStr << "_frl";
+ TString functionName = strstr.str().c_str();
+ TIntermAggregate *callNode = createInternalFunctionCallNode(functionName, left);
+ callNode->getSequence()->push_back(right);
+ return callNode;
+}
+
+bool parentUsesResult(TIntermNode* parent, TIntermNode* node)
+{
+ if (!parent)
+ {
+ return false;
+ }
+
+ TIntermAggregate *aggParent = parent->getAsAggregate();
+ // If the parent's op is EOpSequence, the result is not assigned anywhere,
+ // so rounding it is not needed. In particular, this can avoid a lot of
+ // unnecessary rounding of unused return values of assignment.
+ if (aggParent && aggParent->getOp() == EOpSequence)
+ {
+ return false;
+ }
+ if (aggParent && aggParent->getOp() == EOpComma && (aggParent->getSequence()->back() != node))
+ {
+ return false;
+ }
+ return true;
+}
+
+} // namespace anonymous
+
+EmulatePrecision::EmulatePrecision()
+ : TIntermTraverser(true, true, true),
+ mDeclaringVariables(false),
+ mInLValue(false),
+ mInFunctionCallOutParameter(false)
+{}
+
+void EmulatePrecision::visitSymbol(TIntermSymbol *node)
+{
+ if (canRoundFloat(node->getType()) &&
+ !mDeclaringVariables && !mInLValue && !mInFunctionCallOutParameter)
+ {
+ TIntermNode *parent = getParentNode();
+ TIntermNode *replacement = createRoundingFunctionCallNode(node);
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, true));
+ }
+}
+
+
+bool EmulatePrecision::visitBinary(Visit visit, TIntermBinary *node)
+{
+ bool visitChildren = true;
+
+ if (node->isAssignment())
+ {
+ if (visit == PreVisit)
+ mInLValue = true;
+ else if (visit == InVisit)
+ mInLValue = false;
+ }
+
+ TOperator op = node->getOp();
+
+ // RHS of initialize is not being declared.
+ if (op == EOpInitialize && visit == InVisit)
+ mDeclaringVariables = false;
+
+ if ((op == EOpIndexDirectStruct || op == EOpVectorSwizzle) && visit == InVisit)
+ visitChildren = false;
+
+ if (visit != PreVisit)
+ return visitChildren;
+
+ const TType& type = node->getType();
+ bool roundFloat = canRoundFloat(type);
+
+ if (roundFloat) {
+ switch (op) {
+ // Math operators that can result in a float may need to apply rounding to the return
+ // value. Note that in the case of assignment, the rounding is applied to its return
+ // value here, not the value being assigned.
+ case EOpAssign:
+ case EOpAdd:
+ case EOpSub:
+ case EOpMul:
+ case EOpDiv:
+ case EOpVectorTimesScalar:
+ case EOpVectorTimesMatrix:
+ case EOpMatrixTimesVector:
+ case EOpMatrixTimesScalar:
+ case EOpMatrixTimesMatrix:
+ {
+ TIntermNode *parent = getParentNode();
+ if (!parentUsesResult(parent, node))
+ {
+ break;
+ }
+ TIntermNode *replacement = createRoundingFunctionCallNode(node);
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, true));
+ break;
+ }
+
+ // Compound assignment cases need to replace the operator with a function call.
+ case EOpAddAssign:
+ {
+ mEmulateCompoundAdd.insert(TypePair(getFloatTypeStr(type), getFloatTypeStr(node->getRight()->getType())));
+ TIntermNode *parent = getParentNode();
+ TIntermNode *replacement = createCompoundAssignmentFunctionCallNode(node->getLeft(), node->getRight(), "add");
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, false));
+ break;
+ }
+ case EOpSubAssign:
+ {
+ mEmulateCompoundSub.insert(TypePair(getFloatTypeStr(type), getFloatTypeStr(node->getRight()->getType())));
+ TIntermNode *parent = getParentNode();
+ TIntermNode *replacement = createCompoundAssignmentFunctionCallNode(node->getLeft(), node->getRight(), "sub");
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, false));
+ break;
+ }
+ case EOpMulAssign:
+ case EOpVectorTimesMatrixAssign:
+ case EOpVectorTimesScalarAssign:
+ case EOpMatrixTimesScalarAssign:
+ case EOpMatrixTimesMatrixAssign:
+ {
+ mEmulateCompoundMul.insert(TypePair(getFloatTypeStr(type), getFloatTypeStr(node->getRight()->getType())));
+ TIntermNode *parent = getParentNode();
+ TIntermNode *replacement = createCompoundAssignmentFunctionCallNode(node->getLeft(), node->getRight(), "mul");
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, false));
+ break;
+ }
+ case EOpDivAssign:
+ {
+ mEmulateCompoundDiv.insert(TypePair(getFloatTypeStr(type), getFloatTypeStr(node->getRight()->getType())));
+ TIntermNode *parent = getParentNode();
+ TIntermNode *replacement = createCompoundAssignmentFunctionCallNode(node->getLeft(), node->getRight(), "div");
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, false));
+ break;
+ }
+ default:
+ // The rest of the binary operations should not need precision emulation.
+ break;
+ }
+ }
+ return visitChildren;
+}
+
+bool EmulatePrecision::visitAggregate(Visit visit, TIntermAggregate *node)
+{
+ bool visitChildren = true;
+ switch (node->getOp())
+ {
+ case EOpSequence:
+ case EOpConstructStruct:
+ // No special handling
+ break;
+ case EOpFunction:
+ if (visit == PreVisit)
+ {
+ const TIntermSequence &sequence = *(node->getSequence());
+ TIntermSequence::const_iterator seqIter = sequence.begin();
+ TIntermAggregate *params = (*seqIter)->getAsAggregate();
+ ASSERT(params != NULL);
+ ASSERT(params->getOp() == EOpParameters);
+ mFunctionMap[node->getName()] = params->getSequence();
+ }
+ break;
+ case EOpPrototype:
+ if (visit == PreVisit)
+ mFunctionMap[node->getName()] = node->getSequence();
+ visitChildren = false;
+ break;
+ case EOpParameters:
+ visitChildren = false;
+ break;
+ case EOpInvariantDeclaration:
+ visitChildren = false;
+ break;
+ case EOpDeclaration:
+ // Variable declaration.
+ if (visit == PreVisit)
+ {
+ mDeclaringVariables = true;
+ }
+ else if (visit == InVisit)
+ {
+ mDeclaringVariables = true;
+ }
+ else
+ {
+ mDeclaringVariables = false;
+ }
+ break;
+ case EOpFunctionCall:
+ {
+ // Function call.
+ bool inFunctionMap = (mFunctionMap.find(node->getName()) != mFunctionMap.end());
+ if (visit == PreVisit)
+ {
+ // User-defined function return values are not rounded, this relies on that
+ // calculations producing the value were rounded.
+ TIntermNode *parent = getParentNode();
+ if (canRoundFloat(node->getType()) && !inFunctionMap && parentUsesResult(parent, node))
+ {
+ TIntermNode *replacement = createRoundingFunctionCallNode(node);
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, true));
+ }
+
+ if (inFunctionMap)
+ {
+ mSeqIterStack.push_back(mFunctionMap[node->getName()]->begin());
+ if (mSeqIterStack.back() != mFunctionMap[node->getName()]->end())
+ {
+ TQualifier qualifier = (*mSeqIterStack.back())->getAsTyped()->getQualifier();
+ mInFunctionCallOutParameter = (qualifier == EvqOut || qualifier == EvqInOut);
+ }
+ }
+ else
+ {
+ // The function is not user-defined - it is likely built-in texture function.
+ // Assume that those do not have out parameters.
+ mInFunctionCallOutParameter = false;
+ }
+ }
+ else if (visit == InVisit)
+ {
+ if (inFunctionMap)
+ {
+ ++mSeqIterStack.back();
+ TQualifier qualifier = (*mSeqIterStack.back())->getAsTyped()->getQualifier();
+ mInFunctionCallOutParameter = (qualifier == EvqOut || qualifier == EvqInOut);
+ }
+ }
+ else
+ {
+ if (inFunctionMap)
+ {
+ mSeqIterStack.pop_back();
+ mInFunctionCallOutParameter = false;
+ }
+ }
+ break;
+ }
+ default:
+ TIntermNode *parent = getParentNode();
+ if (canRoundFloat(node->getType()) && visit == PreVisit && parentUsesResult(parent, node))
+ {
+ TIntermNode *replacement = createRoundingFunctionCallNode(node);
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, true));
+ }
+ break;
+ }
+ return visitChildren;
+}
+
+bool EmulatePrecision::visitUnary(Visit visit, TIntermUnary *node)
+{
+ switch (node->getOp())
+ {
+ case EOpNegative:
+ case EOpVectorLogicalNot:
+ case EOpLogicalNot:
+ break;
+ case EOpPostIncrement:
+ case EOpPostDecrement:
+ case EOpPreIncrement:
+ case EOpPreDecrement:
+ if (visit == PreVisit)
+ mInLValue = true;
+ else if (visit == PostVisit)
+ mInLValue = false;
+ break;
+ default:
+ if (canRoundFloat(node->getType()) && visit == PreVisit)
+ {
+ TIntermNode *parent = getParentNode();
+ TIntermNode *replacement = createRoundingFunctionCallNode(node);
+ mReplacements.push_back(NodeUpdateEntry(parent, node, replacement, true));
+ }
+ break;
+ }
+
+ return true;
+}
+
+void EmulatePrecision::writeEmulationHelpers(TInfoSinkBase& sink, ShShaderOutput outputLanguage)
+{
+ // Other languages not yet supported
+ ASSERT(outputLanguage == SH_GLSL_COMPATIBILITY_OUTPUT ||
+ outputLanguage == SH_GLSL_CORE_OUTPUT ||
+ outputLanguage == SH_ESSL_OUTPUT);
+ writeCommonPrecisionEmulationHelpers(sink, outputLanguage);
+
+ EmulationSet::const_iterator it;
+ for (it = mEmulateCompoundAdd.begin(); it != mEmulateCompoundAdd.end(); it++)
+ writeCompoundAssignmentPrecisionEmulation(sink, outputLanguage, it->lType, it->rType, "+", "add");
+ for (it = mEmulateCompoundSub.begin(); it != mEmulateCompoundSub.end(); it++)
+ writeCompoundAssignmentPrecisionEmulation(sink, outputLanguage, it->lType, it->rType, "-", "sub");
+ for (it = mEmulateCompoundDiv.begin(); it != mEmulateCompoundDiv.end(); it++)
+ writeCompoundAssignmentPrecisionEmulation(sink, outputLanguage, it->lType, it->rType, "/", "div");
+ for (it = mEmulateCompoundMul.begin(); it != mEmulateCompoundMul.end(); it++)
+ writeCompoundAssignmentPrecisionEmulation(sink, outputLanguage, it->lType, it->rType, "*", "mul");
+}
+
diff --git a/src/3rdparty/angle/src/compiler/translator/EmulatePrecision.h b/src/3rdparty/angle/src/compiler/translator/EmulatePrecision.h
new file mode 100644
index 0000000000..f1f560aa85
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/EmulatePrecision.h
@@ -0,0 +1,74 @@
+//
+// Copyright (c) 2002-2014 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_TRANSLATOR_EMULATE_PRECISION_H_
+#define COMPILER_TRANSLATOR_EMULATE_PRECISION_H_
+
+#include "common/angleutils.h"
+#include "compiler/translator/InfoSink.h"
+#include "compiler/translator/IntermNode.h"
+#include "GLSLANG/ShaderLang.h"
+
+// This class gathers all compound assignments from the AST and can then write
+// the functions required for their precision emulation. This way there is no
+// need to write a huge number of variations of the emulated compound assignment
+// to every translated shader with emulation enabled.
+
+class EmulatePrecision : public TIntermTraverser
+{
+ public:
+ EmulatePrecision();
+
+ virtual void visitSymbol(TIntermSymbol *node);
+ virtual bool visitBinary(Visit visit, TIntermBinary *node);
+ virtual bool visitUnary(Visit visit, TIntermUnary *node);
+ virtual bool visitAggregate(Visit visit, TIntermAggregate *node);
+
+ void writeEmulationHelpers(TInfoSinkBase& sink, ShShaderOutput outputLanguage);
+
+ private:
+ struct TypePair
+ {
+ TypePair(const char *l, const char *r)
+ : lType(l), rType(r) { }
+
+ const char *lType;
+ const char *rType;
+ };
+
+ struct TypePairComparator
+ {
+ bool operator() (const TypePair& l, const TypePair& r) const
+ {
+ if (l.lType == r.lType)
+ return l.rType < r.rType;
+ return l.lType < r.lType;
+ }
+ };
+
+ typedef std::set<TypePair, TypePairComparator> EmulationSet;
+ EmulationSet mEmulateCompoundAdd;
+ EmulationSet mEmulateCompoundSub;
+ EmulationSet mEmulateCompoundMul;
+ EmulationSet mEmulateCompoundDiv;
+
+ // Stack of function call parameter iterators
+ std::vector<TIntermSequence::const_iterator> mSeqIterStack;
+
+ bool mDeclaringVariables;
+ bool mInLValue;
+ bool mInFunctionCallOutParameter;
+
+ struct TStringComparator
+ {
+ bool operator() (const TString& a, const TString& b) const { return a.compare(b) < 0; }
+ };
+
+ // Map from function names to their parameter sequences
+ std::map<TString, TIntermSequence*, TStringComparator> mFunctionMap;
+};
+
+#endif // COMPILER_TRANSLATOR_EMULATE_PRECISION_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/ExtensionBehavior.h b/src/3rdparty/angle/src/compiler/translator/ExtensionBehavior.h
index 5c1595fb21..cf4d7fba31 100644
--- a/src/3rdparty/angle/src/compiler/translator/ExtensionBehavior.h
+++ b/src/3rdparty/angle/src/compiler/translator/ExtensionBehavior.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef _EXTENSION_BEHAVIOR_INCLUDED_
-#define _EXTENSION_BEHAVIOR_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
+#define COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
#include <map>
#include <string>
@@ -34,4 +34,4 @@ inline const char* getBehaviorString(TBehavior b)
// Mapping between extension name and behavior.
typedef std::map<std::string, TBehavior> TExtensionBehavior;
-#endif // _EXTENSION_TABLE_INCLUDED_
+#endif // COMPILER_TRANSLATOR_EXTENSIONBEHAVIOR_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/FlagStd140Structs.h b/src/3rdparty/angle/src/compiler/translator/FlagStd140Structs.h
index c93a6f808e..07b9a72c5c 100644
--- a/src/3rdparty/angle/src/compiler/translator/FlagStd140Structs.h
+++ b/src/3rdparty/angle/src/compiler/translator/FlagStd140Structs.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_FLAGSTD140STRUCTS_H_
-#define COMPILER_FLAGSTD140STRUCTS_H_
+#ifndef COMPILER_TRANSLATOR_FLAGSTD140STRUCTS_H_
+#define COMPILER_TRANSLATOR_FLAGSTD140STRUCTS_H_
#include "compiler/translator/IntermNode.h"
@@ -34,4 +34,4 @@ std::vector<TIntermTyped *> FlagStd140ValueStructs(TIntermNode *node);
}
-#endif // COMPILER_FLAGSTD140STRUCTS_H_
+#endif // COMPILER_TRANSLATOR_FLAGSTD140STRUCTS_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/ForLoopUnroll.h b/src/3rdparty/angle/src/compiler/translator/ForLoopUnroll.h
index a820d2a20d..c8787d55a0 100644
--- a/src/3rdparty/angle/src/compiler/translator/ForLoopUnroll.h
+++ b/src/3rdparty/angle/src/compiler/translator/ForLoopUnroll.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_FORLOOPUNROLL_H_
-#define COMPILER_FORLOOPUNROLL_H_
+#ifndef COMPILER_TRANSLATOR_FORLOOPUNROLL_H_
+#define COMPILER_TRANSLATOR_FORLOOPUNROLL_H_
#include "compiler/translator/LoopInfo.h"
@@ -47,4 +47,4 @@ class ForLoopUnrollMarker : public TIntermTraverser
bool mVisitSamplerArrayIndexNodeInsideLoop;
};
-#endif
+#endif // COMPILER_TRANSLATOR_FORLOOPUNROLL_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/HashNames.h b/src/3rdparty/angle/src/compiler/translator/HashNames.h
index 26546a3e7b..09c959f9da 100644
--- a/src/3rdparty/angle/src/compiler/translator/HashNames.h
+++ b/src/3rdparty/angle/src/compiler/translator/HashNames.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_HASH_NAMES_H_
-#define COMPILER_HASH_NAMES_H_
+#ifndef COMPILER_TRANSLATOR_HASHNAMES_H_
+#define COMPILER_TRANSLATOR_HASHNAMES_H_
#include <map>
@@ -15,4 +15,4 @@
typedef std::map<TPersistString, TPersistString> NameMap;
-#endif // COMPILER_HASH_NAMES_H_
+#endif // COMPILER_TRANSLATOR_HASHNAMES_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/InfoSink.h b/src/3rdparty/angle/src/compiler/translator/InfoSink.h
index 698a8b454b..f47fafa8ee 100644
--- a/src/3rdparty/angle/src/compiler/translator/InfoSink.h
+++ b/src/3rdparty/angle/src/compiler/translator/InfoSink.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef _INFOSINK_INCLUDED_
-#define _INFOSINK_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_INFOSINK_H_
+#define COMPILER_TRANSLATOR_INFOSINK_H_
#include <math.h>
#include <stdlib.h>
@@ -113,4 +113,4 @@ public:
TInfoSinkBase obj;
};
-#endif // _INFOSINK_INCLUDED_
+#endif // COMPILER_TRANSLATOR_INFOSINK_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/Initialize.cpp b/src/3rdparty/angle/src/compiler/translator/Initialize.cpp
index 10b21e6d28..9e11405758 100644
--- a/src/3rdparty/angle/src/compiler/translator/Initialize.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/Initialize.cpp
@@ -21,307 +21,208 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR
TType *float2 = new TType(EbtFloat, 2);
TType *float3 = new TType(EbtFloat, 3);
TType *float4 = new TType(EbtFloat, 4);
-
TType *int1 = new TType(EbtInt);
TType *int2 = new TType(EbtInt, 2);
TType *int3 = new TType(EbtInt, 3);
- TType *int4 = new TType(EbtInt, 4);
+ TType *uint1 = new TType(EbtUInt);
+ TType *bool1 = new TType(EbtBool);
+ TType *genType = new TType(EbtGenType);
+ TType *genIType = new TType(EbtGenIType);
+ TType *genUType = new TType(EbtGenUType);
+ TType *genBType = new TType(EbtGenBType);
//
// Angle and Trigonometric Functions.
//
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "radians", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "radians", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "radians", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "radians", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "degrees", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "degrees", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "degrees", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "degrees", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "sin", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "sin", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "sin", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "sin", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "cos", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "cos", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "cos", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "cos", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "tan", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "tan", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "tan", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "tan", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "asin", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "asin", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "asin", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "asin", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "acos", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "acos", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "acos", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "acos", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "atan", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "atan", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "atan", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "atan", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "atan", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "atan", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "atan", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "atan", float4);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpRadians, genType, "radians", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpDegrees, genType, "degrees", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpSin, genType, "sin", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpCos, genType, "cos", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpTan, genType, "tan", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpAsin, genType, "asin", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpAcos, genType, "acos", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpAtan, genType, "atan", genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpAtan, genType, "atan", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpSinh, genType, "sinh", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpCosh, genType, "cosh", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTanh, genType, "tanh", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpAsinh, genType, "asinh", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpAcosh, genType, "acosh", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpAtanh, genType, "atanh", genType);
//
// Exponential Functions.
//
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "pow", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "pow", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "pow", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "pow", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "exp", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "exp", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "exp", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "exp", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "log", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "log", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "log", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "log", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "exp2", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "exp2", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "exp2", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "exp2", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "log2", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "log2", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "log2", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "log2", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "sqrt", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "sqrt", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "sqrt", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "sqrt", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "inversesqrt", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "inversesqrt", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "inversesqrt", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "inversesqrt", float4);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpPow, genType, "pow", genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpExp, genType, "exp", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpLog, genType, "log", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpExp2, genType, "exp2", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpLog2, genType, "log2", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpSqrt, genType, "sqrt", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpInverseSqrt, genType, "inversesqrt", genType);
//
// Common Functions.
//
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "abs", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "abs", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "abs", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "abs", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "sign", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "sign", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "sign", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "sign", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "floor", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "floor", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "floor", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "floor", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "ceil", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "ceil", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "ceil", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "ceil", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "fract", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "fract", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "fract", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "fract", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "mod", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "mod", float2, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "mod", float3, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "mod", float4, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "mod", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "mod", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "mod", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "min", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "min", float2, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "min", float3, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "min", float4, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "min", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "min", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "min", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "max", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "max", float2, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "max", float3, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "max", float4, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "max", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "max", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "max", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "clamp", float1, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "clamp", float2, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "clamp", float3, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "clamp", float4, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "clamp", float2, float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "clamp", float3, float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "clamp", float4, float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "mix", float1, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "mix", float2, float2, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "mix", float3, float3, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "mix", float4, float4, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "mix", float2, float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "mix", float3, float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "mix", float4, float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "step", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "step", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "step", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "step", float4, float4);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "step", float1, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "step", float1, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "step", float1, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "smoothstep", float1, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "smoothstep", float2, float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "smoothstep", float3, float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "smoothstep", float4, float4, float4);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "smoothstep", float1, float1, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "smoothstep", float1, float1, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "smoothstep", float1, float1, float4);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpAbs, genType, "abs", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpAbs, genIType, "abs", genIType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpSign, genType, "sign", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpSign, genIType, "sign", genIType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpFloor, genType, "floor", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTrunc, genType, "trunc", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpRound, genType, "round", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpRoundEven, genType, "roundEven", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpCeil, genType, "ceil", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpFract, genType, "fract", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMod, genType, "mod", genType, float1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMod, genType, "mod", genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMin, genType, "min", genType, float1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMin, genType, "min", genType, genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMin, genIType, "min", genIType, genIType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMin, genIType, "min", genIType, int1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMin, genUType, "min", genUType, genUType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMin, genUType, "min", genUType, uint1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMax, genType, "max", genType, float1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMax, genType, "max", genType, genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMax, genIType, "max", genIType, genIType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMax, genIType, "max", genIType, int1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMax, genUType, "max", genUType, genUType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMax, genUType, "max", genUType, uint1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpClamp, genType, "clamp", genType, float1, float1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpClamp, genType, "clamp", genType, genType, genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpClamp, genIType, "clamp", genIType, int1, int1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpClamp, genIType, "clamp", genIType, genIType, genIType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpClamp, genUType, "clamp", genUType, uint1, uint1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpClamp, genUType, "clamp", genUType, genUType, genUType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMix, genType, "mix", genType, genType, float1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMix, genType, "mix", genType, genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpStep, genType, "step", genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpStep, genType, "step", float1, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpSmoothStep, genType, "smoothstep", genType, genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpSmoothStep, genType, "smoothstep", float1, float1, genType);
+
+ TType *outFloat1 = new TType(EbtFloat);
+ TType *outFloat2 = new TType(EbtFloat, 2);
+ TType *outFloat3 = new TType(EbtFloat, 3);
+ TType *outFloat4 = new TType(EbtFloat, 4);
+ outFloat1->setQualifier(EvqOut);
+ outFloat2->setQualifier(EvqOut);
+ outFloat3->setQualifier(EvqOut);
+ outFloat4->setQualifier(EvqOut);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpModf, float1, "modf", float1, outFloat1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpModf, float2, "modf", float2, outFloat2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpModf, float3, "modf", float3, outFloat3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpModf, float4, "modf", float4, outFloat4);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpIsNan, genBType, "isnan", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpIsInf, genBType, "isinf", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpFloatBitsToInt, genIType, "floatBitsToInt", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpFloatBitsToUint, genUType, "floatBitsToUint", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpIntBitsToFloat, genType, "intBitsToFloat", genIType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpUintBitsToFloat, genType, "uintBitsToFloat", genUType);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpPackSnorm2x16, uint1, "packSnorm2x16", float2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpPackUnorm2x16, uint1, "packUnorm2x16", float2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpPackHalf2x16, uint1, "packHalf2x16", float2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpUnpackSnorm2x16, float2, "unpackSnorm2x16", uint1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpUnpackUnorm2x16, float2, "unpackUnorm2x16", uint1);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpUnpackHalf2x16, float2, "unpackHalf2x16", uint1);
//
// Geometric Functions.
//
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "length", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "length", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "length", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "length", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "distance", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "distance", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "distance", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "distance", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "dot", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "dot", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "dot", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "dot", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "cross", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "normalize", float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "normalize", float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "normalize", float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "normalize", float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "faceforward", float1, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "faceforward", float2, float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "faceforward", float3, float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "faceforward", float4, float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "reflect", float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "reflect", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "reflect", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "reflect", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float1, "refract", float1, float1, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float2, "refract", float2, float2, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float3, "refract", float3, float3, float1);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, float4, "refract", float4, float4, float1);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpLength, float1, "length", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpDistance, float1, "distance", genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpDot, float1, "dot", genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpCross, float3, "cross", float3, float3);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpNormalize, genType, "normalize", genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpFaceForward, genType, "faceforward", genType, genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpReflect, genType, "reflect", genType, genType);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpRefract, genType, "refract", genType, genType, float1);
TType *mat2 = new TType(EbtFloat, 2, 2);
TType *mat3 = new TType(EbtFloat, 3, 3);
TType *mat4 = new TType(EbtFloat, 4, 4);
+ TType *mat2x3 = new TType(EbtFloat, 2, 3);
+ TType *mat3x2 = new TType(EbtFloat, 3, 2);
+ TType *mat2x4 = new TType(EbtFloat, 2, 4);
+ TType *mat4x2 = new TType(EbtFloat, 4, 2);
+ TType *mat3x4 = new TType(EbtFloat, 3, 4);
+ TType *mat4x3 = new TType(EbtFloat, 4, 3);
//
// Matrix Functions.
//
- symbolTable.insertBuiltIn(COMMON_BUILTINS, mat2, "matrixCompMult", mat2, mat2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, mat3, "matrixCompMult", mat3, mat3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, mat4, "matrixCompMult", mat4, mat4);
-
- TType *bool1 = new TType(EbtBool);
- TType *bool2 = new TType(EbtBool, 2);
- TType *bool3 = new TType(EbtBool, 3);
- TType *bool4 = new TType(EbtBool, 4);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMul, mat2, "matrixCompMult", mat2, mat2);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMul, mat3, "matrixCompMult", mat3, mat3);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpMul, mat4, "matrixCompMult", mat4, mat4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMul, mat2x3, "matrixCompMult", mat2x3, mat2x3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMul, mat3x2, "matrixCompMult", mat3x2, mat3x2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMul, mat2x4, "matrixCompMult", mat2x4, mat2x4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMul, mat4x2, "matrixCompMult", mat4x2, mat4x2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMul, mat3x4, "matrixCompMult", mat3x4, mat3x4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpMul, mat4x3, "matrixCompMult", mat4x3, mat4x3);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat2, "outerProduct", float2, float2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat3, "outerProduct", float3, float3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat4, "outerProduct", float4, float4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat2x3, "outerProduct", float3, float2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat3x2, "outerProduct", float2, float3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat2x4, "outerProduct", float4, float2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat4x2, "outerProduct", float2, float4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat3x4, "outerProduct", float4, float3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpOuterProduct, mat4x3, "outerProduct", float3, float4);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat2, "transpose", mat2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat3, "transpose", mat3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat4, "transpose", mat4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat2x3, "transpose", mat3x2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat3x2, "transpose", mat2x3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat2x4, "transpose", mat4x2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat4x2, "transpose", mat2x4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat3x4, "transpose", mat4x3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpTranspose, mat4x3, "transpose", mat3x4);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpDeterminant, float1, "determinant", mat2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpDeterminant, float1, "determinant", mat3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpDeterminant, float1, "determinant", mat4);
+
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpInverse, mat2, "inverse", mat2);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpInverse, mat3, "inverse", mat3);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpInverse, mat4, "inverse", mat4);
+
+ TType *vec = new TType(EbtVec);
+ TType *ivec = new TType(EbtIVec);
+ TType *uvec = new TType(EbtUVec);
+ TType *bvec = new TType(EbtBVec);
//
// Vector relational functions.
//
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "lessThan", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "lessThan", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "lessThan", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "lessThan", int2, int2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "lessThan", int3, int3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "lessThan", int4, int4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "lessThanEqual", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "lessThanEqual", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "lessThanEqual", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "lessThanEqual", int2, int2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "lessThanEqual", int3, int3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "lessThanEqual", int4, int4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "greaterThan", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "greaterThan", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "greaterThan", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "greaterThan", int2, int2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "greaterThan", int3, int3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "greaterThan", int4, int4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "greaterThanEqual", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "greaterThanEqual", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "greaterThanEqual", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "greaterThanEqual", int2, int2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "greaterThanEqual", int3, int3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "greaterThanEqual", int4, int4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "equal", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "equal", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "equal", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "equal", int2, int2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "equal", int3, int3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "equal", int4, int4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "equal", bool2, bool2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "equal", bool3, bool3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "equal", bool4, bool4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "notEqual", float2, float2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "notEqual", float3, float3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "notEqual", float4, float4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "notEqual", int2, int2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "notEqual", int3, int3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "notEqual", int4, int4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "notEqual", bool2, bool2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "notEqual", bool3, bool3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "notEqual", bool4, bool4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool1, "any", bool2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool1, "any", bool3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool1, "any", bool4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool1, "all", bool2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool1, "all", bool3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool1, "all", bool4);
-
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool2, "not", bool2);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool3, "not", bool3);
- symbolTable.insertBuiltIn(COMMON_BUILTINS, bool4, "not", bool4);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpLessThan, bvec, "lessThan", vec, vec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpLessThan, bvec, "lessThan", ivec, ivec);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpLessThan, bvec, "lessThan", uvec, uvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpLessThanEqual, bvec, "lessThanEqual", vec, vec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpLessThanEqual, bvec, "lessThanEqual", ivec, ivec);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpLessThanEqual, bvec, "lessThanEqual", uvec, uvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpGreaterThan, bvec, "greaterThan", vec, vec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpGreaterThan, bvec, "greaterThan", ivec, ivec);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpGreaterThan, bvec, "greaterThan", uvec, uvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpGreaterThanEqual, bvec, "greaterThanEqual", vec, vec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpGreaterThanEqual, bvec, "greaterThanEqual", ivec, ivec);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpGreaterThanEqual, bvec, "greaterThanEqual", uvec, uvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpVectorEqual, bvec, "equal", vec, vec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpVectorEqual, bvec, "equal", ivec, ivec);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpVectorEqual, bvec, "equal", uvec, uvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpVectorEqual, bvec, "equal", bvec, bvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpVectorNotEqual, bvec, "notEqual", vec, vec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpVectorNotEqual, bvec, "notEqual", ivec, ivec);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpVectorNotEqual, bvec, "notEqual", uvec, uvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpVectorNotEqual, bvec, "notEqual", bvec, bvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpAny, bool1, "any", bvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpAll, bool1, "all", bvec);
+ symbolTable.insertBuiltIn(COMMON_BUILTINS, EOpVectorLogicalNot, bvec, "not", bvec);
TType *sampler2D = new TType(EbtSampler2D);
TType *samplerCube = new TType(EbtSamplerCube);
@@ -357,10 +258,10 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR
/* The *Grad* variants are new to both vertex and fragment shaders; the fragment
* shader specific pieces are added separately below.
*/
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DGradEXT", sampler2D, float2, float2, float2);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DProjGradEXT", sampler2D, float3, float2, float2);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DProjGradEXT", sampler2D, float4, float2, float2);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "textureCubeGradEXT", samplerCube, float3, float3, float3);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "texture2DGradEXT", sampler2D, float2, float2, float2);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "texture2DProjGradEXT", sampler2D, float3, float2, float2);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "texture2DProjGradEXT", sampler2D, float4, float2, float2);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "textureCubeGradEXT", samplerCube, float3, float3, float3);
}
if (type == GL_FRAGMENT_SHADER)
@@ -372,32 +273,21 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR
if (resources.OES_standard_derivatives)
{
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float1, "dFdx", float1);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float2, "dFdx", float2);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float3, "dFdx", float3);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "dFdx", float4);
-
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float1, "dFdy", float1);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float2, "dFdy", float2);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float3, "dFdy", float3);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "dFdy", float4);
-
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float1, "fwidth", float1);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float2, "fwidth", float2);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float3, "fwidth", float3);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "fwidth", float4);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpDFdx, "GL_OES_standard_derivatives", genType, "dFdx", genType);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpDFdy, "GL_OES_standard_derivatives", genType, "dFdy", genType);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, EOpFwidth, "GL_OES_standard_derivatives", genType, "fwidth", genType);
}
if (resources.EXT_shader_texture_lod)
{
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DLodEXT", sampler2D, float2, float1);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DProjLodEXT", sampler2D, float3, float1);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DProjLodEXT", sampler2D, float4, float1);
- symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "textureCubeLodEXT", samplerCube, float3, float1);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "texture2DLodEXT", sampler2D, float2, float1);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "texture2DProjLodEXT", sampler2D, float3, float1);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "texture2DProjLodEXT", sampler2D, float4, float1);
+ symbolTable.insertBuiltIn(ESSL1_BUILTINS, "GL_EXT_shader_texture_lod", float4, "textureCubeLodEXT", samplerCube, float3, float1);
}
}
- if(type == GL_VERTEX_SHADER)
+ if (type == GL_VERTEX_SHADER)
{
symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DLod", sampler2D, float2, float1);
symbolTable.insertBuiltIn(ESSL1_BUILTINS, float4, "texture2DProjLod", sampler2D, float3, float1);
@@ -463,22 +353,11 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int2, "textureSize", samplerCubeShadow, int1);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, int3, "textureSize", sampler2DArrayShadow, int1);
- if(type == GL_FRAGMENT_SHADER)
+ if (type == GL_FRAGMENT_SHADER)
{
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float1, "dFdx", float1);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float2, "dFdx", float2);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float3, "dFdx", float3);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "dFdx", float4);
-
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float1, "dFdy", float1);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float2, "dFdy", float2);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float3, "dFdy", float3);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "dFdy", float4);
-
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float1, "fwidth", float1);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float2, "fwidth", float2);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float3, "fwidth", float3);
- symbolTable.insertBuiltIn(ESSL3_BUILTINS, float4, "fwidth", float4);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpDFdx, genType, "dFdx", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpDFdy, genType, "dFdy", genType);
+ symbolTable.insertBuiltIn(ESSL3_BUILTINS, EOpFwidth, genType, "fwidth", genType);
}
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "textureOffset", gsampler2D, float2, int2);
@@ -486,7 +365,7 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float1, "textureOffset", sampler2DShadow, float3, int2);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "textureOffset", gsampler2DArray, float3, int2);
- if(type == GL_FRAGMENT_SHADER)
+ if (type == GL_FRAGMENT_SHADER)
{
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "textureOffset", gsampler2D, float2, int2, float1);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "textureOffset", gsampler3D, float3, int3, float1);
@@ -499,7 +378,7 @@ void InsertBuiltInFunctions(sh::GLenum type, ShShaderSpec spec, const ShBuiltInR
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "textureProjOffset", gsampler3D, float4, int3);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, float1, "textureProjOffset", sampler2DShadow, float4, int2);
- if(type == GL_FRAGMENT_SHADER)
+ if (type == GL_FRAGMENT_SHADER)
{
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "textureProjOffset", gsampler2D, float3, int2, float1);
symbolTable.insertBuiltIn(ESSL3_BUILTINS, gvec4, "textureProjOffset", gsampler2D, float4, int2, float1);
@@ -600,146 +479,84 @@ void IdentifyBuiltIns(sh::GLenum type, ShShaderSpec spec,
TSymbolTable &symbolTable)
{
//
- // First, insert some special built-in variables that are not in
+ // Insert some special built-in variables that are not in
// the built-in header files.
//
- switch(type) {
- case GL_FRAGMENT_SHADER:
- symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_FragCoord"), TType(EbtFloat, EbpMedium, EvqFragCoord, 4)));
- symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_FrontFacing"), TType(EbtBool, EbpUndefined, EvqFrontFacing, 1)));
- symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_PointCoord"), TType(EbtFloat, EbpMedium, EvqPointCoord, 2)));
+ switch (type)
+ {
+ case GL_FRAGMENT_SHADER:
+ symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_FragCoord"),
+ TType(EbtFloat, EbpMedium, EvqFragCoord, 4)));
+ symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_FrontFacing"),
+ TType(EbtBool, EbpUndefined, EvqFrontFacing, 1)));
+ symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_PointCoord"),
+ TType(EbtFloat, EbpMedium, EvqPointCoord, 2)));
//
// In CSS Shaders, gl_FragColor, gl_FragData, and gl_MaxDrawBuffers are not available.
// Instead, css_MixColor and css_ColorMatrix are available.
//
- if (spec != SH_CSS_SHADERS_SPEC) {
- symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragColor"), TType(EbtFloat, EbpMedium, EvqFragColor, 4)));
- symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragData[gl_MaxDrawBuffers]"), TType(EbtFloat, EbpMedium, EvqFragData, 4)));
- if (resources.EXT_frag_depth) {
- symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragDepthEXT"), TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium, EvqFragDepth, 1)));
- symbolTable.relateToExtension(ESSL1_BUILTINS, "gl_FragDepthEXT", "GL_EXT_frag_depth");
- }
- } else {
- symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("css_MixColor"), TType(EbtFloat, EbpMedium, EvqGlobal, 4)));
- symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("css_ColorMatrix"), TType(EbtFloat, EbpMedium, EvqGlobal, 4, 4)));
- }
-
- break;
-
- case GL_VERTEX_SHADER:
- symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_Position"), TType(EbtFloat, EbpHigh, EvqPosition, 4)));
- symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_PointSize"), TType(EbtFloat, EbpMedium, EvqPointSize, 1)));
- break;
-
- default: assert(false && "Language not supported");
- }
-
- //
- // Next, identify which built-ins from the already loaded headers have
- // a mapping to an operator. Those that are not identified as such are
- // expected to be resolved through a library of functions, versus as
- // operations.
- //
- symbolTable.relateToOperator(COMMON_BUILTINS, "matrixCompMult", EOpMul);
-
- symbolTable.relateToOperator(COMMON_BUILTINS, "equal", EOpVectorEqual);
- symbolTable.relateToOperator(COMMON_BUILTINS, "notEqual", EOpVectorNotEqual);
- symbolTable.relateToOperator(COMMON_BUILTINS, "lessThan", EOpLessThan);
- symbolTable.relateToOperator(COMMON_BUILTINS, "greaterThan", EOpGreaterThan);
- symbolTable.relateToOperator(COMMON_BUILTINS, "lessThanEqual", EOpLessThanEqual);
- symbolTable.relateToOperator(COMMON_BUILTINS, "greaterThanEqual", EOpGreaterThanEqual);
-
- symbolTable.relateToOperator(COMMON_BUILTINS, "radians", EOpRadians);
- symbolTable.relateToOperator(COMMON_BUILTINS, "degrees", EOpDegrees);
- symbolTable.relateToOperator(COMMON_BUILTINS, "sin", EOpSin);
- symbolTable.relateToOperator(COMMON_BUILTINS, "cos", EOpCos);
- symbolTable.relateToOperator(COMMON_BUILTINS, "tan", EOpTan);
- symbolTable.relateToOperator(COMMON_BUILTINS, "asin", EOpAsin);
- symbolTable.relateToOperator(COMMON_BUILTINS, "acos", EOpAcos);
- symbolTable.relateToOperator(COMMON_BUILTINS, "atan", EOpAtan);
-
- symbolTable.relateToOperator(COMMON_BUILTINS, "pow", EOpPow);
- symbolTable.relateToOperator(COMMON_BUILTINS, "exp2", EOpExp2);
- symbolTable.relateToOperator(COMMON_BUILTINS, "log", EOpLog);
- symbolTable.relateToOperator(COMMON_BUILTINS, "exp", EOpExp);
- symbolTable.relateToOperator(COMMON_BUILTINS, "log2", EOpLog2);
- symbolTable.relateToOperator(COMMON_BUILTINS, "sqrt", EOpSqrt);
- symbolTable.relateToOperator(COMMON_BUILTINS, "inversesqrt", EOpInverseSqrt);
-
- symbolTable.relateToOperator(COMMON_BUILTINS, "abs", EOpAbs);
- symbolTable.relateToOperator(COMMON_BUILTINS, "sign", EOpSign);
- symbolTable.relateToOperator(COMMON_BUILTINS, "floor", EOpFloor);
- symbolTable.relateToOperator(COMMON_BUILTINS, "ceil", EOpCeil);
- symbolTable.relateToOperator(COMMON_BUILTINS, "fract", EOpFract);
- symbolTable.relateToOperator(COMMON_BUILTINS, "mod", EOpMod);
- symbolTable.relateToOperator(COMMON_BUILTINS, "min", EOpMin);
- symbolTable.relateToOperator(COMMON_BUILTINS, "max", EOpMax);
- symbolTable.relateToOperator(COMMON_BUILTINS, "clamp", EOpClamp);
- symbolTable.relateToOperator(COMMON_BUILTINS, "mix", EOpMix);
- symbolTable.relateToOperator(COMMON_BUILTINS, "step", EOpStep);
- symbolTable.relateToOperator(COMMON_BUILTINS, "smoothstep", EOpSmoothStep);
-
- symbolTable.relateToOperator(COMMON_BUILTINS, "length", EOpLength);
- symbolTable.relateToOperator(COMMON_BUILTINS, "distance", EOpDistance);
- symbolTable.relateToOperator(COMMON_BUILTINS, "dot", EOpDot);
- symbolTable.relateToOperator(COMMON_BUILTINS, "cross", EOpCross);
- symbolTable.relateToOperator(COMMON_BUILTINS, "normalize", EOpNormalize);
- symbolTable.relateToOperator(COMMON_BUILTINS, "faceforward", EOpFaceForward);
- symbolTable.relateToOperator(COMMON_BUILTINS, "reflect", EOpReflect);
- symbolTable.relateToOperator(COMMON_BUILTINS, "refract", EOpRefract);
-
- symbolTable.relateToOperator(COMMON_BUILTINS, "any", EOpAny);
- symbolTable.relateToOperator(COMMON_BUILTINS, "all", EOpAll);
- symbolTable.relateToOperator(COMMON_BUILTINS, "not", EOpVectorLogicalNot);
-
- // Map language-specific operators.
- switch(type) {
- case GL_VERTEX_SHADER:
- break;
- case GL_FRAGMENT_SHADER:
- if (resources.OES_standard_derivatives)
+ if (spec != SH_CSS_SHADERS_SPEC)
{
- symbolTable.relateToOperator(ESSL1_BUILTINS, "dFdx", EOpDFdx);
- symbolTable.relateToOperator(ESSL1_BUILTINS, "dFdy", EOpDFdy);
- symbolTable.relateToOperator(ESSL1_BUILTINS, "fwidth", EOpFwidth);
+ symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragColor"),
+ TType(EbtFloat, EbpMedium, EvqFragColor, 4)));
+ TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, 1, true);
+ fragData.setArraySize(resources.MaxDrawBuffers);
+ symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragData"), fragData));
+
+ if (resources.EXT_frag_depth)
+ {
+ symbolTable.insert(ESSL1_BUILTINS, "GL_EXT_frag_depth", new TVariable(NewPoolTString("gl_FragDepthEXT"),
+ TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium, EvqFragDepth, 1)));
+ }
- symbolTable.relateToExtension(ESSL1_BUILTINS, "dFdx", "GL_OES_standard_derivatives");
- symbolTable.relateToExtension(ESSL1_BUILTINS, "dFdy", "GL_OES_standard_derivatives");
- symbolTable.relateToExtension(ESSL1_BUILTINS, "fwidth", "GL_OES_standard_derivatives");
+ if (resources.EXT_shader_framebuffer_fetch || resources.NV_shader_framebuffer_fetch)
+ {
+ TType lastFragData(EbtFloat, EbpMedium, EvqLastFragData, 4, 1, true);
+ lastFragData.setArraySize(resources.MaxDrawBuffers);
+
+ if (resources.EXT_shader_framebuffer_fetch)
+ {
+ symbolTable.insert(ESSL1_BUILTINS, "GL_EXT_shader_framebuffer_fetch",
+ new TVariable(NewPoolTString("gl_LastFragData"), lastFragData));
+ }
+ else if (resources.NV_shader_framebuffer_fetch)
+ {
+ symbolTable.insert(ESSL1_BUILTINS, "GL_NV_shader_framebuffer_fetch",
+ new TVariable(NewPoolTString("gl_LastFragColor"),
+ TType(EbtFloat, EbpMedium, EvqLastFragColor, 4)));
+ symbolTable.insert(ESSL1_BUILTINS, "GL_NV_shader_framebuffer_fetch",
+ new TVariable(NewPoolTString("gl_LastFragData"), lastFragData));
+ }
+ }
+ else if (resources.ARM_shader_framebuffer_fetch)
+ {
+ symbolTable.insert(ESSL1_BUILTINS, "GL_ARM_shader_framebuffer_fetch",
+ new TVariable(NewPoolTString("gl_LastFragColorARM"),
+ TType(EbtFloat, EbpMedium, EvqLastFragColor, 4)));
+ }
}
- if (resources.EXT_shader_texture_lod)
+ else
{
- symbolTable.relateToExtension(ESSL1_BUILTINS, "texture2DLodEXT", "GL_EXT_shader_texture_lod");
- symbolTable.relateToExtension(ESSL1_BUILTINS, "texture2DProjLodEXT", "GL_EXT_shader_texture_lod");
- symbolTable.relateToExtension(ESSL1_BUILTINS, "textureCubeLodEXT", "GL_EXT_shader_texture_lod");
+ symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("css_MixColor"),
+ TType(EbtFloat, EbpMedium, EvqGlobal, 4)));
+ symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("css_ColorMatrix"),
+ TType(EbtFloat, EbpMedium, EvqGlobal, 4, 4)));
}
- break;
- default: break;
- }
- symbolTable.relateToOperator(ESSL3_BUILTINS, "dFdx", EOpDFdx);
- symbolTable.relateToOperator(ESSL3_BUILTINS, "dFdy", EOpDFdy);
- symbolTable.relateToOperator(ESSL3_BUILTINS, "fwidth", EOpFwidth);
-
- if (resources.EXT_shader_texture_lod)
- {
- symbolTable.relateToExtension(ESSL1_BUILTINS, "texture2DGradEXT", "GL_EXT_shader_texture_lod");
- symbolTable.relateToExtension(ESSL1_BUILTINS, "texture2DProjGradEXT", "GL_EXT_shader_texture_lod");
- symbolTable.relateToExtension(ESSL1_BUILTINS, "textureCubeGradEXT", "GL_EXT_shader_texture_lod");
- }
+ break;
- // Finally add resource-specific variables.
- switch(type) {
- case GL_FRAGMENT_SHADER:
- if (spec != SH_CSS_SHADERS_SPEC) {
- // Set up gl_FragData. The array size.
- TType fragData(EbtFloat, EbpMedium, EvqFragData, 4, 1, true);
- fragData.setArraySize(resources.MaxDrawBuffers);
- symbolTable.insert(ESSL1_BUILTINS, new TVariable(NewPoolTString("gl_FragData"), fragData));
- }
+ case GL_VERTEX_SHADER:
+ symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_Position"),
+ TType(EbtFloat, EbpHigh, EvqPosition, 4)));
+ symbolTable.insert(COMMON_BUILTINS, new TVariable(NewPoolTString("gl_PointSize"),
+ TType(EbtFloat, EbpMedium, EvqPointSize, 1)));
+ symbolTable.insert(ESSL3_BUILTINS, new TVariable(NewPoolTString("gl_InstanceID"),
+ TType(EbtInt, EbpHigh, EvqInstanceID, 1)));
break;
- default: break;
+
+ default:
+ assert(false && "Language not supported");
}
}
@@ -758,4 +575,20 @@ void InitExtensionBehavior(const ShBuiltInResources& resources,
extBehavior["GL_EXT_frag_depth"] = EBhUndefined;
if (resources.EXT_shader_texture_lod)
extBehavior["GL_EXT_shader_texture_lod"] = EBhUndefined;
+ if (resources.EXT_shader_framebuffer_fetch)
+ extBehavior["GL_EXT_shader_framebuffer_fetch"] = EBhUndefined;
+ if (resources.NV_shader_framebuffer_fetch)
+ extBehavior["GL_NV_shader_framebuffer_fetch"] = EBhUndefined;
+ if (resources.ARM_shader_framebuffer_fetch)
+ extBehavior["GL_ARM_shader_framebuffer_fetch"] = EBhUndefined;
+}
+
+void ResetExtensionBehavior(TExtensionBehavior &extBehavior)
+{
+ for (auto ext_iter = extBehavior.begin();
+ ext_iter != extBehavior.end();
+ ++ext_iter)
+ {
+ ext_iter->second = EBhUndefined;
+ }
}
diff --git a/src/3rdparty/angle/src/compiler/translator/Initialize.h b/src/3rdparty/angle/src/compiler/translator/Initialize.h
index cc1862c90e..c43ce3417a 100644
--- a/src/3rdparty/angle/src/compiler/translator/Initialize.h
+++ b/src/3rdparty/angle/src/compiler/translator/Initialize.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef _INITIALIZE_INCLUDED_
-#define _INITIALIZE_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_INITIALIZE_H_
+#define COMPILER_TRANSLATOR_INITIALIZE_H_
#include "compiler/translator/Common.h"
#include "compiler/translator/Compiler.h"
@@ -20,4 +20,10 @@ void IdentifyBuiltIns(sh::GLenum type, ShShaderSpec spec,
void InitExtensionBehavior(const ShBuiltInResources& resources,
TExtensionBehavior& extensionBehavior);
-#endif // _INITIALIZE_INCLUDED_
+// Resets the behavior of the extensions listed in |extensionBehavior| to the
+// undefined state. These extensions will only be those initially supported in
+// the ShBuiltInResources object for this compiler instance. All other
+// extensions will remain unsupported.
+void ResetExtensionBehavior(TExtensionBehavior &extensionBehavior);
+
+#endif // COMPILER_TRANSLATOR_INITIALIZE_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/InitializeDll.h b/src/3rdparty/angle/src/compiler/translator/InitializeDll.h
index 43070cc3ff..4c400760f6 100644
--- a/src/3rdparty/angle/src/compiler/translator/InitializeDll.h
+++ b/src/3rdparty/angle/src/compiler/translator/InitializeDll.h
@@ -3,11 +3,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//
-#ifndef __INITIALIZEDLL_H
-#define __INITIALIZEDLL_H
+#ifndef COMPILER_TRANSLATOR_INITIALIZEDLL_H_
+#define COMPILER_TRANSLATOR_INITIALIZEDLL_H_
bool InitProcess();
void DetachProcess();
-#endif // __INITIALIZEDLL_H
+#endif // COMPILER_TRANSLATOR_INITIALIZEDLL_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/InitializeGlobals.h b/src/3rdparty/angle/src/compiler/translator/InitializeGlobals.h
index 0715941424..8c65cb28da 100644
--- a/src/3rdparty/angle/src/compiler/translator/InitializeGlobals.h
+++ b/src/3rdparty/angle/src/compiler/translator/InitializeGlobals.h
@@ -4,10 +4,10 @@
// found in the LICENSE file.
//
-#ifndef __INITIALIZE_GLOBALS_INCLUDED_
-#define __INITIALIZE_GLOBALS_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_INITIALIZEGLOBALS_H_
+#define COMPILER_TRANSLATOR_INITIALIZEGLOBALS_H_
bool InitializePoolIndex();
void FreePoolIndex();
-#endif // __INITIALIZE_GLOBALS_INCLUDED_
+#endif // COMPILER_TRANSLATOR_INITIALIZEGLOBALS_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/InitializeParseContext.h b/src/3rdparty/angle/src/compiler/translator/InitializeParseContext.h
index bffbab87d0..fa9b885e80 100644
--- a/src/3rdparty/angle/src/compiler/translator/InitializeParseContext.h
+++ b/src/3rdparty/angle/src/compiler/translator/InitializeParseContext.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef __INITIALIZE_PARSE_CONTEXT_INCLUDED_
-#define __INITIALIZE_PARSE_CONTEXT_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_INITIALIZEPARSECONTEXT_H_
+#define COMPILER_TRANSLATOR_INITIALIZEPARSECONTEXT_H_
bool InitializeParseContextIndex();
void FreeParseContextIndex();
@@ -14,4 +14,4 @@ struct TParseContext;
extern void SetGlobalParseContext(TParseContext* context);
extern TParseContext* GetGlobalParseContext();
-#endif // __INITIALIZE_PARSE_CONTEXT_INCLUDED_
+#endif // COMPILER_TRANSLATOR_INITIALIZEPARSECONTEXT_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/InitializeVariables.h b/src/3rdparty/angle/src/compiler/translator/InitializeVariables.h
index 59c3ea0a39..4a81266498 100644
--- a/src/3rdparty/angle/src/compiler/translator/InitializeVariables.h
+++ b/src/3rdparty/angle/src/compiler/translator/InitializeVariables.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_INITIALIZE_VARIABLES_H_
-#define COMPILER_INITIALIZE_VARIABLES_H_
+#ifndef COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_
+#define COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_
#include "compiler/translator/IntermNode.h"
@@ -47,4 +47,4 @@ class InitializeVariables : public TIntermTraverser
bool mCodeInserted;
};
-#endif // COMPILER_INITIALIZE_VARIABLES_H_
+#endif // COMPILER_TRANSLATOR_INITIALIZEVARIABLES_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/IntermNode.cpp b/src/3rdparty/angle/src/compiler/translator/IntermNode.cpp
index aa0f31d170..266e3c8e3d 100644
--- a/src/3rdparty/angle/src/compiler/translator/IntermNode.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/IntermNode.cpp
@@ -157,26 +157,6 @@ bool TIntermLoop::replaceChildNode(
return false;
}
-void TIntermLoop::enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const
-{
- if (mInit)
- {
- nodeQueue->push(mInit);
- }
- if (mCond)
- {
- nodeQueue->push(mCond);
- }
- if (mExpr)
- {
- nodeQueue->push(mExpr);
- }
- if (mBody)
- {
- nodeQueue->push(mBody);
- }
-}
-
bool TIntermBranch::replaceChildNode(
TIntermNode *original, TIntermNode *replacement)
{
@@ -184,14 +164,6 @@ bool TIntermBranch::replaceChildNode(
return false;
}
-void TIntermBranch::enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const
-{
- if (mExpression)
- {
- nodeQueue->push(mExpression);
- }
-}
-
bool TIntermBinary::replaceChildNode(
TIntermNode *original, TIntermNode *replacement)
{
@@ -200,18 +172,6 @@ bool TIntermBinary::replaceChildNode(
return false;
}
-void TIntermBinary::enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const
-{
- if (mLeft)
- {
- nodeQueue->push(mLeft);
- }
- if (mRight)
- {
- nodeQueue->push(mRight);
- }
-}
-
bool TIntermUnary::replaceChildNode(
TIntermNode *original, TIntermNode *replacement)
{
@@ -219,14 +179,6 @@ bool TIntermUnary::replaceChildNode(
return false;
}
-void TIntermUnary::enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const
-{
- if (mOperand)
- {
- nodeQueue->push(mOperand);
- }
-}
-
bool TIntermAggregate::replaceChildNode(
TIntermNode *original, TIntermNode *replacement)
{
@@ -237,14 +189,6 @@ bool TIntermAggregate::replaceChildNode(
return false;
}
-void TIntermAggregate::enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const
-{
- for (size_t childIndex = 0; childIndex < mSequence.size(); childIndex++)
- {
- nodeQueue->push(mSequence[childIndex]);
- }
-}
-
void TIntermAggregate::setPrecisionFromChildren()
{
if (getBasicType() == EbtBool)
@@ -300,20 +244,19 @@ bool TIntermSelection::replaceChildNode(
return false;
}
-void TIntermSelection::enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const
+bool TIntermSwitch::replaceChildNode(
+ TIntermNode *original, TIntermNode *replacement)
{
- if (mCondition)
- {
- nodeQueue->push(mCondition);
- }
- if (mTrueBlock)
- {
- nodeQueue->push(mTrueBlock);
- }
- if (mFalseBlock)
- {
- nodeQueue->push(mFalseBlock);
- }
+ REPLACE_IF_IS(mInit, TIntermTyped, original, replacement);
+ REPLACE_IF_IS(mStatementList, TIntermAggregate, original, replacement);
+ return false;
+}
+
+bool TIntermCase::replaceChildNode(
+ TIntermNode *original, TIntermNode *replacement)
+{
+ REPLACE_IF_IS(mCondition, TIntermTyped, original, replacement);
+ return false;
}
//
@@ -336,6 +279,12 @@ bool TIntermOperator::isAssignment() const
case EOpMatrixTimesScalarAssign:
case EOpMatrixTimesMatrixAssign:
case EOpDivAssign:
+ case EOpIModAssign:
+ case EOpBitShiftLeftAssign:
+ case EOpBitShiftRightAssign:
+ case EOpBitwiseAndAssign:
+ case EOpBitwiseXorAssign:
+ case EOpBitwiseOrAssign:
return true;
default:
return false;
@@ -379,65 +328,55 @@ bool TIntermOperator::isConstructor() const
// Make sure the type of a unary operator is appropriate for its
// combination of operation and operand type.
//
-// Returns false in nothing makes sense.
-//
-bool TIntermUnary::promote(TInfoSink &)
+void TIntermUnary::promote(const TType *funcReturnType)
{
switch (mOp)
{
- case EOpLogicalNot:
- if (mOperand->getBasicType() != EbtBool)
- return false;
+ case EOpFloatBitsToInt:
+ case EOpFloatBitsToUint:
+ case EOpIntBitsToFloat:
+ case EOpUintBitsToFloat:
+ case EOpPackSnorm2x16:
+ case EOpPackUnorm2x16:
+ case EOpPackHalf2x16:
+ case EOpUnpackSnorm2x16:
+ case EOpUnpackUnorm2x16:
+ mType.setPrecision(EbpHigh);
break;
- case EOpNegative:
- case EOpPositive:
- case EOpPostIncrement:
- case EOpPostDecrement:
- case EOpPreIncrement:
- case EOpPreDecrement:
- if (mOperand->getBasicType() == EbtBool)
- return false;
+ case EOpUnpackHalf2x16:
+ mType.setPrecision(EbpMedium);
break;
-
- // operators for built-ins are already type checked against their prototype
- case EOpAny:
- case EOpAll:
- case EOpVectorLogicalNot:
- return true;
-
default:
- if (mOperand->getBasicType() != EbtFloat)
- return false;
+ setType(mOperand->getType());
}
- setType(mOperand->getType());
- mType.setQualifier(EvqTemporary);
+ if (funcReturnType != nullptr)
+ {
+ if (funcReturnType->getBasicType() == EbtBool)
+ {
+ // Bool types should not have precision.
+ setType(*funcReturnType);
+ }
+ else
+ {
+ // Precision of the node has been set based on the operand.
+ setTypePreservePrecision(*funcReturnType);
+ }
+ }
- return true;
+ mType.setQualifier(EvqTemporary);
}
//
// Establishes the type of the resultant operation, as well as
// makes the operator the correct one for the operands.
//
-// Returns false if operator can't work on operands.
+// For lots of operations it should already be established that the operand
+// combination is valid, but returns false if operator can't work on operands.
//
bool TIntermBinary::promote(TInfoSink &infoSink)
{
- // This function only handles scalars, vectors, and matrices.
- if (mLeft->isArray() || mRight->isArray())
- {
- infoSink.info.message(EPrefixInternalError, getLine(),
- "Invalid operation for arrays");
- return false;
- }
-
- // GLSL ES 2.0 does not support implicit type casting.
- // So the basic type should always match.
- if (mLeft->getBasicType() != mRight->getBasicType())
- {
- return false;
- }
+ ASSERT(mLeft->isArray() == mRight->isArray());
//
// Base assumption: just make the type the same as the left
@@ -483,12 +422,9 @@ bool TIntermBinary::promote(TInfoSink &infoSink)
// And and Or operate on conditionals
//
case EOpLogicalAnd:
+ case EOpLogicalXor:
case EOpLogicalOr:
- // Both operands must be of type bool.
- if (mLeft->getBasicType() != EbtBool || mRight->getBasicType() != EbtBool)
- {
- return false;
- }
+ ASSERT(mLeft->getBasicType() == EbtBool && mRight->getBasicType() == EbtBool);
setType(TType(EbtBool, EbpUndefined));
break;
@@ -625,12 +561,28 @@ bool TIntermBinary::promote(TInfoSink &infoSink)
case EOpAssign:
case EOpInitialize:
+ // No more additional checks are needed.
+ ASSERT((mLeft->getNominalSize() == mRight->getNominalSize()) &&
+ (mLeft->getSecondarySize() == mRight->getSecondarySize()));
+ break;
case EOpAdd:
case EOpSub:
case EOpDiv:
+ case EOpIMod:
+ case EOpBitShiftLeft:
+ case EOpBitShiftRight:
+ case EOpBitwiseAnd:
+ case EOpBitwiseXor:
+ case EOpBitwiseOr:
case EOpAddAssign:
case EOpSubAssign:
case EOpDivAssign:
+ case EOpIModAssign:
+ case EOpBitShiftLeftAssign:
+ case EOpBitShiftRightAssign:
+ case EOpBitwiseAndAssign:
+ case EOpBitwiseXorAssign:
+ case EOpBitwiseOrAssign:
if ((mLeft->isMatrix() && mRight->isVector()) ||
(mLeft->isVector() && mRight->isMatrix()))
{
@@ -641,13 +593,19 @@ bool TIntermBinary::promote(TInfoSink &infoSink)
if (mLeft->getNominalSize() != mRight->getNominalSize() ||
mLeft->getSecondarySize() != mRight->getSecondarySize())
{
- // If the nominal size of operands do not match:
- // One of them must be scalar.
+ // If the nominal sizes of operands do not match:
+ // One of them must be a scalar.
if (!mLeft->isScalar() && !mRight->isScalar())
return false;
- // Operator cannot be of type pure assignment.
- if (mOp == EOpAssign || mOp == EOpInitialize)
+ // In the case of compound assignment other than multiply-assign,
+ // the right side needs to be a scalar. Otherwise a vector/matrix
+ // would be assigned to a scalar. A scalar can't be shifted by a
+ // vector either.
+ if (!mRight->isScalar() &&
+ (isAssignment() ||
+ mOp == EOpBitShiftLeft ||
+ mOp == EOpBitShiftRight))
return false;
}
@@ -656,6 +614,11 @@ bool TIntermBinary::promote(TInfoSink &infoSink)
mLeft->getSecondarySize(), mRight->getSecondarySize());
setType(TType(basicType, higherPrecision, EvqTemporary,
nominalSize, secondarySize));
+ if (mLeft->isArray())
+ {
+ ASSERT(mLeft->getArraySize() == mRight->getArraySize());
+ mType.setArraySize(mLeft->getArraySize());
+ }
}
break;
@@ -665,11 +628,8 @@ bool TIntermBinary::promote(TInfoSink &infoSink)
case EOpGreaterThan:
case EOpLessThanEqual:
case EOpGreaterThanEqual:
- if ((mLeft->getNominalSize() != mRight->getNominalSize()) ||
- (mLeft->getSecondarySize() != mRight->getSecondarySize()))
- {
- return false;
- }
+ ASSERT((mLeft->getNominalSize() == mRight->getNominalSize()) &&
+ (mLeft->getSecondarySize() == mRight->getSecondarySize()));
setType(TType(EbtBool, EbpUndefined));
break;
@@ -793,6 +753,7 @@ TIntermTyped *TIntermConstantUnion::fold(
break;
case EOpDiv:
+ case EOpIMod:
{
tempConstArray = new ConstantUnion[objectSize];
for (size_t i = 0; i < objectSize; i++)
@@ -810,6 +771,7 @@ TIntermTyped *TIntermConstantUnion::fold(
}
else
{
+ ASSERT(op == EOpDiv);
tempConstArray[i].setFConst(
unionArray[i].getFConst() /
rightUnionArray[i].getFConst());
@@ -826,9 +788,19 @@ TIntermTyped *TIntermConstantUnion::fold(
}
else
{
- tempConstArray[i].setIConst(
- unionArray[i].getIConst() /
- rightUnionArray[i].getIConst());
+ if (op == EOpDiv)
+ {
+ tempConstArray[i].setIConst(
+ unionArray[i].getIConst() /
+ rightUnionArray[i].getIConst());
+ }
+ else
+ {
+ ASSERT(op == EOpIMod);
+ tempConstArray[i].setIConst(
+ unionArray[i].getIConst() %
+ rightUnionArray[i].getIConst());
+ }
}
break;
@@ -842,9 +814,19 @@ TIntermTyped *TIntermConstantUnion::fold(
}
else
{
- tempConstArray[i].setUConst(
- unionArray[i].getUConst() /
- rightUnionArray[i].getUConst());
+ if (op == EOpDiv)
+ {
+ tempConstArray[i].setUConst(
+ unionArray[i].getUConst() /
+ rightUnionArray[i].getUConst());
+ }
+ else
+ {
+ ASSERT(op == EOpIMod);
+ tempConstArray[i].setUConst(
+ unionArray[i].getUConst() %
+ rightUnionArray[i].getUConst());
+ }
}
break;
@@ -968,6 +950,32 @@ TIntermTyped *TIntermConstantUnion::fold(
}
break;
+ case EOpBitwiseAnd:
+ tempConstArray = new ConstantUnion[objectSize];
+ for (size_t i = 0; i < objectSize; i++)
+ tempConstArray[i] = unionArray[i] & rightUnionArray[i];
+ break;
+ case EOpBitwiseXor:
+ tempConstArray = new ConstantUnion[objectSize];
+ for (size_t i = 0; i < objectSize; i++)
+ tempConstArray[i] = unionArray[i] ^ rightUnionArray[i];
+ break;
+ case EOpBitwiseOr:
+ tempConstArray = new ConstantUnion[objectSize];
+ for (size_t i = 0; i < objectSize; i++)
+ tempConstArray[i] = unionArray[i] | rightUnionArray[i];
+ break;
+ case EOpBitShiftLeft:
+ tempConstArray = new ConstantUnion[objectSize];
+ for (size_t i = 0; i < objectSize; i++)
+ tempConstArray[i] = unionArray[i] << rightUnionArray[i];
+ break;
+ case EOpBitShiftRight:
+ tempConstArray = new ConstantUnion[objectSize];
+ for (size_t i = 0; i < objectSize; i++)
+ tempConstArray[i] = unionArray[i] >> rightUnionArray[i];
+ break;
+
case EOpLessThan:
ASSERT(objectSize == 1);
tempConstArray = new ConstantUnion[1];
@@ -1160,6 +1168,23 @@ TIntermTyped *TIntermConstantUnion::fold(
}
break;
+ case EOpBitwiseNot:
+ switch (getType().getBasicType())
+ {
+ case EbtInt:
+ tempConstArray[i].setIConst(~unionArray[i].getIConst());
+ break;
+ case EbtUInt:
+ tempConstArray[i].setUConst(~unionArray[i].getUConst());
+ break;
+ default:
+ infoSink.info.message(
+ EPrefixInternalError, getLine(),
+ "Unary operation not folded into constant");
+ return NULL;
+ }
+ break;
+
default:
return NULL;
}
@@ -1181,3 +1206,29 @@ TString TIntermTraverser::hash(const TString &name, ShHashFunction64 hashFunctio
TString hashedName = stream.str();
return hashedName;
}
+
+void TIntermTraverser::updateTree()
+{
+ for (size_t ii = 0; ii < mReplacements.size(); ++ii)
+ {
+ const NodeUpdateEntry& entry = mReplacements[ii];
+ ASSERT(entry.parent);
+ bool replaced = entry.parent->replaceChildNode(
+ entry.original, entry.replacement);
+ ASSERT(replaced);
+
+ if (!entry.originalBecomesChildOfReplacement)
+ {
+ // In AST traversing, a parent is visited before its children.
+ // After we replace a node, if an immediate child is to
+ // be replaced, we need to make sure we don't update the replaced
+ // node; instead, we update the replacement node.
+ for (size_t jj = ii + 1; jj < mReplacements.size(); ++jj)
+ {
+ NodeUpdateEntry& entry2 = mReplacements[jj];
+ if (entry2.parent == entry.original)
+ entry2.parent = entry.replacement;
+ }
+ }
+ }
+}
diff --git a/src/3rdparty/angle/src/compiler/translator/IntermNode.h b/src/3rdparty/angle/src/compiler/translator/IntermNode.h
index 32c70f4671..9f732cbb00 100644
--- a/src/3rdparty/angle/src/compiler/translator/IntermNode.h
+++ b/src/3rdparty/angle/src/compiler/translator/IntermNode.h
@@ -13,182 +13,19 @@
// each node can have it's own type of list of children.
//
-#ifndef COMPILER_TRANSLATOR_INTERMEDIATE_H_
-#define COMPILER_TRANSLATOR_INTERMEDIATE_H_
+#ifndef COMPILER_TRANSLATOR_INTERMNODE_H_
+#define COMPILER_TRANSLATOR_INTERMNODE_H_
#include "GLSLANG/ShaderLang.h"
#include <algorithm>
#include <queue>
+#include "common/angleutils.h"
#include "compiler/translator/Common.h"
#include "compiler/translator/Types.h"
#include "compiler/translator/ConstantUnion.h"
-
-//
-// Operators used by the high-level (parse tree) representation.
-//
-enum TOperator
-{
- EOpNull, // if in a node, should only mean a node is still being built
- EOpSequence, // denotes a list of statements, or parameters, etc.
- EOpFunctionCall,
- EOpFunction, // For function definition
- EOpParameters, // an aggregate listing the parameters to a function
-
- EOpDeclaration,
- EOpInvariantDeclaration, // Specialized declarations for attributing invariance
- EOpPrototype,
-
- //
- // Unary operators
- //
-
- EOpNegative,
- EOpPositive,
- EOpLogicalNot,
- EOpVectorLogicalNot,
-
- EOpPostIncrement,
- EOpPostDecrement,
- EOpPreIncrement,
- EOpPreDecrement,
-
- //
- // binary operations
- //
-
- EOpAdd,
- EOpSub,
- EOpMul,
- EOpDiv,
- EOpEqual,
- EOpNotEqual,
- EOpVectorEqual,
- EOpVectorNotEqual,
- EOpLessThan,
- EOpGreaterThan,
- EOpLessThanEqual,
- EOpGreaterThanEqual,
- EOpComma,
-
- EOpVectorTimesScalar,
- EOpVectorTimesMatrix,
- EOpMatrixTimesVector,
- EOpMatrixTimesScalar,
-
- EOpLogicalOr,
- EOpLogicalXor,
- EOpLogicalAnd,
-
- EOpIndexDirect,
- EOpIndexIndirect,
- EOpIndexDirectStruct,
- EOpIndexDirectInterfaceBlock,
-
- EOpVectorSwizzle,
-
- //
- // Built-in functions potentially mapped to operators
- //
-
- EOpRadians,
- EOpDegrees,
- EOpSin,
- EOpCos,
- EOpTan,
- EOpAsin,
- EOpAcos,
- EOpAtan,
-
- EOpPow,
- EOpExp,
- EOpLog,
- EOpExp2,
- EOpLog2,
- EOpSqrt,
- EOpInverseSqrt,
-
- EOpAbs,
- EOpSign,
- EOpFloor,
- EOpCeil,
- EOpFract,
- EOpMod,
- EOpMin,
- EOpMax,
- EOpClamp,
- EOpMix,
- EOpStep,
- EOpSmoothStep,
-
- EOpLength,
- EOpDistance,
- EOpDot,
- EOpCross,
- EOpNormalize,
- EOpFaceForward,
- EOpReflect,
- EOpRefract,
-
- EOpDFdx, // Fragment only, OES_standard_derivatives extension
- EOpDFdy, // Fragment only, OES_standard_derivatives extension
- EOpFwidth, // Fragment only, OES_standard_derivatives extension
-
- EOpMatrixTimesMatrix,
-
- EOpAny,
- EOpAll,
-
- //
- // Branch
- //
-
- EOpKill, // Fragment only
- EOpReturn,
- EOpBreak,
- EOpContinue,
-
- //
- // Constructors
- //
-
- EOpConstructInt,
- EOpConstructUInt,
- EOpConstructBool,
- EOpConstructFloat,
- EOpConstructVec2,
- EOpConstructVec3,
- EOpConstructVec4,
- EOpConstructBVec2,
- EOpConstructBVec3,
- EOpConstructBVec4,
- EOpConstructIVec2,
- EOpConstructIVec3,
- EOpConstructIVec4,
- EOpConstructUVec2,
- EOpConstructUVec3,
- EOpConstructUVec4,
- EOpConstructMat2,
- EOpConstructMat3,
- EOpConstructMat4,
- EOpConstructStruct,
-
- //
- // moves
- //
-
- EOpAssign,
- EOpInitialize,
- EOpAddAssign,
- EOpSubAssign,
- EOpMulAssign,
- EOpVectorTimesMatrixAssign,
- EOpVectorTimesScalarAssign,
- EOpMatrixTimesScalarAssign,
- EOpMatrixTimesMatrixAssign,
- EOpDivAssign
-};
+#include "compiler/translator/Operator.h"
class TIntermTraverser;
class TIntermAggregate;
@@ -196,10 +33,13 @@ class TIntermBinary;
class TIntermUnary;
class TIntermConstantUnion;
class TIntermSelection;
+class TIntermSwitch;
+class TIntermCase;
class TIntermTyped;
class TIntermSymbol;
class TIntermLoop;
class TInfoSink;
+class TInfoSinkBase;
class TIntermRaw;
//
@@ -228,6 +68,8 @@ class TIntermNode
virtual TIntermBinary *getAsBinaryNode() { return 0; }
virtual TIntermUnary *getAsUnaryNode() { return 0; }
virtual TIntermSelection *getAsSelectionNode() { return 0; }
+ virtual TIntermSwitch *getAsSwitchNode() { return 0; }
+ virtual TIntermCase *getAsCaseNode() { return 0; }
virtual TIntermSymbol *getAsSymbolNode() { return 0; }
virtual TIntermLoop *getAsLoopNode() { return 0; }
virtual TIntermRaw *getAsRawNode() { return 0; }
@@ -237,10 +79,6 @@ class TIntermNode
virtual bool replaceChildNode(
TIntermNode *original, TIntermNode *replacement) = 0;
- // For traversing a tree in no particular order, but using
- // heap memory.
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const = 0;
-
protected:
TSourceLoc mLine;
};
@@ -331,8 +169,6 @@ class TIntermLoop : public TIntermNode
void setUnrollFlag(bool flag) { mUnrollFlag = flag; }
bool getUnrollFlag() const { return mUnrollFlag; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const;
-
protected:
TLoopType mType;
TIntermNode *mInit; // for-loop initialization
@@ -360,8 +196,6 @@ class TIntermBranch : public TIntermNode
TOperator getFlowOp() { return mFlowOp; }
TIntermTyped* getExpression() { return mExpression; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const;
-
protected:
TOperator mFlowOp;
TIntermTyped *mExpression; // non-zero except for "return exp;" statements
@@ -394,8 +228,6 @@ class TIntermSymbol : public TIntermTyped
virtual TIntermSymbol *getAsSymbolNode() { return this; }
virtual bool replaceChildNode(TIntermNode *, TIntermNode *) { return false; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const {}
-
protected:
int mId;
TString mSymbol;
@@ -419,7 +251,6 @@ class TIntermRaw : public TIntermTyped
virtual TIntermRaw *getAsRawNode() { return this; }
virtual bool replaceChildNode(TIntermNode *, TIntermNode *) { return false; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const {}
protected:
TString mRawText;
@@ -459,8 +290,6 @@ class TIntermConstantUnion : public TIntermTyped
TIntermTyped *fold(TOperator, TIntermTyped *, TInfoSink &);
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const {}
-
protected:
ConstantUnion *mUnionArrayPointer;
};
@@ -519,8 +348,6 @@ class TIntermBinary : public TIntermOperator
void setAddIndexClamp() { mAddIndexClamp = true; }
bool getAddIndexClamp() { return mAddIndexClamp; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const;
-
protected:
TIntermTyped* mLeft;
TIntermTyped* mRight;
@@ -556,13 +383,11 @@ class TIntermUnary : public TIntermOperator
void setOperand(TIntermTyped *operand) { mOperand = operand; }
TIntermTyped *getOperand() { return mOperand; }
- bool promote(TInfoSink &);
+ void promote(const TType *funcReturnType);
void setUseEmulatedFunction() { mUseEmulatedFunction = true; }
bool getUseEmulatedFunction() { return mUseEmulatedFunction; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const;
-
protected:
TIntermTyped *mOperand;
@@ -613,8 +438,6 @@ class TIntermAggregate : public TIntermOperator
void setUseEmulatedFunction() { mUseEmulatedFunction = true; }
bool getUseEmulatedFunction() { return mUseEmulatedFunction; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const;
-
void setPrecisionFromChildren();
void setBuiltInFunctionPrecision();
@@ -634,7 +457,7 @@ class TIntermAggregate : public TIntermOperator
};
//
-// For if tests. Simplified since there is no switch statement.
+// For if tests.
//
class TIntermSelection : public TIntermTyped
{
@@ -664,14 +487,64 @@ class TIntermSelection : public TIntermTyped
TIntermNode *getFalseBlock() const { return mFalseBlock; }
TIntermSelection *getAsSelectionNode() { return this; }
- virtual void enqueueChildren(std::queue<TIntermNode *> *nodeQueue) const;
-
protected:
TIntermTyped *mCondition;
TIntermNode *mTrueBlock;
TIntermNode *mFalseBlock;
};
+//
+// Switch statement.
+//
+class TIntermSwitch : public TIntermNode
+{
+ public:
+ TIntermSwitch(TIntermTyped *init, TIntermAggregate *statementList)
+ : TIntermNode(),
+ mInit(init),
+ mStatementList(statementList)
+ {
+ }
+
+ void traverse(TIntermTraverser *it) override;
+ bool replaceChildNode(
+ TIntermNode *original, TIntermNode *replacement) override;
+
+ TIntermSwitch *getAsSwitchNode() override { return this; }
+
+ TIntermAggregate *getStatementList() { return mStatementList; }
+ void setStatementList(TIntermAggregate *statementList) { mStatementList = statementList; }
+
+ protected:
+ TIntermTyped *mInit;
+ TIntermAggregate *mStatementList;
+};
+
+//
+// Case label.
+//
+class TIntermCase : public TIntermNode
+{
+ public:
+ TIntermCase(TIntermTyped *condition)
+ : TIntermNode(),
+ mCondition(condition)
+ {
+ }
+
+ void traverse(TIntermTraverser *it) override;
+ bool replaceChildNode(
+ TIntermNode *original, TIntermNode *replacement) override;
+
+ TIntermCase *getAsCaseNode() override { return this; }
+
+ bool hasCondition() const { return mCondition != nullptr; }
+ TIntermTyped *getCondition() const { return mCondition; }
+
+ protected:
+ TIntermTyped *mCondition;
+};
+
enum Visit
{
PreVisit,
@@ -687,7 +560,7 @@ enum Visit
// When using this, just fill in the methods for nodes you want visited.
// Return false from a pre-visit to skip visiting that node's subtree.
//
-class TIntermTraverser
+class TIntermTraverser : angle::NonCopyable
{
public:
POOL_ALLOCATOR_NEW_DELETE();
@@ -708,6 +581,8 @@ class TIntermTraverser
virtual bool visitBinary(Visit, TIntermBinary *) { return true; }
virtual bool visitUnary(Visit, TIntermUnary *) { return true; }
virtual bool visitSelection(Visit, TIntermSelection *) { return true; }
+ virtual bool visitSwitch(Visit, TIntermSwitch *) { return true; }
+ virtual bool visitCase(Visit, TIntermCase *) { return true; }
virtual bool visitAggregate(Visit, TIntermAggregate *) { return true; }
virtual bool visitLoop(Visit, TIntermLoop *) { return true; }
virtual bool visitBranch(Visit, TIntermBranch *) { return true; }
@@ -741,12 +616,38 @@ class TIntermTraverser
const bool postVisit;
const bool rightToLeft;
+ // If traversers need to replace nodes, they can add the replacements in
+ // mReplacements during traversal and the user of the traverser should call
+ // this function after traversal to perform them.
+ void updateTree();
+
protected:
int mDepth;
int mMaxDepth;
// All the nodes from root to the current node's parent during traversing.
TVector<TIntermNode *> mPath;
+
+ struct NodeUpdateEntry
+ {
+ NodeUpdateEntry(TIntermNode *_parent,
+ TIntermNode *_original,
+ TIntermNode *_replacement,
+ bool _originalBecomesChildOfReplacement)
+ : parent(_parent),
+ original(_original),
+ replacement(_replacement),
+ originalBecomesChildOfReplacement(_originalBecomesChildOfReplacement) {}
+
+ TIntermNode *parent;
+ TIntermNode *original;
+ TIntermNode *replacement;
+ bool originalBecomesChildOfReplacement;
+ };
+
+ // During traversing, save all the changes that need to happen into
+ // mReplacements, then do them by calling updateTree().
+ std::vector<NodeUpdateEntry> mReplacements;
};
//
@@ -768,10 +669,10 @@ class TMaxDepthTraverser : public TIntermTraverser
virtual bool visitLoop(Visit, TIntermLoop *) { return depthCheck(); }
virtual bool visitBranch(Visit, TIntermBranch *) { return depthCheck(); }
-protected:
+ protected:
bool depthCheck() const { return mMaxDepth < mDepthLimit; }
int mDepthLimit;
};
-#endif // COMPILER_TRANSLATOR_INTERMEDIATE_H_
+#endif // COMPILER_TRANSLATOR_INTERMNODE_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/IntermTraverse.cpp b/src/3rdparty/angle/src/compiler/translator/IntermTraverse.cpp
index 72b2033fb3..7a7efb71f5 100644
--- a/src/3rdparty/angle/src/compiler/translator/IntermTraverse.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/IntermTraverse.cpp
@@ -194,6 +194,60 @@ void TIntermSelection::traverse(TIntermTraverser *it)
}
//
+// Traverse a switch node. Same comments in binary node apply here.
+//
+void TIntermSwitch::traverse(TIntermTraverser *it)
+{
+ bool visit = true;
+
+ if (it->preVisit)
+ visit = it->visitSwitch(PreVisit, this);
+
+ if (visit)
+ {
+ it->incrementDepth(this);
+ if (it->rightToLeft)
+ {
+ if (mStatementList)
+ mStatementList->traverse(it);
+ if (it->inVisit)
+ visit = it->visitSwitch(InVisit, this);
+ if (visit)
+ mInit->traverse(it);
+ }
+ else
+ {
+ mInit->traverse(it);
+ if (it->inVisit)
+ visit = it->visitSwitch(InVisit, this);
+ if (visit && mStatementList)
+ mStatementList->traverse(it);
+ }
+ it->decrementDepth();
+ }
+
+ if (visit && it->postVisit)
+ it->visitSwitch(PostVisit, this);
+}
+
+//
+// Traverse a switch node. Same comments in binary node apply here.
+//
+void TIntermCase::traverse(TIntermTraverser *it)
+{
+ bool visit = true;
+
+ if (it->preVisit)
+ visit = it->visitCase(PreVisit, this);
+
+ if (visit && mCondition)
+ mCondition->traverse(it);
+
+ if (visit && it->postVisit)
+ it->visitCase(PostVisit, this);
+}
+
+//
// Traverse a loop node. Same comments in binary node apply here.
//
void TIntermLoop::traverse(TIntermTraverser *it)
diff --git a/src/3rdparty/angle/src/compiler/translator/Intermediate.cpp b/src/3rdparty/angle/src/compiler/translator/Intermediate.cpp
index e558683c55..320056f8ce 100644
--- a/src/3rdparty/angle/src/compiler/translator/Intermediate.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/Intermediate.cpp
@@ -13,7 +13,6 @@
#include <algorithm>
#include "compiler/translator/Intermediate.h"
-#include "compiler/translator/RemoveTree.h"
#include "compiler/translator/SymbolTable.h"
////////////////////////////////////////////////////////////////////////////
@@ -46,47 +45,6 @@ TIntermSymbol *TIntermediate::addSymbol(
TIntermTyped *TIntermediate::addBinaryMath(
TOperator op, TIntermTyped *left, TIntermTyped *right, const TSourceLoc &line)
{
- switch (op)
- {
- case EOpEqual:
- case EOpNotEqual:
- if (left->isArray())
- return NULL;
- break;
- case EOpLessThan:
- case EOpGreaterThan:
- case EOpLessThanEqual:
- case EOpGreaterThanEqual:
- if (left->isMatrix() || left->isArray() || left->isVector() ||
- left->getBasicType() == EbtStruct)
- {
- return NULL;
- }
- break;
- case EOpLogicalOr:
- case EOpLogicalXor:
- case EOpLogicalAnd:
- if (left->getBasicType() != EbtBool ||
- left->isMatrix() || left->isArray() || left->isVector())
- {
- return NULL;
- }
- break;
- case EOpAdd:
- case EOpSub:
- case EOpDiv:
- case EOpMul:
- if (left->getBasicType() == EbtStruct || left->getBasicType() == EbtBool)
- return NULL;
- default:
- break;
- }
-
- if (left->getBasicType() != right->getBasicType())
- {
- return NULL;
- }
-
//
// Need a new node holding things together then. Make
// one and promote it to the right type.
@@ -169,45 +127,8 @@ TIntermTyped *TIntermediate::addIndex(
// Returns the added node.
//
TIntermTyped *TIntermediate::addUnaryMath(
- TOperator op, TIntermNode *childNode, const TSourceLoc &line)
+ TOperator op, TIntermTyped *child, const TSourceLoc &line, const TType *funcReturnType)
{
- TIntermUnary *node;
- TIntermTyped *child = childNode->getAsTyped();
-
- if (child == NULL)
- {
- mInfoSink.info.message(EPrefixInternalError, line,
- "Bad type in AddUnaryMath");
- return NULL;
- }
-
- switch (op)
- {
- case EOpLogicalNot:
- if (child->getType().getBasicType() != EbtBool ||
- child->getType().isMatrix() ||
- child->getType().isArray() ||
- child->getType().isVector())
- {
- return NULL;
- }
- break;
-
- case EOpPostIncrement:
- case EOpPreIncrement:
- case EOpPostDecrement:
- case EOpPreDecrement:
- case EOpNegative:
- case EOpPositive:
- if (child->getType().getBasicType() == EbtStruct ||
- child->getType().isArray())
- {
- return NULL;
- }
- default:
- break;
- }
-
TIntermConstantUnion *childTempConstant = 0;
if (child->getAsConstantUnion())
childTempConstant = child->getAsConstantUnion();
@@ -215,12 +136,10 @@ TIntermTyped *TIntermediate::addUnaryMath(
//
// Make a new node for the operator.
//
- node = new TIntermUnary(op);
+ TIntermUnary *node = new TIntermUnary(op);
node->setLine(line);
node->setOperand(child);
-
- if (!node->promote(mInfoSink))
- return 0;
+ node->promote(funcReturnType);
if (childTempConstant)
{
@@ -423,6 +342,24 @@ TIntermTyped *TIntermediate::addSelection(
return node;
}
+TIntermSwitch *TIntermediate::addSwitch(
+ TIntermTyped *init, TIntermAggregate *statementList, const TSourceLoc &line)
+{
+ TIntermSwitch *node = new TIntermSwitch(init, statementList);
+ node->setLine(line);
+
+ return node;
+}
+
+TIntermCase *TIntermediate::addCase(
+ TIntermTyped *condition, const TSourceLoc &line)
+{
+ TIntermCase *node = new TIntermCase(condition);
+ node->setLine(line);
+
+ return node;
+}
+
//
// Constant terminal nodes. Has a union that contains bool, float or int constants
//
@@ -510,12 +447,3 @@ bool TIntermediate::postProcess(TIntermNode *root)
return true;
}
-
-//
-// This deletes the tree.
-//
-void TIntermediate::remove(TIntermNode *root)
-{
- if (root)
- RemoveAllTreeNodes(root);
-}
diff --git a/src/3rdparty/angle/src/compiler/translator/intermediate.h b/src/3rdparty/angle/src/compiler/translator/Intermediate.h
index 3b7e7bd802..ec73e22834 100644
--- a/src/3rdparty/angle/src/compiler/translator/intermediate.h
+++ b/src/3rdparty/angle/src/compiler/translator/Intermediate.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_TRANSLATOR_LOCAL_INTERMEDIATE_H_
-#define COMPILER_TRANSLATOR_LOCAL_INTERMEDIATE_H_
+#ifndef COMPILER_TRANSLATOR_INTERMEDIATE_H_
+#define COMPILER_TRANSLATOR_INTERMEDIATE_H_
#include "compiler/translator/IntermNode.h"
@@ -35,7 +35,7 @@ class TIntermediate
TIntermTyped *addIndex(
TOperator op, TIntermTyped *base, TIntermTyped *index, const TSourceLoc &);
TIntermTyped *addUnaryMath(
- TOperator op, TIntermNode *child, const TSourceLoc &);
+ TOperator op, TIntermTyped *child, const TSourceLoc &line, const TType *funcReturnType);
TIntermAggregate *growAggregate(
TIntermNode *left, TIntermNode *right, const TSourceLoc &);
TIntermAggregate *makeAggregate(TIntermNode *node, const TSourceLoc &);
@@ -43,6 +43,10 @@ class TIntermediate
TIntermNode *addSelection(TIntermTyped *cond, TIntermNodePair code, const TSourceLoc &);
TIntermTyped *addSelection(
TIntermTyped *cond, TIntermTyped *trueBlock, TIntermTyped *falseBlock, const TSourceLoc &);
+ TIntermSwitch *addSwitch(
+ TIntermTyped *init, TIntermAggregate *statementList, const TSourceLoc &line);
+ TIntermCase *addCase(
+ TIntermTyped *condition, const TSourceLoc &line);
TIntermTyped *addComma(
TIntermTyped *left, TIntermTyped *right, const TSourceLoc &);
TIntermConstantUnion *addConstantUnion(ConstantUnion *, const TType &, const TSourceLoc &);
@@ -55,8 +59,8 @@ class TIntermediate
TIntermBranch *addBranch(TOperator, TIntermTyped *, const TSourceLoc &);
TIntermTyped *addSwizzle(TVectorFields &, const TSourceLoc &);
bool postProcess(TIntermNode *);
- void remove(TIntermNode *);
- void outputTree(TIntermNode *);
+
+ static void outputTree(TIntermNode *, TInfoSinkBase &);
private:
void operator=(TIntermediate &); // prevent assignments
@@ -64,4 +68,4 @@ class TIntermediate
TInfoSink & mInfoSink;
};
-#endif // COMPILER_TRANSLATOR_LOCAL_INTERMEDIATE_H_
+#endif // COMPILER_TRANSLATOR_INTERMEDIATE_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/LoopInfo.h b/src/3rdparty/angle/src/compiler/translator/LoopInfo.h
index 5f72a6e944..ec73fd0fa5 100644
--- a/src/3rdparty/angle/src/compiler/translator/LoopInfo.h
+++ b/src/3rdparty/angle/src/compiler/translator/LoopInfo.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef COMPILER_TRANSLATOR_LOOP_INFO_H_
-#define COMPILER_TRANSLATOR_LOOP_INFO_H_
+#ifndef COMPILER_TRANSLATOR_LOOPINFO_H_
+#define COMPILER_TRANSLATOR_LOOPINFO_H_
#include "compiler/translator/IntermNode.h"
@@ -76,5 +76,5 @@ class TLoopStack : public TVector<TLoopInfo>
void pop();
};
-#endif // COMPILER_TRANSLATOR_LOOP_INDEX_H_
+#endif // COMPILER_TRANSLATOR_LOOPINFO_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/MMap.h b/src/3rdparty/angle/src/compiler/translator/MMap.h
index a308671514..fca843992b 100644
--- a/src/3rdparty/angle/src/compiler/translator/MMap.h
+++ b/src/3rdparty/angle/src/compiler/translator/MMap.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef _MMAP_INCLUDED_
-#define _MMAP_INCLUDED_
+#ifndef COMPILER_TRANSLATOR_MMAP_H_
+#define COMPILER_TRANSLATOR_MMAP_H_
//
// Encapsulate memory mapped files
@@ -53,4 +53,4 @@ private:
char* fBuff; // the actual data;
};
-#endif // _MMAP_INCLUDED_
+#endif // COMPILER_TRANSLATOR_MMAP_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/NodeSearch.h b/src/3rdparty/angle/src/compiler/translator/NodeSearch.h
index 60070c9d33..8ffed614c3 100644
--- a/src/3rdparty/angle/src/compiler/translator/NodeSearch.h
+++ b/src/3rdparty/angle/src/compiler/translator/NodeSearch.h
@@ -6,8 +6,8 @@
// NodeSearch.h: Utilities for searching translator node graphs
//
-#ifndef TRANSLATOR_NODESEARCH_H_
-#define TRANSLATOR_NODESEARCH_H_
+#ifndef COMPILER_TRANSLATOR_NODESEARCH_H_
+#define COMPILER_TRANSLATOR_NODESEARCH_H_
#include "compiler/translator/IntermNode.h"
@@ -77,4 +77,4 @@ class FindSideEffectRewriting : public NodeSearchTraverser<FindSideEffectRewriti
}
-#endif // TRANSLATOR_NODESEARCH_H_
+#endif // COMPILER_TRANSLATOR_NODESEARCH_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/Operator.cpp b/src/3rdparty/angle/src/compiler/translator/Operator.cpp
new file mode 100644
index 0000000000..ae4512bd44
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/Operator.cpp
@@ -0,0 +1,195 @@
+//
+// Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#include "compiler/translator/Operator.h"
+
+const char *GetOperatorString(TOperator op)
+{
+ switch (op)
+ {
+ // Note: ops from EOpNull to EOpPrototype can't be handled here.
+
+ case EOpNegative: return "-";
+ case EOpPositive: return "+";
+ case EOpLogicalNot: return "!";
+ case EOpVectorLogicalNot: return "not";
+ case EOpBitwiseNot: return "~";
+
+ case EOpPostIncrement: return "++";
+ case EOpPostDecrement: return "--";
+ case EOpPreIncrement: return "++";
+ case EOpPreDecrement: return "--";
+
+ case EOpAdd: return "+";
+ case EOpSub: return "-";
+ case EOpMul: return "*";
+ case EOpDiv: return "/";
+ case EOpIMod: return "%";
+ case EOpEqual: return "==";
+ case EOpNotEqual: return "!=";
+ case EOpVectorEqual: return "equal";
+ case EOpVectorNotEqual: return "notEqual";
+ case EOpLessThan: return "<";
+ case EOpGreaterThan: return ">";
+ case EOpLessThanEqual: return "<=";
+ case EOpGreaterThanEqual: return ">=";
+ case EOpComma: return ",";
+
+ // Fall-through.
+ case EOpVectorTimesScalar:
+ case EOpVectorTimesMatrix:
+ case EOpMatrixTimesVector:
+ case EOpMatrixTimesScalar: return "*";
+
+ case EOpLogicalOr: return "||";
+ case EOpLogicalXor: return "^^";
+ case EOpLogicalAnd: return "&&";
+
+ case EOpBitShiftLeft: return "<<";
+ case EOpBitShiftRight: return ">>";
+
+ case EOpBitwiseAnd: return "&";
+ case EOpBitwiseXor: return "^";
+ case EOpBitwiseOr: return "|";
+
+ // Fall-through.
+ case EOpIndexDirect:
+ case EOpIndexIndirect: return "[]";
+
+ case EOpIndexDirectStruct:
+ case EOpIndexDirectInterfaceBlock: return ".";
+
+ case EOpVectorSwizzle: return ".";
+
+ case EOpRadians: return "radians";
+ case EOpDegrees: return "degrees";
+ case EOpSin: return "sin";
+ case EOpCos: return "cos";
+ case EOpTan: return "tan";
+ case EOpAsin: return "asin";
+ case EOpAcos: return "acos";
+ case EOpAtan: return "atan";
+
+ case EOpSinh: return "sinh";
+ case EOpCosh: return "cosh";
+ case EOpTanh: return "tanh";
+ case EOpAsinh: return "asinh";
+ case EOpAcosh: return "acosh";
+ case EOpAtanh: return "atanh";
+
+ case EOpPow: return "pow";
+ case EOpExp: return "exp";
+ case EOpLog: return "log";
+ case EOpExp2: return "exp2";
+ case EOpLog2: return "log2";
+ case EOpSqrt: return "sqrt";
+ case EOpInverseSqrt: return "inversesqrt";
+
+ case EOpAbs: return "abs";
+ case EOpSign: return "sign";
+ case EOpFloor: return "floor";
+ case EOpTrunc: return "trunc";
+ case EOpRound: return "round";
+ case EOpRoundEven: return "roundEven";
+ case EOpCeil: return "ceil";
+ case EOpFract: return "fract";
+ case EOpMod: return "mod";
+ case EOpModf: return "modf";
+ case EOpMin: return "min";
+ case EOpMax: return "max";
+ case EOpClamp: return "clamp";
+ case EOpMix: return "mix";
+ case EOpStep: return "step";
+ case EOpSmoothStep: return "smoothstep";
+ case EOpIsNan: return "isnan";
+ case EOpIsInf: return "isinf";
+
+ case EOpFloatBitsToInt: return "floatBitsToInt";
+ case EOpFloatBitsToUint: return "floatBitsToUint";
+ case EOpIntBitsToFloat: return "intBitsToFloat";
+ case EOpUintBitsToFloat: return "uintBitsToFloat";
+
+ case EOpPackSnorm2x16: return "packSnorm2x16";
+ case EOpPackUnorm2x16: return "packUnorm2x16";
+ case EOpPackHalf2x16: return "packHalf2x16";
+ case EOpUnpackSnorm2x16: return "unpackSnorm2x16";
+ case EOpUnpackUnorm2x16: return "unpackUnorm2x16";
+ case EOpUnpackHalf2x16: return "unpackHalf2x16";
+
+ case EOpLength: return "length";
+ case EOpDistance: return "distance";
+ case EOpDot: return "dot";
+ case EOpCross: return "cross";
+ case EOpNormalize: return "normalize";
+ case EOpFaceForward: return "faceforward";
+ case EOpReflect: return "reflect";
+ case EOpRefract: return "refract";
+
+ case EOpDFdx: return "dFdx";
+ case EOpDFdy: return "dFdy";
+ case EOpFwidth: return "fwidth";
+
+ case EOpMatrixTimesMatrix: return "*";
+
+ case EOpOuterProduct: return "outerProduct";
+ case EOpTranspose: return "transpose";
+ case EOpDeterminant: return "determinant";
+ case EOpInverse: return "inverse";
+
+ case EOpAny: return "any";
+ case EOpAll: return "all";
+
+ case EOpKill: return "kill";
+ case EOpReturn: return "return";
+ case EOpBreak: return "break";
+ case EOpContinue: return "continue";
+
+ case EOpConstructInt: return "int";
+ case EOpConstructUInt: return "uint";
+ case EOpConstructBool: return "bool";
+ case EOpConstructFloat: return "float";
+ case EOpConstructVec2: return "vec2";
+ case EOpConstructVec3: return "vec3";
+ case EOpConstructVec4: return "vec4";
+ case EOpConstructBVec2: return "bvec2";
+ case EOpConstructBVec3: return "bvec3";
+ case EOpConstructBVec4: return "bvec4";
+ case EOpConstructIVec2: return "ivec2";
+ case EOpConstructIVec3: return "ivec3";
+ case EOpConstructIVec4: return "ivec4";
+ case EOpConstructUVec2: return "uvec2";
+ case EOpConstructUVec3: return "uvec3";
+ case EOpConstructUVec4: return "uvec4";
+ case EOpConstructMat2: return "mat2";
+ case EOpConstructMat3: return "mat3";
+ case EOpConstructMat4: return "mat4";
+ // Note: EOpConstructStruct can't be handled here
+
+ case EOpAssign: return "=";
+ case EOpInitialize: return "=";
+ case EOpAddAssign: return "+=";
+ case EOpSubAssign: return "-=";
+
+ // Fall-through.
+ case EOpMulAssign:
+ case EOpVectorTimesMatrixAssign:
+ case EOpVectorTimesScalarAssign:
+ case EOpMatrixTimesScalarAssign:
+ case EOpMatrixTimesMatrixAssign: return "*=";
+
+ case EOpDivAssign: return "/=";
+ case EOpIModAssign: return "%=";
+ case EOpBitShiftLeftAssign: return "<<=";
+ case EOpBitShiftRightAssign: return ">>=";
+ case EOpBitwiseAndAssign: return "&=";
+ case EOpBitwiseXorAssign: return "^=";
+ case EOpBitwiseOrAssign: return "|=";
+
+ default: break;
+ }
+ return "";
+}
+
diff --git a/src/3rdparty/angle/src/compiler/translator/Operator.h b/src/3rdparty/angle/src/compiler/translator/Operator.h
new file mode 100644
index 0000000000..8290f952fc
--- /dev/null
+++ b/src/3rdparty/angle/src/compiler/translator/Operator.h
@@ -0,0 +1,226 @@
+//
+// Copyright (c) 2002-2015 The ANGLE Project Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+
+#ifndef COMPILER_TRANSLATOR_OPERATOR_H_
+#define COMPILER_TRANSLATOR_OPERATOR_H_
+
+//
+// Operators used by the high-level (parse tree) representation.
+//
+enum TOperator
+{
+ EOpNull, // if in a node, should only mean a node is still being built
+ EOpSequence, // denotes a list of statements, or parameters, etc.
+ EOpFunctionCall,
+ EOpInternalFunctionCall, // Call to an internal helper function
+ EOpFunction, // For function definition
+ EOpParameters, // an aggregate listing the parameters to a function
+
+ EOpDeclaration,
+ EOpInvariantDeclaration, // Specialized declarations for attributing invariance
+ EOpPrototype,
+
+ //
+ // Unary operators
+ //
+
+ EOpNegative,
+ EOpPositive,
+ EOpLogicalNot,
+ EOpVectorLogicalNot,
+ EOpBitwiseNot,
+
+ EOpPostIncrement,
+ EOpPostDecrement,
+ EOpPreIncrement,
+ EOpPreDecrement,
+
+ //
+ // binary operations
+ //
+
+ EOpAdd,
+ EOpSub,
+ EOpMul,
+ EOpDiv,
+ EOpIMod,
+ EOpEqual,
+ EOpNotEqual,
+ EOpVectorEqual,
+ EOpVectorNotEqual,
+ EOpLessThan,
+ EOpGreaterThan,
+ EOpLessThanEqual,
+ EOpGreaterThanEqual,
+ EOpComma,
+
+ EOpVectorTimesScalar,
+ EOpVectorTimesMatrix,
+ EOpMatrixTimesVector,
+ EOpMatrixTimesScalar,
+
+ EOpLogicalOr,
+ EOpLogicalXor,
+ EOpLogicalAnd,
+
+ EOpBitShiftLeft,
+ EOpBitShiftRight,
+
+ EOpBitwiseAnd,
+ EOpBitwiseXor,
+ EOpBitwiseOr,
+
+ EOpIndexDirect,
+ EOpIndexIndirect,
+ EOpIndexDirectStruct,
+ EOpIndexDirectInterfaceBlock,
+
+ EOpVectorSwizzle,
+
+ //
+ // Built-in functions potentially mapped to operators
+ //
+
+ EOpRadians,
+ EOpDegrees,
+ EOpSin,
+ EOpCos,
+ EOpTan,
+ EOpAsin,
+ EOpAcos,
+ EOpAtan,
+
+ EOpSinh,
+ EOpCosh,
+ EOpTanh,
+ EOpAsinh,
+ EOpAcosh,
+ EOpAtanh,
+
+ EOpPow,
+ EOpExp,
+ EOpLog,
+ EOpExp2,
+ EOpLog2,
+ EOpSqrt,
+ EOpInverseSqrt,
+
+ EOpAbs,
+ EOpSign,
+ EOpFloor,
+ EOpTrunc,
+ EOpRound,
+ EOpRoundEven,
+ EOpCeil,
+ EOpFract,
+ EOpMod,
+ EOpModf,
+ EOpMin,
+ EOpMax,
+ EOpClamp,
+ EOpMix,
+ EOpStep,
+ EOpSmoothStep,
+ EOpIsNan,
+ EOpIsInf,
+
+ EOpFloatBitsToInt,
+ EOpFloatBitsToUint,
+ EOpIntBitsToFloat,
+ EOpUintBitsToFloat,
+
+ EOpPackSnorm2x16,
+ EOpPackUnorm2x16,
+ EOpPackHalf2x16,
+ EOpUnpackSnorm2x16,
+ EOpUnpackUnorm2x16,
+ EOpUnpackHalf2x16,
+
+ EOpLength,
+ EOpDistance,
+ EOpDot,
+ EOpCross,
+ EOpNormalize,
+ EOpFaceForward,
+ EOpReflect,
+ EOpRefract,
+
+ EOpDFdx, // Fragment only, OES_standard_derivatives extension
+ EOpDFdy, // Fragment only, OES_standard_derivatives extension
+ EOpFwidth, // Fragment only, OES_standard_derivatives extension
+
+ EOpMatrixTimesMatrix,
+
+ EOpOuterProduct,
+ EOpTranspose,
+ EOpDeterminant,
+ EOpInverse,
+
+ EOpAny,
+ EOpAll,
+
+ //
+ // Branch
+ //
+
+ EOpKill, // Fragment only
+ EOpReturn,
+ EOpBreak,
+ EOpContinue,
+
+ //
+ // Constructors
+ //
+
+ EOpConstructInt,
+ EOpConstructUInt,
+ EOpConstructBool,
+ EOpConstructFloat,
+ EOpConstructVec2,
+ EOpConstructVec3,
+ EOpConstructVec4,
+ EOpConstructBVec2,
+ EOpConstructBVec3,
+ EOpConstructBVec4,
+ EOpConstructIVec2,
+ EOpConstructIVec3,
+ EOpConstructIVec4,
+ EOpConstructUVec2,
+ EOpConstructUVec3,
+ EOpConstructUVec4,
+ EOpConstructMat2,
+ EOpConstructMat3,
+ EOpConstructMat4,
+ EOpConstructStruct,
+
+ //
+ // moves
+ //
+
+ EOpAssign,
+ EOpInitialize,
+ EOpAddAssign,
+ EOpSubAssign,
+
+ EOpMulAssign,
+ EOpVectorTimesMatrixAssign,
+ EOpVectorTimesScalarAssign,
+ EOpMatrixTimesScalarAssign,
+ EOpMatrixTimesMatrixAssign,
+
+ EOpDivAssign,
+ EOpIModAssign,
+ EOpBitShiftLeftAssign,
+ EOpBitShiftRightAssign,
+ EOpBitwiseAndAssign,
+ EOpBitwiseXorAssign,
+ EOpBitwiseOrAssign
+};
+
+// Returns the string corresponding to the operator in GLSL
+const char* GetOperatorString(TOperator op);
+
+#endif // COMPILER_TRANSLATOR_OPERATOR_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/OutputESSL.cpp b/src/3rdparty/angle/src/compiler/translator/OutputESSL.cpp
index 65635af1ff..77e0a8fb37 100644
--- a/src/3rdparty/angle/src/compiler/translator/OutputESSL.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/OutputESSL.cpp
@@ -6,13 +6,21 @@
#include "compiler/translator/OutputESSL.h"
-TOutputESSL::TOutputESSL(TInfoSinkBase& objSink,
+TOutputESSL::TOutputESSL(TInfoSinkBase &objSink,
ShArrayIndexClampingStrategy clampingStrategy,
ShHashFunction64 hashFunction,
- NameMap& nameMap,
- TSymbolTable& symbolTable,
- int shaderVersion)
- : TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable, shaderVersion)
+ NameMap &nameMap,
+ TSymbolTable &symbolTable,
+ int shaderVersion,
+ bool forceHighp)
+ : TOutputGLSLBase(objSink,
+ clampingStrategy,
+ hashFunction,
+ nameMap,
+ symbolTable,
+ shaderVersion,
+ SH_ESSL_OUTPUT),
+ mForceHighp(forceHighp)
{
}
@@ -22,6 +30,9 @@ bool TOutputESSL::writeVariablePrecision(TPrecision precision)
return false;
TInfoSinkBase& out = objSink();
- out << getPrecisionString(precision);
+ if (mForceHighp)
+ out << getPrecisionString(EbpHigh);
+ else
+ out << getPrecisionString(precision);
return true;
}
diff --git a/src/3rdparty/angle/src/compiler/translator/OutputESSL.h b/src/3rdparty/angle/src/compiler/translator/OutputESSL.h
index 8a567fb8aa..813f1e944b 100644
--- a/src/3rdparty/angle/src/compiler/translator/OutputESSL.h
+++ b/src/3rdparty/angle/src/compiler/translator/OutputESSL.h
@@ -4,8 +4,8 @@
// found in the LICENSE file.
//
-#ifndef CROSSCOMPILERGLSL_OUTPUTESSL_H_
-#define CROSSCOMPILERGLSL_OUTPUTESSL_H_
+#ifndef COMPILER_TRANSLATOR_OUTPUTESSL_H_
+#define COMPILER_TRANSLATOR_OUTPUTESSL_H_
#include "compiler/translator/OutputGLSLBase.h"
@@ -17,10 +17,13 @@ public:
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable,
- int shaderVersion);
+ int shaderVersion,
+ bool forceHighp);
protected:
virtual bool writeVariablePrecision(TPrecision precision);
+private:
+ bool mForceHighp;
};
-#endif // CROSSCOMPILERGLSL_OUTPUTESSL_H_
+#endif // COMPILER_TRANSLATOR_OUTPUTESSL_H_
diff --git a/src/3rdparty/angle/src/compiler/translator/OutputGLSL.cpp b/src/3rdparty/angle/src/compiler/translator/OutputGLSL.cpp
index eb7cbb4ae8..9badf0e2fc 100644
--- a/src/3rdparty/angle/src/compiler/translator/OutputGLSL.cpp
+++ b/src/3rdparty/angle/src/compiler/translator/OutputGLSL.cpp
@@ -11,8 +11,15 @@ TOutputGLSL::TOutputGLSL(TInfoSinkBase& objSink,
ShHashFunction64 hashFunction,
NameMap& nameMap,
TSymbolTable& symbolTable,
- int shaderVersion)
- : TOutputGLSLBase(objSink, clampingStrategy, hashFunction, nameMap, symbolTable, shaderVersion)
+ int shaderVersion,
+ ShShaderOutput output)
+ : TOutputGLSLBase(objSink,
+ clampingStrategy,
+ hashFunction,
+ nameMap,
+ symbolTable,
+ shaderVersion,
+ output)
{
}
@@ -21,21 +28,30 @@ bool TOutputGLSL::writeVariablePrecision(TPrecision)
return false;
}
-void TOutputGLSL::visitSymbol(TIntermSymbol* node)
+void TOutputGLSL::visitSymbol(TIntermSymbol *node)
{
TInfoSinkBase& out = objSink();
- if (node->getSymbol() == "gl_FragDepthEXT")
+ const TString &symbol = node->getSymbol();
+ if (symbol == "gl_FragDepthEXT")
{
out << "gl_FragDepth";
}
+ else if (symbol == "gl_FragColor" && getShaderOutput() == SH_GLSL_CORE_OUTPUT)
+ {
+ out << "webgl_FragColor";
+ }
+ else if (symbol == "gl_FragData" && getShaderOutput() == SH_GLSL_CORE_OUTPUT)
+ {
+ out << "webgl_FragData";
+ }
else
{
TOutputGLSLBase::visitSymbol(node);
}
}
-TString TOutputGLSL::translateTextureFunction(TString& name)
+TString TOutputGLSL::translateTextureFunction(TString &name)
{
static const char *simpleRename[] = {
"texture2DLodEXT", "texture2DLod",
@@ -46,10 +62,30 @@ TString TOutputGLSL::translateTextureFunction(TString& name)
"textureCubeGradEXT", "textureCubeGradARB",
NULL, NULL
};
+ static const char *legacyToCoreRename[] = {
+ "texture2D", "texture",
+ "texture2DProj", "textureProj",
+ "texture2DLod", "textureLod",
+ "texture2DProjLod", "textureProjLod",
+ "textureCube", "texture",
+ "textureCubeLod", "textureLod",
+ // Extensions
+ "texture2DLodEXT", "textureLod",
+ "texture2DProjLodEXT", "textureProjLod",
+ "textureCubeLodEXT", "textureLod",
+ "texture2DGradEXT", "textureGrad",
+ "texture2DProjGradEXT", "textureProjGrad",
+ "textureCubeGradEXT", "textureGrad",
+ NULL, NULL
+ };
+ const char **mapping = (getShaderOutput() == SH_GLSL_CORE_OUTPUT) ?
+ legacyToCoreRename : simpleRename;
- for (int i = 0; simpleRename[i] != NULL; i += 2) {
- if (name == simpleRename[i]) {
- return simpleRename[i+1];
+ for (int i = 0; mapping[i] != NULL; i += 2)
+ {
+ if (name == mapping[i])
+ {
+ return mapping[i+1];
}
}
diff --git a/src/3rdparty/angle/src/compiler/translator/OutputGLSL.h b/src/3rdparty/angle/src/compiler/translator/OutputGLSL.h
index bceebe397d..21b2d079d3 100644
--- a/s