From: Brian Paul Date: Thu, 11 Mar 2010 18:17:15 +0000 (-0700) Subject: gallivm: fix some bugs on the 1D texture paths X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d6451190982fdae60dd0055550a54398729c64f4;p=mesa.git gallivm: fix some bugs on the 1D texture paths --- diff --git a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c index dadae61115b..9358ad38601 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c @@ -1007,7 +1007,7 @@ lp_build_sample_image_nearest(struct lp_build_sample_context *bld, } } else { - y = NULL; + y = z = NULL; } /* @@ -1075,6 +1075,7 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld, } else { y0 = y1 = t_fpart = NULL; + z0 = z1 = r_fpart = NULL; } /* @@ -1092,9 +1093,11 @@ lp_build_sample_image_linear(struct lp_build_sample_context *bld, if (dims == 1) { /* Interpolate two samples from 1D image to produce one color */ - colors_out[chan] = lp_build_lerp(&bld->texel_bld, s_fpart, - neighbors[0][0][chan], - neighbors[0][1][chan]); + for (chan = 0; chan < 4; chan++) { + colors_out[chan] = lp_build_lerp(&bld->texel_bld, s_fpart, + neighbors[0][0][chan], + neighbors[0][1][chan]); + } } else { /* 2D/3D texture */ @@ -1198,10 +1201,10 @@ lp_build_sample_general(struct lp_build_sample_context *bld, const int dims = texture_dims(bld->static_state->target); LLVMValueRef lod, lod_fpart; LLVMValueRef ilevel0, ilevel1, ilevel0_vec, ilevel1_vec; - LLVMValueRef width0_vec, height0_vec, depth0_vec; - LLVMValueRef width1_vec, height1_vec, depth1_vec; - LLVMValueRef row_stride0_vec, row_stride1_vec; - LLVMValueRef img_stride0_vec, img_stride1_vec; + 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; int chan;