summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/r300/r300_texture_desc.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-02-16 20:09:06 +0100
committerMarek Olšák <maraeo@gmail.com>2011-02-16 21:40:54 +0100
commit2d1cc27729bd1808a39b226ae3eda5663328ba74 (patch)
tree5116ad6ab6487e9f2a250ac1d2771bbebc35fdae /src/gallium/drivers/r300/r300_texture_desc.c
parent8513d3405bd5cd633579b16af1ab04253a8b37d9 (diff)
r300g: fix blitting NPOT compressed textures
Diffstat (limited to 'src/gallium/drivers/r300/r300_texture_desc.c')
-rw-r--r--src/gallium/drivers/r300/r300_texture_desc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/r300/r300_texture_desc.c b/src/gallium/drivers/r300/r300_texture_desc.c
index 221e5a314a..2cfeec7d75 100644
--- a/src/gallium/drivers/r300/r300_texture_desc.c
+++ b/src/gallium/drivers/r300/r300_texture_desc.c
@@ -162,6 +162,14 @@ static unsigned r300_texture_get_nblocksy(struct r300_resource *tex,
height = u_minify(tex->tex.height0, level);
+ /* Mipmapped and 3D textures must have their height aligned to POT. */
+ if ((tex->b.b.b.target != PIPE_TEXTURE_1D &&
+ tex->b.b.b.target != PIPE_TEXTURE_2D &&
+ tex->b.b.b.target != PIPE_TEXTURE_RECT) ||
+ tex->b.b.b.last_level != 0) {
+ height = util_next_power_of_two(height);
+ }
+
if (util_format_is_plain(tex->b.b.b.format)) {
tile_height = r300_get_pixel_alignment(tex->b.b.b.format,
tex->b.b.b.nr_samples,
@@ -170,14 +178,6 @@ static unsigned r300_texture_get_nblocksy(struct r300_resource *tex,
DIM_HEIGHT, 0);
height = align(height, tile_height);
- /* This is needed for the kernel checker, unfortunately. */
- if ((tex->b.b.b.target != PIPE_TEXTURE_1D &&
- tex->b.b.b.target != PIPE_TEXTURE_2D &&
- tex->b.b.b.target != PIPE_TEXTURE_RECT) ||
- tex->b.b.b.last_level != 0) {
- height = util_next_power_of_two(height);
- }
-
/* See if the CBZB clear can be used on the buffer,
* taking the texture size into account. */
if (out_aligned_for_cbzb) {