OSDN Git Service

i965: fix wrong cube/3D texture layout
authorYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 2 May 2012 09:29:11 +0000 (17:29 +0800)
committerYuanhan Liu <yuanhan.liu@linux.intel.com>
Wed, 9 May 2012 07:13:56 +0000 (15:13 +0800)
commitf939776cb2372a3427784f88d34bf14c18a5a212
tree8eeab9816251c2e8f4fce8e77e0a8eb5f818aad9
parent5aaaa6a426258dc714c7346bec062795998f9986
i965: fix wrong cube/3D texture layout

Fix wrong cube/3D texture layout for the tailing levels whose width or
height is smaller than the align unit.

From 965 B-spec http://intellinuxgraphics.org/VOL_1_graphics_core.pdf at
page 135:
   All of the LOD=0 q-planes are stacked vertically, then below that,
   the LOD=1 qplanes are stacked two-wide, then the LOD=2 qplanes are
   stacked four-wide below that, and so on.

Thus we should always inrease pack_x_nr, which results to the pitch of LODn
may greater than the pitch of LOD0. So we should refactor mt->total_width
when needed.

This would fix the following webgl test case on all gen4 platforms:
  conformance/textures/texture-size-cube-maps.html

NOTE: This is a candidate for stable release branches.

Signed-off-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
src/mesa/drivers/dri/i965/brw_tex_layout.c