diff options
author | Kristian Høgsberg <[email protected]> | 2010-05-02 10:17:07 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-05-02 10:17:07 -0400 |
commit | 0870e4a2022cff79805613ae7cd4b9237a2f564c (patch) | |
tree | 694d0c07918661996255cff226602045e0d9c707 /src/mesa/main/getstring.c | |
parent | 9d3360567346036f1c2b0b5e9de9bd123d883762 (diff) | |
parent | 9fd5fa05122aa0cac0051fa92d1634bde43209db (diff) |
Merge branch 'gles2-2'
Conflicts:
src/mesa/drivers/dri/common/dri_util.h
Diffstat (limited to 'src/mesa/main/getstring.c')
-rw-r--r-- | src/mesa/main/getstring.c | 37 |
1 files changed, 27 insertions, 10 deletions
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 51dd5f77957..e3a60fa6eb5 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -30,6 +30,30 @@ #include "enums.h" #include "extensions.h" +static const GLubyte * +shading_laguage_version(GLcontext *ctx) +{ + switch (ctx->API) { +#if FEATURE_ARB_shading_language_100 + case API_OPENGL: + if (ctx->Extensions.ARB_shading_language_120) + return (const GLubyte *) "1.20"; + else if (ctx->Extensions.ARB_shading_language_100) + return (const GLubyte *) "1.10"; + goto error; +#endif + + case API_OPENGLES2: + return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16"; + + case API_OPENGLES: + default: + error: + _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); + return (const GLubyte *) 0; + } +} + /** * Query string-valued state. The return value should _not_ be freed by @@ -74,13 +98,9 @@ _mesa_GetString( GLenum name ) if (!ctx->Extensions.String) ctx->Extensions.String = _mesa_make_extension_string(ctx); return (const GLubyte *) ctx->Extensions.String; -#if FEATURE_ARB_shading_language_100 - case GL_SHADING_LANGUAGE_VERSION_ARB: - if (ctx->Extensions.ARB_shading_language_120) - return (const GLubyte *) "1.20"; - else if (ctx->Extensions.ARB_shading_language_100) - return (const GLubyte *) "1.10"; - goto error; +#if FEATURE_ARB_shading_language_100 || FEATURE_ES2 + case GL_SHADING_LANGUAGE_VERSION: + return shading_laguage_version(ctx); #endif #if FEATURE_NV_fragment_program || FEATURE_ARB_fragment_program || \ FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program @@ -93,9 +113,6 @@ _mesa_GetString( GLenum name ) } /* FALL-THROUGH */ #endif -#if FEATURE_ARB_shading_language_100 - error: -#endif default: _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); return (const GLubyte *) 0; |