mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 20:28:04 +02:00
fix invalid error detection problem in _mesa_bind_attrib_location(), bug 10602
This commit is contained in:
parent
183d8e0620
commit
9f66025f54
1 changed files with 11 additions and 7 deletions
|
|
@ -323,7 +323,13 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
|
|||
return;
|
||||
}
|
||||
|
||||
oldIndex = _mesa_get_attrib_location(ctx, program, name);
|
||||
if (shProg->LinkStatus) {
|
||||
/* get current index/location for the attribute */
|
||||
oldIndex = _mesa_get_attrib_location(ctx, program, name);
|
||||
}
|
||||
else {
|
||||
oldIndex = -1;
|
||||
}
|
||||
|
||||
/* this will replace the current value if it's already in the list */
|
||||
i = _mesa_add_attribute(shProg->Attributes, name, size, index);
|
||||
|
|
@ -331,14 +337,12 @@ _mesa_bind_attrib_location(GLcontext *ctx, GLuint program, GLuint index,
|
|||
_mesa_error(ctx, GL_OUT_OF_MEMORY, "glBindAttribLocation");
|
||||
}
|
||||
|
||||
if (shProg->VertexProgram && oldIndex >= 0) {
|
||||
if (shProg->VertexProgram && oldIndex >= 0 && oldIndex != index) {
|
||||
/* If the index changed, need to search/replace references to that attribute
|
||||
* in the vertex program.
|
||||
*/
|
||||
_slang_remap_attribute(&shProg->VertexProgram->Base, oldIndex, index);
|
||||
}
|
||||
|
||||
#if 0
|
||||
printf("===== post BindAttrib:\n");
|
||||
_mesa_print_program(&shProg->VertexProgram->Base);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue