Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Backport attribute binding changes to release branch - #9440

Merged
jfirebaugh merged 12 commits into
release-ios-v3.6.0-android-v5.1.0from
backport-vao
Jul 17, 2017
Merged

jfirebaugh merged 12 commits into
release-ios-v3.6.0-android-v5.1.0from
backport-vao

Conversation

@jfirebaugh

@jfirebaugh jfirebaugh commented Jul 6, 2017 •

Copy link
Copy Markdown
Contributor

Backports #9433 and prior prerequisites to release-ios-v3.6.0-android-v5.1.0. I didn't see a good way to cherry pick a more minimal fix; this code is all interdependent.

jfirebaugh and others added 5 commits July 6, 2017 13:13
The current value is not passed to `SymbolSizeBinder::uniformValues`, so we shouldn't check `currentValue.isConstant()` in `SymbolSizeBinder::attributeBindings`. If it were true, then we might end up using attribute bindings that are appropriate only for a constant property, but uniform bindings that are appropriate only for a source or composite function.

Instead, just wait for a new bucket to be generated. This will happen automatically, since icon/text-size are layout properties.
Rather than binding constant attributes that will never be used, just disable the attribute.
… reflect naming in the shader

not sure how this ever worked
…ute limits (#9373)

Introducing two new attributes to enable property functions for line-width (#9250) pushed the attribute count over GL_MAX_VERTEX_ATTRIBS on some devices. Now we selectively bind only attributes that are used, making it unlikely to surpass GL_MAX_VERTEX_ATTRIBS.
@jfirebaugh jfirebaugh mentioned this pull request Jul 6, 2017
5 tasks done
@boundsj boundsj added this to the ios-v3.6.1 milestone Jul 7, 2017
@kkaefer kkaefer added the Core The cross-platform C++ core, aka mbgl label Jul 12, 2017
These changes are necessary for programs whose set of active attributes is not fixed at compile time by a template parameter pack, but rather varies based on the generated shader text at runtime. In such cases, the attribute location of a given named attribute may vary between instances of the same Program.

Previously, attribute bindings were implicitly associated with a location based on template parameter order, and -1 was used to indicate an inactive attribute. This left us unable to disable the appropriate attribute when it went from active to inactive. Now, the state tracker for bindings explicitly associates locations and state, and an empty optional is used to indicate an inactive attribute.

In addition, a gl::VertexArray class is now exposed, allowing more flexibility in the relationship between Programs, Segments, and attribute bindings. In this commit, that relationship does not change, but the subsequent commit adjusts it to match gl-js, reduce rebinds, and work around buggy VAO implementations.

VertexArray uses a pimpl idiom in order to support implementations that lack the VAO extension. In that case, all VertexArrays share global binding state, reflecting the platform reality in the absence of VAOs, while still providing a uniform API.
Reduces rebinding, matches gl-js, and works around the buggy VAO implementation on PowerVR SGX544 GPUs.
@jfirebaugh
jfirebaugh merged commit 2d14747 into release-ios-v3.6.0-android-v5.1.0 Jul 17, 2017
@jfirebaugh
jfirebaugh deleted the backport-vao branch July 17, 2017 16:19
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Core The cross-platform C++ core, aka mbgl

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants