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