nir: intel/compiler: Lower TXD on array surfaces on DG2+
authorIan Romanick <ian.d.romanick@intel.com>
Wed, 30 Mar 2022 23:36:06 +0000 (16:36 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 31 Mar 2022 19:59:18 +0000 (12:59 -0700)
commit7fd1955412e252957486e0430b2e5a6e7c755364
treeb93a72030d10113eebbe61cd3e317d39f79004dc
parent3f8224baeead17338fdd593b8fe1c23e436e10a5
nir: intel/compiler: Lower TXD on array surfaces on DG2+

DG2 can only do sample_d and sample_d_c on 1D and 2D surfaces.  Cube
maps and 3D surfaces were already handled, but 1D array and 2D array
surfaces were not.

Fixes the following Vulkan CTS failures on DG2:

    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler1darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.isampler2darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1darray_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler1darray_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2darray_fixed_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.sampler2darray_float_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler1darray_fragment
    dEQP-VK.glsl.texture_functions.texturegradclamp.usampler2darray_fragment

The Fixes: tag below is a bit misleading. This commit adds another
lowering, similar to the one in the Fixes: commit, that probably should
have been added at the same time.  I just want to make sure this commit
gets applied everywhere that commit was also applied.

Fixes: 635ed58e527 ("intel/compiler: Lower txd for 3D samplers on XeHP.")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15681>
src/compiler/nir/nir.h
src/compiler/nir/nir_lower_tex.c
src/intel/compiler/brw_nir.c