2 * Copyright 2014 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 // This source file is automatically generated
19 #include <GLES3/gl31.h>
20 #include <GLES2/gl2ext.h>
24 #include <android_runtime/AndroidRuntime.h>
25 #include <utils/misc.h>
28 static int initialized = 0;
30 static jclass nioAccessClass;
31 static jclass bufferClass;
32 static jmethodID getBasePointerID;
33 static jmethodID getBaseArrayID;
34 static jmethodID getBaseArrayOffsetID;
35 static jfieldID positionID;
36 static jfieldID limitID;
37 static jfieldID elementSizeShiftID;
40 /* special calls implemented in Android's GLES wrapper used to more
41 * efficiently bound-check passed arrays */
43 #ifdef GL_VERSION_ES_CM_1_1
44 GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride,
45 const GLvoid *ptr, GLsizei count);
46 GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride,
47 const GLvoid *pointer, GLsizei count);
48 GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type,
49 GLsizei stride, const GLvoid *pointer, GLsizei count);
50 GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type,
51 GLsizei stride, const GLvoid *pointer, GLsizei count);
52 GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type,
53 GLsizei stride, const GLvoid *pointer, GLsizei count);
54 GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type,
55 GLsizei stride, const GLvoid *pointer, GLsizei count);
56 GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type,
57 GLsizei stride, const GLvoid *pointer, GLsizei count);
59 #ifdef GL_ES_VERSION_2_0
60 static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type,
61 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) {
62 glVertexAttribPointer(indx, size, type, normalized, stride, pointer);
65 #ifdef GL_ES_VERSION_3_0
66 static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type,
67 GLsizei stride, const GLvoid *pointer, GLsizei count) {
68 glVertexAttribIPointer(indx, size, type, stride, pointer);
73 /* Cache method IDs each time the class is loaded. */
76 nativeClassInit(JNIEnv *_env, jclass glImplClass)
78 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess");
79 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal);
81 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer");
82 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal);
84 getBasePointerID = _env->GetStaticMethodID(nioAccessClass,
85 "getBasePointer", "(Ljava/nio/Buffer;)J");
86 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass,
87 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;");
88 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass,
89 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I");
91 positionID = _env->GetFieldID(bufferClass, "position", "I");
92 limitID = _env->GetFieldID(bufferClass, "limit", "I");
94 _env->GetFieldID(bufferClass, "_elementSizeShift", "I");
98 getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset)
102 jint elementSizeShift;
105 position = _env->GetIntField(buffer, positionID);
106 limit = _env->GetIntField(buffer, limitID);
107 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
108 *remaining = (limit - position) << elementSizeShift;
109 pointer = _env->CallStaticLongMethod(nioAccessClass,
110 getBasePointerID, buffer);
113 return reinterpret_cast<void*>(pointer);
116 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass,
117 getBaseArrayID, buffer);
118 *offset = _env->CallStaticIntMethod(nioAccessClass,
119 getBaseArrayOffsetID, buffer);
125 releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit)
127 _env->ReleasePrimitiveArrayCritical(array, data,
128 commit ? 0 : JNI_ABORT);
132 getDirectBufferPointer(JNIEnv *_env, jobject buffer) {
133 char* buf = (char*) _env->GetDirectBufferAddress(buffer);
135 jint position = _env->GetIntField(buffer, positionID);
136 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID);
137 buf += position << elementSizeShift;
139 jniThrowException(_env, "java/lang/IllegalArgumentException",
140 "Must use a native order direct Buffer");
145 // --------------------------------------------------------------------------
148 * returns the number of values glGet returns for a given pname.
150 * The code below is written such that pnames requiring only one values
151 * are the default (and are not explicitely tested for). This makes the
152 * checking code much shorter/readable/efficient.
154 * This means that unknown pnames (e.g.: extensions) will default to 1. If
155 * that unknown pname needs more than 1 value, then the validation check
156 * is incomplete and the app may crash if it passed the wrong number params.
158 static int getNeededCount(GLint pname) {
160 #ifdef GL_ES_VERSION_2_0
163 case GL_ALIASED_LINE_WIDTH_RANGE:
164 case GL_ALIASED_POINT_SIZE_RANGE:
169 case GL_COLOR_CLEAR_VALUE:
170 case GL_COLOR_WRITEMASK:
176 case GL_COMPRESSED_TEXTURE_FORMATS:
177 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
180 case GL_SHADER_BINARY_FORMATS:
181 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed);
186 #ifdef GL_VERSION_ES_CM_1_1
189 case GL_ALIASED_LINE_WIDTH_RANGE:
190 case GL_ALIASED_POINT_SIZE_RANGE:
192 case GL_SMOOTH_LINE_WIDTH_RANGE:
193 case GL_SMOOTH_POINT_SIZE_RANGE:
197 case GL_CURRENT_NORMAL:
198 case GL_POINT_DISTANCE_ATTENUATION:
202 case GL_COLOR_CLEAR_VALUE:
203 case GL_COLOR_WRITEMASK:
204 case GL_CURRENT_COLOR:
205 case GL_CURRENT_TEXTURE_COORDS:
207 case GL_LIGHT_MODEL_AMBIENT:
213 case GL_MODELVIEW_MATRIX:
214 case GL_PROJECTION_MATRIX:
215 case GL_TEXTURE_MATRIX:
219 case GL_COMPRESSED_TEXTURE_FORMATS:
220 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed);
227 template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)>
230 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) {
232 const char * _exceptionType;
233 const char * _exceptionMessage;
234 CTYPE *params_base = (CTYPE *) 0;
236 CTYPE *params = (CTYPE *) 0;
241 _exceptionType = "java/lang/IllegalArgumentException";
242 _exceptionMessage = "params == null";
247 _exceptionType = "java/lang/IllegalArgumentException";
248 _exceptionMessage = "offset < 0";
251 _remaining = _env->GetArrayLength(params_ref) - offset;
252 _needed = getNeededCount(pname);
253 // if we didn't find this pname, we just assume the user passed
254 // an array of the right size -- this might happen with extensions
255 // or if we forget an enum here.
256 if (_remaining < _needed) {
258 _exceptionType = "java/lang/IllegalArgumentException";
259 _exceptionMessage = "length - offset < needed";
262 params_base = (CTYPE *)
263 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
264 params = params_base + offset;
273 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
274 _exception ? JNI_ABORT: 0);
277 jniThrowException(_env, _exceptionType, _exceptionMessage);
282 template <typename CTYPE, void GET(GLenum, CTYPE*)>
285 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) {
287 const char * _exceptionType;
288 const char * _exceptionMessage;
289 jarray _array = (jarray) 0;
290 jint _bufferOffset = (jint) 0;
292 CTYPE *params = (CTYPE *) 0;
295 params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
296 _remaining /= sizeof(CTYPE); // convert from bytes to item count
297 _needed = getNeededCount(pname);
298 // if we didn't find this pname, we just assume the user passed
299 // an array of the right size -- this might happen with extensions
300 // or if we forget an enum here.
301 if (_needed>0 && _remaining < _needed) {
303 _exceptionType = "java/lang/IllegalArgumentException";
304 _exceptionMessage = "remaining() < needed";
307 if (params == NULL) {
308 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
309 params = (CTYPE *) (_paramsBase + _bufferOffset);
318 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE);
321 jniThrowException(_env, _exceptionType, _exceptionMessage);
325 // --------------------------------------------------------------------------
326 /* void glBlendBarrierKHR ( void ) */
328 android_glBlendBarrierKHR__
329 (JNIEnv *_env, jobject _this) {
333 /* void glDebugMessageControlKHR ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
335 android_glDebugMessageControlKHR__IIII_3IIZ
336 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jintArray ids_ref, jint offset, jboolean enabled) {
338 const char * _exceptionType = NULL;
339 const char * _exceptionMessage = NULL;
340 GLuint *ids_base = (GLuint *) 0;
342 GLuint *ids = (GLuint *) 0;
346 _exceptionType = "java/lang/IllegalArgumentException";
347 _exceptionMessage = "ids == null";
352 _exceptionType = "java/lang/IllegalArgumentException";
353 _exceptionMessage = "offset < 0";
356 _remaining = _env->GetArrayLength(ids_ref) - offset;
357 ids_base = (GLuint *)
358 _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0);
359 ids = ids_base + offset;
361 glDebugMessageControlKHR(
372 _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base,
376 jniThrowException(_env, _exceptionType, _exceptionMessage);
380 /* void glDebugMessageControlKHR ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */
382 android_glDebugMessageControlKHR__IIIILjava_nio_IntBuffer_2Z
383 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jobject ids_buf, jboolean enabled) {
384 jarray _array = (jarray) 0;
385 jint _bufferOffset = (jint) 0;
387 GLuint *ids = (GLuint *) 0;
389 ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset);
391 char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
392 ids = (GLuint *) (_idsBase + _bufferOffset);
394 glDebugMessageControlKHR(
403 releasePointer(_env, _array, ids, JNI_FALSE);
407 /* void glDebugMessageInsertKHR ( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf ) */
409 android_glDebugMessageInsertKHR__IIIILjava_lang_String_2
410 (JNIEnv *_env, jobject _this, jint source, jint type, jint id, jint severity, jstring buf) {
412 const char * _exceptionType = NULL;
413 const char * _exceptionMessage = NULL;
414 const char* _nativebuf = 0;
419 _exceptionType = "java/lang/IllegalArgumentException";
420 _exceptionMessage = "buf == null";
423 _nativebuf = _env->GetStringUTFChars(buf, 0);
424 _length = _env->GetStringUTFLength(buf);
426 glDebugMessageInsertKHR(
437 _env->ReleaseStringUTFChars(buf, _nativebuf);
441 jniThrowException(_env, _exceptionType, _exceptionMessage);
445 /* void glDebugMessageCallbackKHR ( GLDEBUGPROCKHR callback, const void *userParam ) */
447 android_glDebugMessageCallbackKHR(JNIEnv *_env, jobject _this, jobject callback) {
448 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
450 /* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
452 android_glGetDebugMessageLogKHR__II_3II_3II_3II_3II_3II_3BI
453 (JNIEnv *_env, jobject _this, jint count, jint bufSize, jintArray sources_ref, jint sourcesOffset, jintArray types_ref, jint typesOffset, jintArray ids_ref, jint idsOffset, jintArray severities_ref, jint severitiesOffset, jintArray lengths_ref, jint lengthsOffset, jbyteArray messageLog_ref, jint messageLogOffset) {
454 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
458 /* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
460 android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2
461 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref, jobject lengths_ref, jobject messageLog_ref) {
462 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
466 /* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
468 android_glGetDebugMessageLogKHR__I_3II_3II_3II_3II
469 (JNIEnv *_env, jobject _this, jint count, jintArray sources_ref, jint sourcesOffset, jintArray types_ref, jint typesOffset, jintArray ids_ref, jint idsOffset, jintArray severities_ref, jint severitiesOffset) {
470 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
474 /* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */
476 android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2
477 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref) {
478 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
481 /* void glPushDebugGroupKHR ( GLenum source, GLuint id, GLsizei length, const GLchar *message ) */
483 android_glPushDebugGroupKHR__IIILjava_lang_String_2
484 (JNIEnv *_env, jobject _this, jint source, jint id, jint length, jstring message) {
486 const char * _exceptionType = NULL;
487 const char * _exceptionMessage = NULL;
488 const char* _nativemessage = 0;
492 _exceptionType = "java/lang/IllegalArgumentException";
493 _exceptionMessage = "message == null";
496 _nativemessage = _env->GetStringUTFChars(message, 0);
502 (GLchar *)_nativemessage
506 if (_nativemessage) {
507 _env->ReleaseStringUTFChars(message, _nativemessage);
511 jniThrowException(_env, _exceptionType, _exceptionMessage);
515 /* void glPopDebugGroupKHR ( void ) */
517 android_glPopDebugGroupKHR__
518 (JNIEnv *_env, jobject _this) {
519 glPopDebugGroupKHR();
522 /* void glObjectLabelKHR ( GLenum identifier, GLuint name, GLsizei length, const GLchar *label ) */
524 android_glObjectLabelKHR__IIILjava_lang_String_2
525 (JNIEnv *_env, jobject _this, jint identifier, jint name, jint length, jstring label) {
527 const char * _exceptionType = NULL;
528 const char * _exceptionMessage = NULL;
529 const char* _nativelabel = 0;
533 _exceptionType = "java/lang/IllegalArgumentException";
534 _exceptionMessage = "label == null";
537 _nativelabel = _env->GetStringUTFChars(label, 0);
543 (GLchar *)_nativelabel
548 _env->ReleaseStringUTFChars(label, _nativelabel);
552 jniThrowException(_env, _exceptionType, _exceptionMessage);
556 /* void glGetObjectLabelKHR ( GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label ) */
558 android_glGetObjectLabelKHR(JNIEnv *_env, jobject _this, jint identifier, jint name) {
559 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
563 /* void glObjectPtrLabelKHR ( const void *ptr, GLsizei length, const GLchar *label ) */
565 android_glObjectPtrLabelKHR(JNIEnv *_env, jobject _this, jlong ptr, jstring label) {
566 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
569 /* void glGetObjectPtrLabelKHR ( const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label ) */
571 android_glGetObjectPtrLabelKHR(JNIEnv *_env, jobject _this, jlong ptr) {
572 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
576 /* void glGetPointervKHR ( GLenum pname, void **params ) */
578 android_glGetDebugMessageCallbackKHR(JNIEnv *_env, jobject _this) {
579 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented");
583 /* void glMinSampleShadingOES ( GLfloat value ) */
585 android_glMinSampleShadingOES__F
586 (JNIEnv *_env, jobject _this, jfloat value) {
587 glMinSampleShadingOES(
592 /* void glTexStorage3DMultisampleOES ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations ) */
594 android_glTexStorage3DMultisampleOES__IIIIIIZ
595 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) {
596 glTexStorage3DMultisampleOES(
599 (GLenum)internalformat,
603 (GLboolean)fixedsamplelocations
607 /* void glCopyImageSubDataEXT ( GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth ) */
609 android_glCopyImageSubDataEXT__IIIIIIIIIIIIIII
610 (JNIEnv *_env, jobject _this, jint srcName, jint srcTarget, jint srcLevel, jint srcX, jint srcY, jint srcZ, jint dstName, jint dstTarget, jint dstLevel, jint dstX, jint dstY, jint dstZ, jint srcWidth, jint srcHeight, jint srcDepth) {
611 glCopyImageSubDataEXT(
630 /* void glEnableiEXT ( GLenum target, GLuint index ) */
632 android_glEnableiEXT__II
633 (JNIEnv *_env, jobject _this, jint target, jint index) {
640 /* void glDisableiEXT ( GLenum target, GLuint index ) */
642 android_glDisableiEXT__II
643 (JNIEnv *_env, jobject _this, jint target, jint index) {
650 /* void glBlendEquationiEXT ( GLuint buf, GLenum mode ) */
652 android_glBlendEquationiEXT__II
653 (JNIEnv *_env, jobject _this, jint buf, jint mode) {
660 /* void glBlendEquationSeparateiEXT ( GLuint buf, GLenum modeRGB, GLenum modeAlpha ) */
662 android_glBlendEquationSeparateiEXT__III
663 (JNIEnv *_env, jobject _this, jint buf, jint modeRGB, jint modeAlpha) {
664 glBlendEquationSeparateiEXT(
671 /* void glBlendFunciEXT ( GLuint buf, GLenum src, GLenum dst ) */
673 android_glBlendFunciEXT__III
674 (JNIEnv *_env, jobject _this, jint buf, jint src, jint dst) {
682 /* void glBlendFuncSeparateiEXT ( GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */
684 android_glBlendFuncSeparateiEXT__IIIII
685 (JNIEnv *_env, jobject _this, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) {
686 glBlendFuncSeparateiEXT(
695 /* void glColorMaskiEXT ( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a ) */
697 android_glColorMaskiEXT__IZZZZ
698 (JNIEnv *_env, jobject _this, jint index, jboolean r, jboolean g, jboolean b, jboolean a) {
708 /* GLboolean glIsEnablediEXT ( GLenum target, GLuint index ) */
710 android_glIsEnablediEXT__II
711 (JNIEnv *_env, jobject _this, jint target, jint index) {
712 GLboolean _returnValue;
713 _returnValue = glIsEnablediEXT(
717 return (jboolean)_returnValue;
720 /* void glFramebufferTextureEXT ( GLenum target, GLenum attachment, GLuint texture, GLint level ) */
722 android_glFramebufferTextureEXT__IIII
723 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level) {
724 glFramebufferTextureEXT(
732 /* void glPrimitiveBoundingBoxEXT ( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW ) */
734 android_glPrimitiveBoundingBoxEXT__FFFFFFFF
735 (JNIEnv *_env, jobject _this, jfloat minX, jfloat minY, jfloat minZ, jfloat minW, jfloat maxX, jfloat maxY, jfloat maxZ, jfloat maxW) {
736 glPrimitiveBoundingBoxEXT(
748 /* void glPatchParameteriEXT ( GLenum pname, GLint value ) */
750 android_glPatchParameteriEXT__II
751 (JNIEnv *_env, jobject _this, jint pname, jint value) {
752 glPatchParameteriEXT(
758 /* void glTexParameterIivEXT ( GLenum target, GLenum pname, const GLint *params ) */
760 android_glTexParameterIivEXT__II_3II
761 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
763 const char * _exceptionType = NULL;
764 const char * _exceptionMessage = NULL;
765 GLint *params_base = (GLint *) 0;
767 GLint *params = (GLint *) 0;
771 _exceptionType = "java/lang/IllegalArgumentException";
772 _exceptionMessage = "params == null";
777 _exceptionType = "java/lang/IllegalArgumentException";
778 _exceptionMessage = "offset < 0";
781 _remaining = _env->GetArrayLength(params_ref) - offset;
782 params_base = (GLint *)
783 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
784 params = params_base + offset;
786 glTexParameterIivEXT(
794 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
798 jniThrowException(_env, _exceptionType, _exceptionMessage);
802 /* void glTexParameterIivEXT ( GLenum target, GLenum pname, const GLint *params ) */
804 android_glTexParameterIivEXT__IILjava_nio_IntBuffer_2
805 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
806 jarray _array = (jarray) 0;
807 jint _bufferOffset = (jint) 0;
809 GLint *params = (GLint *) 0;
811 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
812 if (params == NULL) {
813 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
814 params = (GLint *) (_paramsBase + _bufferOffset);
816 glTexParameterIivEXT(
822 releasePointer(_env, _array, params, JNI_FALSE);
826 /* void glTexParameterIuivEXT ( GLenum target, GLenum pname, const GLuint *params ) */
828 android_glTexParameterIuivEXT__II_3II
829 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
831 const char * _exceptionType = NULL;
832 const char * _exceptionMessage = NULL;
833 GLuint *params_base = (GLuint *) 0;
835 GLuint *params = (GLuint *) 0;
839 _exceptionType = "java/lang/IllegalArgumentException";
840 _exceptionMessage = "params == null";
845 _exceptionType = "java/lang/IllegalArgumentException";
846 _exceptionMessage = "offset < 0";
849 _remaining = _env->GetArrayLength(params_ref) - offset;
850 params_base = (GLuint *)
851 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
852 params = params_base + offset;
854 glTexParameterIuivEXT(
862 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
866 jniThrowException(_env, _exceptionType, _exceptionMessage);
870 /* void glTexParameterIuivEXT ( GLenum target, GLenum pname, const GLuint *params ) */
872 android_glTexParameterIuivEXT__IILjava_nio_IntBuffer_2
873 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
874 jarray _array = (jarray) 0;
875 jint _bufferOffset = (jint) 0;
877 GLuint *params = (GLuint *) 0;
879 params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
880 if (params == NULL) {
881 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
882 params = (GLuint *) (_paramsBase + _bufferOffset);
884 glTexParameterIuivEXT(
890 releasePointer(_env, _array, params, JNI_FALSE);
894 /* void glGetTexParameterIivEXT ( GLenum target, GLenum pname, GLint *params ) */
896 android_glGetTexParameterIivEXT__II_3II
897 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
899 const char * _exceptionType = NULL;
900 const char * _exceptionMessage = NULL;
901 GLint *params_base = (GLint *) 0;
903 GLint *params = (GLint *) 0;
907 _exceptionType = "java/lang/IllegalArgumentException";
908 _exceptionMessage = "params == null";
913 _exceptionType = "java/lang/IllegalArgumentException";
914 _exceptionMessage = "offset < 0";
917 _remaining = _env->GetArrayLength(params_ref) - offset;
918 params_base = (GLint *)
919 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
920 params = params_base + offset;
922 glGetTexParameterIivEXT(
930 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
931 _exception ? JNI_ABORT: 0);
934 jniThrowException(_env, _exceptionType, _exceptionMessage);
938 /* void glGetTexParameterIivEXT ( GLenum target, GLenum pname, GLint *params ) */
940 android_glGetTexParameterIivEXT__IILjava_nio_IntBuffer_2
941 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
942 jarray _array = (jarray) 0;
943 jint _bufferOffset = (jint) 0;
945 GLint *params = (GLint *) 0;
947 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
948 if (params == NULL) {
949 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
950 params = (GLint *) (_paramsBase + _bufferOffset);
952 glGetTexParameterIivEXT(
958 releasePointer(_env, _array, params, JNI_TRUE);
962 /* void glGetTexParameterIuivEXT ( GLenum target, GLenum pname, GLuint *params ) */
964 android_glGetTexParameterIuivEXT__II_3II
965 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) {
967 const char * _exceptionType = NULL;
968 const char * _exceptionMessage = NULL;
969 GLuint *params_base = (GLuint *) 0;
971 GLuint *params = (GLuint *) 0;
975 _exceptionType = "java/lang/IllegalArgumentException";
976 _exceptionMessage = "params == null";
981 _exceptionType = "java/lang/IllegalArgumentException";
982 _exceptionMessage = "offset < 0";
985 _remaining = _env->GetArrayLength(params_ref) - offset;
986 params_base = (GLuint *)
987 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
988 params = params_base + offset;
990 glGetTexParameterIuivEXT(
998 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
999 _exception ? JNI_ABORT: 0);
1002 jniThrowException(_env, _exceptionType, _exceptionMessage);
1006 /* void glGetTexParameterIuivEXT ( GLenum target, GLenum pname, GLuint *params ) */
1008 android_glGetTexParameterIuivEXT__IILjava_nio_IntBuffer_2
1009 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) {
1010 jarray _array = (jarray) 0;
1011 jint _bufferOffset = (jint) 0;
1013 GLuint *params = (GLuint *) 0;
1015 params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
1016 if (params == NULL) {
1017 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1018 params = (GLuint *) (_paramsBase + _bufferOffset);
1020 glGetTexParameterIuivEXT(
1026 releasePointer(_env, _array, params, JNI_TRUE);
1030 /* void glSamplerParameterIivEXT ( GLuint sampler, GLenum pname, const GLint *param ) */
1032 android_glSamplerParameterIivEXT__II_3II
1033 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
1034 jint _exception = 0;
1035 const char * _exceptionType = NULL;
1036 const char * _exceptionMessage = NULL;
1037 GLint *param_base = (GLint *) 0;
1039 GLint *param = (GLint *) 0;
1043 _exceptionType = "java/lang/IllegalArgumentException";
1044 _exceptionMessage = "param == null";
1049 _exceptionType = "java/lang/IllegalArgumentException";
1050 _exceptionMessage = "offset < 0";
1053 _remaining = _env->GetArrayLength(param_ref) - offset;
1054 param_base = (GLint *)
1055 _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0);
1056 param = param_base + offset;
1058 glSamplerParameterIivEXT(
1066 _env->ReleasePrimitiveArrayCritical(param_ref, param_base,
1070 jniThrowException(_env, _exceptionType, _exceptionMessage);
1074 /* void glSamplerParameterIivEXT ( GLuint sampler, GLenum pname, const GLint *param ) */
1076 android_glSamplerParameterIivEXT__IILjava_nio_IntBuffer_2
1077 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
1078 jarray _array = (jarray) 0;
1079 jint _bufferOffset = (jint) 0;
1081 GLint *param = (GLint *) 0;
1083 param = (GLint *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset);
1084 if (param == NULL) {
1085 char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1086 param = (GLint *) (_paramBase + _bufferOffset);
1088 glSamplerParameterIivEXT(
1094 releasePointer(_env, _array, param, JNI_FALSE);
1098 /* void glSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, const GLuint *param ) */
1100 android_glSamplerParameterIuivEXT__II_3II
1101 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) {
1102 jint _exception = 0;
1103 const char * _exceptionType = NULL;
1104 const char * _exceptionMessage = NULL;
1105 GLuint *param_base = (GLuint *) 0;
1107 GLuint *param = (GLuint *) 0;
1111 _exceptionType = "java/lang/IllegalArgumentException";
1112 _exceptionMessage = "param == null";
1117 _exceptionType = "java/lang/IllegalArgumentException";
1118 _exceptionMessage = "offset < 0";
1121 _remaining = _env->GetArrayLength(param_ref) - offset;
1122 param_base = (GLuint *)
1123 _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0);
1124 param = param_base + offset;
1126 glSamplerParameterIuivEXT(
1134 _env->ReleasePrimitiveArrayCritical(param_ref, param_base,
1138 jniThrowException(_env, _exceptionType, _exceptionMessage);
1142 /* void glSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, const GLuint *param ) */
1144 android_glSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2
1145 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) {
1146 jarray _array = (jarray) 0;
1147 jint _bufferOffset = (jint) 0;
1149 GLuint *param = (GLuint *) 0;
1151 param = (GLuint *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset);
1152 if (param == NULL) {
1153 char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1154 param = (GLuint *) (_paramBase + _bufferOffset);
1156 glSamplerParameterIuivEXT(
1162 releasePointer(_env, _array, param, JNI_FALSE);
1166 /* void glGetSamplerParameterIivEXT ( GLuint sampler, GLenum pname, GLint *params ) */
1168 android_glGetSamplerParameterIivEXT__II_3II
1169 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
1170 jint _exception = 0;
1171 const char * _exceptionType = NULL;
1172 const char * _exceptionMessage = NULL;
1173 GLint *params_base = (GLint *) 0;
1175 GLint *params = (GLint *) 0;
1179 _exceptionType = "java/lang/IllegalArgumentException";
1180 _exceptionMessage = "params == null";
1185 _exceptionType = "java/lang/IllegalArgumentException";
1186 _exceptionMessage = "offset < 0";
1189 _remaining = _env->GetArrayLength(params_ref) - offset;
1190 params_base = (GLint *)
1191 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1192 params = params_base + offset;
1194 glGetSamplerParameterIivEXT(
1202 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1203 _exception ? JNI_ABORT: 0);
1206 jniThrowException(_env, _exceptionType, _exceptionMessage);
1210 /* void glGetSamplerParameterIivEXT ( GLuint sampler, GLenum pname, GLint *params ) */
1212 android_glGetSamplerParameterIivEXT__IILjava_nio_IntBuffer_2
1213 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
1214 jarray _array = (jarray) 0;
1215 jint _bufferOffset = (jint) 0;
1217 GLint *params = (GLint *) 0;
1219 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
1220 if (params == NULL) {
1221 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1222 params = (GLint *) (_paramsBase + _bufferOffset);
1224 glGetSamplerParameterIivEXT(
1230 releasePointer(_env, _array, params, JNI_TRUE);
1234 /* void glGetSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, GLuint *params ) */
1236 android_glGetSamplerParameterIuivEXT__II_3II
1237 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) {
1238 jint _exception = 0;
1239 const char * _exceptionType = NULL;
1240 const char * _exceptionMessage = NULL;
1241 GLuint *params_base = (GLuint *) 0;
1243 GLuint *params = (GLuint *) 0;
1247 _exceptionType = "java/lang/IllegalArgumentException";
1248 _exceptionMessage = "params == null";
1253 _exceptionType = "java/lang/IllegalArgumentException";
1254 _exceptionMessage = "offset < 0";
1257 _remaining = _env->GetArrayLength(params_ref) - offset;
1258 params_base = (GLuint *)
1259 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0);
1260 params = params_base + offset;
1262 glGetSamplerParameterIuivEXT(
1270 _env->ReleasePrimitiveArrayCritical(params_ref, params_base,
1271 _exception ? JNI_ABORT: 0);
1274 jniThrowException(_env, _exceptionType, _exceptionMessage);
1278 /* void glGetSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, GLuint *params ) */
1280 android_glGetSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2
1281 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) {
1282 jarray _array = (jarray) 0;
1283 jint _bufferOffset = (jint) 0;
1285 GLuint *params = (GLuint *) 0;
1287 params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset);
1288 if (params == NULL) {
1289 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0);
1290 params = (GLuint *) (_paramsBase + _bufferOffset);
1292 glGetSamplerParameterIuivEXT(
1298 releasePointer(_env, _array, params, JNI_TRUE);
1302 /* void glTexBufferEXT ( GLenum target, GLenum internalformat, GLuint buffer ) */
1304 android_glTexBufferEXT__III
1305 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer) {
1308 (GLenum)internalformat,
1313 /* void glTexBufferRangeEXT ( GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size ) */
1315 android_glTexBufferRangeEXT__IIIII
1316 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer, jint offset, jint size) {
1317 glTexBufferRangeEXT(
1319 (GLenum)internalformat,
1326 static const char *classPathName = "android/opengl/GLES31Ext";
1328 static JNINativeMethod methods[] = {
1329 {"_nativeClassInit", "()V", (void*)nativeClassInit },
1330 {"glBlendBarrierKHR", "()V", (void *) android_glBlendBarrierKHR__ },
1331 {"glDebugMessageControlKHR", "(IIII[IIZ)V", (void *) android_glDebugMessageControlKHR__IIII_3IIZ },
1332 {"glDebugMessageControlKHR", "(IIIILjava/nio/IntBuffer;Z)V", (void *) android_glDebugMessageControlKHR__IIIILjava_nio_IntBuffer_2Z },
1333 {"glDebugMessageInsertKHR", "(IIIILjava/lang/String;)V", (void *) android_glDebugMessageInsertKHR__IIIILjava_lang_String_2 },
1334 {"glDebugMessageCallbackKHR", "(Landroid/opengl/GLES31Ext$DebugProcKHR;)V", (void *) android_glDebugMessageCallbackKHR },
1335 {"glGetDebugMessageLogKHR", "(II[II[II[II[II[II[BI)I", (void *) android_glGetDebugMessageLogKHR__II_3II_3II_3II_3II_3II_3BI },
1336 {"glGetDebugMessageLogKHR", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/ByteBuffer;)I", (void *) android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 },
1337 {"glGetDebugMessageLogKHR", "(I[II[II[II[II)[Ljava/lang/String;", (void *) android_glGetDebugMessageLogKHR__I_3II_3II_3II_3II },
1338 {"glGetDebugMessageLogKHR", "(ILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;)[Ljava/lang/String;", (void *) android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 },
1339 {"glPushDebugGroupKHR", "(IIILjava/lang/String;)V", (void *) android_glPushDebugGroupKHR__IIILjava_lang_String_2 },
1340 {"glPopDebugGroupKHR", "()V", (void *) android_glPopDebugGroupKHR__ },
1341 {"glObjectLabelKHR", "(IIILjava/lang/String;)V", (void *) android_glObjectLabelKHR__IIILjava_lang_String_2 },
1342 {"glGetObjectLabelKHR", "(II)Ljava/lang/String;", (void *) android_glGetObjectLabelKHR },
1343 {"glObjectPtrLabelKHR", "(JLjava/lang/String;)V", (void *) android_glObjectPtrLabelKHR },
1344 {"glGetObjectPtrLabelKHR", "(J)Ljava/lang/String;", (void *) android_glGetObjectPtrLabelKHR },
1345 {"glGetDebugMessageCallbackKHR", "()Landroid/opengl/GLES31Ext$DebugProcKHR;", (void *) android_glGetDebugMessageCallbackKHR },
1346 {"glMinSampleShadingOES", "(F)V", (void *) android_glMinSampleShadingOES__F },
1347 {"glTexStorage3DMultisampleOES", "(IIIIIIZ)V", (void *) android_glTexStorage3DMultisampleOES__IIIIIIZ },
1348 {"glCopyImageSubDataEXT", "(IIIIIIIIIIIIIII)V", (void *) android_glCopyImageSubDataEXT__IIIIIIIIIIIIIII },
1349 {"glEnableiEXT", "(II)V", (void *) android_glEnableiEXT__II },
1350 {"glDisableiEXT", "(II)V", (void *) android_glDisableiEXT__II },
1351 {"glBlendEquationiEXT", "(II)V", (void *) android_glBlendEquationiEXT__II },
1352 {"glBlendEquationSeparateiEXT", "(III)V", (void *) android_glBlendEquationSeparateiEXT__III },
1353 {"glBlendFunciEXT", "(III)V", (void *) android_glBlendFunciEXT__III },
1354 {"glBlendFuncSeparateiEXT", "(IIIII)V", (void *) android_glBlendFuncSeparateiEXT__IIIII },
1355 {"glColorMaskiEXT", "(IZZZZ)V", (void *) android_glColorMaskiEXT__IZZZZ },
1356 {"glIsEnablediEXT", "(II)Z", (void *) android_glIsEnablediEXT__II },
1357 {"glFramebufferTextureEXT", "(IIII)V", (void *) android_glFramebufferTextureEXT__IIII },
1358 {"glPrimitiveBoundingBoxEXT", "(FFFFFFFF)V", (void *) android_glPrimitiveBoundingBoxEXT__FFFFFFFF },
1359 {"glPatchParameteriEXT", "(II)V", (void *) android_glPatchParameteriEXT__II },
1360 {"glTexParameterIivEXT", "(II[II)V", (void *) android_glTexParameterIivEXT__II_3II },
1361 {"glTexParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIivEXT__IILjava_nio_IntBuffer_2 },
1362 {"glTexParameterIuivEXT", "(II[II)V", (void *) android_glTexParameterIuivEXT__II_3II },
1363 {"glTexParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1364 {"glGetTexParameterIivEXT", "(II[II)V", (void *) android_glGetTexParameterIivEXT__II_3II },
1365 {"glGetTexParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIivEXT__IILjava_nio_IntBuffer_2 },
1366 {"glGetTexParameterIuivEXT", "(II[II)V", (void *) android_glGetTexParameterIuivEXT__II_3II },
1367 {"glGetTexParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1368 {"glSamplerParameterIivEXT", "(II[II)V", (void *) android_glSamplerParameterIivEXT__II_3II },
1369 {"glSamplerParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 },
1370 {"glSamplerParameterIuivEXT", "(II[II)V", (void *) android_glSamplerParameterIuivEXT__II_3II },
1371 {"glSamplerParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1372 {"glGetSamplerParameterIivEXT", "(II[II)V", (void *) android_glGetSamplerParameterIivEXT__II_3II },
1373 {"glGetSamplerParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 },
1374 {"glGetSamplerParameterIuivEXT", "(II[II)V", (void *) android_glGetSamplerParameterIuivEXT__II_3II },
1375 {"glGetSamplerParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 },
1376 {"glTexBufferEXT", "(III)V", (void *) android_glTexBufferEXT__III },
1377 {"glTexBufferRangeEXT", "(IIIII)V", (void *) android_glTexBufferRangeEXT__IIIII },
1380 int register_android_opengl_jni_GLES31Ext(JNIEnv *_env)
1383 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods));