Merge pull request #25 from InKryption/patch-1

Replace `anytype` with explicit `[]const {s}Command`
This commit is contained in:
Robin Voetter
2021-11-05 19:10:11 +01:00
committed by GitHub
2 changed files with 5 additions and 6 deletions

View File

@@ -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,

View File

@@ -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(),