summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/compiler/translator/PruneNoOps.cpp
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/PruneNoOps.cpp
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/PruneNoOps.cpp')
-rw-r--r--src/3rdparty/angle/src/compiler/translator/PruneNoOps.cpp156
1 files changed, 0 insertions, 156 deletions
diff --git a/src/3rdparty/angle/src/compiler/translator/PruneNoOps.cpp b/src/3rdparty/angle/src/compiler/translator/PruneNoOps.cpp
deleted file mode 100644
index 6c9a02cd1c..0000000000
--- a/src/3rdparty/angle/src/compiler/translator/PruneNoOps.cpp
+++ /dev/null
@@ -1,156 +0,0 @@
-//
-// 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.
-//
-// PruneNoOps.cpp: The PruneNoOps function prunes:
-// 1. Empty declarations "int;". Empty declarators will be pruned as well, so for example:
-// int , a;
-// is turned into
-// int a;
-// 2. Literal statements: "1.0;". The ESSL output doesn't define a default precision for float,
-// so float literal statements would end up with no precision which is invalid ESSL.
-
-#include "compiler/translator/PruneNoOps.h"
-
-#include "compiler/translator/IntermTraverse.h"
-
-namespace sh
-{
-
-namespace
-{
-
-bool IsNoOp(TIntermNode *node)
-{
- if (node->getAsConstantUnion() != nullptr)
- {
- return true;
- }
- bool isEmptyDeclaration = node->getAsDeclarationNode() != nullptr &&
- node->getAsDeclarationNode()->getSequence()->empty();
- if (isEmptyDeclaration)
- {
- return true;
- }
- return false;
-}
-
-class PruneNoOpsTraverser : private TIntermTraverser
-{
- public:
- static void apply(TIntermBlock *root);
-
- private:
- PruneNoOpsTraverser();
- bool visitDeclaration(Visit, TIntermDeclaration *node) override;
- bool visitBlock(Visit visit, TIntermBlock *node) override;
- bool visitLoop(Visit visit, TIntermLoop *loop) override;
-};
-
-void PruneNoOpsTraverser::apply(TIntermBlock *root)
-{
- PruneNoOpsTraverser prune;
- root->traverse(&prune);
- prune.updateTree();
-}
-
-PruneNoOpsTraverser::PruneNoOpsTraverser() : TIntermTraverser(true, false, false)
-{
-}
-
-bool PruneNoOpsTraverser::visitDeclaration(Visit, TIntermDeclaration *node)
-{
- TIntermSequence *sequence = node->getSequence();
- if (sequence->size() >= 1)
- {
- TIntermSymbol *sym = sequence->front()->getAsSymbolNode();
- // Prune declarations without a variable name, unless it's an interface block declaration.
- if (sym != nullptr && sym->getSymbol() == "" && !sym->isInterfaceBlock())
- {
- if (sequence->size() > 1)
- {
- // Generate a replacement that will remove the empty declarator in the beginning of
- // a declarator list. Example of a declaration that will be changed:
- // float, a;
- // will be changed to
- // float a;
- // This applies also to struct declarations.
- TIntermSequence emptyReplacement;
- mMultiReplacements.push_back(
- NodeReplaceWithMultipleEntry(node, sym, emptyReplacement));
- }
- else if (sym->getBasicType() != EbtStruct)
- {
- // If there are entirely empty non-struct declarations, they result in
- // TIntermDeclaration nodes without any children in the parsing stage. These are
- // handled in visitBlock and visitLoop.
- UNREACHABLE();
- }
- else if (sym->getType().getQualifier() != EvqGlobal &&
- sym->getType().getQualifier() != EvqTemporary)
- {
- // Single struct declarations may just declare the struct type and no variables, so
- // they should not be pruned. Here we handle an empty struct declaration with a
- // qualifier, for example like this:
- // const struct a { int i; };
- // NVIDIA GL driver version 367.27 doesn't accept this kind of declarations, so we
- // convert the declaration to a regular struct declaration. This is okay, since ESSL
- // 1.00 spec section 4.1.8 says about structs that "The optional qualifiers only
- // apply to any declarators, and are not part of the type being defined for name."
-
- if (mInGlobalScope)
- {
- sym->getTypePointer()->setQualifier(EvqGlobal);
- }
- else
- {
- sym->getTypePointer()->setQualifier(EvqTemporary);
- }
- }
- }
- }
- return false;
-}
-
-bool PruneNoOpsTraverser::visitBlock(Visit visit, TIntermBlock *node)
-{
- TIntermSequence *statements = node->getSequence();
-
- for (TIntermNode *statement : *statements)
- {
- if (IsNoOp(statement))
- {
- TIntermSequence emptyReplacement;
- mMultiReplacements.push_back(
- NodeReplaceWithMultipleEntry(node, statement, emptyReplacement));
- }
- }
-
- return true;
-}
-
-bool PruneNoOpsTraverser::visitLoop(Visit visit, TIntermLoop *loop)
-{
- TIntermTyped *expr = loop->getExpression();
- if (expr != nullptr && IsNoOp(expr))
- {
- loop->setExpression(nullptr);
- }
- TIntermNode *init = loop->getInit();
- if (init != nullptr && IsNoOp(init))
- {
- loop->setInit(nullptr);
- }
-
- return true;
-}
-
-} // namespace
-
-void PruneNoOps(TIntermBlock *root)
-{
- PruneNoOpsTraverser::apply(root);
-}
-
-} // namespace sh