Skip to content

vbo/save: avoid dangling_attr_ref situation

Pierre-Eric Pelloux-Prayer requested to merge pepp/mesa:dri_vbo_cleanup into main

dangling_attr_ref=true can be set when the following happens:

  glBegin(GL_TRIANGLES)
  glVertex(...)
  glVertex(...)
  glColor4(...)
  glVertex(...)

When glColor4 is hit, the first 2 vertices are copied to the vertex store by upgrade_vertex, but since this is done before glColor4 new values are copied, we make a note to fixup these attribute laters using dangling_attr_ref.

This causes very slow rendering. What this commit does instead, is in this situation, the new attribute values are backported to the vertex store for the copied vertices after upgrade_vertex is done updating the layout.

This avoids the slow corner case.

Closes: #7912 (closed)

(the first commit is a minor cleanup)

Merge request reports