summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_fbo.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-10-10 11:04:48 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-10-10 11:04:48 -0600
commit500e3af175cf8ef66bad23ae3b9e440670421ecd (patch)
treebb67f35f2b81060b55bd8f8bf111ca23208ed5a8 /src/mesa/state_tracker/st_cb_fbo.c
parentfa7a5898761fc106c9dbef6f640ce4654eae5136 (diff)
fix width/height padding that caused failed assertion upon window resize
Diffstat (limited to 'src/mesa/state_tracker/st_cb_fbo.c')
-rw-r--r--src/mesa/state_tracker/st_cb_fbo.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c
index 5b4afbd119..4a21ff5371 100644
--- a/src/mesa/state_tracker/st_cb_fbo.c
+++ b/src/mesa/state_tracker/st_cb_fbo.c
@@ -64,6 +64,7 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
const struct pipe_format_info *info = st_get_format_info(pipeFormat);
GLuint cpp;
GLbitfield flags = PIPE_SURFACE_FLAG_RENDER; /* want to render to surface */
+ GLuint width2, height2;
assert(info);
if (!info)
@@ -100,10 +101,10 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
}
/* Softpipe operates on quads, so pad dimensions to multiples of 2 */
- width += width & 1;
- height += height & 1;
+ width2 = (width + 1) & ~1;
+ height2 = (height + 1) & ~1;
- strb->surface->region = pipe->region_alloc(pipe, cpp, width, height, flags);
+ strb->surface->region = pipe->region_alloc(pipe, cpp, width2, height2, flags);
if (!strb->surface->region)
return GL_FALSE; /* out of memory, try s/w buffer? */