[Mesa-dev] [PATCH 07/20] i965/fs: Import image memory offset calculation code.

Chad Versace chad.versace at intel.com
Thu Jul 23 16:09:30 PDT 2015


On Wed 22 Jul 2015, Jason Ekstrand wrote:
> This needs a *lot* more commentary.  These calculations are extremely
> tricky and there are almost no comments.  For instance, you are
> turning a 2D offset on a tiled surface into a new 2D address into the
> raw view of the surface.  Nowhere do you explain what the "raw"
> surface looks like and how its width/height map to "real" tiled
> version.  Somewhere, you need to write all this down in detail and
> explain why your calculations are correct.  If you don't write it down
> here, then write it down somewhere else and put a comment here
> explaining where to go look.
> 
> I tried to dig through it, but I'm having a lot of trouble getting any
> further splitting the x/y into major/minor.
> 
> Cc'ing chad.  He knows miptree layouts far better than I do.  Maybe
> this is all obvious to someone familiar with the calculations.

I know how to do miptree layout calculations in my sleep (at least for
non-W layouts!), and I still find this code extremely hard to follow.

Please add more explantion in the code. You don't need to redocument
Intel tiling layout; that would be wasteful noise. But please document
the details of how your *calculations* encode/decode the layout.


More information about the mesa-dev mailing list