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

[Impeller] Implement framebuffer fetch support for OpenGLES. #46585

Merged
merged 11 commits into from
Oct 10, 2023

Conversation

jonahwilliams
Copy link
Member

@jonahwilliams jonahwilliams commented Oct 5, 2023

flutter/flutter#120223 for OpenGLES. Checks for support of the framebuffer fetch extension: https://registry.khronos.org/OpenGL/extensions/EXT/EXT_shader_framebuffer_fetch.txt . This is supported on a Pixel 6 at least, we should double check the distribution of the extension.

d3c

@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 to this rule, contact Hixie or stuartmorgan on 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.

@@ -133,11 +133,14 @@ bool FramebufferBlendContents::Render(const ContentContext& renderer,

auto src_sampler_descriptor = src_snapshot->sampler_descriptor;
if (!renderer.GetDeviceCapabilities().SupportsDecalSamplerAddressMode()) {
// No known devices that support framebuffer fetch but not decal tile mode.
return false;
src_sampler_descriptor.width_address_mode =
Copy link
Member Author

Choose a reason for hiding this comment

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

Todo: fix

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -1,3 +1,5 @@
#version 200
Copy link
Member Author

Choose a reason for hiding this comment

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

Todo: fix

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -15,7 +15,7 @@ namespace impeller {
class ProcTableGLES;

struct CapabilitiesGLES {
Copy link
Member

Choose a reason for hiding this comment

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

It's really odd that this doesn't extend Capabilities like CapabilitiesVK and we have to pipe these in later. I guess that base class came after the OpenGL ES prototype. Something to tackle later.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@@ -56,6 +56,8 @@ struct CapabilitiesGLES {
// May be 0.
size_t num_shader_binary_formats = 0;

bool supports_framebuffer_fetch = false;
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps just a comment that says the extension that needs to be supported.

GLint extension_count = 0;
gl.GetIntegerv(GL_NUM_EXTENSIONS, &extension_count);

std::set<std::string> extensions;
Copy link
Member

Choose a reason for hiding this comment

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

Nit: Why toss it in a set first instead of just strncmping it iterating over GetStringi?

Copy link
Member Author

Choose a reason for hiding this comment

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

I was thinking about the additional extension checks we'll need for MSAA, ssbo, et cetera

Copy link
Member Author

Choose a reason for hiding this comment

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

Removed, Description does this already

@chinmaygarde chinmaygarde changed the title [Impeller] implement framebuffer fetch support for OpenGLES. [Impeller] Implement framebuffer fetch support for OpenGLES. Oct 5, 2023
@@ -155,6 +155,9 @@ static CompilerBackend CreateGLSLCompiler(const spirv_cross::ParsedIR& ir,
? source_options.gles_language_version
: 100;
sl_options.es = true;
if (source_options.type == SourceType::kFragmentShader) {
Copy link
Member Author

Choose a reason for hiding this comment

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

TODO: verify if this makes the extension required in all shaders. If so, we'll need to add a check

Copy link
Member Author

Choose a reason for hiding this comment

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

This was adding the extension to all shaders so now this is configured via an impellerc parameter

@jonahwilliams
Copy link
Member Author

Still todo: update malioc diff to skip diffing on framebuffer fetch shaders (not supported)

@jonahwilliams
Copy link
Member Author

Moving to WIP while I handle some foundational stuff.

auto-submit bot pushed a commit that referenced this pull request Oct 6, 2023
From #46585

For Framebuffer fetch and other changes we should refactor the CapabilitiesGLES into a regular capabilities.
@jonahwilliams jonahwilliams removed the Work in progress (WIP) Not ready (yet) for review! label Oct 10, 2023
@jonahwilliams jonahwilliams requested a review from dnfield October 10, 2023 17:30
Comment on lines 12 to 13
static std::string kFramebufferFetchExtension =
"GL_EXT_shader_framebuffer_fetch";
Copy link
Contributor

Choose a reason for hiding this comment

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

Make this a constexpr std::string_view here

Copy link
Member Author

Choose a reason for hiding this comment

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

did const constexpr char* for similar effect without more refactoring.

Copy link
Contributor

@dnfield dnfield left a comment

Choose a reason for hiding this comment

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

LGTM with nit

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 10, 2023
@auto-submit auto-submit bot merged commit 657af19 into flutter:main Oct 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 10, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Oct 10, 2023
…136292)

flutter/engine@702f366...bdeb534

2023-10-10 [email protected] Fix high FPS screen flicker of Platform Views when using ImageReaderPlatformViewRenderTarget (flutter/engine#46724)
2023-10-10 [email protected] Prepare to move new folders into `third_party/` by adding a `.gitignore`. (flutter/engine#46729)
2023-10-10 [email protected] Use x86 machines for ios builds. (flutter/engine#46726)
2023-10-10 [email protected] Remove workaround for older versions of MSVC. (flutter/engine#46689)
2023-10-10 [email protected] Roll Skia from 475286f0f6f1 to 06145491fd17 (1 revision) (flutter/engine#46728)
2023-10-10 [email protected] [Impeller] Implement framebuffer fetch support for OpenGLES. (flutter/engine#46585)

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],[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
@jonahwilliams jonahwilliams deleted the fix_tex_i_error branch October 12, 2023 17:51
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
From #46585

For Framebuffer fetch and other changes we should refactor the CapabilitiesGLES into a regular capabilities.
harryterkelsen pushed a commit that referenced this pull request Oct 23, 2023
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
No open projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants