1/*
2 * Copyright 2014 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17// This source file is automatically generated
18
19#pragma GCC diagnostic ignored "-Wunused-variable"
20#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
21#pragma GCC diagnostic ignored "-Wunused-function"
22
23#include <stdint.h>
24#include <GLES3/gl31.h>
25#include <jni.h>
26#include <JNIHelp.h>
27#include <android_runtime/AndroidRuntime.h>
28#include <utils/misc.h>
29#include <assert.h>
30
31static int initialized = 0;
32
33static jclass nioAccessClass;
34static jclass bufferClass;
35static jmethodID getBasePointerID;
36static jmethodID getBaseArrayID;
37static jmethodID getBaseArrayOffsetID;
38static jfieldID positionID;
39static jfieldID limitID;
40static jfieldID elementSizeShiftID;
41
42
43/* special calls implemented in Android's GLES wrapper used to more
44 * efficiently bound-check passed arrays */
45extern "C" {
46#ifdef GL_VERSION_ES_CM_1_1
47GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
48        const GLvoid *ptr, GLsizei count);
49GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
50        const GLvoid *pointer, GLsizei count);
51GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
52        GLsizei stride, const GLvoid *pointer, GLsizei count);
53GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
54        GLsizei stride, const GLvoid *pointer, GLsizei count);
55GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
56        GLsizei stride, const GLvoid *pointer, GLsizei count);
57GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
58        GLsizei stride, const GLvoid *pointer, GLsizei count);
59GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
60        GLsizei stride, const GLvoid *pointer, GLsizei count);
61#endif
62#ifdef GL_ES_VERSION_2_0
63static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
64        GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
65    glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
66}
67#endif
68#ifdef GL_ES_VERSION_3_0
69static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
70        GLsizei stride, const GLvoid *pointer, GLsizei count) {
71    glVertexAttribIPointer(indx, size, type, stride, pointer);
72}
73#endif
74}
75
76/* Cache method IDs each time the class is loaded. */
77
78static void
79nativeClassInit(JNIEnv *_env, jclass glImplClass)
80{
81    jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
82    nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
83
84    jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
85    bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
86
87    getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
88            "getBasePointer", "(Ljava/nio/Buffer;)J");
89    getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
90            "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
91    getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
92            "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
93
94    positionID = _env->GetFieldID(bufferClass, "position", "I");
95    limitID = _env->GetFieldID(bufferClass, "limit", "I");
96    elementSizeShiftID =
97        _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
98}
99
100static void *
101getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
102{
103    jint position;
104    jint limit;
105    jint elementSizeShift;
106    jlong pointer;
107
108    position = _env->GetIntField(buffer, positionID);
109    limit = _env->GetIntField(buffer, limitID);
110    elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
111    *remaining = (limit - position) << elementSizeShift;
112    pointer = _env->CallStaticLongMethod(nioAccessClass,
113            getBasePointerID, buffer);
114    if (pointer != 0L) {
115        *array = NULL;
116        return reinterpret_cast<void*>(pointer);
117    }
118
119    *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
120            getBaseArrayID, buffer);
121    *offset = _env->CallStaticIntMethod(nioAccessClass,
122            getBaseArrayOffsetID, buffer);
123
124    return NULL;
125}
126
127class ByteArrayGetter {
128public:
129    static void* Get(JNIEnv* _env, jbyteArray array, jboolean* is_copy) {
130        return _env->GetByteArrayElements(array, is_copy);
131    }
132};
133class BooleanArrayGetter {
134public:
135    static void* Get(JNIEnv* _env, jbooleanArray array, jboolean* is_copy) {
136        return _env->GetBooleanArrayElements(array, is_copy);
137    }
138};
139class CharArrayGetter {
140public:
141    static void* Get(JNIEnv* _env, jcharArray array, jboolean* is_copy) {
142        return _env->GetCharArrayElements(array, is_copy);
143    }
144};
145class ShortArrayGetter {
146public:
147    static void* Get(JNIEnv* _env, jshortArray array, jboolean* is_copy) {
148        return _env->GetShortArrayElements(array, is_copy);
149    }
150};
151class IntArrayGetter {
152public:
153    static void* Get(JNIEnv* _env, jintArray array, jboolean* is_copy) {
154        return _env->GetIntArrayElements(array, is_copy);
155    }
156};
157class LongArrayGetter {
158public:
159    static void* Get(JNIEnv* _env, jlongArray array, jboolean* is_copy) {
160        return _env->GetLongArrayElements(array, is_copy);
161    }
162};
163class FloatArrayGetter {
164public:
165    static void* Get(JNIEnv* _env, jfloatArray array, jboolean* is_copy) {
166        return _env->GetFloatArrayElements(array, is_copy);
167    }
168};
169class DoubleArrayGetter {
170public:
171    static void* Get(JNIEnv* _env, jdoubleArray array, jboolean* is_copy) {
172        return _env->GetDoubleArrayElements(array, is_copy);
173    }
174};
175
176template<typename JTYPEARRAY, typename ARRAYGETTER>
177static void*
178getArrayPointer(JNIEnv *_env, JTYPEARRAY array, jboolean* is_copy) {
179    return ARRAYGETTER::Get(_env, array, is_copy);
180}
181
182class ByteArrayReleaser {
183public:
184    static void Release(JNIEnv* _env, jbyteArray array, jbyte* data, jboolean commit) {
185        _env->ReleaseByteArrayElements(array, data, commit ? 0 : JNI_ABORT);
186    }
187};
188class BooleanArrayReleaser {
189public:
190    static void Release(JNIEnv* _env, jbooleanArray array, jboolean* data, jboolean commit) {
191        _env->ReleaseBooleanArrayElements(array, data, commit ? 0 : JNI_ABORT);
192    }
193};
194class CharArrayReleaser {
195public:
196    static void Release(JNIEnv* _env, jcharArray array, jchar* data, jboolean commit) {
197        _env->ReleaseCharArrayElements(array, data, commit ? 0 : JNI_ABORT);
198    }
199};
200class ShortArrayReleaser {
201public:
202    static void Release(JNIEnv* _env, jshortArray array, jshort* data, jboolean commit) {
203        _env->ReleaseShortArrayElements(array, data, commit ? 0 : JNI_ABORT);
204    }
205};
206class IntArrayReleaser {
207public:
208    static void Release(JNIEnv* _env, jintArray array, jint* data, jboolean commit) {
209        _env->ReleaseIntArrayElements(array, data, commit ? 0 : JNI_ABORT);
210    }
211};
212class LongArrayReleaser {
213public:
214    static void Release(JNIEnv* _env, jlongArray array, jlong* data, jboolean commit) {
215        _env->ReleaseLongArrayElements(array, data, commit ? 0 : JNI_ABORT);
216    }
217};
218class FloatArrayReleaser {
219public:
220    static void Release(JNIEnv* _env, jfloatArray array, jfloat* data, jboolean commit) {
221        _env->ReleaseFloatArrayElements(array, data, commit ? 0 : JNI_ABORT);
222    }
223};
224class DoubleArrayReleaser {
225public:
226    static void Release(JNIEnv* _env, jdoubleArray array, jdouble* data, jboolean commit) {
227        _env->ReleaseDoubleArrayElements(array, data, commit ? 0 : JNI_ABORT);
228    }
229};
230
231template<typename JTYPEARRAY, typename NTYPEARRAY, typename ARRAYRELEASER>
232static void
233releaseArrayPointer(JNIEnv *_env, JTYPEARRAY array, NTYPEARRAY data, jboolean commit) {
234    ARRAYRELEASER::Release(_env, array, data, commit);
235}
236
237static void
238releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
239{
240    _env->ReleasePrimitiveArrayCritical(array, data,
241                       commit ? 0 : JNI_ABORT);
242}
243
244static void *
245getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
246    char* buf = (char*) _env->GetDirectBufferAddress(buffer);
247    if (buf) {
248        jint position = _env->GetIntField(buffer, positionID);
249        jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
250        buf += position << elementSizeShift;
251    } else {
252        jniThrowException(_env, "java/lang/IllegalArgumentException",
253                          "Must use a native order direct Buffer");
254    }
255    return (void*) buf;
256}
257
258// --------------------------------------------------------------------------
259
260/*
261 * returns the number of values glGet returns for a given pname.
262 *
263 * The code below is written such that pnames requiring only one values
264 * are the default (and are not explicitely tested for). This makes the
265 * checking code much shorter/readable/efficient.
266 *
267 * This means that unknown pnames (e.g.: extensions) will default to 1. If
268 * that unknown pname needs more than 1 value, then the validation check
269 * is incomplete and the app may crash if it passed the wrong number params.
270 */
271static int getNeededCount(GLint pname) {
272    int needed = 1;
273#ifdef GL_ES_VERSION_2_0
274    // GLES 2.x pnames
275    switch (pname) {
276        case GL_ALIASED_LINE_WIDTH_RANGE:
277        case GL_ALIASED_POINT_SIZE_RANGE:
278            needed = 2;
279            break;
280
281        case GL_BLEND_COLOR:
282        case GL_COLOR_CLEAR_VALUE:
283        case GL_COLOR_WRITEMASK:
284        case GL_SCISSOR_BOX:
285        case GL_VIEWPORT:
286            needed = 4;
287            break;
288
289        case GL_COMPRESSED_TEXTURE_FORMATS:
290            glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
291            break;
292
293        case GL_SHADER_BINARY_FORMATS:
294            glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
295            break;
296    }
297#endif
298
299#ifdef GL_VERSION_ES_CM_1_1
300    // GLES 1.x pnames
301    switch (pname) {
302        case GL_ALIASED_LINE_WIDTH_RANGE:
303        case GL_ALIASED_POINT_SIZE_RANGE:
304        case GL_DEPTH_RANGE:
305        case GL_SMOOTH_LINE_WIDTH_RANGE:
306        case GL_SMOOTH_POINT_SIZE_RANGE:
307            needed = 2;
308            break;
309
310        case GL_CURRENT_NORMAL:
311        case GL_POINT_DISTANCE_ATTENUATION:
312            needed = 3;
313            break;
314
315        case GL_COLOR_CLEAR_VALUE:
316        case GL_COLOR_WRITEMASK:
317        case GL_CURRENT_COLOR:
318        case GL_CURRENT_TEXTURE_COORDS:
319        case GL_FOG_COLOR:
320        case GL_LIGHT_MODEL_AMBIENT:
321        case GL_SCISSOR_BOX:
322        case GL_VIEWPORT:
323            needed = 4;
324            break;
325
326        case GL_MODELVIEW_MATRIX:
327        case GL_PROJECTION_MATRIX:
328        case GL_TEXTURE_MATRIX:
329            needed = 16;
330            break;
331
332        case GL_COMPRESSED_TEXTURE_FORMATS:
333            glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
334            break;
335    }
336#endif
337    return needed;
338}
339
340template <typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
341          typename ARRAYRELEASER, typename CTYPE, void GET(GLenum, CTYPE*)>
342static void
343get
344  (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
345    jint _exception = 0;
346    const char * _exceptionType;
347    const char * _exceptionMessage;
348    CTYPE *params_base = (CTYPE *) 0;
349    jint _remaining;
350    CTYPE *params = (CTYPE *) 0;
351    int _needed = 0;
352
353    if (!params_ref) {
354        _exception = 1;
355        _exceptionType = "java/lang/IllegalArgumentException";
356        _exceptionMessage = "params == null";
357        goto exit;
358    }
359    if (offset < 0) {
360        _exception = 1;
361        _exceptionType = "java/lang/IllegalArgumentException";
362        _exceptionMessage = "offset < 0";
363        goto exit;
364    }
365    _remaining = _env->GetArrayLength(params_ref) - offset;
366    _needed = getNeededCount(pname);
367    // if we didn't find this pname, we just assume the user passed
368    // an array of the right size -- this might happen with extensions
369    // or if we forget an enum here.
370    if (_remaining < _needed) {
371        _exception = 1;
372        _exceptionType = "java/lang/IllegalArgumentException";
373        _exceptionMessage = "length - offset < needed";
374        goto exit;
375    }
376    params_base = (CTYPE *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
377        _env, params_ref, (jboolean *)0);
378    params = params_base + offset;
379
380    GET(
381        (GLenum)pname,
382        (CTYPE *)params
383    );
384
385exit:
386    if (params_base) {
387        releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
388            _env, params_ref, params_base, !_exception);
389    }
390    if (_exception) {
391        jniThrowException(_env, _exceptionType, _exceptionMessage);
392    }
393}
394
395
396template <typename CTYPE, typename JTYPEARRAY, typename ARRAYGETTER, typename NTYPEARRAY,
397          typename ARRAYRELEASER, void GET(GLenum, CTYPE*)>
398static void
399getarray
400  (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
401    jint _exception = 0;
402    const char * _exceptionType;
403    const char * _exceptionMessage;
404    JTYPEARRAY _array = (JTYPEARRAY) 0;
405    jint _bufferOffset = (jint) 0;
406    jint _remaining;
407    CTYPE *params = (CTYPE *) 0;
408    int _needed = 0;
409
410    params = (CTYPE *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
411    _remaining /= sizeof(CTYPE);    // convert from bytes to item count
412    _needed = getNeededCount(pname);
413    // if we didn't find this pname, we just assume the user passed
414    // an array of the right size -- this might happen with extensions
415    // or if we forget an enum here.
416    if (_needed>0 && _remaining < _needed) {
417        _exception = 1;
418        _exceptionType = "java/lang/IllegalArgumentException";
419        _exceptionMessage = "remaining() < needed";
420        goto exit;
421    }
422    if (params == NULL) {
423        char * _paramsBase = (char *) getArrayPointer<JTYPEARRAY, ARRAYGETTER>(
424            _env, _array, (jboolean *) 0);
425        params = (CTYPE *) (_paramsBase + _bufferOffset);
426    }
427    GET(
428        (GLenum)pname,
429        (CTYPE *)params
430    );
431
432exit:
433    if (_array) {
434        releaseArrayPointer<JTYPEARRAY, NTYPEARRAY, ARRAYRELEASER>(
435            _env, _array, (NTYPEARRAY)params, _exception ? JNI_FALSE : JNI_TRUE);
436    }
437    if (_exception) {
438        jniThrowException(_env, _exceptionType, _exceptionMessage);
439    }
440}
441
442// --------------------------------------------------------------------------
443/* void glDispatchCompute ( GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z ) */
444static void
445android_glDispatchCompute__III
446  (JNIEnv *_env, jobject _this, jint num_groups_x, jint num_groups_y, jint num_groups_z) {
447    glDispatchCompute(
448        (GLuint)num_groups_x,
449        (GLuint)num_groups_y,
450        (GLuint)num_groups_z
451    );
452}
453
454/* void glDispatchComputeIndirect ( GLintptr indirect ) */
455static void android_glDispatchComputeIndirect(JNIEnv *_env, jobject, jlong indirect) {
456    // 'indirect' is a byte offset, not a pointer. GL checks for negative and too-large values.
457    // Here we only need to check for successful 64-bit to 32-bit conversion.
458    // - jlong is a int64_t (jni.h)
459    // - GLintptr is a long (khrplatform.h)
460    if (sizeof(GLintptr) != sizeof(jlong) && (indirect < LONG_MIN || indirect > LONG_MAX)) {
461        jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
462        return;
463    }
464    glDispatchComputeIndirect((GLintptr)indirect);
465}
466
467/* void glDrawArraysIndirect ( GLenum mode, const void *indirect ) */
468static void android_glDrawArraysIndirect(JNIEnv *_env, jobject, int mode, jlong indirect) {
469    // In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
470    // GL checks for too-large values. Here we only need to check for successful signed 64-bit
471    // to unsigned 32-bit conversion.
472    if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
473        jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
474        return;
475    }
476    glDrawArraysIndirect(mode, (const void*)indirect);
477}
478
479/* void glDrawElementsIndirect ( GLenum mode, GLenum type, const void *indirect ) */
480static void android_glDrawElementsIndirect(JNIEnv *_env, jobject, jint mode, jint type, jlong indirect) {
481    // In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
482    // GL checks for too-large values. Here we only need to check for successful signed 64-bit
483    // to unsigned 32-bit conversion.
484    if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
485        jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
486        return;
487    }
488    glDrawElementsIndirect(mode, type, (const void*)indirect);
489}
490
491/* void glFramebufferParameteri ( GLenum target, GLenum pname, GLint param ) */
492static void
493android_glFramebufferParameteri__III
494  (JNIEnv *_env, jobject _this, jint target, jint pname, jint param) {
495    glFramebufferParameteri(
496        (GLenum)target,
497        (GLenum)pname,
498        (GLint)param
499    );
500}
501
502/* void glGetFramebufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
503static void
504android_glGetFramebufferParameteriv__II_3II
505  (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
506    jint _exception = 0;
507    const char * _exceptionType = NULL;
508    const char * _exceptionMessage = NULL;
509    GLint *params_base = (GLint *) 0;
510    jint _remaining;
511    GLint *params = (GLint *) 0;
512
513    if (!params_ref) {
514        _exception = 1;
515        _exceptionType = "java/lang/IllegalArgumentException";
516        _exceptionMessage = "params == null";
517        goto exit;
518    }
519    if (offset < 0) {
520        _exception = 1;
521        _exceptionType = "java/lang/IllegalArgumentException";
522        _exceptionMessage = "offset < 0";
523        goto exit;
524    }
525    _remaining = _env->GetArrayLength(params_ref) - offset;
526    params_base = (GLint *)
527        _env->GetIntArrayElements(params_ref, (jboolean *)0);
528    params = params_base + offset;
529
530    glGetFramebufferParameteriv(
531        (GLenum)target,
532        (GLenum)pname,
533        (GLint *)params
534    );
535
536exit:
537    if (params_base) {
538        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
539            _exception ? JNI_ABORT: 0);
540    }
541    if (_exception) {
542        jniThrowException(_env, _exceptionType, _exceptionMessage);
543    }
544}
545
546/* void glGetFramebufferParameteriv ( GLenum target, GLenum pname, GLint *params ) */
547static void
548android_glGetFramebufferParameteriv__IILjava_nio_IntBuffer_2
549  (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
550    jintArray _array = (jintArray) 0;
551    jint _bufferOffset = (jint) 0;
552    jint _remaining;
553    GLint *params = (GLint *) 0;
554
555    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
556    if (params == NULL) {
557        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
558        params = (GLint *) (_paramsBase + _bufferOffset);
559    }
560    glGetFramebufferParameteriv(
561        (GLenum)target,
562        (GLenum)pname,
563        (GLint *)params
564    );
565    if (_array) {
566        _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
567    }
568}
569
570/* void glGetProgramInterfaceiv ( GLuint program, GLenum programInterface, GLenum pname, GLint *params ) */
571static void
572android_glGetProgramInterfaceiv__III_3II
573  (JNIEnv *_env, jobject _this, jint program, jint programInterface, jint pname, jintArray params_ref, jint offset) {
574    jint _exception = 0;
575    const char * _exceptionType = NULL;
576    const char * _exceptionMessage = NULL;
577    GLint *params_base = (GLint *) 0;
578    jint _remaining;
579    GLint *params = (GLint *) 0;
580
581    if (!params_ref) {
582        _exception = 1;
583        _exceptionType = "java/lang/IllegalArgumentException";
584        _exceptionMessage = "params == null";
585        goto exit;
586    }
587    if (offset < 0) {
588        _exception = 1;
589        _exceptionType = "java/lang/IllegalArgumentException";
590        _exceptionMessage = "offset < 0";
591        goto exit;
592    }
593    _remaining = _env->GetArrayLength(params_ref) - offset;
594    params_base = (GLint *)
595        _env->GetIntArrayElements(params_ref, (jboolean *)0);
596    params = params_base + offset;
597
598    glGetProgramInterfaceiv(
599        (GLuint)program,
600        (GLenum)programInterface,
601        (GLenum)pname,
602        (GLint *)params
603    );
604
605exit:
606    if (params_base) {
607        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
608            _exception ? JNI_ABORT: 0);
609    }
610    if (_exception) {
611        jniThrowException(_env, _exceptionType, _exceptionMessage);
612    }
613}
614
615/* void glGetProgramInterfaceiv ( GLuint program, GLenum programInterface, GLenum pname, GLint *params ) */
616static void
617android_glGetProgramInterfaceiv__IIILjava_nio_IntBuffer_2
618  (JNIEnv *_env, jobject _this, jint program, jint programInterface, jint pname, jobject params_buf) {
619    jintArray _array = (jintArray) 0;
620    jint _bufferOffset = (jint) 0;
621    jint _remaining;
622    GLint *params = (GLint *) 0;
623
624    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
625    if (params == NULL) {
626        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
627        params = (GLint *) (_paramsBase + _bufferOffset);
628    }
629    glGetProgramInterfaceiv(
630        (GLuint)program,
631        (GLenum)programInterface,
632        (GLenum)pname,
633        (GLint *)params
634    );
635    if (_array) {
636        _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
637    }
638}
639
640/* GLuint glGetProgramResourceIndex ( GLuint program, GLenum programInterface, const GLchar *name ) */
641static jint
642android_glGetProgramResourceIndex__IILjava_lang_String_2
643  (JNIEnv *_env, jobject _this, jint program, jint programInterface, jstring name) {
644    jint _exception = 0;
645    const char * _exceptionType = NULL;
646    const char * _exceptionMessage = NULL;
647    GLuint _returnValue = 0;
648    const char* _nativename = 0;
649
650    if (!name) {
651        _exception = 1;
652        _exceptionType = "java/lang/IllegalArgumentException";
653        _exceptionMessage = "name == null";
654        goto exit;
655    }
656    _nativename = _env->GetStringUTFChars(name, 0);
657
658    _returnValue = glGetProgramResourceIndex(
659        (GLuint)program,
660        (GLenum)programInterface,
661        (GLchar *)_nativename
662    );
663
664exit:
665    if (_nativename) {
666        _env->ReleaseStringUTFChars(name, _nativename);
667    }
668
669    if (_exception) {
670        jniThrowException(_env, _exceptionType, _exceptionMessage);
671    }
672    return (jint)_returnValue;
673}
674
675/* void glGetProgramResourceName ( GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name ) */
676static jstring
677android_glGetProgramResourceName
678  (JNIEnv *_env, jobject _this, jint program, jint programInterface, jint index) {
679    jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
680    return NULL;
681}
682
683/* void glGetProgramResourceiv ( GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params ) */
684static void
685android_glGetProgramResourceiv__IIII_3III_3II_3II
686  (JNIEnv *_env, jobject _this, jint program, jint programInterface, jint index, jint propCount, jintArray props_ref, jint propsOffset, jint bufSize, jintArray length_ref, jint lengthOffset, jintArray params_ref, jint paramsOffset) {
687    jint _exception = 0;
688    const char * _exceptionType = NULL;
689    const char * _exceptionMessage = NULL;
690    GLenum *props_base = (GLenum *) 0;
691    jint _propsRemaining;
692    GLenum *props = (GLenum *) 0;
693    GLsizei *length_base = (GLsizei *) 0;
694    jint _lengthRemaining;
695    GLsizei *length = (GLsizei *) 0;
696    GLint *params_base = (GLint *) 0;
697    jint _paramsRemaining;
698    GLint *params = (GLint *) 0;
699
700    if (!props_ref) {
701        _exception = 1;
702        _exceptionType = "java/lang/IllegalArgumentException";
703        _exceptionMessage = "props == null";
704        goto exit;
705    }
706    if (propsOffset < 0) {
707        _exception = 1;
708        _exceptionType = "java/lang/IllegalArgumentException";
709        _exceptionMessage = "propsOffset < 0";
710        goto exit;
711    }
712    _propsRemaining = _env->GetArrayLength(props_ref) - propsOffset;
713    props_base = (GLenum *)
714        _env->GetIntArrayElements(props_ref, (jboolean *)0);
715    props = props_base + propsOffset;
716
717    if (!length_ref) {
718        _exception = 1;
719        _exceptionType = "java/lang/IllegalArgumentException";
720        _exceptionMessage = "length == null";
721        goto exit;
722    }
723    if (lengthOffset < 0) {
724        _exception = 1;
725        _exceptionType = "java/lang/IllegalArgumentException";
726        _exceptionMessage = "lengthOffset < 0";
727        goto exit;
728    }
729    _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset;
730    length_base = (GLsizei *)
731        _env->GetIntArrayElements(length_ref, (jboolean *)0);
732    length = length_base + lengthOffset;
733
734    if (!params_ref) {
735        _exception = 1;
736        _exceptionType = "java/lang/IllegalArgumentException";
737        _exceptionMessage = "params == null";
738        goto exit;
739    }
740    if (paramsOffset < 0) {
741        _exception = 1;
742        _exceptionType = "java/lang/IllegalArgumentException";
743        _exceptionMessage = "paramsOffset < 0";
744        goto exit;
745    }
746    _paramsRemaining = _env->GetArrayLength(params_ref) - paramsOffset;
747    params_base = (GLint *)
748        _env->GetIntArrayElements(params_ref, (jboolean *)0);
749    params = params_base + paramsOffset;
750
751    glGetProgramResourceiv(
752        (GLuint)program,
753        (GLenum)programInterface,
754        (GLuint)index,
755        (GLsizei)propCount,
756        (GLenum *)props,
757        (GLsizei)bufSize,
758        (GLsizei *)length,
759        (GLint *)params
760    );
761
762exit:
763    if (params_base) {
764        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
765            _exception ? JNI_ABORT: 0);
766    }
767    if (length_base) {
768        _env->ReleaseIntArrayElements(length_ref, (jint*)length_base,
769            _exception ? JNI_ABORT: 0);
770    }
771    if (props_base) {
772        _env->ReleaseIntArrayElements(props_ref, (jint*)props_base,
773            JNI_ABORT);
774    }
775    if (_exception) {
776        jniThrowException(_env, _exceptionType, _exceptionMessage);
777    }
778}
779
780/* void glGetProgramResourceiv ( GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum *props, GLsizei bufSize, GLsizei *length, GLint *params ) */
781static void
782android_glGetProgramResourceiv__IIIILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
783  (JNIEnv *_env, jobject _this, jint program, jint programInterface, jint index, jint propCount, jobject props_buf, jint bufSize, jobject length_buf, jobject params_buf) {
784    jintArray _propsArray = (jintArray) 0;
785    jint _propsBufferOffset = (jint) 0;
786    jintArray _lengthArray = (jintArray) 0;
787    jint _lengthBufferOffset = (jint) 0;
788    jintArray _paramsArray = (jintArray) 0;
789    jint _paramsBufferOffset = (jint) 0;
790    jint _propsRemaining;
791    GLenum *props = (GLenum *) 0;
792    jint _lengthRemaining;
793    GLsizei *length = (GLsizei *) 0;
794    jint _paramsRemaining;
795    GLint *params = (GLint *) 0;
796
797    props = (GLenum *)getPointer(_env, props_buf, (jarray*)&_propsArray, &_propsRemaining, &_propsBufferOffset);
798    length = (GLsizei *)getPointer(_env, length_buf, (jarray*)&_lengthArray, &_lengthRemaining, &_lengthBufferOffset);
799    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_paramsArray, &_paramsRemaining, &_paramsBufferOffset);
800    if (props == NULL) {
801        char * _propsBase = (char *)_env->GetIntArrayElements(_propsArray, (jboolean *) 0);
802        props = (GLenum *) (_propsBase + _propsBufferOffset);
803    }
804    if (length == NULL) {
805        char * _lengthBase = (char *)_env->GetIntArrayElements(_lengthArray, (jboolean *) 0);
806        length = (GLsizei *) (_lengthBase + _lengthBufferOffset);
807    }
808    if (params == NULL) {
809        char * _paramsBase = (char *)_env->GetIntArrayElements(_paramsArray, (jboolean *) 0);
810        params = (GLint *) (_paramsBase + _paramsBufferOffset);
811    }
812    glGetProgramResourceiv(
813        (GLuint)program,
814        (GLenum)programInterface,
815        (GLuint)index,
816        (GLsizei)propCount,
817        (GLenum *)props,
818        (GLsizei)bufSize,
819        (GLsizei *)length,
820        (GLint *)params
821    );
822    if (_paramsArray) {
823        _env->ReleaseIntArrayElements(_paramsArray, (jint*)params, 0);
824    }
825    if (_lengthArray) {
826        _env->ReleaseIntArrayElements(_lengthArray, (jint*)length, 0);
827    }
828    if (_propsArray) {
829        _env->ReleaseIntArrayElements(_propsArray, (jint*)props, JNI_ABORT);
830    }
831}
832
833/* GLint glGetProgramResourceLocation ( GLuint program, GLenum programInterface, const GLchar *name ) */
834static jint
835android_glGetProgramResourceLocation__IILjava_lang_String_2
836  (JNIEnv *_env, jobject _this, jint program, jint programInterface, jstring name) {
837    jint _exception = 0;
838    const char * _exceptionType = NULL;
839    const char * _exceptionMessage = NULL;
840    GLint _returnValue = 0;
841    const char* _nativename = 0;
842
843    if (!name) {
844        _exception = 1;
845        _exceptionType = "java/lang/IllegalArgumentException";
846        _exceptionMessage = "name == null";
847        goto exit;
848    }
849    _nativename = _env->GetStringUTFChars(name, 0);
850
851    _returnValue = glGetProgramResourceLocation(
852        (GLuint)program,
853        (GLenum)programInterface,
854        (GLchar *)_nativename
855    );
856
857exit:
858    if (_nativename) {
859        _env->ReleaseStringUTFChars(name, _nativename);
860    }
861
862    if (_exception) {
863        jniThrowException(_env, _exceptionType, _exceptionMessage);
864    }
865    return (jint)_returnValue;
866}
867
868/* void glUseProgramStages ( GLuint pipeline, GLbitfield stages, GLuint program ) */
869static void
870android_glUseProgramStages__III
871  (JNIEnv *_env, jobject _this, jint pipeline, jint stages, jint program) {
872    glUseProgramStages(
873        (GLuint)pipeline,
874        (GLbitfield)stages,
875        (GLuint)program
876    );
877}
878
879/* void glActiveShaderProgram ( GLuint pipeline, GLuint program ) */
880static void
881android_glActiveShaderProgram__II
882  (JNIEnv *_env, jobject _this, jint pipeline, jint program) {
883    glActiveShaderProgram(
884        (GLuint)pipeline,
885        (GLuint)program
886    );
887}
888
889/* GLuint glCreateShaderProgramv ( GLenum type, GLsizei count, const GLchar *const *strings ) */
890static jint
891android_glCreateShaderProgramv
892  (JNIEnv *_env, jobject _this, jint type, jobjectArray strings) {
893
894    jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
895    return 0;
896}
897/* void glBindProgramPipeline ( GLuint pipeline ) */
898static void
899android_glBindProgramPipeline__I
900  (JNIEnv *_env, jobject _this, jint pipeline) {
901    glBindProgramPipeline(
902        (GLuint)pipeline
903    );
904}
905
906/* void glDeleteProgramPipelines ( GLsizei n, const GLuint *pipelines ) */
907static void
908android_glDeleteProgramPipelines__I_3II
909  (JNIEnv *_env, jobject _this, jint n, jintArray pipelines_ref, jint offset) {
910    jint _exception = 0;
911    const char * _exceptionType = NULL;
912    const char * _exceptionMessage = NULL;
913    GLuint *pipelines_base = (GLuint *) 0;
914    jint _remaining;
915    GLuint *pipelines = (GLuint *) 0;
916
917    if (!pipelines_ref) {
918        _exception = 1;
919        _exceptionType = "java/lang/IllegalArgumentException";
920        _exceptionMessage = "pipelines == null";
921        goto exit;
922    }
923    if (offset < 0) {
924        _exception = 1;
925        _exceptionType = "java/lang/IllegalArgumentException";
926        _exceptionMessage = "offset < 0";
927        goto exit;
928    }
929    _remaining = _env->GetArrayLength(pipelines_ref) - offset;
930    pipelines_base = (GLuint *)
931        _env->GetIntArrayElements(pipelines_ref, (jboolean *)0);
932    pipelines = pipelines_base + offset;
933
934    glDeleteProgramPipelines(
935        (GLsizei)n,
936        (GLuint *)pipelines
937    );
938
939exit:
940    if (pipelines_base) {
941        _env->ReleaseIntArrayElements(pipelines_ref, (jint*)pipelines_base,
942            JNI_ABORT);
943    }
944    if (_exception) {
945        jniThrowException(_env, _exceptionType, _exceptionMessage);
946    }
947}
948
949/* void glDeleteProgramPipelines ( GLsizei n, const GLuint *pipelines ) */
950static void
951android_glDeleteProgramPipelines__ILjava_nio_IntBuffer_2
952  (JNIEnv *_env, jobject _this, jint n, jobject pipelines_buf) {
953    jintArray _array = (jintArray) 0;
954    jint _bufferOffset = (jint) 0;
955    jint _remaining;
956    GLuint *pipelines = (GLuint *) 0;
957
958    pipelines = (GLuint *)getPointer(_env, pipelines_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
959    if (pipelines == NULL) {
960        char * _pipelinesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
961        pipelines = (GLuint *) (_pipelinesBase + _bufferOffset);
962    }
963    glDeleteProgramPipelines(
964        (GLsizei)n,
965        (GLuint *)pipelines
966    );
967    if (_array) {
968        _env->ReleaseIntArrayElements(_array, (jint*)pipelines, JNI_ABORT);
969    }
970}
971
972/* void glGenProgramPipelines ( GLsizei n, GLuint *pipelines ) */
973static void
974android_glGenProgramPipelines__I_3II
975  (JNIEnv *_env, jobject _this, jint n, jintArray pipelines_ref, jint offset) {
976    jint _exception = 0;
977    const char * _exceptionType = NULL;
978    const char * _exceptionMessage = NULL;
979    GLuint *pipelines_base = (GLuint *) 0;
980    jint _remaining;
981    GLuint *pipelines = (GLuint *) 0;
982
983    if (!pipelines_ref) {
984        _exception = 1;
985        _exceptionType = "java/lang/IllegalArgumentException";
986        _exceptionMessage = "pipelines == null";
987        goto exit;
988    }
989    if (offset < 0) {
990        _exception = 1;
991        _exceptionType = "java/lang/IllegalArgumentException";
992        _exceptionMessage = "offset < 0";
993        goto exit;
994    }
995    _remaining = _env->GetArrayLength(pipelines_ref) - offset;
996    pipelines_base = (GLuint *)
997        _env->GetIntArrayElements(pipelines_ref, (jboolean *)0);
998    pipelines = pipelines_base + offset;
999
1000    glGenProgramPipelines(
1001        (GLsizei)n,
1002        (GLuint *)pipelines
1003    );
1004
1005exit:
1006    if (pipelines_base) {
1007        _env->ReleaseIntArrayElements(pipelines_ref, (jint*)pipelines_base,
1008            _exception ? JNI_ABORT: 0);
1009    }
1010    if (_exception) {
1011        jniThrowException(_env, _exceptionType, _exceptionMessage);
1012    }
1013}
1014
1015/* void glGenProgramPipelines ( GLsizei n, GLuint *pipelines ) */
1016static void
1017android_glGenProgramPipelines__ILjava_nio_IntBuffer_2
1018  (JNIEnv *_env, jobject _this, jint n, jobject pipelines_buf) {
1019    jintArray _array = (jintArray) 0;
1020    jint _bufferOffset = (jint) 0;
1021    jint _remaining;
1022    GLuint *pipelines = (GLuint *) 0;
1023
1024    pipelines = (GLuint *)getPointer(_env, pipelines_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1025    if (pipelines == NULL) {
1026        char * _pipelinesBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1027        pipelines = (GLuint *) (_pipelinesBase + _bufferOffset);
1028    }
1029    glGenProgramPipelines(
1030        (GLsizei)n,
1031        (GLuint *)pipelines
1032    );
1033    if (_array) {
1034        _env->ReleaseIntArrayElements(_array, (jint*)pipelines, 0);
1035    }
1036}
1037
1038/* GLboolean glIsProgramPipeline ( GLuint pipeline ) */
1039static jboolean
1040android_glIsProgramPipeline__I
1041  (JNIEnv *_env, jobject _this, jint pipeline) {
1042    GLboolean _returnValue;
1043    _returnValue = glIsProgramPipeline(
1044        (GLuint)pipeline
1045    );
1046    return (jboolean)_returnValue;
1047}
1048
1049/* void glGetProgramPipelineiv ( GLuint pipeline, GLenum pname, GLint *params ) */
1050static void
1051android_glGetProgramPipelineiv__II_3II
1052  (JNIEnv *_env, jobject _this, jint pipeline, jint pname, jintArray params_ref, jint offset) {
1053    jint _exception = 0;
1054    const char * _exceptionType = NULL;
1055    const char * _exceptionMessage = NULL;
1056    GLint *params_base = (GLint *) 0;
1057    jint _remaining;
1058    GLint *params = (GLint *) 0;
1059
1060    if (!params_ref) {
1061        _exception = 1;
1062        _exceptionType = "java/lang/IllegalArgumentException";
1063        _exceptionMessage = "params == null";
1064        goto exit;
1065    }
1066    if (offset < 0) {
1067        _exception = 1;
1068        _exceptionType = "java/lang/IllegalArgumentException";
1069        _exceptionMessage = "offset < 0";
1070        goto exit;
1071    }
1072    _remaining = _env->GetArrayLength(params_ref) - offset;
1073    params_base = (GLint *)
1074        _env->GetIntArrayElements(params_ref, (jboolean *)0);
1075    params = params_base + offset;
1076
1077    glGetProgramPipelineiv(
1078        (GLuint)pipeline,
1079        (GLenum)pname,
1080        (GLint *)params
1081    );
1082
1083exit:
1084    if (params_base) {
1085        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
1086            _exception ? JNI_ABORT: 0);
1087    }
1088    if (_exception) {
1089        jniThrowException(_env, _exceptionType, _exceptionMessage);
1090    }
1091}
1092
1093/* void glGetProgramPipelineiv ( GLuint pipeline, GLenum pname, GLint *params ) */
1094static void
1095android_glGetProgramPipelineiv__IILjava_nio_IntBuffer_2
1096  (JNIEnv *_env, jobject _this, jint pipeline, jint pname, jobject params_buf) {
1097    jintArray _array = (jintArray) 0;
1098    jint _bufferOffset = (jint) 0;
1099    jint _remaining;
1100    GLint *params = (GLint *) 0;
1101
1102    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1103    if (params == NULL) {
1104        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1105        params = (GLint *) (_paramsBase + _bufferOffset);
1106    }
1107    glGetProgramPipelineiv(
1108        (GLuint)pipeline,
1109        (GLenum)pname,
1110        (GLint *)params
1111    );
1112    if (_array) {
1113        _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
1114    }
1115}
1116
1117/* void glProgramUniform1i ( GLuint program, GLint location, GLint v0 ) */
1118static void
1119android_glProgramUniform1i__III
1120  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0) {
1121    glProgramUniform1i(
1122        (GLuint)program,
1123        (GLint)location,
1124        (GLint)v0
1125    );
1126}
1127
1128/* void glProgramUniform2i ( GLuint program, GLint location, GLint v0, GLint v1 ) */
1129static void
1130android_glProgramUniform2i__IIII
1131  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0, jint v1) {
1132    glProgramUniform2i(
1133        (GLuint)program,
1134        (GLint)location,
1135        (GLint)v0,
1136        (GLint)v1
1137    );
1138}
1139
1140/* void glProgramUniform3i ( GLuint program, GLint location, GLint v0, GLint v1, GLint v2 ) */
1141static void
1142android_glProgramUniform3i__IIIII
1143  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0, jint v1, jint v2) {
1144    glProgramUniform3i(
1145        (GLuint)program,
1146        (GLint)location,
1147        (GLint)v0,
1148        (GLint)v1,
1149        (GLint)v2
1150    );
1151}
1152
1153/* void glProgramUniform4i ( GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3 ) */
1154static void
1155android_glProgramUniform4i__IIIIII
1156  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0, jint v1, jint v2, jint v3) {
1157    glProgramUniform4i(
1158        (GLuint)program,
1159        (GLint)location,
1160        (GLint)v0,
1161        (GLint)v1,
1162        (GLint)v2,
1163        (GLint)v3
1164    );
1165}
1166
1167/* void glProgramUniform1ui ( GLuint program, GLint location, GLuint v0 ) */
1168static void
1169android_glProgramUniform1ui__III
1170  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0) {
1171    glProgramUniform1ui(
1172        (GLuint)program,
1173        (GLint)location,
1174        (GLuint)v0
1175    );
1176}
1177
1178/* void glProgramUniform2ui ( GLuint program, GLint location, GLuint v0, GLuint v1 ) */
1179static void
1180android_glProgramUniform2ui__IIII
1181  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0, jint v1) {
1182    glProgramUniform2ui(
1183        (GLuint)program,
1184        (GLint)location,
1185        (GLuint)v0,
1186        (GLuint)v1
1187    );
1188}
1189
1190/* void glProgramUniform3ui ( GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2 ) */
1191static void
1192android_glProgramUniform3ui__IIIII
1193  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0, jint v1, jint v2) {
1194    glProgramUniform3ui(
1195        (GLuint)program,
1196        (GLint)location,
1197        (GLuint)v0,
1198        (GLuint)v1,
1199        (GLuint)v2
1200    );
1201}
1202
1203/* void glProgramUniform4ui ( GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) */
1204static void
1205android_glProgramUniform4ui__IIIIII
1206  (JNIEnv *_env, jobject _this, jint program, jint location, jint v0, jint v1, jint v2, jint v3) {
1207    glProgramUniform4ui(
1208        (GLuint)program,
1209        (GLint)location,
1210        (GLuint)v0,
1211        (GLuint)v1,
1212        (GLuint)v2,
1213        (GLuint)v3
1214    );
1215}
1216
1217/* void glProgramUniform1f ( GLuint program, GLint location, GLfloat v0 ) */
1218static void
1219android_glProgramUniform1f__IIF
1220  (JNIEnv *_env, jobject _this, jint program, jint location, jfloat v0) {
1221    glProgramUniform1f(
1222        (GLuint)program,
1223        (GLint)location,
1224        (GLfloat)v0
1225    );
1226}
1227
1228/* void glProgramUniform2f ( GLuint program, GLint location, GLfloat v0, GLfloat v1 ) */
1229static void
1230android_glProgramUniform2f__IIFF
1231  (JNIEnv *_env, jobject _this, jint program, jint location, jfloat v0, jfloat v1) {
1232    glProgramUniform2f(
1233        (GLuint)program,
1234        (GLint)location,
1235        (GLfloat)v0,
1236        (GLfloat)v1
1237    );
1238}
1239
1240/* void glProgramUniform3f ( GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2 ) */
1241static void
1242android_glProgramUniform3f__IIFFF
1243  (JNIEnv *_env, jobject _this, jint program, jint location, jfloat v0, jfloat v1, jfloat v2) {
1244    glProgramUniform3f(
1245        (GLuint)program,
1246        (GLint)location,
1247        (GLfloat)v0,
1248        (GLfloat)v1,
1249        (GLfloat)v2
1250    );
1251}
1252
1253/* void glProgramUniform4f ( GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3 ) */
1254static void
1255android_glProgramUniform4f__IIFFFF
1256  (JNIEnv *_env, jobject _this, jint program, jint location, jfloat v0, jfloat v1, jfloat v2, jfloat v3) {
1257    glProgramUniform4f(
1258        (GLuint)program,
1259        (GLint)location,
1260        (GLfloat)v0,
1261        (GLfloat)v1,
1262        (GLfloat)v2,
1263        (GLfloat)v3
1264    );
1265}
1266
1267/* void glProgramUniform1iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1268static void
1269android_glProgramUniform1iv__III_3II
1270  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1271    jint _exception = 0;
1272    const char * _exceptionType = NULL;
1273    const char * _exceptionMessage = NULL;
1274    GLint *value_base = (GLint *) 0;
1275    jint _remaining;
1276    GLint *value = (GLint *) 0;
1277
1278    if (!value_ref) {
1279        _exception = 1;
1280        _exceptionType = "java/lang/IllegalArgumentException";
1281        _exceptionMessage = "value == null";
1282        goto exit;
1283    }
1284    if (offset < 0) {
1285        _exception = 1;
1286        _exceptionType = "java/lang/IllegalArgumentException";
1287        _exceptionMessage = "offset < 0";
1288        goto exit;
1289    }
1290    _remaining = _env->GetArrayLength(value_ref) - offset;
1291    value_base = (GLint *)
1292        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1293    value = value_base + offset;
1294
1295    glProgramUniform1iv(
1296        (GLuint)program,
1297        (GLint)location,
1298        (GLsizei)count,
1299        (GLint *)value
1300    );
1301
1302exit:
1303    if (value_base) {
1304        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1305            JNI_ABORT);
1306    }
1307    if (_exception) {
1308        jniThrowException(_env, _exceptionType, _exceptionMessage);
1309    }
1310}
1311
1312/* void glProgramUniform1iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1313static void
1314android_glProgramUniform1iv__IIILjava_nio_IntBuffer_2
1315  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1316    jintArray _array = (jintArray) 0;
1317    jint _bufferOffset = (jint) 0;
1318    jint _remaining;
1319    GLint *value = (GLint *) 0;
1320
1321    value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1322    if (value == NULL) {
1323        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1324        value = (GLint *) (_valueBase + _bufferOffset);
1325    }
1326    glProgramUniform1iv(
1327        (GLuint)program,
1328        (GLint)location,
1329        (GLsizei)count,
1330        (GLint *)value
1331    );
1332    if (_array) {
1333        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1334    }
1335}
1336
1337/* void glProgramUniform2iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1338static void
1339android_glProgramUniform2iv__III_3II
1340  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1341    jint _exception = 0;
1342    const char * _exceptionType = NULL;
1343    const char * _exceptionMessage = NULL;
1344    GLint *value_base = (GLint *) 0;
1345    jint _remaining;
1346    GLint *value = (GLint *) 0;
1347
1348    if (!value_ref) {
1349        _exception = 1;
1350        _exceptionType = "java/lang/IllegalArgumentException";
1351        _exceptionMessage = "value == null";
1352        goto exit;
1353    }
1354    if (offset < 0) {
1355        _exception = 1;
1356        _exceptionType = "java/lang/IllegalArgumentException";
1357        _exceptionMessage = "offset < 0";
1358        goto exit;
1359    }
1360    _remaining = _env->GetArrayLength(value_ref) - offset;
1361    value_base = (GLint *)
1362        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1363    value = value_base + offset;
1364
1365    glProgramUniform2iv(
1366        (GLuint)program,
1367        (GLint)location,
1368        (GLsizei)count,
1369        (GLint *)value
1370    );
1371
1372exit:
1373    if (value_base) {
1374        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1375            JNI_ABORT);
1376    }
1377    if (_exception) {
1378        jniThrowException(_env, _exceptionType, _exceptionMessage);
1379    }
1380}
1381
1382/* void glProgramUniform2iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1383static void
1384android_glProgramUniform2iv__IIILjava_nio_IntBuffer_2
1385  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1386    jintArray _array = (jintArray) 0;
1387    jint _bufferOffset = (jint) 0;
1388    jint _remaining;
1389    GLint *value = (GLint *) 0;
1390
1391    value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1392    if (value == NULL) {
1393        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1394        value = (GLint *) (_valueBase + _bufferOffset);
1395    }
1396    glProgramUniform2iv(
1397        (GLuint)program,
1398        (GLint)location,
1399        (GLsizei)count,
1400        (GLint *)value
1401    );
1402    if (_array) {
1403        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1404    }
1405}
1406
1407/* void glProgramUniform3iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1408static void
1409android_glProgramUniform3iv__III_3II
1410  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1411    jint _exception = 0;
1412    const char * _exceptionType = NULL;
1413    const char * _exceptionMessage = NULL;
1414    GLint *value_base = (GLint *) 0;
1415    jint _remaining;
1416    GLint *value = (GLint *) 0;
1417
1418    if (!value_ref) {
1419        _exception = 1;
1420        _exceptionType = "java/lang/IllegalArgumentException";
1421        _exceptionMessage = "value == null";
1422        goto exit;
1423    }
1424    if (offset < 0) {
1425        _exception = 1;
1426        _exceptionType = "java/lang/IllegalArgumentException";
1427        _exceptionMessage = "offset < 0";
1428        goto exit;
1429    }
1430    _remaining = _env->GetArrayLength(value_ref) - offset;
1431    value_base = (GLint *)
1432        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1433    value = value_base + offset;
1434
1435    glProgramUniform3iv(
1436        (GLuint)program,
1437        (GLint)location,
1438        (GLsizei)count,
1439        (GLint *)value
1440    );
1441
1442exit:
1443    if (value_base) {
1444        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1445            JNI_ABORT);
1446    }
1447    if (_exception) {
1448        jniThrowException(_env, _exceptionType, _exceptionMessage);
1449    }
1450}
1451
1452/* void glProgramUniform3iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1453static void
1454android_glProgramUniform3iv__IIILjava_nio_IntBuffer_2
1455  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1456    jintArray _array = (jintArray) 0;
1457    jint _bufferOffset = (jint) 0;
1458    jint _remaining;
1459    GLint *value = (GLint *) 0;
1460
1461    value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1462    if (value == NULL) {
1463        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1464        value = (GLint *) (_valueBase + _bufferOffset);
1465    }
1466    glProgramUniform3iv(
1467        (GLuint)program,
1468        (GLint)location,
1469        (GLsizei)count,
1470        (GLint *)value
1471    );
1472    if (_array) {
1473        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1474    }
1475}
1476
1477/* void glProgramUniform4iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1478static void
1479android_glProgramUniform4iv__III_3II
1480  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1481    jint _exception = 0;
1482    const char * _exceptionType = NULL;
1483    const char * _exceptionMessage = NULL;
1484    GLint *value_base = (GLint *) 0;
1485    jint _remaining;
1486    GLint *value = (GLint *) 0;
1487
1488    if (!value_ref) {
1489        _exception = 1;
1490        _exceptionType = "java/lang/IllegalArgumentException";
1491        _exceptionMessage = "value == null";
1492        goto exit;
1493    }
1494    if (offset < 0) {
1495        _exception = 1;
1496        _exceptionType = "java/lang/IllegalArgumentException";
1497        _exceptionMessage = "offset < 0";
1498        goto exit;
1499    }
1500    _remaining = _env->GetArrayLength(value_ref) - offset;
1501    value_base = (GLint *)
1502        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1503    value = value_base + offset;
1504
1505    glProgramUniform4iv(
1506        (GLuint)program,
1507        (GLint)location,
1508        (GLsizei)count,
1509        (GLint *)value
1510    );
1511
1512exit:
1513    if (value_base) {
1514        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1515            JNI_ABORT);
1516    }
1517    if (_exception) {
1518        jniThrowException(_env, _exceptionType, _exceptionMessage);
1519    }
1520}
1521
1522/* void glProgramUniform4iv ( GLuint program, GLint location, GLsizei count, const GLint *value ) */
1523static void
1524android_glProgramUniform4iv__IIILjava_nio_IntBuffer_2
1525  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1526    jintArray _array = (jintArray) 0;
1527    jint _bufferOffset = (jint) 0;
1528    jint _remaining;
1529    GLint *value = (GLint *) 0;
1530
1531    value = (GLint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1532    if (value == NULL) {
1533        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1534        value = (GLint *) (_valueBase + _bufferOffset);
1535    }
1536    glProgramUniform4iv(
1537        (GLuint)program,
1538        (GLint)location,
1539        (GLsizei)count,
1540        (GLint *)value
1541    );
1542    if (_array) {
1543        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1544    }
1545}
1546
1547/* void glProgramUniform1uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1548static void
1549android_glProgramUniform1uiv__III_3II
1550  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1551    jint _exception = 0;
1552    const char * _exceptionType = NULL;
1553    const char * _exceptionMessage = NULL;
1554    GLuint *value_base = (GLuint *) 0;
1555    jint _remaining;
1556    GLuint *value = (GLuint *) 0;
1557
1558    if (!value_ref) {
1559        _exception = 1;
1560        _exceptionType = "java/lang/IllegalArgumentException";
1561        _exceptionMessage = "value == null";
1562        goto exit;
1563    }
1564    if (offset < 0) {
1565        _exception = 1;
1566        _exceptionType = "java/lang/IllegalArgumentException";
1567        _exceptionMessage = "offset < 0";
1568        goto exit;
1569    }
1570    _remaining = _env->GetArrayLength(value_ref) - offset;
1571    value_base = (GLuint *)
1572        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1573    value = value_base + offset;
1574
1575    glProgramUniform1uiv(
1576        (GLuint)program,
1577        (GLint)location,
1578        (GLsizei)count,
1579        (GLuint *)value
1580    );
1581
1582exit:
1583    if (value_base) {
1584        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1585            JNI_ABORT);
1586    }
1587    if (_exception) {
1588        jniThrowException(_env, _exceptionType, _exceptionMessage);
1589    }
1590}
1591
1592/* void glProgramUniform1uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1593static void
1594android_glProgramUniform1uiv__IIILjava_nio_IntBuffer_2
1595  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1596    jintArray _array = (jintArray) 0;
1597    jint _bufferOffset = (jint) 0;
1598    jint _remaining;
1599    GLuint *value = (GLuint *) 0;
1600
1601    value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1602    if (value == NULL) {
1603        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1604        value = (GLuint *) (_valueBase + _bufferOffset);
1605    }
1606    glProgramUniform1uiv(
1607        (GLuint)program,
1608        (GLint)location,
1609        (GLsizei)count,
1610        (GLuint *)value
1611    );
1612    if (_array) {
1613        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1614    }
1615}
1616
1617/* void glProgramUniform2uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1618static void
1619android_glProgramUniform2uiv__III_3II
1620  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1621    jint _exception = 0;
1622    const char * _exceptionType = NULL;
1623    const char * _exceptionMessage = NULL;
1624    GLuint *value_base = (GLuint *) 0;
1625    jint _remaining;
1626    GLuint *value = (GLuint *) 0;
1627
1628    if (!value_ref) {
1629        _exception = 1;
1630        _exceptionType = "java/lang/IllegalArgumentException";
1631        _exceptionMessage = "value == null";
1632        goto exit;
1633    }
1634    if (offset < 0) {
1635        _exception = 1;
1636        _exceptionType = "java/lang/IllegalArgumentException";
1637        _exceptionMessage = "offset < 0";
1638        goto exit;
1639    }
1640    _remaining = _env->GetArrayLength(value_ref) - offset;
1641    value_base = (GLuint *)
1642        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1643    value = value_base + offset;
1644
1645    glProgramUniform2uiv(
1646        (GLuint)program,
1647        (GLint)location,
1648        (GLsizei)count,
1649        (GLuint *)value
1650    );
1651
1652exit:
1653    if (value_base) {
1654        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1655            JNI_ABORT);
1656    }
1657    if (_exception) {
1658        jniThrowException(_env, _exceptionType, _exceptionMessage);
1659    }
1660}
1661
1662/* void glProgramUniform2uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1663static void
1664android_glProgramUniform2uiv__IIILjava_nio_IntBuffer_2
1665  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1666    jintArray _array = (jintArray) 0;
1667    jint _bufferOffset = (jint) 0;
1668    jint _remaining;
1669    GLuint *value = (GLuint *) 0;
1670
1671    value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1672    if (value == NULL) {
1673        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1674        value = (GLuint *) (_valueBase + _bufferOffset);
1675    }
1676    glProgramUniform2uiv(
1677        (GLuint)program,
1678        (GLint)location,
1679        (GLsizei)count,
1680        (GLuint *)value
1681    );
1682    if (_array) {
1683        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1684    }
1685}
1686
1687/* void glProgramUniform3uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1688static void
1689android_glProgramUniform3uiv__III_3II
1690  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1691    jint _exception = 0;
1692    const char * _exceptionType = NULL;
1693    const char * _exceptionMessage = NULL;
1694    GLuint *value_base = (GLuint *) 0;
1695    jint _remaining;
1696    GLuint *value = (GLuint *) 0;
1697
1698    if (!value_ref) {
1699        _exception = 1;
1700        _exceptionType = "java/lang/IllegalArgumentException";
1701        _exceptionMessage = "value == null";
1702        goto exit;
1703    }
1704    if (offset < 0) {
1705        _exception = 1;
1706        _exceptionType = "java/lang/IllegalArgumentException";
1707        _exceptionMessage = "offset < 0";
1708        goto exit;
1709    }
1710    _remaining = _env->GetArrayLength(value_ref) - offset;
1711    value_base = (GLuint *)
1712        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1713    value = value_base + offset;
1714
1715    glProgramUniform3uiv(
1716        (GLuint)program,
1717        (GLint)location,
1718        (GLsizei)count,
1719        (GLuint *)value
1720    );
1721
1722exit:
1723    if (value_base) {
1724        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1725            JNI_ABORT);
1726    }
1727    if (_exception) {
1728        jniThrowException(_env, _exceptionType, _exceptionMessage);
1729    }
1730}
1731
1732/* void glProgramUniform3uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1733static void
1734android_glProgramUniform3uiv__IIILjava_nio_IntBuffer_2
1735  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1736    jintArray _array = (jintArray) 0;
1737    jint _bufferOffset = (jint) 0;
1738    jint _remaining;
1739    GLuint *value = (GLuint *) 0;
1740
1741    value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1742    if (value == NULL) {
1743        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1744        value = (GLuint *) (_valueBase + _bufferOffset);
1745    }
1746    glProgramUniform3uiv(
1747        (GLuint)program,
1748        (GLint)location,
1749        (GLsizei)count,
1750        (GLuint *)value
1751    );
1752    if (_array) {
1753        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1754    }
1755}
1756
1757/* void glProgramUniform4uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1758static void
1759android_glProgramUniform4uiv__III_3II
1760  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jintArray value_ref, jint offset) {
1761    jint _exception = 0;
1762    const char * _exceptionType = NULL;
1763    const char * _exceptionMessage = NULL;
1764    GLuint *value_base = (GLuint *) 0;
1765    jint _remaining;
1766    GLuint *value = (GLuint *) 0;
1767
1768    if (!value_ref) {
1769        _exception = 1;
1770        _exceptionType = "java/lang/IllegalArgumentException";
1771        _exceptionMessage = "value == null";
1772        goto exit;
1773    }
1774    if (offset < 0) {
1775        _exception = 1;
1776        _exceptionType = "java/lang/IllegalArgumentException";
1777        _exceptionMessage = "offset < 0";
1778        goto exit;
1779    }
1780    _remaining = _env->GetArrayLength(value_ref) - offset;
1781    value_base = (GLuint *)
1782        _env->GetIntArrayElements(value_ref, (jboolean *)0);
1783    value = value_base + offset;
1784
1785    glProgramUniform4uiv(
1786        (GLuint)program,
1787        (GLint)location,
1788        (GLsizei)count,
1789        (GLuint *)value
1790    );
1791
1792exit:
1793    if (value_base) {
1794        _env->ReleaseIntArrayElements(value_ref, (jint*)value_base,
1795            JNI_ABORT);
1796    }
1797    if (_exception) {
1798        jniThrowException(_env, _exceptionType, _exceptionMessage);
1799    }
1800}
1801
1802/* void glProgramUniform4uiv ( GLuint program, GLint location, GLsizei count, const GLuint *value ) */
1803static void
1804android_glProgramUniform4uiv__IIILjava_nio_IntBuffer_2
1805  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1806    jintArray _array = (jintArray) 0;
1807    jint _bufferOffset = (jint) 0;
1808    jint _remaining;
1809    GLuint *value = (GLuint *) 0;
1810
1811    value = (GLuint *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1812    if (value == NULL) {
1813        char * _valueBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
1814        value = (GLuint *) (_valueBase + _bufferOffset);
1815    }
1816    glProgramUniform4uiv(
1817        (GLuint)program,
1818        (GLint)location,
1819        (GLsizei)count,
1820        (GLuint *)value
1821    );
1822    if (_array) {
1823        _env->ReleaseIntArrayElements(_array, (jint*)value, JNI_ABORT);
1824    }
1825}
1826
1827/* void glProgramUniform1fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
1828static void
1829android_glProgramUniform1fv__III_3FI
1830  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jfloatArray value_ref, jint offset) {
1831    jint _exception = 0;
1832    const char * _exceptionType = NULL;
1833    const char * _exceptionMessage = NULL;
1834    GLfloat *value_base = (GLfloat *) 0;
1835    jint _remaining;
1836    GLfloat *value = (GLfloat *) 0;
1837
1838    if (!value_ref) {
1839        _exception = 1;
1840        _exceptionType = "java/lang/IllegalArgumentException";
1841        _exceptionMessage = "value == null";
1842        goto exit;
1843    }
1844    if (offset < 0) {
1845        _exception = 1;
1846        _exceptionType = "java/lang/IllegalArgumentException";
1847        _exceptionMessage = "offset < 0";
1848        goto exit;
1849    }
1850    _remaining = _env->GetArrayLength(value_ref) - offset;
1851    value_base = (GLfloat *)
1852        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
1853    value = value_base + offset;
1854
1855    glProgramUniform1fv(
1856        (GLuint)program,
1857        (GLint)location,
1858        (GLsizei)count,
1859        (GLfloat *)value
1860    );
1861
1862exit:
1863    if (value_base) {
1864        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
1865            JNI_ABORT);
1866    }
1867    if (_exception) {
1868        jniThrowException(_env, _exceptionType, _exceptionMessage);
1869    }
1870}
1871
1872/* void glProgramUniform1fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
1873static void
1874android_glProgramUniform1fv__IIILjava_nio_FloatBuffer_2
1875  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1876    jfloatArray _array = (jfloatArray) 0;
1877    jint _bufferOffset = (jint) 0;
1878    jint _remaining;
1879    GLfloat *value = (GLfloat *) 0;
1880
1881    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1882    if (value == NULL) {
1883        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1884        value = (GLfloat *) (_valueBase + _bufferOffset);
1885    }
1886    glProgramUniform1fv(
1887        (GLuint)program,
1888        (GLint)location,
1889        (GLsizei)count,
1890        (GLfloat *)value
1891    );
1892    if (_array) {
1893        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
1894    }
1895}
1896
1897/* void glProgramUniform2fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
1898static void
1899android_glProgramUniform2fv__III_3FI
1900  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jfloatArray value_ref, jint offset) {
1901    jint _exception = 0;
1902    const char * _exceptionType = NULL;
1903    const char * _exceptionMessage = NULL;
1904    GLfloat *value_base = (GLfloat *) 0;
1905    jint _remaining;
1906    GLfloat *value = (GLfloat *) 0;
1907
1908    if (!value_ref) {
1909        _exception = 1;
1910        _exceptionType = "java/lang/IllegalArgumentException";
1911        _exceptionMessage = "value == null";
1912        goto exit;
1913    }
1914    if (offset < 0) {
1915        _exception = 1;
1916        _exceptionType = "java/lang/IllegalArgumentException";
1917        _exceptionMessage = "offset < 0";
1918        goto exit;
1919    }
1920    _remaining = _env->GetArrayLength(value_ref) - offset;
1921    value_base = (GLfloat *)
1922        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
1923    value = value_base + offset;
1924
1925    glProgramUniform2fv(
1926        (GLuint)program,
1927        (GLint)location,
1928        (GLsizei)count,
1929        (GLfloat *)value
1930    );
1931
1932exit:
1933    if (value_base) {
1934        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
1935            JNI_ABORT);
1936    }
1937    if (_exception) {
1938        jniThrowException(_env, _exceptionType, _exceptionMessage);
1939    }
1940}
1941
1942/* void glProgramUniform2fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
1943static void
1944android_glProgramUniform2fv__IIILjava_nio_FloatBuffer_2
1945  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
1946    jfloatArray _array = (jfloatArray) 0;
1947    jint _bufferOffset = (jint) 0;
1948    jint _remaining;
1949    GLfloat *value = (GLfloat *) 0;
1950
1951    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
1952    if (value == NULL) {
1953        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
1954        value = (GLfloat *) (_valueBase + _bufferOffset);
1955    }
1956    glProgramUniform2fv(
1957        (GLuint)program,
1958        (GLint)location,
1959        (GLsizei)count,
1960        (GLfloat *)value
1961    );
1962    if (_array) {
1963        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
1964    }
1965}
1966
1967/* void glProgramUniform3fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
1968static void
1969android_glProgramUniform3fv__III_3FI
1970  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jfloatArray value_ref, jint offset) {
1971    jint _exception = 0;
1972    const char * _exceptionType = NULL;
1973    const char * _exceptionMessage = NULL;
1974    GLfloat *value_base = (GLfloat *) 0;
1975    jint _remaining;
1976    GLfloat *value = (GLfloat *) 0;
1977
1978    if (!value_ref) {
1979        _exception = 1;
1980        _exceptionType = "java/lang/IllegalArgumentException";
1981        _exceptionMessage = "value == null";
1982        goto exit;
1983    }
1984    if (offset < 0) {
1985        _exception = 1;
1986        _exceptionType = "java/lang/IllegalArgumentException";
1987        _exceptionMessage = "offset < 0";
1988        goto exit;
1989    }
1990    _remaining = _env->GetArrayLength(value_ref) - offset;
1991    value_base = (GLfloat *)
1992        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
1993    value = value_base + offset;
1994
1995    glProgramUniform3fv(
1996        (GLuint)program,
1997        (GLint)location,
1998        (GLsizei)count,
1999        (GLfloat *)value
2000    );
2001
2002exit:
2003    if (value_base) {
2004        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2005            JNI_ABORT);
2006    }
2007    if (_exception) {
2008        jniThrowException(_env, _exceptionType, _exceptionMessage);
2009    }
2010}
2011
2012/* void glProgramUniform3fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
2013static void
2014android_glProgramUniform3fv__IIILjava_nio_FloatBuffer_2
2015  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
2016    jfloatArray _array = (jfloatArray) 0;
2017    jint _bufferOffset = (jint) 0;
2018    jint _remaining;
2019    GLfloat *value = (GLfloat *) 0;
2020
2021    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2022    if (value == NULL) {
2023        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2024        value = (GLfloat *) (_valueBase + _bufferOffset);
2025    }
2026    glProgramUniform3fv(
2027        (GLuint)program,
2028        (GLint)location,
2029        (GLsizei)count,
2030        (GLfloat *)value
2031    );
2032    if (_array) {
2033        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2034    }
2035}
2036
2037/* void glProgramUniform4fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
2038static void
2039android_glProgramUniform4fv__III_3FI
2040  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jfloatArray value_ref, jint offset) {
2041    jint _exception = 0;
2042    const char * _exceptionType = NULL;
2043    const char * _exceptionMessage = NULL;
2044    GLfloat *value_base = (GLfloat *) 0;
2045    jint _remaining;
2046    GLfloat *value = (GLfloat *) 0;
2047
2048    if (!value_ref) {
2049        _exception = 1;
2050        _exceptionType = "java/lang/IllegalArgumentException";
2051        _exceptionMessage = "value == null";
2052        goto exit;
2053    }
2054    if (offset < 0) {
2055        _exception = 1;
2056        _exceptionType = "java/lang/IllegalArgumentException";
2057        _exceptionMessage = "offset < 0";
2058        goto exit;
2059    }
2060    _remaining = _env->GetArrayLength(value_ref) - offset;
2061    value_base = (GLfloat *)
2062        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2063    value = value_base + offset;
2064
2065    glProgramUniform4fv(
2066        (GLuint)program,
2067        (GLint)location,
2068        (GLsizei)count,
2069        (GLfloat *)value
2070    );
2071
2072exit:
2073    if (value_base) {
2074        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2075            JNI_ABORT);
2076    }
2077    if (_exception) {
2078        jniThrowException(_env, _exceptionType, _exceptionMessage);
2079    }
2080}
2081
2082/* void glProgramUniform4fv ( GLuint program, GLint location, GLsizei count, const GLfloat *value ) */
2083static void
2084android_glProgramUniform4fv__IIILjava_nio_FloatBuffer_2
2085  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jobject value_buf) {
2086    jfloatArray _array = (jfloatArray) 0;
2087    jint _bufferOffset = (jint) 0;
2088    jint _remaining;
2089    GLfloat *value = (GLfloat *) 0;
2090
2091    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2092    if (value == NULL) {
2093        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2094        value = (GLfloat *) (_valueBase + _bufferOffset);
2095    }
2096    glProgramUniform4fv(
2097        (GLuint)program,
2098        (GLint)location,
2099        (GLsizei)count,
2100        (GLfloat *)value
2101    );
2102    if (_array) {
2103        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2104    }
2105}
2106
2107/* void glProgramUniformMatrix2fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2108static void
2109android_glProgramUniformMatrix2fv__IIIZ_3FI
2110  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2111    jint _exception = 0;
2112    const char * _exceptionType = NULL;
2113    const char * _exceptionMessage = NULL;
2114    GLfloat *value_base = (GLfloat *) 0;
2115    jint _remaining;
2116    GLfloat *value = (GLfloat *) 0;
2117
2118    if (!value_ref) {
2119        _exception = 1;
2120        _exceptionType = "java/lang/IllegalArgumentException";
2121        _exceptionMessage = "value == null";
2122        goto exit;
2123    }
2124    if (offset < 0) {
2125        _exception = 1;
2126        _exceptionType = "java/lang/IllegalArgumentException";
2127        _exceptionMessage = "offset < 0";
2128        goto exit;
2129    }
2130    _remaining = _env->GetArrayLength(value_ref) - offset;
2131    value_base = (GLfloat *)
2132        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2133    value = value_base + offset;
2134
2135    glProgramUniformMatrix2fv(
2136        (GLuint)program,
2137        (GLint)location,
2138        (GLsizei)count,
2139        (GLboolean)transpose,
2140        (GLfloat *)value
2141    );
2142
2143exit:
2144    if (value_base) {
2145        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2146            JNI_ABORT);
2147    }
2148    if (_exception) {
2149        jniThrowException(_env, _exceptionType, _exceptionMessage);
2150    }
2151}
2152
2153/* void glProgramUniformMatrix2fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2154static void
2155android_glProgramUniformMatrix2fv__IIIZLjava_nio_FloatBuffer_2
2156  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2157    jfloatArray _array = (jfloatArray) 0;
2158    jint _bufferOffset = (jint) 0;
2159    jint _remaining;
2160    GLfloat *value = (GLfloat *) 0;
2161
2162    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2163    if (value == NULL) {
2164        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2165        value = (GLfloat *) (_valueBase + _bufferOffset);
2166    }
2167    glProgramUniformMatrix2fv(
2168        (GLuint)program,
2169        (GLint)location,
2170        (GLsizei)count,
2171        (GLboolean)transpose,
2172        (GLfloat *)value
2173    );
2174    if (_array) {
2175        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2176    }
2177}
2178
2179/* void glProgramUniformMatrix3fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2180static void
2181android_glProgramUniformMatrix3fv__IIIZ_3FI
2182  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2183    jint _exception = 0;
2184    const char * _exceptionType = NULL;
2185    const char * _exceptionMessage = NULL;
2186    GLfloat *value_base = (GLfloat *) 0;
2187    jint _remaining;
2188    GLfloat *value = (GLfloat *) 0;
2189
2190    if (!value_ref) {
2191        _exception = 1;
2192        _exceptionType = "java/lang/IllegalArgumentException";
2193        _exceptionMessage = "value == null";
2194        goto exit;
2195    }
2196    if (offset < 0) {
2197        _exception = 1;
2198        _exceptionType = "java/lang/IllegalArgumentException";
2199        _exceptionMessage = "offset < 0";
2200        goto exit;
2201    }
2202    _remaining = _env->GetArrayLength(value_ref) - offset;
2203    value_base = (GLfloat *)
2204        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2205    value = value_base + offset;
2206
2207    glProgramUniformMatrix3fv(
2208        (GLuint)program,
2209        (GLint)location,
2210        (GLsizei)count,
2211        (GLboolean)transpose,
2212        (GLfloat *)value
2213    );
2214
2215exit:
2216    if (value_base) {
2217        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2218            JNI_ABORT);
2219    }
2220    if (_exception) {
2221        jniThrowException(_env, _exceptionType, _exceptionMessage);
2222    }
2223}
2224
2225/* void glProgramUniformMatrix3fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2226static void
2227android_glProgramUniformMatrix3fv__IIIZLjava_nio_FloatBuffer_2
2228  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2229    jfloatArray _array = (jfloatArray) 0;
2230    jint _bufferOffset = (jint) 0;
2231    jint _remaining;
2232    GLfloat *value = (GLfloat *) 0;
2233
2234    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2235    if (value == NULL) {
2236        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2237        value = (GLfloat *) (_valueBase + _bufferOffset);
2238    }
2239    glProgramUniformMatrix3fv(
2240        (GLuint)program,
2241        (GLint)location,
2242        (GLsizei)count,
2243        (GLboolean)transpose,
2244        (GLfloat *)value
2245    );
2246    if (_array) {
2247        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2248    }
2249}
2250
2251/* void glProgramUniformMatrix4fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2252static void
2253android_glProgramUniformMatrix4fv__IIIZ_3FI
2254  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2255    jint _exception = 0;
2256    const char * _exceptionType = NULL;
2257    const char * _exceptionMessage = NULL;
2258    GLfloat *value_base = (GLfloat *) 0;
2259    jint _remaining;
2260    GLfloat *value = (GLfloat *) 0;
2261
2262    if (!value_ref) {
2263        _exception = 1;
2264        _exceptionType = "java/lang/IllegalArgumentException";
2265        _exceptionMessage = "value == null";
2266        goto exit;
2267    }
2268    if (offset < 0) {
2269        _exception = 1;
2270        _exceptionType = "java/lang/IllegalArgumentException";
2271        _exceptionMessage = "offset < 0";
2272        goto exit;
2273    }
2274    _remaining = _env->GetArrayLength(value_ref) - offset;
2275    value_base = (GLfloat *)
2276        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2277    value = value_base + offset;
2278
2279    glProgramUniformMatrix4fv(
2280        (GLuint)program,
2281        (GLint)location,
2282        (GLsizei)count,
2283        (GLboolean)transpose,
2284        (GLfloat *)value
2285    );
2286
2287exit:
2288    if (value_base) {
2289        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2290            JNI_ABORT);
2291    }
2292    if (_exception) {
2293        jniThrowException(_env, _exceptionType, _exceptionMessage);
2294    }
2295}
2296
2297/* void glProgramUniformMatrix4fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2298static void
2299android_glProgramUniformMatrix4fv__IIIZLjava_nio_FloatBuffer_2
2300  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2301    jfloatArray _array = (jfloatArray) 0;
2302    jint _bufferOffset = (jint) 0;
2303    jint _remaining;
2304    GLfloat *value = (GLfloat *) 0;
2305
2306    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2307    if (value == NULL) {
2308        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2309        value = (GLfloat *) (_valueBase + _bufferOffset);
2310    }
2311    glProgramUniformMatrix4fv(
2312        (GLuint)program,
2313        (GLint)location,
2314        (GLsizei)count,
2315        (GLboolean)transpose,
2316        (GLfloat *)value
2317    );
2318    if (_array) {
2319        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2320    }
2321}
2322
2323/* void glProgramUniformMatrix2x3fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2324static void
2325android_glProgramUniformMatrix2x3fv__IIIZ_3FI
2326  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2327    jint _exception = 0;
2328    const char * _exceptionType = NULL;
2329    const char * _exceptionMessage = NULL;
2330    GLfloat *value_base = (GLfloat *) 0;
2331    jint _remaining;
2332    GLfloat *value = (GLfloat *) 0;
2333
2334    if (!value_ref) {
2335        _exception = 1;
2336        _exceptionType = "java/lang/IllegalArgumentException";
2337        _exceptionMessage = "value == null";
2338        goto exit;
2339    }
2340    if (offset < 0) {
2341        _exception = 1;
2342        _exceptionType = "java/lang/IllegalArgumentException";
2343        _exceptionMessage = "offset < 0";
2344        goto exit;
2345    }
2346    _remaining = _env->GetArrayLength(value_ref) - offset;
2347    value_base = (GLfloat *)
2348        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2349    value = value_base + offset;
2350
2351    glProgramUniformMatrix2x3fv(
2352        (GLuint)program,
2353        (GLint)location,
2354        (GLsizei)count,
2355        (GLboolean)transpose,
2356        (GLfloat *)value
2357    );
2358
2359exit:
2360    if (value_base) {
2361        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2362            JNI_ABORT);
2363    }
2364    if (_exception) {
2365        jniThrowException(_env, _exceptionType, _exceptionMessage);
2366    }
2367}
2368
2369/* void glProgramUniformMatrix2x3fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2370static void
2371android_glProgramUniformMatrix2x3fv__IIIZLjava_nio_FloatBuffer_2
2372  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2373    jfloatArray _array = (jfloatArray) 0;
2374    jint _bufferOffset = (jint) 0;
2375    jint _remaining;
2376    GLfloat *value = (GLfloat *) 0;
2377
2378    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2379    if (value == NULL) {
2380        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2381        value = (GLfloat *) (_valueBase + _bufferOffset);
2382    }
2383    glProgramUniformMatrix2x3fv(
2384        (GLuint)program,
2385        (GLint)location,
2386        (GLsizei)count,
2387        (GLboolean)transpose,
2388        (GLfloat *)value
2389    );
2390    if (_array) {
2391        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2392    }
2393}
2394
2395/* void glProgramUniformMatrix3x2fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2396static void
2397android_glProgramUniformMatrix3x2fv__IIIZ_3FI
2398  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2399    jint _exception = 0;
2400    const char * _exceptionType = NULL;
2401    const char * _exceptionMessage = NULL;
2402    GLfloat *value_base = (GLfloat *) 0;
2403    jint _remaining;
2404    GLfloat *value = (GLfloat *) 0;
2405
2406    if (!value_ref) {
2407        _exception = 1;
2408        _exceptionType = "java/lang/IllegalArgumentException";
2409        _exceptionMessage = "value == null";
2410        goto exit;
2411    }
2412    if (offset < 0) {
2413        _exception = 1;
2414        _exceptionType = "java/lang/IllegalArgumentException";
2415        _exceptionMessage = "offset < 0";
2416        goto exit;
2417    }
2418    _remaining = _env->GetArrayLength(value_ref) - offset;
2419    value_base = (GLfloat *)
2420        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2421    value = value_base + offset;
2422
2423    glProgramUniformMatrix3x2fv(
2424        (GLuint)program,
2425        (GLint)location,
2426        (GLsizei)count,
2427        (GLboolean)transpose,
2428        (GLfloat *)value
2429    );
2430
2431exit:
2432    if (value_base) {
2433        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2434            JNI_ABORT);
2435    }
2436    if (_exception) {
2437        jniThrowException(_env, _exceptionType, _exceptionMessage);
2438    }
2439}
2440
2441/* void glProgramUniformMatrix3x2fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2442static void
2443android_glProgramUniformMatrix3x2fv__IIIZLjava_nio_FloatBuffer_2
2444  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2445    jfloatArray _array = (jfloatArray) 0;
2446    jint _bufferOffset = (jint) 0;
2447    jint _remaining;
2448    GLfloat *value = (GLfloat *) 0;
2449
2450    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2451    if (value == NULL) {
2452        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2453        value = (GLfloat *) (_valueBase + _bufferOffset);
2454    }
2455    glProgramUniformMatrix3x2fv(
2456        (GLuint)program,
2457        (GLint)location,
2458        (GLsizei)count,
2459        (GLboolean)transpose,
2460        (GLfloat *)value
2461    );
2462    if (_array) {
2463        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2464    }
2465}
2466
2467/* void glProgramUniformMatrix2x4fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2468static void
2469android_glProgramUniformMatrix2x4fv__IIIZ_3FI
2470  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2471    jint _exception = 0;
2472    const char * _exceptionType = NULL;
2473    const char * _exceptionMessage = NULL;
2474    GLfloat *value_base = (GLfloat *) 0;
2475    jint _remaining;
2476    GLfloat *value = (GLfloat *) 0;
2477
2478    if (!value_ref) {
2479        _exception = 1;
2480        _exceptionType = "java/lang/IllegalArgumentException";
2481        _exceptionMessage = "value == null";
2482        goto exit;
2483    }
2484    if (offset < 0) {
2485        _exception = 1;
2486        _exceptionType = "java/lang/IllegalArgumentException";
2487        _exceptionMessage = "offset < 0";
2488        goto exit;
2489    }
2490    _remaining = _env->GetArrayLength(value_ref) - offset;
2491    value_base = (GLfloat *)
2492        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2493    value = value_base + offset;
2494
2495    glProgramUniformMatrix2x4fv(
2496        (GLuint)program,
2497        (GLint)location,
2498        (GLsizei)count,
2499        (GLboolean)transpose,
2500        (GLfloat *)value
2501    );
2502
2503exit:
2504    if (value_base) {
2505        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2506            JNI_ABORT);
2507    }
2508    if (_exception) {
2509        jniThrowException(_env, _exceptionType, _exceptionMessage);
2510    }
2511}
2512
2513/* void glProgramUniformMatrix2x4fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2514static void
2515android_glProgramUniformMatrix2x4fv__IIIZLjava_nio_FloatBuffer_2
2516  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2517    jfloatArray _array = (jfloatArray) 0;
2518    jint _bufferOffset = (jint) 0;
2519    jint _remaining;
2520    GLfloat *value = (GLfloat *) 0;
2521
2522    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2523    if (value == NULL) {
2524        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2525        value = (GLfloat *) (_valueBase + _bufferOffset);
2526    }
2527    glProgramUniformMatrix2x4fv(
2528        (GLuint)program,
2529        (GLint)location,
2530        (GLsizei)count,
2531        (GLboolean)transpose,
2532        (GLfloat *)value
2533    );
2534    if (_array) {
2535        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2536    }
2537}
2538
2539/* void glProgramUniformMatrix4x2fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2540static void
2541android_glProgramUniformMatrix4x2fv__IIIZ_3FI
2542  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2543    jint _exception = 0;
2544    const char * _exceptionType = NULL;
2545    const char * _exceptionMessage = NULL;
2546    GLfloat *value_base = (GLfloat *) 0;
2547    jint _remaining;
2548    GLfloat *value = (GLfloat *) 0;
2549
2550    if (!value_ref) {
2551        _exception = 1;
2552        _exceptionType = "java/lang/IllegalArgumentException";
2553        _exceptionMessage = "value == null";
2554        goto exit;
2555    }
2556    if (offset < 0) {
2557        _exception = 1;
2558        _exceptionType = "java/lang/IllegalArgumentException";
2559        _exceptionMessage = "offset < 0";
2560        goto exit;
2561    }
2562    _remaining = _env->GetArrayLength(value_ref) - offset;
2563    value_base = (GLfloat *)
2564        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2565    value = value_base + offset;
2566
2567    glProgramUniformMatrix4x2fv(
2568        (GLuint)program,
2569        (GLint)location,
2570        (GLsizei)count,
2571        (GLboolean)transpose,
2572        (GLfloat *)value
2573    );
2574
2575exit:
2576    if (value_base) {
2577        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2578            JNI_ABORT);
2579    }
2580    if (_exception) {
2581        jniThrowException(_env, _exceptionType, _exceptionMessage);
2582    }
2583}
2584
2585/* void glProgramUniformMatrix4x2fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2586static void
2587android_glProgramUniformMatrix4x2fv__IIIZLjava_nio_FloatBuffer_2
2588  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2589    jfloatArray _array = (jfloatArray) 0;
2590    jint _bufferOffset = (jint) 0;
2591    jint _remaining;
2592    GLfloat *value = (GLfloat *) 0;
2593
2594    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2595    if (value == NULL) {
2596        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2597        value = (GLfloat *) (_valueBase + _bufferOffset);
2598    }
2599    glProgramUniformMatrix4x2fv(
2600        (GLuint)program,
2601        (GLint)location,
2602        (GLsizei)count,
2603        (GLboolean)transpose,
2604        (GLfloat *)value
2605    );
2606    if (_array) {
2607        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2608    }
2609}
2610
2611/* void glProgramUniformMatrix3x4fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2612static void
2613android_glProgramUniformMatrix3x4fv__IIIZ_3FI
2614  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2615    jint _exception = 0;
2616    const char * _exceptionType = NULL;
2617    const char * _exceptionMessage = NULL;
2618    GLfloat *value_base = (GLfloat *) 0;
2619    jint _remaining;
2620    GLfloat *value = (GLfloat *) 0;
2621
2622    if (!value_ref) {
2623        _exception = 1;
2624        _exceptionType = "java/lang/IllegalArgumentException";
2625        _exceptionMessage = "value == null";
2626        goto exit;
2627    }
2628    if (offset < 0) {
2629        _exception = 1;
2630        _exceptionType = "java/lang/IllegalArgumentException";
2631        _exceptionMessage = "offset < 0";
2632        goto exit;
2633    }
2634    _remaining = _env->GetArrayLength(value_ref) - offset;
2635    value_base = (GLfloat *)
2636        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2637    value = value_base + offset;
2638
2639    glProgramUniformMatrix3x4fv(
2640        (GLuint)program,
2641        (GLint)location,
2642        (GLsizei)count,
2643        (GLboolean)transpose,
2644        (GLfloat *)value
2645    );
2646
2647exit:
2648    if (value_base) {
2649        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2650            JNI_ABORT);
2651    }
2652    if (_exception) {
2653        jniThrowException(_env, _exceptionType, _exceptionMessage);
2654    }
2655}
2656
2657/* void glProgramUniformMatrix3x4fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2658static void
2659android_glProgramUniformMatrix3x4fv__IIIZLjava_nio_FloatBuffer_2
2660  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2661    jfloatArray _array = (jfloatArray) 0;
2662    jint _bufferOffset = (jint) 0;
2663    jint _remaining;
2664    GLfloat *value = (GLfloat *) 0;
2665
2666    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2667    if (value == NULL) {
2668        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2669        value = (GLfloat *) (_valueBase + _bufferOffset);
2670    }
2671    glProgramUniformMatrix3x4fv(
2672        (GLuint)program,
2673        (GLint)location,
2674        (GLsizei)count,
2675        (GLboolean)transpose,
2676        (GLfloat *)value
2677    );
2678    if (_array) {
2679        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2680    }
2681}
2682
2683/* void glProgramUniformMatrix4x3fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2684static void
2685android_glProgramUniformMatrix4x3fv__IIIZ_3FI
2686  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jfloatArray value_ref, jint offset) {
2687    jint _exception = 0;
2688    const char * _exceptionType = NULL;
2689    const char * _exceptionMessage = NULL;
2690    GLfloat *value_base = (GLfloat *) 0;
2691    jint _remaining;
2692    GLfloat *value = (GLfloat *) 0;
2693
2694    if (!value_ref) {
2695        _exception = 1;
2696        _exceptionType = "java/lang/IllegalArgumentException";
2697        _exceptionMessage = "value == null";
2698        goto exit;
2699    }
2700    if (offset < 0) {
2701        _exception = 1;
2702        _exceptionType = "java/lang/IllegalArgumentException";
2703        _exceptionMessage = "offset < 0";
2704        goto exit;
2705    }
2706    _remaining = _env->GetArrayLength(value_ref) - offset;
2707    value_base = (GLfloat *)
2708        _env->GetFloatArrayElements(value_ref, (jboolean *)0);
2709    value = value_base + offset;
2710
2711    glProgramUniformMatrix4x3fv(
2712        (GLuint)program,
2713        (GLint)location,
2714        (GLsizei)count,
2715        (GLboolean)transpose,
2716        (GLfloat *)value
2717    );
2718
2719exit:
2720    if (value_base) {
2721        _env->ReleaseFloatArrayElements(value_ref, (jfloat*)value_base,
2722            JNI_ABORT);
2723    }
2724    if (_exception) {
2725        jniThrowException(_env, _exceptionType, _exceptionMessage);
2726    }
2727}
2728
2729/* void glProgramUniformMatrix4x3fv ( GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) */
2730static void
2731android_glProgramUniformMatrix4x3fv__IIIZLjava_nio_FloatBuffer_2
2732  (JNIEnv *_env, jobject _this, jint program, jint location, jint count, jboolean transpose, jobject value_buf) {
2733    jfloatArray _array = (jfloatArray) 0;
2734    jint _bufferOffset = (jint) 0;
2735    jint _remaining;
2736    GLfloat *value = (GLfloat *) 0;
2737
2738    value = (GLfloat *)getPointer(_env, value_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2739    if (value == NULL) {
2740        char * _valueBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2741        value = (GLfloat *) (_valueBase + _bufferOffset);
2742    }
2743    glProgramUniformMatrix4x3fv(
2744        (GLuint)program,
2745        (GLint)location,
2746        (GLsizei)count,
2747        (GLboolean)transpose,
2748        (GLfloat *)value
2749    );
2750    if (_array) {
2751        _env->ReleaseFloatArrayElements(_array, (jfloat*)value, JNI_ABORT);
2752    }
2753}
2754
2755/* void glValidateProgramPipeline ( GLuint pipeline ) */
2756static void
2757android_glValidateProgramPipeline__I
2758  (JNIEnv *_env, jobject _this, jint pipeline) {
2759    glValidateProgramPipeline(
2760        (GLuint)pipeline
2761    );
2762}
2763
2764#include <stdlib.h>
2765
2766/* void glGetProgramPipelineInfoLog ( GLuint shader, GLsizei maxLength, GLsizei* length, GLchar* infoLog ) */
2767static jstring android_glGetProgramPipelineInfoLog(JNIEnv *_env, jobject, jint shader) {
2768    GLint infoLen = 0;
2769    glGetProgramPipelineiv(shader, GL_INFO_LOG_LENGTH, &infoLen);
2770    if (!infoLen) {
2771        return _env->NewStringUTF("");
2772    }
2773    char* buf = (char*) malloc(infoLen);
2774    if (buf == NULL) {
2775        jniThrowException(_env, "java/lang/OutOfMemoryError", "out of memory");
2776        return NULL;
2777    }
2778    glGetProgramPipelineInfoLog(shader, infoLen, NULL, buf);
2779    jstring result = _env->NewStringUTF(buf);
2780    free(buf);
2781    return result;
2782}
2783/* void glBindImageTexture ( GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format ) */
2784static void
2785android_glBindImageTexture__IIIZIII
2786  (JNIEnv *_env, jobject _this, jint unit, jint texture, jint level, jboolean layered, jint layer, jint access, jint format) {
2787    glBindImageTexture(
2788        (GLuint)unit,
2789        (GLuint)texture,
2790        (GLint)level,
2791        (GLboolean)layered,
2792        (GLint)layer,
2793        (GLenum)access,
2794        (GLenum)format
2795    );
2796}
2797
2798/* void glGetBooleani_v ( GLenum target, GLuint index, GLboolean *data ) */
2799static void
2800android_glGetBooleani_v__II_3ZI
2801  (JNIEnv *_env, jobject _this, jint target, jint index, jbooleanArray data_ref, jint offset) {
2802    jint _exception = 0;
2803    const char * _exceptionType = NULL;
2804    const char * _exceptionMessage = NULL;
2805    GLboolean *data_base = (GLboolean *) 0;
2806    jint _remaining;
2807    GLboolean *data = (GLboolean *) 0;
2808
2809    if (!data_ref) {
2810        _exception = 1;
2811        _exceptionType = "java/lang/IllegalArgumentException";
2812        _exceptionMessage = "data == null";
2813        goto exit;
2814    }
2815    if (offset < 0) {
2816        _exception = 1;
2817        _exceptionType = "java/lang/IllegalArgumentException";
2818        _exceptionMessage = "offset < 0";
2819        goto exit;
2820    }
2821    _remaining = _env->GetArrayLength(data_ref) - offset;
2822    data_base = (GLboolean *)
2823        _env->GetBooleanArrayElements(data_ref, (jboolean *)0);
2824    data = data_base + offset;
2825
2826    glGetBooleani_v(
2827        (GLenum)target,
2828        (GLuint)index,
2829        (GLboolean *)data
2830    );
2831
2832exit:
2833    if (data_base) {
2834        _env->ReleaseBooleanArrayElements(data_ref, (jboolean*)data_base,
2835            _exception ? JNI_ABORT: 0);
2836    }
2837    if (_exception) {
2838        jniThrowException(_env, _exceptionType, _exceptionMessage);
2839    }
2840}
2841
2842/* void glGetBooleani_v ( GLenum target, GLuint index, GLboolean *data ) */
2843static void
2844android_glGetBooleani_v__IILjava_nio_IntBuffer_2
2845  (JNIEnv *_env, jobject _this, jint target, jint index, jobject data_buf) {
2846    jintArray _array = (jintArray) 0;
2847    jint _bufferOffset = (jint) 0;
2848    jint _remaining;
2849    GLboolean *data = (GLboolean *) 0;
2850
2851    data = (GLboolean *)getPointer(_env, data_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2852    if (data == NULL) {
2853        char * _dataBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
2854        data = (GLboolean *) (_dataBase + _bufferOffset);
2855    }
2856    glGetBooleani_v(
2857        (GLenum)target,
2858        (GLuint)index,
2859        (GLboolean *)data
2860    );
2861    if (_array) {
2862        _env->ReleaseIntArrayElements(_array, (jint*)data, 0);
2863    }
2864}
2865
2866/* void glMemoryBarrier ( GLbitfield barriers ) */
2867static void
2868android_glMemoryBarrier__I
2869  (JNIEnv *_env, jobject _this, jint barriers) {
2870    glMemoryBarrier(
2871        (GLbitfield)barriers
2872    );
2873}
2874
2875/* void glMemoryBarrierByRegion ( GLbitfield barriers ) */
2876static void
2877android_glMemoryBarrierByRegion__I
2878  (JNIEnv *_env, jobject _this, jint barriers) {
2879    glMemoryBarrierByRegion(
2880        (GLbitfield)barriers
2881    );
2882}
2883
2884/* void glTexStorage2DMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations ) */
2885static void
2886android_glTexStorage2DMultisample__IIIIIZ
2887  (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height, jboolean fixedsamplelocations) {
2888    glTexStorage2DMultisample(
2889        (GLenum)target,
2890        (GLsizei)samples,
2891        (GLenum)internalformat,
2892        (GLsizei)width,
2893        (GLsizei)height,
2894        (GLboolean)fixedsamplelocations
2895    );
2896}
2897
2898/* void glGetMultisamplefv ( GLenum pname, GLuint index, GLfloat *val ) */
2899static void
2900android_glGetMultisamplefv__II_3FI
2901  (JNIEnv *_env, jobject _this, jint pname, jint index, jfloatArray val_ref, jint offset) {
2902    jint _exception = 0;
2903    const char * _exceptionType = NULL;
2904    const char * _exceptionMessage = NULL;
2905    GLfloat *val_base = (GLfloat *) 0;
2906    jint _remaining;
2907    GLfloat *val = (GLfloat *) 0;
2908
2909    if (!val_ref) {
2910        _exception = 1;
2911        _exceptionType = "java/lang/IllegalArgumentException";
2912        _exceptionMessage = "val == null";
2913        goto exit;
2914    }
2915    if (offset < 0) {
2916        _exception = 1;
2917        _exceptionType = "java/lang/IllegalArgumentException";
2918        _exceptionMessage = "offset < 0";
2919        goto exit;
2920    }
2921    _remaining = _env->GetArrayLength(val_ref) - offset;
2922    val_base = (GLfloat *)
2923        _env->GetFloatArrayElements(val_ref, (jboolean *)0);
2924    val = val_base + offset;
2925
2926    glGetMultisamplefv(
2927        (GLenum)pname,
2928        (GLuint)index,
2929        (GLfloat *)val
2930    );
2931
2932exit:
2933    if (val_base) {
2934        _env->ReleaseFloatArrayElements(val_ref, (jfloat*)val_base,
2935            _exception ? JNI_ABORT: 0);
2936    }
2937    if (_exception) {
2938        jniThrowException(_env, _exceptionType, _exceptionMessage);
2939    }
2940}
2941
2942/* void glGetMultisamplefv ( GLenum pname, GLuint index, GLfloat *val ) */
2943static void
2944android_glGetMultisamplefv__IILjava_nio_FloatBuffer_2
2945  (JNIEnv *_env, jobject _this, jint pname, jint index, jobject val_buf) {
2946    jfloatArray _array = (jfloatArray) 0;
2947    jint _bufferOffset = (jint) 0;
2948    jint _remaining;
2949    GLfloat *val = (GLfloat *) 0;
2950
2951    val = (GLfloat *)getPointer(_env, val_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
2952    if (val == NULL) {
2953        char * _valBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
2954        val = (GLfloat *) (_valBase + _bufferOffset);
2955    }
2956    glGetMultisamplefv(
2957        (GLenum)pname,
2958        (GLuint)index,
2959        (GLfloat *)val
2960    );
2961    if (_array) {
2962        _env->ReleaseFloatArrayElements(_array, (jfloat*)val, 0);
2963    }
2964}
2965
2966/* void glSampleMaski ( GLuint maskNumber, GLbitfield mask ) */
2967static void
2968android_glSampleMaski__II
2969  (JNIEnv *_env, jobject _this, jint maskNumber, jint mask) {
2970    glSampleMaski(
2971        (GLuint)maskNumber,
2972        (GLbitfield)mask
2973    );
2974}
2975
2976/* void glGetTexLevelParameteriv ( GLenum target, GLint level, GLenum pname, GLint *params ) */
2977static void
2978android_glGetTexLevelParameteriv__III_3II
2979  (JNIEnv *_env, jobject _this, jint target, jint level, jint pname, jintArray params_ref, jint offset) {
2980    jint _exception = 0;
2981    const char * _exceptionType = NULL;
2982    const char * _exceptionMessage = NULL;
2983    GLint *params_base = (GLint *) 0;
2984    jint _remaining;
2985    GLint *params = (GLint *) 0;
2986
2987    if (!params_ref) {
2988        _exception = 1;
2989        _exceptionType = "java/lang/IllegalArgumentException";
2990        _exceptionMessage = "params == null";
2991        goto exit;
2992    }
2993    if (offset < 0) {
2994        _exception = 1;
2995        _exceptionType = "java/lang/IllegalArgumentException";
2996        _exceptionMessage = "offset < 0";
2997        goto exit;
2998    }
2999    _remaining = _env->GetArrayLength(params_ref) - offset;
3000    params_base = (GLint *)
3001        _env->GetIntArrayElements(params_ref, (jboolean *)0);
3002    params = params_base + offset;
3003
3004    glGetTexLevelParameteriv(
3005        (GLenum)target,
3006        (GLint)level,
3007        (GLenum)pname,
3008        (GLint *)params
3009    );
3010
3011exit:
3012    if (params_base) {
3013        _env->ReleaseIntArrayElements(params_ref, (jint*)params_base,
3014            _exception ? JNI_ABORT: 0);
3015    }
3016    if (_exception) {
3017        jniThrowException(_env, _exceptionType, _exceptionMessage);
3018    }
3019}
3020
3021/* void glGetTexLevelParameteriv ( GLenum target, GLint level, GLenum pname, GLint *params ) */
3022static void
3023android_glGetTexLevelParameteriv__IIILjava_nio_IntBuffer_2
3024  (JNIEnv *_env, jobject _this, jint target, jint level, jint pname, jobject params_buf) {
3025    jintArray _array = (jintArray) 0;
3026    jint _bufferOffset = (jint) 0;
3027    jint _remaining;
3028    GLint *params = (GLint *) 0;
3029
3030    params = (GLint *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3031    if (params == NULL) {
3032        char * _paramsBase = (char *)_env->GetIntArrayElements(_array, (jboolean *) 0);
3033        params = (GLint *) (_paramsBase + _bufferOffset);
3034    }
3035    glGetTexLevelParameteriv(
3036        (GLenum)target,
3037        (GLint)level,
3038        (GLenum)pname,
3039        (GLint *)params
3040    );
3041    if (_array) {
3042        _env->ReleaseIntArrayElements(_array, (jint*)params, 0);
3043    }
3044}
3045
3046/* void glGetTexLevelParameterfv ( GLenum target, GLint level, GLenum pname, GLfloat *params ) */
3047static void
3048android_glGetTexLevelParameterfv__III_3FI
3049  (JNIEnv *_env, jobject _this, jint target, jint level, jint pname, jfloatArray params_ref, jint offset) {
3050    jint _exception = 0;
3051    const char * _exceptionType = NULL;
3052    const char * _exceptionMessage = NULL;
3053    GLfloat *params_base = (GLfloat *) 0;
3054    jint _remaining;
3055    GLfloat *params = (GLfloat *) 0;
3056
3057    if (!params_ref) {
3058        _exception = 1;
3059        _exceptionType = "java/lang/IllegalArgumentException";
3060        _exceptionMessage = "params == null";
3061        goto exit;
3062    }
3063    if (offset < 0) {
3064        _exception = 1;
3065        _exceptionType = "java/lang/IllegalArgumentException";
3066        _exceptionMessage = "offset < 0";
3067        goto exit;
3068    }
3069    _remaining = _env->GetArrayLength(params_ref) - offset;
3070    params_base = (GLfloat *)
3071        _env->GetFloatArrayElements(params_ref, (jboolean *)0);
3072    params = params_base + offset;
3073
3074    glGetTexLevelParameterfv(
3075        (GLenum)target,
3076        (GLint)level,
3077        (GLenum)pname,
3078        (GLfloat *)params
3079    );
3080
3081exit:
3082    if (params_base) {
3083        _env->ReleaseFloatArrayElements(params_ref, (jfloat*)params_base,
3084            _exception ? JNI_ABORT: 0);
3085    }
3086    if (_exception) {
3087        jniThrowException(_env, _exceptionType, _exceptionMessage);
3088    }
3089}
3090
3091/* void glGetTexLevelParameterfv ( GLenum target, GLint level, GLenum pname, GLfloat *params ) */
3092static void
3093android_glGetTexLevelParameterfv__IIILjava_nio_FloatBuffer_2
3094  (JNIEnv *_env, jobject _this, jint target, jint level, jint pname, jobject params_buf) {
3095    jfloatArray _array = (jfloatArray) 0;
3096    jint _bufferOffset = (jint) 0;
3097    jint _remaining;
3098    GLfloat *params = (GLfloat *) 0;
3099
3100    params = (GLfloat *)getPointer(_env, params_buf, (jarray*)&_array, &_remaining, &_bufferOffset);
3101    if (params == NULL) {
3102        char * _paramsBase = (char *)_env->GetFloatArrayElements(_array, (jboolean *) 0);
3103        params = (GLfloat *) (_paramsBase + _bufferOffset);
3104    }
3105    glGetTexLevelParameterfv(
3106        (GLenum)target,
3107        (GLint)level,
3108        (GLenum)pname,
3109        (GLfloat *)params
3110    );
3111    if (_array) {
3112        _env->ReleaseFloatArrayElements(_array, (jfloat*)params, 0);
3113    }
3114}
3115
3116/* void glBindVertexBuffer ( GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride ) */
3117static void
3118android_glBindVertexBuffer__IIJI
3119  (JNIEnv *_env, jobject _this, jint bindingindex, jint buffer, jlong offset, jint stride) {
3120    if (sizeof(GLintptr) != sizeof(jlong) && (offset < LONG_MIN || offset > LONG_MAX)) {
3121        jniThrowException(_env, "java/lang/IllegalArgumentException", "offset too large");
3122        return;
3123    }
3124    glBindVertexBuffer(
3125        (GLuint)bindingindex,
3126        (GLuint)buffer,
3127        (GLintptr)offset,
3128        (GLsizei)stride
3129    );
3130}
3131/* void glVertexAttribFormat ( GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset ) */
3132static void
3133android_glVertexAttribFormat__IIIZI
3134  (JNIEnv *_env, jobject _this, jint attribindex, jint size, jint type, jboolean normalized, jint relativeoffset) {
3135    glVertexAttribFormat(
3136        (GLuint)attribindex,
3137        (GLint)size,
3138        (GLenum)type,
3139        (GLboolean)normalized,
3140        (GLuint)relativeoffset
3141    );
3142}
3143
3144/* void glVertexAttribIFormat ( GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset ) */
3145static void
3146android_glVertexAttribIFormat__IIII
3147  (JNIEnv *_env, jobject _this, jint attribindex, jint size, jint type, jint relativeoffset) {
3148    glVertexAttribIFormat(
3149        (GLuint)attribindex,
3150        (GLint)size,
3151        (GLenum)type,
3152        (GLuint)relativeoffset
3153    );
3154}
3155
3156/* void glVertexAttribBinding ( GLuint attribindex, GLuint bindingindex ) */
3157static void
3158android_glVertexAttribBinding__II
3159  (JNIEnv *_env, jobject _this, jint attribindex, jint bindingindex) {
3160    glVertexAttribBinding(
3161        (GLuint)attribindex,
3162        (GLuint)bindingindex
3163    );
3164}
3165
3166/* void glVertexBindingDivisor ( GLuint bindingindex, GLuint divisor ) */
3167static void
3168android_glVertexBindingDivisor__II
3169  (JNIEnv *_env, jobject _this, jint bindingindex, jint divisor) {
3170    glVertexBindingDivisor(
3171        (GLuint)bindingindex,
3172        (GLuint)divisor
3173    );
3174}
3175
3176static const char *classPathName = "android/opengl/GLES31";
3177
3178static JNINativeMethod methods[] = {
3179{"_nativeClassInit", "()V", (void*)nativeClassInit },
3180{"glDispatchCompute", "(III)V", (void *) android_glDispatchCompute__III },
3181{"glDispatchComputeIndirect", "(J)V", (void *) android_glDispatchComputeIndirect },
3182{"glDrawArraysIndirect", "(IJ)V", (void *) android_glDrawArraysIndirect },
3183{"glDrawElementsIndirect", "(IIJ)V", (void *) android_glDrawElementsIndirect },
3184{"glFramebufferParameteri", "(III)V", (void *) android_glFramebufferParameteri__III },
3185{"glGetFramebufferParameteriv", "(II[II)V", (void *) android_glGetFramebufferParameteriv__II_3II },
3186{"glGetFramebufferParameteriv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetFramebufferParameteriv__IILjava_nio_IntBuffer_2 },
3187{"glGetProgramInterfaceiv", "(III[II)V", (void *) android_glGetProgramInterfaceiv__III_3II },
3188{"glGetProgramInterfaceiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetProgramInterfaceiv__IIILjava_nio_IntBuffer_2 },
3189{"glGetProgramResourceIndex", "(IILjava/lang/String;)I", (void *) android_glGetProgramResourceIndex__IILjava_lang_String_2 },
3190{"glGetProgramResourceName", "(III)Ljava/lang/String;", (void *) android_glGetProgramResourceName },
3191{"glGetProgramResourceiv", "(IIII[III[II[II)V", (void *) android_glGetProgramResourceiv__IIII_3III_3II_3II },
3192{"glGetProgramResourceiv", "(IIIILjava/nio/IntBuffer;ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)V", (void *) android_glGetProgramResourceiv__IIIILjava_nio_IntBuffer_2ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
3193{"glGetProgramResourceLocation", "(IILjava/lang/String;)I", (void *) android_glGetProgramResourceLocation__IILjava_lang_String_2 },
3194{"glUseProgramStages", "(III)V", (void *) android_glUseProgramStages__III },
3195{"glActiveShaderProgram", "(II)V", (void *) android_glActiveShaderProgram__II },
3196{"glCreateShaderProgramv", "(I[Ljava/lang/String;)I", (void *) android_glCreateShaderProgramv },
3197{"glBindProgramPipeline", "(I)V", (void *) android_glBindProgramPipeline__I },
3198{"glDeleteProgramPipelines", "(I[II)V", (void *) android_glDeleteProgramPipelines__I_3II },
3199{"glDeleteProgramPipelines", "(ILjava/nio/IntBuffer;)V", (void *) android_glDeleteProgramPipelines__ILjava_nio_IntBuffer_2 },
3200{"glGenProgramPipelines", "(I[II)V", (void *) android_glGenProgramPipelines__I_3II },
3201{"glGenProgramPipelines", "(ILjava/nio/IntBuffer;)V", (void *) android_glGenProgramPipelines__ILjava_nio_IntBuffer_2 },
3202{"glIsProgramPipeline", "(I)Z", (void *) android_glIsProgramPipeline__I },
3203{"glGetProgramPipelineiv", "(II[II)V", (void *) android_glGetProgramPipelineiv__II_3II },
3204{"glGetProgramPipelineiv", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetProgramPipelineiv__IILjava_nio_IntBuffer_2 },
3205{"glProgramUniform1i", "(III)V", (void *) android_glProgramUniform1i__III },
3206{"glProgramUniform2i", "(IIII)V", (void *) android_glProgramUniform2i__IIII },
3207{"glProgramUniform3i", "(IIIII)V", (void *) android_glProgramUniform3i__IIIII },
3208{"glProgramUniform4i", "(IIIIII)V", (void *) android_glProgramUniform4i__IIIIII },
3209{"glProgramUniform1ui", "(III)V", (void *) android_glProgramUniform1ui__III },
3210{"glProgramUniform2ui", "(IIII)V", (void *) android_glProgramUniform2ui__IIII },
3211{"glProgramUniform3ui", "(IIIII)V", (void *) android_glProgramUniform3ui__IIIII },
3212{"glProgramUniform4ui", "(IIIIII)V", (void *) android_glProgramUniform4ui__IIIIII },
3213{"glProgramUniform1f", "(IIF)V", (void *) android_glProgramUniform1f__IIF },
3214{"glProgramUniform2f", "(IIFF)V", (void *) android_glProgramUniform2f__IIFF },
3215{"glProgramUniform3f", "(IIFFF)V", (void *) android_glProgramUniform3f__IIFFF },
3216{"glProgramUniform4f", "(IIFFFF)V", (void *) android_glProgramUniform4f__IIFFFF },
3217{"glProgramUniform1iv", "(III[II)V", (void *) android_glProgramUniform1iv__III_3II },
3218{"glProgramUniform1iv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform1iv__IIILjava_nio_IntBuffer_2 },
3219{"glProgramUniform2iv", "(III[II)V", (void *) android_glProgramUniform2iv__III_3II },
3220{"glProgramUniform2iv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform2iv__IIILjava_nio_IntBuffer_2 },
3221{"glProgramUniform3iv", "(III[II)V", (void *) android_glProgramUniform3iv__III_3II },
3222{"glProgramUniform3iv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform3iv__IIILjava_nio_IntBuffer_2 },
3223{"glProgramUniform4iv", "(III[II)V", (void *) android_glProgramUniform4iv__III_3II },
3224{"glProgramUniform4iv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform4iv__IIILjava_nio_IntBuffer_2 },
3225{"glProgramUniform1uiv", "(III[II)V", (void *) android_glProgramUniform1uiv__III_3II },
3226{"glProgramUniform1uiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform1uiv__IIILjava_nio_IntBuffer_2 },
3227{"glProgramUniform2uiv", "(III[II)V", (void *) android_glProgramUniform2uiv__III_3II },
3228{"glProgramUniform2uiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform2uiv__IIILjava_nio_IntBuffer_2 },
3229{"glProgramUniform3uiv", "(III[II)V", (void *) android_glProgramUniform3uiv__III_3II },
3230{"glProgramUniform3uiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform3uiv__IIILjava_nio_IntBuffer_2 },
3231{"glProgramUniform4uiv", "(III[II)V", (void *) android_glProgramUniform4uiv__III_3II },
3232{"glProgramUniform4uiv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glProgramUniform4uiv__IIILjava_nio_IntBuffer_2 },
3233{"glProgramUniform1fv", "(III[FI)V", (void *) android_glProgramUniform1fv__III_3FI },
3234{"glProgramUniform1fv", "(IIILjava/nio/FloatBuffer;)V", (void *) android_glProgramUniform1fv__IIILjava_nio_FloatBuffer_2 },
3235{"glProgramUniform2fv", "(III[FI)V", (void *) android_glProgramUniform2fv__III_3FI },
3236{"glProgramUniform2fv", "(IIILjava/nio/FloatBuffer;)V", (void *) android_glProgramUniform2fv__IIILjava_nio_FloatBuffer_2 },
3237{"glProgramUniform3fv", "(III[FI)V", (void *) android_glProgramUniform3fv__III_3FI },
3238{"glProgramUniform3fv", "(IIILjava/nio/FloatBuffer;)V", (void *) android_glProgramUniform3fv__IIILjava_nio_FloatBuffer_2 },
3239{"glProgramUniform4fv", "(III[FI)V", (void *) android_glProgramUniform4fv__III_3FI },
3240{"glProgramUniform4fv", "(IIILjava/nio/FloatBuffer;)V", (void *) android_glProgramUniform4fv__IIILjava_nio_FloatBuffer_2 },
3241{"glProgramUniformMatrix2fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix2fv__IIIZ_3FI },
3242{"glProgramUniformMatrix2fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix2fv__IIIZLjava_nio_FloatBuffer_2 },
3243{"glProgramUniformMatrix3fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix3fv__IIIZ_3FI },
3244{"glProgramUniformMatrix3fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix3fv__IIIZLjava_nio_FloatBuffer_2 },
3245{"glProgramUniformMatrix4fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix4fv__IIIZ_3FI },
3246{"glProgramUniformMatrix4fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix4fv__IIIZLjava_nio_FloatBuffer_2 },
3247{"glProgramUniformMatrix2x3fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix2x3fv__IIIZ_3FI },
3248{"glProgramUniformMatrix2x3fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix2x3fv__IIIZLjava_nio_FloatBuffer_2 },
3249{"glProgramUniformMatrix3x2fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix3x2fv__IIIZ_3FI },
3250{"glProgramUniformMatrix3x2fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix3x2fv__IIIZLjava_nio_FloatBuffer_2 },
3251{"glProgramUniformMatrix2x4fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix2x4fv__IIIZ_3FI },
3252{"glProgramUniformMatrix2x4fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix2x4fv__IIIZLjava_nio_FloatBuffer_2 },
3253{"glProgramUniformMatrix4x2fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix4x2fv__IIIZ_3FI },
3254{"glProgramUniformMatrix4x2fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix4x2fv__IIIZLjava_nio_FloatBuffer_2 },
3255{"glProgramUniformMatrix3x4fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix3x4fv__IIIZ_3FI },
3256{"glProgramUniformMatrix3x4fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix3x4fv__IIIZLjava_nio_FloatBuffer_2 },
3257{"glProgramUniformMatrix4x3fv", "(IIIZ[FI)V", (void *) android_glProgramUniformMatrix4x3fv__IIIZ_3FI },
3258{"glProgramUniformMatrix4x3fv", "(IIIZLjava/nio/FloatBuffer;)V", (void *) android_glProgramUniformMatrix4x3fv__IIIZLjava_nio_FloatBuffer_2 },
3259{"glValidateProgramPipeline", "(I)V", (void *) android_glValidateProgramPipeline__I },
3260{"glGetProgramPipelineInfoLog", "(I)Ljava/lang/String;", (void *) android_glGetProgramPipelineInfoLog },
3261{"glBindImageTexture", "(IIIZIII)V", (void *) android_glBindImageTexture__IIIZIII },
3262{"glGetBooleani_v", "(II[ZI)V", (void *) android_glGetBooleani_v__II_3ZI },
3263{"glGetBooleani_v", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetBooleani_v__IILjava_nio_IntBuffer_2 },
3264{"glMemoryBarrier", "(I)V", (void *) android_glMemoryBarrier__I },
3265{"glMemoryBarrierByRegion", "(I)V", (void *) android_glMemoryBarrierByRegion__I },
3266{"glTexStorage2DMultisample", "(IIIIIZ)V", (void *) android_glTexStorage2DMultisample__IIIIIZ },
3267{"glGetMultisamplefv", "(II[FI)V", (void *) android_glGetMultisamplefv__II_3FI },
3268{"glGetMultisamplefv", "(IILjava/nio/FloatBuffer;)V", (void *) android_glGetMultisamplefv__IILjava_nio_FloatBuffer_2 },
3269{"glSampleMaski", "(II)V", (void *) android_glSampleMaski__II },
3270{"glGetTexLevelParameteriv", "(III[II)V", (void *) android_glGetTexLevelParameteriv__III_3II },
3271{"glGetTexLevelParameteriv", "(IIILjava/nio/IntBuffer;)V", (void *) android_glGetTexLevelParameteriv__IIILjava_nio_IntBuffer_2 },
3272{"glGetTexLevelParameterfv", "(III[FI)V", (void *) android_glGetTexLevelParameterfv__III_3FI },
3273{"glGetTexLevelParameterfv", "(IIILjava/nio/FloatBuffer;)V", (void *) android_glGetTexLevelParameterfv__IIILjava_nio_FloatBuffer_2 },
3274{"glBindVertexBuffer", "(IIJI)V", (void *) android_glBindVertexBuffer__IIJI },
3275{"glVertexAttribFormat", "(IIIZI)V", (void *) android_glVertexAttribFormat__IIIZI },
3276{"glVertexAttribIFormat", "(IIII)V", (void *) android_glVertexAttribIFormat__IIII },
3277{"glVertexAttribBinding", "(II)V", (void *) android_glVertexAttribBinding__II },
3278{"glVertexBindingDivisor", "(II)V", (void *) android_glVertexBindingDivisor__II },
3279};
3280
3281int register_android_opengl_jni_GLES31(JNIEnv *_env)
3282{
3283    int err;
3284    err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));
3285    return err;
3286}
3287