diff options
author | Brian Paul <brianp@vmware.com> | 2010-09-23 18:18:40 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-09-24 09:47:37 -0600 |
commit | 61b7da074e2faebf03d3dfc30e910ee1367bcd5a (patch) | |
tree | 0151a5a1782d89392199435c1d49c3a870d4a7a7 /src/gallium/auxiliary/gallivm/lp_bld_sample.h | |
parent | 7967b46e652eeef5e3bb1101e53b4c15683ecd12 (diff) |
llvmpipe: make min/max lod and lod bias dynamic state
Before, changing any of these sampler values triggered generation
of new JIT code. Added a new flag for the special case of
min_lod == max_lod which is hit during auto mipmap generation.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample.h')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_sample.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index 8b042d5242..661f35f6de 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -82,8 +82,9 @@ struct lp_sampler_static_state unsigned compare_mode:1; unsigned compare_func:3; unsigned normalized_coords:1; - float lod_bias, min_lod, max_lod; float border_color[4]; + unsigned min_max_lod_equal:1; /**< min_lod == max_lod ? */ + float min_max_lod; /**< only valid when min_max_lod_equal=1 */ /* Aero hacks */ unsigned force_nearest_s:1; @@ -143,6 +144,20 @@ struct lp_sampler_dynamic_state LLVMBuilderRef builder, unsigned unit); + /** Obtain texture min lod */ + LLVMValueRef + (*min_lod)(const struct lp_sampler_dynamic_state *state, + LLVMBuilderRef builder, unsigned unit); + + /** Obtain texture max lod */ + LLVMValueRef + (*max_lod)(const struct lp_sampler_dynamic_state *state, + LLVMBuilderRef builder, unsigned unit); + + /** Obtain texture lod bias */ + LLVMValueRef + (*lod_bias)(const struct lp_sampler_dynamic_state *state, + LLVMBuilderRef builder, unsigned unit); }; @@ -248,6 +263,7 @@ lp_sampler_static_state(struct lp_sampler_static_state *state, LLVMValueRef lp_build_lod_selector(struct lp_build_sample_context *bld, + unsigned unit, const LLVMValueRef ddx[4], const LLVMValueRef ddy[4], LLVMValueRef lod_bias, /* optional */ |