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