[Mesa-dev] [Bug 108856] floating-point-exceptions in gallium/auxiliary/tgsi/ functions

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Mon Nov 26 21:08:39 UTC 2018


https://bugs.freedesktop.org/show_bug.cgi?id=108856

--- Comment #3 from Roland Scheidegger <sroland at vmware.com> ---
FWIW in the example you gave the result wouldn't even be undefined (it would be
infinite).
Either that was an overflow exception, or what was happening there wasn't quite
what you used in the example. That said, yes things like 0.0/0.0 can equally
happen.
Generally, it is completely impossible for software rendering to avoid this,
since doing such operations with undefined results can come from the
application itself, as a trivial example a shader could do this directly. That
might be quite different to scientific computing, but with rendering you never
ever want to deal with FPEs (gpus do not support exceptions neither at all, at
least not when running graphics, they might for compute kernels). (The graphic
APIs actually may define what happens with the resulting NaNs, for instance
when you later try to convert them to integers, although in general with OpenGL
the results are all undefined, just must not crash.)
The default FPE is defined by the abi, not what you or I think it should be
(for my part, IMHO exceptions are a totally broken concept, but I understand
for what you're doing you might think otherwise...). FWIW if you use llvmpipe
instead of softpipe with osmesa, we actually do mess with the floating point
state (when processing draw commands) - but we only use this to always flush
the useless (and I bet you disagree on that part too...) denormals to zero (we
do this because GL doesn't care about denormals, and d3d10 requires them to be
flushed to zero, and they might be very slow). We would restore the floating
point state on returning from the draw command, however. But even there, we
don't mess with enabling/disabling exceptions, as it's simply not our
responsibility, we're just fine with the default of all exceptions masked.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181126/92ee51e5/attachment.html>


More information about the mesa-dev mailing list