]> git.sesse.net Git - movit/commit
Implement GammaExpansionEffect using ALU ops instead of texture lookups.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 8 Jan 2014 21:14:42 +0000 (22:14 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 8 Jan 2014 21:14:42 +0000 (22:14 +0100)
commit9a00101dbb6f98d21c6b8ce4d33200af840ea908
tree3ddd73b5832183ad0342ff63c27fb3885df7958f
parentb61cd4cf5535ecfd76d5c923ea7421a8282bf98b
Implement GammaExpansionEffect using ALU ops instead of texture lookups.

In a standalone benchmark (on a Sandy Bridge laptop), this is pretty much
a no-op performance-wise, but when more ops are put into the mix, it's
a ~20% FPS win, and but in a more real situation with multiple inputs
etc., it's subjectively also a pretty clear win. The reason is probably
that we generally are way overloaded on texture operations.

Note that we had similar code like this before (before we started using
the texture for lookup), but it used pow(), which is markedly slower than our
fourth-degree polynomial approximation.

We should probably do the same for GammaCompressionEffect.
gamma_expansion_effect.cpp
gamma_expansion_effect.frag
gamma_expansion_effect.h