iris: Avoid flushing for cache history on transfer range flushes

Graphics / Mesa 3D Graphics Library / Mesa - Kenneth Graunke [whitecape.org] - 9 September 2019 22:08 EDT

The VBO module maps a buffer with GL_MAP_FLUSH_EXPLICIT, and keeps appending data, and calling glFlushMappedBufferRange(). We were invalidating the VF cache each time it flushed a new range, which results in a ton of VF flushes.

If the contents of the destination in the target range are undefined (never even possibly written), this patch makes us assume that it's likely not in the cache and so cache invalidations are required. If the destination range is defined, we continue cache flushing as we may need to expunge stale data.

This eliminates 88% of the VF cache invalidates on Manhattan 3.0. Improves performance in Manhattan 3.0 on my Icelake 8x8 with the GPU frequency locked to 700Mhz by 0.376724% +/- 0.0989183% (n=10).

410894c6432 iris: Avoid flushing for cache history on transfer range flushes
src/gallium/drivers/iris/iris_resource.c | 13 +++++++++++--
src/gallium/drivers/iris/iris_resource.h | 2 ++
2 files changed, 13 insertions(+), 2 deletions(-)

Upstream: cgit.freedesktop.org


  • Share