Merge.
GL: Added check for texture formats.