From 4b52f4df1b37918a363d05e0b3db22125e801367 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Mon, 9 Jun 2008 18:49:13 +0900 Subject: pipebuffer: Be more lenient when matching cached buffer sizes. Reuse cached buffers up to twice as big a requested. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 4bd3f94a6c0..f1a457dde4d 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -207,8 +207,11 @@ pb_cache_is_buffer_compat(struct pb_cache_buffer *buf, size_t size, const struct pb_desc *desc) { - /* TODO: be more lenient with size */ - if(buf->base.base.size != size) + if(buf->base.base.size < size) + return FALSE; + + /* be lenient with size */ + if(buf->base.base.size >= 2*size) return FALSE; if(!pb_check_alignment(desc->alignment, buf->base.base.alignment)) -- cgit v1.2.3