[Intel] Centralize mipmap pitch computations.
authorKeith Packard <keithp@keithp.com>
Tue, 18 Dec 2007 06:43:48 +0000 (22:43 -0800)
committerKeith Packard <keithp@keithp.com>
Tue, 18 Dec 2007 18:22:04 +0000 (10:22 -0800)
commita183efc132c8db1bb42525ac177ffff96f69a59b
treee4106d93ea70e4b9fbe635704983e34b1dd24a78
parent6f1bfdc4bf5b72ac705b8cbb2dc431e133dcb5b8
[Intel] Centralize mipmap pitch computations.

mipmap pitches must account for the device alignment requirements, which
used to be fairly simple; just align to a 4-byte boundary. However, to allow
textures to be drawn to under TTM, they now need to be aligned to a 64-byte
boundary. Placing all of the alignment constraints in a single function
allows this new constraint to be applied uniformly.

There was some pitch constraining code in intel_miptree_create, but that was
modifying the pitch long after the miptree had been layed out, so it only
served to wreck the mipmap and cause rendering errors.
src/mesa/drivers/dri/i915/i915_tex_layout.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.c
src/mesa/drivers/dri/intel/intel_mipmap_tree.h
src/mesa/drivers/dri/intel/intel_tex_layout.c
src/mesa/drivers/dri/intel/intel_tex_layout.h