Bug 1501134 - Don't consider snorm compatible with unorm for CopyTexImage. r=kvark
authorJeff Gilbert <jgilbert@mozilla.com>
Wed, 24 Oct 2018 15:31:43 +0000
changeset 491186 a1f419870e136b8838471fde0d1094f2942fa20a
parent 491185 2c675ab661cad80e1cc5a791de042a3322110adc
child 491187 fa86045075416389c2d59efad35226b6d8d56561
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewerskvark
bugs1501134
milestone65.0a1
Bug 1501134 - Don't consider snorm compatible with unorm for CopyTexImage. r=kvark Differential Revision: https://phabricator.services.mozilla.com/D9464
dom/canvas/WebGLTextureUpload.cpp
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -1862,31 +1862,17 @@ ValidateCopyDestUsage(WebGLContext* webg
         }
 
         return dstUsage;
     }
     // Alright, it's sized.
 
     const auto dstFormat = dstUsage->format;
 
-    const auto fnNarrowType = [&](webgl::ComponentType type) {
-        switch (type) {
-        case webgl::ComponentType::NormInt:
-        case webgl::ComponentType::NormUInt:
-            // These both count as "fixed-point".
-            return webgl::ComponentType::NormInt;
-
-        default:
-            return type;
-        }
-    };
-
-    const auto srcType = fnNarrowType(srcFormat->componentType);
-    const auto dstType = fnNarrowType(dstFormat->componentType);
-    if (dstType != srcType) {
+    if (dstFormat->componentType != srcFormat->componentType) {
         webgl->ErrorInvalidOperation("For sized internalFormats, source and dest"
                                      " component types must match. (source: %s, dest:"
                                      " %s)",
                                      srcFormat->name, dstFormat->name);
         return nullptr;
     }
 
     bool componentSizesMatch = true;