Skip to content

mesa,gallium: rework of draw interfaces and multi draw support in gallium, touches all drivers

Marek Olšák requested to merge mareko/mesa:draw-interface1 into master

This MR is a prerequisite for unification of draw interfaces between core Mesa and Gallium. (using pipe_draw_info in core Mesa)

It's also a massive redesign of draw_vbo to support multi draws and pass indirect draw info differently. It's also a cleanup of core Mesa draw code.

Core Mesa Changes:

  • Added Driver.DrawTransformFeedback to get this out of Driver.Draw
  • Added bool primitive_restart and unsigned restart_index into Driver.Draw (for display lists to disable it trivially and to match gallium)
  • Many cleanups

Gallium changes:

  • New draw_vbo interface: void draw_vbo(struct pipe_context *ctx, struct pipe_draw_info *info, struct pipe_draw_indirect_info *indirect, struct pipe_draw_start_count *draws, unsigned num_draws);
  • count_from_stream_output moved to pipe_draw_indirect_info
  • Added bool pipe_draw_info::index_bounds_valid
  • Added bool pipe_draw_info::increment_draw_id to choose between glMultiDraw behavior and internal multi draw behavior
  • Added PIPE_CAP_MULTI_DRAW for direct multi draws
  • Small improvements to u_threaded_context

radeonsi receives full direct multi draw support.

Note that gallium multi draws are not generated by OpenGL yet. That will be enabled by the next MR after this.

Gallium multi draws don't support the following (this may be addressed in a future MR, but it's not certain):

  • different base vertex per draw
  • different primitive type per draw
  • arbitrary draw ID per draw (not just constant or incrementing)
  • specification of line stipple reset state per draw (same as _mesa_prim::begin)
Edited by Marek Olšák

Merge request reports