From 5406a65955a90c4a90de1243cdf5fd33ef3af94c Mon Sep 17 00:00:00 2001 From: Boris Brezillon Date: Tue, 6 Feb 2024 14:27:15 +0100 Subject: [PATCH] pan/blend: Expose pan_blend_create_shader() Will be used in panvk. Signed-off-by: Boris Brezillon Reviewed-by: Mary Guillemard Acked-by: Erik Faye-Lund Part-of: --- src/panfrost/lib/pan_blend.c | 11 ++++++----- src/panfrost/lib/pan_blend.h | 4 ++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/panfrost/lib/pan_blend.c b/src/panfrost/lib/pan_blend.c index fa82c12f4f6..5d9d705290b 100644 --- a/src/panfrost/lib/pan_blend.c +++ b/src/panfrost/lib/pan_blend.c @@ -616,10 +616,10 @@ pan_inline_blend_constants(nir_builder *b, nir_intrinsic_instr *intr, return true; } -static nir_shader * -pan_blend_create_shader(const struct pan_blend_state *state, - nir_alu_type src0_type, nir_alu_type src1_type, - unsigned rt) +nir_shader * +GENX(pan_blend_create_shader)(const struct pan_blend_state *state, + nir_alu_type src0_type, nir_alu_type src1_type, + unsigned rt) { const struct pan_blend_rt_state *rt_state = &state->rts[rt]; char equation_str[128] = {0}; @@ -853,7 +853,8 @@ GENX(pan_blend_get_shader_locked)(struct pan_blend_shader_cache *cache, memcpy(variant->constants, state->constants, sizeof(variant->constants)); - nir_shader *nir = pan_blend_create_shader(state, src0_type, src1_type, rt); + nir_shader *nir = + GENX(pan_blend_create_shader)(state, src0_type, src1_type, rt); nir_shader_intrinsics_pass(nir, pan_inline_blend_constants, nir_metadata_block_index | nir_metadata_dominance, diff --git a/src/panfrost/lib/pan_blend.h b/src/panfrost/lib/pan_blend.h index 49c9ad65e39..c25b1afd6d6 100644 --- a/src/panfrost/lib/pan_blend.h +++ b/src/panfrost/lib/pan_blend.h @@ -155,6 +155,10 @@ void pan_blend_shader_cache_cleanup(struct pan_blend_shader_cache *cache); #ifdef PAN_ARCH +nir_shader *GENX(pan_blend_create_shader)(const struct pan_blend_state *state, + nir_alu_type src0_type, + nir_alu_type src1_type, unsigned rt); + #if PAN_ARCH >= 6 uint64_t GENX(pan_blend_get_internal_desc)(enum pipe_format fmt, unsigned rt, unsigned force_size, bool dithered);