Fix WebGLVAOWrapper failing when it can't find an expected attribute.

This can happen on systems with different GLSL compilers,
which optimize entire unused attributes.
This commit is contained in:
Ben Richards 2024-11-19 10:44:34 +13:00
parent 6979e7b96b
commit af90c85460

View file

@ -143,7 +143,8 @@ var WebGLVAOWrapper = new Class({
var attributeIndex = glAttributeNames.get(layout.name);
if (attributeIndex === undefined)
{
throw new Error('Attribute not found: ' + layout.name);
// This attribute is not used in the shader, so skip it.
continue;
}
var attributeInfo = glAttributes[attributeIndex];
layout.location = attributeInfo.location;