engine
engine copied to clipboard
Use glBlitFramebuffer when rendering
This is much faster than using a shader which is not required currently (we are not doing any transformations).
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.
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.
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.
Moving this to draft status as I need to think about an appropriate fallback behaviour.
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
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.
Doesn't this need a fallback for ES2?
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?
Requesting a test exemption as this render path is not explicitly checked currently.
Added a test, so this no longer requires the exemption.