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

Validate maximum number of data-driven paint properties per layer #4879

Open
jfirebaugh opened this issue Jun 23, 2017 · 3 comments
Open

Validate maximum number of data-driven paint properties per layer #4879

jfirebaugh opened this issue Jun 23, 2017 · 3 comments
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)

Comments

@jfirebaugh
Copy link
Contributor

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).

@jfirebaugh jfirebaugh added the cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.) label Jun 23, 2017
@jfirebaugh
Copy link
Contributor Author

This is, unfortunately, a validation that may become stricter over time, if we introduce features that require adding new non-paint-property attributes to a shader. Not sure there's any solution for that other than to avoid such features.

@anandthakker
Copy link
Contributor

Should this be something that we flag in Studio as well? @mapbox/studio

@jfirebaugh
Copy link
Contributor Author

Current limits: circle: 7, fill-extrusion: 6, fill: 7, heatmap: 7, line: 6, symbol: 4. For symbol layers, the limit is independent in text-* properties and icon-* properties. That is, you can make up to 4 text-* properties data driven, and simultaneously, up to 4 icon-* properties.

These numbers are subject to change, but effectively, given the current set of data-driven properties, the only way to hit this limit is to make all the icon-* paint properties or all the text-* paint properties data-driven simultaneously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cross-platform 📺 Requires coordination with Mapbox GL Native (style specification, rendering tests, etc.)
Projects
None yet
Development

No branches or pull requests

2 participants