2 #include <Gfx/Graph/ISFNode.hpp>
3 #include <Gfx/Graph/NodeRenderer.hpp>
5 #include <ossia/audio/fft.hpp>
6 #include <ossia/detail/small_flat_map.hpp>
7 #include <ossia/detail/variant.hpp>
8 #include <ossia/math/math_expression.hpp>
16 QRhiBuffer* processUBO{};
21 QRhiSampler* sampler{};
22 QRhiTexture* textures[2]{
nullptr,
nullptr};
24 using PassOutput = ossia::variant<PersistSampler, TextureRenderTarget>;
31 process(
AudioTexture& audio, QRhiResourceUpdateBatch& res, QRhiTexture* rhiTexture);
34 AudioTexture& audio, QRhiResourceUpdateBatch& res, QRhiTexture* rhiTexture);
37 AudioTexture& audio, QRhiResourceUpdateBatch& res, QRhiTexture* rhiTexture);
39 [[nodiscard]] std::optional<Sampler> updateAudioTexture(
41 QRhiResourceUpdateBatch& res);
44 std::vector<float> m_scratchpad;
56 void init(
RenderList& renderer, QRhiResourceUpdateBatch& res)
override;
57 void update(
RenderList& renderer, QRhiResourceUpdateBatch& res)
override;
60 void runInitialPasses(
61 RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res,
64 void runRenderPass(
RenderList&, QRhiCommandBuffer& commands,
Edge& edge)
override;
67 ossia::small_flat_map<const Port*, TextureRenderTarget, 2> m_rts;
69 std::pair<Pass, Pass> createPass(
70 RenderList& renderer, ossia::small_vector<PassOutput, 1>& m_passSamplers,
71 PassOutput target,
bool previousPassIsPersistent);
73 std::pair<Pass, Pass> createFinalPass(
74 RenderList& renderer, ossia::small_vector<PassOutput, 1>& m_passSamplers,
78 QSize mainTexSize, QRhiResourceUpdateBatch& res);
80 PassOutput initPassSampler(
82 QSize mainTexSize, QRhiResourceUpdateBatch& res);
86 ossia::small_vector<Pass, 1> passes;
87 ossia::small_vector<Pass, 1> altPasses;
88 ossia::small_vector<PassOutput, 1> samplers;
92 allSamplers(ossia::small_vector<PassOutput, 1>&,
int mainOrAltPass)
const noexcept;
94 ossia::small_vector<std::pair<Edge*, Passes>, 2> m_passes;
98 std::vector<Sampler> m_inputSamplers;
99 std::vector<Sampler> m_audioSamplers;
101 std::vector<TextureRenderTarget> m_innerPassTargets;
103 const Mesh* m_mesh{};
104 QRhiBuffer* m_meshBuffer{};
105 QRhiBuffer* m_idxBuffer{};
107 QRhiBuffer* m_materialUBO{};
108 int m_materialSize{};
109 int64_t materialChangedIndex{-1};
124 void init(
RenderList& renderer, QRhiResourceUpdateBatch& res)
override;
125 void update(
RenderList& renderer, QRhiResourceUpdateBatch& res)
override;
128 void runInitialPasses(
129 RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res,
130 Edge& edge)
override;
132 void runRenderPass(
RenderList&, QRhiCommandBuffer& commands,
Edge& edge)
override;
135 ossia::small_flat_map<const Port*, TextureRenderTarget, 2> m_rts;
139 std::vector<Sampler> allSamplers()
const noexcept;
141 ossia::small_vector<std::pair<Edge*, Pass>, 2> m_passes;
145 std::vector<Sampler> m_inputSamplers;
146 std::vector<Sampler> m_audioSamplers;
148 const Mesh* m_mesh{};
149 QRhiBuffer* m_meshBuffer{};
150 QRhiBuffer* m_idxBuffer{};
152 QRhiBuffer* m_materialUBO{};
153 int m_materialSize{};
154 int64_t materialChangedIndex{-1};
156 std::optional<AudioTextureUpload> m_audioTex;
Data model for Interactive Shader Format filters.
Definition: ISFNode.hpp:20
Renderer for a given node.
Definition: NodeRenderer.hpp:11
List of nodes to be rendered to an output.
Definition: RenderList.hpp:19
Graphics rendering pipeline for ossia score.
Definition: Filter/PreviewWidget.hpp:12
Data model for audio data being sent to the GPU.
Definition: score-plugin-gfx/Gfx/Graph/Utils.hpp:34
Definition: RenderedISFNode.hpp:27
Connection between two score::gfx::Port.
Definition: score-plugin-gfx/Gfx/Graph/Utils.hpp:66
Data model for meshes.
Definition: Mesh.hpp:23
Definition: RenderedISFNode.hpp:13
Definition: RenderedISFNode.hpp:20
Useful abstraction for storing a graphics pipeline and associated resource bindings.
Definition: score-plugin-gfx/Gfx/Graph/Utils.hpp:93
Port of a score::gfx::Node.
Definition: score-plugin-gfx/Gfx/Graph/Utils.hpp:48
Definition: RenderedISFNode.hpp:49
Definition: RenderedISFNode.hpp:117
Useful abstraction for storing all the data related to a render target.
Definition: score-plugin-gfx/Gfx/Graph/Utils.hpp:111