| Summary: | [WPE] Always call glBindAttribLocation before glLinkProgram | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Adrian Perez <aperez> |
| Component: | WPE WebKit | Assignee: | Adrian Perez <aperez> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | bugs-noreply |
| Priority: | P2 | ||
| Version: | WebKit Local Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
This bug, and the solution for it, was reported by user “mizmar” Thanks a lot! 👏️ Pull request: https://github.com/WebKit/WebKit/pull/12392 Committed 262592@main (0b1da7fc6eb2): <https://commits.webkit.org/262592@main> Reviewed commits have been landed. Closing PR #12392 and removing active labels. |
There are currently two places where we wrongly call glBindAttribLocation() after glLinkProgram(), which is wrong: - Tools/wpe/backends/fdo/WindowViewBackend.cpp:827 - Source/WebKit/UIProcess/API/wpe/qt/WPEQtViewBackend.cpp:111 While this works by chance on most GL implementations (they seem to assign the locations in the same order as declared in shader sources), there is no guarantee about this--and actually the current code was reported to not work on an iMX8 Mini with the proprietary Vivante driver. The documentation tells that glLinkProgram() is what makes the bindings effective: “Attribute variable name-to-generic attribute index bindings for a program object can be explicitly assigned at any time by calling glBindAttribLocation. Attribute bindings do not go into effect until glLinkProgram is called.” -- https://docs.gl/es2/glBindAttribLocation This means we should be calling glLinkProgram() *after* glBindAttribLocation().