diff --git a/gpu/command_buffer/service/gles2_cmd_decoder.cc b/gpu/command_buffer/service/gles2_cmd_decoder.cc index 1c5abf4d01a29..e4a9d5c259a91 100644 --- a/gpu/command_buffer/service/gles2_cmd_decoder.cc +++ b/gpu/command_buffer/service/gles2_cmd_decoder.cc @@ -13429,6 +13429,16 @@ void GLES2DecoderImpl::DoCopyTexImage2D( return; } + if (GetBoundFramebufferSamples(GL_READ_FRAMEBUFFER) > 0) { + // Per ES 3.0 ยง8.6, copying from a multisampled read framebuffer generates + // GL_INVALID_OPERATION. Reject here so that the clipped branch below + // cannot redefine the driver-side level via glTexImage2D and then have + // glCopyTexSubImage2D fail, leaving the decoder LevelInfo stale. + LOCAL_SET_GL_ERROR(GL_INVALID_OPERATION, func_name, + "multisampled framebuffer"); + return; + } + GLenum read_format = GetBoundReadFramebufferInternalFormat(); GLenum read_type = GetBoundReadFramebufferTextureType(); if (!ValidateCopyTexFormat(func_name, internal_format,