Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-120126

When attempting to utilize the render or sync functions within QQuickRenderControl, my application crashes unexpectedly.

    XMLWordPrintable

Details

    • Windows

    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();
      
          }
      

       

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            janichol Andy Nichols
            mohsenkondori mohsen Kondori
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes