|
99bd5f40
|
2016-11-07T12:44:29
|
|
Fix GLSL float parsing corner cases
This fixes parsing floats that are out-of-range, and floats that have
more digits than the standard library float parsing functions can
handle. In these cases, we now fall back to a custom implementation of
float parsing. The custom parsing path can correctly process floats
with up to hundreds of millions of digits in their mantissa part.
Rounding behavior of the custom float parser may not be entirely
consistent with the standard parser, but the error should be at most
a few ULP. This can be considered acceptable since floating point
operations are not expected to be exact in GLSL in general. Settling
for lower accuracy also enables the parser to run in constant memory,
instead of having to store all the significant digits of the decimal
mantissa being parsed.
BUG=angleproject:1613
TEST=angle_unittests
Change-Id: I04a5d9ae5aaca48ef14b79cca5b997078614eb1c
Reviewed-on: https://chromium-review.googlesource.com/412082
Commit-Queue: Olli Etuaho <oetuaho@nvidia.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
|