Qt build with opengl=angle fix support for Windows clients not having opengl 2.0 support?

Does Qt build with opengl=angle fix support for Windows clients not having opengl 2.0 support?

我们使用来自 Python 绑定的 QtWebEngine 构建了一个客户端。不幸的是,此客户端在某些 windows 不支持本机 OpenGL 2.0 的系统上崩溃(请参阅下面的调试)。 如果我设法用 opengl=angle 在 windows 上编译 qt,这是否可行?或者这是一条死路?

我已经花了一整天的时间尝试使用 msys2/mingw64 在 windows 上从源代码编译 qt,但是从一个陷阱掉入另一个陷阱但没有成功,我想确保这项努力有机会成功...

谢谢!

P.S.: 我也在Qt forum

发帖
qt.qpa.gl: Basic wglCreateContext gives version 1.1
qt.qpa.gl: OpenGL version too low
qt.qpa.gl: OpenGL 2.0 entry points not found
qt.qpa.gl: GPU features: QSet("disable_d3d11", "disable_d3d9", "disable_desktopgl")
qt.qpa.gl: Disabling Desktop GL:  GpuDescription(vendorId=0x0, deviceId=0x0, subSysId=0x0, revision=0, driver: "vm3dum64.dll", version=7.14.1.1233, "R
DPDD Chained DD")
qt.qpa.gl: Disabling D3D11:  GpuDescription(vendorId=0x0, deviceId=0x0, subSysId=0x0, revision=0, driver: "vm3dum64.dll", version=7.14.1.1233, "RDPDD
Chained DD")
qt.qpa.gl: Disabling D3D9:  GpuDescription(vendorId=0x0, deviceId=0x0, subSysId=0x0, revision=0, driver: "vm3dum64.dll", version=7.14.1.1233, "RDPDD C
hained DD")
qt.qpa.gl: QWindowsOpenGLTester::supportedRenderers GpuDescription(vendorId=0x0, deviceId=0x0, subSysId=0x0, revision=0, driver: "vm3dum64.dll", versi
on=7.14.1.1233, "RDPDD Chained DD") renderer:  QFlags(0x8|0x20)
qt.qpa.gl: Qt: Using EGL from libEGL
qt.qpa.gl: Qt: Using OpenGL ES 2.0 from libGLESv2
qt.qpa.gl: QWindowsEGLStaticContext::create Created EGL display 0x3d409b0 v 1 . 4
qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSiz
e 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBe
havior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))
qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSiz
e -1, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize -1, samples -1, swapBehavior QSurfaceFormat::Swap
Behavior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))
qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSiz
e 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBe
havior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))
qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSiz
e 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBe
havior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))
qt.qpa.gl: QWindowsIntegration::createPlatformOpenGLContext QSurfaceFormat(version 2.0, options QFlags<QSurfaceFormat::FormatOption>(), depthBufferSiz
e 24, redBufferSize -1, greenBufferSize -1, blueBufferSize -1, alphaBufferSize -1, stencilBufferSize 8, samples 0, swapBehavior QSurfaceFormat::SwapBe
havior(DefaultSwapBehavior), swapInterval 1, profile  QSurfaceFormat::OpenGLContextProfile(NoProfile))
QOpenGLShader::link: Failed to create D3D shaders.

Could not link shader program:
 "Failed to create D3D shaders.\n"
QOpenGLShader::link: Failed to create D3D shaders.
Failed to create D3D shaders.

不,我认为从支持 ANGLE 的源代码编译 Qt 对您的情况没有帮助。在调试输出中可以看到 Qt 已经回落到 ANGLE (libGLESv2):

Qt: Using OpenGL ES 2.0 from libGLESv2

link 证实了这一点,假设您是 运行 Qt 5.5 或更新版本的预构建二进制包:

When configured with -opengl dynamic, neither Qt nor the applications built using qmake will link to the opengl32 (standard desktop OpenGL) or libGLESv2 (ANGLE) libraries. Instead, the appropriate library is chosen at runtime. By default, Qt will determine whether the system's opengl32.dll provides OpenGL 2 functions. If these are present, opengl32.dll is used, otherwise the ANGLE libraries will be used.

崩溃的原因似乎是在模拟 OpenGL 代码中发生着色器链接失败 (ANGLE/Direct3D)。

QOpenGLShader::link: Failed to create D3D shaders.

为什么会发生这种情况是另一回事。首先,我会将 DirectX 更新到最新版本。

talamaki 的评论让我找到了正确的方向:

  • PyQt5 已经支持 QT 5.8.x mimik,首先检查原生 OpenGL 支持,然后回退到 windows 上的 ANGLE 仿真。
  • 不幸的是,errorstack 没有提示故障系统上缺少什么。经过长时间的研究,我找到了所有无法正常工作的 windows 系统的解决方案:(重新)安装 DirectX End-User Runtimes (June 2010)。看来,Windows 7 缺少一些 DLL,无法像 QT 期望的那样使用 ANGLE ...