Bug 1656813 - Add SWGL support for UNSIGNED_INT_8_8_8_8_REV. r=lsalzman
☠☠ backed out by 019363ddffdf ☠ ☠
authorMatt Woodrow <mwoodrow@mozilla.com>
Wed, 05 Aug 2020 00:52:56 +0000
changeset 607949 37e5e5e6593a5326d5e19883095ad9438db69656
parent 607948 12c0e9554a5f8a80e85fa88b23b6dad5a8afe750
child 607950 060254b3ad73855146cd3d6147e50fbc514e1cdc
push id13553
push userffxbld-merge
push dateMon, 24 Aug 2020 12:51:36 +0000
treeherdermozilla-beta@a54f8b5d0977 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslsalzman
bugs1656813
milestone81.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1656813 - Add SWGL support for UNSIGNED_INT_8_8_8_8_REV. r=lsalzman Differential Revision: https://phabricator.services.mozilla.com/D85712
gfx/wr/swgl/src/gl.cc
gfx/wr/swgl/src/swgl_fns.rs
--- a/gfx/wr/swgl/src/gl.cc
+++ b/gfx/wr/swgl/src/gl.cc
@@ -1372,17 +1372,17 @@ void TexStorage2D(GLenum target, GLint l
   Texture& t = ctx->textures[ctx->get_binding(target)];
   set_tex_storage(t, internal_format, width, height);
 }
 
 GLenum internal_format_for_data(GLenum format, GLenum ty) {
   if (format == GL_RED && ty == GL_UNSIGNED_BYTE) {
     return GL_R8;
   } else if ((format == GL_RGBA || format == GL_BGRA) &&
-             ty == GL_UNSIGNED_BYTE) {
+             (ty == GL_UNSIGNED_BYTE || ty == GL_UNSIGNED_INT_8_8_8_8_REV)) {
     return GL_RGBA8;
   } else if (format == GL_RGBA && ty == GL_FLOAT) {
     return GL_RGBA32F;
   } else if (format == GL_RGBA_INTEGER && ty == GL_INT) {
     return GL_RGBA32I;
   } else if (format == GL_RG && ty == GL_UNSIGNED_BYTE) {
     return GL_RG8;
   } else {
--- a/gfx/wr/swgl/src/swgl_fns.rs
+++ b/gfx/wr/swgl/src/swgl_fns.rs
@@ -413,16 +413,17 @@ fn calculate_length(width: GLsizei, heig
         DEPTH_COMPONENT => 1,
         _ => panic!("unsupported format for read_pixels: {:?}", format),
     };
     let depth = match pixel_type {
         UNSIGNED_BYTE => 1,
         UNSIGNED_SHORT => 2,
         SHORT => 2,
         FLOAT => 4,
+        UNSIGNED_INT_8_8_8_8_REV => 1,
         _ => panic!("unsupported pixel_type for read_pixels: {:?}", pixel_type),
     };
 
     return (width * height * colors * depth) as usize;
 }
 
 impl Gl for Context {
     fn get_type(&self) -> GlType {