diff options
author | Brian Paul <[email protected]> | 2010-09-21 18:13:02 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2010-09-21 18:13:04 -0600 |
commit | e7087175f8a04f777403366fb34b58edd00f4d60 (patch) | |
tree | a6720bb374844ccd8c7eb790f33e0ebda6cdc324 /src/mesa/main/getstring.c | |
parent | 3642ca2f66efa8e078062f566b8f9975928d9f44 (diff) |
mesa: don't advertise bogus GL_ARB_shading_language_120 extension
Instead of using the invalid GL_ARB_shading_language_120 extension to
determine the GLSL version, use a new ctx->Const.GLSLVersion field.
Updated the intel and r600 drivers, but untested.
See fd.o bug 29910
NOTE: This is a candidate for the 7.9 branch (but let's wait and see if
there's any regressions).
Diffstat (limited to 'src/mesa/main/getstring.c')
-rw-r--r-- | src/mesa/main/getstring.c | 34 |
1 files changed, 25 insertions, 9 deletions
diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c index 5e4fcd599c3..3910047fb5d 100644 --- a/src/mesa/main/getstring.c +++ b/src/mesa/main/getstring.c @@ -30,26 +30,42 @@ #include "enums.h" #include "extensions.h" + +/** + * Return the string for a glGetString(GL_SHADING_LANGUAGE_VERSION) query. + */ static const GLubyte * shading_language_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 + if (!ctx->Extensions.ARB_shader_objects) { + _mesa_error(ctx, GL_INVALID_ENUM, "glGetString"); + return (const GLubyte *) 0; + } + + switch (ctx->Const.GLSLVersion) { + case 110: + return (const GLubyte *) "1.10"; + case 120: + return (const GLubyte *) "1.20"; + case 130: + return (const GLubyte *) "1.30"; + default: + _mesa_problem(ctx, + "Invalid GLSL version in shading_language_version()"); + return (const GLubyte *) 0; + } + break; case API_OPENGLES2: return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16"; case API_OPENGLES: + /* fall-through */ + default: - error: - _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" ); + _mesa_problem(ctx, "Unexpected API value in shading_language_version()"); return (const GLubyte *) 0; } } |