OSDN Git Service

util: implement table-based + linear interpolation linear-to-srgb conversion
authorRoland Scheidegger <sroland@vmware.com>
Tue, 6 Aug 2013 14:55:47 +0000 (16:55 +0200)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 8 Aug 2013 16:55:57 +0000 (18:55 +0200)
commite3b5e2db1b189092522c43ba789c4f244ddb7c60
tree1a642b2ae7ffc3f26c9b86d5f51acdb1bf2ec2e5
parent2d9fea95e8627e7524bc4263bc6f9067fcf4db5e
util: implement table-based + linear interpolation linear-to-srgb conversion

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 :-(.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
src/gallium/auxiliary/util/u_format_srgb.h
src/gallium/auxiliary/util/u_format_srgb.py