gallivm: fix sampling with texture offsets in SoA path
authorRoland Scheidegger <sroland@vmware.com>
Thu, 22 Oct 2015 21:49:41 +0000 (23:49 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Sat, 24 Oct 2015 01:00:33 +0000 (03:00 +0200)
commit71ff5af5dd308e4a53b66b7530cc01ec4bf5715e
treeeacd88dc928db5c1a262be53976ee903131cb1ea
parentfb586e1edb207328534f554a9afaf2c07434e08e
gallivm: fix sampling with texture offsets in SoA path

When using nearest filtering and clamp / clamp to edge wrapping results could
be wrong for negative offsets. Fix this by adding the offset before doing
the conversion to int coords (could also use floor instead of trunc int
conversion but probably more complex on "typical" cpu).

This fixes the piglit texwrap offset failures with this filter/wrap combo
(which only leaves the linear/mirror repeat combination broken).

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c