diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-10-09 12:36:56 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-10-09 12:36:56 -0600 |
commit | 9509afe97cd7d9f58c9b344242171952990abfc8 (patch) | |
tree | 4a842e34ff97b362fc19297cfc7a569d1828e400 /src/mesa/drivers/dri/i915/intel_mipmap_tree.c | |
parent | 2dbd905ab0265b520efccce24ce9de66b6fc5fb0 (diff) | |
parent | 4599683b480d295e407725e0fe99c357a0086092 (diff) |
Merge branch 'master' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/mesa/drivers/dri/i915/intel_mipmap_tree.c')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_mipmap_tree.c | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c index 74f6b2d851..2c167a9ab7 100644 --- a/src/mesa/drivers/dri/i915/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i915/intel_mipmap_tree.c @@ -99,12 +99,29 @@ intel_miptree_create(struct intel_context *intel, 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. + int align; + + if (intel->intelScreen->ttm) { + /* 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. + */ + align = 63; + } else { + align = 3; + } + + mt->pitch = (mt->pitch * cpp + align) & ~align; + + /* 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 the required alignment for now. */ - mt->pitch = ((mt->pitch * cpp + 63) & ~63) / cpp; + if (!(mt->pitch & 511)) + mt->pitch += align + 1; + + mt->pitch /= cpp; } mt->region = intel_region_alloc(intel->intelScreen, |