summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/r300/r300_texstate.c
diff options
context:
space:
mode:
authorAlex Deucher <[email protected]>2008-05-12 11:57:08 -0400
committerAlex Deucher <[email protected]>2008-05-12 11:57:08 -0400
commit2a4d1085cb9d2d03e6aeb2c71a59888826c31afd (patch)
treefdf172c83e55f3dabe12480e7f509d2f158ad58b /src/mesa/drivers/dri/r300/r300_texstate.c
parent63503f284863530d628f26bea27f2390aca518e5 (diff)
R500: add support for 4k textures
Diffstat (limited to 'src/mesa/drivers/dri/r300/r300_texstate.c')
-rw-r--r--src/mesa/drivers/dri/r300/r300_texstate.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index 43d1406da34..f69a27671b1 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -398,16 +398,24 @@ static void r300SetTexImages(r300ContextPtr rmesa,
R300_TX_HEIGHTMASK_SHIFT))
| ((numLevels - 1) << R300_TX_MAX_MIP_LEVEL_SHIFT);
+ t->pitch = 0;
+ if (rmesa->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) {
+ if (tObj->Image[0][t->base.firstLevel]->Width > 2048)
+ t->pitch |= R500_TXWIDTH_BIT11;
+ if (tObj->Image[0][t->base.firstLevel]->Height > 2048)
+ t->pitch |= R500_TXHEIGHT_BIT11;
+ }
+
/* Only need to round to nearest 32 for textures, but the blitter
* requires 64-byte aligned pitches, and we may/may not need the
* blitter. NPOT only!
*/
if (baseImage->IsCompressed) {
- t->pitch =
+ t->pitch |=
(tObj->Image[0][t->base.firstLevel]->Width + 63) & ~(63);
} else if (tObj->Target == GL_TEXTURE_RECTANGLE_NV) {
unsigned int align = blitWidth - 1;
- t->pitch = ((tObj->Image[0][t->base.firstLevel]->Width *
+ t->pitch |= ((tObj->Image[0][t->base.firstLevel]->Width *
texelBytes) + 63) & ~(63);
t->size |= R300_TX_SIZE_TXPITCH_EN;
if (!t->image_override)
@@ -415,7 +423,7 @@ static void r300SetTexImages(r300ContextPtr rmesa,
(((tObj->Image[0][t->base.firstLevel]->Width) +
align) & ~align) - 1;
} else {
- t->pitch =
+ t->pitch |=
((tObj->Image[0][t->base.firstLevel]->Width *
texelBytes) + 63) & ~(63);
}