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 /tests | |
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 'tests')
-rw-r--r-- | tests/auto/gui/rhi/qrhi/tst_qrhi.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp index b6351eef45..477b98cc4e 100644 --- a/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp +++ b/tests/auto/gui/rhi/qrhi/tst_qrhi.cpp @@ -2751,8 +2751,8 @@ void tst_QRhi::finishWithinSwapchainFrame() QScopedPointer<QRhiBuffer> vbuf(rhi->newBuffer(QRhiBuffer::Immutable, QRhiBuffer::VertexBuffer, sizeof(vertices))); QVERIFY(vbuf->create()); - // exercise begin/endExternal() just a little bit, hence ExternalContentsInPass - QVERIFY(rhi->beginFrame(swapChain.data(), QRhi::ExternalContentsInPass) == QRhi::FrameOpSuccess); + // exercise begin/endExternal() just a little bit, note ExternalContent for beginPass() + QVERIFY(rhi->beginFrame(swapChain.data()) == QRhi::FrameOpSuccess); QRhiCommandBuffer *cb = swapChain->currentFrameCommandBuffer(); QRhiRenderTarget *rt = swapChain->currentFrameRenderTarget(); const QSize outputSize = swapChain->currentPixelSize(); @@ -2763,7 +2763,7 @@ void tst_QRhi::finishWithinSwapchainFrame() QRhiResourceUpdateBatch *updates = rhi->nextResourceUpdateBatch(); updates->uploadStaticBuffer(vbuf.data(), vertices); - cb->beginPass(rt, Qt::blue, { 1.0f, 0 }, updates); + cb->beginPass(rt, Qt::blue, { 1.0f, 0 }, updates, QRhiCommandBuffer::ExternalContent); // just have some commands, do not bother with draw calls cb->setGraphicsPipeline(pipeline.data()); |