diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.c b/src/gallium/auxiliary/nir/nir_to_tgsi.c index ce4f5e7aba3..231192792c1 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.c +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.c @@ -2645,3 +2645,29 @@ nir_to_tgsi(struct nir_shader *s, return tgsi_tokens; } + +static const nir_shader_compiler_options nir_to_tgsi_compiler_options = { + .fuse_ffma32 = true, + .fuse_ffma64 = true, + .lower_extract_byte = true, + .lower_extract_word = true, + .lower_fdph = true, + .lower_flrp64 = true, + .lower_fmod = true, + .lower_rotate = true, + .lower_sub = true, + .lower_vector_cmp = true, + .use_interpolated_input_intrinsics = true, +}; + +/* Returns a default compiler options for drivers with only nir-to-tgsi-based + * NIR support. + */ +const void * +nir_to_tgsi_get_compiler_options(struct pipe_screen *pscreen, + enum pipe_shader_ir ir, + unsigned shader) +{ + assert(ir == PIPE_SHADER_IR_NIR); + return &nir_to_tgsi_compiler_options; +} diff --git a/src/gallium/auxiliary/nir/nir_to_tgsi.h b/src/gallium/auxiliary/nir/nir_to_tgsi.h index e4cc044b839..73bb0ab896d 100644 --- a/src/gallium/auxiliary/nir/nir_to_tgsi.h +++ b/src/gallium/auxiliary/nir/nir_to_tgsi.h @@ -30,4 +30,9 @@ struct pipe_screen; const void *nir_to_tgsi(struct nir_shader *s, struct pipe_screen *screen); +const void * +nir_to_tgsi_get_compiler_options(struct pipe_screen *pscreen, + enum pipe_shader_ir ir, + unsigned shader); + #endif /* NIR_TO_TGSI_H */