llvmpipe: clamp texcoords in lp_build_sample_compare()
authorBrian Paul <brianp@vmware.com>
Tue, 8 Mar 2011 01:59:39 +0000 (18:59 -0700)
committerBrian Paul <brianp@vmware.com>
Tue, 8 Mar 2011 01:59:42 +0000 (18:59 -0700)
See previous commit for more info.

NOTE: This is a candidate for the 7.10 branch.

src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c

index 1fec3adf5b1848d74552e676f4cb4a3d3b66d6e1..9961ba08f3a1d83b53a1f314589020ff3251a958 100644 (file)
@@ -1108,6 +1108,11 @@ lp_build_sample_compare(struct lp_build_sample_context *bld,
                       coord, tex);
    }
 
+   /* Clamp p coords to [0,1] */
+   p = lp_build_clamp(&bld->coord_bld, p,
+                      bld->coord_bld.zero,
+                      bld->coord_bld.one);
+
    /* result = (p FUNC texel) ? 1 : 0 */
    res = lp_build_cmp(texel_bld, bld->static_state->compare_func,
                       p, texel[chan]);