Skip to content

Fix Adreno GPU crashes from symbol UBO dynamic indexing#13652

Closed
navidemad wants to merge 15 commits intomapbox:mainfrom
navidemad:fix/adreno-symbol-ubo-crash
Closed

Fix Adreno GPU crashes from symbol UBO dynamic indexing#13652
navidemad wants to merge 15 commits intomapbox:mainfrom
navidemad:fix/adreno-symbol-ubo-crash

Conversation

@navidemad
Copy link
Copy Markdown

Summary

Fixes #13651 — v3.21.0 crashes on Android Pixel devices (Pixel 7, 8, 8A, 9a) during zoom/pan due to Adreno GPU incompatibility with the new symbol UBO feature.

Root cause: Adreno GPUs (like PowerVR, already disabled in 9880b06b4) do not correctly handle dynamic (non-uniform) indexing into UBO arrays — this is technically undefined behavior in GLSL ES 3.00. The symbol shader also had inconsistent Adreno workarounds: uvec4At/vec4At used safe explicit swizzles, but readFloat/readUint used direct bracket indexing that fails on affected Adreno drivers.

Changes:

  • src/gl/context.ts — Disable symbol UBO batching on Adreno GPUs (matching the existing PowerVR treatment)
  • src/shaders/symbol.vertex.glsl — Replace direct slot[index] bracket indexing in readFloat/readUint with the existing Adreno-safe vec4At/uvec4At helpers
  • src/data/bucket/symbol_properties_ubo.ts — Fix stale default parameter in getMaxFeatureCount (was 4096 - 12 = 4084, should be 4096 after the sizing fix in e56c56731)
  • src/render/cutoff.ts — Guard zRange division against near-zero values on mobile viewports

Test plan

  • symbol_property_binder_ubo.test.ts — all 35 tests pass
  • Verify on Pixel 7/8/8A/9a that zoom/pan no longer crashes
  • Verify on desktop that symbol rendering is unchanged (UBO still active on non-Adreno/non-PowerVR GPUs)
  • Verify on PowerVR devices that existing disable still works

🤖 Generated with Claude Code

underoot and others added 15 commits March 25, 2026 12:27
GitOrigin-RevId: d8b7178303eff53126efd82975fe1e4d3cd5fac6
…ont-cutoff, and source-max-zoom style properties (internal-11462)

Backport 5ed86553c8260e2d878edaf06023be6c5b56d94f from internal-11456.

Co-authored-by: Aleksandar Stojiljković <aleksandar.stojiljkovic@mapbox.com>
GitOrigin-RevId: 417476b6b1bdd6d2e4ae14500669e47a956f767a
GitOrigin-RevId: 620a106be6b9dd7945d20d22c2e67d89a40eef08
GitOrigin-RevId: e4eac81b13826400cb41bb24edc36a44147fdaac
GitOrigin-RevId: 2093289c542b04a3536e5469cfd40278f256a83c
GitOrigin-RevId: 59fb0f9a4919fe1e04bf387bfd4a895d8d3dee18
Backport f8b61a596360124dc07f819fd8c188f00c9ca751 from internal-11546.

cc @mapbox/gl-native

cc @mapbox/gl-js

---------

Co-authored-by: Changelog autocreator bot <github-actions[bot]@users.noreply.github.com>
Co-authored-by: Isaac Besora Vilardaga <isaac.besora@gmail.com>
GitOrigin-RevId: 9a46f79c1f81b009c8604b37908ae95dddd6c280
GitOrigin-RevId: d8133a397d49d5647be34c4051f7597eaf0c566c
GitOrigin-RevId: 566af7741eb979f255efba12e4bef3e3f58c8cd6
GitOrigin-RevId: 007491dd4b1b78583c41040c3fa436dbbbec175c
GitOrigin-RevId: f3f5fdb44dde5352981414a506e1c5a1b4fb74db
source-max-zoom layout property. (internal-11356)

GitOrigin-RevId: 1c29f1223670427f4547d02ecab8ba2ca77bd1fb
GitOrigin-RevId: 55bb44b848317713b5a115abc00865dd07c136f8
GitOrigin-RevId: 11051c3e28a335335cd8c6fa2b8f01b8562c1a22
Disable symbol UBO batching on Adreno GPUs (Qualcomm, used in Pixel 7/8/8A/9a)
where GLSL ES 3.00 dynamic indexing into UBO arrays causes GPU faults. Also fix
readFloat/readUint in the symbol shader to use the existing Adreno-safe swizzle
helpers, correct a stale getMaxFeatureCount default, and guard against
zero-division in the cutoff formula.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@navidemad navidemad requested a review from a team as a code owner April 4, 2026 02:49
@navidemad navidemad requested review from underoot and removed request for a team April 4, 2026 02:49
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 4, 2026

Hey, @navidemad 👋 Thanks for your contribution to Mapbox GL JS!

Important: This repository does not accept direct merges. All changes go through our internal review process.

What happens next:

  1. A team member will review your PR here first
  2. If it looks good, they will import it to our internal repository for further review
  3. If approved, changes will be synced back here via our release process

Please respond to any review comments on this PR. For more details, see CONTRIBUTING.md.

@CLAassistant
Copy link
Copy Markdown

CLAassistant commented Apr 4, 2026

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
3 out of 10 committers have signed the CLA.

✅ mourner
✅ stepankuzmin
✅ navidemad
❌ underoot
❌ mapbox-github-ci-writer-1[bot]
❌ endanke
❌ speps
❌ astojilj
❌ mapbox-github-ci-writer-3[bot]
❌ mapbox-github-ci-writer-2[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

@navidemad
Copy link
Copy Markdown
Author

Closing in favor of a new PR rebased onto main with changelog entry added per CONTRIBUTING.md.

@navidemad navidemad closed this Apr 4, 2026
@navidemad navidemad deleted the fix/adreno-symbol-ubo-crash branch April 4, 2026 02:55
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

Successfully merging this pull request may close these issues.

Map crashes in v3.21.0 with many Pixel devices

8 participants