summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2010-04-23 17:07:14 +0100
committerJosé Fonseca <[email protected]>2010-04-23 17:08:11 +0100
commitf73feb9cd6095d82b87e7022c351408e6e232797 (patch)
treeace03607ea86ca717b8d60a1b3f50896430132e9 /src/gallium/state_trackers
parentd7996beb4ca01ba9ca83e71d2833278cb4df3a75 (diff)
st/xlib: Try to propagate failure to create framebuffer.
Doesn't help much, since it is ignored by st_framebuffer_validate.
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/glx/xlib/xm_st.c13
1 files 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;