diff options
author | Michel Daenzer <michel@tungstengraphics.com> | 2006-10-22 17:26:28 +0200 |
---|---|---|
committer | Michel Daenzer <michel@tungstengraphics.com> | 2006-10-22 17:26:28 +0200 |
commit | 2bcb51d66edaa944379cf8c8ca1ba91fffdc20a8 (patch) | |
tree | e06b070650f553e7343a6cec3c960d393b6f4b5d /src/radeon_render.c | |
parent | dabffb8335027b60ca1fc554423e196dfb9acd6d (diff) |
Bug #6756: Attempt to fix repeat picture acceleration.
Always use normalized texture coordinates on R200 and fall back if a POT
texture pitch doesn't match the HW's implicit pitch.
Diffstat (limited to 'src/radeon_render.c')
-rw-r--r-- | src/radeon_render.c | 31 |
1 files changed, 21 insertions, 10 deletions
diff --git a/src/radeon_render.c b/src/radeon_render.c index 9e3529e..054e60f 100644 --- a/src/radeon_render.c +++ b/src/radeon_render.c @@ -398,6 +398,13 @@ static Bool FUNC_NAME(R100SetupTexture)( txformat = RadeonGetTextureFormat(format); tex_bytepp = PICT_FORMAT_BPP(format) >> 3; + dst_pitch = (width * tex_bytepp + 63) & ~63; + size = dst_pitch * height; + + if ((flags & XAA_RENDER_REPEAT) && + (((width * tex_bytepp + 31) & ~31) != dst_pitch)) + return FALSE; + #ifndef ACCEL_CP #if X_BYTE_ORDER == X_BIG_ENDIAN @@ -410,9 +417,6 @@ static Bool FUNC_NAME(R100SetupTexture)( #endif - dst_pitch = (width * tex_bytepp + 63) & ~63; - size = dst_pitch * height; - if (!AllocateLinear(pScrn, size)) return FALSE; @@ -731,6 +735,13 @@ static Bool FUNC_NAME(R200SetupTexture)( txformat = RadeonGetTextureFormat(format); tex_bytepp = PICT_FORMAT_BPP(format) >> 3; + dst_pitch = (width * tex_bytepp + 63) & ~63; + size = dst_pitch * height; + + if ((flags & XAA_RENDER_REPEAT) && + (((width * tex_bytepp + 31) & ~31) != dst_pitch)) + return FALSE; + #ifndef ACCEL_CP #if X_BYTE_ORDER == X_BIG_ENDIAN @@ -743,9 +754,6 @@ static Bool FUNC_NAME(R200SetupTexture)( #endif - dst_pitch = (width * tex_bytepp + 63) & ~63; - size = dst_pitch * height; - if (!AllocateLinear(pScrn, size)) return FALSE; @@ -757,6 +765,9 @@ static Bool FUNC_NAME(R200SetupTexture)( txformat |= RADEON_TXFORMAT_NON_POWER2; } + info->texW[0] = width; + info->texH[0] = height; + offset = info->RenderTex->offset * pScrn->bitsPerPixel / 8; dst = (CARD8*)(info->FB + offset); @@ -956,10 +967,10 @@ FUNC_NAME(R200SubsequentCPUToScreenTexture) ( r = width + l; b = height + t; - fl = srcx; - fr = srcx + width; - ft = srcy; - fb = srcy + height; + fl = (float)srcx / info->texW[0]; + fr = (float)(srcx + width) / info->texW[0]; + ft = (float)srcy / info->texH[0]; + fb = (float)(srcy + height) / info->texH[0]; #ifdef ACCEL_CP BEGIN_RING(24); |