From 12f01086735d1ea978a891d7d1d1527911233557 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 22 Jul 2024 15:32:58 -0700 Subject: [PATCH] renderer/metal: fix custom shader animations with display link --- src/renderer/Metal.zig | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/renderer/Metal.zig b/src/renderer/Metal.zig index e459d36ab..d6c2514cc 100644 --- a/src/renderer/Metal.zig +++ b/src/renderer/Metal.zig @@ -1039,10 +1039,11 @@ pub fn updateFrame( pub fn drawFrame(self: *Metal, surface: *apprt.Surface) !void { _ = surface; - // If our cells are not rebuilt, do a no-op draw. This means - // that no possible new data can exist that would warrant a full - // GPU update, our existing drawable is valid. - if (!self.cells_rebuilt) return; + // If we have no cells rebuilt we can usually skip drawing since there + // is no changed data. However, if we have active animations we still + // need to draw so that we can update the time uniform and render the + // changes. + if (!self.cells_rebuilt and !self.hasAnimations()) return; self.cells_rebuilt = false; // Wait for a frame to be available.