Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Dec 5, 2024

Create a GLES3 "backend" by compiling a second set of GLES shaders to 300 es. This allows the usage of UBOs and SSBOs.

@flutter-dashboard
Copy link

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.

@jonahwilliams jonahwilliams changed the title gles3 android backend [Impeller] create a 300 es variant of all GLES shaders to support UBO binding. Dec 5, 2024
#include <cstring>
#include <memory>

#include "GLES3/gl3.h"
Copy link
Member

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.

Copy link
Contributor Author

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,
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


std::vector<GLchar> name;
name.resize(name_length);
GLint length;
Copy link
Member

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.

Copy link
Contributor Author

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);
Copy link
Member

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 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: OOL?

Copy link
Contributor Author

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;
Copy link
Member

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 5, 2024
… Android. (#159857)

Required changes for flutter/engine#56960

This configures an additional shader target for Android devices.
@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 5, 2024
@auto-submit auto-submit bot merged commit 2fdce10 into flutter:main Dec 5, 2024
34 checks passed
@jonahwilliams jonahwilliams deleted the do_ubo_baby branch December 5, 2024 21:05
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 5, 2024
github-merge-queue bot pushed a commit to flutter/flutter that referenced this pull request Dec 5, 2024
…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
nick9822 pushed a commit to nick9822/flutter that referenced this pull request Dec 18, 2024
… 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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

autosubmit Merge PR when tree becomes green via auto submit App e: impeller platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants