diff --git a/dom/canvas/WebGLTexture.h b/dom/canvas/WebGLTexture.h index da3056e73544..89d278d352ae 100644 --- a/dom/canvas/WebGLTexture.h +++ b/dom/canvas/WebGLTexture.h @@ -249,7 +249,7 @@ protected: GLint zOffset, uint32_t width, uint32_t height, uint32_t depth, WebGLTexture::ImageInfo** const out_imageInfo); - bool ValidateCopyTexImageForFeedback(const char* funcName, uint32_t level) const; + bool ValidateCopyTexImageForFeedback(const char* funcName, uint32_t level, GLint layer = 0) const; bool ValidateUnpack(const char* funcName, const webgl::TexUnpackBlob* blob, bool isFunc3D, const webgl::PackingInfo& srcPI) const; diff --git a/dom/canvas/WebGLTextureUpload.cpp b/dom/canvas/WebGLTextureUpload.cpp index f333c802b10a..0f76a9c6114b 100644 --- a/dom/canvas/WebGLTextureUpload.cpp +++ b/dom/canvas/WebGLTextureUpload.cpp @@ -1918,7 +1918,7 @@ ValidateCopyDestUsage(const char* funcName, WebGLContext* webgl, } bool -WebGLTexture::ValidateCopyTexImageForFeedback(const char* funcName, uint32_t level) const +WebGLTexture::ValidateCopyTexImageForFeedback(const char* funcName, uint32_t level, GLint layer) const { const auto& fb = mContext->mBoundReadFramebuffer; if (fb) { @@ -1926,6 +1926,7 @@ WebGLTexture::ValidateCopyTexImageForFeedback(const char* funcName, uint32_t lev MOZ_ASSERT(attach); if (attach->Texture() == this && + attach->Layer() == layer && uint32_t(attach->MipLevel()) == level) { // Note that the TexImageTargets *don't* have to match for this to be @@ -2116,7 +2117,7 @@ WebGLTexture::CopyTexSubImage(const char* funcName, TexImageTarget target, GLint return; auto srcFormat = srcUsage->format; - if (!ValidateCopyTexImageForFeedback(funcName, level)) + if (!ValidateCopyTexImageForFeedback(funcName, level, zOffset)) return; ////////////////////////////////////