summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
diff options
context:
space:
mode:
authorJosé Fonseca <jfonseca@vmware.com>2010-10-09 09:34:31 +0100
committerJosé Fonseca <jfonseca@vmware.com>2010-10-09 09:34:31 +0100
commit34c11c87e4e3b5639764abee413c45e918749477 (patch)
treec77556cc81e756cb60d70319c2c245b92eed1e6d /src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
parent6316d540564d116460bfd1382e3eee98480e28ff (diff)
gallivm: Do size computations simultanously for all dimensions (AoS).
Operate simultanouesly on <width, height, depth> vector as much as possible, instead of doing the operations on vectors with broadcasted scalars. Also do the 24.8 fixed point scalar with integer shift of the texture size, for unnormalized coordinates. AoS path only for now -- the same thing can be done for SoA.
Diffstat (limited to 'src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c')
-rw-r--r--src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
index f3c4b6a7c8..1af0318e8e 100644
--- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
+++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
@@ -805,6 +805,8 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
LLVMValueRef *colors_out)
{
LLVMBuilderRef builder = bld->builder;
+ LLVMValueRef size0;
+ LLVMValueRef size1;
LLVMValueRef width0_vec;
LLVMValueRef width1_vec;
LLVMValueRef height0_vec;
@@ -822,8 +824,13 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
/* sample the first mipmap level */
lp_build_mipmap_level_sizes(bld, ilevel0,
- &width0_vec, &height0_vec, &depth0_vec,
+ &size0,
&row_stride0_vec, &img_stride0_vec);
+ lp_build_extract_image_sizes(bld,
+ bld->int_size_type,
+ bld->int_coord_type,
+ size0,
+ &width0_vec, &height0_vec, &depth0_vec);
data_ptr0 = lp_build_get_mipmap_level(bld, ilevel0);
if (img_filter == PIPE_TEX_FILTER_NEAREST) {
lp_build_sample_image_nearest(bld, unit,
@@ -863,8 +870,13 @@ lp_build_sample_mipmap(struct lp_build_sample_context *bld,
{
/* sample the second mipmap level */
lp_build_mipmap_level_sizes(bld, ilevel1,
- &width1_vec, &height1_vec, &depth1_vec,
+ &size1,
&row_stride1_vec, &img_stride1_vec);
+ lp_build_extract_image_sizes(bld,
+ bld->int_size_type,
+ bld->int_coord_type,
+ size1,
+ &width1_vec, &height1_vec, &depth1_vec);
data_ptr1 = lp_build_get_mipmap_level(bld, ilevel1);
if (img_filter == PIPE_TEX_FILTER_NEAREST) {
lp_build_sample_image_nearest(bld, unit,