Remove Shader::getSemanticIndex.
This method doesn't really belong to GL, and was only used by the D3D
back-end to compute some attribute indexes. Simplify the code by
moving it into ProgramD3D. Also add the ability for the ShaderImpl to
assert that any pending compiles have resolved.
BUG=angleproject:1156
Change-Id: I0af3d3082ff8c908e6a87b9734989efbefd28808
Reviewed-on: https://chromium-review.googlesource.com/526336
Commit-Queue: Jamie Madill <jmadill@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/Program.cpp b/src/libANGLE/Program.cpp
index 3ec48d1..fdd3164 100644
--- a/src/libANGLE/Program.cpp
+++ b/src/libANGLE/Program.cpp
@@ -382,6 +382,19 @@
return uniformIndex - mSamplerUniformRange.low();
}
+GLuint ProgramState::getAttributeLocation(const std::string &name) const
+{
+ for (const sh::Attribute &attribute : mAttributes)
+ {
+ if (attribute.name == name)
+ {
+ return attribute.location;
+ }
+ }
+
+ return static_cast<GLuint>(-1);
+}
+
Program::Program(rx::GLImplFactory *factory, ShaderProgramManager *manager, GLuint handle)
: mProgram(factory->createProgram(mState)),
mValidated(false),
@@ -941,15 +954,7 @@
GLuint Program::getAttributeLocation(const std::string &name) const
{
- for (const sh::Attribute &attribute : mState.mAttributes)
- {
- if (attribute.name == name)
- {
- return attribute.location;
- }
- }
-
- return static_cast<GLuint>(-1);
+ return mState.getAttributeLocation(name);
}
bool Program::isAttribLocationActive(size_t attribLocation) const