static INLINE void
vsplit_add_cache(struct vsplit_frontend *vsplit, unsigned fetch)
{
- unsigned hash = fetch % MAP_SIZE;
+ struct draw_context *draw = vsplit->draw;
+ unsigned hash;
+
+ fetch = MIN2(fetch, draw->pt.max_index);
+
+ hash = fetch % MAP_SIZE;
if (vsplit->cache.fetches[hash] != fetch) {
/* update cache */
}
-static void vsplit_finish(struct draw_pt_front_end *frontend)
+static void vsplit_flush(struct draw_pt_front_end *frontend, unsigned flags)
{
struct vsplit_frontend *vsplit = (struct vsplit_frontend *) frontend;
- vsplit->middle->finish(vsplit->middle);
- vsplit->middle = NULL;
+
+ if (flags & DRAW_FLUSH_STATE_CHANGE) {
+ vsplit->middle->finish(vsplit->middle);
+ vsplit->middle = NULL;
+ }
}
vsplit->base.prepare = vsplit_prepare;
vsplit->base.run = NULL;
- vsplit->base.finish = vsplit_finish;
+ vsplit->base.flush = vsplit_flush;
vsplit->base.destroy = vsplit_destroy;
vsplit->draw = draw;