Mesa (master): gallium/u_threaded: rewrite slot layout to reduce wasted space

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed May 5 05:43:01 UTC 2021


Module: Mesa
Branch: master
Commit: 1233c90ab4aa85331dadc7f5e5243ac8252b6669
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1233c90ab4aa85331dadc7f5e5243ac8252b6669

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Wed Apr 28 19:25:53 2021 -0400

gallium/u_threaded: rewrite slot layout to reduce wasted space

A lot of space was wasted due to 16-byte alignment for slots. This new
layout tries to match glthread. Highlights:

- the slot size changed to 8 bytes (was 16), so less padding
- the header size changed to 4 bytes (was 8), so some calls can use
  the remaining 4 bytes in the slot for parameters
- draw merging merges up to 307 draws (was 256) due to space savings
- parameters in structures are sorted based on implicit type alignment
  (uint8_t first, pointers last) to make it easier to utilize the 4 bytes
  after the header and to remove holes
- some structures use smaller types for parameters than pipe_context where
  it's safe (e.g. clear uses float instead of double for depth)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.eric.pelloux-prayer at amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10606>

---

 src/gallium/auxiliary/util/u_threaded_context.c | 857 ++++++++++++------------
 src/gallium/auxiliary/util/u_threaded_context.h |  51 +-
 2 files changed, 448 insertions(+), 460 deletions(-)

Diff:   http://cgit.freedesktop.org/mesa/mesa/diff/?id=1233c90ab4aa85331dadc7f5e5243ac8252b6669


More information about the mesa-commit mailing list