summaryrefslogtreecommitdiffstats
path: root/opengl/tools
diff options
context:
space:
mode:
authorJesse Hall <jessehall@google.com>2013-04-10 00:34:07 -0700
committerJesse Hall <jessehall@google.com>2013-04-10 22:00:18 -0700
commit552a6204828b5f25db0c3e644cead321664706fa (patch)
treef54af7c1d53942767c8078742a33b23198c0b558 /opengl/tools
parent071fc660597efdfa5ebc58b427252393e628a497 (diff)
downloadframeworks_native-552a6204828b5f25db0c3e644cead321664706fa.zip
frameworks_native-552a6204828b5f25db0c3e644cead321664706fa.tar.gz
frameworks_native-552a6204828b5f25db0c3e644cead321664706fa.tar.bz2
Special-case glTransformFeedbackVaryings
Bug: 8566953 Change-Id: I02a1548aebc12bd3599903029bfd2e4ccea53211
Diffstat (limited to 'opengl/tools')
-rw-r--r--opengl/tools/glgen/specs/gles11/GLES30.spec2
-rw-r--r--opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp49
-rw-r--r--opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java8
-rw-r--r--opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg1
4 files changed, 59 insertions, 1 deletions
diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec
index dad4499..6315c56 100644
--- a/opengl/tools/glgen/specs/gles11/GLES30.spec
+++ b/opengl/tools/glgen/specs/gles11/GLES30.spec
@@ -195,7 +195,7 @@ void glBeginTransformFeedback ( GLenum primitiveMode )
void glEndTransformFeedback ( void )
void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size )
void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer )
-// void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *const *varyings, GLenum bufferMode )
+void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode )
// void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name )
void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer )
void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset )
diff --git a/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp
new file mode 100644
index 0000000..0dedd0f
--- /dev/null
+++ b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp
@@ -0,0 +1,49 @@
+/* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */
+static
+void
+android_glTransformFeedbackVaryings
+ (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) {
+ jint _exception = 0;
+ const char* _exceptionType = NULL;
+ const char* _exceptionMessage = NULL;
+ jint _count = 0, _i;
+ const char** _varyings = NULL;
+ const char* _varying = NULL;
+
+ if (!varyings_ref) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "varyings == null";
+ goto exit;
+ }
+
+ _count = _env->GetArrayLength(varyings_ref);
+ _varyings = (const char**)calloc(_count, sizeof(const char*));
+ for (_i = 0; _i < _count; _i++) {
+ jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
+ if (!_varying) {
+ _exception = 1;
+ _exceptionType = "java/lang/IllegalArgumentException";
+ _exceptionMessage = "null varyings element";
+ goto exit;
+ }
+ _varyings[_i] = _env->GetStringUTFChars(_varying, 0);
+ }
+
+ glTransformFeedbackVaryings(program, _count, _varyings, bufferMode);
+
+exit:
+ for (_i = _count - 1; _i >= 0; _i--) {
+ if (_varyings[_i]) {
+ jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i);
+ if (_varying) {
+ _env->ReleaseStringUTFChars(_varying, _varyings[_i]);
+ }
+ }
+ }
+ free(_varyings);
+ if (_exception) {
+ jniThrowException(_env, _exceptionType, _exceptionMessage);
+ }
+}
+
diff --git a/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java
new file mode 100644
index 0000000..c824344
--- /dev/null
+++ b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java
@@ -0,0 +1,8 @@
+ // C function void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode )
+
+ public static native void glTransformFeedbackVaryings(
+ int program,
+ String[] varyings,
+ int bufferMode
+ );
+
diff --git a/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg
new file mode 100644
index 0000000..24f2b77
--- /dev/null
+++ b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg
@@ -0,0 +1 @@
+{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },