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

Synchronous rendering on Metal when annotation views are visible #2334

Merged
merged 4 commits into from
Apr 29, 2024

Conversation

stefankarschti
Copy link
Collaborator

@stefankarschti stefankarschti commented Apr 25, 2024

Implement conditional synchronous rendering on Metal backend when annotation views are visible, that is waiting for frames to fully complete by invoking [commandBuffer waitUntilCompleted]; in the swap method of the MLNMapViewMetalRenderableResource.

This is needed because the map transformation is set as soon as the camera is mutated, and annotations are positioned on the screen according to that in MLNMapView::renderSync -> updateAnnotationViews, while the frame rendering is completing asynchronously on Metal - which causes desynchronization.

ref: #2082
Fixes #2053

Copy link

github-actions bot commented Apr 25, 2024

Bloaty Results (iOS) 🐋

Compared to main

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.0%    +496  [ = ]       0    TOTAL

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

@stefankarschti stefankarschti marked this pull request as ready for review April 26, 2024 11:14
platform/ios/src/MLNMapView+Metal.h Outdated Show resolved Hide resolved
@stefankarschti stefankarschti requested a review from mwilsnd April 29, 2024 15:52
@louwers louwers enabled auto-merge (squash) April 29, 2024 18:37
@louwers louwers merged commit 855d753 into maplibre:main Apr 29, 2024
19 checks passed
@michaelkirk
Copy link

Thank you so much, it looks much better now! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working metal
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[iOS - Metal - v6.0.0] - MLNAnnotationView delay with map panning
4 participants