Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • mesa mesa
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 3.2k
    • Issues 3.2k
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1k
    • Merge requests 1k
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • MesaMesa
  • mesamesa
  • Merge requests
  • !7679

mesa,gallium: use pipe_draw_info in mesa/main and vbo (unification with gallium), perf++

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Marek Olšák requested to merge mareko/mesa:draw-interface2 into master Nov 19, 2020
  • Overview 49
  • Commits 29
  • Pipelines 67
  • Changes 61

This change:

  • reduces CPU overhead for gallium by eliminating the intermediate _mesa_prim structure, exceptions:
    • display lists still use _mesa_prim
  • passes multi draws into gallium drivers as-is, exceptions:
    • glBegin/End multi draws are split into sub-multi draws in st/mesa where the primitive type changes
    • glMultiDrawElementsBaseVertex is split into sub-multi draws in st/mesa where the base vertex changes

There are 2 new driver callbacks that replace Draw: DrawGallium and DrawGalliumComplex

New frontend behavior / possible driver breakage

  • If !index_size, index_bias and has_user_indices are uninitialized.
  • If !index_bounds_valid, min_index and max_index are uninitialized.
  • Drivers aren't allowed to ignore start with user index buffers anymore.

Drivers known to handle the new behavior correctly:

  • d3d12
  • etnaviv
  • freedreno
  • i915
  • iris
  • lima
  • llvmpipe
  • nv30
  • nv50
  • nvc0
  • panfrost
  • r300
  • r600
  • radeonsi
  • softpipe
  • svga
  • swr
  • tegra
  • v3d
  • vc4
  • virgl
  • zink

Performance difference

Command: taskset 0x7007 piglit/bin/drawoverhead (taskset is for predictable Zen CCX scheduling)

Before:

   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                21286, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                21360, 100.3%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                21503, 101.0%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                21489, 101.0%
   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                21415, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                21382, 99.8%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                21622, 101.0%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                21611, 100.9%
   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                21016, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                21425, 101.9%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                21386, 101.8%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                21407, 101.9%
   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                21324, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                21416, 100.4%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                21389, 100.3%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                21457, 100.6%

After:

   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                24449, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                24781, 101.4%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                24483, 100.1%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                24629, 100.7%
   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                24246, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                24103, 99.4%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                24003, 99.0%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                24345, 100.4%
   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                23841, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                23943, 100.4%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                23878, 100.2%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                23881, 100.2%
   1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change,                23639, 100.0%
   2, DrawElements ( 4 VBO| 0 UBO|  0    ) w/ no state change,                23292, 98.5%
   3, DrawElements (16 VBO| 0 UBO|  0    ) w/ no state change,                23640, 100.0%
   4, DrawElements ( 1 VBO| 0 UBO| 16 Tex) w/ no state change,                23538, 99.6%

I can see more than 10% improvement in the noisy data.

Edited Nov 28, 2020 by Marek Olšák
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: draw-interface2