forked from mirror/vulkan-zig
Add workaround for incorrect StdVideoH265HrdParameters encoding
See https://github.com/KhronosGroup/Vulkan-Docs/issues/2557
This commit is contained in:
@@ -110,7 +110,12 @@ pub fn main() !void {
|
||||
|
||||
var out_buffer = std.ArrayList(u8).init(allocator);
|
||||
var w = out_buffer.writer().adaptToNewApi();
|
||||
generator.generate(allocator, api, xml_src, maybe_video_xml_src, &w.new_interface) catch |err| switch (err) {
|
||||
generator.generate(allocator, api, xml_src, maybe_video_xml_src, &w.new_interface) catch |err| {
|
||||
if (debug) {
|
||||
return err;
|
||||
}
|
||||
|
||||
switch (err) {
|
||||
error.InvalidXml => {
|
||||
std.log.err("invalid vulkan registry - invalid xml", .{});
|
||||
std.log.err("please check that the correct vk.xml file is passed", .{});
|
||||
@@ -128,6 +133,7 @@ pub fn main() !void {
|
||||
std.process.exit(1);
|
||||
},
|
||||
error.OutOfMemory, error.WriteFailed => @panic("oom"),
|
||||
}
|
||||
};
|
||||
|
||||
out_buffer.append(0) catch @panic("oom");
|
||||
|
||||
@@ -365,10 +365,18 @@ fn parsePointerMeta(fields: Fields, type_info: *registry.TypeInfo, elem: *xml.El
|
||||
else => break,
|
||||
};
|
||||
|
||||
if (it.next()) |_| {
|
||||
if (it.next()) |_| ignore: {
|
||||
// There are more elements in the `len` attribute than there are pointers
|
||||
// Something probably went wrong
|
||||
std.log.err("len: {s}", .{lens});
|
||||
switch (current_type_info.*) {
|
||||
.name => |name| if (std.mem.eql(u8, name, "StdVideoH265SubLayerHrdParameters")) {
|
||||
// Known issue: https://github.com/KhronosGroup/Vulkan-Docs/issues/2557
|
||||
break :ignore;
|
||||
},
|
||||
else => {},
|
||||
}
|
||||
|
||||
std.log.err("excessive pointer lengths: {s}", .{lens});
|
||||
return error.InvalidRegistry;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user