From f73feb9cd6095d82b87e7022c351408e6e232797 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 23 Apr 2010 17:07:14 +0100 Subject: [PATCH] st/xlib: Try to propagate failure to create framebuffer. Doesn't help much, since it is ignored by st_framebuffer_validate. --- src/gallium/state_trackers/glx/xlib/xm_st.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/gallium/state_trackers/glx/xlib/xm_st.c b/src/gallium/state_trackers/glx/xlib/xm_st.c index 294b593bf77..1c678b4f760 100644 --- a/src/gallium/state_trackers/glx/xlib/xm_st.c +++ b/src/gallium/state_trackers/glx/xlib/xm_st.c @@ -125,7 +125,7 @@ xmesa_st_framebuffer_copy_textures(struct st_framebuffer_iface *stfbi, /** * Remove outdated textures and create the requested ones. */ -static void +static boolean xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi, unsigned width, unsigned height, unsigned mask) @@ -183,12 +183,16 @@ xmesa_st_framebuffer_validate_textures(struct st_framebuffer_iface *stfbi, xstfb->textures[i] = xstfb->screen->resource_create(xstfb->screen, &templ); + if (!xstfb->textures[i]) + return FALSE; } } xstfb->texture_width = width; xstfb->texture_height = height; xstfb->texture_mask = mask; + + return TRUE; } static boolean @@ -200,6 +204,7 @@ xmesa_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, struct xmesa_st_framebuffer *xstfb = xmesa_st_framebuffer(stfbi); unsigned statt_mask, new_mask, i; boolean resized; + boolean ret; statt_mask = 0x0; for (i = 0; i < count; i++) @@ -212,8 +217,10 @@ xmesa_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, /* revalidate textures */ if (resized || new_mask) { - xmesa_st_framebuffer_validate_textures(stfbi, - xstfb->buffer->width, xstfb->buffer->height, statt_mask); + ret = xmesa_st_framebuffer_validate_textures(stfbi, + xstfb->buffer->width, xstfb->buffer->height, statt_mask); + if (!ret) + return ret; if (!resized) { enum st_attachment_type back, front; -- 2.30.2