engine icon indicating copy to clipboard operation
engine copied to clipboard

Use glBlitFramebuffer when rendering

Open robert-ancell opened this issue 1 year ago • 6 comments

This is much faster than using a shader which is not required currently (we are not doing any transformations).

robert-ancell avatar May 29 '24 02:05 robert-ancell

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

flutter-dashboard[bot] avatar May 29 '24 02:05 flutter-dashboard[bot]

Done as part of diagnosing https://github.com/flutter/flutter/issues/148653. It hasn't resolved the issue, but has made things simpler (and faster) than before.

robert-ancell avatar May 29 '24 02:05 robert-ancell

seems strictly better, but also blitFramebuffer is an OpenGL 3 proc. I dont know what the minimum gl version the linux embedder requires, but something to keep in mind.

It sounds like practically this will exist, but we should provide a fallback to cover all cases.

robert-ancell avatar Jun 04 '24 04:06 robert-ancell

Moving this to draft status as I need to think about an appropriate fallback behaviour.

robert-ancell avatar Jun 05 '24 04:06 robert-ancell

If you are on OpenGL 2 or less then I think the current shader based solution is the best you can do. Still, that is an ancient gl version, and I don't know if we actually support it

jonahwilliams avatar Jun 05 '24 04:06 jonahwilliams

Talking to the OpenGL experts here it seems GLES2 is the minimum we can expect, but practically all systems will have GL3. So we just need to provide some form of fallback for a rare case - i.e. it probably doesn't have to be performant.

robert-ancell avatar Jun 05 '24 04:06 robert-ancell

Doesn't this need a fallback for ES2?

chinmaygarde avatar Jul 11 '24 20:07 chinmaygarde

Doesn't this need a fallback for ES2?

If glBlitFramebuffer it reverts to the current texture rendering - is there something special in ES2 that would stop that working?

robert-ancell avatar Jul 12 '24 06:07 robert-ancell

Requesting a test exemption as this render path is not explicitly checked currently.

robert-ancell avatar Jul 12 '24 07:07 robert-ancell

Added a test, so this no longer requires the exemption.

robert-ancell avatar Jul 18 '24 01:07 robert-ancell