Skip to content

gallium: the big draw refactor of 2021

Mike Blumenkrantz requested to merge zmike/mesa:draw_refactor into master

In #4608 (closed), a discussion was begun regarding the merging of draws where only index_bias changes, and I hypothesized that this would benefit certain apps, such as Unigine Superposition.

I spent a little time thinking about the process for affecting these changes, and, as I do, I then started deleting code. The result is this MR, which accomplishes a few things:

  • splits pipe_draw_info::index_bias off into the multidraw struct for tc draw merging
    • also simplifies the gallium/mesa interfaces a bit by coincidence
  • moves pipe_draw_info::drawid to a separate draw_vbo param
  • slightly optimizes tc draw merging by removing unmergeable draws from the merge path

Initial results show a slight improvement in drawoverhead figures (initial results seemed more exciting but turned out to just be Intel power/thermal wackiness), and I'm hoping to get my updated multidraw implementation for RADV to stop hanging my GPU long enough to find out how much less CPU I'm using in Superposition soon.

Unfortunately, this MR is a massive amount of changes to every driver. I've run piglit and CTS on zink across a couple drivers, and it seems like everything in core is working as it should be. The majority of the churn is in the struct rename patch, which has no functional changes whatsoever, ideally enabling review to be easier for the remainder of the series.

With that said, this will naturally have to wait until after the upcoming branch point to land since making major changes like this just before a release isn't ideal.

Merge request reports