Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 552a6204 authored by Jesse Hall's avatar Jesse Hall
Browse files

Special-case glTransformFeedbackVaryings

Bug: 8566953
Change-Id: I02a1548aebc12bd3599903029bfd2e4ccea53211
parent 071fc660
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 )
+49 −0
Original line number Diff line number Diff line
/* 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);
    }
}
+8 −0
Original line number Diff line number Diff line
	// C function void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode )

	public static native void glTransformFeedbackVaryings(
        int program,
        String[] varyings,
        int bufferMode
	);
+1 −0
Original line number Diff line number Diff line
{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings },