GLShaderInterface: Fix undefined behavior when attributes are optimized away.

Optimized out attributes returns an invalid location `-1` resulting in
an undefined behavior shift.
This commit is contained in:
Clément Foucault
2022-02-15 00:48:18 +01:00
parent b744081f83
commit d7d827789b

View File

@@ -391,7 +391,9 @@ GLShaderInterface::GLShaderInterface(GLuint program, const shader::ShaderCreateI
else {
input->location = input->binding = attr.index;
}
enabled_attr_mask_ |= (1 << input->location);
if (input->location != -1) {
enabled_attr_mask_ |= (1 << input->location);
}
input++;
}