mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-12 22:17:26 +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)).
|
||||||
|
if g.screenDrawable == (ca.MetalDrawable{}) {
|
||||||
g.screenDrawable = g.view.nextDrawable()
|
g.screenDrawable = g.view.nextDrawable()
|
||||||
}
|
}
|
||||||
|
if g.screenDrawable != (ca.MetalDrawable{}) {
|
||||||
if present && g.screenDrawable != (ca.MetalDrawable{}) {
|
|
||||||
g.cb.PresentDrawable(g.screenDrawable)
|
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