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

Conversation

@jonahwilliams
Copy link
Contributor

Winding order and cull mode almost never change, so avoid re-binding them over and over again. Minor performance improvement.

@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.


CullMode current_cull_mode = CullMode::kNone;
WindingOrder current_winding_order = WindingOrder::kClockwise;
gl.FrontFace(GL_CW);
Copy link
Member

Choose a reason for hiding this comment

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

Can you pull these into helper functions like this:

void SetFrontFace(ProcTable& gl, 
    std::optional<WindingOrder>& cached_winding_order, 
    WindingOrder new_winding_order) {
  if (cached_winding_order.has_value() && *cached_winding_order == new_winding_order) {
    return;
  }
  cached_winding_order = new_winding_order;
  gl.FrontFace(foobar(new_winding_order));
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can pull them into closures, but this whole thing is a big static function so there isn't anywhere else to store the fields. WDUT?

Copy link
Member

Choose a reason for hiding this comment

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

The closures don't really clean things up much. I was thinking the helper functions would be helpful abstractions over setting only something if it is different or isn't set. The cached values are stored on the stack. It's not a huge deal.


CullMode current_cull_mode = CullMode::kNone;
WindingOrder current_winding_order = WindingOrder::kClockwise;
gl.FrontFace(GL_CW);
Copy link
Member

Choose a reason for hiding this comment

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

The closures don't really clean things up much. I was thinking the helper functions would be helpful abstractions over setting only something if it is different or isn't set. The cached values are stored on the stack. It's not a huge deal.

@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 5c00163 into flutter:main Dec 5, 2024
31 checks passed
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 5, 2024
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 5, 2024
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
…159836)

flutter/engine@8d3c718...05e2d65

2024-12-05 jonahwilliams@google.com [Impeller] store GLES bindings on
render pass w/ offsets instead of per-command. (flutter/engine#56910)
2024-12-05 jonahwilliams@google.com [Impeller] avoid re-binding winding
order and cull mode. (flutter/engine#56943)
2024-12-05 30870216+gaaclarke@users.noreply.github.com Implements the
naming of untracked gles handles (flutter/engine#56948)
2024-12-05 skia-flutter-autoroll@skia.org Roll Fuchsia Test Scripts from
VilXq4eGH5A24wRWA... to r9Dc5VRF6sE3pJH20... (flutter/engine#56953)

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 bdero@google.com,zra@google.com 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
…ine#56943)

Winding order and cull mode almost never change, so avoid re-binding them over and over again. Minor performance improvement.
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