From f928fc67fadcf5d8b898e6d9097ab3155d070a07 Mon Sep 17 00:00:00 2001 From: Ronald M Zielaznicki Date: Mon, 21 Oct 2024 00:16:25 -0400 Subject: [PATCH 1/3] fix(core/linux/X11): double free during deinit --- src/core/linux/X11.zig | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/linux/X11.zig b/src/core/linux/X11.zig index b649ef377a..8fe5a7ea09 100644 --- a/src/core/linux/X11.zig +++ b/src/core/linux/X11.zig @@ -243,7 +243,6 @@ pub fn deinit( x11: *X11, linux: *Linux, ) void { - x11.allocator.destroy(x11.surface_descriptor); linux.allocator.destroy(x11.surface_descriptor); for (x11.cursors) |cur| { if (cur) |_| { From 3723460da473793ceec8fc506505f99b6b3da608 Mon Sep 17 00:00:00 2001 From: Ronald M Zielaznicki Date: Mon, 21 Oct 2024 00:17:14 -0400 Subject: [PATCH 2/3] change(core/linux): FailedToConnectToDisplay message to include display's name --- src/core/Linux.zig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/Linux.zig b/src/core/Linux.zig index 60b56116ed..2f9e6182a5 100644 --- a/src/core/Linux.zig +++ b/src/core/Linux.zig @@ -91,7 +91,7 @@ pub fn init( const x11 = X11.init(linux, core, options) catch |err| { const err_msg = switch (err) { error.LibraryNotFound => "Missing X11 library", - error.FailedToConnectToDisplay => "Failed to connect to display", + error.FailedToConnectToDisplay => "Failed to connect to X11 display", else => "An unknown error occured while trying to connect to X11", }; log.err("{s}\nFalling back to Wayland\n", .{err_msg}); @@ -104,7 +104,7 @@ pub fn init( const wayland = Wayland.init(linux, core, options) catch |err| { const err_msg = switch (err) { error.LibraryNotFound => "Missing Wayland library", - error.FailedToConnectToDisplay => "Failed to connect to display", + error.FailedToConnectToDisplay => "Failed to connect to Wayland display", else => "An unknown error occured while trying to connect to Wayland", }; log.err("{s}\nFalling back to X11\n", .{err_msg}); From 34a1929c7260186de4c23ff33d6fc660ff4b2688 Mon Sep 17 00:00:00 2001 From: Ronald M Zielaznicki Date: Mon, 21 Oct 2024 00:18:09 -0400 Subject: [PATCH 3/3] add(Core.zig): call to deviceTick after platform update --- src/Core.zig | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Core.zig b/src/Core.zig index bb8b549fc7..6c72cc37ce 100644 --- a/src/Core.zig +++ b/src/Core.zig @@ -611,6 +611,7 @@ fn presentFrame(core: *Mod, entities: *mach.Entities.Mod) !void { if (num_windows > 1) @panic("mach: Core currently only supports a single window"); _ = try state.platform.update(); + mach.sysgpu.Impl.deviceTick(state.device); state.swap_chain.present(); // Update swapchain for the next frame