Skip to content

glthread: finish the implementation of non-VBO vertex uploads and other changes and fixes

Marek Olšák requested to merge mareko/mesa:glthread-uploads into main

This is mostly about non-VBO uploads. The previous code worked fine (minus possible bugs), but it relied on u_vbuf to handle some corner cases. The plan is to skip the u_vbuf determination logic when glthread is enabled, so we need to make sure that glthread handles everything.

The 3 biggest changes in glthread are:

  • the conversion of glDrawElements into glBegin/End for the "unroll_indices" vertex upload optimization that u_vbuf implements using the translate module (basically do it like glArrayElement in glthread)
  • the lowering of glDrawIndirect into glDraw(non-indirect) to get the draw info for uploading non-VBO vertex arrays (basically push glDrawIndirect through the direct path, which handles non-VBO vertex arrays; this also adds the option for glthread to set the draw ID for lowering indirect multidraws)
  • the unbinding of uploaded vertices and indices after draws is removed because there is never a case when we need to keep user buffers bound in mesa/main (this is allowed by handling all uploads in glthread)

There are lots of cleanups and some fixes.

Merge request reports