Loading...
Searching...
No Matches
BufferGatherPass.hpp
1#pragma once
2#include <Gfx/Graph/RenderState.hpp>
3
4#include <QtGui/private/qrhi_p.h>
5
6#include <Ui/Monitor/BufferGather.hpp>
7
9{
18{
19public:
20 GatherPass() = default;
21 GatherPass(const GatherPass&) = delete;
22 GatherPass& operator=(const GatherPass&) = delete;
24
26 Fallback check(QRhi& rhi, const QRhiBuffer& source) const noexcept;
27
36 bool record(
37 score::gfx::RenderState& state, QRhiCommandBuffer& cb, QRhiResourceUpdateBatch*& res,
38 QRhiBuffer& source, const GatherPlan& plan, QRhiBufferReadbackResult& out);
39
41 void release() noexcept;
42
43private:
44 bool ensurePipeline(score::gfx::RenderState& state);
45 bool ensureStaging(QRhi& rhi, int64_t bytes);
46 bool ensureBindings(QRhi& rhi, QRhiBuffer& source, const GatherPlan& plan);
47
48 QShader m_shader;
49 QRhiComputePipeline* m_pipeline{};
50 QRhiShaderResourceBindings* m_srb{};
51 QRhiBuffer* m_params{};
52 QRhiBuffer* m_staging{};
55 quint64 m_sourceId{};
56 quint64 m_stagingId{};
57 int64_t m_bindOffset{-1};
58 int64_t m_bindSize{-1};
59 bool m_failed{};
60};
61}
Definition BufferGatherPass.hpp:18
Fallback check(QRhi &rhi, const QRhiBuffer &source) const noexcept
Whether the pass can read source on rhi.
Definition BufferGatherPass.cpp:162
void release() noexcept
Deletes the resources. A readback recorded must have completed.
Definition BufferGatherPass.cpp:316
bool record(score::gfx::RenderState &state, QRhiCommandBuffer &cb, QRhiResourceUpdateBatch *&res, QRhiBuffer &source, const GatherPlan &plan, QRhiBufferReadbackResult &out)
Definition BufferGatherPass.cpp:267
Definition BufferDecode.hpp:16
Fallback
Why a buffer is read back as one range instead of through the gather pass.
Definition BufferGather.hpp:27
What a gather pass reads and where its result goes.
Definition BufferGather.hpp:85
Global state associated to a rendering context.
Definition RenderState.hpp:40