Pad surface dimensions to multiples of 2.
authorMichel Dänzer <michel@tungstengraphics.com>
Wed, 19 Sep 2007 16:59:51 +0000 (17:59 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Wed, 19 Sep 2007 19:40:09 +0000 (20:40 +0100)
Avoids an assertion failure with softpipe if requested width or height is odd.

src/mesa/state_tracker/st_cb_fbo.c

index 563b5add3885b79731500f89f7cb04357790bc58..5b4afbd11960b275977a99be3d1a9bbb53de5ebe 100644 (file)
@@ -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? */