mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-09-26 20:11:28 +08:00
internal/graphicsdriver/metal: add assertions
This commit is contained in:
@@ -231,7 +231,10 @@ func (g *Graphics) SetVertices(vertices []float32, indices []uint32) error {
|
||||
func (g *Graphics) flushIfNeeded(present bool) {
|
||||
if g.cb == (mtl.CommandBuffer{}) {
|
||||
if g.rce != (mtl.RenderCommandEncoder{}) {
|
||||
panic("metal: command buffer is empty but render command encoder is not empty")
|
||||
panic("metal: render command encoder must be empty if command buffer is empty")
|
||||
}
|
||||
if present && g.screenDrawable != (ca.MetalDrawable{}) {
|
||||
panic("metal: screen drawable must be empty if command buffer is empty")
|
||||
}
|
||||
return
|
||||
}
|
||||
|
Reference in New Issue
Block a user