gallivm/sample: pass indirect offset into texture/image units
[mesa.git] / src / gallium / drivers / llvmpipe / lp_tex_sample.c
index 0b1d7198e8f33b10c24f6cd94b640242d492acbe..a8d18d772d92552bbb6520812ffb35d200ffed9f 100644 (file)
@@ -110,6 +110,7 @@ lp_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
                        struct gallivm_state *gallivm,
                        LLVMValueRef context_ptr,
                        unsigned texture_unit,
+                       LLVMValueRef texture_unit_offset,
                        unsigned member_index,
                        const char *member_name,
                        boolean emit_load)
@@ -157,10 +158,12 @@ lp_llvm_texture_member(const struct lp_sampler_dynamic_state *base,
    lp_llvm_texture_##_name( const struct lp_sampler_dynamic_state *base, \
                             struct gallivm_state *gallivm, \
                             LLVMValueRef context_ptr, \
-                            unsigned texture_unit) \
+                            unsigned texture_unit,    \
+                            LLVMValueRef texture_unit_offset) \
    { \
       return lp_llvm_texture_member(base, gallivm, context_ptr, \
-                                    texture_unit, _index, #_name, _emit_load ); \
+                                    texture_unit, texture_unit_offset,  \
+                                    _index, #_name, _emit_load );       \
    }
 
 
@@ -254,6 +257,7 @@ lp_llvm_image_member(const struct lp_sampler_dynamic_state *base,
                      struct gallivm_state *gallivm,
                      LLVMValueRef context_ptr,
                      unsigned image_unit,
+                     LLVMValueRef image_unit_offset,
                      unsigned member_index,
                      const char *member_name,
                      boolean emit_load)
@@ -299,12 +303,13 @@ lp_llvm_image_member(const struct lp_sampler_dynamic_state *base,
 #define LP_LLVM_IMAGE_MEMBER(_name, _index, _emit_load)  \
    static LLVMValueRef \
    lp_llvm_image_##_name( const struct lp_sampler_dynamic_state *base, \
-                            struct gallivm_state *gallivm, \
-                            LLVMValueRef context_ptr, \
-                            unsigned image_unit) \
+                          struct gallivm_state *gallivm,               \
+                          LLVMValueRef context_ptr,                     \
+                          unsigned image_unit, LLVMValueRef image_unit_offset) \
    { \
       return lp_llvm_image_member(base, gallivm, context_ptr, \
-                                    image_unit, _index, #_name, _emit_load ); \
+                                  image_unit, image_unit_offset, \
+                                  _index, #_name, _emit_load );  \
    }