diff --git a/include/merian-nodes/graph/graph.hpp b/include/merian-nodes/graph/graph.hpp index 75e040b..eae11df 100644 --- a/include/merian-nodes/graph/graph.hpp +++ b/include/merian-nodes/graph/graph.hpp @@ -1386,7 +1386,9 @@ class Graph : public std::enable_shared_from_this> { try { data.input_connectors = node->describe_inputs(); } catch (const graph_errors::node_error& e) { - data.errors.push_back(e.what()); + data.errors.emplace_back(fmt::format("node error: ", e.what())); + } catch (const ShaderCompiler::compilation_failed& e) { + data.errors.emplace_back(fmt::format("compilation failed: ", e.what())); } for (const InputConnectorHandle& input : data.input_connectors) { if (data.input_connector_for_name.contains(input->name)) { @@ -1470,7 +1472,9 @@ class Graph : public std::enable_shared_from_this> { register_event_listener_for_connect(event_pattern, listener); })); } catch (const graph_errors::node_error& e) { - data.errors.emplace_back(e.what()); + data.errors.emplace_back(fmt::format("node error: ", e.what())); + } catch (const ShaderCompiler::compilation_failed& e) { + data.errors.emplace_back(fmt::format("compilation failed: ", e.what())); } for (const auto& output : data.output_connectors) { diff --git a/include/merian-nodes/graph/node.hpp b/include/merian-nodes/graph/node.hpp index 81d2fd3..9bd8079 100644 --- a/include/merian-nodes/graph/node.hpp +++ b/include/merian-nodes/graph/node.hpp @@ -35,7 +35,7 @@ class Node : public std::enable_shared_from_this { // // Note that input and output names must be unique. // - // If you throw a node_error here the graph will disable the node for this connect attempt and + // If you throw node_error or compilation_failed the graph will disable the node for this connect attempt and // set the error state for this node. Your inputs will then be invisible. [[nodiscard]] virtual std::vector describe_inputs() { @@ -50,8 +50,8 @@ class Node : public std::enable_shared_from_this { // // Note that input and output names must be unique. // - // If you throw a node_error here the graph will disable the node for this connect attempt and - // set the error state for this node. + // If you throw node_error or compilation_failed the graph will disable the node for this + // connect attempt and set the error state for this node. [[nodiscard]] virtual std::vector describe_outputs([[maybe_unused]] const NodeIOLayout& io_layout) { @@ -68,7 +68,7 @@ class Node : public std::enable_shared_from_this { // It contains all input and output connectors for which get_descriptor_info() method does not // return std::nullopt. The order is guaranteed to be all inputs in the order of // describe_inputs() then outputs in the order of describe_outputs(). - // + // // Here also delayed inputs can be accessed from io_layout. [[nodiscard]] virtual NodeStatusFlags diff --git a/src/merian-nodes/graph/node_registry.cpp b/src/merian-nodes/graph/node_registry.cpp index 2996e5a..c1467af 100644 --- a/src/merian-nodes/graph/node_registry.cpp +++ b/src/merian-nodes/graph/node_registry.cpp @@ -14,11 +14,11 @@ #include "merian-nodes/nodes/image_write/image_write.hpp" #include "merian-nodes/nodes/mean/mean.hpp" #include "merian-nodes/nodes/median_approx/median.hpp" +#include "merian-nodes/nodes/shadertoy/shadertoy.hpp" #include "merian-nodes/nodes/svgf/svgf.hpp" #include "merian-nodes/nodes/taa/taa.hpp" #include "merian-nodes/nodes/tonemap/tonemap.hpp" #include "merian-nodes/nodes/vkdt_filmcurv/vkdt_filmcurv.hpp" -#include "merian-nodes/nodes/shadertoy/shadertoy.hpp" namespace merian_nodes {