I think this is a good idea, and at one point I was trying to do something similar.
There are some further changes we can make here—some code that doesn't look GL-specific probably is, and some code like alpha fixup should probably be shared. Also, some code can be modernized a bit. In the interest of expediency I'm going to take the liberty of fixing it up myself and resubmitting, rather than just reviewing, if that's not going to be too much of a problem.