-
Notifications
You must be signed in to change notification settings - Fork 6k
[Impeller] avoid re-binding winding order and cull mode. #56943
Conversation
|
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); |
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.
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));
}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 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?
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.
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); |
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.
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.
…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
…ine#56943) Winding order and cull mode almost never change, so avoid re-binding them over and over again. Minor performance improvement.
Winding order and cull mode almost never change, so avoid re-binding them over and over again. Minor performance improvement.