Loading...
Searching...
No Matches
RenderedVSANode.hpp
1#pragma once
2
3#include <Gfx/Graph/ISFNode.hpp>
4#include <Gfx/Graph/NodeRenderer.hpp>
5#include <Gfx/Graph/RenderedISFUtils.hpp>
6
7namespace score::gfx
8{
10{
11 explicit SimpleRenderedVSANode(const ISFNode& node) noexcept;
12
13 virtual ~SimpleRenderedVSANode();
14
15 TextureRenderTarget renderTargetForInput(const Port& p) override;
16 void updateInputTexture(const Port& input, QRhiTexture* tex) override;
17
18 void init(RenderList& renderer, QRhiResourceUpdateBatch& res) override;
19 void update(RenderList& renderer, QRhiResourceUpdateBatch& res, Edge* edge) override;
20 void release(RenderList& r) override;
21
22 void runInitialPasses(
23 RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res,
24 Edge& edge) override;
25
26 void runRenderPass(RenderList&, QRhiCommandBuffer& commands, Edge& edge) override;
27
28private:
29 ossia::small_flat_map<const Port*, TextureRenderTarget, 2> m_rts;
30
31 void initPass(
32 const TextureRenderTarget& rt, RenderList& renderer, Edge& edge,
33 QRhiResourceUpdateBatch& res);
34
35 std::vector<Sampler> allSamplers() const noexcept;
36
37 struct PassData
38 {
39 Edge* edge;
40 Pass main_pass;
41 QRhiGraphicsPipeline* background_pipeline{};
42 QRhiShaderResourceBindings* background_srb{};
43 QRhiBuffer* background_ubo{};
44 MeshBuffers background_tri{};
45 };
46
47 ossia::small_vector<PassData, 2> m_passes;
48
49 ISFNode& n;
50
51 std::vector<Sampler> m_inputSamplers;
52 std::vector<Sampler> m_audioSamplers;
53
54 Mesh* m_mesh{};
55
56 QRhiBuffer* m_materialUBO{};
57 int m_materialSize{};
58
59 std::optional<AudioTextureUpload> m_audioTex;
60
61 int m_prevFormat{};
62};
63}
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
Connection between two score::gfx::Port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:74
Definition Mesh.hpp:23
Data model for meshes.
Definition Mesh.hpp:30
Definition RenderedISFUtils.hpp:13
Port of a score::gfx::Node.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:53
Definition RenderedVSANode.hpp:10
void updateInputTexture(const Port &input, QRhiTexture *tex) override
Definition RenderedVSANode.cpp:44
Useful abstraction for storing all the data related to a render target.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:119