diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-06-25 16:37:58 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-07-04 19:49:08 +0200 |
commit | 192d4fa0af5f40f76979f195c4356b26eaed1696 (patch) | |
tree | e4df789d370b45b5a84f0b971b21ce3c2640fa2c /src/quick/items | |
parent | fc40f0738e55725d4449059578510802dbf596ec (diff) |
Make openglunderqml functional with and without the rhi
It has to be written following the new split approach (beforeRendering
for resource setup, beforeRenderPassRecording to issue the actual
underlay draw calls), but it will then work both with and
without QSG_RHI=1.
Change-Id: I9b7b35434aa0caec543cae268064b2684256382d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 33 |
1 files changed, 25 insertions, 8 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 0adfbdb922..c51cfc8ac1 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -474,13 +474,18 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size, const QSize &surfa if (rhi) { // ### no offscreen ("renderTargetId") support yet - context->beginRhiFrame(renderer, - swapchain->currentFrameRenderTarget(), - rpDescForSwapchain, - swapchain->currentFrameCommandBuffer(), - emitBeforeRenderPassRecording, - emitAfterRenderPassRecording, - q); + context->beginNextRhiFrame(renderer, + swapchain->currentFrameRenderTarget(), + rpDescForSwapchain, + swapchain->currentFrameCommandBuffer(), + emitBeforeRenderPassRecording, + emitAfterRenderPassRecording, + q); + } else { + context->beginNextFrame(renderer, + emitBeforeRenderPassRecording, + emitAfterRenderPassRecording, + q); } animationController->advance(); @@ -528,7 +533,9 @@ void QQuickWindowPrivate::renderSceneGraph(const QSize &size, const QSize &surfa runAndClearJobs(&afterRenderingJobs); if (rhi) - context->endRhiFrame(renderer); + context->endNextRhiFrame(renderer); + else + context->endNextFrame(renderer); } QQuickWindowPrivate::QQuickWindowPrivate() @@ -4202,6 +4209,11 @@ QQmlIncubationController *QQuickWindow::incubationController() const attached images). The native graphics objects can be queried via QSGRendererInterface. + When not running with the RHI (and using OpenGL directly), the signal is + emitted after the renderer has cleared the render target. This makes it + possible to create appliations that function identically both with and + without the RHI. + \note Resource updates (uploads, copies) typically cannot be enqueued from within a render pass. Therefore, more complex user rendering will need to connect to both the beforeRendering() and this signals. @@ -4228,6 +4240,11 @@ QQmlIncubationController *QQuickWindow::incubationController() const the attached images). The native graphics objects can be queried via QSGRendererInterface. + When not running with the RHI (and using OpenGL directly), the signal is + emitted after the renderer has finished its rendering, but before + afterRendering(). This makes it possible to create appliations that + function identically both with and without the RHI. + \note Resource updates (uploads, copies) typically cannot be enqueued from within a render pass. Therefore, more complex user rendering will need to connect to both the beforeRendering() and this signals. |