From 87fe7bfd9936eb17970275cb56a030aef08a56c1 Mon Sep 17 00:00:00 2001 From: Hajime Hoshi Date: Tue, 2 Jan 2024 23:42:50 +0900 Subject: [PATCH] internal/graphicsdriver/metal: refactoring --- internal/graphicsdriver/metal/view_darwin.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/graphicsdriver/metal/view_darwin.go b/internal/graphicsdriver/metal/view_darwin.go index d72f5b7ef..c4ca4cdd4 100644 --- a/internal/graphicsdriver/metal/view_darwin.go +++ b/internal/graphicsdriver/metal/view_darwin.go @@ -52,9 +52,6 @@ func (v *view) setDisplaySyncEnabled(enabled bool) { func (v *view) forceSetDisplaySyncEnabled(enabled bool) { v.ml.SetDisplaySyncEnabled(enabled) v.vsyncDisabled = !enabled - - // Always use 3. There are some situations that the FPS becomes half, or the FPS becomes too low (#2880). - v.ml.SetMaximumDrawableCount(3) } func (v *view) colorPixelFormat() mtl.PixelFormat { @@ -86,6 +83,9 @@ func (v *view) initialize(device mtl.Device) error { // nextDrawable took more than one second if the window has other controls like NSTextView (#1029). v.ml.SetPresentsWithTransaction(false) + // Always use 3. There are some situations that the FPS becomes half, or the FPS becomes too low (#2880). + v.ml.SetMaximumDrawableCount(3) + return nil }