From d9c1c792231cfc8ff97221ef5003c49e7bccb6f5 Mon Sep 17 00:00:00 2001 From: InKryption <59504965+InKryption@users.noreply.github.com> Date: Fri, 5 Nov 2021 17:45:15 +0000 Subject: [PATCH 1/2] Replace `anytype` with explicit `[]const {s}Command` --- generator/vulkan/render.zig | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/generator/vulkan/render.zig b/generator/vulkan/render.zig index 9596d25..51ebfb1 100644 --- a/generator/vulkan/render.zig +++ b/generator/vulkan/render.zig @@ -1015,10 +1015,9 @@ fn Renderer(comptime WriterType: type) type { }; try self.writer.print( - \\pub fn {s}Wrapper(comptime cmds: anytype) type {{ - \\ const cmd_array: [cmds.len]{s}Command = cmds; + \\pub fn {s}Wrapper(comptime cmds: []const {s}Command) type {{ \\ comptime var fields: [cmds.len]std.builtin.TypeInfo.StructField = undefined; - \\ inline for (cmd_array) |cmd, i| {{ + \\ inline for (cmds) |cmd, i| {{ \\ const PfnType = cmd.PfnType(); \\ fields[i] = .{{ \\ .name = cmd.symbol(), From 087cd024134c66fd2f8f35e1497e2f76f9919a6c Mon Sep 17 00:00:00 2001 From: InKryption <59504965+InKryption@users.noreply.github.com> Date: Fri, 5 Nov 2021 18:06:20 +0000 Subject: [PATCH 2/2] Update graphics_context.zig --- examples/graphics_context.zig | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/graphics_context.zig b/examples/graphics_context.zig index 51f14ce..72749ac 100644 --- a/examples/graphics_context.zig +++ b/examples/graphics_context.zig @@ -5,11 +5,11 @@ const Allocator = std.mem.Allocator; const required_device_extensions = [_][]const u8{vk.extension_info.khr_swapchain.name}; -const BaseDispatch = vk.BaseWrapper(.{ +const BaseDispatch = vk.BaseWrapper(&.{ .createInstance, }); -const InstanceDispatch = vk.InstanceWrapper(.{ +const InstanceDispatch = vk.InstanceWrapper(&.{ .destroyInstance, .createDevice, .destroySurfaceKHR, @@ -25,7 +25,7 @@ const InstanceDispatch = vk.InstanceWrapper(.{ .getDeviceProcAddr, }); -const DeviceDispatch = vk.DeviceWrapper(.{ +const DeviceDispatch = vk.DeviceWrapper(&.{ .destroyDevice, .getDeviceQueue, .createSemaphore,