Skip to content

Commit

Permalink
merian/merian-nodes: Fix compilation_failed not handled correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
LDAP committed Nov 21, 2024
1 parent ff3b910 commit 3bd6376
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions include/merian-nodes/graph/graph.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1386,9 +1386,9 @@ class Graph : public std::enable_shared_from_this<Graph<ITERATIONS_IN_FLIGHT>> {
try {
data.input_connectors = node->describe_inputs();
} catch (const graph_errors::node_error& e) {
data.errors.emplace_back(fmt::format("node error: ", 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()));
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)) {
Expand Down Expand Up @@ -1472,9 +1472,9 @@ class Graph : public std::enable_shared_from_this<Graph<ITERATIONS_IN_FLIGHT>> {
register_event_listener_for_connect(event_pattern, listener);
}));
} catch (const graph_errors::node_error& e) {
data.errors.emplace_back(fmt::format("node error: ", 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()));
data.errors.emplace_back(fmt::format("compilation failed: {}", e.what()));
}

for (const auto& output : data.output_connectors) {
Expand Down
3 changes: 3 additions & 0 deletions src/merian/vk/shader/shader_compiler_shaderc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ std::vector<uint32_t> ShadercCompiler::compile_glsl(const std::string& source,
const auto binary_result = shader_compiler.CompileGlslToSpv(
preprocess_result.begin(), preprocess_result.end() - preprocess_result.begin(), kind,
source_name.data(), compile_options);
if (binary_result.GetCompilationStatus() != shaderc_compilation_status_success) {
throw ShaderCompiler::compilation_failed{binary_result.GetErrorMessage()};
}

return std::vector<uint32_t>(binary_result.begin(), binary_result.end());
}
Expand Down

0 comments on commit 3bd6376

Please sign in to comment.