diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-09-30 14:08:53 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2020-10-02 13:14:08 +0200 |
commit | d92b0e18c1b987e60304c2e366ff374405adaab1 (patch) | |
tree | 07734992c8ce08cedf3214c1893dc033c21c2996 /src/gui/rhi/qrhimetal.mm | |
parent | 3080194ae41128e91da59301a7e221303a2f04a5 (diff) |
rhi: Make per-frame flags per-pass where appropriate
ExternalContentsInPass becomes a per-pass flag now. Why is this
beneficial? Because while Qt Quick has no choice for its render
pass, not being able to guess if the application wants to do some
native rendering in there, Quick 3D's render passes, all the ones
that are under Quick3D's control, do not have native rendering
from the application in them, and so using secondary command
buffers with Vulkan is not necessary.
Introduce something similar for compute and OpenGL. By knowing that
none of the resources used in a pass are used with a compute pass
(e.g. because we know that there are no compute passes at all) a small
amount of time can be saved by skipping tracking buffers and textures
because the only purpose of said tracking is to generate barriers that
are relevant only to compute.
Change-Id: I0eceb4774d87803c73a39db527f5707a9f4d75c1
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhimetal.mm')
-rw-r--r-- | src/gui/rhi/qrhimetal.mm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/rhi/qrhimetal.mm b/src/gui/rhi/qrhimetal.mm index a31d37c01a..4caaca4a3a 100644 --- a/src/gui/rhi/qrhimetal.mm +++ b/src/gui/rhi/qrhimetal.mm @@ -1898,7 +1898,8 @@ void QRhiMetal::beginPass(QRhiCommandBuffer *cb, QRhiRenderTarget *rt, const QColor &colorClearValue, const QRhiDepthStencilClearValue &depthStencilClearValue, - QRhiResourceUpdateBatch *resourceUpdates) + QRhiResourceUpdateBatch *resourceUpdates, + QRhiCommandBuffer::BeginPassFlags) { QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb); Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::NoPass); @@ -2013,7 +2014,9 @@ void QRhiMetal::endPass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resource enqueueResourceUpdates(cb, resourceUpdates); } -void QRhiMetal::beginComputePass(QRhiCommandBuffer *cb, QRhiResourceUpdateBatch *resourceUpdates) +void QRhiMetal::beginComputePass(QRhiCommandBuffer *cb, + QRhiResourceUpdateBatch *resourceUpdates, + QRhiCommandBuffer::BeginPassFlags) { QMetalCommandBuffer *cbD = QRHI_RES(QMetalCommandBuffer, cb); Q_ASSERT(cbD->recordingPass == QMetalCommandBuffer::NoPass); |