WebGL / OpenGL treat the data as row-major when uploading it to the
textures (consecutive entries are assumed to belong to the same row, see
https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml -
"first element corresponds to the lower left corner of the texture
image", "subsequent elements progress left-to-right throughout the
remaining texels in the lowest row of the texture image, and then in
successively higher rows of the texture image").
Fix the spec to account for that - we were already doing the right thing
in Chrome's implementation but this bit me when writing WPTs.
WebGL / OpenGL treat the data as row-major when uploading it to the textures (consecutive entries are assumed to belong to the same row, see https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glTexImage2D.xhtml - "first element corresponds to the lower left corner of the texture image", "subsequent elements progress left-to-right throughout the remaining texels in the lowest row of the texture image, and then in successively higher rows of the texture image").
Fix the spec to account for that - we were already doing the right thing in Chrome's implementation but this bit me when writing WPTs.
Preview | Diff