diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-05-18 15:16:30 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-05-26 15:11:40 +0200 |
commit | 752497910b67b2a1a80560840ca44548d8893434 (patch) | |
tree | 541501c9abfd97c3d2fa450d2e6abb60582c4420 /src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32 | |
parent | 7db527dbdd911c79f31425d099d1fc9c63e42453 (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/renderer/d3d/d3d11/win32')
-rw-r--r-- | src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp | 217 | ||||
-rw-r--r-- | src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.h | 53 |
2 files changed, 0 insertions, 270 deletions
diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp deleted file mode 100644 index f5e6c93813..0000000000 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.cpp +++ /dev/null @@ -1,217 +0,0 @@ -// -// Copyright (c) 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. -// - -// NativeWindow11Win32.cpp: Implementation of NativeWindow11 using win32 window APIs. - -#include "libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.h" -#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h" - -#include "common/debug.h" - -#include <initguid.h> -#include <dcomp.h> - -namespace rx -{ - -NativeWindow11Win32::NativeWindow11Win32(EGLNativeWindowType window, - bool hasAlpha, - bool directComposition) - : NativeWindow11(window), - mDirectComposition(directComposition), - mHasAlpha(hasAlpha), - mDevice(nullptr), - mCompositionTarget(nullptr), - mVisual(nullptr) -{ -} - -NativeWindow11Win32::~NativeWindow11Win32() -{ - SafeRelease(mCompositionTarget); - SafeRelease(mDevice); - SafeRelease(mVisual); -} - -bool NativeWindow11Win32::initialize() -{ - return true; -} - -bool NativeWindow11Win32::getClientRect(LPRECT rect) const -{ - return GetClientRect(getNativeWindow(), rect) == TRUE; -} - -bool NativeWindow11Win32::isIconic() const -{ - return IsIconic(getNativeWindow()) == TRUE; -} - -HRESULT NativeWindow11Win32::createSwapChain(ID3D11Device *device, - IDXGIFactory *factory, - DXGI_FORMAT format, - UINT width, - UINT height, - UINT samples, - IDXGISwapChain **swapChain) -{ - if (device == nullptr || factory == nullptr || swapChain == nullptr || width == 0 || - height == 0) - { - return E_INVALIDARG; - } - - if (mDirectComposition) - { - HMODULE dcomp = ::GetModuleHandle(TEXT("dcomp.dll")); - if (!dcomp) - { - return E_INVALIDARG; - } - - typedef HRESULT(WINAPI * PFN_DCOMPOSITION_CREATE_DEVICE)( - IDXGIDevice * dxgiDevice, REFIID iid, void **dcompositionDevice); - PFN_DCOMPOSITION_CREATE_DEVICE createDComp = - reinterpret_cast<PFN_DCOMPOSITION_CREATE_DEVICE>( - GetProcAddress(dcomp, "DCompositionCreateDevice")); - if (!createDComp) - { - return E_INVALIDARG; - } - - if (!mDevice) - { - IDXGIDevice *dxgiDevice = d3d11::DynamicCastComObject<IDXGIDevice>(device); - HRESULT result = createDComp(dxgiDevice, __uuidof(IDCompositionDevice), - reinterpret_cast<void **>(&mDevice)); - SafeRelease(dxgiDevice); - - if (FAILED(result)) - { - return result; - } - } - - if (!mCompositionTarget) - { - HRESULT result = - mDevice->CreateTargetForHwnd(getNativeWindow(), TRUE, &mCompositionTarget); - if (FAILED(result)) - { - return result; - } - } - - if (!mVisual) - { - HRESULT result = mDevice->CreateVisual(&mVisual); - if (FAILED(result)) - { - return result; - } - } - - IDXGIFactory2 *factory2 = d3d11::DynamicCastComObject<IDXGIFactory2>(factory); - DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0}; - swapChainDesc.Width = width; - swapChainDesc.Height = height; - swapChainDesc.Format = format; - swapChainDesc.Stereo = FALSE; - swapChainDesc.SampleDesc.Count = 1; - swapChainDesc.SampleDesc.Quality = 0; - swapChainDesc.BufferUsage = - DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_BACK_BUFFER | DXGI_USAGE_SHADER_INPUT; - swapChainDesc.BufferCount = 2; - swapChainDesc.Scaling = DXGI_SCALING_STRETCH; - swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; - swapChainDesc.AlphaMode = - mHasAlpha ? DXGI_ALPHA_MODE_PREMULTIPLIED : DXGI_ALPHA_MODE_IGNORE; - swapChainDesc.Flags = 0; - IDXGISwapChain1 *swapChain1 = nullptr; - HRESULT result = - factory2->CreateSwapChainForComposition(device, &swapChainDesc, nullptr, &swapChain1); - if (SUCCEEDED(result)) - { - *swapChain = static_cast<IDXGISwapChain *>(swapChain1); - } - mVisual->SetContent(swapChain1); - mCompositionTarget->SetRoot(mVisual); - SafeRelease(factory2); - return result; - } - - // Use IDXGIFactory2::CreateSwapChainForHwnd if DXGI 1.2 is available to create a - // DXGI_SWAP_EFFECT_SEQUENTIAL swap chain. - IDXGIFactory2 *factory2 = d3d11::DynamicCastComObject<IDXGIFactory2>(factory); - if (factory2 != nullptr) - { - DXGI_SWAP_CHAIN_DESC1 swapChainDesc = {0}; - swapChainDesc.Width = width; - swapChainDesc.Height = height; - swapChainDesc.Format = format; - swapChainDesc.Stereo = FALSE; - swapChainDesc.SampleDesc.Count = samples; - swapChainDesc.SampleDesc.Quality = 0; - swapChainDesc.BufferUsage = - DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT | DXGI_USAGE_BACK_BUFFER; - swapChainDesc.BufferCount = 1; - swapChainDesc.Scaling = DXGI_SCALING_STRETCH; - swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_SEQUENTIAL; - swapChainDesc.AlphaMode = DXGI_ALPHA_MODE_UNSPECIFIED; - swapChainDesc.Flags = 0; - IDXGISwapChain1 *swapChain1 = nullptr; - HRESULT result = factory2->CreateSwapChainForHwnd(device, getNativeWindow(), &swapChainDesc, - nullptr, nullptr, &swapChain1); - if (SUCCEEDED(result)) - { - factory2->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES); - *swapChain = static_cast<IDXGISwapChain *>(swapChain1); - } - SafeRelease(factory2); - return result; - } - - DXGI_SWAP_CHAIN_DESC swapChainDesc = {}; - swapChainDesc.BufferCount = 1; - swapChainDesc.BufferDesc.Format = format; - swapChainDesc.BufferDesc.Width = width; - swapChainDesc.BufferDesc.Height = height; - swapChainDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; - swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; - swapChainDesc.BufferDesc.RefreshRate.Numerator = 0; - swapChainDesc.BufferDesc.RefreshRate.Denominator = 1; - swapChainDesc.BufferUsage = - DXGI_USAGE_RENDER_TARGET_OUTPUT | DXGI_USAGE_SHADER_INPUT | DXGI_USAGE_BACK_BUFFER; - swapChainDesc.Flags = 0; - swapChainDesc.OutputWindow = getNativeWindow(); - swapChainDesc.SampleDesc.Count = samples; - swapChainDesc.SampleDesc.Quality = 0; - swapChainDesc.Windowed = TRUE; - swapChainDesc.SwapEffect = DXGI_SWAP_EFFECT_DISCARD; - - HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, swapChain); - if (SUCCEEDED(result)) - { - factory->MakeWindowAssociation(getNativeWindow(), DXGI_MWA_NO_WINDOW_CHANGES); - } - return result; -} - -void NativeWindow11Win32::commitChange() -{ - if (mDevice) - { - mDevice->Commit(); - } -} - -// static -bool NativeWindow11Win32::IsValidNativeWindow(EGLNativeWindowType window) -{ - return IsWindow(window) == TRUE; -} -} // namespace rx diff --git a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.h b/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.h deleted file mode 100644 index baeba6a347..0000000000 --- a/src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/win32/NativeWindow11Win32.h +++ /dev/null @@ -1,53 +0,0 @@ -// -// Copyright (c) 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. -// - -// NativeWindow11Win32.h: Implementation of NativeWindow11 using win32 window APIs. - -#ifndef LIBANGLE_RENDERER_D3D_D3D11_WIN32_NATIVEWINDOW11WIN32_H_ -#define LIBANGLE_RENDERER_D3D_D3D11_WIN32_NATIVEWINDOW11WIN32_H_ - -#include "libANGLE/renderer/d3d/d3d11/NativeWindow11.h" - -typedef interface IDCompositionDevice IDCompositionDevice; -typedef interface IDCompositionTarget IDCompositionTarget; -typedef interface IDCompositionVisual IDCompositionVisual; - -namespace rx -{ - -class NativeWindow11Win32 : public NativeWindow11 -{ - public: - NativeWindow11Win32(EGLNativeWindowType window, bool hasAlpha, bool directComposition); - ~NativeWindow11Win32() override; - - bool initialize() override; - bool getClientRect(LPRECT rect) const override; - bool isIconic() const override; - - HRESULT createSwapChain(ID3D11Device *device, - IDXGIFactory *factory, - DXGI_FORMAT format, - UINT width, - UINT height, - UINT samples, - IDXGISwapChain **swapChain) override; - - void commitChange() override; - - static bool IsValidNativeWindow(EGLNativeWindowType window); - - private: - bool mDirectComposition; - bool mHasAlpha; - IDCompositionDevice *mDevice; - IDCompositionTarget *mCompositionTarget; - IDCompositionVisual *mVisual; -}; - -} // namespace rx - -#endif // LIBANGLE_RENDERER_D3D_D3D11_WIN32_NATIVEWINDOW11WIN32_H_ |