diff options
author | Marek Olšák <[email protected]> | 2011-10-08 00:27:16 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2011-10-08 18:54:28 +0200 |
commit | 39d7de69b1e3317ba813b4475f2b6132d70f8eef (patch) | |
tree | f5437164d5079239074cb1f805abfefcc9b624a2 /src | |
parent | a66a2359d72ceb67781c7e366f34265c7aaae91a (diff) |
pb_bufmgr_cache: flush cache when create_buffer fails and try again
NOTE: This is a candidate for the stable branches.
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 58721c068e2..0e6896afd0a 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -324,6 +324,13 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, return NULL; buf->buffer = mgr->provider->create_buffer(mgr->provider, size, desc); + + /* Empty the cache and try again. */ + if (!buf->buffer) { + mgr->base.flush(&mgr->base); + buf->buffer = mgr->provider->create_buffer(mgr->provider, size, desc); + } + if(!buf->buffer) { FREE(buf); return NULL; |