Repository navigation
Uber compactify - #196392
Uber compactify#196392
Conversation
|
It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging. 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. If both you and the PR author believe this PR qualifies for a test exemption, escalate to the tech lead for the changed area to review and apply the |
There was a problem hiding this comment.
Code Review
This pull request introduces a new vertex shader, uber_sdf.vert, which offloads per-draw offsets from the fragment shader to reduce uniform register usage. It also optimizes rounded superellipse calculations in rse_sdf.glsl by utilizing the cosine of the angular span to avoid expensive operations, packing these values into the unused radii.zw uniform components. Feedback on these changes highlights a potential rendering regression in uber_sdf_common.glsl where directly casting float uniforms to integers via int() can lead to truncation errors on certain GPU architectures; using round() before casting is recommended to ensure robust conversion.
gaaclarke
left a comment
There was a problem hiding this comment.
Just a few cleanup requests and one question about ints, otherwise liking the approach.
| // Equivalent to `useCircularDistance`, but takes the cosine of the span. | ||
| // | ||
| // `p` is within the span of the corner circle's arc when the angle between `p` | ||
| // and the 45 degree midline is less than the span, i.e. when | ||
| // cos(angle) > cos(span). This avoids atan() and mod(), which need more | ||
| // constants and uniform registers. |
There was a problem hiding this comment.
Can you format this like doxygen comments? Also have it describe what it does and do a see also for useCircularDistance
| float pixel_size; | ||
| if (frag_info.type < 0.5) { // Circle | ||
| // frag_info.type holds an exact small integer. | ||
| int type = int(frag_info.type); |
There was a problem hiding this comment.
Do we have int support for all our targeted devices? I thought some opengles 2 stuff might not have it?
There was a problem hiding this comment.
We have int support within the shader
.Int uniforms are converted into floats, maybe you're thinking of that?
gaaclarke
left a comment
There was a problem hiding this comment.
LGTM, I have one nit that I would ask for a follow up when you get a chance please
| /// Returns whether the closest point on a rounded superellipse octant to `p` | ||
| /// is on the octant's corner circle, in which case the distance to the | ||
| /// superellipse is the distance to that circle. | ||
| /// | ||
| /// `p` is relative to the corner circle's center. The closest point is on the | ||
| /// circle when `p` is within the circle's arc, i.e. when the angle between `p` | ||
| /// and the 45 degree midline is less than the arc's angular span. This is | ||
| /// tested as cos(angle) > `cos_span`, where `cos_span` is the cosine of the | ||
| /// angular span. | ||
| /// | ||
| /// This gives the same result as `useCircularDistance`, which takes the span | ||
| /// itself, but avoids atan() and mod(), which need more constants and uniform | ||
| /// registers. | ||
| /// |
There was a problem hiding this comment.
Sorry, this isn't quite doxygen format. I'd like to see parameter comments. This is important because those parameters are not easily understood by looking at the signature.
/// brief
///
/// details
/// @param p blah blah
/// @ param cos_span blah blah
/// @returns true when yadda yadda yadda
|
test-exempt: no logic change, just an optimization |
|
autosubmit label was removed for flutter/flutter/196392, because - The status or check suite Presubmit has failed. Please fix the issues identified (or deflake) before re-applying this label. |
|
Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change). If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review. For more guidance, visit Writing a golden file test for Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
flutter/flutter@b98afb5...9c427b5 2026-11-12 [email protected] Roll Skia from d67d0f22e3ec to 9aa2513a4ac9 (2 revisions) (flutter/flutter#196429) 2026-11-12 [email protected] [flutter_tools] Move CpuArch to flutter_tools_core and define HostPlatform by osName and cpuArch (flutter/flutter#195841) 2026-11-12 [email protected] Roll Skia from 23e7e63789b8 to d67d0f22e3ec (2 revisions) (flutter/flutter#196424) 2026-11-12 [email protected] Uber compactify (flutter/flutter#196392) 2026-11-12 [email protected] Roll Skia from 3d7e335da165 to 23e7e63789b8 (12 revisions) (flutter/flutter#196422) 2026-11-12 [email protected] Roll Dart SDK from 13af329ea4f2 to e5add7a25b32 (1 revision) (flutter/flutter#196413) 2026-11-12 [email protected] Don't terminate the shared EGL display when an engine is disposed (flutter/flutter#194520) 2026-11-11 [email protected] Adds manifest flag to turn on SDFs for Android. (flutter/flutter#196056) 2026-11-11 [email protected] Remove bringup from Linux_pixel_7pro integration_ui_keyboard_inset_jump (flutter/flutter#196334) 2026-11-11 [email protected] Uses system default locale for text rendering when preferred locale isn't supported (flutter/flutter#195997) 2026-11-11 [email protected] [android]: prewarms shaders when the context is created (flutter/flutter#196069) 2026-11-11 [email protected] iOS: Recomposite platform views only if their parameters change (flutter/flutter#196287) 2026-11-11 [email protected] [flutter_tools] Forward encoding in ErrorHandlingFile.readAsStringSync (flutter/flutter#196136) 2026-11-11 [email protected] Roll Skia from b89c24bbab8c to 3d7e335da165 (8 revisions) (flutter/flutter#196390) 2026-11-11 [email protected] Add Flutter Gardener instructions on how to disable a test (flutter/flutter#196312) 2026-11-11 [email protected] [Impeller] Enable malioc analysis for framebuffer_blend shaders (flutter/flutter#196343) 2026-11-11 [email protected] [flutter_tools] Migrate general.shard Android, asset, and build tests off globals (flutter/flutter#196125) 2026-11-11 [email protected] Roll Dart SDK from 8f15c4ca2d41 to 13af329ea4f2 (1 revision) (flutter/flutter#196386) 2026-11-11 [email protected] [Impeller] Do not clamp the local coverage limit to the root render target (flutter/flutter#195860) 2026-11-11 [email protected] [Impeller] Use separate uniform buffers on VMware SVGA3D (flutter/flutter#196022) 2026-11-11 [email protected] [flutter_tools] Introduce AndroidSdkProvider for lazy native_assets SDK lookup (flutter/flutter#196122) 2026-11-11 [email protected] Moves linux to ThinLTO. (flutter/flutter#196314) 2026-11-11 [email protected] [flutter_tools] Migrate bin/fuchsia_tester.dart off globals and runInContext (flutter/flutter#196074) 2026-11-11 [email protected] Changes the tolerances for frame_rate_main_test.dart. (flutter/flutter#196304) 2026-11-11 [email protected] Roll Packages from 08faf64 to 653628e (16 revisions) (flutter/flutter#196381) 2026-11-11 [email protected] Allow SliverCrossAxisGroup children to lay out with zero cross-axis extent instead of asserting (flutter/flutter#191287) 2026-11-11 [email protected] Roll Skia from cc4c54f752ba to b89c24bbab8c (4 revisions) (flutter/flutter#196375) 2026-11-11 [email protected] [Linux] Fix layer offset when compositing with glBlitFramebuffer (flutter/flutter#196189) 2026-11-11 [email protected] [flutter_tools] Inject CrashReportSender into SwiftPM migration (flutter/flutter#196315) If this roll has caused a breakage, revert this CL and set the roller to dry run mode using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: 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
Refactors a few things in uber_sdf to save on uniform registers.
radiifieldscenterandgradient_originto vertex inputsPrework for #195703
Pre-launch Checklist
///).