summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/translator/Compiler.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-05-18 15:16:30 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-05-26 15:11:40 +0200
commit752497910b67b2a1a80560840ca44548d8893434 (patch)
tree541501c9abfd97c3d2fa450d2e6abb60582c4420 /src/3rdparty/angle/src/compiler/translator/Compiler.h
parent7db527dbdd911c79f31425d099d1fc9c63e42453 (diff)
Remove ANGLE
This marks the end of EGL and OpenGL ES support on Windows. The concepts of -opengl dynamic, -opengl desktop, QT_OPENGL=software, etc. remain unchanged, with the exception of the disapperance of everything ANGLE related. CMake builds now work identically to qmake on Windows: they default to 'dynamic' OpenGL on Windows, unless -DINPUT_opengl=desktop is specified. On Windows, Qt 6 is expected to default to the "dynamic" OpenGL model by default, just like Qt 5.15. This can be changed by switching to "desktop" OpenGL, which will link to opengl32 (publicly, so other libs and applications will do so as well) and disallows using another OpenGL DLL. The "dynamic" mode is essential still because the fallback to a software rasterizer, such as the opengl32sw.dll we ship with the Qt packages, has to to work exactly like in Qt 5, the removal of ANGLE does not change this concept in any way (except of course that the middle option of using ANGLE is now gone) When it comes to the windows plugin's OpenGL blacklist feature, it works like before and accepts the ANGLE/D3D related keywords. They will then be ignored. Similarly, requesting QT_OPENGL=angle is ignored (but will show a warning). The D3D11 and DXGI configure time tests are removed: Qt 5.14 already depends on D3D 11.1 and DXGI 1.3 headers being available unconditionally on Win32 (in QRhi's D3D11 backend). No need to test for these. [ChangeLog][Windows] ANGLE is no longer included with Qt. Dynamic OpenGL builds work like before but ANGLE is no longer an option. OpenGL proper or an alternative opengl32 implementation are the two remaining options now. Attempting to set QT_OPENGL=angle or Qt::AA_UseOpenGLES will have no effect on Windows. Fixes: QTBUG-79103 Change-Id: Ia404e0d07f3fe191b27434d863c81180112ecb3b Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'src/3rdparty/angle/src/compiler/translator/Compiler.h')
-rw-r--r--src/3rdparty/angle/src/compiler/translator/Compiler.h308
1 files changed, 0 insertions, 308 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/Compiler.h b/src/3rdparty/angle/src/compiler/translator/Compiler.h
deleted file mode 100644
index 753cfb8e7b..0000000000
--- a/src/3rdparty/angle/src/compiler/translator/Compiler.h
+++ /dev/null
@@ -1,308 +0,0 @@
-//
-// Copyright (c) 2002-2013 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_COMPILER_H_
-#define COMPILER_TRANSLATOR_COMPILER_H_
-
-//
-// Machine independent part of the compiler private objects
-// sent as ShHandle to the driver.
-//
-// This should not be included by driver code.
-//
-
-#include <GLSLANG/ShaderVars.h>
-
-#include "compiler/translator/BuiltInFunctionEmulator.h"
-#include "compiler/translator/CallDAG.h"
-#include "compiler/translator/Diagnostics.h"
-#include "compiler/translator/ExtensionBehavior.h"
-#include "compiler/translator/HashNames.h"
-#include "compiler/translator/InfoSink.h"
-#include "compiler/translator/Pragma.h"
-#include "compiler/translator/SymbolTable.h"
-#include "third_party/compiler/ArrayBoundsClamper.h"
-
-namespace sh
-{
-
-class TCompiler;
-class TParseContext;
-#ifdef ANGLE_ENABLE_HLSL
-class TranslatorHLSL;
-#endif // ANGLE_ENABLE_HLSL
-
-//
-// Helper function to identify specs that are based on the WebGL spec.
-//
-bool IsWebGLBasedSpec(ShShaderSpec spec);
-
-//
-// Helper function to check if the shader type is GLSL.
-//
-bool IsGLSL130OrNewer(ShShaderOutput output);
-bool IsGLSL420OrNewer(ShShaderOutput output);
-bool IsGLSL410OrOlder(ShShaderOutput output);
-
-//
-// Helper function to check if the invariant qualifier can be removed.
-//
-bool RemoveInvariant(sh::GLenum shaderType,
- int shaderVersion,
- ShShaderOutput outputType,
- ShCompileOptions compileOptions);
-
-//
-// The base class used to back handles returned to the driver.
-//
-class TShHandleBase
-{
- 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.
- // Deallocates all memory when compiler is destructed.
- TPoolAllocator allocator;
-};
-
-//
-// The base class for the machine dependent compiler to derive from
-// for managing object code from the compile.
-//
-class TCompiler : public TShHandleBase
-{
- public:
- TCompiler(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
- ~TCompiler() override;
- TCompiler *getAsCompiler() override { 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 nullptr whenever there are compilation errors.
- TIntermBlock *compileTreeForTesting(const char *const shaderStrings[],
- size_t numStrings,
- ShCompileOptions compileOptions);
-
- bool compile(const char *const shaderStrings[],
- size_t numStrings,
- ShCompileOptions compileOptions);
-
- // Get results of the last compilation.
- int getShaderVersion() const { return shaderVersion; }
- TInfoSink &getInfoSink() { return infoSink; }
-
- bool isComputeShaderLocalSizeDeclared() const { return mComputeShaderLocalSizeDeclared; }
- const sh::WorkGroupSize &getComputeShaderLocalSize() const { return mComputeShaderLocalSize; }
- int getNumViews() const { return mNumViews; }
-
- // Clears the results from the previous compilation.
- void clearResults();
-
- const std::vector<sh::Attribute> &getAttributes() const { return attributes; }
- const std::vector<sh::OutputVariable> &getOutputVariables() const { return outputVariables; }
- const std::vector<sh::Uniform> &getUniforms() const { return uniforms; }
- const std::vector<sh::Varying> &getInputVaryings() const { return inputVaryings; }
- const std::vector<sh::Varying> &getOutputVaryings() const { return outputVaryings; }
- const std::vector<sh::InterfaceBlock> &getInterfaceBlocks() const { return interfaceBlocks; }
- const std::vector<sh::InterfaceBlock> &getUniformBlocks() const { return uniformBlocks; }
- const std::vector<sh::InterfaceBlock> &getShaderStorageBlocks() const
- {
- return shaderStorageBlocks;
- }
- const std::vector<sh::InterfaceBlock> &getInBlocks() const { return inBlocks; }
-
- ShHashFunction64 getHashFunction() const { return hashFunction; }
- NameMap &getNameMap() { return nameMap; }
- TSymbolTable &getSymbolTable() { return symbolTable; }
- ShShaderSpec getShaderSpec() const { return shaderSpec; }
- ShShaderOutput getOutputType() const { return outputType; }
- const std::string &getBuiltInResourcesString() const { return builtInResourcesString; }
-
- bool shouldRunLoopAndIndexingValidation(ShCompileOptions compileOptions) const;
-
- // Get the resources set by InitBuiltInSymbolTable
- const ShBuiltInResources &getResources() const;
-
- int getGeometryShaderMaxVertices() const { return mGeometryShaderMaxVertices; }
- int getGeometryShaderInvocations() const { return mGeometryShaderInvocations; }
- TLayoutPrimitiveType getGeometryShaderInputPrimitiveType() const
- {
- return mGeometryShaderInputPrimitiveType;
- }
- TLayoutPrimitiveType getGeometryShaderOutputPrimitiveType() const
- {
- return mGeometryShaderOutputPrimitiveType;
- }
-
- sh::GLenum getShaderType() const { return shaderType; }
-
- protected:
- // Initialize symbol-table with built-in symbols.
- bool InitBuiltInSymbolTable(const ShBuiltInResources &resources);
- // Compute the string representation of the built-in resources
- void setResourceString();
- // Return false if the call depth is exceeded.
- bool checkCallDepth();
- // Add emulated functions to the built-in function emulator.
- virtual void initBuiltInFunctionEmulator(BuiltInFunctionEmulator *emu,
- ShCompileOptions compileOptions){};
- // Translate to object code. May generate performance warnings through the diagnostics.
- virtual void translate(TIntermBlock *root,
- ShCompileOptions compileOptions,
- PerformanceDiagnostics *perfDiagnostics) = 0;
- // Insert statements to reference all members in unused uniform blocks with standard and shared
- // layout. This is to work around a Mac driver that treats unused standard/shared
- // uniform blocks as inactive.
- void useAllMembersInUnusedStandardAndSharedBlocks(TIntermBlock *root);
- // Insert statements to initialize output variables in the beginning of main().
- // This is to avoid undefined behaviors.
- void initializeOutputVariables(TIntermBlock *root);
- // Insert gl_Position = vec4(0,0,0,0) to the beginning of main().
- // It is to work around a Linux driver bug where missing this causes compile failure
- // while spec says it is allowed.
- // This function should only be applied to vertex shaders.
- void initializeGLPosition(TIntermBlock *root);
- // Return true if the maximum expression complexity is below the limit.
- bool limitExpressionComplexity(TIntermBlock *root);
- // Get built-in extensions with default behavior.
- const TExtensionBehavior &getExtensionBehavior() const;
- const char *getSourcePath() const;
- const TPragma &getPragma() const { return mPragma; }
- void writePragma(ShCompileOptions compileOptions);
- // Relies on collectVariables having been called.
- bool isVaryingDefined(const char *varyingName);
-
- const ArrayBoundsClamper &getArrayBoundsClamper() const;
- ShArrayIndexClampingStrategy getArrayIndexClampingStrategy() const;
- const BuiltInFunctionEmulator &getBuiltInFunctionEmulator() const;
-
- virtual bool shouldFlattenPragmaStdglInvariantAll() = 0;
- virtual bool shouldCollectVariables(ShCompileOptions compileOptions);
-
- bool wereVariablesCollected() const;
- std::vector<sh::Attribute> attributes;
- std::vector<sh::OutputVariable> outputVariables;
- std::vector<sh::Uniform> uniforms;
- std::vector<sh::Varying> inputVaryings;
- std::vector<sh::Varying> outputVaryings;
- std::vector<sh::InterfaceBlock> interfaceBlocks;
- std::vector<sh::InterfaceBlock> uniformBlocks;
- std::vector<sh::InterfaceBlock> shaderStorageBlocks;
- std::vector<sh::InterfaceBlock> inBlocks;
-
- private:
- // Creates the function call DAG for further analysis, returning false if there is a recursion
- bool initCallDag(TIntermNode *root);
- // Return false if "main" doesn't exist
- bool tagUsedFunctions();
- void internalTagUsedFunction(size_t index);
-
- void initSamplerDefaultPrecision(TBasicType samplerType);
-
- void collectInterfaceBlocks();
-
- bool variablesCollected;
-
- bool mGLPositionInitialized;
-
- // Removes unused function declarations and prototypes from the AST
- class UnusedPredicate;
- void pruneUnusedFunctions(TIntermBlock *root);
-
- TIntermBlock *compileTreeImpl(const char *const shaderStrings[],
- size_t numStrings,
- const ShCompileOptions compileOptions);
-
- // Fetches and stores shader metadata that is not stored within the AST itself, such as shader
- // version.
- void setASTMetadata(const TParseContext &parseContext);
-
- // Does checks that need to be run after parsing is complete and returns true if they pass.
- bool checkAndSimplifyAST(TIntermBlock *root,
- const TParseContext &parseContext,
- ShCompileOptions compileOptions);
-
- sh::GLenum shaderType;
- ShShaderSpec shaderSpec;
- ShShaderOutput outputType;
-
- struct FunctionMetadata
- {
- FunctionMetadata() : used(false) {}
- bool used;
- };
-
- CallDAG mCallDag;
- std::vector<FunctionMetadata> functionMetadata;
-
- int maxUniformVectors;
- int maxExpressionComplexity;
- int maxCallStackDepth;
- int maxFunctionParameters;
-
- ShBuiltInResources compileResources;
- std::string builtInResourcesString;
-
- // Built-in symbol table for the given language, spec, and resources.
- // It is preserved from compile-to-compile.
- TSymbolTable symbolTable;
- // Built-in extensions with default behavior.
- TExtensionBehavior extensionBehavior;
- bool fragmentPrecisionHigh;
-
- ArrayBoundsClamper arrayBoundsClamper;
- ShArrayIndexClampingStrategy clampingStrategy;
- BuiltInFunctionEmulator builtInFunctionEmulator;
-
- // Results of compilation.
- int shaderVersion;
- TInfoSink infoSink; // Output sink.
- TDiagnostics mDiagnostics;
- const char *mSourcePath; // Path of source file or NULL
-
- // compute shader local group size
- bool mComputeShaderLocalSizeDeclared;
- sh::WorkGroupSize mComputeShaderLocalSize;
-
- // GL_OVR_multiview num_views.
- int mNumViews;
-
- // geometry shader parameters.
- int mGeometryShaderMaxVertices;
- int mGeometryShaderInvocations;
- TLayoutPrimitiveType mGeometryShaderInputPrimitiveType;
- TLayoutPrimitiveType mGeometryShaderOutputPrimitiveType;
-
- // name hashing.
- ShHashFunction64 hashFunction;
- NameMap nameMap;
-
- TPragma mPragma;
-};
-
-//
-// This is the interface between the machine independent code
-// and the machine dependent code.
-//
-// The machine dependent code should derive from the classes
-// above. Then Construct*() and Delete*() will create and
-// destroy the machine dependent objects, which contain the
-// above machine independent information.
-//
-TCompiler *ConstructCompiler(sh::GLenum type, ShShaderSpec spec, ShShaderOutput output);
-void DeleteCompiler(TCompiler *);
-
-} // namespace sh
-
-#endif // COMPILER_TRANSLATOR_COMPILER_H_