From f4654c458f81d47b59f3562f6f92ebf20321a3a2 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 15 Jun 2020 09:37:13 -0700 Subject: [PATCH] freedreno/ir3: constify shader key Signed-off-by: Rob Clark Part-of: --- src/freedreno/ir3/ir3_shader.c | 6 +++--- src/freedreno/ir3/ir3_shader.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/freedreno/ir3/ir3_shader.c b/src/freedreno/ir3/ir3_shader.c index a8f3dc76e9f..4bd427b4dc8 100644 --- a/src/freedreno/ir3/ir3_shader.c +++ b/src/freedreno/ir3/ir3_shader.c @@ -181,7 +181,7 @@ assemble_variant(struct ir3_shader_variant *v) * (non-binning) variant. */ static struct ir3_shader_variant * -create_variant(struct ir3_shader *shader, struct ir3_shader_key *key, +create_variant(struct ir3_shader *shader, const struct ir3_shader_key *key, struct ir3_shader_variant *nonbinning) { struct ir3_shader_variant *v = CALLOC_STRUCT(ir3_shader_variant); @@ -237,7 +237,7 @@ fail: } static inline struct ir3_shader_variant * -shader_variant(struct ir3_shader *shader, struct ir3_shader_key *key, +shader_variant(struct ir3_shader *shader, const struct ir3_shader_key *key, bool *created) { struct ir3_shader_variant *v; @@ -260,7 +260,7 @@ shader_variant(struct ir3_shader *shader, struct ir3_shader_key *key, } struct ir3_shader_variant * -ir3_shader_get_variant(struct ir3_shader *shader, struct ir3_shader_key *key, +ir3_shader_get_variant(struct ir3_shader *shader, const struct ir3_shader_key *key, bool binning_pass, bool *created) { mtx_lock(&shader->variants_lock); diff --git a/src/freedreno/ir3/ir3_shader.h b/src/freedreno/ir3/ir3_shader.h index 1ee7371d8f4..0123af67635 100644 --- a/src/freedreno/ir3/ir3_shader.h +++ b/src/freedreno/ir3/ir3_shader.h @@ -325,7 +325,7 @@ ir3_tess_mode(unsigned gl_tess_mode) } static inline bool -ir3_shader_key_equal(struct ir3_shader_key *a, struct ir3_shader_key *b) +ir3_shader_key_equal(const struct ir3_shader_key *a, const struct ir3_shader_key *b) { /* slow-path if we need to check {v,f}saturate_{s,t,r} */ if (a->has_per_samp || b->has_per_samp) @@ -649,7 +649,7 @@ ir3_const_state(const struct ir3_shader_variant *v) void * ir3_shader_assemble(struct ir3_shader_variant *v); struct ir3_shader_variant * ir3_shader_get_variant(struct ir3_shader *shader, - struct ir3_shader_key *key, bool binning_pass, bool *created); + const struct ir3_shader_key *key, bool binning_pass, bool *created); struct ir3_shader * ir3_shader_from_nir(struct ir3_compiler *compiler, nir_shader *nir, unsigned reserved_user_consts, struct ir3_stream_output_info *stream_output); void ir3_shader_destroy(struct ir3_shader *shader); -- 2.30.2