diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-08-26 15:22:41 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2019-09-08 09:40:49 +0200 |
commit | 144d4ec0262680aa9cf7732e3896a836ec126a71 (patch) | |
tree | dde015f6732d271b76d688cbf7a0988d00067758 /src/quick/scenegraph/qsgrhisupport.cpp | |
parent | 81ac3bd856e7c6ead21fc2efc34cdf52cd9196b1 (diff) |
Expose renderpass from QSGRendererInterface
Important for Vulkan and (upcoming) examples like vulkanunderqml.
Change-Id: I5b6c978f38175eca76efe059aa83bb7158724752
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/qsgrhisupport.cpp')
-rw-r--r-- | src/quick/scenegraph/qsgrhisupport.cpp | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgrhisupport.cpp b/src/quick/scenegraph/qsgrhisupport.cpp index a92b6b0c84..e050938cc9 100644 --- a/src/quick/scenegraph/qsgrhisupport.cpp +++ b/src/quick/scenegraph/qsgrhisupport.cpp @@ -279,12 +279,16 @@ QSurface::SurfaceType QSGRhiSupport::windowSurfaceType() const } #if QT_CONFIG(vulkan) -static const void *qsgrhi_vk_rifResource(QSGRendererInterface::Resource res, const QRhiNativeHandles *nat, - const QRhiNativeHandles *cbNat) +static const void *qsgrhi_vk_rifResource(QSGRendererInterface::Resource res, + const QRhiNativeHandles *nat, + const QRhiNativeHandles *cbNat, + const QRhiNativeHandles *rpNat) { const QRhiVulkanNativeHandles *vknat = static_cast<const QRhiVulkanNativeHandles *>(nat); const QRhiVulkanCommandBufferNativeHandles *maybeVkCbNat = static_cast<const QRhiVulkanCommandBufferNativeHandles *>(cbNat); + const QRhiVulkanRenderPassNativeHandles *maybeVkRpNat = + static_cast<const QRhiVulkanRenderPassNativeHandles *>(rpNat); switch (res) { case QSGRendererInterface::DeviceResource: @@ -298,6 +302,11 @@ static const void *qsgrhi_vk_rifResource(QSGRendererInterface::Resource res, con return nullptr; case QSGRendererInterface::PhysicalDeviceResource: return &vknat->physDev; + case QSGRendererInterface::RenderPassResource: + if (maybeVkRpNat) + return &maybeVkRpNat->renderPass; + else + return nullptr; default: return nullptr; } @@ -376,7 +385,10 @@ const void *QSGRhiSupport::rifResource(QSGRendererInterface::Resource res, const case QRhi::Vulkan: { QRhiCommandBuffer *cb = rc->currentFrameCommandBuffer(); - return qsgrhi_vk_rifResource(res, nat, cb ? cb->nativeHandles() : nullptr); + QRhiRenderPassDescriptor *rp = rc->currentFrameRenderPass(); + return qsgrhi_vk_rifResource(res, nat, + cb ? cb->nativeHandles() : nullptr, + rp ? rp->nativeHandles() : nullptr); } #endif #if QT_CONFIG(opengl) |