Skip to content

Commit

Permalink
fix: Print closure missing error message at compile time instead of r…
Browse files Browse the repository at this point in the history
…un time. (#1781)

Prevent complications on the GPU by printing error messages at compile time instead of generating code to print them at runtime when a closure doesn't exist.

---------

Signed-off-by: Stephen Friedman <[email protected]>
  • Loading branch information
sfriedmapixar authored and lgritz committed Apr 1, 2024
1 parent e9a78a2 commit b86f0b9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/liboslexec/llvm_gen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3830,11 +3830,11 @@ LLVMGEN(llvm_gen_closure)
const ClosureRegistry::ClosureEntry* clentry
= rop.shadingsys().find_closure(closure_name);
if (!clentry) {
rop.llvm_gen_error(fmtformat(
rop.shadingcontext()->errorfmt(
"Closure '{}' is not supported by the current renderer, called from {}:{} in shader \"{}\", layer {} \"{}\", group \"{}\"",
closure_name, op.sourcefile(), op.sourceline(),
rop.inst()->shadername(), rop.layer(), rop.inst()->layername(),
rop.group().name()));
rop.group().name());
return false;
}

Expand Down

0 comments on commit b86f0b9

Please sign in to comment.