gallivm: make sampling more robust against bogus coordinates
Some cases (especially these using fract for coord wrapping) did not handle NaNs (or Infs) correctly - the following code assumed the fract result could not be outside [0,1], but if the input is a NaN (or +-Inf) the fract result was NaN - which then could produce out-of-bound offsets. (Note that the explicit NaN behavior changes for min/max on x86 sse don't result in actual changes in the generated jit code, but may on other architectures. Found by looking through all the wrap functions.) This fixes https://bugs.freedesktop.org/show_bug.cgi?id=94955 No piglit changes. (v2: fix min/max typo in coord_mirror, add comment) Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org> Tested-by:Bruce Cherniak <bruce.cherniak@intel.com> Reviewed-by:
Jose Fonseca <jfonseca@vmware.com> (cherry picked from commit bd07e20d)
Showing
- src/gallium/auxiliary/gallivm/lp_bld_arit.c 5 additions, 4 deletionssrc/gallium/auxiliary/gallivm/lp_bld_arit.c
- src/gallium/auxiliary/gallivm/lp_bld_sample_aos.c 12 additions, 1 deletionsrc/gallium/auxiliary/gallivm/lp_bld_sample_aos.c
- src/gallium/auxiliary/gallivm/lp_bld_sample_soa.c 26 additions, 8 deletionssrc/gallium/auxiliary/gallivm/lp_bld_sample_soa.c
Loading
Please register or sign in to comment