Implement initial suggestions on PR

This commit is contained in:
bluesillybeard
2024-04-26 20:42:44 -06:00
parent 500d7cc3e8
commit d4a04e0bea

View File

@@ -1063,29 +1063,12 @@ fn Renderer(comptime WriterType: type) type {
const class = classifyCommandDispatch(command_name, command); const class = classifyCommandDispatch(command_name, command);
switch (class) { switch (class) {
// Vulkan extensions cannot add base functions. // Vulkan extensions cannot add base functions.
.base => continue, .base => return error.InvalidRegistry,
// TODO: some extensions have multiple separate requirements.
// For example, "VK_KHR_push_descriptor" depends on either "VK_VERSION_1_1" or "VK_KHR_descriptor_update_template",
// which causes the same function to be mentioned twice; once for each requirement.
// For now, duplicate functions are just removed,
// However in the future it might be worth exposing these separate requirements somehow.
.instance => { .instance => {
var duplicate = false; try instance_commands.append(command_name);
for(instance_commands.items) |cmd| {
if(std.mem.eql(u8, cmd, command_name)) {
duplicate = true;
}
}
if(!duplicate) try instance_commands.append(command_name);
}, },
.device => { .device => {
var duplicate = false; try device_commands.append(command_name);
for(device_commands.items) |cmd| {
if(std.mem.eql(u8, cmd, command_name)) {
duplicate = true;
}
}
if(!duplicate) try device_commands.append(command_name);
}, },
} }
} }