fix(render): give degenerate segments area, pin font bit order, clarify vertex_count
This commit is contained in:
1 parent
7cbc1c9955
commit
b4e88fe0c1
5 files changed
+76
-15
No files matched your search
@@ -34,7 +34,11 @@ class LineBatch {
|
||||
|
||||
/// Segments staged so far, one instance each.
|
||||
u32 segment_count() const noexcept { return static_cast<u32>(v_.size() / 4u); }
|
||||
/// Vertices the pipeline will rasterise: two per staged segment.
|
||||
/// Staging vertices, two per staged segment. The pipeline draws one instanced
|
||||
/// quad per segment (its four `GL_TRIANGLE_STRIP` corners come from
|
||||
/// `gl_VertexID`), so the instance count a draw passes is `vertex_count() / 2`
|
||||
/// — handing `vertex_count()` to `glDrawArraysInstanced` would rasterise
|
||||
/// twice the geometry the batch staged.
|
||||
u32 vertex_count() const noexcept { return segment_count() * 2u; }
|
||||
|
||||
/// Interleaved `x0,y0,x1,y1`, four floats per staged segment.
|
||||
|
||||
Reference in new issue
Block a user