nir: add indirect loop unrolling to compiler options

This is where it should be rather than having to pass it into the
optimisation pass every time.

It also allows us to call the loop analysis pass without having to
duplicate these options which we will do later in this series.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12064>
This commit is contained in:
Timothy Arceri
2021-07-29 19:34:26 +10:00
committed by Marge Bot
parent a654e39f15
commit a9ed4538ab
24 changed files with 90 additions and 94 deletions

View File

@@ -68,7 +68,8 @@
.lower_usub_sat64 = true, \
.lower_hadd64 = true, \
.lower_bfe_with_two_constants = true, \
.max_unroll_iterations = 32
.max_unroll_iterations = 32, \
.force_indirect_unrolling = nir_var_function_temp
static const struct nir_shader_compiler_options scalar_nir_options = {
COMMON_OPTIONS,
@@ -196,6 +197,9 @@ brw_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo)
nir_options->unify_interfaces = i < MESA_SHADER_FRAGMENT;
nir_options->force_indirect_unrolling |=
brw_nir_no_indirect_mask(compiler, i);
compiler->glsl_compiler_options[i].NirOptions = nir_options;
compiler->glsl_compiler_options[i].ClampBlockIndicesToArrayBounds = true;