Details
-
Bug
-
Resolution: Fixed
-
P5: Not important
-
None
-
6.6.1, 6.7.0
-
None
Description
Upon migrating my application from Qt 5.15.2 to versions 6.6.1 and 6.7, I encountered crashes when invoking the render or sync functions. Previously, the application worked flawlessly with Qt 5.15.2, and I made adjustments to ensure compatibility with Qt 6.6.1.
During initialization, the QQuickRenderControl object is created successfully, and its RHI (Render Hardware Interface) object is established without issues. However, upon attempting to use the render or sync functions within Qt 6.6.1 or 6.7, the application crashes unexpectedly.
The application's functionality seems intact in Qt 5.15.2, but these issues arise specifically after transitioning to the newer Qt versions.
if (_currentSize != QSize()) { static auto& glf = gl::functions(); // QOpenGLFunctions_4_5_Core GLuint texture = TextureCache::get().acquireTexture(_currentSize); glf.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _fbo); // uint32_t _fbo{ 0 }; glf.glFramebufferTexture(GL_DRAW_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, texture, 0); glf.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); auto fbos = QQuickRenderTarget::fromOpenGLTexture( _fbo, _currentSize); _quickWindow->setRenderTarget(fbos); // _quickWindow (QQuickWindow*) _renderControl->beginFrame(); auto rhi = _shared->_renderControl->rhi(); qDebug() << Q_FUNC_INFO << __LINE__<<rhi; _renderControl->render(); // crash _renderControl->endFrame(); _lastRenderTime = usecTimestampNow(); glf.glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0); auto fence = glf.glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); // Fence will be used in another thread / context, so a flush is required glf.glFlush(); updateTexture({texture, fence, _currentSize}); _quickWindow->beginExternalCommands(); _quickWindow->endExternalCommands(); }