[Mesa-dev] [PATCH 0/6] cso: Enforce maximum size of sampler cache again

Michel Dänzer michel at daenzer.net
Fri Dec 16 09:52:01 UTC 2016


From: Michel Dänzer <michel.daenzer at amd.com>

It turned out to be slightly more complicated than I'd expected, but I
think I've found a good solution with low (hopefully insignificant)
additional overhead. In fact, thanks to the optimization in patch 3, the
overhead may be slightly lower in general than before the series.

While working on this, I stumbled over the bug fixed in patch 1.

Tested with piglit gpu.py (no regressions on Kaveri) and:

* Enabling the testing code in cso_create_context which sets the maximum
  CSO cache size to 4 entries.
* Adding assertions in delete_sampler_state that the state being deleted
  isn't currently bound.
* Running demos/textures from mesa-demos and hitting the f key dozens of
  times, cycling through different texture filtering modes.

The assertions in delete_sampler_state failed quickly without patch 5.

Michel Dänzer (6):
  cso: Don't restore nr_samplers in cso_restore_fragment_samplers
  cso: Store pointers to struct cso_sampler in struct sampler_info
  cso: Optimize cso_save/restore_fragment_samplers
  cso: Store hash key in struct cso_sampler
  cso: Make sanitize_hash safe for samplers
  Revert "cso: don't release sampler states that are bound"

 src/gallium/auxiliary/cso_cache/cso_cache.c   |  4 +-
 src/gallium/auxiliary/cso_cache/cso_cache.h   |  1 +
 src/gallium/auxiliary/cso_cache/cso_context.c | 92 ++++++++++++++++++++++-----
 3 files changed, 77 insertions(+), 20 deletions(-)

-- 
2.11.0



More information about the mesa-dev mailing list