diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-09-19 17:59:51 +0100 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-09-19 20:40:09 +0100 |
commit | 617b39ce9811b0998ceb746c935cc50cacf8a9bc (patch) | |
tree | b84e4eed85fe1ae341b939010bc14f1bffd12fd3 /src | |
parent | b8ecec7abefcd1f0720e448c05e901af0224806a (diff) |
Pad surface dimensions to multiples of 2.
Avoids an assertion failure with softpipe if requested width or height is odd.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 563b5add38..5b4afbd119 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -99,6 +99,10 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, pipe->region_release(pipe, &strb->surface->region); } + /* Softpipe operates on quads, so pad dimensions to multiples of 2 */ + width += width & 1; + height += height & 1; + strb->surface->region = pipe->region_alloc(pipe, cpp, width, height, flags); if (!strb->surface->region) return GL_FALSE; /* out of memory, try s/w buffer? */ |