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

Custom Layer Re-ordering Issue #3187

Open
yousifd opened this issue Jan 31, 2025 · 0 comments
Open

Custom Layer Re-ordering Issue #3187

yousifd opened this issue Jan 31, 2025 · 0 comments

Comments

@yousifd
Copy link

yousifd commented Jan 31, 2025

Describe the bug

Using a custom layer and inserting at any position (using insertLayer at index 0 instead of addLayer) results in a change in how other layers are rendered. I've narrowed it down to the custom layer changing what's bound at the first bind index and context.bindGlobalUniformBuffers not being called after the custom layer is done rendering.

In some situations, depending on what gets bound to index 0, the app might also crash.

To Reproduce

  1. Modify "MBXViewController.mm:1754` to the following
        // [self.mapView.style addLayer:layer];
        [self.mapView.style insertLayer:layer atIndex:0];
  1. Build and run the sample iOS app that includes the built-in CustomStyleLayerExample using the metal renderer
  2. Select the gear icon in the top left and scroll down the list and select Add Custom Triangle Layer (Metal)
  3. You will notice that all lines are gone (mercator and country lines)

Expected behavior

Nothing should be different and the triangle doesn't show because it gets overdrawn by the layers above it.

Screenshots

Image of map without anything changed
Image

Image of map after selecting the custom layer
Image

Expected Output

Image

Platform information (please complete the following information):

  • Operating System: MacOS (building) and iOS (simulator)
  • Platform (e.g. Node.js, Qt): iOS
  • Version: 6.10.0

Additional context

The issue was solved by re-binding the global UBOs at the end of the custom layer tweaker in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant