forked from mirror/vulkan-zig
render error sets for all functions returning VkResult
> VK_ERROR_UNKNOWN will be returned by an implementation when an unexpected > error occurs that cannot be attributed to valid behavior of the application > and implementation. Under these conditions, it may be returned from any > command returning a VkResult. Fixes #42
This commit is contained in:
@@ -1130,7 +1130,8 @@ fn Renderer(comptime WriterType: type) type {
|
||||
|
||||
try self.writer.writeAll(") ");
|
||||
|
||||
if (command.error_codes.len > 0) {
|
||||
const returns_vk_result = command.return_type.* == .name and mem.eql(u8, command.return_type.name, "VkResult");
|
||||
if (returns_vk_result) {
|
||||
try self.renderErrorSetName(name);
|
||||
try self.writer.writeByte('!');
|
||||
}
|
||||
@@ -1245,7 +1246,7 @@ fn Renderer(comptime WriterType: type) type {
|
||||
try self.renderReturnStruct(name, returns);
|
||||
}
|
||||
|
||||
if (command.error_codes.len > 0) {
|
||||
if (returns_vk_result) {
|
||||
try self.writer.writeAll("pub const ");
|
||||
try self.renderErrorSetName(name);
|
||||
try self.writer.writeAll(" = ");
|
||||
|
||||
Reference in New Issue
Block a user