summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2008-06-09 18:49:13 +0900
committerJosé Fonseca <[email protected]>2008-06-10 08:37:38 +0900
commit4b52f4df1b37918a363d05e0b3db22125e801367 (patch)
tree4731166cfc727cf77b75357f71cb0064af22e114
parenta70684bf256c3d5bc3a729bf9e9cf1a64cb2064a (diff)
pipebuffer: Be more lenient when matching cached buffer sizes.
Reuse cached buffers up to twice as big a requested.
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c7
1 files changed, 5 insertions, 2 deletions
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))