-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with the GlyphBrush::process_queued
method
#119
Comments
On the first point, you can have your vertex type as an array type. In my experience you get better performance from one vertex per glyph + instance rendering, so the API encourages that. On the second, I imagine the allocation cost of the vertex vec is not significant compared to the cost of layout & draw cache interactions. When there is no text changes (most frames) there also isn't any vertices returned ( |
That only works if you call |
The api is indeed designed for one For example, in Robo Instructus I do use a few instances. The api is trying to push you in a performant direction, keeping in mind the gpu pipeline. It's not perfect, and I am trying to think of better and more flexible API designs, but I think it'll always try to steer toward performance as that is the point of glyph_brush. If you need more control right now, you can opt to use ab_glyph directly (perhaps with glyph_brush_layout & glyph_brush_draw_cache). |
emit_vertex
FnMut closure argument instead of returning it viaBrushAction
.Vec
with vertices. The method could instead take aT: Extend<V>
so the user can reuse a single buffer, or just return vertices with a closure as said above.The text was updated successfully, but these errors were encountered: