radeon: fix fbo size calculation to after pitch
authorDave Airlie <airlied@linux.ie>
Mon, 24 Aug 2009 21:20:37 +0000 (07:20 +1000)
committerDave Airlie <airlied@linux.ie>
Mon, 24 Aug 2009 21:21:03 +0000 (07:21 +1000)
src/mesa/drivers/dri/radeon/radeon_fbo.c

index 3d7c9708e1a9e413a1c5ab52f26ffdfd10bacb11..6f0cc08770ca4f521236e983619226d68ac8a52d 100644 (file)
@@ -178,12 +178,13 @@ radeon_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb,
                                              width, height);
    }
    else {
-     uint32_t size = width * height * cpp;
+     uint32_t size;
      uint32_t pitch = ((cpp * width + 63) & ~63) / cpp;
 
      fprintf(stderr,"Allocating %d x %d radeon RBO (pitch %d)\n", width,
          height, pitch);
 
+     size = pitch * height * cpp;
      rrb->pitch = pitch * cpp;
      rrb->cpp = cpp;
      rrb->bo = radeon_bo_open(radeon->radeonScreen->bom,