forked from mirror/vulkan-zig
generate wrapper for command aliases
Instead of generating a Zig alias for aliased commands, actual wrappers are now generated. This should make sure that extension commands, such as vkCmdBeginRenderingKHR, can still be used on older Vulkan implementations.
This commit is contained in:
@@ -1210,17 +1210,11 @@ fn Renderer(comptime WriterType: type) type {
|
||||
if (classifyCommandDispatch(decl.name, command) != dispatch_type) {
|
||||
continue;
|
||||
}
|
||||
switch (decl.decl_type) {
|
||||
.command => try self.renderWrapper(decl.name, decl.decl_type.command),
|
||||
.alias => |alias| {
|
||||
try self.writer.writeAll("pub const ");
|
||||
try self.writeIdentifierWithCase(.camel, trimVkNamespace(decl.name));
|
||||
try self.writer.writeAll(" = ");
|
||||
try self.writeIdentifierWithCase(.camel, trimVkNamespace(alias.name));
|
||||
try self.writer.writeAll(";\n");
|
||||
},
|
||||
else => unreachable,
|
||||
}
|
||||
// Note: If this decl is an alias, generate a full wrapper instead of simply an
|
||||
// alias like `const old = new;`. This ensures that Vulkan bindings generated
|
||||
// for newer versions of vulkan can still invoke extension behavior on older
|
||||
// implementations.
|
||||
try self.renderWrapper(decl.name, command);
|
||||
}
|
||||
|
||||
try self.writer.writeAll("};}\n");
|
||||
|
||||
Reference in New Issue
Block a user