forked from mirror/vulkan-zig
Remove type param from cast builtins
This commit is contained in:
@@ -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, ¤t.frame_fence));
|
||||
try self.gc.vkd.resetFences(self.gc.dev, 1, @ptrCast(¤t.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, ¤t.image_acquired),
|
||||
.p_wait_semaphores = @ptrCast(¤t.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, ¤t.render_finished),
|
||||
.p_signal_semaphores = @ptrCast(¤t.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, ¤t.render_finished),
|
||||
.p_wait_semaphores = @as([*]const vk.Semaphore, @ptrCast(¤t.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));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user