gallivm/tgsi: add image interface to tgsi builder
authorDave Airlie <airlied@redhat.com>
Fri, 19 Jul 2019 06:33:03 +0000 (16:33 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 27 Aug 2019 02:29:55 +0000 (12:29 +1000)
This adds the callbacks for the driver/gallium binding for
image operations.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_tgsi.h
src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c

index 26e8e405869b59cad8609a2ef39e91f0410a779b..ed3465874bc5e0b1795507fc208d102f655513ef 100644 (file)
@@ -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];
 
index c51ab658f50511c8f35a3504ba7054511bc32225..ab78e6bb50c0fe38c36afa6d72d29c6e0927c54e 100644 (file)
@@ -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