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

QQuickRenderControl: rendering to an existing QRhi?

    XMLWordPrintable

Details

    Description

      Hi,

      Given a QRhi* instance, what is the procedure to get QQuickRenderControl to render to it? I am interested in the very simple case of synchronous rendering

      Very naively, given:

      QQmlEngine engine;
      QQuickRenderControl renderControl;
      QQuickWindow window{&renderControl};
      QRhi* rhi = ...;
      QRhiRenderTarget* tgt = ...;
      
      // ... init ...
      
      window.setGraphicsDevice(QQuickGraphicsDevice::fromRhi(rhi));
      window.setRenderTarget(QQuickRenderTarget::fromRhiRenderTarget(tgt)); 
      
      renderControl.initialize();
      
      // ... update resources ...
      // How do I get the Qt Quick updates into my QRhiResourceUpdateBatch?
      QRhiResourceUpdateBatch& res = ...;
      renderControl.polishItems();
      
       // ... render ...
      QRhiCommandBuffer& cb = ...;
      // How do I pass the command buffer to the render control?
      
      renderControl.beginFrame();
      
      // next call causes: "QQuickRenderControl cannot be used with QRhi when no QRhiCommandBuffer is provided" which makes sense, but I cannot find where I can pass the QRhiCB
      renderControl.sync(); 
      
      renderControl.render();
      renderControl.endFrame();

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            jcelerier Jean-Michaƫl Celerier
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes