forked from vv/efemra
1
0
Fork 0

minor tweaks from looking at pim

This commit is contained in:
Vivianne 2022-06-30 21:58:07 -07:00
parent 6d975868f5
commit b2e5cc1769
1 changed files with 6 additions and 4 deletions

View File

@ -50,18 +50,18 @@ pub const Swapchain = struct {
const handle = try gc.vkd.createSwapchainKHR(gc.dev, &.{
.flags = .{},
.surface = gc.surface,
.present_mode = present_mode,
.min_image_count = image_count,
.image_format = surface_format.format,
.image_color_space = surface_format.color_space,
.image_extent = actual_extent,
.image_array_layers = 1,
.image_usage = .{ .color_attachment_bit = true, .transfer_dst_bit = true },
.image_usage = .{ .color_attachment_bit = true },
.image_sharing_mode = sharing_mode,
.queue_family_index_count = qfi.len,
.queue_family_index_count = if (sharing_mode == .concurrent) qfi.len else 0,
.p_queue_family_indices = &qfi,
.pre_transform = caps.current_transform,
.composite_alpha = .{ .opaque_bit_khr = true },
.present_mode = present_mode,
.clipped = vk.TRUE,
.old_swapchain = old_handle,
}, null);
@ -88,12 +88,12 @@ pub const Swapchain = struct {
std.mem.swap(vk.Semaphore, &swap_images[result.image_index].image_acquired, &next_image_acquired);
return Swapchain{
.handle = handle,
.gc = gc,
.allocator = allocator,
.surface_format = surface_format,
.present_mode = present_mode,
.extent = actual_extent,
.handle = handle,
.swap_images = swap_images,
.image_index = result.image_index,
.next_image_acquired = next_image_acquired,
@ -304,6 +304,8 @@ fn findPresentMode(gc: *const GraphicsContext, allocator: Allocator) !vk.Present
const preferred = [_]vk.PresentModeKHR{
.mailbox_khr,
.immediate_khr,
.fifo_relaxed_khr,
.fifo_khr,
};
for (preferred) |mode| {