Allow texture decoding functions to return whichever type they need.

Currently only used to return RGBA32, but in the future a decoder may choose different types.
This puts back functionality that was removed in the previous commit.