Fix Adreno GPU crashes from symbol UBO dynamic indexing#13652
Fix Adreno GPU crashes from symbol UBO dynamic indexing#13652navidemad wants to merge 15 commits intomapbox:mainfrom
Conversation
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
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>
|
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:
Please respond to any review comments on this PR. For more details, see CONTRIBUTING.md. |
|
|
|
Closing in favor of a new PR rebased onto main with changelog entry added per CONTRIBUTING.md. |
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/vec4Atused safe explicit swizzles, butreadFloat/readUintused 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 directslot[index]bracket indexing inreadFloat/readUintwith the existing Adreno-safevec4At/uvec4Athelperssrc/data/bucket/symbol_properties_ubo.ts— Fix stale default parameter ingetMaxFeatureCount(was4096 - 12 = 4084, should be4096after the sizing fix ine56c56731)src/render/cutoff.ts— GuardzRangedivision against near-zero values on mobile viewportsTest plan
symbol_property_binder_ubo.test.ts— all 35 tests pass🤖 Generated with Claude Code