internal/graphicsdriver/metal: fix the case when screenDrawable is nil

From the specification, screenDrawable can be nil when present is true.
This commit is contained in:
Hajime Hoshi
2025-08-26 19:33:38 +09:00
parent a91cf1518f
commit 84d4fd45ef

View File

@@ -233,12 +233,6 @@ func (g *Graphics) flushIfNeeded(present bool) {
if g.rce != (mtl.RenderCommandEncoder{}) {
panic("metal: render command encoder must be empty if command buffer is empty")
}
if !present {
return
}
if g.screenDrawable != (ca.MetalDrawable{}) {
panic("metal: screen drawable must be empty if command buffer is empty")
}
return
}