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