Skip to content
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

Add MultiRect command #70415

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lawnjelly
Copy link
Member

@lawnjelly lawnjelly commented Dec 21, 2022

Large groups of similar rects can be processed more efficiently using the MultiRect command. Processing common to the group can be done as a one off, instead of per rect.

Adds the new API to RendererCanvasRender, and uses the new functionality from Label, via the RendererCanvasHelper class.

Very modified port of #68960 for Godot 4.x.

Notes

  • This is very much a WIP, but should be enough for @clayjohn to have a look at adding OpenGL (and possibly vulkan) backend.
  • It's only implemented for Label so far but should be enough to test.
  • The font side and the backend will be completely different to 3.x, especially as the fonts are handled through a text server in master.

Large groups of similar rects can be processed more efficiently using the MultiRect command. Processing common to the group can be done as a one off, instead of per rect.

Adds the new API to RendererCanvasRender, and uses the new functionality from Label, via the RendererCanvasHelper class.
@Squiddu
Copy link

Squiddu commented Jul 26, 2024

I find it somewhat odd how this PR, which to my knowledge would introduce 2D batching of sorts into Godot 4 which is a major sticking point for some devs, has been put on hold for so long

@clayjohn
Copy link
Member

clayjohn commented Jul 26, 2024

I find it somewhat odd how this PR, which to my knowledge would introduce 2D batching of sorts into Godot 4 which is a major sticking point for some devs, has been put on hold for so long

Is the current batching implementation not fast enough for your project? This feature should help some games, but the actual performance benefit will vary and it still needs testing.

In particular this may help for games that heavily use text and are CPU-bottlenecked by processing draw commands.

It hasn't been prioritized because there are few contributors interested in doing the work and no one has complained about the current performance levels.

I should add, just in case you aren't familiar with our development, batching has been implemented in the compatibility backend since before 4.0, while for the RD backend it is coming in 4.4

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

Successfully merging this pull request may close these issues.

4 participants