Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android surface pre-rotation #2955

Merged
merged 3 commits into from
Nov 20, 2024

Conversation

adrian-cojocaru
Copy link
Collaborator

@adrian-cojocaru adrian-cojocaru commented Oct 22, 2024

Add a surface transform at the end of each vertex shader to eliminate the compositor pass added by the OS (needed to display the framebuffer correctly).
A great article that describes all the benefits and implications: https://developer.android.com/games/optimize/vulkan-prerotation

Copy link

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2955-compared-to-main.txt

Copy link

github-actions bot commented Oct 22, 2024

Bloaty Results 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  [ = ]       0  [ = ]       0    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2955-compared-to-main.txt

Compared to d387090 (legacy)

    FILE SIZE        VM SIZE    
 --------------  -------------- 
   +28% +32.4Mi  +426% +25.4Mi    TOTAL

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2955-compared-to-legacy.txt

Copy link

github-actions bot commented Oct 22, 2024

Benchmark Results ⚡

Benchmark                                                     Time             CPU      Time Old      Time New       CPU Old       CPU New
------------------------------------------------------------------------------------------------------------------------------------------
OVERALL_GEOMEAN                                            -0.0115         -0.0115             0             0             0             0

Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-2955-compared-to-main.txt

@adrian-cojocaru adrian-cojocaru marked this pull request as ready for review October 25, 2024 10:19
Copy link
Collaborator

@louwers louwers left a comment

Choose a reason for hiding this comment

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

Really cool, also thanks for sharing the link.

Any way we can test this as part of the instrumentation tests?

@adrian-cojocaru
Copy link
Collaborator Author

After some quick searching looks like OrientationChangeTest and MapSnapshotterTest can be combined to get bitmaps and compare them with a rotated baseline or in pairs SCREEN_ORIENTATION_PORTRAIT/SCREEN_ORIENTATION_REVERSE_PORTRAIT and SCREEN_ORIENTATION_LANDSCAPE/SCREEN_ORIENTATION_REVERSE_LANDSCAPE.

@louwers louwers merged commit d282b3b into maplibre:main Nov 20, 2024
39 checks passed
@adrian-cojocaru adrian-cojocaru deleted the surface-pre-rotation branch November 27, 2024 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants