Mesa (gallium-0.2): nouveau: include and calc offset before changing dimensions for next level

Patrice Mandin pmandin at kemper.freedesktop.org
Sun Feb 8 16:04:35 UTC 2009


Module: Mesa
Branch: gallium-0.2
Commit: b907d4cd8fafe719b4f87d877562829548937485
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b907d4cd8fafe719b4f87d877562829548937485

Author: Patrice Mandin <patmandin at gmail.com>
Date:   Sun Feb  8 17:03:47 2009 +0100

nouveau: include and calc offset before changing dimensions for next level

---

 src/gallium/drivers/nv04/nv04_surface_2d.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c
index 1892055..1b5d980 100644
--- a/src/gallium/drivers/nv04/nv04_surface_2d.c
+++ b/src/gallium/drivers/nv04/nv04_surface_2d.c
@@ -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;




More information about the mesa-commit mailing list