util: implement table-based + linear interpolation linear-to-srgb conversion

Graphics / Mesa 3D Graphics Library / Mesa - Roland Scheidegger [vmware.com] - 8 August 2013 11:55 UTC

Should be much faster, seems to work in softpipe. While here (also it's now disabled) fix up the pow factor - the former value is what is in GL core it is however not actually accurate to fp32 standard (as it is 1.0/2.4), and if someone would do all the accurate math there's no reason to waste 8 mantissa bits or so...

v2: use real table generating function instead of just printing the values (might take a bit longer as it does calculations on some 3+ million floats but much more descriptive obviously). Also fix up another inaccurate pow factor (this time in the python code) -wondering where the couple one bit errors came from :-(.

e3b5e2d util: implement table-based + linear interpolation linear-to-srgb conversion
src/gallium/auxiliary/util/u_format_srgb.h | 56 +++++++++++++++++++++-----
src/gallium/auxiliary/util/u_format_srgb.py | 57 ++++++++++++++++++++++++++-
2 files changed, 102 insertions(+), 11 deletions(-)

Upstream: cgit.freedesktop.org


  • Share