mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
internal/graphicsdriver/metal: bug fix: use 3 for drawable count when vsync is off
Updates #2822
This commit is contained in:
parent
80301eb29e
commit
d91f328083
@ -52,6 +52,14 @@ func (v *view) setDisplaySyncEnabled(enabled bool) {
|
||||
func (v *view) forceSetDisplaySyncEnabled(enabled bool) {
|
||||
v.ml.SetDisplaySyncEnabled(enabled)
|
||||
v.vsyncDisabled = !enabled
|
||||
|
||||
if v.vsyncDisabled {
|
||||
// Apparently 2 makes FPS half. Use 3.
|
||||
v.ml.SetMaximumDrawableCount(3)
|
||||
} else {
|
||||
// Use 2 in usual case not to cause rendering delays (#2822).
|
||||
v.ml.SetMaximumDrawableCount(2)
|
||||
}
|
||||
}
|
||||
|
||||
func (v *view) colorPixelFormat() mtl.PixelFormat {
|
||||
@ -82,7 +90,6 @@ func (v *view) initialize(device mtl.Device) error {
|
||||
// presentsWithTransaction doesn't work with vsync off (#1196).
|
||||
// nextDrawable took more than one second if the window has other controls like NSTextView (#1029).
|
||||
v.ml.SetPresentsWithTransaction(false)
|
||||
v.ml.SetMaximumDrawableCount(2)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user