-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Figure out how to make disabled attributes performant in IE #1714
Comments
I haven't read through the ANGLE source yet to see what they are doing but we might be able to improve performance by managing this buffer ourselves since we know the values earlier. |
IE doesn't use ANGLE but I think it has an internal translation to Direct3D so it probably has a similar problem. We can't manually manage a buffer with a stride of 0 because in webgl a 0 stride means "use a stride that matches the type and size". I don't think we can make it read the same buffer value for each vertex from webgl. If that's the case, I think the only way we can improve performance on our side is by generating a new shader for each unique combination of constant vs enabled attributes. There are many possible combinations but in practice there probably won't be that many different combinations in a single style. We'd use glsl preprocessor directives to implement the variations in the shaders. When the style is loaded or changed we'd calculate which shader variations are needed and then compile them by prepending some We could use this approach only for IE/Windows and use constant attributes everywhere else, but we should strongly consider using this approach everywhere so that we don't have different implementations and bugs on different platforms. |
uniforms
allow us to specify global values to WebGL shaders.attribute
s allow us to specify per-feature values.If all features have the same value (i.e. all circles are
red
), we can disable the attributes usinggl.disableVertexAttribArray
and set a global value as if it were auniform
.We converted most data-driven styling related
uniform
s toattribute
s in #1257. Then, there were reports of big performance regressions in IE #1336, so we reverted our changes in #1415One of the big remaining challenges for implementing data driven styling is figuring out how to make disabled attributes performant in IE.
cc @jfirebaugh @tmcw @ansis
The text was updated successfully, but these errors were encountered: