radeonsi: don't lower indirect IO in GLSL
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_sample.h
index 22fab7445aa40a13771bbe331082256c46365e7a..a91e9c2ddbc92c5c52d575e5fb53528639292cf9 100644 (file)
@@ -140,6 +140,7 @@ struct lp_img_params
 {
    struct lp_type type;
    unsigned image_index;
+   LLVMValueRef image_index_offset;
    unsigned img_op;
    unsigned target;
    LLVMAtomicRMWBinOp op;
@@ -459,6 +460,14 @@ struct lp_build_sample_array_switch {
    LLVMValueRef phi;
 };
 
+struct lp_build_img_op_array_switch {
+   struct gallivm_state *gallivm;
+   struct lp_img_params params;
+   unsigned base, range;
+   LLVMValueRef switch_ref;
+   LLVMBasicBlockRef merge_ref;
+   LLVMValueRef phi[4];
+};
 
 /**
  * We only support a few wrap modes in lp_build_sample_wrap_linear_int() at
@@ -705,9 +714,10 @@ lp_build_minify(struct lp_build_context *bld,
 
 void
 lp_build_img_op_soa(const struct lp_static_texture_state *static_texture_state,
-                      struct lp_sampler_dynamic_state *dynamic_state,
-                      struct gallivm_state *gallivm,
-                      const struct lp_img_params *params);
+                    struct lp_sampler_dynamic_state *dynamic_state,
+                    struct gallivm_state *gallivm,
+                    const struct lp_img_params *params,
+                    LLVMValueRef outdata[4]);
 
 void
 lp_build_sample_array_init_soa(struct lp_build_sample_array_switch *switch_info,
@@ -724,6 +734,21 @@ lp_build_sample_array_case_soa(struct lp_build_sample_array_switch *switch_info,
                            struct lp_sampler_dynamic_state *dynamic_texture_state);
 
 void lp_build_sample_array_fini_soa(struct lp_build_sample_array_switch *switch_info);
+
+void
+lp_build_image_op_switch_soa(struct lp_build_img_op_array_switch *switch_info,
+                             struct gallivm_state *gallivm,
+                             const struct lp_img_params *params,
+                             LLVMValueRef idx,
+                             unsigned base, unsigned range);
+
+void
+lp_build_image_op_array_case(struct lp_build_img_op_array_switch *switch_info,
+                            int idx,
+                            const struct lp_static_texture_state *static_texture_state,
+                            struct lp_sampler_dynamic_state *dynamic_state);
+
+void lp_build_image_op_array_fini_soa(struct lp_build_img_op_array_switch *switch_info);
 #ifdef __cplusplus
 }
 #endif