Adapt to latest Zig master

See ziglang/zig/pull/10055
This commit is contained in:
Robin Voetter
2021-12-01 05:05:34 +01:00
parent e634a4b434
commit 797ae8af88
10 changed files with 78 additions and 76 deletions

View File

@@ -224,7 +224,7 @@ fn copyBuffer(gc: *const GraphicsContext, pool: vk.CommandPool, dst: vk.Buffer,
fn createCommandBuffers(
gc: *const GraphicsContext,
pool: vk.CommandPool,
allocator: *Allocator,
allocator: Allocator,
buffer: vk.Buffer,
extent: vk.Extent2D,
render_pass: vk.RenderPass,
@@ -291,12 +291,12 @@ fn createCommandBuffers(
return cmdbufs;
}
fn destroyCommandBuffers(gc: *const GraphicsContext, pool: vk.CommandPool, allocator: *Allocator, cmdbufs: []vk.CommandBuffer) void {
fn destroyCommandBuffers(gc: *const GraphicsContext, pool: vk.CommandPool, allocator: Allocator, cmdbufs: []vk.CommandBuffer) void {
gc.vkd.freeCommandBuffers(gc.dev, pool, @truncate(u32, cmdbufs.len), cmdbufs.ptr);
allocator.free(cmdbufs);
}
fn createFramebuffers(gc: *const GraphicsContext, allocator: *Allocator, render_pass: vk.RenderPass, swapchain: Swapchain) ![]vk.Framebuffer {
fn createFramebuffers(gc: *const GraphicsContext, allocator: Allocator, render_pass: vk.RenderPass, swapchain: Swapchain) ![]vk.Framebuffer {
const framebuffers = try allocator.alloc(vk.Framebuffer, swapchain.swap_images.len);
errdefer allocator.free(framebuffers);
@@ -319,7 +319,7 @@ fn createFramebuffers(gc: *const GraphicsContext, allocator: *Allocator, render_
return framebuffers;
}
fn destroyFramebuffers(gc: *const GraphicsContext, allocator: *Allocator, framebuffers: []const vk.Framebuffer) void {
fn destroyFramebuffers(gc: *const GraphicsContext, allocator: Allocator, framebuffers: []const vk.Framebuffer) void {
for (framebuffers) |fb| gc.vkd.destroyFramebuffer(gc.dev, fb, null);
allocator.free(framebuffers);
}