etnaviv: Switch etna_compiler_create(..) to etna_core_info

Prep step to drop halti from etna_specs.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30394>
This commit is contained in:
Christian Gmeiner 2024-07-30 17:13:06 +02:00 committed by Marge Bot
parent ce2fc866ec
commit 6d673a3ac7
3 changed files with 12 additions and 9 deletions

View file

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

View file

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

View file

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