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

Re-bind uniform locations after re-linking program #11583

Merged
merged 1 commit into from
Apr 5, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/mbgl/gl/program.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ class Program {
context.createShader(ShaderType::Fragment, fragmentSource))),
uniformsState((context.linkProgram(program), Uniforms::bindLocations(program))),
attributeLocations(Attributes::bindLocations(program)) {

// Re-link program after manually binding only active attributes in Attributes::bindLocations
context.linkProgram(program);

// We have to re-initialize the uniforms state from the bindings as the uniform locations
// get shifted on some implementations
uniformsState = Uniforms::bindLocations(program);
Copy link
Member

Choose a reason for hiding this comment

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

Nice find!

}

template <class BinaryProgram>
Expand Down