gallivm: Use lp_build_ifloor_fract for lod computation.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 8 Oct 2010 12:36:18 +0000 (13:36 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 8 Oct 2010 13:06:38 +0000 (14:06 +0100)
Forgot this one before.

src/gallium/auxiliary/gallivm/lp_bld_sample.c

index c4ed79e0e7ef39e8da36f352a115541f1a37b4ec..d6b50fbe5ff213a6767f322733c4428cfeef4edc 100644 (file)
@@ -359,11 +359,9 @@ lp_build_lod_selector(struct lp_build_sample_context *bld,
    }
 
    if (mip_filter == PIPE_TEX_MIPFILTER_LINEAR) {
-      LLVMValueRef ipart = lp_build_ifloor(float_bld, lod);
-      lp_build_name(ipart, "lod_ipart");
-      *out_lod_ipart = ipart;
-      ipart = LLVMBuildSIToFP(bld->builder, ipart, float_bld->vec_type, "");
-      *out_lod_fpart = LLVMBuildFSub(bld->builder, lod, ipart, "lod_fpart");
+      lp_build_ifloor_fract(float_bld, lod, out_lod_ipart, out_lod_fpart);
+      lp_build_name(*out_lod_ipart, "lod_ipart");
+      lp_build_name(*out_lod_fpart, "lod_fpart");
    }
    else {
       *out_lod_ipart = lp_build_iround(float_bld, lod);