Better cache tracking mechanism
Our current cache tracker is not great:
- We don't track buffers in the vertex cache, and so on.
- The mechanism has a fair bit of overhead due to hash tables - we should switch to per-context BO data, see #32.
- We don't track BOs used for stream out, then bound as a vertex buffer / indirect buffer, and so on. While these don't have a cache, we do need to stall until rendering is complete.
- iris_flush_and_dirty_for_history is kind of confused.
Really, we want top of pipe invalidates, bottom of pipe flushes, and to track which caches things live in, and where they're currently bound, in per-context-BO fields.
Ken prototyped a version of this, but it ended up having a lot of overhead due to having to consider all inputs. We should instead flip the problem and consider all BOs that have been rendered to or written, and see where they're bound. This should be a much smaller list, leading to lower CPU overhead.