diff options
Diffstat (limited to 'opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp')
-rw-r--r-- | opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp new file mode 100644 index 0000000..ce3bc8f --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glDrawArraysIndirect.cpp @@ -0,0 +1,12 @@ +/* void glDrawArraysIndirect ( GLenum mode, const void *indirect ) */ +static void android_glDrawArraysIndirect(JNIEnv *_env, jobject, int mode, 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 > UINTPTR_MAX) { + jniThrowException(_env, "java/lang/IllegalArgumentException", "indirect offset too large"); + return; + } + glDrawArraysIndirect(mode, (const void*)indirect); +} + |