Skip to content

Commit

Permalink
Merge pull request #147 from flut2/master
Browse files Browse the repository at this point in the history
Log command name when loading fails
  • Loading branch information
Snektron authored Jul 6, 2024
2 parents 51c5566 + 982178e commit 66b7b77
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 @@ -1484,8 +1484,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 66b7b77

Please sign in to comment.