Reject shaders using attribute aliasing.
The current code rejects any shaders that use more than the caps
allow, but a bug would crash us before the check. We don't support
aliasing in shaders that use a lot of uniforms because this
causes problems with the D3D back-end, currently. This changes the
crash in the dEQP aliasing tests to a link error.
See dEQP-GLES2.functional.attribute_location.bind_aliasing.*
BUG=angleproject:901
Change-Id: I6906d3345abe9f89cfa0aa6cec4be26b5b2851d0
Reviewed-on: https://chromium-review.googlesource.com/266928
Tested-by: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Brandon Jones <bajones@chromium.org>
diff --git a/src/libANGLE/renderer/ProgramImpl.cpp b/src/libANGLE/renderer/ProgramImpl.cpp
index 4ce3f57..b0267ae 100644
--- a/src/libANGLE/renderer/ProgramImpl.cpp
+++ b/src/libANGLE/renderer/ProgramImpl.cpp
@@ -131,4 +131,26 @@
mTransformFeedbackLinkedVaryings.clear();
}
+void ProgramImpl::setShaderAttribute(size_t index, const sh::Attribute &attrib)
+{
+ if (mShaderAttributes.size() <= index)
+ {
+ mShaderAttributes.resize(index + 1);
+ }
+ mShaderAttributes[index] = attrib;
+}
+
+void ProgramImpl::setShaderAttribute(size_t index, GLenum type, GLenum precision, const std::string &name, GLint size, int location)
+{
+ if (mShaderAttributes.size() <= index)
+ {
+ mShaderAttributes.resize(index + 1);
+ }
+ mShaderAttributes[index].type = type;
+ mShaderAttributes[index].precision = precision;
+ mShaderAttributes[index].name = name;
+ mShaderAttributes[index].arraySize = size;
+ mShaderAttributes[index].location = location;
+}
+
}