Bug 1501134 - Don't consider snorm compatible with unorm for CopyTexImage. r=kvark
Differential Revision:
https://phabricator.services.mozilla.com/D9464
--- 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;