diff options
author | Roland Scheidegger <[email protected]> | 2012-11-12 20:35:04 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2012-11-12 21:02:59 +0100 |
commit | 26097c4855b97ee6e362c19df11d51fb7fd42192 (patch) | |
tree | dbc5018aa4b3a2c2fb2e1e0464be4776610cc044 /src/gallium/auxiliary/gallivm/lp_bld_sample.h | |
parent | 8257bb963f0b21c0c35da479707b5cacbc1c2824 (diff) |
gallivm,draw,llvmpipe: use base ptr + mip offsets instead of mip pointers
This might have a slight overhead but handling mip offsets more like
the width (and image) strides should make some things easier (mip level
being just part of the offset calculation) later.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample.h')
-rw-r--r-- | src/gallium/auxiliary/gallivm/lp_bld_sample.h | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample.h b/src/gallium/auxiliary/gallivm/lp_bld_sample.h index 0f3d8ae6cb5..d8a068d5497 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample.h +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample.h @@ -157,12 +157,18 @@ struct lp_sampler_dynamic_state struct gallivm_state *gallivm, unsigned unit); - /** Obtain pointer to array of pointers to mimpap levels */ + /** Obtain pointer to base of texture */ LLVMValueRef - (*data_ptr)( const struct lp_sampler_dynamic_state *state, + (*base_ptr)( const struct lp_sampler_dynamic_state *state, struct gallivm_state *gallivm, unsigned unit); + /** Obtain pointer to array of mipmap offsets */ + LLVMValueRef + (*mip_offsets)( const struct lp_sampler_dynamic_state *state, + struct gallivm_state *gallivm, + unsigned unit); + /** Obtain texture min lod (returns float) */ LLVMValueRef (*min_lod)(const struct lp_sampler_dynamic_state *state, @@ -246,7 +252,8 @@ struct lp_build_sample_context /* Common dynamic state values */ LLVMValueRef row_stride_array; LLVMValueRef img_stride_array; - LLVMValueRef data_array; + LLVMValueRef base_ptr; + LLVMValueRef mip_offsets; /** Integer vector with texture width, height, depth */ LLVMValueRef int_size; |