Skip to content
Snippets Groups Projects
Commit f20890c7 authored by Roland Scheidegger's avatar Roland Scheidegger Committed by Emil Velikov
Browse files

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: default avatarBruce Cherniak <bruce.cherniak@intel.com>
Reviewed-by: default avatarJose Fonseca <jfonseca@vmware.com>
(cherry picked from commit bd07e20d)
parent 02420d0a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment