Mesa (7.11): pb_bufmgr_cache: flush cache when create_buffer fails and try again

Marek Olšák mareko at kemper.freedesktop.org
Thu Oct 20 22:46:11 UTC 2011


Module: Mesa
Branch: 7.11
Commit: 8b4315cb47d254559b2021576da998efcd7b26d5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8b4315cb47d254559b2021576da998efcd7b26d5

Author: Marek Olšák <maraeo at gmail.com>
Date:   Sat Oct  8 00:27:16 2011 +0200

pb_bufmgr_cache: flush cache when create_buffer fails and try again

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 39d7de69b1e3317ba813b4475f2b6132d70f8eef)

---

 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 25accef..87603d9 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;




More information about the mesa-commit mailing list