GPU: Fix Negative Shift
glAttributes also include `gl_` names. These don't have a location and should be ignored during shader interface creation. Those internal names received a location of -1 and therefore the bitmasking was undefined. Users wouldn't notice this, but ASAN warned developers of this situation. ASAN could quit making ASAN un-usable as most shaders have this issue. Reviewed By: Clément Foucault` Differential Revision: https://developer.blender.org/D7448
This commit is contained in:
parent
a1420da027
commit
d34c5eec19
|
@ -254,8 +254,11 @@ GPUShaderInterface *GPU_shaderinterface_create(int32_t program)
|
|||
}
|
||||
|
||||
/* TODO: reject DOUBLE gl_types */
|
||||
|
||||
input->location = glGetAttribLocation(program, name);
|
||||
/* Ignore OpenGL names like `gl_BaseInstanceARB`, `gl_InstanceID` and `gl_VertexID`. */
|
||||
if (input->location == -1) {
|
||||
continue;
|
||||
}
|
||||
|
||||
shaderface->enabled_attr_mask |= (1 << input->location);
|
||||
|
||||
|
|
Loading…
Reference in New Issue