pitchalign = tile_alignment[rsc->cpp].pitchalign;
aligned_height = align(aligned_height, heightalign);
} else {
- pitchalign = 64;
+ if (prsc->target == PIPE_TEXTURE_3D) {
+ unsigned a;
+ if (width >= 64) {
+ a = util_next_power_of_two(MAX2(width, height));
+ } else {
+ a = 16;
+ }
+
+ pitchalign = align(a, 64);
+ aligned_height = align(aligned_height, a);
+ } else {
+ pitchalign = 64;
+ }
/* The blits used for mem<->gmem work at a granularity of
* 32x32, which can cause faults due to over-fetch on the
break;
case PIPE_TEXTURE_3D:
so->texconst3 =
+ A6XX_TEX_CONST_3_MIN_LAYERSZ(rsc->slices[prsc->last_level].size0) |
A6XX_TEX_CONST_3_ARRAY_PITCH(rsc->slices[lvl].size0);
so->texconst5 =
A6XX_TEX_CONST_5_DEPTH(u_minify(prsc->depth0, lvl));
break;
default:
- so->texconst3 = 0x00000000;
break;
}
* programmed with the start address of each mipmap level, and hw
* derives the layer offset within the level.
*
- * Texture Layout on a4xx:
+ * Texture Layout on a4xx+:
*
* For cubemap and 2d array, each layer contains all of it's mipmap
* levels (layer_first layout).