i965: Fix textureSize() depth value for 1 layer surfaces on Gen4-6.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 29 Mar 2016 16:58:11 +0000 (09:58 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 31 Mar 2016 22:23:49 +0000 (15:23 -0700)
commit58d4751fa0c5a38069879e9f72047b75f8351d93
tree521810b605aa2f39c89102bca2a4b48ccb8f8fbe
parent08ff5f4d1f04ea426be679018c2c38da6b6b9a65
i965: Fix textureSize() depth value for 1 layer surfaces on Gen4-6.

According to the Sandybridge PRM's description of the resinfo message,
the .z value returned will be Depth == 0 ? 0 : Depth + 1.  The earlier
PRMs have the same table.

This means we return 0 for array textures with a single slice, when
we ought to return 1.  Just override it to max(depth, 1).

Fixes 10 dEQP-GLES3.functional tests on Sandybridge:
shaders.texture_functions.texturesize.sampler2darray_fixed_vertex
shaders.texture_functions.texturesize.sampler2darray_fixed_fragment
shaders.texture_functions.texturesize.sampler2darray_float_vertex
shaders.texture_functions.texturesize.sampler2darray_float_fragment
shaders.texture_functions.texturesize.isampler2darray_vertex
shaders.texture_functions.texturesize.isampler2darray_fragment
shaders.texture_functions.texturesize.usampler2darray_vertex
shaders.texture_functions.texturesize.usampler2darray_fragment
shaders.texture_functions.texturesize.sampler2darrayshadow_vertex
shaders.texture_functions.texturesize.sampler2darrayshadow_fragment

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp