Skip to content

Performance Enhancement: Font rendering in a single drawcall#2791

Open
Vwing wants to merge 1 commit into
Interkarma:masterfrom
Vwing:text-single-drawcall
Open

Performance Enhancement: Font rendering in a single drawcall#2791
Vwing wants to merge 1 commit into
Interkarma:masterfrom
Vwing:text-single-drawcall

Conversation

@Vwing
Copy link
Copy Markdown

@Vwing Vwing commented May 24, 2026

Both SDF and classic fonts were being rendered a single character at a time, causing potentially tens of thousands of draw calls in a single frame. I've reduced it down to a single draw call per text item.

Before (18k draw calls and 30 fps):
image

After (500 draw calls and 60 fps):
image

The old multi-call path is still present and called if and when an error ever occurs in the new path.

@Vwing
Copy link
Copy Markdown
Author

Vwing commented May 24, 2026

Note the drawcalls could be reduced further in books by batching lines together, and I believe I'm doing that in the Android fork, but it might cause some appearance differences. Will examine later, but it's a lower priority; I think this PR is fine without that addition.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant