Skip to content

intel: Fix bug in mipmap layout of compressed textures

Nanley Chery requested to merge nchery/mesa:sent/fix/compressed-mipmaps into master

Aligning phys_level0_sa by the compression block dimension prior to mipmap layout causes the layout of compressed surfaces to differ from the sampler's expectations in certain cases. The hardware docs agree:

From the BDW PRM, Vol. 5, Compressed Mipmap Layout,

The compressed mipmaps are stored in a similar fashion to uncompressed mipmaps [...]

The following exceptions apply to the layout of compressed (vs. uncompressed) mipmaps:

  • [...]
  • The dimensions of the mip maps are first determined by applying the sizing algorithm presented in Non-Power-of-Two Mipmaps above. Then, if necessary, they are padded out to compression block boundaries.

The last bullet indicates that alignment should not be done for calculating a miplevel's dimensions, but rather for determining miplevel placement/padding. Comply with this text by removing the extra alignment.

Fixes some fbo-generatemipmap-formats piglit failures seen SNB-KBL. (See piglit!59 (merged))

Cc: mesa-stable@lists.freedesktop.org

Edited by Nanley Chery

Merge request reports