intel/compiler: Enable packing of offset with LOD or Bias

Move intel_nir_lower_texture just before nir_lower_tex since we need to
operate on the offset and those are getting lowerd.

v2: (Ian)
- Rename variable name to intel_tex_options

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27447>
This commit is contained in:
Sagar Ghuge 2024-02-09 10:51:20 -08:00 committed by Marge Bot
parent 30ead72e80
commit 269d2c4a3f

View file

@ -930,6 +930,11 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir,
if (intel_needs_workaround(devinfo, 1806565034) && !opts->robust_image_access)
OPT(intel_nir_clamp_image_1d_2d_array_sizes);
const struct intel_nir_lower_texture_opts intel_tex_options = {
.combined_lod_or_bias_and_offset = compiler->devinfo->ver >= 20,
};
OPT(intel_nir_lower_texture, &intel_tex_options);
const nir_lower_tex_options tex_options = {
.lower_txp = ~0,
.lower_txf_offset = true,
@ -953,8 +958,11 @@ brw_preprocess_nir(const struct brw_compiler *compiler, nir_shader *nir,
* rerun the pass because the instructions inserted by the first lowering
* are not visible during that first pass.
*/
if (OPT(nir_lower_tex, &tex_options))
if (OPT(nir_lower_tex, &tex_options)) {
OPT(intel_nir_lower_texture, &intel_tex_options);
OPT(nir_lower_tex, &tex_options);
}
OPT(nir_normalize_cubemap_coords);
OPT(nir_lower_global_vars_to_local);