From 1bc84102ad4df377df6c8bf5734b886b7683b939 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Wed, 3 Oct 2007 10:48:56 +0200 Subject: [PATCH] i915: Work around texture pitch related performance drops on i915 at least. --- src/mesa/drivers/dri/i915/intel_mipmap_tree.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c index 74f6b2d8515..aefb89ac83c 100644 --- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c @@ -104,7 +104,16 @@ intel_miptree_create(struct intel_context *intel, * replaced at some point by some scheme to only do this when really * necessary. */ - mt->pitch = ((mt->pitch * cpp + 63) & ~63) / cpp; + mt->pitch = (mt->pitch * cpp + 63) & ~63; + + /* XXX: At least the i915 seems very upset when the pitch is a multiple + * of 1024 and sometimes 512 bytes - performance can drop by several + * times. Go to the next multiple of 64 for now. + */ + if (!(mt->pitch & 511)) + mt->pitch += 64; + + mt->pitch /= cpp; } mt->region = intel_region_alloc(intel->intelScreen, -- 2.30.2