Skip to content

Commit

Permalink
log command name when loading fails
Browse files Browse the repository at this point in the history
  • Loading branch information
flut2 committed Jun 24, 2024
1 parent ff4cff5 commit 0623579
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/vulkan/render.zig
Original file line number Diff line number Diff line change
Expand Up @@ -1435,8 +1435,12 @@ fn Renderer(comptime WriterType: type) type {
\\ var self: Self = undefined;
\\ inline for (std.meta.fields(Dispatch)) |field| {{
\\ const name: [*:0]const u8 = @ptrCast(field.name ++ "\x00");
\\ const cmd_ptr = loader({[first_arg]s}, name) orelse return error.CommandLoadFailure;
\\ @field(self.dispatch, field.name) = @ptrCast(cmd_ptr);
\\ if (loader({[first_arg]s}, name)) |cmd_ptr| {{
\\ @field(self.dispatch, field.name) = @ptrCast(cmd_ptr);
\\ }} else {{
\\ std.log.err("Command loading failed for \"{{s}}\".", .{{field.name}});
\\ return error.CommandLoadFailure;
\\ }}
\\ }}
\\ return self;
\\}}
Expand Down

0 comments on commit 0623579

Please sign in to comment.