diff options
author | Paul Lemire <paul.lemire@kdab.com> | 2020-07-15 16:17:10 +0200 |
---|---|---|
committer | Paul Lemire <paul.lemire@kdab.com> | 2020-07-29 08:03:55 +0200 |
commit | 136c016cbe99cd7b8c810c44724e5e3b1b6297e1 (patch) | |
tree | 81e05dbf0eddcc70ece85cf54292b3ba47110a59 /src/plugins/renderers/rhi/managers/rhiresourcemanagers.cpp | |
parent | db611272f595dbb9f381b86d23353dece35df021 (diff) | |
download | qt3d-136c016cbe99cd7b8c810c44724e5e3b1b6297e1.tar.gz |
Refactor Scene3D to work with both RHI and GL Qt3D renderers
- Depending on whether we are using RHI or GL we need to either trigger
the rendering after the beforeRendering or beforeRenderPassRecording
have been fired
-> beforeRendering
The RHI command buffer is set up but nothing has been
recorded yet. This is what we want for the RHI backend
but we will need to make sure we don't call begin/endFrame
nor use swap chains other than the one QtQuick is using.
This means RenderSurfaceSelector won't be possible.
-> beforeRenderPassRecording
The RHI command for buffer uploads have been uploaded but the
actual RenderPass draw calls have yet to be made. The screen
has been cleared already, so this is the best place for the
GL backend which expects the screen to have been cleared.
- The GL backend can use a QOpenGLFrameBufferObject but that is not
possible with the RHI backend.
- The RHI backend uses a custom QRhiRenderTarget that takes care of
blitting its color attachment into a QRhiTexture which is then
bound to a QSGTexture
The overall Scene3DItem/Scene3DRender architecture remains the same:
- processChange
- Render Qt3D content into Texture
- Set texture on a custom QSGNode quad
Change-Id: Id6c317342d0a227d5295cbfefefc3ed12da160d7
Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/plugins/renderers/rhi/managers/rhiresourcemanagers.cpp')
-rw-r--r-- | src/plugins/renderers/rhi/managers/rhiresourcemanagers.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/renderers/rhi/managers/rhiresourcemanagers.cpp b/src/plugins/renderers/rhi/managers/rhiresourcemanagers.cpp index 385fa24b4..387464fe4 100644 --- a/src/plugins/renderers/rhi/managers/rhiresourcemanagers.cpp +++ b/src/plugins/renderers/rhi/managers/rhiresourcemanagers.cpp @@ -68,6 +68,9 @@ RHIResourceManagers::~RHIResourceManagers() void RHIResourceManagers::releaseAllResources() { auto releaseAll = [](auto *manager) noexcept { + // Release all resources reference by a key + manager->releaseAllResources(); + // Release remaining resources which were allocated manually but had no key const auto handles = manager->activeHandles(); for (const auto &handle : handles) { manager->release(handle); |