[core] Don't crash when attribute count is exceeded
This commit is contained in:
committed by
Lauren Budorick
parent
f6da3ba9be
commit
c3346f473a
@@ -9,7 +9,11 @@ void VertexArray::bind(Context& context, BufferID indexBuffer, const AttributeBi
|
||||
context.bindVertexArray = state->vertexArray;
|
||||
state->indexBuffer = indexBuffer;
|
||||
|
||||
for (AttributeLocation location = 0; location < MAX_ATTRIBUTES; ++location) {
|
||||
state->bindings.reserve(bindings.size());
|
||||
for (AttributeLocation location = 0; location < bindings.size(); ++location) {
|
||||
if (state->bindings.size() <= location) {
|
||||
state->bindings.emplace_back(context, AttributeLocation(location));
|
||||
}
|
||||
state->bindings[location] = bindings[location];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user