Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
6.5
-
None
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();