summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c7
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;