diff options
author | Jordan Justen <jordan.l.justen@intel.com> | 2012-08-16 16:04:58 -0700 |
---|---|---|
committer | Jordan Justen <jordan.l.justen@intel.com> | 2012-08-30 11:40:30 -0700 |
commit | e2c51f73b596606241cbef044c14b13be137657f (patch) | |
tree | 18e1219ec479e5d81a3b0327cf2a3248d163c2c6 | |
parent | 598583d74cdadb52ac87cd65da6aa636e1db3709 (diff) |
work in processcontext-tests
-rw-r--r-- | src/mesa/main/api_exec.c | 10 | ||||
-rw-r--r-- | src/mesa/main/api_loopback.c | 29 | ||||
-rw-r--r-- | src/mesa/main/api_loopback.h | 6 | ||||
-rw-r--r-- | src/mesa/main/context.c | 2 | ||||
-rw-r--r-- | src/mesa/main/context.h | 1 | ||||
-rw-r--r-- | src/mesa/main/dlist.c | 6 | ||||
-rw-r--r-- | src/mesa/main/dlist.h | 2 | ||||
-rw-r--r-- | src/mesa/main/shaderapi.c | 24 | ||||
-rw-r--r-- | src/mesa/main/shaderapi.h | 2 | ||||
-rw-r--r-- | src/mesa/main/tests/Makefile.am | 8 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_gl.cpp | 747 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_stubs.cpp | 127 | ||||
-rw-r--r-- | src/mesa/main/tests/enum_strings.cpp | 11 | ||||
-rw-r--r-- | src/mesa/main/tests/make_dispatch_gl_table.py | 115 | ||||
-rw-r--r-- | src/mesa/main/version.h | 36 |
15 files changed, 1081 insertions, 45 deletions
diff --git a/src/mesa/main/api_exec.c b/src/mesa/main/api_exec.c index c448189456..99ad55a509 100644 --- a/src/mesa/main/api_exec.c +++ b/src/mesa/main/api_exec.c @@ -129,7 +129,7 @@ _mesa_create_exec_table(struct gl_context *ctx) return NULL; #if _HAVE_FULL_GL - _mesa_loopback_init_api_table( exec ); + _mesa_loopback_init_api_table(ctx, exec); #endif /* load the dispatch slots we understand */ @@ -377,7 +377,7 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate); #if FEATURE_ARB_shader_objects - _mesa_init_shader_dispatch(exec); + _mesa_init_shader_dispatch(ctx, exec); _mesa_init_shader_uniform_dispatch(exec); #endif @@ -664,8 +664,10 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_VertexAttribPointerARB(exec, _mesa_VertexAttribPointerARB); SET_EnableVertexAttribArrayARB(exec, _mesa_EnableVertexAttribArrayARB); SET_DisableVertexAttribArrayARB(exec, _mesa_DisableVertexAttribArrayARB); - if (ctx->API != API_OPENGLES2) { + if (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) { SET_ProgramStringARB(exec, _mesa_ProgramStringARB); + } + if (ctx->API != API_OPENGLES2) { /* glBindProgramARB aliases glBindProgramNV */ /* glDeleteProgramsARB aliases glDeleteProgramsNV */ /* glGenProgramsARB aliases glGenProgramsNV */ @@ -690,8 +692,8 @@ _mesa_create_exec_table(struct gl_context *ctx) SET_GetProgramLocalParameterdvARB(exec, _mesa_GetProgramLocalParameterdvARB); SET_GetProgramLocalParameterfvARB(exec, _mesa_GetProgramLocalParameterfvARB); SET_GetProgramStringARB(exec, _mesa_GetProgramStringARB); + SET_GetProgramivARB(exec, _mesa_GetProgramivARB); } - SET_GetProgramivARB(exec, _mesa_GetProgramivARB); #endif /* ARB 28. GL_ARB_vertex_buffer_object */ diff --git a/src/mesa/main/api_loopback.c b/src/mesa/main/api_loopback.c index c438307d84..7caab5600f 100644 --- a/src/mesa/main/api_loopback.c +++ b/src/mesa/main/api_loopback.c @@ -1495,14 +1495,8 @@ loopback_VertexAttribI4usv(GLuint index, const GLushort *v) } - - -/* - * This code never registers handlers for any of the entry points - * listed in vtxfmt.h. - */ -void -_mesa_loopback_init_api_table( struct _glapi_table *dest ) +static void +loopback_init_api_table_legacy(struct _glapi_table *dest) { SET_Color3b(dest, loopback_Color3b_f); SET_Color3d(dest, loopback_Color3d_f); @@ -1650,7 +1644,11 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) SET_Rectsv(dest, loopback_Rectsv); SET_FogCoorddEXT(dest, loopback_FogCoorddEXT); SET_FogCoorddvEXT(dest, loopback_FogCoorddvEXT); +} +static void +loopback_init_api_table_core(struct _glapi_table *dest) +{ SET_VertexAttrib1sNV(dest, loopback_VertexAttrib1sNV); SET_VertexAttrib1dNV(dest, loopback_VertexAttrib1dNV); SET_VertexAttrib2sNV(dest, loopback_VertexAttrib2sNV); @@ -1722,4 +1720,19 @@ _mesa_loopback_init_api_table( struct _glapi_table *dest ) } +/* + * This code never registers handlers for any of the entry points + * listed in vtxfmt.h. + */ +void +_mesa_loopback_init_api_table(struct gl_context *ctx, struct _glapi_table *dest) +{ + if (ctx->API != API_OPENGL_CORE) { + loopback_init_api_table_legacy(dest); + } + + loopback_init_api_table_core(dest); +} + + #endif /* FEATURE_beginend */ diff --git a/src/mesa/main/api_loopback.h b/src/mesa/main/api_loopback.h index f53b902809..817f8b0bbd 100644 --- a/src/mesa/main/api_loopback.h +++ b/src/mesa/main/api_loopback.h @@ -34,12 +34,14 @@ struct _glapi_table; #if FEATURE_beginend -extern void _mesa_loopback_init_api_table( struct _glapi_table *dest ); +extern void _mesa_loopback_init_api_table(struct gl_context *ctx, + struct _glapi_table *dest); #else /* FEATURE_beginend */ static inline void -_mesa_loopback_init_api_table( struct _glapi_table *dest ) +_mesa_loopback_init_api_table(struct gl_context *ctx, + struct _glapi_table *dest); { } diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index 333be72991..7e74a38404 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -1009,7 +1009,7 @@ _mesa_initialize_context(struct gl_context *ctx, switch (ctx->API) { case API_OPENGL: #if FEATURE_dlist - ctx->Save = _mesa_create_save_table(); + ctx->Save = _mesa_create_save_table(ctx); if (!ctx->Save) { _mesa_reference_shared_state(ctx, &ctx->Shared, NULL); free(ctx->Exec); diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h index f0b4471b14..3356cc5ec2 100644 --- a/src/mesa/main/context.h +++ b/src/mesa/main/context.h @@ -321,7 +321,6 @@ _mesa_is_gles3(const struct gl_context *ctx) return ctx->API == API_OPENGLES2 && ctx->Version >= 30; } - #ifdef __cplusplus } #endif diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c index 5a813e98ac..ae096a5609 100644 --- a/src/mesa/main/dlist.c +++ b/src/mesa/main/dlist.c @@ -9933,7 +9933,7 @@ exec_MultiModeDrawElementsIBM(const GLenum * mode, * struct. */ struct _glapi_table * -_mesa_create_save_table(void) +_mesa_create_save_table(struct gl_context *ctx) { struct _glapi_table *table; @@ -9941,7 +9941,7 @@ _mesa_create_save_table(void) if (table == NULL) return NULL; - _mesa_loopback_init_api_table(table); + _mesa_loopback_init_api_table(ctx, table); /* GL 1.0 */ SET_Accum(table, save_Accum); @@ -10480,7 +10480,7 @@ _mesa_create_save_table(void) #endif /* GL_ARB_shader_objects */ - _mesa_init_shader_dispatch(table); /* Plug in glCreate/Delete/Get, etc */ + _mesa_init_shader_dispatch(ctx, table); /* Plug in glCreate/Delete/Get, etc */ SET_UseProgramObjectARB(table, save_UseProgramObjectARB); SET_Uniform1fARB(table, save_Uniform1fARB); SET_Uniform2fARB(table, save_Uniform2fARB); diff --git a/src/mesa/main/dlist.h b/src/mesa/main/dlist.h index 89008431a8..077140f5dc 100644 --- a/src/mesa/main/dlist.h +++ b/src/mesa/main/dlist.h @@ -63,7 +63,7 @@ extern void _mesa_delete_list(struct gl_context *ctx, struct gl_display_list *dl extern void _mesa_save_vtxfmt_init( GLvertexformat *vfmt ); -extern struct _glapi_table *_mesa_create_save_table(void); +extern struct _glapi_table *_mesa_create_save_table(struct gl_context *ctx); extern void _mesa_install_dlist_vtxfmt(struct _glapi_table *disp, const GLvertexformat *vfmt); diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c index d6acade3da..c21054cf9d 100644 --- a/src/mesa/main/shaderapi.c +++ b/src/mesa/main/shaderapi.c @@ -1718,25 +1718,27 @@ _mesa_CreateShaderProgramEXT(GLenum type, const GLchar *string) * Plug in shader-related functions into API dispatch table. */ void -_mesa_init_shader_dispatch(struct _glapi_table *exec) +_mesa_init_shader_dispatch(struct gl_context *ctx, struct _glapi_table *exec) { #if FEATURE_GL /* GL_ARB_vertex/fragment_shader */ - SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); - SET_GetHandleARB(exec, _mesa_GetHandleARB); - SET_DetachObjectARB(exec, _mesa_DetachObjectARB); - SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB); SET_ShaderSourceARB(exec, _mesa_ShaderSourceARB); SET_CompileShaderARB(exec, _mesa_CompileShaderARB); - SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB); - SET_AttachObjectARB(exec, _mesa_AttachObjectARB); + if (ctx->API != API_OPENGL_CORE) { + SET_GetHandleARB(exec, _mesa_GetHandleARB); + SET_DeleteObjectARB(exec, _mesa_DeleteObjectARB); + SET_DetachObjectARB(exec, _mesa_DetachObjectARB); + SET_CreateShaderObjectARB(exec, _mesa_CreateShaderObjectARB); + SET_CreateProgramObjectARB(exec, _mesa_CreateProgramObjectARB); + SET_AttachObjectARB(exec, _mesa_AttachObjectARB); + SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB); + SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB); + SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB); + SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB); + } SET_LinkProgramARB(exec, _mesa_LinkProgramARB); SET_UseProgramObjectARB(exec, _mesa_UseProgramObjectARB); SET_ValidateProgramARB(exec, _mesa_ValidateProgramARB); - SET_GetObjectParameterfvARB(exec, _mesa_GetObjectParameterfvARB); - SET_GetObjectParameterivARB(exec, _mesa_GetObjectParameterivARB); - SET_GetInfoLogARB(exec, _mesa_GetInfoLogARB); - SET_GetAttachedObjectsARB(exec, _mesa_GetAttachedObjectsARB); SET_GetShaderSourceARB(exec, _mesa_GetShaderSourceARB); /* OpenGL 2.0 */ diff --git a/src/mesa/main/shaderapi.h b/src/mesa/main/shaderapi.h index 00c7d7f2aa..5ea61d29ff 100644 --- a/src/mesa/main/shaderapi.h +++ b/src/mesa/main/shaderapi.h @@ -51,7 +51,7 @@ _mesa_active_program(struct gl_context *ctx, struct gl_shader_program *shProg, const char *caller); extern void -_mesa_init_shader_dispatch(struct _glapi_table *exec); +_mesa_init_shader_dispatch(struct gl_context *ctx, struct _glapi_table *exec); extern unsigned _mesa_count_active_attribs(struct gl_shader_program *shProg); diff --git a/src/mesa/main/tests/Makefile.am b/src/mesa/main/tests/Makefile.am index 74e02a8ccc..62040d4dc9 100644 --- a/src/mesa/main/tests/Makefile.am +++ b/src/mesa/main/tests/Makefile.am @@ -3,15 +3,19 @@ AM_CPPFLAGS = \ -I$(top_builddir)/src/mapi \ -I$(top_builddir)/src/mesa \ -I$(top_builddir)/include \ - $(X11_CFLAGS) + $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS) $(X11_CFLAGS) TESTS = main-test check_PROGRAMS = main-test main_test_SOURCES = \ + dispatch_gl.cpp \ + dispatch_stubs.cpp \ enum_strings.cpp +# dispatch_es2.cpp + main_test_LDADD = \ $(top_builddir)/src/mesa/libmesa.la \ $(top_builddir)/src/gtest/libgtest.la \ - -lpthread + -lpthread -ldl diff --git a/src/mesa/main/tests/dispatch_gl.cpp b/src/mesa/main/tests/dispatch_gl.cpp new file mode 100644 index 0000000000..e8f5ea839f --- /dev/null +++ b/src/mesa/main/tests/dispatch_gl.cpp @@ -0,0 +1,747 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +extern "C" { +#include "main/mfeatures.h" +} + +#include <gtest/gtest.h> + +extern "C" { +#include "GL/gl.h" +#include "GL/glext.h" +#include "main/compiler.h" +#include "main/api_exec.h" +#include "glapi/glapi.h" +#include "main/mtypes.h" + +#include "main/context.h" +#include "main/version.h" + +#include "swrast/swrast.h" +#include "vbo/vbo.h" +#include "tnl/tnl.h" +#include "swrast_setup/swrast_setup.h" + +//#include "program/program.h" +#include "drivers/common/driverfuncs.h" + +extern int _mesa_generic_nop(void); + +#ifndef GLAPIENTRYP +#define GLAPIENTRYP GL_APIENTRYP +#endif + +#include "main/dispatch.h" + +#include "dispatch_stubs.h" +} + +static void pass1_checks(struct gl_context *ctx); + +TEST(Dispatch, GL31) +{ + struct gl_context *ctx; + struct gl_config visual; + struct dd_function_table driver_functions; + struct gl_context share_list; + unsigned i; + + ctx = (struct gl_context *) calloc(1, sizeof(struct gl_context)); + if (!ctx) + return; + + memset(&visual, 0, sizeof(visual)); + memset(&driver_functions, 0, sizeof(driver_functions)); + memset(&share_list, 0, sizeof(share_list)); + + _mesa_init_driver_functions(&driver_functions); + //driver_functions.NewTextureObject = NewTextureObject; + //driver_functions.FreeTextureImageBuffer = FreeTextureImageBuffer; + + ctx->API = API_OPENGL_CORE; + _mesa_set_version(ctx, 3, 1); + + assert (_mesa_initialize_context(ctx, + API_OPENGL_CORE, //api, + &visual, + NULL, //&share_list, + &driver_functions, + (void *) NULL)); + _swrast_CreateContext(ctx); + _vbo_CreateContext(ctx); + _tnl_CreateContext(ctx); + _swsetup_CreateContext(ctx); + + struct _glapi_table *const exec = ctx->Exec; + + pass1_checks(ctx); + + const unsigned size = _glapi_get_dispatch_table_size(); + const _glapi_proc *const table = (_glapi_proc *) exec; + + for (unsigned i = 0; i < size; i++) { + EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i]) << + dispatch_stub_get_name(i) << " should be NOP"; + } +} + + +#define PASS1_RUN(func) \ + f = (_glapi_proc) GET_##func(exec); \ + EXPECT_NE(f, (_glapi_proc) _mesa_generic_nop) << "Function: gl" #func; \ + SET_by_offset(exec, _gloffset_##func, _mesa_generic_nop) + +#define PASS1_CHECK(minMajor, minMinor, maxMajor, maxMinor) \ + (_mesa_have_version(ctx, minMajor, minMinor) && \ + (maxMajor == 0 || !_mesa_have_version(ctx, maxMajor, maxMinor))) + +#define GL_FUNC_MINMAX(minMajor, minMinor, maxMajor, maxMinor, func) \ + if (PASS1_CHECK(minMajor, minMinor, maxMajor, maxMinor)) PASS1_RUN(func) + +#define GL_FUNC_MIN(major, minor, func) \ + GL_FUNC_MINMAX(major, minor, 0, 0, func) + +static void +pass1_checks(struct gl_context *ctx) +{ + _glapi_proc f; + struct _glapi_table *const exec = ctx->Exec; + + GL_FUNC_MIN(1, 0, CullFace); + GL_FUNC_MIN(1, 0, FrontFace); + GL_FUNC_MIN(1, 0, Hint); + GL_FUNC_MIN(1, 0, LineWidth); + GL_FUNC_MIN(1, 0, PointSize); + GL_FUNC_MIN(1, 0, PolygonMode); + GL_FUNC_MIN(1, 0, Scissor); + GL_FUNC_MIN(1, 0, TexParameterf); + GL_FUNC_MIN(1, 0, TexParameterfv); + GL_FUNC_MIN(1, 0, TexParameteri); + GL_FUNC_MIN(1, 0, TexParameteriv); + GL_FUNC_MIN(1, 0, TexImage1D); + GL_FUNC_MIN(1, 0, TexImage2D); + GL_FUNC_MIN(1, 0, DrawBuffer); + GL_FUNC_MIN(1, 0, Clear); + GL_FUNC_MIN(1, 0, ClearColor); + GL_FUNC_MIN(1, 0, ClearStencil); + GL_FUNC_MIN(1, 0, ClearDepth); + GL_FUNC_MIN(1, 0, StencilMask); + GL_FUNC_MIN(1, 0, ColorMask); + GL_FUNC_MIN(1, 0, DepthMask); + GL_FUNC_MIN(1, 0, Disable); + GL_FUNC_MIN(1, 0, Enable); + GL_FUNC_MIN(1, 0, Finish); + GL_FUNC_MIN(1, 0, Flush); + GL_FUNC_MIN(1, 0, BlendFunc); + GL_FUNC_MIN(1, 0, LogicOp); + GL_FUNC_MIN(1, 0, StencilFunc); + GL_FUNC_MIN(1, 0, StencilOp); + GL_FUNC_MIN(1, 0, DepthFunc); + GL_FUNC_MIN(1, 0, PixelStoref); + GL_FUNC_MIN(1, 0, PixelStorei); + GL_FUNC_MIN(1, 0, ReadBuffer); + GL_FUNC_MIN(1, 0, ReadPixels); + GL_FUNC_MIN(1, 0, GetBooleanv); + GL_FUNC_MIN(1, 0, GetDoublev); + GL_FUNC_MIN(1, 0, GetError); + GL_FUNC_MIN(1, 0, GetFloatv); + GL_FUNC_MIN(1, 0, GetIntegerv); + GL_FUNC_MIN(1, 0, GetString); + GL_FUNC_MIN(1, 0, GetTexImage); + GL_FUNC_MIN(1, 0, GetTexParameterfv); + GL_FUNC_MIN(1, 0, GetTexParameteriv); + GL_FUNC_MIN(1, 0, GetTexLevelParameterfv); + GL_FUNC_MIN(1, 0, GetTexLevelParameteriv); + GL_FUNC_MIN(1, 0, IsEnabled); + GL_FUNC_MIN(1, 0, DepthRange); + GL_FUNC_MIN(1, 0, Viewport); + GL_FUNC_MIN(1, 1, DrawArrays); + GL_FUNC_MIN(1, 1, DrawElements); + GL_FUNC_MINMAX(1, 1, 3, 1, GetPointerv); + GL_FUNC_MIN(1, 1, PolygonOffset); + GL_FUNC_MIN(1, 1, CopyTexImage1D); + GL_FUNC_MIN(1, 1, CopyTexImage2D); + GL_FUNC_MIN(1, 1, CopyTexSubImage1D); + GL_FUNC_MIN(1, 1, CopyTexSubImage2D); + GL_FUNC_MIN(1, 1, TexSubImage1D); + GL_FUNC_MIN(1, 1, TexSubImage2D); + GL_FUNC_MIN(1, 1, BindTexture); + GL_FUNC_MIN(1, 1, DeleteTextures); + GL_FUNC_MIN(1, 1, GenTextures); + GL_FUNC_MIN(1, 1, IsTexture); + GL_FUNC_MIN(1, 2, BlendColor); + GL_FUNC_MIN(1, 2, BlendEquation); + GL_FUNC_MIN(1, 2, DrawRangeElements); + GL_FUNC_MIN(1, 2, TexImage3D); + GL_FUNC_MIN(1, 2, TexSubImage3D); + GL_FUNC_MIN(1, 2, CopyTexSubImage3D); + GL_FUNC_MIN(1, 3, ActiveTextureARB); + GL_FUNC_MIN(1, 3, SampleCoverageARB); + GL_FUNC_MIN(1, 3, CompressedTexImage3DARB); + GL_FUNC_MIN(1, 3, CompressedTexImage2DARB); + GL_FUNC_MIN(1, 3, CompressedTexImage1DARB); + GL_FUNC_MIN(1, 3, CompressedTexSubImage3DARB); + GL_FUNC_MIN(1, 3, CompressedTexSubImage2DARB); + GL_FUNC_MIN(1, 3, CompressedTexSubImage1DARB); + GL_FUNC_MIN(1, 3, GetCompressedTexImageARB); + GL_FUNC_MIN(1, 4, BlendFuncSeparateEXT); + GL_FUNC_MIN(1, 4, MultiDrawArraysEXT); + GL_FUNC_MIN(1, 4, MultiDrawElementsEXT); + GL_FUNC_MIN(1, 4, PointParameterfEXT); + GL_FUNC_MIN(1, 4, PointParameterfvEXT); + GL_FUNC_MIN(1, 4, PointParameteriNV); + GL_FUNC_MIN(1, 4, PointParameterivNV); + GL_FUNC_MIN(1, 5, GenQueriesARB); + GL_FUNC_MIN(1, 5, DeleteQueriesARB); + GL_FUNC_MIN(1, 5, IsQueryARB); + GL_FUNC_MIN(1, 5, BeginQueryARB); + GL_FUNC_MIN(1, 5, EndQueryARB); + GL_FUNC_MIN(1, 5, GetQueryivARB); + GL_FUNC_MIN(1, 5, GetQueryObjectivARB); + GL_FUNC_MIN(1, 5, GetQueryObjectuivARB); + GL_FUNC_MIN(1, 5, BindBufferARB); + GL_FUNC_MIN(1, 5, DeleteBuffersARB); + GL_FUNC_MIN(1, 5, GenBuffersARB); + GL_FUNC_MIN(1, 5, IsBufferARB); + GL_FUNC_MIN(1, 5, BufferDataARB); + GL_FUNC_MIN(1, 5, BufferSubDataARB); + GL_FUNC_MIN(1, 5, GetBufferSubDataARB); + GL_FUNC_MIN(1, 5, MapBufferARB); + GL_FUNC_MIN(1, 5, UnmapBufferARB); + GL_FUNC_MIN(1, 5, GetBufferParameterivARB); + GL_FUNC_MIN(1, 5, GetBufferPointervARB); + GL_FUNC_MIN(2, 0, BlendEquationSeparateEXT); + GL_FUNC_MIN(2, 0, DrawBuffersARB); + GL_FUNC_MIN(2, 0, StencilOpSeparate); + GL_FUNC_MIN(2, 0, StencilFuncSeparate); + GL_FUNC_MIN(2, 0, StencilMaskSeparate); + GL_FUNC_MIN(2, 0, AttachShader); + GL_FUNC_MIN(2, 0, BindAttribLocationARB); + GL_FUNC_MIN(2, 0, CompileShaderARB); + GL_FUNC_MIN(2, 0, CreateProgram); + GL_FUNC_MIN(2, 0, CreateShader); + GL_FUNC_MIN(2, 0, DeleteProgram); + GL_FUNC_MIN(2, 0, DeleteShader); + GL_FUNC_MIN(2, 0, DetachShader); + GL_FUNC_MIN(2, 0, DisableVertexAttribArrayARB); + GL_FUNC_MIN(2, 0, EnableVertexAttribArrayARB); + GL_FUNC_MIN(2, 0, GetActiveAttribARB); + GL_FUNC_MIN(2, 0, GetActiveUniformARB); + GL_FUNC_MIN(2, 0, GetAttachedShaders); + GL_FUNC_MIN(2, 0, GetAttribLocationARB); + GL_FUNC_MIN(2, 0, GetProgramiv); + GL_FUNC_MIN(2, 0, GetProgramInfoLog); + GL_FUNC_MIN(2, 0, GetShaderiv); + GL_FUNC_MIN(2, 0, GetShaderInfoLog); + GL_FUNC_MIN(2, 0, GetShaderSourceARB); + GL_FUNC_MIN(2, 0, GetUniformLocationARB); + GL_FUNC_MIN(2, 0, GetUniformfvARB); + GL_FUNC_MIN(2, 0, GetUniformivARB); + GL_FUNC_MIN(2, 0, GetVertexAttribdvARB); + GL_FUNC_MIN(2, 0, GetVertexAttribfvARB); + GL_FUNC_MIN(2, 0, GetVertexAttribivARB); + GL_FUNC_MIN(2, 0, GetVertexAttribPointervNV); + GL_FUNC_MIN(2, 0, IsProgram); + GL_FUNC_MIN(2, 0, IsShader); + GL_FUNC_MIN(2, 0, LinkProgramARB); + GL_FUNC_MIN(2, 0, ShaderSourceARB); + GL_FUNC_MIN(2, 0, UseProgramObjectARB); + GL_FUNC_MIN(2, 0, Uniform1fARB); + GL_FUNC_MIN(2, 0, Uniform2fARB); + GL_FUNC_MIN(2, 0, Uniform3fARB); + GL_FUNC_MIN(2, 0, Uniform4fARB); + GL_FUNC_MIN(2, 0, Uniform1iARB); + GL_FUNC_MIN(2, 0, Uniform2iARB); + GL_FUNC_MIN(2, 0, Uniform3iARB); + GL_FUNC_MIN(2, 0, Uniform4iARB); + GL_FUNC_MIN(2, 0, Uniform1fvARB); + GL_FUNC_MIN(2, 0, Uniform2fvARB); + GL_FUNC_MIN(2, 0, Uniform3fvARB); + GL_FUNC_MIN(2, 0, Uniform4fvARB); + GL_FUNC_MIN(2, 0, Uniform1ivARB); + GL_FUNC_MIN(2, 0, Uniform2ivARB); + GL_FUNC_MIN(2, 0, Uniform3ivARB); + GL_FUNC_MIN(2, 0, Uniform4ivARB); + GL_FUNC_MIN(2, 0, UniformMatrix2fvARB); + GL_FUNC_MIN(2, 0, UniformMatrix3fvARB); + GL_FUNC_MIN(2, 0, UniformMatrix4fvARB); + GL_FUNC_MIN(2, 0, ValidateProgramARB); + GL_FUNC_MIN(2, 0, VertexAttrib1dARB); + GL_FUNC_MIN(2, 0, VertexAttrib1dvARB); + GL_FUNC_MIN(2, 0, VertexAttrib1fARB); + GL_FUNC_MIN(2, 0, VertexAttrib1fvARB); + GL_FUNC_MIN(2, 0, VertexAttrib1sARB); + GL_FUNC_MIN(2, 0, VertexAttrib1svARB); + GL_FUNC_MIN(2, 0, VertexAttrib2dARB); + GL_FUNC_MIN(2, 0, VertexAttrib2dvARB); + GL_FUNC_MIN(2, 0, VertexAttrib2fARB); + GL_FUNC_MIN(2, 0, VertexAttrib2fvARB); + GL_FUNC_MIN(2, 0, VertexAttrib2sARB); + GL_FUNC_MIN(2, 0, VertexAttrib2svARB); + GL_FUNC_MIN(2, 0, VertexAttrib3dARB); + GL_FUNC_MIN(2, 0, VertexAttrib3dvARB); + GL_FUNC_MIN(2, 0, VertexAttrib3fARB); + GL_FUNC_MIN(2, 0, VertexAttrib3fvARB); + GL_FUNC_MIN(2, 0, VertexAttrib3sARB); + GL_FUNC_MIN(2, 0, VertexAttrib3svARB); + GL_FUNC_MIN(2, 0, VertexAttrib4NbvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4NivARB); + GL_FUNC_MIN(2, 0, VertexAttrib4NsvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4NubARB); + GL_FUNC_MIN(2, 0, VertexAttrib4NubvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4NuivARB); + GL_FUNC_MIN(2, 0, VertexAttrib4NusvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4bvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4dARB); + GL_FUNC_MIN(2, 0, VertexAttrib4dvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4fARB); + GL_FUNC_MIN(2, 0, VertexAttrib4fvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4ivARB); + GL_FUNC_MIN(2, 0, VertexAttrib4sARB); + GL_FUNC_MIN(2, 0, VertexAttrib4svARB); + GL_FUNC_MIN(2, 0, VertexAttrib4ubvARB); + GL_FUNC_MIN(2, 0, VertexAttrib4uivARB); + GL_FUNC_MIN(2, 0, VertexAttrib4usvARB); + GL_FUNC_MIN(2, 0, VertexAttribPointerARB); + GL_FUNC_MIN(2, 1, UniformMatrix2x3fv); + GL_FUNC_MIN(2, 1, UniformMatrix3x2fv); + GL_FUNC_MIN(2, 1, UniformMatrix2x4fv); + GL_FUNC_MIN(2, 1, UniformMatrix4x2fv); + GL_FUNC_MIN(2, 1, UniformMatrix3x4fv); + GL_FUNC_MIN(2, 1, UniformMatrix4x3fv); + GL_FUNC_MIN(3, 0, ColorMaskIndexedEXT); + GL_FUNC_MIN(3, 0, GetBooleanIndexedvEXT); + GL_FUNC_MIN(3, 0, GetIntegerIndexedvEXT); + GL_FUNC_MIN(3, 0, EnableIndexedEXT); + GL_FUNC_MIN(3, 0, DisableIndexedEXT); + GL_FUNC_MIN(3, 0, IsEnabledIndexedEXT); + GL_FUNC_MIN(3, 0, BeginTransformFeedbackEXT); + GL_FUNC_MIN(3, 0, EndTransformFeedbackEXT); + GL_FUNC_MIN(3, 0, BindBufferRangeEXT); + GL_FUNC_MIN(3, 0, BindBufferBaseEXT); + GL_FUNC_MIN(3, 0, TransformFeedbackVaryingsEXT); + GL_FUNC_MIN(3, 0, GetTransformFeedbackVaryingEXT); + GL_FUNC_MIN(3, 0, ClampColor); + GL_FUNC_MIN(3, 0, BeginConditionalRenderNV); + GL_FUNC_MIN(3, 0, EndConditionalRenderNV); + GL_FUNC_MIN(3, 0, VertexAttribIPointerEXT); + GL_FUNC_MIN(3, 0, GetVertexAttribIivEXT); + GL_FUNC_MIN(3, 0, GetVertexAttribIuivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI1iEXT); + GL_FUNC_MIN(3, 0, VertexAttribI2iEXT); + GL_FUNC_MIN(3, 0, VertexAttribI3iEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4iEXT); + GL_FUNC_MIN(3, 0, VertexAttribI1uiEXT); + GL_FUNC_MIN(3, 0, VertexAttribI2uiEXT); + GL_FUNC_MIN(3, 0, VertexAttribI3uiEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4uiEXT); + GL_FUNC_MIN(3, 0, VertexAttribI1ivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI2ivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI3ivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4ivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI1uivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI2uivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI3uivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4uivEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4bvEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4svEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4ubvEXT); + GL_FUNC_MIN(3, 0, VertexAttribI4usvEXT); + GL_FUNC_MIN(3, 0, GetUniformuivEXT); + GL_FUNC_MIN(3, 0, BindFragDataLocationEXT); + GL_FUNC_MIN(3, 0, GetFragDataLocationEXT); + GL_FUNC_MIN(3, 0, Uniform1uiEXT); + GL_FUNC_MIN(3, 0, Uniform2uiEXT); + GL_FUNC_MIN(3, 0, Uniform3uiEXT); + GL_FUNC_MIN(3, 0, Uniform4uiEXT); + GL_FUNC_MIN(3, 0, Uniform1uivEXT); + GL_FUNC_MIN(3, 0, Uniform2uivEXT); + GL_FUNC_MIN(3, 0, Uniform3uivEXT); + GL_FUNC_MIN(3, 0, Uniform4uivEXT); + GL_FUNC_MIN(3, 0, TexParameterIivEXT); + GL_FUNC_MIN(3, 0, TexParameterIuivEXT); + GL_FUNC_MIN(3, 0, GetTexParameterIivEXT); + GL_FUNC_MIN(3, 0, GetTexParameterIuivEXT); + GL_FUNC_MIN(3, 0, ClearBufferiv); + GL_FUNC_MIN(3, 0, ClearBufferuiv); + GL_FUNC_MIN(3, 0, ClearBufferfv); + GL_FUNC_MIN(3, 0, ClearBufferfi); + GL_FUNC_MIN(3, 0, GetStringi); + GL_FUNC_MIN(3, 1, DrawArraysInstancedARB); + GL_FUNC_MIN(3, 1, DrawElementsInstancedARB); + GL_FUNC_MIN(3, 1, TexBufferARB); + GL_FUNC_MIN(3, 1, PrimitiveRestartIndexNV); + GL_FUNC_MIN(3, 2, GetInteger64i_v); + GL_FUNC_MIN(3, 2, GetBufferParameteri64v); + GL_FUNC_MIN(3, 2, FramebufferTexture); + GL_FUNC_MIN(3, 3, VertexAttribDivisor); +// GL_FUNC_MIN(4, 0, MinSampleShading); + GL_FUNC_MIN(4, 0, BlendEquationiARB); + GL_FUNC_MIN(4, 0, BlendEquationSeparateiARB); + GL_FUNC_MIN(4, 0, BlendFunciARB); + GL_FUNC_MIN(4, 0, BlendFuncSeparateiARB); + GL_FUNC_MIN(4, 3, IsRenderbufferEXT); + GL_FUNC_MIN(4, 3, BindRenderbufferEXT); + GL_FUNC_MIN(4, 3, DeleteRenderbuffersEXT); + GL_FUNC_MIN(4, 3, GenRenderbuffersEXT); + GL_FUNC_MIN(4, 3, RenderbufferStorageEXT); + GL_FUNC_MIN(4, 3, GetRenderbufferParameterivEXT); + GL_FUNC_MIN(4, 3, IsFramebufferEXT); + GL_FUNC_MIN(4, 3, BindFramebufferEXT); + GL_FUNC_MIN(4, 3, DeleteFramebuffersEXT); + GL_FUNC_MIN(4, 3, GenFramebuffersEXT); + GL_FUNC_MIN(4, 3, CheckFramebufferStatusEXT); + GL_FUNC_MIN(4, 3, FramebufferTexture1DEXT); + GL_FUNC_MIN(4, 3, FramebufferTexture2DEXT); + GL_FUNC_MIN(4, 3, FramebufferTexture3DEXT); + GL_FUNC_MIN(4, 3, FramebufferRenderbufferEXT); + GL_FUNC_MIN(4, 3, GetFramebufferAttachmentParameterivEXT); + GL_FUNC_MIN(4, 3, GenerateMipmapEXT); + GL_FUNC_MIN(4, 3, BlitFramebufferEXT); + GL_FUNC_MIN(4, 3, RenderbufferStorageMultisample); + GL_FUNC_MIN(4, 3, FramebufferTextureLayerEXT); + GL_FUNC_MIN(4, 3, MapBufferRange); + GL_FUNC_MIN(4, 3, FlushMappedBufferRange); + GL_FUNC_MIN(4, 3, BindVertexArray); +// GL_FUNC_MIN(4, 3, DeleteVertexArrays); + GL_FUNC_MIN(4, 3, GenVertexArrays); +// GL_FUNC_MIN(4, 3, IsVertexArray); + GL_FUNC_MIN(4, 3, GetUniformIndices); + GL_FUNC_MIN(4, 3, GetActiveUniformsiv); + GL_FUNC_MIN(4, 3, GetActiveUniformName); + GL_FUNC_MIN(4, 3, GetUniformBlockIndex); + GL_FUNC_MIN(4, 3, GetActiveUniformBlockiv); + GL_FUNC_MIN(4, 3, GetActiveUniformBlockName); + GL_FUNC_MIN(4, 3, UniformBlockBinding); + GL_FUNC_MIN(4, 3, CopyBufferSubData); + GL_FUNC_MIN(4, 3, DrawElementsBaseVertex); + GL_FUNC_MIN(4, 3, DrawRangeElementsBaseVertex); + GL_FUNC_MIN(4, 3, DrawElementsInstancedBaseVertex); + GL_FUNC_MIN(4, 3, MultiDrawElementsBaseVertex); + GL_FUNC_MIN(4, 3, ProvokingVertexEXT); + GL_FUNC_MIN(4, 3, FenceSync); + GL_FUNC_MIN(4, 3, IsSync); + GL_FUNC_MIN(4, 3, DeleteSync); + GL_FUNC_MIN(4, 3, ClientWaitSync); + GL_FUNC_MIN(4, 3, WaitSync); + GL_FUNC_MIN(4, 3, GetInteger64v); + GL_FUNC_MIN(4, 3, GetSynciv); +// GL_FUNC_MIN(4, 3, TexImage2DMultisample); +// GL_FUNC_MIN(4, 3, TexImage3DMultisample); +// GL_FUNC_MIN(4, 3, GetMultisamplefv); +// GL_FUNC_MIN(4, 3, SampleMaski); + GL_FUNC_MIN(4, 3, BlendEquationiARB); + GL_FUNC_MIN(4, 3, BlendEquationSeparateiARB); + GL_FUNC_MIN(4, 3, BlendFunciARB); + GL_FUNC_MIN(4, 3, BlendFuncSeparateiARB); +// GL_FUNC_MIN(4, 3, MinSampleShadingARB); +// GL_FUNC_MIN(4, 3, NamedStringARB); +// GL_FUNC_MIN(4, 3, DeleteNamedStringARB); +// GL_FUNC_MIN(4, 3, CompileShaderIncludeARB); +// GL_FUNC_MIN(4, 3, IsNamedStringARB); +// GL_FUNC_MIN(4, 3, GetNamedStringARB); +// GL_FUNC_MIN(4, 3, GetNamedStringivARB); + GL_FUNC_MIN(4, 3, BindFragDataLocationIndexed); + GL_FUNC_MIN(4, 3, GetFragDataIndex); + GL_FUNC_MIN(4, 3, GenSamplers); + GL_FUNC_MIN(4, 3, DeleteSamplers); + GL_FUNC_MIN(4, 3, IsSampler); + GL_FUNC_MIN(4, 3, BindSampler); + GL_FUNC_MIN(4, 3, SamplerParameteri); + GL_FUNC_MIN(4, 3, SamplerParameteriv); + GL_FUNC_MIN(4, 3, SamplerParameterf); + GL_FUNC_MIN(4, 3, SamplerParameterfv); + GL_FUNC_MIN(4, 3, SamplerParameterIiv); + GL_FUNC_MIN(4, 3, SamplerParameterIuiv); + GL_FUNC_MIN(4, 3, GetSamplerParameteriv); + GL_FUNC_MIN(4, 3, GetSamplerParameterIiv); + GL_FUNC_MIN(4, 3, GetSamplerParameterfv); + GL_FUNC_MIN(4, 3, GetSamplerParameterIuiv); + GL_FUNC_MIN(4, 3, QueryCounter); + GL_FUNC_MIN(4, 3, GetQueryObjecti64vEXT); + GL_FUNC_MIN(4, 3, GetQueryObjectui64vEXT); + GL_FUNC_MIN(4, 3, VertexP2ui); + GL_FUNC_MIN(4, 3, VertexP2uiv); + GL_FUNC_MIN(4, 3, VertexP3ui); + GL_FUNC_MIN(4, 3, VertexP3uiv); + GL_FUNC_MIN(4, 3, VertexP4ui); + GL_FUNC_MIN(4, 3, VertexP4uiv); + GL_FUNC_MIN(4, 3, TexCoordP1ui); + GL_FUNC_MIN(4, 3, TexCoordP1uiv); + GL_FUNC_MIN(4, 3, TexCoordP2ui); + GL_FUNC_MIN(4, 3, TexCoordP2uiv); + GL_FUNC_MIN(4, 3, TexCoordP3ui); + GL_FUNC_MIN(4, 3, TexCoordP3uiv); + GL_FUNC_MIN(4, 3, TexCoordP4ui); + GL_FUNC_MIN(4, 3, TexCoordP4uiv); + GL_FUNC_MIN(4, 3, MultiTexCoordP1ui); + GL_FUNC_MIN(4, 3, MultiTexCoordP1uiv); + GL_FUNC_MIN(4, 3, MultiTexCoordP2ui); + GL_FUNC_MIN(4, 3, MultiTexCoordP2uiv); + GL_FUNC_MIN(4, 3, MultiTexCoordP3ui); + GL_FUNC_MIN(4, 3, MultiTexCoordP3uiv); + GL_FUNC_MIN(4, 3, MultiTexCoordP4ui); + GL_FUNC_MIN(4, 3, MultiTexCoordP4uiv); + GL_FUNC_MIN(4, 3, NormalP3ui); + GL_FUNC_MIN(4, 3, NormalP3uiv); + GL_FUNC_MIN(4, 3, ColorP3ui); + GL_FUNC_MIN(4, 3, ColorP3uiv); + GL_FUNC_MIN(4, 3, ColorP4ui); + GL_FUNC_MIN(4, 3, ColorP4uiv); + GL_FUNC_MIN(4, 3, SecondaryColorP3ui); + GL_FUNC_MIN(4, 3, SecondaryColorP3uiv); + GL_FUNC_MIN(4, 3, VertexAttribP1ui); + GL_FUNC_MIN(4, 3, VertexAttribP1uiv); + GL_FUNC_MIN(4, 3, VertexAttribP2ui); + GL_FUNC_MIN(4, 3, VertexAttribP2uiv); + GL_FUNC_MIN(4, 3, VertexAttribP3ui); + GL_FUNC_MIN(4, 3, VertexAttribP3uiv); + GL_FUNC_MIN(4, 3, VertexAttribP4ui); + GL_FUNC_MIN(4, 3, VertexAttribP4uiv); +// GL_FUNC_MIN(4, 3, DrawArraysIndirect); +// GL_FUNC_MIN(4, 3, DrawElementsIndirect); +// GL_FUNC_MIN(4, 3, Uniform1d); +// GL_FUNC_MIN(4, 3, Uniform2d); +// GL_FUNC_MIN(4, 3, Uniform3d); +// GL_FUNC_MIN(4, 3, Uniform4d); +// GL_FUNC_MIN(4, 3, Uniform1dv); +// GL_FUNC_MIN(4, 3, Uniform2dv); +// GL_FUNC_MIN(4, 3, Uniform3dv); +// GL_FUNC_MIN(4, 3, Uniform4dv); +// GL_FUNC_MIN(4, 3, UniformMatrix2dv); +// GL_FUNC_MIN(4, 3, UniformMatrix3dv); +// GL_FUNC_MIN(4, 3, UniformMatrix4dv); +// GL_FUNC_MIN(4, 3, UniformMatrix2x3dv); +// GL_FUNC_MIN(4, 3, UniformMatrix2x4dv); +// GL_FUNC_MIN(4, 3, UniformMatrix3x2dv); +// GL_FUNC_MIN(4, 3, UniformMatrix3x4dv); +// GL_FUNC_MIN(4, 3, UniformMatrix4x2dv); +// GL_FUNC_MIN(4, 3, UniformMatrix4x3dv); +// GL_FUNC_MIN(4, 3, GetUniformdv); +// GL_FUNC_MIN(4, 3, GetSubroutineUniformLocation); +// GL_FUNC_MIN(4, 3, GetSubroutineIndex); +// GL_FUNC_MIN(4, 3, GetActiveSubroutineUniformiv); +// GL_FUNC_MIN(4, 3, GetActiveSubroutineUniformName); +// GL_FUNC_MIN(4, 3, GetActiveSubroutineName); +// GL_FUNC_MIN(4, 3, UniformSubroutinesuiv); +// GL_FUNC_MIN(4, 3, GetUniformSubroutineuiv); +// GL_FUNC_MIN(4, 3, GetProgramStageiv); +// GL_FUNC_MIN(4, 3, PatchParameteri); +// GL_FUNC_MIN(4, 3, PatchParameterfv); + GL_FUNC_MIN(4, 3, BindTransformFeedback); + GL_FUNC_MIN(4, 3, DeleteTransformFeedbacks); + GL_FUNC_MIN(4, 3, GenTransformFeedbacks); + GL_FUNC_MIN(4, 3, IsTransformFeedback); + GL_FUNC_MIN(4, 3, PauseTransformFeedback); + GL_FUNC_MIN(4, 3, ResumeTransformFeedback); + GL_FUNC_MIN(4, 3, DrawTransformFeedback); + GL_FUNC_MIN(4, 3, DrawTransformFeedbackStream); + GL_FUNC_MIN(4, 3, BeginQueryIndexed); + GL_FUNC_MIN(4, 3, EndQueryIndexed); + GL_FUNC_MIN(4, 3, GetQueryIndexediv); + GL_FUNC_MIN(4, 3, ReleaseShaderCompiler); + GL_FUNC_MIN(4, 3, ShaderBinary); + GL_FUNC_MIN(4, 3, GetShaderPrecisionFormat); + GL_FUNC_MIN(4, 3, DepthRangef); + GL_FUNC_MIN(4, 3, ClearDepthf); +// GL_FUNC_MIN(4, 3, GetProgramBinary); +// GL_FUNC_MIN(4, 3, ProgramBinary); + GL_FUNC_MIN(4, 3, ProgramParameteriARB); +// GL_FUNC_MIN(4, 3, UseProgramStages); +// GL_FUNC_MIN(4, 3, ActiveShaderProgram); +// GL_FUNC_MIN(4, 3, CreateShaderProgramv); +// GL_FUNC_MIN(4, 3, BindProgramPipeline); +// GL_FUNC_MIN(4, 3, DeleteProgramPipelines); +// GL_FUNC_MIN(4, 3, GenProgramPipelines); +// GL_FUNC_MIN(4, 3, IsProgramPipeline); +// GL_FUNC_MIN(4, 3, GetProgramPipelineiv); +// GL_FUNC_MIN(4, 3, ProgramUniform1i); +// GL_FUNC_MIN(4, 3, ProgramUniform1iv); +// GL_FUNC_MIN(4, 3, ProgramUniform1f); +// GL_FUNC_MIN(4, 3, ProgramUniform1fv); +// GL_FUNC_MIN(4, 3, ProgramUniform1d); +// GL_FUNC_MIN(4, 3, ProgramUniform1dv); +// GL_FUNC_MIN(4, 3, ProgramUniform1ui); +// GL_FUNC_MIN(4, 3, ProgramUniform1uiv); +// GL_FUNC_MIN(4, 3, ProgramUniform2i); +// GL_FUNC_MIN(4, 3, ProgramUniform2iv); +// GL_FUNC_MIN(4, 3, ProgramUniform2f); +// GL_FUNC_MIN(4, 3, ProgramUniform2fv); +// GL_FUNC_MIN(4, 3, ProgramUniform2d); +// GL_FUNC_MIN(4, 3, ProgramUniform2dv); +// GL_FUNC_MIN(4, 3, ProgramUniform2ui); +// GL_FUNC_MIN(4, 3, ProgramUniform2uiv); +// GL_FUNC_MIN(4, 3, ProgramUniform3i); +// GL_FUNC_MIN(4, 3, ProgramUniform3iv); +// GL_FUNC_MIN(4, 3, ProgramUniform3f); +// GL_FUNC_MIN(4, 3, ProgramUniform3fv); +// GL_FUNC_MIN(4, 3, ProgramUniform3d); +// GL_FUNC_MIN(4, 3, ProgramUniform3dv); +// GL_FUNC_MIN(4, 3, ProgramUniform3ui); +// GL_FUNC_MIN(4, 3, ProgramUniform3uiv); +// GL_FUNC_MIN(4, 3, ProgramUniform4i); +// GL_FUNC_MIN(4, 3, ProgramUniform4iv); +// GL_FUNC_MIN(4, 3, ProgramUniform4f); +// GL_FUNC_MIN(4, 3, ProgramUniform4fv); +// GL_FUNC_MIN(4, 3, ProgramUniform4d); +// GL_FUNC_MIN(4, 3, ProgramUniform4dv); +// GL_FUNC_MIN(4, 3, ProgramUniform4ui); +// GL_FUNC_MIN(4, 3, ProgramUniform4uiv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix2fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix3fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix4fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix2dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix3dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix4dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix2x3fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix3x2fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix2x4fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix4x2fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix3x4fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix4x3fv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix2x3dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix3x2dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix2x4dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix4x2dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix3x4dv); +// GL_FUNC_MIN(4, 3, ProgramUniformMatrix4x3dv); +// GL_FUNC_MIN(4, 3, ValidateProgramPipeline); +// GL_FUNC_MIN(4, 3, GetProgramPipelineInfoLog); +// GL_FUNC_MIN(4, 3, VertexAttribL1d); +// GL_FUNC_MIN(4, 3, VertexAttribL2d); +// GL_FUNC_MIN(4, 3, VertexAttribL3d); +// GL_FUNC_MIN(4, 3, VertexAttribL4d); +// GL_FUNC_MIN(4, 3, VertexAttribL1dv); +// GL_FUNC_MIN(4, 3, VertexAttribL2dv); +// GL_FUNC_MIN(4, 3, VertexAttribL3dv); +// GL_FUNC_MIN(4, 3, VertexAttribL4dv); +// GL_FUNC_MIN(4, 3, VertexAttribLPointer); +// GL_FUNC_MIN(4, 3, GetVertexAttribLdv); +// GL_FUNC_MIN(4, 3, ViewportArrayv); +// GL_FUNC_MIN(4, 3, ViewportIndexedf); +// GL_FUNC_MIN(4, 3, ViewportIndexedfv); +// GL_FUNC_MIN(4, 3, ScissorArrayv); +// GL_FUNC_MIN(4, 3, ScissorIndexed); +// GL_FUNC_MIN(4, 3, ScissorIndexedv); +// GL_FUNC_MIN(4, 3, DepthRangeArrayv); +// GL_FUNC_MIN(4, 3, DepthRangeIndexed); +// GL_FUNC_MIN(4, 3, GetFloati_v); +// GL_FUNC_MIN(4, 3, GetDoublei_v); +// GL_FUNC_MIN(4, 3, CreateSyncFromCLeventARB); + GL_FUNC_MIN(4, 3, DebugMessageControlARB); + GL_FUNC_MIN(4, 3, DebugMessageInsertARB); + GL_FUNC_MIN(4, 3, DebugMessageCallbackARB); + GL_FUNC_MIN(4, 3, GetDebugMessageLogARB); + GL_FUNC_MIN(4, 3, GetGraphicsResetStatusARB); + GL_FUNC_MIN(4, 3, GetnMapdvARB); + GL_FUNC_MIN(4, 3, GetnMapfvARB); + GL_FUNC_MIN(4, 3, GetnMapivARB); + GL_FUNC_MIN(4, 3, GetnPixelMapfvARB); + GL_FUNC_MIN(4, 3, GetnPixelMapuivARB); + GL_FUNC_MIN(4, 3, GetnPixelMapusvARB); + GL_FUNC_MIN(4, 3, GetnPolygonStippleARB); + GL_FUNC_MIN(4, 3, GetnColorTableARB); + GL_FUNC_MIN(4, 3, GetnConvolutionFilterARB); + GL_FUNC_MIN(4, 3, GetnSeparableFilterARB); + GL_FUNC_MIN(4, 3, GetnHistogramARB); + GL_FUNC_MIN(4, 3, GetnMinmaxARB); + GL_FUNC_MIN(4, 3, GetnTexImageARB); + GL_FUNC_MIN(4, 3, ReadnPixelsARB); + GL_FUNC_MIN(4, 3, GetnCompressedTexImageARB); + GL_FUNC_MIN(4, 3, GetnUniformfvARB); + GL_FUNC_MIN(4, 3, GetnUniformivARB); + GL_FUNC_MIN(4, 3, GetnUniformuivARB); + GL_FUNC_MIN(4, 3, GetnUniformdvARB); + GL_FUNC_MIN(4, 3, DrawArraysInstancedBaseInstance); + GL_FUNC_MIN(4, 3, DrawElementsInstancedBaseInstance); + GL_FUNC_MIN(4, 3, DrawElementsInstancedBaseVertexBaseInstance); + GL_FUNC_MIN(4, 3, DrawTransformFeedbackInstanced); + GL_FUNC_MIN(4, 3, DrawTransformFeedbackStreamInstanced); +// GL_FUNC_MIN(4, 3, GetInternalformativ); +// GL_FUNC_MIN(4, 3, GetActiveAtomicCounterBufferiv); +// GL_FUNC_MIN(4, 3, BindImageTexture); +// GL_FUNC_MIN(4, 3, MemoryBarrier); + GL_FUNC_MIN(4, 3, TexStorage1D); + GL_FUNC_MIN(4, 3, TexStorage2D); + GL_FUNC_MIN(4, 3, TexStorage3D); + GL_FUNC_MIN(4, 3, TextureStorage1DEXT); + GL_FUNC_MIN(4, 3, TextureStorage2DEXT); + GL_FUNC_MIN(4, 3, TextureStorage3DEXT); + GL_FUNC_MIN(4, 3, DebugMessageControlARB); + GL_FUNC_MIN(4, 3, DebugMessageInsertARB); + GL_FUNC_MIN(4, 3, DebugMessageCallbackARB); + GL_FUNC_MIN(4, 3, GetDebugMessageLogARB); +// GL_FUNC_MIN(4, 3, PushDebugGroup); +// GL_FUNC_MIN(4, 3, PopDebugGroup); +// GL_FUNC_MIN(4, 3, ObjectLabel); +// GL_FUNC_MIN(4, 3, GetObjectLabel); +// GL_FUNC_MIN(4, 3, ObjectPtrLabel); +// GL_FUNC_MIN(4, 3, GetObjectPtrLabel); +// GL_FUNC_MIN(4, 3, ClearBufferData); +// GL_FUNC_MIN(4, 3, ClearBufferSubData); +// GL_FUNC_MIN(4, 3, ClearNamedBufferDataEXT); +// GL_FUNC_MIN(4, 3, ClearNamedBufferSubDataEXT); +// GL_FUNC_MIN(4, 3, DispatchCompute); +// GL_FUNC_MIN(4, 3, DispatchComputeIndirect); +// GL_FUNC_MIN(4, 3, CopyImageSubData); +// GL_FUNC_MIN(4, 3, TextureView); +// GL_FUNC_MIN(4, 3, BindVertexBuffer); +// GL_FUNC_MIN(4, 3, VertexAttribFormat); +// GL_FUNC_MIN(4, 3, VertexAttribIFormat); +// GL_FUNC_MIN(4, 3, VertexAttribLFormat); +// GL_FUNC_MIN(4, 3, VertexAttribBinding); +// GL_FUNC_MIN(4, 3, VertexBindingDivisor); +// GL_FUNC_MIN(4, 3, VertexArrayBindVertexBufferEXT); +// GL_FUNC_MIN(4, 3, VertexArrayVertexAttribFormatEXT); +// GL_FUNC_MIN(4, 3, VertexArrayVertexAttribIFormatEXT); +// GL_FUNC_MIN(4, 3, VertexArrayVertexAttribLFormatEXT); +// GL_FUNC_MIN(4, 3, VertexArrayVertexAttribBindingEXT); +// GL_FUNC_MIN(4, 3, VertexArrayVertexBindingDivisorEXT); +// GL_FUNC_MIN(4, 3, FramebufferParameteri); +// GL_FUNC_MIN(4, 3, GetFramebufferParameteriv); +// GL_FUNC_MIN(4, 3, NamedFramebufferParameteriEXT); +// GL_FUNC_MIN(4, 3, GetNamedFramebufferParameterivEXT); +// GL_FUNC_MIN(4, 3, GetInternalformati64v); + GL_FUNC_MIN(4, 3, InvalidateTexSubImage); + GL_FUNC_MIN(4, 3, InvalidateTexImage); + GL_FUNC_MIN(4, 3, InvalidateBufferSubData); + GL_FUNC_MIN(4, 3, InvalidateBufferData); + GL_FUNC_MIN(4, 3, InvalidateFramebuffer); + GL_FUNC_MIN(4, 3, InvalidateSubFramebuffer); +// GL_FUNC_MIN(4, 3, MultiDrawArraysIndirect); +// GL_FUNC_MIN(4, 3, MultiDrawElementsIndirect); +// GL_FUNC_MIN(4, 3, GetProgramInterfaceiv); +// GL_FUNC_MIN(4, 3, GetProgramResourceIndex); +// GL_FUNC_MIN(4, 3, GetProgramResourceName); +// GL_FUNC_MIN(4, 3, GetProgramResourceiv); +// GL_FUNC_MIN(4, 3, GetProgramResourceLocation); +// GL_FUNC_MIN(4, 3, GetProgramResourceLocationIndex); +// GL_FUNC_MIN(4, 3, ShaderStorageBlockBinding); +// GL_FUNC_MIN(4, 3, TexBufferRange); +// GL_FUNC_MIN(4, 3, TextureBufferRangeEXT); +// GL_FUNC_MIN(4, 3, TexStorage2DMultisample); +// GL_FUNC_MIN(4, 3, TexStorage3DMultisample); +// GL_FUNC_MIN(4, 3, TextureStorage2DMultisampleEXT); +// GL_FUNC_MIN(4, 3, TextureStorage3DMultisampleEXT); +} diff --git a/src/mesa/main/tests/dispatch_stubs.cpp b/src/mesa/main/tests/dispatch_stubs.cpp new file mode 100644 index 0000000000..0964a553ba --- /dev/null +++ b/src/mesa/main/tests/dispatch_stubs.cpp @@ -0,0 +1,127 @@ +/* + * Copyright © 2012 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#include <gtest/gtest.h> +#include <GL/gl.h> + +extern "C" { +#include "main/mfeatures.h" +#include "main/mtypes.h" +#include "glapi/glapitable.h" +#include "main/dispatch.h" +} + +#if defined (GLX_USE_TLS) + +_GLAPI_EXPORT __thread struct _glapi_table * _glapi_tls_Dispatch + __attribute__((tls_model("initial-exec"))); + +_GLAPI_EXPORT __thread void * _glapi_tls_Context + __attribute__((tls_model("initial-exec"))); + +_GLAPI_EXPORT const struct _glapi_table *_glapi_Dispatch; +_GLAPI_EXPORT const void *_glapi_Context; + +#else + +_GLAPI_EXPORT struct _glapi_table *_glapi_Dispatch; +_GLAPI_EXPORT void *_glapi_Context; + +#endif /* defined (GLX_USE_TLS) */ + +extern "C" void +_glapi_destroy_multithread(void) +{ +} + +extern "C" void +_glapi_check_multithread(void) +{ +} + +extern "C" void +_glapi_set_context(void *context) +{ + (void) context; +} + +extern "C" void +_glapi_set_dispatch(struct _glapi_table *dispatch) +{ + (void) dispatch; +} + +#define TABLE_SIZE ((sizeof(struct _glapi_table) / sizeof(void *)) + 111) + +static char *function_map[TABLE_SIZE] = { + (char *) 0, +}; + +extern "C" int +_glapi_add_dispatch(const char *const *function_names, + const char *parameter_signature) +{ + (void) parameter_signature; + + unsigned i; + + for (i = 0; i < TABLE_SIZE && function_map[i] != NULL; i++) { + if (strcmp(function_map[i], function_names[0]) == 0) { + //printf("%s: %d\n", function_names[0], _gloffset_MultiTexCoord4svARB + i + 1); + return _gloffset_MultiTexCoord4svARB + i + 1; + } + } + + if (i == TABLE_SIZE) { + //printf("%s: %d\n", function_names[0], -1); + return -1; + } + + function_map[i] = strdup(function_names[0]); + //printf("%s: %d\n", function_names[0], _gloffset_MultiTexCoord4svARB + i + 1); + return _gloffset_MultiTexCoord4svARB + i + 1; +} + +extern "C" void * +_glapi_get_context(void) +{ + return (void *) _glapi_Context; +} + +extern "C" GLuint +_glapi_get_dispatch_table_size(void) +{ + return (sizeof(struct _glapi_table) / sizeof(void *)) + 111; +} + +extern "C" const char * +dispatch_stub_get_name(GLuint offset) +{ + int i = offset - _gloffset_MultiTexCoord4svARB - 1; + + if (i >= 0) { + return function_map[i]; + } else { + return "?"; + } +} + diff --git a/src/mesa/main/tests/enum_strings.cpp b/src/mesa/main/tests/enum_strings.cpp index 7d46080a60..b9def32bdb 100644 --- a/src/mesa/main/tests/enum_strings.cpp +++ b/src/mesa/main/tests/enum_strings.cpp @@ -28,17 +28,6 @@ extern "C" { #include "main/enums.h" } -/* Stub this out because the real Mesa implementation is tied into a - * bunch of the GL_ARB_debug infrastructure. This results in pulling - * in most of libmesa.a and a cacade of missing symbols, etc. - */ -extern "C" void -_mesa_warning( struct gl_context *ctx, const char *fmtString, ... ) -{ - (void) ctx; - (void) fmtString; -} - struct enum_info { int value; const char *name; diff --git a/src/mesa/main/tests/make_dispatch_gl_table.py b/src/mesa/main/tests/make_dispatch_gl_table.py new file mode 100644 index 0000000000..2397e4e4c4 --- /dev/null +++ b/src/mesa/main/tests/make_dispatch_gl_table.py @@ -0,0 +1,115 @@ +import os +import re +import sys + +def open_argv(idx): + try: + return open(sys.argv[idx], 'r') + except: + return None + +gl_header = open_argv(1) +mesa_dispatch_header = open_argv(2) + +if None in (gl_header, mesa_dispatch_header): + print 'Usage:', sys.argv[0], 'path/to/glcorearb.h src/mesa/main/dispatch.h' + sys.exit(1) + +re1 = re.compile('.+APIENTRY\ gl(\S+)\s+.+') +re2 = re.compile('#define\ _gloffset_(\S+)\s+.+') +re3 = re.compile('#define\ GL_VERSION_(\d+)_(\d+)\s+.+') + +def line_grep_pair(line, regex): + mo = regex.match(line) + if mo is not None: + return (True, mo) + else: + return (False, line) + +def re_grep_bool(file, regex): + if type(file) is str: + f = open(file) + else: + f = file + for line in f.readlines(): + yield line_grep_pair(line, regex) + f.close() + +def re_grep(file, regex): + for result in re_grep_bool(file, regex): + if result[0]: + yield result[1].group(1) + +def get_gl_core_funcs(): + major = 1 + minor = 0 + retval = [] + for result in re_grep_bool(gl_header, re1): + if result[0]: + retval.append((result[1].group(1), major, minor)) + else: + result = line_grep_pair(result[1], re3) + if result[0]: + major = int(result[1].group(1)) + minor = int(result[1].group(2)) + return retval + +def re_grep_to_list(filename, regex): + retval = [] + for line in re_grep(filename, regex): + retval.append(line) + return retval + +def gl_core_to_mesa(gl_funcs, mesa_funcs): + mesa_funcs = set(mesa_funcs) + retval = {} + for gl_func in gl_funcs: + gl_func = gl_func[0] + found = False + for suffix in ('', 'ARB', 'EXT', 'NV', 'ObjectARB'): + if gl_func + suffix in mesa_funcs: + retval[gl_func] = gl_func + suffix + found = True + break + if not found: + for trans in { + 'i': 'IndexedEXT', + 'i_v': 'IndexedvEXT', + }.iteritems(): + if gl_func.endswith(trans[0]): + try_func = gl_func[:-len(trans[0])] + trans[1] + if try_func in mesa_funcs: + retval[gl_func] = try_func + found = True + break + return retval + +gl_core_funcs = get_gl_core_funcs() +mesa_dispatch_funcs = re_grep_to_list(mesa_dispatch_header, re2) + +mesa_core_funcs = gl_core_to_mesa(gl_core_funcs, mesa_dispatch_funcs) + +maxFunctions = { + 'GetPointerv': (3, 1), +} + +for gl_func in gl_core_funcs: + if gl_func[0] in mesa_core_funcs: + line = ' ' + func = mesa_core_funcs[gl_func[0]] + else: + line = '// ' + func = gl_func[0] + minMajor, minMinor = gl_func[1], gl_func[2] + if func in maxFunctions: + majorMinor = maxFunctions[func] + maxMajor, maxMinor = majorMinor[0], majorMinor[1] + else: + maxMajor, maxMinor = None, None + hasMax = maxMajor is not None + line += 'GL_FUNC_MIN' + ('', 'MAX')[hasMax] + '(' + line += '%d, %d, ' % (minMajor, minMinor) + if hasMax: line += '%d, %d, ' % (maxMajor, maxMinor) + line += func + ');' + print line + diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 94a9855d98..f69417e7d7 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -27,6 +27,11 @@ #ifndef VERSION_H #define VERSION_H +#include "mtypes.h" + +#ifdef __cplusplus +extern "C" { +#endif struct gl_context; @@ -48,4 +53,35 @@ _mesa_compute_version(struct gl_context *ctx); extern void _mesa_override_glsl_version(struct gl_context *ctx); +/** + * Merge major/minor into a comparable uint + */ +static inline GLuint +_mesa_uint_version(int major, int minor) +{ + return major * 10 + minor; +} + +/** + * Sets the context version to major.minor + */ +static inline void +_mesa_set_version(struct gl_context *ctx, int major, int minor) +{ + ctx->Version = _mesa_uint_version(major, minor); +} + +/** + * Checks if the context version is greater than or equal to major.minor + */ +static inline GLboolean +_mesa_have_version(const struct gl_context *ctx, int major, int minor) +{ + return ctx->Version >= _mesa_uint_version(major, minor); +} + +#ifdef __cplusplus +} +#endif + #endif /* VERSION_H */ |