aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/nv50/nv50_miptree.c
diff options
context:
space:
mode:
authorBen Skeggs <[email protected]>2009-06-05 22:04:07 +1000
committerBen Skeggs <[email protected]>2009-06-05 22:53:24 +1000
commitd06e380e022d938a61800cbbec0004ec9f1fecfd (patch)
tree63d7867e5cc63bef5b460cede40c042282ba37d0 /src/gallium/drivers/nv50/nv50_miptree.c
parenta471497345bcd3aaaa52d3dc73f68367cb4af6a0 (diff)
nv50: use larger tile sizes
Diffstat (limited to 'src/gallium/drivers/nv50/nv50_miptree.c')
-rw-r--r--src/gallium/drivers/nv50/nv50_miptree.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 2fbedb6779a..6b605ba416c 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -34,7 +34,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
struct pipe_texture *pt = &mt->base;
unsigned width = tmp->width[0], height = tmp->height[0];
unsigned depth = tmp->depth[0];
- uint32_t tile_mode = 0, tile_flags = 0;
+ uint32_t tile_mode, tile_flags, tile_h;
int ret, i, l;
mt->base = *tmp;
@@ -51,6 +51,13 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
break;
}
+ if (pt->height[0] > 32) tile_mode = 4;
+ else if (pt->height[0] > 16) tile_mode = 3;
+ else if (pt->height[0] > 8) tile_mode = 2;
+ else if (pt->height[0] > 4) tile_mode = 1;
+ else tile_mode = 0;
+ tile_h = 1 << (tile_mode + 2);
+
switch (pt->target) {
case PIPE_TEXTURE_3D:
mt->image_nr = pt->depth[0];
@@ -87,7 +94,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp)
size = align(pt->width[l], 8) * pt->block.size;
size = align(size, 64);
- size *= align(pt->height[l], 8) * pt->block.size;
+ size *= align(pt->height[l], tile_h) * pt->block.size;
lvl->image_offset[i] = mt->total_size;