diff options
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/drivers/dri/i965/brw_tex_layout.c | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_tex_layout.c b/src/mesa/drivers/dri/i965/brw_tex_layout.c index 45aa85471af..f5ea13437ae 100644 --- a/src/mesa/drivers/dri/i965/brw_tex_layout.c +++ b/src/mesa/drivers/dri/i965/brw_tex_layout.c @@ -246,17 +246,17 @@ brw_miptree_layout_texture_array(struct brw_context *brw, mt->qpitch = h0; else mt->qpitch = (h0 + h1 + (brw->gen >= 7 ? 12 : 11) * mt->align_h); - if (mt->compressed) - mt->qpitch /= 4; + + int physical_qpitch = mt->compressed ? mt->qpitch / 4 : mt->qpitch; brw_miptree_layout_2d(mt); for (unsigned level = mt->first_level; level <= mt->last_level; level++) { for (int q = 0; q < mt->physical_depth0; q++) { - intel_miptree_set_image_offset(mt, level, q, 0, q * mt->qpitch); + intel_miptree_set_image_offset(mt, level, q, 0, q * physical_qpitch); } } - mt->total_height = mt->qpitch * mt->physical_depth0; + mt->total_height = physical_qpitch * mt->physical_depth0; align_cube(mt); } diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h index bc63a249d2a..69d5b0a22c0 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h @@ -334,7 +334,10 @@ struct intel_mipmap_tree bool array_spacing_lod0; /** - * The distance in rows between array slices. + * The distance in rows between array slices in an uncompressed surface. + * + * For compressed surfaces, slices are stored closer together physically; + * the real distance is (qpitch / block height). */ uint32_t qpitch; |