From d1fcc4f17dd85eab915ce9959a5505b74f5bcbdf Mon Sep 17 00:00:00 2001 From: "xiaozhuai, Weihang Ding" <798047000@qq.com> Date: Thu, 29 Dec 2022 05:43:43 +0800 Subject: [PATCH] [qt5-base] Fix Failed to create OpenGL context for format QSurfaceFormat (#28430) * [qt5-base] Fix Failed to create OpenGL context for format QSurfaceFormat #28428 * update version database * Fix build * update version database * Remove useless defines * update version database --- ports/qt5-base/patches/fix_angle.patch | 35 ++++++++++++++++++++++++++ ports/qt5-base/portfile.cmake | 1 + ports/qt5-base/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/q-/qt5-base.json | 5 ++++ 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 ports/qt5-base/patches/fix_angle.patch diff --git a/ports/qt5-base/patches/fix_angle.patch b/ports/qt5-base/patches/fix_angle.patch new file mode 100644 index 0000000000..32875858a4 --- /dev/null +++ b/ports/qt5-base/patches/fix_angle.patch @@ -0,0 +1,35 @@ +diff --git a/src/plugins/platforms/windows/qwindowseglcontext.cpp b/src/plugins/platforms/windows/qwindowseglcontext.cpp +index 4ae087dfa..3a07d511e 100644 +--- a/src/plugins/platforms/windows/qwindowseglcontext.cpp ++++ b/src/plugins/platforms/windows/qwindowseglcontext.cpp +@@ -46,6 +46,21 @@ + + #if defined(QT_OPENGL_ES_2_ANGLE) || defined(QT_OPENGL_DYNAMIC) + # include ++ ++#ifndef EGL_ANGLE_platform_angle ++#define EGL_ANGLE_platform_angle 1 ++#define EGL_PLATFORM_ANGLE_ANGLE 0x3202 ++#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203 ++#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209 ++#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 0x3207 ++#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208 ++#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE 0x320B ++#endif /* EGL_ANGLE_platform_angle_d3d */ ++ + #endif + + QT_BEGIN_NAMESPACE +@@ -210,7 +225,7 @@ bool QWindowsEGLStaticContext::initializeAngle(QWindowsOpenGLTester::Renderers p + { EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, EGL_NONE }, + { EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE, EGL_NONE }, + { EGL_PLATFORM_ANGLE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE, +- EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_WARP_ANGLE, EGL_NONE } ++ EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE, EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE, EGL_NONE } + }; + const EGLint *attributes = nullptr; + if (preferredType & QWindowsOpenGLTester::AngleRendererD3d11) diff --git a/ports/qt5-base/portfile.cmake b/ports/qt5-base/portfile.cmake index 4ce376a6f2..07bac0c7e0 100644 --- a/ports/qt5-base/portfile.cmake +++ b/ports/qt5-base/portfile.cmake @@ -67,6 +67,7 @@ qt_download_submodule( OUT_SOURCE_PATH SOURCE_PATH patches/Qt5PluginTarget.patch patches/create_cmake.patch patches/Qt5GuiConfigExtras.patch # Patches the library search behavior for EGL since angle is not build with Qt + patches/fix_angle.patch # Failed to create OpenGL context for format QSurfaceFormat ... ) # Remove vendored dependencies to ensure they are not picked up by the build diff --git a/ports/qt5-base/vcpkg.json b/ports/qt5-base/vcpkg.json index 9b6905382c..1d53dc4e78 100644 --- a/ports/qt5-base/vcpkg.json +++ b/ports/qt5-base/vcpkg.json @@ -1,7 +1,7 @@ { "name": "qt5-base", "version": "5.15.7", - "port-version": 3, + "port-version": 4, "description": "Qt5 Application Framework Base Module. Includes Core, GUI, Widgets, Networking, SQL, Concurrent and other essential qt components.", "homepage": "https://www.qt.io/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 017c278e61..cc70adcd81 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6130,7 +6130,7 @@ }, "qt5-base": { "baseline": "5.15.7", - "port-version": 3 + "port-version": 4 }, "qt5-canvas3d": { "baseline": "0", diff --git a/versions/q-/qt5-base.json b/versions/q-/qt5-base.json index 6a67139f9d..51fdd5423b 100644 --- a/versions/q-/qt5-base.json +++ b/versions/q-/qt5-base.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "c8d7ff2134c21300e90082d9eb7dbf5c70689856", + "version": "5.15.7", + "port-version": 4 + }, { "git-tree": "81ce731dc0595354a8eb77ea9557f4b7a6ca44d3", "version": "5.15.7",