2#include <ossia/detail/variant.hpp>
12class invalid_file :
public std::runtime_error
15 using std::runtime_error::runtime_error;
24 using value_type = bool;
25 using has_default = std::true_type;
31 using value_type = int64_t;
32 using has_minmax = std::true_type;
33 std::vector<ossia::variant<int64_t, double, std::string>> values;
34 std::vector<std::string> labels;
39 using value_type = double;
40 using has_minmax = std::true_type;
48 using value_type = std::array<double, 2>;
49 using has_minmax = std::true_type;
50 std::optional<value_type> def{};
51 std::optional<value_type> min{};
52 std::optional<value_type> max{};
57 using value_type = std::array<double, 3>;
58 using has_minmax = std::true_type;
59 std::optional<value_type> def{};
60 std::optional<value_type> min{};
61 std::optional<value_type> max{};
66 using value_type = std::array<double, 4>;
67 using has_minmax = std::true_type;
68 std::optional<value_type> def{};
69 std::optional<value_type> min{};
70 std::optional<value_type> max{};
103 std::vector<layout_field> layout;
111struct csf_image_input
116 std::string width_expression;
117 std::string height_expression;
122 using input_impl = ossia::variant<
123 float_input, long_input, event_input, bool_input, color_input, point2d_input,
124 point3d_input, image_input, audio_input, audioFFT_input, audioHist_input,
125 storage_input, texture_input, csf_image_input>;
137 bool float_storage{};
138 bool nearest_filter{};
139 std::string width_expression{};
140 std::string height_expression{};
151 std::string description;
153 std::vector<std::string> categories;
154 std::vector<input> inputs;
155 std::vector<pass> passes;
156 std::vector<std::string> pass_targets;
157 bool default_vertex_shader{};
161 std::string primitive_mode;
162 std::string line_size;
163 std::array<double, 4> background_color;
166 struct type_definition
169 std::vector<storage_input::layout_field> layout;
171 std::vector<type_definition> types;
175 std::array<int, 3> local_size{16, 16, 1};
176 std::string execution_type{
"2D_IMAGE"};
177 std::string target_resource;
178 std::array<int, 3> workgroups{1, 1, 1};
180 std::vector<dispatch_info> csf_passes;
185 std::string m_sourceVertex;
186 std::string m_sourceFragment;
187 std::string m_source_geometry_filter;
190 std::string m_vertex;
191 std::string m_fragment;
192 std::string m_geometry_filter;
197 enum class ShaderType
207 parser(std::string vert, std::string frag,
int glslVersion, ShaderType);
208 explicit parser(std::string isf_geom_filter, ShaderType t);
210 descriptor data()
const;
211 descriptor::Mode mode()
const;
212 std::string vertex()
const;
213 std::string fragment()
const;
214 std::string geometry_filter()
const;
215 std::string compute_shader()
const;
216 static std::pair<int, descriptor> parse_isf_header(std::string_view source);
217 void parse_shadertoy_json(
const std::string& json);
219 std::string write_isf()
const;
223 void parse_shadertoy();
224 void parse_glsl_sandbox();
225 void parse_geometry_filter();