bgfx: NanoVG broken when filling large number of vertices
In my app I need to draw complex polygons with lots of nvgLineTo(), and it may require more than 200 thousands vertices (gl->nverts) in the vertex buffer in nvgRenderFlush(). However, the rendered results looks as expected when using the original NanoVG but the same code will render a broken result when switching the backend to bgfx. This only happens when using nvgFill() with lots of nvgLineTo(). Are there limits of transient vertex buffer in bgfx?
PS. Nothing is wrong when using nvgStroke() with the same complex polygon. Only nvgFill() breaks.
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (18 by maintainers)
Commits related to this issue
- Fixes #1671 and Fixes #1139. Flush the nanovg draw commands whenever the next draw would overflow the uint16_t index type. — committed to mcourteaux/bgfx by mcourteaux 7 months ago
- Fixes #1671 and Fixes #1139. Flush the nanovg draw commands whenever the next draw would overflow the uint16_t index type. (#3207) — committed to jay3d/bgfx by mcourteaux 7 months ago
- Fixes #1671 and Fixes #1139. Flush the nanovg draw commands whenever the next draw would overflow the uint16_t index type. (#3207) — committed to junjie020/bgfx by mcourteaux 7 months ago
- Fixes #1671 and Fixes #1139. Flush the nanovg draw commands whenever the next draw would overflow the uint16_t index type. (#3207) — committed to mipek/bgfx by mcourteaux 7 months ago
Found the solution. This line should also change to
MTLPixelFormatDepth32Float_Stencil8https://github.com/bkaradzic/bgfx/blob/master/src/renderer_mtl.mm#L584 Now the pixel format is consistent inRendererContextMtl::submit()for iOS.Too bad this still doesn’t fix the broken
nvgFill()issue. 😦