OSDN Git Service

i965: Stop muging cube array lengths by 6
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 18 Jul 2016 23:25:12 +0000 (16:25 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 20 Jul 2016 15:19:26 +0000 (08:19 -0700)
commit96dfed49e47eac7afc100e5b8d3b316dd6652fb6
tree395efcfb0ddd4d2977c0a6223b55db4566556189
parente19b7f7f1b5d6a1d325c0129d6d6b9da6234330a
i965: Stop muging cube array lengths by 6

From the Sky Lake PRM:

   "For SURFTYPE_CUBE: For Sampling Engine Surfaces and Typed Data Port
   Surfaces, the range of this field is [0,340], indicating the number of
   cube array elements (equal to the number of underlying 2D array elements
   divided by 6). For other surfaces, this field must be zero."

In other words, the depth field for cube maps is in number of cubes not
number of 2-D slices so we need to divide by 6.  ISL will do this correctly
for us assuming that we provide it with the correct array bounds which it
expects to be in 2-D slices.  It appears as if we've been doing this wrong
ever since we first added cube map arrays for Sandy Bridge and the change
to ISL made things slightly worse.  While we're at it, we now need to remoe
the shader hacks we've always done since they were only needed because we
were setting the depth field six times too large.

v2: Fix the vec4 backend as well (not sure how I missed this).

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Chris Forbes <chrisforbes@google.com>
src/mesa/drivers/dri/i965/brw_fs_nir.cpp
src/mesa/drivers/dri/i965/brw_vec4.h
src/mesa/drivers/dri/i965/brw_vec4_nir.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/drivers/dri/i965/brw_wm_surface_state.c