OSDN Git Service

Accept GL_HALF_FLOAT and GL_HALF_FLOAT_OES interchangeably.
authorNicolas Capens <capn@google.com>
Thu, 26 Apr 2018 20:38:05 +0000 (16:38 -0400)
committerNicolas Capens <nicolascapens@google.com>
Thu, 26 Apr 2018 21:29:24 +0000 (21:29 +0000)
commitce8eb945ca823a50eca9bb0d7b32c31e4c20a477
treea6d2810971c9f44551146e5b51f0a33b7dc07cbb
parent840f47ea853b48c0c3f35c279489862c2ff0c979
Accept GL_HALF_FLOAT and GL_HALF_FLOAT_OES interchangeably.

These enums don't have the same value, but this is only because of
desktop OpenGL and OpenGL ES having evolved separately. OpenGL ES 3.0
reconverged to use the enum name and value of desktop OpenGL.

Apps choosing between OpenGL ES 2.0 and 3.0 strictly speaking have to
use different enums, but many drivers already accept either enum so the
apps don't bother to differentiate them. Running them on a driver which
adheres more strictly to the (extension) specs would cause parameter
validation errors.

Additionally, native platform pixel formats such as
HAL_PIXEL_FORMAT_RGBA_FP16 on Android couldn't be mapped to GL_RGBA16F
with GL_HALF_FLOAT component types on an OpenGL ES 2.0 context if the
latter are considered OpenGL ES 3.0 only.

Change-Id: Ib66cba7444fe438c0e4a8a6454460773cf02236d
Reviewed-on: https://swiftshader-review.googlesource.com/18728
Tested-by: Nicolas Capens <nicolascapens@google.com>
Reviewed-by: Alexis Hétu <sugoi@google.com>
src/OpenGL/libEGL/Display.cpp
src/OpenGL/libEGL/Surface.cpp
src/OpenGL/libGLESv2/Context.h
src/OpenGL/libGLESv2/libGLESv2.cpp
src/OpenGL/libGLESv2/utilities.cpp