From 48ae5cf09d733497519328d513c4176bfa1c8fc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Mon, 14 Jan 2008 16:30:58 +0100 Subject: [PATCH] i965: Fix byte vs. pixel unit mixup for aligned texture pitch. I sincerely hope I don't manage to mess this up yet again... Thanks again to Todd Merrill for pointing out the problem and testing the fix on IRC. --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 78191d10d30..8548bc88bac 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -128,7 +128,7 @@ int intel_miptree_pitch_align (struct intel_context *intel, int pitch) { if (!mt->compressed) - pitch = (pitch * mt->cpp + 3) & ~3; + pitch = ((pitch * mt->cpp + 3) & ~3) / mt->cpp; return pitch; }