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 void updateInputTexture(const Port& input, QRhiTexture* tex) override;
16
17 void init(RenderList& renderer, QRhiResourceUpdateBatch& res) override;
18 void update(RenderList& renderer, QRhiResourceUpdateBatch& res, Edge* edge) override;
19 void release(RenderList& r) override;
20
21 void runInitialPasses(
22 RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res,
23 Edge& edge) override;
24
25 void runRenderPass(RenderList&, QRhiCommandBuffer& commands, Edge& edge) override;
26
27private:
28 void initPass(
29 const TextureRenderTarget& rt, RenderList& renderer, Edge& edge,
30 QRhiResourceUpdateBatch& res);
31
32 std::vector<Sampler> allSamplers() const noexcept;
33
34 struct PassData
35 {
36 Edge* edge;
37 Pass main_pass;
38 QRhiGraphicsPipeline* background_pipeline{};
39 QRhiShaderResourceBindings* background_srb{};
40 QRhiBuffer* background_ubo{};
41 MeshBuffers background_tri{};
42 };
43
44 ossia::small_vector<PassData, 2> m_passes;
45
46 ISFNode& n;
47
48 std::vector<Sampler> m_inputSamplers;
49 std::vector<Sampler> m_audioSamplers;
50
51 Mesh* m_mesh{};
52
53 QRhiBuffer* m_materialUBO{};
54 int m_materialSize{};
55
56 std::optional<AudioTextureUpload> m_audioTex;
57
58 int m_prevFormat{};
59};
60}
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:75
Definition Mesh.hpp:33
Data model for meshes.
Definition Mesh.hpp:46
Definition RenderedISFUtils.hpp:13
Port of a score::gfx::Node.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:54
Definition RenderedVSANode.hpp:10
void updateInputTexture(const Port &input, QRhiTexture *tex) override
Definition RenderedVSANode.cpp:36
Useful abstraction for storing all the data related to a render target.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:122