-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Fix GLES2 rendering performance #20077
Conversation
1bb38f6
to
d3bc03d
Compare
d8d83dd
to
7b6ea72
Compare
71d5ce8
to
8b60c73
Compare
d1b5da4
to
90c1ce3
Compare
Test project (from #19917) with vsync turned off, Add More Text modified to add 50x more text at once, GLES2 video driver set by default and number of draw calls displayed: |
bffd948
to
c5f2798
Compare
… calls and batching TYPE_RECT draw calls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good generally! I didn't completely check every single memcpy and glXXX command, but the general architecture is pretty good! I think time will tell if there are bugs 😛
|
||
Item *material_owner = ci->material_owner ? ci->material_owner : ci; | ||
const uint8_t count = 6; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think most compilers will deal with this just fine, but technically this would create a VLA (which are not part of the C++ standard), so making this static const uint8_t count = 6;
would be more "safe", but not priority.
Closing because the canvas rasterizer is expected to have all or none batching and not a partial batching that's been proposed here. See https://godot.eska.me/irc-logs/devel/2018-07-25.log [16:56:58] - [17:13:35] for details. |
I understand that @reduz wants something even more exhaustive, but what are the drawbacks of the current implementation? It fixes real world issues that should not be disregarded. |
That's quite unexpected.We can't change the whole code all in once. |
@groud I have closed it because I can't reimplement it in a near future to have full batching. |
I know, but it could have been merged until someone can. |
The code doesn't seem to be hard to understand (hey it's just rendering code) but it still could be split into a few commits |
Fixes a problem described in #19943 but for GLES2 only. The fix reduces the number of glBufferSubData calls by splitting canvas rendering into two phases:
I'm getting 4-10 times performance boost for the project attached to #19943 when run with "--video-driver GLES2" flag.
Performance tests (FPS comparison [after vs before]):
Core i5-650, GTX 950:
Core i7-4790K, Intel 4600:
Core i3-2310M, Intel 3000:
Android (Moto C):
Tasks: