if (init_pb_cache) {
bo->u.real.use_reusable_pool = true;
- pb_cache_init_entry(&screen->pb.bo_cache, bo->cache_entry, &bo->base, heap);
+ pb_cache_init_entry(&screen->pb.bo_cache, bo->cache_entry, &bo->base, mem_type_idx);
} else {
#ifdef ZINK_USE_DMABUF
list_inithead(&bo->u.real.exports);
return NULL;
bo = container_of(entry, struct zink_bo, u.slab.entry);
+ assert(bo->base.placement == mem_type_idx);
pipe_reference_init(&bo->base.reference, 1);
bo->base.size = size;
assert(alignment <= 1 << bo->base.alignment_log2);
if (use_reusable_pool) {
/* Get a buffer from the cache. */
bo = (struct zink_bo*)
- pb_cache_reclaim_buffer(&screen->pb.bo_cache, size, alignment, 0, heap);
+ pb_cache_reclaim_buffer(&screen->pb.bo_cache, size, alignment, 0, mem_type_idx);
+ assert(!bo || bo->base.placement == mem_type_idx);
if (bo)
return &bo->base;
}
if (!bo)
return NULL;
}
+ assert(bo->base.placement == mem_type_idx);
return &bo->base;
}