summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/angle/src/libANGLE/WorkerThread.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/libANGLE/WorkerThread.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/libANGLE/WorkerThread.h')
-rw-r--r--src/3rdparty/angle/src/libANGLE/WorkerThread.h284
1 files changed, 0 insertions, 284 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/WorkerThread.h b/src/3rdparty/angle/src/libANGLE/WorkerThread.h
deleted file mode 100644
index f6b81dce21..0000000000
--- a/src/3rdparty/angle/src/libANGLE/WorkerThread.h
+++ /dev/null
@@ -1,284 +0,0 @@
-//
-// Copyright 2016 The ANGLE Project Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-//
-// WorkerThread:
-// Asychronous tasks/threads for ANGLE, similar to a TaskRunner in Chromium.
-// Can be implemented as different targets, depending on platform.
-//
-
-#ifndef LIBANGLE_WORKER_THREAD_H_
-#define LIBANGLE_WORKER_THREAD_H_
-
-#include <array>
-#include <vector>
-
-#include "common/debug.h"
-#include "libANGLE/features.h"
-
-#if (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-#include <future>
-#endif // (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-
-namespace angle
-{
-// Indicates whether a WaitableEvent should automatically reset the event state after a single
-// waiting thread has been released or remain signaled until reset() is manually invoked.
-enum class EventResetPolicy
-{
- Manual,
- Automatic
-};
-
-// Specify the initial state on creation.
-enum class EventInitialState
-{
- NonSignaled,
- Signaled
-};
-
-// A callback function with no return value and no arguments.
-class Closure
-{
- public:
- virtual ~Closure() = default;
- virtual void operator()() = 0;
-};
-
-namespace priv
-{
-// An event that we can wait on, useful for joining worker threads.
-template <typename Impl>
-class WaitableEventBase : angle::NonCopyable
-{
- public:
- WaitableEventBase(EventResetPolicy resetPolicy, EventInitialState initialState);
-
- WaitableEventBase(WaitableEventBase &&other);
-
- // Puts the event in the un-signaled state.
- void reset();
-
- // Waits indefinitely for the event to be signaled.
- void wait();
-
- // Puts the event in the signaled state, causing any thread blocked on Wait to be woken up.
- // The event state is reset to non-signaled after a waiting thread has been released.
- void signal();
-
- protected:
- Impl &copyBase(Impl &&other);
-
- template <size_t Count>
- static size_t WaitManyBase(std::array<Impl, Count> *waitables);
-
- EventResetPolicy mResetPolicy;
- bool mSignaled;
-};
-
-template <typename Impl>
-WaitableEventBase<Impl>::WaitableEventBase(EventResetPolicy resetPolicy,
- EventInitialState initialState)
- : mResetPolicy(resetPolicy), mSignaled(initialState == EventInitialState::Signaled)
-{
-}
-
-template <typename Impl>
-WaitableEventBase<Impl>::WaitableEventBase(WaitableEventBase &&other)
- : mResetPolicy(other.mResetPolicy), mSignaled(other.mSignaled)
-{
-}
-
-template <typename Impl>
-void WaitableEventBase<Impl>::reset()
-{
- static_cast<Impl *>(this)->resetImpl();
-}
-
-template <typename Impl>
-void WaitableEventBase<Impl>::wait()
-{
- static_cast<Impl *>(this)->waitImpl();
-}
-
-template <typename Impl>
-void WaitableEventBase<Impl>::signal()
-{
- static_cast<Impl *>(this)->signalImpl();
-}
-
-template <typename Impl>
-template <size_t Count>
-// static
-size_t WaitableEventBase<Impl>::WaitManyBase(std::array<Impl, Count> *waitables)
-{
- ASSERT(Count > 0);
-
- for (size_t index = 0; index < Count; ++index)
- {
- (*waitables)[index].wait();
- }
-
- return 0;
-}
-
-template <typename Impl>
-Impl &WaitableEventBase<Impl>::copyBase(Impl &&other)
-{
- std::swap(mSignaled, other.mSignaled);
- std::swap(mResetPolicy, other.mResetPolicy);
- return *static_cast<Impl *>(this);
-}
-
-class SingleThreadedWaitableEvent : public WaitableEventBase<SingleThreadedWaitableEvent>
-{
- public:
- SingleThreadedWaitableEvent();
- SingleThreadedWaitableEvent(EventResetPolicy resetPolicy, EventInitialState initialState);
- ~SingleThreadedWaitableEvent();
-
- SingleThreadedWaitableEvent(SingleThreadedWaitableEvent &&other);
- SingleThreadedWaitableEvent &operator=(SingleThreadedWaitableEvent &&other);
-
- void resetImpl();
- void waitImpl();
- void signalImpl();
-
- // Wait, synchronously, on multiple events.
- // returns the index of a WaitableEvent which has been signaled.
- template <size_t Count>
- static size_t WaitMany(std::array<SingleThreadedWaitableEvent, Count> *waitables);
-};
-
-template <size_t Count>
-// static
-size_t SingleThreadedWaitableEvent::WaitMany(
- std::array<SingleThreadedWaitableEvent, Count> *waitables)
-{
- return WaitableEventBase<SingleThreadedWaitableEvent>::WaitManyBase(waitables);
-}
-
-#if (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-class AsyncWaitableEvent : public WaitableEventBase<AsyncWaitableEvent>
-{
- public:
- AsyncWaitableEvent();
- AsyncWaitableEvent(EventResetPolicy resetPolicy, EventInitialState initialState);
- ~AsyncWaitableEvent();
-
- AsyncWaitableEvent(AsyncWaitableEvent &&other);
- AsyncWaitableEvent &operator=(AsyncWaitableEvent &&other);
-
- void resetImpl();
- void waitImpl();
- void signalImpl();
-
- // Wait, synchronously, on multiple events.
- // returns the index of a WaitableEvent which has been signaled.
- template <size_t Count>
- static size_t WaitMany(std::array<AsyncWaitableEvent, Count> *waitables);
-
- private:
- friend class AsyncWorkerPool;
- void setFuture(std::future<void> &&future);
-
- std::future<void> mFuture;
-};
-
-template <size_t Count>
-// static
-size_t AsyncWaitableEvent::WaitMany(std::array<AsyncWaitableEvent, Count> *waitables)
-{
- return WaitableEventBase<AsyncWaitableEvent>::WaitManyBase(waitables);
-}
-#endif // (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-
-// The traits class allows the the thread pool to return the "Typed" waitable event from postTask.
-// Otherwise postTask would always think it returns the current active type, so the unit tests
-// could not run on multiple worker types in the same compilation.
-template <typename Impl>
-struct WorkerThreadPoolTraits;
-
-class SingleThreadedWorkerPool;
-template <>
-struct WorkerThreadPoolTraits<SingleThreadedWorkerPool>
-{
- using WaitableEventType = SingleThreadedWaitableEvent;
-};
-
-#if (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-class AsyncWorkerPool;
-template <>
-struct WorkerThreadPoolTraits<AsyncWorkerPool>
-{
- using WaitableEventType = AsyncWaitableEvent;
-};
-#endif // (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-
-// Request WorkerThreads from the WorkerThreadPool. Each pool can keep worker threads around so
-// we avoid the costly spin up and spin down time.
-template <typename Impl>
-class WorkerThreadPoolBase : angle::NonCopyable
-{
- public:
- WorkerThreadPoolBase(size_t maxThreads);
- ~WorkerThreadPoolBase();
-
- using WaitableEventType = typename WorkerThreadPoolTraits<Impl>::WaitableEventType;
-
- // Returns an event to wait on for the task to finish.
- // If the pool fails to create the task, returns null.
- WaitableEventType postWorkerTask(Closure *task);
-};
-
-template <typename Impl>
-WorkerThreadPoolBase<Impl>::WorkerThreadPoolBase(size_t maxThreads)
-{
-}
-
-template <typename Impl>
-WorkerThreadPoolBase<Impl>::~WorkerThreadPoolBase()
-{
-}
-
-template <typename Impl>
-typename WorkerThreadPoolBase<Impl>::WaitableEventType WorkerThreadPoolBase<Impl>::postWorkerTask(
- Closure *task)
-{
- return static_cast<Impl *>(this)->postWorkerTaskImpl(task);
-}
-
-class SingleThreadedWorkerPool : public WorkerThreadPoolBase<SingleThreadedWorkerPool>
-{
- public:
- SingleThreadedWorkerPool(size_t maxThreads);
- ~SingleThreadedWorkerPool();
-
- SingleThreadedWaitableEvent postWorkerTaskImpl(Closure *task);
-};
-
-#if (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-class AsyncWorkerPool : public WorkerThreadPoolBase<AsyncWorkerPool>
-{
- public:
- AsyncWorkerPool(size_t maxThreads);
- ~AsyncWorkerPool();
-
- AsyncWaitableEvent postWorkerTaskImpl(Closure *task);
-};
-#endif // (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-
-} // namespace priv
-
-#if (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-using WaitableEvent = priv::AsyncWaitableEvent;
-using WorkerThreadPool = priv::AsyncWorkerPool;
-#else
-using WaitableEvent = priv::SingleThreadedWaitableEvent;
-using WorkerThreadPool = priv::SingleThreadedWorkerPool;
-#endif // (ANGLE_STD_ASYNC_WORKERS == ANGLE_ENABLED)
-
-} // namespace angle
-
-#endif // LIBANGLE_WORKER_THREAD_H_