-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] create a 300 es variant of all GLES shaders to support UBO binding. #56960
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). 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. The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group. |
| #include <cstring> | ||
| #include <memory> | ||
|
|
||
| #include "GLES3/gl3.h" |
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.
Like vk.h, the convention in the GL backend is to include //impeller/renderer/backend/gles/gles.h.
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.
Done
| gl.GetProgramiv(program, GL_ACTIVE_UNIFORM_BLOCKS, &uniform_blocks); | ||
| for (GLint i = 0; i < uniform_blocks; i++) { | ||
| GLint name_length = 0; | ||
| gl.GetActiveUniformBlockiv(program, i, GL_UNIFORM_BLOCK_NAME_LENGTH, |
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.
Paranoid note: Does the name include the NULL terminator?
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.
according to https://registry.khronos.org/OpenGL-Refpages/gl4/html/glGetActiveUniformBlock.xhtml it does
|
|
||
| std::vector<GLchar> name; | ||
| name.resize(name_length); | ||
| GLint length; |
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.
Like name_length above, zero this out so an error in the next call doesn't leave garbage in the variable that you will later use to create a string.
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.
Done
| std::make_pair(block_index, i); | ||
| } | ||
| use_ubo_ = true; | ||
| return ReadUniformsBindingsV2(gl, program); |
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.
Nicely done.
|
|
||
| void Flush(std::optional<Range> range = std::nullopt) const override; | ||
|
|
||
| std::optional<GLuint> GetHandle() const { |
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.
Nit: OOL?
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.
Done
| element_count, // count | ||
| buffer_data // data | ||
| ); | ||
| continue; |
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.
Perhaps add the default: case that logs the member type so we don't silently ignore stuff? But yeah, at this point, probably all types have shaken out.
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.
Done
… Android. (#159857) Required changes for flutter/engine#56960 This configures an additional shader target for Android devices.
…upport UBO binding. (flutter/engine#56960)
…159865) flutter/engine@3a8204a...bbe33f2 2024-12-05 [email protected] [DisplayList] Disable group opacity when a RuntimeEffect is in use (flutter/engine#56936) 2024-12-05 [email protected] Removes ReactorGLES::Ref (flutter/engine#56981) 2024-12-05 [email protected] [Impeller] create a 300 es variant of all GLES shaders to support UBO binding. (flutter/engine#56960) 2024-12-05 [email protected] [Impeller] Add rounded superellipse (flutter/engine#56726) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
|
It looks like the code size hit for this is about ~120 Kb. I don't know if this is compressed or uncompressed. |
… binding. (flutter/engine#56960) Create a GLES3 "backend" by compiling a second set of GLES shaders to 300 es. This allows the usage of UBOs and SSBOs.
Create a GLES3 "backend" by compiling a second set of GLES shaders to 300 es. This allows the usage of UBOs and SSBOs.