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 Oct 18, 2024

Otherwise with backdrop filters we create and throw away a single fullscreen texture every frame. Very wasteful!

Does not impact iOS because it has the read from resolve option. Removed some unused parts of the inline_pass_context that were only used in the entity pass days.

pass_ = collapsed_parent_pass.value().pass;
}
}
InlinePassContext::InlinePassContext(const ContentContext& renderer,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

entity_count, collapsed_parent_pass, is_collapsed_ are all unused


class InlinePassContext {
public:
struct RenderPassResult {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

None of these are used anymore

TextureDescriptor new_descriptor =
color0.resolve_texture->GetTextureDescriptor();
secondary_color_texture_ = allocator.CreateTexture(new_descriptor);
RenderTarget target = renderer.GetRenderTargetCache()->CreateOffscreenMSAA(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When we "flip" the backdrop texture, do the new allocation from the render target cache. Technically this creates some unused transients too but :shrug.

While we still only create a maximum of two backdrop textures per frame, this change ensures we recycle them across frames and avoid continual re-allocation

@jonahwilliams jonahwilliams marked this pull request as ready for review October 18, 2024 16:41
@gaaclarke
Copy link
Member

Is there an issue associated with this change? Sounds similar to some of the others I've seen.

@jonahwilliams
Copy link
Contributor Author

The related issues is flutter/flutter#149368 , we still have worst frame instability compared to skia which I suspect is related to the allocation.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

looks mostly good to me, I just have one question about msaa

}

entity.Render(renderer_, *result.pass);
entity.Render(renderer_, *result);
Copy link
Member

Choose a reason for hiding this comment

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

Add a FML_DCHECK that we can dereference this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

its null checked on the previous line?

TextureDescriptor new_descriptor =
color0.resolve_texture->GetTextureDescriptor();
secondary_color_texture_ = allocator.CreateTexture(new_descriptor);
RenderTarget target = renderer.GetRenderTargetCache()->CreateOffscreenMSAA(
Copy link
Member

Choose a reason for hiding this comment

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

Should there be a branch here if we aren't using MSAA?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

See above, we'll never use this on a non-MSAA target.

  auto color0 = target_.GetColorAttachments().find(0)->second;
  if (!color0.resolve_texture) {
    VALIDATION_LOG << "EntityPassTarget Flip should never be called for a "
                      "non-MSAA target.";


entity_pass_target.Flip(
*content_context->GetContext()->GetResourceAllocator());
entity_pass_target.Flip(*content_context);
Copy link
Member

Choose a reason for hiding this comment

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

Same here, DCHECK for nullptr.

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


uint32_t GetPassCount() const;

RenderPassResult GetRenderPass(uint32_t pass_depth);
Copy link
Member

Choose a reason for hiding this comment

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

This is just straight up dead code regardless of your change? No need to change this PR but for future PRs it would be easier if refactoring and functional changes are split into 2 different prs =)

Copy link
Contributor Author

@jonahwilliams jonahwilliams Oct 18, 2024

Choose a reason for hiding this comment

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

Yeah I get it. Though I didn't intend to do a large refactoring, I realized all this was dead when I started changing it.

Copy link
Member

@gaaclarke gaaclarke left a comment

Choose a reason for hiding this comment

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

lgtm, modulo a few nits on dereferencing a pointer into a reference that's potentially null.

@jonahwilliams jonahwilliams added the autosubmit Merge PR when tree becomes green via auto submit App label Oct 18, 2024
@auto-submit auto-submit bot merged commit cd8c39c into flutter:main Oct 18, 2024
30 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 19, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Oct 19, 2024
jonahwilliams pushed a commit to flutter/flutter that referenced this pull request Oct 19, 2024
…157215)

flutter/engine@76d310e...dd37446

2024-10-19 [email protected] Move keymap from
FlKeyboardViewDelegate to FlKeyboardManager (flutter/engine#55942)
2024-10-19 [email protected] [UI] fix scene builder parameter
naming. (flutter/engine#55969)
2024-10-19 [email protected] iOS: Improve thread safety of first frame
callback (flutter/engine#55966)
2024-10-18 [email protected] iOS: Fix flaky tests (remove timeouts)
(flutter/engine#55961)
2024-10-18 [email protected] [Impeller] allocate the impeller
onscreen texture from the render target cache. (flutter/engine#55943)
2024-10-18 [email protected] Roll Fuchsia Linux SDK from
9F_NaKPd2twhbPwP7... to tNQZ8d5mRYpe3--lk... (flutter/engine#55963)
2024-10-18 [email protected] Started filtering
out close line segments in rrect polylines. (flutter/engine#55929)
2024-10-18 [email protected] [Impeller] libImpeller: Allow custom
font registrations. (flutter/engine#55934)
2024-10-18 [email protected] Re-reland "iOS: Migrate FlutterEngine to
ARC" (flutter/engine#55962)
2024-10-18 [email protected] [Impeller] libImpeller: Add a README.
(flutter/engine#55940)
2024-10-18 [email protected] iOS: Eliminate needless profiler metrics
ivar (flutter/engine#55957)
2024-10-18 98614782+auto-submit[bot]@users.noreply.github.com Reverts
"[Impeller] one descriptor pool per frame. (#55939)"
(flutter/engine#55959)
2024-10-18 [email protected] Revert "Reland "iOS: Migrate FlutterEngine
to ARC" (#55937)" (flutter/engine#55954)
2024-10-18 [email protected] Roll Dart SDK from
993d3069f42e to a51df90298ca (7 revisions) (flutter/engine#55951)
2024-10-18 [email protected] [engine] add back opt out for merged
threads. (flutter/engine#55952)
2024-10-18 [email protected] [Impeller] one descriptor pool per
frame. (flutter/engine#55939)
2024-10-18 [email protected] [Impeller] add mechanism for sharing
bdf inputs. (flutter/engine#55701)

Also rolling transitive DEPS:
  fuchsia/sdk/core/linux-amd64 from 9F_NaKPd2twh to tNQZ8d5mRYpe

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
…get cache. (flutter/engine#55943)

Otherwise with backdrop filters we create and throw away a single fullscreen texture every frame. Very wasteful!

Does not impact iOS because it has the read from resolve option. Removed some unused parts of the inline_pass_context that were only used in the entity pass days.
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants