From 15f7688ac9d75dcc10a07f103881c062bf9fdb9a Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 19 Jul 2019 16:33:03 +1000 Subject: [PATCH] gallivm/tgsi: add image interface to tgsi builder This adds the callbacks for the driver/gallium binding for image operations. Reviewed-by: Roland Scheidegger --- src/gallium/auxiliary/gallivm/lp_bld_tgsi.h | 20 +++++++++++++++++++- src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c | 1 + 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h index 26e8e40..ed34658 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h @@ -210,6 +210,23 @@ struct lp_build_sampler_aos enum lp_build_tex_modifier modifier); }; +struct lp_img_params; + +struct lp_build_image_soa +{ + void + (*destroy)( struct lp_build_image_soa *image ); + + void + (*emit_op)(const struct lp_build_image_soa *image, + struct gallivm_state *gallivm, + const struct lp_img_params *params); + + void + (*emit_size_query)( const struct lp_build_image_soa *sampler, + struct gallivm_state *gallivm, + const struct lp_sampler_size_query_params *params); +}; void lp_build_tgsi_info(const struct tgsi_token *tokens, @@ -230,6 +247,7 @@ struct lp_build_tgsi_params { const struct lp_build_tgsi_gs_iface *gs_iface; LLVMValueRef ssbo_ptr; LLVMValueRef ssbo_sizes_ptr; + const struct lp_build_image_soa *image; }; void @@ -238,7 +256,6 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, const struct lp_build_tgsi_params *params, LLVMValueRef (*outputs)[4]); - void lp_build_tgsi_aos(struct gallivm_state *gallivm, const struct tgsi_token *tokens, @@ -464,6 +481,7 @@ struct lp_build_tgsi_soa_context LLVMValueRef ssbo_sizes[LP_MAX_TGSI_SHADER_BUFFERS]; const struct lp_build_sampler_soa *sampler; + const struct lp_build_image_soa *image; struct tgsi_declaration_sampler_view sv[PIPE_MAX_SHADER_SAMPLER_VIEWS]; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c index c51ab65..ab78e6b 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c @@ -4180,6 +4180,7 @@ lp_build_tgsi_soa(struct gallivm_state *gallivm, bld.indirect_files = params->info->indirect_files; bld.context_ptr = params->context_ptr; bld.thread_data_ptr = params->thread_data_ptr; + bld.image = params->image; /* * If the number of temporaries is rather large then we just -- 2.7.4