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

Support rendering to QImage via QQuickRenderControl without having to use private APIs

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.0.0 Beta5
    • Qt RHI, Quick: SceneGraph
    • None

    Description

      Currently to render offscreen using QQuickRenderControl, you need to QQuickWindow::setRenderTarget - and all available {{QQuickRenderTarget}}s are native, so you need 4 different native implementations.

      Qt should expose a cross-platform QQuickRenderTarget so that I can render to this then read back the results as a QImage. This is for e.g. rendering QML offscreen as image frames into a video.

      The test tst_RenderControl::renderAndReadBackWithRhi() in https://github.com/qt/qtdeclarative/blob/v6.0.0-beta5/tests/auto/quick/qquickrendercontrol/tst_qquickrendercontrol.cpp#L137 does exactly what I want. And the comment in that test is exactly what this bug is about - why do application developers have to do 4 separate native implementations to make this work?

      // What comes now is technically cheating - as long as QRhi is not a public
      // API this is not something applications can follow doing. However, it  
      // allows us to test out the pipeline without having to write 4 different
      // native (Vulkan, Metal, D3D11, OpenGL) implementations of all what's below.

      Attachments

        Issue Links

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

          Activity

            People

              qt.team.graphics.and.multimedia Qt Graphics Team
              rectalogic Andrew Wason
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes