gallivm/nir: refactor image operations for indirect support.
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_sample.h
index 24fc06ffe722c24ec832bd1f78962f7bb9c95e7a..399c24df1d6094de7d1ea7ac196e96924d372cbe 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;
@@ -226,77 +227,77 @@ struct lp_sampler_dynamic_state
    (*width)(const struct lp_sampler_dynamic_state *state,
             struct gallivm_state *gallivm,
             LLVMValueRef context_ptr,
-            unsigned texture_unit);
+            unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain the base texture height (returns int32) */
    LLVMValueRef
    (*height)(const struct lp_sampler_dynamic_state *state,
              struct gallivm_state *gallivm,
              LLVMValueRef context_ptr,
-             unsigned texture_unit);
+             unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain the base texture depth (or array size) (returns int32) */
    LLVMValueRef
    (*depth)(const struct lp_sampler_dynamic_state *state,
             struct gallivm_state *gallivm,
             LLVMValueRef context_ptr,
-            unsigned texture_unit);
+            unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain the first mipmap level (base level) (returns int32) */
    LLVMValueRef
    (*first_level)(const struct lp_sampler_dynamic_state *state,
                   struct gallivm_state *gallivm,
                   LLVMValueRef context_ptr,
-                  unsigned texture_unit);
+                  unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain the number of mipmap levels minus one (returns int32) */
    LLVMValueRef
    (*last_level)(const struct lp_sampler_dynamic_state *state,
                  struct gallivm_state *gallivm,
                  LLVMValueRef context_ptr,
-                 unsigned texture_unit);
+                 unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain stride in bytes between image rows/blocks (returns int32) */
    LLVMValueRef
    (*row_stride)(const struct lp_sampler_dynamic_state *state,
                  struct gallivm_state *gallivm,
                  LLVMValueRef context_ptr,
-                 unsigned texture_unit);
+                 unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain stride in bytes between image slices (returns int32) */
    LLVMValueRef
    (*img_stride)(const struct lp_sampler_dynamic_state *state,
                  struct gallivm_state *gallivm,
                  LLVMValueRef context_ptr,
-                 unsigned texture_unit);
+                 unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain pointer to base of texture */
    LLVMValueRef
    (*base_ptr)(const struct lp_sampler_dynamic_state *state,
                struct gallivm_state *gallivm,
                LLVMValueRef context_ptr,
-               unsigned texture_unit);
+               unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain pointer to array of mipmap offsets */
    LLVMValueRef
    (*mip_offsets)(const struct lp_sampler_dynamic_state *state,
                   struct gallivm_state *gallivm,
                   LLVMValueRef context_ptr,
-                  unsigned texture_unit);
+                  unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain number of samples (returns int32) */
    LLVMValueRef
    (*num_samples)(const struct lp_sampler_dynamic_state *state,
                   struct gallivm_state *gallivm,
                   LLVMValueRef context_ptr,
-                  unsigned texture_unit);
+                  unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /** Obtain multisample stride (returns int32) */
    LLVMValueRef
    (*sample_stride)(const struct lp_sampler_dynamic_state *state,
                     struct gallivm_state *gallivm,
                     LLVMValueRef context_ptr,
-                    unsigned texture_unit);
+                    unsigned texture_unit, LLVMValueRef texture_unit_offset);
 
    /* These are callbacks for sampler state */
 
@@ -705,9 +706,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,