[Mesa-dev] [PATCH 2/6] i965/skl: Layout a 1D miptree horizontally

Neil Roberts neil at linux.intel.com
Wed Feb 25 05:03:59 PST 2015

Ben Widawsky <ben at bwidawsk.net> writes:

> Okay, I'm guilty of a bikeshed here, but doesn't this look cleaner if you just
> do two for loops? One for depth, and one for levels.
> something like...
> const unsigned depth = mt->physical_depth0;
> for (i = 0; i < depth; i++) {
> 	width = mt->physical_width0;
> 	for (unsigned level = mt->first_level; level <= mt->last_level; level++) {
> 		intel_miptree_set_level_info(mt, level, x, 0, depth);
> 		mt->total_width += ALIGN(width, 64);
> 		width = minify(width, 1);
> 	}
> }

I'm not sure what you mean. This function is just laying out a single
array slice so the depth isn't iterated. The other array slices are laid
out in brw_miptree_layout_texture_array by copying the offsets that this
function generates. It is done the same way for 2D textures.

It might look a bit confusing because the last three parameters of
intel_miptree_set_level_info look like x-offset, y-offset and z-offset
but it's actually x-offset, y-offset and depth of the entire level. The
depth is the same for each level.

I guess I could comment the arguments but the same problem exists in

- Neil
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150225/f45d7b6d/attachment.sig>

More information about the mesa-dev mailing list