From 34a115706e84196d455a1fb84b0cb55255526031 Mon Sep 17 00:00:00 2001 From: Acaki Date: Mon, 25 Aug 2025 15:18:26 +0800 Subject: [PATCH] Revert "fix: sync imgui fps to stream fps to avoid it interferes with displaylink timings" This reverts commit 5d1bed4d2532ede065ca2278474eac0d0989a8b4. --- VoidLink/ImGuiRenderer.h | 1 - VoidLink/ImGuiRenderer.mm | 7 ++----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/VoidLink/ImGuiRenderer.h b/VoidLink/ImGuiRenderer.h index d65094a5..ac5cc620 100644 --- a/VoidLink/ImGuiRenderer.h +++ b/VoidLink/ImGuiRenderer.h @@ -28,7 +28,6 @@ typedef void (^MetricsHandler)(int plotId, CFTimeInterval value); @property (nonatomic) BOOL enableGraphs; @property (nonatomic) float graphOpacity; @property (nonatomic) BOOL imguiRunning; -@property (nonatomic) int streamFps; @property (nonatomic) MetricsHandler _Nonnull metricsHandler; -(nonnull instancetype) initWithFrame:(CGRect)bounds diff --git a/VoidLink/ImGuiRenderer.mm b/VoidLink/ImGuiRenderer.mm index a8cc0dee..a1eba0a2 100644 --- a/VoidLink/ImGuiRenderer.mm +++ b/VoidLink/ImGuiRenderer.mm @@ -42,9 +42,6 @@ _plots = [ImGuiPlots sharedInstance].plots; - // Store stream FPS to synchronize MTKView - _streamFps = streamFps; - return self; } @@ -93,7 +90,7 @@ self.mtkView.device = self.device; self.mtkView.delegate = self; - self.mtkView.preferredFramesPerSecond = _streamFps; // Synchronize with stream framerate + self.mtkView.preferredFramesPerSecond = 60; // ImGui overlay will always render at this rate self.mtkView.opaque = NO; self.mtkView.enableSetNeedsDisplay = NO; @@ -182,7 +179,7 @@ #if TARGET_OS_SIMULATOR [commandBuffer presentDrawable:view.currentDrawable]; #else - [commandBuffer presentDrawable:view.currentDrawable afterMinimumDuration:1.0 / _streamFps]; + [commandBuffer presentDrawable:view.currentDrawable afterMinimumDuration:1.0 / view.preferredFramesPerSecond]; #endif [commandBuffer commit]; #endif