2#include <Gfx/Graph/CommonUBOs.hpp>
3#include <Gfx/Graph/Mesh.hpp>
4#include <Gfx/Graph/RenderState.hpp>
5#include <Gfx/Graph/Uniforms.hpp>
6#include <Gfx/Graph/Utils.hpp>
8#include <ossia/dataflow/geometry_port.hpp>
9#include <ossia/dataflow/nodes/media.hpp>
10#include <ossia/dataflow/texture_port.hpp>
11#include <ossia/dataflow/token_request.hpp>
12#include <ossia/detail/flat_map.hpp>
13#include <ossia/detail/variant.hpp>
14#include <ossia/network/value/value.hpp>
16#include <score_plugin_gfx_export.h>
18#include <boost/version.hpp>
25class GenericNodeRenderer;
28#if BOOST_VERSION < 107900
29#define a <::BOOST_VERSION>
31#error Boost version not supported anymore
33using gfx_input = ossia::variant<
34 ossia::monostate, ossia::value, ossia::audio_vector, ossia::render_target_spec,
35 ossia::transform3d, FunctionMessage, ossia::buffer_spec>;
44 ossia::time_value date{};
45 ossia::time_value parent_duration{};
52 std::vector<gfx_input> input;
59 QRhiTexture::Format format = QRhiTexture::Format ::RGBA8;
61 QRhiSampler::Filter mag_filter = QRhiSampler::Linear;
62 QRhiSampler::Filter min_filter = QRhiSampler::Linear;
63 QRhiSampler::Filter mipmap_mode = QRhiSampler::None;
65 QRhiSampler::AddressMode address_u = QRhiSampler::Repeat;
66 QRhiSampler::AddressMode address_v = QRhiSampler::Repeat;
67 QRhiSampler::AddressMode address_w = QRhiSampler::Repeat;
73class SCORE_PLUGIN_GFX_EXPORT
Node :
public QObject
81 Node& operator=(
const Node&) =
delete;
92 virtual void renderedNodesChanged();
97 virtual void process(
Message&& msg);
98 virtual void update();
109 ossia::small_pod_vector<Port*, 1>
output;
128 materialChanged.fetch_add(1, std::memory_order_release);
130 bool hasMaterialChanged(int64_t& renderer)
const noexcept
132 int64_t res = materialChanged.load(std::memory_order_acquire);
140 std::atomic_int64_t materialChanged{0};
147 renderTargetSpecChanged.fetch_add(1, std::memory_order_release);
149 bool hasRenderTargetChanged(int64_t& renderer)
const noexcept
151 int64_t res = renderTargetSpecChanged.load(std::memory_order_acquire);
159 std::atomic_int64_t renderTargetSpecChanged{-1};
162 bool requiresDepth{};
165 QSize resolveRenderTargetSize(int32_t port, RenderList& renderer)
const noexcept;
167 resolveRenderTargetSpecs(int32_t port, RenderList& renderer)
const noexcept;
169 void process(int32_t port,
const ossia::render_target_spec& v);
187 void process(
Message&& msg)
override;
188 virtual void process(
Timings tk);
189 virtual void process(int32_t port,
const ossia::value& v);
190 virtual void process(int32_t port,
const ossia::audio_vector& v);
192 virtual void process(int32_t port,
const ossia::transform3d& v);
193 void process(int32_t port, ossia::monostate)
const noexcept { }
194 virtual void process(int32_t port,
const FunctionMessage&);
195 virtual void process(int32_t port,
const ossia::buffer_spec&);
209 createRenderer(
RenderList& r)
const noexcept override;
212 std::unique_ptr<char[]> m_materialData;
219QDebug operator<<(QDebug,
const std::vector<score::gfx::gfx_input>&);
Generic renderer.
Definition NodeRenderer.hpp:96
Root data model for visual nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:74
ossia::flat_map< int32_t, ossia::render_target_spec > renderTargetSpecs
Render target info.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:121
std::vector< Port * > input
Input ports of that node.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:103
void renderTargetChange() noexcept
Used to notify a render target (texture inlet) change from the model to the renderers.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:145
void materialChange() noexcept
Used to notify a material change from the model to the renderers.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:126
ossia::flat_map< RenderList *, score::gfx::NodeRenderer * > renderedNodes
Map associating each RenderList to a Renderer for this model.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:114
virtual NodeRenderer * createRenderer(RenderList &r) const noexcept=0
Create a renderer in a given context for this node.
ossia::small_pod_vector< Port *, 1 > output
Output ports of that node.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:109
Common base class for most single-pass, simple nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:203
Renderer for a given node.
Definition NodeRenderer.hpp:11
Common base class for nodes that map to score processes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:176
List of nodes to be rendered to an output.
Definition RenderList.hpp:19
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:12
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:49
UBO specific to individual processes / nodes.
Definition CommonUBOs.hpp:12
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:56
Messages sent from the execution thread to the rendering thread.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:43