mapbox / mapbox/mapbox-gl-js

Validate maximum number of data-driven paint properties per layer

Open
#4,879 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

cross-platform :tv:
Dominant language
TypeScript
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

The maximum number of properties that can be data-driven in a single layer simultaneously is effectively limited by `GL_MAX_VERTEX_ATTRIBS`, which can be as low as 8. As we grow the number of data-driven properties, it becomes more likely that a style author could go over this limit unknowingly, test on devices that support `GL_MAX_VERTEX_ATTRIBS` > 8, see nothing wrong, and then deploy and have the style break on lower-end devices.

We should introduce style validation to prevent this. The validation rule should enforce a limit on the number of data-driven paint properties used per layer. The limit varies by layer type, and is defined by (8 - maximum number of _non_-paint-property attributes required by any shader used for that layer type).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file or test is named in the issue. Start by locating the style-validation entry point and the per-layer shader attribute definitions; verify the computed limit for each layer type and add validation coverage showing that styles exceeding the limit are rejected.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
computer-graphics, frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.