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:
@@ -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++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user