summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-08-13 13:22:43 +0200
committerMichel Dänzer <[email protected]>2007-08-13 17:58:45 +0200
commitb7a9222dc7492181588cedd62b94482fab8e9c95 (patch)
treeaf23dba2fff12924fb322b7dfac37e41bd4b63a7 /src/mesa
parent9e01b915f1243a3f551cb795b7124bd1e52ca15f (diff)
i915tex: Make sure pitch is aligned properly for render-to-texture.
Just always align texture pitch to multiples of 64 bytes for now, pending a more sophisticated scheme to do it only when really necessary.
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c12
1 files changed, 11 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 fc38a28290d..74f6b2d8515 100644
--- a/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915tex/intel_mipmap_tree.c
@@ -97,9 +97,19 @@ intel_miptree_create(struct intel_context *intel,
break;
}
- if (ok)
+ if (ok) {
+ if (!mt->compressed) {
+ /* XXX: Align pitch to multiple of 64 bytes for now to allow
+ * render-to-texture to work in all cases. This should probably be
+ * replaced at some point by some scheme to only do this when really
+ * necessary.
+ */
+ mt->pitch = ((mt->pitch * cpp + 63) & ~63) / cpp;
+ }
+
mt->region = intel_region_alloc(intel->intelScreen,
mt->cpp, mt->pitch, mt->total_height);
+ }
if (!mt->region) {
free(mt);