internal/graphicsdriver/metal: refactoring

This commit is contained in:
Hajime Hoshi 2024-01-02 23:42:50 +09:00
parent fd63820139
commit 87fe7bfd99

View File

@ -52,9 +52,6 @@ func (v *view) setDisplaySyncEnabled(enabled bool) {
func (v *view) forceSetDisplaySyncEnabled(enabled bool) { func (v *view) forceSetDisplaySyncEnabled(enabled bool) {
v.ml.SetDisplaySyncEnabled(enabled) v.ml.SetDisplaySyncEnabled(enabled)
v.vsyncDisabled = !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 { 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). // nextDrawable took more than one second if the window has other controls like NSTextView (#1029).
v.ml.SetPresentsWithTransaction(false) 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 return nil
} }