Ben Widawsky <b...@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 brw_miptree_layout_2d. Regards, - Neil
pgpSYPbhBmvkc.pgp
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev