From 2a1ff08376d84b111873214297518abed3cf75b2 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Mon, 6 Nov 2023 12:52:50 +0200 Subject: [PATCH] intel/compiler: make default NIR compiler options visible Signed-off-by: Lionel Landwerlin Reviewed-by: Kenneth Graunke Part-of: --- src/intel/compiler/brw_compiler.c | 9 +++++---- src/intel/compiler/brw_nir.h | 3 +++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/intel/compiler/brw_compiler.c b/src/intel/compiler/brw_compiler.c index 482a9059a49..587ae0b402e 100644 --- a/src/intel/compiler/brw_compiler.c +++ b/src/intel/compiler/brw_compiler.c @@ -24,6 +24,7 @@ #include "brw_compiler.h" #include "brw_shader.h" #include "brw_eu.h" +#include "brw_nir.h" #include "dev/intel_debug.h" #include "compiler/nir/nir.h" #include "util/u_debug.h" @@ -76,12 +77,12 @@ nir_divergence_single_patch_per_tes_subgroup | \ nir_divergence_shader_record_ptr_uniform) -static const struct nir_shader_compiler_options scalar_nir_options = { +const struct nir_shader_compiler_options brw_scalar_nir_options = { COMMON_OPTIONS, COMMON_SCALAR_OPTIONS, }; -static const struct nir_shader_compiler_options vector_nir_options = { +const struct nir_shader_compiler_options brw_vector_nir_options = { COMMON_OPTIONS, /* In the vec4 backend, our dpN instruction replicates its result to all the @@ -175,10 +176,10 @@ brw_compiler_create(void *mem_ctx, const struct intel_device_info *devinfo) rzalloc(compiler, struct nir_shader_compiler_options); bool is_scalar = compiler->scalar_stage[i]; if (is_scalar) { - *nir_options = scalar_nir_options; + *nir_options = brw_scalar_nir_options; int64_options |= nir_lower_usub_sat64; } else { - *nir_options = vector_nir_options; + *nir_options = brw_vector_nir_options; } /* Prior to Gfx6, there are no three source operations, and Gfx11 loses diff --git a/src/intel/compiler/brw_nir.h b/src/intel/compiler/brw_nir.h index c1925a1a909..317c8e9c779 100644 --- a/src/intel/compiler/brw_nir.h +++ b/src/intel/compiler/brw_nir.h @@ -33,6 +33,9 @@ extern "C" { #endif +extern const struct nir_shader_compiler_options brw_scalar_nir_options; +extern const struct nir_shader_compiler_options brw_vector_nir_options; + int type_size_vec4(const struct glsl_type *type, bool bindless); int type_size_dvec4(const struct glsl_type *type, bool bindless);