• webgl: Convert non-raw TexImage sources to the requested format.

    The code was returning RGBA8 data from the non-raw sources (HTML
    canvas elements, JS ImageData, etc.), but we then validated and passed
    that rgba8 data as if it was whatever format/datatype was specified in
    TexImage2D/TexSubImage2D, so the pixels would come out as garbage.
    
    It would seem like we could just rewrite the passed in format/datatype
    for the TexImage call to be RGBA/UNSIGNED_BYTE, but that would leave
    incorrect levels of precision if the internalformat didn't match the
    format/datatype (and older desktop implementations often ignore the
    internalformat in choosing their internal format, anyway).
    anholt committed Jan 28, 2017