Mesa (master): st: assert on pipe_buffer_create failure

Keith Whitwell keithw at kemper.freedesktop.org
Mon Apr 20 15:12:27 UTC 2009


Module: Mesa
Branch: master
Commit: 53c6467aea129b03cf960a0854c1746ce52a2daa
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=53c6467aea129b03cf960a0854c1746ce52a2daa

Author: Keith Whitwell <keithw at vmware.com>
Date:   Fri Apr 17 17:11:09 2009 +0100

st: assert on pipe_buffer_create failure

This needs a proper fix to propogate the out-of-memory condition back
up to Mesa and the app as a GL error.  Until then, at least catch the
problem at its source.

---

 src/mesa/state_tracker/st_cb_bufferobjects.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c
index 1025265..ea9f73c 100644
--- a/src/mesa/state_tracker/st_cb_bufferobjects.c
+++ b/src/mesa/state_tracker/st_cb_bufferobjects.c
@@ -169,6 +169,11 @@ st_bufferobj_data(GLcontext *ctx,
 
    st_obj->buffer = pipe_buffer_create( pipe->screen, 32, buffer_usage, size );
 
+   /* We don't seem to have any good way of passing failure to
+    * allocate up to Mesa??
+    */
+   assert(st_obj->buffer);
+
    st_obj->size = size;
 
    if (data)




More information about the mesa-commit mailing list