mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 18:58:54 +01:00
internal/graphicsdriver/metal: refactoring
This commit is contained in:
parent
5e17791e4e
commit
8d020ad414
@ -204,14 +204,16 @@ func (g *Graphics) flushIfNeeded(present bool) {
|
|||||||
}
|
}
|
||||||
g.flushRenderCommandEncoderIfNeeded()
|
g.flushRenderCommandEncoderIfNeeded()
|
||||||
|
|
||||||
// This logic is necessary when skipping clearing the framebuffer.
|
if present {
|
||||||
if present && g.screenDrawable == (ca.MetalDrawable{}) {
|
// This check is necessary when skipping to render the screen (SetScreenClearedEveryFrame(false)).
|
||||||
g.screenDrawable = g.view.nextDrawable()
|
if g.screenDrawable == (ca.MetalDrawable{}) {
|
||||||
|
g.screenDrawable = g.view.nextDrawable()
|
||||||
|
}
|
||||||
|
if g.screenDrawable != (ca.MetalDrawable{}) {
|
||||||
|
g.cb.PresentDrawable(g.screenDrawable)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if present && g.screenDrawable != (ca.MetalDrawable{}) {
|
|
||||||
g.cb.PresentDrawable(g.screenDrawable)
|
|
||||||
}
|
|
||||||
g.cb.Commit()
|
g.cb.Commit()
|
||||||
|
|
||||||
for _, t := range g.tmpTextures {
|
for _, t := range g.tmpTextures {
|
||||||
|
Loading…
Reference in New Issue
Block a user