Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glErrors #45

Closed
arjansomers opened this issue May 31, 2012 · 7 comments
Closed

glErrors #45

arjansomers opened this issue May 31, 2012 · 7 comments
Assignees

Comments

@arjansomers
Copy link
Contributor

I am trying to use your framework. When using it i noticed getting a lot of glErrors.

You don't check for glErrors in your code every frame, but if you add a check in your rendering loop as such:

    public void onDrawFrame(GL10 glUnused) {
        checkError();
        super.onDrawFrame(glUnused);

    }

    public void checkError(){
    int error;
    while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
        Log.v("eror", "glError: " + GLU.gluErrorString(error));
    }

You will notice the errors. (I tried this in your model loading example)
I unfortunately did not yet have time to pinpoint the cause of these messages, but wanted to make you aware of them.

@MasDennis
Copy link
Member

Cheers Arjan, I'll investigate.

@xroberx
Copy link
Contributor

xroberx commented May 31, 2012

Not sure if it is related, but I always get these two errors:

05-31 10:36:11.595: E/Adreno200-ES20(3132): <process_gl_state_enables:456>: GL_INVALID_ENUM
05-31 10:36:32.825: E/Adreno200-ES20(3132): <qgl2DrvAPI_glDeleteTextures:720>: GL_INVALID_VALUE

The former always comes before 05-31 10:36:32.665: D/Rajawali(3132): Creating OpenGL ES 2.0 context
And the latter comes after it.

@ghost ghost assigned MasDennis Jun 1, 2012
@arjansomers
Copy link
Contributor Author

I found at least some source of these errors.

In OpenGL ES 2.0 it is no longer required to glEnable(GL_TEXTURE2D)

In fact is is no longer allowed and will throw a GL_INVALID_ENUM error (as described in 2.0 spec: http://www.khronos.org/opengles/sdk/docs/man/)

The problem i found was in AMaterial;.bindTextures(). I did not search further, but i assume similar openGL ES 1.x style calls may be presesent in your code.

If you would be so kind to fix them it would be greatly appreciated as i enjoy using your framework.

@arjansomers
Copy link
Contributor Author

In relation to my last comment: In fact the bind and unbind functions in AMaterial can be completely removed, as well as a call to enable/disable a cubemap texture (search for glEnable to locate it).

After removing these calls i also noticed a lot of errors when pausing/resuming the app. In BaseObject3D.render() there is a call to mMaterial.useProgram(); which results in an INVALID_VALUE error. I think there might be something wrong when an app is resumed such that the program is not re-created.

@MasDennis
Copy link
Member

Awesome, thanks for investigating :-) I'll try to make the changes today.

@arjansomers
Copy link
Contributor Author

Great!

Btw, for faster bug hunting i added the following class

public class Test {

    public static void checkError(StackTraceElement stackTraceElement) {
        int error;
        while ((error = GLES20.glGetError()) != GLES20.GL_NO_ERROR) {
            Log.v(stackTraceElement.getClassName()+"."+stackTraceElement.getMethodName()+":"+ stackTraceElement.getLineNumber(), "glError: " + GLU.gluErrorString(error));

        }       

    }

}

And added lots of these calls to the code:

Test.checkError(Thread.currentThread().getStackTrace()[2]);

It makes it easier to quickly locate the source of errors. Good luck finding the bugs.

@MasDennis
Copy link
Member

I'm working on this, but I'm running out of time. Will continue working on this after the weekend.

MasDennis pushed a commit that referenced this issue Jun 12, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants