diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-07-29 18:06:20 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-07-29 18:06:20 -0400 |
commit | b116f57bacb79205a1f80c7055964c60b402a19d (patch) | |
tree | a86fb9b15f050b4988c037546f6c6fc1219c7acf /src/mesa/drivers/dri/r600 | |
parent | 1e207ba9c127d12feff3e1c2e8e29da26182e0bb (diff) |
r600: fix texture pitch alignment
fixes texwrap
Diffstat (limited to 'src/mesa/drivers/dri/r600')
-rw-r--r-- | src/mesa/drivers/dri/r600/r600_texstate.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 70dd540481..082bfd75f6 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -556,7 +556,7 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex radeonTexObj *t = radeon_tex_obj(texObj); const struct gl_texture_image *firstImage; int firstlevel = t->mt ? t->mt->firstLevel : 0; - GLuint uTexelPitch; + GLuint uTexelPitch, row_align;; firstImage = t->base.Image[0][firstlevel]; @@ -595,7 +595,9 @@ static void setup_hardware_state(context_t *rmesa, struct gl_texture_object *tex return; } - uTexelPitch = (firstImage->Width + R700_TEXEL_PITCH_ALIGNMENT_MASK) + row_align = rmesa->radeon.texture_row_align - 1; + uTexelPitch = ((firstImage->Width * t->mt->bpp + row_align) & ~row_align) / t->mt->bpp; + uTexelPitch = (uTexelPitch + R700_TEXEL_PITCH_ALIGNMENT_MASK) & ~R700_TEXEL_PITCH_ALIGNMENT_MASK; /* min pitch is 8 */ |