Skip to content

Performance Enhancement: Font rendering in a single drawcall#2791

Merged
KABoissonneault merged 1 commit into
Interkarma:masterfrom
Vwing:text-single-drawcall
Jun 13, 2026
Merged

Performance Enhancement: Font rendering in a single drawcall#2791
KABoissonneault merged 1 commit into
Interkarma:masterfrom
Vwing:text-single-drawcall

Conversation

@Vwing

@Vwing Vwing commented May 24, 2026

Copy link
Copy Markdown
Contributor

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

Vwing commented May 24, 2026

Copy link
Copy Markdown
Contributor Author

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.

@Daneel53

Copy link
Copy Markdown
Collaborator

Seems good to have a try, will push it into the next 1.2 Test3.

@Daneel53 Daneel53 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested into Test3 and books are displayed without issue.

@KABoissonneault KABoissonneault merged commit 82feccc into Interkarma:master Jun 13, 2026
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.

3 participants