mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
main: Report GL_SHADING_LANGUAGE_VERSION according to API
This commit is contained in:
parent
df4d6bcbe8
commit
d233c5b75e
2 changed files with 27 additions and 12 deletions
|
|
@ -124,8 +124,6 @@ const GLubyte * GLAPIENTRY
|
|||
_es_GetString(GLenum name)
|
||||
{
|
||||
switch (name) {
|
||||
case GL_SHADING_LANGUAGE_VERSION:
|
||||
return (const GLubyte *) "OpenGL ES GLSL ES 1.0.16";
|
||||
case GL_EXTENSIONS:
|
||||
return compute_es_extensions();
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
@ -92,9 +112,6 @@ _mesa_GetString( GLenum name )
|
|||
return (const GLubyte *) ctx->Program.ErrorString;
|
||||
}
|
||||
/* FALL-THROUGH */
|
||||
#endif
|
||||
#if FEATURE_ARB_shading_language_100
|
||||
error:
|
||||
#endif
|
||||
default:
|
||||
_mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue