android_opengl_GLES31Ext.cpp revision bfe6333c3cf529600f41f14e3b8c5846e632c9a2
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 <GLES3/gl31.h> 24#include <GLES2/gl2ext.h> 25 26#include <jni.h> 27#include <JNIHelp.h> 28#include <android_runtime/AndroidRuntime.h> 29#include <utils/misc.h> 30#include <assert.h> 31 32static int initialized = 0; 33 34static jclass nioAccessClass; 35static jclass bufferClass; 36static jmethodID getBasePointerID; 37static jmethodID getBaseArrayID; 38static jmethodID getBaseArrayOffsetID; 39static jfieldID positionID; 40static jfieldID limitID; 41static jfieldID elementSizeShiftID; 42 43 44/* special calls implemented in Android's GLES wrapper used to more 45 * efficiently bound-check passed arrays */ 46extern "C" { 47#ifdef GL_VERSION_ES_CM_1_1 48GL_API void GL_APIENTRY glColorPointerBounds(GLint size, GLenum type, GLsizei stride, 49 const GLvoid *ptr, GLsizei count); 50GL_API void GL_APIENTRY glNormalPointerBounds(GLenum type, GLsizei stride, 51 const GLvoid *pointer, GLsizei count); 52GL_API void GL_APIENTRY glTexCoordPointerBounds(GLint size, GLenum type, 53 GLsizei stride, const GLvoid *pointer, GLsizei count); 54GL_API void GL_APIENTRY glVertexPointerBounds(GLint size, GLenum type, 55 GLsizei stride, const GLvoid *pointer, GLsizei count); 56GL_API void GL_APIENTRY glPointSizePointerOESBounds(GLenum type, 57 GLsizei stride, const GLvoid *pointer, GLsizei count); 58GL_API void GL_APIENTRY glMatrixIndexPointerOESBounds(GLint size, GLenum type, 59 GLsizei stride, const GLvoid *pointer, GLsizei count); 60GL_API void GL_APIENTRY glWeightPointerOESBounds(GLint size, GLenum type, 61 GLsizei stride, const GLvoid *pointer, GLsizei count); 62#endif 63#ifdef GL_ES_VERSION_2_0 64static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type, 65 GLboolean normalized, GLsizei stride, const GLvoid *pointer, GLsizei count) { 66 glVertexAttribPointer(indx, size, type, normalized, stride, pointer); 67} 68#endif 69#ifdef GL_ES_VERSION_3_0 70static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type, 71 GLsizei stride, const GLvoid *pointer, GLsizei count) { 72 glVertexAttribIPointer(indx, size, type, stride, pointer); 73} 74#endif 75} 76 77/* Cache method IDs each time the class is loaded. */ 78 79static void 80nativeClassInit(JNIEnv *_env, jclass glImplClass) 81{ 82 jclass nioAccessClassLocal = _env->FindClass("java/nio/NIOAccess"); 83 nioAccessClass = (jclass) _env->NewGlobalRef(nioAccessClassLocal); 84 85 jclass bufferClassLocal = _env->FindClass("java/nio/Buffer"); 86 bufferClass = (jclass) _env->NewGlobalRef(bufferClassLocal); 87 88 getBasePointerID = _env->GetStaticMethodID(nioAccessClass, 89 "getBasePointer", "(Ljava/nio/Buffer;)J"); 90 getBaseArrayID = _env->GetStaticMethodID(nioAccessClass, 91 "getBaseArray", "(Ljava/nio/Buffer;)Ljava/lang/Object;"); 92 getBaseArrayOffsetID = _env->GetStaticMethodID(nioAccessClass, 93 "getBaseArrayOffset", "(Ljava/nio/Buffer;)I"); 94 95 positionID = _env->GetFieldID(bufferClass, "position", "I"); 96 limitID = _env->GetFieldID(bufferClass, "limit", "I"); 97 elementSizeShiftID = 98 _env->GetFieldID(bufferClass, "_elementSizeShift", "I"); 99} 100 101static void * 102getPointer(JNIEnv *_env, jobject buffer, jarray *array, jint *remaining, jint *offset) 103{ 104 jint position; 105 jint limit; 106 jint elementSizeShift; 107 jlong pointer; 108 109 position = _env->GetIntField(buffer, positionID); 110 limit = _env->GetIntField(buffer, limitID); 111 elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 112 *remaining = (limit - position) << elementSizeShift; 113 pointer = _env->CallStaticLongMethod(nioAccessClass, 114 getBasePointerID, buffer); 115 if (pointer != 0L) { 116 *array = NULL; 117 return reinterpret_cast<void*>(pointer); 118 } 119 120 *array = (jarray) _env->CallStaticObjectMethod(nioAccessClass, 121 getBaseArrayID, buffer); 122 *offset = _env->CallStaticIntMethod(nioAccessClass, 123 getBaseArrayOffsetID, buffer); 124 125 return NULL; 126} 127 128static void 129releasePointer(JNIEnv *_env, jarray array, void *data, jboolean commit) 130{ 131 _env->ReleasePrimitiveArrayCritical(array, data, 132 commit ? 0 : JNI_ABORT); 133} 134 135static void * 136getDirectBufferPointer(JNIEnv *_env, jobject buffer) { 137 char* buf = (char*) _env->GetDirectBufferAddress(buffer); 138 if (buf) { 139 jint position = _env->GetIntField(buffer, positionID); 140 jint elementSizeShift = _env->GetIntField(buffer, elementSizeShiftID); 141 buf += position << elementSizeShift; 142 } else { 143 jniThrowException(_env, "java/lang/IllegalArgumentException", 144 "Must use a native order direct Buffer"); 145 } 146 return (void*) buf; 147} 148 149// -------------------------------------------------------------------------- 150 151/* 152 * returns the number of values glGet returns for a given pname. 153 * 154 * The code below is written such that pnames requiring only one values 155 * are the default (and are not explicitely tested for). This makes the 156 * checking code much shorter/readable/efficient. 157 * 158 * This means that unknown pnames (e.g.: extensions) will default to 1. If 159 * that unknown pname needs more than 1 value, then the validation check 160 * is incomplete and the app may crash if it passed the wrong number params. 161 */ 162static int getNeededCount(GLint pname) { 163 int needed = 1; 164#ifdef GL_ES_VERSION_2_0 165 // GLES 2.x pnames 166 switch (pname) { 167 case GL_ALIASED_LINE_WIDTH_RANGE: 168 case GL_ALIASED_POINT_SIZE_RANGE: 169 needed = 2; 170 break; 171 172 case GL_BLEND_COLOR: 173 case GL_COLOR_CLEAR_VALUE: 174 case GL_COLOR_WRITEMASK: 175 case GL_SCISSOR_BOX: 176 case GL_VIEWPORT: 177 needed = 4; 178 break; 179 180 case GL_COMPRESSED_TEXTURE_FORMATS: 181 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 182 break; 183 184 case GL_SHADER_BINARY_FORMATS: 185 glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &needed); 186 break; 187 } 188#endif 189 190#ifdef GL_VERSION_ES_CM_1_1 191 // GLES 1.x pnames 192 switch (pname) { 193 case GL_ALIASED_LINE_WIDTH_RANGE: 194 case GL_ALIASED_POINT_SIZE_RANGE: 195 case GL_DEPTH_RANGE: 196 case GL_SMOOTH_LINE_WIDTH_RANGE: 197 case GL_SMOOTH_POINT_SIZE_RANGE: 198 needed = 2; 199 break; 200 201 case GL_CURRENT_NORMAL: 202 case GL_POINT_DISTANCE_ATTENUATION: 203 needed = 3; 204 break; 205 206 case GL_COLOR_CLEAR_VALUE: 207 case GL_COLOR_WRITEMASK: 208 case GL_CURRENT_COLOR: 209 case GL_CURRENT_TEXTURE_COORDS: 210 case GL_FOG_COLOR: 211 case GL_LIGHT_MODEL_AMBIENT: 212 case GL_SCISSOR_BOX: 213 case GL_VIEWPORT: 214 needed = 4; 215 break; 216 217 case GL_MODELVIEW_MATRIX: 218 case GL_PROJECTION_MATRIX: 219 case GL_TEXTURE_MATRIX: 220 needed = 16; 221 break; 222 223 case GL_COMPRESSED_TEXTURE_FORMATS: 224 glGetIntegerv(GL_NUM_COMPRESSED_TEXTURE_FORMATS, &needed); 225 break; 226 } 227#endif 228 return needed; 229} 230 231template <typename JTYPEARRAY, typename CTYPE, void GET(GLenum, CTYPE*)> 232static void 233get 234 (JNIEnv *_env, jobject _this, jint pname, JTYPEARRAY params_ref, jint offset) { 235 jint _exception = 0; 236 const char * _exceptionType; 237 const char * _exceptionMessage; 238 CTYPE *params_base = (CTYPE *) 0; 239 jint _remaining; 240 CTYPE *params = (CTYPE *) 0; 241 int _needed = 0; 242 243 if (!params_ref) { 244 _exception = 1; 245 _exceptionType = "java/lang/IllegalArgumentException"; 246 _exceptionMessage = "params == null"; 247 goto exit; 248 } 249 if (offset < 0) { 250 _exception = 1; 251 _exceptionType = "java/lang/IllegalArgumentException"; 252 _exceptionMessage = "offset < 0"; 253 goto exit; 254 } 255 _remaining = _env->GetArrayLength(params_ref) - offset; 256 _needed = getNeededCount(pname); 257 // if we didn't find this pname, we just assume the user passed 258 // an array of the right size -- this might happen with extensions 259 // or if we forget an enum here. 260 if (_remaining < _needed) { 261 _exception = 1; 262 _exceptionType = "java/lang/IllegalArgumentException"; 263 _exceptionMessage = "length - offset < needed"; 264 goto exit; 265 } 266 params_base = (CTYPE *) 267 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 268 params = params_base + offset; 269 270 GET( 271 (GLenum)pname, 272 (CTYPE *)params 273 ); 274 275exit: 276 if (params_base) { 277 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 278 _exception ? JNI_ABORT: 0); 279 } 280 if (_exception) { 281 jniThrowException(_env, _exceptionType, _exceptionMessage); 282 } 283} 284 285 286template <typename CTYPE, void GET(GLenum, CTYPE*)> 287static void 288getarray 289 (JNIEnv *_env, jobject _this, jint pname, jobject params_buf) { 290 jint _exception = 0; 291 const char * _exceptionType; 292 const char * _exceptionMessage; 293 jarray _array = (jarray) 0; 294 jint _bufferOffset = (jint) 0; 295 jint _remaining; 296 CTYPE *params = (CTYPE *) 0; 297 int _needed = 0; 298 299 params = (CTYPE *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 300 _remaining /= sizeof(CTYPE); // convert from bytes to item count 301 _needed = getNeededCount(pname); 302 // if we didn't find this pname, we just assume the user passed 303 // an array of the right size -- this might happen with extensions 304 // or if we forget an enum here. 305 if (_needed>0 && _remaining < _needed) { 306 _exception = 1; 307 _exceptionType = "java/lang/IllegalArgumentException"; 308 _exceptionMessage = "remaining() < needed"; 309 goto exit; 310 } 311 if (params == NULL) { 312 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 313 params = (CTYPE *) (_paramsBase + _bufferOffset); 314 } 315 GET( 316 (GLenum)pname, 317 (CTYPE *)params 318 ); 319 320exit: 321 if (_array) { 322 releasePointer(_env, _array, params, _exception ? JNI_FALSE : JNI_TRUE); 323 } 324 if (_exception) { 325 jniThrowException(_env, _exceptionType, _exceptionMessage); 326 } 327} 328 329// -------------------------------------------------------------------------- 330/* void glBlendBarrierKHR ( void ) */ 331static void 332android_glBlendBarrierKHR__ 333 (JNIEnv *_env, jobject _this) { 334 glBlendBarrierKHR(); 335} 336 337/* void glDebugMessageControlKHR ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */ 338static void 339android_glDebugMessageControlKHR__IIII_3IIZ 340 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jintArray ids_ref, jint offset, jboolean enabled) { 341 jint _exception = 0; 342 const char * _exceptionType = NULL; 343 const char * _exceptionMessage = NULL; 344 GLuint *ids_base = (GLuint *) 0; 345 jint _remaining; 346 GLuint *ids = (GLuint *) 0; 347 348 if (!ids_ref) { 349 _exception = 1; 350 _exceptionType = "java/lang/IllegalArgumentException"; 351 _exceptionMessage = "ids == null"; 352 goto exit; 353 } 354 if (offset < 0) { 355 _exception = 1; 356 _exceptionType = "java/lang/IllegalArgumentException"; 357 _exceptionMessage = "offset < 0"; 358 goto exit; 359 } 360 _remaining = _env->GetArrayLength(ids_ref) - offset; 361 ids_base = (GLuint *) 362 _env->GetPrimitiveArrayCritical(ids_ref, (jboolean *)0); 363 ids = ids_base + offset; 364 365 glDebugMessageControlKHR( 366 (GLenum)source, 367 (GLenum)type, 368 (GLenum)severity, 369 (GLsizei)count, 370 (GLuint *)ids, 371 (GLboolean)enabled 372 ); 373 374exit: 375 if (ids_base) { 376 _env->ReleasePrimitiveArrayCritical(ids_ref, ids_base, 377 JNI_ABORT); 378 } 379 if (_exception) { 380 jniThrowException(_env, _exceptionType, _exceptionMessage); 381 } 382} 383 384/* void glDebugMessageControlKHR ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled ) */ 385static void 386android_glDebugMessageControlKHR__IIIILjava_nio_IntBuffer_2Z 387 (JNIEnv *_env, jobject _this, jint source, jint type, jint severity, jint count, jobject ids_buf, jboolean enabled) { 388 jarray _array = (jarray) 0; 389 jint _bufferOffset = (jint) 0; 390 jint _remaining; 391 GLuint *ids = (GLuint *) 0; 392 393 ids = (GLuint *)getPointer(_env, ids_buf, &_array, &_remaining, &_bufferOffset); 394 if (ids == NULL) { 395 char * _idsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 396 ids = (GLuint *) (_idsBase + _bufferOffset); 397 } 398 glDebugMessageControlKHR( 399 (GLenum)source, 400 (GLenum)type, 401 (GLenum)severity, 402 (GLsizei)count, 403 (GLuint *)ids, 404 (GLboolean)enabled 405 ); 406 if (_array) { 407 releasePointer(_env, _array, ids, JNI_FALSE); 408 } 409} 410 411/* void glDebugMessageInsertKHR ( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf ) */ 412static void 413android_glDebugMessageInsertKHR__IIIILjava_lang_String_2 414 (JNIEnv *_env, jobject _this, jint source, jint type, jint id, jint severity, jstring buf) { 415 jint _exception = 0; 416 const char * _exceptionType = NULL; 417 const char * _exceptionMessage = NULL; 418 const char* _nativebuf = 0; 419 jint _length = 0; 420 421 if (!buf) { 422 _exception = 1; 423 _exceptionType = "java/lang/IllegalArgumentException"; 424 _exceptionMessage = "buf == null"; 425 goto exit; 426 } 427 _nativebuf = _env->GetStringUTFChars(buf, 0); 428 _length = _env->GetStringUTFLength(buf); 429 430 glDebugMessageInsertKHR( 431 (GLenum)source, 432 (GLenum)type, 433 (GLuint)id, 434 (GLenum)severity, 435 (GLsizei)_length, 436 (GLchar *)_nativebuf 437 ); 438 439exit: 440 if (_nativebuf) { 441 _env->ReleaseStringUTFChars(buf, _nativebuf); 442 } 443 444 if (_exception) { 445 jniThrowException(_env, _exceptionType, _exceptionMessage); 446 } 447} 448 449/* void glDebugMessageCallbackKHR ( GLDEBUGPROCKHR callback, const void *userParam ) */ 450static void 451android_glDebugMessageCallbackKHR(JNIEnv *_env, jobject _this, jobject callback) { 452 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 453} 454/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */ 455static jint 456android_glGetDebugMessageLogKHR__II_3II_3II_3II_3II_3II_3BI 457 (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) { 458 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 459 return 0; 460} 461 462/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */ 463static uint 464android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_ByteBuffer_2 465 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref, jobject lengths_ref, jobject messageLog_ref) { 466 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 467 return 0; 468} 469 470/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */ 471static jobjectArray 472android_glGetDebugMessageLogKHR__I_3II_3II_3II_3II 473 (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) { 474 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 475 return 0; 476} 477 478/* GLuint glGetDebugMessageLogKHR ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog ) */ 479static jobjectArray 480android_glGetDebugMessageLogKHR__ILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2 481 (JNIEnv *_env, jobject _this, jint count, jobject sources_ref, jobject types_ref, jobject ids_ref, jobject severities_ref) { 482 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 483 return 0; 484} 485/* void glPushDebugGroupKHR ( GLenum source, GLuint id, GLsizei length, const GLchar *message ) */ 486static void 487android_glPushDebugGroupKHR__IIILjava_lang_String_2 488 (JNIEnv *_env, jobject _this, jint source, jint id, jint length, jstring message) { 489 jint _exception = 0; 490 const char * _exceptionType = NULL; 491 const char * _exceptionMessage = NULL; 492 const char* _nativemessage = 0; 493 494 if (!message) { 495 _exception = 1; 496 _exceptionType = "java/lang/IllegalArgumentException"; 497 _exceptionMessage = "message == null"; 498 goto exit; 499 } 500 _nativemessage = _env->GetStringUTFChars(message, 0); 501 502 glPushDebugGroupKHR( 503 (GLenum)source, 504 (GLuint)id, 505 (GLsizei)length, 506 (GLchar *)_nativemessage 507 ); 508 509exit: 510 if (_nativemessage) { 511 _env->ReleaseStringUTFChars(message, _nativemessage); 512 } 513 514 if (_exception) { 515 jniThrowException(_env, _exceptionType, _exceptionMessage); 516 } 517} 518 519/* void glPopDebugGroupKHR ( void ) */ 520static void 521android_glPopDebugGroupKHR__ 522 (JNIEnv *_env, jobject _this) { 523 glPopDebugGroupKHR(); 524} 525 526/* void glObjectLabelKHR ( GLenum identifier, GLuint name, GLsizei length, const GLchar *label ) */ 527static void 528android_glObjectLabelKHR__IIILjava_lang_String_2 529 (JNIEnv *_env, jobject _this, jint identifier, jint name, jint length, jstring label) { 530 jint _exception = 0; 531 const char * _exceptionType = NULL; 532 const char * _exceptionMessage = NULL; 533 const char* _nativelabel = 0; 534 535 if (!label) { 536 _exception = 1; 537 _exceptionType = "java/lang/IllegalArgumentException"; 538 _exceptionMessage = "label == null"; 539 goto exit; 540 } 541 _nativelabel = _env->GetStringUTFChars(label, 0); 542 543 glObjectLabelKHR( 544 (GLenum)identifier, 545 (GLuint)name, 546 (GLsizei)length, 547 (GLchar *)_nativelabel 548 ); 549 550exit: 551 if (_nativelabel) { 552 _env->ReleaseStringUTFChars(label, _nativelabel); 553 } 554 555 if (_exception) { 556 jniThrowException(_env, _exceptionType, _exceptionMessage); 557 } 558} 559 560/* void glGetObjectLabelKHR ( GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label ) */ 561static jstring 562android_glGetObjectLabelKHR(JNIEnv *_env, jobject _this, jint identifier, jint name) { 563 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 564 return NULL; 565} 566 567/* void glObjectPtrLabelKHR ( const void *ptr, GLsizei length, const GLchar *label ) */ 568static void 569android_glObjectPtrLabelKHR(JNIEnv *_env, jobject _this, jlong ptr, jstring label) { 570 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 571} 572 573/* void glGetObjectPtrLabelKHR ( const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label ) */ 574static jstring 575android_glGetObjectPtrLabelKHR(JNIEnv *_env, jobject _this, jlong ptr) { 576 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 577 return NULL; 578} 579 580/* void glGetPointervKHR ( GLenum pname, void **params ) */ 581static jobject 582android_glGetDebugMessageCallbackKHR(JNIEnv *_env, jobject _this) { 583 jniThrowException(_env, "java/lang/UnsupportedOperationException", "not yet implemented"); 584 return NULL; 585} 586 587/* void glMinSampleShadingOES ( GLfloat value ) */ 588static void 589android_glMinSampleShadingOES__F 590 (JNIEnv *_env, jobject _this, jfloat value) { 591 glMinSampleShadingOES( 592 (GLfloat)value 593 ); 594} 595 596/* void glTexStorage3DMultisampleOES ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations ) */ 597static void 598android_glTexStorage3DMultisampleOES__IIIIIIZ 599 (JNIEnv *_env, jobject _this, jint target, jint samples, jint internalformat, jint width, jint height, jint depth, jboolean fixedsamplelocations) { 600 glTexStorage3DMultisampleOES( 601 (GLenum)target, 602 (GLsizei)samples, 603 (GLenum)internalformat, 604 (GLsizei)width, 605 (GLsizei)height, 606 (GLsizei)depth, 607 (GLboolean)fixedsamplelocations 608 ); 609} 610 611/* 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 ) */ 612static void 613android_glCopyImageSubDataEXT__IIIIIIIIIIIIIII 614 (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) { 615 glCopyImageSubDataEXT( 616 (GLuint)srcName, 617 (GLenum)srcTarget, 618 (GLint)srcLevel, 619 (GLint)srcX, 620 (GLint)srcY, 621 (GLint)srcZ, 622 (GLuint)dstName, 623 (GLenum)dstTarget, 624 (GLint)dstLevel, 625 (GLint)dstX, 626 (GLint)dstY, 627 (GLint)dstZ, 628 (GLsizei)srcWidth, 629 (GLsizei)srcHeight, 630 (GLsizei)srcDepth 631 ); 632} 633 634/* void glEnableiEXT ( GLenum target, GLuint index ) */ 635static void 636android_glEnableiEXT__II 637 (JNIEnv *_env, jobject _this, jint target, jint index) { 638 glEnableiEXT( 639 (GLenum)target, 640 (GLuint)index 641 ); 642} 643 644/* void glDisableiEXT ( GLenum target, GLuint index ) */ 645static void 646android_glDisableiEXT__II 647 (JNIEnv *_env, jobject _this, jint target, jint index) { 648 glDisableiEXT( 649 (GLenum)target, 650 (GLuint)index 651 ); 652} 653 654/* void glBlendEquationiEXT ( GLuint buf, GLenum mode ) */ 655static void 656android_glBlendEquationiEXT__II 657 (JNIEnv *_env, jobject _this, jint buf, jint mode) { 658 glBlendEquationiEXT( 659 (GLuint)buf, 660 (GLenum)mode 661 ); 662} 663 664/* void glBlendEquationSeparateiEXT ( GLuint buf, GLenum modeRGB, GLenum modeAlpha ) */ 665static void 666android_glBlendEquationSeparateiEXT__III 667 (JNIEnv *_env, jobject _this, jint buf, jint modeRGB, jint modeAlpha) { 668 glBlendEquationSeparateiEXT( 669 (GLuint)buf, 670 (GLenum)modeRGB, 671 (GLenum)modeAlpha 672 ); 673} 674 675/* void glBlendFunciEXT ( GLuint buf, GLenum src, GLenum dst ) */ 676static void 677android_glBlendFunciEXT__III 678 (JNIEnv *_env, jobject _this, jint buf, jint src, jint dst) { 679 glBlendFunciEXT( 680 (GLuint)buf, 681 (GLenum)src, 682 (GLenum)dst 683 ); 684} 685 686/* void glBlendFuncSeparateiEXT ( GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) */ 687static void 688android_glBlendFuncSeparateiEXT__IIIII 689 (JNIEnv *_env, jobject _this, jint buf, jint srcRGB, jint dstRGB, jint srcAlpha, jint dstAlpha) { 690 glBlendFuncSeparateiEXT( 691 (GLuint)buf, 692 (GLenum)srcRGB, 693 (GLenum)dstRGB, 694 (GLenum)srcAlpha, 695 (GLenum)dstAlpha 696 ); 697} 698 699/* void glColorMaskiEXT ( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a ) */ 700static void 701android_glColorMaskiEXT__IZZZZ 702 (JNIEnv *_env, jobject _this, jint index, jboolean r, jboolean g, jboolean b, jboolean a) { 703 glColorMaskiEXT( 704 (GLuint)index, 705 (GLboolean)r, 706 (GLboolean)g, 707 (GLboolean)b, 708 (GLboolean)a 709 ); 710} 711 712/* GLboolean glIsEnablediEXT ( GLenum target, GLuint index ) */ 713static jboolean 714android_glIsEnablediEXT__II 715 (JNIEnv *_env, jobject _this, jint target, jint index) { 716 GLboolean _returnValue; 717 _returnValue = glIsEnablediEXT( 718 (GLenum)target, 719 (GLuint)index 720 ); 721 return (jboolean)_returnValue; 722} 723 724/* void glFramebufferTextureEXT ( GLenum target, GLenum attachment, GLuint texture, GLint level ) */ 725static void 726android_glFramebufferTextureEXT__IIII 727 (JNIEnv *_env, jobject _this, jint target, jint attachment, jint texture, jint level) { 728 glFramebufferTextureEXT( 729 (GLenum)target, 730 (GLenum)attachment, 731 (GLuint)texture, 732 (GLint)level 733 ); 734} 735 736/* void glPrimitiveBoundingBoxEXT ( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW ) */ 737static void 738android_glPrimitiveBoundingBoxEXT__FFFFFFFF 739 (JNIEnv *_env, jobject _this, jfloat minX, jfloat minY, jfloat minZ, jfloat minW, jfloat maxX, jfloat maxY, jfloat maxZ, jfloat maxW) { 740 glPrimitiveBoundingBoxEXT( 741 (GLfloat)minX, 742 (GLfloat)minY, 743 (GLfloat)minZ, 744 (GLfloat)minW, 745 (GLfloat)maxX, 746 (GLfloat)maxY, 747 (GLfloat)maxZ, 748 (GLfloat)maxW 749 ); 750} 751 752/* void glPatchParameteriEXT ( GLenum pname, GLint value ) */ 753static void 754android_glPatchParameteriEXT__II 755 (JNIEnv *_env, jobject _this, jint pname, jint value) { 756 glPatchParameteriEXT( 757 (GLenum)pname, 758 (GLint)value 759 ); 760} 761 762/* void glTexParameterIivEXT ( GLenum target, GLenum pname, const GLint *params ) */ 763static void 764android_glTexParameterIivEXT__II_3II 765 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 766 jint _exception = 0; 767 const char * _exceptionType = NULL; 768 const char * _exceptionMessage = NULL; 769 GLint *params_base = (GLint *) 0; 770 jint _remaining; 771 GLint *params = (GLint *) 0; 772 773 if (!params_ref) { 774 _exception = 1; 775 _exceptionType = "java/lang/IllegalArgumentException"; 776 _exceptionMessage = "params == null"; 777 goto exit; 778 } 779 if (offset < 0) { 780 _exception = 1; 781 _exceptionType = "java/lang/IllegalArgumentException"; 782 _exceptionMessage = "offset < 0"; 783 goto exit; 784 } 785 _remaining = _env->GetArrayLength(params_ref) - offset; 786 params_base = (GLint *) 787 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 788 params = params_base + offset; 789 790 glTexParameterIivEXT( 791 (GLenum)target, 792 (GLenum)pname, 793 (GLint *)params 794 ); 795 796exit: 797 if (params_base) { 798 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 799 JNI_ABORT); 800 } 801 if (_exception) { 802 jniThrowException(_env, _exceptionType, _exceptionMessage); 803 } 804} 805 806/* void glTexParameterIivEXT ( GLenum target, GLenum pname, const GLint *params ) */ 807static void 808android_glTexParameterIivEXT__IILjava_nio_IntBuffer_2 809 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 810 jarray _array = (jarray) 0; 811 jint _bufferOffset = (jint) 0; 812 jint _remaining; 813 GLint *params = (GLint *) 0; 814 815 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 816 if (params == NULL) { 817 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 818 params = (GLint *) (_paramsBase + _bufferOffset); 819 } 820 glTexParameterIivEXT( 821 (GLenum)target, 822 (GLenum)pname, 823 (GLint *)params 824 ); 825 if (_array) { 826 releasePointer(_env, _array, params, JNI_FALSE); 827 } 828} 829 830/* void glTexParameterIuivEXT ( GLenum target, GLenum pname, const GLuint *params ) */ 831static void 832android_glTexParameterIuivEXT__II_3II 833 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 834 jint _exception = 0; 835 const char * _exceptionType = NULL; 836 const char * _exceptionMessage = NULL; 837 GLuint *params_base = (GLuint *) 0; 838 jint _remaining; 839 GLuint *params = (GLuint *) 0; 840 841 if (!params_ref) { 842 _exception = 1; 843 _exceptionType = "java/lang/IllegalArgumentException"; 844 _exceptionMessage = "params == null"; 845 goto exit; 846 } 847 if (offset < 0) { 848 _exception = 1; 849 _exceptionType = "java/lang/IllegalArgumentException"; 850 _exceptionMessage = "offset < 0"; 851 goto exit; 852 } 853 _remaining = _env->GetArrayLength(params_ref) - offset; 854 params_base = (GLuint *) 855 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 856 params = params_base + offset; 857 858 glTexParameterIuivEXT( 859 (GLenum)target, 860 (GLenum)pname, 861 (GLuint *)params 862 ); 863 864exit: 865 if (params_base) { 866 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 867 JNI_ABORT); 868 } 869 if (_exception) { 870 jniThrowException(_env, _exceptionType, _exceptionMessage); 871 } 872} 873 874/* void glTexParameterIuivEXT ( GLenum target, GLenum pname, const GLuint *params ) */ 875static void 876android_glTexParameterIuivEXT__IILjava_nio_IntBuffer_2 877 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 878 jarray _array = (jarray) 0; 879 jint _bufferOffset = (jint) 0; 880 jint _remaining; 881 GLuint *params = (GLuint *) 0; 882 883 params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 884 if (params == NULL) { 885 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 886 params = (GLuint *) (_paramsBase + _bufferOffset); 887 } 888 glTexParameterIuivEXT( 889 (GLenum)target, 890 (GLenum)pname, 891 (GLuint *)params 892 ); 893 if (_array) { 894 releasePointer(_env, _array, params, JNI_FALSE); 895 } 896} 897 898/* void glGetTexParameterIivEXT ( GLenum target, GLenum pname, GLint *params ) */ 899static void 900android_glGetTexParameterIivEXT__II_3II 901 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 902 jint _exception = 0; 903 const char * _exceptionType = NULL; 904 const char * _exceptionMessage = NULL; 905 GLint *params_base = (GLint *) 0; 906 jint _remaining; 907 GLint *params = (GLint *) 0; 908 909 if (!params_ref) { 910 _exception = 1; 911 _exceptionType = "java/lang/IllegalArgumentException"; 912 _exceptionMessage = "params == null"; 913 goto exit; 914 } 915 if (offset < 0) { 916 _exception = 1; 917 _exceptionType = "java/lang/IllegalArgumentException"; 918 _exceptionMessage = "offset < 0"; 919 goto exit; 920 } 921 _remaining = _env->GetArrayLength(params_ref) - offset; 922 params_base = (GLint *) 923 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 924 params = params_base + offset; 925 926 glGetTexParameterIivEXT( 927 (GLenum)target, 928 (GLenum)pname, 929 (GLint *)params 930 ); 931 932exit: 933 if (params_base) { 934 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 935 _exception ? JNI_ABORT: 0); 936 } 937 if (_exception) { 938 jniThrowException(_env, _exceptionType, _exceptionMessage); 939 } 940} 941 942/* void glGetTexParameterIivEXT ( GLenum target, GLenum pname, GLint *params ) */ 943static void 944android_glGetTexParameterIivEXT__IILjava_nio_IntBuffer_2 945 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 946 jarray _array = (jarray) 0; 947 jint _bufferOffset = (jint) 0; 948 jint _remaining; 949 GLint *params = (GLint *) 0; 950 951 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 952 if (params == NULL) { 953 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 954 params = (GLint *) (_paramsBase + _bufferOffset); 955 } 956 glGetTexParameterIivEXT( 957 (GLenum)target, 958 (GLenum)pname, 959 (GLint *)params 960 ); 961 if (_array) { 962 releasePointer(_env, _array, params, JNI_TRUE); 963 } 964} 965 966/* void glGetTexParameterIuivEXT ( GLenum target, GLenum pname, GLuint *params ) */ 967static void 968android_glGetTexParameterIuivEXT__II_3II 969 (JNIEnv *_env, jobject _this, jint target, jint pname, jintArray params_ref, jint offset) { 970 jint _exception = 0; 971 const char * _exceptionType = NULL; 972 const char * _exceptionMessage = NULL; 973 GLuint *params_base = (GLuint *) 0; 974 jint _remaining; 975 GLuint *params = (GLuint *) 0; 976 977 if (!params_ref) { 978 _exception = 1; 979 _exceptionType = "java/lang/IllegalArgumentException"; 980 _exceptionMessage = "params == null"; 981 goto exit; 982 } 983 if (offset < 0) { 984 _exception = 1; 985 _exceptionType = "java/lang/IllegalArgumentException"; 986 _exceptionMessage = "offset < 0"; 987 goto exit; 988 } 989 _remaining = _env->GetArrayLength(params_ref) - offset; 990 params_base = (GLuint *) 991 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 992 params = params_base + offset; 993 994 glGetTexParameterIuivEXT( 995 (GLenum)target, 996 (GLenum)pname, 997 (GLuint *)params 998 ); 999 1000exit: 1001 if (params_base) { 1002 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1003 _exception ? JNI_ABORT: 0); 1004 } 1005 if (_exception) { 1006 jniThrowException(_env, _exceptionType, _exceptionMessage); 1007 } 1008} 1009 1010/* void glGetTexParameterIuivEXT ( GLenum target, GLenum pname, GLuint *params ) */ 1011static void 1012android_glGetTexParameterIuivEXT__IILjava_nio_IntBuffer_2 1013 (JNIEnv *_env, jobject _this, jint target, jint pname, jobject params_buf) { 1014 jarray _array = (jarray) 0; 1015 jint _bufferOffset = (jint) 0; 1016 jint _remaining; 1017 GLuint *params = (GLuint *) 0; 1018 1019 params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1020 if (params == NULL) { 1021 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1022 params = (GLuint *) (_paramsBase + _bufferOffset); 1023 } 1024 glGetTexParameterIuivEXT( 1025 (GLenum)target, 1026 (GLenum)pname, 1027 (GLuint *)params 1028 ); 1029 if (_array) { 1030 releasePointer(_env, _array, params, JNI_TRUE); 1031 } 1032} 1033 1034/* void glSamplerParameterIivEXT ( GLuint sampler, GLenum pname, const GLint *param ) */ 1035static void 1036android_glSamplerParameterIivEXT__II_3II 1037 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) { 1038 jint _exception = 0; 1039 const char * _exceptionType = NULL; 1040 const char * _exceptionMessage = NULL; 1041 GLint *param_base = (GLint *) 0; 1042 jint _remaining; 1043 GLint *param = (GLint *) 0; 1044 1045 if (!param_ref) { 1046 _exception = 1; 1047 _exceptionType = "java/lang/IllegalArgumentException"; 1048 _exceptionMessage = "param == null"; 1049 goto exit; 1050 } 1051 if (offset < 0) { 1052 _exception = 1; 1053 _exceptionType = "java/lang/IllegalArgumentException"; 1054 _exceptionMessage = "offset < 0"; 1055 goto exit; 1056 } 1057 _remaining = _env->GetArrayLength(param_ref) - offset; 1058 param_base = (GLint *) 1059 _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0); 1060 param = param_base + offset; 1061 1062 glSamplerParameterIivEXT( 1063 (GLuint)sampler, 1064 (GLenum)pname, 1065 (GLint *)param 1066 ); 1067 1068exit: 1069 if (param_base) { 1070 _env->ReleasePrimitiveArrayCritical(param_ref, param_base, 1071 JNI_ABORT); 1072 } 1073 if (_exception) { 1074 jniThrowException(_env, _exceptionType, _exceptionMessage); 1075 } 1076} 1077 1078/* void glSamplerParameterIivEXT ( GLuint sampler, GLenum pname, const GLint *param ) */ 1079static void 1080android_glSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 1081 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) { 1082 jarray _array = (jarray) 0; 1083 jint _bufferOffset = (jint) 0; 1084 jint _remaining; 1085 GLint *param = (GLint *) 0; 1086 1087 param = (GLint *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset); 1088 if (param == NULL) { 1089 char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1090 param = (GLint *) (_paramBase + _bufferOffset); 1091 } 1092 glSamplerParameterIivEXT( 1093 (GLuint)sampler, 1094 (GLenum)pname, 1095 (GLint *)param 1096 ); 1097 if (_array) { 1098 releasePointer(_env, _array, param, JNI_FALSE); 1099 } 1100} 1101 1102/* void glSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, const GLuint *param ) */ 1103static void 1104android_glSamplerParameterIuivEXT__II_3II 1105 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray param_ref, jint offset) { 1106 jint _exception = 0; 1107 const char * _exceptionType = NULL; 1108 const char * _exceptionMessage = NULL; 1109 GLuint *param_base = (GLuint *) 0; 1110 jint _remaining; 1111 GLuint *param = (GLuint *) 0; 1112 1113 if (!param_ref) { 1114 _exception = 1; 1115 _exceptionType = "java/lang/IllegalArgumentException"; 1116 _exceptionMessage = "param == null"; 1117 goto exit; 1118 } 1119 if (offset < 0) { 1120 _exception = 1; 1121 _exceptionType = "java/lang/IllegalArgumentException"; 1122 _exceptionMessage = "offset < 0"; 1123 goto exit; 1124 } 1125 _remaining = _env->GetArrayLength(param_ref) - offset; 1126 param_base = (GLuint *) 1127 _env->GetPrimitiveArrayCritical(param_ref, (jboolean *)0); 1128 param = param_base + offset; 1129 1130 glSamplerParameterIuivEXT( 1131 (GLuint)sampler, 1132 (GLenum)pname, 1133 (GLuint *)param 1134 ); 1135 1136exit: 1137 if (param_base) { 1138 _env->ReleasePrimitiveArrayCritical(param_ref, param_base, 1139 JNI_ABORT); 1140 } 1141 if (_exception) { 1142 jniThrowException(_env, _exceptionType, _exceptionMessage); 1143 } 1144} 1145 1146/* void glSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, const GLuint *param ) */ 1147static void 1148android_glSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 1149 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject param_buf) { 1150 jarray _array = (jarray) 0; 1151 jint _bufferOffset = (jint) 0; 1152 jint _remaining; 1153 GLuint *param = (GLuint *) 0; 1154 1155 param = (GLuint *)getPointer(_env, param_buf, &_array, &_remaining, &_bufferOffset); 1156 if (param == NULL) { 1157 char * _paramBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1158 param = (GLuint *) (_paramBase + _bufferOffset); 1159 } 1160 glSamplerParameterIuivEXT( 1161 (GLuint)sampler, 1162 (GLenum)pname, 1163 (GLuint *)param 1164 ); 1165 if (_array) { 1166 releasePointer(_env, _array, param, JNI_FALSE); 1167 } 1168} 1169 1170/* void glGetSamplerParameterIivEXT ( GLuint sampler, GLenum pname, GLint *params ) */ 1171static void 1172android_glGetSamplerParameterIivEXT__II_3II 1173 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) { 1174 jint _exception = 0; 1175 const char * _exceptionType = NULL; 1176 const char * _exceptionMessage = NULL; 1177 GLint *params_base = (GLint *) 0; 1178 jint _remaining; 1179 GLint *params = (GLint *) 0; 1180 1181 if (!params_ref) { 1182 _exception = 1; 1183 _exceptionType = "java/lang/IllegalArgumentException"; 1184 _exceptionMessage = "params == null"; 1185 goto exit; 1186 } 1187 if (offset < 0) { 1188 _exception = 1; 1189 _exceptionType = "java/lang/IllegalArgumentException"; 1190 _exceptionMessage = "offset < 0"; 1191 goto exit; 1192 } 1193 _remaining = _env->GetArrayLength(params_ref) - offset; 1194 params_base = (GLint *) 1195 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1196 params = params_base + offset; 1197 1198 glGetSamplerParameterIivEXT( 1199 (GLuint)sampler, 1200 (GLenum)pname, 1201 (GLint *)params 1202 ); 1203 1204exit: 1205 if (params_base) { 1206 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1207 _exception ? JNI_ABORT: 0); 1208 } 1209 if (_exception) { 1210 jniThrowException(_env, _exceptionType, _exceptionMessage); 1211 } 1212} 1213 1214/* void glGetSamplerParameterIivEXT ( GLuint sampler, GLenum pname, GLint *params ) */ 1215static void 1216android_glGetSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 1217 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) { 1218 jarray _array = (jarray) 0; 1219 jint _bufferOffset = (jint) 0; 1220 jint _remaining; 1221 GLint *params = (GLint *) 0; 1222 1223 params = (GLint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1224 if (params == NULL) { 1225 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1226 params = (GLint *) (_paramsBase + _bufferOffset); 1227 } 1228 glGetSamplerParameterIivEXT( 1229 (GLuint)sampler, 1230 (GLenum)pname, 1231 (GLint *)params 1232 ); 1233 if (_array) { 1234 releasePointer(_env, _array, params, JNI_TRUE); 1235 } 1236} 1237 1238/* void glGetSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, GLuint *params ) */ 1239static void 1240android_glGetSamplerParameterIuivEXT__II_3II 1241 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jintArray params_ref, jint offset) { 1242 jint _exception = 0; 1243 const char * _exceptionType = NULL; 1244 const char * _exceptionMessage = NULL; 1245 GLuint *params_base = (GLuint *) 0; 1246 jint _remaining; 1247 GLuint *params = (GLuint *) 0; 1248 1249 if (!params_ref) { 1250 _exception = 1; 1251 _exceptionType = "java/lang/IllegalArgumentException"; 1252 _exceptionMessage = "params == null"; 1253 goto exit; 1254 } 1255 if (offset < 0) { 1256 _exception = 1; 1257 _exceptionType = "java/lang/IllegalArgumentException"; 1258 _exceptionMessage = "offset < 0"; 1259 goto exit; 1260 } 1261 _remaining = _env->GetArrayLength(params_ref) - offset; 1262 params_base = (GLuint *) 1263 _env->GetPrimitiveArrayCritical(params_ref, (jboolean *)0); 1264 params = params_base + offset; 1265 1266 glGetSamplerParameterIuivEXT( 1267 (GLuint)sampler, 1268 (GLenum)pname, 1269 (GLuint *)params 1270 ); 1271 1272exit: 1273 if (params_base) { 1274 _env->ReleasePrimitiveArrayCritical(params_ref, params_base, 1275 _exception ? JNI_ABORT: 0); 1276 } 1277 if (_exception) { 1278 jniThrowException(_env, _exceptionType, _exceptionMessage); 1279 } 1280} 1281 1282/* void glGetSamplerParameterIuivEXT ( GLuint sampler, GLenum pname, GLuint *params ) */ 1283static void 1284android_glGetSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 1285 (JNIEnv *_env, jobject _this, jint sampler, jint pname, jobject params_buf) { 1286 jarray _array = (jarray) 0; 1287 jint _bufferOffset = (jint) 0; 1288 jint _remaining; 1289 GLuint *params = (GLuint *) 0; 1290 1291 params = (GLuint *)getPointer(_env, params_buf, &_array, &_remaining, &_bufferOffset); 1292 if (params == NULL) { 1293 char * _paramsBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); 1294 params = (GLuint *) (_paramsBase + _bufferOffset); 1295 } 1296 glGetSamplerParameterIuivEXT( 1297 (GLuint)sampler, 1298 (GLenum)pname, 1299 (GLuint *)params 1300 ); 1301 if (_array) { 1302 releasePointer(_env, _array, params, JNI_TRUE); 1303 } 1304} 1305 1306/* void glTexBufferEXT ( GLenum target, GLenum internalformat, GLuint buffer ) */ 1307static void 1308android_glTexBufferEXT__III 1309 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer) { 1310 glTexBufferEXT( 1311 (GLenum)target, 1312 (GLenum)internalformat, 1313 (GLuint)buffer 1314 ); 1315} 1316 1317/* void glTexBufferRangeEXT ( GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size ) */ 1318static void 1319android_glTexBufferRangeEXT__IIIII 1320 (JNIEnv *_env, jobject _this, jint target, jint internalformat, jint buffer, jint offset, jint size) { 1321 glTexBufferRangeEXT( 1322 (GLenum)target, 1323 (GLenum)internalformat, 1324 (GLuint)buffer, 1325 (GLintptr)offset, 1326 (GLsizeiptr)size 1327 ); 1328} 1329 1330static const char *classPathName = "android/opengl/GLES31Ext"; 1331 1332static JNINativeMethod methods[] = { 1333{"_nativeClassInit", "()V", (void*)nativeClassInit }, 1334{"glBlendBarrierKHR", "()V", (void *) android_glBlendBarrierKHR__ }, 1335{"glDebugMessageControlKHR", "(IIII[IIZ)V", (void *) android_glDebugMessageControlKHR__IIII_3IIZ }, 1336{"glDebugMessageControlKHR", "(IIIILjava/nio/IntBuffer;Z)V", (void *) android_glDebugMessageControlKHR__IIIILjava_nio_IntBuffer_2Z }, 1337{"glDebugMessageInsertKHR", "(IIIILjava/lang/String;)V", (void *) android_glDebugMessageInsertKHR__IIIILjava_lang_String_2 }, 1338{"glDebugMessageCallbackKHR", "(Landroid/opengl/GLES31Ext$DebugProcKHR;)V", (void *) android_glDebugMessageCallbackKHR }, 1339{"glGetDebugMessageLogKHR", "(II[II[II[II[II[II[BI)I", (void *) android_glGetDebugMessageLogKHR__II_3II_3II_3II_3II_3II_3BI }, 1340{"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 }, 1341{"glGetDebugMessageLogKHR", "(I[II[II[II[II)[Ljava/lang/String;", (void *) android_glGetDebugMessageLogKHR__I_3II_3II_3II_3II }, 1342{"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 }, 1343{"glPushDebugGroupKHR", "(IIILjava/lang/String;)V", (void *) android_glPushDebugGroupKHR__IIILjava_lang_String_2 }, 1344{"glPopDebugGroupKHR", "()V", (void *) android_glPopDebugGroupKHR__ }, 1345{"glObjectLabelKHR", "(IIILjava/lang/String;)V", (void *) android_glObjectLabelKHR__IIILjava_lang_String_2 }, 1346{"glGetObjectLabelKHR", "(II)Ljava/lang/String;", (void *) android_glGetObjectLabelKHR }, 1347{"glObjectPtrLabelKHR", "(JLjava/lang/String;)V", (void *) android_glObjectPtrLabelKHR }, 1348{"glGetObjectPtrLabelKHR", "(J)Ljava/lang/String;", (void *) android_glGetObjectPtrLabelKHR }, 1349{"glGetDebugMessageCallbackKHR", "()Landroid/opengl/GLES31Ext$DebugProcKHR;", (void *) android_glGetDebugMessageCallbackKHR }, 1350{"glMinSampleShadingOES", "(F)V", (void *) android_glMinSampleShadingOES__F }, 1351{"glTexStorage3DMultisampleOES", "(IIIIIIZ)V", (void *) android_glTexStorage3DMultisampleOES__IIIIIIZ }, 1352{"glCopyImageSubDataEXT", "(IIIIIIIIIIIIIII)V", (void *) android_glCopyImageSubDataEXT__IIIIIIIIIIIIIII }, 1353{"glEnableiEXT", "(II)V", (void *) android_glEnableiEXT__II }, 1354{"glDisableiEXT", "(II)V", (void *) android_glDisableiEXT__II }, 1355{"glBlendEquationiEXT", "(II)V", (void *) android_glBlendEquationiEXT__II }, 1356{"glBlendEquationSeparateiEXT", "(III)V", (void *) android_glBlendEquationSeparateiEXT__III }, 1357{"glBlendFunciEXT", "(III)V", (void *) android_glBlendFunciEXT__III }, 1358{"glBlendFuncSeparateiEXT", "(IIIII)V", (void *) android_glBlendFuncSeparateiEXT__IIIII }, 1359{"glColorMaskiEXT", "(IZZZZ)V", (void *) android_glColorMaskiEXT__IZZZZ }, 1360{"glIsEnablediEXT", "(II)Z", (void *) android_glIsEnablediEXT__II }, 1361{"glFramebufferTextureEXT", "(IIII)V", (void *) android_glFramebufferTextureEXT__IIII }, 1362{"glPrimitiveBoundingBoxEXT", "(FFFFFFFF)V", (void *) android_glPrimitiveBoundingBoxEXT__FFFFFFFF }, 1363{"glPatchParameteriEXT", "(II)V", (void *) android_glPatchParameteriEXT__II }, 1364{"glTexParameterIivEXT", "(II[II)V", (void *) android_glTexParameterIivEXT__II_3II }, 1365{"glTexParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIivEXT__IILjava_nio_IntBuffer_2 }, 1366{"glTexParameterIuivEXT", "(II[II)V", (void *) android_glTexParameterIuivEXT__II_3II }, 1367{"glTexParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glTexParameterIuivEXT__IILjava_nio_IntBuffer_2 }, 1368{"glGetTexParameterIivEXT", "(II[II)V", (void *) android_glGetTexParameterIivEXT__II_3II }, 1369{"glGetTexParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIivEXT__IILjava_nio_IntBuffer_2 }, 1370{"glGetTexParameterIuivEXT", "(II[II)V", (void *) android_glGetTexParameterIuivEXT__II_3II }, 1371{"glGetTexParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetTexParameterIuivEXT__IILjava_nio_IntBuffer_2 }, 1372{"glSamplerParameterIivEXT", "(II[II)V", (void *) android_glSamplerParameterIivEXT__II_3II }, 1373{"glSamplerParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 }, 1374{"glSamplerParameterIuivEXT", "(II[II)V", (void *) android_glSamplerParameterIuivEXT__II_3II }, 1375{"glSamplerParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 }, 1376{"glGetSamplerParameterIivEXT", "(II[II)V", (void *) android_glGetSamplerParameterIivEXT__II_3II }, 1377{"glGetSamplerParameterIivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIivEXT__IILjava_nio_IntBuffer_2 }, 1378{"glGetSamplerParameterIuivEXT", "(II[II)V", (void *) android_glGetSamplerParameterIuivEXT__II_3II }, 1379{"glGetSamplerParameterIuivEXT", "(IILjava/nio/IntBuffer;)V", (void *) android_glGetSamplerParameterIuivEXT__IILjava_nio_IntBuffer_2 }, 1380{"glTexBufferEXT", "(III)V", (void *) android_glTexBufferEXT__III }, 1381{"glTexBufferRangeEXT", "(IIIII)V", (void *) android_glTexBufferRangeEXT__IIIII }, 1382}; 1383 1384int register_android_opengl_jni_GLES31Ext(JNIEnv *_env) 1385{ 1386 int err; 1387 err = android::AndroidRuntime::registerNativeMethods(_env, classPathName, methods, NELEM(methods)); 1388 return err; 1389} 1390