-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] Implement framebuffer fetch support for OpenGLES. #46585
Conversation
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 = |
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.
Todo: fix
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
@@ -1,3 +1,5 @@ | |||
#version 200 |
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.
Todo: fix
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
@@ -15,7 +15,7 @@ namespace impeller { | |||
class ProcTableGLES; | |||
|
|||
struct CapabilitiesGLES { |
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.
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.
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
@@ -56,6 +56,8 @@ struct CapabilitiesGLES { | |||
// May be 0. | |||
size_t num_shader_binary_formats = 0; | |||
|
|||
bool supports_framebuffer_fetch = false; |
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 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; |
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: Why toss it in a set first instead of just strncmp
ing it iterating over GetStringi
?
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.
I was thinking about the additional extension checks we'll need for MSAA, ssbo, et cetera
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.
Removed, Description does this already
impeller/compiler/compiler.cc
Outdated
@@ -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) { |
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.
TODO: verify if this makes the extension required in all shaders. If so, we'll need to add a check
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.
This was adding the extension to all shaders so now this is configured via an impellerc parameter
Still todo: update malioc diff to skip diffing on framebuffer fetch shaders (not supported) |
Moving to WIP while I handle some foundational stuff. |
From #46585 For Framebuffer fetch and other changes we should refactor the CapabilitiesGLES into a regular capabilities.
static std::string kFramebufferFetchExtension = | ||
"GL_EXT_shader_framebuffer_fetch"; |
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.
Make this a constexpr std::string_view
here
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.
did const constexpr char* for similar effect without more refactoring.
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.
LGTM with nit
…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
From #46585 For Framebuffer fetch and other changes we should refactor the CapabilitiesGLES into a regular capabilities.
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. 
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.