diff options
author | Vadym Shovkoplias <[email protected]> | 2018-02-13 11:38:22 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2018-02-13 13:24:31 -0700 |
commit | a553c54abf92533daf442073dd3408c35f57d8ba (patch) | |
tree | ad6a333c33af4ae7f045b2a47c5624a9810f1fbd /src/mesa/main/get.c | |
parent | b08d718703bc907d9cb99887f90ea80d7e91dc45 (diff) |
mesa: add glsl version query (v4)
Add support for GL_NUM_SHADING_LANGUAGE_VERSIONS
and glGetStringi for GL_SHADING_LANGUAGE_VERSION
v2:
- Combine similar functionality into
_mesa_get_shading_language_version() function.
- Change GLSL version return mechanism.
v3:
- Add return of empty string for GLSL ver 1.10.
- Move _mesa_get_shading_language_version() function
to src/mesa/main/version.c.
v4:
- Add OpenGL version check.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104915
Signed-off-by: Andriy Khulap <[email protected]>
Signed-off-by: Vadym Shovkoplias <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/main/get.c')
-rw-r--r-- | src/mesa/main/get.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 57a211856c9..13d5e857ab2 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -143,6 +143,7 @@ enum value_extra { EXTRA_VERSION_31, EXTRA_VERSION_32, EXTRA_VERSION_40, + EXTRA_VERSION_43, EXTRA_API_GL, EXTRA_API_GL_CORE, EXTRA_API_ES2, @@ -522,6 +523,7 @@ extra_NV_primitive_restart[] = { static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END }; static const int extra_version_31[] = { EXTRA_VERSION_31, EXTRA_END }; static const int extra_version_32[] = { EXTRA_VERSION_32, EXTRA_END }; +static const int extra_version_43[] = { EXTRA_VERSION_43, EXTRA_END }; static const int extra_gl30_es3[] = { EXTRA_VERSION_30, @@ -1084,6 +1086,10 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int = 0; } break; + /* GL 4.3 */ + case GL_NUM_SHADING_LANGUAGE_VERSIONS: + v->value_int = _mesa_get_shading_language_version(ctx, -1, NULL); + break; /* GL_ARB_draw_indirect */ case GL_DRAW_INDIRECT_BUFFER_BINDING: v->value_int = ctx->DrawIndirectBuffer->Name; @@ -1229,6 +1235,11 @@ check_extra(struct gl_context *ctx, const char *func, const struct value_desc *d if (version >= 40) api_found = GL_TRUE; break; + case EXTRA_VERSION_43: + api_check = TRUE; + if (_mesa_is_desktop_gl(ctx) && version >= 43) + api_found = GL_TRUE; + break; case EXTRA_NEW_FRAG_CLAMP: if (ctx->NewState & (_NEW_BUFFERS | _NEW_FRAG_CLAMP)) _mesa_update_state(ctx); |