diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp index f2845dc9f9a..bb1389aaa50 100644 --- a/src/libANGLE/formatutils.cpp +++ b/src/libANGLE/formatutils.cpp @@ -1702,7 +1702,15 @@ const InternalFormat &GetInternalFormatInfo(GLenum internalFormat, GLenum type) GLuint InternalFormat::computePixelBytes(GLenum formatType) const { const auto &typeInfo = GetTypeInfo(formatType); - GLuint components = typeInfo.specialInterpretation ? 1u : componentCount; + GLuint components = componentCount; + if (sizedInternalFormat == GL_RGBX8_ANGLE) + { + components = 4; + } + else if (typeInfo.specialInterpretation) + { + components = 1; + } return components * typeInfo.bytes; } diff --git a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp index 8344099fd51..3aff1e2aa2d 100644 --- a/src/libANGLE/renderer/vulkan/FramebufferVk.cpp +++ b/src/libANGLE/renderer/vulkan/FramebufferVk.cpp @@ -813,15 +813,6 @@ angle::Result FramebufferVk::readPixels(const gl::Context *context, gl::Buffer *packBuffer, void *pixels) { - // Note that GL_RGBX8_ANGLE is the only format where the upload format is 3-channel RGB, while - // the download format is 4-channel RGBX. As such, the internal format corresponding to - // format+type expects 3-byte input/output. The format is fixed here for readPixels to output - // 4 bytes per pixel. - if (format == GL_RGBX8_ANGLE) - { - format = GL_RGBA8; - } - // Clip read area to framebuffer. const gl::Extents &fbSize = getState().getReadPixelsAttachment(format)->getSize(); const gl::Rectangle fbRect(0, 0, fbSize.width, fbSize.height);