Skip to content

Commit

Permalink
Manually bind a_data attribute to location 0 for symbol_icon shader (…
Browse files Browse the repository at this point in the history
…see #4688)
  • Loading branch information
Lauren Budorick committed Jun 6, 2017
1 parent 943dc39 commit b2eedec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/render/painter.js
Original file line number Diff line number Diff line change
Expand Up @@ -394,10 +394,10 @@ class Painter {
gl.attachShader(program, vertexShader);


// For the symbol program, manually ensure the attrib bound to position 0 is always used (either a_data or a_pos_offset would work here).
// For the symbol programs, manually ensure the attrib bound to position 0 is always used (either a_data or a_pos_offset would work here).
// This is needed to fix https://github.com/mapbox/mapbox-gl-js/issues/4607 — otherwise a_size can be bound first, causing rendering to fail.
// All remaining attribs will be bound dynamically below.
if (name === 'symbolSDF') {
if (name === 'symbolSDF' || name === 'symbolIcon') {
gl.bindAttribLocation(program, 0, 'a_data');
}

Expand Down
2 changes: 2 additions & 0 deletions src/shaders/symbol_icon.vertex.glsl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// NOTE: the a_data attribute in this shader is manually bound (see https://github.com/mapbox/mapbox-gl-js/issues/4607 / #4728).
// If removing or renaming a_data, revisit the manual binding in painter.js accordingly.
attribute vec4 a_pos_offset;
attribute vec2 a_label_pos;
attribute vec4 a_data;
Expand Down

0 comments on commit b2eedec

Please sign in to comment.