nouveau: include and calc offset before changing dimensions for next level
authorPatrice Mandin <patmandin@gmail.com>
Sun, 8 Feb 2009 16:03:47 +0000 (17:03 +0100)
committerPatrice Mandin <patmandin@gmail.com>
Sun, 8 Feb 2009 16:04:09 +0000 (17:04 +0100)
src/gallium/drivers/nv04/nv04_surface_2d.c

index 1892055418b00b78dee772f8c5ca1fa84e5a1739..1b5d980468df645fb0135ca202a20e3e85a6a42c 100644 (file)
@@ -1,6 +1,7 @@
 #include "pipe/p_context.h"
 #include "pipe/p_format.h"
 #include "util/u_memory.h"
+#include "util/u_math.h"
 
 #include "nouveau/nouveau_winsys.h"
 #include "nouveau/nouveau_util.h"
@@ -159,10 +160,10 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx,
                  }
                }
 
+               /* FIXME: need to know how many bytes per pixel */
+               offset += align(w * h * 2 /*src->block.size*/, 64);
                w >>= 1;
                h >>= 1;
-               /* FIXME: need to know how many bytes per pixel */
-               offset += align(w * h * 2, 64);
        }
 
        return 0;