LLVMValueRef height_vec,
LLVMValueRef depth_vec,
LLVMValueRef row_stride_array,
- LLVMValueRef img_stride_vec,
+ LLVMValueRef img_stride_array,
LLVMValueRef data_array,
LLVMValueRef *colors_out)
{
const unsigned min_filter = bld->static_state->min_img_filter;
const unsigned mag_filter = bld->static_state->mag_img_filter;
const int dims = texture_dims(bld->static_state->target);
- LLVMValueRef lod, lod_fpart;
- LLVMValueRef ilevel0, ilevel1, ilevel0_vec, ilevel1_vec;
+ LLVMValueRef lod = NULL, lod_fpart = NULL;
+ LLVMValueRef ilevel0, ilevel1 = NULL, ilevel0_vec, ilevel1_vec = NULL;
LLVMValueRef width0_vec = NULL, height0_vec = NULL, depth0_vec = NULL;
LLVMValueRef width1_vec = NULL, height1_vec = NULL, depth1_vec = NULL;
LLVMValueRef row_stride0_vec = NULL, row_stride1_vec = NULL;
LLVMValueRef img_stride0_vec = NULL, img_stride1_vec = NULL;
- LLVMValueRef data_ptr0, data_ptr1;
+ LLVMValueRef data_ptr0, data_ptr1 = NULL;
/*
printf("%s mip %d min %d mag %d\n", __FUNCTION__,
row_stride0_vec = lp_build_get_level_stride_vec(bld, row_stride_array,
ilevel0);
if (dims == 3 || bld->static_state->target == PIPE_TEXTURE_CUBE) {
- img_stride0_vec = lp_build_mul(&bld->int_coord_bld,
- row_stride0_vec, height0_vec);
+ img_stride0_vec = lp_build_get_level_stride_vec(bld,
+ img_stride_array,
+ ilevel0);
if (dims == 3) {
depth0_vec = lp_build_minify(bld, depth_vec, ilevel0_vec);
}
row_stride1_vec = lp_build_get_level_stride_vec(bld, row_stride_array,
ilevel1);
if (dims == 3 || bld->static_state->target == PIPE_TEXTURE_CUBE) {
- img_stride1_vec = lp_build_mul(&bld->int_coord_bld,
- row_stride1_vec, height1_vec);
+ img_stride1_vec = lp_build_get_level_stride_vec(bld,
+ img_stride_array,
+ ilevel1);
if (dims ==3) {
depth1_vec = lp_build_minify(bld, depth_vec, ilevel1_vec);
}
LLVMValueRef width, width_vec;
LLVMValueRef height, height_vec;
LLVMValueRef depth, depth_vec;
- LLVMValueRef stride_array;
+ LLVMValueRef row_stride_array, img_stride_array;
LLVMValueRef data_array;
LLVMValueRef s;
LLVMValueRef t;
LLVMValueRef r;
- (void) lp_build_lod_selector; /* temporary to silence warning */
- (void) lp_build_nearest_mip_level;
- (void) lp_build_linear_mip_levels;
- (void) lp_build_minify;
-
/* Setup our build context */
memset(&bld, 0, sizeof bld);
bld.builder = builder;
width = dynamic_state->width(dynamic_state, builder, unit);
height = dynamic_state->height(dynamic_state, builder, unit);
depth = dynamic_state->depth(dynamic_state, builder, unit);
- stride_array = dynamic_state->row_stride(dynamic_state, builder, unit);
+ row_stride_array = dynamic_state->row_stride(dynamic_state, builder, unit);
+ img_stride_array = dynamic_state->img_stride(dynamic_state, builder, unit);
data_array = dynamic_state->data_ptr(dynamic_state, builder, unit);
/* Note that data_array is an array[level] of pointers to texture images */
is_simple_wrap_mode(static_state->wrap_t)) {
/* special case */
lp_build_sample_2d_linear_aos(&bld, s, t, width_vec, height_vec,
- stride_array, data_array, texel);
+ row_stride_array, data_array, texel);
}
else {
lp_build_sample_general(&bld, unit, s, t, r,
width, height, depth,
width_vec, height_vec, depth_vec,
- stride_array, NULL, data_array,
+ row_stride_array, img_stride_array,
+ data_array,
texel);
}