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>
24class GenericNodeRenderer;
27#if BOOST_VERSION < 107900
29using gfx_input = ossia::slow_variant<
30 ossia::monostate, ossia::value, ossia::audio_vector, ossia::render_target_spec,
31 ossia::geometry_spec, ossia::transform3d, FunctionMessage>;
33using gfx_input = ossia::variant<
34 ossia::monostate, ossia::value, ossia::audio_vector, ossia::render_target_spec,
35 ossia::geometry_spec, ossia::transform3d, FunctionMessage>;
45 ossia::time_value date{};
46 ossia::time_value parent_duration{};
53 std::vector<gfx_input> input;
60 QRhiTexture::Format format = QRhiTexture::Format ::RGBA8;
62 QRhiSampler::Filter mag_filter = QRhiSampler::Linear;
63 QRhiSampler::Filter min_filter = QRhiSampler::Linear;
64 QRhiSampler::Filter mipmap_mode = QRhiSampler::None;
66 QRhiSampler::AddressMode address_u = QRhiSampler::Repeat;
67 QRhiSampler::AddressMode address_v = QRhiSampler::Repeat;
68 QRhiSampler::AddressMode address_w = QRhiSampler::Repeat;
74class SCORE_PLUGIN_GFX_EXPORT
Node
82 Node& operator=(
const Node&) =
delete;
93 virtual void renderedNodesChanged();
98 virtual void process(
Message&& msg);
99 virtual void update();
110 ossia::small_pod_vector<Port*, 1>
output;
122 materialChanged.fetch_add(1, std::memory_order_release);
124 bool hasMaterialChanged(int64_t& renderer)
const noexcept
126 int64_t res = materialChanged.load(std::memory_order_acquire);
134 std::atomic_int64_t materialChanged{0};
141 geometryChanged.fetch_add(1, std::memory_order_release);
143 bool hasGeometryChanged(int64_t& renderer)
const noexcept
145 int64_t res = geometryChanged.load(std::memory_order_acquire);
153 std::atomic_int64_t geometryChanged{-1};
160 renderTargetSpecChanged.fetch_add(1, std::memory_order_release);
162 bool hasRenderTargetChanged(int64_t& renderer)
const noexcept
164 int64_t res = renderTargetSpecChanged.load(std::memory_order_acquire);
172 std::atomic_int64_t renderTargetSpecChanged{-1};
208 void process(
Message&& msg)
override;
210 void process(int32_t port,
const ossia::value& v);
211 void process(int32_t port,
const ossia::audio_vector& v);
212 void process(int32_t port,
const ossia::geometry_spec& v);
213 void process(int32_t port,
const ossia::render_target_spec& v);
214 void process(int32_t port,
const ossia::transform3d& v);
215 void process(int32_t port, ossia::monostate)
const noexcept { }
216 void process(int32_t port,
const FunctionMessage&);
218 QSize resolveRenderTargetSize(int32_t port,
RenderList& renderer)
const noexcept;
220 resolveRenderTargetSpecs(int32_t port,
RenderList& renderer)
const noexcept;
233 createRenderer(
RenderList& r)
const noexcept override;
236 std::unique_ptr<char[]> m_materialData;
243QDebug operator<<(QDebug,
const std::vector<score::gfx::gfx_input>&);
Generic renderer.
Definition NodeRenderer.hpp:84
Root data model for visual nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:75
std::vector< Port * > input
Input ports of that node.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:104
void geometryChange() noexcept
Used to notify a geometry change from the model to the renderers.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:139
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:158
void materialChange() noexcept
Used to notify a material change from the model to the renderers.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:120
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:115
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:110
Common base class for most single-pass, simple nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:227
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:182
ossia::geometry_spec geometry
The geometry to use.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:199
ossia::flat_map< int32_t, ossia::render_target_spec > renderTargetSpecs
Render target info.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:206
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:50
UBO specific to individual processes / nodes.
Definition CommonUBOs.hpp:12
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:57
Messages sent from the execution thread to the rendering thread.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:44