-
-
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
Add Nvidia Workaround for GLES3 #38517
Conversation
b0c8f42
to
3aad68c
Compare
Ok, code is now cleared. up. Only question now is what to use for project setting: Project Setting NameThis is something up for discussion, and I can change to whatever desired. I have preliminary changed the project setting from There is a trade off here between
With a change to the existing setting, this means that existing projects that use this option may see an extra (useless) version of the old setting, because it is still in their Let me know opinions on this, it is easy to change. |
3aad68c
to
327e3d3
Compare
This also means that if they previously enabled the option, it will no longer be enabled once they update to 3.2.2, so they will have to change this manually. But if we make it crystal clear in the release notes, it shouldn't be a big issue. I don't expect that many users actually use this workaround in production due to the big performance hit that it gives. |
Needs a rebase after I merged your other PR. |
327e3d3
to
c8e77a8
Compare
Done. 👍 |
use_nvidia_rect_workaround = false; | ||
|
||
#ifdef GLES_OVER_GL | ||
if (!Engine::get_singleton()->is_editor_hint()) { |
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.
Why exclude it from the editor? Users might still see flickering in their TileMaps when editing them.
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 originally didn't, but the IDE seemed a little slower typing scripts with it set on in the editor. Maybe I'm imagining it. I'm ok with leaving it on in the editor too, I'll change this.
c8e77a8
to
6b18986
Compare
Ported GLES2 workaround code to GLES3.
6b18986
to
dcb19ed
Compare
@akien-mga Unfortunately, I have to use it for my 2D games. The flickering is gosh awful and WAYYYY too frequent to allow it in a released title. It's one of the main reasons I don't make 2D games that much these days in Godot. |
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 fine to me.
Moreover, the Nvidia workaround is now only used when batching is OFF, and by default in 3.2.2 batching will be ON, so IMO it's OK that we also rename the setting for clarity and to avoid duplication. If some users decide to disable batching, and they used to need the Nvidia workaround, they'll see the new one next to the |
Thanks! |
@lawnjelly I can confirm with m,y build using your code fix has corrected the flicker problem. I tried both with and without the setting. Without the setting, the flicker was there (expected). With the setting, the flickering disappeared. I did notice that the flickering still occurred in the Editor? |
There may actually be a couple of places in the editor that draw using texture rect from a different place. I noticed it while working on the shader today. I'll have a look at changing those too, however first of all I need to get you (or someone else) to test out #38628, if you have any time to try it. If that PR works, we can get rid of the workarounds completely, and you can run things at full speed, which would be much better! 👍 |
gotcha -- i'll try to find some time today to test that out for you. |
Ported GLES2 workaround code to GLES3. This is to deal with the infamous flickering issue on some hardware / drivers.
Several people were asking for this in #9913.
gles2_use_nvidia_workaround
. It would seem to make sense to lose the gles2 prefix and use the same for both. This may potentially confusingly make some people's project settings show both the old setting and the new, if they have existing projects that use it.I'm planning to have a go at fixing the uniform draw method soon, if we can get that working it will make the workaround code redundant, but that's a big if! 😁