Bmesh editing "GPU_indexbuf_add_tri_verts segfault" error

I’m getting strange GPU_indexbuf_add_tri_verts error after editing mesh using bmesh.
From debug log i can see that mesh topology is not the issue - but changing polygon material indexes could be.

assert(builder->prim_type == GPU_PRIM_TRIS)

Should i flag the mesh as invalid by hand (an how?) or call any other update / tag function ?