This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
Re-bind uniform locations after re-linking program - #11583
Merged
Merged
Conversation
- On some gl implementations the uniform locations are shifted after linking the program a second time, resulting in errors when using any uniform. On some implementations they are actually doubled. Re-binding the uniforms after selectively binding the vertex attributes prevents this.
kkaefer
approved these changes
Apr 4, 2018
|
|
||
| // We have to re-initialize the uniforms state from the bindings as the uniform locations | ||
| // get shifted on some implementations | ||
| uniformsState = Uniforms::bindLocations(program); |
This was referenced Apr 10, 2018
This was referenced Feb 7, 2019
astojilj
added a commit
that referenced
this pull request
Apr 18, 2019
Remove re-linking programs as redundant. It costs (cheaper to link once than twice) and is not that common GL API usage pattern (subjective). Initial idea was to enable work on optimization what would reduce number of attrib setup calls in case that VAO is not available (#9433). As such optimization is not implemented, we can remove re-linking. Related to closed PR #9433 and PR #11583.
astojilj
added a commit
that referenced
this pull request
May 20, 2019
Remove re-linking programs as redundant. It costs (cheaper to link once than twice) and is not that common GL API usage pattern (subjective). Initial idea was to enable work on optimization what would reduce number of attrib setup calls in case that VAO is not available (#9433). As such optimization is not implemented, we can remove re-linking. Related to closed PR #9433 and PR #11583.
astojilj
added a commit
that referenced
this pull request
May 20, 2019
Remove re-linking programs as redundant. It costs (cheaper to link once than twice) and (subjective) is not that common GL API usage pattern, although perfectly legal and permitted. Initial idea, behind the removed code, was to enable work on optimization that would reduce number of attrib setup calls in case when VAO is not available (as described in #9433). As such optimization is not implemented, and it is arguable if it makes sense to do it now, we can remove re-linking. Related to closed PRs #9433 and PR #11583. I have [measured the time spent just on relinking](https://gist.github.com/astojilj/29bd5a5c5dc0b2d9f29ecb660da07fbf) using release build on iPhone SE (A9, same as iPhone 6S): - 1st run after reboot or installation Total 37.14ms, average per program:1.86ms - reopening Total: 2.47ms, average per program: 0.12ms This time we save using the patch here.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On some gl implementations the uniform locations are shifted after linking the program a second time, resulting in errors when using any uniform. (On some implementations they are actually doubled). Re-binding the uniforms after selectively binding the vertex attributes prevents this.
This currently prevents running on the Android emulator with hardware acceleration.
Fixes #11266