Fix issues with ProgramGL.
* Don't re-create the native GL program every link, some program state should
persist between re-linking such as bound attribute locations.
* Forward glBindAttribLocation calls to the ProgramImpl, fixes some chromium
rendering issues because chromium always binds attribute locations,
sometimes with gaps.
* Query the real attrib location before inserting it into the list of attribs.
It was unsafe to rely on the attrib having the same location as its index
into the active attributes.
BUG=angleproject:882
Change-Id: If14b4c4c2f5ebcdaa4f7c5a890b9519d6d4e6e43
Reviewed-on: https://chromium-review.googlesource.com/269991
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index 6900888..8d9a61a 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -252,6 +252,7 @@
void Program::bindAttributeLocation(GLuint index, const char *name)
{
mAttributeBindings.bindAttributeLocation(index, name);
+ mProgram->bindAttributeLocation(index, name);
}
// Links the HLSL code of the vertex and pixel shader by matching up their varyings,