Skip to content

Commit 668b779

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 Change-Id: I0641cfae57aa31fea1984d79b2aa9fa636330f1d Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/556301 Reviewed-by: Peter Varga <[email protected]> (cherry picked from commit 317dd08) Reviewed-on: https://codereview.qt-project.org/c/qt/qtwebengine-chromium/+/582812 Reviewed-by: Qt Cherry-pick Bot <[email protected]>
1 parent 9ac563e commit 668b779

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
@@ -296,6 +296,14 @@ void SetupGLDisplayManagerEGL(const GPUInfo& gpu_info,
296296
GpuInit::GpuInit() = default;
297297

298298
GpuInit::~GpuInit() {
299+
if (gl::GetGLImplementation() != gl::kGLImplementationDisabled) {
300+
auto *gl_display = gl::init::GetOrInitializeGLOneOffPlatformImplementation(
301+
false, false, false, gl::GpuPreference::kDefault);
302+
if (gl_display) {
303+
gl::init::ShutdownGL(gl_display, false);
304+
}
305+
}
306+
299307
StopForceDiscreteGPU();
300308
}
301309

0 commit comments

Comments
 (0)