Remove type param from cast builtins

This commit is contained in:
antlilja
2023-06-27 13:09:34 +02:00
parent 4f15927ba2
commit 6c9133bc24
3 changed files with 43 additions and 43 deletions

View File

@@ -150,27 +150,27 @@ pub const Swapchain = struct {
// Step 1: Make sure the current frame has finished rendering
const current = self.currentSwapImage();
try current.waitForFence(self.gc);
try self.gc.vkd.resetFences(self.gc.dev, 1, @ptrCast([*]const vk.Fence, &current.frame_fence));
try self.gc.vkd.resetFences(self.gc.dev, 1, @ptrCast(&current.frame_fence));
// Step 2: Submit the command buffer
const wait_stage = [_]vk.PipelineStageFlags{.{ .top_of_pipe_bit = true }};
try self.gc.vkd.queueSubmit(self.gc.graphics_queue.handle, 1, &[_]vk.SubmitInfo{.{
.wait_semaphore_count = 1,
.p_wait_semaphores = @ptrCast([*]const vk.Semaphore, &current.image_acquired),
.p_wait_semaphores = @ptrCast(&current.image_acquired),
.p_wait_dst_stage_mask = &wait_stage,
.command_buffer_count = 1,
.p_command_buffers = @ptrCast([*]const vk.CommandBuffer, &cmdbuf),
.p_command_buffers = @ptrCast(&cmdbuf),
.signal_semaphore_count = 1,
.p_signal_semaphores = @ptrCast([*]const vk.Semaphore, &current.render_finished),
.p_signal_semaphores = @ptrCast(&current.render_finished),
}}, current.frame_fence);
// Step 3: Present the current frame
_ = try self.gc.vkd.queuePresentKHR(self.gc.present_queue.handle, &.{
.wait_semaphore_count = 1,
.p_wait_semaphores = @ptrCast([*]const vk.Semaphore, &current.render_finished),
.p_wait_semaphores = @as([*]const vk.Semaphore, @ptrCast(&current.render_finished)),
.swapchain_count = 1,
.p_swapchains = @ptrCast([*]const vk.SwapchainKHR, &self.handle),
.p_image_indices = @ptrCast([*]const u32, &self.image_index),
.p_swapchains = @as([*]const vk.SwapchainKHR, @ptrCast(&self.handle)),
.p_image_indices = @as([*]const u32, @ptrCast(&self.image_index)),
});
// Step 4: Acquire next frame
@@ -243,7 +243,7 @@ const SwapImage = struct {
}
fn waitForFence(self: SwapImage, gc: *const GraphicsContext) !void {
_ = try gc.vkd.waitForFences(gc.dev, 1, @ptrCast([*]const vk.Fence, &self.frame_fence), vk.TRUE, std.math.maxInt(u64));
_ = try gc.vkd.waitForFences(gc.dev, 1, @ptrCast(&self.frame_fence), vk.TRUE, std.math.maxInt(u64));
}
};