- if (prsc->target != PIPE_TEXTURE_CUBE) {
- if (level == 0) {
- width = util_next_power_of_two(width);
- height = util_next_power_of_two(height);
- }
- width = MAX2(width, 8);
- height = MAX2(height, 4);
- // Multiplying by 4 is the result of the 4x4 tiling pattern.
- slice->pitch = width * 4;
- blocks = util_format_get_nblocks(format, width, height);
- } else {
- uint32_t twidth, theight;
- twidth = align(width, 8);
- theight = align(height, 4);
- // Multiplying by 4 is the result of the 4x4 tiling pattern.
- slice->pitch = twidth * 4;
- blocks = util_format_get_nblocks(format, twidth, theight);
- }
- } else {
- slice->pitch = width = align(width, pitchalign);
- blocks = util_format_get_nblocks(format, slice->pitch, height);
+ height = align(height, 4);
+ if (prsc->target != PIPE_TEXTURE_CUBE)
+ height = util_next_power_of_two(height);