Commit feafc888 by Geoff Lang Committed by Commit Bot

GL: Treat RGBA+HALF_FLOAT IOSurfaces as sized formats.

ANGLE_iosurface_client_buffer imports IOSufraces with GL_RGBA + GL_HALF_FLOAT which isn't a valid GLES internalFormat + type combination so sampling from this format fails. We cannot easily update the spec on this format because it is also implemented by SwiftShader so manually adjust the format to sized RGBA16F. Bug: chromium:1148599 Change-Id: I3f24bbdcd08003eaae26e8391e5edca7a51f6888 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2558950Reviewed-by: 's avatarJonah Ryan-Davis <jonahr@google.com> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 23d4b64a
...@@ -199,7 +199,14 @@ Error Surface::initialize(const Display *display) ...@@ -199,7 +199,14 @@ Error Surface::initialize(const Display *display)
{ {
GLenum internalFormat = GLenum internalFormat =
static_cast<GLenum>(mState.attributes.get(EGL_TEXTURE_INTERNAL_FORMAT_ANGLE)); static_cast<GLenum>(mState.attributes.get(EGL_TEXTURE_INTERNAL_FORMAT_ANGLE));
GLenum type = static_cast<GLenum>(mState.attributes.get(EGL_TEXTURE_TYPE_ANGLE)); GLenum type = static_cast<GLenum>(mState.attributes.get(EGL_TEXTURE_TYPE_ANGLE));
// GL_RGBA + GL_HALF_FLOAT is not a valid format/type combination in GLES like it is in
// desktop GL. Adjust the frontend format to be sized RGBA16F.
if (internalFormat == GL_RGBA && type == GL_HALF_FLOAT)
{
internalFormat = GL_RGBA16F;
}
mColorFormat = gl::Format(internalFormat, type); mColorFormat = gl::Format(internalFormat, type);
} }
if (mBuftype == EGL_D3D_TEXTURE_ANGLE) if (mBuftype == EGL_D3D_TEXTURE_ANGLE)
......
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