Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Last modification | View Log | RSS feed

  1. /*
  2.  * Copyright © 2012 Intel Corporation
  3.  *
  4.  * Permission is hereby granted, free of charge, to any person obtaining a
  5.  * copy of this software and associated documentation files (the "Software"),
  6.  * to deal in the Software without restriction, including without limitation
  7.  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8.  * and/or sell copies of the Software, and to permit persons to whom the
  9.  * Software is furnished to do so, subject to the following conditions:
  10.  *
  11.  * The above copyright notice and this permission notice (including the next
  12.  * paragraph) shall be included in all copies or substantial portions of the
  13.  * Software.
  14.  *
  15.  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16.  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17.  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  18.  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19.  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20.  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  21.  * DEALINGS IN THE SOFTWARE.
  22.  */
  23.  
  24. /**
  25.  * \name dispatch_sanity.cpp
  26.  *
  27.  * Verify that only set of functions that should be available in a particular
  28.  * API are available in that API.
  29.  *
  30.  * The list of expected functions originally came from the functions set by
  31.  * api_exec_es2.c.  This file no longer exists in Mesa (but api_exec_es1.c was
  32.  * still generated at the time this test was written).  It was the generated
  33.  * file that configured the dispatch table for ES2 contexts.  This test
  34.  * verifies that all of the functions set by the old api_exec_es2.c (with the
  35.  * recent addition of VAO functions) are set in the dispatch table and
  36.  * everything else is a NOP.
  37.  *
  38.  * When adding extensions that add new functions, this test will need to be
  39.  * modified to expect dispatch functions for the new extension functions.
  40.  */
  41.  
  42. #include <gtest/gtest.h>
  43.  
  44. extern "C" {
  45. #include "GL/gl.h"
  46. #include "GL/glext.h"
  47. #include "main/compiler.h"
  48. #include "main/api_exec.h"
  49. #include "main/context.h"
  50. #include "main/remap.h"
  51. #include "main/vtxfmt.h"
  52. #include "glapi/glapi.h"
  53. #include "drivers/common/driverfuncs.h"
  54.  
  55. #include "swrast/swrast.h"
  56. #include "vbo/vbo.h"
  57. #include "tnl/tnl.h"
  58. #include "swrast_setup/swrast_setup.h"
  59.  
  60. #ifndef GLAPIENTRYP
  61. #define GLAPIENTRYP GL_APIENTRYP
  62. #endif
  63.  
  64. #include "main/dispatch.h"
  65. }
  66.  
  67. struct function {
  68.    const char *name;
  69.    unsigned int Version;
  70.    int offset;
  71. };
  72.  
  73. extern const struct function gl_core_functions_possible[];
  74. extern const struct function gles11_functions_possible[];
  75. extern const struct function gles2_functions_possible[];
  76. extern const struct function gles3_functions_possible[];
  77.  
  78. class DispatchSanity_test : public ::testing::Test {
  79. public:
  80.    virtual void SetUp();
  81.    void SetUpCtx(gl_api api, unsigned int version);
  82.  
  83.    struct gl_config visual;
  84.    struct dd_function_table driver_functions;
  85.    struct gl_context share_list;
  86.    struct gl_context ctx;
  87. };
  88.  
  89. void
  90. DispatchSanity_test::SetUp()
  91. {
  92.    memset(&visual, 0, sizeof(visual));
  93.    memset(&driver_functions, 0, sizeof(driver_functions));
  94.    memset(&share_list, 0, sizeof(share_list));
  95.    memset(&ctx, 0, sizeof(ctx));
  96.  
  97.    _mesa_init_driver_functions(&driver_functions);
  98. }
  99.  
  100. void
  101. DispatchSanity_test::SetUpCtx(gl_api api, unsigned int version)
  102. {
  103.    _mesa_initialize_context(&ctx,
  104.                             api,
  105.                             &visual,
  106.                             NULL, // share_list
  107.                             &driver_functions);
  108.    _vbo_CreateContext(&ctx);
  109.  
  110.    ctx.Version = version;
  111.  
  112.    _mesa_initialize_dispatch_tables(&ctx);
  113.    _mesa_initialize_vbo_vtxfmt(&ctx);
  114. }
  115.  
  116. static const char *
  117. offset_to_proc_name_safe(unsigned offset)
  118. {
  119.    const char *name = _glapi_get_proc_name(offset);
  120.    return name ? name : "???";
  121. }
  122.  
  123. /* Scan through the dispatch table and check that all the functions in
  124.  * _glapi_proc *table exist. When found, set their pointers in the table
  125.  * to _mesa_generic_nop.  */
  126. static void
  127. validate_functions(struct gl_context *ctx, const struct function *function_table)
  128. {
  129.    _glapi_proc *table = (_glapi_proc *) ctx->Exec;
  130.  
  131.    for (unsigned i = 0; function_table[i].name != NULL; i++) {
  132.       /* The context version is >= the GL version where the
  133.          function was introduced. Therefore, the function cannot
  134.          be set to the nop function.
  135.        */
  136.       bool cant_be_nop = ctx->Version >= function_table[i].Version;
  137.  
  138.       const int offset = (function_table[i].offset != -1)
  139.          ? function_table[i].offset
  140.          : _glapi_get_proc_offset(function_table[i].name);
  141.  
  142.       ASSERT_NE(-1, offset)
  143.          << "Function: " << function_table[i].name;
  144.       ASSERT_EQ(offset,
  145.                 _glapi_get_proc_offset(function_table[i].name))
  146.          << "Function: " << function_table[i].name;
  147.       if (cant_be_nop) {
  148.          EXPECT_NE((_glapi_proc) _mesa_generic_nop, table[offset])
  149.             << "Function: " << function_table[i].name
  150.             << " at offset " << offset;
  151.       }
  152.  
  153.       table[offset] = (_glapi_proc) _mesa_generic_nop;
  154.    }
  155. }
  156.  
  157. /* Scan through the table and ensure that there is nothing except
  158.  * _mesa_generic_nop (as set by validate_functions().  */
  159. static void
  160. validate_nops(struct gl_context *ctx)
  161. {
  162.    _glapi_proc *table = (_glapi_proc *) ctx->Exec;
  163.  
  164.    const unsigned size = _glapi_get_dispatch_table_size();
  165.    for (unsigned i = 0; i < size; i++) {
  166.       EXPECT_EQ((_glapi_proc) _mesa_generic_nop, table[i])
  167.          << "i = " << i << " (" << offset_to_proc_name_safe(i) << ")";
  168.    }
  169. }
  170.  
  171. TEST_F(DispatchSanity_test, GL31_CORE)
  172. {
  173.    SetUpCtx(API_OPENGL_CORE, 31);
  174.    validate_functions(&ctx, gl_core_functions_possible);
  175.    validate_nops(&ctx);
  176. }
  177.  
  178. TEST_F(DispatchSanity_test, GLES11)
  179. {
  180.    SetUpCtx(API_OPENGLES, 11);
  181.    validate_functions(&ctx, gles11_functions_possible);
  182.    validate_nops(&ctx);
  183. }
  184.  
  185. TEST_F(DispatchSanity_test, GLES2)
  186. {
  187.    SetUpCtx(API_OPENGLES2, 20);
  188.    validate_functions(&ctx, gles2_functions_possible);
  189.    validate_nops(&ctx);
  190. }
  191.  
  192. TEST_F(DispatchSanity_test, GLES3)
  193. {
  194.    SetUpCtx(API_OPENGLES2, 30);
  195.    validate_functions(&ctx, gles2_functions_possible);
  196.    validate_functions(&ctx, gles3_functions_possible);
  197.    validate_nops(&ctx);
  198. }
  199.  
  200. const struct function gl_core_functions_possible[] = {
  201.    { "glCullFace", 10, -1 },
  202.    { "glFrontFace", 10, -1 },
  203.    { "glHint", 10, -1 },
  204.    { "glLineWidth", 10, -1 },
  205.    { "glPointSize", 10, -1 },
  206.    { "glPolygonMode", 10, -1 },
  207.    { "glScissor", 10, -1 },
  208.    { "glTexParameterf", 10, -1 },
  209.    { "glTexParameterfv", 10, -1 },
  210.    { "glTexParameteri", 10, -1 },
  211.    { "glTexParameteriv", 10, -1 },
  212.    { "glTexImage1D", 10, -1 },
  213.    { "glTexImage2D", 10, -1 },
  214.    { "glDrawBuffer", 10, -1 },
  215.    { "glClear", 10, -1 },
  216.    { "glClearColor", 10, -1 },
  217.    { "glClearStencil", 10, -1 },
  218.    { "glClearDepth", 10, -1 },
  219.    { "glStencilMask", 10, -1 },
  220.    { "glColorMask", 10, -1 },
  221.    { "glDepthMask", 10, -1 },
  222.    { "glDisable", 10, -1 },
  223.    { "glEnable", 10, -1 },
  224.    { "glFinish", 10, -1 },
  225.    { "glFlush", 10, -1 },
  226.    { "glBlendFunc", 10, -1 },
  227.    { "glLogicOp", 10, -1 },
  228.    { "glStencilFunc", 10, -1 },
  229.    { "glStencilOp", 10, -1 },
  230.    { "glDepthFunc", 10, -1 },
  231.    { "glPixelStoref", 10, -1 },
  232.    { "glPixelStorei", 10, -1 },
  233.    { "glReadBuffer", 10, -1 },
  234.    { "glReadPixels", 10, -1 },
  235.    { "glGetBooleanv", 10, -1 },
  236.    { "glGetDoublev", 10, -1 },
  237.    { "glGetError", 10, -1 },
  238.    { "glGetFloatv", 10, -1 },
  239.    { "glGetIntegerv", 10, -1 },
  240.    { "glGetString", 10, -1 },
  241.    { "glGetTexImage", 10, -1 },
  242.    { "glGetTexParameterfv", 10, -1 },
  243.    { "glGetTexParameteriv", 10, -1 },
  244.    { "glGetTexLevelParameterfv", 10, -1 },
  245.    { "glGetTexLevelParameteriv", 10, -1 },
  246.    { "glIsEnabled", 10, -1 },
  247.    { "glDepthRange", 10, -1 },
  248.    { "glViewport", 10, -1 },
  249.  
  250.    /* GL 1.1 */
  251.    { "glDrawArrays", 11, -1 },
  252.    { "glDrawElements", 11, -1 },
  253.    { "glGetPointerv", 11, -1 },
  254.    { "glPolygonOffset", 11, -1 },
  255.    { "glCopyTexImage1D", 11, -1 },
  256.    { "glCopyTexImage2D", 11, -1 },
  257.    { "glCopyTexSubImage1D", 11, -1 },
  258.    { "glCopyTexSubImage2D", 11, -1 },
  259.    { "glTexSubImage1D", 11, -1 },
  260.    { "glTexSubImage2D", 11, -1 },
  261.    { "glBindTexture", 11, -1 },
  262.    { "glDeleteTextures", 11, -1 },
  263.    { "glGenTextures", 11, -1 },
  264.    { "glIsTexture", 11, -1 },
  265.  
  266.    /* GL 1.2 */
  267.    { "glBlendColor", 12, -1 },
  268.    { "glBlendEquation", 12, -1 },
  269.    { "glDrawRangeElements", 12, -1 },
  270.    { "glTexImage3D", 12, -1 },
  271.    { "glTexSubImage3D", 12, -1 },
  272.    { "glCopyTexSubImage3D", 12, -1 },
  273.  
  274.    /* GL 1.3 */
  275.    { "glActiveTexture", 13, -1 },
  276.    { "glSampleCoverage", 13, -1 },
  277.    { "glCompressedTexImage3D", 13, -1 },
  278.    { "glCompressedTexImage2D", 13, -1 },
  279.    { "glCompressedTexImage1D", 13, -1 },
  280.    { "glCompressedTexSubImage3D", 13, -1 },
  281.    { "glCompressedTexSubImage2D", 13, -1 },
  282.    { "glCompressedTexSubImage1D", 13, -1 },
  283.    { "glGetCompressedTexImage", 13, -1 },
  284.  
  285.    /* GL 1.4 */
  286.    { "glBlendFuncSeparate", 14, -1 },
  287.    { "glMultiDrawArrays", 14, -1 },
  288.    { "glMultiDrawElements", 14, -1 },
  289.    { "glPointParameterf", 14, -1 },
  290.    { "glPointParameterfv", 14, -1 },
  291.    { "glPointParameteri", 14, -1 },
  292.    { "glPointParameteriv", 14, -1 },
  293.  
  294.    /* GL 1.5 */
  295.    { "glGenQueries", 15, -1 },
  296.    { "glDeleteQueries", 15, -1 },
  297.    { "glIsQuery", 15, -1 },
  298.    { "glBeginQuery", 15, -1 },
  299.    { "glEndQuery", 15, -1 },
  300.    { "glGetQueryiv", 15, -1 },
  301.    { "glGetQueryObjectiv", 15, -1 },
  302.    { "glGetQueryObjectuiv", 15, -1 },
  303.    { "glBindBuffer", 15, -1 },
  304.    { "glDeleteBuffers", 15, -1 },
  305.    { "glGenBuffers", 15, -1 },
  306.    { "glIsBuffer", 15, -1 },
  307.    { "glBufferData", 15, -1 },
  308.    { "glBufferSubData", 15, -1 },
  309.    { "glGetBufferSubData", 15, -1 },
  310.    { "glMapBuffer", 15, -1 },
  311.    { "glUnmapBuffer", 15, -1 },
  312.    { "glGetBufferParameteriv", 15, -1 },
  313.    { "glGetBufferPointerv", 15, -1 },
  314.  
  315.    /* GL 2.0 */
  316.    { "glBlendEquationSeparate", 20, -1 },
  317.    { "glDrawBuffers", 20, -1 },
  318.    { "glStencilOpSeparate", 20, -1 },
  319.    { "glStencilFuncSeparate", 20, -1 },
  320.    { "glStencilMaskSeparate", 20, -1 },
  321.    { "glAttachShader", 20, -1 },
  322.    { "glBindAttribLocation", 20, -1 },
  323.    { "glCompileShader", 20, -1 },
  324.    { "glCreateProgram", 20, -1 },
  325.    { "glCreateShader", 20, -1 },
  326.    { "glDeleteProgram", 20, -1 },
  327.    { "glDeleteShader", 20, -1 },
  328.    { "glDetachShader", 20, -1 },
  329.    { "glDisableVertexAttribArray", 20, -1 },
  330.    { "glEnableVertexAttribArray", 20, -1 },
  331.    { "glGetActiveAttrib", 20, -1 },
  332.    { "glGetActiveUniform", 20, -1 },
  333.    { "glGetAttachedShaders", 20, -1 },
  334.    { "glGetAttribLocation", 20, -1 },
  335.    { "glGetProgramiv", 20, -1 },
  336.    { "glGetProgramInfoLog", 20, -1 },
  337.    { "glGetShaderiv", 20, -1 },
  338.    { "glGetShaderInfoLog", 20, -1 },
  339.    { "glGetShaderSource", 20, -1 },
  340.    { "glGetUniformLocation", 20, -1 },
  341.    { "glGetUniformfv", 20, -1 },
  342.    { "glGetUniformiv", 20, -1 },
  343.    { "glGetVertexAttribdv", 20, -1 },
  344.    { "glGetVertexAttribfv", 20, -1 },
  345.    { "glGetVertexAttribiv", 20, -1 },
  346.    { "glGetVertexAttribPointerv", 20, -1 },
  347.    { "glIsProgram", 20, -1 },
  348.    { "glIsShader", 20, -1 },
  349.    { "glLinkProgram", 20, -1 },
  350.    { "glShaderSource", 20, -1 },
  351.    { "glUseProgram", 20, -1 },
  352.    { "glUniform1f", 20, -1 },
  353.    { "glUniform2f", 20, -1 },
  354.    { "glUniform3f", 20, -1 },
  355.    { "glUniform4f", 20, -1 },
  356.    { "glUniform1i", 20, -1 },
  357.    { "glUniform2i", 20, -1 },
  358.    { "glUniform3i", 20, -1 },
  359.    { "glUniform4i", 20, -1 },
  360.    { "glUniform1fv", 20, -1 },
  361.    { "glUniform2fv", 20, -1 },
  362.    { "glUniform3fv", 20, -1 },
  363.    { "glUniform4fv", 20, -1 },
  364.    { "glUniform1iv", 20, -1 },
  365.    { "glUniform2iv", 20, -1 },
  366.    { "glUniform3iv", 20, -1 },
  367.    { "glUniform4iv", 20, -1 },
  368.    { "glUniformMatrix2fv", 20, -1 },
  369.    { "glUniformMatrix3fv", 20, -1 },
  370.    { "glUniformMatrix4fv", 20, -1 },
  371.    { "glValidateProgram", 20, -1 },
  372.    { "glVertexAttrib1d", 20, -1 },
  373.    { "glVertexAttrib1dv", 20, -1 },
  374.    { "glVertexAttrib1f", 20, -1 },
  375.    { "glVertexAttrib1fv", 20, -1 },
  376.    { "glVertexAttrib1s", 20, -1 },
  377.    { "glVertexAttrib1sv", 20, -1 },
  378.    { "glVertexAttrib2d", 20, -1 },
  379.    { "glVertexAttrib2dv", 20, -1 },
  380.    { "glVertexAttrib2f", 20, -1 },
  381.    { "glVertexAttrib2fv", 20, -1 },
  382.    { "glVertexAttrib2s", 20, -1 },
  383.    { "glVertexAttrib2sv", 20, -1 },
  384.    { "glVertexAttrib3d", 20, -1 },
  385.    { "glVertexAttrib3dv", 20, -1 },
  386.    { "glVertexAttrib3f", 20, -1 },
  387.    { "glVertexAttrib3fv", 20, -1 },
  388.    { "glVertexAttrib3s", 20, -1 },
  389.    { "glVertexAttrib3sv", 20, -1 },
  390.    { "glVertexAttrib4Nbv", 20, -1 },
  391.    { "glVertexAttrib4Niv", 20, -1 },
  392.    { "glVertexAttrib4Nsv", 20, -1 },
  393.    { "glVertexAttrib4Nub", 20, -1 },
  394.    { "glVertexAttrib4Nubv", 20, -1 },
  395.    { "glVertexAttrib4Nuiv", 20, -1 },
  396.    { "glVertexAttrib4Nusv", 20, -1 },
  397.    { "glVertexAttrib4bv", 20, -1 },
  398.    { "glVertexAttrib4d", 20, -1 },
  399.    { "glVertexAttrib4dv", 20, -1 },
  400.    { "glVertexAttrib4f", 20, -1 },
  401.    { "glVertexAttrib4fv", 20, -1 },
  402.    { "glVertexAttrib4iv", 20, -1 },
  403.    { "glVertexAttrib4s", 20, -1 },
  404.    { "glVertexAttrib4sv", 20, -1 },
  405.    { "glVertexAttrib4ubv", 20, -1 },
  406.    { "glVertexAttrib4uiv", 20, -1 },
  407.    { "glVertexAttrib4usv", 20, -1 },
  408.    { "glVertexAttribPointer", 20, -1 },
  409.  
  410.    /* GL 2.1 */
  411.    { "glUniformMatrix2x3fv", 21, -1 },
  412.    { "glUniformMatrix3x2fv", 21, -1 },
  413.    { "glUniformMatrix2x4fv", 21, -1 },
  414.    { "glUniformMatrix4x2fv", 21, -1 },
  415.    { "glUniformMatrix3x4fv", 21, -1 },
  416.    { "glUniformMatrix4x3fv", 21, -1 },
  417.  
  418.    /* GL 3.0 */
  419.    { "glColorMaski", 30, -1 },
  420.    { "glGetBooleani_v", 30, -1 },
  421.    { "glGetIntegeri_v", 30, -1 },
  422.    { "glEnablei", 30, -1 },
  423.    { "glDisablei", 30, -1 },
  424.    { "glIsEnabledi", 30, -1 },
  425.    { "glBeginTransformFeedback", 30, -1 },
  426.    { "glEndTransformFeedback", 30, -1 },
  427.    { "glBindBufferRange", 30, -1 },
  428.    { "glBindBufferBase", 30, -1 },
  429.    { "glTransformFeedbackVaryings", 30, -1 },
  430.    { "glGetTransformFeedbackVarying", 30, -1 },
  431.    { "glClampColor", 30, -1 },
  432.    { "glBeginConditionalRender", 30, -1 },
  433.    { "glEndConditionalRender", 30, -1 },
  434.    { "glVertexAttribIPointer", 30, -1 },
  435.    { "glGetVertexAttribIiv", 30, -1 },
  436.    { "glGetVertexAttribIuiv", 30, -1 },
  437.    { "glVertexAttribI1i", 30, -1 },
  438.    { "glVertexAttribI2i", 30, -1 },
  439.    { "glVertexAttribI3i", 30, -1 },
  440.    { "glVertexAttribI4i", 30, -1 },
  441.    { "glVertexAttribI1ui", 30, -1 },
  442.    { "glVertexAttribI2ui", 30, -1 },
  443.    { "glVertexAttribI3ui", 30, -1 },
  444.    { "glVertexAttribI4ui", 30, -1 },
  445.    { "glVertexAttribI1iv", 30, -1 },
  446.    { "glVertexAttribI2iv", 30, -1 },
  447.    { "glVertexAttribI3iv", 30, -1 },
  448.    { "glVertexAttribI4iv", 30, -1 },
  449.    { "glVertexAttribI1uiv", 30, -1 },
  450.    { "glVertexAttribI2uiv", 30, -1 },
  451.    { "glVertexAttribI3uiv", 30, -1 },
  452.    { "glVertexAttribI4uiv", 30, -1 },
  453.    { "glVertexAttribI4bv", 30, -1 },
  454.    { "glVertexAttribI4sv", 30, -1 },
  455.    { "glVertexAttribI4ubv", 30, -1 },
  456.    { "glVertexAttribI4usv", 30, -1 },
  457.    { "glGetUniformuiv", 30, -1 },
  458.    { "glBindFragDataLocation", 30, -1 },
  459.    { "glGetFragDataLocation", 30, -1 },
  460.    { "glUniform1ui", 30, -1 },
  461.    { "glUniform2ui", 30, -1 },
  462.    { "glUniform3ui", 30, -1 },
  463.    { "glUniform4ui", 30, -1 },
  464.    { "glUniform1uiv", 30, -1 },
  465.    { "glUniform2uiv", 30, -1 },
  466.    { "glUniform3uiv", 30, -1 },
  467.    { "glUniform4uiv", 30, -1 },
  468.    { "glTexParameterIiv", 30, -1 },
  469.    { "glTexParameterIuiv", 30, -1 },
  470.    { "glGetTexParameterIiv", 30, -1 },
  471.    { "glGetTexParameterIuiv", 30, -1 },
  472.    { "glClearBufferiv", 30, -1 },
  473.    { "glClearBufferuiv", 30, -1 },
  474.    { "glClearBufferfv", 30, -1 },
  475.    { "glClearBufferfi", 30, -1 },
  476.    { "glGetStringi", 30, -1 },
  477.  
  478.    /* GL 3.1 */
  479.    { "glDrawArraysInstanced", 31, -1 },
  480.    { "glDrawElementsInstanced", 31, -1 },
  481.    { "glTexBuffer", 31, -1 },
  482.    { "glPrimitiveRestartIndex", 31, -1 },
  483.  
  484.    /* GL_ARB_shader_objects */
  485.    { "glDeleteObjectARB", 31, -1 },
  486.    { "glGetHandleARB", 31, -1 },
  487.    { "glDetachObjectARB", 31, -1 },
  488.    { "glCreateShaderObjectARB", 31, -1 },
  489.    { "glCreateProgramObjectARB", 31, -1 },
  490.    { "glAttachObjectARB", 31, -1 },
  491.    { "glGetObjectParameterfvARB", 31, -1 },
  492.    { "glGetObjectParameterivARB", 31, -1 },
  493.    { "glGetInfoLogARB", 31, -1 },
  494.    { "glGetAttachedObjectsARB", 31, -1 },
  495.  
  496.    /* GL_ARB_get_program_binary */
  497.    { "glGetProgramBinary", 30, -1 },
  498.    { "glProgramBinary", 30, -1 },
  499.    { "glProgramParameteri", 30, -1 },
  500.  
  501.    /* GL_EXT_transform_feedback */
  502.    { "glBindBufferOffsetEXT", 31, -1 },
  503.  
  504.    /* GL_IBM_multimode_draw_arrays */
  505.    { "glMultiModeDrawArraysIBM", 31, -1 },
  506.    { "glMultiModeDrawElementsIBM", 31, -1 },
  507.  
  508.    /* GL_EXT_depth_bounds_test */
  509.    { "glDepthBoundsEXT", 31, -1 },
  510.  
  511.    /* GL_apple_object_purgeable */
  512.    { "glObjectPurgeableAPPLE", 31, -1 },
  513.    { "glObjectUnpurgeableAPPLE", 31, -1 },
  514.    { "glGetObjectParameterivAPPLE", 31, -1 },
  515.  
  516.    /* GL_ARB_instanced_arrays */
  517.    { "glVertexAttribDivisorARB", 31, -1 },
  518.  
  519.    /* GL_NV_texture_barrier */
  520.    { "glTextureBarrierNV", 31, -1 },
  521.  
  522.    /* GL_EXT_texture_integer */
  523.    { "glClearColorIiEXT", 31, -1 },
  524.    { "glClearColorIuiEXT", 31, -1 },
  525.  
  526.    /* GL_OES_EGL_image */
  527.    { "glEGLImageTargetRenderbufferStorageOES", 31, -1 },
  528.    { "glEGLImageTargetTexture2DOES", 31, -1 },
  529.  
  530.    /* GL 3.2 */
  531.    { "glGetInteger64i_v", 32, -1 },
  532.    { "glGetBufferParameteri64v", 32, -1 },
  533.    { "glFramebufferTexture", 32, -1 },
  534.  
  535.    /* GL_ARB_geometry_shader4 */
  536.    { "glProgramParameteriARB", 32, -1 },
  537.    { "glFramebufferTextureARB", 32, -1 },
  538.    { "glFramebufferTextureLayerARB", 32, -1 },
  539.    { "glFramebufferTextureFaceARB", 32, -1 },
  540.  
  541.    /* GL 3.3 */
  542.    { "glVertexAttribDivisor", 33, -1 },
  543.  
  544.    /* GL 4.0 */
  545. // { "glMinSampleShading", 40, -1 },                    // XXX: Add to xml
  546. // { "glBlendEquationi", 40, -1 },                      // XXX: Add to xml
  547. // { "glBlendEquationSeparatei", 40, -1 },              // XXX: Add to xml
  548. // { "glBlendFunci", 40, -1 },                          // XXX: Add to xml
  549. // { "glBlendFuncSeparatei", 40, -1 },                  // XXX: Add to xml
  550.  
  551.    /* GL 4.3 */
  552.    { "glIsRenderbuffer", 43, -1 },
  553.    { "glBindRenderbuffer", 43, -1 },
  554.    { "glDeleteRenderbuffers", 43, -1 },
  555.    { "glGenRenderbuffers", 43, -1 },
  556.    { "glRenderbufferStorage", 43, -1 },
  557.    { "glGetRenderbufferParameteriv", 43, -1 },
  558.    { "glIsFramebuffer", 43, -1 },
  559.    { "glBindFramebuffer", 43, -1 },
  560.    { "glDeleteFramebuffers", 43, -1 },
  561.    { "glGenFramebuffers", 43, -1 },
  562.    { "glCheckFramebufferStatus", 43, -1 },
  563.    { "glFramebufferTexture1D", 43, -1 },
  564.    { "glFramebufferTexture2D", 43, -1 },
  565.    { "glFramebufferTexture3D", 43, -1 },
  566.    { "glFramebufferRenderbuffer", 43, -1 },
  567.    { "glGetFramebufferAttachmentParameteriv", 43, -1 },
  568.    { "glGenerateMipmap", 43, -1 },
  569.    { "glBlitFramebuffer", 43, -1 },
  570.    { "glRenderbufferStorageMultisample", 43, -1 },
  571.    { "glFramebufferTextureLayer", 43, -1 },
  572.    { "glMapBufferRange", 43, -1 },
  573.    { "glFlushMappedBufferRange", 43, -1 },
  574.    { "glBindVertexArray", 43, -1 },
  575.    { "glDeleteVertexArrays", 43, -1 },
  576.    { "glGenVertexArrays", 43, -1 },
  577.    { "glIsVertexArray", 43, -1 },
  578.    { "glGetUniformIndices", 43, -1 },
  579.    { "glGetActiveUniformsiv", 43, -1 },
  580.    { "glGetActiveUniformName", 43, -1 },
  581.    { "glGetUniformBlockIndex", 43, -1 },
  582.    { "glGetActiveUniformBlockiv", 43, -1 },
  583.    { "glGetActiveUniformBlockName", 43, -1 },
  584.    { "glUniformBlockBinding", 43, -1 },
  585.    { "glCopyBufferSubData", 43, -1 },
  586.    { "glDrawElementsBaseVertex", 43, -1 },
  587.    { "glDrawRangeElementsBaseVertex", 43, -1 },
  588.    { "glDrawElementsInstancedBaseVertex", 43, -1 },
  589.    { "glMultiDrawElementsBaseVertex", 43, -1 },
  590.    { "glProvokingVertex", 43, -1 },
  591.    { "glFenceSync", 43, -1 },
  592.    { "glIsSync", 43, -1 },
  593.    { "glDeleteSync", 43, -1 },
  594.    { "glClientWaitSync", 43, -1 },
  595.    { "glWaitSync", 43, -1 },
  596.    { "glGetInteger64v", 43, -1 },
  597.    { "glGetSynciv", 43, -1 },
  598.    { "glTexImage2DMultisample", 43, -1 },
  599.    { "glTexImage3DMultisample", 43, -1 },
  600.    { "glGetMultisamplefv", 43, -1 },
  601.    { "glSampleMaski", 43, -1 },
  602.    { "glBlendEquationiARB", 43, -1 },
  603.    { "glBlendEquationSeparateiARB", 43, -1 },
  604.    { "glBlendFunciARB", 43, -1 },
  605.    { "glBlendFuncSeparateiARB", 43, -1 },
  606. // { "glMinSampleShadingARB", 43, -1 },                 // XXX: Add to xml
  607. // { "glNamedStringARB", 43, -1 },                      // XXX: Add to xml
  608. // { "glDeleteNamedStringARB", 43, -1 },                // XXX: Add to xml
  609. // { "glCompileShaderIncludeARB", 43, -1 },             // XXX: Add to xml
  610. // { "glIsNamedStringARB", 43, -1 },                    // XXX: Add to xml
  611. // { "glGetNamedStringARB", 43, -1 },                   // XXX: Add to xml
  612. // { "glGetNamedStringivARB", 43, -1 },                 // XXX: Add to xml
  613.    { "glBindFragDataLocationIndexed", 43, -1 },
  614.    { "glGetFragDataIndex", 43, -1 },
  615.    { "glGenSamplers", 43, -1 },
  616.    { "glDeleteSamplers", 43, -1 },
  617.    { "glIsSampler", 43, -1 },
  618.    { "glBindSampler", 43, -1 },
  619.    { "glSamplerParameteri", 43, -1 },
  620.    { "glSamplerParameteriv", 43, -1 },
  621.    { "glSamplerParameterf", 43, -1 },
  622.    { "glSamplerParameterfv", 43, -1 },
  623.    { "glSamplerParameterIiv", 43, -1 },
  624.    { "glSamplerParameterIuiv", 43, -1 },
  625.    { "glGetSamplerParameteriv", 43, -1 },
  626.    { "glGetSamplerParameterIiv", 43, -1 },
  627.    { "glGetSamplerParameterfv", 43, -1 },
  628.    { "glGetSamplerParameterIuiv", 43, -1 },
  629.    { "glQueryCounter", 43, -1 },
  630.    { "glGetQueryObjecti64v", 43, -1 },
  631.    { "glGetQueryObjectui64v", 43, -1 },
  632.    { "glVertexP2ui", 43, -1 },
  633.    { "glVertexP2uiv", 43, -1 },
  634.    { "glVertexP3ui", 43, -1 },
  635.    { "glVertexP3uiv", 43, -1 },
  636.    { "glVertexP4ui", 43, -1 },
  637.    { "glVertexP4uiv", 43, -1 },
  638.    { "glTexCoordP1ui", 43, -1 },
  639.    { "glTexCoordP1uiv", 43, -1 },
  640.    { "glTexCoordP2ui", 43, -1 },
  641.    { "glTexCoordP2uiv", 43, -1 },
  642.    { "glTexCoordP3ui", 43, -1 },
  643.    { "glTexCoordP3uiv", 43, -1 },
  644.    { "glTexCoordP4ui", 43, -1 },
  645.    { "glTexCoordP4uiv", 43, -1 },
  646.    { "glMultiTexCoordP1ui", 43, -1 },
  647.    { "glMultiTexCoordP1uiv", 43, -1 },
  648.    { "glMultiTexCoordP2ui", 43, -1 },
  649.    { "glMultiTexCoordP2uiv", 43, -1 },
  650.    { "glMultiTexCoordP3ui", 43, -1 },
  651.    { "glMultiTexCoordP3uiv", 43, -1 },
  652.    { "glMultiTexCoordP4ui", 43, -1 },
  653.    { "glMultiTexCoordP4uiv", 43, -1 },
  654.    { "glNormalP3ui", 43, -1 },
  655.    { "glNormalP3uiv", 43, -1 },
  656.    { "glColorP3ui", 43, -1 },
  657.    { "glColorP3uiv", 43, -1 },
  658.    { "glColorP4ui", 43, -1 },
  659.    { "glColorP4uiv", 43, -1 },
  660.    { "glSecondaryColorP3ui", 43, -1 },
  661.    { "glSecondaryColorP3uiv", 43, -1 },
  662.    { "glVertexAttribP1ui", 43, -1 },
  663.    { "glVertexAttribP1uiv", 43, -1 },
  664.    { "glVertexAttribP2ui", 43, -1 },
  665.    { "glVertexAttribP2uiv", 43, -1 },
  666.    { "glVertexAttribP3ui", 43, -1 },
  667.    { "glVertexAttribP3uiv", 43, -1 },
  668.    { "glVertexAttribP4ui", 43, -1 },
  669.    { "glVertexAttribP4uiv", 43, -1 },
  670. // { "glDrawArraysIndirect", 43, -1 },                  // XXX: Add to xml
  671. // { "glDrawElementsIndirect", 43, -1 },                // XXX: Add to xml
  672. // { "glUniform1d", 43, -1 },                           // XXX: Add to xml
  673. // { "glUniform2d", 43, -1 },                           // XXX: Add to xml
  674. // { "glUniform3d", 43, -1 },                           // XXX: Add to xml
  675. // { "glUniform4d", 43, -1 },                           // XXX: Add to xml
  676. // { "glUniform1dv", 43, -1 },                          // XXX: Add to xml
  677. // { "glUniform2dv", 43, -1 },                          // XXX: Add to xml
  678. // { "glUniform3dv", 43, -1 },                          // XXX: Add to xml
  679. // { "glUniform4dv", 43, -1 },                          // XXX: Add to xml
  680. // { "glUniformMatrix2dv", 43, -1 },                    // XXX: Add to xml
  681. // { "glUniformMatrix3dv", 43, -1 },                    // XXX: Add to xml
  682. // { "glUniformMatrix4dv", 43, -1 },                    // XXX: Add to xml
  683. // { "glUniformMatrix2x3dv", 43, -1 },                  // XXX: Add to xml
  684. // { "glUniformMatrix2x4dv", 43, -1 },                  // XXX: Add to xml
  685. // { "glUniformMatrix3x2dv", 43, -1 },                  // XXX: Add to xml
  686. // { "glUniformMatrix3x4dv", 43, -1 },                  // XXX: Add to xml
  687. // { "glUniformMatrix4x2dv", 43, -1 },                  // XXX: Add to xml
  688. // { "glUniformMatrix4x3dv", 43, -1 },                  // XXX: Add to xml
  689. // { "glGetUniformdv", 43, -1 },                        // XXX: Add to xml
  690. // { "glGetSubroutineUniformLocation", 43, -1 },        // XXX: Add to xml
  691. // { "glGetSubroutineIndex", 43, -1 },                  // XXX: Add to xml
  692. // { "glGetActiveSubroutineUniformiv", 43, -1 },        // XXX: Add to xml
  693. // { "glGetActiveSubroutineUniformName", 43, -1 },      // XXX: Add to xml
  694. // { "glGetActiveSubroutineName", 43, -1 },             // XXX: Add to xml
  695. // { "glUniformSubroutinesuiv", 43, -1 },               // XXX: Add to xml
  696. // { "glGetUniformSubroutineuiv", 43, -1 },             // XXX: Add to xml
  697. // { "glGetProgramStageiv", 43, -1 },                   // XXX: Add to xml
  698. // { "glPatchParameteri", 43, -1 },                     // XXX: Add to xml
  699. // { "glPatchParameterfv", 43, -1 },                    // XXX: Add to xml
  700.    { "glBindTransformFeedback", 43, -1 },
  701.    { "glDeleteTransformFeedbacks", 43, -1 },
  702.    { "glGenTransformFeedbacks", 43, -1 },
  703.    { "glIsTransformFeedback", 43, -1 },
  704.    { "glPauseTransformFeedback", 43, -1 },
  705.    { "glResumeTransformFeedback", 43, -1 },
  706.    { "glDrawTransformFeedback", 43, -1 },
  707.    { "glDrawTransformFeedbackStream", 43, -1 },
  708.    { "glBeginQueryIndexed", 43, -1 },
  709.    { "glEndQueryIndexed", 43, -1 },
  710.    { "glGetQueryIndexediv", 43, -1 },
  711.    { "glReleaseShaderCompiler", 43, -1 },
  712.    { "glShaderBinary", 43, -1 },
  713.    { "glGetShaderPrecisionFormat", 43, -1 },
  714.    { "glDepthRangef", 43, -1 },
  715.    { "glClearDepthf", 43, -1 },
  716.    { "glGetProgramBinary", 43, -1 },
  717.    { "glProgramBinary", 43, -1 },
  718.    { "glProgramParameteri", 43, -1 },
  719. // { "glUseProgramStages", 43, -1 },                    // XXX: Add to xml
  720. // { "glActiveShaderProgram", 43, -1 },                 // XXX: Add to xml
  721. // { "glCreateShaderProgramv", 43, -1 },                // XXX: Add to xml
  722. // { "glBindProgramPipeline", 43, -1 },                 // XXX: Add to xml
  723. // { "glDeleteProgramPipelines", 43, -1 },              // XXX: Add to xml
  724. // { "glGenProgramPipelines", 43, -1 },                 // XXX: Add to xml
  725. // { "glIsProgramPipeline", 43, -1 },                   // XXX: Add to xml
  726. // { "glGetProgramPipelineiv", 43, -1 },                // XXX: Add to xml
  727. // { "glProgramUniform1i", 43, -1 },                    // XXX: Add to xml
  728. // { "glProgramUniform1iv", 43, -1 },                   // XXX: Add to xml
  729. // { "glProgramUniform1f", 43, -1 },                    // XXX: Add to xml
  730. // { "glProgramUniform1fv", 43, -1 },                   // XXX: Add to xml
  731. // { "glProgramUniform1d", 43, -1 },                    // XXX: Add to xml
  732. // { "glProgramUniform1dv", 43, -1 },                   // XXX: Add to xml
  733. // { "glProgramUniform1ui", 43, -1 },                   // XXX: Add to xml
  734. // { "glProgramUniform1uiv", 43, -1 },                  // XXX: Add to xml
  735. // { "glProgramUniform2i", 43, -1 },                    // XXX: Add to xml
  736. // { "glProgramUniform2iv", 43, -1 },                   // XXX: Add to xml
  737. // { "glProgramUniform2f", 43, -1 },                    // XXX: Add to xml
  738. // { "glProgramUniform2fv", 43, -1 },                   // XXX: Add to xml
  739. // { "glProgramUniform2d", 43, -1 },                    // XXX: Add to xml
  740. // { "glProgramUniform2dv", 43, -1 },                   // XXX: Add to xml
  741. // { "glProgramUniform2ui", 43, -1 },                   // XXX: Add to xml
  742. // { "glProgramUniform2uiv", 43, -1 },                  // XXX: Add to xml
  743. // { "glProgramUniform3i", 43, -1 },                    // XXX: Add to xml
  744. // { "glProgramUniform3iv", 43, -1 },                   // XXX: Add to xml
  745. // { "glProgramUniform3f", 43, -1 },                    // XXX: Add to xml
  746. // { "glProgramUniform3fv", 43, -1 },                   // XXX: Add to xml
  747. // { "glProgramUniform3d", 43, -1 },                    // XXX: Add to xml
  748. // { "glProgramUniform3dv", 43, -1 },                   // XXX: Add to xml
  749. // { "glProgramUniform3ui", 43, -1 },                   // XXX: Add to xml
  750. // { "glProgramUniform3uiv", 43, -1 },                  // XXX: Add to xml
  751. // { "glProgramUniform4i", 43, -1 },                    // XXX: Add to xml
  752. // { "glProgramUniform4iv", 43, -1 },                   // XXX: Add to xml
  753. // { "glProgramUniform4f", 43, -1 },                    // XXX: Add to xml
  754. // { "glProgramUniform4fv", 43, -1 },                   // XXX: Add to xml
  755. // { "glProgramUniform4d", 43, -1 },                    // XXX: Add to xml
  756. // { "glProgramUniform4dv", 43, -1 },                   // XXX: Add to xml
  757. // { "glProgramUniform4ui", 43, -1 },                   // XXX: Add to xml
  758. // { "glProgramUniform4uiv", 43, -1 },                  // XXX: Add to xml
  759. // { "glProgramUniformMatrix2fv", 43, -1 },             // XXX: Add to xml
  760. // { "glProgramUniformMatrix3fv", 43, -1 },             // XXX: Add to xml
  761. // { "glProgramUniformMatrix4fv", 43, -1 },             // XXX: Add to xml
  762. // { "glProgramUniformMatrix2dv", 43, -1 },             // XXX: Add to xml
  763. // { "glProgramUniformMatrix3dv", 43, -1 },             // XXX: Add to xml
  764. // { "glProgramUniformMatrix4dv", 43, -1 },             // XXX: Add to xml
  765. // { "glProgramUniformMatrix2x3fv", 43, -1 },           // XXX: Add to xml
  766. // { "glProgramUniformMatrix3x2fv", 43, -1 },           // XXX: Add to xml
  767. // { "glProgramUniformMatrix2x4fv", 43, -1 },           // XXX: Add to xml
  768. // { "glProgramUniformMatrix4x2fv", 43, -1 },           // XXX: Add to xml
  769. // { "glProgramUniformMatrix3x4fv", 43, -1 },           // XXX: Add to xml
  770. // { "glProgramUniformMatrix4x3fv", 43, -1 },           // XXX: Add to xml
  771. // { "glProgramUniformMatrix2x3dv", 43, -1 },           // XXX: Add to xml
  772. // { "glProgramUniformMatrix3x2dv", 43, -1 },           // XXX: Add to xml
  773. // { "glProgramUniformMatrix2x4dv", 43, -1 },           // XXX: Add to xml
  774. // { "glProgramUniformMatrix4x2dv", 43, -1 },           // XXX: Add to xml
  775. // { "glProgramUniformMatrix3x4dv", 43, -1 },           // XXX: Add to xml
  776. // { "glProgramUniformMatrix4x3dv", 43, -1 },           // XXX: Add to xml
  777. // { "glValidateProgramPipeline", 43, -1 },             // XXX: Add to xml
  778. // { "glGetProgramPipelineInfoLog", 43, -1 },           // XXX: Add to xml
  779. // { "glVertexAttribL1d", 43, -1 },                     // XXX: Add to xml
  780. // { "glVertexAttribL2d", 43, -1 },                     // XXX: Add to xml
  781. // { "glVertexAttribL3d", 43, -1 },                     // XXX: Add to xml
  782. // { "glVertexAttribL4d", 43, -1 },                     // XXX: Add to xml
  783. // { "glVertexAttribL1dv", 43, -1 },                    // XXX: Add to xml
  784. // { "glVertexAttribL2dv", 43, -1 },                    // XXX: Add to xml
  785. // { "glVertexAttribL3dv", 43, -1 },                    // XXX: Add to xml
  786. // { "glVertexAttribL4dv", 43, -1 },                    // XXX: Add to xml
  787. // { "glVertexAttribLPointer", 43, -1 },                // XXX: Add to xml
  788. // { "glGetVertexAttribLdv", 43, -1 },                  // XXX: Add to xml
  789. // { "glViewportArrayv", 43, -1 },                      // XXX: Add to xml
  790. // { "glViewportIndexedf", 43, -1 },                    // XXX: Add to xml
  791. // { "glViewportIndexedfv", 43, -1 },                   // XXX: Add to xml
  792. // { "glScissorArrayv", 43, -1 },                       // XXX: Add to xml
  793. // { "glScissorIndexed", 43, -1 },                      // XXX: Add to xml
  794. // { "glScissorIndexedv", 43, -1 },                     // XXX: Add to xml
  795. // { "glDepthRangeArrayv", 43, -1 },                    // XXX: Add to xml
  796. // { "glDepthRangeIndexed", 43, -1 },                   // XXX: Add to xml
  797. // { "glGetFloati_v", 43, -1 },                         // XXX: Add to xml
  798. // { "glGetDoublei_v", 43, -1 },                        // XXX: Add to xml
  799. // { "glCreateSyncFromCLeventARB", 43, -1 },            // XXX: Add to xml
  800.    { "glDebugMessageControlARB", 43, -1 },
  801.    { "glDebugMessageInsertARB", 43, -1 },
  802.    { "glDebugMessageCallbackARB", 43, -1 },
  803.    { "glGetDebugMessageLogARB", 43, -1 },
  804.    { "glGetGraphicsResetStatusARB", 43, -1 },
  805.    { "glGetnMapdvARB", 43, -1 },
  806.    { "glGetnMapfvARB", 43, -1 },
  807.    { "glGetnMapivARB", 43, -1 },
  808.    { "glGetnPixelMapfvARB", 43, -1 },
  809.    { "glGetnPixelMapuivARB", 43, -1 },
  810.    { "glGetnPixelMapusvARB", 43, -1 },
  811.    { "glGetnPolygonStippleARB", 43, -1 },
  812.    { "glGetnColorTableARB", 43, -1 },
  813.    { "glGetnConvolutionFilterARB", 43, -1 },
  814.    { "glGetnSeparableFilterARB", 43, -1 },
  815.    { "glGetnHistogramARB", 43, -1 },
  816.    { "glGetnMinmaxARB", 43, -1 },
  817.    { "glGetnTexImageARB", 43, -1 },
  818.    { "glReadnPixelsARB", 43, -1 },
  819.    { "glGetnCompressedTexImageARB", 43, -1 },
  820.    { "glGetnUniformfvARB", 43, -1 },
  821.    { "glGetnUniformivARB", 43, -1 },
  822.    { "glGetnUniformuivARB", 43, -1 },
  823.    { "glGetnUniformdvARB", 43, -1 },
  824.    { "glDrawArraysInstancedBaseInstance", 43, -1 },
  825.    { "glDrawElementsInstancedBaseInstance", 43, -1 },
  826.    { "glDrawElementsInstancedBaseVertexBaseInstance", 43, -1 },
  827.    { "glDrawTransformFeedbackInstanced", 43, -1 },
  828.    { "glDrawTransformFeedbackStreamInstanced", 43, -1 },
  829. // { "glGetInternalformativ", 43, -1 },                 // XXX: Add to xml
  830. // { "glGetActiveAtomicCounterBufferiv", 43, -1 },      // XXX: Add to xml
  831. // { "glBindImageTexture", 43, -1 },                    // XXX: Add to xml
  832. // { "glMemoryBarrier", 43, -1 },                       // XXX: Add to xml
  833.    { "glTexStorage1D", 43, -1 },
  834.    { "glTexStorage2D", 43, -1 },
  835.    { "glTexStorage3D", 43, -1 },
  836.    { "glTextureStorage1DEXT", 43, -1 },
  837.    { "glTextureStorage2DEXT", 43, -1 },
  838.    { "glTextureStorage3DEXT", 43, -1 },
  839. // { "glDebugMessageControl", 43, -1 },                 // XXX: Add to xml
  840. // { "glDebugMessageInsert", 43, -1 },                  // XXX: Add to xml
  841. // { "glDebugMessageCallback", 43, -1 },                // XXX: Add to xml
  842. // { "glGetDebugMessageLog", 43, -1 },                  // XXX: Add to xml
  843. // { "glPushDebugGroup", 43, -1 },                      // XXX: Add to xml
  844. // { "glPopDebugGroup", 43, -1 },                       // XXX: Add to xml
  845. // { "glObjectLabel", 43, -1 },                         // XXX: Add to xml
  846. // { "glGetObjectLabel", 43, -1 },                      // XXX: Add to xml
  847. // { "glObjectPtrLabel", 43, -1 },                      // XXX: Add to xml
  848. // { "glGetObjectPtrLabel", 43, -1 },                   // XXX: Add to xml
  849. // { "glClearBufferData", 43, -1 },                     // XXX: Add to xml
  850. // { "glClearBufferSubData", 43, -1 },                  // XXX: Add to xml
  851. // { "glClearNamedBufferDataEXT", 43, -1 },             // XXX: Add to xml
  852. // { "glClearNamedBufferSubDataEXT", 43, -1 },          // XXX: Add to xml
  853. // { "glDispatchCompute", 43, -1 },                     // XXX: Add to xml
  854. // { "glDispatchComputeIndirect", 43, -1 },             // XXX: Add to xml
  855. // { "glCopyImageSubData", 43, -1 },                    // XXX: Add to xml
  856. // { "glTextureView", 43, -1 },                         // XXX: Add to xml
  857. // { "glBindVertexBuffer", 43, -1 },                    // XXX: Add to xml
  858. // { "glVertexAttribFormat", 43, -1 },                  // XXX: Add to xml
  859. // { "glVertexAttribIFormat", 43, -1 },                 // XXX: Add to xml
  860. // { "glVertexAttribLFormat", 43, -1 },                 // XXX: Add to xml
  861. // { "glVertexAttribBinding", 43, -1 },                 // XXX: Add to xml
  862. // { "glVertexBindingDivisor", 43, -1 },                // XXX: Add to xml
  863. // { "glVertexArrayBindVertexBufferEXT", 43, -1 },      // XXX: Add to xml
  864. // { "glVertexArrayVertexAttribFormatEXT", 43, -1 },    // XXX: Add to xml
  865. // { "glVertexArrayVertexAttribIFormatEXT", 43, -1 },   // XXX: Add to xml
  866. // { "glVertexArrayVertexAttribLFormatEXT", 43, -1 },   // XXX: Add to xml
  867. // { "glVertexArrayVertexAttribBindingEXT", 43, -1 },   // XXX: Add to xml
  868. // { "glVertexArrayVertexBindingDivisorEXT", 43, -1 },  // XXX: Add to xml
  869. // { "glFramebufferParameteri", 43, -1 },               // XXX: Add to xml
  870. // { "glGetFramebufferParameteriv", 43, -1 },           // XXX: Add to xml
  871. // { "glNamedFramebufferParameteriEXT", 43, -1 },       // XXX: Add to xml
  872. // { "glGetNamedFramebufferParameterivEXT", 43, -1 },   // XXX: Add to xml
  873. // { "glGetInternalformati64v", 43, -1 },               // XXX: Add to xml
  874.    { "glInvalidateTexSubImage", 43, -1 },
  875.    { "glInvalidateTexImage", 43, -1 },
  876.    { "glInvalidateBufferSubData", 43, -1 },
  877.    { "glInvalidateBufferData", 43, -1 },
  878.    { "glInvalidateFramebuffer", 43, -1 },
  879.    { "glInvalidateSubFramebuffer", 43, -1 },
  880. // { "glMultiDrawArraysIndirect", 43, -1 },             // XXX: Add to xml
  881. // { "glMultiDrawElementsIndirect", 43, -1 },           // XXX: Add to xml
  882. // { "glGetProgramInterfaceiv", 43, -1 },               // XXX: Add to xml
  883. // { "glGetProgramResourceIndex", 43, -1 },             // XXX: Add to xml
  884. // { "glGetProgramResourceName", 43, -1 },              // XXX: Add to xml
  885. // { "glGetProgramResourceiv", 43, -1 },                // XXX: Add to xml
  886. // { "glGetProgramResourceLocation", 43, -1 },          // XXX: Add to xml
  887. // { "glGetProgramResourceLocationIndex", 43, -1 },     // XXX: Add to xml
  888. // { "glShaderStorageBlockBinding", 43, -1 },           // XXX: Add to xml
  889.    { "glTexBufferRange", 43, -1 },
  890. // { "glTextureBufferRangeEXT", 43, -1 },               // XXX: Add to xml
  891.    { "glTexStorage2DMultisample", 43, -1 },
  892.    { "glTexStorage3DMultisample", 43, -1 },
  893. // { "glTextureStorage2DMultisampleEXT", 43, -1 },      // XXX: Add to xml
  894. // { "glTextureStorage3DMultisampleEXT", 43, -1 },      // XXX: Add to xml
  895.  
  896.    /* GL_ARB_internalformat_query */
  897.    { "glGetInternalformativ", 30, -1 },
  898.  
  899.    { NULL, 0, -1 }
  900. };
  901.  
  902. const struct function gles11_functions_possible[] = {
  903.    { "glActiveTexture", 11, _gloffset_ActiveTexture },
  904.    { "glAlphaFunc", 11, _gloffset_AlphaFunc },
  905.    { "glAlphaFuncx", 11, -1 },
  906.    { "glBindBuffer", 11, -1 },
  907.    { "glBindFramebufferOES", 11, -1 },
  908.    { "glBindRenderbufferOES", 11, -1 },
  909.    { "glBindTexture", 11, _gloffset_BindTexture },
  910.    { "glBlendEquationOES", 11, _gloffset_BlendEquation },
  911.    { "glBlendEquationSeparateOES", 11, -1 },
  912.    { "glBlendFunc", 11, _gloffset_BlendFunc },
  913.    { "glBlendFuncSeparateOES", 11, -1 },
  914.    { "glBufferData", 11, -1 },
  915.    { "glBufferSubData", 11, -1 },
  916.    { "glCheckFramebufferStatusOES", 11, -1 },
  917.    { "glClear", 11, _gloffset_Clear },
  918.    { "glClearColor", 11, _gloffset_ClearColor },
  919.    { "glClearColorx", 11, -1 },
  920.    { "glClearDepthf", 11, -1 },
  921.    { "glClearDepthx", 11, -1 },
  922.    { "glClearStencil", 11, _gloffset_ClearStencil },
  923.    { "glClientActiveTexture", 11, _gloffset_ClientActiveTexture },
  924.    { "glClipPlanef", 11, -1 },
  925.    { "glClipPlanex", 11, -1 },
  926.    { "glColor4f", 11, _gloffset_Color4f },
  927.    { "glColor4ub", 11, _gloffset_Color4ub },
  928.    { "glColor4x", 11, -1 },
  929.    { "glColorMask", 11, _gloffset_ColorMask },
  930.    { "glColorPointer", 11, _gloffset_ColorPointer },
  931.    { "glCompressedTexImage2D", 11, -1 },
  932.    { "glCompressedTexSubImage2D", 11, -1 },
  933.    { "glCopyTexImage2D", 11, _gloffset_CopyTexImage2D },
  934.    { "glCopyTexSubImage2D", 11, _gloffset_CopyTexSubImage2D },
  935.    { "glCullFace", 11, _gloffset_CullFace },
  936.    { "glDeleteBuffers", 11, -1 },
  937.    { "glDeleteFramebuffersOES", 11, -1 },
  938.    { "glDeleteRenderbuffersOES", 11, -1 },
  939.    { "glDeleteTextures", 11, _gloffset_DeleteTextures },
  940.    { "glDepthFunc", 11, _gloffset_DepthFunc },
  941.    { "glDepthMask", 11, _gloffset_DepthMask },
  942.    { "glDepthRangef", 11, -1 },
  943.    { "glDepthRangex", 11, -1 },
  944.    { "glDisable", 11, _gloffset_Disable },
  945.    { "glDiscardFramebufferEXT", 11, -1 },
  946.    { "glDisableClientState", 11, _gloffset_DisableClientState },
  947.    { "glDrawArrays", 11, _gloffset_DrawArrays },
  948.    { "glDrawElements", 11, _gloffset_DrawElements },
  949.    { "glDrawTexfOES", 11, -1 },
  950.    { "glDrawTexfvOES", 11, -1 },
  951.    { "glDrawTexiOES", 11, -1 },
  952.    { "glDrawTexivOES", 11, -1 },
  953.    { "glDrawTexsOES", 11, -1 },
  954.    { "glDrawTexsvOES", 11, -1 },
  955.    { "glDrawTexxOES", 11, -1 },
  956.    { "glDrawTexxvOES", 11, -1 },
  957.    { "glEGLImageTargetRenderbufferStorageOES", 11, -1 },
  958.    { "glEGLImageTargetTexture2DOES", 11, -1 },
  959.    { "glEnable", 11, _gloffset_Enable },
  960.    { "glEnableClientState", 11, _gloffset_EnableClientState },
  961.    { "glFinish", 11, _gloffset_Finish },
  962.    { "glFlush", 11, _gloffset_Flush },
  963.    { "glFlushMappedBufferRangeEXT", 11, -1 },
  964.    { "glFogf", 11, _gloffset_Fogf },
  965.    { "glFogfv", 11, _gloffset_Fogfv },
  966.    { "glFogx", 11, -1 },
  967.    { "glFogxv", 11, -1 },
  968.    { "glFramebufferRenderbufferOES", 11, -1 },
  969.    { "glFramebufferTexture2DOES", 11, -1 },
  970.    { "glFrontFace", 11, _gloffset_FrontFace },
  971.    { "glFrustumf", 11, -1 },
  972.    { "glFrustumx", 11, -1 },
  973.    { "glGenBuffers", 11, -1 },
  974.    { "glGenFramebuffersOES", 11, -1 },
  975.    { "glGenRenderbuffersOES", 11, -1 },
  976.    { "glGenTextures", 11, _gloffset_GenTextures },
  977.    { "glGenerateMipmapOES", 11, -1 },
  978.    { "glGetBooleanv", 11, _gloffset_GetBooleanv },
  979.    { "glGetBufferParameteriv", 11, -1 },
  980.    { "glGetBufferPointervOES", 11, -1 },
  981.    { "glGetClipPlanef", 11, -1 },
  982.    { "glGetClipPlanex", 11, -1 },
  983.    { "glGetError", 11, _gloffset_GetError },
  984.    { "glGetFixedv", 11, -1 },
  985.    { "glGetFloatv", 11, _gloffset_GetFloatv },
  986.    { "glGetFramebufferAttachmentParameterivOES", 11, -1 },
  987.    { "glGetIntegerv", 11, _gloffset_GetIntegerv },
  988.    { "glGetLightfv", 11, _gloffset_GetLightfv },
  989.    { "glGetLightxv", 11, -1 },
  990.    { "glGetMaterialfv", 11, _gloffset_GetMaterialfv },
  991.    { "glGetMaterialxv", 11, -1 },
  992.    { "glGetPointerv", 11, _gloffset_GetPointerv },
  993.    { "glGetRenderbufferParameterivOES", 11, -1 },
  994.    { "glGetString", 11, _gloffset_GetString },
  995.    { "glGetTexEnvfv", 11, _gloffset_GetTexEnvfv },
  996.    { "glGetTexEnviv", 11, _gloffset_GetTexEnviv },
  997.    { "glGetTexEnvxv", 11, -1 },
  998.    { "glGetTexGenfvOES", 11, _gloffset_GetTexGenfv },
  999.    { "glGetTexGenivOES", 11, _gloffset_GetTexGeniv },
  1000.    { "glGetTexGenxvOES", 11, -1 },
  1001.    { "glGetTexParameterfv", 11, _gloffset_GetTexParameterfv },
  1002.    { "glGetTexParameteriv", 11, _gloffset_GetTexParameteriv },
  1003.    { "glGetTexParameterxv", 11, -1 },
  1004.    { "glHint", 11, _gloffset_Hint },
  1005.    { "glIsBuffer", 11, -1 },
  1006.    { "glIsEnabled", 11, _gloffset_IsEnabled },
  1007.    { "glIsFramebufferOES", 11, -1 },
  1008.    { "glIsRenderbufferOES", 11, -1 },
  1009.    { "glIsTexture", 11, _gloffset_IsTexture },
  1010.    { "glLightModelf", 11, _gloffset_LightModelf },
  1011.    { "glLightModelfv", 11, _gloffset_LightModelfv },
  1012.    { "glLightModelx", 11, -1 },
  1013.    { "glLightModelxv", 11, -1 },
  1014.    { "glLightf", 11, _gloffset_Lightf },
  1015.    { "glLightfv", 11, _gloffset_Lightfv },
  1016.    { "glLightx", 11, -1 },
  1017.    { "glLightxv", 11, -1 },
  1018.    { "glLineWidth", 11, _gloffset_LineWidth },
  1019.    { "glLineWidthx", 11, -1 },
  1020.    { "glLoadIdentity", 11, _gloffset_LoadIdentity },
  1021.    { "glLoadMatrixf", 11, _gloffset_LoadMatrixf },
  1022.    { "glLoadMatrixx", 11, -1 },
  1023.    { "glLogicOp", 11, _gloffset_LogicOp },
  1024.    { "glMapBufferOES", 11, -1 },
  1025.    { "glMapBufferRangeEXT", 11, -1 },
  1026.    { "glMaterialf", 11, _gloffset_Materialf },
  1027.    { "glMaterialfv", 11, _gloffset_Materialfv },
  1028.    { "glMaterialx", 11, -1 },
  1029.    { "glMaterialxv", 11, -1 },
  1030.    { "glMatrixMode", 11, _gloffset_MatrixMode },
  1031.    { "glMultMatrixf", 11, _gloffset_MultMatrixf },
  1032.    { "glMultMatrixx", 11, -1 },
  1033.    { "glMultiDrawArraysEXT", 11, -1 },
  1034.    { "glMultiDrawElementsEXT", 11, -1 },
  1035.    { "glMultiTexCoord4f", 11, _gloffset_MultiTexCoord4fARB },
  1036.    { "glMultiTexCoord4x", 11, -1 },
  1037.    { "glNormal3f", 11, _gloffset_Normal3f },
  1038.    { "glNormal3x", 11, -1 },
  1039.    { "glNormalPointer", 11, _gloffset_NormalPointer },
  1040.    { "glOrthof", 11, -1 },
  1041.    { "glOrthox", 11, -1 },
  1042.    { "glPixelStorei", 11, _gloffset_PixelStorei },
  1043.    { "glPointParameterf", 11, -1 },
  1044.    { "glPointParameterfv", 11, -1 },
  1045.    { "glPointParameterx", 11, -1 },
  1046.    { "glPointParameterxv", 11, -1 },
  1047.    { "glPointSize", 11, _gloffset_PointSize },
  1048.    { "glPointSizePointerOES", 11, -1 },
  1049.    { "glPointSizex", 11, -1 },
  1050.    { "glPolygonOffset", 11, _gloffset_PolygonOffset },
  1051.    { "glPolygonOffsetx", 11, -1 },
  1052.    { "glPopMatrix", 11, _gloffset_PopMatrix },
  1053.    { "glPushMatrix", 11, _gloffset_PushMatrix },
  1054.    { "glQueryMatrixxOES", 11, -1 },
  1055.    { "glReadPixels", 11, _gloffset_ReadPixels },
  1056.    { "glRenderbufferStorageOES", 11, -1 },
  1057.    { "glRotatef", 11, _gloffset_Rotatef },
  1058.    { "glRotatex", 11, -1 },
  1059.    { "glSampleCoverage", 11, -1 },
  1060.    { "glSampleCoveragex", 11, -1 },
  1061.    { "glScalef", 11, _gloffset_Scalef },
  1062.    { "glScalex", 11, -1 },
  1063.    { "glScissor", 11, _gloffset_Scissor },
  1064.    { "glShadeModel", 11, _gloffset_ShadeModel },
  1065.    { "glStencilFunc", 11, _gloffset_StencilFunc },
  1066.    { "glStencilMask", 11, _gloffset_StencilMask },
  1067.    { "glStencilOp", 11, _gloffset_StencilOp },
  1068.    { "glTexCoordPointer", 11, _gloffset_TexCoordPointer },
  1069.    { "glTexEnvf", 11, _gloffset_TexEnvf },
  1070.    { "glTexEnvfv", 11, _gloffset_TexEnvfv },
  1071.    { "glTexEnvi", 11, _gloffset_TexEnvi },
  1072.    { "glTexEnviv", 11, _gloffset_TexEnviv },
  1073.    { "glTexEnvx", 11, -1 },
  1074.    { "glTexEnvxv", 11, -1 },
  1075.    { "glTexGenfOES", 11, _gloffset_TexGenf },
  1076.    { "glTexGenfvOES", 11, _gloffset_TexGenfv },
  1077.    { "glTexGeniOES", 11, _gloffset_TexGeni },
  1078.    { "glTexGenivOES", 11, _gloffset_TexGeniv },
  1079.    { "glTexGenxOES", 11, -1 },
  1080.    { "glTexGenxvOES", 11, -1 },
  1081.    { "glTexImage2D", 11, _gloffset_TexImage2D },
  1082.    { "glTexParameterf", 11, _gloffset_TexParameterf },
  1083.    { "glTexParameterfv", 11, _gloffset_TexParameterfv },
  1084.    { "glTexParameteri", 11, _gloffset_TexParameteri },
  1085.    { "glTexParameteriv", 11, _gloffset_TexParameteriv },
  1086.    { "glTexParameterx", 11, -1 },
  1087.    { "glTexParameterxv", 11, -1 },
  1088.    { "glTexSubImage2D", 11, _gloffset_TexSubImage2D },
  1089.    { "glTranslatef", 11, _gloffset_Translatef },
  1090.    { "glTranslatex", 11, -1 },
  1091.    { "glUnmapBufferOES", 11, -1 },
  1092.    { "glVertexPointer", 11, _gloffset_VertexPointer },
  1093.    { "glViewport", 11, _gloffset_Viewport },
  1094.    { NULL, 0, -1 }
  1095. };
  1096.  
  1097. const struct function gles2_functions_possible[] = {
  1098.    { "glActiveTexture", 20, _gloffset_ActiveTexture },
  1099.    { "glAttachShader", 20, -1 },
  1100.    { "glBindAttribLocation", 20, -1 },
  1101.    { "glBindBuffer", 20, -1 },
  1102.    { "glBindFramebuffer", 20, -1 },
  1103.    { "glBindRenderbuffer", 20, -1 },
  1104.    { "glBindTexture", 20, _gloffset_BindTexture },
  1105.    { "glBindVertexArrayOES", 20, -1 },
  1106.    { "glBlendColor", 20, _gloffset_BlendColor },
  1107.    { "glBlendEquation", 20, _gloffset_BlendEquation },
  1108.    { "glBlendEquationSeparate", 20, -1 },
  1109.    { "glBlendFunc", 20, _gloffset_BlendFunc },
  1110.    { "glBlendFuncSeparate", 20, -1 },
  1111.    { "glBufferData", 20, -1 },
  1112.    { "glBufferSubData", 20, -1 },
  1113.    { "glCheckFramebufferStatus", 20, -1 },
  1114.    { "glClear", 20, _gloffset_Clear },
  1115.    { "glClearColor", 20, _gloffset_ClearColor },
  1116.    { "glClearDepthf", 20, -1 },
  1117.    { "glClearStencil", 20, _gloffset_ClearStencil },
  1118.    { "glColorMask", 20, _gloffset_ColorMask },
  1119.    { "glCompileShader", 20, -1 },
  1120.    { "glCompressedTexImage2D", 20, -1 },
  1121.    { "glCompressedTexImage3DOES", 20, -1 },
  1122.    { "glCompressedTexSubImage2D", 20, -1 },
  1123.    { "glCompressedTexSubImage3DOES", 20, -1 },
  1124.    { "glCopyTexImage2D", 20, _gloffset_CopyTexImage2D },
  1125.    { "glCopyTexSubImage2D", 20, _gloffset_CopyTexSubImage2D },
  1126.    { "glCopyTexSubImage3DOES", 20, _gloffset_CopyTexSubImage3D },
  1127.    { "glCreateProgram", 20, -1 },
  1128.    { "glCreateShader", 20, -1 },
  1129.    { "glCullFace", 20, _gloffset_CullFace },
  1130.    { "glDeleteBuffers", 20, -1 },
  1131.    { "glDeleteFramebuffers", 20, -1 },
  1132.    { "glDeleteProgram", 20, -1 },
  1133.    { "glDeleteRenderbuffers", 20, -1 },
  1134.    { "glDeleteShader", 20, -1 },
  1135.    { "glDeleteTextures", 20, _gloffset_DeleteTextures },
  1136.    { "glDeleteVertexArraysOES", 20, -1 },
  1137.    { "glDepthFunc", 20, _gloffset_DepthFunc },
  1138.    { "glDepthMask", 20, _gloffset_DepthMask },
  1139.    { "glDepthRangef", 20, -1 },
  1140.    { "glDetachShader", 20, -1 },
  1141.    { "glDisable", 20, _gloffset_Disable },
  1142.    { "glDiscardFramebufferEXT", 20, -1 },
  1143.    { "glDisableVertexAttribArray", 20, -1 },
  1144.    { "glDrawArrays", 20, _gloffset_DrawArrays },
  1145.    { "glDrawBuffersNV", 20, -1 },
  1146.    { "glDrawElements", 20, _gloffset_DrawElements },
  1147.    { "glEGLImageTargetRenderbufferStorageOES", 20, -1 },
  1148.    { "glEGLImageTargetTexture2DOES", 20, -1 },
  1149.    { "glEnable", 20, _gloffset_Enable },
  1150.    { "glEnableVertexAttribArray", 20, -1 },
  1151.    { "glFinish", 20, _gloffset_Finish },
  1152.    { "glFlush", 20, _gloffset_Flush },
  1153.    { "glFlushMappedBufferRangeEXT", 20, -1 },
  1154.    { "glFramebufferRenderbuffer", 20, -1 },
  1155.    { "glFramebufferTexture2D", 20, -1 },
  1156.    { "glFramebufferTexture3DOES", 20, -1 },
  1157.    { "glFrontFace", 20, _gloffset_FrontFace },
  1158.    { "glGenBuffers", 20, -1 },
  1159.    { "glGenFramebuffers", 20, -1 },
  1160.    { "glGenRenderbuffers", 20, -1 },
  1161.    { "glGenTextures", 20, _gloffset_GenTextures },
  1162.    { "glGenVertexArraysOES", 20, -1 },
  1163.    { "glGenerateMipmap", 20, -1 },
  1164.    { "glGetActiveAttrib", 20, -1 },
  1165.    { "glGetActiveUniform", 20, -1 },
  1166.    { "glGetAttachedShaders", 20, -1 },
  1167.    { "glGetAttribLocation", 20, -1 },
  1168.    { "glGetBooleanv", 20, _gloffset_GetBooleanv },
  1169.    { "glGetBufferParameteriv", 20, -1 },
  1170.    { "glGetBufferPointervOES", 20, -1 },
  1171.    { "glGetError", 20, _gloffset_GetError },
  1172.    { "glGetFloatv", 20, _gloffset_GetFloatv },
  1173.    { "glGetFramebufferAttachmentParameteriv", 20, -1 },
  1174.    { "glGetIntegerv", 20, _gloffset_GetIntegerv },
  1175.    { "glGetProgramInfoLog", 20, -1 },
  1176.    { "glGetProgramiv", 20, -1 },
  1177.    { "glGetRenderbufferParameteriv", 20, -1 },
  1178.    { "glGetShaderInfoLog", 20, -1 },
  1179.    { "glGetShaderPrecisionFormat", 20, -1 },
  1180.    { "glGetShaderSource", 20, -1 },
  1181.    { "glGetShaderiv", 20, -1 },
  1182.    { "glGetString", 20, _gloffset_GetString },
  1183.    { "glGetTexParameterfv", 20, _gloffset_GetTexParameterfv },
  1184.    { "glGetTexParameteriv", 20, _gloffset_GetTexParameteriv },
  1185.    { "glGetUniformLocation", 20, -1 },
  1186.    { "glGetUniformfv", 20, -1 },
  1187.    { "glGetUniformiv", 20, -1 },
  1188.    { "glGetVertexAttribPointerv", 20, -1 },
  1189.    { "glGetVertexAttribfv", 20, -1 },
  1190.    { "glGetVertexAttribiv", 20, -1 },
  1191.    { "glHint", 20, _gloffset_Hint },
  1192.    { "glIsBuffer", 20, -1 },
  1193.    { "glIsEnabled", 20, _gloffset_IsEnabled },
  1194.    { "glIsFramebuffer", 20, -1 },
  1195.    { "glIsProgram", 20, -1 },
  1196.    { "glIsRenderbuffer", 20, -1 },
  1197.    { "glIsShader", 20, -1 },
  1198.    { "glIsTexture", 20, _gloffset_IsTexture },
  1199.    { "glIsVertexArrayOES", 20, -1 },
  1200.    { "glLineWidth", 20, _gloffset_LineWidth },
  1201.    { "glLinkProgram", 20, -1 },
  1202.    { "glMapBufferOES", 20, -1 },
  1203.    { "glMapBufferRangeEXT", 20, -1 },
  1204.    { "glMultiDrawArraysEXT", 20, -1 },
  1205.    { "glMultiDrawElementsEXT", 20, -1 },
  1206.    { "glPixelStorei", 20, _gloffset_PixelStorei },
  1207.    { "glPolygonOffset", 20, _gloffset_PolygonOffset },
  1208.    { "glReadBufferNV", 20, _gloffset_ReadBuffer },
  1209.    { "glReadPixels", 20, _gloffset_ReadPixels },
  1210.    { "glReleaseShaderCompiler", 20, -1 },
  1211.    { "glRenderbufferStorage", 20, -1 },
  1212.    { "glSampleCoverage", 20, -1 },
  1213.    { "glScissor", 20, _gloffset_Scissor },
  1214.    { "glShaderBinary", 20, -1 },
  1215.    { "glShaderSource", 20, -1 },
  1216.    { "glStencilFunc", 20, _gloffset_StencilFunc },
  1217.    { "glStencilFuncSeparate", 20, -1 },
  1218.    { "glStencilMask", 20, _gloffset_StencilMask },
  1219.    { "glStencilMaskSeparate", 20, -1 },
  1220.    { "glStencilOp", 20, _gloffset_StencilOp },
  1221.    { "glStencilOpSeparate", 20, -1 },
  1222.    { "glTexImage2D", 20, _gloffset_TexImage2D },
  1223.    { "glTexImage3DOES", 20, _gloffset_TexImage3D },
  1224.    { "glTexParameterf", 20, _gloffset_TexParameterf },
  1225.    { "glTexParameterfv", 20, _gloffset_TexParameterfv },
  1226.    { "glTexParameteri", 20, _gloffset_TexParameteri },
  1227.    { "glTexParameteriv", 20, _gloffset_TexParameteriv },
  1228.    { "glTexSubImage2D", 20, _gloffset_TexSubImage2D },
  1229.    { "glTexSubImage3DOES", 20, _gloffset_TexSubImage3D },
  1230.    { "glUniform1f", 20, -1 },
  1231.    { "glUniform1fv", 20, -1 },
  1232.    { "glUniform1i", 20, -1 },
  1233.    { "glUniform1iv", 20, -1 },
  1234.    { "glUniform2f", 20, -1 },
  1235.    { "glUniform2fv", 20, -1 },
  1236.    { "glUniform2i", 20, -1 },
  1237.    { "glUniform2iv", 20, -1 },
  1238.    { "glUniform3f", 20, -1 },
  1239.    { "glUniform3fv", 20, -1 },
  1240.    { "glUniform3i", 20, -1 },
  1241.    { "glUniform3iv", 20, -1 },
  1242.    { "glUniform4f", 20, -1 },
  1243.    { "glUniform4fv", 20, -1 },
  1244.    { "glUniform4i", 20, -1 },
  1245.    { "glUniform4iv", 20, -1 },
  1246.    { "glUniformMatrix2fv", 20, -1 },
  1247.    { "glUniformMatrix3fv", 20, -1 },
  1248.    { "glUniformMatrix4fv", 20, -1 },
  1249.    { "glUnmapBufferOES", 20, -1 },
  1250.    { "glUseProgram", 20, -1 },
  1251.    { "glValidateProgram", 20, -1 },
  1252.    { "glVertexAttrib1f", 20, -1 },
  1253.    { "glVertexAttrib1fv", 20, -1 },
  1254.    { "glVertexAttrib2f", 20, -1 },
  1255.    { "glVertexAttrib2fv", 20, -1 },
  1256.    { "glVertexAttrib3f", 20, -1 },
  1257.    { "glVertexAttrib3fv", 20, -1 },
  1258.    { "glVertexAttrib4f", 20, -1 },
  1259.    { "glVertexAttrib4fv", 20, -1 },
  1260.    { "glVertexAttribPointer", 20, -1 },
  1261.    { "glViewport", 20, _gloffset_Viewport },
  1262.  
  1263.    /* GL_OES_get_program_binary - Also part of OpenGL ES 3.0. */
  1264.    { "glGetProgramBinaryOES", 20, -1 },
  1265.    { "glProgramBinaryOES", 20, -1 },
  1266.  
  1267.    { NULL, 0, -1 }
  1268. };
  1269.  
  1270. const struct function gles3_functions_possible[] = {
  1271.    { "glBeginQuery", 30, -1 },
  1272.    { "glBeginTransformFeedback", 30, -1 },
  1273.    { "glBindBufferBase", 30, -1 },
  1274.    { "glBindBufferRange", 30, -1 },
  1275.    { "glBindSampler", 30, -1 },
  1276.    { "glBindTransformFeedback", 30, -1 },
  1277.    // We check for the aliased -OES version in GLES 2
  1278.    // { "glBindVertexArray", 30, -1 },
  1279.    { "glBlitFramebuffer", 30, -1 },
  1280.    { "glClearBufferfi", 30, -1 },
  1281.    { "glClearBufferfv", 30, -1 },
  1282.    { "glClearBufferiv", 30, -1 },
  1283.    { "glClearBufferuiv", 30, -1 },
  1284.    { "glClientWaitSync", 30, -1 },
  1285.    // We check for the aliased -OES version in GLES 2
  1286.    // { "glCompressedTexImage3D", 30, -1 },
  1287.    // We check for the aliased -OES version in GLES 2
  1288.    // { "glCompressedTexSubImage3D", 30, -1 },
  1289.    { "glCopyBufferSubData", 30, -1 },
  1290.    // We check for the aliased -OES version in GLES 2
  1291.    // { "glCopyTexSubImage3D", 30, -1 },
  1292.    { "glDeleteQueries", 30, -1 },
  1293.    { "glDeleteSamplers", 30, -1 },
  1294.    { "glDeleteSync", 30, -1 },
  1295.    { "glDeleteTransformFeedbacks", 30, -1 },
  1296.    // We check for the aliased -OES version in GLES 2
  1297.    // { "glDeleteVertexArrays", 30, -1 },
  1298.    { "glDrawArraysInstanced", 30, -1 },
  1299.    // We check for the aliased -NV version in GLES 2
  1300.    // { "glDrawBuffers", 30, -1 },
  1301.    { "glDrawElementsInstanced", 30, -1 },
  1302.    { "glDrawRangeElements", 30, -1 },
  1303.    { "glEndQuery", 30, -1 },
  1304.    { "glEndTransformFeedback", 30, -1 },
  1305.    { "glFenceSync", 30, -1 },
  1306.    // We check for the aliased -EXT version in GLES 2
  1307.    // { "glFlushMappedBufferRange", 30, -1 },
  1308.    { "glFramebufferTextureLayer", 30, -1 },
  1309.    { "glGenQueries", 30, -1 },
  1310.    { "glGenSamplers", 30, -1 },
  1311.    { "glGenTransformFeedbacks", 30, -1 },
  1312.    // We check for the aliased -OES version in GLES 2
  1313.    // { "glGenVertexArrays", 30, -1 },
  1314.    { "glGetActiveUniformBlockiv", 30, -1 },
  1315.    { "glGetActiveUniformBlockName", 30, -1 },
  1316.    { "glGetActiveUniformsiv", 30, -1 },
  1317.    { "glGetBufferParameteri64v", 30, -1 },
  1318.    // We check for the aliased -OES version in GLES 2
  1319.    // { "glGetBufferPointerv", 30, -1 },
  1320.    { "glGetFragDataLocation", 30, -1 },
  1321.    { "glGetInteger64i_v", 30, -1 },
  1322.    { "glGetInteger64v", 30, -1 },
  1323.    { "glGetIntegeri_v", 30, -1 },
  1324.    { "glGetInternalformativ", 30, -1 },
  1325.    // glGetProgramBinary aliases glGetProgramBinaryOES in GLES 2
  1326.    { "glGetQueryiv", 30, -1 },
  1327.    { "glGetQueryObjectuiv", 30, -1 },
  1328.    { "glGetSamplerParameterfv", 30, -1 },
  1329.    { "glGetSamplerParameteriv", 30, -1 },
  1330.    { "glGetStringi", 30, -1 },
  1331.    { "glGetSynciv", 30, -1 },
  1332.    { "glGetTransformFeedbackVarying", 30, -1 },
  1333.    { "glGetUniformBlockIndex", 30, -1 },
  1334.    { "glGetUniformIndices", 30, -1 },
  1335.    { "glGetUniformuiv", 30, -1 },
  1336.    { "glGetVertexAttribIiv", 30, -1 },
  1337.    { "glGetVertexAttribIuiv", 30, -1 },
  1338.    { "glInvalidateFramebuffer", 30, -1 },
  1339.    { "glInvalidateSubFramebuffer", 30, -1 },
  1340.    { "glIsQuery", 30, -1 },
  1341.    { "glIsSampler", 30, -1 },
  1342.    { "glIsSync", 30, -1 },
  1343.    { "glIsTransformFeedback", 30, -1 },
  1344.    // We check for the aliased -OES version in GLES 2
  1345.    // { "glIsVertexArray", 30, -1 },
  1346.    // We check for the aliased -EXT version in GLES 2
  1347.    // { "glMapBufferRange", 30, -1 },
  1348.    { "glPauseTransformFeedback", 30, -1 },
  1349.    // glProgramBinary aliases glProgramBinaryOES in GLES 2
  1350.    { "glProgramParameteri", 30, -1 },
  1351.    // We check for the aliased -NV version in GLES 2
  1352.    // { "glReadBuffer", 30, -1 },
  1353.    { "glRenderbufferStorageMultisample", 30, -1 },
  1354.    { "glResumeTransformFeedback", 30, -1 },
  1355.    { "glSamplerParameterf", 30, -1 },
  1356.    { "glSamplerParameterfv", 30, -1 },
  1357.    { "glSamplerParameteri", 30, -1 },
  1358.    { "glSamplerParameteriv", 30, -1 },
  1359.    // We check for the aliased -OES version in GLES 2
  1360.    // { "glTexImage3D", 30, -1 },
  1361.    { "glTexStorage2D", 30, -1 },
  1362.    { "glTexStorage3D", 30, -1 },
  1363.    // We check for the aliased -OES version in GLES 2
  1364.    // { "glTexSubImage3D", 30, -1 },
  1365.    { "glTransformFeedbackVaryings", 30, -1 },
  1366.    { "glUniform1ui", 30, -1 },
  1367.    { "glUniform1uiv", 30, -1 },
  1368.    { "glUniform2ui", 30, -1 },
  1369.    { "glUniform2uiv", 30, -1 },
  1370.    { "glUniform3ui", 30, -1 },
  1371.    { "glUniform3uiv", 30, -1 },
  1372.    { "glUniform4ui", 30, -1 },
  1373.    { "glUniform4uiv", 30, -1 },
  1374.    { "glUniformBlockBinding", 30, -1 },
  1375.    { "glUniformMatrix2x3fv", 30, -1 },
  1376.    { "glUniformMatrix2x4fv", 30, -1 },
  1377.    { "glUniformMatrix3x2fv", 30, -1 },
  1378.    { "glUniformMatrix3x4fv", 30, -1 },
  1379.    { "glUniformMatrix4x2fv", 30, -1 },
  1380.    { "glUniformMatrix4x3fv", 30, -1 },
  1381.    // We check for the aliased -OES version in GLES 2
  1382.    // { "glUnmapBuffer", 30, -1 },
  1383.    { "glVertexAttribDivisor", 30, -1 },
  1384.    { "glVertexAttribI4i", 30, -1 },
  1385.    { "glVertexAttribI4iv", 30, -1 },
  1386.    { "glVertexAttribI4ui", 30, -1 },
  1387.    { "glVertexAttribI4uiv", 30, -1 },
  1388.    { "glVertexAttribIPointer", 30, -1 },
  1389.    { "glWaitSync", 30, -1 },
  1390.    { NULL, 0, -1 }
  1391. };
  1392.