Skip to content

add attribute unpacking code for gl-native - #4363

Merged
jfirebaugh merged 1 commit into
masterfrom
shader-funx
Mar 8, 2017
Merged

jfirebaugh merged 1 commit into
masterfrom
shader-funx

Conversation

@mollymerp

Copy link
Copy Markdown
Contributor

@mollymerp mollymerp changed the title add attribute unpacking code for gl-native 🤖 add attribute unpacking code for gl-native Mar 6, 2017

@mourner mourner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few minor nitpicks.

Comment thread src/shaders/symbol_sdf.vertex.glsl Outdated
#ifdef MAPBOX_GL_NATIVE
mediump vec2 a_pos = a_pos_offset.xy;
mediump vec2 a_offset = a_pos_offset.zw;
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be explicitly mediump?

Comment thread src/shaders/symbol_sdf.vertex.glsl Outdated
attribute vec4 a_data;



Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Accidental newlines

Comment thread src/shaders/symbol_icon.vertex.glsl Outdated
attribute vec2 a_pos;
attribute vec2 a_offset;
#endif

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we just switch to packed representation for both JS & Native at the same time instead of adding an ifdef?

Comment thread src/shaders/_prelude.vertex.glsl Outdated
// const auto v1 = static_cast<uint16_t>( static_cast<uint16_t>(color.r*255)*256 + color.g*255);
// const auto v2 = static_cast<uint16_t>( static_cast<uint16_t>(color.b*255)*256 + color.a*255);
// return {{ static_cast<float>(v1), static_cast<float>(v2) }};
// }

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we document this in a simpler way instead of adding a C++ comment in GLSL?

@anandthakker

Copy link
Copy Markdown
Contributor

@mollymerp heads up, I rebased / force-pushed

@anandthakker

anandthakker commented Mar 8, 2017 •

Copy link
Copy Markdown
Contributor

The dependent native PR needs to go into the release branch instead of master, so:

I'd love to hear that I'm overcomplicating this.....

@jfirebaugh jfirebaugh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to hear that I'm overcomplicating this.....

You're overcomplicating this. 😄 Per chat, I think we should just merge all gl-native changes into the release branch.

@anandthakker

Copy link
Copy Markdown
Contributor

You're overcomplicating this.

🎉 Hooray!

I'll rebase this to master and update the gl-native sha

@jfirebaugh
jfirebaugh merged commit 69bb05c into master Mar 8, 2017
@jfirebaugh
jfirebaugh deleted the shader-funx branch March 8, 2017 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants