b5da0d78d2
The code currently being generated by glgen is not the cleanest, but we would like to get core/jni onto -Werror. Thus add pragmas turning off warnings locally to the C headers. Also fix signed-comparison in two functions. Longer term TODO: Emit clean code. Change-Id: Iee8582f8c0c1de076d64851d3b6ca467afd5bc43
13 lines
682 B
C++
13 lines
682 B
C++
/* void glDrawElementsIndirect ( GLenum mode, GLenum type, const void *indirect ) */
|
|
static void android_glDrawElementsIndirect(JNIEnv *_env, jobject, jint mode, jint type, jlong indirect) {
|
|
// In OpenGL ES, 'indirect' is a byte offset into a buffer, not a raw pointer.
|
|
// GL checks for too-large values. Here we only need to check for successful signed 64-bit
|
|
// to unsigned 32-bit conversion.
|
|
if (sizeof(void*) != sizeof(jlong) && indirect > static_cast<jlong>(UINT32_MAX)) {
|
|
jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large");
|
|
return;
|
|
}
|
|
glDrawElementsIndirect(mode, type, (const void*)indirect);
|
|
}
|
|
|