-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Ensure symbol shader attrib bound at 0 is always valid and used #4688
Conversation
(Binding unused/undefined attribs to position 0 causes symbols to not render in Safari)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, the old "don't disable attribute 0" gotcha. We've been bitten several times in the past by this. It would be good to come up with a test that fails if this regresses again. Would this have been hitting
assert(i !== 0); |
In native our strategy is to explicitly bind everything with bindAttribLocation and a fixed order of attributes.
@jfirebaugh I haven't dug too far into it yet, but it appears it's not entering that branch because the It also appears that in Chrome on It'd probably be a good idea to eventually take the same approach as native with explicit bindings. |
Yeah, if you don't define explicit bindings, it auto-assigns them when linking.
This is pretty hard to test. It only happens for me every 5-10 reloads of the map. When the labels are vanishing, the map is also really slow. Since this is a race condition we're trying to remove, I don't think there's a good way to test this. Even if we had a test, we'd only catch the error in a very limited number of test runs. Longer term, it might make more sense to force explicit bindings, similar to how GL native does it. |
Anybody have time to review this? Waiting for the specific bugfix so we can upgrade the version :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sheesh. What a weird issue, nice catch.
…ox#4688) Manually bind a_data at position 0 for symbolSDF shader. Binding unused/undefined attributes to position 0 causes symbols to not render in Safari.
Fixes #4607.
@jfirebaugh found the culprit in Firefox: binding an attrib to position 0 without using it "forces the browser to do expensive emulation work when running on desktop OpenGL platforms, for example on Mac." In this case,
a_size
was frequently being bound to position 0 and was not always used. This PR manually bindsa_data
(which is always used — either this ora_pos_offset
would work) to position 0, and then lets the program dynamically bind the rest.