Commit a2ece533 by Geoff Lang Committed by Commit Bot

GL: Use a valid internal format for CopyTexImage in BlitGL::blitColorBufferWithShader

The frontend format is not always valid to use for glCopyTexImage. Translate it to a valid format for the current driver. TEST=deqp/functional/gles3/framebufferblit/default_framebuffer_00.html BUG=angleproject:4632 Change-Id: I838a1b27b528f074f440575adb88357a910f596a Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2196842Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent e9dcffb1
...@@ -439,15 +439,17 @@ angle::Result BlitGL::blitColorBufferWithShader(const gl::Context *context, ...@@ -439,15 +439,17 @@ angle::Result BlitGL::blitColorBufferWithShader(const gl::Context *context,
{ {
textureId = mScratchTextures[0]; textureId = mScratchTextures[0];
GLenum format = readAttachment->getFormat().info->internalFormat; const gl::InternalFormat &sourceInternalFormat = *readAttachment->getFormat().info;
nativegl::CopyTexImageImageFormat copyTexImageFormat = nativegl::GetCopyTexImageImageFormat(
mFunctions, mFeatures, sourceInternalFormat.internalFormat, sourceInternalFormat.type);
const FramebufferGL *sourceGL = GetImplAs<FramebufferGL>(source); const FramebufferGL *sourceGL = GetImplAs<FramebufferGL>(source);
mStateManager->bindFramebuffer(GL_READ_FRAMEBUFFER, sourceGL->getFramebufferID()); mStateManager->bindFramebuffer(GL_READ_FRAMEBUFFER, sourceGL->getFramebufferID());
mStateManager->bindTexture(gl::TextureType::_2D, textureId); mStateManager->bindTexture(gl::TextureType::_2D, textureId);
ANGLE_GL_TRY_ALWAYS_CHECK( ANGLE_GL_TRY_ALWAYS_CHECK(
context, context, mFunctions->copyTexImage2D(GL_TEXTURE_2D, 0, copyTexImageFormat.internalFormat,
mFunctions->copyTexImage2D(GL_TEXTURE_2D, 0, format, inBoundsSource.x, inBoundsSource.y, inBoundsSource.x, inBoundsSource.y,
inBoundsSource.width, inBoundsSource.height, 0)); inBoundsSource.width, inBoundsSource.height, 0));
// Translate sourceArea to be relative to the copied image. // Translate sourceArea to be relative to the copied image.
sourceArea.x -= inBoundsSource.x; sourceArea.x -= inBoundsSource.x;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment