diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.c b/src/gallium/drivers/etnaviv/etnaviv_compiler.c index afc70cfcb3c..88ccb3b243c 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler.c +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.c @@ -31,9 +31,11 @@ #include "util/ralloc.h" struct etna_compiler * -etna_compiler_create(const char *renderer, const struct etna_specs *specs) +etna_compiler_create(const char *renderer, const struct etna_core_info *info) { struct etna_compiler *compiler = rzalloc(NULL, struct etna_compiler); + bool has_sign_floor_ceil = etna_core_has_feature(info, ETNA_FEATURE_HAS_SIGN_FLOOR_CEIL); + bool has_sin_cos_sqrt = etna_core_has_feature(info, ETNA_FEATURE_HAS_SQRT_TRIG); compiler->options = (nir_shader_compiler_options) { .has_texture_scaling = true, @@ -59,12 +61,12 @@ etna_compiler_create(const char *renderer, const struct etna_specs *specs) .lower_fdiv = true, /* !specs->has_new_transcendentals */ .lower_extract_byte = true, .lower_extract_word = true, - .lower_fsign = !specs->has_sign_floor_ceil, - .lower_ffloor = !specs->has_sign_floor_ceil, - .lower_fceil = !specs->has_sign_floor_ceil, - .lower_fsqrt = !specs->has_sin_cos_sqrt, - .lower_sincos = !specs->has_sin_cos_sqrt, - .lower_uniforms_to_ubo = specs->halti >= 2, + .lower_fsign = !has_sign_floor_ceil, + .lower_ffloor = !has_sign_floor_ceil, + .lower_fceil = !has_sign_floor_ceil, + .lower_fsqrt = !has_sin_cos_sqrt, + .lower_sincos = !has_sin_cos_sqrt, + .lower_uniforms_to_ubo = info->halti >= 2, .force_indirect_unrolling = nir_var_all, .max_unroll_iterations = 32, .vectorize_io = true, diff --git a/src/gallium/drivers/etnaviv/etnaviv_compiler.h b/src/gallium/drivers/etnaviv/etnaviv_compiler.h index dde156ba570..fa52d47a16f 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_compiler.h +++ b/src/gallium/drivers/etnaviv/etnaviv_compiler.h @@ -27,6 +27,7 @@ #ifndef H_ETNAVIV_COMPILER #define H_ETNAVIV_COMPILER +#include "etna_core_info.h" #include "etnaviv_context.h" #include "etnaviv_internal.h" #include "etnaviv_shader.h" @@ -147,7 +148,7 @@ struct etna_shader_link_info { }; struct etna_compiler * -etna_compiler_create(const char *renderer, const struct etna_specs *specs); +etna_compiler_create(const char *renderer, const struct etna_core_info *info); void etna_compiler_destroy(const struct etna_compiler *compiler); diff --git a/src/gallium/drivers/etnaviv/etnaviv_shader.c b/src/gallium/drivers/etnaviv/etnaviv_shader.c index 46a7ed56e22..8af86adcccd 100644 --- a/src/gallium/drivers/etnaviv/etnaviv_shader.c +++ b/src/gallium/drivers/etnaviv/etnaviv_shader.c @@ -593,7 +593,7 @@ etna_shader_screen_init(struct pipe_screen *pscreen) /* Create at least one thread - even on single core CPU systems. */ num_threads = MAX2(1, num_threads); - screen->compiler = etna_compiler_create(pscreen->get_name(pscreen), &screen->specs); + screen->compiler = etna_compiler_create(pscreen->get_name(pscreen), screen->info); if (!screen->compiler) return false;