intel/compiler: make default NIR compiler options visible

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26797>
This commit is contained in:
Lionel Landwerlin
2023-11-06 12:52:50 +02:00
committed by Marge Bot
parent 012489e55c
commit 2a1ff08376
2 changed files with 8 additions and 4 deletions

View File

@@ -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

View File

@@ -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);