Return HALF_FLOAT as an implementation read type in ES3.
BUG=765953
Change-Id: I4dc79921766975cd75c489887b7e57ec4666fbbb
Reviewed-on: https://chromium-review.googlesource.com/685897
Reviewed-by: Zhenyao Mo <zmo@chromium.org>
Commit-Queue: Geoff Lang <geofflang@chromium.org>
diff --git a/src/libANGLE/formatutils.cpp b/src/libANGLE/formatutils.cpp
index faf985c..cf4a2fb 100644
--- a/src/libANGLE/formatutils.cpp
+++ b/src/libANGLE/formatutils.cpp
@@ -312,15 +312,24 @@
return format;
}
-GLenum InternalFormat::getReadPixelsType() const
+GLenum InternalFormat::getReadPixelsType(const Version &version) const
{
switch (type)
{
case GL_HALF_FLOAT:
- // The internal format may have a type of GL_HALF_FLOAT but when exposing this type as
- // the IMPLEMENTATION_READ_TYPE, only HALF_FLOAT_OES is allowed by
- // OES_texture_half_float
- return GL_HALF_FLOAT_OES;
+ case GL_HALF_FLOAT_OES:
+ if (version < Version(3, 0))
+ {
+ // The internal format may have a type of GL_HALF_FLOAT but when exposing this type
+ // as the IMPLEMENTATION_READ_TYPE, only HALF_FLOAT_OES is allowed by
+ // OES_texture_half_float. HALF_FLOAT becomes core in ES3 and is acceptable to use
+ // as an IMPLEMENTATION_READ_TYPE.
+ return GL_HALF_FLOAT_OES;
+ }
+ else
+ {
+ return GL_HALF_FLOAT;
+ }
default:
return type;