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
  • !8298

Gallium interface and u_upload_mgr changes to eliminate atomics and unbind resources efficiently

  • Review changes

  • Download
  • Patches
  • Plain diff
Merged Marek Olšák requested to merge mareko/mesa:gallium-interface-and-atomics into master Jan 03, 2021
  • Overview 97
  • Commits 16
  • Pipelines 38
  • Changes 139

This MR depends on and contains !8180 (merged), which is squashed into 1 commit here.

This is a very large improvement in CPU overhead mainly due to the elimination of atomic ops for reference counting. When I saw the results in my CPU profiler, my jaw dropped. 😮

The Gallium interface is changed as follows:

  • Many pipe_context functions have their parameter types changed from unsigned to ubyte.
  • Changes that make resource unbinding more efficient:
    • set_vertex_buffers gets new parameter unbind_num_trailing_slots, which unbinds slots after start + count while binding buffers at the same time.
    • set_shader_images gets new parameter unbind_num_trailing_slots
    • set_sampler_views gets new parameter unbind_num_trailing_slots
  • Changes that totally eliminate refcount atomics from st/mesa and u_threaded_context, improving performance significantly on some CPU architectures:
    • set_constant_buffer gets new parameter take_ownership, meaning the driver shouldn't increment the reference count of the buffer. This is used to pass a buffer from st/mesa through u_threaded_context into the driver without touching the reference count on the way.
    • set_vertex_buffers gets new parameter take_ownership, meaning the driver shouldn't increment the reference counts of the buffers.
    • Added pipe_draw_info::take_index_buffer_ownership, meaning the driver should decrement the reference count of the index buffer in draw_vbo. Only used when u_threaded_context is used.

Additionally, all refcount atomic ops in u_upload_mgr are eliminated when returning buffers to callers. There are also other small improvements in this MR.

Edited Jan 05, 2021 by Marek Olšák
Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: gallium-interface-and-atomics