mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-25 03:08:54 +01:00
internal/ui: disable the optimization to skip rendering offscreen
This caused some issues in various environments. Until we find a good solution, let's disable this. Updates #2341 Updates #2342 Closes #2518
This commit is contained in:
parent
4d270de75e
commit
a049acd94e
@ -198,8 +198,9 @@ func (c *context) drawGame(graphicsDriver graphicsdriver.Graphics, forceDraw boo
|
|||||||
c.skipCount = 0
|
c.skipCount = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the offscreen is not updated and the framebuffers don't have to be updated, skip rendering to save GPU power.
|
// TODO: If the offscreen is not updated and the framebuffers don't have to be updated, skip rendering to save GPU power
|
||||||
if c.skipCount < maxSkipCount {
|
// (#2341, #2342). The condition would be `c.skipCount < maxSkipCount`.
|
||||||
|
// However, Metal (and maybe DirectX) cannot vsync without swapping the buffer by rendering the screen framebuffer (#2520).
|
||||||
if graphicsDriver.NeedsClearingScreen() {
|
if graphicsDriver.NeedsClearingScreen() {
|
||||||
// This clear is needed for fullscreen mode or some mobile platforms (#622).
|
// This clear is needed for fullscreen mode or some mobile platforms (#622).
|
||||||
c.screen.clear()
|
c.screen.clear()
|
||||||
@ -210,7 +211,6 @@ func (c *context) drawGame(graphicsDriver graphicsdriver.Graphics, forceDraw boo
|
|||||||
// The final screen is never used as the rendering source.
|
// The final screen is never used as the rendering source.
|
||||||
// Flush its buffer here just in case.
|
// Flush its buffer here just in case.
|
||||||
c.screen.flushBufferIfNeeded()
|
c.screen.flushBufferIfNeeded()
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user