4#include <ossia/detail/variant.hpp>
40 port_counts operator()(
const isf::float_input&)
const noexcept {
return {1, 0, 0}; }
41 port_counts operator()(
const isf::long_input&)
const noexcept {
return {1, 0, 0}; }
42 port_counts operator()(
const isf::event_input&)
const noexcept {
return {1, 0, 0}; }
43 port_counts operator()(
const isf::bool_input&)
const noexcept {
return {1, 0, 0}; }
44 port_counts operator()(
const isf::point2d_input&)
const noexcept {
return {1, 0, 0}; }
45 port_counts operator()(
const isf::point3d_input&)
const noexcept {
return {1, 0, 0}; }
46 port_counts operator()(
const isf::color_input&)
const noexcept {
return {1, 0, 0}; }
47 port_counts operator()(
const isf::audio_input&)
const noexcept {
return {1, 0, 0}; }
48 port_counts operator()(
const isf::audioHist_input&)
const noexcept{
return {1, 0, 0}; }
49 port_counts operator()(
const isf::audioFFT_input&)
const noexcept {
return {1, 0, 0}; }
51 port_counts operator()(
const isf::image_input& in)
const noexcept
56 const bool grabs = (in.dimensions == 3 || in.is_array || in.is_static);
57 const int extra_depth_sampler = (in.depth && !grabs) ? 1 : 0;
58 return {1, 0, 1 + extra_depth_sampler};
60 port_counts operator()(
const isf::cubemap_input&)
const noexcept {
return {1, 0, 1}; }
61 port_counts operator()(
const isf::texture_input&)
const noexcept {
return {1, 0, 1}; }
63 port_counts operator()(
const isf::storage_input& in)
const noexcept
68 if(in.access ==
"read_only")
72 && in.layout.back().type.find(
"[]") != std::string::npos)
77 port_counts operator()(
const isf::uniform_input&)
const noexcept
82 port_counts operator()(
const isf::csf_image_input& in)
const noexcept
85 if(in.access ==
"read_only")
90 port_counts operator()(
const isf::geometry_input& in)
const noexcept
93 if(in.attributes.empty())
101 for(
const auto& attr : in.attributes)
102 if(attr.access ==
"read_only" || attr.access ==
"read_write")
103 { c.inlets = 1;
break; }
104 for(
const auto& attr : in.attributes)
105 if(attr.access ==
"write_only" || attr.access ==
"read_write")
106 { c.outlets = 1;
break; }
109 if(in.vertex_count.find(
"$USER") != std::string::npos) c.inlets++;
110 if(in.instance_count.find(
"$USER") != std::string::npos) c.inlets++;
111 for(
const auto& aux : in.auxiliary)
112 if(aux.size.find(
"$USER") != std::string::npos)
129inline void walk_descriptor_inputs(
130 const isf::descriptor& desc,
port_counts start, F&& fn)
133 for(
const auto& inp : desc.inputs)
143inline void walk_descriptor_inputs(
const isf::descriptor& desc, F&& fn)
145 walk_descriptor_inputs(desc, port_counts{}, std::forward<F>(fn));
151 void operator()(
const isf::float_input&)
noexcept { sz += 4; }
153 void operator()(
const isf::long_input&)
noexcept { sz += 4; }
155 void operator()(
const isf::event_input&)
noexcept
160 void operator()(
const isf::bool_input&)
noexcept
165 void operator()(
const isf::point2d_input&)
noexcept
172 void operator()(
const isf::point3d_input&)
noexcept
181 void operator()(
const isf::color_input&)
noexcept
190 void operator()(
const isf::image_input&)
noexcept { }
191 void operator()(
const isf::cubemap_input&)
noexcept { }
193 void operator()(
const isf::audio_input&)
noexcept { }
194 void operator()(
const isf::audioFFT_input&)
noexcept { }
195 void operator()(
const isf::audioHist_input&)
noexcept { }
198 void operator()(
const isf::storage_input& in)
noexcept
205 if(in.access.contains(
"write") && !in.layout.empty()
206 && in.layout.back().type.find(
"[]") != std::string::npos)
208 (*this)(isf::long_input{});
212 void operator()(
const isf::uniform_input&)
noexcept
218 void operator()(
const isf::texture_input in)
noexcept { }
220 void operator()(
const isf::csf_image_input& in)
noexcept
228 void operator()(
const isf::geometry_input& in)
noexcept
233 if(in.vertex_count.find(
"$USER") != std::string::npos)
234 (*this)(isf::long_input{});
235 if(in.instance_count.find(
"$USER") != std::string::npos)
236 (*
this)(isf::long_input{});
237 for(
const auto& aux : in.auxiliary)
238 if(aux.size.find(
"$USER") != std::string::npos)
239 (*
this)(isf::long_input{});
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
Definition ISFVisitors.hpp:21
int outlets
score output ports created
Definition ISFVisitors.hpp:23
int samplers
Definition ISFVisitors.hpp:24
int inlets
score input ports created by this desc.inputs entry
Definition ISFVisitors.hpp:22