Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call sysgpu device tick #1289

Merged
merged 3 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Core.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than putting the tick in every device update, I thought it better to put it somewhere more general.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems reasonable for now

state.swap_chain.present();

// Update swapchain for the next frame
Expand Down
4 changes: 2 additions & 2 deletions src/core/Linux.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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});
Expand All @@ -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});
Expand Down
1 change: 0 additions & 1 deletion src/core/linux/X11.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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) |_| {
Expand Down
Loading