Make the Program's semantic index D3D-only.
This concept isn't strictly necessary for GL-side validation. Instead
we can use a bitset to track active attribs, and determine is a
particular location is active.
BUG=angleproject:1123
Change-Id: If7a920a3071672116bafffb3368671f721723b65
Reviewed-on: https://chromium-review.googlesource.com/294570
Reviewed-by: Geoff Lang <geofflang@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/libANGLE/validationES.cpp b/src/libANGLE/validationES.cpp
index 73aafab..cc8a73b 100644
--- a/src/libANGLE/validationES.cpp
+++ b/src/libANGLE/validationES.cpp
@@ -36,13 +36,11 @@
const VertexArray *vao = state.getVertexArray();
const auto &vertexAttribs = vao->getVertexAttributes();
- const int *semanticIndexes = program->getSemanticIndexes();
size_t maxEnabledAttrib = vao->getMaxEnabledAttribute();
for (size_t attributeIndex = 0; attributeIndex < maxEnabledAttrib; ++attributeIndex)
{
const VertexAttribute &attrib = vertexAttribs[attributeIndex];
- bool attribActive = (semanticIndexes[attributeIndex] != -1);
- if (attribActive && attrib.enabled)
+ if (program->isAttribLocationActive(attributeIndex) && attrib.enabled)
{
gl::Buffer *buffer = attrib.buffer.get();
@@ -1564,11 +1562,10 @@
gl::Program *program = state.getProgram();
const VertexArray *vao = state.getVertexArray();
- for (int attributeIndex = 0; attributeIndex < MAX_VERTEX_ATTRIBS; attributeIndex++)
+ for (size_t attributeIndex = 0; attributeIndex < MAX_VERTEX_ATTRIBS; attributeIndex++)
{
const VertexAttribute &attrib = vao->getVertexAttribute(attributeIndex);
- bool active = (program->getSemanticIndex(attributeIndex) != -1);
- if (active && attrib.divisor == 0)
+ if (program->isAttribLocationActive(attributeIndex) && attrib.divisor == 0)
{
return true;
}