Skip to content

Commit 317dd08

Browse files
author
Kaloyan Chehlarski
committed
Shut GL down on process exit to silence Direct3D11 warnings
When using Direct3D11 as RHI backed, exiting the process will trigger a huge amount of warnings about live Direct3D objects. These happen because Chromium never actually shuts down its GL implementation, which in turn doesn't destroy the underlying Direct3D11 device that ANGLE runs on top of. This behavior can also be observed in upstream Chromium when running with --in-process-gpu. This change adds a call to ShutdownGL() inside GpuInit's destructor, which makes sure the implementation is properly destroyed, along with all its leftover live objects. Task-number: QTBUG-123790 Pick-to: 118-based Change-Id: I0641cfae57aa31fea1984d79b2aa9fa636330f1d Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/556301 Reviewed-by: Peter Varga <[email protected]>
1 parent b5373a4 commit 317dd08

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

chromium/gpu/ipc/service/gpu_init.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,14 @@ void SetupGLDisplayManagerEGL(const GPUInfo& gpu_info,
293293
GpuInit::GpuInit() = default;
294294

295295
GpuInit::~GpuInit() {
296+
if (gl::GetGLImplementation() != gl::kGLImplementationDisabled) {
297+
auto *gl_display = gl::init::GetOrInitializeGLOneOffPlatformImplementation(
298+
false, false, false, gl::GpuPreference::kDefault);
299+
if (gl_display) {
300+
gl::init::ShutdownGL(gl_display, false);
301+
}
302+
}
303+
296304
StopForceDiscreteGPU();
297305
}
298306

0 commit comments

Comments
 (0)