Bug 1136508 - Remove redundent READ_BUFFER != NONE validation. - r=mtseng
MozReview-Commit-ID: D1yZ4m6p8Wk
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -1751,25 +1751,16 @@ WebGLTexture::CopyTexImage2D(TexImageTar
if (!mContext->ValidateCurFBForRead(funcName, &srcUsage, &srcWidth, &srcHeight,
&srcMode))
return;
auto srcFormat = srcUsage->format;
if (!ValidateCopyTexImageForFeedback(funcName, level))
return;
- // GLES 3.0.4 p145:
- // "Calling CopyTexSubImage3D, CopyTexImage2D, or CopyTexSubImage2D will result in an
- // INVALID_OPERATION error if any of the following conditions is true: READ_BUFFER
- // is NONE"
- if (srcMode == LOCAL_GL_NONE) {
- mContext->ErrorInvalidOperation("%s: READ_BUFFER is NONE. ", funcName);
- return;
- }
-
////////////////////////////////////
// Check that source and dest info are compatible
const auto& fua = mContext->mFormatUsage;
auto dstUsage = fua->GetSizedTexUsage(internalFormat);
if (!dstUsage) {
// It must be an unsized format then...
@@ -1915,25 +1906,16 @@ WebGLTexture::CopyTexSubImage(const char
if (!mContext->ValidateCurFBForRead(funcName, &srcUsage, &srcWidth, &srcHeight,
&srcMode))
return;
auto srcFormat = srcUsage->format;
if (!ValidateCopyTexImageForFeedback(funcName, level))
return;
- // GLES 3.0.4 p145:
- // "Calling CopyTexSubImage3D, CopyTexImage2D, or CopyTexSubImage2D will result in an
- // INVALID_OPERATION error if any of the following conditions is true: READ_BUFFER
- // is NONE"
- if (srcMode == LOCAL_GL_NONE) {
- mContext->ErrorInvalidOperation("%s: READ_BUFFER is NONE. ", funcName);
- return;
- }
-
////////////////////////////////////
// Check that source and dest info are compatible
if (!ValidateCopyTexImageFormats(mContext, funcName, srcFormat, dstFormat))
return;
////////////////////////////////////
// Do the thing!