diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-09-25 12:13:45 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-09-25 12:21:19 +0100 |
commit | 2a8d1fd3cedbac1dd145a3ac5b7a8edcba9a85d5 (patch) | |
tree | a5f640fc5f8ab54457060820f769d82cf3de1942 /src/gallium/auxiliary/gallivm/lp_bld_sample.c | |
parent | 998cf11e1387b3b0f774426eb7b52abfebbb20d3 (diff) |
gallivm: Fetch the lod from the dynamic state when min_lod == max_lod.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample.c')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_sample.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.c b/src/gallium/auxiliary/gallivm/lp_bld_sample.c index 44f44ff1aa..d9fbc0f305 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.c @@ -104,7 +104,6 @@ lp_sampler_static_state(struct lp_sampler_static_state *state, */ if (sampler->min_lod == sampler->max_lod) { state->min_max_lod_equal = 1; - state->min_max_lod = sampler->min_lod; } state->compare_mode = sampler->compare_mode; @@ -145,18 +144,19 @@ lp_build_lod_selector(struct lp_build_sample_context *bld, LLVMValueRef depth) { + LLVMValueRef min_lod = + bld->dynamic_state->min_lod(bld->dynamic_state, bld->builder, unit); + if (bld->static_state->min_max_lod_equal) { /* User is forcing sampling from a particular mipmap level. * This is hit during mipmap generation. */ - return LLVMConstReal(LLVMFloatType(), bld->static_state->min_max_lod); + return min_lod; } else { struct lp_build_context *float_bld = &bld->float_bld; LLVMValueRef sampler_lod_bias = bld->dynamic_state->lod_bias(bld->dynamic_state, bld->builder, unit); - LLVMValueRef min_lod = - bld->dynamic_state->min_lod(bld->dynamic_state, bld->builder, unit); LLVMValueRef max_lod = bld->dynamic_state->max_lod(bld->dynamic_state, bld->builder, unit); LLVMValueRef index0 = LLVMConstInt(LLVMInt32Type(), 0, 0); |