From 5fdd77c7f24a17bc20ff6571eb52233fc7a44f02 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Tue, 9 Aug 2022 05:28:06 +1000 Subject: [PATCH] gallivm/sample: remove unused base parameter from dynamic callbacks. This parameters was never used anywhere, so just remove it. Reviewed-by: Roland Scheidegger Part-of: --- src/gallium/auxiliary/draw/draw_llvm_sample.c | 24 +++---- src/gallium/auxiliary/gallivm/lp_bld_sample.c | 20 +++--- src/gallium/auxiliary/gallivm/lp_bld_sample.h | 51 +++++-------- .../auxiliary/gallivm/lp_bld_sample_soa.c | 72 +++++++++---------- src/gallium/drivers/llvmpipe/lp_tex_sample.c | 33 ++++----- 5 files changed, 82 insertions(+), 118 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_llvm_sample.c b/src/gallium/auxiliary/draw/draw_llvm_sample.c index 084f7200cf1..21985e26c52 100644 --- a/src/gallium/auxiliary/draw/draw_llvm_sample.c +++ b/src/gallium/auxiliary/draw/draw_llvm_sample.c @@ -99,8 +99,7 @@ struct draw_llvm_image_soa * @sa http://llvm.org/docs/GetElementPtr.html */ static LLVMValueRef -draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base, - struct gallivm_state *gallivm, +draw_llvm_texture_member(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned texture_unit, LLVMValueRef texture_unit_offset, @@ -151,8 +150,7 @@ draw_llvm_texture_member(const struct lp_sampler_dynamic_state *base, * @sa http://llvm.org/docs/GetElementPtr.html */ static LLVMValueRef -draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base, - struct gallivm_state *gallivm, +draw_llvm_sampler_member(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned sampler_unit, unsigned member_index, @@ -196,8 +194,7 @@ draw_llvm_sampler_member(const struct lp_sampler_dynamic_state *base, * @sa http://llvm.org/docs/GetElementPtr.html */ static LLVMValueRef -draw_llvm_image_member(const struct lp_sampler_dynamic_state *base, - struct gallivm_state *gallivm, +draw_llvm_image_member(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned image_unit, LLVMValueRef image_unit_offset, @@ -249,13 +246,12 @@ draw_llvm_image_member(const struct lp_sampler_dynamic_state *base, */ #define DRAW_LLVM_TEXTURE_MEMBER(_name, _index, _emit_load) \ static LLVMValueRef \ - draw_llvm_texture_##_name( const struct lp_sampler_dynamic_state *base, \ - struct gallivm_state *gallivm, \ + draw_llvm_texture_##_name( struct gallivm_state *gallivm, \ LLVMValueRef context_ptr, \ unsigned texture_unit, \ LLVMValueRef texture_unit_offset) \ { \ - return draw_llvm_texture_member(base, gallivm, context_ptr, \ + return draw_llvm_texture_member(gallivm, context_ptr, \ texture_unit, texture_unit_offset, \ _index, #_name, _emit_load ); \ } @@ -275,12 +271,11 @@ DRAW_LLVM_TEXTURE_MEMBER(sample_stride, DRAW_JIT_TEXTURE_SAMPLE_STRIDE, TRUE) #define DRAW_LLVM_SAMPLER_MEMBER(_name, _index, _emit_load) \ static LLVMValueRef \ - draw_llvm_sampler_##_name( const struct lp_sampler_dynamic_state *base, \ - struct gallivm_state *gallivm, \ + draw_llvm_sampler_##_name( struct gallivm_state *gallivm, \ LLVMValueRef context_ptr, \ unsigned sampler_unit) \ { \ - return draw_llvm_sampler_member(base, gallivm, context_ptr, \ + return draw_llvm_sampler_member(gallivm, context_ptr, \ sampler_unit, _index, #_name, _emit_load ); \ } @@ -293,12 +288,11 @@ DRAW_LLVM_SAMPLER_MEMBER(max_aniso, DRAW_JIT_SAMPLER_MAX_ANISO, TRUE) #define DRAW_LLVM_IMAGE_MEMBER(_name, _index, _emit_load) \ static LLVMValueRef \ - draw_llvm_image_##_name( const struct lp_sampler_dynamic_state *base, \ - struct gallivm_state *gallivm, \ + draw_llvm_image_##_name( struct gallivm_state *gallivm, \ LLVMValueRef context_ptr, \ unsigned image_unit, LLVMValueRef image_unit_offset) \ { \ - return draw_llvm_image_member(base, gallivm, context_ptr, \ + return draw_llvm_image_member(gallivm, context_ptr, \ image_unit, image_unit_offset, \ _index, #_name, _emit_load ); \ } diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 49aa1ac5de1..5ab732ab765 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -264,7 +264,7 @@ lp_build_pmin(struct lp_build_sample_context *bld, boolean pmin_per_quad = pmin_bld->type.length != length; unsigned i; - first_level = bld->dynamic_state->first_level(bld->dynamic_state, bld->gallivm, + first_level = bld->dynamic_state->first_level(bld->gallivm, bld->context_ptr, texture_unit, NULL); first_level_vec = lp_build_broadcast_scalar(int_size_bld, first_level); int_size = lp_build_minify(int_size_bld, bld->int_size, first_level_vec, TRUE); @@ -375,7 +375,7 @@ lp_build_rho(struct lp_build_sample_context *bld, * the messy cube maps for now) when requested. */ - first_level = bld->dynamic_state->first_level(bld->dynamic_state, bld->gallivm, + first_level = bld->dynamic_state->first_level(bld->gallivm, bld->context_ptr, texture_unit, NULL); first_level_vec = lp_build_broadcast_scalar(int_size_bld, first_level); int_size = lp_build_minify(int_size_bld, bld->int_size, first_level_vec, TRUE); @@ -877,7 +877,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, * This is hit during mipmap generation. */ LLVMValueRef min_lod = - dynamic_state->min_lod(dynamic_state, bld->gallivm, + dynamic_state->min_lod(bld->gallivm, bld->context_ptr, sampler_unit); lod = lp_build_broadcast_scalar(lodf_bld, min_lod); @@ -976,7 +976,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, /* add sampler lod bias */ if (bld->static_sampler_state->lod_bias_non_zero) { LLVMValueRef sampler_lod_bias = - dynamic_state->lod_bias(dynamic_state, bld->gallivm, + dynamic_state->lod_bias(bld->gallivm, bld->context_ptr, sampler_unit); sampler_lod_bias = lp_build_broadcast_scalar(lodf_bld, sampler_lod_bias); @@ -990,7 +990,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, /* clamp lod */ if (bld->static_sampler_state->apply_max_lod) { LLVMValueRef max_lod = - dynamic_state->max_lod(dynamic_state, bld->gallivm, + dynamic_state->max_lod(bld->gallivm, bld->context_ptr, sampler_unit); max_lod = lp_build_broadcast_scalar(lodf_bld, max_lod); @@ -998,7 +998,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, } if (bld->static_sampler_state->apply_min_lod) { LLVMValueRef min_lod = - dynamic_state->min_lod(dynamic_state, bld->gallivm, + dynamic_state->min_lod(bld->gallivm, bld->context_ptr, sampler_unit); min_lod = lp_build_broadcast_scalar(lodf_bld, min_lod); @@ -1056,9 +1056,9 @@ lp_build_nearest_mip_level(struct lp_build_sample_context *bld, struct lp_sampler_dynamic_state *dynamic_state = bld->dynamic_state; LLVMValueRef first_level, last_level, level; - first_level = dynamic_state->first_level(dynamic_state, bld->gallivm, + first_level = dynamic_state->first_level(bld->gallivm, bld->context_ptr, texture_unit, NULL); - last_level = dynamic_state->last_level(dynamic_state, bld->gallivm, + last_level = dynamic_state->last_level(bld->gallivm, bld->context_ptr, texture_unit, NULL); first_level = lp_build_broadcast_scalar(leveli_bld, first_level); last_level = lp_build_broadcast_scalar(leveli_bld, last_level); @@ -1118,9 +1118,9 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld, assert(bld->num_lods == bld->num_mips); - first_level = dynamic_state->first_level(dynamic_state, bld->gallivm, + first_level = dynamic_state->first_level(bld->gallivm, bld->context_ptr, texture_unit, NULL); - last_level = dynamic_state->last_level(dynamic_state, bld->gallivm, + last_level = dynamic_state->last_level(bld->gallivm, bld->context_ptr, texture_unit, NULL); first_level = lp_build_broadcast_scalar(leveli_bld, first_level); last_level = lp_build_broadcast_scalar(leveli_bld, last_level); diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index a5dfda5f4b4..fd89ab1bd92 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -228,78 +228,67 @@ struct lp_sampler_dynamic_state /** Obtain the base texture width (or number of elements) (returns int32) */ LLVMValueRef - (*width)(const struct lp_sampler_dynamic_state *state, - struct gallivm_state *gallivm, + (*width)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*height)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*depth)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*first_level)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*last_level)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*row_stride)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*img_stride)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*base_ptr)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*mip_offsets)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*num_samples)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, 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, + (*sample_stride)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned texture_unit, LLVMValueRef texture_unit_offset); @@ -307,36 +296,31 @@ struct lp_sampler_dynamic_state /** Obtain texture min lod (returns float) */ LLVMValueRef - (*min_lod)(const struct lp_sampler_dynamic_state *state, - struct gallivm_state *gallivm, + (*min_lod)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned sampler_unit); /** Obtain texture max lod (returns float) */ LLVMValueRef - (*max_lod)(const struct lp_sampler_dynamic_state *state, - struct gallivm_state *gallivm, + (*max_lod)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned sampler_unit); /** Obtain texture lod bias (returns float) */ LLVMValueRef - (*lod_bias)(const struct lp_sampler_dynamic_state *state, - struct gallivm_state *gallivm, + (*lod_bias)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned sampler_unit); /** Obtain texture border color (returns ptr to float[4]) */ LLVMValueRef - (*border_color)(const struct lp_sampler_dynamic_state *state, - struct gallivm_state *gallivm, + (*border_color)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned sampler_unit); /** Obtain maximum anisotropy */ LLVMValueRef - (*max_aniso)(const struct lp_sampler_dynamic_state *state, - struct gallivm_state *gallivm, + (*max_aniso)(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned sampler_unit); @@ -346,8 +330,7 @@ struct lp_sampler_dynamic_state * It's optional: no caching will be done if it's NULL. */ LLVMValueRef - (*cache_ptr)(const struct lp_sampler_dynamic_state *state, - struct gallivm_state *gallivm, + (*cache_ptr)(struct gallivm_state *gallivm, LLVMValueRef thread_data_ptr, unsigned unit); }; diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index 5fe5b087c33..ab453a4674b 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -2046,7 +2046,7 @@ lp_build_layer_coord(struct lp_build_sample_context *bld, LLVMValueRef num_layers; struct lp_build_context *int_coord_bld = &bld->int_coord_bld; - num_layers = bld->dynamic_state->depth(bld->dynamic_state, bld->gallivm, + num_layers = bld->dynamic_state->depth(bld->gallivm, bld->context_ptr, texture_unit, NULL); if (out_of_bounds) { @@ -2608,8 +2608,7 @@ lp_build_sample_common(struct lp_build_sample_context *bld, LLVMValueRef max_aniso = NULL; if (aniso) - max_aniso = bld->dynamic_state->max_aniso(bld->dynamic_state, - bld->gallivm, + max_aniso = bld->dynamic_state->max_aniso(bld->gallivm, bld->context_ptr, sampler_index); @@ -2623,12 +2622,10 @@ lp_build_sample_common(struct lp_build_sample_context *bld, &lod_ipart, lod_fpart, lod_pos_or_zero); if (is_lodq) { LLVMValueRef last_level; - last_level = bld->dynamic_state->last_level(bld->dynamic_state, - bld->gallivm, + last_level = bld->dynamic_state->last_level(bld->gallivm, bld->context_ptr, texture_index, NULL); - first_level = bld->dynamic_state->first_level(bld->dynamic_state, - bld->gallivm, + first_level = bld->dynamic_state->first_level(bld->gallivm, bld->context_ptr, texture_index, NULL); last_level = lp_build_sub(&bld->int_bld, last_level, first_level); @@ -2675,8 +2672,7 @@ lp_build_sample_common(struct lp_build_sample_context *bld, assert(0 && "bad mip_filter value in lp_build_sample_soa()"); case PIPE_TEX_MIPFILTER_NONE: /* always use mip level 0 */ - first_level = bld->dynamic_state->first_level(bld->dynamic_state, - bld->gallivm, bld->context_ptr, + first_level = bld->dynamic_state->first_level(bld->gallivm, bld->context_ptr, texture_index, NULL); first_level = lp_build_broadcast_scalar(&bld->leveli_bld, first_level); *ilevel0 = first_level; @@ -2703,7 +2699,7 @@ lp_build_clamp_border_color(struct lp_build_sample_context *bld, struct gallivm_state *gallivm = bld->gallivm; LLVMBuilderRef builder = gallivm->builder; LLVMValueRef border_color_ptr = - bld->dynamic_state->border_color(bld->dynamic_state, gallivm, + bld->dynamic_state->border_color(gallivm, bld->context_ptr, sampler_unit); LLVMValueRef border_color; const struct util_format_description *format_desc = bld->format_desc; @@ -3128,7 +3124,7 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld, else { assert(bld->num_mips == 1); if (bld->static_texture_state->target != PIPE_BUFFER) { - ilevel = bld->dynamic_state->first_level(bld->dynamic_state, bld->gallivm, + ilevel = bld->dynamic_state->first_level(bld->gallivm, bld->context_ptr, texture_unit, NULL); } else { @@ -3197,7 +3193,7 @@ lp_build_fetch_texel(struct lp_build_sample_context *bld, if (bld->fetch_ms) { LLVMValueRef num_samples; - num_samples = bld->dynamic_state->num_samples(bld->dynamic_state, bld->gallivm, + num_samples = bld->dynamic_state->num_samples(bld->gallivm, bld->context_ptr, texture_unit, NULL); out1 = lp_build_cmp(int_coord_bld, PIPE_FUNC_LESS, ms_index, int_coord_bld->zero); out_of_bounds = lp_build_or(int_coord_bld, out_of_bounds, out1); @@ -3557,23 +3553,22 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, lp_build_context_init(&bld.lodi_bld, gallivm, bld.lodi_type); /* Get the dynamic state */ - LLVMValueRef tex_width = dynamic_state->width(dynamic_state, gallivm, + LLVMValueRef tex_width = dynamic_state->width(gallivm, context_ptr, texture_index, NULL); - bld.row_stride_array = dynamic_state->row_stride(dynamic_state, gallivm, + bld.row_stride_array = dynamic_state->row_stride(gallivm, context_ptr, texture_index, NULL); - bld.img_stride_array = dynamic_state->img_stride(dynamic_state, gallivm, + bld.img_stride_array = dynamic_state->img_stride(gallivm, context_ptr, texture_index, NULL); - bld.base_ptr = dynamic_state->base_ptr(dynamic_state, gallivm, + bld.base_ptr = dynamic_state->base_ptr(gallivm, context_ptr, texture_index, NULL); - bld.mip_offsets = dynamic_state->mip_offsets(dynamic_state, gallivm, + bld.mip_offsets = dynamic_state->mip_offsets(gallivm, context_ptr, texture_index, NULL); if (fetch_ms) { bld.sample_stride = lp_build_broadcast_scalar(&bld.int_coord_bld, - dynamic_state->sample_stride(dynamic_state, - gallivm, + dynamic_state->sample_stride(gallivm, context_ptr, texture_index, NULL)); @@ -3582,7 +3577,7 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, /* Note that mip_offsets is an array[level] of offsets to texture images */ if (dynamic_state->cache_ptr && thread_data_ptr) { - bld.cache = dynamic_state->cache_ptr(dynamic_state, gallivm, + bld.cache = dynamic_state->cache_ptr(gallivm, thread_data_ptr, texture_index); } @@ -3596,14 +3591,14 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm, LLVMConstInt(i32t, 0, 0), ""); if (dims >= 2) { LLVMValueRef tex_height = - dynamic_state->height(dynamic_state, gallivm, + dynamic_state->height(gallivm, context_ptr, texture_index, NULL); bld.int_size = LLVMBuildInsertElement(builder, bld.int_size, tex_height, LLVMConstInt(i32t, 1, 0), ""); if (dims >= 3) { LLVMValueRef tex_depth = - dynamic_state->depth(dynamic_state, gallivm, context_ptr, + dynamic_state->depth(gallivm, context_ptr, texture_index, NULL); bld.int_size = LLVMBuildInsertElement(builder, bld.int_size, tex_depth, @@ -4415,7 +4410,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, params->sizes_out[0] = lp_build_broadcast(gallivm, lp_build_vec_type(gallivm, params->int_type), - dynamic_state->num_samples(dynamic_state, gallivm, + dynamic_state->num_samples(gallivm, context_ptr, texture_unit, texture_unit_offset)); @@ -4426,7 +4421,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, /* FIXME: this needs to honor per-element lod */ lod = LLVMBuildExtractElement(gallivm->builder, params->explicit_lod, lp_build_const_int32(gallivm, 0), ""); - first_level = dynamic_state->first_level(dynamic_state, gallivm, + first_level = dynamic_state->first_level(gallivm, context_ptr, texture_unit, texture_unit_offset); level = LLVMBuildAdd(gallivm->builder, lod, first_level, "level"); @@ -4438,7 +4433,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, size = bld_int_vec4.undef; size = LLVMBuildInsertElement(gallivm->builder, size, - dynamic_state->width(dynamic_state, gallivm, + dynamic_state->width(gallivm, context_ptr, texture_unit, texture_unit_offset), @@ -4446,8 +4441,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, if (dims >= 2) { size = LLVMBuildInsertElement(gallivm->builder, size, - dynamic_state->height(dynamic_state, - gallivm, context_ptr, + dynamic_state->height(gallivm, context_ptr, texture_unit, texture_unit_offset), lp_build_const_int32(gallivm, 1), ""); @@ -4455,7 +4449,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, if (dims >= 3) { size = LLVMBuildInsertElement(gallivm->builder, size, - dynamic_state->depth(dynamic_state, gallivm, + dynamic_state->depth(gallivm, context_ptr, texture_unit, texture_unit_offset), @@ -4465,7 +4459,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, size = lp_build_minify(&bld_int_vec4, size, lod, TRUE); if (has_array) { - LLVMValueRef layers = dynamic_state->depth(dynamic_state, gallivm, + LLVMValueRef layers = dynamic_state->depth(gallivm, context_ptr, texture_unit, texture_unit_offset); if (target == PIPE_TEXTURE_CUBE_ARRAY) { @@ -4492,7 +4486,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, /* everything is scalar for now */ lp_build_context_init(&leveli_bld, gallivm, lp_type_int_vec(32, 32)); - last_level = dynamic_state->last_level(dynamic_state, gallivm, + last_level = dynamic_state->last_level(gallivm, context_ptr, texture_unit, texture_unit_offset); @@ -4539,7 +4533,7 @@ lp_build_size_query_soa(struct gallivm_state *gallivm, else { LLVMValueRef last_level; - last_level = dynamic_state->last_level(dynamic_state, gallivm, + last_level = dynamic_state->last_level(gallivm, context_ptr, texture_unit, texture_unit_offset); num_levels = lp_build_sub(&bld_int_scalar, last_level, first_level); @@ -4693,30 +4687,30 @@ lp_build_img_op_soa(const struct lp_static_texture_state *static_texture_state, } LLVMValueRef offset, i, j; - LLVMValueRef row_stride = dynamic_state->row_stride(dynamic_state, gallivm, + LLVMValueRef row_stride = dynamic_state->row_stride(gallivm, params->context_ptr, params->image_index, NULL); - LLVMValueRef img_stride = dynamic_state->img_stride(dynamic_state, gallivm, + LLVMValueRef img_stride = dynamic_state->img_stride(gallivm, params->context_ptr, params->image_index, NULL); - LLVMValueRef base_ptr = dynamic_state->base_ptr(dynamic_state, gallivm, + LLVMValueRef base_ptr = dynamic_state->base_ptr(gallivm, params->context_ptr, params->image_index, NULL); - LLVMValueRef width = dynamic_state->width(dynamic_state, gallivm, + LLVMValueRef width = dynamic_state->width(gallivm, params->context_ptr, params->image_index, NULL); - LLVMValueRef height = dynamic_state->height(dynamic_state, gallivm, + LLVMValueRef height = dynamic_state->height(gallivm, params->context_ptr, params->image_index, NULL); - LLVMValueRef depth = dynamic_state->depth(dynamic_state, gallivm, + LLVMValueRef depth = dynamic_state->depth(gallivm, params->context_ptr, params->image_index, NULL); LLVMValueRef num_samples = NULL, sample_stride = NULL; if (ms_index) { - num_samples = dynamic_state->num_samples(dynamic_state, gallivm, + num_samples = dynamic_state->num_samples(gallivm, params->context_ptr, params->image_index, NULL); - sample_stride = dynamic_state->sample_stride(dynamic_state, gallivm, + sample_stride = dynamic_state->sample_stride(gallivm, params->context_ptr, params->image_index, NULL); } diff --git a/src/gallium/drivers/llvmpipe/lp_tex_sample.c b/src/gallium/drivers/llvmpipe/lp_tex_sample.c index 61ce6439a11..6d63300d81a 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_sample.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_sample.c @@ -109,8 +109,7 @@ struct lp_llvm_image_soa * @sa http://llvm.org/docs/GetElementPtr.html */ static LLVMValueRef -lp_llvm_texture_member(const struct lp_sampler_dynamic_state *base, - struct gallivm_state *gallivm, +lp_llvm_texture_member(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned texture_unit, LLVMValueRef texture_unit_offset, @@ -166,13 +165,12 @@ lp_llvm_texture_member(const struct lp_sampler_dynamic_state *base, */ #define LP_LLVM_TEXTURE_MEMBER(_name, _index, _emit_load) \ static LLVMValueRef \ - lp_llvm_texture_##_name( const struct lp_sampler_dynamic_state *base, \ - struct gallivm_state *gallivm, \ - LLVMValueRef context_ptr, \ - unsigned texture_unit, \ - LLVMValueRef texture_unit_offset) \ + lp_llvm_texture_##_name(struct gallivm_state *gallivm, \ + LLVMValueRef context_ptr, \ + unsigned texture_unit, \ + LLVMValueRef texture_unit_offset) \ { \ - return lp_llvm_texture_member(base, gallivm, context_ptr, \ + return lp_llvm_texture_member(gallivm, context_ptr, \ texture_unit, texture_unit_offset, \ _index, #_name, _emit_load ); \ } @@ -200,8 +198,7 @@ LP_LLVM_TEXTURE_MEMBER(sample_stride, LP_JIT_TEXTURE_SAMPLE_STRIDE, TRUE) * @sa http://llvm.org/docs/GetElementPtr.html */ static LLVMValueRef -lp_llvm_sampler_member(const struct lp_sampler_dynamic_state *base, - struct gallivm_state *gallivm, +lp_llvm_sampler_member(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned sampler_unit, unsigned member_index, @@ -235,12 +232,11 @@ lp_llvm_sampler_member(const struct lp_sampler_dynamic_state *base, #define LP_LLVM_SAMPLER_MEMBER(_name, _index, _emit_load) \ static LLVMValueRef \ - lp_llvm_sampler_##_name( const struct lp_sampler_dynamic_state *base, \ - struct gallivm_state *gallivm, \ + lp_llvm_sampler_##_name( struct gallivm_state *gallivm, \ LLVMValueRef context_ptr, \ unsigned sampler_unit) \ { \ - return lp_llvm_sampler_member(base, gallivm, context_ptr, \ + return lp_llvm_sampler_member(gallivm, context_ptr, \ sampler_unit, _index, #_name, _emit_load ); \ } @@ -261,8 +257,7 @@ LP_LLVM_SAMPLER_MEMBER(max_aniso, LP_JIT_SAMPLER_MAX_ANISO, TRUE) * @sa http://llvm.org/docs/GetElementPtr.html */ static LLVMValueRef -lp_llvm_image_member(const struct lp_sampler_dynamic_state *base, - struct gallivm_state *gallivm, +lp_llvm_image_member(struct gallivm_state *gallivm, LLVMValueRef context_ptr, unsigned image_unit, LLVMValueRef image_unit_offset, @@ -311,12 +306,11 @@ 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, \ + lp_llvm_image_##_name( struct gallivm_state *gallivm, \ LLVMValueRef context_ptr, \ unsigned image_unit, LLVMValueRef image_unit_offset) \ { \ - return lp_llvm_image_member(base, gallivm, context_ptr, \ + return lp_llvm_image_member(gallivm, context_ptr, \ image_unit, image_unit_offset, \ _index, #_name, _emit_load ); \ } @@ -334,8 +328,7 @@ LP_LLVM_IMAGE_MEMBER(sample_stride, LP_JIT_IMAGE_SAMPLE_STRIDE, TRUE) #if LP_USE_TEXTURE_CACHE static LLVMValueRef -lp_llvm_texture_cache_ptr(const struct lp_sampler_dynamic_state *base, - struct gallivm_state *gallivm, +lp_llvm_texture_cache_ptr(struct gallivm_state *gallivm, LLVMValueRef thread_data_ptr, unsigned unit) {