if (tex width < 4), mipmap calculation will be out of range

This commit is contained in:
Wang Zhenyu 2006-12-11 00:00:51 -08:00 committed by Eric Anholt
parent 9a94dae4c2
commit b4d9c0048f

View file

@ -138,7 +138,7 @@ GLboolean brw_miptree_layout( struct intel_mipmap_tree *mt )
/* Layout_below: step right after second mipmap.
*/
if (level == mt->first_level + 1) {
if (level == mt->first_level + 1 && mt->pitch > 4) {
x += mt->pitch / 2;
x = (x + 3) & ~ 3;
}