Commit 18bcfcc5 by Alexis Hetu Committed by Alexis Hétu

Return correct OpenGL ES version

Since we can create OpenGL ES 3.0 contexts locally now, we should also be able to retrieve the correct version. Change-Id: I9154869ddea5951946c8e23e59a00beb042fca8c Reviewed-on: https://swiftshader-review.googlesource.com/3633Tested-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent 3f5af3a4
......@@ -3503,9 +3503,19 @@ const GLubyte* GetString(GLenum name)
case GL_RENDERER:
return (GLubyte*)"SwiftShader";
case GL_VERSION:
return (GLubyte*)"OpenGL ES 2.0 SwiftShader " VERSION_STRING;
{
es2::Context *context = es2::getContext();
return (context && (context->getClientVersion() >= 3)) ?
(GLubyte*)"OpenGL ES 3.0 SwiftShader " VERSION_STRING :
(GLubyte*)"OpenGL ES 2.0 SwiftShader " VERSION_STRING;
}
case GL_SHADING_LANGUAGE_VERSION:
return (GLubyte*)"OpenGL ES GLSL ES 1.00 SwiftShader " VERSION_STRING;
{
es2::Context *context = es2::getContext();
return (context && (context->getClientVersion() >= 3)) ?
(GLubyte*)"OpenGL ES GLSL ES 3.00 SwiftShader " VERSION_STRING :
(GLubyte*)"OpenGL ES GLSL ES 1.00 SwiftShader " VERSION_STRING;
}
case GL_EXTENSIONS:
{
es2::Context *context = es2::getContext();
......
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