Skip to content

OpenGL renderer: restore surface on context when shutting down

Paul Lemire requested to merge lemirep/qt3d:patch into kde/5.15

When using a QQuickWidget and Qt3D, on shutdown and assert occurs. This is the result of the QQuickWidget expecting the surface on the context to be its own internal surface after the QQuickRenderControl has been invalidated.

This conflict with what Qt3D does on shutdown as it makes the context current on its own internal offscreen surface on shutdown.

Therefore, to fix this issue, we record the surface in use before Qt3D shuts down and we make the context current on it after Qt3D has shutdown.

Arguably, the fix should really go in QQuickWidgetPrivate::invalidateRenderControl where the QQuickWidget should check that the current surface is indeed the one it expects and set it accordingly.

Change-Id: I534dc330a30a2ad5d17a6416715d03206ef4b1c9 Reviewed-by: Mike Krus (cherry picked from commit 559d77ca) Reviewed-by: Paul Lemire

Merge request reports