This is a directly-from-the-spec, unoptimized implementation.
This is another example for a 2-texture shader. So far, only separable blend modes are implemented. The implementation is not optimized, with an if-else cascade in the shader.