mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-09-26 20:11:28 +08:00
internal/graphicsdriver/metal: do not call PresentDrawable when CommandBuffer is empty
Before this fix, PresentDrawable could be invoked even when the CommandBuffer was empty. This might cause the flickering issue #3278. This is an experimental (but seemingly valid) fix. Updates #3278
This commit is contained in:
@@ -229,7 +229,10 @@ func (g *Graphics) SetVertices(vertices []float32, indices []uint32) error {
|
||||
}
|
||||
|
||||
func (g *Graphics) flushIfNeeded(present bool) {
|
||||
if g.cb == (mtl.CommandBuffer{}) && !present {
|
||||
if g.cb == (mtl.CommandBuffer{}) {
|
||||
if g.rce != (mtl.RenderCommandEncoder{}) {
|
||||
panic("metal: command buffer is empty but render command encoder is not empty")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user