summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-10-03 10:48:56 +0200
committerMichel Dänzer <[email protected]>2007-10-03 10:48:56 +0200
commitbcdaed2c0a4e70c3dd7c4648442c97540f3c9f1f (patch)
tree86d93b4d5ccbf5150c801803fd6213dffd77e595 /src/mesa/drivers
parent78c6637db571d08720ab4ca669a5b9213edecd02 (diff)
i915tex: Work around texture pitch related performance drops on i915 at least.
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
index 6c285433241..564eb9e0197 100644
--- a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915tex/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,