diff options
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_sample.c | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 7d18ee592ba..5b220450bf3 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -246,8 +246,8 @@ 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, texture_unit); + first_level = bld->dynamic_state->first_level(bld->dynamic_state, bld->gallivm, + bld->context_ptr, texture_unit); 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); float_size = lp_build_int_to_float(float_size_bld, int_size); @@ -714,6 +714,7 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, { LLVMBuilderRef builder = bld->gallivm->builder; + struct lp_sampler_dynamic_state *dynamic_state = bld->dynamic_state; struct lp_build_context *lodf_bld = &bld->lodf_bld; LLVMValueRef lod; @@ -744,8 +745,8 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, * This is hit during mipmap generation. */ LLVMValueRef min_lod = - bld->dynamic_state->min_lod(bld->dynamic_state, - bld->gallivm, sampler_unit); + dynamic_state->min_lod(dynamic_state, bld->gallivm, + bld->context_ptr, sampler_unit); lod = lp_build_broadcast_scalar(lodf_bld, min_lod); } @@ -835,8 +836,8 @@ 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 = - bld->dynamic_state->lod_bias(bld->dynamic_state, - bld->gallivm, sampler_unit); + dynamic_state->lod_bias(dynamic_state, bld->gallivm, + bld->context_ptr, sampler_unit); sampler_lod_bias = lp_build_broadcast_scalar(lodf_bld, sampler_lod_bias); lod = LLVMBuildFAdd(builder, lod, sampler_lod_bias, "sampler_lod_bias"); @@ -845,16 +846,16 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, /* clamp lod */ if (bld->static_sampler_state->apply_max_lod) { LLVMValueRef max_lod = - bld->dynamic_state->max_lod(bld->dynamic_state, - bld->gallivm, sampler_unit); + dynamic_state->max_lod(dynamic_state, bld->gallivm, + bld->context_ptr, sampler_unit); max_lod = lp_build_broadcast_scalar(lodf_bld, max_lod); lod = lp_build_min(lodf_bld, lod, max_lod); } if (bld->static_sampler_state->apply_min_lod) { LLVMValueRef min_lod = - bld->dynamic_state->min_lod(bld->dynamic_state, - bld->gallivm, sampler_unit); + dynamic_state->min_lod(dynamic_state, bld->gallivm, + bld->context_ptr, sampler_unit); min_lod = lp_build_broadcast_scalar(lodf_bld, min_lod); lod = lp_build_max(lodf_bld, lod, min_lod); @@ -901,12 +902,13 @@ lp_build_nearest_mip_level(struct lp_build_sample_context *bld, LLVMValueRef *out_of_bounds) { struct lp_build_context *leveli_bld = &bld->leveli_bld; + struct lp_sampler_dynamic_state *dynamic_state = bld->dynamic_state; LLVMValueRef first_level, last_level, level; - first_level = bld->dynamic_state->first_level(bld->dynamic_state, - bld->gallivm, texture_unit); - last_level = bld->dynamic_state->last_level(bld->dynamic_state, - bld->gallivm, texture_unit); + first_level = dynamic_state->first_level(dynamic_state, bld->gallivm, + bld->context_ptr, texture_unit); + last_level = dynamic_state->last_level(dynamic_state, bld->gallivm, + bld->context_ptr, texture_unit); first_level = lp_build_broadcast_scalar(leveli_bld, first_level); last_level = lp_build_broadcast_scalar(leveli_bld, last_level); @@ -956,6 +958,7 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld, LLVMValueRef *level1_out) { LLVMBuilderRef builder = bld->gallivm->builder; + struct lp_sampler_dynamic_state *dynamic_state = bld->dynamic_state; struct lp_build_context *leveli_bld = &bld->leveli_bld; struct lp_build_context *levelf_bld = &bld->levelf_bld; LLVMValueRef first_level, last_level; @@ -964,10 +967,10 @@ lp_build_linear_mip_levels(struct lp_build_sample_context *bld, assert(bld->num_lods == bld->num_mips); - first_level = bld->dynamic_state->first_level(bld->dynamic_state, - bld->gallivm, texture_unit); - last_level = bld->dynamic_state->last_level(bld->dynamic_state, - bld->gallivm, texture_unit); + first_level = dynamic_state->first_level(dynamic_state, bld->gallivm, + bld->context_ptr, texture_unit); + last_level = dynamic_state->last_level(dynamic_state, bld->gallivm, + bld->context_ptr, texture_unit); first_level = lp_build_broadcast_scalar(leveli_bld, first_level); last_level = lp_build_broadcast_scalar(leveli_bld, last_level); |